Skip to content

Instantly share code, notes, and snippets.

View charlesreid1's full-sized avatar

Chaz Reid charlesreid1

View GitHub Profile
@charlesreid1
charlesreid1 / gist:6877075
Created October 7, 2013 23:52
Simplified Dijsktra's algorithm
# Simplified Dijsktra's Algorithm
# from http://code.activestate.com/recipes/119466/
def shortest_path(G, start, end):
def flatten(L): # Flatten linked list of form [0,[1,[2,[]]]]
while len(L) > 0:
yield L[0]
L = L[1]
q = [(0, start, ())] # Heap of (cost, path_head, path_rest).
@charlesreid1
charlesreid1 / gist:6877038
Last active December 24, 2015 22:59
PyEvolve Simple Program
from pyevolve import G1DBinaryString
from pyevolve import GSimpleGA
# http://pyevolve.sourceforge.net/ simple genetic algorithm example
genome = G1DBinaryString.G1DBinaryString(30)
genome.evaluator.set(lambda chromosome: sum(chromosome))
ga = GSimpleGA.GSimpleGA(genome)
ga.evolve(freq_stats=10)
print ga.bestIndividual()
@charlesreid1
charlesreid1 / gist:5753342
Created June 10, 2013 23:24
output of ```brew install -v svn```
$ brew install -v svn
==> Downloading http://www.apache.org/dyn/closer.cgi?path=subversion/subversion-1.7.10.tar.bz2
Already downloaded: /Library/Caches/Homebrew/subversion-1.7.10.tar.bz2
tar xf /Library/Caches/Homebrew/subversion-1.7.10.tar.bz2
==> ./configure --disable-debug --prefix=/usr/local/Cellar/subversion/1.7.10 --with-apr=/usr/local/Library/ENV/4.3 --with-ssl --with-zlib=/usr --with-sqlite=/usr/local/opt/sqlite --with-serf=/usr/local/opt/serf --without-neon --disable-mod-activation --disable-nls --without-apache-libexecdir --without-berkeley-db
./configure --disable-debug --prefix=/usr/local/Cellar/subversion/1.7.10 --with-apr=/usr/local/Library/ENV/4.3 --with-ssl --with-zlib=/usr --with-sqlite=/usr/local/opt/sqlite --with-serf=/usr/local/opt/serf --without-neon --disable-mod-activation --disable-nls --without-apache-libexecdir --without-berkeley-db
configure: Configuring Subversion 1.7.10
configure: creating config.nice
checking for gcc... cc
checking whether the C compiler works... yes
$ brew install -v svn
==> Downloading http://www.apache.org/dyn/closer.cgi?path=subversion/subversion-1.7.9.tar.bz2
Already downloaded: /Library/Caches/Homebrew/subversion-1.7.9.tar.bz2
tar xf /Library/Caches/Homebrew/subversion-1.7.9.tar.bz2
==> ./configure --disable-debug --prefix=/usr/local/Cellar/subversion/1.7.9 --with-apr=/usr/local/Library/ENV/4.3 --with-ssl --with-zlib=/usr --with-sqlite=/usr/local/opt/sqlite --with-serf=/usr/local/opt/serf --disable-neon-version-check --disable-mod-activation --disable-nls --without-apache-libexecdir --without-berkeley-db
./configure --disable-debug --prefix=/usr/local/Cellar/subversion/1.7.9 --with-apr=/usr/local/Library/ENV/4.3 --with-ssl --with-zlib=/usr --with-sqlite=/usr/local/opt/sqlite --with-serf=/usr/local/opt/serf --disable-neon-version-check --disable-mod-activation --disable-nls --without-apache-libexecdir --without-berkeley-db
configure: Configuring Subversion 1.7.9
configure: creating config.nice
checking for gcc... cc
checking whether the C compiler wo