Re: [nodejs] [ANN] redis-lock: An implementation of locks using redis

2012-06-19 Thread George Stagas
Rakesh what? No, sorry I didn't mean to sound like that. Open source is meant to exchange ideas and move forward, stuff aren't always obvious to everyone and I love when people point out things in my code so I can improve! Cheers! 2012/6/19 Rakesh Pai : > Thanks George, > > I feel like a dumbass

Re: [nodejs] [ANN] redis-lock: An implementation of locks using redis

2012-06-19 Thread Rakesh Pai
Oh, I didn't mean it in a bad way at all. Your suggestions are welcome, as is everyone's. Only helps improve the code, the API and my skills. :) I just meant that your suggestions are very elegant, and is an obvious improvement. Thanks again, Rakesh Pai On Tue, Jun 19, 2012 at 12:32 PM, George S

Re: [nodejs] Re: [ANN] redis-lock: An implementation of locks using redis

2012-06-19 Thread Rakesh Pai
I am using redis pub/sub to talk between processes, and redis lists as a queue, so there's some amount of IPC right there. I hope to release those bits soon. Stream API #ftw! On Tue, Jun 19, 2012 at 10:06 AM, dhruvbird wrote: > I wonder if anyone has tried to similarly use redis to do IPC between

Re: [nodejs] [ANN] MuContent

2012-06-19 Thread AndDM
Added some features: maintenance mode, subdomain and submenu manager. First simple blog plugin: https://github.com/anddimario/mucontent-blog On Friday, May 25, 2012 3:04:13 PM UTC+2, AndDM wrote: > > Added a language/content manager. I hope to receive some feedback. > > On Thursday, May 10, 2012 6

[nodejs] Compression in Node.js

