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
wget https://s3.amazonaws.com/jamessar-pycon-2013/shortflask.tar.gz | |
wget https://s3.amazonaws.com/elasticbeanstalk/cli/AWS-ElasticBeanstalk-CLI-2.3.1.zip |
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
Was trying to optimize sequential writes (fill_sequential benchmark). Showing: | |
* Current released version | |
* performance regression with python3 support | |
* Better performance with binary file format | |
Benchmark params: | |
100,000 keys, key size 16 bytes, value size 100 bytes |
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
Time taken to insert elements into the specified data structures. | |
Left hand column is total number of elements, right hand side is total time. | |
Recall skiplist insert is O(log n) in average case, binary search insert is O(n) worst case. | |
python2.7: | |
Skiplist insert (implemented in pure python): | |
10: 0.000175 |
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 | |
# Given a local checkout of a python package | |
# in SOURCE_DIR, this script will download all | |
# of its deps (transitively) into BUNDLE_DIR. | |
import os | |
import shutil | |
import subprocess | |
BUNDLE_DIR = '/tmp/bundle' | |
# Directory of the local package (should contain a setup.py file). |
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 datetime | |
import time | |
import sys | |
import threading | |
import traceback | |
import subprocess | |
import random | |
def clear_screen(): |
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 collections import OrderedDict | |
# This will raise a RuntimeError in python3, but will work | |
# in python2. | |
regular_dict = dict(a='a', b='c') | |
for i, j in regular_dict.items(): | |
regular_dict[i + j] = j | |
# This will create an infinite loop and consume all memory |
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
function sortArray(n) { | |
var array = []; | |
for (var i = 1; i <= n; i++) { | |
array.push({key: 10, name: i.toString()}); | |
} | |
array.sort(function(a, b) { | |
return a.key - b.key; | |
}); | |
for(var j = 0; j < n; j++) { | |
process.stdout.write(array[j].name + " "); |
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 | |
"""Script to do an intial review of a PR. | |
There are many things that a core dev will look at when reviewing a pull | |
request. Many of these things will require the expertise of someone who is | |
familiar with the codebase. | |
There are also things that can be entirely automated. | |
That's the point of this script. To get all the checks that can be automated, |
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 asyncio | |
@asyncio.coroutine | |
def coro(): | |
return "foo" | |
# Writing the code without a list comp works, | |
# even with an asyncio.sleep(0.1). | |
@asyncio.coroutine |
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
$ make test | |
go test -v ./... | |
? github.com/jmespath/jmespath.go/cmd/jp [no test files] | |
=== RUN TestCompliance | |
Best: a | |
--- PASS: TestCompliance (0.02s) | |
=== RUN TestCanLexTokens | |
--- PASS: TestCanLexTokens (0.00s) | |
=== RUN TestLexingErrors | |
--- PASS: TestLexingErrors (0.00s) |
OlderNewer