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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 fs = require('fs'); | |
var data = function(dataFile, mapFile, done) { | |
fs.readFile(dataFile, function(err, dataString) { | |
if(err) return done(err); | |
var evaluated = eval(dataString+";data"); | |
var data = evaluated.reduce(function(data, item) { | |
data[item.key] = item.val; |
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 transformAsync = function(objects, map, data) { | |
console.log('-----------------------------------'); | |
console.log('Function transformAsync is started.'); | |
var keys = Object.keys(map); | |
async.each(objects, function(object, done) { | |
console.log('------------------------------------------------------------'); | |
console.log('Processing object: %s', util.inspect(object, { depth: null })); | |
console.log('------------------------------------------------------------'); | |
async.each(keys, function(key) { | |
if(typeof map[key] === 'object') { |
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
'use strict'; | |
var util = require('util'); | |
var Combo = function (finalCallback) { | |
this.finalCallback = finalCallback; | |
this.map = {}; | |
this.counter = 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
node app.js | |
Function transformAsync is started. | |
----------------------------------- | |
Start getVal "0:0:0:1", delay 329ms | |
End getVal "0:0:0:1", delay 329ms | |
Start getVal "0:0:0:2", delay 1442ms | |
End getVal "0:0:0:2", delay 1442ms | |
Start getVal "0:0:0:3:0", delay 977ms | |
End getVal "0:0:0:3:0", delay 977ms | |
Start getVal "0:0:0:3:1", delay 478ms |
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
'use strict'; | |
var util = require('util'); | |
var randomInt = function (low, high) { | |
return Math.floor(Math.random() * (high - low) + low); | |
}; | |
var find = function (key, object, callback) { | |
object.forEach(function (element) { |
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
Function transformAsync is started. | |
----------------------------------- | |
Start getVal "0:0:0:1", delay 854ms | |
End getVal "0:0:0:1", delay 854ms | |
Start getVal "0:0:0:2", delay 483ms | |
End getVal "0:0:0:2", delay 483ms | |
Start getVal "0:0:0:3:0", delay 428ms | |
End getVal "0:0:0:3:0", delay 428ms | |
Start getVal "0:0:0:3:1", delay 1458ms | |
End getVal "0:0:0:3:1", delay 1458ms |
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
'use strict'; | |
var util = require('util'); | |
var randomInt = function (low, high) { | |
return Math.floor(Math.random() * (high - low) + low); | |
}; | |
var find = function (key, object, callback) { | |
console.log('----------------'); |
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
{ | |
"display": { | |
"mainPage": { | |
"group": [ | |
{ | |
"_ind": null, | |
"name":"0.1.2.2.0.200.0.*.0", | |
"element": [ | |
{ | |
"_ind": null, |
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
{ | |
"_internal": { | |
"id": "0:0:0:1", | |
"type": "0:0:0:2" | |
}, | |
"geo": { | |
"latitude": "0:0:0:3:0", | |
"longitude": "0:0:0:3:1" | |
}, | |
"system": { |
OlderNewer