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() { | |
this.tmpl3 = function tmpl(str, data) { | |
var value = "var out = ''; out+=" + "'" + | |
str.replace(/[\r\t\n]/g, " ") | |
.replace(/'(?=[^%]*%>)/g,"\t") | |
.split("'").join("\\'") | |
.split("\t").join("'") | |
.replace(/<%=(.+?)%>/g, "'; out += $1; out += '") | |
.split("<%").join("';") |
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
(ns neural-net.core) ; Copyright Eric Schulte, GPL V3 | |
(defprotocol Neural | |
"Protocol implemented by any element of a neural network." | |
(run [this x] "Evaluates the net") | |
(train [this x y d] "Trains the net returning the updated net and deltas") | |
(collect [this key] "Collect key from the network") | |
(inputs [this] "Number of inputs") | |
(outputs [this] "Number of outputs") | |
(check [this] "Ensure that the number of inputs matches the outputs")) |
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
Array.prototype.intersect = function(b) { | |
return this.filter(function(n) { | |
return (b.indexOf(n) != -1); | |
}); | |
} | |
Array.prototype.diff = function(a) { | |
return this.filter(function(n) { | |
return !(a.indexOf(n) > -1); | |
}); |
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 doHash(str, seed) { | |
var m = 0x5bd1e995; | |
var r = 24; | |
var h = seed ^ str.length; | |
var length = str.length; | |
var currentIndex = 0; | |
while (length >= 4) { | |
var k = UInt32(str, currentIndex); | |
NewerOlder