[nodejs] Re: Node.js and Chrome (socket.io)

2013-03-19 Thread greelgorke
connect to the same domain or send Access-Control-Allow-Origin headers. read more here: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS Am Dienstag, 19. März 2013 05:26:55 UTC+1 schrieb Bhushan N.N: I am unable to get socket.io working on Chrome. I get the following error

[nodejs] Re: Node.js and Chrome (socket.io)

2013-03-19 Thread Bhushan N.N
Hi greelgorke, Thanks for your response. I tried adding res.header(Access-Control-Allow-Origin, *); res.header(Access-Control-Allow-Headers, X-Requested-With); using the blog post at http://john.sh/blog/2011/6/30/cross-domain-ajax-expressjs-and-access-control-allow-origin.html Still doesn't

Re: [nodejs] New Streams confusion

2013-03-19 Thread Bruno Jouhier
On Monday, March 18, 2013 9:41:14 PM UTC+1, Nathan Rajlich wrote: You have been very vocal indeed Bruno, I'm sorry that your proposal hasn't gained more traction. @Nathan Less than 10 posts in 8 months. I've been rather quiet :-) My proposal was exactly what you describe in your post (

[nodejs] Re: New Streams confusion

2013-03-19 Thread Floby
I have a question regarding the new streams to which I could not find any answer. *Is it okay to use streams as before (aka old mode) ?* On Monday, 18 March 2013 19:06:48 UTC+1, Sigurgeir Jonsson wrote: The new streams have excellent support for high/low watermarks and

[nodejs] Re: New Streams confusion

2013-03-19 Thread Floby
The real question being: will the pain of using it go away? On Tuesday, 19 March 2013 10:12:38 UTC+1, Floby wrote: I have a question regarding the new streams to which I could not find any answer. *Is it okay to use streams as before (aka old mode) ?* On Monday, 18 March 2013 19:06:48

[nodejs] Re: Calling a C++ app using CLI vs binding to Node with node-gyp

2013-03-19 Thread Floby
My advice is having your C++ library/process use a message-based communication system. - Using it from CLI means that you'll be most likely starting up a new process each time you need it. - Writing bindings to it can mean a lot of pain and headaches and also constant maintenance - using a

Re: [nodejs] Re: New Streams confusion

2013-03-19 Thread Fedor Indutny
Floby, It'll generally work just fine, but please consider using streams2 in the new code. Cheers, Fedor. On Tue, Mar 19, 2013 at 1:13 PM, Floby florent.j...@gmail.com wrote: The real question being: will the pain of using it go away? On Tuesday, 19 March 2013 10:12:38 UTC+1, Floby wrote:

Re: [nodejs] How do I get the names of all the files located on the remote file server using Node.js?

2013-03-19 Thread vins
Let me re-phrase my question. I have server: http://blah.com. The server is just the repository of files. Client has to fetch the files from http://blah.com/scripts folder. It's simple http GET. Every time I don't want to download the files. If the folder has new files I should download only

[nodejs] about net socket.write data to specify client

2013-03-19 Thread fivewall
var net = require('net'); var server = net.createServer(function (socket) { socket.write('Echo server\r\n'); socket.pipe(socket); }); server.listen(1337, '127.0.0.1'); there are two client connect the server port1337, I need specify client to send data,how to do? thank you for you help.

[nodejs] Re: [ANN] HAVE.js - Have your arguments, and validate it too. -- Slick arguments validator for all your js functions.

2013-03-19 Thread Adam Ahmed
Be careful with this. If I'm reading your code correctly, you are relying on the order of that object literal matching the order of the arguments object. This is not guaranteed, as far as I know. This would cause your arguments to be matched against the wrong schemas. I'd suggest replacing the

Re: [nodejs] git server built with node

2013-03-19 Thread Michael Collins
I blogged about this a while ago, but ran out of time to do anything with it. This blog post discusses the git HTTP protocol and what you need to do to be able to push to/pull from a remote repository: http://www.michaelfcollins3.me/blog/2012/05/18/implementing-a-git-http-server.html I hope

Re: [nodejs] about net socket.write data to specify client

2013-03-19 Thread Danilo Luiz Rheinheimer Danilo
You can save the sockets on a data structure to later be able to use them. The most simple would be a simple array where you push the socket. To a simple example look at : https://gist.github.com/creationix/707146 Danilo. On Mon, Mar 18, 2013 at 11:50 PM, fivew...@gmail.com wrote: var net =

