[nodejs] Re: Forget your promises... adopt the yielded style programming

2013-08-18 Thread Michaël Rouges
New version *1.0.7 *The generators are now extensibles*. * * * The parent generator yld() & error are unavailable, from the child generator. Each generator treats them itself. * *https://npmjs.org/package/yld -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joy

[nodejs] Re: Forget your promises... adopt the yielded style programming

2013-08-18 Thread Michaël Rouges
New major version (1.1.0) Simplified parent <-> child communication See the how-it-works-6.js& the diff https://npmjs

Re: [nodejs] Callbacks are Pretty Okay

2013-08-18 Thread Floby
javacript : doNext () function doNext () { } this works as (not for me) expected. coffescript : doNext () doNext = -> compiles to : var doNext ; doNext (); doNext = function () {} ^ this doesn't work. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joy

[nodejs] Re: Callbacks are Pretty Okay

2013-08-18 Thread Floby
Point being, there is no way to make coffeescript generate hoisted function statements. It only generates assignments with function expressions. On Saturday, 17 August 2013 07:53:26 UTC+2, Andrew Kelley wrote: > > I wrote this article as a response to all the recent callback hate: > > http://andr

[nodejs] Re: Callbacks are Pretty Okay

2013-08-18 Thread Floby
Also Ryan Dahl once outlined a single rule to avoid callback hell. 1. Set your editor column limit to 80. On Saturday, 17 August 2013 07:53:26 UTC+2, Andrew Kelley wrote: > > I wrote this article as a response to all the recent callback hate: > > http://andrewkelley.me/post/js-callback-organizati

[nodejs] C++ contributions

2013-08-18 Thread D. Charbonneau
I'm wanting to contribute to a project using what I know from C++. The problem is that I just started C++, having come from various dynamic languages, so I don't think my skill level is good enough to contribute to this project, but maybe I could work on some future module that is planned? If a

Re: [nodejs] Re: How to host a node.js app on a server

2013-08-18 Thread Dylan Hassinger
This was challenging for me too, the way I learned to do it was: - install Node and get your app running at the ip:port address - use node-http-proxy to set route your subdomain to this port - launch both the app and http-proxy using forev

[nodejs] Should undefined be allowed as type in EventEmitter.prototype.addListener = function(type,listener)

2013-08-18 Thread Henning Skoglund
Hi, I sometimes pass undefined to type when I type in the wrong actual argument. EventEmitter does'nt complain are registers the event on undefined, should it be allowed? A guard condition at the top of addListener would be helpfull to prevent these kind of mistakes. https://github.com/joyent/

Re: [nodejs] C++ contributions

2013-08-18 Thread Ben Noordhuis
On Sun, Aug 18, 2013 at 5:52 AM, D. Charbonneau wrote: > I'm wanting to contribute to a project using what I know from C++. The > problem is that I just started C++, having come from various dynamic > languages, so I don't think my skill level is good enough to contribute to > this project, but ma

Re: [nodejs] Buffer.poolSize

2013-08-18 Thread Ben Noordhuis
On Sat, Aug 17, 2013 at 9:27 PM, Laurent Fortin wrote: > Hi, > > Let's say I want to boost the SlowBuffer size like this: > > // set to 1 Mb > Buffer.poolSize = 1024 * 1024; > > Is it a good practice for boosting performance, if there is lots of memory > available? The answer to that question is

[nodejs] Re: Forget your promises... adopt the yielded style programming

2013-08-18 Thread Michaël Rouges
*Version 1.1.1* this.error becomes this.throw(), conforming with the ES6 generators -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs

[nodejs] Re: Buffer.poolSize

2013-08-18 Thread Laurent Fortin
Thanks for the reply Trevor, and congrats for all the work done on Buffer / smalloc. On Saturday, 17 August 2013 23:48:15 UTC-4, Trevor Norris wrote: > > Performance proportionally plateaus with regard to the size of the slice. > Since the average allocation is already relatively small in compa

Re: [nodejs] Buffer.poolSize