2012-06-19 Thread killerhunk
I am new to node.js and currently working on a tcp server. I want all the messages to be sent to client in a compressed format.I am using zlib for this purpose. The following sample is a code on server side: zlib.deflate(response.toString(), function(err, buffer) { if (!err) {

[nodejs] How can I run a script while initializing an addon?

2012-06-19 Thread sahal
I'm wrapping a module into an addon. I want to run a standard nodejs script when the module gets initialized, so that I only have to do "node mymodule" from the command line. As far as I can see none of the usual module apis are exposed. How can I do it then? Here's what I've tried: > #includ

Re: [nodejs] Build 0.6.19 with static openssl ?

2012-06-19 Thread Ben Noordhuis
On Tue, Jun 19, 2012 at 5:50 AM, Thomas Shinnick wrote: > Unfortunately there's a reason, which is the need for a module not yet ready > for 0.7.x/0.8.x, node-sqlite3.  And so the desire for the latest 0.6.19, in > my crossed-up server.  I suppose I can limp along using LD_LIBRARY_PATH for > awhil

Re: [nodejs] cp.fork with stdout

2012-06-19 Thread Ben Noordhuis
On Tue, Jun 19, 2012 at 6:16 AM, Tim Dickinson wrote: > Ok so with using node 0.7.11 can i setup an ipc channel using "{ stdio: > ['ipc', 'pipe', 'pipe'] }". I've played around with it but can't seem to get > it to work.Am I don't this I'm going about it right, Even something like > "{ stdio: 'ipc

Re: [nodejs] How can I run a script while initializing an addon?

2012-06-19 Thread Ben Noordhuis
On Tue, Jun 19, 2012 at 8:27 AM, sahal wrote: > I'm wrapping a module into an addon. I want to run a standard nodejs script > when the module gets initialized, so that I only have to do "node mymodule" > from the command line. As far as I can see none of the usual module apis are > exposed. How ca

Re: [nodejs] Compression in Node.js

2012-06-19 Thread Ben Noordhuis
On Tue, Jun 19, 2012 at 9:50 AM, killerhunk wrote: > I am new to node.js and currently working on a tcp server. I want all the > messages to be sent to client in a compressed format.I am using zlib for > this purpose. > > The following sample is a code on server side: > >     zlib.deflate(response

Re: [nodejs] Compression in Node.js

2012-06-19 Thread Ankit Chandawala
So even if the client is on a different machine,it will work without any problems? On Tue, Jun 19, 2012 at 5:36 PM, Ben Noordhuis wrote: > On Tue, Jun 19, 2012 at 9:50 AM, killerhunk > wrote: > > I am new to node.js and currently working on a tcp server. I want all the > > messages to be sent t

[nodejs] Re: An actor model in node.js

2012-06-19 Thread Tristan Slominski
I haven't taken it up to tens of thousands of processes, but here's my pet project: https://github.com/tristanls/anodejs It naively uses process.nextTick for sending a message, which negatively affects performance (the correct answer is an optimisation based on what node.js release you have th

[nodejs] NODE_PATH deprecated?

2012-06-19 Thread Oliver Leics
Hallo, is NODE_PATH deprecated? -- 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@goo

Re: [nodejs] NODE_PATH deprecated?

2012-06-19 Thread Ben Noordhuis
On Tue, Jun 19, 2012 at 2:52 PM, Oliver Leics wrote: > is NODE_PATH deprecated? No. Why do you ask? -- 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 G

Re: [nodejs] Compression in Node.js

2012-06-19 Thread Ben Noordhuis
On Tue, Jun 19, 2012 at 2:32 PM, Ankit Chandawala wrote: > So even if the client is on a different machine,it will work without any > problems? That question suggests a lack of understanding of what a buffer is. Either that, or there's a lack of understanding from my side about what you're asking

[nodejs] connection counts to http server

2012-06-19 Thread Angelo Chen
Hi, is there a way to know how many concurrent connections to a http server? I use this from command line: netstat -an --inet |wc is it a rough estimate of concurrent connections? Thanks, Angelo -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mai

Re: [nodejs] connection counts to http server

2012-06-19 Thread Arnout Kazemier
If you want to know it inside your node process, you can use the .connections property of the server. if you want to know it outside your node process, i usually use `netstat -an | grep -c EST` for counting the actual established connections. On Tuesday, June 19, 2012 at 4:20 PM, Angelo Chen wro

Re: [nodejs] NODE_PATH deprecated?

2012-06-19 Thread Oliver Leics
On Tue, Jun 19, 2012 at 4:12 PM, Ben Noordhuis wrote: > On Tue, Jun 19, 2012 at 2:52 PM, Oliver Leics wrote: >> is NODE_PATH deprecated? > > No. Why do you ask? nvm does not set it, but: -> ``npm install -g `` just works -> ``npm link `` inside a 'local' package just works -> just works

Re: [nodejs] NODE_PATH deprecated?

2012-06-19 Thread Ben Noordhuis
On Tue, Jun 19, 2012 at 4:34 PM, Oliver Leics wrote: > On Tue, Jun 19, 2012 at 4:12 PM, Ben Noordhuis wrote: >> On Tue, Jun 19, 2012 at 2:52 PM, Oliver Leics wrote: >>> is NODE_PATH deprecated? >> >> No. Why do you ask? > > nvm does not set it, but: >  -> ``npm install -g `` just works >  -> ``n

[nodejs] Re: connection counts to http server

2012-06-19 Thread Angelo Chen
that helps, thanks. if this: netstat -an --inet | grep -c EST 418 that's concurrent connections. and this: netstat -an --inet | grep -c TIME_WAIT 7448 are those time_wait connection not active any more? On Jun 19, 10:24 pm, Arnout Kazemier wrote: > If you want to know it inside your node

Re: [nodejs] NODE_PATH deprecated?

2012-06-19 Thread Isaac Schlueter
npm does not muck with NODE_PATH or any other node environment vars. >> Plus: I have problems installing a module that (somehow) requires >> NODE_PATH during install. So I want to know who to blame ;-) If you share the specifics of the problem (including, at least: what you did, what you expected

Re: [nodejs] Re: connection counts to http server

2012-06-19 Thread Matt
On Tue, Jun 19, 2012 at 10:32 AM, Angelo Chen wrote: > that helps, thanks. > > if this: > > netstat -an --inet | grep -c EST > 418 > > that's concurrent connections. > > and this: > netstat -an --inet | grep -c TIME_WAIT > 7448 > > are those time_wait connection not active any more? > Correct. Th

Re: [nodejs] cp.fork with stdout

2012-06-19 Thread Tim Dickinson
Oh i meant through cp.spawn. I've upgraded to 0.7.16-pre and it seems to work now. On Tuesday, June 19, 2012 7:58:17 AM UTC-4, Ben Noordhuis wrote: > > On Tue, Jun 19, 2012 at 6:16 AM, Tim Dickinson > wrote: > > Ok so with using node 0.7.11 can i setup an ipc channel using "{ stdio: > > ['ipc

[nodejs] Re: The right way of coding nodejs applications: functional or string Object Oriented ?

2012-06-19 Thread Rich Schiavi
Anyone out there have any deep benchmarks to back up using prototype/new over a functional style in Node/V8? And that it is a clear performance/memory win?? Mixu's node book says: http://book.mixu.net/ch6.html "Don't construct by returning objects - use prototype and new" The claim to fu

[nodejs] [ANN] Mincer 0.2.0 released.

2012-06-19 Thread Aleksey V Zapparov
Hi, I'm happy to announce [Mincer][1] v0.2.0, a powerful web assets processor pipeline, that gives you freedom to right your assets using any languages/processor you like (Stylus, LESS, CoffeScript, EJS). More than that it gives you ability to put them in a pipeline (e.g. first compile as EJS, the

Re: [nodejs] Build 0.6.19 with static openssl ?

2012-06-19 Thread Nathan Rajlich
Thomas, I was able to take a second and look at node-sqlite3 to see what they needed for v0.7/v0.8 support. The changes were pretty minimal. You can take a look here: https://github.com/developmentseed/node-sqlite3/pull/76 On Mon, Jun 18, 2012 at 8:50 PM, Thomas Shinnick wrote: > Unfortunately

Re: [nodejs] How can I run a script while initializing an addon?

2012-06-19 Thread sahal
On Tuesday, June 19, 2012 3:04:00 PM UTC+3, Ben Noordhuis wrote: > > On Tue, Jun 19, 2012 at 8:27 AM, sahal <> wrote: > > I'm wrapping a module into an addon. I want to run a standard nodejs > script > > when the module gets initialized, so that I only have to do "node > mymodule" > > from the

[nodejs] assert.deepEqual and undefined

2012-06-19 Thread Mark Volkmann
Why does the second assert below fail? var assert = require('assert'); var a = []; a[1] = 5; assert.deepEqual(a, [, 5]); // passes assert.deepEqual(a, [undefined, 5]); // fails -- R. Mark Volkmann Object Computing, Inc. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.

[nodejs] Re: assert.deepEqual and undefined

2012-06-19 Thread mscdex
On Jun 19, 3:31 pm, Mark Volkmann wrote: > Why does the second assert below fail? The reason is that deepEqual checks the number and values of Object.keys() for arrays. For [,5] there is only one key, '1.' For [undefined,5] there is two keys, '0' and '1.' Therefore the number of keys does not mat

Re: [nodejs] Re: The right way of coding nodejs applications: functional or string Object Oriented ?

2012-06-19 Thread Jake Verbaten
There is nothing wrong with not using the prototype and preferring a functional style. There is something wrong with using closure scope when you can use `this` For example function fooFactory(bar) { return { baz: function () { return bar } } } function fooFactory(bar) { ret

Re: [nodejs] NODE_PATH deprecated?

2012-06-19 Thread Oliver Leics
On Tue, Jun 19, 2012 at 7:11 PM, Isaac Schlueter wrote: >>> Plus: I have problems installing a module that (somehow) requires >>> NODE_PATH during install. So I want to know who to blame ;-) > > If you share the specifics of the problem (including, at least: what > you did, what you expected, and

[nodejs] Re: [ANN] Mincer 0.2.0 released.

2012-06-19 Thread Vitaly Puzrin
FYI, here are examples from real life: init: https://github.com/fontello/fontello/blob/master/lib/init/assets.js#L42 css: https://github.com/fontello/fontello/blob/master/assets/css/app.css Note, that we use stylus & built custom bootstrap files with less, in the same time. That's very convenie

Re: [nodejs] How can I run a script while initializing an addon?

2012-06-19 Thread Nathan Rajlich
No, that's not what he's saying. Basically, instead of having the .node file be the "entry point" to your module, have a separate .js file that will act as the entry point, that also does other initialization like requiring your own native bindings. Then in your package.json file, the "main" field

[nodejs] Re: The right way of coding nodejs applications: functional or string Object Oriented ?

2012-06-19 Thread Rich Schiavi
Cool, yeah, that is what we are doing. Our tests against prototype showed prototype was 5x faster, but in cases where classes/object were more "real world" in style about a 1ms difference at most in creation time On Thursday, September 29, 2011 8:30:07 AM UTC-7, Giovanni Giorgi wrote: > > Hi all

Re: [nodejs] Re: The right way of coding nodejs applications: functional or string Object Oriented ?

2012-06-19 Thread Nuno Job
Do functional style if you feel like it, OO if you feel like it. It's your choice, nodejs lends itself to both. A lot of good nodejs developers do OO. A lot of good nodejs developers do functional style. Ignore FUD, and all the benchmarks that consistently look at non bottlenecks. (If you are cr

Re: [nodejs] Re: The right way of coding nodejs applications: functional or string Object Oriented ?

2012-06-19 Thread Nuno Job
>> What is your experience (and suggestions)? Awesome. I'm an haskell geek and I love nodejs :) It's great to code functional style, if you like it go for it. SubStack mostly code functional style (hence I find his code very easy to read), and so do I. Check some code: - http://github.com/s

Re: [nodejs] Re: The right way of coding nodejs applications: functional or string Object Oriented ?

2012-06-19 Thread José F . Romaniello
I agree with Nuno on this (but I'm a beginner). I mostly do functional but often I find a places where i prefer an object abstraction. And I find that this is mostly the case of the node api, you will find like a bunch of functions in "fs"... but then things like Stream or the EventEmitter loo

[nodejs] Re: Desktop apps with Node.js

2012-06-19 Thread henrik
I haven't tried it myself, but https://github.com/arturadib/node-qt looks interesting. Henrik On Monday, June 18, 2012 1:40:32 AM UTC-7, Sri wrote: > > Had a quick look at node-webkit. Last commit, three months ago (at least > on master branch). > > Any ideas which is the most popular library f

[nodejs] Node Package for building facebook app

2012-06-19 Thread MeetM
I have tried few packaged, but some are complicated, some are too old and haven't been updated for the new facebook platform. I got some very basic part working with some of them (eg., everyauth, node facebook sdk, etc) . So is there any nice package with simple configuration and documentation?

Re: [nodejs] How can I run a script while initializing an addon?

2012-06-19 Thread sahal
Ok so instead of running "node.exe mymodule.node" I need to run "node.exe -e require('mymodule.node').start(module); " And in mymodule.cc write a function start() which compiles and runs a v8::Function, passing it args[0] and work with it like with(arguments[0]) { console.log(require); } This

[nodejs] Re: Desktop apps with Node.js

2012-06-19 Thread sahal
AppJS uses CEF. All others use webkit one way or another. I'm just saying the HTML5 APIs change at such a rate you'll have one hell of a time keeping up. I spammed crbug a while back to ask about an --embeddable flag here http://code.google.com/p/chromium/issues/detail?id=132455 maybe I'm not

[nodejs] Version 0.7.12 (last one before 0.8.0)

2012-06-19 Thread Isaac Schlueter
2012.06.19, Version 0.7.12 (unstable) This is the last release on the 0.7 branch. Version 0.8.0 will be released some time later this week, barring any major problems. As with other even-numbered Node releases before it, the v0.8.x releases will maintain API and binary compatibility. The major

[nodejs] Re: Algorithm help

2012-06-19 Thread vitoa
One more question is this var table = Object.create(null); efficient on search or write an algorith or is just a linear search? In m project i must take care of cpu utilization and I want minimum I'm handling 2 serial ports, 1 http server, 1 tcp/ip socket and 1 websocket server in same board linux

Re: [nodejs] Version 0.7.12 (last one before 0.8.0)

2012-06-19 Thread Phoscur
Haven't seen any discussions on domains lately, they are in .7.12, so they are going to be in 0.8? Anyone using them yet? Am 20.06.2012 01:31, schrieb Isaac Schlueter: 2012.06.19, Version 0.7.12 (unstable) This is the last release on the 0.7 branch. Version 0.8.0 will be released some time

Re: [nodejs] Version 0.7.12 (last one before 0.8.0)

2012-06-19 Thread Isaac Schlueter
Phoscur, I've been using them in the npm-www site. They're actually quite nice used along with cluster in development, because any time you hit a bug that raises an error, you can send a 500 to the client, and kill that worker. Then you use something like the "cluster-master" module so that the

Re: [nodejs] Re: The right way of coding nodejs applications: functional or string Object Oriented ?

2012-06-19 Thread Jorge
On Jun 19, 2012, at 8:41 PM, Rich Schiavi wrote: > > > The claim to functional being "terrible" is one I question, since I've done > some basic comparisons between a functional style versus prototype/new in > node and seen nothing to indicate it's "terrible" to use functional style. > > (The

Re: [nodejs] Build 0.6.19 with static openssl ?

2012-06-19 Thread Thomas Shinnick
Why thank you tall stranger! You are cool relief to the sun-stroked... On Tuesday, June 19, 2012 1:59:36 PM UTC-5, Nathan Rajlich wrote: > > Thomas, > > I was able to take a second and look at node-sqlite3 to see what they > needed for v0.7/v0.8 support. The changes were pretty minimal. You can

[nodejs] Re: [node-dev] Version 0.7.12 (last one before 0.8.0)

2012-06-19 Thread Matt
On Tue, Jun 19, 2012 at 7:31 PM, Isaac Schlueter wrote: > 2012.06.19, Version 0.7.12 (unstable) > > This is the last release on the 0.7 branch. Version 0.8.0 will be > released some time later this week, barring any major problems. > What's the schedule on the major bug in the crypto module: ht

Re: [nodejs] Re: [ANN] redis-lock: An implementation of locks using redis

2012-06-19 Thread dhruvbird
Great! Looking forward to seeing those bits! On Tuesday, June 19, 2012 2:26:25 AM UTC-7, Rakesh Pai wrote: > > I am using redis pub/sub to talk between processes, and redis lists as > a queue, so there's some amount of IPC right there. I hope to release > those bits soon. Stream API #ftw! > > O

Re: [nodejs] Re: [ANN] redis-lock: An implementation of locks using redis

2012-06-19 Thread dhruvbird
Great! Looking forward to seeing those bits! On Tuesday, June 19, 2012 2:26:25 AM UTC-7, Rakesh Pai wrote: > > I am using redis pub/sub to talk between processes, and redis lists as > a queue, so there's some amount of IPC right there. I hope to release > those bits soon. Stream API #ftw! > > O

[nodejs] Re: Node Package for building facebook app

2012-06-19 Thread vicapow
i think some of the reason why this doesn't exist as a nice package is that it's pretty easy to do just by using the request package and making any API calls you want by hand. On Tuesday, June 19, 2012 6:33:54 PM UTC-4, MeetM wrote: > > I have tried few packaged, but some are complicated, some a

[nodejs] Re: Version 0.7.12 (last one before 0.8.0)

2012-06-19 Thread mscdex
On Jun 19, 11:22 pm, Matt wrote: > What's the schedule on the major bug in the crypto > module:https://github.com/joyent/node/issues/1393 +1 This was fixed for some functions in https://github.com/joyent/node/commit/900196e13506bdfb525db1e69072a6a4c18aaba3 -- Job Board: http://jobs.nodejs.org

[nodejs] Generate Excel/CSV files

2012-06-19 Thread ravi prakash
Hi group, How can i generate a excel/csv file from nodejs application. Say, I have a link in webpage and on click of link, i query database and put result into excel/csv file. Finally the file download must be opened. I am building application using nodejs+express. My goal is to export data into

Re: [nodejs] Generate Excel/CSV files

2012-06-19 Thread Matthew Vickers
I have used ya-csv in the past, it works well for our basic usage. https://github.com/koles/ya-csv Matt - "ravi prakash" wrote: > Hi group, > > How can i generate a excel/csv file from nodejs application. Say, I > have a link in webpage and on click of link, i query database and put > r

Re: [nodejs] Generate Excel/CSV files

2012-06-19 Thread Andrew Stone
Hi Ravi, Since you already have the csv content generated you just want to send it out with res.write() or res.end() depending upon whether you are writing it out in chunks or not (streaming). To get the CSV to be a downloadable file you need to add the 'content-type' and 'content-disposition' he

Re: [nodejs] Re: The right way of coding nodejs applications: functional or string Object Oriented ?

2012-06-19 Thread mixu
I agree, the point is more that if you're going to write OOP JS **with inheritance**, then prototypes are nice because they are the standard way. My point is NOT that "functional is terrible", it is that if what you want is OO with inheritance, then please use the capabilities the language prov

[nodejs] Re: Generate Excel/CSV files

2012-06-19 Thread ravi prakash
Hi Andrew, Thanks for your quick response. I tried your first option. Say, i have data from database in array called results, for(var i = 0; i < results.length; i++) { body = ''; body = results[i]+'\n'; res.write(body); } res.setHeader('Content-disposition', 'att

[nodejs] Re: Version 0.7.12 (last one before 0.8.0)

2012-06-19 Thread phidelta
Hi, I am currently experimenting with domains in a storage-library that provides me with a uniform interface to s3, memcache, files, mongo, et. al. It is an awesome feature, that allows for much easier error handling and enables me to centralize error-reporting in a structured and easy way. Re

Re: [nodejs] Re: Generate Excel/CSV files

2012-06-19 Thread Andrew Stone
Hi Ravi, Your for loop look fine, but I believe you messed up the headers. Don't capitalize them. Also, the 'content-disposition' header is a bit of an anomaly. It just doesn't look right to most programmer's eyes, and I've screwed it up also resulting in no file download. It cannot have any (unes