Re: [nodejs] Re: Multiple timeouts (lots of...)

2016-09-19 Thread Rick Waldron
You should hop in https://gitter.im/rwaldron/johnny-five and introduce
yourself—there's lots of people willing to help with node.js and iot
projects
On Mon, Sep 19, 2016 at 8:19 PM Alain Mouette 
wrote:

> Hi Zlatko, thanks for the detailed answer :)
>
> My client is IoT and this brings some limitations...
> First I am limited by what libs I can find on the hardware side, then
> the IoT can be switched off without proper signaling. And I need to
> control that and react on connection loss.
>
> I couldn't find any option for keepalive on either side of the
> comunication, I am using:
> IoT side: https://github.com/Links2004/arduinoWebSockets
> Node.js: https://github.com/websockets/ws
>
> We have just moved to WebSockets, I am implementing from scratch and I
> am gathering information because I don't want to go through a bad path
>
> If you or anyone, has any idea, I would be glad to hear :)
> Thanks (again),
>
> Alain Mouette
> === Projetos especiais:  ===
>
> On 19-09-2016 05:23, Zlatko wrote:
> > 5000 timers per se should not be a problem to measure nor a problem to
> > the app. It's not even a strain to the connections: it amounts to
> > approximately 83 pings per sec, which is not too much.
> >
> > But the bigger question is why do you want this? Just to keep sockets
> > alive? You can set this option in your websocket implementation of
> > choice (well, the most used ones, at least). Tell ws to do it's own
> > keepalive and you don't have to do bookkeeping.
> >
> > If it's to relay changes in some sort of state to all the clients,
> > then again - why not simply sending updates as they happen? That's
> > kind of the advantage of websockets - if you wanted timers, you could
> > simply schedule regular REST requests on the client and not mess with
> > all of this.
> >
> >
>
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/57E001D8.9060902%40bonseletrons.com.br
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfpe1ynKhmLmk9EkWpF9eewa35JFdYHZXZ-QwS%3De9Qyy4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: Node.js issue with Math.log exiting immediately

2015-09-03 Thread Rick Waldron
Math.log is defined in v8, not node, so I'd say build v8 from source on
that machine and see if it repros.
https://chromium.googlesource.com/v8/v8.git/+/master/src/math.js
On Thu, Sep 3, 2015 at 11:09 AM JF Robichaud  wrote:

> I've compiled my own version with vcbuild debug nosign x64 using the
> binary from that I get no errors and get the expected results.
>
> I initially installed Node using Chocolatey so I thought it could be
> related to my strange result, I've uninstalled that one and re-installed
> Node using the official installer but the issue remain.  For now I can use
> the debug version I've compiled, but not sure exactly what is different in
> that one.  If anyone is interested in seeing the binary or have ideas as to
> what could cause this I can provide the binary if you wish.
>
> Cheers!
>
> --
> JF
>
>
>
> On Wednesday, 2 September 2015 18:29:27 UTC-4, JF Robichaud wrote:
>>
>> Hi,
>>
>> I originally posted this issue on stackoverflow here
>>
>> 
>> After following up through comments over there I was able to discover
>> that my %errorlevel% is set to a negative value.  The only reference to
>> this I have found in reference to node was because of node segfaulting so I
>> decided to post here to perhaps get more traction.
>>
>> I was doing some work with Gulp and pushed my tasks to our Windows 2008
>> R2 server where they strangely stopped working.
>>
>> The tasks are just exiting at a certain point and return me to prompt.
>> Everything is working fine on my Windows 7 dev machine and on one Windows
>> 2008 R2 server, so far the issue is only occuring on our development
>> Windows 2008 R2 server
>>
>> Through isolation, I was able to narrow it down to the module Pretty
>> bytes  which uses Math.log
>> in its calculation. I tried to use Math.log directly from node and I get
>> the same result on that one server. It looks like Math.log is broken,
>> however other Math functions work just fine.
>>
>> Reproduction steps below:
>>
>> Details:
>>
>> 2 different Windows 2008 R2 running in a VM (if that's important)
>> node v0.12.7
>>
>> //nodemathtest.js
>> console.log(process.versions);
>> console.log("before");
>> console.log(Math.floor(2.2));
>> console.log(Math.log(10));
>> console.log("after");
>>
>> Running
>> node mathlogtest.js
>>
>> On one my machine and on one Windows 2008 R2 server I get the expected
>> result:
>>
>> C:\>node mathlogtest.js
>> { http_parser: '2.3',
>>   node: '0.12.7',
>>   v8: '3.28.71.19',
>>   uv: '1.6.1',
>>   zlib: '1.2.8',
>>   modules: '14',
>>   openssl: '1.0.1p' }
>> before
>> 2
>> 2.302585092994046
>> after
>>
>>
>> On our development Windows server where the Gulp tasks are exiting
>> prematurely I get this:
>>
>> C:\>node mathlogtest.js
>> { http_parser: '2.3',
>>   node: '0.12.7',
>>   v8: '3.28.71.19',
>>   uv: '1.6.1',
>>   zlib: '1.2.8',
>>   modules: '14',
>>   openssl: '1.0.1p' }
>> before
>> 2
>>
>> C:\>
>>
>> I can see that Math.log is causing Node to exit immediately back to
>> prompt which is also what's happening from Gulp, I get kicked back to my
>> prompt and the task is interrupted.
>>
>> After this running echo %ERRORLEVEL% returns -1073741795 on the faulty
>> server, 0 where it's successful.
>>
>> I'm not exactly sure where to look as I'm fairly new to Node.  From my
>> understanding Node is using Chrome's V8 JS engine and `process.version` is
>> returning exactly the same on each server.  I've tried to install .NET
>> 4.5.1 and various C++ redistributable package to no avail.
>>
>>
>> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/7e1054a9-b9d6-473f-b141-ce5ab4b6c73b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop 

Re: [nodejs] json parse output problem . SyntaxError: Unexpected token o

2015-01-21 Thread Rick Waldron
On Wed Jan 21 2015 at 2:42:55 PM Roelof Wobben rwob...@hotmail.com wrote:

 Hello,

 I have this :

 ~~~

 var user = {
   username: 'The Reddest',
   email: 'bran...@switchonthecode.com',
   firstName: 'Brandon',
   lastName: 'Cannaday'
 };
 JSON.parse(user, function (k, v) {
 console.log(k);
 return v;
 })

 ~~~

 but when I do node test.js to run the file I see this output :

 ~~~


 undefined:1

 [object Object]

  ^

 SyntaxError: Unexpected token o

 at Object.parse (native)

 ~~~

 Can somone tell me what is the right way to parse and see the output of a
 json file.


In the code above, there is an object, not JSON. JSON is the serialized
(string/text) representation of a subset of JavaScript data. That data
 can be a string, number, array, object, null, true, or false

```
$ node
 JSON.parse('a')
'a'
 JSON.parse('1')
1
 JSON.parse('[]')
[]
 JSON.parse('{}')
{}
 JSON.parse('null')
null
 JSON.parse('true')
true
 JSON.parse('false')
false
```


When you store JSON in a file, like so:

// a.json
{
  name: Rick,
  age: 33
}

... It must be valid, per the grammar rules of JSON, note the strings are
all double quoted, but the number is not.

// a.js
var fs = require(fs);
fs.readFile(a.json, utf8, function(err, json) {
  // turn the valid json text back into an object.
  var object = JSON.parse(json);
  console.log(object);

  console.log(typeof json);
  console.log(typeof object);
});


$ node a.js
{ name: 'Rick', age: 33 }
string
object




Rick




-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfrPRb1K45ooU6cfjn8_cotNDH4tPQTRro%3Dm5nNhCWewcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Data Model Definition Standard in JavaScript/Node

2015-01-06 Thread Rick Waldron
This has nothing to do with Node. The disparity in patterns you're seeing
is in language experience. bean1.js and bean3.js are just explicitly
doing what bean2.js does for implicitly: allocate an instance object.
bean4.js is not a comparable pattern to 1, 2 and 3 in the initialization
sense: it's an instance of the built-in Object whose properties are being
used to expose multiple exports, whereas 1, 2, 3 use a function to export
a single function object export.

Rick

On Tue Jan 06 2015 at 7:23:11 PM Prabhash Rathore prabhashrath...@gmail.com
wrote:

 I recently started programming in JavaScript (Server side) and Node.js. I
 come from Java background where there is a concrete standard on how you
 define Data Object, which is Java Bean. Do we have any such standards in
 JavaScript/Node on how we define Data Objects (similar to Java Beans)?

 I have researched at many places and couldn't find any standards. I have
 seen following styles but not sure which is better or recommended:

 //bean1.js
 module.exports = function() {var obj = {};
 obj.name = '';
 obj.department = '';
 return obj;
 }
 //bean2.js
 module.exports = function() {
 this.name = '';this.department = '';
 return this;
 }
 //bean3.js
 module.exports = function(param) {var obj = {};
 if(param === undefined) {return obj;}

 obj.name = param.name;
 obj.department = param.department;
 return obj;
 }
 //bean4.js
 module.exports = {
 name : '';
 department : '';}

  --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 To post to this group, send email to nodejs@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/85a3bdc4-83af-4c8a-979d-5d527eee8695%40googlegroups.com
 https://groups.google.com/d/msgid/nodejs/85a3bdc4-83af-4c8a-979d-5d527eee8695%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfqiTZ5MCoavQ6Ybj2iA%3DkoC-WQoGugrZJpp%2BmJ6ewvZ4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] worry.... of ES6 and Node errors

2014-09-16 Thread Rick Waldron
On Tuesday, September 16, 2014, Ep Ga epg...@gmail.com wrote:

 Rick, copy and paste in Firefox--the ones who are most involve in the spec
 direction--:

 function r(){
  var i = 0, a = [0,9,8,7,6,5,4,3,2,1];
  return (function (){return a.pop();});
  }

 var rr = r();

 function y(){
  let i = 0, a = [0,9,8,7,6,5,4,3,2,1];
  while(a){
  yield (a.pop());
  }
 }


Firefox implemented `yield` in normal functions during ES4 prototyping era.
It's non-standard, it's wrong and it's not part of ES6. I'm losing patience
for this discussion.



 let yy = y();

 function* g(){
  let i = 0, a = [0,9,8,7,6,5,4,3,2,1];
  while(a){
  yield (a.pop());
  }
 }


Why would you _ever_ do this? `a` will always evaluate truthy. Writing an
intentionally broken program is not a valid argument against anything.


 let gg = g();

 console.log(return:  + rr() +   + rr() +   + rr() +   + rr() +  
 + rr() +   + rr() +   + rr() +   + rr() +   + rr() +   + rr() + 
  + rr()  + \n +
   yield:  + yy.next() +   + yy.next() +   + yy.next() +   +
 yy.next() +   + yy.next() +   + yy.next() +   + yy.next() +   +
 yy.next() +   + yy.next() +   + yy.next() +   + yy.next() + \n +
   function*:  + JSON.stringify([gg.next(), gg.next(), gg.next(),
 gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(),
 gg.next(), gg.next()]));

 /*
 return: 1 2 3 4 5 6 7 8 9 0 undefined
 yield: 1 2 3 4 5 6 7 8 9 0 undefined
 function*:
 [{value:1,done:false},{value:2,done:false},{value:3,done:false},{value:4,done:false},{value:5,done:false},{value:6,done:false},{value:7,done:false},{value:8,done:false},{value:9,done:false},{value:0,done:false},{done:false}]
 */


Clearly you don't understand the history of iterator and generator design,
but read this and please move on:
https://github.com/rwaldron/tc39-notes/blob/master/es6/2013-03/mar-12.md

(Look for StopIteration)

Rick



 --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:;.
 To post to this group, send email to nodejs@googlegroups.com
 javascript:;.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/cfb22331-3b40-424e-a6d9-a85d765db51c%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfqsNYJ%3DwA7BmrV4P7278CBkG%2B8zuFxWa-Wy%2BE0jv%3DafKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: worry.... of ES6 and Node errors

2014-09-15 Thread Rick Waldron
On Mon, Sep 15, 2014 at 12:48 AM, Ep Ga epg...@gmail.com wrote:

 I'm mostly looking forward to what I consider the extension of ES5, ES5+:

 let
 yield --with out the 'function*'--


That's not a thing that is possible or going to change.



 And a couple of other addition.

 I am to use native module to build my app, no external module...

 With these add on for the language, this might make this easier... But no
 sense on waiting... You'll think by this time 'let' would be useable by now.


The current implementation in v8, behind the --harmony flag is several
years old and long obsolete.

Rick

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfonkVFiSh%3D%3D5uuA_4%2B_bgMXTaMe4eA4K2bo%2ByHM-B6qiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: Cluster

2014-09-15 Thread Rick Waldron
On Mon, Sep 15, 2014 at 1:39 PM, Ep Ga epg...@gmail.com wrote:

 What is your thoughts about node team including a proxy module? For local
 use case.


Are you referring to ES6 Proxy? If yes, then Node.js will have Proxy when
V8 has Proxy. The current Proxy, available behind the --harmony flag is an
early prototype that is no longer spec correct.

Rick

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfqMJuvi4f_fjkUSEU_-HrEsHC-9hx7FsOQxociLVYtnAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] worry.... of ES6 and Node errors

2014-09-15 Thread Rick Waldron
On Monday, September 15, 2014, Ep Ga epg...@gmail.com wrote:

 Rick Waldron

 I'm speaking of this:

 function foo(x){
 While(x){
 yield x.pop();
 }
 }


This is not valid in ES6, you cannot have a yield inside a plain function.
(There is also a typo: While)





 var bar = Foo([foo,bar,baz]);


 for(;bar;) console.log(bar.next())://baz, bar, foo, undefined


 I welcome this, the ES5+ spec welcome this!

 But not this:

 function* foo(x){
 While(x){
 yield x.pop();
 }
 }

 var bar = Foo([foo,bar,baz]);

 for(;bar;) console.log(bar.next())://{value: baz, done:false}{value: bar,
 done:false}{value: foo, done:false}{value: undefined, done:false} the done
 property will never be true consider that the while loop will not continue
 after coming across a false condition. And or the yield sign consider the
 pop() method being active on an undefined array.

 Returning an object that will need to be parse.


Just because you're mis-understanding how generator logic works and
you're writing intentionally wrong examples doesn't mean the feature is
broken or incorrect. If you had actually bothered to write the examples
above correctly, with the correct for-of usage, you'd see it works just
fine:

function* gen(x){
  // Don't intentionally check a value that will always be true,
  // that's not new or special to generators.
  while(x.length) {
yield x.pop();
  }
}

for (var item of gen([foo,bar,baz])) {
  console.log(item);
}

baz
bar
foo



Rick

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfromXXhQy%2BMOoBhsni5xUAf7OgidtHFJcBWtF-fD0ypyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] worry.... of ES6 and Node errors

2014-09-14 Thread Rick Waldron
On Friday, September 12, 2014, Ep Ga epg...@gmail.com wrote:

 I just... I just find it more easier to understand ES5 than Es6... A few
 of there new addition I can see of use, but for most I'm cloudy on... I
 just want to be able to always use ES5 with addition to it as ES+... I like
 the callback hell, and node have module that can be use to break it down
 into an saner view.

 I'm ES5+ Just won't some comfort knowing that i can use it's style
 instead of this new syntax style


As I've told you several times, on several threads, over several mailing
lists: you may use whatever parts of the language you feel comfortable
with—no one will force you to use anything.



 Generators, why do they have *? Couldn't the yield sign defined a behavior
 of the function to a generator behavior?


Because yield is not a reserved word and making it so would break code in
existing functions that may use that word as an identifier. function* is a
new syntactic boundary that eliminates this hazard. This is well documented.


 And even understand or better yet compwthending the act of generator is
 not clear to me

 And why couldn't they be a key word instead of adding a funny syntax to
 it? Like Geneator(); and generator();


For the same reason as above.



 for both constructor and statment?

 And promise???

 I just Anyone care to give a feedback?


There exists ample discussion and publications covering the use cases and
history of generators and promises in both JavaScript and other languages.

Rick




 --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:;.
 To post to this group, send email to nodejs@googlegroups.com
 javascript:;.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/10e28c5d-2f28-4cfa-b46a-47d8b5a97993%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfoh5knVKPxS3gdvZp-NYGY5AXTLepzK8pceewSwFJSRoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: worry.... of ES6 and Node errors

2014-09-14 Thread Rick Waldron
On Sat, Sep 13, 2014 at 9:46 AM, Bruno Jouhier bjouh...@gmail.com wrote:

 Generators have a * because it is sometimes desirable to be able to create
 a generator that does not yield. Consider the following:


That's not why function * exists. The new syntactic form exists as a
means of creating a safe way to introduce `yield` as a special special form
keyword; currently `yield` is a valid identifier in any global or function
code. Take a look at the following:

  function foo() {
var yield = 1;
return yield;
  }

That's completely valid in non-strict code:
http://jsfiddle.net/rwaldron/16hg19cd/ If ES6 decided to risk the path that
SpiderMonkey took for JS1.7/1.8 then any code that used the word `yield` as
an identifier would suddenly stop working as intended. Providing a new
syntactic boundary prevents that from happening: no code can possibly exist
of this form or within this form, therefore nothing can be broken by its
addition. A second reason is that function * provides a syntactic
mechanism to clearly denote that this function declaration or expression is
in fact defining a generator.

Rick





 function* genIntegers() { var i = 0; while (true) yield i++; }
 function* genNothing() { }

 function doSomethingWithGenerator(g) { ... }
 function foobar(really) { doSomethingWithGenerator(really ? genIntegers()
 : genNothing()); }

 Bruno

 On Saturday, September 13, 2014 4:08:42 AM UTC+2, Ep Ga wrote:

 I just... I just find it more easier to understand ES5 than Es6... A few
 of there new addition I can see of use, but for most I'm cloudy on... I
 just want to be able to always use ES5 with addition to it as ES+... I like
 the callback hell, and node have module that can be use to break it down
 into an saner view.

 I'm ES5+ Just won't some comfort knowing that i can use it's style
 instead of this new syntax style

 Generators, why do they have *? Couldn't the yield sign defined a
 behavior of the function to a generator behavior? And even understand or
 better yet compwthending the act of generator is not clear to me

 And why couldn't they be a key word instead of adding a funny syntax to
 it? Like Geneator(); and generator(); for both constructor and statment?

 And promise???

 I just Anyone care to give a feedback?

  --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 To post to this group, send email to nodejs@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/e1ca9baa-b50d-43eb-b73a-4e49cecb145d%40googlegroups.com
 https://groups.google.com/d/msgid/nodejs/e1ca9baa-b50d-43eb-b73a-4e49cecb145d%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfpAsvy%2BV0mmwkhxpRWk8Fys1LZsxHzgZNWXae6iWPL%3D0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: worry.... of ES6 and Node errors

2014-09-11 Thread Rick Waldron
On Wed, Sep 10, 2014 at 9:43 PM, Ep Ga epg...@gmail.com wrote:

 I'm more so speaking on syntax style... are we going to have to be force
 to use the enw syntax style or will there be a choice in the programming
 style we prefer?

 like callback function and so on.

  dark days ahead I see... dark days...



You can write whatever code style you want to write.

Rick

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfpX6TGB4ajmOOweo-WLhQSgRR6%3D2E_KjGXq9wUwDQ242g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] worry.... of ES6 and Node errors

2014-09-10 Thread Rick Waldron
On Tuesday, September 9, 2014, Ep Ga epg...@gmail.com wrote:

  Are you going to force user to use ES6? A lot of dislike ES6 and are for
 ES5+; staying complaint with our code style and syntax as ES5, with the
 addition of new feature such as let and const, +. Which does not change the
 syntax but just add on new statement and operand.

 Are you going to force user to use new feature of ES6 or are you just
 going to make them available to be use in node, and node, not changing the
 code module where we will be force to use ES6 feature.

 Like I said, a lot of us disprove of some... most the majority of the new
 features in ES6, and are only looking forward to those that does not change
 the language, but add on... i.e.: ES5+