Re: [nodejs] How do I get the names of all the files located on the remote file server using Node.js?

2013-03-19 Thread Ryan Schmidt
On Mar 19, 2013, at 07:29, vins wrote: I have server: http://blah.com. The server is just the repository of files. Client has to fetch the files from http://blah.com/scripts folder. It's simple http GET. Every time I don't want to download the files. If the folder has new files I should

Re: [nodejs] Socket hang up problems

2013-03-19 Thread Ryan Schmidt
The message you replied to was two years old... Have you tried with node 0.10 yet? On Mar 18, 2013, at 04:22, Oleg Slobodskoi wrote: I have this error reproducible very stable using node v0.8.21 And I think I have nailed the issue: it happens if the maxSockets of the agent is lower than

[nodejs] Where did the 0.10 development headers go?

2013-03-19 Thread Nabeel S.
The make install did not install them. There's no mention of them being moved anywhere. node-gyp does not install them in any system directory, and the node-gyp configure and install do not find them either (though, a `find /` shows them in my home directory... ???). There are no notes on this

Re: [nodejs] about net socket.write data to specify client

2013-03-19 Thread fivewall
Danilo: thanks you,is work! 在 2013年3月19日星期二UTC+8下午9时47分48秒,Danilo Luiz Rheinheimer Danilo写道: You can save the sockets on a data structure to later be able to use them. The most simple would be a simple array where you push the socket. To a simple example look at :

Re: [nodejs] Where did the 0.10 development headers go?

2013-03-19 Thread Ben Noordhuis
On Tue, Mar 19, 2013 at 5:12 PM, Nabeel S. nshah...@gmail.com wrote: The make install did not install them. There's no mention of them being moved anywhere. node-gyp does not install them in any system directory, and the node-gyp configure and install do not find them either (though, a `find

Re: [nodejs] Where did the 0.10 development headers go?

