I hereby claim:
- I am tammoippen on github.
- I am tammoippen (https://keybase.io/tammoippen) on keybase.
- I have a public key ASBXMCFYTyAd4m_Y7w4KAuHlOVcnJTFvTPA3R89OKFEb_wo
To claim this, I am signing this object:
import numpy as np | |
def crappyhist(a, bins=50, width=140): | |
h, b = np.histogram(a, bins) | |
for i in range (0, bins): | |
print('{:12.5f} | {:{width}s} {}'.format( | |
b[i], | |
'#'*int(width*h[i]/np.amax(h)), | |
h[i], |
from collections import defaultdict | |
from functools import lru_cache | |
from typing import Dict, Iterable, List, Tuple | |
import mmh3 | |
import numpy as np | |
from slugify import slugify | |
def verify_edit_distance(s1: str, s2: str, th: int) -> bool: |
I hereby claim:
To claim this, I am signing this object:
from __future__ import division | |
from collections import Counter | |
import math | |
def idf(documents): | |
freq = Counter() | |
for doc in documents: | |
words = set(doc.split()) | |
freq.update(words) |
_roots = None | |
def roots_level_domains(): | |
global _roots | |
if _roots is not None: | |
return _roots | |
# get https://publicsuffix.org/list/effective_tld_names.dat | |
rld = [] | |
with open('effective_tld_names.dat', 'rb') as f: | |
for l in f: | |
ul = l.strip().decode('UTF-8') |
import math | |
import sys | |
import freetype | |
import plotille | |
def chunks(l, n): | |
n = max(1, n) | |
return (l[i:i+n] for i in range(0, len(l), n)) |
# execute like: python hanoi.py a b 5 | |
from time import sleep | |
DO_SLEEP = False | |
class Hanoi: | |
def __init__(self, pilon: str, height: int): | |
self.pilons = { | |
'a': [], | |
'b': [], |
SELECT | |
schemaname, | |
tablename, | |
PG_SIZE_PRETTY( | |
PG_TOTAL_RELATION_SIZE(schemaname || '.' || tablename) | |
) AS tablesize | |
FROM | |
pg_catalog.pg_tables | |
WHERE | |
schemaname NOT IN ('pg_catalog', 'information_schema') |