Skip to content

Instantly share code, notes, and snippets.

View girving's full-sized avatar

Geoffrey Irving girving

View GitHub Profile
2015-11-14 22:02:14 -0800
python
-c
import setuptools, tokenize
__file__ = 'setup.py'
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
.replace('\r\n', '\n'), __file__, 'exec'))
--no-user-cfg
install
@girving
girving / diagonals
Created August 20, 2015 23:51
reachability on random diagonal graphs
#!/usr/bin/env python
from __future__ import division,print_function
from numpy import *
import scipy.sparse
import scipy.sparse.csgraph
"""
Consider approximate disjoint diagonal cycles concentric around the origin.
We can arrange that cycle C_n has radius O(n) and length O(n).
@girving
girving / gambler.py
Created November 15, 2012 16:53
Lower and upper bounds for a gambler's ruin problem
#!/usr/bin/env python
from __future__ import division
from numpy import *
def iter(n,boundary):
p = ones(n)
b = boundary.copy()
j = 3*arange(1,n)
for i in xrange(1000):