This file contains hidden or 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
# 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). |
This file contains hidden or 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 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() |
This file contains hidden or 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
$ 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 |
This file contains hidden or 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
$ 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 |
NewerOlder