[nodejs] Re: How do you test code which communicates with a database?

2012-03-10 Thread Roly Fentanes
Like Ian said, most people create a test database. but ideally it is much faster and better to use a mocked database. It's easiest for couchdb since it uses http to communicate. For that you could use https://github.com/flatiron/nock you don't even have to mock the connection. if you know the

[nodejs] Re: NodeConf Reverse Call for Speakers

2012-03-10 Thread Mikeal Rogers
HAHA! urls help :) http://www.nodeconf.com/ On Sat, Mar 10, 2012 at 11:18 PM, Mikeal Rogers wrote: > Just realized I forgot to tell the list about this. > > A week or so back I opened up a "reverse" call for speakers for NodeConf, > which will be this summer in Portland, OR. > > The idea of a rev

[nodejs] NodeConf Reverse Call for Speakers

2012-03-10 Thread Mikeal Rogers
Just realized I forgot to tell the list about this. A week or so back I opened up a "reverse" call for speakers for NodeConf, which will be this summer in Portland, OR. The idea of a reverse call is that instead of just speakers posting what they'd like to talk about attendees get a chance to s

RE: [nodejs] O'Reilly's Fluent conf - javacript conference is now open for registration

2012-03-10 Thread Glenn Block
And 100K ask for platinum sponsors. Sent from my Windows Phone -- From: Jeff Barczewski Sent: 3/9/2012 10:32 AM To: nodejs@googlegroups.com Subject: [nodejs] O'Reilly's Fluent conf - javacript conference is now open for registration O'Reilly's Fluent conf - javacript c

[nodejs] Re: How do you test code which communicates with a database?

2012-03-10 Thread Ian Young
Hey Martin, The path of least resistance is often to just to use the database. Generally, you'll set up a second "test" db so that you don't clobber the data you're developing with. Before your test, you seed the db with some simple data. In your test you let your code pull that data out and ch

Re: [nodejs] Re: garbage collection, patterns: classical/prototypal inheritance and ValueObject

2012-03-10 Thread Mihai Tomescu
I suggest you look at how util.inherits is implemented, then use that for inheritance. With regards to your code, the issue lies in your `.create` function - instead of doing `Object.create(this)` do `Object.create(ValueObject.prototype)`. The reason you're getting the `getProperty` closure add

Re: [nodejs] Re: garbage collection, patterns: classical/prototypal inheritance and ValueObject

