[nodejs] piping jpeg to browser, pictures got overlapped

2012-02-22 Thread Angelo Chen
hi, I pipe jpegs from database to browser with following code, if picking up only one photo, it works perfect, if more than one, then you can see photos are overlapping each other as one, any idea why that happens? thanks. code in route: exports.get_jpeg = function(req, res){ dao.loadJpe

[nodejs] Re: Automatically populate dependencies based on node_modules folder contents?

2012-02-22 Thread dhruvbird
Wow! Thanks a ton :) Does -S work with update/upgrade as well (I mean if I update the packages?) Regards, -Dhruv. On Feb 21, 11:02 pm, Thomas Blobaum wrote: > yes. > > npm install package --save > or npm install package -S > > http://npmjs.org/doc/ > > Thomas Blobaumhttps://github.com/tblobaum >

[nodejs] Re: parseInt bug

2012-02-22 Thread Dave Clements
+1 for + :D On Feb 22, 6:18 pm, Mark Hahn wrote: > >  +'123 px' > >  NaN > > And that is exactly correct.  '123 px'  is not a number.   Using that > "feature" is worse than trusting type coercion.  I would never trust that > in my code, just as I always use === instead of ==.  Well actually I

[nodejs] Best practice for pushing lots of data over TCP to a distant server

2012-02-22 Thread Jules
Daemon A needs to push lots of data to Daemon B, which is located on another continent. The bandwidth available is usually quite high, but it's highly variable and might drop out entirely at times. Is there an accepted "best strategy" for implementing this in Node? Does A just write as fast as i

[nodejs] Re: JSLint or not?

2012-02-22 Thread tjholowaychuk
use it for things that actually matter, like discovering unwanted global vars etc, but ignore all the style crap On Feb 22, 12:34 pm, "P. Douglas Reeder" wrote: > @Douglas, have you compared it with JSHint? > > I've tried to configure JSLint to not throw errors, but it's too > finicky.  I found i

[nodejs] maybe some memory leak in TLS module

2012-02-22 Thread 马涛
hi, there I got some error and I think there maybe some memory leak in TLS module terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc I'm testing haraka, when setup a smtp_forward with tls enable, if a mail with a big attchment like

[nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Juraj Vitko
Very interesting. I just had a bit longer read of their website and paper than I wanted, and it looks like they are only beating Redis/ Mongo/Cassandra in a cluster config, and only because of a new Cluster hashing/addressing technique. This Slashdot comment seems to suggest that as well: http://h

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Mikeal Rogers
You can create a node.js streaming gzip http server and connect to it in node within a single test file. If you can reproduce the problem with a single node script then there is a 100% chance it will get fixed. On Feb 22, 2012, at February 22, 20121:17 PM, Demián Andrés Rodriguez wrote: > I wou

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Mikeal Rogers
On Feb 22, 2012, at February 22, 201211:43 AM, Rambo wrote: > How can the error be happening before the error event attachment if the > connection is alive for at least 10 minutes? > > Regarding the random disconnects, maybe there is no error but what about the > 'end' event that ClientRespons

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Demián Andrés Rodriguez
I would need access to a public streaming api that uses gzip! I cannot publish the auth details. On Wed, Feb 22, 2012 at 6:11 PM, Ben Noordhuis wrote: > On Wed, Feb 22, 2012 at 20:43, Rambo wrote: > > How can the error be happening before the error event attachment if the > > connection is aliv

Re: [nodejs] implementing module in header library

2012-02-22 Thread Ben Noordhuis
On Wed, Feb 22, 2012 at 20:22, Tristan Zajonc wrote: > Hi, > > Is there a trick to implementing modules in header libraries, to help with > reuse across modules.  I don't know the ins and outs of node modules but I > tried to port: > > https://github.com/kkaefer/node-cpp-modules/tree/master/06_obj

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Ben Noordhuis
On Wed, Feb 22, 2012 at 20:43, Rambo wrote: > How can the error be happening before the error event attachment if the > connection is alive for at least 10 minutes? > > Regarding the random disconnects, maybe there is no error but what about the > 'end' event that ClientResponse should emit? I've

[nodejs] implementing module in header library

2012-02-22 Thread Tristan Zajonc
Hi, Is there a trick to implementing modules in header libraries, to help with reuse across modules. I don't know the ins and outs of node modules but I tried to port: https://github.com/kkaefer/node-cpp-modules/tree/master/06_objects to put the implementation in the header library as follows:

[nodejs] Re: Free nodejs services

2012-02-22 Thread Le Zhang
Wow! Didn't know this and immensly useful since we're rolling Node on Heroku. Thanks! On Feb 21, 12:59 am, Anand George wrote: > Now it's possible to run different version of node.js on Heroku. Check this > > http://www.scoop.it/t/nodejs-code/p/1210329655/run-multi-version-of-n... > > Anand > > O

[nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Juraj Vitko
Clojure looks quite intriguing to me, I wish day had at least 48 hours so that I can go over all the things I want:) Have you considered quick and dirty port of the Finger Trees using ClojureScript? Actually I've noticed quite a lot JDK dependencies in that code, so not sure.. >From a quick scan

[nodejs] Re: JSLint or not?

2012-02-22 Thread P. Douglas Reeder
@Douglas, have you compared it with JSHint? I've tried to configure JSLint to not throw errors, but it's too finicky. I found it very easy to configure Miller's Javascript lint to not returning spurious errors, and it catches additional real errors like functions sometimes reurning a value and

Re: [nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Dean Landolt
On Wed, Feb 22, 2012 at 2:37 PM, Juraj Vitko wrote: > The problem with tree (ordered) maps is that they usually take more > space and are slower than hash maps. So that's why I proposed a > separate Map and OrderedMap. > > Plus, often times one needs to store a sequential structure, e.g. to > imp

Re: [nodejs] Off topic - Necesito programador en node (spanish language only)

2012-02-22 Thread Emilio Astarita
Hola Normando, Soy de Argentina, hice algunos proyectos personales en node. Me gustaría conocer un poco más acerca del trabajo. Saludos! -- Emilio Astarita http://cloudymedia.com 2012/2/15 Normando Hall > Buen día. > > Formo parte de un grupo de programadores en node que estamos por comenzar >

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Jeremy Darling
Notice I said process.on('error') and process.on('exit') NOT connection.on(*). If this is something that is happening lower than the socket level you may not be able to catch it at the socket level. Since your getting an ECONREFUSED error after the socket is stableized (sp?) and running I'd see i

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Rambo
How can the error be happening before the error event attachment if the connection is alive for at least 10 minutes? Regarding the random disconnects, maybe there is no error but what about the 'end' event that ClientResponse should emit? I've registered a listener for that event but nothing ge

[nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Juraj Vitko
LevelDB I already have in the links up there (http://nodejsdb.com), this is what I got (copy&paste): Rawhash - In-memory key:value cache where keys are binary Buffers mem, kv Node-LevelDB - NodeJS bindings to levelDB, with SSTable disk storage approach disk, kv node-cask - Bitcask clone for node,

[nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Juraj Vitko
The problem with tree (ordered) maps is that they usually take more space and are slower than hash maps. So that's why I proposed a separate Map and OrderedMap. Plus, often times one needs to store a sequential structure, e.g. to implement a Queue, or Stack, etc. It's possible to implement a list

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Mikeal Rogers
Your original error looks to be thrown **before** the HTTP client attaches it's error listener. This is kind of insane because as soon as a socket is created it is assigned using ClientRequest.onSocket() and in a nextTick() handler it adds the error listener. The socket's nextTick() handler for

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Demián Andrés Rodriguez
But the thing is that now the connection ends without emitting any 'error' or 'end' event. I've registered a listener for every damn event the request & response emits, what am I missing? We are not behind a firewall: root@w5:/var/www/nsnode# lscpu Architecture: x86_64 CPU op-mode(s):

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Jeremy Darling
OS, Num CPUs, Firewall or no Firewall, etc etc please. Lots of things can cause a connection to be terminated that are in and out of scope for any application. As for catching you can use process.on('error') or process.on('exit') or try{}catch(e){} and retry logic depending on where the line is g

[nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Alexey Petrushin
Hmm, maybe we don't need index integrity, after all if each dataset is independent and small we can rebuild indexes it every time we loading DB in memory. In such case non-blocking robust persistence can be achieved with storing database as append-only journal. So, it seems that we basically ne

Re: [nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Dean Landolt
On Wed, Feb 22, 2012 at 2:05 PM, Alexey Petrushin < alexey.petrus...@gmail.com> wrote: > Basically to do so we need: > - an ordered b-tree, supporting sequential access and range queries > - non-blocking persistence (preserving db integrity in crush case) > - integrity of indexes (indexes also sto

Re: [nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread David Cope
Someone just slashdotted this http://hyperdex.org/, first time I've seen it. No node bindings, but it looks promising. On Feb 22, 2012, at 2:05 PM, Alexey Petrushin wrote: > Basically to do so we need: > - an ordered b-tree, supporting sequential access and range queries > - non-blocking persis

[nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Alexey Petrushin
Basically to do so we need: - an ordered b-tree, supporting sequential access and range queries - non-blocking persistence (preserving db integrity in crush case) - integrity of indexes (indexes also stored in b-tree, so, we basically need some sort of transactions for storing documents in multipl

Re: [nodejs] Captcha

2012-02-22 Thread Alan Hoffmeister
reCaptcha fails in personalization... -- Att, Alan Hoffmeister -- 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

[nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Alexey Petrushin
> Anyway, I'm kind of trying to see what would people consider a good base API I believe CouchDB like API is quite satisfying. In its original form it enforces constraints like: - Map/Reduce as tool for building indexes - only one document can be used at a time for building indexes - documents a

Re: [nodejs] Captcha

2012-02-22 Thread Joshua Holbrook
Why not use the recaptcha bindings and call it a day? Serious question. --Josh On Wed, Feb 22, 2012 at 10:35 AM, Alan Hoffmeister wrote: > Simple captcha generation, an image with distorted letters and numbers... > -- > Att, > Alan Hoffmeister > > > > 2012/2/22 Jann Horn : >> 2012/2/22 Alan Hoff

Re: [nodejs] Captcha

2012-02-22 Thread Alan Hoffmeister
Simple captcha generation, an image with distorted letters and numbers... -- Att, Alan Hoffmeister 2012/2/22 Jann Horn : > 2012/2/22 Alan Hoffmeister : >> Hello there! >> >> Anyone knows if there is some active captcha project for NodeJS? I >> could only find reCaptcha bindings on NPM. > > Well,

Re: [nodejs] Re: parseInt bug

2012-02-22 Thread Mark Hahn
> +'123 px' > NaN And that is exactly correct. '123 px' is not a number. Using that "feature" is worse than trusting type coercion. I would never trust that in my code, just as I always use === instead of ==. Well actually I use "is" in coffee, but that is a different subject. What if you

Re: [nodejs] Captcha

2012-02-22 Thread Jann Horn
2012/2/22 Alan Hoffmeister : > Hello there! > > Anyone knows if there is some active captcha project for NodeJS? I > could only find reCaptcha bindings on NPM. Well, what are you looking for? "captcha" is pretty broad, it could mean anything from "Specify the main character of the series this foru

Re: [nodejs] Free nodejs services

2012-02-22 Thread Dick Hardt
I found dotCloud easy to setup and run. You get two processes for free so you can run a DB and node. You can run a custom version of Node with https://github.com/dotcloud/node-on-dotcloud On Feb 21, 2012, at 8:05 PM, Thomas Blobaum wrote: > Here is a walk-through and list of resources for nod

[nodejs] Re: Connection dies with ECONNREFUSED

2012-02-22 Thread Rambo
I'm also experiencing random disconnects without any emitted errors, that's just bizarre. I'm sure the server is not causing the disconnection. What could be happening? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines

Re: [nodejs] Memory leak

2012-02-22 Thread Jeremy Darling
Are you using a custom web server or something like express? What type/level of caching are you using or did you implement for pages/stores? This sounds a lot like a closure leak. - Jeremy On Wed, Feb 22, 2012 at 8:24 AM, Chris Casey wrote: > Unfortunately I know the pattern very well. > Som

Re: [nodejs] Connection dies with ECONNREFUSED

2012-02-22 Thread Rambo
node v0.6.10 -- 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 uns

Re: [nodejs] Re: parseInt bug

2012-02-22 Thread Jorge
On Feb 22, 2012, at 11:37 AM, danp wrote: > > > +time.substr(-2) > > ~~t.substr(-2) ~~"12345678901" -539222987 -- Jorge. -- 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 su

Re: [nodejs] Connection dies with ECONNREFUSED

2012-02-22 Thread Diogo Resende
On Wed, 22 Feb 2012 07:19:33 -0800 (PST), Rambo wrote: I'm establishing a streaming connection using http.get(). It's supposed to be kept alive forever but suddenly it dies with en ECONNREFUSED error that I cannot catch. I know everyone is sick of this type of error but no one says how to solve i

[nodejs] Connection dies with ECONNREFUSED

2012-02-22 Thread Rambo
I'm establishing a streaming connection using http.get(). It's supposed to be kept alive forever but suddenly it dies with en ECONNREFUSED error that I cannot catch. I know everyone is sick of this type of error but no one says how to solve it. How can I catch that error and what the fuck is th

Re: [nodejs] Memory leak

2012-02-22 Thread Chris Casey
Unfortunately I know the pattern very well. Somewhere in node it is storing all of the served pages. memory increasing by the number of pages served. Just can't figure out exactly where and how to stop it. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/w

Re: [nodejs] Memory leak

2012-02-22 Thread Jeremy Darling
LOL I know the feeling, my servers just got an "Upgrade" to 2k8 R2 64 from 2k3 R2 64. BIG difference especially from the admin side of things. Actually has been a painful migration for me as learning all the changes from 2k3 to 2k8 was painful (we are a MS shop for the most part so I have to "uti

Re: [nodejs] Memory leak

2012-02-22 Thread Chris Casey
This is running on windows server as a service but we have the same memory leak if we run it on the console. We manage our own logging which goes to file. The o/s version id server 2003 R2 x64 SP2 (yes, I know but I have no control over this) -- Job Board: http://jobs.nodejs.org/ Posting guide

Re: [nodejs] Automatically populate dependencies based on node_modules folder contents?

2012-02-22 Thread Jeremy Darling
Thanks for the answer, didn't know that myself :). Might want to update the docs you linked to as I don't actually see --save or -S mentioned anywhere on that page or the install package page. Though I could be missing it. On Tue, Feb 21, 2012 at 10:02 PM, Thomas Blobaum wrote: > yes. > > npm

Re: [nodejs] Memory leak

2012-02-22 Thread Jeremy Darling
What OS are you on and how are you running the parent and child processes? In Windows when running via console or startup script with lots of things written to the console I've noticed that the OS starts to slow down on console writes and tends to each tons of memory when under high utilization.

[nodejs] Memory leak

2012-02-22 Thread Chris Casey
I am having great problems tracking down a memory leak. I have dumped out my global and am sure that nothing is getting stored there so it has to be somewhere in nodes memory structures. Without being able to do snapshots due to the current state of the v8-profiler it is proving very difficult t

Re: [nodejs] Support for multiple ARCHs on Mac OS X (fat binaries)

2012-02-22 Thread Ben Noordhuis
On Tue, Feb 21, 2012 at 21:08, Stephen Bannasch wrote: > At 11:22 AM -0800 2/21/12, Nathan Rajlich wrote: >>I just bumped gyp the other day to account for the "zero or one ARCHs" >>revision, so now you can actually build a 64-bit binary for OS X, though >>still not a fat binary. >> >>I believe o

Re: [nodejs] Fatal Python error: Py_Initialize: Unable to get the locale encoding

2012-02-22 Thread Ben Noordhuis
On Wed, Feb 22, 2012 at 11:12, d4v1dv00 wrote: > Trying to build nodejs version 0.4.8 from GIT, already set the $PYTHON > and $PYTHONHOME to /usr/bin/python2 and /usr/lib where /usr/lib/ > python2.7 situated. > > when executing ./configure --prefix=/opt/node got the following error: > > Fatal Pyth

[nodejs] Re: parseInt bug

2012-02-22 Thread Lothar Pfeiler
On Feb 21, 10:50 pm, Tim Caswell wrote: > Actually, according to that mdn page I just linked, ES5 (which V8 > implements) should not try to parse octal mode and in a way it's a bug. Oh, that's a bummer! Coming from C it's just natural that numbers with preceding 0 are octal numbers. I always th

[nodejs] Fatal Python error: Py_Initialize: Unable to get the locale encoding

2012-02-22 Thread d4v1dv00
Trying to build nodejs version 0.4.8 from GIT, already set the $PYTHON and $PYTHONHOME to /usr/bin/python2 and /usr/lib where /usr/lib/ python2.7 situated. when executing ./configure --prefix=/opt/node got the following error: Fatal Python error: Py_Initialize: Unable to get the locale encoding L

Re: [nodejs] Re: JSLint or not?

2012-02-22 Thread Axel Kittenberger
I wished someone nudged me to these tools, when I asked how I can easily find bracket matching problems in a larger JS files. I tried the ones posted here on my code base and I can definitely say that jslint hurts my feelings and has some IMHO ridiculous claims. JSHint on the other hand had the m

[nodejs] Captcha

2012-02-22 Thread Alan Hoffmeister
Hello there! Anyone knows if there is some active captcha project for NodeJS? I could only find reCaptcha bindings on NPM. -- Att, Alan Hoffmeister -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this me

[nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Juraj Vitko
OK, turns out that the DB in the paper (http://read.seas.harvard.edu/ ~kohler/pubs/mao12cache.pdf) actually is a tree one already (supports range queries while being faster than memcache, mongo, redis, etc.). I haven't read the paper fully, but I assume it will support ordered iteration as well. Go

[nodejs] Re: Capability security for Web apps: request for comment.

2012-02-22 Thread deitch
In a proper authorization system (as distinct from authentication), I have one credential - the one that identifies me as AD - and the system on the backend says, "I see that AD has authorization privileges to do actions A, B and D, but not C or E," and so allows me to do A. Here, rather than auth

[nodejs] Re: parseInt bug

2012-02-22 Thread danp
I need minutes for a modulus operation, and the time string is of format "hh.nn". All methods are working fine: parseInt( time.substr(-2), 10 ) +time.substr(-2) ~~t.substr(-2) Number( t.substr(-2) ) Thank you all, Dan -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.

[nodejs] Re: Intrinsic datastores for Node.js

2012-02-22 Thread Juraj Vitko
Dobes, good that you brought up the Globals DB here - when compiling a list of existing Node.js native addon DB implementations for the nodejsdb.com page, I did not include the embedded Globals because setting it up seemed not straightforward - e.g. you need a Linux machine and do some setup steps

Re: [nodejs] parseInt bug

2012-02-22 Thread Jorge
On Feb 22, 2012, at 8:56 AM, Mark Hahn wrote: > > > The plus sign always does what I want. It always converts in base 10 and > works with integers and floats. > > +"123"=> 123 > +"0123" => 123 > +"012.3" => 12.3 +'123 px' NaN parseInt('123 px', 10) 123 -- Jorge. -- Jo

Re: [nodejs] Re: JSLint or not?

2012-02-22 Thread Evgeny Bogdanov
Yes, Matt. Completely agree. I hope jshint is going in this direction, it is already a lot more configurable than jslint. It can't check the Isaac's style, but at least it does not complain for me now )) -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/w