I hereby claim:
- I am metamatt on github.
- I am metamatt (https://keybase.io/metamatt) on keybase.
- I have a public key whose fingerprint is 6EBF C4F0 19C0 122A 168F 600E 0452 043E 5FC8 7E11
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Demo for NodeJS preemption bugs via node::MakeCallback.
Usage:
node-gyp rebuild
to compile preemptor.cc into build/Release/preemptor.nodenode demo
to run the demoFor me, the demo output is
matt@matt-dev ~/s/n/node-webkit-agent> node-gyp rebuild | |
gyp info it worked if it ends with ok | |
gyp info using [email protected] | |
gyp info using [email protected] | linux | x64 | |
child_process: customFds option is deprecated, use stdio instead. | |
gyp info spawn python | |
gyp info spawn args [ '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py', | |
gyp info spawn args 'binding.gyp', | |
gyp info spawn args '-f', | |
gyp info spawn args 'make', |
matt@matt-dev ~> ~/node-binaries/nodejs-0.10.33 | |
> e = new Error() | |
[Error] | |
> Object.getOwnPropertyDescriptor(e, 'stack') | |
{ get: [Function], | |
set: [Function], | |
enumerable: false, | |
configurable: true } | |
> e.stack | |
'Error\n at repl:1:6\n at REPLServer.self.eval (repl.js:110:21)\n at Interface.<anonymous> (repl.js:239:12)\n at Interface.emit (events.js:95:17)\n at Interface._onLine (readline.js:202:10)\n at Interface._line (readline.js:531:8)\n at Interface._ttyWrite (readline.js:760:14)\n at ReadStream.onkeypress (readline.js:99:10)\n at ReadStream.emit (events.js:98:17)\n at emitKey (readline.js:1095:12)' |
app.config(['$qProvider', function($qProvider) { | |
// Tell Angular to create Bluebird promises instead of $q promises. | |
$qProvider.$get = function() { | |
function QBird(resolver) { | |
return new Promise(resolver); | |
} | |
QBird.defer = function() { | |
var deferred = {}; | |
deferred.promise = new Promise(function(resolve, reject) { |
#! /usr/bin/env python3 | |
# | |
# Purpose: calculate the odds | |
# usage: risk_dice.py [ number of attacking armies ] [ number of defending armies ] | |
# eg: risk_dice.py 3 2 | |
# | |
# I first tried looking this up to see what others had found: https://www.google.com/search?q=risk+dice+odds | |
# The first 3 Google results have answers which disagree substantially: | |
# 1) https://www.reddit.com/r/theydidthemath/comments/2h224y/comment/ckottiv/ has an analytic approach | |
# which doesn't seem to apply the actual game rules |