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
/* | |
A* Pathfinding | |
*/ | |
function Path(map, start, end) { | |
// Sets | |
var open = [], | |
closed = []; | |
// Create node for start |
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
/* | |
A* Pathfinding | |
*/ | |
function Path(map, start, end) { | |
// Sets | |
var open = [], | |
closed = []; | |
// Create node for start |
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
$image = array(); | |
$image['acl'] = S3_ACL_PUBLIC; | |
$image['filename'] = '000-images/agent_photos/'.$this->logged_in_user->id.'.jpg'; | |
$image['contentType'] = image_type_to_mime_type(exif_imagetype($_FILES['photo']['tmp_name'])); | |
$image['body'] = file_get_contents($_FILES['photo']['tmp_name']); |
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 Foo() {} | |
Foo.prototype = { | |
bar: function () {}, | |
baz: function () {}, | |
fiz: function () {} | |
}; | |
function Foo() {} | |
Foo.prototype.bar = function () {}; | |
Foo.prototype.baz = function () {}; |
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
Foo.bar = function (a, b) { // ... } |
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 toIndice(vector, graph_width) { | |
return (vector.y * graph_width) + vector.x; | |
} | |
toIndice({x:4, y:2}, 10); | |
=> 24 |
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 toIndice(vec, gw) { | |
return ((vec.y) * gw + vec.x); | |
} | |
function isUnique(array) { | |
var uniques = _.uniq(array); | |
return array.length === uniques.length; | |
}; |
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 toIndice(vec, graph_width) { | |
return ((vec.y) * graph_width + vec.x); | |
} | |
function allUnique(array) { | |
var uniques = _.uniq(array); | |
return array.length === uniques.length; | |
}; |
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 Foo() { | |
var pass = true; | |
if (false) { | |
pass = false; | |
} else if (false) { | |
pass = false; | |
} else if (false) { | |
pass = false; | |
} |
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
Graph.inBounds = function (G, x) { | |
var vec = x.vector; | |
return (vec.x < G.w && vec.x >= 0 && vec.y < G.h && vec.y >= 0); | |
}; |
OlderNewer