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
| exports.Card = function(suit,rank) { | |
| function constructor() {}; | |
| constructor.prototype.getSuit = function() { | |
| return suit; } ; | |
| constructor.prototype.getRank = function() { | |
| return rank; } ; | |
| return new constructor(); |
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
| { | |
| "token": "6fa1b4a093968cd87c7e08f2e1dd66882136cf4d" | |
| } |
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
| function reverse(list){ | |
| var temp = []; | |
| while (list != null){ | |
| temp.push(list.head); | |
| list = list.tail; | |
| } | |
| var newList = { | |
| head: temp.shift, | |
| tail:null | |
| } |
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
| function LinkedList() { | |
| this._length = 0; | |
| this._head = null; | |
| } | |
| LinkedList.prototype = { | |
| add: function (data){ | |
| var node = { | |
| data: data, |
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
| function merge(list1, list2){ | |
| var output = new LinkedList(); | |
| while(list1 != null | list2 != null){ | |
| console.log("asdf"); | |
| if (!list2){ | |
| output.add(list1.value); | |
| list1 = list1.next; | |
| } else if (!list1){ |
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
| function arrayToBST(list){ | |
| function buildTree(list, min, max){ | |
| if (min == max){ | |
| return { | |
| value: list[max], | |
| left: null, | |
| right: null | |
| }; | |
| } |
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
| function rangeSearchBST(bst, min, max){ | |
| var list = []; | |
| function searchTree(bst, min, max){ | |
| if (bst){ | |
| searchTree(bst.left, min, max); | |
| if (min<bst.value & bst.value<max){ | |
| list.push(bst.value); | |
| } | |
| searchTree(bst.right, min, max); | |
| } |
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
| // config/auth.js | |
| // expose our config directly to our application using module.exports | |
| module.exports = { | |
| 'twitterAuth' : { | |
| 'consumerKey' : 'M815eSuEjhX0o1SZkvJlng', | |
| 'consumerSecret' : '1PSz1RkuE1vN6z6BO2AfCIFFJz6ICONnpARZi8tOyM', | |
| 'callbackURL' : 'http://localhost:3000/auth/twitter/callback' | |
| } |
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
| function BFS(node){ | |
| var list = [node]; | |
| var current = list.shift(); | |
| while(current){ | |
| console.log(current.data); | |
| var i = 1; |
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
| MM: | |
| App.request('get:photos:recent').fetch().done -> | |
| App.vent.trigger 'recentphotos:fetch:success' | |
| effects Show.Controller | |
| App.vent.on 'recentphotos:fetch:success', -> | |
| effectContainer.collection.addEffect('MosaicPhotos') |
OlderNewer