My Recent Pastes (74 and counting)
Pastes by Alexander Ross (74 and counting)
Below are the 15 most recent pasties by Alexander Ross.
September 22, 2006
10:11PM EDT
by Alexander Ross
View all 10 lines
a = 'plain single line string' r = r'raw single-line string' u = u'unicode single-line string' ur = ur'a raw-unicode single-line string'
September 22, 2006
4:37PM EDT
by Alexander Ross
View all 28 lines
URL: http://localhost:5000/temporal/query?site=AKN&year=2001&year=2005&month=1&day=1&month=1&day=31&hour=0¶meter=tp%28850%29&filter=&number_periods=1&period_type=year&reducing_func=mean File '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Pylons-0.9.2-py2.4.egg/pylons/error.py', line 224 in respond app_iter = self.application(environ, detect_start_response) File '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Paste-0.9.8.1-py2.4.egg/paste/httpexceptions.py', line 623 in __call__ self.send_http_response, catch=HTTPException)
September 22, 2006
4:35PM EDT
by Alexander Ross
TypeError: No object (name: G) has been registered for this thread
September 22, 2006
4:21PM EDT
by Alexander Ross
>>> keys = ['1', '2', '3']
>>> largest = {'1': ['f', [1]], '2': ['fo',[3,4]], '3':['foo',[5,6]]}
>>> largest_counts = [(len(largest[key][0]), largest[key][1]) for key in keys]
>>> largest_counts
[(1, [1]), (2, [3, 4]), (3, [5, 6])]
September 20, 2006
2:30AM EDT
by Alexander Ross
# a note on connect disconnect:
# Turn phase shouldn't really matter with regard to connect/disconnect.
# there is no competitive advantage to being able to mix
# connects/disconnects freely (none that I can see, anyway).
September 20, 2006
2:25AM EDT
by Alexander Ross
View all 10 lines
def message_waiting(meth):
"""
This decorator keeps the waiting user informed of the current players
every (valid) move.
"""
September 20, 2006
2:16AM EDT
by Alexander Ross
View all 22 lines
@public
@require_game
@require_current
def claim(self, node):
""" Claim `node`. """
September 20, 2006
2:00AM EDT
by Alexander Ross
View all 6 lines
>>> d = {"a": 2, "b": 3}
>>> def foo(a=3, b=2):
... print "a: ", a, " b: ", b
...
>>> foo(**d)
September 19, 2006
7:05PM EDT
by Alexander Ross
View all 10 lines
>>> x = 'é' >>> x '\xc3\xa9' >>> y = u'é' >>> y
September 19, 2006
6:55PM EDT
by Alexander Ross
View all 274 lines
{ scopeName = 'source.python';
firstLineMatch = '^#!/.*\bpython\b';
fileTypes = ( 'py', 'rpy', 'cpy', 'SConstruct', 'Sconstruct', 'sconstruct', 'SConscript' );
patterns = (
{ name = 'comment.line.number-sign.python';
September 17, 2006
12:16AM EDT
by Alexander Ross
{ name = 'constant.numeric.float.python';
match = '\b(?i:(\d+\.\d*|\.\d+)(e[\-\+]?\d+)?)\b';
},
September 17, 2006
12:16AM EDT
by Alexander Ross
{ name = 'constant.numeric.float.python';
match = '\b(?i:(\d+\.\d*|\.\d+)(e[\-\+]?\d+)?)';
},
September 15, 2006
6:02PM EDT
by Alexander Ross
View all 8 lines
{ name = 'meta.function.decorator.py';
begin = '^\s*@([a-zA-Z_][a-zA-Z_0-9]*)(\.\g<1>)*\(';
end = '\)';
patterns = ( { include = '$base'; } );
},
September 15, 2006
4:14PM EDT
by Alexander Ross
{ name = 'meta.function.decorator.py';
begin = '^\s*@';
end = '\)(?!\s*(?:,|\)))';
},
