Skip to content

Instantly share code, notes, and snippets.

[19:18] [sylv(+Zi)] [2:Freenode/##edef(+Sns)] [Act: 1,6,7]
[##edef]
[0] 0:irssi* 1:bitlbee- 3:bash 4:bash 5:bash 6:bash 7:bash 8:supybot "technillogue@spock: ~" 19:18 31-Jan-20
[0] 0:irssi- 1:supybot 2:bitlbee 3:bash 4:bash 5:bash 6:bash 7:spock* "technillogue@spock: ~" 19:18 31-Jan-20
@technillogue
technillogue / numbers
Created November 30, 2019 18:00
various large numbers and population counts
k = 10^3 a thousand
mil = 10^6, a thousand thousand
bil = 10^9, a thousand thousand thousand, a thousand mil (giga)
trillion = 10^12, a thousand thousand thousand thousand, a billion mil, a thousand bill (tera, great pyramid of giza is 6 tetagrams, a tetrasecond is 31.5k years. C = ~1 terameter/hour. RAM can go up to 12TB for servers)
quadrillion = 10^15, ..., peta (2018 faster computer did 143 pentaflops)
exa = google had 5-15 exabytes in 2013 according to xkcd. 2010 global internet traffic is 21 exabytes/mo
pops:
2100 world estimate: 12bil
2046 world estimate: 9bil
@technillogue
technillogue / actual_thing_i_used_in_prod.py
Last active July 27, 2019 18:03
example of stable protocols
from typing import Callable, TypeVar
from typing_extensions import Protocol
from cache import cache
X = TypeVar("X")
Y = TypeVar("Y")
Z = TypeVar("Z")
class Wrapper(Protocol):
__wrapped__: Callable
$ mypy test.py
test.py:71: error: List comprehension has incompatible type List[Callable[[List[str]], List[str]]]; expected List[Callable[[Arg(List[str], 'names')], List[str]]]
@technillogue
technillogue / parse_shifts0.py
Last active June 24, 2019 18:11
parse_shifts
import csv
from datetime import time, datetime as dt
DAY_NAMES = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
def find_shift_agents(csv_filename, search_dt):
shifts = [[] for day in DAY_NAMES]
with open(csv_filename) as f:
for name, shift_ranges in csv.reader(f):
for shift_range in shift_ranges.split(" / "):
@technillogue
technillogue / example.sql
Created June 4, 2019 14:44
example of average cost per minute of flights involving various airports
sqlite> # departure_airport, arrival_airport, cost (EUR), travel_time (minutes)
sqlite> SELECT * FROM flights;AMS|KBP|329|170
AMS|OTP|308|165
BRU|KBP|70|165
BRU|OTP|110|165
CDG|KBP|201|185
CDG|OTP|160|170
CDG|AMS|588|80
CDG|BRU|287|55
KBP|AMS|423|185
"""
This is the version my interviewer seemed to want me to write.
It uses a list of shifts using the 1900-1-1 offsets returned by strptime
"""
import csv
from datetime import datetime as dt
DAY_NAMES = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]

AngleList profile: https://angel.co/matthew-liberman

My goal is to get a full-stack or backend position from which I can transition into ML or data science, preferably somewhere relating to language, biotech, healthcare, QS, or education. I don't want to remote for my first job. I'd prefer a full Boston salary but absolutely don't mind an 30k+ internship. All of these are much less stringent for queerer workplaces. It was suggested I want a small startup building something cool with minimal bureaucracy being ideal for ADHD.

Some ideal jobs:

class Board:
def __init__(self, n=3):
self.board = [["*" for i in range(n)] for j in range(n)]
self.n = n
def move(self, player):
raw = raw_input("x,y move for player %s? " % player)
try:
x, y = map(int, raw.split(","))
cell = self.board[y][x]
from random import shuffle
class Cell:
def __init__(self, board, y, x):
self.board = board
self.y = y
self.x = x
self.mine = False