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
Linguistic - disection of a sentence or command | |
[subject] = noun (always implied) | |
object = noun (person, place, or thing, i.e. "car") | |
objectAttributes = adjectives (desribes a noun, i.e. "red") | |
action = verb (action word, i.e. "drive") | |
actionAttributes = adverb (describes an action, i.e. "slowly") | |
SENTENCE = subject + action + object (i.e., [I] drive [the] red car slowly.) | |
Mapping of linguistic elements to programming objects | |
linguistic.object.objectAttributes = new Object [ i.e. new Car or new Car.color = 'red' ] |
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
/** | |
* Possible Test Requirements for Tracker App | |
*/ | |
describe("Normal play conditions", function(){ | |
it("should provide a list of clubs when requested"); | |
it("should select a club when requested"); | |
it("should ask for a moodswing after a club is selected"); | |
it("should prompt for What's next? after moodswing has been saved", function() { | |
//next_shot(); |
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
describe("Play functionality to be tested", function (){ | |
it("should start with a round", function () { | |
expect(Round).toBeDefined(); | |
}); | |
describe("Play intialization for a new round", function () { | |
var myRound = new Round(); | |
it("should start with hole 1 if hole is unspecified", function () { |
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
/*********TinyTest******** | |
* The test function will test if two returned values are exactly the same | |
* //Pass and Fail Examples | |
* test(square(3), 9) -> Pass: 9 === 9 | |
* test(square(3), 6) -> Fail: 9 expected but got 6 | |
**/ | |
function test(conditionToTest, expectedResult) { | |
var failMsg = 'Fail: ' + expectedResult + ' expected but got ' + conditionToTest, | |
passMsg = 'Pass: ' + expectedResult + ' === ' + conditionToTest, |
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
//Makes array of objects into an object sorted by a requested key | |
//--> Key must be unique or collisions will happen and data lost | |
/** (v0.0.2) Works better! | |
-- softer failures (i.e. returns empty object instead of blowing up) | |
-- use key names from on inner levels (eg. name.first) | |
**/ | |
function arrayToObject(keyToReplaceIndex, arr) { | |
var obj = {}; | |
if(arr && arr.constructor === Array) { |
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 factorial(n) { | |
var product = 1; | |
while(n > 1) { | |
product = product * n; | |
n--; | |
} | |
return product; | |
} |
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
// 'abc, ghi, def, abd1, g4hi' => 'abc, abd1, def, ghi, g4hi' | |
// Ignores non-letters in valuation but preserves them in return | |
function resortByValue(group) { | |
function __getWordVal(word) { | |
var alphaVals = { | |
a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10, k: 11, l: 12, m: 13, | |
n: 14, o: 15,p: 16, q: 17, r: 18, s: 19, t: 20, u: 21, v: 22, w: 23, x: 24, y: 25, z: 26 | |
}, | |
wordSum = 0; |
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
//Refactor of absolute path check from Express | |
module.exports = function (path){ | |
var pathIsAbsolute = false, | |
firstCharIsSlash = path[0] === '/', | |
containsWinChars = path[1] === ':' && path[2] === '\\'; | |
if(firstCharIsSlash || containsWinChars) { | |
pathIsAbsolute = true; | |
} | |
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
/*jshint strict:false */ | |
'use strict'; | |
// Create a new angular module. | |
var MessageCenterModule = angular.module('MessageCenterModule', []); | |
// Define a service to inject. | |
MessageCenterModule | |
.provider("$messageCenterService", function() { | |
var _this = this; |
OlderNewer