This file contains 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
import math | |
import itertools | |
def length(x, y): | |
dx = x[0] - y[0] | |
dy = x[1] - y[1] | |
return math.sqrt(dx*dx + dy*dy) | |
def solve_tsp_dynamic(points): | |
#calc all lengths |
This file contains 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
(function() { | |
var ghost = 'face'; | |
function blah() {}; | |
$(function() { | |
blah(); | |
}); | |
}).call(this); |
This file contains 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
/** | |
* Monkey patch `Backbone.Model.extend()` with ES5 getters/setters for each | |
* attribute defined in the defaults. Gives you the added bonus of being | |
* to pass your backbone models directly to your Mustache.js views. | |
* | |
* Example: | |
* | |
* var User = Backbone.Model.extend({ | |
* defaults: { | |
* username: undefined, |