I hereby claim:
- I am agfor on github.
- I am agf (https://keybase.io/agf) on keybase.
- I have a public key whose fingerprint is 0648 5B84 A556 77B0 4442 6A36 74F0 4AF9 EEF6 7BB2
To claim this, I am signing this object:
#!/usr/bin/env python3 | |
import random | |
from collections import Counter, OrderedDict | |
class OrderedCounter(Counter, OrderedDict): | |
pass | |
class FakeEtcd: |
8 Spruce Street, Lake Placid, NY 12946 | |
$247,500 purchase price | |
20% down | |
$198,000 mortgage | |
30 year fixed | |
Primary Residence | |
First home purchase | |
Single family home | |
Do not need to escrow taxes and insurance, | |
but will if it is lowers interest rate. |
from collections import OrderedDict | |
from pprint import pprint | |
def greedy_reduction(weights, capacities): | |
weights = [{'weight': weight, 'used': False} for weight in sorted(weights, reverse = True)] | |
knapsacks = [{'capacity': capacity, 'load': 0, 'weights': []} for capacity in sorted(capacities, reverse = True)] | |
for knapsack in knapsacks: | |
for weight in weights: | |
if weight['used']: |
#Naive version. Takes a couple of minutes for 11 dice on my laptop | |
#from itertools import product | |
#from collections import Counter | |
# | |
#dice = int(input('How many dice? ')) | |
#result = Counter(map(sum, product(range(1, 7), repeat=dice))) | |
#print(result) | |
def choose(n, k): | |
""" |
#based on http://ubuntuforums.org/showthread.php?t=500337 | |
import alsaaudio, time, audioop | |
talks = """OCaml | |
R | |
Swift | |
PostScript | |
QML | |
Ruby |
These notes are just what struck me as worth writing down. It was a pretty standard speech of his, so some of this is the color you wouldn't necessarily get by watching a video online. | |
-- | |
He ran down the aisle shouting "dammit dammit dammit" when he arrived, which made a toddler in the back of the room yell the same. | |
He picked his feet. | |
My tea's not hot enough. It needs to be run through the machine again. The water should fall right on the tea bag if possible. |
>>> def foo(bar): | |
... if bar: | |
... def baz(): | |
... yield True | |
... return baz() | |
... else: | |
... return False | |
... | |
>>> foo(True) | |
<generator object baz at 0x100b82910> |
#!/usr/bin/env python3 | |
import sys | |
assert sys.version[0] == '3' | |
from random import choice | |
from itertools import product | |
from collections import Counter, defaultdict | |
class Settings: |
I hereby claim:
To claim this, I am signing this object:
class TransposedMatrix(object): | |
def __init__(self, matrix, index = None): | |
self.matrix = matrix | |
self.index = index | |
def __getitem__(self, index): | |
if self.index is None: | |
return TransposedMatrix(self.matrix, index) | |
return self.matrix[index][self.index] |