2013-03-19 Thread Nabeel S.
Right, I've read through the release notes, and there's no mention of the development headers being removed from the make install (and I don't understand why) I've been using node-gyp to build and compile. 0.8 installed the development headers in the proper system paths. node-gyp is not doing

[nodejs] create dynamic URLs based on new content

2013-03-19 Thread Jatin Patel
Hello fellow Node'rs, I'm moving forward and getting close here with respect to my startup... here's some background - https://groups.google.com/d/topic/nodejs/77TqZeWiEZM/discussion I have another question and can't find direct documentation although many articles on similar topic... I

[nodejs] Immediately-Invoked Function Expressions Demystified

2013-03-19 Thread AJ ONeal
Article + Screencast http://blog.coolaj86.com/articles/how-and-why-auto-executing-function.html 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

Re: [nodejs] Immediately-Invoked Function Expressions Demystified

2013-03-19 Thread Rick Waldron
See also http://benalman.com/news/2010/11/immediately-invoked-function-expression/ Not trying to rain on any parades, but Ben coined the term and his article is comprehensive Rick On Tue, Mar 19, 2013 at 2:07 PM, AJ ONeal coola...@gmail.com wrote: Article + Screencast

Re: [nodejs] Immediately-Invoked Function Expressions Demystified

2013-03-19 Thread AJ ONeal
Yeah, it's a good read. I wouldn't say the one precludes the other. We're both explaining a thing, but in the context of different other things (my focus is on the safety benefits). AJ ONeal On Tue, Mar 19, 2013 at 12:16 PM, Rick Waldron waldron.r...@gmail.comwrote: See also

[nodejs] Help with cluster master/work communication performance question

2013-03-19 Thread Matt
I created a simple script to test cluster's performance sending messages to workers. My problem is it slows down the send() rate significantly as I add workers, starting at 1 worker being the fastest. I would expect the send() rate to be completely untied to the number of workers (at least until

[nodejs] Re: How to use streams with feedparser

2013-03-19 Thread Dan MacTough
Josh, sorry about the outdated documentation. The pipe method doesn't work anymore. I've updated the README. I still encourage you to try using streams (although I haven't had a chance to update to streams2 yet). The correct method would be: feedparser.parseStream(request({ 'uri':

Re: [nodejs] create dynamic URLs based on new content

2013-03-19 Thread Phil Jackson
Hey Jatin, Assuming I'm understanding your question: 1) Have an extra column in the DB (uniquely constrained, indexed) called url_name or something and put chicago-the-musical in there when the venue has registered. 2) Add a controller app.get(/events/:envent_name) 3) When someone hits

Re: [nodejs] create dynamic URLs based on new content

2013-03-19 Thread Jatin Patel
Thank you Phil. On #2) so app.get(/events/:event_name) - here event_name is not url_name so how does it ever route to proper URL? event_name is: Chicago, the Musical and eventURL (named) would be chicago-the-musical. #3) Sorry, can you explain this bit more? I don't understand. Thanks, Jatin

Re: [nodejs] create dynamic URLs based on new content

2013-03-19 Thread Phil Jackson
Jatin, Here's the relevant documentation on expressjs.com: http://expressjs.com/api.html#req.params Cheers, Phil Jatin Patel jatin.je...@gmail.com writes: Thank you Phil. On #2) so app.get(/events/:event_name) - here event_name is not url_name so how does it ever route to proper URL?

[nodejs] how to install on ubuntu?

2013-03-19 Thread jai bharat
I have read below thread. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907#113 the present pkg on ubuntu is old version. I wanted to have latest from nodejs website, but I am not sure, if that will install in the manner ubuntu wants it to be. does anyone know? ty. -- -- Job Board:

[nodejs] How to build a nodejs community in Vietnam

2013-03-19 Thread Phúc Phạm Tấn
Hi all, My name is Phuc and I love Nodejs. I try to expand my knowledge and technies in Nodejs but it's so hard to develop because of the lack of materials and poor community in Vietnam. So I write this message to seek the guide and help for the Nodejs community in Vietnam. May you share to me

[nodejs] Re: how to install on ubuntu?

2013-03-19 Thread Ken
Many people (including me) mooch off of Chris Lea's PPA for this purpose: sudo add-apt-repository -y ppa:chris-lea/node.js sudo apt-get upgrade sudo apt-get update sudo apt-get install nodejs He just upgraded to 0.10, but is maintaining a legacy PPA with 0.8, you can read the details on his

[nodejs] Memory leak when retrying a failed request

2013-03-19 Thread James Coglan
Hi all, I have a problem where a system of mine that retries HTTP requests when they fail is leaking memory. Here's a simple demo: ``` var http = require('http'); var request = function() { var req = http.request({ host: 'localhost', port: 9000, method: 'GET', path: '/' });

[nodejs] thoughts on (ab)using Function.prototype to simplify boilerplate error handling in callbacks

2013-03-19 Thread Ken
I've been writing a bunch of shell-script-like node scripts lately. These mostly call a series of async functions that take the usual function (error, data) { ... } callback, and generally they handle any error along the way by logging it and exiting. Here's a naive example using aws-sdk to

[nodejs] Re: Memory leak when retrying a failed request

2013-03-19 Thread Jimb Esser
That doesn't leak when I run it on node 0.10 Changing the timeout to 1ms so it goes quickly, it seems to very quickly hit a steady state of memory usage (around 57mb in my case). It does rise the first few times, but that's not a leak, that's how V8's JS heap works - it garbage collects

Re: [nodejs] thoughts on (ab)using Function.prototype to simplify boilerplate error handling in callbacks

2013-03-19 Thread George Stagas
What's the difference from a someFunction(foo, xie(2, callbackFn)) pattern that doesn't pollute Function.prototype? 2013/3/20 Ken ken.woodr...@gmail.com: I've been writing a bunch of shell-script-like node scripts lately. These mostly call a series of async functions that take the usual

Re: [nodejs] thoughts on (ab)using Function.prototype to simplify boilerplate error handling in callbacks

2013-03-19 Thread Rick Waldron
Felix says: don't do it. http://nodeguide.com/style.html#extending-prototypes ...but it doesn't matter if you're programs are the only code that will affected. Rick On Tuesday, March 19, 2013, George Stagas wrote: What's the difference from a someFunction(foo, xie(2, callbackFn)) pattern

[nodejs] Re: thoughts on (ab)using Function.prototype to simplify boilerplate error handling in callbacks

2013-03-19 Thread Jimb Esser
No need to (ab)use Function.prototype, just make xie a regular function: var xie = function exitIfError(exitCode, f) { // Same body as yours above } code collapses to just ec2.runInstances({ ... }, xie(1, function (runInstancesResponse) { // ... get the instanceIds from response as input to

Re: [nodejs] thoughts on (ab)using Function.prototype to simplify boilerplate error handling in callbacks

2013-03-19 Thread Ken
Only terseness/consistency. It's easy for a module to add a bunch of stuff to Function.prototype, and it's then just there with a consistent name. For global functions to be available you'd have to require them, though this gives you flexibility on the short names, e.g. var xie =

Re: [nodejs] Immediately-Invoked Function Expressions Demystified

2013-03-19 Thread Jake Verbaten
Is there any good reason to ever use IIFE given that commonJS wraps my file in a closure. Can't every use-case for IIFE be replaced with write more smaller modules. At least I havn't used them in months. On Tue, Mar 19, 2013 at 11:44 AM, AJ ONeal coola...@gmail.com wrote: Yeah, it's a good

Re: [nodejs] Immediately-Invoked Function Expressions Demystified

2013-03-19 Thread Marcel Laverdet
This doesn't do too much to demystify anything, imo. Now how that works... I have no idea, but I do believe that it's more aesthetic and so that's how I write my code. I won't argue if you feel differently. It works because (foo)() is identical to foo(). The only reason that that even works

Re: [nodejs] Immediately-Invoked Function Expressions Demystified

2013-03-19 Thread AJ ONeal
This doesn't do too much to demystify anything, imo. Now how that works... I have no idea, but I do believe that it's more aesthetic and so that's how I write my code. I won't argue if you feel differently. I suppose I should have been more specific: This is an error foo(): function

Re: [nodejs] Immediately-Invoked Function Expressions Demystified

2013-03-19 Thread AJ ONeal
On Tue, Mar 19, 2013 at 6:48 PM, Jake Verbaten rayn...@gmail.com wrote: Is there any good reason to ever use IIFE given that commonJS wraps my file in a closure. Can't every use-case for IIFE be replaced with write more smaller modules. At least I havn't used them in months. Living the

Re: [nodejs] git server built with node

2013-03-19 Thread Tim Dickinson
Ah now we are getting someplace. Thanks for the information I will use it when I build my server. On Monday, March 18, 2013 10:18:20 PM UTC-4, mfcollins3 wrote: I blogged about this a while ago, but ran out of time to do anything with it. This blog post discusses the git HTTP protocol and

Re: [nodejs] Immediately-Invoked Function Expressions Demystified

2013-03-19 Thread Rick Waldron
On Tue, Mar 19, 2013 at 9:41 PM, AJ ONeal coola...@gmail.com wrote: This doesn't do too much to demystify anything, imo. Now how that works... I have no idea, but I do believe that it's more aesthetic and so that's how I write my code. I won't argue if you feel differently. I suppose I

Re: [nodejs] Where did the 0.10 development headers go?

2013-03-19 Thread Nathan Rajlich
Can you 1. delete your ~/.node-gyp directory, and then 2. gist the output of `npm install --verbose`? Frankly, I've been getting a lot of strange error reports from people about the node-gyp header installation process not working correctly on v0.10.0, including myself :\ Hopefully I'll have some

[nodejs] Re: [ANN] HAVE.js - Have your arguments, and validate it too. -- Slick arguments validator for all your js functions.

2013-03-19 Thread chakrit
Yeah, I'll admit that is sort of a hack. But it does works very reliably from my experience. There will be problem if you have numeric keys but that is not the case with arguments since you can't name arguments with numbers anyway. See here for more info:

Re: [nodejs] Where did the 0.10 development headers go?

2013-03-19 Thread Nabeel S.
Sure can, thanks. I haven't been able to find out why the headers were also removed from the make install... that just seems like a strange decision to me, esp since other projects do that. For now, I just copied the headers manually into a local directory. Less than ideal, but need to get things

Re: [nodejs] Re: [ANN] HAVE.js - Have your arguments, and validate it too. -- Slick arguments validator for all your js functions.

2013-03-19 Thread Rick Waldron
On Mon, Mar 18, 2013 at 6:45 AM, Eric Muyser eric.muy...@gmail.com wrote: I've done a lot of programming and this is definitely useful. I've come up with a few times but never follow through with using it. The jQuery core has a lot of argument type checking and should probably use something