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
var Node = function(value) { | |
this.value = value; | |
this.left = null; | |
this.right = null; | |
return this; | |
}; | |
Node.prototype.insert = function(newNode) { | |
if(newNode.value < this.value) { | |
if(this.left === null) { |
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
var Node = function(value) { | |
this.value = value; | |
this.next=null; | |
return this; | |
}; | |
var LinkedList = function(node){ | |
this.head = node; | |
return 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
// Helper Constructor | |
var RandomArray = function(size) { | |
size = size || 10; | |
var tempArray = []; | |
for(var count=0,max = size;count<max;count++) { | |
tempArray.push(~~(Math.random()*100)); | |
} | |
return tempArray; | |
}; |
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
var RandomArray = function(size) { | |
size = size || 10; | |
var tempArray = []; | |
for(var count=0,max = size;count<max;count++) { | |
tempArray.push(~~(Math.random()*100)); | |
} | |
return tempArray; | |
}; | |
// Check to see if the array is sorted |
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
[ | |
{ | |
"pokemonId":"446", | |
"pokemonNickname":"", | |
"trainerCountry":"US", | |
"trainerName":"Josh", | |
"trainerId":50549, | |
"level":1, | |
"isShiny":"FALSE", | |
"hasHiddenAbility":"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
/** | |
* To Execute, run: node isPrime 13 | |
* | |
*/ | |
var testNumber = process.argv[2]; | |
/** | |
* @param test - an integer between 1 and 2^16 | |
* If the number is negative, we will absolute value it. |
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
App.IndexRoute = Ember.Route.extend({ | |
model: function() { | |
var store = this.store; | |
return Ember.RSVP.hash({ | |
pokeballs: App.Pokeball.all(), | |
pokemon: store.find('pokemon'), | |
status: App.Status.all(), | |
levels: App.Levels | |
}); |
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
module.exports = function(app) { | |
var express = require('express'); | |
var postsRouter = express.Router(); | |
var posts = [], | |
count = 1; | |
postsRouter.get('/', function(req, res) { | |
res.send({ | |
'posts': posts |
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
var BST = function(arr){ | |
var length = arr.length, | |
middle = length % 2 === 0 ? length/2 : (length -1)/2; | |
this.value = arr[middle]; | |
if(length > 1) { | |
this.left = new BST(arr.slice(0, middle )); | |
this.right = new BST(arr.slice((middle + 1), 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
@@ -61,6 +61,9 @@ module.exports = React.createClass({ | |
}, | |
getInitialState() { | |
+ | |
+ let previousTransactions = localStorage.previousTransactions ? JSON.parse(localStorage.previousTransactions) : []; | |
+ | |
return { | |
// Server-Side calls will populate these |
OlderNewer