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
// entities = { next: linkedListItem, size: numberOfItems } | |
// linkedListItem = { isDeleted: true/false, next: linkedListItem } | |
var cur = entities; | |
for (var i = 0; i < entities.size; i++) { | |
if (cur.next.value < 0) { | |
cur.next = cur.next.next; | |
// bug is that we increase i AND decrease entities.size, which | |
// causes us to approach the end of the loop from both sides | |
entities.size--; |
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 Cell(val) { | |
this.empty = false; | |
this.value = val; | |
} | |
Cell.prototype.reset = function () { | |
this.empty = true; | |
this.value = null; | |
}; | |
var grid = [] |
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(){ | |
// prevent double callbacks | |
if (sent) return; | |
var args = Array.prototype.slice.call(arguments); | |
debug('sending ack %j', args); | |
self.packet({ | |
id: id, | |
type: hasBin(args) ? parser.BINARY_ACK : parser.ACK, | |
data: args |
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
getOpportunityData: function () { | |
return getDateFilter('Opportunity') | |
.then(function(dateFilterQuery) { | |
createNewAPIQuery('Opportunity'); | |
dateFilter = ''; | |
if (apiQuery != undefined) { | |
let timestamp = parseTimestamp(apiQuery[0].timestamp); | |
dateFilter = '?filter[created_after]=' + timestamp; | |
} |
OlderNewer