V8 will implement new language features and they will appear in Node as
they become stable.


 Also, do you have documentation of all errors that could take place in the
 node environment?

There are no breaking changes in ES6, so there will be no errors when using
new language features.

Rick


   --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com
 javascript:_e(%7B%7D,'cvml','nodejs%2bunsubscr...@googlegroups.com');.
 To post to this group, send email to nodejs@googlegroups.com
 javascript:_e(%7B%7D,'cvml','nodejs@googlegroups.com');.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/bf8a0e1d-6128-4f84-9d2c-773b2b6cf5ee%40googlegroups.com
 https://groups.google.com/d/msgid/nodejs/bf8a0e1d-6128-4f84-9d2c-773b2b6cf5ee%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfrHyngFXHAbZAic6L%3DGm90%2Bz83qvQ2wWOmP-S_pMQ5zJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: Does `node --harmony` works stable on all platforms?

2014-08-17 Thread Rick Waldron
Coincidentally:
https://github.com/facebook/regenerator/pull/109#issuecomment-52431845


On Sun, Aug 17, 2014 at 4:51 PM, Rick Waldron waldron.r...@gmail.com
wrote:




 On Sun, Aug 17, 2014 at 4:20 AM, Mario Vejlupek ma...@vejlupek.cz wrote:

 Hi Rick,

 to clarify you anwser a bit, yes you are right, generators in existing
 implementations are incomplete, as it is draft
 http://wiki.ecmascript.org/doku.php?id=harmony:generators


 This is just a strawman, the latest specification draft is maintained
 online here: https://people.mozilla.org/~jorendorff/es6-draft.html



 it's even suprising that they are in any stable envirnonment(talking
 about Firefox).


 It's not very surprising, the spec is still in development, will be frozen
 Dec 2014, but won't be officially published until June 2015.


 But what in my opinion, is now importat that they are usable in node as
 coroutine solution to callback hell.


 As long as you're ok with a potentially moving target, then yes.



 If you have any notes on how current implementation would change in near
 future please let me know.


 Yes, I recorded the resolutions, which could not possibly be implemented
 yet:
 https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-07/jul-29.md#short-discussion-about-making-generatorreturn-throw-a-special-exception


 Rick



-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfpjkYS1sC8WgWvmg2xg6Xs_yudr4i1A0UvhXwTCmK9%3DZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: Does `node --harmony` works stable on all platforms?

2014-08-17 Thread Rick Waldron
On Sun, Aug 17, 2014 at 4:20 AM, Mario Vejlupek ma...@vejlupek.cz wrote:

 Hi Rick,

 to clarify you anwser a bit, yes you are right, generators in existing
 implementations are incomplete, as it is draft
 http://wiki.ecmascript.org/doku.php?id=harmony:generators


This is just a strawman, the latest specification draft is maintained
online here: https://people.mozilla.org/~jorendorff/es6-draft.html



 it's even suprising that they are in any stable envirnonment(talking about
 Firefox).


It's not very surprising, the spec is still in development, will be frozen
Dec 2014, but won't be officially published until June 2015.


 But what in my opinion, is now importat that they are usable in node as
 coroutine solution to callback hell.


As long as you're ok with a potentially moving target, then yes.



 If you have any notes on how current implementation would change in near
 future please let me know.


Yes, I recorded the resolutions, which could not possibly be implemented
yet:
https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-07/jul-29.md#short-discussion-about-making-generatorreturn-throw-a-special-exception


Rick

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfo4BUUdz%3DZqRCe02KWB07UuC%3D_FaGRuogqDuHNn%3D715Yw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: Does `node --harmony` works stable on all platforms?

2014-08-16 Thread Rick Waldron
On Sat, Aug 16, 2014 at 4:13 AM, Mario Vejlupek ma...@vejlupek.cz wrote:

 Hi,

 - yes in general all nodejs functionaly works on all supported platforms
 - no it might, but not in near future as upcomming nodejs 0.12 and current
 Firefox has it already implemented


Both are incomplete implementations.

Rick



 Checkout http://koajs.com/ it aims to replace Express by using generator
 functions and avoiding callback hell

 Mario

 Dne čtvrtek, 14. srpna 2014 22:25:02 UTC+2 Alexey Petrushin napsal(a):

 Want to try generators `node --harmony` but worried a little about:

 - if it works on all platforms?
 - does the API stable and won't be changed in future?

  --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 To post to this group, send email to nodejs@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/96e3d152-bcd6-4e8b-948d-f4416af2470b%40googlegroups.com
 https://groups.google.com/d/msgid/nodejs/96e3d152-bcd6-4e8b-948d-f4416af2470b%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfoPyx2w%3Dn3xTTNpAqKHyhh5GUSHZGAr9qWi9x7kSyNnaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Whats @ used for?

2014-05-19 Thread Rick Waldron
Nothing as of yet, but there are proposals for ES7 to use it as a private
property prefix:


function Foo() {
  this.@privy = true;
  this._privy = false
}

var foo = new Foo();

foo;

{ _privy: false } -- no access to @privy property


Rick




On Mon, May 19, 2014 at 4:09 AM, Kevin Ingwersen
ingwie2...@googlemail.comwrote:

 Hey.

 Short question; what is the @ operator used for in JS?
 in PHP, its the „silence errors“ operator.

 Kind regards, Ingwie.


 --
 Yo Dawg, I heard you like C++, so I  added C++ to your build system, so
 you have to compile before you compile.“ -StackOverflow, Matt Joiner (
 http://stackoverflow.com/a/5025525/2423150 )

  --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 To post to this group, send email to nodejs@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/CA2C2220-BD0E-49FB-B027-746D3D74CA87%40googlemail.comhttps://groups.google.com/d/msgid/nodejs/CA2C2220-BD0E-49FB-B027-746D3D74CA87%40googlemail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfpm6JvNuEQA2wOmCtXJ7Bnq_Z4n%2BTyqRpcnzbvVZLAmmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Whats @ used for?

2014-05-19 Thread Rick Waldron
On Mon, May 19, 2014 at 4:16 PM, Mariano Pardo marianom...@gmail.comwrote:

 In ES6 proposal, you can use @ for annotations.


Presumably you're referring to this:
https://github.com/google/traceur-compiler/wiki/LanguageFeatures#annotations-experimentalNote
that this feature has no official strawman.

A great example is the DI from angular 2 (
 https://www.npmjs.org/package/ng-annotate).


These are just comment-based annotations.

Rick



 Mariano


 On Mon, May 19, 2014 at 12:46 PM, Rick Waldron waldron.r...@gmail.comwrote:

 Nothing as of yet, but there are proposals for ES7 to use it as a private
 property prefix:


 function Foo() {
   this.@privy = true;
   this._privy = false
 }

 var foo = new Foo();

 foo;

 { _privy: false } -- no access to @privy property


 Rick




 On Mon, May 19, 2014 at 4:09 AM, Kevin Ingwersen 
 ingwie2...@googlemail.com wrote:

 Hey.

 Short question; what is the @ operator used for in JS?
  in PHP, its the „silence errors“ operator.

 Kind regards, Ingwie.


 --
 Yo Dawg, I heard you like C++, so I  added C++ to your build system, so
 you have to compile before you compile.“ -StackOverflow, Matt Joiner (
 http://stackoverflow.com/a/5025525/2423150 )

  --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscr...@googlegroups.com.
 To post to this group, send email to nodejs@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/CA2C2220-BD0E-49FB-B027-746D3D74CA87%40googlemail.comhttps://groups.google.com/d/msgid/nodejs/CA2C2220-BD0E-49FB-B027-746D3D74CA87%40googlemail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 To post to this group, send email to nodejs@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/CAHfnhfpm6JvNuEQA2wOmCtXJ7Bnq_Z4n%2BTyqRpcnzbvVZLAmmg%40mail.gmail.comhttps://groups.google.com/d/msgid/nodejs/CAHfnhfpm6JvNuEQA2wOmCtXJ7Bnq_Z4n%2BTyqRpcnzbvVZLAmmg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


  --
 Job board: http://jobs.nodejs.org/
 New group rules:
 https://gist.github.com/othiym23/9886289#file-moderation-policy-md
 Old group rules:
 https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 To post to this group, send email to nodejs@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nodejs/CACgk%2BLyXB5AkL_QiAjm0JR951bRZ7K6e%3DZsJAVkTSnNAGVoskw%40mail.gmail.comhttps://groups.google.com/d/msgid/nodejs/CACgk%2BLyXB5AkL_QiAjm0JR951bRZ7K6e%3DZsJAVkTSnNAGVoskw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAHfnhfpo-Hm_vuW9EDXoABtY0Hbsu76RxZZ2eRpFBmLg1QNQfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] changes to the moderation of this group

2014-05-03 Thread Rick Waldron
+1, * applause*


Rick

On Saturday, May 3, 2014, Forrest Norvell othiy...@gmail.com wrote:

 Hello, everyone. If you don't know me, I'm a longtime Node.js developer
 and member of this group. I'm also a strong believer that this group hasn't
 been living up to its potential for a while now, and in an effort to
 improve its usefulness and the quality of the discussion here, I've agreed
 to take on the responsibility of moderating it.

 For now, that implies one big change, which is that every message to the
 group will be reviewed by an actual person before being posted to the
 group. The moderation policy is pretty simple (it's included below), and
 things shouldn't change much. My current plan is to continue this policy
 until the end of July and then revisit how people feel about the state of
 the list. (As an aside, if you're interested in helping me moderate the
 list, get in touch off-list and we can talk. With conference season
 starting to heat up again, I'm likely to be away from the internet a few
 times between now and the end of July, and having someone to help me cover
 moderation duties would be great.)

 If your message gets rejected, you may not get a whole lot of feedback as
 to why it didn't get passed through. I apologize for this, but Google
 Groups's interface for rejecting messages is kind of terrible and doesn't
 allow me to easily include a personalized message.

 As part of more actively moderating the group, I'm also open to your
 suggestions on what we can do to shape this into a more useful forum. If
 you go to the gist where I put the draft of the moderation 
 policyhttps://gist.github.com/othiym23/9886289,
 you can see that there are already a couple suggestions. Feedback on those
 suggestions is welcome, as is feedback on the moderation policy itself. My
 main goal here is to improve the tenor of discussion here to the point that
 it's a comfortable place for both newcomers and experienced Node
 developers. One of Node's greatest strengths is its community, and I'd love
 to see this group become a more significant clearinghouse for the community
 as a whole.

 Here's the moderation policy itself:

 The Node.js group is a tool to announce cool things you've built, discuss
 interesting projects you're working on, and get help with things that are
 confusing you. It is a great forum for swapping knowledge. It is part of
 Node's large, loose network of resources. But it's not the only one – there
 are other resources that might be a better place to seek help or ask
 questions:

- Stack Overflow http://stackoverflow.com/questions/tagged/node.js is
a great place to get help with specific technical questions about Node! If
you post a question there, please wait a few days before crossposting it to
the list, as many of the people who answer questions about Node on SO are
also here. Also, crosspost with a link rather than the whole text of the
question, to keep things tidy and to keep discussion of the issue in one
place.
- The development of Node itself is largely handled through Github. If
you think you've encountered a bug in Node itself, it's best to file
an issue https://github.com/joyent/node/issues/new there.
- Likewise, the development of npm is handled by the npm team, also on
Github https://github.com/npm/npm, and npm bugs should be filed 
 therehttps://github.com/npm/npm/issues/new
.
- For a more conversational approach to figuring things out, #node.js
and #libuv on freenode IRC http://webchat.freenode.net/ are great
realtime resources for help with Node.

 That said, here are the rules governing the list:

1. No personal attacks or harassment. This group is governed by the
Conference Code of Conduct http://confcodeofconduct.com/, and
violating its rules will get you barred from the list permanently, at the
moderators' discretion.
2. No spam. Self-promotion is fine, and major updates of projects to
which you've contributed merit a mention, but this is a technical forum,
not a marketplace.
3. Large chunks of source will work much better if posted to a
requirebin http://requirebin.com/, jsbin http://jsbin.com/, 
 gisthttps://gist.github.com/,
or generic pastebin of some kind.

 In addition, there are some more informal guidelines that, if followed,
 will make everyone's lives more pleasant:

- There are certain arguments that recur with monotonous regularity.
Bikeshedding is a major part of hacker culture, but there is no one true
solution to any of the problems that are regularly brought up on the list
(promises vs callbacks vs coroutines vs generators vs CPS transforms vs ∞,
JavaScript vs CoffeeScript, etc). What works best for you may not work well
for somebody else.
- Not everybody comes to Node with the same background. One of Node's
touted advantages is that it unifies server-side and front-end developers.
Sometimes people need a 

Re: [nodejs] How to implement getUserMedia Server-side?

2014-04-13 Thread Rick Waldron
Take a look at https://github.com/peterbraden/node-opencv


Rick


On Sun, Apr 13, 2014 at 1:52 PM, Jim Carroll jimcarrol...@gmail.com wrote:

 Hi, Roger.

 Any updates on the headless browser APIs? I am trying to implement a
 webcam streaming server using node.js and WebRTC, but it seems like there
 aren't any implementations of getUserMedia() for server-side node apps. I
 haven't had a lot of time to look through node-webkit, but I will be soon.
 In the meantime, could you tell me if a getUserMedia()-like API is in the
 works?

 Kind regards,

 Jim

 On Sunday, February 3, 2013 7:59:07 PM UTC-5, Roger Wang wrote:

 j...@peepo.com writes:

  is there a way to implement getUserMedia server side?
 
  I guess this query could relate to a broader range of activities** that
  normally take place in a browser...

 In node-webkit we have plan to bridge the internals of Node.js and
 WebKit so 'getUserMedia' will expose a stream interface to Node.js. And
 we'll also make it headless so it could run better on the server side.

  **apologies if this seems kooky, but I have a use case...

 Could you please give more information on your use case?

 --
 Roger WANG Intel Open Source Technology Center

 https://github.com/rogerwang/node-webkit
 node-webkit https://github.com/rogerwang/node-webkitnode-webkit: Call
 all Node.js modules directly from DOM and enable
 a new way of writing applications with all Web technologies.

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Re: Anyone have any idea how to send data from server directly to Arduino board

2014-03-21 Thread Rick Waldron
On Fri, Mar 21, 2014 at 4:31 AM, greelgorke greelgo...@gmail.com wrote:

 you know https://github.com/rwaldron/johnny-five ?


*nods*

Let me know if you have any questions :)

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Need help with module.exports!!!

2014-03-06 Thread Rick Waldron
Below...


On Thu, Mar 6, 2014 at 4:50 PM, Bob Spero bobsp...@gmail.com wrote:

 I am using node oracle to* connection.execute(SELECT alot of stuff FROM
 inventory)*. So I took all my original sql files and I put them in a
 folder. Now I want to use node to read the file contents and do * 
 connection.execute(function(inventory.sql))
 *where in the sql file is my select. Some of the queries have three table
 joins so it make the code look messy and it just seems more organize. Below
 is what I have so far but I just can not get it working! Thanks


 fs = require('fs');
 var select_statement = ;
 var sql_file = function(value) {
 fs.readFile('./SQLs/inventory.sql', 'utf8', function(err, data) {
 if (err) {
 return console.log(err);
 };
 return data.toString();
 });
 //return value //+ select_statement;
 };
 module.exports.select_statement = select_statement;
 module.exports.sql_file = sql_file;



fs.readFile is async, so you need to send along a callback to handle the
results of the read:


var fs = require('fs');
var sql_file = function(value, callback) {
  fs.readFile('./SQLs/inventory.sql', 'utf8', function(err, data) {
if (err) {
  return console.log(err);
};
callback(data.toString());
  });
};
module.exports.sql_file = sql_file;



Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: What do we call ourselves? Nodesters?

2014-03-04 Thread Rick Waldron
Strange how Node is categorized along with programming languages.


On Tue, Mar 4, 2014 at 3:55 AM, Floby florent.j...@gmail.com wrote:

 Nodles

 On Thursday, 27 February 2014 19:53:45 UTC+1, CoolAJ86 wrote:

 Is it 'noders' as in 'coders' or 'nodesters' as in 'drinking http before
 it was cool'? What are we?

 I'm trying to come up with a canonical list of how we generally refer to
 the communities

 Ex:
 Ruby = Rubyists
 Python = Pythonistas
 Cocoa = Cocoa Heads
 Go = Go Nuts
 Node = Nodesters (?)
 PHP = PHPers (?)
 Programmer = Brogrammatic Ninja Throwing Rockstar Badassians (?)

 AJ ONeal

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: What do we call ourselves? Nodesters?

2014-03-04 Thread Rick Waldron
On Tue, Mar 4, 2014 at 2:07 PM, Tim Caswell t...@creationix.com wrote:




 On Tue, Mar 4, 2014 at 10:51 AM, Rick Waldron waldron.r...@gmail.comwrote:

 Strange how Node is categorized along with programming languages.


 https://medium.com/cool-code-pal/cf72b588b1b


I can't stop staring at the massive image of Dan Heberden...

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] node vs dart

2014-03-01 Thread Rick Waldron
On Saturday, March 1, 2014, Pat Monardo patmona...@gmail.com wrote:


 Struggling to understand these two technologies and I do enjoy both very
 much.
 My question is, do these guys compete? Is dart on the server going to be
 'node-like' ?
 I admit I have been studying Angular more than Dart which is why I am
 interested by the talk recently (for me) of Dart on the server.



 Thanks!


Generally speaking, Node.js is a platform for writing servers and services
in JavaScript. Angular is a framework for writing web applications in
JavaScript. Dart is a programming language that can be compiled to
JavaScript. Dart purports to, but never will, replace JavaScript in the
browser. Dart on the server is a much smarter strategy for an emerging
language and platform.

Learn them all, there is no reason no to.


 Rick



  --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e(%7B%7D,'cvml','nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.comjavascript:_e(%7B%7D,'cvml','nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to 
 nodejs+unsubscr...@googlegroups.comjavascript:_e(%7B%7D,'cvml','nodejs%2bunsubscr...@googlegroups.com');
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] v0.12 Release

2014-02-23 Thread Rick Waldron
On Sun, Feb 23, 2014 at 9:34 PM, Stephen Belanger cyruzdr...@gmail.comwrote:

 Yes. New V8 versions break a bunch of stuff. There's the nan project

What is the nan project?

Rick


 to deal with that at the moment, and there was some effort to abstract V8
 API so native module writers have a more consistent target--not sure what
 the plan is with that presently.
  On 23 Feb 2014 16:10, Matt hel...@gmail.com wrote:

 Fedor: For those of us with compiled modules, do we have to make
 significant changes to work on 0.12? I noticed a few things don't compile.


 On Sun, Feb 23, 2014 at 5:23 PM, Fedor Indutny fe...@indutny.com wrote:

 Hello guys!

 Sorry for not responding early, I have pretty long backlog in my inbox.
 While
 I'm not the leader of node.js project (TJ Fontaine is), I could perhaps
 shed
 some light on the current state of things.

 I think we are almost done with update to v8 3.24 and I'm quite sure
 that we
 will stick to it in the v0.12 release, but in case of any trouble we
 could
 always easily revert it back to the current version. All API changes
 that has
 happened since 3.22 are very minor and are mostly about argument order
 or stuff
 like that.

 Regarding, overall status: we are working hard on getting v0.11
 feature-set
 freezed. I think only a couple of things left before that would be
 possible.
 After that, there will be (hopefully) short period of stabilization
 (read: bug
 fixes) and a v0.12 release.

 At the time, I prefer not to set any deadlines or give rough estimates,
 because
 they are not the thing that we are caring most at the time. The main and
 the
 most serious stuff that we are interested is a stability, stability in
 both
 API (and feature-set) and core code.

 Finishing this message, I'd like to ask you to give a try to latest v0.11
 releases, as it is the best thing that we all could do to get v0.12
 released
 as soon as possible!

 Cheers,
 Fedor.

 On Mon, Feb 24, 2014 at 2:14 AM, Jason Hill jamesjasonh...@gmail.com
 wrote:
  I know that list but after reading the one that suggests v8 update, I
 felt
  like we are no where close to 0.12..
 
  There are many people use 0.11 already for some time with the current
  version of v8. I just don't understand the such big changes right
 before the
  release.
 
  Indeed v8 3.24 solves couple of problems and brings some features and
  performance update (1-4% ?) but how about the problems ?
 
  I'm not into arguing v8 decision (not my expertise). I'm just really
 looking
  for a clarification for the items left.
 
  Thanks
 
 
 
 
  On Sunday, February 23, 2014 3:56:02 PM UTC+1, Peter Rust wrote:
 
   What is left for 0.12 release (apart from bug fixes). ?
 
  Looks like there are 34 open issues slated for the 0.12 milestone:
  https://github.com/joyent/node/issues?milestone=17state=open
 
  -- peter
 
  --
  --
  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 group.
  To post to this group, send email to nodejs@googlegroups.com
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 
  ---
  You received this message because you are subscribed to the Google
 Groups
  nodejs group.
  To unsubscribe from this group and stop receiving emails from it, send
 an
  email to nodejs+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to 

Re: [nodejs] Re: [ES6] Dependency injection via Proxy ?

2014-02-02 Thread Rick Waldron
On Sun, Feb 2, 2014 at 5:18 PM, Luca Morandini lmorand...@ieee.org wrote:

 On 03/02/14 09:16, Luca Morandini wrote:


 Does it differ significantly from
 http://wiki.ecmascript.org/doku.php?id=harmony:proxies ?


 Oops, the correct link is:
 http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies


Note the text at the top. I've added this text to all pages that should be
avoided once the feature appears in spec draft.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Callback functions prefixed with __

2014-01-29 Thread Rick Waldron
On Tue, Jan 28, 2014 at 8:39 PM, Alex Kocharin a...@kocharin.ru wrote:


 It's the same deal as with hungarian notation. Terrible idea.


*applause*



Rick


 Your function name should already describe what this variable contains.
 There is no need to duplicate this information with underscores. Name it
 on_save or save_cb instead. Even save will do fine in small functions.

 This code will be read by humans, not computers. So there is no need to
 invent a notation just for the sake of it. Computers don't need it, and
 humans should get this info from the name/context anyway.


 26.01.2014, 18:24, Filipe Deschamps fili...@gmail.com:

 Guys, what do you think to prefix all callback functions with double
 underscores? (or any other pattern that makes more sense to identify a
 callback)

 For example:

   model.save(data, *__save*);

   function *__save*(err, return) {
 ...
   }

 I'm node/javascript newbie, but using a prefix for callback names is
 making a huge different to scan the code (including using find features).

 Are you guys using some name convention approach for callbacks? Or is this
 just a newbie problem?

 Best regards,

 Filipe Deschamps


 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Re[2]: [nodejs] JavaScripts spec.

2014-01-23 Thread Rick Waldron
On Thu, Jan 23, 2014 at 2:42 PM, Michael Monashev softsea...@gmail.comwrote:

 Hi, Rick.

  This is the ES5.1 spec, in one page: http://es5.github.io/ (non-pdf).

 I am looking for specification with examples like this:
 http://www.tutorialspoint.com/javascript/javascript_arrays_object.htm


The best and closest to what you want is
https://developer.mozilla.org/en-US/docs/Web/JavaScript


Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] JavaScripts spec.

2014-01-22 Thread Rick Waldron
This is the ES5.1 spec, in one page: http://es5.github.io/ (non-pdf).


Rick


On Wed, Jan 22, 2014 at 3:03 AM, Michael Monashev softsea...@gmail.comwrote:

 Hi.

 Where can I find complete all in one page JavaScript specification for
 Node.JS?


 --
  Michael  mailto:softsea...@gmail.com

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] nodejs serial?

