This file contains hidden or 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 | |
""" | |
This is an example of what seems to be a garbage collection bug in Python 3.4.0 | |
that does not exist in Python 3.3.3. | |
The example uses asyncio to create a producer that multiplexes to N consumers. | |
On my Mac, with N=100, 38 consumers are incorrectly garbage collected and only execute | |
once, dropping the surviving consumer count to 62. |
This file contains hidden or 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 | |
""" | |
This works fine in Python 3.3, but causes a strange error in Python 3.4.0: | |
TypeError: send() takes 2 positional arguments but 3 were given | |
""" | |
import asyncio |
This file contains hidden or 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 | |
""" | |
The obvious way is to do it with complex numbers. | |
""" | |
def f(x): | |
# remember, in Python 1j means sqrt(-1) | |
return 1j * x |
This file contains hidden or 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
PROCESS | |
- install Raspian | |
- expand filesystem | |
- get on wifi | |
(zfec dependencies) | |
$ sudo apt-get install python-dev | |
$ curl http://python-distribute.org/distribute_setup.py | sudo python |
This file contains hidden or 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 | |
""" | |
The obvious way is to do it with complex numbers. | |
""" | |
def f(x): | |
# remember, in Python 1j means sqrt(-1) | |
return 1j * x |
This file contains hidden or 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
/*global $ */ | |
(function( $ ){ | |
$.fn.time_picker = function( method ) { | |
if ( methods[method] ) { | |
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); | |
} else if ( typeof method === 'object' || ! method ) { | |
return methods.init.apply( this, arguments ); | |
} else { |
This file contains hidden or 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 | |
import sys | |
import time | |
import csv | |
import sqlite3 | |
from google.appengine.datastore import entity_pb | |
from google.appengine.api import datastore |
NewerOlder