Friday, February 10, 2012

Starting the build...

Pretty much the intent is to roughly follow Bard Dring's initial ORD Bot design, but with a larger build platform.
I've been receiving packages from all over this week: MakerSlideUltiMachineMakerGearMisumiMcMasterCarSDP-SI, and a couple of eBay vendors.

Parts, parts, parts...

Wednesday, February 1, 2012

RangeError: Maximum call stack size exceeded

One difficulty in node.js occurs with the asynchronous processing of a large amount of sequential data.
For example, in Stack Overflow: Is there really a Node.js maximum execution call limit? a large amount of data is being processed through DB calls via recursive callbacks. Eventually a Maximum call stack size exceeded error is generated.
It's possible to simplify the code through modules like Step or Flow-JS, but these still use the call stack to keep things in sync.

An interesting approach that doesn't build up the call stack is to avoid recursion and use setTimeout with a timeout value of 0 to schedule the callback call. See http://metaduck.com/01-asynchronous-iteration-patterns.html.