2014-01-06 Thread Rick Waldron
On Mon, Jan 6, 2014 at 3:29 PM, Mark Hahn m...@reevuit.com wrote:

 Is there any node module to give access to a serial port on windows that
 does not require compiling an extension?


What is the problem with using extensions that have native bindings that
must be compiled when they are installed?

It's not hard to search npm and find this:
https://github.com/technicalmachine/node-jssc, which makes me think you
just wanted to post here in order to have a go with the following comment...



 The author of node-serialport has this weird idea that you can't offer a
 c++ extension unless the user compiles it himself.


The author is several people that work _very_ hard to maintain a
non-trivial extension—have some respect.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] nodejs serial?

2014-01-06 Thread Rick Waldron
On Mon, Jan 6, 2014 at 4:15 PM, Mark Hahn m...@reevuit.com wrote:

  What is the problem with using extensions that have native bindings
 that must be compiled when they are installed?

 The instructions directed me to install visual studio which led me to
 believe that I had to compile from source.


No, this is to make the necessary compiler available on your machine, no
different from `sudo apt-get install build-essential` on linux or
installing xcode or xcode command line tools.


 In other npm installs the compile just happened when I did npm install.  I
 now realize that even though I need visual stdio and python 2.7 installed
 the process is just npm install after all.


Correct.



 I was not trolling.  I really do need serialport.  I meant no disrespect.
  I apologize for the tone.


Understandable and appreciated. Good luck with whatever you're creating

Rick






 On Mon, Jan 6, 2014 at 1:08 PM, Rick Waldron waldron.r...@gmail.comwrote:




 On Mon, Jan 6, 2014 at 3:29 PM, Mark Hahn m...@reevuit.com wrote:

 Is there any node module to give access to a serial port on windows that
 does not require compiling an extension?


 What is the problem with using extensions that have native bindings that
 must be compiled when they are installed?

 It's not hard to search npm and find this:
 https://github.com/technicalmachine/node-jssc, which makes me think you
 just wanted to post here in order to have a go with the following comment...



 The author of node-serialport has this weird idea that you can't offer a
 c++ extension unless the user compiles it himself.


 The author is several people that work _very_ hard to maintain a
 non-trivial extension—have some respect.

 Rick

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Node 0.12 and harmony flag

2014-01-01 Thread Rick Waldron
On Sat, Dec 21, 2013 at 10:48 PM, Alessandro Artoni arto...@gmail.comwrote:

 Guys, just my humble opinion... I don't think node APIs will directly make
 use of generator (or promises) in a near future, since they will break
 almost everything.
 What, to me, is more important is to understand weather developer can
 reasonably hope to have support for these features in the platform or not,
 so that new higher-level APIs and framework could be built on top of it.
 For what I understand, after quite a lot of research, v8 will more likely
 NOT enabled harmony features without flag until the standard is finalized.
 That being, according to people on es-discuss, something around end of Q1
 for a RC version, end of the year for the final Ecmascript 6 publication
 Thanks everybody for helping!


Sorry so late, but I can confirm this is correct.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[nodejs] Node 0.12 and harmony flag

2013-12-21 Thread Rick Waldron
On Sat, Dec 21, 2013 at 1:57 PM, q2dg2b
q2d...@gmail.comjavascript:_e({}, 'cvml', 'q2d...@gmail.com');
 wrote:

 I think the question most important about this topic it is:* will Node.js
 substitute callback by generators in 1.0?*


I don't think you understand generators—they don't replace or
substitute callbacks. They are an addition to your developer toolkit.


 If it will, it will be a completely different language and platform.


The language is still JavaScript, it's just evolving.


 Sincerely, I would like to know if generators will be the next great
 thing, since they  are another way of thinking very different from
 callbacks (in fact, Node.js wouldn't be the same Node.js we know)

 You can see a movement in this direction inside Express team, who has
 launched Koa, for instance...


...Evolution.


Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] (Malware/Adware???) Suspicious code in jQuery npm package...

2013-12-19 Thread Rick Waldron
Please file a bug for this http://bugs.jquery.com and probably with
https://github.com/tautologistics/node-htmlparser

Thanks

Rick


On Thu, Dec 19, 2013 at 7:13 PM, Stephen Carnam steveor...@gmail.comwrote:

 Noob to nodejs (but not to JavaScript). Today I needed jQuery
 functionality in a nodewebkit app I'm writing and so I ran npm install
 jquery. However, I noticed the following show up in Netbeans as it tracks
 remote dependencies being referenced now that jQuery is present; these are
 curiously named:

 show_ads.js
 urchin.js

 And appear to be coming from a testdata\trackerchecker.html page, in a
 folder along with a bunch of hidden .tmp files in the jQuery node_modules
 dependency, htmlparser version 1.7.6 (the current version is 2.0.0).
 However, this testdata doesn't appear in the current version or archive
 in github. Further examination is showing that this page is some sort of
 torrent checker software. What the heck does this have to do with jQuery
 and does anyone know if it's legit (suspect as it's not in the author's
 github version)?

 Is this just a poorly chosen testing document, or does piratebits and
 pi sexy have any relevance here?

 Screenshot attached...


 https://lh6.googleusercontent.com/-r6EdHz9Ujho/UrOKyuN8UCI/AO0/Leypy8i59vk/s1600/npm.jpg


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] [ANN] Suspend v0.4.0

2013-12-13 Thread Rick Waldron
*applause*


On Fri, Dec 13, 2013 at 12:03 PM, jmar777 jmar...@gmail.com wrote:

 Hey All!

 I just wanted to announce that I've pushed out the v0.4.0 release of
 suspend!

 https://github.com/jmar777/suspend

 This is a major update that involved a complete rewrite (and some
 substantial beefing up of the test suite).

 There's a lot that's new in there, but here are some highlights:

- The `resume` parameter is gone, so suspend never has to mess with
your arguments.
- Stupid simple parallel execution! (well, concurrent execution, if
you want to be a jerk about it...)
- Better error handling.
- Some new API methods that better support various async scenarios.
- Lots of new tests.
- Beefed up the documentation with more examples and explanations.
- Friendlier error messages for common foot-gun situations.

 For those who aren't familiar with it, suspend provides callback-free
 control flow for Node using ES6 generators.  It's designed to play nice
 with Node's error-first callback conventions as well as promises.

 For example, using suspend you can write code like this:

 var copyFile = suspend.async(function*(from, to) {
 var data = yield fs.readFile(from, resume());
 yield fs.writeFile(to, data, resume());
 });

 ...instead of like this:

 var copyFile = function(from, to, cb) {
 fs.readFile(from, function(err, data) {
 if (err) {
 return cb(err);
 }
 fs.writeFile(to, data, function(err) {
 if (err) {
 return cb(err);
 }
 cb();
 });
 });
 };

 One last thing: a huge thanks to Gorgi Kosev (Spion), who graciously
 provided a great deal of feedback for the API redesign.

 Thanks for reading, and as always any feedback is greatly appreciated!

 https://github.com/jmar777/suspend

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Node 0.12 and harmony flag

2013-12-12 Thread Rick Waldron
On Thu, Dec 12, 2013 at 2:04 PM, Timothy J Fontaine tjfonta...@gmail.comwrote:

 though quite evil, it's also possible to turn features on at runtime
 https://npmjs.org/package/setflags


Three of the flags that are listed in the readme are for obsolete proto
implementations:

--harmony_modules
--harmony_proxies
--harmony_typeof

The first two are just out of date (by more than a year), but the third is
completely removed from ES6. Seems bad to offer a module that promotes
using junk that will only result in broken code when it gets removed.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] node.js needs a new home

2013-12-10 Thread Rick Waldron
On Monday, December 9, 2013, Forrest L Norvell wrote:

 On Mon, Dec 9, 2013 at 11:04 AM, Rick Waldron 
 waldron.r...@gmail.comjavascript:_e({}, 'cvml', 'waldron.r...@gmail.com');
  wrote:

 On Monday, December 9, 2013, Isaac Schlueter wrote:

  Meanwhile, also looking as an outsider, I *don't* see the consensus
  forming around either Joyent's control is fine or a non-profit would
  be better.  The views on this from main contributors seem to be all
  over the map.

 The problem is that this mailing list is used by roughly 1% or less of
 the Node community, and only a few major contributors have even bothered
 to weigh in on this thread.


 I've had a message in my drafts for 3 days, wherein I request the closing
 of this group/mailing list on the grounds that non-technical discussion has
 polluted the waters to the point of uninhabitable toxicity.


 Rick,

 I'm glad you brought this up here, because I've seen you tweeting about it
 and it bums me out. I agree that the vibe on this group is not what it
 could be, but one of the most persistent problems I see in the Node
 community is that we're pretty poor at communicating with ourselves
 asynchronously (oh, irony).

 I would rather see this mailing list improve, and also work on extending
 its reach into more of the community (which requires that people believe
 that the list is actually valuable / welcoming). Resources like
 https://github.com/mikeal/node-meatspace and
 https://github.com/knode/meetups are valuable, but only deal with a small
 piece of this. What would it take to make this into a resource that doesn't
 irritate you or bum *you* out?


FWIW, I also prefer improvement over abandonment. I'm on vacation, so I'll
get back to you on the rest at a later time—thanks for understanding.

Rick


 Also, to get back to the original topic (although I made my opinion on
 this stuff pretty clear already), I more or less agree with Bradley's
 typology of how open-source projects typically interact with foundations
 over time. Maybe at some point it makes sense for Node to move under the
 umbrella of something like the Conservancy (although – no offense intended
 towards those who have contributed and gotten value from the ASF – the idea
 of Apache Node.sf does not make me happy), and maybe that time is sooner
 than a lot of us comfortable with the status quo might recognize. That
 said, I still believe that Joyent has been a responsible steward for those
 aspects of Node it has responsibility over and duties to maintain. A lot of
 the speculation and might-bes people are going over here feel premature to
 me. (And yeah, I'm friends with a substantial number of Joyent's staff, but
 that's because I like them and think they're doing good work – my
 livelihood comes from New Relic and non-Joyent projects alone.)

 F

 --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Ben Noordhuis's Departure

2013-12-10 Thread Rick Waldron
On Monday, December 9, 2013, Joshua Holbrook wrote:

 I hate you all.


3




 --Josh





 On Mon, Dec 9, 2013 at 2:56 PM, Mikeal Rogers mikeal.rog...@gmail.comwrote:


 On Dec 9, 2013, at 12:38PM, Ben Noordhuis i...@bnoordhuis.nl wrote:

 On the contrary, it's 100% accurate.  The reason I stepped down is not
 because of the Twitter brouhaha, I was unmoved by that.  It's because
 I feel I can no longer trust Isaac to do the right thing and that
 makes working together impossible.


 Bert was fine with the change, Bert force pushed out your commit, do you
 share the same distrust of Bert?

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] node.js needs a new home

2013-12-10 Thread Rick Waldron
On Tuesday, December 10, 2013, Mark Hahn wrote:

  GH is suppose to have a new feature soon that should let us kill the
 mailing list

 You aren't referring to google hangouts are you?  I and many others refuse
 to join google+ or facebook.  I'm not going to deal with all that social
 crap.


(G)it(H)ub





 On Tue, Dec 10, 2013 at 12:03 PM, Mikeal Rogers 
 mikeal.rog...@gmail.comjavascript:_e({}, 'cvml', 
 'mikeal.rog...@gmail.com');
  wrote:

 GH is suppose to have a new feature soon that should let us kill the
 mailing list while maintaining a forum for the positive (and without doubt
 some of the negative) uses of the mailing list. I've got no love for Google
 Groups.

 On Dec 10, 2013, at 11:48AM, Rick Waldron 
 waldron.r...@gmail.comjavascript:_e({}, 'cvml', 
 'waldron.r...@gmail.com');
 wrote:

 FWIW, I also prefer improvement over abandonment. I'm on vacation, so
 I'll get back to you on the rest at a later time—thanks for understanding.


  --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 
 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] node.js needs a new home

2013-12-09 Thread Rick Waldron
On Monday, December 9, 2013, Isaac Schlueter wrote:

  Meanwhile, also looking as an outsider, I *don't* see the consensus
  forming around either Joyent's control is fine or a non-profit would
  be better.  The views on this from main contributors seem to be all
  over the map.

 The problem is that this mailing list is used by roughly 1% or less of the
 Node community, and only a few major contributors have even bothered to
 weigh in on this thread.


I've had a message in my drafts for 3 days, wherein I request the closing
of this group/mailing list on the grounds that non-technical discussion has
polluted the waters to the point of uninhabitable toxicity.

Rick



The vast majority of users clearly don't care one way or another.  The
 majority of current active contributors don't care, or think the status quo
 is preferable.



 On Mon, Dec 9, 2013 at 7:50 AM, Bradley M. Kuhn 
 bk...@ebb.orgjavascript:_e({}, 'cvml', 'bk...@ebb.org');
  wrote:

 // ravi wrote at 12:24 (EST) on Sunday:
  rather than speak in the abstract, why not consider the actual
  proposals made that I was referring to

 Part of my point in this thread has been that Node.js community need not
 narrow its options for an organizational home down to just one or two
 choices immediately.

  I differ, perhaps, in my inability to see a problem in the
  arrangement, as it exists today

 As I also pointed out in my original post, how the question came up is
 not necessarily relevant to considering the question of where Node.js
 wants its organizational home.  I also pointed out that status quo has a
 strong power in situations like this.

 Both the upsides and the downsides of having an Open Source and Free
 Software project housed in a single for-profit entity are pretty
 apparent.  If the upsides outweigh the downsides for this community,
 then you should stick with it.

 --
-- bkuhn

 --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 
 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Ben Noordhuis's Departure

2013-12-04 Thread Rick Waldron
On Wed, Dec 4, 2013 at 2:16 PM, Alex Kocharin a...@kocharin.ru wrote:



  The issue in that in opensource it's customary to base all commits on
 technical reasons.


Apparently you don't use underscore...


Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] how to create a singleton

2013-11-27 Thread Rick Waldron
On Wednesday, November 27, 2013, Ryan Schmidt wrote:


 On Nov 26, 2013, at 23:50, dhtml wrote:

  On Thursday, November 21, 2013 7:13:48 AM UTC-8, Gregg Caines wrote:
 
  So how do you achieve the same effect in javascript?  In the browser,
 you have globals.
 
  The global object has nothing to do with web browsers.

 Sure it does. In browsers you can reference a global easily from any file.
 In node, each file gets its own namespace, so you can’t.


This is simply not true. By default, module code has access to the `global`
object reference, which allows:

// module.js
global.foo = 1;


// program.js
require(./module.js);

console.log(foo); // 1


There is no implicit global environment bindings created for top level var
declarations or function declarations because the source body of module
code is wrapped in an IIFE:
https://github.com/joyent/node/blob/master/src/node.js#L1007-L1014. Which
is not the same as a unique namespace and certainly not the same as
having a fresh realm-like global object.

Rick





-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] how to create a singleton

2013-11-27 Thread Rick Waldron
On Wednesday, November 27, 2013, Michael J. Ryan wrote:

   of course you could just as easy have done...



Sure, if I was trying to illustrate something that wasn't the thing I was
trying to illustrate. Or if I wanted to confuse my point with something
questionably relevant.

