[nodejs] bug with _read method invocation, or problem with me?

2013-11-03 Thread Dave Clements
I'm guessing probably me, but truly I know not why. Take this mock scenario: var stream = require('stream'); > var readable = new stream.Readable(); > readable._read = function (size) { > console.log(size); > } > readable.read(512); This (with Node 0.10.21) will log 16384 (the high water

[nodejs] the streams read method

2013-10-26 Thread Dave Clements
Hey guys, I've read up on previous posts, but I'm still left scratching my head a little when it comes to the finer details of the additional streams superset. In particular, the docs says of the read method : If size bytes are not available, then it will return null. [1] This isn't what

[nodejs] Re: ANN: dicer

2013-04-11 Thread Dave Clements
nice On Apr 7, 10:47 pm, mscdex wrote: > Announcing dicer[1], a fast, streaming multipart parser. > > FWIW here are some results I received using the simple 'bench- > multipart-parser.js' from node-formidable for various multipart > parsers currently available on npm: > > di...@v0.0.3 (streaming

[nodejs] Re: Steams2: It ain't over till it's over

2013-04-11 Thread Dave Clements
Isaacs, With streams2 being unstable, will there be any refactoring again before v 1.x.x or is the actual API pretty much set in stone? (motive for question- will adding streams chapter to node cookbook 2nd edition) -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.co

[nodejs] Re: Curious question about node/lib/module.js

2013-04-11 Thread Dave Clements
I think this would be more of a design choice, overhead to requiring modules is minimal - if the same module in a parent module is required in a child module I believe its already cached, plus requiring is a one time only event at the beginning of execution the already minimal cost of requiring i

[nodejs] express.io = express + socket.io

2012-12-31 Thread Dave Clements
Hey Brad This is great, it was needful - thanks for doing it. How do you see this keeping apace with express and socket.io versioning? Dave -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message b

[nodejs] Re: TypeScript and node.js

2012-10-01 Thread Dave Clements
I'm surprised at the confusion re: ricks point, it seems to center around the word "optimized"... I believe the point is that typescript enforces optimizable code writing practices upon the developer. Passing in a string to a function that expects a string and only works with it as a string avoid

[nodejs] Re: Node Cook book

2012-09-02 Thread Dave Clements
thanks for the heads up Andy:) On Sep 1, 10:53 am, Adam Reynolds wrote: > I know he's on here, could the author of the book contact me. > > Regards, > Adam -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received

Re: [nodejs] [ANN] Node Cookbook

2012-08-10 Thread Dave Clements
Hey Tim, Thanks :) yeah its fun to 'be an author', my main aim though was to provide a book that anyone with some Javascript abiliy could follow and be eased into Node - but in the process I know from the reviewers that theres some tidbits in there that even the experienced may not have come ac

Re: [nodejs] Node Cookbook [ANN]

2012-08-10 Thread Dave Clements
@josh thanks man, and thanks for the helpful reviewing @mark wow, glad you like it! Now for the confession, I did something very silly and deleted the original post, (it was about 4am) so reposting here: https://groups.google.com/forum/?fromgroups#!topic/nodejs/Zuuu5JyyQoA%5B1-25%5D -- Job B

[nodejs] [ANN] Node Cookbook

2012-08-10 Thread Dave Clements
Hello Everyone I was looking for a good practical book about Node about 10 months ago, but I couldn't really find anything beyond the highly theoretical and  everything I looked at seemed to have negative reviews. So I thought I'd do the research and write the book I wanted.  So without further

[nodejs] Node Cookbook [ANN]

2012-08-09 Thread Dave Clements
Hello Everyone I was looking for a good practical book about Node about 10 months ago, but I couldn't really find anything beyond the highly theoretical and everything I looked at seemed to have negative reviews. So I thought I'd do the research and write the book I wanted. So without further

Re: [nodejs] Can you build a CMS in 14 days? $10,000 Prize

2012-07-13 Thread Dave Clements
Marak you totally confirmed my own sentiments regarding this post. -- 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 th

