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
This is a game of two players where each player rolls the dice. | |
The player gets to keep their number or risk rolling a 1 which will make their turn total equal to zero and the turn changes. | |
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
//is Unique: Implement an algorithm to determine if a //string has all unique characters. No additional | |
//data tractures | |
#include <iostream> | |
using namespace std; | |
//bruth force | |
bool isunique(string str){ | |
int checker=0; | |
for(int i=0; i<str.size(); i++){ |
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
#include <iostream> | |
using namespace std; | |
class linkedList{ | |
public: | |
struct Node{ | |
int data; | |
Node* next; | |
}; |
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
2017-03-06T00:36:21.544284+00:00 heroku[web.1]: Starting process with command `npm start` | |
2017-03-06T00:36:25.216245+00:00 app[web.1]: npm ERR! Linux 3.13.0-110-generic | |
2017-03-06T00:36:25.216843+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start" | |
2017-03-06T00:36:25.218099+00:00 app[web.1]: npm ERR! npm v3.10.10 | |
2017-03-06T00:36:25.217433+00:00 app[web.1]: npm ERR! node v6.10.0 | |
2017-03-06T00:36:25.223647+00:00 app[web.1]: | |
2017-03-06T00:36:25.227148+00:00 app[web.1]: npm ERR! missing script: start | |
2017-03-06T00:36:25.229125+00:00 app[web.1]: npm ERR! | |
2017-03-06T00:36:25.255906+00:00 app[web.1]: npm ERR! Please include the following file with any support request: | |
2017-03-06T00:36:25.229286+00:00 app[web.1]: npm ERR! If you need help, you may report this error at: |
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
#include <iostream> | |
#include <iomanip> | |
#include <stack> | |
using namespace std; | |
class Tree{ | |
public: | |
//create each node |
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 f = function(n) { | |
var f = 1; | |
for (var i = 1; i <= n; i ++) { | |
f = f*i; | |
} | |
return f; | |
} | |
console.log(f(4)) |
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
class CashAmount{ | |
constructor(amount) { | |
this.amount = amount; | |
this.pennies = this.amount * 100; | |
} | |
addDoubleAmount (newAdd) { | |
this.amount += newAdd; | |
this.pennies += newAdd*100; | |
} |
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
/** | |
* @param {number[]} nums | |
* @return {number[]} | |
*/ | |
var productExceptSelf = function(nums) { | |
//i: array | |
let output = [] | |
//need to handle division by 0 [1, 0] => [0, 1] | |
// need to handle division by -number [9,0,-2] => [0,-18,0] | |
// |
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 messageBus = { | |
subscrib: function(str, callback) { | |
// make a key in the parent object | |
if (!this[str]) { | |
this[str] = []; | |
this[str].push(callback) | |
} else { | |
this[str].push(callback) | |
} |
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
/* | |
Install mysql -> https://dev.mysql.com/doc/mysql-osx-excerpt/5.5/en/osx-installation-pkg.html | |
run the server | |
log in with 'root' user | |
log in with mysql -u root -p; | |
create a super user like (https://dev.mysql.com/doc/refman/5.5/en/adding-users.html) | |
in another termilal log in with the user info. 'sara' | |
mysql -u sara -p; | |
OlderNewer