Rick


   //foo module ...
   var foo = {...}
   module.exports = foo;

   //app.js
   var foo = require(‘foo’)

 all require(‘foo’) with the same library reference will be the same...


 the only thing global does is allow multiple versions of libraries not to
 stomp on eachother...

   //bar module – first to register wins
   module.exports = global.__bar__ = global.__bar__ || initModule();

   function initModule() {
 return {\*...some object...*\};
   }
   ...

 which can also be valuable


  *From:* Rick Waldron javascript:_e({}, 'cvml',
 'waldron.r...@gmail.com');
 *Sent:* Wednesday, November 27, 2013 11:36 AM
 *To:* nodejs@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs@googlegroups.com');
 *Subject:* Re: [nodejs] how to create a singleton



 On Wednesday, November 27, 2013, Ryan Schmidt wrote:


 On Nov 26, 2013, at 23:50, dhtml wrote:

  On Thursday, November 21, 2013 7:13:48 AM UTC-8, Gregg Caines wrote:
 
  So how do you achieve the same effect in javascript?  In the browser,
 you have globals.
 
  The global object has nothing to do with web browsers.

 Sure it does. In browsers you can reference a global easily from any
 file. In node, each file gets its own namespace, so you can’t.


 This is simply not true. By default, module code has access to the
 `global` object reference, which allows:

 // module.js
 global.foo = 1;


 // program.js
 require(./module.js);

 console.log(foo); // 1


 There is no implicit global environment bindings created for top level var
 declarations or function declarations because the source body of module
 code is wrapped in an IIFE:
 https://github.com/joyent/node/blob/master/src/node.js#L1007-L1014. Which
 is not the same as a unique namespace and certainly not the same as
 having a fresh realm-like global object.

 Rick



 --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.

 --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: how to create a singleton

2013-11-21 Thread Rick Waldron
I recommend being wary of any broad generalizations about programming
patterns :P

Rick


On Thu, Nov 21, 2013 at 7:13 AM, Gregg Caines cai...@gmail.com wrote:

 The singleton pattern is actually unnecessary in most languages outside of
 java, including javascript.  You should be wary of any javascript book that
 tries to teach you singletons at all.  Many of those gang of four patterns
 simply don't translate outside of java and c++ (eg if you want to implement
 command, strategy, or factory patterns, you should really first check out
 javascript's first class functions.).

 So how do you achieve the same effect in javascript?  In the browser, you
 have globals.  If you want just one instance of a thing, create it, and set
 it to a global variable.  You can use that global variable everywhere.  (If
 you're thinking but global variables are bad!, I mostly agree.  This is
 one of the reasons that the singleton itself is actually considered an
 anti-pattern by many.

 In node, the module system is a global namespace that can maintain state,
 so that's the appropriate way to achieve the same effect.  I do this in
 node applications all the time.  For example, if I have a module for
 emailing with a send() method on it, I don't have it export a constructor;
 I have it export an object.  That object might maintain some state or it
 might not.  When the module is subsequently require()'d, it will have any
 state that it has accumulated since.

 All of this is a bit hairy because we're talking about global state (which
 is the main impetus for singletons, when you get right down to it).
 Whatever you decide to do though, keep in mind that writing idiomatic code
 in any language means using the features of that language, and not
 translating java/C++ idioms into it.  It will be an extremely rare
 javascripter that will want to work on your code if you've got singletons
 in it.

 G




 On Monday, November 18, 2013 3:38:09 PM UTC-8, Reza Razavipour wrote:

 A newbie question...

 I have an app that connects and reuses the same connection to a remote
 database and a connection to a remote soap server.
 I want to implement a singleton pattern for each of these. I am used to
 doing that in C++ and Java but want to know what the standard
 implementation for a Singleton pattern is in node.js.

 Any recommendations or references.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: module.export

2013-11-11 Thread Rick Waldron
On Mon, Nov 11, 2013 at 3:01 PM, greelgorke greelgo...@gmail.com wrote:

 it's not a scope issue. not really. ideally you define your functions and
 other stuf in module body and then just reference them in module.exports
 object,


How is that not scope? That's definitively scope.


Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: dumb question about asynchronous function execution

2013-11-08 Thread Rick Waldron
On Fri, Nov 8, 2013 at 3:57 PM, Ilya Shaisultanov 
ilya.shaisulta...@gmail.com wrote:

 Pardon for resurrecting such old thread but I have a question about
 process.nextTick: why/how does it eliminate the current stack? What happens
 behind the scenes?


It doesn't eliminate the current stack. The callback is scheduled and
subsequently executed in the next execution turn.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: dumb question about asynchronous function execution

2013-11-08 Thread Rick Waldron
On Fri, Nov 8, 2013 at 5:29 PM, Ilya Shaisultanov 
ilya.shaisulta...@gmail.com wrote:

 Ok, I think I'm thinking about process.nextTick as it was in node 0.10,
 where, if I'm not mistaken

 function f() {
   process.nextTick(f)
 }

 f()

 would loop infinitely, whereas an immediate recursive call throws
 RangeError.

 I tried running that in v0.10 and got RangeError. However,

 function f() {
   setImmediate(f)
 }

 f()

 puts the function in background and makes node process consume 100% CPU.
 What happens there?



I believe this is a bug that's specific to  0.10.x and was fixed in 0.11.x
and up. (Sorry, I don't have free cycles to look up the relevant github
issues at the moment)

Rick


 On Friday, November 8, 2013 5:20:21 PM UTC-5, Rick Waldron wrote:




 On Fri, Nov 8, 2013 at 3:57 PM, Ilya Shaisultanov 
 ilya.sha...@gmail.comwrote:

 Pardon for resurrecting such old thread but I have a question about
 process.nextTick: why/how does it eliminate the current stack? What happens
 behind the scenes?


 It doesn't eliminate the current stack. The callback is scheduled and
 subsequently executed in the next execution turn.

 Rick


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: dumb question about asynchronous function execution

2013-11-08 Thread Rick Waldron
https://github.com/joyent/node/issues/5798

On Fri, Nov 8, 2013 at 5:38 PM, Ilya Shaisultanov 
ilya.shaisulta...@gmail.com wrote:

 No worries.

 Is the bug that it doesn't throw RangeError or that the execution happens
 in background?

 On Friday, November 8, 2013 5:31:45 PM UTC-5, Rick Waldron wrote:




 On Fri, Nov 8, 2013 at 5:29 PM, Ilya Shaisultanov 
 ilya.sha...@gmail.comwrote:

 Ok, I think I'm thinking about process.nextTick as it was in node 0.10,
 where, if I'm not mistaken

 function f() {
   process.nextTick(f)
 }

 f()

 would loop infinitely, whereas an immediate recursive call throws
 RangeError.

 I tried running that in v0.10 and got RangeError. However,

 function f() {
   setImmediate(f)
 }

 f()

 puts the function in background and makes node process consume 100%
 CPU. What happens there?



 I believe this is a bug that's specific to  0.10.x and was fixed in
 0.11.x and up. (Sorry, I don't have free cycles to look up the relevant
 github issues at the moment)

 Rick


 On Friday, November 8, 2013 5:20:21 PM UTC-5, Rick Waldron wrote:




 On Fri, Nov 8, 2013 at 3:57 PM, Ilya Shaisultanov 
 ilya.sha...@gmail.com wrote:

 Pardon for resurrecting such old thread but I have a question about
 process.nextTick: why/how does it eliminate the current stack? What 
 happens
 behind the scenes?


 It doesn't eliminate the current stack. The callback is scheduled and
 subsequently executed in the next execution turn.

 Rick


  --
 --
 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 group.
 To post to this group, send email to nod...@googlegroups.com

 To unsubscribe from this group, send email to
 nodejs+un...@googlegroups.com

 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+un...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: Does not accept mesage from REDIS?

2013-10-25 Thread Rick Waldron
On Fri, Oct 25, 2013 at 5:34 PM, Brian Di Palma off...@gmail.com wrote:

 Const is the new var in the ES6 world, you should use it everywhere except
 for mutable references.

What about block scoped primitive values? const is not the new var—that
implies s/var/const/, which is not true.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] event emitters w/ callbacks and finishing when all callbacks are finished

2013-10-05 Thread Rick Waldron
On Sat, Oct 5, 2013 at 3:48 PM, David Herron da...@davidherron.com wrote:

 While planning a new feature for my project (AkashaCMS) I realized that
 EventEmitter's aren't the correct tool for one of the things I'm doing.
  Are there alternatives to EventEmitter that fits the scenario I have. ...
 a quick look through the NPM repository says there are some relavent
 modules ...

 The issue is that I want to a) have my application proceed only when all
 the event handlers finish running b) in some cases I need the event handler
 to send a value


This is Promises :)

https://github.com/domenic/promises-unwrapping

https://github.com/kriszyp/node-promise

Rick




 EventEmitter.emit doesn't support a callback that's triggered when all
 event handler invocations have finished.

 What that means is, for example, an array of functions to call each with a
 known signature that includes a callback function.  Then to use, for
 example, async.eachSeries to invoke each in series...

 Here's a few relavent modules that look likely:

 https://npmjs.org/package/async-emit
 https://npmjs.org/package/emit-and-callback

 http://underscorejs.org/  ??


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Questions about semantics of events in Nodejs

2013-10-04 Thread Rick Waldron
On Fri, Oct 4, 2013 at 12:09 PM, Chaoran Yang chaoran.y...@gmail.comwrote:

 Questions 1: Are event listeners always invoked synchronously?

 For example, If I do:

 event.on(end, function() {
   console.log(end);
 });
 event.emit(end);
 event.removeAllListeners();

 Does this code always prints end every time?


Yes, the current implementation is synchronous and yes that's ok (and
totally normal/expected)

console.log(1);
emitter.on(end, function() {
  console.log(3);
});
console.log(2);
emitter.emit(end);
console.log(4);
emitter.removeAllListeners();
console.log(5);

Will output:
1
2
3
4
5






 Question 2: Are event listeners always invoked in the order of they are
 attached?

 For example, if I do:

 event.on('end', function() {
   console.log('end');
 });
 event.on('end', function() {
   event.removeAllListeners();
 });
 event.emit('end');

 Does this code always prints end every time?


Yes, this is documented:
http://nodejs.org/api/events.html#events_emitter_addlistener_event_listener

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Questions about semantics of events in Nodejs

2013-10-04 Thread Rick Waldron
On Fri, Oct 4, 2013 at 4:57 PM, Chaoran Yang chaoran.y...@gmail.com wrote:

 Awesome! Thanks, Rick.

 You're welcome!

Rick


 -Chaoran

 On Friday, October 4, 2013 3:54:50 PM UTC-5, Rick Waldron wrote:




 On Fri, Oct 4, 2013 at 12:09 PM, Chaoran Yang chaora...@gmail.comwrote:

 Questions 1: Are event listeners always invoked synchronously?

 For example, If I do:

 event.on(end, function() {
   console.log(end);
 });
 event.emit(end);
 event.removeAllListeners();

 Does this code always prints end every time?


 Yes, the current implementation is synchronous and yes that's ok (and
 totally normal/expected)

 console.log(1);
 emitter.on(end, function() {
   console.log(3);
 });
 console.log(2);
 emitter.emit(end);
 console.log(4);
 emitter.removeAllListeners();
 console.log(5);

 Will output:
 1
 2
 3
 4
 5






 Question 2: Are event listeners always invoked in the order of they are
 attached?

 For example, if I do:

 event.on('end', function() {
   console.log('end');
 });
 event.on('end', function() {
   event.removeAllListeners();
 });
 event.emit('end');

 Does this code always prints end every time?


 Yes, this is documented: http://nodejs.org/api/events.**
 html#events_emitter_**addlistener_event_listenerhttp://nodejs.org/api/events.html#events_emitter_addlistener_event_listener


 Rick

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: [ANNC] Announcing javelin - A view templating engine for your RESTful APIs

2013-09-29 Thread Rick Waldron
This might be a non-issue, but there is already a project called Javelin in
the JavaScript world: http://www.javelinjs.com/

Rick


On Sun, Sep 29, 2013 at 8:55 PM, blemx blem...@gmail.com wrote:

 Nice project. but I think there should be schema validation feature to
 assure external test.

 2013년 9월 29일 일요일 오전 2시 12분 23초 UTC+9, Jason LaChapelle 님의 말:

 javelin is a view templating engine for your node.js based RESTful APIs.
 It allows you to treat the data of your API as you would any other view.
 The gain here is that you can separate your view logic from your
 controllers and models. javelin can compile to JSON and XML natively but
 other builders can be plugged in to allow compiling to any other format.
 The syntax of javelin is inspired by the Ruby gem known as 
 rablhttps://github.com/nesquena/rabl
 .

 javelin sets out with a few main goals in mind:

 * An easy, familiar, way to separate the view logic from your data within
 RESTful APIs
 * A simple, lightweight templating language that makes sense for
 application data
 * Ability to serve your API data in different formats from the same view

 Please note that javelin is currently in an alpha state. Most features
 are somewhere between Stability 1 (Experimental) and Stability 2 (Unstable).

 Github: 
 https://github.com/**jaylach/javelin/tree/masterhttps://github.com/jaylach/javelin/tree/master

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-25 Thread Rick Waldron
On Wed, Sep 25, 2013 at 6:43 PM, Adam Crabtree atcrabt...@gmail.com wrote:

 Thanks for the clarifications. It seems I was mistaken about
 Object.setPrototypeOf.



Anytime :)

Rick


 1. I didn't realize in this context[1] Object included Functions,
 Errors, etc...
 2. Reinforced by Object.create being object specific.

 Given this, it's understandable why you thought I was bizarrely expo on
 Function.create. At any rate, we're in complete agreement here.

 [1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-19.1.3.19



 On Tue, Sep 24, 2013 at 1:15 PM, Rick Waldron waldron.r...@gmail.comwrote:




 On Tue, Sep 24, 2013 at 3:45 PM, Adam Crabtree atcrabt...@gmail.comwrote:

 There's a combination of things going on here:

 1. There has been discussion on ESDiscuss[1]


 2 years ago, and never discussed again.


 of __proto__ and the insufficiencies of Object.create, specifically when
 you want to set the __proto__ of something other than an Object (e.g.,
 Functions, Errors, Arrays, etc...).


 Yes, I think we're all aware of this.

 I don't know what the current state of this feature is, but I know it at
 least has been raised and acknowledged as a gap in functionality that
 __proto__ fills[2,3].


 The current state is the __proto__ will remain in an annex of the spec
 and be superseded by Object.setPrototypeOf(target, source)




 2. I was mistaken earlier when I said Function.create would be
 insufficient for my use cases (and thus would require `fn.__proto__ =
 ...`). In fact, in both of my use cases I am setting the proto of functions
 I have created, and therefore a Function.create (where it to exist, see the
 next point) would be sufficient.


 Let's stop talking about Function.create. It's not a thing and never will
 be. The use cases I see on that thread, for Function.create and |
 (triangle literal, aka proto operator) are solved using the extends
 operator with ES6 classes.



 3. Regarding times where I may want to assign the proto of objects,
 functions, arrays, errors, I don't own, I personally don't have a usecase
 ATM, but I can easily imagine how that would be incredibly useful for any
 type of library that shims, wraps or augments core or any built-ins to
 extend their functionality seamlessly. If these sorts of libraries don't
 already exist, I would hate to unnecessarily break the requisite
 functionality before they have a chance to.


 This is the juicy stuff I was looking for, and yet it's woefully
 misguided. Anyway, __proto__ isn't going to be removed from v8—like I said
 earlier about browser game theory: they don't want to be the only engine
 that doesn't support it, whether it's a standard feature or not. As far as
 it being standard, __proto__ will exist in an annex and not as part of the
 core language specification. Again, Object.setPrototypeOf() and
 Object.getPrototypeOf() will exist in its place.

 Rick

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




 --
 Better a little with righteousness
than much gain with injustice.
 Proverbs 16:8

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you

Re: [nodejs] Re: Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-24 Thread Rick Waldron
On Tue, Sep 24, 2013 at 1:11 PM, Adam Crabtree atcrabt...@gmail.com wrote:

 The situations I'm talking about were both cases where I needed to set the
 __proto__ of a function to inherit from another object or function. One is
 an instance where Function.create is insufficient because I did not create
 the originating function.


Function.create? There is no built in class-side create method of the
Function object. Do you mean Object.create? I'd be interested in
understanding more about your use case for changing the [[Prototype]] of
objects you don't own (I assume, since your messages says insufficient
because I did not create the originating function.)

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-24 Thread Rick Waldron
On Tue, Sep 24, 2013 at 1:34 PM, Adam Crabtree atcrabt...@gmail.com wrote:

 Object.getPrototypeOf would not help me at all since it would not allow me
 to assign a *new* __proto__ to a function I just created, but I *am*
 mistaken, Function.create() would be sufficient in my cases.

 There's still more flexibility in __proto__ to reassign __proto__, which
 Function.create and Object.getPrototypeOf would not provide.


I'm certain you mean Object.create, but otherwise I understand where you're
going. Though this point was clear in your previous message, I'm still
interested in understanding what circumstances your program is in where it
needs to re-assign the [[Prototype]] of objects it doesn't own.

Anyway, the solution you need is Object.setPrototypeOf(), which is
specified for inclusion in ES6.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-24 Thread Rick Waldron
On Tue, Sep 24, 2013 at 3:45 PM, Adam Crabtree atcrabt...@gmail.com wrote:

 There's a combination of things going on here:

 1. There has been discussion on ESDiscuss[1]


2 years ago, and never discussed again.


 of __proto__ and the insufficiencies of Object.create, specifically when
 you want to set the __proto__ of something other than an Object (e.g.,
 Functions, Errors, Arrays, etc...).


Yes, I think we're all aware of this.

I don't know what the current state of this feature is, but I know it at
 least has been raised and acknowledged as a gap in functionality that
 __proto__ fills[2,3].


The current state is the __proto__ will remain in an annex of the spec and
be superseded by Object.setPrototypeOf(target, source)




 2. I was mistaken earlier when I said Function.create would be
 insufficient for my use cases (and thus would require `fn.__proto__ =
 ...`). In fact, in both of my use cases I am setting the proto of functions
 I have created, and therefore a Function.create (where it to exist, see the
 next point) would be sufficient.


Let's stop talking about Function.create. It's not a thing and never will
be. The use cases I see on that thread, for Function.create and |
(triangle literal, aka proto operator) are solved using the extends
operator with ES6 classes.



 3. Regarding times where I may want to assign the proto of objects,
 functions, arrays, errors, I don't own, I personally don't have a usecase
 ATM, but I can easily imagine how that would be incredibly useful for any
 type of library that shims, wraps or augments core or any built-ins to
 extend their functionality seamlessly. If these sorts of libraries don't
 already exist, I would hate to unnecessarily break the requisite
 functionality before they have a chance to.


This is the juicy stuff I was looking for, and yet it's woefully misguided.
Anyway, __proto__ isn't going to be removed from v8—like I said earlier
about browser game theory: they don't want to be the only engine that
doesn't support it, whether it's a standard feature or not. As far as it
being standard, __proto__ will exist in an annex and not as part of the
core language specification. Again, Object.setPrototypeOf() and
Object.getPrototypeOf() will exist in its place.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-24 Thread Rick Waldron
On Tue, Sep 24, 2013 at 10:57 PM, Mark Hahn m...@reevuit.com wrote:

  It's relevant to the community to have technical discussions about the
 platform.

 This forum is about the node platform, not V8.


If you don't use it already, I suggest switching to gmail—it has an awesome
Undo feature: https://support.google.com/mail/answer/1284885?hl=en

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-20 Thread Rick Waldron
On Friday, September 20, 2013, Nathan Rajlich wrote:

 Andrew, long story short, it's out of our hands. __proto__ is implemented
 by v8 and we just use it as-is. If v8 decides to remove __proto__ then node
 would adopt that at some point, but it's not going to go out of its way to
 change the language past the defaults.


I would add for the win

;)






 On Thu, Sep 19, 2013 at 5:03 PM, Rick Waldron waldron.r...@gmail.comwrote:



 On Thursday, September 19, 2013, Dean Landolt wrote:




 On Thu, Sep 19, 2013 at 5:33 PM, Rick Waldron waldron.r...@gmail.comwrote:




 On Thu, Sep 19, 2013 at 5:08 PM, Gagle gagle...@gmail.com wrote:

 Node.js is javascript, if you remove __proto__ then it's not javascript.


 Funny thing to say about something that is not actually part of the
 language. Check yourself before wreck yourself?



 Wait, is it in or out? I know at one point it was spec'd for es6, right?
 Don't get me wrong -- I'd love to hear that it got the axe, especially in
 light of Object.setPrototypeOf, but I haven't seen anything about that.


 Sometime before July and then formally agreed on in July, then any back to
 an annex.

 Rick









 That being said, sorry but imo Domenic's dict module is based on a poor
 design. The in operator is fucking-terrible-uber-extremly slow thing
 compared with a comparison with undefined:



 If only there was a public website that he could post the code, which
 would allow you to modify it and send him your changes...


 Rick

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google



