Skip to content

Instantly share code, notes, and snippets.

"""
run python web.rewrite.example.py
and then open a browser to localhost:8080/data/foo/bar
The two segments of the path below /data are transformed into query
arguments using the rewrite function pathToArgs.
The root resource is wrapped with the rewrite resource
The second arg to RewriterResource is the rewrite function.
"""binary search.
Given an pre-sorted array (list), keep track of a range L (a subset of the list) in
which a sought value T would exist if it is anywhere in the list.
"""
class End(Exception):
"""can't reduce list anymore"""
class TrackList(object):
"""
@file dictstore.py
@brief Demonstration of technique for testing a class in the magnet/lcaarch
shell that requires asynchronous setup.
"""
from twisted.internet import defer
class DictStore(object):
def __init__(self, backend):
"""
Example of making many xmlrpc calls in parallel.
The original example is from Jp Calderone's blog:
http://jcalderone.livejournal.com/24285.html
"""
from twisted.internet import reactor
from twisted.internet import defer
from twisted.internet import task
@deldotdr
deldotdr / __init__.py
Created September 7, 2011 23:02
bank service example for anode
We couldn’t find that file to show.
This will be w00t
@deldotdr
deldotdr / gist:1357033
Created November 11, 2011 02:43
Example
Teh latest example!
@deldotdr
deldotdr / gist:1357036
Created November 11, 2011 02:44
Do This
This
n00b