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
Traceback (most recent call last): | |
File "<console>", line 1, in <module> | |
File "/Users/ong/.virtualenvs/spatiallab/lib/python2.6/site-packages/django/db/models/query.py", line 334, in count | |
return self.query.get_count(using=self.db) | |
File "/Users/ong/.virtualenvs/spatiallab/lib/python2.6/site-packages/django/db/models/sql/query.py", line 401, in get_count | |
number = obj.get_aggregation(using=using)[None] | |
File "/Users/ong/.virtualenvs/spatiallab/lib/python2.6/site-packages/django/contrib/gis/db/models/sql/query.py", line 85, in get_aggregation | |
return super(GeoQuery, self).get_aggregation(using) | |
File "/Users/ong/.virtualenvs/spatiallab/lib/python2.6/site-packages/django/db/models/sql/query.py", line 367, in get_aggregation | |
result = query.get_compiler(using).execute_sql(SINGLE) |
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 zsh | |
for d in /Volumes/* | |
do | |
if diskutil info $d | grep -P "\bEjectable:\s+Yes" > /dev/null | |
then | |
diskutil eject $d | |
fi | |
done | |
growlnotify -m "External devices ejected." |
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
320034 function calls (302666 primitive calls) in 46.917 CPU seconds | |
Ordered by: internal time, call count | |
List reduced from 290 to 100 due to restriction <100> | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
18386/17385 39.135 0.002 39.158 0.002 threadsafe.py:42(__call__) | |
2228 4.522 0.002 11.127 0.005 geometry.py:42(__init__) | |
1 1.528 1.528 1.528 1.528 base.py:42(execute) | |
11 0.164 0.015 0.167 0.015 compiler.py:749(<lambda>) |
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 division | |
""" | |
Code Jam 2011 | |
Round1B: Problem A | |
""" | |
import sys | |
def compute(gamelist): | |
num_teams = len(gamelist) | |
opponents = [None] * num_teams |
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 sys | |
def min_time(directive): | |
"""directive -- the button pushing sequence e.g. | |
[('O',2),('B',1),('B',2),('O',4)] | |
""" | |
bot = { 'O': (0, 1), # (time, position) | |
'B': (0, 1) } | |
time = 0 | |
for b, loc in directive: |