-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-20 Thread Rick Waldron
On Friday, September 20, 2013, Andrew Kelley wrote:

 Makes sense.

 I wonder if creating a fork of v8 without __proto__ and drumming up public
 knowledge would do anything to affect the minds of the decision-makers -
 whoever they might be. (In my opinion v8 and ecmascript committee are
 somewhat chicken and egg)


Hi! Right here!

I don't know why you say chicken and egg... V8 implementors are on TC39
and have a lot of say in the future of the language. That said, V8 won't be
removing __proto__ anytime soon. It's simple browser game theory: removing
means breaking compatibility with a lot of code written specifically for
mobile (Safari, Chrome, Firefox)—seems like a bad way to build market
share, don't you think?

Honestly, I think you're just being over dramatic. __proto__ will always be
non-standard, but isn't going anywhere, anytime soon. A fork will quickly
wither and die, but good luck trying.

Rick




 On Friday, September 20, 2013 12:28:54 AM UTC-4, Nathan Rajlich wrote:

 Andrew, long story short, it's out of our hands. __proto__ is implemented
 by v8 and we just use it as-is. If v8 decides to remove __proto__ then node
 would adopt that at some point, but it's not going to go out of its way to
 change the language past the defaults.


 On Thu, Sep 19, 2013 at 5:03 PM, Rick Waldron waldro...@gmail.comwrote:



 On Thursday, September 19, 2013, Dean Landolt wrote:




 On Thu, Sep 19, 2013 at 5:33 PM, Rick Waldron 
 waldron.r...@gmail.comwrote:




 On Thu, Sep 19, 2013 at 5:08 PM, Gagle gagle...@gmail.com wrote:

 Node.js is javascript, if you remove __proto__ then it's not
 javascript.


 Funny thing to say about something that is not actually part of the
 language. Check yourself before wreck yourself?



 Wait, is it in or out? I know at one point it was spec'd for es6,
 right? Don't get me wrong -- I'd love to hear that it got the axe,
 especially in light of Object.setPrototypeOf, but I haven't seen anything
 about that.


 Sometime before July and then formally agreed on in July, then any back
 to an annex.

 Rick









 That being said, sorry but imo Domenic's dict module is based on a
 poor design. The in operator is fucking-terrible-uber-extremly slow 
 thing
 compared with a comparison with undefined:



 If only there was a public website that he could post the code, which
 would allow you to modify it and send him your changes...


 Rick

 --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**
 node/wiki/Mailing-List-**Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscribe@**googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscribe@**googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-
 **Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscribe@**googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscribe@**googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .

  --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
 *Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+un...@**googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send

Re: [nodejs] Re: Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-19 Thread Rick Waldron
On Thu, Sep 19, 2013 at 3:54 PM, Alexandre Morgaut 
alexandre.morg...@gmail.com wrote:

 getPrototypeOf() is meant to be readonly


No it's not. Object.getPrototypeOf(foo) returns a reference to foo's
[[Prototype]] (otherwise known as __proto__). It does no configuration of
the object before returning.


 for consistency with __proto__ a new setPrototypeOf() method is considered
 in ECMAScript 6
 http://people.mozilla.org/~jorendorff/es6-draft.html#sec-19.1.3.19


Yes, considered and has consensus, so it's perfectly valid to create a
polyfill for setPrototypeOf
http://webreflection.blogspot.com/2013/05/objectsetprototypeofo-proto-is-in-es6.html

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-19 Thread Rick Waldron
On Thu, Sep 19, 2013 at 5:08 PM, Gagle gagle...@gmail.com wrote:

 Node.js is javascript, if you remove __proto__ then it's not javascript.


Funny thing to say about something that is not actually part of the
language. Check yourself before wreck yourself?



 That being said, sorry but imo Domenic's dict module is based on a poor
 design. The in operator is fucking-terrible-uber-extremly slow thing
 compared with a comparison with undefined:



If only there was a public website that he could post the code, which would
allow you to modify it and send him your changes...


Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Node.js should delete __proto__ while we still have a chance (before we hit 1.0)

2013-09-19 Thread Rick Waldron
On Thursday, September 19, 2013, Dean Landolt wrote:




 On Thu, Sep 19, 2013 at 5:33 PM, Rick Waldron 
 waldron.r...@gmail.comjavascript:_e({}, 'cvml', 'waldron.r...@gmail.com');
  wrote:




 On Thu, Sep 19, 2013 at 5:08 PM, Gagle gagle...@gmail.comjavascript:_e({}, 
 'cvml', 'gagle...@gmail.com');
  wrote:

 Node.js is javascript, if you remove __proto__ then it's not javascript.


 Funny thing to say about something that is not actually part of the
 language. Check yourself before wreck yourself?



 Wait, is it in or out? I know at one point it was spec'd for es6, right?
 Don't get me wrong -- I'd love to hear that it got the axe, especially in
 light of Object.setPrototypeOf, but I haven't seen anything about that.


Sometime before July and then formally agreed on in July, then any back to
an annex.

Rick









 That being said, sorry but imo Domenic's dict module is based on a poor
 design. The in operator is fucking-terrible-uber-extremly slow thing
 compared with a comparison with undefined:



 If only there was a public website that he could post the code, which
 would allow you to modify it and send him your changes...


 Rick

 --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 
 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Problem with Node.js in For in

2013-08-23 Thread Rick Waldron
Don't use for-in to iterate array entries.

Rick

On Friday, August 23, 2013, Александр Крылов wrote:

 Hello!
 I have problem.

 For test example code:

 var user = {}
 var action = 'test';

 user[action] = [{ user_id: '521319f2df3b32081005',
 _id: '521723678857785c050b',
 action: { acType: 'photo', acId: '3' },
 viewed: false },
 { user_id: '521319f2df3b32081005',
 _id: '5217293a1cab19bc1108',
 action: { acType: 'photo', acId: '1' },
 viewed: false },
 { user_id: '521319f2df3b32081005',
 _id: '52172c97d8b04bdc1108',
 action: { acType: 'photo', acId: '1' },
 viewed: false },
 { user_id: '521319f2df3b32081005',
 _id: '52172cc201feeff81108',
 action: { acType: 'photo', acId: '1' },
 viewed: false },
 { user_id: '521319f2df3b32081005',
 _id: '52172ce901feeff81109',
 action: { acType: 'photo', acId: '1' },
 viewed: false },
 { user_id: '521319f2df3b32081005',
 _id: '52172d0d80f9c0701308',
 action: { acType: 'photo', acId: '1' },
 viewed: false },
 { user_id: '521319f2df3b32081005',
 _id: '52172e038c017e041208',
 action: { acType: 'photo', acId: '1' },
 viewed: false },
 { user_id: '521319f2df3b32081005',
 _id: '52172e8ca28258401008',
 action: { acType: 'photo', acId: '1' },
 viewed: false }];
 console.log(user[action]);
 for(var i in user[action]){
 console.log(i);
 }

 So, first console.log shows all elemrnts of array, good. Second
 console.log shows key of iteration and shows:

 0
 1
 2
 3
 4
 5
 6
 7
 _atomics
 validators
 _path
 _parent
 _schema
 _cast
 id
 toObject
 inspect
 create
 notify
 _markModified
 _registerAtomic
 $__getAtomics
 hasAtomics
 push
 nonAtomicPush
 $pop
 pop
 $shift
 shift
 pull
 remove
 splice
 unshift
 sort
 addToSet
 set
 indexOf

 I tested in Node.js (0.10.12) and all browsers. Problem only in node.js
 Can you help me?

 --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Re: Extended inheritance model

2013-08-20 Thread Rick Waldron
On Mon, Aug 19, 2013 at 7:28 PM, Bert Belder bertbel...@gmail.com wrote:

  What do you think about it?

 I think for your own safety you want to run now.


Aw, why?? I was hoping to learn more about this amazing discovery! Can you
imagine—the language can grew parts that no one knows about? Must be hell
for those unit tests...

;)

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-08-19 Thread Rick Waldron
On Mon, Aug 19, 2013 at 5:03 AM, Jake Verbaten rayn...@gmail.com wrote:

 At the top of that page it says

  This proposal has progressed to the Draft ECMAScript 6 Specification,
 which is available for review here: specification_drafts.
  The content on this page is for historic record only and may no longer
 reflect the current state of the feature described within.

 If you look at the draft spec (
 http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.19.4.1 ) it
 says there are two methods, next  throw

 Rick: That notice of this page is 100% out of date and should not be used
 at reference material really should be a lot more obvious. Maybe something
 like give the bolded message a title Warning: with a warning icon


I think it's pretty obvious already and I'm not really interested in
spending the amount of time it would require to go back and update every
page. People should just read the whole page before claiming to know a
thing. I do appreciate your feedback though and if I have a day where I
have time to do this, I'll dig in, but that might not be very soon.






 On Sun, Aug 18, 2013 at 6:15 PM, Michaël Rouges 
 michael.rou...@gmail.comwrote:

 Hi Rick,

 Thank you for looking at my code, however, the spec says otherwise.

 http://wiki.ecmascript.org/doku.php?id=harmony:generators


Do me a favor, when I offer you feedback based on ES6 features, try to
remember that I'm a member of TC39, directly involved in ES6, and assume
that I'm not trolling you. This doesn't mean that I think I'm always right,
I'm not—I actually double checked the spec draft before sending you that
message, just to be certain. What I promise is that I will always offer
information in the best of faith and only to make that interested community
members, such as yourself, stay well informed (so you too can pass it on).

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 function defined further down in the file.  It's the
 difference between space and time.



The problem is that your using the word call incorrectly in the latter.
What you mean, based on the example you show below is referenced. There
can be a reference to a function before (spacially) it is defined by
assignment (because to declare would hoist). The reference can even be a
call site, as long as it isn't reached and evaluated before
(temporally) the definition.

Using the correct terminology to express a technical point is not optional.

Rick


Everyone keeps showing me code that doesn't work and ignores my code that
 does work.  My code has the call above the definition which is all that is
 needed to implement the desired pattern.

 start = - nonHoistedFunc()  # this call is
 ABOVE the definition below
 nonHoistedFunc = - console.log 'this works'# this definition is
 BELOW the call above

 start()  # this starts everything running, just needed once at bottom of
 module

 I use pretty much the pattern described in the blog in all my code.  I am
 going blue in the face trying to explain that the pattern works in
 coffeescript.

 It's not like I care what other people code.  I'm not evangelizing   It
 just drives me crazy that this is the second thread I've talked about this
 and no one has ever admitted my code works.  It is also a slight to
 coffeescript.


  --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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://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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-08-15 Thread Rick Waldron
On Thu, Aug 15, 2013 at 5:45 AM, Bruno Jouhier bjouh...@gmail.com wrote:

 Looks like Michaël has been working with generators in Firefox (he
 mentions JavaScript 1.7 somewhere).

 Michaël, you should take a look at *harmony* generators. They will
 superseed the JS 1.7 generators in Firefox. It's the same concept but the
 syntax has evolved a little bit. For example yield is only allowed inside
 generator functions declared with function*. You can play with them with
 node 0.11.5.

 Also, some projects you can look at:

 https://github.com/jmar777/suspend
 https://github.com/spion/genny
 https://github.com/bjouhier/galaxy (mine - there is a browser example
 that works in Chrome Canary)



Maybe I'm just grouchy this morning, but is there any reason why you're
just repeating everything that Jake and I have already posted?

Rick



 Bruno


 On Thursday, August 15, 2013 12:31:18 AM UTC+2, Rick Waldron wrote:

 It's unwise to encourage the use of `yield` in non-generator function
 bodies... yield is strict-mode reserved and will throw a SyntaxError
 exception in ES6 engines. This appears in many places throughout the readme
 file.


 Rick








 On Wed, Aug 14, 2013 at 3:38 PM, Michaël Rouges michael...@gmail.comwrote:

 The wiki : 
 https://github.com/Lcfvs/yld/**wikihttps://github.com/Lcfvs/yld/wiki

 I apologize if my English isn't very correct, I receive with pleasure your
 comments.

 --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
 *Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com

 To unsubscribe from this group, send email to
 nodejs+un...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+un...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-08-15 Thread Rick Waldron
On Thu, Aug 15, 2013 at 12:11 PM, Bruno Jouhier bjouh...@gmail.com wrote:



 On Thursday, August 15, 2013 2:16:02 PM UTC+2, Rick Waldron wrote:




 On Thu, Aug 15, 2013 at 5:45 AM, Bruno Jouhier bjou...@gmail.com wrote:

 Looks like Michaël has been working with generators in Firefox (he
 mentions JavaScript 1.7 somewhere).

 Michaël, you should take a look at *harmony* generators. They will
 superseed the JS 1.7 generators in Firefox. It's the same concept but the
 syntax has evolved a little bit. For example yield is only allowed inside
 generator functions declared with function*. You can play with them with
 node 0.11.5.

 Also, some projects you can look at:

 https://github.com/jmar777/**suspendhttps://github.com/jmar777/suspend
 https://github.com/spion/genny
 https://github.com/bjouhier/**galaxyhttps://github.com/bjouhier/galaxy(mine
  - there is a browser example that works in Chrome Canary)



  Maybe I'm just grouchy this morning, but is there any reason why you're
 just repeating everything that Jake and I have already posted?


 Answer is simple: I did not scroll far enough down and did not see that
 there were more messages in the thread (or the page wasn't up-to-date - I
 don't know). But I saw them just after posting and felt a bit silly.



Makes sense—I've done the same before. Sorry for being a nit-picker.

Rick




 Bruno


 Rick



 Bruno


 On Thursday, August 15, 2013 12:31:18 AM UTC+2, Rick Waldron wrote:

 It's unwise to encourage the use of `yield` in non-generator function
 bodies... yield is strict-mode reserved and will throw a SyntaxError
 exception in ES6 engines. This appears in many places throughout the readme
 file.


 Rick








 On Wed, Aug 14, 2013 at 3:38 PM, Michaël Rouges 
 michael...@gmail.comwrote:

 The wiki : 
 https://github.com/Lcfvs/yld/**w**ikihttps://github.com/Lcfvs/yld/wiki

 I apologize if my English isn't very correct, I receive with pleasure your
 comments.

 --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node**
 /wiki/Mailing-List-**Posting-**Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com

 To unsubscribe from this group, send email to
 nodejs+un...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group**/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+un...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**grou**ps/opt_outhttps://groups.google.com/groups/opt_out
 .


  --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
 *Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+un...@**googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+un...@**googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received

Re: [nodejs] OOP in Node.js ???

2013-08-14 Thread Rick Waldron
On Wed, Aug 14, 2013 at 9:57 AM, greelgorke greelgo...@gmail.com wrote:

 which does in fact function.bind, which is just another way to do the
 this/that dance. only it is slower.


:D *applause*




Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




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

2013-08-14 Thread Rick Waldron
It's unwise to encourage the use of `yield` in non-generator function
bodies... yield is strict-mode reserved and will throw a SyntaxError
exception in ES6 engines. This appears in many places throughout the readme
file.


Rick








On Wed, Aug 14, 2013 at 3:38 PM, Michaël Rouges michael.rou...@gmail.comwrote:

 The wiki : https://github.com/Lcfvs/yld/wiki

 I apologize if my English isn't very correct, I receive with pleasure your
 comments.

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-08-14 Thread Rick Waldron
On Wed, Aug 14, 2013 at 8:35 PM, Michaël Rouges michael.rou...@gmail.comwrote:

 Could you tell me why, for you, my yielded functions aren't generator
 functions, please?

Because they're not.

A Generator function looks like this:

function * generator() {
  yield 1;
}

Note the asterisk between function and generator.

Rick







 Le jeudi 15 août 2013 00:31:18 UTC+2, Rick Waldron a écrit :

 It's unwise to encourage the use of `yield` in non-generator function
 bodies... yield is strict-mode reserved and will throw a SyntaxError
 exception in ES6 engines. This appears in many places throughout the readme
 file.


 Rick








 On Wed, Aug 14, 2013 at 3:38 PM, Michaël Rouges michael...@gmail.comwrote:

 The wiki : 
 https://github.com/Lcfvs/yld/**wikihttps://github.com/Lcfvs/yld/wiki

 I apologize if my English isn't very correct, I receive with pleasure your
 comments.

 --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
 *Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com

 To unsubscribe from this group, send email to
 nodejs+un...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+un...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-08-14 Thread Rick Waldron
Too be blunt, none of the code in the yld.js file will actually run, these
will all throw syntax error exceptions:
https://github.com/Lcfvs/yld/blob/master/yld.js#L76-L97

Rick


On Wed, Aug 14, 2013 at 8:35 PM, Michaël Rouges michael.rou...@gmail.comwrote:

 Could you tell me why, for you, my yielded functions aren't generator
 functions, please?


 Le jeudi 15 août 2013 00:31:18 UTC+2, Rick Waldron a écrit :

 It's unwise to encourage the use of `yield` in non-generator function
 bodies... yield is strict-mode reserved and will throw a SyntaxError
 exception in ES6 engines. This appears in many places throughout the readme
 file.


 Rick








 On Wed, Aug 14, 2013 at 3:38 PM, Michaël Rouges michael...@gmail.comwrote:

 The wiki : 
 https://github.com/Lcfvs/yld/**wikihttps://github.com/Lcfvs/yld/wiki

 I apologize if my English isn't very correct, I receive with pleasure your
 comments.

 --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
 *Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com

 To unsubscribe from this group, send email to
 nodejs+un...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+un...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-08-14 Thread Rick Waldron
On Wed, Aug 14, 2013 at 9:35 PM, Jake Verbaten rayn...@gmail.com wrote:

 That looks like the old firefox version of generators as well as firefox
 specific (from es4) destructuring  conditional catch clause.


Good catch. I had dismissed the possibility since this was all
node-oriented.


Rick




 On Wed, Aug 14, 2013 at 6:20 PM, Rick Waldron waldron.r...@gmail.comwrote:

 Too be blunt, none of the code in the yld.js file will actually run,
 these will all throw syntax error exceptions:
 https://github.com/Lcfvs/yld/blob/master/yld.js#L76-L97

 Rick


 On Wed, Aug 14, 2013 at 8:35 PM, Michaël Rouges michael.rou...@gmail.com
  wrote:

 Could you tell me why, for you, my yielded functions aren't generator
 functions, please?


 Le jeudi 15 août 2013 00:31:18 UTC+2, Rick Waldron a écrit :

 It's unwise to encourage the use of `yield` in non-generator function
 bodies... yield is strict-mode reserved and will throw a SyntaxError
 exception in ES6 engines. This appears in many places throughout the readme
 file.


 Rick








 On Wed, Aug 14, 2013 at 3:38 PM, Michaël Rouges 
 michael...@gmail.comwrote:

 The wiki : 
 https://github.com/Lcfvs/yld/**wikihttps://github.com/Lcfvs/yld/wiki

 I apologize if my English isn't very correct, I receive with pleasure your
 comments.

 --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**
 node/wiki/Mailing-List-**Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com

 To unsubscribe from this group, send email to
 nodejs+un...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+un...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group

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

2013-08-14 Thread Rick Waldron
On Wed, Aug 14, 2013 at 9:56 PM, Michaël Rouges michael.rou...@gmail.comwrote:

 My code is based on
 https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7examples...

 Would they be so wrong?


Yes, if you're trying to use generators in node, which are based on the
in-progress ES6 standard. If your library is meant to be used in Firefox
only and with special script tags, then your code is fine, otherwise it's
not.

Don't argue with me, I'm right.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] The Future of Programming in Node.js

