[nodejs] Re: Node x64 on Windows -- any advantages?

2012-07-07 Thread Domenic Denicola
FWIW All the native modules I've tried fail to compile when using x64, so there's that as a *dis*advantage. On Saturday, July 7, 2012 12:53:49 AM UTC-4, Glenn Scott wrote: I see there's an x64 Node executable built for Windows: http://nodejs.org/dist/v0.8.1/x64/node-v0.8.1-x64.msi Are

[nodejs] How do you extract values from the JSON data receiving

2012-07-07 Thread Ket
Hi I have this code when I send message: var msg = { name: userName, text: ABCD }; var json = JSON.stringify({ type:'message', data: msg }); socket.send(json); And here the code that receives the message: socket.addEventListener(message, function(event) { console.log

Re: [nodejs] How do you extract values from the JSON data receiving

2012-07-07 Thread Dominic Tarr
var msg = JSON.parse(json) On Sat, Jul 7, 2012 at 7:08 PM, Ket kettin...@gmail.com wrote: Hi I have this code when I send message: var msg = { name: userName, text: ABCD }; var json = JSON.stringify({ type:'message', data: msg }); socket.send(json); And here the code

Re: [nodejs] How do you extract values from the JSON data receiving

2012-07-07 Thread Ket
Thanks, I get it done. -- 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] Re: TLS - EPIPE error without close event being emitted

2012-07-07 Thread Thierry
Hey Gary, I am also working on a node.js library for Apple Push Notifications: https://github.com/Orion98MC/node_apns I do check if the stream is writable before sending anything. You can checkout my code on github: https://github.com/Orion98MC/node_apns/blob/master/lib/apns.js:230 Also,

[nodejs] Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Angel Java Lopez
Hi people! A very simple question. When I write in the Node repl: this.foo = 'bar'; console.log(foo); it's ok, foo is defined. But writing that code in file.js and running node file.js then foo is not defined. Or require('file.js'), then foo is not defined. Any way to define a variable in

[nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Mariusz Nowak
@ajlopez get to know how variable scoping in JavaScript works (what is global, how this and how local variable works), and you'll get the answers :) On Saturday, July 7, 2012 2:11:56 PM UTC+2, ajlopez wrote: Hi people! A very simple question. When I write in the Node repl: this.foo =

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Angel Java Lopez
Thanks for the suggestion! but... I missing some part of your answer. I guess I understand the difference btw global, this.property, and var local. And then, I understand why it not works. What I don't understand is how to circumvent/solve the problem. I don't know if your answer is: a-

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Angel Java Lopez
Thanks! I usually do in your suggested way, and I'm with you. But in this special case, I feel the user of my module could find a bit weird to write var st = require('simpletags'); st.html(st.head(st.title('...')), st.body(st.h1()) instead html(head(title('')), body(h1('...')) in a

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Jorge
On 07/07/2012, at 15:18, Angel Java Lopez wrote: (...) Apparently, my problem is: I didn't find a way to define a local var with a dynamic name. (...) The only way to declare a local var dinamically is with eval(): var varName= thisIsATest; eval(var + varName+ = 27);

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Mariusz Nowak
This is the use case we were missing, you want to do same thing I've once tried to do in domjs https://github.com/medikoo/domjs Currently I think there's no better solution than polluting global scope. In domjs I resolved it by introducing dynamic scope (

Re: [nodejs] Re: Node x64 on Windows -- any advantages?

2012-07-07 Thread Nathan Rajlich
The trick with native addons on Windows 64-bit node is that you have to invoke npm/node-gyp from inside a 64-bit MSVC command prompt. There's a shortcut to in in the start menu, but it's different than both the 32-bit MSVC command prompt as well as cmd.exe, and I've been able to compile native

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Rick Waldron
On Saturday, July 7, 2012 at 10:28 AM, Mariusz Nowak wrote: This is the use case we were missing, you want to do same thing I've once tried to do in domjs https://github.com/medikoo/domjs Currently I think there's no better solution than polluting global scope. In domjs I resolved it by

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread José F . Romaniello
just to add something to the thread, when you are in a file this is equals to exports you can try it as: echo console.log(this === exports) | node 2012/7/7 Angel Java Lopez ajlopez2...@gmail.com Thanks! I usually do in your suggested way, and I'm with you. But in this special case, I feel

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Alan Gutierrez
On Sat, Jul 07, 2012 at 10:55:26AM -0300, Angel Java Lopez wrote: var st = require('simpletags'); st.html(st.head(st.title('...')), st.body(st.h1()) instead html(head(title('')), body(h1('...')) in a controlled way (only in its own module). I want to give him/her an option.

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread Alan Gutierrez
On Sat, Jul 07, 2012 at 10:55:26AM -0300, Angel Java Lopez wrote: Thanks! I usually do in your suggested way, and I'm with you. But in this special case, I feel the user of my module could find a bit weird to write var st = require('simpletags'); st.html(st.head(st.title('...')),

[nodejs] Re: Node x64 on Windows -- any advantages?

2012-07-07 Thread Bert Belder
On Saturday, July 7, 2012 6:53:49 AM UTC+2, Glenn Scott wrote: I see there's an x64 Node executable built for Windows: http://nodejs.org/dist/v0.8.1/x64/node-v0.8.1-x64.msi Are there any advantages to running that x64 build if you're just running fairly vanilla web apps? The x64

[nodejs] installing Node.js 0.8.1 with n

2012-07-07 Thread Mark Volkmann
I get lots of errors when I try to install Node.js 0.8.1 on a Mac (Lion) with n using n latest. Here's one of them: /usr/include/mach/processor_info.h:106: error: declaration for parameter ‘processor_basic_info_data_t’ but no such parameter Any idea what I need to do differently? -- R. Mark

Re: [nodejs] installing Node.js 0.8.1 with n

2012-07-07 Thread Dan Shaw
I know it doesn't help much, but I've been using `n latest` all the way through 0.8.1 on Lion and it's worked without a hitch. Daniel Shaw @dshaw On Sat, Jul 7, 2012 at 12:39 PM, Mark Volkmann r.mark.volkm...@gmail.com wrote: I get lots of errors when I try to install Node.js 0.8.1 on a Mac

[nodejs] Queue requests

2012-07-07 Thread Alan Hoffmeister
Hello fellows, I want to queue my POST requests, someone known a link where I can read more about requests, Node.js and queue manager (my preference is RabbitMQ). Thanks! -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] Queue requests

2012-07-07 Thread Angel Java Lopez
Just curious... Why you need to queue the POST request? An in-memory queue is enough? Or you need to process the POST request in another process? (I can't imagine why/how) On Sat, Jul 7, 2012 at 5:04 PM, Alan Hoffmeister alanhoffmeis...@gmail.comwrote: The major problem is the logic, I had

Re: [nodejs] Queue requests

2012-07-07 Thread Martin Wawrusch
Here are some docs, just a piece of advice - this can easily result in overkill, only use when it is really necessary: http://www.soapatterns.org/synchronous_response_deferred_processing.php http://martinfowler.com/bliki/CQRS.html Also, it might be feasible to check out iron.io - iron worker

Re: [nodejs] Queue requests

2012-07-07 Thread Angel Java Lopez
Thanks! Hmm... interesting... but I missed some part, Martin. If I understand your idea, the consumer(s) of the queue is in another machine. That's is Ok, it compiles in my neuron ;-) My problem is about POST request. The initial POST request reach Machine A, from Client 1. At the end, it's a

Re: [nodejs] Queue requests

2012-07-07 Thread Martin Wawrusch
There are a couple ways to do this, for example: POST request with payload - Machine A within request, machine A takes the payload and adds a message with it to the queue, then returns with some status message, perhaps containing a reference to the task entry. Machine B, upon pulling the message

Re: [nodejs] Queue requests

2012-07-07 Thread Angel Java Lopez
Martin, thanks for the detailed explanation. Now, it's clear to me. I see the light ;-) you are queuing the PAYLOAD, not the POST request, the request object and transfer that it was born with the post. Now I understand the situation (I hope ;-) I see three main use cases: a- you need to queue

[nodejs] new exclusive modes for fs.open

2012-07-07 Thread Mark Volkmann
The fs documentation says Exclusive mode (O_EXCL) ensures that path is newly created. Does that make sense for ax and ax+ that append to an existing file? -- R. Mark Volkmann Object Computing, Inc. -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] `close` event is emitted only when `server.connections === 0`

2012-07-07 Thread Kilian C.
As I can see here: https://github.com/joyent/node/issues/1383 The `close` event is emitted only when `server.connections === 0` While I can not understand motivations behind this, it would be great if someone could answer to this: How socket clients have to notice a server.close() call? Should

[nodejs] [Off] Sites to read Node.js/JavaScript news

2012-07-07 Thread Alan Hoffmeister
Hello fellows, Where do you grab your news about JavaScript / Node.js? -- 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

[nodejs] Re: Sites to read Node.js/JavaScript news

2012-07-07 Thread mscdex
On Jul 7, 10:00 pm, Alan Hoffmeister alanhoffmeis...@gmail.com wrote: Where do you grab your news about JavaScript / Node.js? Well, there's at least echojs.com, dailyjs.com, and planetnodejs.com. There's also HN if you want to count that, as there's been a fair number of javascript and/or