This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
The zero_pad function taken from: | |
http://www.nineboxes.net/2009/10/an-applescript-function-to-zero-pad-integers/ | |
*) | |
on zero_pad(value, string_length) | |
set string_zeroes to "" | |
set digits_to_pad to string_length - (length of (value as string)) | |
if digits_to_pad > 0 then | |
repeat digits_to_pad times | |
set string_zeroes to string_zeroes & "0" as string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Converts an exponential (scientific) number notation to a decimal one. | |
* Uses neither GMP nor BCMath modules. | |
* | |
* @param float|int|string $value | |
* @return string | |
*/ | |
function formatExponential($value) { | |
// Both upper-case “E” and lower-case “e” would work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unicodedata import name | |
ANIMALS = ( | |
"🐶🐱🐭🐹🐰🦊🐻🐼🐻🐨🐯🦁🐮🐷🐽🐸🐵🙈🙉🙊🐒🐔🐧🐦🐤🐣🐥🦆🦅🦉🦇🐺🐗🐴🦄🐝🪱🐛🦋🐌🐞🐜🪰🪲🪳🦟🦗🕷🕸🦂🐢🐍🦎🦖🦕🐙🦑🦐🦞🦀🐡🐠🐟🐬🐳🐋🦈🦭🐊" | |
"🐅🐆🦓🦍🦧🦣🐘🦛🦏🐪🐫🦒🦘🦬🐃🐂🐄🐎🐖🐏🐑🦙🐐🦌🐕🐩🦮🐈🪶🐓🦃🦤🦚🦜🦢🦩🕊🐇🦝🦨🦡🦫🦦🦥🐁🐀🐿🦔🐾🐉🐲" | |
) | |
class Emoticons: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ANIMALS = { | |
"🐇": "🐰", | |
"🐁": "🐭", | |
"🐈": "🐱", | |
"🐕": "🐶", | |
"🐅": "🐯", | |
"🐄": "🐮", | |
"🐖": "🐷", | |
"🐒": "🐵", | |
"🐥": "🐤", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Combination do | |
def combine([]) do | |
[] | |
end | |
def combine([head | tail]) do | |
tail_combinations = combine(tail) | |
merged_combinations = Enum.map( | |
[[]] ++ tail_combinations, | |
fn c -> c ++ [head] end |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stáhněte si z https://raw.githubusercontent.com/frenzymadness/Data_analysis_workshop/master/data/Pokemon.csv. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
from contextlib import contextmanager | |
from functools import partial | |
from io import BytesIO | |
from io import StringIO | |
from os.path import join | |
from re import escape | |
from re import fullmatch | |
from shlex import quote | |
from tarfile import open as tar_open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from contextlib import contextmanager | |
from os.path import join | |
from rpmfile import open as rpm_open | |
from sys import argv | |
from zipfile import ZipFile | |
EGG_PATH = join(".", "etc", "insights-client", "rpm.egg") | |
VERSION_PATH = join("insights", "VERSION") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prevent warning caused by upgrade to Python 3.10. | |
# See https://github.com/xonsh/xonsh//issues/4409. | |
import warnings | |
warnings.filterwarnings( | |
'ignore', | |
message='There is no current event loop', | |
category=DeprecationWarning, | |
module='prompt_toolkit', | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_NOTHING = object() | |
DELETE = object() | |
class Cell: | |
def __init__(self, value=_NOTHING): | |
if value is not _NOTHING: | |
self.value = value | |
def __call__(self, value=_NOTHING): |
NewerOlder