2013-08-18 Thread Laurent Fortin
Thanks for the reply Ben, that's interesting stuff. On Sunday, 18 August 2013 08:34:02 UTC-4, Ben Noordhuis wrote: > > On Sat, Aug 17, 2013 at 9:27 PM, Laurent Fortin > > wrote: > > Hi, > > > > Let's say I want to boost the SlowBuffer size like this: > > > > // set to 1 Mb > > Buffer.poolS

Re: [nodejs] Re: Callbacks are Pretty Okay

2013-08-18 Thread Mark Hahn
I know coffeescript functions don't hoist. I've been coding in nothing but coffeescript for almost three years. Hoisting *is* needed to call a definition that hasn't been encountered yet in time. But hoisting is *not* needed to call a function defined further down in the file. It's the differen

[nodejs] Quick question about npmjs.org

2013-08-18 Thread Stewart Obert
Hi, I wanted to find out with the site (npmjs.org) is there any method to retrieve a list of modules or search the modules with the result being json or xml? I appreciate any help Thanks, Stewart -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/w

Re: [nodejs] Re: Callbacks are Pretty Okay

2013-08-18 Thread Stephen Belanger
That is calling a function that is defined in an upper context. It IS defined before the call, as the body of start does not run until the last line. That is NOT hoisting, that is a result of Javascript exposing the upper context by memory reference rather copying the memory at the time of defining

Re: [nodejs] Quick question about npmjs.org

2013-08-18 Thread Ryan Macy
Use a couch interface to this -> http://couch.npmjs.org/ npm is just a iriscouch with an interface, I believe. On Sun, Aug 18, 2013 at 12:26 PM, Stewart Obert wrote: > Hi, > > I wanted to find out with the site (npmjs.org) is there any method to > retrieve a list of modules or search the module

Re: [nodejs] Re: Callbacks are Pretty Okay

2013-08-18 Thread Mark Hahn
Yes, I know it isn't hoisting. I never claimed it was. I'm just saying (over and over) that callbacks can call the functions while going downwards in the file. This is how I code everything. Here is a more detailed example. Note how readable it is when the control flows downward, just like syn

[nodejs] command-line script question

2013-08-18 Thread Mark Hahn
When I run this bash script ... #!/bin/bash tail -f log & echo "tail is working" >> log it prints out "tail is working" as expected. My question is how can I do the same thing with a node command-line script? I've tried everything but I can't come up with anything that works. Most

Re: [nodejs] Re: Callbacks are Pretty Okay

2013-08-18 Thread Nathan Rajlich
Mark, I think the point everyone is trying to make is that with regular JavaScript, this "start()" thing is *not* necessary, but with CoffeeScript it is... essentially, this "start()" mechanism is a hack for CS's lack of function hoisting. On Sun, Aug 18, 2013 at 1:36 PM, Mark Hahn wrote: > Yes

Re: [nodejs] Callbacks are Pretty Okay

2013-08-18 Thread Rick Waldron
On Sunday, August 18, 2013, Mark Hahn wrote: > I know coffeescript functions don't hoist. I've been coding in nothing > but coffeescript for almost three years. Hoisting *is* needed to call a > definition that hasn't been encountered yet in time. But hoisting is *not* > needed to call a functio

Re: [nodejs] Forget your promises... adopt the yielded style programming

2013-08-18 Thread Rick Waldron
Just a friendly heads up, there is no close method on GeneratorObject, eg. fnGenerator.close(); generator.close(); Rick On Sunday, August 18, 2013, Michaël Rouges wrote: > *Version 1.1.1* > > this.error becomes this.throw(), conforming with the ES6 generators > > -- > -- > Job Board: http://j

Re: [nodejs] Re: Callbacks are Pretty Okay

2013-08-18 Thread Brett Ritter
On Sun, Aug 18, 2013 at 1:36 PM, Mark Hahn wrote: > > Yes, I know it isn't hoisting. I never claimed it was. I'm just saying (over and over) that callbacks can call the functions while going downwards in the file. This is how I code everything. So that's the key. Coffeescript requires a certa

Re: [nodejs] command-line script question