2013-08-13 Thread Rick Waldron
On Tuesday, August 13, 2013, Mark Hahn wrote:

  Sure. Always follow the majority rule!

 I wasn't saying anything about what action to take.  I was just stating a
 statistical fact.


I'd be interested in seeing the data your referencing.

Rick




 On Tue, Aug 13, 2013 at 3:40 PM, Bruno Jouhier 
 bjouh...@gmail.comjavascript:_e({}, 'cvml', 'bjouh...@gmail.com');
  wrote:


 Not true.  When someone (or even a few) say it sucks and no one agrees
 then he is usually wrong.


 Sure. Always follow the majority rule! Even if you think it sucks, it
 really doesn't!

 Suddenly, I do not know how, it happened, I did not have time to think,
 Panurge, without another word, threw his sheep, crying and bleating, into
 the sea. All the other sheep, crying and bleating in the same intonation,
 started to throw themselves in the sea after it, all in a line. The herd
 was such that once one jumped, so jumped its companions. It was not
 possible to stop them, as you know, with sheep, it's natural to always
 follow the first one, wherever it may go. --Francois Rabelais, Quart
 Livre, chapter VIII

 --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 
 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] OOP in Node.js ???

2013-08-12 Thread Rick Waldron
`this.collection` doesn't yet exist, so the `else` path in `saveData` is
being taken, which is sent to `connectDB` which calls
 `MongoClient.connect`, but does not bind `this` to the callback.

This change should work:

this.connectDB(this.saveData.bind(this));





On Mon, Aug 12, 2013 at 7:22 PM, bodo vuducbinhs...@gmail.com wrote:

 I did a pretty code:

 var Square = function(id,order,color,state) {

  this.id = id;
 this.order = order;
  this.color = color;
 this.state = state;
  this.connected = false;

 MongoClient.connect(config.mongoURL, (function(err, db) {
  this.connected = true;
 this.db = db; //db
  this.collection = db.collection(squares); //collection
 }).bind(this));
 }

 Square.prototype.connectDB = function(callback){

 (function(that){
  MongoClient.connect(config.mongoURL, function(err, db) {
  console.log(connected);
  this.connected = true;
  this.db = db; //db
 this.collection = db.collection(squares); //collection

 //callback(that);
 callback();

 });

 })(this);
 }


 Square.prototype.test = function(){
  console.log(test);
 }

 //export data
 Square.prototype.exportData = function(){

 var rtArr = {
 id:this.id,
  order:this.order,
 color:this.color,
 state:this.state
 };

 return rtArr;
 }

 //save datas to mongo
 Square.prototype.saveData = function () {

 if (this.collection){

 *var doc = this.exportData();*
  this.collection.insert(doc,function() {
 console.log('inserted');
  });
  }else{
 this.connectDB(this.saveData);
 }
 }

 var square = new Square(6,1,'red',1);
 square.saveData();

 When I run this code, that display:

 throw err
 ^
 TypeError: Object #Object has no method 'exportData'

 Why it can not understand *var doc = this.exportData(); ?*
 *
 *
 Someone can help me ? Thank you very much

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Future of asynchronous programming in node

2013-08-06 Thread Rick Waldron
On Tue, Aug 6, 2013 at 5:35 AM, greelgorke greelgo...@gmail.com wrote:

 Few points in my opinon:

 1. Callbacks are not un-intuitive. We do it all the way in our life. i
 mean besides the programming.
 2. Callbacks are not hard to compose. they are functions, do them right,
 nothing stops you to compose, currie or memoing anything.

 One just have to make a little switch in his/her mind. I find it
 surprising, that many of us are willing to make a bigger switch to more
 abstract concepts, just to be back in old sync-imperative world... And it
 doesn't even save you from this so annoying task to think about your
 architecture...

 Besides of the callbacks, i think its hard to reason about if node should
 keep with v8 and adapt es6 features until we have real field experience
 with them.


Node.js (the core) isn't obligated to immediately use ES6 features, but
forking v8 to prevent the use of new language features will only result in
Node.js stagnation and ultimately, abandonment. I think it's safe to say
that won't happen.

Rick




 Node is supposed to be done and be crazy fast. so i'm with Trevor here.


 Am Dienstag, 6. August 2013 10:38:22 UTC+2 schrieb Trevor Norris:

 I'd like a clarifying point. By callback system I'll assume that means
 the EventEmitter modal.

  But the concept of abstracting the callbacks away using a more
 composable and more natural way is definitely a good thing, at least in my
 opinion. The callbacks are a implementation detail of asynchronous io but
 low-level stuff is not what a normal developer should rely on.

 Getting to the point of calling the callback has gone through so many
 layers of abstraction I'd hardly call it low-level.

  Nodes key feature is that it strongly encourages thinking about
 concurrency but the best concurrency abstraction is the abstraction which
 abstracts concurrency totally away. All I'm saying is that the node library
 could evolve when the language does.

 As far as I'm concerned most the new features coming to JS are sugar.
 The event based callback system is straight forward and cheap. Well, it
 _can_ be cheap. Also easily extendable. I don't buy the argument it's
 unnatural or difficult to reason. It's simple to define. The end of an
 asynchronous task is an event. Then, if there's a listening callback it
 gets fired.

 There are many ways to handle this, and unfortunately it seems there's
 inconsistency. Do we just have one callback that we always call and pass
 the status, or do we listen for several events and only fire for those that
 have listeners? It's all implementation details, but adding an extra layer
 of keywords and control flow isn't going to remove the fundamental problem.
 That's easy enough to see in this thread. Even to the point of discussion
 variable naming conventions to remove confusion. Seriously?

 I used to be on the band wagon of let's chain all the things! Then I
 began to see how all the map() and forEach() in the world just makes things
 run slow. It's all just syntactic sugar that for some reason makes
 developers feel fuzzy. And it encourages bad patterns like writing
 functions in functions. Can it be done? Yes, but if you ever take the time
 to trace execution you'll see it has to reoptimize that code every time.

 And at the very least, until those features work without introducing
 performance penalties I can't see them being integrated into core.

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Future of asynchronous programming in node

2013-08-06 Thread Rick Waldron
On Tue, Aug 6, 2013 at 11:12 AM, greelgorke greelgo...@gmail.com wrote:

 Uh, i don't say, fork and prevent. we're talking about adapting language
 feature into core code, right? never said, node should do that. i said,
 don't addapt anything, if it doesnt make node better than before.


Then I apologize for misunderstanding the point of this:

i think its hard to reason about if node should keep with v8 and adapt es6
features until we have real field experience with them.

I still don't see where exactly the discussion had become
node-code-centric, but I'll give you the benefit of the doubt and concede
my wrongness.

Rick




 Am Dienstag, 6. August 2013 16:58:21 UTC+2 schrieb Rick Waldron:




 On Tue, Aug 6, 2013 at 5:35 AM, greelgorke greel...@gmail.com wrote:

 Few points in my opinon:

 1. Callbacks are not un-intuitive. We do it all the way in our life. i
 mean besides the programming.
 2. Callbacks are not hard to compose. they are functions, do them right,
 nothing stops you to compose, currie or memoing anything.

 One just have to make a little switch in his/her mind. I find it
 surprising, that many of us are willing to make a bigger switch to more
 abstract concepts, just to be back in old sync-imperative world... And it
 doesn't even save you from this so annoying task to think about your
 architecture...

 Besides of the callbacks, i think its hard to reason about if node
 should keep with v8 and adapt es6 features until we have real field
 experience with them.


 Node.js (the core) isn't obligated to immediately use ES6 features, but
 forking v8 to prevent the use of new language features will only result in
 Node.js stagnation and ultimately, abandonment. I think it's safe to say
 that won't happen.

 Rick




 Node is supposed to be done and be crazy fast. so i'm with Trevor here.


 Am Dienstag, 6. August 2013 10:38:22 UTC+2 schrieb Trevor Norris:

 I'd like a clarifying point. By callback system I'll assume that means
 the EventEmitter modal.

  But the concept of abstracting the callbacks away using a more
 composable and more natural way is definitely a good thing, at least in my
 opinion. The callbacks are a implementation detail of asynchronous io but
 low-level stuff is not what a normal developer should rely on.

 Getting to the point of calling the callback has gone through so many
 layers of abstraction I'd hardly call it low-level.

  Nodes key feature is that it strongly encourages thinking about
 concurrency but the best concurrency abstraction is the abstraction which
 abstracts concurrency totally away. All I'm saying is that the node library
 could evolve when the language does.

 As far as I'm concerned most the new features coming to JS are sugar.
 The event based callback system is straight forward and cheap. Well, it
 _can_ be cheap. Also easily extendable. I don't buy the argument it's
 unnatural or difficult to reason. It's simple to define. The end of an
 asynchronous task is an event. Then, if there's a listening callback it
 gets fired.

 There are many ways to handle this, and unfortunately it seems there's
 inconsistency. Do we just have one callback that we always call and pass
 the status, or do we listen for several events and only fire for those that
 have listeners? It's all implementation details, but adding an extra layer
 of keywords and control flow isn't going to remove the fundamental problem.
 That's easy enough to see in this thread. Even to the point of discussion
 variable naming conventions to remove confusion. Seriously?

 I used to be on the band wagon of let's chain all the things! Then I
 began to see how all the map() and forEach() in the world just makes things
 run slow. It's all just syntactic sugar that for some reason makes
 developers feel fuzzy. And it encourages bad patterns like writing
 functions in functions. Can it be done? Yes, but if you ever take the time
 to trace execution you'll see it has to reoptimize that code every time.

 And at the very least, until those features work without introducing
 performance penalties I can't see them being integrated into core.

  --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
 *Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com

 To unsubscribe from this group, send email to
 nodejs+un...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=enhttp://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+un...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps

Re: [nodejs] Future of asynchronous programming in node

2013-08-06 Thread Rick Waldron
On Tue, Aug 6, 2013 at 12:00 PM, Tim Caswell t...@creationix.com wrote:




 On Mon, Aug 5, 2013 at 6:26 PM, Mikeal Rogers mikeal.rog...@gmail.comwrote:


 On Aug 5, 2013, at 4:16PM, Jake Verbaten rayn...@gmail.com wrote:

 The only confusion is knowing whether your using generators for async
 flow control or whether your using them to generate iterators you iterate
 over.
  Once you learn to only use the first type in synchronous fashion and
 only use the second type in an asynchronous fashion the confusion goes away.


 This is *exactly* what I'm worried about.

 I'm trying to think about this not in the context of all the code I
 write but all the code i use, and what they use, and what they use.

 If yield becomes a successful pattern a library user won't be aware of
 all the dependent generators it has, just like very few people are aware of
 their dependencies dependencies dependencies. Yet somehow all of the actors
 along this chain have to be sure they didn't use generators one way when I
 want to use them another way.

 This is very concerning. Patterns should enforce or at the very least
 visibly display the compatibility they offer so that actors can coordinate
 without active collaboration, this sounds like it depends on a bunch of
 people all agreeing about how their API should be used without any visible
 indicator stating such.

 One of two things will happen:

 * Most iterators will be used for async which means that very few people
 will write them in a way that i'm worry about
 OR
 * Most iterators won't be use for async which means mixing up the two
 cases will end in bugs *only* visible at scale.


 I'm not sure I understand the concern here.  Could you show me a concrete
 case where this is a problem?  Generators are generators.  They are not
 magic.  They are also never implicit in ES6.  They are annoyingly explicit
 which has the one good side effect of you will never accidentally get
 suspended in disinterested code. (I assume this is why they were designed
 this way)

 Lets go back to the callback case where sync and async code is mixed:

 var items = [];
 array.forEach(function (item) {
   items.push(item);
  });
 assert.equal(array.length, items.length);

 In forEach, the callback is *always* synchronous. Or in other words, it
 will call the callback *before* returning.  When it does return, you can
 know that it's done calling the callback and won't do it ever again.

 But what if I wrote Stream.prototype.forEach that iterated over a node
 stream?

 var items = [];
 stream.forEach(function (item) {
   items.push(item);
 });
 assert.equal(items.length, 0);

 In this case, the forEach function would be async, meaning it *always*
 calls the callback after it returns.  The code block that the assert lives
 in will run to completion and some later turns of the event loop will
 trigger the calls to the callback and mutate the shared state `items`.

 How are generators any worse than this?  The only visual queue that state
 may change at some later time is the function keyword.  But *all* functions
 in javascript use the function keyword.  Sync and async.

 Generators are in an extremely similar boat to callbacks.  They are
 certainly no worse in terms of accidental state clobbering as far as I can
 tell.  They are even more explicit because the only function bodies that
 are allowed to be suspended are ones marked with `function*`.  That star is
 plenty ugly and hard to miss.  I'll bet your dev tools don't even support
 it and most versions of linters will blow up at this point.


Just wanted to interject some good news here: JSHint has already been
updated with support for generator functions, by setting the es6 flag to
`true` :)

Rick





 Then on top of that, even within these specially marked generator bodies,
 the only places you can be suspended and resumed are at the `yield`
 keyword.  You can't call a normal function that then yields for you.  If
 you want to delegate this to another function you have to call it using
 delegating `yield*`, then that function body has to also be marked as a
 generator body with the star.

 So the pattern of creating generators that yield promises or continuables
 and then wrapping in a small helper library that waits for the promise or
 continuable to resolve is not magic at all.  It's extremely explicit.

 Compare:

 function insertFile(path, callback) {
   fs.readFile(path, onFile);

   function onFile(err, data) {
 if (err) return callback(err);
 db.insert(data, callback);
   }
 }

 vs:

 function insertFile(path, callback) {
   run(function* () {
 var data = yield fs.readFile(path);
 return yield db.insert(data);
   }, callback);
 }

 Both of which are consumed using:

 insertFile(myfile.txt, function (err, id) {
   if (err) throw err;
   console.log(id, id);
 });


 Tell me which is easier to find the two places 

Re: [nodejs] Future of asynchronous programming in node

2013-08-06 Thread Rick Waldron
On Tue, Aug 6, 2013 at 6:17 PM, Mark Hahn m...@reevuit.com wrote:

  Always assume that you will be suspended any time you have a yield or
 yield*

 How do you know any of this you see a function call?  Only the function
 definition looks different.  Tell me which is these will yield ..

 a()
 b()
 c()


I see no reason why it would matter if any or all of these are generator
functions. How is this argument any different then calling constructor
functions with new or not?

Tell me which of these is a constructor that must be called with `new`:

a()
b()
c()


Rick






 On Tue, Aug 6, 2013 at 2:54 PM, Tim Caswell t...@creationix.com wrote:




 On Tue, Aug 6, 2013 at 4:47 PM, Mikeal Rogers mikeal.rog...@gmail.comwrote:

 It is the *exact same* hazard as the code you posted, I don't think it
 is any *more* of a hazard at the language level. The difference is that the
 pattern in the function code below is basically never seen in node.js code
 and it has been *possible* to write it since node's creation.

 Could be that nobody will use/clobber closure scope in their generators
 either, but I'm afraid they will because it will work and operate as
 expected *most* of the time and, unlike the function example you've posted,
 it will still fit well when used with what I assume will become a healthy
 ecosystem of generator consuming libraries.

 The reason nobody writes this kind of thing in node is that it just
 won't play well with the rest of the libraries in the ecosystem whereas the
 hazardous generator example looks like it would fit just as well as a well
 written generator until it hits scale and causes visible bugs.

 All kinds of bad patterns and bad code are possible in any language. The
 patterns we adopt to create a healthy ecosystem are what will keep people
 away from the third rails. Depending on people to have well written code,
 by some definition of well, is not a good alternative to solidifying and
 encouraging patterns that make it *difficult* to write hazardous code in
 the first place.

 No pattern or feature in JavaScript escapes the potential for abuse and
 bugs, and nothing that I'm worried about w/ respect to generators is worse
 or better than language level hazards w/ callbacks, it's just that we've
 created a set of patterns that *discourage* those hazards in the current
 ecosystem and I'm failing to see how we do that in this particular case
 with generators.


 I propose a simple rule for all generator code:

  - Always assume that you will be suspended any time you have a yield or
 yield* and any shared state may change.

 If we educate everyone and focus on that one thing (yield) that will
 cover all hazards around shared state and generators, be it async
 promise/continuable based stuff or sync lazy iterator stuff.

 Just like with functions we've learned to look for the function keyword
 and guard our state around that point, we need to do the same around the
 yield keyword.

 Teach people correct principles and trust them to do the right thing.
  We'll be fine.




 -Mikeal

 On Aug 6, 2013, at 2:33PM, Tim Caswell t...@creationix.com wrote:

 My question to people on the list is how is this any different than the
 same hazard with normal function?

 var sum, i;
 function reduce(arr) {
   sum = 0;
   i = 0;
   return function () {
 if (i  arr.length) {
   sum += arr[i++];
   return sum;
 }
   };
 }


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 Job Board: http://jobs.nodejs.org/
 

Re: [nodejs] Future of asynchronous programming in node

2013-08-06 Thread Rick Waldron
On Tue, Aug 6, 2013 at 7:06 PM, Mikeal Rogers mikeal.rog...@gmail.comwrote:


 On Aug 6, 2013, at 3:57PM, Rick Waldron waldron.r...@gmail.com wrote:




 On Tue, Aug 6, 2013 at 6:17 PM, Mark Hahn m...@reevuit.com wrote:

  Always assume that you will be suspended any time you have a yield or
 yield*

 How do you know any of this you see a function call?  Only the function
 definition looks different.  Tell me which is these will yield ..

 a()
 b()
 c()


 I see no reason why it would matter if any or all of these are generator
 functions. How is this argument any different then calling constructor
 functions with new or not?

 Tell me which of these is a constructor that must be called with `new`:

 a()
 b()
 c()


 None of them, they aren't capitalized. This is a trick question right?


Can you provide the spec chapter/section that defines constructors as
functions whose names begin with a capital letter?

:P





 :P



 Rick






 On Tue, Aug 6, 2013 at 2:54 PM, Tim Caswell t...@creationix.com wrote:




 On Tue, Aug 6, 2013 at 4:47 PM, Mikeal Rogers 
 mikeal.rog...@gmail.comwrote:

 It is the *exact same* hazard as the code you posted, I don't think it
 is any *more* of a hazard at the language level. The difference is that the
 pattern in the function code below is basically never seen in node.js code
 and it has been *possible* to write it since node's creation.

 Could be that nobody will use/clobber closure scope in their generators
 either, but I'm afraid they will because it will work and operate as
 expected *most* of the time and, unlike the function example you've posted,
 it will still fit well when used with what I assume will become a healthy
 ecosystem of generator consuming libraries.

 The reason nobody writes this kind of thing in node is that it just
 won't play well with the rest of the libraries in the ecosystem whereas the
 hazardous generator example looks like it would fit just as well as a well
 written generator until it hits scale and causes visible bugs.

 All kinds of bad patterns and bad code are possible in any language.
 The patterns we adopt to create a healthy ecosystem are what will keep
 people away from the third rails. Depending on people to have well
 written code, by some definition of well, is not a good alternative to
 solidifying and encouraging patterns that make it *difficult* to write
 hazardous code in the first place.

 No pattern or feature in JavaScript escapes the potential for abuse and
 bugs, and nothing that I'm worried about w/ respect to generators is worse
 or better than language level hazards w/ callbacks, it's just that we've
 created a set of patterns that *discourage* those hazards in the current
 ecosystem and I'm failing to see how we do that in this particular case
 with generators.


 I propose a simple rule for all generator code:

  - Always assume that you will be suspended any time you have a yield or
 yield* and any shared state may change.

 If we educate everyone and focus on that one thing (yield) that will
 cover all hazards around shared state and generators, be it async
 promise/continuable based stuff or sync lazy iterator stuff.

 Just like with functions we've learned to look for the function
 keyword and guard our state around that point, we need to do the same
 around the yield keyword.

 Teach people correct principles and trust them to do the right thing.
  We'll be fine.




 -Mikeal

 On Aug 6, 2013, at 2:33PM, Tim Caswell t...@creationix.com wrote:

 My question to people on the list is how is this any different than the
 same hazard with normal function?

 var sum, i;
 function reduce(arr) {
   sum = 0;
   i = 0;
   return function () {
 if (i  arr.length) {
   sum += arr[i++];
   return sum;
 }
   };
 }



 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http