[nodejs] Node.js for real-time app, that involves bank accounts? Is recommended?

2012-07-12 Thread Dave Clements
When it comes to finance, SQL comes out on top - things like MySQL have been battle tested for decades, accounts information is intrinsicly relational so relational databases are the right fit, ACID compliance with nosql is more liberal but with your project you'd need 100% reliability. Also t

[nodejs] require(), Object.Create and Inheritance

2012-06-08 Thread Dave Clements
like Tim said, so if you changed: var Client = require("./client"); to var Client = require("./client")(); or Object.create(Client, to Object.create(Client(), it should work -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Postin

[nodejs] Re: net.connect() in the browser?

2012-05-22 Thread Dave Clements
I think the closest thing to pure TCP in the browser is websockets, http://www.w3.org/TR/websockets/ The most all around Node library that supports websockets in the browser with good fallbacks is socket.io: http://socket.io/ On Tuesday, 22 May 2012 05:04:33 UTC+1, aliasone wrote: > > I was

Re: [nodejs] Re: NodeJs e-commerce solution?

2012-05-16 Thread Dave Clements
if its orders/payment data you might want to go with couchdb. If mongodb crashed theres a fair chance of data loss because it operates in RAM and periodically stores to disk. In this case that loss can be directly mapped to financial loss. There are ways to set mongo up that gaurd against this,

Re: [nodejs] node.in.js: a new framework for javascript and node that changes everything

2012-05-14 Thread Dave Clements
I think nowjs goes a long way to doing what you're talking about. http://nowjs.com/doc/functions for example. -- 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 t

[nodejs] Re: Forever and lot of processes

2012-04-18 Thread Dave Clements
I wonder if this related to my issue with forever, my hosts have killed all my node processes a few times, because of going over allotted memory - I stopped using Forever and the memory usage has stayed low. On Wednesday, 18 April 2012 09:14:21 UTC+1, ec.developer wrote: > > Hi all, > I got a

Re: [nodejs] HTML to PDF

2012-04-10 Thread Dave Clements
On Tuesday, 10 April 2012 15:52:26 UTC+1, Matthew Hazlett wrote: > > Pricey, should be possible to build a rendering engine using webkit or > something to output to a image. Then insert the image in a PDF. But then you lose the ability to search PDF text -- Job Board: http://jobs.nodejs.org/

[nodejs] Re: Node.js IDE for iPad

2012-04-10 Thread Dave Clements
I had the thought of using two iPads (or an iPad and a cheap HP touchpad), and an external keyboard, and possibly a stand that holds one of the iPads/tablets up in the air. Then I realized that I was basically reinventing the notebook. -- Job Board: http://jobs.nodejs.org/ Posting guideli

[nodejs] Node.js IDE for iPad

2012-04-09 Thread Dave Clements
I do my development on laptop, but I use iPad for updates, admin, etc. on the move. All my work for a site or app is done in a dropbox folder on laptop, i have the dropbox service running on my server so updates are synced automatically, and then I use PlainText [1] which syns with db for nice

[nodejs] client express js

2012-04-07 Thread Dave Clements
hey all, whilst navigating the google webs I've come accross this a few times: http://clientexpressjs.com/ but the github page has 0 pull requests and 0 logged issues, but its been around for about 10months and has sone functionality, just thought I'd put it to the group: does this have littl

[nodejs] Re: best way to read accross stream chunks?

2012-04-02 Thread Dave Clements
hey chad how does your buffer stream define a piece, is it just length based or is there an interface for defining what constitutes a piece, I think something flexible like that would be great for making various streaming parsers -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https:

[nodejs] best way to read accross stream chunks?

2012-03-30 Thread Dave Clements
Hi all, Whenever you read from a data event, each chunk is obviously the size of the buffer, which means pieces of data can be split between two chunks, I'm just wondering how other people reconcile data over the chunking chasm (besides obviously collecting it all first then processing it), a

Re: [nodejs] Re: a good practice to handle date

2012-03-21 Thread Dave Clements
Are you sure this isn't just a time discrepency between first date and second date? node << EOF while(1) { if (Date.now() === Date.now()) { process.stdout.write('.'); } else { console.log('fail'); break; } } EOF

[nodejs] Re: keep alive webserver

2012-03-17 Thread Dave Clements
they updated... -- 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

Re: [nodejs] Nominate me for a NodeConf 2012 Streams talk

2012-03-15 Thread Dave Clements
I wonder is there any demand for a British NodeConf? I wouldn't mind talking about the possibilities of making that happen. -- 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 sub

Re: [nodejs] Re: PHP v8 (a little off topic, but you'se are the best guys I know)

2012-03-15 Thread Dave Clements
I thought it was a optional extension! Including in core surely adds bloat? PHP is already too fat to compete with Node, although it would be cool if we could port Node code straight into PHP for legacy apps. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyen

Re: [nodejs] PHP v8 (a little off topic, but you'se are the best guys I know)

2012-03-14 Thread Dave Clements
en "return" that > variable). > > -Matt > > On Mar 14, 2012, at 11:35 PM, Matthew Vickers wrote: > > This seems to be PHP pushing Javascript through V8. > > $JS is a here doc containing some javascript code. > > Matt > > - "Dave Clements&q

[nodejs] PHP v8 (a little off topic, but you'se are the best guys I know)

2012-03-14 Thread Dave Clements
This is a "Javascript" example from the PHP v8 extension http://www.php.net/manual/en/v8js.examples.php executeString($JS, 'basic.js')); } catch (V8JsException $e) { var_dump($e); } ?> I know this isn't Node, but I just wanted to check I'm not mad... the $JS variable.. that's not javascript

[nodejs] Easy table - nice and simple text table for Node.js

2012-03-13 Thread Dave Clements
hey that's kinda cool -- 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.c

Re: [nodejs] Re: EBADF with socket.setTTL

2012-03-08 Thread Dave Clements
hey Ben, thanks for replying (both to this and in the 0.6.12 ann), I've been attempting to make a pure Node traceroute with dgram and node_pcap but I'm pretty much stuck at the udp data buffers, I'm trying to work out how to extract the icmp data from them to pull out the intermediate IP addres

[nodejs] Re: EBADF with socket.setTTL

2012-03-08 Thread Dave Clements
ion (err, bytes) { if (err) {throw err;} socket.setTTL(128); doit(); }); } which makes the first TTL 64 and all thereafter 128 On Friday, 9 March 2012 01:19:19 UTC, Dave Clements wrote: > > Hey guys, > > I keep getting an EBADF error with this code: > >

[nodejs] EBADF with socket.setTTL

2012-03-08 Thread Dave Clements
Hey guys, I keep getting an EBADF error with this code: var socket = dgram.createSocket('udp4') socket.setTTL(128); socket.send(dummyBuffer, 0, 60, port, domain, function (err, bytes) { if (err) {throw err;} }); Can anyone tell me what I'm doing wrong? Is thi

Re: [nodejs] Re: Security in Node

2012-03-08 Thread Dave Clements
Hey teduso, That's probably true, but when I used PHP for the most part you relied on the framework to cater to these general web security problems, (with the exception of SQL insertion, XSS etc), so many of the points made were, to me, very helpful Dave On Friday, 7 October 2011 20:14:46 UT

[nodejs] Re: Version 0.6.12 (stable)

2012-03-02 Thread Dave Clements
hoorah! Only because I'm currently looking at it... when's ETA for dgram functions like setTTL et. al. ? dave On Friday, 2 March 2012 21:22:14 UTC, Isaac Schlueter wrote: > > 2012.03.02 Version 0.6.12 (stable) > > * Upgrade V8 to 3.6.6.24 > > * dtrace ustack helper improvements (Dave Pacheco) >

Re: [nodejs] Payment Gateway / Card Processing

2012-03-02 Thread Dave Clements
hope they're coming to the uk soon -- 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@g

[nodejs] Save the milliseconds!!

2012-02-27 Thread Dave Clements
This lady (Grace Hopper) really shows the difference between nanoseconds and milliseconds: http://www.youtube.com/watch?v=JEpsKnWZrJ8&feature=player_embedded For me, its inspired me to focus more on writing tighter code, felt like sharing :) -- Job Board: http://jobs.nodejs.org/ Posting guideli

[nodejs] Re: Any existing avatar server/image processing projects?

2012-02-25 Thread Dave Clements
does something like this fit? http://transloadit.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,

[nodejs] Re: Which advices to build my project ? (stream audio)

2012-02-25 Thread Dave Clements
Hi Ludo Before you think of building this as a web app you need to know that browsers don't curremtly capture mic input, which means you'll have to rely on flash. As for audio related stuff, search this user group, theres a few tidbits about sound scatrered about dave -- Job Board: http://jobs

[nodejs] Re: fs.watch

2012-02-24 Thread Dave Clements
Hey Mark, I think due to some restrictions in mac os x, support for fs.watch is patchier, for instance the filename param isn't supported in OS X, its possible these restrictions flow into other areas such as ctime Dave -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.c

[nodejs] Re: JSLint or not?

2012-02-24 Thread Dave Clements
Gentlemen I think we're confusing style and recommended practice. The reason JSLint enforces comma last is because it's the best case scenario for human error prevention. Comma first looks better, but that doesn't mean it IS better. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https

[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] Re: Intrinsic datastores for Node.js

2012-02-21 Thread Dave Clements
I don't know if this is possible or feasible, but from a usability perspective a fully transparent intrinsic database would be outstanding: require('memorymodder'); var users = { fname: 'john', lname: 'smith', email: '...@b.c' }; where memorymodder alters the underlying v8 storage structure, so

[nodejs] Re: JSLint or not?

2012-02-20 Thread Dave Clements
personally I think there's safety in JSLint, Crockford's experience and research have led him to the conclusions he's made for the JSLint rules, his decisions are less about style (i.e. what looks nice to me), and more about the minimization of human error with clearer expression of programmer inte

[nodejs] Re: Node version 0.6.11 (stable)

2012-02-17 Thread Dave Clements
Hey with regard to multiple www-authentication headers, what use cases are there for that. would it be for, say, providing advanced digest authentication for IE followed by digest auth for all others? Also multiple websocket headers, is that essentially for multiple protocols? dave -- Job Boar

[nodejs] Re: Good resource or code to start with Node JS in web development

2012-02-16 Thread Dave Clements
I've found the tutorials on elegant code to be rather helpful, http://elegantcode.com/2010/11/08/taking-baby-steps-with-node-js-introduction/ http://elegantcode.com/2011/12/23/taking-toddler-steps-with-node-js-express/ Also, NodeJitsu docs provide some great points: http://docs.nodejitsu.com/

[nodejs] Re: Google Digest email for NodeJS

2012-02-03 Thread Dave Clements
I knew something wasn't quite right... something on the back of my mind On Feb 4, 12:15 am, Levi Dobson wrote: > The same here. > L > > On Feb 4, 12:12 am, pduch wrote: > > > > > I've just realized that I am not getting my daily Google digest emails > > for this group since the 21st of January.

[nodejs] Re: Hospital self-service kiosk goes live using node.js

2012-01-31 Thread Dave Clements
ah right so the barcode reader converted straight to ascii, hmm v good, cheers On Jan 31, 10:08 pm, Chris Casey wrote: > Dave, > > We didn't need to use anything special. > The unit had a barcode reader attached on the front and we just redirected > the output from that to a standard input f

[nodejs] Re: Hospital self-service kiosk goes live using node.js

2012-01-31 Thread Dave Clements
Hey Chris, That's cool to see a good production use, what did you use for the barcode stuff? Dave On Jan 31, 3:56 pm, Chris Casey wrote: > After a few months work my new hospital self-service kiosks went live at > Calderdale and Huddersfield hospitals. > > http://www.cht.nhs.uk/news/news-item/a