2012-03-10 Thread Phoscur
Firefox does not support __proto__, so only V8 leaks here? Am 11.03.2012 03:22, schrieb Jimb Esser: > I didn't completely understand your code, but if you're creating a new > prototype inheriting from the old one multiple times, I think you > should still be able to access all the old ones (e.g. w

[nodejs] Re: garbage collection, patterns: classical/prototypal inheritance and ValueObject

2012-03-10 Thread Jimb Esser
I didn't completely understand your code, but if you're creating a new prototype inheriting from the old one multiple times, I think you should still be able to access all the old ones (e.g. with obj.__proto__.__proto__.__proto__), so since it's accessible, it will not and must not be garbage colle

Re: [nodejs] garbage collection, patterns: classical/prototypal inheritance and ValueObject

2012-03-10 Thread Phoscur
Considering that a long chain of prototypes is created. Interact 1times with a ValueObject, the prototype chain stores 1 getter closures. If the last one is kept is basically stores all older states in it's prototype chain. Is the garbage collection going to clean those closures up at same

[nodejs] Re: How do you test code which communicates with a database?

2012-03-10 Thread theCole
you should checkout http://www.iriscouch.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, send email

[nodejs] How do you test code which communicates with a database?

2012-03-10 Thread Martin Lundberg
I've got an object named UserRepository which has a method named find which uses node-mysql to fetch rows from the database and I'm confused on how to test this code. I've tried reading about mocks but I still can't figure out exactly how to test the code. How do you test code which talks to a

[nodejs] Re: which one is correct ?

2012-03-10 Thread Angelo Chen
This does bring out another topic, when we need a call back? Any rule ? In this case the function wii be replaced with a database one later, so it might have some IO. On Mar 10, 11:49 pm, Axel Kittenberger wrote: > If your user are not in a particular order, add to this: don't use an > array if

Re: [nodejs] spdy?

2012-03-10 Thread Mikeal Rogers
I've been talking with isaac lately about getting this in to core. there is an http refactor coming and this is something i want to get in as part of it. On Mar 10, 2012, at 11:59 AM, Mark Hahn wrote: > I didn't even think to check for a module. I assumed spdy was too new. I > won't underes

Re: [nodejs] garbage collection, patterns: classical/prototypal inheritance and ValueObject

2012-03-10 Thread Marcel Laverdet
If you can write it in JS, v8 can garbage collect it. On Sat, Mar 10, 2012 at 2:46 PM, Phoscur wrote: > Short Question: Do V8 and Jägermonkey garbage collect prototype chains > at some point? > > Let code speak: https://gist.github.com/e83c353f7f16e14e4333 > > Actually, while writing this, I fou

[nodejs] garbage collection, patterns: classical/prototypal inheritance and ValueObject

2012-03-10 Thread Phoscur
Short Question: Do V8 and Jägermonkey garbage collect prototype chains at some point? Let code speak: https://gist.github.com/e83c353f7f16e14e4333 Actually, while writing this, I found the solution (line 69/70), but I would like to leave it without that, as forgetting it may produce a memory leak

Re: [nodejs] spdy?

2012-03-10 Thread Mark Hahn
I didn't even think to check for a module. I assumed spdy was too new. I won't underestimate node again. On Sat, Mar 10, 2012 at 11:35 AM, Nuno Job wrote: > Here you go: > > http://github.com/indutny/node-spdy > http://blog.nodejitsu.com/what-is-node-spdy > > On Sat, Mar 10, 2012 at 7:32 PM, M

Re: [nodejs] spdy?

2012-03-10 Thread Nuno Job
Here you go: http://github.com/indutny/node-spdy http://blog.nodejitsu.com/what-is-node-spdy On Sat, Mar 10, 2012 at 7:32 PM, Mark Hahn wrote: > Has anyone worked on implementing spdy in node as an http alternative? > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://git

Re: [nodejs] spdy?

2012-03-10 Thread Fedor Indutny
Hi! You can try taking a look at: https://github.com/indutny/node-spdy Cheers, Fedor. On Sun, Mar 11, 2012 at 1:32 AM, Mark Hahn wrote: > Has anyone worked on implementing spdy in node as an http alternative? > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.

[nodejs] spdy?

2012-03-10 Thread Mark Hahn
Has anyone worked on implementing spdy in node as an http alternative? -- 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 t

Re: [nodejs] module properties

2012-03-10 Thread Nathan Rajlich
A quick look in module.js and grep through lib/ shows that they're never used... On Sat, Mar 10, 2012 at 10:38 AM, Mark Volkmann wrote: > The module object has these seven properties: exports, parent, > filename, paths, loaded, exited and children. In some sample code I > wrote, I see that the fi

[nodejs] module properties

2012-03-10 Thread Mark Volkmann
The module object has these seven properties: exports, parent, filename, paths, loaded, exited and children. In some sample code I wrote, I see that the first five are getting set. However, it's not clear to me when exited and children are set. I expected that module.children would be an array of t

[nodejs] Re: Eido: Tex+lisp style doumentation language

2012-03-10 Thread Belleve Invis
Overall compilation progress: *Source doc* --parse-> *Source Tree (lisp style)* -- evaluation -> *Generated content* And its output actions is controlled by the document itself (*fileOut* and * consoleOut* marco). 在 2012年3月11日星期日UTC+8上午1时32分22秒,Belleve Invis写道: > > Hi. I am a node developer fro

[nodejs] Eido: Tex+lisp style doumentation language

2012-03-10 Thread Belleve Invis
Hi. I am a node developer from China and I made eido for making douments. link: http://github.com/be5invis/eido Its kernel is Lisp and its syntax looks like TeX. Its system is entirely based on marcos --- or "functons". *defun* is provided. It uses eager evaluation in most cases with some speci

Re: [nodejs] nodejs deployment workflow, what do you use?

2012-03-10 Thread Arunoda Susiripala
We Store our code base at github and bitbucket. So we wrote nariya to continuously deploy when a change happens on a branch (mainly master) 2012/3/10 Tadeusz Wójcik > Hi, > Would do you recommend when deploying nodejs apps? > > Do you use PAAS (nodejitsu, n

[nodejs] nodejs deployment workflow, what do you use?

2012-03-10 Thread Tadeusz Wójcik
Hi, Would do you recommend when deploying nodejs apps? Do you use PAAS (nodejitsu, no.de etc) ? Do you use git push based deployment tools? If so do you use ruby Capistrano or maybe @substack's https://github.com/substack/fleet ? How do you handle dependencies? Do you check node modules into gi

[nodejs] Writing a module to connect to a RESTful database.

2012-03-10 Thread Oni
Hi everyone, As an exercise to learn node.js, I propossed myself to write a module to connect node.js with a Neo4j database. My problem is in how to design the module. Neo4j is a graph database, so it basicaly has nodes and relationships between nodes. Its interface is based on a RESTful proto

[nodejs] Re: minimalist OS for web server: Raspberry Pi?

2012-03-10 Thread Nick
There were some issues with a compile flag for V8 on ARM (I'm running a SheevePlug) a few versions back but that was an easy enough fix and hasn't happened since (touch wood...). Should be able to find it in the nodejs github issue list if it comes back. On Mar 5, 8:02 am, mscdex wrote: > On Mar

Re: [nodejs] Re: which one is correct ?

2012-03-10 Thread Axel Kittenberger
If your user are not in a particular order, add to this: don't use an array if there is no order, but a hash (object). users = {}; e.g. with adding a user by: users[id] = {|somenewuserdata|}; In that case getting a new user is easy as: exports.get_user = function(id, func) { func(users[id] ?

Re: [nodejs] Re: request.js piping w/ autodetect file type

2012-03-10 Thread Alex Topliceanu
Yeah, you're wright, i didn't need the pass-through stream. I needed something to pipe to, but i guess i don't need that. Can't wait for 0.8! On Monday, February 20, 2012 8:14:57 AM UTC+2, Mikeal Rogers wrote: > > What is the passthrough stream for? > > Also, this is something I'll add after 0.8

[nodejs] Re: which one is correct ?

2012-03-10 Thread Angelo Chen
Hi All, surprised to see many discussions about this, I'd say i learnt a lot: 1) return from loop 2) Array.some 3) return error instead of string 4) string is faster sometimes all are very valuable, after evaluating my use case, I choose 2 and 4, and reserve the rest for future use, very educati

[nodejs] Re: HELP! Windows NPM problem

2012-03-10 Thread jg
Sorry. You don't need the formatters option. On Mar 10, 8:04 am, jg wrote: > I ran I tithe same issue. It turned out to be the dependence with > dtrace. I emailed the author of restify and he said he's got a version > where dtrace is ootion. It will require npm 1.1.5, which isn't out yet > thou

[nodejs] Re: HELP! Windows NPM problem

2012-03-10 Thread jg
I ran I tithe same issue. It turned out to be the dependence with dtrace. I emailed the author of restify and he said he's got a version where dtrace is ootion. It will require npm 1.1.5, which isn't out yet though, and when restify is published at 1.3.0 we should be able to install via npm on wind