Re: [nodejs] Future of asynchronous programming in node

2013-08-06 Thread Rick Waldron
On Tue, Aug 6, 2013 at 7:07 PM, Mark Hahn m...@reevuit.com wrote:

 Also, the constructor problem would break immediately, not at some random
 later time.


Can you explain how any or all of these being generator functions:

a()
b()
c()

... will break at some random later time? Assuming that those three calls
represent some user code.


Rick








 On Tue, Aug 6, 2013 at 4:06 PM, Mikeal Rogers mikeal.rog...@gmail.comwrote:


 On Aug 6, 2013, at 3:57PM, Rick Waldron waldron.r...@gmail.com wrote:




 On Tue, Aug 6, 2013 at 6:17 PM, Mark Hahn m...@reevuit.com wrote:

  Always assume that you will be suspended any time you have a yield or
 yield*

 How do you know any of this you see a function call?  Only the function
 definition looks different.  Tell me which is these will yield ..

 a()
 b()
 c()


 I see no reason why it would matter if any or all of these are generator
 functions. How is this argument any different then calling constructor
 functions with new or not?

 Tell me which of these is a constructor that must be called with `new`:

 a()
 b()
 c()


 None of them, they aren't capitalized. This is a trick question right?

 :P



 Rick






 On Tue, Aug 6, 2013 at 2:54 PM, Tim Caswell t...@creationix.com wrote:




 On Tue, Aug 6, 2013 at 4:47 PM, Mikeal Rogers 
 mikeal.rog...@gmail.comwrote:

 It is the *exact same* hazard as the code you posted, I don't think it
 is any *more* of a hazard at the language level. The difference is that 
 the
 pattern in the function code below is basically never seen in node.js code
 and it has been *possible* to write it since node's creation.

 Could be that nobody will use/clobber closure scope in their
 generators either, but I'm afraid they will because it will work and
 operate as expected *most* of the time and, unlike the function example
 you've posted, it will still fit well when used with what I assume will
 become a healthy ecosystem of generator consuming libraries.

 The reason nobody writes this kind of thing in node is that it just
 won't play well with the rest of the libraries in the ecosystem whereas 
 the
 hazardous generator example looks like it would fit just as well as a 
 well
 written generator until it hits scale and causes visible bugs.

 All kinds of bad patterns and bad code are possible in any language.
 The patterns we adopt to create a healthy ecosystem are what will keep
 people away from the third rails. Depending on people to have well
 written code, by some definition of well, is not a good alternative to
 solidifying and encouraging patterns that make it *difficult* to write
 hazardous code in the first place.

 No pattern or feature in JavaScript escapes the potential for abuse
 and bugs, and nothing that I'm worried about w/ respect to generators is
 worse or better than language level hazards w/ callbacks, it's just that
 we've created a set of patterns that *discourage* those hazards in the
 current ecosystem and I'm failing to see how we do that in this particular
 case with generators.


 I propose a simple rule for all generator code:

  - Always assume that you will be suspended any time you have a yield
 or yield* and any shared state may change.

 If we educate everyone and focus on that one thing (yield) that will
 cover all hazards around shared state and generators, be it async
 promise/continuable based stuff or sync lazy iterator stuff.

 Just like with functions we've learned to look for the function
 keyword and guard our state around that point, we need to do the same
 around the yield keyword.

 Teach people correct principles and trust them to do the right thing.
  We'll be fine.




 -Mikeal

 On Aug 6, 2013, at 2:33PM, Tim Caswell t...@creationix.com wrote:

 My question to people on the list is how is this any different than
 the same hazard with normal function?

 var sum, i;
 function reduce(arr) {
   sum = 0;
   i = 0;
   return function () {
 if (i  arr.length) {
   sum += arr[i++];
   return sum;
 }
   };
 }



 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





 --
 --
 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

Re: [nodejs] Future of asynchronous programming in node

2013-08-06 Thread Rick Waldron
On Tue, Aug 6, 2013 at 8:04 PM, jmar777 jmar...@gmail.com wrote:

 I suppose it's worth pointing out that there's (technically) no ambiguity
 about whether or not a yield expression will result in suspension.  It
 will. Period.

 Granted, sometimes execution may be resumed synchronously, and sometimes
 from an async context, but I think we're already starting to see some
 patterns that give us some indicators there.  Specifically, it's fairly
 obvious that the most common approach for async control-flow with
 generators is going to be with the assistance of some sort of utility
 (e.g., suspend, co, gen-run, galaxy, etc.).

 That is, consider the following example:

 suspend(function* () {
 var user = yield db.getUser('jmar777');
 })();

 So, we now have:

 1) function*
 2) yield
 3) an intentional call to something returning a promise (or continuable)
 4) the whole thing is wrapped in a suspend() call, a library who's sole
 purpose is to help with async interactions

 I'll concede on an academic level that the syntax itself is ambiguous (but
 hey, that's JavaScript).  However, that's where the ambiguity starts *and* 
 ends.
  The async/suspend/resume semantics are pretty abundantly clear.


The syntax is _irrefutably_ unambiguous—otherwise it wouldn't even be in
the language; yield is not a reserved word and therefore function*() {...}
must exist to provide a _single_ new, declarative syntactic form to provide
the necessary grammatical context in which the word yield may be treated
as a language keyword and not just an identifier. It is the very definition
of the word unambiguous.

Everything prior to that: +1

Rick


 On Tuesday, August 6, 2013 7:31:04 PM UTC-4, Tim Caswell wrote:




 On Tue, Aug 6, 2013 at 5:20 PM, Mikeal Rogers mikeal...@gmail.comwrote:

 I think Tim means that the author of the generator should assume it will
 be suspended at any time, not the consumer.


 Yes, that's exactly what I mean.  No function that you call can suspend
 you simply by calling it.  That danger does not exist in ES6's version of
 generators.




 On Aug 6, 2013, at 3:17PM, Mark Hahn ma...@reevuit.com wrote:

  Always assume that you will be suspended any time you have a yield or
 yield*

 How do you know any of this you see a function call?  Only the function
 definition looks different.  Tell me which is these will yield ..

 a()
 b()
 c()

 On Tue, Aug 6, 2013 at 2:54 PM, Tim Caswell t...@creationix.com wrote:




 On Tue, Aug 6, 2013 at 4:47 PM, Mikeal Rogers mikeal...@gmail.comwrote:

 It is the *exact same* hazard as the code you posted, I don't think it
 is any *more* of a hazard at the language level. The difference is that 
 the
 pattern in the function code below is basically never seen in node.js code
 and it has been *possible* to write it since node's creation.

 Could be that nobody will use/clobber closure scope in their
 generators either, but I'm afraid they will because it will work and
 operate as expected *most* of the time and, unlike the function example
 you've posted, it will still fit well when used with what I assume will
 become a healthy ecosystem of generator consuming libraries.

 The reason nobody writes this kind of thing in node is that it just
 won't play well with the rest of the libraries in the ecosystem whereas 
 the
 hazardous generator example looks like it would fit just as well as a 
 well
 written generator until it hits scale and causes visible bugs.

 All kinds of bad patterns and bad code are possible in any language.
 The patterns we adopt to create a healthy ecosystem are what will keep
 people away from the third rails. Depending on people to have well
 written code, by some definition of well, is not a good alternative to
 solidifying and encouraging patterns that make it *difficult* to write
 hazardous code in the first place.

 No pattern or feature in JavaScript escapes the potential for abuse
 and bugs, and nothing that I'm worried about w/ respect to generators is
 worse or better than language level hazards w/ callbacks, it's just that
 we've created a set of patterns that *discourage* those hazards in the
 current ecosystem and I'm failing to see how we do that in this particular
 case with generators.


 I propose a simple rule for all generator code:

  - Always assume that you will be suspended any time you have a yield
 or yield* and any shared state may change.

 If we educate everyone and focus on that one thing (yield) that will
 cover all hazards around shared state and generators, be it async
 promise/continuable based stuff or sync lazy iterator stuff.

 Just like with functions we've learned to look for the function
 keyword and guard our state around that point, we need to do the same
 around the yield keyword.

 Teach people correct principles and trust them to do the right thing.
  We'll be fine.




 -Mikeal

 On Aug 6, 2013, at 2:33PM, Tim Caswell t...@creationix.com wrote:

 My question to people on the list is how is this any different 

Re: [nodejs] Future of asynchronous programming in node

2013-08-05 Thread Rick Waldron
On Mon, Aug 5, 2013 at 8:05 PM, Mark Hahn m...@reevuit.com wrote:

 asyncSomething would be a pain in the ass.  I hate typing and it would
 clutter the readability.  Imagine the name pipe having to be asyncPipe.  I
 would prefer pipe$ or pipe_ which are much more readable.  Pipe_ does the
 least cluttering.  (I know you probably don't care much about cluttering
 since you hate coffeescript).  :-)

 In any case there would be a giant argument with thread lengths surpassing
 even async threads like this. The only feasible solution would be for the
 BDFL to choose something and demand it.



I don't care who says what, BDFL or not, I refuse to suffer some asinine
naming convention as a community cost for using generators.


Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: Future of asynchronous programming in node

2013-08-05 Thread Rick Waldron
On Mon, Aug 5, 2013 at 11:36 PM, jmar777 jmar...@gmail.com wrote:

 Does anyone know if Deferred Functions with the `await` keyword has been
 entirely dropped from the ES7 roadmap?  Early discussions around it seemed
 to rely on thenables.


No, there is still opportunity to discuss `await`

Rick



 I only ask because actual syntax-level sugar for asynchronous interactions
 using native Promises is about the only thing I can imagine reopening a
 discussion of Promises node in core (if even that would do it).


 On Monday, August 5, 2013 11:23:11 AM UTC-4, Christopher Probst wrote:

 Hi guys,

 today I read something about the upcomming es6 generator support and how
 useful they are in combination with promises (Q library for instance).

 The problem with node is that it provides only asynchronous functions
 (and synchronous.. pff).
 I think in order to use promised based io the node.js should support an
 additional function for each asynchronous function in the future or maybe a
 library which does this.

 I know that the Q library already exports functions like Q.denodeify so
 it's definitely not much work but it's still work.

 I've started with node a year ago and it is really a nice tool but I
 always hated the callbacks. They are not composable, verbose and absolutely
 ugly.

 What do you think about this issue ? Any chance direct support for this
 will ever be added ?

 Regards,
 Chris

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Multiple reading of variables in Node.js

2013-07-20 Thread Rick Waldron
Maybe have a look here? https://github.com/rwldrn/johnny-five

Let me know if you have any questions.

Rick


