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
console.log((new Error("test") instanceof Error)); | |
var ctx = {log: function(msg){console.log(msg);}}; | |
var vm = require('vm'); | |
vm.runInNewContext('function errtest(err){log(err instanceof Error);}; errtest(new Error("test 2"));',ctx); | |
vm.runInNewContext('errtest(new Error("test 3"));',ctx); | |
// outputs: | |
// true | |
// true | |
// false - WTF ?? |
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
console.log((new Error("test") instanceof Error)); | |
var ctx = {log: function(msg){console.log(msg);}}; | |
var vm = require('vm'); | |
vm.runInNewContext('function errtest(err){log(err instanceof Error);}; errtest(new Error("test 2"));',ctx); | |
vm.runInNewContext('errtest(new Error("test 3"));',ctx); | |
// outputs: | |
// true | |
// true | |
// false - WTF ?? |
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
... | |
void SteveNode::myEmit(int argc, Handle<Value> argv[]) { | |
char emitType[256]; | |
argv[0]->ToString()->WriteAscii(emitType,0,-1); | |
if (showDebugMessages==1) printf("\nnode-steve.node - myEmit: %s", emitType); | |
HandleScope scope; | |
// ** complete this method such that the 'success' event is received in JavaScript by the registered listener ** | |
node::MakeCallback(handle_,"emit",argc,argv); | |
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 cfg = require("./config").cfg; | |
var fb = require('../node_firebird/firebird'); | |
var util = require('util'); | |
var events = require('events'); | |
var http = require('http'); | |
var con = fb.createConnection(); | |
con.connectSync(cfg.db, cfg.user, cfg.password, cfg.role); | |
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
// Load configuration for Firebird | |
var fbCfg = require("./fbConfig").cfg; | |
var fbCfgOuter = require("./fbConfig").cfgOuter; | |
var DEV_MODE = true; | |
function getCardHoldersData(uid) { | |
fbConnect(); |
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(){ | |
var | |
elementKey = '__ko_vectorObservableArray'; | |
ko.bindingHandlers.vector = { | |
init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { | |
var winRTObservableVector = ko.utils.unwrapObservable(valueAccessor()); | |
element[elementKey] = ko.observableArray(winRTObservableVector); | |
function wrappedValueAccessor() { | |
return element[elementKey]; |
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
{ | |
"basic_info": [ | |
{ | |
"description": "Initialization time", | |
"value": "332" | |
}, | |
{ | |
"description": "Sandboxed", |
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 naive(){ | |
var | |
max_a0 = process.argv[2], | |
longest = 0, | |
max_len = 0, a0,len,a; | |
for(a0=1;a0<=max_a0;a0++){ | |
a = a0; | |
len = 0; | |
while( a != 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title></title> | |
<script src="knockout-3.0.0.js"></script> | |
<script> | |
var vm = { | |
angles: [0,1,2,3,4,5,6,7,8,9,10,11].map(function(c){ | |
return "rotate("+c*360/12+" 100 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
/** | |
* Created with JetBrains WebStorm. | |
* User: Den | |
* Date: 25.01.14 | |
* Time: 23:52 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
OlderNewer