2013-08-18 Thread // ravi
On Aug 18, 2013, at 5:52 PM, Mark Hahn wrote: > When I run this bash script ... > > #!/bin/bash > tail -f log & > echo "tail is working" >> log > > it prints out "tail is working" as expected. > > My question is how can I do the same thing with a node command-line script? > I'v

Re: [nodejs] command-line script question

2013-08-18 Thread // ravi
On Aug 18, 2013, at 7:21 PM, // ravi wrote: > On Aug 18, 2013, at 5:52 PM, Mark Hahn wrote: >> When I run this bash script ... >> >>#!/bin/bash >>tail -f log & >>echo "tail is working" >> log >> >> it prints out "tail is working" as expected. >> >> My question is how can I do th

Re: [nodejs] command-line script question

2013-08-18 Thread Nathan White
If this is indeed your test file it won't output. I think you may want to run your source through coffeescript first ;) On Aug 18, 2013, at 3:52 PM, Mark Hahn wrote: > When I run this bash script ... > > #!/bin/bash > tail -f log & > echo "tail is working" >> log > > it prints ou

Re: [nodejs] Re: Callbacks are Pretty Okay

2013-08-18 Thread Mark Hahn
I agree with everyone, although I don't think it is a hack. I'm very happy that we all understand each other now. I just wanted to put this option out there. There seemed to be a general consensus that this wasn't possible in coffeescript and I wanted to provide this counter-opinion. I do feel

Re: [nodejs] command-line script question

2013-08-18 Thread Mark Hahn
I'll try again using these ideas. It was mentioned that I'm not using a tail module. Does such a thing exist? I'm all for non-wheel-reinvention. > I think you may want to run your source through coffeescript first ;) :-) On Sun, Aug 18, 2013 at 5:28 PM, Nathan White wrote: > If this is ind

Re: [nodejs] Forget your promises... adopt the yielded style programming

2013-08-18 Thread Michaël Rouges
Hi Rick, Thank you for looking at my code, however, the spec says otherwise. http://wiki.ecmascript.org/doku.php?id=harmony:generators Michaël Le lundi 19 août 2013 00:46:46 UTC+2, Rick Waldron a écrit : > > Just a friendly heads up, there is no close method on GeneratorObject, eg. > > fnGene

Re: [nodejs] command-line script question

2013-08-18 Thread // ravi
On Aug 18, 2013, at 8:41 PM, Mark Hahn wrote: > I'll try again using these ideas. > > It was mentioned that I'm not using a tail module. Does such a thing exist? > I'm all for non-wheel-reinvention. > A quick search brought up: https://npmjs.org/package/tailnative https://npmjs.org/packag

Re: [nodejs] Quick question about npmjs.org

2013-08-18 Thread Martin Cooper
This will get you a list of package names, as a JSON array of strings: $ curl http://registry.npmjs.org/-/short and this will get you a ton of data on all packages, as a JSON object keyed by package name: $ curl http://registry.npmjs.org/-/all npm uses a variation of the second URL, adding args

Re: [nodejs] command-line script question

2013-08-18 Thread Mark Hahn
Thanks. I should have looked for these. It didn't occur to me. On Sun, Aug 18, 2013 at 6:18 PM, // ravi wrote: > On Aug 18, 2013, at 8:41 PM, Mark Hahn wrote: > > I'll try again using these ideas. > > > > It was mentioned that I'm not using a tail module. Does such a thing > exist? I'm all

Re: [nodejs] command-line script question

2013-08-18 Thread Shawn Wilson
A few thoughts: Use -F to deal with logrotate and other moves. Also try tail -F | nc (though this could get ugly). And, yeah, it's probably better to use a module. -Original Message- From: Mark Hahn To: nodejs@googlegroups.com Sent: Sun, 18 Aug 2013 23:21 Subject: Re: [nodejs] comman

[nodejs] `crypto.Hash` digest endianness

2013-08-18 Thread Alan Gutierrez
I'm implementing a collection of non-cryptographic hash algorithms for use in tables and data verity in pure-JavaScript with native counterparts. https://github.com/bigeasy/hash The hashes I've implemented so far produce keys that are a multiple of 32-bit, where each 32-bits represents a regi