On Sat, Jul 20, 2013 at 6:35 AM, Angel Java Lopez ajlopez2...@gmail.comwrote:

 Hi everyone!

 Ummm... engg. What module are you using? Maybe:

 https://github.com/voodootikigod/node-serialport

 In general, the stream programmer writes expecting you consume the stream
 with something like:

 stream.on('data', function(data) { 

 with one parameter, instead of:

 stream.on('data', function(data, data1, data2) { 

 Am I write? Or your module (or some version of stream) accepts three
 parameters?

 Another question:
 Where are receivedData1,receivedData2 in your code? I see them only at
 console.log

 I don't see Serial.print(',') the comma in your Arduino output:
  181 32 23
 191 31 28
 .
 nor the Serial.print of a new line.

 I guess you receive an string, you must use

 stream.on('data', function(data) {
 // parse the data and collect in an array
 });

 If you are using node-serialport, you have parsers:
 https://github.com/voodootikigod/node-serialport#parsers

 My first approach: use a parser with a delimeter, maybe \n if you have it
 at your Arduino output.

 Nice to know Node.js has a serial port implementation, even in Windows! I
 gave a talk at Cuenca, Ecuador, last year, and some of the attendants found
 some serial port support for their project, but I never tried it. Baud
 rates, old good times ;-)

 Angel Java Lopez
 @ajlopez



 On Sat, Jul 20, 2013 at 12:06 AM, e...@cleantechsolution.in wrote:

 I have my arduino connected in serial with my laptop. The arduino has
 three sensors.
 The reading of the sensors is given by

 Serial.print(sensor1);
 Serial.print(,);
 Serial.print(sensor2);
 Serial.print(,);
 Serial.print(sensor3);
 Serial.print(,);

 The arduino serial monitor is showing data perfectly
 181 32 23
 191 31 28
 .

 In node.Js I wrote like this

 function serialListener(debug)
 {
 var receivedData = ;
 var receivedData1 = ;
 serialPort = new SerialPort(portName, {
 baudrate: 9600,
 // defaults for Arduino serial communication
  dataBits: 8,
  parity: 'none',
  stopBits: 1,
  flowControl: false
 });
  serialPort.on(open, function () {
   console.log('open serial communication');
 // Listens to incoming data
 serialPort.on('data',function(data,data1,data2) {
  receivedData += data.toString();
   receivedData += data1.toString();
   receivedData += data2.toString();
 console.log(receivedData, receivedData1,receivedData2);
 });

 });
 }

 The console is giving results like this
 181,32,23,191,31,28...
 This means I will not be able to extract independent values.

 Please help me how to listen to individual multiple values and get them
 with HTML.
 Thanks

 Please note that I am getting perfect results with single sensor both in
 node.js and in HTML

 Thanks in advance

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You 

Re: [nodejs] Re: Weird error with generators (using suspend or galaxy)

2013-07-17 Thread Rick Waldron
On Wed, Jul 17, 2013 at 8:42 AM, jmar777 jmar...@gmail.com wrote:

  Here are the notes from the meeting when this was discussed:
 https://github.com/**rwldrn/tc39-notes/blob/master/**
 es6/2013-01/jan-31.md#**comprehensionsgenerator-syntaxhttps://github.com/rwldrn/tc39-notes/blob/master/es6/2013-01/jan-31.md#comprehensionsgenerator-syntax

 Ahh, thanks for the clarification.  So, hopefully correct this time, the
 previous example should have really been:

 [for (url of getURLs()) xhrGet(url)]


For a generator comprehension, you had the parens right, but yes, the order
is now correct :)

(for (url of getURLs()) xhrGet(url))

Rick



 ?

 On Tuesday, July 16, 2013 7:38:56 PM UTC-4, Rick Waldron wrote:




 On Tue, Jul 16, 2013 at 9:13 AM, jmar777 jma...@gmail.com wrote:

  That for...of syntax is very nice, is it an official part of
 ECMAScript 6?

 Yes, although it's not implemented in V8 just yet.  Once for-of and
 generator-expressions are implemented, a lot of these operations will
 become a lot nicer at the language level (rather than relying on cludgy
 `suspend.map()` or whatever helpers).

 Here's an example from the ES6 Wiki [1]:

 (xhrGet(url) for (url of getURLs())) // hawt

 [1] http://wiki.ecmascript.org/**doku.php?id=harmony:generator_**
 expressionshttp://wiki.ecmascript.org/doku.php?id=harmony:generator_expressions


 Caution!!!

 *This proposal has progressed to the Draft ECMAScript 6 Specification,
 which is available for review here: specification_drafts. Any new issues
 relating to them should be filed as bugs at http://bugs.ecmascript.org.
 The content on this page is for historic record only and may no longer
 reflect the current state of the feature described within*

 I added this to every wiki proposal that is now in the spec—in this case,
 the generator expression syntax is backwards!

 In the spec draft...

 GeneratorComprehension :
   ( Comprehension )


 And Comprehension is defined in ArrayComprehension

 Comprehension :
   ComprehensionFor ComprehensionQualifierTail

 ComprehensionQualifierTail :
   AssignmentExpression
   ComprehensionQualifier ComprehensionQualifierTail

 ComprehensionQualifier :
   ComprehensionFor
   ComprehensionIf

 ComprehensionFor :
   for (ForBinding of AssignmentExpression )

 ComprehensionIf :
   if ( AssignmentExpression )


 ForBinding :
   BindingIdentifier
   BindingPattern


 Here are the notes from the meeting when this was discussed:
 https://github.com/**rwldrn/tc39-notes/blob/master/**
 es6/2013-01/jan-31.md#**comprehensionsgenerator-syntaxhttps://github.com/rwldrn/tc39-notes/blob/master/es6/2013-01/jan-31.md#comprehensionsgenerator-syntax


 Rick




 On Tuesday, July 16, 2013 2:36:44 AM UTC-4, cpprototypes wrote:

 The code sample I posted was a simplified example to demonstrate the
 issue.  The actual command line script I was working on uses the response
 from the get request for other things.  That for...of syntax is very nice,
 is it an official part of ECMAScript 6?


 On Friday, July 12, 2013 2:47:28 PM UTC-7, cpprototypes wrote:

 I'm using node 0.11.3 with --harmony-generators to try the new
 feature.  I found two libraries that should help use existing node
 callback-based code with generators (suspend and galaxy).  The code I'm
 trying to run was similar to the following:

 (using suspend)

 var fs = require('fs');
 var request = require('request');

 suspend(function* (resume) {
 var contents = yield fs.readFile('idList.json', 'utf8', resume);
 contents.split('\n').forEach(**f**unction(id) {
 var info = yield request.get('http://www.**exampl**
 e.com?id='+id http://www.example.com?id='+id, resume);
 });
 })();

 (using galaxy)

 var galaxy = require('galaxy');
 var fs = galaxy.star(require('fs'));
 var request = galaxy.star(require('request'));

 function* main() {
 var contents = yield fs.readFile('idList.json', 'utf8');
 contents.split('\n').forEach(**f**unction(id) {
 var info = yield request.get('http://www.**exampl**
 e.com?id='+id http://www.example.com?id='+id);
 });
 };

 galaxy.unstar(main)(function(**e**rr, result) {
 console.log('done');
 });

 Using either library, when node tries to execute the get request (var
 info = yield request.get...) it exits with the following error:

 SyntaxError: Unexpected identifier

 And the error highlights the request part in var info = yield
 request.get...  I'm guessing that the creation of the new function scope
 in the forEach is somehow causing an issue.  But I'm not sure why it's not
 working.


  --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
 *Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com

 To unsubscribe from this group, send email to
 nodejs+un

Re: [nodejs] Re: Weird error with generators (using suspend or galaxy)

2013-07-17 Thread Rick Waldron
On Wed, Jul 17, 2013 at 8:43 AM, jmar777 jmar...@gmail.com wrote:

 Also, FWIW, the LTR version reads much more naturally to me. Happy about
 that change.


Same here :)




 On Wednesday, July 17, 2013 8:42:40 AM UTC-4, jmar777 wrote:

  Here are the notes from the meeting when this was discussed:
 https://github.com/**rwldrn/tc39-notes/blob/master/**
 es6/2013-01/jan-31.md#**comprehensionsgenerator-syntaxhttps://github.com/rwldrn/tc39-notes/blob/master/es6/2013-01/jan-31.md#comprehensionsgenerator-syntax

 Ahh, thanks for the clarification.  So, hopefully correct this time, the
 previous example should have really been:

 [for (url of getURLs()) xhrGet(url)]

 ?

 On Tuesday, July 16, 2013 7:38:56 PM UTC-4, Rick Waldron wrote:




 On Tue, Jul 16, 2013 at 9:13 AM, jmar777 jma...@gmail.com wrote:

  That for...of syntax is very nice, is it an official part of
 ECMAScript 6?

 Yes, although it's not implemented in V8 just yet.  Once for-of and
 generator-expressions are implemented, a lot of these operations will
 become a lot nicer at the language level (rather than relying on cludgy
 `suspend.map()` or whatever helpers).

 Here's an example from the ES6 Wiki [1]:

 (xhrGet(url) for (url of getURLs())) // hawt

 [1] http://wiki.ecmascript.org/**doku.php?id=harmony:generator_**
 expressionshttp://wiki.ecmascript.org/doku.php?id=harmony:generator_expressions


 Caution!!!

 *This proposal has progressed to the Draft ECMAScript 6 Specification,
 which is available for review here: specification_drafts. Any new issues
 relating to them should be filed as bugs at http://bugs.ecmascript.org.
 The content on this page is for historic record only and may no longer
 reflect the current state of the feature described within*

 I added this to every wiki proposal that is now in the spec—in this
 case, the generator expression syntax is backwards!

 In the spec draft...

 GeneratorComprehension :
   ( Comprehension )


 And Comprehension is defined in ArrayComprehension

 Comprehension :
   ComprehensionFor ComprehensionQualifierTail

 ComprehensionQualifierTail :
   AssignmentExpression
   ComprehensionQualifier ComprehensionQualifierTail

 ComprehensionQualifier :
   ComprehensionFor
   ComprehensionIf

 ComprehensionFor :
   for (ForBinding of AssignmentExpression )

 ComprehensionIf :
   if ( AssignmentExpression )


 ForBinding :
   BindingIdentifier
   BindingPattern


 Here are the notes from the meeting when this was discussed:
 https://github.com/**rwldrn/tc39-notes/blob/master/**
 es6/2013-01/jan-31.md#**comprehensionsgenerator-syntaxhttps://github.com/rwldrn/tc39-notes/blob/master/es6/2013-01/jan-31.md#comprehensionsgenerator-syntax


 Rick




 On Tuesday, July 16, 2013 2:36:44 AM UTC-4, cpprototypes wrote:

 The code sample I posted was a simplified example to demonstrate the
 issue.  The actual command line script I was working on uses the response
 from the get request for other things.  That for...of syntax is very nice,
 is it an official part of ECMAScript 6?


 On Friday, July 12, 2013 2:47:28 PM UTC-7, cpprototypes wrote:

 I'm using node 0.11.3 with --harmony-generators to try the new
 feature.  I found two libraries that should help use existing node
 callback-based code with generators (suspend and galaxy).  The code I'm
 trying to run was similar to the following:

 (using suspend)

 var fs = require('fs');
 var request = require('request');

 suspend(function* (resume) {
 var contents = yield fs.readFile('idList.json', 'utf8', resume);
 contents.split('\n').forEach(**f**unction(id) {
 var info = yield request.get('http://www.**exampl**
 e.com?id='+id http://www.example.com?id='+id, resume);
 });
 })();

 (using galaxy)

 var galaxy = require('galaxy');
 var fs = galaxy.star(require('fs'));
 var request = galaxy.star(require('request'));

 function* main() {
 var contents = yield fs.readFile('idList.json', 'utf8');
 contents.split('\n').forEach(**f**unction(id) {
 var info = yield request.get('http://www.**exampl**
 e.com?id='+id http://www.example.com?id='+id);
 });
 };

 galaxy.unstar(main)(function(**e**rr, result) {
 console.log('done');
 });

 Using either library, when node tries to execute the get request
 (var info = yield request.get...) it exits with the following error:

 SyntaxError: Unexpected identifier

 And the error highlights the request part in var info = yield
 request.get...  I'm guessing that the creation of the new function scope
 in the forEach is somehow causing an issue.  But I'm not sure why it's 
 not
 working.


  --
 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-
 **Posting-Guidelineshttps://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nod...@googlegroups.com
 To unsubscribe from this group, send email

Re: [nodejs] Re: Weird error with generators (using suspend or galaxy)

2013-07-16 Thread Rick Waldron
On Tue, Jul 16, 2013 at 2:36 AM, cpprototypes cpprototy...@gmail.comwrote:

 The code sample I posted was a simplified example to demonstrate the
 issue.  The actual command line script I was working on uses the response
 from the get request for other things.  That for...of syntax is very nice,
 is it an official part of ECMAScript 6?


Big time. It's already implemented in Firefox ;)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla


Rick





 On Friday, July 12, 2013 2:47:28 PM UTC-7, cpprototypes wrote:

 I'm using node 0.11.3 with --harmony-generators to try the new feature.
  I found two libraries that should help use existing node callback-based
 code with generators (suspend and galaxy).  The code I'm trying to run was
 similar to the following:

 (using suspend)

 var fs = require('fs');
 var request = require('request');

 suspend(function* (resume) {
 var contents = yield fs.readFile('idList.json', 'utf8', resume);
 contents.split('\n').forEach(**function(id) {
 var info = yield 
 request.get('http://www.**example.com?id='+idhttp://www.example.com?id='+id,
 resume);
 });
 })();

 (using galaxy)

 var galaxy = require('galaxy');
 var fs = galaxy.star(require('fs'));
 var request = galaxy.star(require('request')**);

 function* main() {
 var contents = yield fs.readFile('idList.json', 'utf8');
 contents.split('\n').forEach(**function(id) {
 var info = yield 
 request.get('http://www.**example.com?id='+idhttp://www.example.com?id='+id
 );
 });
 };

 galaxy.unstar(main)(function(**err, result) {
 console.log('done');
 });

 Using either library, when node tries to execute the get request (var
 info = yield request.get...) it exits with the following error:

 SyntaxError: Unexpected identifier

 And the error highlights the request part in var info = yield
 request.get...  I'm guessing that the creation of the new function scope
 in the forEach is somehow causing an issue.  But I'm not sure why it's not
 working.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: Weird error with generators (using suspend or galaxy)

2013-07-16 Thread Rick Waldron
On Tue, Jul 16, 2013 at 9:13 AM, jmar777 jmar...@gmail.com wrote:

  That for...of syntax is very nice, is it an official part of ECMAScript
 6?

 Yes, although it's not implemented in V8 just yet.  Once for-of and
 generator-expressions are implemented, a lot of these operations will
 become a lot nicer at the language level (rather than relying on cludgy
 `suspend.map()` or whatever helpers).

 Here's an example from the ES6 Wiki [1]:

 (xhrGet(url) for (url of getURLs())) // hawt

 [1] http://wiki.ecmascript.org/doku.php?id=harmony:generator_expressions


Caution!!!

*This proposal has progressed to the Draft ECMAScript 6 Specification,
which is available for review here: specification_drafts. Any new issues
relating to them should be filed as bugs at http://bugs.ecmascript.org. The
content on this page is for historic record only and may no longer reflect
the current state of the feature described within*

I added this to every wiki proposal that is now in the spec—in this case,
the generator expression syntax is backwards!

In the spec draft...

GeneratorComprehension :
  ( Comprehension )


And Comprehension is defined in ArrayComprehension

Comprehension :
  ComprehensionFor ComprehensionQualifierTail

ComprehensionQualifierTail :
  AssignmentExpression
  ComprehensionQualifier ComprehensionQualifierTail

ComprehensionQualifier :
  ComprehensionFor
  ComprehensionIf

ComprehensionFor :
  for (ForBinding of AssignmentExpression )

ComprehensionIf :
  if ( AssignmentExpression )


ForBinding :
  BindingIdentifier
  BindingPattern


Here are the notes from the meeting when this was discussed:
https://github.com/rwldrn/tc39-notes/blob/master/es6/2013-01/jan-31.md#comprehensionsgenerator-syntax


Rick




 On Tuesday, July 16, 2013 2:36:44 AM UTC-4, cpprototypes wrote:

 The code sample I posted was a simplified example to demonstrate the
 issue.  The actual command line script I was working on uses the response
 from the get request for other things.  That for...of syntax is very nice,
 is it an official part of ECMAScript 6?


 On Friday, July 12, 2013 2:47:28 PM UTC-7, cpprototypes wrote:

 I'm using node 0.11.3 with --harmony-generators to try the new feature.
  I found two libraries that should help use existing node callback-based
 code with generators (suspend and galaxy).  The code I'm trying to run was
 similar to the following:

 (using suspend)

 var fs = require('fs');
 var request = require('request');

 suspend(function* (resume) {
 var contents = yield fs.readFile('idList.json', 'utf8', resume);
 contents.split('\n').forEach(**function(id) {
 var info = yield 
 request.get('http://www.**example.com?id='+idhttp://www.example.com?id='+id,
 resume);
 });
 })();

 (using galaxy)

 var galaxy = require('galaxy');
 var fs = galaxy.star(require('fs'));
 var request = galaxy.star(require('request')**);

 function* main() {
 var contents = yield fs.readFile('idList.json', 'utf8');
 contents.split('\n').forEach(**function(id) {
 var info = yield 
 request.get('http://www.**example.com?id='+idhttp://www.example.com?id='+id
 );
 });
 };

 galaxy.unstar(main)(function(**err, result) {
 console.log('done');
 });

 Using either library, when node tries to execute the get request (var
 info = yield request.get...) it exits with the following error:

 SyntaxError: Unexpected identifier

 And the error highlights the request part in var info = yield
 request.get...  I'm guessing that the creation of the new function scope
 in the forEach is somehow causing an issue.  But I'm not sure why it's not
 working.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 

Re: [nodejs] Re: Weird error with generators (using suspend or galaxy)

2013-07-15 Thread Rick Waldron
On Mon, Jul 15, 2013 at 7:17 PM, jmar777 jmar...@gmail.com wrote:

 Hey -

 Just realized there's another simple solution to your issue (that should
 work with any of the libraries mentioned in this thread) - just avoid
 nested functions:

 suspend(function* (resume) {
 var contents = yield fs.readFile('idList.json', 'utf8', resume),
 ids = contents.split('\n');

 for (var i = 0, len = ids.length; i  len; i++) {
 var info = yield request.get('http://www.example.com?id=' +
 ids[i], resume);
 }
 })();


I've had a for-of example waiting in my drafts, seems like now is a good
time to share (updated for relevance):

suspend(function* (resume) {
  var contents = yield fs.readFile('idList.json', 'utf8', resume),
ids = contents.split('\n');

  for (var id of ids) {
var info = yield request.get('http://www.example.com?id=' + id, resume);
  }
})();


But I can't help it... what the hell is info for? Nothing happens with
the yielded return from request.get...?

Rick







 Main caveat to the above is that all the requests will happen in serial,
 rather than parallel.  Like I said earlier, suspend will soon be including
 some helper functions to make these scenarios easier (I'll happily accept
 any API suggestions around that, too :)).

 On Friday, July 12, 2013 5:47:28 PM UTC-4, cpprototypes wrote:

 I'm using node 0.11.3 with --harmony-generators to try the new feature.
  I found two libraries that should help use existing node callback-based
 code with generators (suspend and galaxy).  The code I'm trying to run was
 similar to the following:

 (using suspend)

 var fs = require('fs');
 var request = require('request');

 suspend(function* (resume) {
 var contents = yield fs.readFile('idList.json', 'utf8', resume);
 contents.split('\n').forEach(**function(id) {
 var info = yield 
 request.get('http://www.**example.com?id='+idhttp://www.example.com?id='+id,
 resume);
 });
 })();

 (using galaxy)

 var galaxy = require('galaxy');
 var fs = galaxy.star(require('fs'));
 var request = galaxy.star(require('request')**);

 function* main() {
 var contents = yield fs.readFile('idList.json', 'utf8');
 contents.split('\n').forEach(**function(id) {
 var info = yield 
 request.get('http://www.**example.com?id='+idhttp://www.example.com?id='+id
 );
 });
 };

 galaxy.unstar(main)(function(**err, result) {
 console.log('done');
 });

 Using either library, when node tries to execute the get request (var
 info = yield request.get...) it exits with the following error:

 SyntaxError: Unexpected identifier

 And the error highlights the request part in var info = yield
 request.get...  I'm guessing that the creation of the new function scope
 in the forEach is somehow causing an issue.  But I'm not sure why it's not
 working.


  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Weird error with generators (using suspend or galaxy)

2013-07-12 Thread Rick Waldron
On Fri, Jul 12, 2013 at 5:47 PM, cpprototypes cpprototy...@gmail.comwrote:

 I'm using node 0.11.3 with --harmony-generators to try the new feature.  I
 found two libraries that should help use existing node callback-based code
 with generators (suspend and galaxy).  The code I'm trying to run was
 similar to the following:

 (using suspend)

 var fs = require('fs');
 var request = require('request');

 suspend(function* (resume) {
 var contents = yield fs.readFile('idList.json', 'utf8', resume);
 contents.split('\n').forEach(function(id) {
 var info = yield request.get('http://www.example.com?id='+id,
 resume);
 });
 })();

 (using galaxy)

 var galaxy = require('galaxy');
 var fs = galaxy.star(require('fs'));
 var request = galaxy.star(require('request'));

 function* main() {
 var contents = yield fs.readFile('idList.json', 'utf8');
 contents.split('\n').forEach(function(id) {
 var info = yield request.get('http://www.example.com?id='+id);
 });
 };

 galaxy.unstar(main)(function(err, result) {
 console.log('done');
 });

 Using either library, when node tries to execute the get request (var
 info = yield request.get...) it exits with the following error:

 SyntaxError: Unexpected identifier

 And the error highlights the request part in var info = yield
 request.get...  I'm guessing that the creation of the new function scope
 in the forEach is somehow causing an issue.  But I'm not sure why it's not
 working.



`yield` may not be used in the body of a regular function.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Node.js ES6

2013-07-07 Thread Rick Waldron
On Sunday, July 7, 2013, António Ramos wrote:

 What is es6?


Ecma-262, v6 (ECMAScript)

Rick



 No dia Sexta-feira, 5 de Julho de 2013, 
 gaglegagle...@gmail.comjavascript:_e({}, 'cvml', 
 'gaglegagle...@gmail.com');escreveu:

 not yet



 El martes, 2 de julio de 2013 17:41:16 UTC+2, Alan Gutierrez escribió:

 Is it time to start using ES6 in Node.js libraries hosted on NPM? Or is
 ES6
 going to be the new CoffeeScript?

 --
 Alan Gutierrez ~ @bigeasy

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



  --
 --
 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 group.
 To post to this group, send email to 
 nodejs@googlegroups.comjavascript:_e({}, 'cvml', 'nodejs@googlegroups.com');
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'nodejs%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Node.js and harmony proxies

2013-06-21 Thread Rick Waldron
On Fri, Jun 21, 2013 at 3:08 PM, Gagle gagle...@gmail.com wrote:

 Which proxy specification implements node.js? I'm trying to execute the
 example code from here (direct 
 proxies)http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxiesbut I 
 don't get the expected results.



The current Proxy is not the correct Proxy. Proxy is still being finalized

Rick

  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] [OT] Badges / Logos for the Web Trifecta: HTML5, CSS3, JS Strict

2013-04-09 Thread Rick Waldron
JS: https://github.com/voodootikigod/logo.js




On Tue, Apr 9, 2013 at 1:11 PM, AJ ONeal coola...@gmail.com wrote:

 I found an SVG for HTML5 and CSS3 and added one for JS Strict.

 PNG:
 dropsha.re/files/1JjCawA/web-trifecta_html5_css3_js-strict.png
 box.com/s/mczjtv7zb2843g07o0vq
 dropsha.re#1JjCawA

 SVG:
 dropsha.re/files/+prCawA/web-trifecta_html5_css3_js-strict.svg
 box.com/s/3lc26vtw1k7v253cgj6e
 dropsha.re#+prCawA

 EPS:
 dropsha.re/files/xgCaNQA/web-trifecta_html5_css3_js-strict.eps
 box.com/s/1ib17ph1nhzs66vo0805
 dropsha.re#xgCaNQA

 PDF:
 dropsha.re/files/9gaaNQA/web-trifecta_html5_css3_js-strict.pdf
 box.com/s/3tk0jar4haczkzlmlzpr
 dropsha.re#9gaaNQA

 Adobe Illustrator:
 dropsha.re/files/5faZNQA/web-trifecta_html5_css3_js-strict.ai
 box.com/s/7qunxx8uhhq1iptzj18q
 dropsha.re#5faZNQA

 P.S. Aside from my vehement love for JS Strict, the S made sense because
 the 3 (for ES5 in ES3 Mode) and 5 (for ES5 in plain-old strict mode) were
 already being used in the other badges.

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] [OT] Badges / Logos for the Web Trifecta: HTML5, CSS3, JS Strict

2013-04-09 Thread Rick Waldron
On Tue, Apr 9, 2013 at 3:18 PM, AJ ONeal coola...@gmail.com wrote:

 Yeah, I put in a pull request for the badge there as well.
 https://github.com/voodootikigod/logo.js/pull/41
 https://github.com/voodootikigod/logo.js/issues/39



But it's not the JS logo...?





 AJ ONeal

 On Tue, Apr 9, 2013 at 1:09 PM, Rick Waldron waldron.r...@gmail.comwrote:

 JS: https://github.com/voodootikigod/logo.js




 On Tue, Apr 9, 2013 at 1:11 PM, AJ ONeal coola...@gmail.com wrote:

 I found an SVG for HTML5 and CSS3 and added one for JS Strict.

 PNG:
 dropsha.re/files/1JjCawA/web-trifecta_html5_css3_js-strict.png
 box.com/s/mczjtv7zb2843g07o0vq
 dropsha.re#1JjCawA

 SVG:
 dropsha.re/files/+prCawA/web-trifecta_html5_css3_js-strict.svg
 box.com/s/3lc26vtw1k7v253cgj6e
 dropsha.re#+prCawA

 EPS:
 dropsha.re/files/xgCaNQA/web-trifecta_html5_css3_js-strict.eps
 box.com/s/1ib17ph1nhzs66vo0805
 dropsha.re#xgCaNQA

 PDF:
 dropsha.re/files/9gaaNQA/web-trifecta_html5_css3_js-strict.pdf
 box.com/s/3tk0jar4haczkzlmlzpr
 dropsha.re#9gaaNQA

 Adobe Illustrator:
 dropsha.re/files/5faZNQA/web-trifecta_html5_css3_js-strict.ai
 box.com/s/7qunxx8uhhq1iptzj18q
 dropsha.re#5faZNQA

 P.S. Aside from my vehement love for JS Strict, the S made sense because
 the 3 (for ES5 in ES3 Mode) and 5 (for ES5 in plain-old strict mode) were
 already being used in the other badges.

 --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Module pattern feedback

2013-03-23 Thread Rick Waldron
I might be half-trolling here...


On Fri, Mar 22, 2013 at 1:50 AM, Nabeel S. nshah...@gmail.com wrote:


   var logger = bunyan.createLogger(...);


Why do module authors make gross factory APIs?

Instead of wrapping the export in this icky createLogger method, that
doesn't do _anything_ (one assumes a factory exists to provide some
additional layer of logic over the base constructor, or else what is the
point?), why not export the constructor?

var logger = new bunyan.Logger();

Yay, much nicer.

Feel free to completely ignore me.

Rick

-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Module pattern feedback

2013-03-23 Thread Rick Waldron
On Sat, Mar 23, 2013 at 8:25 PM, Mikeal Rogers mikeal.rog...@gmail.comwrote:

 var logger = bunyan();

 I was taking into account that bunyan doesn't drink single exports
kool-aid (which makes no difference to me)

Either way, yes, that _is_ simpler...

Rick


 :)

 -Mikeal

 On Mar 23, 2013, at 5:22PM, Rick Waldron waldron.r...@gmail.com wrote:

 I might be half-trolling here...


 On Fri, Mar 22, 2013 at 1:50 AM, Nabeel S. nshah...@gmail.com wrote:


   var logger = bunyan.createLogger(...);


 Why do module authors make gross factory APIs?

 Instead of wrapping the export in this icky createLogger method, that
 doesn't do _anything_ (one assumes a factory exists to provide some
 additional layer of logic over the base constructor, or else what is the
 point?), why not export the constructor?

 var logger = new bunyan.Logger();

 Yay, much nicer.

 Feel free to completely ignore me.

 Rick




  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google Groups
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




  1   2   3   >