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
package main | |
import "fmt" | |
type F func(i int) int | |
func (f F) compose(inner F) F { | |
return func(i int) int { return f(inner(i)) } | |
} |
If someone forks a gist and you'd like to merge their changes. Do this:
-
clone your repo, I use the name of the gist
git clone git://gist.github.com/1163142.git gist-1163142
-
add a remote for the forked gist, I'm using the name of my fellow developer
git remote add aaron git://gist.github.com/1164196.git
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
""" | |
Author: Simon Westphahl <[email protected]> | |
Description: Brute-force implementation for solving the TSP. | |
http://en.wikipedia.org/wiki/Travelling_salesman_problem | |
""" | |
routes = [] | |
def find_paths(node, cities, path, distance): |
NewerOlder