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
# list of books, padded with None to be 1-indexed | |
# each book is a tuple with name of book, # of chapters, [number of verses in each chapter] | |
# the list with the number of verses per chapter is padded to make it 1-indexed | |
passage_data = [None, | |
('Genesis', 50, [None, 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, | |
46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26]), | |
('Exodus', 40, [None, 22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21, | |
43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38]), | |
('Leviticus', 27, [None, 17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34]), | |
('Numbers', 36, [None, 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22, 29, 35, 41, 30, 25, 18, 65, |
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
# -*- coding: utf-8 -*- | |
"""Profiling The Evolution of the Python Programmer | |
Based on the code offered in good humor at | |
<http://metaleks.net/programming/the-evolution-of-a-python-programmer>. | |
I thought it would be fun to profile the various approaches to a | |
factorial implementation offered by Aleks. My attempt below. | |
I couldn't profile the EXPERT PROGRAMMERS or the Unix Programmer, as I |
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
In [33]: msgpack_lt, pickle_lt, marshal_lt | |
Out[33]: (0.004015207290649414, 0.039834022521972656, 0.007205963134765625) | |
In [34]: msgpack_dt, pickle_dt, marshal_dt | |
Out[34]: (0.015387773513793945, 0.04079103469848633, 0.006851911544799805) | |
In [35]: len(s_msgpack), len(s_pickle), len(s_marshal) | |
Out[35]: (16, 48, 41) |
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
*.pyc | |
bin/ | |
include/ | |
lib/ |
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
### Keybase proof | |
I hereby claim: | |
* I am eykd on github. | |
* I am eykd (https://keybase.io/eykd) on keybase. | |
* I have a public key ASCtPxBeTQqK-TZwsV225mEtCNQO1VwTa01NGBf2aS8XoAo | |
To claim this, I am signing this object: |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""nginx_error_rate -- Munin plugin to report the error rate in an access log. | |
The access log defaults to `/var/log/nginx/access.log`. This may be | |
customized with the following stanza in your munin plugin conf: | |
[nginx_error_rate] | |
env.access_log /path/to/access.log | |
""" |
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
$ echo 'hello world' >> /mnt/repo/helloworld.txt | |
$ cat /mnt/repo/helloworld.txt | |
$ echo 'hello world' >> /mnt/repo/helloworld.txt | |
$ cat /mnt/repo/helloworld.txt | |
hello world | |
$ cat /mnt/repo/helloworld.txt | |
hello world | |
$ cat /mnt/repo/helloworld.txt | |
hello world | |
$ echo 'hello world' >> /mnt/repo/test.txt |
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
.vagrant |
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 __future__ import print_function | |
foo = 'bar' | |
# This works | |
[foo for _ in range(5)] | |
# This also works: | |
class Foo: |
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
import logging | |
import random | |
logger = logging.getLogger('mylib.query') | |
def query_predicates(query, predicates): | |
matches = [] | |
qkeys = set() | |
for rkey, predicate in predicates: |
NewerOlder