I hereby claim:
- I am lernisto on github.
- I am lernisto (https://keybase.io/lernisto) on keybase.
- I have a public key ASD_COor_N2aq_jjMqnMHoj4ntlMq4W2imfQnKBsDaND4wo
To claim this, I am signing this object:
$ mongod --port 3001 --dbpath data.1 --replSet rs1 | |
Wed Nov 26 06:53:44.447 [initandlisten] MongoDB starting : pid=4991 port=3001 dbpath=data.1 64-bit host=harry | |
Wed Nov 26 06:53:44.447 [initandlisten] db version v2.4.9 | |
Wed Nov 26 06:53:44.447 [initandlisten] git version: nogitversion | |
Wed Nov 26 06:53:44.447 [initandlisten] build info: Linux orlo 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 BOOST_LIB_VERSION=1_54 | |
Wed Nov 26 06:53:44.447 [initandlisten] allocator: tcmalloc | |
Wed Nov 26 06:53:44.447 [initandlisten] options: { dbpath: "data.1", port: 3001, replSet: "rs1" } | |
Wed Nov 26 06:53:44.517 [initandlisten] journal dir=data.1/journal | |
Wed Nov 26 06:53:44.518 [initandlisten] recover : no journal files present, no recovery needed | |
Wed Nov 26 06:53:47.440 [initandlisten] preallocateIsFaster=true 32.44 |
I hereby claim:
To claim this, I am signing this object:
import re | |
from collections import defaultdict | |
def wordfreq(words): | |
freq = defaultdict(int) | |
for word in words: | |
freq[word] += 1 |
data = [43, 542, 34, 15, 23, 24, 125, 503] | |
labels = ("even", "odd") | |
buckets = [list() for x in labels] | |
n = len(buckets) | |
for d in data: | |
buckets[d % n].append(d) | |
for label, bucket in zip(labels, buckets): |
#!/usr/bin/env python3 | |
''' | |
I spent way too much time messing with timestamps. | |
A timestamp is the number of seconds elapsed since the epoch. | |
A unix timestamp uses the unix epoch, which is defined as | |
1970-01-01T00:00:00+00:00 | |
Takeaways |