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
angular.test = 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
a = 10 | |
b = 10 | |
print(a is b) | |
a = 10000000 | |
b = 10000000 | |
print(a is b) | |
def func(a): |
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
""" | |
The card game we are analyzing plays as follows: | |
1. Shuffle a deck of 52 playing cards | |
2. Player is dealt N cards into the "face down pile" | |
3. Turn over a card and place it in the "face up pile": | |
- if it is an ace, deal 4 cards from the deck to the "face down pile" | |
- if it is a king deal 3 | |
- if it is a queen deal 2 | |
- if it is a jack deal 1 |
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
-- circular buffer factory for lua | |
local function rotate_indice(i, n) | |
return ((i - 1) % n) + 1 | |
end | |
local circular_buffer = {} | |
local function circular_buffer:filled() |
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
Q = require('Q'); | |
/** | |
* Store a promise for each `group` of function calls; the existence of a | |
* promise for a given key indicates a lock on that group, and subsequent | |
* calls in that group are delayed until that promise is resolved. After the | |
* last call is complete, the lock (i.e. key) is cleared. | |
*/ | |
var groupQueues = exports._groupQueus = {}; |
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
// Extend a winston by making it expand errors when passed in as the | |
// second argument (the first argument is the log level). | |
function expandErrors(logger) { | |
var oldLogFunc = logger.log; | |
logger.log = function() { | |
var args = Array.prototype.slice.call(arguments, 0); | |
if (args.length >= 2 && args[1] instanceof Error) { | |
args[1] = args[1].stack; | |
} | |
return oldLogFunc.apply(this, args); |