[00:00] tonymilne: so, for example - to render that view, we need to have loaded two separate things 'foo' and 'bar' [00:00] tonymilne: they can load in parallel, but we need them both before we can render. [00:00] tonymilne: with step, "it just works" [00:00] jkridner has joined the channel [00:00] tonymilne: as you see, its going serial through the 2 functions: loadData and render in step. [00:01] tonymilne: but loadData only finished once the two parallel calls inside it have finished. [00:01] mawkor2: but it looks like step uses locks... [00:01] cafesofie has joined the channel [00:01] tonymilne: nah. i don't think so. it uses callbacks and counters under the hood. [00:01] mawkor2: https://github.com/creationix/step [00:01] mawkor2: this? [00:02] mawkor2: or something different? [00:02] tonymilne: yah... it uses locks? [00:02] mawkor2: i just looking atthe code [00:02] Promethet has joined the channel [00:02] augustl_ has joined the channel [00:02] mawkor2: but the lock is just a flag really [00:02] tonymilne: line #? [00:03] hucker has joined the channel [00:03] tonymilne: Yeah, i see the variable, but i don't think his usage is problematic. [00:04] zemanel has joined the channel [00:04] brolin has joined the channel [00:04] wilhelm has joined the channel [00:05] j0shua has joined the channel [00:05] mawkor2: sure I think you could use Step, your code might become a mess though... [00:06] mawkor2: this is really just for json 'joins' [00:06] brainproxy: mawkor2: another general purpose tool for working with graphs of dependencies and dependents in an async signaling environment is Functional Reactive programming [00:06] mawkor2: It's handy I just made it cause I need it [00:06] Tobsn: yeah, step is awesome. [00:06] Tobsn: ;) [00:07] c4milo1 has joined the channel [00:07] tjholowaychuk: SubStack: app.use('/mount-point', static(....)) ? [00:07] c4milo1 has joined the channel [00:07] brainproxy: mawkor2: there's an FRP lib for JavaScript called Flapjax, but you have to massage it a bit for it work in node.js [00:07] tjholowaychuk: seems like what you wanted [00:07] tjholowaychuk: in that mod [00:07] SubStack: tjholowaychuk: oh! [00:07] wookiehangover has joined the channel [00:07] c4milo1 has joined the channel [00:08] tjholowaychuk: you can optionally supply a mount point [00:08] tjholowaychuk: for apps, middleware etc [00:08] c4milo1 has joined the channel [00:08] c4milo1 has joined the channel [00:08] Tobsn: thats like the most asked question [00:08] c4milo1 has joined the channel [00:08] philtor has joined the channel [00:08] SubStack: yeah that does the trick [00:08] Tobsn: you should put that way up in the readme hehe [00:08] c4milo1 has joined the channel [00:08] mawkor2: I'm dynamically modifying the config object you pass in as an actor object [00:08] c4milo1 has joined the channel [00:09] Tobsn: tjholowaychuk, put a big STATIC FILES title over it ;) [00:09] mawkor2: well not 'object' [00:09] SubStack: yeah I've been using express for ages and I didn't know about that [00:09] dipser has joined the channel [00:09] mawkor2: just adding the construct [00:09] Tobsn: SubStack, someone is asking that at least once a day [00:09] mike5w3c has joined the channel [00:09] c4milo2 has joined the channel [00:09] SubStack: that's a problem with the docs then [00:09] c4milo2 has joined the channel [00:09] Tobsn: yep [00:09] Tobsn: 's what im saying, put it in the readme really way up [00:09] tjholowaychuk: connect docs are brutal all around [00:09] c4milo1 has joined the channel [00:10] mawkor2: actor/promise|future works really well [00:10] c4milo1 has joined the channel [00:11] mawkor2: FRP is cool... [00:11] darshanshankar has joined the channel [00:12] brainproxy: yes, EventStreams and Behaviors are uber powerful concepts [00:12] brainproxy: closely related to Arrows and Monads in FP [00:12] hermanjunge has joined the channel [00:13] hermanjunge: some jquery + json guru??? [00:13] brainproxy: however, getting them "right" in JavaScript isn't the easiest thing.. the Flapjax lib has some warts when you dig into it [00:13] hermanjunge: pulling my hair on the way to get this JSON: http://coderwall.com/hermanjunge.json? [00:13] davidban_ has joined the channel [00:13] hermanjunge: using jQuery [00:13] hermanjunge: cross domain prohibited with $.ajax()... [00:14] hermanjunge: invalid character with getJSON()... [00:14] mawkor2: use JSONP [00:14] hermanjunge: did it [00:14] brainproxy: mawkor2: I'm working on a variadic generalization of Flapjax which targets both node.js and browsers, but it's slow-ish going [00:14] tonymilne: hermanjunge: you used jQuery.getJSON ? [00:15] hermanjunge: yep [00:15] hermanjunge: with ?callback? at the end [00:15] McMAGIC--Copy has joined the channel [00:16] hermanjunge: there I got over the cross-domain erro, but get an "Uncaught SyntaxError: Unexpected token :" [00:16] mawkor2: sounds really cool... there seem to be subtle differences in browser js and node.js [00:16] hermanjunge: ... I wanted real bad to release a coderwall badge :( [00:18] kersny has joined the channel [00:18] c4milo1 has joined the channel [00:18] cagdas has joined the channel [00:19] c4milo1 has joined the channel [00:19] mawkor2: and that's why I use dojo [00:19] mawkor2: : \ [00:19] c4milo1 has joined the channel [00:19] brainproxy: mawkor2: yes, but you can work around those things with clever use of orthogonal inheritance patterns, in my experience, and conditionally defining methods [00:19] jmckind has joined the channel [00:20] c4milo1 has joined the channel [00:20] brainproxy: I like joose for that ("Roles" are neat) but I know that straying away from prototypal inheritance gets a chilly reception from some in js / node community :) [00:21] mawkor2: my current game is to never use the 'new' keyword [00:21] mawkor2: we'll see how it plays out [00:21] brainproxy: what r u using? Object.create? [00:21] igl: by using object.create? :P [00:21] mawkor2: it's definitely causing me to learn [00:22] mawkor2: y [00:22] monokrome has left the channel [00:22] igl: do you use dojo.declare? [00:22] mawkor2: ah well [00:22] mawkor2: yes [00:22] mawkor2: but [00:22] mawkor2: it was just because I wanted to play around with dojo.declare [00:23] tonymilne: Thoughts on app architecture: if i plan to use cluster and express, and my app has some "tasks" that i want to schedule periodically, e.g. send a summary of a user's activities to them once a day, I probably should externalize these tasks from my cluster+express app? [00:23] mawkor2: I'm not sure if dojo.declare is a good idea [00:23] samsonjs_ has joined the channel [00:24] mawkor2: dojo query selector is fastest surprisingly [00:24] igl: its fine [00:24] igl: well its sizzle just like jquery isnt it? [00:24] mawkor2: I think it's different let me find the link... [00:25] igl: and if you use a modern browser [00:26] igl: it should fall back to the fast dom query selector anyway [00:27] brainproxy: wow, I need sizzle in my lib [00:27] mawkor2: oh my bad this is really out of date... [00:27] mawkor2: http://blog.creonfx.com/javascript/mootools-vs-jquery-vs-prototype-vs-yui-vs-dojo-comparison-revised [00:28] davidascher has joined the channel [00:28] devaholic: tonymilne: where do you think? [00:29] c4milo1 has joined the channel [00:29] c4milo1 has joined the channel [00:30] c4milo1 has joined the channel [00:30] tonymilne: devaholic: well, i wonder if cluster would result in multiple workers running the task unless i set up a lock or something. [00:30] c4milo1 has joined the channel [00:30] tonymilne: devaholic: I don't really want more daemons with upstart / monit scripts etc. [00:31] c4milo1 has joined the channel [00:31] c4milo1 has joined the channel [00:32] tonymilne: if i weren't using cluster, and i did have them in the same app, i could see the tasks potentially hogging the app if the loop was too tight and long running. [00:32] igl: query selector speed shouldnt really be an issue anymore mawkor2 [00:32] c4milo1 has joined the channel [00:32] tonymilne: devaholic: maybe spawning a new process and having them run from there would be neat... thoughts? [00:33] jmoyers: tonymilne sounds like a use case for a job queue [00:34] jmoyers: if they're tasks that are going to take substantial amounts of time, and you want a durable record [00:34] jerrysv has joined the channel [00:34] tjholowaychuk: you can run cluster without an associated server if you want to implement a job queue with cluster [00:34] tjholowaychuk: we'll need that in the future but i havent started anything yet [00:35] jmoyers: fucking a [00:35] jmoyers: that sounds great [00:35] mawkor2: what bugs me about jQuery is that everything is wrapped around the pretext of a DOM object [00:35] tonymilne: TJ: as in, i can use cluster to just have a general workers setup? [00:35] tjholowaychuk: yup [00:35] tonymilne: Hmm, cool. [00:35] tonymilne: Did you have any thoughts on my question? [00:35] jmoyers: i was going to suggest node-resque [00:36] jmoyers: but it looks like its no longer being actively developed [00:36] tjholowaychuk: cluster().start() [00:36] tjholowaychuk: accepts the same options as normal [00:37] radicality has joined the channel [00:37] omni5cience has joined the channel [00:37] igl: mawkor2: well its convenient, and dojo.query() works 95% the same :p [00:38] mawkor2: and going through x different plugins only to find out x+1 is the plugin that doesn't suck [00:38] radicality: Could someone tell me why in Mongoose, ObjectId is used instead of just using the name of the schema you want to use? I'm trying to just simulate a simple has-a relationship, but do I need to define something of type ObjectId instead of something that I already have a schema for ? [00:38] mawkor2: at least with dojo, you get one chance. either the dojo version sucks or doesn't [00:38] jmoyers: radicality since Schema as child is not supported, only array of type Schema [00:38] mawkor2: which gives you a nice excuse to roll your own [00:38] igl: mawkor2: var $ = dojo.mixin(function(){ return dojo.query.apply(this, arguments); }, dojo); = 99% jquery syntax [00:39] avalanche123 has joined the channel [00:39] radicality: jmoyers: So that means that any type of has-a relationship that's one-to-one has to be using ObjectId ? [00:39] jmoyers: radicality https://github.com/LearnBoost/mongoose/issues/188 [00:39] jmoyers: radicality or a simple object [00:39] igl: $(".foo").connect("onclick", function(){}).query(".bar").style() ..... in dojo [00:39] jmoyers: "Embedding single docs is out of the question. It's not a good idea (just use regular nested objects)" [00:40] mawkor2: yeah connect in dojo is awesome [00:40] jmoyers: personally i think it makes sense to embed with a has-a relationship [00:40] jmoyers: since you might define virtual functions and such [00:40] c4milo1 has joined the channel [00:40] mawkor2: because you can connect disparate events easily [00:40] jmoyers: buuuuut, that appears to not be the way the cookie is crumbling and all that [00:40] radicality: jmoyers: oh alright, thanks, i'll read through the issue on github [00:40] bingomanatee has joined the channel [00:41] jmoyers: in fact i think its a bit silly, since sub: [Schema] is a valid definition [00:41] jmoyers: but not sub: Schema [00:41] c4milo1 has joined the channel [00:41] jmoyers: counterintuitive, anyway [00:41] radicality: yeah, i cannot understand how possibly i can do [Comments] but not Comment (from the example on mongoose) [00:41] c4milo1 has joined the channel [00:41] jmoyers: yup [00:41] jmoyers: exactly [00:41] c4milo1 has joined the channel [00:42] _rain has joined the channel [00:42] c4milo1 has joined the channel [00:42] _rain: . [00:43] radicality: jmoyers: i see people discussed some plugin that could make that possible, you know if anything like that exists yet ? [00:43] baudehlo has joined the channel [00:44] jmoyers: radicality haven't seen it yet [00:44] jmoyers: personally, i dont use schemas as my model objects [00:44] jmoyers: but rather a composite/persistence layer [00:44] AvianFlu has joined the channel [00:44] jmoyers: found that kind of limitation a little irksome [00:45] radicality: oh ok, so you define a model as just an object (?), and then what, how to translate it to a schema ? [00:49] jmoyers: radicality i built a small plugin that makes a schema out of my model base objects [00:50] jmoyers: at that point, i wasn't sure if i should just be using mongodb native :P [00:50] jmoyers: but shrug [00:50] c4milo1 has joined the channel [00:51] igl: why did you choose mongo over mysql for node? [00:51] c4milo1 has joined the channel [00:51] igl: < bit of a db nub and never used mongo [00:51] c4milo1 has joined the channel [00:51] c4milo1 has joined the channel [00:53] jmoyers: igl can morph schemas, nice indexing features (similarish to relational databases), geospatial indexing as a first class citizen [00:53] jmoyers: for me, im testing the waters [00:53] jmoyers: i haven't jumped in all the way [00:53] jmoyers: but its nice and flexible thus far [00:53] c4milo1 has joined the channel [00:54] radicality: jmoyers: oh allright, so just define your models as objects, and then translate to a schema. Ughh, this sounds like a lot of effort. When i saw mongoose it looked very nice/clean simple, kind of like django models, but now I see that stuff is more complicated than I thought, haha [00:54] c4milo1 has joined the channel [00:54] truedat101 has joined the channel [00:55] jmoyers: radicality shrug -- DBRef and friends are coming down the pike, im sure [00:55] jmoyers: and you can probably get away with using simple types for the 90% case [00:55] jmoyers: for me, having model code usable on both client and server out of the box is important [00:55] jmoyers: didn't seem to be a goal of mongoose [00:56] radicality: jmoyers: allright. is your small plugin that maps objects to schemas somewhere on github ? [00:56] jmoyers: radicality not at the moment -- and its actually in coffeescript ;-) [00:56] hackeron has joined the channel [00:57] c4milo1 has joined the channel [00:57] radicality: jmoyers: ah, coffescript. eventually i'll start using that, I just don't want to start doing too many new things at once, haha [00:57] jmoyers: radicality still on the fence about it [00:57] jmoyers: just testing out the waters [00:58] c4milo1 has joined the channel [00:58] c4milo1 has joined the channel [00:59] c4milo1 has joined the channel [01:00] kersny has joined the channel [01:01] icey has joined the channel [01:02] c4milo1 has joined the channel [01:02] c4milo1 has joined the channel [01:03] c4milo1 has joined the channel [01:03] c4milo1 has joined the channel [01:04] Yuffster has joined the channel [01:04] yhahn has joined the channel [01:05] auscompgeek has joined the channel [01:10] abraxas has joined the channel [01:10] brownies has joined the channel [01:13] c4milo1 has joined the channel [01:13] c4milo1 has joined the channel [01:13] c4milo1 has joined the channel [01:13] darshanshankar has joined the channel [01:14] c4milo1 has joined the channel [01:14] c4milo1 has joined the channel [01:14] c4milo1 has joined the channel [01:14] c4milo1 has joined the channel [01:15] c4milo1 has joined the channel [01:17] emuyser has joined the channel [01:19] c4milo1 has joined the channel [01:19] jsulak has joined the channel [01:20] c4milo1 has joined the channel [01:20] c4milo1 has joined the channel [01:22] paul_k has joined the channel [01:22] emuyser: beepa freepa [01:22] omni5cience has joined the channel [01:22] icey` has joined the channel [01:23] ako has joined the channel [01:24] c4milo1 has joined the channel [01:25] c4milo1 has joined the channel [01:25] chadsmith has joined the channel [01:26] c4milo1 has joined the channel [01:26] soulofpeace has joined the channel [01:27] c4milo1 has joined the channel [01:27] c4milo1 has joined the channel [01:27] c4milo1 has joined the channel [01:28] perlmonkey2 has joined the channel [01:28] ardcore has joined the channel [01:28] alek_br has joined the channel [01:28] ardcore has left the channel [01:31] ngs has joined the channel [01:32] c4milo1 has joined the channel [01:32] c4milo1 has joined the channel [01:32] neoesque has joined the channel [01:32] c4milo1 has joined the channel [01:35] EyePulp has joined the channel [01:36] c4milo1 has joined the channel [01:36] c4milo2 has joined the channel [01:36] brolin_ has joined the channel [01:37] c4milo2 has joined the channel [01:37] gtramont1na has joined the channel [01:38] c4milo2 has joined the channel [01:38] k1ttty has joined the channel [01:38] materialdesigner has joined the channel [01:38] bartt has joined the channel [01:39] c4milo2 has joined the channel [01:39] c4milo2 has joined the channel [01:40] arthur_kalm has joined the channel [01:40] c4milo2 has joined the channel [01:40] pplante has joined the channel [01:41] tauren has joined the channel [01:41] pkarl has joined the channel [01:43] jakehow has joined the channel [01:44] brolin has joined the channel [01:44] c4milo1 has joined the channel [01:45] arthur_kalm: hello everyone, I have a noobish question, I'm trying to understand how to make my own functions async with node and I was playing around with an example like this: https://gist.github.com/1001639 [01:46] arthur_kalm: my question is, how do I make that last console.log execute right away and then that giant for loop coming back at some later time [01:46] omni5cience has joined the channel [01:46] itissid has joined the channel [01:47] materialdesign-1 has joined the channel [01:47] c4milo1 has joined the channel [01:47] TooTallNate: arthur_kalm: this thing is, that for loop is blocking [01:47] TooTallNate: there's no way around that [01:47] insin: That's not a callback - you're using a loop to block [01:47] insin: oh snap [01:47] arthur_kalm: ok, I do understand that, but is there any way to make something like that non-blocking? [01:47] TooTallNate: you can, however, so something non-blocking, like a setTimeout call [01:48] ditesh|cassini has joined the channel [01:48] TooTallNate: arthur_kalm: not really [01:48] Opaque has joined the channel [01:48] kersny: https://gist.github.com/1001641 [01:48] arthur_kalm: but say I'm not doing something stupid like that for loop, but instead doing some heavy calculations [01:48] arthur_kalm: and I don't want to block until they're done [01:48] kersny: process.nextTick should do it too [01:48] arthur_kalm: kersny: nice :D [01:48] arthur_kalm: lets try [01:48] TooTallNate: arthur_kalm: if you're doing some long number crunching, you need a sub-process or thread [01:48] TooTallNate: node-webworker would work [01:49] c4milo1 has joined the channel [01:49] brolin_ has joined the channel [01:49] brainproxy: right, once a pass around the event loop enters into some long running set of synchronous ops [01:49] c4milo1 has joined the channel [01:49] steffan has joined the channel [01:49] brainproxy: it's got to finish before other things can happen [01:49] chadsmith has joined the channel [01:50] kersny: that example is missing a parenthesis... other than that it works [01:50] bbttxu has joined the channel [01:50] arthur_kalm: kersny: that's exactly what I was looking for [01:50] c4milo1 has joined the channel [01:50] kersny: but yeah, some type of worker is what you want for heavy processing [01:50] c4milo1 has joined the channel [01:50] brainproxy: yeah, if you don't want the front-end process to become unresponsive [01:50] arthur_kalm: kersny: yeah, got it working [01:50] brainproxy: you need to move cpu intense processes out of the way [01:51] arthur_kalm: ok, this is exactly what I was looking for [01:51] arthur_kalm: thank you all :D [01:51] arthur_kalm: did I mention I love IRC? ;) [01:51] c4milo1 has joined the channel [01:51] jzacsh has joined the channel [01:51] jzacsh has joined the channel [01:52] TooTallNate: arthur_kalm: you get the part about you shouldn't do the heavy processing with the main node process though, right? [01:52] TooTallNate: that's really crucial [01:52] TooTallNate: the gist above is bad practice [01:52] TooTallNate: no offense kersny [01:52] mostmodernist has joined the channel [01:53] arthur_kalm: TooTallNate: that ends up on the same process? so node-webworker gets you onto another process? [01:53] TooTallNate: yes [01:53] kersny: this: http://memegenerator.net/instance/7101278 [01:53] arthur_kalm: what about that stuff I saw floating around a week or two ago about Ryah implementing some new process stuff [01:53] arthur_kalm: kersny: :) [01:53] TooTallNate: `process.nextTick` just runs the given runction _later_ on the main thread [01:54] arthur_kalm: ah [01:54] brainproxy: right, it's like setTimeout [01:54] TooTallNate: if that function blocks for a long time, then that's bad [01:54] arthur_kalm: ok, that makes perfect sense [01:54] arthur_kalm: writing this down ;) [01:54] brainproxy: except that you're guaranteed the function will get called on the next trip around the event loop [01:54] TooTallNate: and ya, there's some new "fork()" function or something [01:54] TooTallNate: that ryan added [01:54] brainproxy: TooTallNate: really? [01:54] TooTallNate: I haven't messed with it yet [01:54] brainproxy: wow that could be cool [01:55] kersny: http://bit.ly/k63hJU [01:55] brainproxy: forks aren't shared memory though right? [01:55] kersny: I think thats the diff he tweeted or something [01:55] mostmodernist: Hello, my $HOME/.bashrc file already has "export PATH=$HOME/local/bin:$PATH" but every time I log into a new bash, i have to type that again or else "node: no command" [01:55] arthur_kalm: kersny: yeah, I think that's what I saw too [01:55] brolin has joined the channel [01:55] TooTallNate: brainproxy: its not fork in the usual Unix sense [01:56] c4milo1 has joined the channel [01:56] arthur_kalm: ok thank you everyone, would anyone mind if I asked a socket.io question? [01:56] __jgr has joined the channel [01:56] arthur_kalm: the docs are seemingly out of sync with the code, and I've tried digging around... [01:56] c4milo1 has joined the channel [01:56] brainproxy: arthur_kalm: what version of node are you running? [01:57] c4milo1 has joined the channel [01:57] c4milo1 has joined the channel [01:58] arthur_kalm: anyway, the question is, I'm trying to send a message to a specific client. So on a specific message (login), I store an associative array between the client socket and the user id. I pull out this socket later on to call that particular user directly. I'm using the 'client.send()' API but Node is bombing saying that the send method doesn't exist... [01:58] c4milo1 has joined the channel [01:58] c4milo1 has joined the channel [01:58] arthur_kalm: brainproxy: 0.4.8 [01:58] c4milo1 has joined the channel [01:59] brainproxy: if node is complaining it doesn exist, maybe you're using .call/.apply in the wrong way [01:59] brainproxy: or have tried to alias the send method in an improper method [01:59] arthur_kalm: brainproxy: I'm not using .call or .apply... [01:59] brainproxy: hmm [01:59] arthur_kalm: what are those calls? [01:59] c4milo1 has joined the channel [01:59] arthur_kalm: I've been using the socket's broadcast method well so far [01:59] brainproxy: what are .call and .apply? [01:59] arthur_kalm: but now I'm trying to send something to the user [02:00] jerrysv has joined the channel [02:00] c4milo1 has joined the channel [02:00] arthur_kalm: brainproxy: I don't know hehe, you said "maybe you're using .call/.apply in the wrong way", I don't know what that is [02:00] c4milo1 has joined the channel [02:00] brainproxy: wth is wrong with c4milo1's irc client [02:00] kriszyp has joined the channel [02:00] c4milo1 has joined the channel [02:01] brainproxy: .call and .apply are used to invoke a method in a context other than the one in which it was defined [02:01] brainproxy: thus changing what the "this" keyworkd will reference [02:01] brainproxy: *keyword [02:01] arthur_kalm: oh.. hrm, haven't used that, still very much a JS and Node newbie [02:01] c4milo1 has joined the channel [02:01] dshaw_ has joined the channel [02:01] AvianFlu has joined the channel [02:01] brainproxy: arthur_kalm: sure, np, we all start somewhere [02:02] arthur_kalm: :) [02:02] mostmodernist: can somebody answer me this: why I have to type this every time i enter a new shell export PATH=$HOME/local/bin:$PATH [02:02] brainproxy: arthur_kalm: it's just that when you're throwing an error that the method isn't defined [02:02] brainproxy: that makes me think that you're calling it on an object for which it's not defined [02:02] Billbad has joined the channel [02:03] c4milo1 has joined the channel [02:03] arthur_kalm: mostmodernist: why would you have to type that? did you export your PATH in your .bashrc or .zshrc [02:03] mostmodernist: yes [02:03] mostmodernist: it is already in my $HOME/.bashrc [02:03] arthur_kalm: brainproxy: ah, no the object is defined, I've console.logged it ;) [02:03] c4milo1 has joined the channel [02:04] brainproxy: mostmodernist: maybe you have a .bash_profile which needs to source .bashrc ? [02:04] arthur_kalm: mostmodernist: when you open a new shell, have you 'echo $PATH' and seen if it has the path you declared? [02:04] arthur_kalm: mostmodernist: what OS are you running? [02:04] brainproxy: arthur_kalm: can you gist or pastie? [02:04] arthur_kalm: brainproxy: but I see what you mean with the undefined stuff... [02:05] arthur_kalm: brainproxy: the code is kind of ugly b/c this is just experimenting, I'll link the file to you, sec [02:05] brainproxy: arthur_kalm: okay, i need to go in a few min, but if I'm away when you get it up, I'll look at it when I get back [02:05] mostmodernist: mac osx 10.6 [02:05] mostmodernist: this is my echo $PATH: /Library/Frameworks/Mapnik.framework/Programs:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin [02:05] brainproxy: mostmodernist: do you have a .bash_profile in ~/ [02:05] arthur_kalm: brainproxy: https://gist.github.com/1001668 [02:06] davidascher has joined the channel [02:06] arthur_kalm: mostmodernist: yeah, you'll need to add it to your .profile or have the .profile pick up your .bashrc file [02:06] arthur_kalm: brainproxy: the second method from the bottom called sendTurn [02:06] arthur_kalm: hmm it does broadcast... that should be send [02:07] brainproxy: which part is failing? [02:07] brainproxy: can you give me a line number to work backward from [02:07] InTech[RU] has left the channel [02:07] c4milo1 has joined the channel [02:07] mostmodernist: where is bash_profile [02:07] springmeyer: mostmodernist: in your home directory [02:08] brainproxy: arthur_kalm: btw, one of the things I recommend most highly is to buy a copy (ebook or printed) of Flanagan's "JavaScript: The Definitive Guide, 6th Edition" [02:08] c4milo1 has joined the channel [02:08] mostmodernist: I don't see it in $HOME [02:08] arthur_kalm: brainproxy: lol, it's that bad eh? ;), hmmm, I think have an earlier edition of that book. I have "The Good Parts" which I have yet to read [02:09] tauren has joined the channel [02:09] c4milo1 has joined the channel [02:09] mostmodernist: home seems to be a the user directory [02:09] arthur_kalm: mostmodernist: do you have a ~/.profile directory? [02:09] brainproxy: arthur_kalm: Flanagan's newest edition is worth its weight in gold [02:09] arthur_kalm: mostmodernist: yes, that is [02:09] arthur_kalm: brainproxy: will check it out, for JS (or any language) I guess you definitely need to read a good book on it [02:10] brainproxy: arthur_kalm: the other super duper helpful thing is www.javascriptgarden.info [02:10] brainproxy: most of the quircks of js are doc'd there [02:10] random123: if you see a file in /etc/ that is a global bash runtime configuration file [02:10] arthur_kalm: brainproxy: been trying to pick it up with YUI Theatre videos with Douglas Crockford, but need more [02:10] random123: For all users [02:10] mostmodernist: arthur_kalm -bash: /Users/angelinegragasin/.profile: No such file or directory [02:10] miccolis has joined the channel [02:10] taurenx has joined the channel [02:11] arthur_kalm: mostmodernist: do something like this 'less ~/.profile' [02:11] arthur_kalm: you can press 'q' to get out of that view [02:11] springmeyer has joined the channel [02:11] arthur_kalm: if you'd like, gist or pastebin it [02:11] mostmodernist: no such [02:11] brainproxy: arthur_kalm: the other thing is to read good code, stuff like isaacs, creationix, tj and substack put out, and others [02:11] MikhX has joined the channel [02:11] c4milo1 has joined the channel [02:12] jacter has joined the channel [02:12] Aria has joined the channel [02:12] arthur_kalm: brainproxy: figured out the prototype stuff by looking at the jade code :), those are good people to look at, ty [02:12] random123: mostmodernist create either /etc/bashrc or /etc/profile with is global and add that export line you keep tryping [02:12] arthur_kalm: brainproxy: any idea from the messy code what I might be doing wrong? [02:12] c4milo1 has joined the channel [02:12] brainproxy: arthur_kalm: any hopes of a line number where it's throwing the error? [02:12] arthur_kalm: it's not that client doesn't have the send method, because I call it earlier on in the on connect [02:12] arthur_kalm: oh [02:12] mostmodernist: should I add it it $HOME, or go back into usr/local territory [02:13] igl has joined the channel [02:13] brainproxy: arthur_kalm: also, which method specifically is it that's bombing? [02:13] arthur_kalm: brainproxy: added a comment: https://gist.github.com/1001668#comments [02:13] arthur_kalm: it's called sendTurn [02:13] arthur_kalm: line 103 [02:13] brainproxy: mostmodernist: I'd stick stuff in ~/ before putting it in a global locale [02:14] arthur_kalm: hmm, that's strange, I could swear OS X came with a .profile or a .bash_profile [02:14] c4milo1 has joined the channel [02:14] arthur_kalm: mostmodernist: you can press 'tab' to complete the name of the file, so it might be .profile [02:14] arthur_kalm: not .profiles, I don't remember, been using zsh for a while now ;) [02:15] InTech[RU] has joined the channel [02:15] brainproxy: arthur_kalm: can you pastie the error message node is throwin [02:16] arthur_kalm: brainproxy: it's in the comments, right at the bottom [02:16] arthur_kalm: ignore the first comment, that was with the broadcast call (didn't save the file) [02:16] brainproxy: ah [02:16] aphelion has joined the channel [02:16] tshpaper has joined the channel [02:16] brainproxy: needed to refresh [02:16] arthur_kalm: so right at the bottom [02:16] arthur_kalm: :) [02:17] c4milo1 has joined the channel [02:17] mostmodernist: arthur_kalm i created an etc/.bashrc with the line in it, but nothing changed [02:18] arthur_kalm: mostmodernist: no, you want to do that in your $HOME directory, which is also ~ [02:18] apoc_: no glob in nodejs stdlib? *grml* [02:19] random123: It's /etc/bashrc you tool [02:19] arthur_kalm: brainproxy: so earlier on, for example on line 27, I make a call to client.send and it definitely only goes to that client [02:19] random123: only .bashrc inside ~/ [02:19] abraham has joined the channel [02:19] arthur_kalm: so the API must exist [02:19] mostmodernist: frankly i dont know why "export PATH=$HOME/local/bin:$PATH" works when I type it, b/c there is no local/bin, only locla/node [02:19] EyePulp has joined the channel [02:19] Lorentz has joined the channel [02:20] mscdex: apoc: https://github.com/isaacs/node-glob [02:20] brainproxy: arthur_kalm: so i'm trying to make the connection between userId and client [02:20] brainproxy: is userId the same object as client [02:20] brainproxy: or is userId a string associated with the session/client [02:20] mostmodernist: i put the etc/bashrc in $HOME/etc/bashrc [02:21] mostmodernist: what what [02:21] arthur_kalm: brainproxy: no... basically it's a blackjack game, and when a user logs in they have an id [02:21] mscdex: apoc: or if you want to go the pure-js and filter route: https://github.com/rjrodger/gex [02:21] arthur_kalm: brainproxy: yes... it's kind of a session [02:21] arthur_kalm: I guess I should use sessions hehe [02:21] arthur_kalm: didn't get that far [02:21] arthur_kalm: brainproxy: I'm basically associating the user id with the user [02:21] brainproxy: so I think this is backward [02:21] brainproxy: socketToPlayer[client] = userId [02:21] arthur_kalm: brainproxy: all the code is on github, not sure if that would help [02:21] mscdex: cool, another multiplayer card game! [02:21] mscdex: :-D [02:22] c4milo1 has joined the channel [02:22] brainproxy: arthur_kalm: maybe it should be socketToPlayer[userId] = client [02:22] arthur_kalm: mscdex: lol, it's really not very good atm, doing it for a work demo with some other coworkers [02:22] fangel has joined the channel [02:22] arthur_kalm: brainproxy: I could do that too [02:22] brainproxy: well when you look it up in sendTurn [02:22] brainproxy: you're expecting to get a client object back [02:22] kersny: mscdex: how is youknow? it was really fun to play [02:22] brainproxy: but I think you're only getting a string [02:22] arthur_kalm: brainproxy: I originally needed the userId based on the client, to remove the player when they disconnect [02:23] apoc: mscdex: thanks, but i'm not sure if that justifies the overhead of an extra library, just to resolve [02:23] apoc: .. ~ in paths [02:23] brainproxy: arthur_kalm: you can't use an object as a property name on an object [02:23] nouh has joined the channel [02:23] c4milo1 has joined the channel [02:23] mscdex: apoc: you can resolve paths in node already with the path module [02:23] Tobsn: god, why does vimeo not support scrubbing wtf. [02:23] arthur_kalm: brainproxy: could I use it in an associative array? [02:23] brainproxy: though maybe it's auto-converting it with a .toString() or something [02:23] arthur_kalm: brainproxy: it was working.. [02:23] brainproxy: arthur_kalm: try flipping it around [02:23] arthur_kalm: brainproxy: hmm... that's interesting [02:23] arthur_kalm: brainproxy: yeah [02:24] arthur_kalm: going to do that right now [02:24] arthur_kalm: brainproxy: thanks so much for helping out :D [02:24] apoc: mscdex: and how do i resolve ~? [02:24] arthur_kalm: sec [02:24] nouh: hey,guys,can anybody help me ? [02:24] brainproxy: you're welcome, guys here entertained a lot of questions for me back in late '09 early, '10 [02:24] mscdex: kersny: haven't had much free time for it, hopefully i will soon though. i got a few specific things i need to work on/fix yet [02:24] brainproxy: so I'm glad to do my part [02:24] mscdex: apoc: if path.resolve() doesn't do it, then you're SOL without using something like node-glob [02:25] bentruyman has joined the channel [02:25] kersny: mscdex: cool [02:25] apoc: mscdex: yep already tried resolve().. well okay [02:25] c4milo1 has joined the channel [02:25] mostmodernist: shit, now export PATH=$HOME/local/bin:$PATH doesn't even make node work ftw [02:25] mostmodernist: wtf am i typing [02:26] c4milo1 has joined the channel [02:26] apoc: anyways that should be in the node core [02:26] mscdex: apoc: submit a pull request, post on nodejs-dev about it, and see if it gets accepted ;) [02:26] c4milo1 has joined the channel [02:27] apoc: mscdex: hmm good idea ;) [02:27] c4milo1 has joined the channel [02:28] arthur_kalm: brainproxy: it works! [02:28] arthur_kalm: brainproxy: so, lesson learned [02:28] gavin_huang has joined the channel [02:28] arthur_kalm: the key in a JS associative array can only be a string [02:28] arthur_kalm: well, that was fun :) [02:29] mscdex: there are no associate arrays in js [02:29] c4milo1 has joined the channel [02:29] mscdex: but you can use integers too [02:29] arthur_kalm: mscdex: I guess it's an object then eh? [02:29] arthur_kalm: b/c it's {} [02:29] mscdex: v8: var lol = {}; lol[2] = 'foo'; lol[2] [02:29] v8bot: mscdex: "foo" [02:29] mscdex: arthur_kalm: yep, it's an object [02:29] brainproxy: arthur_kalm: right, objects have properties, and the names of the properties are strings [02:29] niles|iPod has joined the channel [02:30] brainproxy: if you use a number, that works too, automatically [02:30] c4milo1 has joined the channel [02:30] arthur_kalm: ok, so about that Definitive Guide ;) [02:30] c4milo1 has joined the channel [02:30] brainproxy: if you have an iPad, the PDF version from OReilly makes for good reading in iBooks [02:31] davidascher has joined the channel [02:31] brainproxy: arthur_kalm: just keep in mind that if you're going to use numbers for object properties, then you may be better off with an array [02:31] brainproxy: var x = [] [02:31] brainproxy: instead of var x = {} [02:31] brainproxy: it just depends what you're doing [02:31] JoshC1 has joined the channel [02:32] mscdex: v8: var lol = []; lol[2] = 'foo'; lol.length [02:32] v8bot: mscdex: 3 [02:32] mscdex: ^ [02:32] mscdex: :( [02:32] mscdex: just be aware of that [02:32] brainproxy: right, sparse arrays tell you length is 1 greater than member with highest index [02:33] arthur_kalm: mscdex: lol [02:33] arthur_kalm: brainproxy: I was really looking for a hashmap [02:33] arthur_kalm: or map [02:33] brainproxy: arthur_kalm: for what you're doing [02:33] c4milo1 has joined the channel [02:33] brainproxy: I think {} i sbest [02:33] arthur_kalm: <-- is a Java programmer ;) [02:33] brainproxy: *ist best [02:33] mscdex: ACTION shakes a fist at Java [02:33] arthur_kalm: ok, good to know :) [02:33] brainproxy: man, typos [02:34] rworth has joined the channel [02:34] arthur_kalm: mscdex: lol, it's not half bad, but I gotta say I'm liking JS [02:34] mostmodernist: arthur_kalm now "export PATH=$HOME/local/bin:$PATH" does not invoke the node path [02:34] brainproxy: arthur_kalm: the critical thing would be each member of the map having a unique id [02:34] mostmodernist: i dont know what happened [02:34] arthur_kalm: coffee script is my next jump [02:34] mscdex: i had to deal with Java extensively today and i felt like i needed to take another shower afterwards [02:34] arthur_kalm: brainproxy: yep [02:34] brainproxy: arthur_kalm: well, I would encourage you to go the joose route, but I'm terribly biased ;) [02:35] arthur_kalm: mscdex: lol, depend on the Java... I used to like Java when I was doing GWT and Spring, etc. Doing EJBs with Websphere makes me hate Java a lot [02:35] arthur_kalm: joose? [02:35] mscdex: i've only worked with non-server java stuff, thankfully [02:36] arthur_kalm: mscdex: Java desktop? [02:36] mscdex: kind of, and applets somewhat [02:36] arthur_kalm: mostmodernist: don't really know how to help :( [02:36] arthur_kalm: or rather, I know how to help, but I would need to be there beside you to figure it out better [02:36] mscdex: mostmodernist: are you sure your binaries are still in $HOME/local/bin ? [02:37] arthur_kalm: mscdex: hrm, haven't done much of that... I can say that GWT rocks :) [02:37] c4milo1 has joined the channel [02:37] Me1000 has joined the channel [02:37] c4milo1 has joined the channel [02:38] Lorentz has joined the channel [02:38] mostmodernist: mscdex the only thing in $HOME/local is node [02:38] c4milo1 has joined the channel [02:38] c4milo1 has joined the channel [02:40] sechrist has joined the channel [02:40] mscdex: mostmodernist: try this: export PATH=$HOME/local/node/bin:$PATH [02:41] c4milo1 has joined the channel [02:41] mostmodernist: mscdex that worked for reviving node, but when I open a new shell, I have to type it again [02:43] eyesUnclouded has joined the channel [02:44] mostmodernist: mscdex I'm looking at the damn file, the lie is in there. But have to enter the export command every time I have new bash [02:44] mostmodernist: *line [02:44] hij1nx has joined the channel [02:44] secoif_ has joined the channel [02:44] random123 has joined the channel [02:44] random123: Why does this return "zzz" instead of 1? [02:44] random123: http://pastebin.com/0NACDQ8z [02:45] c4milo1 has joined the channel [02:45] jslatts has joined the channel [02:45] c4milo1 has joined the channel [02:47] jvduf has joined the channel [02:48] mostmodernist: mscdex I checked echo $PATh on a new shell and it doesn't have $HOME/local/node/bin [02:48] mostmodernist: it is not permanent [02:48] mscdex: mostmodernist: you have to put that line in your ~/.bashrc or similar [02:49] mostmodernist: it is [02:49] mostmodernist: in there [02:49] kersny: random123: it's returning the result of the last statement [02:49] c4milo1 has joined the channel [02:49] Emmanuel__ has joined the channel [02:49] mscdex: mostmodernist: did you create ~/.bashrc or was it already populated? [02:49] mostmodernist: i have put in $HOME/etc/bashrc, $HOME/bashrc and the same with .bashrc [02:49] tim_smart has joined the channel [02:49] mostmodernist: i created it [02:50] mostmodernist: there was not one in $HOME [02:50] jtsnow has joined the channel [02:50] mscdex: mostmodernist: do you have any other ~/.bash* files? like ~/.bash_profile ? [02:50] mostmodernist: there is a more global one, which claims to be read only [02:50] mostmodernist: no [02:50] mscdex: hmm [02:50] mostmodernist: only another bashrc in usr/etc [02:50] dshaw_1 has joined the channel [02:50] mscdex: mostmodernist: what os are you on? [02:51] mostmodernist: OSX 10.6 [02:51] sugardave has joined the channel [02:51] mscdex: ok, i don't think osx uses .bashrc by default [02:52] mscdex: mostmodernist: try putting that line in ~/.bash_profile [02:52] mscdex: then start up a new terminal and check [02:52] jacobolus has joined the channel [02:54] mostmodernist: should I try profile, bash_profile, .pmscdex aha! there she is [02:54] mostmodernist: ooops [02:54] mscdex: :) [02:54] mostmodernist: mscdex success at that [02:54] mostmodernist: thank you!!! [02:55] mscdex: np [02:55] mostmodernist: i didn't have this issue when i installed node v0.2.7 [02:55] mostmodernist: dont know why but its all good now [02:56] sreeix has joined the channel [02:57] mscdex: maybe the installation instructions changed or something [02:57] mscdex: who knows [02:57] mscdex: could've installed globally or to a different prefix [02:57] mscdex: :S [02:59] Twelve-60 has joined the channel [02:59] cafesofie has joined the channel [02:59] niftylettuce has joined the channel [02:59] niftylettuce: hmm [03:00] niftylettuce: anyone here want to build time tracker in node.js? [03:01] emuyser has left the channel [03:01] niftylettuce: just idea :) [03:02] jslatts has joined the channel [03:04] hermanjunge has joined the channel [03:05] jslatts: Looking for a node friendly testing framework that is enjoyable to use. Any opinions? [03:06] addisonj_ has joined the channel [03:08] jacter has joined the channel [03:08] tbranyen has joined the channel [03:09] ezl- has joined the channel [03:11] ditesh|cassini has joined the channel [03:11] devaholic: check your nodechat jslatts ;) [03:13] towski has joined the channel [03:15] mbrevoort has joined the channel [03:16] secoif_: jslatts: I use node_jasmine [03:16] jslatts: secoif_: thanks. other rec so far is jspec [03:16] jmckind has left the channel [03:16] secoif_: apparently jspec is deprecated [03:17] secoif_: according to the author [03:17] jslatts: oh [03:17] skm has joined the channel [03:17] jslatts: well, nm then [03:17] digiwano: i like jasmine [03:17] secoif_: node_jasmine has best testing system but the stack traces it outputs are a bit shitty [03:17] digiwano: from what i've used so far [03:18] secoif_: IMHO [03:18] digiwano: not testing well enough atm >_< [03:18] skm has joined the channel [03:18] jslatts: digiwano: i am not testing at all :) [03:18] jslatts: the guilt is piling up [03:18] alek_br has joined the channel [03:18] cafesofie has joined the channel [03:18] digiwano: i cant really do the tdd thing [03:18] tbranyen: digiwano: sure you can [03:18] secoif_: why [03:18] tbranyen: so much nicer [03:18] skm has joined the channel [03:19] skm has joined the channel [03:19] digiwano: when im writing a lib i write the client code first, and i do a lot of organic work making sure what im writing is coming out naturally and easy/fun to use [03:19] Tobsn: ha... and there is the macdefender security update. [03:20] wookiehangover has joined the channel [03:20] digiwano: writing explicit tests instead of just focusing on my mock client script early on, i lose that focus [03:20] wookiehangover: hey gang [03:21] jslatts: digiwano: i am with you. When I am working with my team to design and build an app, i have no problem tdd'ing. When I am just hacking around, I feel like i waste time [03:21] jslatts: but the i hack something into existance and it has no tests :( [03:21] wookiehangover: just curious what's considered best practice as far as committing modules in your project [03:21] kmwallio has joined the channel [03:21] wookiehangover: like, should I ignore ./node_modules [03:22] jslatts: wookiehangover: check them in :) [03:22] wookiehangover: word [03:22] digiwano: its not just wasting time, it distracts me from my core goal in writing a library [03:22] tbranyen: should you check them in? [03:22] tbranyen: that seems very weird [03:22] boaz has joined the channel [03:23] wookiehangover: ahh tbranyen, there's a man I can trust [03:23] tbranyen: versus keeping them as depenancies and running an npm install [03:23] tbranyen: i dunno i mean thats what termkit does [03:23] alek_br_ has joined the channel [03:23] wookiehangover: I guess I just want the equivalent of bundler if I'm not checking them in [03:23] jslatts: seems like the whole point of having them local to the project is that you can do that [03:23] tbranyen: jslatts: the whole point is so you can version entire projects :-/ ? [03:23] tbranyen: subprojects* [03:24] tbranyen: probably depends on what you're doing [03:24] jslatts: i just mean make a source tree work "out of the box" so to speak [03:24] tbranyen: if its unit testing modules i don't see the point in checking those in [03:24] tbranyen: i mean its no different *imo* than submodules [03:25] jslatts: I guess I am just lazy and I want the effort from checkout -> running to be a short as possible. but there are certainly limits. I wouldn't include huge modules [03:26] wookiehangover: ya, that's kinda what the point of my question was [03:26] wookiehangover: cause I don't want to check in over 9000 files from some module [03:26] kersny: if you keep up a package.json, it should be easy enough to `npm install` [03:27] dominick has joined the channel [03:27] jslatts: kersny: that is a good point. [03:27] jslatts: kersny: didn't think of it like that. You win :) [03:28] jerrysv has joined the channel [03:28] davidascher has joined the channel [03:28] wookiehangover: kersny: thanks! [03:28] kersny: don't thank me, thank isaacs for the awesomeness that is npm [03:29] tbranyen: already did, only so much thanks i can exert [03:29] boaz has joined the channel [03:29] kersny: that's what heroku wants for their new hosting too [03:29] tbranyen: without having to preface with no homo [03:29] kersny: so you can push right there also [03:29] kersny: http://devcenter.heroku.com/articles/node-js [03:30] jslatts: i wonder if joyent is doing that yet [03:30] kersny: thats what I was just looking for, iirc they don't [03:30] ditesh|cassini has joined the channel [03:31] davidascher has joined the channel [03:31] kersny: I mean npm is installed and you can ssh in, but I'm pretty sure its not a git hook [03:32] jslatts: kersny: on my no.de's i have to go in and install it all [03:32] jslatts: kersny: so I was about to feel stupid if they were checking for package.json's :) [03:34] skm has joined the channel [03:34] jslatts: so do i want jasmine-node or jasmine-runner? [03:34] kersny: you could probably go in and mess with the post-receive hook and set that up [03:35] tonymilne: Anyone familiar with how the `scope` stuff in connect-auth is supposed to work? [03:36] briznad has joined the channel [03:37] ryah_ has joined the channel [03:38] k1ttty has joined the channel [03:39] matyr_ has joined the channel [03:39] ryah: ACTION waves [03:39] dominick has joined the channel [03:40] tonymilne: ryah: programming time? [03:40] ryah: email time [03:40] ryah: yey :< [03:41] chrislorenz has joined the channel [03:43] brettgoulder has joined the channel [03:45] jacter has joined the channel [03:47] langworthy has joined the channel [03:48] zeade has joined the channel [03:53] b_r8 has joined the channel [03:54] unomi has joined the channel [03:57] topfunky has joined the channel [03:58] tilgovi has joined the channel [03:58] tilgovi has joined the channel [03:59] omni5cience has joined the channel [04:00] ardcore has joined the channel [04:00] dgathright has joined the channel [04:01] ardcore has left the channel [04:01] wookiehangover has joined the channel [04:04] niles|iPod has joined the channel [04:06] niftylettuce has joined the channel [04:06] abraham has joined the channel [04:06] mbrevoort has joined the channel [04:10] mikeal has joined the channel [04:12] jmoyers has joined the channel [04:13] vikstrous1 has joined the channel [04:14] vikstrous2 has joined the channel [04:16] derencius has joined the channel [04:19] Corren has joined the channel [04:20] davidascher has joined the channel [04:24] Adman65 has joined the channel [04:27] MichealBenedict has joined the channel [04:29] fairwinds has joined the channel [04:29] skm has joined the channel [04:29] liar has joined the channel [04:29] skm has joined the channel [04:29] wadey has joined the channel [04:34] ardcore has joined the channel [04:34] cha0s has joined the channel [04:34] cha0s has joined the channel [04:34] springmeyer has joined the channel [04:35] simb has joined the channel [04:35] ardcore has left the channel [04:35] matyr has joined the channel [04:35] mynyml has joined the channel [04:36] simb has joined the channel [04:37] k1ttty has joined the channel [04:38] simb: Hey all. [04:39] simb: At Node.Conf ryah talked about node getting updated for windows. Does anyone know if there is a timeline for that? [04:40] tbranyen: probably when its down [04:40] tbranyen: done* [04:40] chjj: libuv has been making a lot of progress, not sure [04:40] chjj: but yeah, when its done [04:41] slloyd_ has joined the channel [04:41] truedat101 has joined the channel [04:43] madzak has joined the channel [04:44] labuser_ has joined the channel [04:45] mscdex: windows support is important, just like php! [04:47] c4milo1 has joined the channel [04:47] igl: i saw a .net jscript build a year ago and what about minGW? [04:47] simb: Just curious, Looking at doing a byo laptop lab at a conf, but I don't want to have to write setup steps for folks with windows laptops [04:48] tbranyen: simb: good thing node's wiki has them written for you already [04:48] tbranyen: simb: also node binaries exist for windows [04:48] tbranyen: http://node-js.prcn.co.cc/ [04:49] tbranyen: if its only for a lab that may be sufficient [04:49] mscdex: they're missing 0.4.8! [04:49] tbranyen: oh noes [04:49] mscdex: get on the ball! [04:50] rauchg has joined the channel [04:50] simb: do the binaries work well? [04:50] random123: http://en.wikipedia.org/wiki/Category:Alternative_medical_systems [04:51] tbranyen: simb: i haven't used windows in probably close to 6 months, sorry couldn't tell ya :-/ [04:51] random123: http://en.wikipedia.org/wiki/Chiropractic [04:51] simb: thats the problem I have, I have not used windows in like... 7 years :/ [04:51] simb: which of course is why I have no idea how to get node runnnig. other than how I do in linux, which is compile. [04:51] briznad has joined the channel [04:52] simb: and thats not something that I can set as a prereq for a lab :) [04:52] mscdex: well that was random [04:52] mscdex: ;) [04:53] mscdex: can't you easily just package up the cygwin install dir? [04:53] mscdex: or no? [04:53] simb: I have no experience with cygwin, so I am not sure. the prebuilt binaries could be good though. [04:53] digiwano: mscdex: ran into an issue w/ node-oscar, seems like connections.main goes awol (becomes undefined) after a period of time, any thoughts before i try to dig deeper? [04:53] tikva has joined the channel [04:53] mbrevoort has joined the channel [04:53] EyePulp has joined the channel [04:54] ExsysTech has joined the channel [04:54] mscdex: digiwano: huh... weird [04:54] igl: http://newcome.wordpress.com/2010/05/08/node-net-node-js-implemented-in-javascript-on-the-net-runtime/ [04:54] igl: that works [04:54] digiwano: i have 4 instances in the same process [04:54] digiwano: if that might cause it [04:55] igl: no setup [04:55] digiwano: otherwise im not sure, after a while it starts choking on conn.seqNum in _createFlap when i send an IM, which is a reply to one i just got [04:56] mscdex: igl: just be aware node.net != node.js [04:56] igl: true [04:56] mscdex: digiwano: hmm [04:56] igl: im sure jscript will have its quirks aswell [04:56] mscdex: igl: oh jeez... "Writes are implemented as blocking calls currently. I didn�t have time to implement write queues to enforce write ordering." [04:57] bencc has left the channel [04:57] igl: ^^ [04:57] mykul has joined the channel [04:59] itsTodd has joined the channel [04:59] Lorentz has joined the channel [05:00] mscdex: digiwano: what do you mean it starts choking on seqNum? [05:00] chjj: node.net? [05:00] igl: its just a hack [05:00] digiwano: TypeError: Cannot read property 'seqNum' of undefined at OscarConnection._createFLAP (/files/node-loqui/node_modules/oscar/oscar.js:2926:35) at OscarConnection.sendIM (/files/node-loqui/node_modules/oscar/oscar.js:166:19) [05:00] igl: but fun [05:00] mikeal has joined the channel [05:01] digiwano: connection's suddenly undefined [05:02] digiwano: meanwhile the account stays connected [05:02] meso_ has joined the channel [05:02] __sorin__ has joined the channel [05:03] kawaz_air has joined the channel [05:03] mikeal1 has joined the channel [05:03] mscdex: digiwano: connections.main is only set in one place, which is during the initial server connection ... [05:04] digiwano: hrm [05:04] mscdex: digiwano: what did you mean by 4 instances? [05:04] mscdex: digiwano: 4 separate oscar connections? [05:05] tbranyen: igl: he only has http implemented it seems [05:05] JoshC1 has joined the channel [05:05] tbranyen: whoops old [05:05] tbranyen: had scrollback [05:05] igl: yes very little [05:05] digiwano: mscdex: yeah, i have 4 things that go new OscarConnection() [05:05] mscdex: digiwano: ok, that should be no problem [05:05] igl: checking out the source [05:05] digiwano: each connecting one account [05:06] digiwano: and tehy all work at first [05:06] digiwano: and once one starts doin this they all do [05:06] davidascher has joined the channel [05:07] mscdex: i guess i don't have keepalive support in there yet, maybe it has to do with that [05:07] beriberikix has joined the channel [05:07] timmywil has joined the channel [05:07] digiwano: well that'd certainly explain it [05:07] CiRlE has joined the channel [05:07] digiwano: since they all seem to go AWOL at the same time [05:08] neurone-1337 has joined the channel [05:08] mscdex: digiwano: there's a few things on the TODO that i really want to take care of, i'm hoping maybe this weekend i'll have some free time to take care of those [05:08] mscdex: and keepalive is one of them [05:08] digiwano: sweet [05:08] mscdex: should be pretty trivial [05:09] jamescarr has joined the channel [05:10] mscdex: keepalive, ssl support, and automatic rate limiting monitoring are the big three right now [05:10] digiwano: nice [05:11] digiwano: workin pretty swell for me otherwise [05:11] mscdex: good to hear :) [05:12] digiwano: ripped apart a whole complicated perl chat bot over the weekend, left the brain in perl and started redoing all the other components in node [05:12] digiwano: 2 days and im already way happier with it than i was the perl one [05:12] mscdex: cool [05:12] digiwano: using dnode to connect to the backend [05:13] SubStack: dnode-perl? [05:13] digiwano: SubStack: yeah [05:13] SubStack: excellent [05:13] CIA-82: node: 03Fuji, Goro 07master * r8971b59 10/ (src/node.js test/simple/test-cli-eval.js): [05:13] CIA-82: node: `node -e ''` should mean eval(''), not invoke REPL [05:13] CIA-82: node: Fixes #1116 - http://bit.ly/kPKtEr [05:14] SubStack: ACTION likes gluing lots of pieces written in whatever together [05:15] digiwano: eventually i'll move the brain out of perl, but i didnt wanna tackle that now and i really like Hailo apart from the fact that its in perl [05:16] akshatj has joined the channel [05:19] dguttman has joined the channel [05:19] jslatts: it seems to me that CPS makes unit testing difficult. Am I missing something? Should I ditch the inline functions? [05:19] STUPIDWIFI has joined the channel [05:19] benmills has joined the channel [05:20] jslatts: or should I ditch the unit testing? :) [05:22] bad_at_math has joined the channel [05:24] blueadept has joined the channel [05:24] jmoyers: jslatts most node unit test frameworks allow for callback based tests [05:25] stonebranch has joined the channel [05:25] tbranyen: i'd sure hope so [05:25] tbranyen: lol [05:25] yozgrahame has joined the channel [05:25] jmoyers: for instance, expresso has beforeEnd https://github.com/visionmedia/expresso [05:25] jmoyers: etc [05:25] jslatts: jmoyers: its not the callback. its the way i'm structuring the code. I end up with deeply nested functions and I can't test them indivdually [05:25] yhahn has left the channel [05:26] jslatts: jmoyers: unless i pull them out an expose them directly to developer.. which wasn't my intent [05:26] jmoyers: need an example [05:26] jmoyers: my cps is apprently different than yours :P [05:26] tbranyen: jslatts: deeply nested functions that fail should emit events to the original callback [05:26] tbranyen: emit errors* [05:26] pifantastic has joined the channel [05:27] dgathright has joined the channel [05:27] jmoyers: also, i would imagine your tests are on your individual apis, are they not? [05:27] jslatts: tbranyen: yes, I _think_ i am honoring the guidance on that (calling fn(err, value)) [05:28] jslatts: jmoyers: I guess thats where I'm getting hung up. I have a simple api, but there is lots of code is going to be tricky to test through it [05:28] eikaas has joined the channel [05:28] jslatts: if that makes sense [05:28] jmoyers: imo, your tests should be external [05:28] jmoyers: and your goal is to get full coverage [05:28] jslatts: i'm trying to restructure it now to be more testable [05:28] jmoyers: ie orchestrate a situation where you test each code path [05:28] jmoyers: real world situations for your api [05:28] jmoyers: that is [05:29] jmoyers: it should matter whats going on under the covers necessarily [05:29] jmoyers: you should just assert.that.your.expectations.for.completion.are.true ;-) [05:29] jslatts: jmoyers: let me try and construct an example real quick [05:30] jvduf has joined the channel [05:32] jslatts: jmoyers: https://gist.github.com/1001829 [05:33] jmoyers: k [05:33] zeade has joined the channel [05:33] jslatts: jmoyers: so its easy to test exports.watch for its success/failure modes [05:33] laggyluker has joined the channel [05:33] superjudge has joined the channel [05:33] jmoyers: right well [05:33] jslatts: jmoyers: but watchFolderTree is hidden from the caller, and I really don't want it exposed as part of the api [05:34] jmoyers: you are exepcting watchFolderTree to do something with that folder tree, i presume? [05:34] jmoyers: say, fire an event [05:34] jslatts: jmoyers: yes, ultimately I can test the happy path, fn(null, filename) should happen [05:34] boehm has joined the channel [05:34] jmoyers: ^ [05:34] jmoyers: so whats wrong with that? [05:35] mendel_ has joined the channel [05:35] jmoyers: your test case should be throrough -- by that i mean, you might want to have deeply nested folders (in this specific case) or whatever, and make sure that known edge cases are covered [05:35] jmoyers: but ultimately its about the _result_ [05:35] jslatts: one of the "lessons" that has been drilled into my head from static language testing is to break things down into the smallest unit possible, requiring the least amount of test state setup [05:36] jmoyers: that is true [05:36] jmoyers: but you're always going to have to mock things up to the least amount of complexity possible to get full code coverage [05:36] jslatts: so when I find myself constructing elaborate state to cause a failure mode, i start to worry about my design being testable [05:36] jmoyers: ah [05:36] jmoyers: well negative testing can be impotant [05:37] fangel has joined the channel [05:37] jmoyers: but... as you say [05:37] jslatts: what I want to do is mock watchFolderTree and just check that it got called [05:37] jmoyers: well indeed [05:37] jmoyers: i've seen plenty of monkey patch mock function wrappers [05:38] jslatts: i could make it work w/ jasmine's spyOn stuff, but I have to expose those private methods. [05:38] c4milo1 has joined the channel [05:38] jmoyers: right well [05:38] jmoyers: convenience trade off [05:39] jmoyers: personally, the way i'd run that test [05:39] jslatts: my current thought is to move things out of the main api file into other files. and if someone instatiates those objects directly, then they can have at it [05:39] jmoyers: is write something to cover the vanilla case (no directory structure), and forget about the rest of it [05:39] jmoyers: then test the other watch function indpendently [05:39] jmoyers: i dont do a bunch of mocking and isolation personally [05:40] jslatts: yeah.. i probably should just move on. i get design anxiety easily :) [05:40] jmoyers: i think we all do :-P [05:40] jmoyers: i do certainly know that javascript cats tend to do things in the simplest way possible. and mock libraries don't seem simple *or* fun ;-) [05:40] jslatts: trying to be a good npm citizen and have a few tests [05:40] jslatts: lol [05:41] jslatts: testing is not so fun. maybe one or two. then boring [05:41] jmoyers: i was finding jscoverage to give me a sort of goal [05:41] jmoyers: oh shit, only a few uncovered lines! and so on [05:42] jslatts: god. we have been chasing 45% by line coverage at work for ever :) [05:43] benmills: I'm tryint to publish an update to an npm package but the install script is not running anymore that runs node-waf configure build for me. [05:44] benmills: Has something changed around that? [05:44] wadey has joined the channel [05:45] mraleph has joined the channel [05:46] ph^ has joined the channel [05:48] random123 has joined the channel [05:48] znutar: What's a typical amount of line coverage in a well-tested js package? Is there any rule of thumb that most people try for? [05:49] charlesjolley- has joined the channel [05:52] yokoe has joined the channel [05:52] philtor has joined the channel [05:53] hij1nx has joined the channel [05:58] Twelve-60` has joined the channel [06:00] [tm] has joined the channel [06:01] qFox has joined the channel [06:01] MrWarGames has joined the channel [06:01] wbw72 has joined the channel [06:02] sreeix has joined the channel [06:02] MrWarGames has joined the channel [06:03] stephank has joined the channel [06:03] mike5w3c has joined the channel [06:05] descipher has joined the channel [06:07] tylerstalder has joined the channel [06:10] desdur has joined the channel [06:10] __jgr has joined the channel [06:11] samyak has joined the channel [06:13] samyak: hello everyone, I am seeing express.js based server closing down after being idle for a while ( around 10 to 15 minutes ) on ec2 micro instance , what could be the reason [06:13] towski has joined the channel [06:14] zeade has joined the channel [06:15] charlesjolley- has joined the channel [06:16] nornagon has joined the channel [06:17] nornagon: If you match a regex like /(.)+/, is it possible to get a list of all the things the () matched? [06:18] apejens: you can do var matches = mystring.match(/(.+)/) at least [06:18] apejens: and have them numbered from 1 -> [06:18] apejens: or from 0 [06:18] apejens: can't remember [06:18] nornagon: it's 1 [06:19] nornagon: it's actually closer to /( \w+)+/ [06:19] nornagon: and i wanted to not have to split the string again [06:19] apejens: samyak: have you checked dmesg and checked for out of memory killer? [06:20] langworthy has joined the channel [06:20] mraleph has joined the channel [06:20] samyak: apejens, I haven't actually [06:21] samyak: Yup but , I do see "Killed" in the log [06:21] samyak: would that be the outofmemory killer ? [06:23] apejens: samyak: might be. type "dmesg" in the shell [06:23] apejens: that log should say if the OOM killer has done anything [06:26] samyak: yup it is saying [06:26] samyak: let me put it on gist [06:27] ph^ has joined the channel [06:27] samyak: apejens, https://gist.github.com/1001878 [06:27] apejens: [60608.020297] Killed process 6616 (node) vsz:656352kB, anon-rss:31420kB, file-rss:16kB [06:28] samyak: apejens, yup it is .. but how do I actually diagnose my script ? [06:28] samyak: How I pin point the cause ? [06:28] apejens: samyak: I have no idea sadly, I have only written one small node thingy so far myself :p [06:28] __tosh has joined the channel [06:28] samyak: apejens, oh !!! but that helps [06:29] apejens: but perhaps you have some sort of circular reference thingy going [06:29] prettyrobots has joined the channel [06:29] apejens: https://github.com/dannycoates/node-inspector might help [06:30] samyak: I am using it along with mongo db ... [06:31] samyak: I think it is problematic when I dont actually send request for a while [06:35] Schmallon has joined the channel [06:35] zeunix: ryah: could you shed some light on the black magic used in require()? specifically the wrapper that some how makes runInThisContext so much faster then using it by itself? lukstr and I noticed earlier today that if we use the same wrapper it performs runInThisContext more then twice as fast. Any reason it isn't included in the vm module for us to use officially? :) [06:36] `3rdEden has joined the channel [06:37] zeunix: ryah: for reference, lines 416-423 in module.js [06:37] kixxauth has joined the channel [06:38] SamuraiJack has joined the channel [06:42] AvianFlu has joined the channel [06:46] WallyDater has joined the channel [06:48] harsu has joined the channel [06:48] matjas has joined the channel [06:48] pigmej has joined the channel [06:49] nail_ has joined the channel [06:49] langworthy has joined the channel [06:50] sechrist has joined the channel [06:53] asabil has joined the channel [06:53] copongcopong has joined the channel [06:53] emattias has joined the channel [06:56] davidban_ has joined the channel [06:56] simenbrekken has joined the channel [06:56] WallyDater has joined the channel [06:58] MikhX has joined the channel [06:59] Bj_o_rn has joined the channel [07:01] towski has joined the channel [07:01] tdegrunt has joined the channel [07:02] fangel has joined the channel [07:02] harsu has joined the channel [07:02] petrjanda has joined the channel [07:06] djcoin has joined the channel [07:06] supster has joined the channel [07:08] Yoric has joined the channel [07:10] nayrb has joined the channel [07:11] mAritz has joined the channel [07:13] paul_k has joined the channel [07:13] MikhX has joined the channel [07:15] c4milo1 has joined the channel [07:21] dgathright has joined the channel [07:22] groom has joined the channel [07:22] jbpros has joined the channel [07:23] stonebranch has joined the channel [07:26] jacter has joined the channel [07:28] charlesjolley- has joined the channel [07:29] emattias has joined the channel [07:31] bkozal has joined the channel [07:33] [AD]Turbo has joined the channel [07:33] harsu has joined the channel [07:33] [AD]Turbo: hi there [07:33] Epeli has joined the channel [07:34] cha0s has joined the channel [07:34] dgathright has joined the channel [07:35] gozala has joined the channel [07:36] ExsysTech has joined the channel [07:36] towski has joined the channel [07:37] eb4890 has joined the channel [07:38] k1ttty has joined the channel [07:42] sechrist has joined the channel [07:45] harth has joined the channel [07:45] JakeyChan has joined the channel [07:46] JakeyChan: where can i get the source code of require() function ??? [07:46] d0k has joined the channel [07:46] d0k_ has joined the channel [07:46] d0k__ has joined the channel [07:47] d0k has joined the channel [07:47] JakeyChan: i want to know how require works [07:47] digiwano: JakeyChan: https://github.com/joyent/node/blob/master/lib/module.js [07:48] WallyDater has joined the channel [07:49] AvianFlu: JakeyChan: in what sense [07:49] msucan has joined the channel [07:52] WallyDater has joined the channel [07:52] adrianmg has joined the channel [07:53] TomY has joined the channel [07:57] WallyDater has joined the channel [07:59] TomY_ has joined the channel [07:59] jacter has joined the channel [07:59] jeremyselier has joined the channel [08:01] tdegrunt has joined the channel [08:01] jomoho has joined the channel [08:02] jonaslund: zeunix: is it wrapping the require'd file into a new function ? [08:03] tjgillies: if nodejs uses kqueue why do it have to jack up ulimit -n to get more file descriptors? or does that only come into play for watching files? [08:03] zeunix: jonaslund: Not sure. when I get a sec I'm going to continue digging through the source to figure it out. [08:04] zeunix: Curious if node has added support for kqueue/epoll/poll for fs.fileWatch ? I remember some discussion bout adding it and see some uses of them in the source but not sure if it's for the watcher or not. [08:04] tjgillies: im talking about url requests [08:04] zeunix: jonaslund: if you require('module') you can actually get the same performance benefit in your own projects suing vm.runInThisContext. Work with precompiled scripts too, just wrap the content before precompiling [08:05] zeunix: tjgillies: your post reminded me to ask about my question :o) thats all [08:05] tjgillies: zeunix: gotcha [08:05] zeunix: last time I used fs.fileWatch it was super slow for lots of files cause it used thread polling or something. [08:06] WallyDater has joined the channel [08:06] paul_k has joined the channel [08:06] zeunix: jonaslund: it actually increases runInThisContext's performance 2.5x or so depending. Which is a big deal if you're trying to preload/compile files for execution later. [08:07] asdfsafdsa has joined the channel [08:09] jonaslund: hmm [08:09] jonaslund: now that part of the source has changed since i last looked [08:09] cha0s has joined the channel [08:09] zeunix: JakeyChan: what did you want to know? [08:09] jonaslund: but if i don't remember wrong then the wrapper used to be a (function(module,exports) { codeGoesHere })(); wrapper [08:09] supster has joined the channel [08:10] jonaslund: to put module and exports into the scope for the require'd code [08:10] jonaslund: and make "var"'s private to the module [08:10] jonaslund: the speed side effect is probably because the compiler can make scope local variables out of every var decl in the function [08:11] jonaslund: and hence leave out any references to the global scope [08:11] zeunix: jonaslund: interesting. [08:11] jonaslund: zeunix: did you mean that the runInThisContext FUNCTION becomes faster or the code that has been run through it ? [08:11] towski has joined the channel [08:12] zeunix: jonaslund: I mean executing code gets an increase of 2.5x over just using plain old vm.runInThisContext. [08:12] gausby has joined the channel [08:12] jonaslund: yes then it's the scoping [08:12] zeunix: closures are magical [08:12] jonaslund: i have been writing my own ecmascript runtime to test [08:12] jonaslund: not really [08:13] jonaslund: If it's the scope that has been run through it i'm almost certain it's the scope rules since the compiler can make safe assumptions about the function references [08:13] zeunix: magical = awesome [08:13] JakeyChan: zeunix: just for learn [08:13] jonaslund: because if you run function BLAH(){} in the global scope [08:13] jonaslund: it becomes a member of the global function [08:13] jonaslund: now the compiler has NO way of knowing what the value of BLAH will be when you run the function [08:13] Shrink has joined the channel [08:13] Shrink has joined the channel [08:13] jonaslund: however if you have it as a scope local function [08:14] jonaslund: the compiler can easily detect if it becomes a constant [08:14] jonaslund: and skip any runtime checks [08:14] WallyDater has joined the channel [08:14] jonaslund: (because the BLAH symbol is never written to) [08:14] mehlah has joined the channel [08:15] jonaslund: zeunix: As a test [08:15] jonaslund: zeunix: you have some "benchmarking" code there ? [08:15] zeunix: let me see if I can find the pastebin we were using this morning.. [08:16] mc_greeny has joined the channel [08:16] zeunix: http://pastebin.com/qUrU5fWX [08:16] zeunix: that was when I found regular runInThisContext was 2.5 slower then require [08:19] jonaslund: i mean the slow function [08:19] zeunix: http://pastebin.com/EqNV5RAj [08:19] markwubben has joined the channel [08:19] zeunix: let me clarify. the first pastebin is the normal usage of runInThisContext, which is 2.5x slower then require [08:19] jonaslund: yeah i noticed [08:20] zeunix: the second pastbin I posted is using the wrapper, which makes the test slightly faster then require [08:20] jonaslund: you don't have the "slow code" ? [08:20] zeunix: slow code? the example.js? it's just a for looping a hundred million times XD [08:20] jonaslund: oh ok [08:20] jonaslund: errrrrr [08:21] zeunix: what's up? [08:21] jonaslund: then it's no surprise that your code is so slow [08:21] jonaslund: for (var i=0;i<1000000;i++) right ? [08:21] jonaslund: {} [08:21] zeunix: yea? it's just to make the results obvious, I'm not really using a hundred million loop in production hahaha [08:21] davidban_: Is it just me or does Winston refuse to install on OS X through npm? Seems to hang up while running the test suite for mongodb. [08:21] zeunix: this was to compare require to runinthsicontext [08:21] jonaslund: ok then it's definetly the scope wrapping [08:22] jonaslund: zeunix: without the wrapping the variable I becomes a global variable [08:22] jonaslund: and every time you access it you touch the global object via a object property lookup [08:22] jonaslund: otoh when it's wrapped I becomes a function local variable [08:22] zeunix: I'm testing it with my own wrapper closure here in a sec. It makes sense to me. [08:23] jonaslund: and in this case the compiler should even detect that I is always an integer [08:23] jonaslund: so it won't even do any type checks or floatnig point numbers.. just integer mutations [08:23] jonaslund: that it's "only" 2.5x slower is probably because of loop overhead [08:23] Yoric: Hi everybody. [08:24] Yoric: Me and my team have recently announced a new open-source web development platform, and since many have asked for a comparison with Node.js, I have planned to start writing one. [08:24] Yoric: However, for this, I'll need some help from someone [much] more knowledgeable about Node.js than I. [08:25] jonaslund: what platform is that ? [08:25] Yoric: Would someone around here be interested and available to give me a hand? [08:25] Yoric: jonaslund: http://opalang.org [08:25] zeunix: jonaslund: bingo. you are correct sir. Except the wrapper node uses isn't autoexecuting, hence the like for handle.apply() [08:25] Yoric: A few similarities to Node.js, but not many. [08:25] zeunix: it probably looks similar to var wrap = '(function(module,exports){' + content + '});'; cause that's what I used and it worked like a charm [08:26] jonaslund: comming soon ? :P [08:26] Yoric: jonaslund: normally, in about 2 weeks. [08:26] zeunix: jonaslund: obviously you can just use autoexecuting and skip the apply step [08:26] Yoric: (we're still testing the cross-platform ./configure stuff, improving the documentation and collecting feedback) [08:27] jonaslund: Yoric: if you're serious about open source you should prolly put it up when it starts to work to get a community around it, otherwise it's just your teams project that's available [08:27] Yoric: jonaslund: actually, one of the reasons why we haven't released yet is on my blog is here: http://dutherenverseauborddelatable.wordpress.com/2011/05/30/crowdsourcing-the-syntax/ . [08:27] Yoric: jonaslund: I'm quite in favor of of that. However, that's not my call. [08:27] troessner has joined the channel [08:29] jonaslund: so it's a new language ? [08:29] Yoric: Indeed. [08:29] hoodoos has joined the channel [08:29] Yoric: And a very good one, with that :) [08:29] hoodoos: hello, guys, is there any way to get total memory of system running current nodejs process? [08:29] Yoric: (although, as my blog states, we still need to improve the syntax) [08:29] jonaslund: seems very domain specific ? [08:29] Yoric: jonaslund: definitely web-specific, yes. [08:30] Yoric: (it could theoretically be repurposed, but we have made no effort for this) [08:30] zeunix: Yoric: do you a writeup somewhere explaining why the new language is superior to what's currently out there? :) [08:31] cha0s has joined the channel [08:31] Epeli has joined the channel [08:31] beawesomeinstead has joined the channel [08:31] jonaslund: Yoric: Why does people want to compare this to node ? [08:31] eldios has joined the channel [08:31] aliem has joined the channel [08:32] Yoric: zeunix: I'll try and put this together? [08:32] zeunix: Yoric: p.s. the target _blanks on the buy page are annoying as shit hahaha xD [08:32] zeunix: (on your mlstate site, that is) [08:32] ewdafa has joined the channel [08:33] zeunix: seems neat though. lot's of work, I'll keep an eye out. [08:33] pigmej: I wonder what's wrong with that keep-alive in http.request in node... [08:33] Yoric: jonaslund: probably because we write "scalable" and "high-performance" everywhere, plus we're using the same language for the client and the server. [08:33] Yoric: jonaslund: still, that's one of the first reactions we got on Hacker News, Reddit, etc. [08:33] Yoric: zeunix: don't tell me about that website... [08:33] jonaslund: so you translate your code to JS ? [08:33] Yoric: jonaslund: the client-side, yes. [08:33] jonaslund: or run it through some interpreter ? [08:33] Yoric: No, compiled to JS. [08:34] zeunix: on the serverside though, how is your code executed? [08:34] MrSmurf has joined the channel [08:34] MrSmurf has joined the channel [08:34] jonaslund: ACTION guesses ocaml [08:35] `3rdEden: rauchg: you alive? [08:36] jonaslund: Yoric: why not take some existing node or common benchmark and port it to your language instead? [08:36] Yoric: zeunix: compiled to native [08:36] Yoric: jonaslund: you mean for the comparative? A teammate is working on that. I'm working on the feature list + general difference in terms of state of mind. [08:37] SeyZ has joined the channel [08:38] Yoric: jonaslund: right now, I have an empty Google Spreadsheet doc waiting until I find someone knowledgeable about Node.js to give me a hand. [08:38] Yoric: I suppose I could fill it alone, but with my little knowledge of Node.js, this would be a bad idea :) [08:39] tjgillies: happy june [08:39] tjgillies: may is dead [08:39] __jgr has joined the channel [08:39] zeunix: may was gay [08:39] zeunix: not that there's anything wrong with that ;) [08:39] jonaslund: fuuu [08:39] jonaslund: need to pay a bill [08:39] zeunix: autobill baby autobill [08:40] lackac has joined the channel [08:40] c4milo1 has joined the channel [08:41] zeunix: I love how vmware's daemon sits at around 8-10% of thread usage when VMware isn't even open. wth [08:43] bzinger has joined the channel [08:43] `3rdEden: rauchg ping me when your awake [08:44] thalll has joined the channel [08:45] _jgr has joined the channel [08:47] pt_tr has joined the channel [08:48] riven has joined the channel [08:48] riven has joined the channel [08:49] dsirijus has joined the channel [08:49] Yoric: ACTION will try again in 1 or 2 hours, when more Noders are awake. [08:51] zeunix: Yoric: what time is it there? [08:51] herbySk has joined the channel [08:51] Yoric: zeunix: here? nearly 11am [08:52] pt_tr_ has joined the channel [08:52] AhtiK has joined the channel [08:52] zeunix: cause I know quite few of the the noders are on western part of the US, which it's just 1:45am here [08:52] Yoric: That might make things a tad harder. [08:53] thron7 has joined the channel [08:53] c4milo1 has joined the channel [08:54] philhawksworth has joined the channel [08:55] zeunix: I haven't slept for ten days, because that would be too long. [08:56] philhawksworth has left the channel [08:56] Yoric: Come on, you don't need sleep, you're event-driven :) [09:01] gozala has joined the channel [09:02] markwubben has joined the channel [09:02] sreeix_ has joined the channel [09:03] hellp has joined the channel [09:03] [AD]Turbo has joined the channel [09:04] aliem has joined the channel [09:04] dies_el has joined the channel [09:04] m00p has joined the channel [09:05] ChrisBuchholz has joined the channel [09:06] vldcnst has left the channel [09:06] burg has joined the channel [09:07] burg: hello. how can i get, from a http server, an unique id for request? something like sessionID [09:09] harth has joined the channel [09:10] `3rdEden: maybe IP + remote port + useragent would be unique enough [09:11] `3rdEden: if not, generate your own session ids :) [09:11] indutny_ic: burg: you can set cookie and track it [09:11] indutny_ic: `3rdEden: hi! :) [09:11] sechrist has joined the channel [09:13] c4milo1 has joined the channel [09:14] fille12 has joined the channel [09:14] fille12: hellop [09:15] c4milo1 has joined the channel [09:15] `3rdEden: indutny_ic howdy [09:15] fille12: got a proxy question [09:16] pt_tr has joined the channel [09:16] night_fox1 has joined the channel [09:17] burg: `3rdEden, if someone opens it from different tabs of the same browsers or from different browsers, i want different ids [09:17] burg: but same id for different requests from the same tab [09:18] night_fox1: Hi, I'm having trouble getting cluster to work. Node is complaining about their first line "var cluster = require('../')" [09:18] n2liquid has joined the channel [09:19] hwinkel has joined the channel [09:20] _jgr has joined the channel [09:22] `3rdEden: burg than you have to generate ids your self [09:23] `3rdEden: night_fox1 did you do npm install cluster? [09:23] `3rdEden: if so.. you should do require('cluster') [09:25] AAA_awright: burg: Such a request makes absolutely no sense in the context of HTTP, which is stateless [09:25] AAA_awright: burg: http://en.wikipedia.org/wiki/Stateless_protocol [09:25] asabil has joined the channel [09:26] burg: AAA_awright, http://en.wikipedia.org/wiki/Session_ID [09:26] dipser has joined the channel [09:26] AAA_awright: What about it? [09:28] fille12: i got a proxy its like the latent-proxy.js but i cant get it to work with the diffrent dns [09:29] burg: AAA_awright, that`s what i want [09:29] fille12: anyone got the same problem? [09:29] brimster has joined the channel [09:29] n2liquid has joined the channel [09:29] Yoric: AAA_awright: well, HTTP itself is stateless, but that doesn't prevent you from carrying some piece of state back and forth between the client and the server [09:29] jetienne: http://superfad.com/missioncontrol/ traffic visualizer super shiny :) [09:29] Yoric: (aka the session id) [09:29] AAA_awright: Right [09:30] adambeynon has joined the channel [09:30] n2liquid: ok, GTK is crap and I can't write question marks on my laptop keyboard, so please let "-p" represent a question mark [09:31] n2liquid: what's the name of that fancy web-based terminal emulator using node-p [09:31] AAA_awright: You mean this thing? [09:31] systemfault has joined the channel [09:31] systemfault has joined the channel [09:31] n2liquid: yeah, thanks? [09:31] n2liquid: I feel like I'm borrowing a question mark! [09:32] AAA_awright: no problem-p [09:32] n2liquid: lol [09:32] easternbloc_: you mean that http://bellard.org/jslinux/ ?? [09:32] n2liquid: easternbloc_, nah, that's an actual x86 emulator, I think [09:33] thron7 has left the channel [09:33] n2liquid: I mean just a terminal emulator [09:33] AAA_awright: Google says http://jsterm.com/ [09:33] pigmej: it's not the same :) [09:33] pigmej: jslinux is full linux ;) [09:33] pigmej: jsterm is just terminal:) [09:33] easternbloc_: ah ok [09:34] easternbloc_: if you're gonna emulate you might as well go the whole hog though... [09:34] adambeynon has joined the channel [09:34] matyr_ has joined the channel [09:34] n2liquid: AAA_awright, that's cool, but the one I've seen was fancier [09:35] n2liquid: it looked like Cloud9 IDE's [09:35] AAA_awright: The other one I'm familiar with is http://www.masswerk.at/jsuix/ [09:36] hij1nx has joined the channel [09:36] sveimac_ has joined the channel [09:38] night_fox1: `3rdEden, yes. I've got cluster 0.6.2 and node "v0.5.0-pre" [09:40] zeunix: best method to watch for new files in a directory? Obviously I can fs.watchFile(directory, function () { fs.readdir(directory, function (err, files) { // compare old directory array to new one }) }) [09:40] n2liquid: well, shit [09:40] n2liquid: I hate going to bed [09:40] zeunix: anything better? [09:40] n2liquid: I must really be just a kid yet [09:40] n2liquid: :\ [09:40] n2liquid: see you, thanks AAA_awright [09:41] stagas: zeunix: https://github.com/jslatts/stalker [09:41] AAA_awright: If anyone has a good terminal that supports ANSI codes AND copy/paste [09:43] zeunix: stagas: thanks, but that's just an modular version of what I posted. which I know works, but it feels like repeatedly getting the file tree and comparing it is excessive. [09:44] Yoric: Hi everybody [09:44] Yoric: Me and my team have recently announced a new open-source web development platform, and since many have asked for a comparison with Node.js, I have planned to start writing one. [09:44] Yoric: However, for this, I'll need some help from someone [much] more knowledgeable about Node.js than I. [09:45] stagas: zeunix: how else? [09:46] AAA_awright: Ooh http://code.google.com/p/shellinabox/ [09:46] zeunix: stagas: that's my point, I don't think there's any other method but I wanted to double check with everyone. [09:47] stagas: zeunix: it's not like it's a heavy operation, drives cache that stuff [09:48] zeunix: stagas: well it's just like most things. It's not super heavy in itself, but do it a ton of times it adds up to a certain extent. Just checking for best practice, that's all. Thanks though. [09:48] stagas: zeunix: and also you wouldn't want that in a production enviroment [09:48] zeunix: stagas: because? [09:49] stagas: zeunix: sorry I was thinking app restarting [09:49] zeunix: stagas: nope, different purpose. [09:50] stagas: zeunix: you could run it in a worker [09:51] zeunix: stagas: it is indeed. :) [09:51] margle has joined the channel [09:53] night_fox1: I get "Cannot find module '../'" when I try the cluster example. [09:54] Shrink has joined the channel [09:54] Shrink has joined the channel [09:54] eb4890 has joined the channel [09:55] night_fox1: I can't see why node doesn't like me including this directory. Why the line var cluster = require('../') even include cluster? [09:56] sveimac has joined the channel [09:57] superjudge has joined the channel [09:58] rchavik has joined the channel [10:00] skohorn has joined the channel [10:00] HektoR_ has joined the channel [10:01] HektoR_: Hello guys. I have simple chat server with node.js and now.js. but when i send message from firefox 4.0 i'm getting error :can't convert null to object. in other browsers everything works perfectly. anyone knows how to fix this ? [10:01] jacobolus has joined the channel [10:02] mike5w3c has joined the channel [10:03] jetienne: q. about express.js, i would like to make some variables available in all templates, like req.session, or req.flash, how can i do that ? [10:04] aliem has joined the channel [10:06] HektoR_: anyone can help ? [10:06] stagas: jetienne: many ways. a middleware with res.locals({ session: req.session, flash: req.flash }); next() [10:07] jetienne: stagas: oh you know express.js ? i gonna ping you a lot :) [10:07] jetienne: meanwhile looking at the middleware thanks [10:08] stagas: jetienne: if they're constants, use app.locals({ foo: 'bar' }) outside no middleware [10:09] christophsturm has joined the channel [10:10] __doc__ has joined the channel [10:12] AhtiK has joined the channel [10:15] __doc__: Hi, any idea when I use socket.io if I should proxy trough to node.js or have node.js front-facing? [10:16] night_fox1: HektoR_, I'm kind of new to this, but I'd suggest using socket.io, because it uses different transports depending on what's supported. Otherwise, you need to figure out where your null is coming from in FF4! [10:16] HektoR_: night_fox1: now.js is using socket.io [10:17] night_fox1: HektoR_ sorry, i'm new to node.js and this stuff. [10:17] jed___ has joined the channel [10:18] night_fox1: Can anyone answer my question about cluster? [10:18] `3rdEden: night_fox1 i already answered it [10:18] jed___: just you and me in a room. feels like old times. [10:18] `3rdEden: i said do require('cluster') instead.. not require('../') [10:19] jed___ has left the channel [10:19] k1ttty has joined the channel [10:19] HektoR_: night_fox1: no problem man [10:22] HektoR_: night_fox1: this is the code where is the error: if(Object.hasOwnProperty.call(theArgs[i], 'type') && theArgs[i].type === 'function'){ i have no idea what's wrong with FF [10:23] ckknight: HektoR_: theArgs[i] is null [10:23] HektoR_: ckknight: yes but why this error appears only in FF [10:23] ckknight: you'll need to paste more code [10:23] ckknight: like, I have no idea what theArgs is given your single line [10:24] liquidproof has joined the channel [10:24] adambeynon has joined the channel [10:27] HektoR_: strange thing is that this only happens sometimes... for example if i close FF and reopen again it works perfectly but if i refresh windows i'll get this error [10:27] night_fox1: `3rdEden, cluster successfully required. However, with 1 cpu/worker, I get an error. "EPERM, Operation not permitted" at Server._doListen (net.js 1101:5) [10:28] fly-away has joined the channel [10:28] FND has joined the channel [10:29] `3rdEden: I think it tries to create a socket file, make sure you directory where you start node in is writeable [10:29] `3rdEden: if that's not the issue, i have no clue [10:30] harsu has joined the channel [10:31] don`catnip has joined the channel [10:35] mahna has joined the channel [10:38] shreekavi has joined the channel [10:39] dbenjamin has joined the channel [10:39] dbenjamin: Hi [10:39] dies_el has left the channel [10:44] night_fox1: `3rdEden, you are right! It's a bit weird though. cluster must use a different user or group or something, because it failed when the directory permissions were 755, but worked when I changed it to 777! Thanks very much! [10:44] jetienne: stagas: any other way to get flash/session automatically in the tempalte ? i cant take off the middleware solution [10:44] piscisaureus has joined the channel [10:45] jetienne: stagas: i get 'Error: req.flash() requires sessions' when i use req.flash() within a middleware... but not within a .get('/') [10:46] stagas: jetienne: is that middleware below the express.session? [10:46] jetienne: stagas: yes [10:48] jetienne: stagas: https://gist.github.com/1002105 [10:49] stagas: jetienne: where's next() ? [10:49] jetienne: :)))))))) [10:50] jetienne: stagas: i added next() at the end, and nothing change [10:51] hij1nx_ has joined the channel [10:52] stagas: jetienne: don't know of req.flash() behaviour, it may work in routes only. maybe add it as a dynamicHelper: app.dynamicHelpers({ flash: function(req, res) { return req.flash() } }) [10:53] night_fox1: `3rdEden, er wait no, it still doesn't work. [10:54] sirjuh has joined the channel [10:56] jetienne: stagas: thanks! it did the job :) [10:56] dbenjamin: i face an issue with node under windows. As i understand, node.js needs cygwin to be able to run properly under windows. So far so good, i already had cygwin installed, i have installed node binaries, and i can run a node process [10:56] ayo has joined the channel [10:56] dbenjamin: i.e : node test.js [10:56] dbenjamin: runs well [10:57] stagas: jetienne: cool! [10:57] dbenjamin: but i soon as i try to run a file from a PATH, it doesn't work [10:57] dbenjamin: i.e : node "C:\node-test\test.js" [10:59] dbenjamin: error : Error: Cannot find module '/cygdrive/c/node-test/C:\node-test\test.js' [10:59] dbenjamin: Don't know if that's an cygwin issue or not [10:59] dbenjamin: *a [10:59] stagas: dbenjamin: probably because you need to use unix style paths? [11:00] jarek has joined the channel [11:00] jarek has joined the channel [11:01] dbenjamin: stagas: well, i can, manually, but the thing is that it is a librarie (in my PHP project) that needs to run the command, and it automatically generate the path [11:01] dbenjamin: so i can't control it [11:01] stagas: don't mix php with node.js [11:02] dbenjamin: lol [11:03] dbenjamin: i'm using an assets control lib that handles less filter [11:03] dbenjamin: i don't see why i should not do that :) [11:03] dbenjamin: the exact command the lib tries to run is : node C:\cygwin\tmp\ass37F5.tmp [11:03] stagas: because random errors like these occur [11:04] dbenjamin: this is not a random error, the lib simply tries to exec the command : node.exe C:\cygwin\tmp\ass37F5.tmp [11:04] Swizec has joined the channel [11:04] jomoho has joined the channel [11:05] mahna_ has joined the channel [11:05] broofa has joined the channel [11:06] okuryu has joined the channel [11:08] tojochacko has joined the channel [11:09] jtrudeau has joined the channel [11:09] Qbix1 has joined the channel [11:11] Shrink has joined the channel [11:11] rstacruz has joined the channel [11:13] Shrink has joined the channel [11:13] Shrink has joined the channel [11:14] framlin: hm, but it seems, that the path your php-lib is creating is not feasible for usage with node under cygwin, so it may help to adapt your php-lib [11:14] eb4890 has joined the channel [11:15] adambeynon has joined the channel [11:15] mendel_ has joined the channel [11:16] dbenjamin: framlin: yeah, that's what i was just thinking :) [11:16] boehm has joined the channel [11:17] ExsysTech has joined the channel [11:18] FireFly has joined the channel [11:20] shreekavi has left the channel [11:21] jsulak has joined the channel [11:21] Shrink has joined the channel [11:21] Shrink has joined the channel [11:21] Yoric: Hi everybody [11:21] Yoric: Me and my team have recently announced a new open-source web development platform, and since many have asked for a comparison with Node.js, I have planned to start writing one. [11:21] Yoric: However, for this, I'll need some help from someone [much] more knowledgeable about Node.js than I. [11:21] Yoric: So, if anybody has knowledge&time, please ping me. [11:23] eldar has joined the channel [11:24] AhtiK has joined the channel [11:26] jomoho has joined the channel [11:28] dgathright has joined the channel [11:29] blueadept has joined the channel [11:30] mAritz: is there a proper method to upgrade npm to >1.0? or just remove <1.0 and install the new one? [11:30] harsu has joined the channel [11:33] mAritz: okay, just "curl http://npmjs.org/install.sh | sh" apparently. :D [11:34] Charuru has joined the channel [11:36] bshumate has joined the channel [11:38] Viper-7 has joined the channel [11:39] broofa has joined the channel [11:39] dgathright has joined the channel [11:40] stagas: another new lib! https://github.com/stagas/ministore [11:45] avalanche123 has joined the channel [11:46] dyer has joined the channel [11:46] dyer has joined the channel [11:51] `3rdEden: y [11:51] FND has left the channel [11:52] Qbix2 has joined the channel [11:53] talin has joined the channel [11:53] talin: hello. i am trying to install node.js on freebsd, but it says that i can't because i'm running amd64 [11:53] jetienne: stagas: nice. i will use it for my prototype. i planned to use db.js from tj [11:53] talin: is there any way around that? [11:54] jetienne: https://github.com/visionmedia/finance/blob/834de995eadc6ce56a358b1ad481d304e728367c/lib/db.js stagas [11:54] Afal has joined the channel [11:54] Shrink has joined the channel [11:56] stagas: jetienne: cool, similar logic, in ministore the db is a dir and collections are json files [11:57] stagas: jetienne: and there are both sync and async versions depending on whether you provide a callback [11:57] ako has joined the channel [11:57] mAritz: hm... how do i get connect-redis to work with the new npm? i see that there are issues open regarding this, but apparently no work has been done on this for more than half a month. :( [11:57] jetienne: stagas: yep i was wondering about locking issue [11:57] jetienne: stagas: if i use a single process, am i safe ? [11:58] sudhirjonathan has joined the channel [11:59] kuya has joined the channel [11:59] stagas: jetienne: it shouldn't block if you use async. actually .set(), .remove() and .clear() trully need it as these actually save to disk [11:59] kuya: does anyone have a glob implementation for node that isnt node-glob... [12:00] talin has left the channel [12:01] FND has joined the channel [12:02] jetienne: stagas: ok for non block, but about about data corruption ? like i save async, and reread async in the next request... am i garanteed to get the data ? [12:02] jetienne: stagas: same issue with loading... [12:03] jomoho has joined the channel [12:04] neshaug_ has joined the channel [12:04] stagas: jetienne: all reads are from memory, and the db is saved all at once, so it should be safe. it never reads from disk other than the init [12:05] stagas: jetienne: so yes you're safe [12:06] niles|iPod has joined the channel [12:06] hellp has joined the channel [12:06] jetienne: stagas: cool thanks [12:07] FND: I'm struggling to create a simple NPM package: https://gist.github.com/1002168 - in that directory: `npm link; echo 'require("sample-package");' | node` # Error: Cannot find module 'sample-package' [12:07] FND: any hints what I might be doing wrong? [12:10] TheFuzzball has joined the channel [12:11] binBASH has joined the channel [12:11] pen has joined the channel [12:13] Afal: http://pastie.org/2003088 anyone can point out why this is giving me an error? [12:14] softdrink has joined the channel [12:14] slickplaid: Afal, have you tried it without the protocol in the domain name? [12:15] Sephi-Chan has joined the channel [12:15] Sephi-Chan: Hello [12:15] Sephi-Chan: i installed the package juggernaut with npm [12:15] Sephi-Chan: But it seem not to be in my path (since the command juggernaut is missing) [12:15] skm has joined the channel [12:15] FND: Afal: you need to use { host: "google.com", path: "/" } (path might be optional) [12:16] slickplaid: Afal, and no trailing slash :) [12:16] skm has joined the channel [12:16] Sephi-Chan: What should i add to my path ? [12:17] Afal: slickplaid: ah I see [12:17] skm has joined the channel [12:17] `3rdEden: Sephi-Chan npm install -g juggernaut [12:17] skm has joined the channel [12:18] skm has joined the channel [12:18] boaz has joined the channel [12:19] binBASH has left the channel [12:19] Sephi-Chan: `3rdEden: Perfect, thanks :) [12:19] SeyZ has joined the channel [12:20] tapia has joined the channel [12:21] tapia: Hi [12:21] tapia: I'm trying to load the content of a file (JSON) into a variable [12:22] tapia: is ok to do that with require() ? [12:22] `3rdEden: sure [12:22] `3rdEden: why not [12:22] FND: why would you do that though [12:22] `3rdEden: thats how I manage my configuration as well.. [12:22] tapia: FND, how can I do it then? [12:22] slickplaid: nconf? [12:22] FND: JSON.parse(fs.readFileSync(myFilePath, "utf-8")) [12:22] `3rdEden: it's much easier than doing a readFileSync and JSON.parse [12:22] tapia: (coming from python, not very confortable with JS yet) [12:23] kriszyp has joined the channel [12:23] sudhirjonathan has joined the channel [12:23] slickplaid: Check out https://github.com/indexzero/nconf works very nicely IMO :) [12:23] FND: the above assumes `var fs = require("fs");` [12:23] `3rdEden: so why include all the modules [12:23] `3rdEden: if you can just do [12:24] `3rdEden: require('./lib/myconf') [12:24] `3rdEden: it's much easier.. and less bloated than the other suggestions [12:24] rputikar has joined the channel [12:24] framlin: I would use require only for modules. Thats much more clear, thn to use it for data, too ... [12:25] FND: `3rdEden: basically, while `require` might work, it's extremely hacky and abusive - and thus not future-proof IMO [12:26] davidban_ has joined the channel [12:26] drudge: how is it not future proof [12:26] FND: require might become more strict [12:27] FND: essentially, while I can use a towel for clothing, that's not what it's made for - depending on the context, it might be sufficient though [12:27] tapia: I agree with FND, I'll do it with readFileSync [12:28] some1else has joined the channel [12:28] tapia: thank you, guys :-) [12:28] FND: tapia: I assumed you would, given the Pythonic background :) [12:28] `3rdEden: require is build to require javascript files [12:28] `3rdEden: a json config is a javascirpt file [12:28] `3rdEden: i don't see any thing hacky about it [12:28] drudge: yeah me neither [12:28] `3rdEden: it's especially handy if you modulize your node application [12:29] `3rdEden: as requires are cached by default [12:29] `3rdEden: and readFileSync is not [12:29] tapia: oh [12:29] `3rdEden: also [12:29] tapia: that's a good point [12:29] `3rdEden: you can do require('').database [12:29] `3rdEden: to only get the database [12:29] `3rdEden: sure you can also do that readFile [12:29] `3rdEden: but you need to wrap it again in ( ) [12:29] tapia: the file I'm trying to import is a JSON scheme [12:29] tapia: so caching would be great [12:30] fumanchu182 has joined the channel [12:30] sreeix has joined the channel [12:31] framlin: yes, but IMHO javascript-files are meant as JS-Source-Code-Files and not JSON-Coded-Data-Files [12:31] niles|iPod has joined the channel [12:32] slickplaid: Isn't JSON, by definition, Javascript? [12:32] ErikCorryV8: require is a blocking call. [12:32] framlin: yes, it is, but its DATA and not CODE [12:32] ErikCorryV8: It's only intended for startup. [12:33] tapia: anyway, I get an error while importing [12:33] framlin: modulize your app means to seperate your code in handy parts, not to partinionize youur data [12:33] tapia: but it's not too verbose [12:33] tapia: $ node test.js [12:33] tapia: node.js:134 [12:33] tapia: throw e; // process.nextTick error, or 'error' event on first tick [12:33] tapia: ^ [12:33] tapia: ReferenceError: fs is not defined [12:33] tapia: at Object. (/home/tapia/workspace/kuti-server/test.js:3:1) [12:33] tapia: at Module._compile (module.js:407:26) [12:33] jomoho has joined the channel [12:33] tapia: at Object..js (module.js:413:10) [12:33] tapia: at Module.load (module.js:339:31) [12:33] tapia: at Function._load (module.js:298:12) [12:34] tapia: at Array. (module.js:426:10) [12:34] sudhirjonathan has joined the channel [12:34] tapia: at EventEmitter._tickCallback (node.js:126:26) [12:34] FND: tapia: `var fs = require("fs");` [12:34] drudge: don't paste like that in here, use gist or pastie [12:34] drudge: please :) [12:34] tapia: drudge, ok, sorry [12:34] framlin: seems you forgt your var fs = require('fs') [12:35] tapia: FND, yes, that's how I did it [12:35] FND: pastebin please [12:35] tapia: var schema = require ("./foo.json"); [12:36] c4milo has joined the channel [12:36] `3E|IDLE: ErikCorryV8 readFileSync is also blocking.. ;D [12:36] tapia: FND, http://pastebin.com/5k6hSvF7 [12:36] copongcopong has joined the channel [12:36] framlin: tapia: where is your var fs = require("fs"); ? [12:37] framlin: I can't see it within your bastebin [12:37] tapia: Do I need to import fs to do a require? [12:37] adambeynon has joined the channel [12:37] drudge: no [12:37] drudge: line 3 doesn't reference fs though, are you sure you pasted test.js? [12:38] drudge: and/or saved [12:38] joeshaw has left the channel [12:38] tapia: drudge, I'm trying to do the json import with require(), not with fs.readFileSync [12:38] tapia: the pastebin is the code I'm executing [12:39] replore_ has joined the channel [12:39] framlin: ah, ok, what is your kuti_rpc_schema.json looking like? [12:40] tapia: is a json schema [12:40] tapia: and it's valid json, tested in jsonlint.com [12:40] hybsch has joined the channel [12:41] framlin: hm, as I understand this require-stuff, you have a statement like exports = {'bla':'fasel'} within your "module" [12:41] tapia: mmmm [12:41] tapia: no [12:41] framlin: you have to have such a statement [12:41] tapia: it's just the json [12:42] fyskij has joined the channel [12:42] tapia: framlin, if I do the import with readFileSync i'll need that also? [12:43] drudge: no [12:43] framlin: no, then you can read the data like any "text" and parse it with JSON [12:43] _rain has joined the channel [12:43] tapia: ok [12:43] tapia: I'll do it with readFileSync then [12:43] tiagoa has joined the channel [12:43] framlin: http://wiki.commonjs.org/wiki/Modules/1.1 [12:44] fermion has joined the channel [12:44] aheckmann has joined the channel [12:44] tapia: that file is a generic json declaration, I can't attach it to a exports var [12:44] jomoho has joined the channel [12:44] TomY has joined the channel [12:44] framlin: just store it within couchDB ;) [12:45] framlin: and then use cradle tu read it ;) [12:49] miccolis has joined the channel [12:50] eee_c has joined the channel [12:53] k1ttty has joined the channel [12:53] sirdancealot has joined the channel [12:56] jonasen has joined the channel [12:56] xandrews has joined the channel [12:58] superjudge has joined the channel [12:59] sivy has joined the channel [12:59] niles|iPod has joined the channel [13:00] x4rMa has joined the channel [13:00] AaronMT has joined the channel [13:00] Sephi-Chan has left the channel [13:01] sledge has joined the channel [13:04] sveimac has joined the channel [13:07] skohorn has joined the channel [13:08] replore has joined the channel [13:10] ianward has joined the channel [13:13] adelgado has left the channel [13:17] piscisaureus has joined the channel [13:18] jomoho has joined the channel [13:19] pifantastic has joined the channel [13:20] jlecker has joined the channel [13:20] avalanche123 has joined the channel [13:21] dyer has joined the channel [13:22] forzan has joined the channel [13:22] radicality has joined the channel [13:23] jtsnow has joined the channel [13:25] ansy has joined the channel [13:26] EyePulp has joined the channel [13:27] jetienne: v8: '' == false [13:27] v8bot: jetienne: true [13:27] jetienne: v8: ' ' == false [13:27] v8bot: jetienne: true [13:27] jetienne: v8: 'e' == false [13:27] v8bot: jetienne: false [13:28] jetienne: hehe js is always tricky [13:28] pigmej: jetienne: 'normal' [13:28] pigmej: empty string == false [13:30] Yoric: Hi everybody [13:30] Yoric: Me and my team have recently announced a new open-source web development platform, and since many have asked for a comparison with Node.js, I have planned to start writing one. [13:30] Yoric: However, for this, I'll need some help from someone [much] more knowledgeable about Node.js than I. [13:30] Yoric: So, if anybody has knowledge&time, please ping me. [13:30] adnam: i alwoys use === instead of == [13:30] adnam: if you want type conversions, do it explicitly [13:30] emattias_ has joined the channel [13:30] jetienne: Yoric: url on your stuff [13:30] Yoric: (and yes, this is not the first time I post this message on the channel – attempting to find the right timezone) [13:31] jetienne: Yoric: coming and ask for ping, this is too close to spam [13:31] Yoric: jetienne: teaser website http://opalang.org, blog announce http://dutherenverseauborddelatable.wordpress.com/2011/05/23/unbreaking-scalable-web-development-one-loc-at-a-time/ [13:31] Yoric: jetienne: well, how should do I handle this? [13:31] zeunix: is there any way to pass variables/objects to the script executed inside a vm.runInThisContext? (besides global variables, or appending a variable as a string e.g. vm.runInThisContext('var foobar = ' + foobar + ';' + script); ) [13:31] Yoric: (that's one of the reasons why I don't give the URL in my ping, btw) [13:31] Yoric: jetienne: and, actually, I've been lurking on the chan since yesterday :) [13:31] jetienne: Yoric: one strong advantage for node, it doesnt do its own langauge :) [13:32] adnam: Yoric: are you looking for a thorough or quick review? [13:32] jetienne: Yoric: then it is just a matter on how you express it [13:32] jetienne: Yoric: do you have users for your stuff ? [13:32] Poetro has joined the channel [13:32] zeunix: zeunix: I realize the point is that it doesn't have access to the local scope, and there isn't a parameter for passing variables that I can see.. [13:33] Yoric: Not a review. But someone who would just be willing to spend time discussing with me (off-chan) so that we can find out exactly what the meaningful (and explainable) differences are. [13:33] Yoric: jetienne: it's not even out yet. [13:33] davidsklar has joined the channel [13:33] Yoric: adnam: you interested? [13:34] Bradleymeck has joined the channel [13:34] mbrevoort has joined the channel [13:34] jetienne: Yoric: good luck, to reach people with a custom language, you need a real strong case [13:35] Yoric: jetienne: Yeah, I know :) [13:35] mbrevoort has joined the channel [13:35] Yoric: (and thanks) [13:35] willwhite has joined the channel [13:36] jakehow has joined the channel [13:36] jvduf has joined the channel [13:38] jslatts has joined the channel [13:41] arpegius has joined the channel [13:45] zeunix: answered my own question. thanks guys. [13:46] boaz has joined the channel [13:47] guybrush: glad i could help :p [13:50] sudhirjonathan has joined the channel [13:50] sirkitree has joined the channel [13:53] ceej has joined the channel [13:55] thomblake has joined the channel [13:55] adelgado has joined the channel [13:57] sfoster has joined the channel [13:58] sivy has joined the channel [13:58] Yuffster has joined the channel [13:58] zitchie has joined the channel [14:00] minaguib has joined the channel [14:00] lukstr: zeunix: get ahold of ryah ? [14:03] zeunix: Did not, however with the help of another guy on here we discovered that very likely, all the wrapper is doing is added a closure to the script, which gives a performance gain by not letting the scripts variables leak into our context's global scope. I tested this and it indeed does the same thing. if you make it self-executing it even skips the need of having to do the appy(). [14:03] jonaslund: lukstr: in re to the performance of wrapped code ? [14:03] zeunix: lukstr: the strange this is that I thought that's runInThisContext was suppose to do that already, by itself. At least that's what the documentation says [14:04] jonaslund: ^- [14:04] zeunix: "To prevent accidental global variable leakage, script.runInNewContext is quite useful" [14:04] jetienne: sudo add-apt-repository ppa:jerome-etienne/neoip && sudo apt-get update && sudo apt-get install phantomjs <- install phantomjs on ubuntu 11.04 [14:05] jakehow has joined the channel [14:05] pquerna_ has joined the channel [14:05] hwinkel has joined the channel [14:05] zeunix: lukstr: which leads me to assume it was simply forgotten to get added. But that's just an assumption. If they want to keep global leakage, at the very least it might be helpful to put in the docs a tip about wrapping it in a closure if you don't need that. [14:06] Utkarsh_ has joined the channel [14:06] `3E|IDLE: if you don't want to leak, you should supply the vm a sandbox variable [14:06] zeunix: leakage the other way around [14:06] `3rdEden: you wan to leak vars to the vm script? [14:06] zeunix: the script executing in the same/new context leaking to the parent context [14:07] zeunix: no, we're discussing something from yesterday haha :) [14:08] jesusabdullah has joined the channel [14:09] Swimming_bird has joined the channel [14:09] nexxy has joined the channel [14:09] nexxy has joined the channel [14:10] HektoR_ has joined the channel [14:10] zeunix: lukstr: The more I think about it, I think it's correct the way it is. I mean, if you're running a script in the same context, allowing the scrip to leak to the global be what you'd naturally think it would do (hence, ThisContext) [14:10] FND has left the channel [14:10] HektoR_: Hello again guys... can anyone suggest good mysql driver for node.js ? [14:10] ceej has joined the channel [14:11] mike5w3c has joined the channel [14:11] pigmej: lukstr, konobi: something is wrong with that keep-alive for sure.... but I can't try an always-failing scenario outside my project [14:12] eyesUnclouded has joined the channel [14:12] mscdex: HektoR_: give node-mysql a try [14:15] jslatts has joined the channel [14:15] brolin has joined the channel [14:15] ed___ has joined the channel [14:15] ExsysTech has joined the channel [14:15] strmpnk has joined the channel [14:17] saschagehlich has joined the channel [14:18] ed___: Node beginner question... I'm trying to use the cradle example code to return the name "Darth Vader"... but get error "cannot read property 'name' of undefined"... any idea why? Here's my code: http://jsbin.com/odohi4/2/edit [14:18] ditesh|cassini has joined the channel [14:18] zitchie has left the channel [14:19] sledge: ed___: your document doesn't contain a 'name' attribute... :P [14:19] MikhX has joined the channel [14:20] sledge: ed___: try dumping the the output of sys.inspect(doc) to the console. [14:20] bentruyman has joined the channel [14:20] guybrush: ed___: check the err-parameter of the callback [14:23] ed___: console.log(sys.inspect(doc)) says "undefined"... updated code: http://jsbin.com/odohi4/3/edit [14:23] sledge: ed___: then there is a problem. like guybrush said, examine the err parameter in the callback. [14:25] Swizec has joined the channel [14:25] Corren has joined the channel [14:25] mynyml has joined the channel [14:25] Treffynnon has joined the channel [14:26] ed___: If I console.log(err), I get the message repeated infinitely: { stack: [Getter/Setter],arguments: [ 'ILLEGAL' ],type: 'unexpected_token',message: [Getter/Setter] } [14:27] charlesjolley- has joined the channel [14:27] jtsnow has joined the channel [14:27] ed___: new code: http://jsbin.com/odohi4/4/edit [14:28] pixel13 has joined the channel [14:28] rphillips has joined the channel [14:29] ed___: guybrush: If I console.log(err), I get the message repeated infinitely: { stack: [Getter/Setter],arguments: [ 'ILLEGAL' ],type: 'unexpected_token',message: [Getter/Setter] } [14:29] strmpnk has joined the channel [14:29] boaz has joined the channel [14:29] BillyBreen has joined the channel [14:30] pquerna has joined the channel [14:30] unomi has joined the channel [14:30] guybrush: :D [14:30] guybrush: sorry no time [14:31] ed___: guybrush: ok, np [14:31] guybrush: did you even save() vader before? [14:31] descipher_ has joined the channel [14:31] ed___: yes, will do it again though [14:33] lukstr: zeunix: yeah that's what I was thinking as well, re: correct behavior, it does make sense, and actually was my hunch as to why require was so fast [14:33] lukstr: pigmej: then it seems likely to me it's your project if you can't reproduce it outside. [14:33] benmills has joined the channel [14:33] petrjanda has joined the channel [14:34] ed___: guybrush: saved and still same result [14:34] pigmej: lukstr: i will try to split some code [14:34] pigmej: the thing is that when I remove keep-alive [14:34] pigmej: or set the agent to false [14:34] pigmej: everything works [14:34] pigmej: with keep-alive [14:34] pigmej: it crashes 'randomly' [14:34] lukstr: pigmej: that doesn't mean the problem is not in your project [14:35] pigmej: lukstr: well... the prolbem is that in my project there is nothing special... just a lot http requests... [14:35] lukstr: it's likely there exists a bug in your project and using keep-alive causes it so happen [14:35] strmpnk has joined the channel [14:35] lukstr: pigmej: you're using some external libraries correct? [14:36] pigmej: winston, async, events, http [14:36] lukstr: perhaps the bug is in one of them. I can't reproduce your issue with stock Node.js [14:37] ed___: sledge: If I console.log(err), I get the message repeated infinitely: { stack: [Getter/Setter],arguments: [ 'ILLEGAL' ],type: 'unexpected_token',message: [Getter/Setter] } [14:38] sirkitree has joined the channel [14:42] Corren has joined the channel [14:43] context: your err whatever it is causing a recursive loop [14:44] enotionz has joined the channel [14:44] dguttman has joined the channel [14:44] ed___: context: Here's my code. Any idea what the error might be? http://jsbin.com/odohi4/4/edit [14:46] zeunix: I wonder if regex hypnotists exist... [14:47] context: ed___: id say blame whatever that err object is from Cradle [14:47] stepheneb has joined the channel [14:47] jeromegn has joined the channel [14:48] colinclark has joined the channel [14:48] ed___: context: Any hints on how to trouble shoot the err obj? I'm a node beginner... [14:48] chadsmith has joined the channel [14:50] __sorin__ has joined the channel [14:50] jasong_at_apache has joined the channel [14:51] emattias has joined the channel [14:51] context: ed___: look at the source code? does it work if you lose the console.log line ? [14:52] timmywil has joined the channel [14:53] sub_pop has joined the channel [14:54] brraaains has joined the channel [14:54] ed___: context: if I loose the console.log line, the app crashes and error shown: cannot read property 'name' of undefined [14:54] pigmej: lukstr: the problem is that I'm getting exception in node core... [14:55] wookiehang0ver has joined the channel [14:55] pigmej: and it happens when I have for example [14:55] pigmej: maxSockets = 5 [14:55] pigmej: and I have per 1 incomming, 3 outgoing connections [14:55] pigmej: and for example from 20 incomming connections about 2-3 can't get into the end of way [14:56] gazumps has joined the channel [14:59] gtramont1na has joined the channel [15:00] davidascher has joined the channel [15:00] Epeli has joined the channel [15:00] gtramont1na_ has joined the channel [15:01] ebryn has joined the channel [15:03] jamescarr_ has joined the channel [15:05] matthijs has joined the channel [15:05] zitchie has joined the channel [15:06] gsmcwhirter has joined the channel [15:06] hwinkel has joined the channel [15:06] avalanche123 has joined the channel [15:08] vish_ has joined the channel [15:09] radicality has joined the channel [15:09] nibblebot has joined the channel [15:09] InTech[RU] has joined the channel [15:10] radicality: anyone know how to sort in Mongoose ? Whatever I try (from API or stackoverflow questions), the server hangs and does nothing [15:10] zitchie has left the channel [15:11] \sega has joined the channel [15:11] timmywil has joined the channel [15:11] pigmej: radicality: you probably forget to 'finish' it [15:11] pigmej: or bind event to finish ;) [15:11] ed___ has left the channel [15:11] ttpva has joined the channel [15:12] pigmej: radicality: paste the code ;-) [15:12] radicality: pigmej: models.Message.find({to: req.session.user._id}).sort(['_id', 1]).all(function(err,result){ do stuff } [15:12] tjholowaychuk has joined the channel [15:12] radicality: and it just hangs [15:13] zitchie has joined the channel [15:14] lukstr: pigmej: it's still possible you're doing something strange to cause the exception [15:14] liquidproof1 has joined the channel [15:15] iFire has joined the channel [15:15] briznad has joined the channel [15:15] pigmej: lukstr: nope ;/ [15:15] radicality: pigmej: here is a bit more code just in case. http://pastebin.com/aB7UkE4q mongoose is starting to get really annoying…. [15:16] pigmej: lukstr: http://wklej.to/wLHJp/hash/test4321 [15:19] liquidproof1 has left the channel [15:20] lukstr: pigmej: are you calling req.end? [15:20] jakehow has joined the channel [15:20] davidwalsh has joined the channel [15:20] tbranyen: tjholowaychuk: started messing around with cluster last night, a++, suggestion tho... can you check if the pid folder doesn't exist and error out with a better message? [15:20] tbranyen: kept saying it couldn't connect when that was the actual issue [15:21] tjholowaychuk: hmm yeah it should give you something better than that [15:21] truedat101 has joined the channel [15:21] dpritchett`: tj has the railsconf shoutout been good for business? [15:22] dpritchett`: i figured it'd help along the lines of 'all press is good press' [15:22] tjholowaychuk: haven't noticed any difference [15:22] dpritchett`: dang [15:22] tjholowaychuk: haha [15:22] piscisaureus has joined the channel [15:22] pigmej: lukstr: yup:) [15:22] pigmej: above of those lines [15:22] dpritchett`: you gotta admit DHH's asset pipeline keynote was a fun show [15:22] lukstr: pigmej: can you paste the entire example? this snippit isn't very useful [15:22] tjholowaychuk: i got bored i didnt watch it all [15:22] tjholowaychuk: trivial stuff [15:23] tjholowaychuk: that pjax thing [15:23] tjholowaychuk: looks retarded [15:23] tjholowaychuk: but i guess for ruby ppl it's cool [15:23] Skipants has joined the channel [15:23] dpritchett`: yeah i'm sure it's boring for people like you who are creating the future [15:23] dpritchett`: for those of us a few steps behind it's nice [15:23] pquerna has joined the channel [15:23] nphase has joined the channel [15:24] pigmej: lukstr: the problem is.. that's full example [15:25] lukstr: pigmej: no it's not, what's options? I don't see your req.end, there is a lot of code missing, can you paste the _entire_ thing, not just a few lines? [15:26] Corren has joined the channel [15:28] jvduf has joined the channel [15:28] bentruyman has joined the channel [15:29] pigmej: lukstr: I can't paste now _entire_ thing [15:29] pigmej: because the _entire_ thing is and will be not public ;/ [15:29] pigmej: (customer) [15:29] arturadib has joined the channel [15:29] gsmcwhirter: i am wondering if anyone can point me at a good reference / google keyword to help with the following problem: i want users to be able to enter a mathematical formula involving both constants and variable names and have a script parse it into a function where variable values can be applied to get a final result [15:29] pigmej: and lukstr it happens 'randomly' [15:29] pigmej: random number of failures [15:30] pigmej: so it depends 'on something' [15:30] pigmej: I'm trying to find out on what it depends... [15:30] sivy has joined the channel [15:30] eventualbuddha: is there a way to load the node repl with some code pre-loaded? [15:30] vipaca has joined the channel [15:30] vipaca has joined the channel [15:30] mscdex: eventualbuddha: http://nodejs.org/docs/v0.4.8/api/repl.html [15:30] niles|iPod has joined the channel [15:31] eventualbuddha: mscdex: thanks [15:31] lukstr: pigmej: I can't help you then, what you pasted is not buggy and works for me, so either the bug exists in code you aren't willing to share, or exists within Node.js and I cannot reproduce it. Unless you can show a full example when this happens I'm not sure what else to say [15:32] materialdesigner has joined the channel [15:32] pigmej: lukstr: sure that's obvious thing... [15:32] pigmej: I'm trying to find a use-case when it fails since tomorrow [15:33] lukstr: alright well, if you find one let me know [15:35] pigmej: hmm [15:35] pigmej: i think I got it.. [15:35] pigmej: everything works fine when I remove events.... [15:38] pigmej: lukstr: http://wklej.to/qrdgG [15:38] willwhite has joined the channel [15:38] replore_ has joined the channel [15:39] niles|iPod has joined the channel [15:39] TooTallNate has joined the channel [15:40] pigmej: lukstr: it happened exactly 2 minutes [15:40] pigmej: after last action... [15:40] pigmej: lukstr: full output: http://wklej.to/xnk6V [15:41] eldar has joined the channel [15:44] sudhirjonathan has joined the channel [15:45] fyskij has joined the channel [15:46] stephank has joined the channel [15:46] aleksandrz has joined the channel [15:46] dmcquay has joined the channel [15:47] sreeix has joined the channel [15:47] isaacs has joined the channel [15:48] bartt has joined the channel [15:48] Yuffster_work has joined the channel [15:49] prettyrobots has joined the channel [15:49] MikhX has joined the channel [15:51] davidascher has joined the channel [15:51] rfay has joined the channel [15:52] hij1nx has joined the channel [15:53] easternbloc: hi guys [15:54] petrjanda has joined the channel [15:54] easternbloc: is anyone using sinon.js in here per chance? [15:54] sreeix_ has joined the channel [15:54] beawesomeinstead has joined the channel [15:54] beawesomeinstead has joined the channel [15:56] zeade has joined the channel [15:56] pigmej: yup it crashes exactly after 2 minutes of iddle [15:57] langworthy has joined the channel [15:57] ph^ has joined the channel [15:57] pigmej: lukstr: does node has any default timeout of 2 minutes somewhere? [15:58] frewsxcv: any benchmarks of rhino vs. node.js? [15:58] mscdex: frewsxcv: yes, rhino is slow and synchronous and nodejs is neither of those two [15:58] mscdex: ;) [15:59] pigmej: and... it's like comparing cow and dog [15:59] niles|iPod has joined the channel [15:59] pquerna: pigmej: yes, there is a 2 minute default idle timeout on http connections [15:59] Cheery has joined the channel [15:59] d0k has joined the channel [15:59] rworth has joined the channel [16:00] pigmej: ok so 'there is a bug' [16:00] pquerna: http://nodejs.org/docs/v0.4.8/api/net.html#socket.setTimeout [16:00] torgeir has joined the channel [16:00] pquerna: you will want to call setTimeout on your http clients [16:00] pigmej: ok pquerna http://wklej.to/xnk6V [16:00] pquerna: with some other value [16:00] pquerna: if you want to have them idle longer [16:01] frewsxcv: mscdex: how is rhino synchronous [16:01] MikhX has joined the channel [16:01] chrislorenz has joined the channel [16:01] pigmej: no... they are crashing not 'iddling' [16:01] pigmej: just look at that traceback pquerna [16:01] pquerna: what version of node? [16:01] pixel13 has left the channel [16:02] pigmej: 0.4.8 i think. [16:02] pigmej: 0.5.0.0pre [16:02] pietern has joined the channel [16:02] pquerna: switch back to 0.4.x [16:03] pquerna: master has several problems currently with its libuv switch [16:03] Druide_ has joined the channel [16:03] BillyBreen has joined the channel [16:03] caolanm has joined the channel [16:03] nibblebo_ has joined the channel [16:04] mscdex: frewsxcv: it uses Java packages, which are pretty much all sync [16:04] tikva has joined the channel [16:04] sharkbone has joined the channel [16:05] pigmej: pquerna: ok.. [16:05] themiddleman_itv has joined the channel [16:06] miccolis has joined the channel [16:07] jakehow has joined the channel [16:08] broofa has joined the channel [16:09] jerrysv has joined the channel [16:09] eresair has joined the channel [16:10] philhawksworth has joined the channel [16:10] philhawksworth has left the channel [16:11] petrjanda has left the channel [16:13] mundanity has joined the channel [16:13] petrjanda has joined the channel [16:13] pigmej: pquerna: same issue [16:14] mehlah has joined the channel [16:15] pquerna: pigmej: can you pastebin the code causing the exception? [16:15] mAritz: tjholowaychuk: is there currently a way to use connect-redis with npm v1.0? or do i have to wait for something? [16:15] mAritz: 1.x ovc [16:15] mAritz: ofc [16:15] tjholowaychuk: is it not working? [16:15] tjholowaychuk: what's it doing? [16:15] petrjanda has joined the channel [16:15] tjholowaychuk: oh [16:15] tjholowaychuk: i think i remember the issue [16:16] pigmej: pquerna: trying to do it since yesterday [16:16] petrjanda has joined the channel [16:16] mscdex: pigmej: are you doing a lot of http requests at a time? [16:16] pigmej: yup [16:16] petrjanda has joined the channel [16:17] pigmej: mscdex: why? [16:17] pigmej: it works fine with 'one' [16:17] pigmej: but when I need to do let's say 3/4 requests [16:17] pigmej: it usually fails [16:17] mAritz: tjholowaychuk: yeah, the require('connect') problem [16:17] mAritz: you created an npm issue, though nothing happened there [16:18] tjholowaychuk: right [16:18] mAritz: and honestly, i don't think waiting for npm to do some major restructuring is the best idea :( [16:18] tjholowaychuk: hmm [16:18] mscdex: pigmej: try raising the http.Agent.maxSockets value to something higher than 5 (some people even use Infinity) [16:18] tjholowaychuk: just sucks that i have to go change everything now [16:18] pigmej: mscdex: i know.. [16:18] mscdex: er defaultMaxSockets [16:18] mscdex: :S [16:18] Afal has left the channel [16:18] pigmej: the problem is that I don't want to do it [16:18] pigmej: ... [16:18] mAritz: isaacs: i suppose you don't have an easy fix for https://github.com/isaacs/npm/issues/930 (especially connect-redis from my pov :D ) [16:18] pigmej: because then I can raise system limits ;) [16:18] mscdex: huh? [16:18] pigmej: yup [16:19] mscdex: huh as in huh what do you mean? [16:19] pigmej: I don't want for example 20k opened sockets... [16:19] mscdex: ok, so then don't use Infinity [16:19] mscdex: :) [16:19] pigmej: sure [16:19] pigmej: but.. [16:19] pigmej: n+1 [16:19] context: hahaha [16:19] pigmej: usually fails [16:19] nrajlich has joined the channel [16:19] pigmej: so it doesn't solve anything.. [16:20] mscdex: pigmej: and you're also tried using a separate Agent for each request? [16:20] pigmej: mscdex: when I just remove keep-alive [16:20] lukstr: mscdex: it's possibly related to this issue: https://github.com/joyent/node/issues/1135 [16:20] pigmej: everything works fisne ;) [16:20] pigmej: fine* [16:21] aheckmann has joined the channel [16:21] steph021 has joined the channel [16:21] steph021 has joined the channel [16:21] pigmej: lukstr: could be [16:21] pigmej: because I saw in logs disconnect/connect to my remote thing [16:22] mscdex: leave it to mjr_ to provide a tcpdump :p [16:22] pigmej: In my thing [16:22] lukstr: mscdex: what a good guy [16:22] pigmej: i have for example [16:22] easternbloc: ok, next question then, is anyone using a mocking framework here? [16:22] pigmej: 10k incomming connections [16:22] FND has joined the channel [16:22] pigmej: and 30k outgoing [16:22] pigmej: to 3 different hosts (10 k each) [16:22] mscdex: easternbloc: no, i just mock frameworks :-D [16:22] pigmej: and it usually crashes with keep-alive in 'random' way [16:23] ceej has joined the channel [16:23] FND: I'm struggling to create a simple NPM package: https://gist.github.com/1002168 - in that directory: `npm link; echo 'require("sample-package");' | node` # Error: Cannot find module 'sample-package' - any hints what I might be doing wrong? [16:23] jtsnow has joined the channel [16:24] lphuberdeau has joined the channel [16:24] mscdex: FND: might ping isaacs about it [16:24] arpegius_ has joined the channel [16:24] FND: I guess you just did, mscdex :) [16:24] mscdex: ;-) [16:25] FND: so I'm not doing something fundamentally wrong? [16:25] mahna has joined the channel [16:25] easternbloc: mscdex: hoho [16:25] lphuberdeau: hello, is this the right place for express-related questions or is there a more specific channel? [16:25] lukegalea_ has joined the channel [16:26] easternbloc: sinon.js has become the bane of my existence this afternoon [16:26] mscdex: FND: no idea, i'm not an npm expert by any means [16:26] isaacs: FND: hey [16:26] mscdex: lphuberdeau: here is probably best [16:26] FND: hello isaacs [16:26] easternbloc: it's nodeunit adapter just plain old doesn't work [16:26] isaacs: FND: link (with no args) creates a global symlink [16:26] isaacs: FND: you could just do your development in a folder called "node_modules". then require("folder-name") would find it [16:26] sandropadin has joined the channel [16:27] lukstr: pigmej: can you do a tcpdump so we can see if it is the same bug? [16:27] FND: let me see whether I understand this [16:27] isaacs: FND: that is, instead of something like ~/projects/foo, you work in ~/projects/node_modules/foo [16:27] pigmej: lukstr: if I would know "how"... [16:28] lphuberdeau: I've been searching around a bit and I can't seem to find the level 2 documentation that would help structure a project, I'm wondering how best to include code that would execute between the moment the route is mapped and when it is executed to handle common request parameters [16:28] yozgrahame has joined the channel [16:28] pigmej: maybe I can filter it in wireshark.. [16:28] mscdex: wireshark works too [16:28] FND: isaacs: so, I'm not quite sure what you mean by "global symlink" - or rather, isn't that what I want, adding foo to the global node_modules path [16:28] amerine has joined the channel [16:29] ebryn has joined the channel [16:29] isaacs: FND: no [16:29] isaacs: FND: the global space is not for require()ing [16:29] isaacs: FND: it's for command-line app [16:29] isaacs: s [16:29] context: heh [16:29] isaacs: FND: instead of doing require("foo") in the repl, try require("./") [16:29] isaacs: that'd find it, since you'd be specifying the folder, and then it'll pick up your main [16:30] context: fnd: npm 1.0 explained: http://pastie.org/1932925 [16:30] mikeal has joined the channel [16:30] context: and http://blog.nodejs.org/2011/05/01/npm-1-0-released/ [16:30] niles|iPod has joined the channel [16:30] tauren has joined the channel [16:30] FND: isaacs: thanks - but relative imports might ... well, I'll stop assuming and test, hang on [16:30] context: isaacs: i can only imagine how often you have this conversation [16:31] FND: context: thank you [16:31] FND: (FWIW, I did do a whole lot of googling, but those pages never came up) [16:31] context: fnd: yeah i know. thats why i keep them handy ;) [16:31] FND: ✓ [16:32] lukstr: context: indeed this issue seems to be coming up very often [16:32] isaacs: context: it's useful [16:33] isaacs: FND: relative require()s should always work if they're within your package. [16:33] isaacs: FND: if they don't, it's a bug [16:33] FND: isaacs: so, the trouble with using relative imports for (my) development is this: I'm trying to package jslint-reporter, which is a single wrapper.js around Crockford's jslint.js ... [16:33] FND: ... for various reasons that wrapper also downloads jslint.js directly from GitHub [16:34] FND: ... it downloads that file into wrapper.js's directory, to be precise [16:34] FND: wrapper.js is called with a simple executable shell script [16:34] context: fnd: you cant depend on lint or jslint or jslint-core [16:34] piscisaureus has joined the channel [16:34] context: ? [16:35] FND: context: I've looked into that, and decided against it because, well, essentially it's too much indirection for a single .js file (which is frequently updated, so I don't wanna rely on third-party maintainers) [16:35] ceej has joined the channel [16:36] context: using a community driven package manager is more indirect than manually downloading a file ? [16:36] context: causing your package to possibly break depending on how its downloading said file, changes in crockfords code, github being down, etc etc etc [16:36] FND: context: the trouble with JSLint is also that Crockford sometimes introduces modifications, so many people use an older version and so on... [16:36] FND: *unpopular modifications [16:36] context: someone installing your package then trying to use said package when they are offline and cant download said file? [16:37] ceej has joined the channel [16:37] FND: the file is downloaded upon installation [16:37] context: or... dependencies: {"jslint-core": "blah"} ; require("jslint-core") [16:37] liar has joined the channel [16:37] madsleejensen has joined the channel [16:38] FND: I understand your insistence on using common infrastructure, context - but in this case, after some struggling with myself, I figured this was the best way [16:38] mscdex: crockford! [16:38] mscdex: http://i55.tinypic.com/30s9cgh.png [16:38] FND: if Crockford himself maintained a jslint package, that'd be different (at least for the most part) [16:39] FND: anyway, context, I think I managed to introduce a red herring there [16:39] rpj8 has joined the channel [16:39] tbranyen: is it possible to specify latest packages in package.json? [16:39] tbranyen: for dependancies [16:40] FND: what I really need to know is how my executable script should call the wrapper.js: https://github.com/FND/jslint-reporter/blob/packaging/jslint-reporter - if I use require("jslint-reporter") there, it won't work (for local dev anyway) [16:40] easternbloc: tbranyen: how is it a dependency if you don't know what's in it ;) [16:41] Wizek has joined the channel [16:41] kmiyashiro has joined the channel [16:41] tbranyen: easternbloc: my app doesn't care what version so long as its latest [16:41] jakehow has joined the channel [16:41] FND: isaacs: ^^ is my issue with relative imports in a nutshell (sorry for not boiling it down sooner) [16:41] tbranyen: i'll just do > 0 [16:42] FND: tbranyen: isn't that the same as * or nothing at all [16:42] isaacs: FND: just require your main module with ../lib/whatever.js [16:42] isaacs: FND: the bin isn't copied out, it's linked. [16:42] isaacs: relative requires work in bins. [16:42] nibblebot has joined the channel [16:42] kmwallio has joined the channel [16:42] FND: isaacs: but that assumes CWD is the package directory - that's not true if the executable script is in ~/bin for example? [16:43] tbranyen: FND hmm * might work for me [16:43] isaacs: FND: it does work no matter what. [16:43] isaacs: FND: try it :) [16:43] FND: thanks, wil ldo [16:43] isaacs: FND: as long as you don't cp the script out (which npm doesn't) [16:43] context: anyone know anything like sidereel that has a webservice [16:43] isaacs: if you use a symlink or shim, it'll be fine. [16:43] ebryn has joined the channel [16:43] isaacs: FND: that's been a guarantee since the npm 0.1 days. [16:45] tbranyen: no go with * [16:45] tbranyen: meh i'll just manaully install them this already too much work [16:46] FND: tbranyen: I don't think you've clearly stated the problem yet? [16:46] pigmej: mscdex: I can't find it in wireshark... [16:46] pigmej: I will try 'later' ;/ [16:46] mscdex: heh [16:46] tbranyen: FND: i don't want to specify a version as a dependancy [16:46] pigmej: mscdex: to many requests.. [16:46] tbranyen: i want the latest whatever thats in npm [16:46] tbranyen: seems like a pretty common feature request [16:46] isaacs: tbranyen: then specify the version as "*" [16:46] isaacs: tbranyen: or >=1.2.3 [16:47] isaacs: tbranyen: or ~1.2.5 [16:47] pigmej: mscdex: hmm [16:47] tbranyen: isaacs: hmm jsut tried that and it failed said it didn't match a.b.c [16:47] pigmej: I'm sure that's it [16:47] pigmej: I have exactly that many exceptins as failed requests in my app.... [16:47] jaequery: if i wanted to create an irc chat client, is node.js a good platform for it? [16:47] pigmej: looks like socket is 'stuck' somewhere [16:47] niles|iPod has joined the channel [16:47] gtramont1na_ has joined the channel [16:48] mscdex: jaequery: sure, there's a start of one that uses ncurses: https://github.com/mscdex/node-ncurses/tree/master/examples [16:48] mscdex: :) [16:48] mscdex: jaequery: i recommend the node-irc module [16:48] isaacs: jaequery: yeah, there are some utils for that already [16:48] isaacs: ircretary: hi [16:48] ircretary: isaacs: Hello :) [16:49] isaacs: jaequery: ^ written in node.js [16:49] rpj8: Do I need to do `mongoose.model('BlogPost', BlogPost);` after I define a Schema "BlogPost" everytime I retart my node server? Or will mongo remember this schema from my previous server instance? [16:49] mayfield has left the channel [16:49] eyesUnclouded has joined the channel [16:49] context: rpj8: how would node 'remember' ? [16:49] rpj8: context: not node. mongodb [16:49] rpj8: will mongodb "remember" this schema definition [16:49] arpegius has joined the channel [16:49] context: i imagine mongo keeps this data.. as it is a database to store data. [16:50] context: but mongo isnt node. and i imagine you need to tell mongoose about the schema you want to play around with. [16:50] rpj8: context: I would too. I'm just trying to go over in my head how I would set up the code so that it only does the mongoose.model('BlogPost', BlogPost); line when it needs to. [16:50] FND: isaacs: sorry to keep bothering you, but I just realized that the issue might go beyond `require` - https://github.com/FND/jslint-reporter/blob/packaging/jslint-reporter#L3 - I *think* need to call node directly, passing wrapper.js as argument so I can pass in other arguments? [16:51] davidascher has joined the channel [16:51] pigmej: mscdex: or maybe I have no idea what I'm looking for in wireshark:D [16:52] tdegrunt has joined the channel [16:52] rpj8: context: aka if I restart the server, but I'd already defined that schema in a previous server instance, would I have to re-define it? I think not. [16:52] langworthy has joined the channel [16:55] towski has joined the channel [16:55] davidascher has joined the channel [16:56] rfay has joined the channel [16:56] figital has joined the channel [16:56] mscdex: pigmej: well, at least filter by http and/or port 80 [16:56] mscdex: ;) [16:56] pigmej: http but not 80 ;P [16:56] pigmej: i filtered it;p [16:56] pigmej: but as I said.. [16:56] pigmej: it happens [16:57] pigmej: when I have a lot of connections;) [16:57] mscdex: ok? [16:57] mscdex: try to match up the socket hangup error timestamp with the timestamp from wireshark [16:57] mscdex: that'd be one way [16:58] wadey has joined the channel [16:58] mscdex: timestamp + ip + port [16:58] joshthecoder has joined the channel [16:58] pigmej: mscdex: have you seen this http://wklej.to/PWeh6 ? [16:58] mscdex: then you could just filter out that tcp stream [16:58] mscdex: pigmej: no, but you showed that already :) [16:59] mscdex: i haven't had to do a bunch of requests like that at once [16:59] mscdex: yet [17:00] pigmej: it happens with 50 also.. [17:00] pigmej: i just saw :) [17:00] pigmej: sometimes even with 20 [17:00] pigmej: but it's random [17:00] pigmej: sometimes it doesn't crash [17:00] pigmej: using huge number of requests always crash at least once ;) [17:01] pigmej: now 4 of total 200 crashed [17:01] hybsch has joined the channel [17:01] pigmej: now I got the exceptions [17:01] MarkMenard has joined the channel [17:01] ryanfitz has joined the channel [17:02] springmeyer has joined the channel [17:02] sudhirjonathan has joined the channel [17:02] FireFly|n900 has joined the channel [17:02] pigmej: ok got 'socket hang up' [17:03] nibblebot has joined the channel [17:03] pigmej: but what now mscdex ? [17:03] lukstr: cross reference your times with your filtered trace [17:03] hij1nx has joined the channel [17:03] dguttman has joined the channel [17:03] mscdex: yeah [17:04] fangel has joined the channel [17:04] pigmej: mscdex: got it ;] [17:04] pigmej: it sometimes returns more than one answer. [17:04] pigmej: at once [17:04] pigmej: like [17:05] pigmej: http://wklej.to/d2rIn [17:05] pigmej: the 21 and 0 are values [17:06] FND: is there an equivalent of Python's shlex.split (splitting command-line arguments) in the standard library? [17:06] FND: i.e. 'foo "bar baz"' becomes ["foo", "bar baz"] [17:06] pigmej: mscdex, lukstr do you want to have full output from my thing ? [17:07] pigmej: full tcp stream history? [17:07] lukstr: well, if you provided that and the times you got errors, sure [17:07] lukstr: not much use unless we can isolate the packets [17:08] tim_smart has joined the channel [17:08] pigmej: i have full stream [17:08] pigmej: lukstr: http://wklej.to/8FlJ2 [17:08] pigmej: like this one [17:08] pigmej: but much more bigger [17:08] Schmallon has joined the channel [17:09] lukstr: er, do you have timestamps? [17:09] pigmej: if I only know how to do it in wireshark.. [17:10] pigmej: ok got it [17:11] tikva has joined the channel [17:12] sivy has joined the channel [17:13] niles|iPod has joined the channel [17:13] pigmej: lukstr, mscdex: http://wklej.to/WWqhS [17:13] MikhX has joined the channel [17:13] ewdafa has joined the channel [17:14] CrabDude has joined the channel [17:14] cagdas has joined the channel [17:16] mscdex: huh... "unable to pop from internal queue" :S [17:16] perezd has joined the channel [17:16] pigmej: mscdex: that's my error in my application [17:16] pigmej: just ignore it [17:16] mscdex: oh ok [17:16] mscdex: :) [17:16] pigmej: it's normal answer [17:16] pigmej: ;-) [17:16] pigmej: it's 303 [17:16] pigmej: http 303 + that message [17:16] mscdex: yeah [17:17] pigmej: it means that it should use different resource [17:17] pigmej: http://wklej.to/WWqhS/text will be probably easier to look at :) [17:17] colinclark has joined the channel [17:18] harth has joined the channel [17:19] AvianFlu has joined the channel [17:19] gtramont1na has joined the channel [17:19] mscdex: i'm not able to import that data successfully into wireshark :/ [17:19] mscdex: bunch of malformed packets [17:20] mscdex: pigmej: did you try cross referencing the timestamp from the error log with that of your filtered wireshark capture? [17:22] mscdex: to find the first tcp stream that is seeing the problem? [17:22] jamescarr has joined the channel [17:22] jetienne: mscdex: hey i did node deb ppa for natty :) thanks [17:23] jetienne: mscdex: i even did phantomjs deb for natty in the process [17:23] mscdex: jetienne: i saw that, cool :) [17:23] pigmej: mscdex: nope [17:24] fly__ has joined the channel [17:24] mscdex: pigmej: i'd try that since it'll make things a lot easier [17:24] bartt has joined the channel [17:25] pigmej: mscdex: i can send you a full capture [17:25] Adman65 has joined the channel [17:25] pigmej: full exprort from wireshark.. [17:25] lphuberdeau has left the channel [17:25] yogurt_truck has joined the channel [17:26] uchuff has joined the channel [17:26] sudhirjonathan has joined the channel [17:27] lukstr: jetienne: keeping it up to date will be a pain, no? [17:27] jetienne: cluster is creating a lot of those cluster.8155.sock files... any way to have it clean after him self ? [17:27] jetienne: lukstr: nah, im doing it for like 8months now [17:27] Corren has joined the channel [17:27] lukstr: jetienne: is it up to date right now? [17:27] jetienne: lukstr: i have been late on natty, because i didnt have a natty available [17:28] jetienne: lukstr: yep [17:28] jetienne: lukstr: it may be 1 day after the git release due to ubuntu servers, but thats it [17:28] lukstr: do you have a link? I'd watch it [17:28] jamescarr__ has joined the channel [17:28] jetienne: sure let me find it [17:28] gozala has joined the channel [17:28] lukstr: my experience with fast moving things and ubuntu packages has not been good :) [17:28] minaguib has joined the channel [17:29] jetienne: sudo add-apt-repository ppa:jerome-etienne/neoip && sudo apt-get update && sudo apt-get install nodejs <- install node 0.4.8 on ubuntu 11.04 [17:29] dgathright has joined the channel [17:29] malkomalko has joined the channel [17:29] jetienne: lukstr: this package install on ubuntu stable, but it is managed by me, so you get the current stable node [17:30] TheEmpath has joined the channel [17:30] lukstr: probably not going to get included into main, eh? :P [17:30] matjas has joined the channel [17:31] jetienne: lukstr: nope, they got != policy on version update, this is why ppa is handy. we can have our own policy. [17:31] jetienne: lukstr: in my case it is "current node stable on curren ubuntu stable" [17:31] malkomalko: anybody use any mock/stub libraries like sinon in here in their testing? I'm finding that sinon doesn't work very well in async tests because it can't stub the same thing in different tests [17:31] jetienne: ok back to express and mongoose [17:31] kuya: im looking for something like the python module shlex to parse shell like commands... anyone know of a such a thing? [17:32] lukstr: jetienne: yeah it's annoying, I'd almost prefer them to not include a lot of stuff in main [17:33] tjholowaychuk: jetienne it should clean up as long as it's not SIGKILLed [17:33] context: kuya: optimist [17:34] context: kuya: nopt, optparse, cli, parseopt [17:34] lukstr: isaacs: has there been much testing npm on windows? [17:34] jetienne: tjholowaychuk: i dont sigkill or sigterm, but yes i sigint, and the server exit with exception when i got a bug, i use cluster cli stop too [17:34] lackac: malkomalko: we use sinon with vows and its working great for us [17:34] tjholowaychuk: jetienne hmm yeah sounds like a bug then [17:35] jetienne: tjholowaychuk: ok i will look [17:35] lackac: malkomalko: what do you mean by not being able to stub the same thing in different tests? [17:35] pigmej: btw lukstr, mscdex it seems that [17:35] pigmej: connections between node.js servers [17:35] pigmej: are handled OK [17:36] lackac: tjholowaychuk: that was a quick merge on my pull request for jade :) [17:36] tjholowaychuk: lackac :) [17:36] jerrysv: second on optimist [17:36] tjholowaychuk: ideally we would re-apply the original indentation space-wise but meh this should be fine [17:36] lackac: tjholowaychuk: and thank for the release too. I hate using tarball urls in package.json... [17:37] davidtrejo has joined the channel [17:37] tjholowaychuk: haha yeah totally [17:37] jamescarr: hey tjholowaychuk [17:37] jamescarr: quick question... been away from express forever [17:37] pietern has joined the channel [17:38] DTrejo has left the channel [17:38] DTrejo has joined the channel [17:38] nibblebot has joined the channel [17:38] jamescarr: one sec [17:39] tjholowaychuk: haha k [17:39] jamescarr: isn't there someway to "namespace" a bunch of paths? [17:39] jetienne: q. i want a database layer which is stable, works. not something trendy. something documented/stable. what are the alternatives ? [17:39] kuya: context: they are all just option parsers [17:39] jamescarr: so I don't have to type app.get("/users/") over and over? [17:39] malkomalko: lackac: stub(Object, 'foo').yields(null, something) in more than one test throws back an error [17:39] kuya: context: i want to parse a full command line [17:39] tjholowaychuk: jamescarr express-namespace [17:39] addisonj: hey tj, while I see you here, got a question about this https://github.com/visionmedia/express-messages/issues/3, if I use that method, I get the raw JS code output to the browser [17:39] jamescarr: ah thanks [17:39] tjholowaychuk: https://github.com/visionmedia/express-namespace [17:39] tjholowaychuk: i dont personally like that stuff [17:40] tjholowaychuk: but it's easy to build on the basics [17:40] context: kuya: like your own command input ? [17:40] context: like your own prompt [17:40] malkomalko: lackac: TypeError: Attempted to wrap selections which is already wrapped [17:40] malkomalko: I don't think it likes async testing when needing the same stub in multiple async tests [17:40] jamescarr: tjholowaychuk, yeah, I'm reaching a point in my where I'll require some heavy refactoring at some point [17:40] tjholowaychuk: addisonj: just do != messages() [17:40] jamescarr: for now all my routes are functions that take app as a param and uses a local root var [17:41] tjholowaychuk: should be fine [17:41] jamescarr: app.get "#{root}/new", (req, res) -> [17:41] FND: oh dear, it appears I somehow managed to mess up my NPM/Node setup - NPM no longer installs into ~/.npm, but uses ./node_modules (i.e. CWD) [17:41] stagas: jetienne: ministore didn't get you very far haha! try mongo with this https://github.com/marcello3d/node-mongolian [17:41] tjholowaychuk: we started using fancier stuff in our app [17:41] tjholowaychuk: instead of regular routing [17:41] steffkes has joined the channel [17:41] tjholowaychuk: but it ends up being more of a PITA than anything [17:41] context: kuya: prompt / ask ? google this stuff [17:41] tjholowaychuk: the time we save typing is then spent debugging or trying to find something [17:42] Country has joined the channel [17:42] addisonj: FND, that is the default location since npm 1.0 [17:42] lackac: malkomalko: in our tests we always wrap examples where stubbing is needed into a sandbox [17:42] niftylettuce has joined the channel [17:42] malkomalko: yah sinon.test(function(){ .. }) ? [17:42] lackac: this way sinon cleans up after itself and you'll be able to restub in another example later [17:42] malkomalko: have you gotten that to work with expresso instead of nodeunit or something else? [17:42] lackac: malkomalko: yep [17:43] lackac: I don't know about expresso but it works great with vows [17:43] FND: addisonj: I'll have to read up on that then [17:43] addisonj: FND: http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/ [17:44] FND: addisonj: ah, that I'd already seen - but I guess I didn't quite grasp it, thanks [17:44] malkomalko: ok, didn't find it working with expresso, but I'll try it out [17:44] jamescarr: tjholowaychuk, I might create some plugin for basic crud stuff [17:44] malkomalko: and that was with your tests being async? [17:44] jamescarr: something that just generates scaffolding [17:44] tjholowaychuk: jamescarr express-resource [17:44] jamescarr: :-P [17:44] kuya: context: node prompt is closer to what i want... googling "node ask" isnt getting me very far - got a link? [17:44] lackac: malkomalko: yep [17:44] addisonj: tjholowaychuk, thanks, not sure why that escaped my grasp, btw, jade rocks [17:45] tjholowaychuk: addisonj np, thanks man [17:45] context: kuya: search.npmjs.org [17:45] matjas has joined the channel [17:45] jamescarr: I need to join the express mailing list it seems [17:45] malkomalko: lackac: besides wrapping it in sinon.test, do you have to specially assert with any of sinon's methods or it just works out the box via vow's assertion methods? [17:45] jetienne: stagas: im scared of its scalability :) [17:45] jetienne: stagas: you used mongolian with success ? [17:46] tjholowaychuk: jamescarr i've still got some work to do on express-resource but it's pretty good for the CRUD stuff, just gets gross if you want to start applying middleware etc, i'll have to find a nice api for that [17:46] kuya: context: good idea"! [17:46] stagas: jetienne: yeah it's pretty good, and it mimics the shell api so it's already documented in the nets [17:46] tjholowaychuk: but you can auto-load the resources which is nice [17:47] jamescarr: tjholowaychuk, yeah, for the most part my starting point was doing a lot of index/get/put/delete/post for Mongoose models [17:47] johnnywengluu_ has joined the channel [17:47] jvduf has joined the channel [17:47] boaz has joined the channel [17:47] reid has joined the channel [17:47] lackac: malkomalko: sinon.test will do the assertions itself [17:47] jetienne: stagas: nice! [17:48] lackac: malkomalko: i checked again and it seems that although the test were async indeed the thing that we were mocking fired in sync and not in a callback [17:49] sudhirjonathan has joined the channel [17:49] malkomalko: ok, I'll have a look, might be tricky [17:49] malkomalko: will see what happens [17:49] malkomalko: I'd love to get it working well, because it's a very very handy tool [17:49] malkomalko: haven't found anything as good [17:50] jamescarr: speaking of mongoose, is there an enum type? [17:51] jamescarr: so I can say that something is one of 5 values? [17:51] chad_burt: hi all - first question on the node irc channel for me! [17:52] Skipants has joined the channel [17:52] chad_burt: if I'd like to have a traditional database of usernames and hashed passwords in redis, are there any connect middleware modules I can use? [17:52] ByteCrunch has joined the channel [17:52] chad_burt: can I make a "strategy" for connect-auth? [17:53] ExsysHost has joined the channel [17:53] johnnywengluu__ has joined the channel [17:53] jetienne: stagas: mongolian has no 'model' whasoever, correct ? [17:54] DTrejo: chad_burt: use bcrypt! [17:54] DTrejo: http://codahale.com/how-to-safely-store-a-password/ [17:54] stagas: jetienne: no [17:54] jetienne: stagas: any url or keyword to find their model stuff ? [17:54] kmiyashiro: is express-auth usable? [17:55] jetienne: stagas: they dont have it in https://github.com/marcello3d/node-mongolian/blob/master/examples/mongolian_trainer.js doc [17:55] Guest12341 has joined the channel [17:55] robhawkes has joined the channel [17:55] pifantastic has joined the channel [17:55] stagas: jetienne: what do you mean model? scheme? [17:56] chad_burt: DTrejo: thanks for the tip. I will check that out. but... are there any end-to-end solutions out there that worry about, or at least can guide me through these details? [17:56] jetienne: stagas: not sure of the vocabulary, i mean schema in sql, the structure of the stored data [17:56] piscisaureus has joined the channel [17:56] DTrejo: chad_burt: haven't heard of anything, would be nice if someone wrote something like that [17:56] chad_burt: kmiyashiro: connect-auth has a commit just 3 days ago [17:57] johnnywengluu_ has joined the channel [17:57] kmiyashiro: but is it usable :) [17:57] chad_burt: seems more geared towards utilizing 3rd-party oauth providers [17:57] chad_burt: not sure, I'm a node newbie [17:57] stagas: jetienne: mongo doesn't have schemas built-in. you can write any type. if you like schemas use something like mongoose [17:57] DTrejo: right, there's nothing that works on any db, or whatever, where you just give it a username+pass and it hashes+stores [17:57] DTrejo: and emails and does password resets [17:57] ExsysTech has joined the channel [17:57] DTrejo: etc [17:57] DTrejo: we need one of those [17:58] chad_burt: okay [17:58] DTrejo: all the stuff that pretty much every site needs [17:58] DTrejo: but anyway [17:58] chad_burt: lol [17:58] DTrejo: ;) [17:58] chad_burt: I'll add writing a possibly poorly secure end-to-end security module to my list of things to do this summer [17:58] chad_burt: :) [17:59] chad_burt: I guess there are plenty of other examples to build off of though [17:59] chad_burt: I'll maybe take a look at the django source since I'm coming from that framework and know it pretty well [17:59] context: dtrejo: what ? [17:59] sudhirjonathan has joined the channel [18:00] context: database aren't designed to do authentication for your application. its designed to store data for you. [18:00] gtramont1na has joined the channel [18:00] lackac: malkomalko: based on the documentation sinon testCases might be the thing you're looking for [18:00] lackac: malkomalko: http://sinonjs.org/docs/#sinon-testCase [18:00] ExsysHost has joined the channel [18:00] mraleph has joined the channel [18:01] piscisaureus_ has joined the channel [18:02] lackac: tjholowaychuk: you must be more familiar with cluster than I am [18:02] lackac: tjholowaychuk: is there a way to not have the master process restart itself when I only want the workers to be restarted? [18:02] d_js has joined the channel [18:02] chad_burt: context: for sure. To be more specific, I'm looking for something like django-registration that handles users signup, forgotten password emails, etc, while storing all credentials in something separate and persistent. [18:02] tjholowaychuk: lackac only by signally each child [18:02] tjholowaychuk: lackac the master restart shouldn't be an issue though [18:02] tjholowaychuk: the old master sticks around until connections are closed [18:03] tjholowaychuk: (or timeout) [18:03] davida has joined the channel [18:03] ExsysHost_ has joined the channel [18:03] Guest12341: tj doesn't know anything about cluster [18:03] lackac: tjholowaychuk: it is an issue when the master is monitored by some other process [18:03] nibblebot has joined the channel [18:03] tjholowaychuk: lackac cant watch the pidfile for changes? [18:04] lackac: i was trying to use foreman with cluster and in development i have the reload plugin enabled [18:04] context: chad_burt: ahh gotcha. yeah not sure there is anything like that for node yet [18:04] tjholowaychuk: lackac it would be super easy to implement via repl / cli etc [18:04] lackac: the moment some file is changed cluster tries to restart which kills foreman somehow and both are dead by the end [18:04] tjholowaychuk: but SIGUSR2 is a regular restart [18:05] tjholowaychuk: hm [18:05] chad_burt: cool, something for me to contribute then [18:05] lackac: tjholowaychuk: but the master quits as well [18:05] context: why run cluster for development ? [18:05] jetienne has joined the channel [18:05] lackac: context: because I can ;) [18:05] jeremyselier: hi there [18:06] lackac: context: with the reload plugin its working great for development [18:06] ExsysTech has joined the channel [18:06] context: whatever floats your boat. [18:06] tjholowaychuk: lackac that's the only way really to guarantee config changes are reloaded as well [18:06] tjholowaychuk: i use cluster in development as well [18:06] jeremyselier: I'm having a hard time figuring out how to deal with international domain name in node [18:06] Guest12341: unless there's some breaking code which causes the master to quit [18:06] jerrysv: jeremyseller: in what context? [18:07] lackac: tjholowaychuk: so you're saying there would be a way to extend cluster with a restart method where each child would be restarted separately? [18:07] jeremyselier: things like '➡.ws ' should be decoded has 'xn--hgi.ws' [18:08] ExsysHost has joined the channel [18:08] tjholowaychuk: lackac yeah easily, just a matter of signally them to QUIT, though you potentially have down time while they let connections die [18:08] tjholowaychuk: which is why the second master is spawned with the new code [18:09] lackac: tjholowaychuk: that shouldn't be a problem in development [18:09] Guest12341: one thing i dont like about cluster in development is that each time code changes theres a couple seconds where cluster stops listening completely [18:09] tjholowaychuk: Guest12341 hmm i dont notice that [18:09] tjholowaychuk: we have a huge app [18:09] lackac: tjholowaychuk: in production I've already using the pidfile for monitoring [18:09] tjholowaychuk: and it's quick enough [18:09] Guest12341: hm maybe im using it wrong [18:09] jeremyselier: righ now I've spotted a first regression between v0.4.6 and v0.4.8 regarding unicode and url.parse [18:09] tjholowaychuk: lackac ah [18:10] ExsysHost_ has joined the channel [18:10] lackac: tjholowaychuk: thanks, I'll look into this [18:10] AdmGre has joined the channel [18:10] tjholowaychuk: sounds good [18:11] jeremyselier: python encode function can deal with idna [18:12] sudhirjonathan has joined the channel [18:13] ExsysTech has joined the channel [18:15] ExsysHost has joined the channel [18:16] maushu has joined the channel [18:17] facepunch has left the channel [18:17] `3rdEden has joined the channel [18:18] ExsysHost_ has joined the channel [18:18] george1 has joined the channel [18:19] colinclark has joined the channel [18:19] AlexMax has joined the channel [18:20] eddanger has joined the channel [18:20] benmills has left the channel [18:20] ExsysTech has joined the channel [18:21] hij1nx has joined the channel [18:21] tbranyen: tjholowaychuk: [18:21] tbranyen: 14:13 < rwaldron> one guy thought that making an object property non-enum, non-config and non-writable should look like.... [18:21] gkmngrgn has joined the channel [18:21] tbranyen: 14:14 < rwaldron> #!~obj.prop [18:21] tbranyen: { #!~obj: "prop" } [18:21] tbranyen: is that hot or what ;-) [18:21] tjholowaychuk: wtf [18:21] tjholowaychuk: lol [18:21] tbranyen: these harmony proposals are so wild [18:21] johnnywengluu_ has joined the channel [18:21] tjholowaychuk: yeah that's... awesome looking [18:22] replore has joined the channel [18:23] dmcquay has joined the channel [18:23] ExsysHost has joined the channel [18:23] ryankirkman has joined the channel [18:24] insin has joined the channel [18:25] ExsysHost_ has joined the channel [18:26] matjas_ has joined the channel [18:26] isaacs has joined the channel [18:28] adambeynon has joined the channel [18:28] ExsysTech has joined the channel [18:28] wbw72 has joined the channel [18:28] DTrejo: anyone driving to the javascript dodgeball/trampoline thing from SF later today? [18:29] margle has joined the channel [18:30] `3rdEden: harmony is going to fuck up javascript so bad [18:30] trotter has joined the channel [18:30] ExsysHost has joined the channel [18:30] Dinosaurus has joined the channel [18:30] sudhirjonathan has joined the channel [18:30] CoverSlide: that's why it will never get adopted [18:31] systemfault: Well.. who knows, it might just end up in the same garbage sack as ES4 [18:31] systemfault: CoverSlide++ [18:31] v8bot: systemfault has given a beer to CoverSlide. CoverSlide now has 1 beers. [18:31] ezmobius has joined the channel [18:31] DTrejo: Harmony reminds me so much of how there's so much harmony in china, for the citizens, politically [18:31] DTrejo: they use euphemisms all the time in china, like harmony [18:32] DTrejo: it is said [18:32] chadsmith has joined the channel [18:32] CoverSlide: we should just abandon javascript, and migrate everything to coffeescript, have spidermonkey and v8 support cs natively, and work on that as the new standard [18:32] Bradleymeck has joined the channel [18:33] tjholowaychuk: lol.. [18:33] DTrejo: CoverSlide: regular javascript isn't so bad [18:33] tjholowaychuk: CoverSlide except that wont solve any real problems lol [18:33] tjholowaychuk: that doesn't change property descriptors etc [18:33] ExsysTech has joined the channel [18:33] DTrejo: the only thing that gets me once in a blue moon is type checking [18:33] systemfault: I just want the damn optional block scoping [18:34] systemfault: Mozilla's "let" [18:34] DTrejo: tjholowaychuk: where can I read about that? [18:34] tjholowaychuk: what? [18:34] DTrejo: nvm [18:35] dgathright has joined the channel [18:35] ExsysHost has joined the channel [18:35] c4milo: any ideas about how to block the main thread in nodejs [18:36] minaguib has joined the channel [18:36] CoverSlide: while(true){} [18:36] c4milo: a legacy application is running my script and waiting a response through the stdout [18:37] c4milo: CoverSlide: I hope you are kiding [18:37] c4milo: kidding [18:37] c4milo: hehe [18:37] DTrejo: what do you mean by block it? [18:37] CoverSlide: oh you wanted it to stop at some point? [18:38] CoverSlide: are you piping to / from this other application? [18:39] hosh_work has joined the channel [18:39] tbranyen: you shouldn't use straight JS and jQuery simultaneously, btw, unless you really know what you're doing [18:40] ExsysTech has joined the channel [18:41] kmiyashiro: tbranyen: why not? [18:42] Wa has joined the channel [18:42] Maximosis has joined the channel [18:43] maushu: tbranyen, wat. [18:43] `3rdEden: lol wut [18:43] maushu: How the heck do we use jQuery without "straight JS"? [18:43] ExsysHost has joined the channel [18:44] wadey: you need to use crooked JS [18:44] joshontheweb has joined the channel [18:44] jerrysv: wiggly js [18:45] jerrysv: in fact, wiggly.js [18:45] CoverSlide: "queer js" [18:45] CoverSlide: for jquery [18:45] insin: $.function(/* source code here */) [18:45] flubba has joined the channel [18:45] `3rdEden: is queer js like cockfyscript? [18:46] figital has joined the channel [18:47] flubba: question about using ejs with node.js, i require("ejs"), and ejs.render("lol") works as expected, but in order to use a template EJS documentation says to do: new EJS({url: 'blah'}).render('blah'). when I do that, i get an 'EJS is not defined' error. any ideas? thanks. [18:47] DTrejo: insin: $.function("console.log('I am a string saying hello world')") [18:47] DTrejo: ; [18:48] CoverSlide: have you defined EJS to the current scope? [18:48] eyesUnclouded has joined the channel [18:48] tjholowaychuk: flubba ejs.compile(stringOfEJS) returns a function [18:48] tjholowaychuk: flubba ejs.compile(stringOfEJS)(locals) [18:49] tjholowaychuk: best to check out the source, it's not large [18:50] flubba: thanks! [18:50] ExsysTech has joined the channel [18:51] c4milo: DTrejo: stop the execution til I have gotten the response from the database to send it out through stdout [18:52] whack has left the channel [18:53] ExsysHost has joined the channel [18:57] pigmej has joined the channel [18:58] niles|iPod has joined the channel [18:58] Xano has joined the channel [18:58] patrickarlt has joined the channel [18:59] sudhirjonathan has joined the channel [19:00] jakehow has joined the channel [19:00] ExsysTech has joined the channel [19:01] temp02 has joined the channel [19:02] patcito has joined the channel [19:02] steph021 has joined the channel [19:03] razvandimescu has joined the channel [19:04] petrjanda has joined the channel [19:04] adrianmg has joined the channel [19:04] Rob- has joined the channel [19:05] hij1nx has joined the channel [19:05] ExsysHost has joined the channel [19:07] jbpros has joined the channel [19:08] ExsysTech has joined the channel [19:08] ardcore has joined the channel [19:09] ardcore has left the channel [19:09] Renegade001 has joined the channel [19:09] TomY has joined the channel [19:11] ExsysHost has joined the channel [19:11] Dinosaurus has joined the channel [19:11] hyperbutts has joined the channel [19:11] hyperbutts: (__x__) [19:12] samsonjs has joined the channel [19:12] kkaefer has joined the channel [19:12] kkaefer has joined the channel [19:13] hyperbutts has joined the channel [19:13] ExsysTech has joined the channel [19:14] themiddleman_itv has left the channel [19:15] hyperbutts: butt the butt like today? [19:15] hyperbutts: butt the weather butt today? [19:15] hyperbutts: butt the weather like today? [19:15] lackac has joined the channel [19:16] ExsysHost_ has joined the channel [19:16] pkarl has joined the channel [19:17] dmcquay has joined the channel [19:18] eddanger has joined the channel [19:18] Martz has joined the channel [19:18] ExsysTech has joined the channel [19:19] kriszyp has joined the channel [19:21] Opaque has joined the channel [19:21] ExsysHost has joined the channel [19:21] jacobolus has joined the channel [19:22] devdazed has joined the channel [19:23] sudhirjonathan has joined the channel [19:23] ExsysHost_ has joined the channel [19:23] omni5cience has joined the channel [19:23] briznad1 has joined the channel [19:24] chad_burt: another newbie question: anyone have an idea of what proportion of the node.js using community uses coffeescript? [19:24] devdazed: ryah, according to the v0.4.8 docs, I should be able to do response.setEncoding('utf8'), but when i try I get Object # has no method 'setEncoding' [19:24] tjholowaychuk: chad_burt the lame portion [19:24] tjholowaychuk: aka ruby ppl [19:24] insin: haha [19:25] gtramont1na has joined the channel [19:25] guybrush: lol :D [19:25] insin: and any Python people who actually hate themselves [19:26] insin: (someone put rubies im their Pythons in their JavaScripts) [19:26] ExsysTech has joined the channel [19:27] niles|iPod has joined the channel [19:28] chad_burt: I'm looking at it because I'm sick of problems with semi-colons and trailing commas, lack of list comprehensions, and would like to put the discussions about oo-class style to rest (don't care how). [19:28] jameson_ has joined the channel [19:28] jmoyers: http nerds [19:28] jmoyers: i have a question re: keepalive [19:28] malkomalko: anybody try node-fake yet? [19:28] nrajlich has joined the channel [19:28] ExsysHost has joined the channel [19:29] jmoyers: how much more overhead is an http + keepalive vs say a custom streaming tcp connection? [19:29] guybrush: chad_burt: try comma first and semi-colons only when really needed [19:29] guybrush: you wont look back [19:29] tjholowaychuk: but why do that [19:29] tjholowaychuk: when you can compile a language to js [19:29] tjholowaychuk: common now [19:29] tjholowaychuk: it's the logical thing to do [19:29] guybrush: ^^ [19:29] jmoyers: hey now [19:29] jmoyers: multi line string literals [19:29] jameson_: anyone familiar with tls.js ? [19:30] jmoyers: extend, => bind [19:30] jmoyers: those are actually nice features [19:30] jmoyers: ACTION actually wants those features in ecma [19:30] tjholowaychuk: ACTION gives up on js [19:30] tbranyen: jmoyers: just got in a discussion with someone at work about http keep-alive vs websockets [19:30] chad_burt: re comma first - that's pretty fucking ugly man. If I look at a piece of code and long for the "beauty" of python there is something seriously wrong! [19:31] chad_burt: ah, yeah multi line strings too are awesome [19:31] tbranyen: comma first is pretty standard with SQL one of the first languages i've encountered that people care about in terms of aesthetics [19:31] jmoyers: tbranyen right, but the primary difference there is inherent bidirectionality [19:31] ExsysTech has joined the channel [19:31] tbranyen: jmoyers: yeah, i dunno if maxing out the 2 tcp connection cap is a good idea [19:31] jmoyers: is there a bunch more overhead in http if its one way? [19:32] merlinm has joined the channel [19:32] jmoyers: hmm [19:32] joshontheweb has joined the channel [19:32] tbranyen: jmoyers: just seems significantly more fragile [19:32] tbranyen: imo [19:32] jmoyers: k [19:32] merlinm: hello [19:33] mc_greeny has joined the channel [19:35] insin: comma-first has grown on me over time - now all my comma errors are accidentally putting one at the end due to muscle memory :/ [19:35] systemfault: comma-first++ [19:35] v8bot: systemfault has given a beer to comma-first. comma-first now has 2 beers. [19:35] stagas: github becomes like twitter if you follow enough [19:36] madsleejensen has joined the channel [19:36] ExsysHost has joined the channel [19:37] sonnym has joined the channel [19:38] tbranyen: stagas: ha i check github in the morning before twitter now [19:39] ExsysTech has joined the channel [19:39] devdazed: does anyone know why in version 0.4.8 response.setEncoding doesnt work? or if there is a different way I can set the response to utf8 [19:40] spasquali_ has joined the channel [19:40] devdazed: the error i get is Object # has no method 'setEncoding' [19:41] ExsysHost has joined the channel [19:41] stepheneb has joined the channel [19:42] fangel has joined the channel [19:42] flubba has joined the channel [19:44] ExsysHost_ has joined the channel [19:45] eee_c has joined the channel [19:46] ExsysTech has joined the channel [19:47] johnnywengluu_ has joined the channel [19:47] wookiehangover has joined the channel [19:50] jameson has joined the channel [19:50] hij1nx has joined the channel [19:51] ExsysTech has joined the channel [19:51] herbySk: v8: new Array(3) [19:51] v8bot: herbySk: [] [19:52] herbySk: v8: [undefined, undefined, undefined] [19:52] v8bot: herbySk: [undefined,undefined,undefined] [19:52] `3rdEden: v8: (new Array(3)).join('pew') [19:52] v8bot: `3rdEden: "pewpew" [19:52] devdazed: ha [19:53] `3rdEden: v8 stole my pew [19:53] halfhalo: it was hungry [19:53] devdazed: `3rdEden: its because you only had 3 elements in the array [19:54] `3rdEden: good point :p [19:54] CoverSlide: v8: ['','',''].join("pew") [19:54] v8bot: CoverSlide: "pewpew" [19:54] devdazed: v8: [1,2,3].join('pew') [19:54] v8bot: devdazed: "1pew2pew3" [19:54] devdazed: see [19:56] ExsysTech has joined the channel [19:58] devdazed: v8: 'foo’bar'.length [19:58] v8bot: devdazed: 7 [19:59] ExsysHost has joined the channel [19:59] devdazed: v8: Buffer('foo’bar').length [19:59] v8bot: devdazed: ReferenceError: Buffer is not defined [19:59] jaequery: nice [19:59] devdazed: v8: new Buffer('foo’bar').length [19:59] v8bot: devdazed: ReferenceError: Buffer is not defined [19:59] devdazed: ? [19:59] devdazed: arg, v8, not node [19:59] jmoyers: Buffer is node [19:59] jmoyers: yerp [19:59] devdazed: well my point is this [20:00] devdazed: Buffer('foo’bar').length [20:00] devdazed: shows 9 [20:00] devdazed: the reason is utf8 [20:00] jslatts_ has joined the channel [20:00] devdazed: what i cant figure out is when i am sending the body length to the client, how to get eh proper length [20:01] devdazed: if i do a length on the string it will truncate 2 chars [20:01] hunterloftis has joined the channel [20:01] tbranyen: devdazed: toString() [20:01] tbranyen: new Buffer("your weird shit").toString().length [20:01] jmoyers: err [20:01] jmoyers: http length? [20:01] jmoyers: thats not the actual buffer length? [20:01] devdazed: nah, its in the http server. if I do response.write('foo’bar') [20:01] CoverSlide: v8: Buffer [20:01] v8bot: CoverSlide: ReferenceError: Buffer is not defined [20:01] jmoyers: i would imagine it is [20:01] CoverSlide: dammit [20:02] Bradleymeck has joined the channel [20:02] CoverSlide: we need a nodeBot [20:02] `3rdEden: yes [20:02] jmoyers: oh yeah, that would be extra safe [20:02] kristsk has joined the channel [20:02] jmoyers: ;-) [20:02] `3rdEden: so we can do fs.readFileSync(/etc/pwd) [20:02] devdazed: so i do a setheader for content-length of 'foo’bar'.length [20:02] devdazed: and it sets it as 7 [20:02] hunterloftis: tjholowaychuk: Testing a user account API with expresso. Simple stuff is easy with assert.response... let's say for initialization I need to 1) find a user ID by email then 2) delete that user, is there a simple way to do that? (since assert.response doesn't actually give me the response... which I need to find the ID... but it's not a listening server so I can't use an http agent either) [20:02] devdazed: but i do response.write('foo’bar') [20:02] CoverSlide: might be possible to compile it without fs [20:02] devdazed: and it ends up giving me 2 les chars on the client side [20:03] ExsysTech has joined the channel [20:03] tjholowaychuk: hunterloftis: that's how assert.response() works, it's still listening for connections, just assert.response controls the port [20:04] tjholowaychuk: you can still use other http clients [20:04] harth has joined the channel [20:04] tjholowaychuk: just make sure to shut down the server when those tests are done [20:04] jmoyers: devdazed: write(string, encoding) no? [20:04] devdazed: the encoding is utf8 [20:04] hunterloftis: tjholowaychuk: cool what port does it run on? [20:04] devdazed: which is default [20:04] tjholowaychuk: hunterloftis it ++s the portno [20:05] tjholowaychuk: defined in expresso(1) i think it starts at 5555 [20:05] tjholowaychuk: but i could have use ephemeral ports [20:05] jmoyers: i would imagine this is the code? https://github.com/joyent/node/blob/master/lib/http.js#L608-613 [20:05] jmoyers: looks to me like its grabbing the bytelength [20:05] devdazed: so basically there is a difference in the number of chars that 'foo’bar'.length is and response.write('foo’bar') is [20:06] jmoyers: not string length [20:06] malkomalko: tjholowaychuk: using the serial option in expresso, do you have to pass a callback to your test and call it to mark it as done or something? [20:06] devdazed: jmoyers: any idea on how to get the byte length? [20:06] tjholowaychuk: malkomalko: yeah [20:06] jmoyers: Buffer.byteLength(chunk, encoding); [20:06] tjholowaychuk: malkomalko: only when you have async stuff in there [20:06] jmoyers: chunk can be string [20:06] ExsysHost has joined the channel [20:06] tjholowaychuk: otherwise it will just go to the next test [20:07] jmoyers: im not clear on the question though [20:07] malkomalko: is there an example in the docs? [20:07] jmoyers: since when you do res.write() [20:07] jmoyers: it should be doing this for you [20:07] malkomalko: do you do something like next.done() or just call next()? [20:07] tjholowaychuk: malkomalko it's passed to the function, just next() [20:07] jmoyers: with bytelength -- so it shouldn't matter that what you're stuffing in is utf8 [20:07] devdazed: what should be doing it for me? [20:07] tjholowaychuk: serial == slow though [20:07] jmoyers: phone brb [20:08] tjholowaychuk: i try to avoid it [20:08] malkomalko: it's impossible to do any type of stubbing for certain test cases though if it's all parallel [20:08] tjholowaychuk: yeah for sure [20:08] malkomalko: and depending on what you're testing, it shouldn't be that slow [20:08] tjholowaychuk: i havent stubbed a single thing since writing node libs [20:08] tjholowaychuk: but [20:09] tjholowaychuk: i work on different projects, not really web apps [20:09] ExsysHost_ has joined the channel [20:09] mike5w3c_ has joined the channel [20:09] malkomalko: I don't want to have to insert things into a database everytime the method hits that spot, it's annoying :) [20:09] malkomalko: I'd rather just set a stub so it returns me what I want [20:09] Lorentz has joined the channel [20:10] tjholowaychuk: in some cases you certainly have to [20:10] tjholowaychuk: but mocks & stubs usually == bugs [20:10] malkomalko: well, anything can == bugs, but sometimes, all you want to do is make sure a certain function is called [20:10] sledge: v8: function Y (func) { (function (x) { return x.call(null, x); })(function (y) { return func.call(null, function () { return y.call(null, y).apply(null, arguments); }); }); } [20:10] malkomalko: anyway, I hear what you're saying, but thanks for the serialized tip [20:10] v8bot: sledge: undefined [20:11] ExsysTech has joined the channel [20:12] niles|iPod has joined the channel [20:12] sledge: v8: function Y (func) { (function (x) { return x.call(null, x); })(function (y) { return func.call(null, function () { return y.call(null, y).apply(null, arguments); }); }); }; [20:12] v8bot: sledge: undefined [20:13] malkomalko: is there anyway inside the test file to force it to be run serially instead of from the command line options? [20:13] jmoyers: devdazed okay, sorry -- whats the situation you're trying to solve? [20:13] jmoyers: you're right that string.length will be different than buffer.length [20:13] tjholowaychuk: malkomalko cant remember if i added that or not [20:13] jmoyers: thats just the way it is [20:13] devdazed: i was setting the response header to the length of the string [20:13] tjholowaychuk: i dont think so [20:13] jmoyers: you dont set it to the length of the string [20:13] tjholowaychuk: but it's not bad if you just use a makefile [20:13] tjholowaychuk: and make test [20:13] jmoyers: you set it to the bytelength [20:13] jmoyers: Buffer.byteLength( string, encoding ) [20:13] devdazed: jmoyers: i see that now, thanks [20:14] jmoyers: kk [20:14] devdazed: jmoyers: you're a lifesaver. [20:14] jerrysv: ooo, people that have some v8 experience are on [20:14] ExsysHost has joined the channel [20:14] hunterloftis: tjholowaychuk: sorry, I still don't think I understand how to interact with the server without assert.response. Can you point me in the right direction to use the same server object that assert is? [20:14] jerrysv: i am trying to convert back to a node::Buffer and get it returned [20:14] jerrysv: speedily [20:14] jerrysv: and, well, speed just isn't happening [20:14] jerrysv: anyone have any ideas? [20:14] tjholowaychuk: hunterloftis just use node's http client and request stuff from the server like you normally would [20:14] jerrysv: happy to post a gist with what i'm doing [20:15] tjholowaychuk: listen() in the test and when your tests are done .close() [20:15] hunterloftis: tjholowaychuk: So in that case I do need to call server.listen(), even though assert.response doesn't need it [20:15] hunterloftis: tjholowaychuk: ok gotcha, that's the part I didn't get [20:15] tjholowaychuk: assert.response does listen() for you [20:15] tjholowaychuk: for example in the express tests I have hundreds of http servers [20:15] devdazed: I don't always test...but when i do...I test in production [20:16] tjholowaychuk: so assert.response sets them up on different ports [20:16] hunterloftis: tjholowaychuk: then I need to know which port to hook up to in each test [20:16] ExsysTech has joined the channel [20:16] cummingscm has joined the channel [20:17] tjholowaychuk: server.address().port [20:17] hunterloftis: tjholowaychuk: thanks - I'll check the express tests to see more detail [20:17] tjholowaychuk: in our tests we have clones of our app running on different ports [20:17] tjholowaychuk: but if you are not using assert.response it's easy to just listen() and request against it like normal [20:18] tjholowaychuk: assert.response should probably see if it's listening already but i dont think it does right now [20:18] jerrysv: nobody on the node::Buffer question? [20:18] eddanger has joined the channel [20:18] fugoki has joined the channel [20:19] ExsysHost_ has joined the channel [20:19] TomY has joined the channel [20:21] hunterloftis: tjholowaychuk: it almost seems easier to ignore the assert.response stuff and just use regular 'should' or 'assert' with regular http clients [20:21] tjholowaychuk: hunterloftis yeah that could be easier depending onwhat you are doing [20:21] ExsysHost has joined the channel [20:22] jvduf has joined the channel [20:24] ExsysTech has joined the channel [20:26] ExsysHost has joined the channel [20:29] tauren has joined the channel [20:29] derencius has joined the channel [20:29] tauren has left the channel [20:29] ExsysHost_ has joined the channel [20:31] pietern has joined the channel [20:31] dmcquay_ has joined the channel [20:31] TooTallNate has joined the channel [20:31] ExsysTech has joined the channel [20:32] dmcquay_ has joined the channel [20:32] tauren has joined the channel [20:33] mikeal1 has joined the channel [20:33] jslatts has joined the channel [20:34] ExsysHost has joined the channel [20:34] colinclark has joined the channel [20:35] markwubben has joined the channel [20:37] ExsysHost_ has joined the channel [20:37] hunterloftis: tjholowaychuk: Would you just use 'localhost' as the host for an http.client alongside assert.response? [20:39] ExsysTech has joined the channel [20:39] eee_c1 has joined the channel [20:42] ExsysHost has joined the channel [20:43] mattly has joined the channel [20:43] eee_c1 has joined the channel [20:43] ceej_ has joined the channel [20:43] FireFly|n900 has joined the channel [20:44] ExsysHost_ has joined the channel [20:44] TheEmpath: hail nodelings [20:44] Yoric has joined the channel [20:46] caolanm has joined the channel [20:46] SubStack: TheEmpath: hail! [20:47] SubStack: $SIG{HEIL} [20:47] ExsysTech has joined the channel [20:47] jerrysv: $SIG{SEGV} [20:47] TheEmpath: oh man [20:47] TheEmpath: im still in pre-alpha [20:48] jerrysv: once again, anyone know node::Buffer() well? [20:48] TheEmpath: how much has node changed in the last six months? [20:48] adambeynon has joined the channel [20:50] ExsysHost has joined the channel [20:50] CoverSlide: [_________________] << this much [20:50] gzmask has joined the channel [20:51] eldios has joined the channel [20:51] context: coverslide++ [20:51] v8bot: context has given a beer to coverslide. coverslide now has 1 beers. [20:51] gzmask: c++ fstream is giving me headaches in node.js ... https://gist.github.com/1001404 this segment of code runs fine in c++ but crashes without warning in node.js. any ideas? [20:51] AhtiK has joined the channel [20:51] mawkor2 has joined the channel [20:52] mawkor2: anyone know how to get a json variable into an attribute with jade? [20:52] jetienne: so those promise, are they in or not ? [20:53] gazumps has joined the channel [20:53] mawkor2: img(src='#{images.image.medium.url}') doesn't work... [20:54] tjholowaychuk: mawkor2 img(src=images.image.medium.url) [20:55] zeade has joined the channel [20:57] brraaains: mawkor2: what tj said plus i'm assuming you passed images as a local so you can access it [20:58] tdegrunt has joined the channel [20:58] supster has joined the channel [21:00] eldar has joined the channel [21:00] springmeyer has joined the channel [21:01] pifantastic has joined the channel [21:03] brraaains: mawkor2: I think you only have to do the hashtag thing when you are printing out with a h-tag or p-tag or something like that [21:03] ExsysTech has joined the channel [21:03] kevwil has joined the channel [21:04] thomblake has left the channel [21:05] ExsysHost has joined the channel [21:05] zzak has joined the channel [21:05] zzak has joined the channel [21:06] joshontheweb has joined the channel [21:07] ExsysTech has joined the channel [21:08] BillyBreen has joined the channel [21:08] keikubo has joined the channel [21:09] unomi has joined the channel [21:09] Wizek: Is there a good way to have js file loading simmilar to node's `require()`? [21:09] brownies has joined the channel [21:09] context: wizek: uhh huh [21:10] DTrejo: Wizek: browserify [21:10] DTrejo: npm install browserify [21:10] DTrejo: npm view browserify [21:10] ExsysHost has joined the channel [21:11] Wizek: DTrejo, wow, seems like to be exactly what I'm looking for! :) [21:11] Wizek: thanks [21:11] DTrejo: :) [21:12] ExsysTech has joined the channel [21:13] joshontheweb has joined the channel [21:13] cognominal_ has joined the channel [21:13] AntelopeSalad: when using socket.io, addListener/removeListener is the standard way to register custom events right? [21:14] ExsysHost has joined the channel [21:15] DTrejo: we need an npm bot in here [21:15] DTrejo: so I can npm view anything I want [21:16] isaacs: DTrejo: i already put one on your machine. [21:16] isaacs: it's called "npm" [21:16] DTrejo: :) [21:16] isaacs: ;) [21:16] DTrejo: alt tabbing is so laborious ha [21:16] dmcquay has joined the channel [21:16] context: antelopesalad: on() and removeListener [21:16] isaacs: but yeah, there are common questions and answers that come up a lot [21:16] Twelve-60 has joined the channel [21:16] DTrejo: mostly I want to get the URL out and link people [21:16] CoverSlide: https://github.com/draggor/node-ircbot [21:17] AntelopeSalad: hmm, so i can simply do client.on('myevent', ...)? [21:17] CoverSlide: build it [21:17] context: antelopesalad: correct ? [21:17] ExsysHost_ has joined the channel [21:17] DTrejo: npm view | grep url [21:17] context: antelopesalad: on() == addListener() just shorter. and reads better [21:17] DTrejo: CoverSlide: yup! or use kohai [21:18] AntelopeSalad: ok that makes sense [21:18] jetienne: q. with mongoose, i would like to bind the error at the global level, and not at every operation. like MyModel.create({}, function(error, doc){}) ..... i like more mongoose.on('error', function(err){});, is there such a thing ? [21:18] isaacs: DTrejo: npm docs browserify [21:18] AntelopeSalad: thanks [21:18] Lorentz has joined the channel [21:18] DTrejo: NICE [21:18] isaacs: DTrejo: or: npm view browserify dist.tarball to get the tarball url [21:18] DTrejo: exactly what I wanted [21:18] SubStack: wait what [21:19] DTrejo: SubStack: do npm docs browserify [21:19] SubStack: npm ERR! 'browser' config is not set. Try doing this: [21:19] SubStack: ACTION sets that [21:19] jeff_horton has joined the channel [21:19] CoverSlide: npm config set sets on /etc/npmrc ? [21:19] SubStack: aha awesome [21:19] isaacs: CoverSlide: if you have --global set then yes. [21:19] SubStack: isaacs++ [21:19] v8bot: SubStack has given a beer to isaacs. isaacs now has 21 beers. [21:19] SubStack: `beers supster [21:19] SubStack: wups [21:20] CoverSlide: oh [21:20] ExsysTech has joined the channel [21:20] isaacs: CoverSlide: usually it sets at `~/.npmrc` [21:20] ahti_ has joined the channel [21:20] CoverSlide: cuz npm config set browser links from standard user gets me npm ERR! Failed saving /etc/npmrc Error: EACCES, Permission denied '/etc/npmrc' [21:20] rfay has joined the channel [21:20] jetienne: q. is there a cmdline option to remove the 1gbyte memory limits of node ? how to overcome this limit ? [21:21] SubStack: `v beers SubStack [21:21] v8bot: SubStack: SubStack has 32 beers. [21:21] SubStack: aw yeah, the beersdb is back [21:22] context: 32 beers. you're gonna be one drunk man [21:22] ExsysHost has joined the channel [21:22] lightcap has joined the channel [21:23] mscdex: jetienne: yes [21:23] Gregor: "error: �SSLv2_method� was not declared in this scope" Now what's all this then >_> [21:24] mscdex: jetienne: this will up the heap limit to 1.7gb: --max-old-space-size=1700 [21:24] mscdex: Gregor: apply this patch: https://gist.github.com/e44765fcd8d6ab7a33a7 [21:24] ExsysTech has joined the channel [21:25] Gregor: mscdex: Thanks [21:25] Poetro1 has joined the channel [21:25] niles|iPod has joined the channel [21:26] jetienne: mscdex: ok thanks [21:27] DTrejo: `v beers DTrejo [21:27] v8bot: DTrejo: DTrejo has 0 beers. [21:27] DTrejo: I wish it didn't delete whenever I leave the room [21:27] ExsysHost has joined the channel [21:27] FireFly has joined the channel [21:28] jerrysv: `v beers jerrysv [21:28] v8bot: jerrysv: jerrysv has 0 beers. [21:28] jerrysv: DTrejo++ [21:28] v8bot: jerrysv has given a beer to DTrejo. DTrejo now has 1 beers. [21:29] ExsysTech has joined the channel [21:31] tanepiper: how do i get the time a http request makes? [21:31] tanepiper: from the response object (if that's possible?) [21:32] caolanm has joined the channel [21:32] ExsysHost has joined the channel [21:32] eee_c has joined the channel [21:34] dransfim has joined the channel [21:34] mscdex: DTrejo: it doesn't delete them, "`v beers x" always reports 0 :/ [21:34] tanepiper: nmv, i see it's not on the http object, so as i suspected have to do it manually [21:34] ExsysTech has joined the channel [21:35] dransfim has left the channel [21:35] beriberikix: Isaacs: I've noticed that NPM on cygwin doesn't play well with dependencies [21:35] cafesofie has joined the channel [21:35] isaacs: beriberikix: cygwin doesn't play well, period. [21:35] mscdex: `v beers mscdex [21:35] v8bot: mscdex: mscdex has 17 beers. [21:35] beriberikix: Isaacs: lol, true that [21:35] mscdex: DTrejo: oops, nevermind i think i was thinking of "`v beers" [21:36] beriberikix: Isaacs: But if you manually install depen, all is grand [21:36] beriberikix: for ex, install connect before express [21:36] jmoyers: what would folks say is the best wathdog/process monitoring package for node? [21:36] mscdex: but cygwin is the only option for windows nt users (with a little patching to v8 of course) :p [21:36] DTrejo: mscdex: try leaving and then coming back [21:36] SubStack: jmoyers: check out forever [21:37] mscdex: DTrejo: it's persistent [21:37] jmoyers: SubStack thanks, will take a look [21:37] herbySk: v8: a=[]; a[5] = "foo"; delete a[5]; a.length [21:37] v8bot: herbySk: 6 [21:37] CoverSlide: or supervisor [21:37] DTrejo: I've gotten beers before and now ther are gone [21:37] mscdex: DTrejo: i just disconnected the other night [21:37] ExsysHost_ has joined the channel [21:37] DTrejo: `v beers DTrejo [21:37] v8bot: DTrejo: DTrejo has 1 beers. [21:37] DTrejo: oh [21:37] DTrejo: there we go [21:37] mscdex: and there's no way i got 17 beers since then [21:37] mscdex: heh [21:37] context: `v beers context [21:37] v8bot: context: context has 0 beers. [21:37] context: :( [21:38] context: im beerless [21:38] mscdex: DTrejo++ [21:38] v8bot: mscdex has given a beer to DTrejo. DTrejo now has 2 beers. [21:38] context: no ballmer peak for me [21:38] mscdex: context++ [21:38] v8bot: mscdex has given a beer to context. context now has 1 beers. [21:38] CoverSlide: `v beers CoverSlide [21:38] v8bot: CoverSlide: CoverSlide has 1 beers. [21:38] DTrejo: glug glug glug [21:38] zeade has joined the channel [21:38] zzak: mscdex++ [21:38] v8bot: zzak has given a beer to mscdex. mscdex now has 18 beers. [21:38] DTrejo: zzak++ [21:38] v8bot: DTrejo has given a beer to zzak. zzak now has 0 beers. [21:38] jmoyers: i probably have like [21:38] jmoyers: a single beer? [21:38] context: `v beers jmoyers [21:38] v8bot: context: jmoyers has 1 beers. [21:39] jmoyers: ACTION nods [21:39] mscdex: it doesn't say how many of these beers are empty [21:39] mscdex: :p [21:40] ExsysTech has joined the channel [21:40] context: haha [21:40] Bonuspunkt: http://www.youtube.com/watch?v=KDt-Fz0PLvk <3 [21:41] zzak: dtrejo++ [21:41] v8bot: zzak has given a beer to dtrejo. dtrejo now has 2 beers. [21:41] tshpaper has joined the channel [21:42] sebbie has joined the channel [21:42] jmoyers: SubStack++ [21:42] v8bot: jmoyers has given a beer to SubStack. SubStack now has 33 beers. [21:42] jmoyers: forever [21:42] jmoyers: rad [21:42] TomsB has joined the channel [21:42] DTrejo: anyone driving to house of air tonight? [21:43] DTrejo: ^ jmoyers SubStack [21:43] jmoyers: hmm [21:43] jmoyers: i saw that post [21:43] DTrejo: I'm in financial district but bus takes 1 hr [21:44] jmoyers: i'd have to get off my ass [21:44] jmoyers: theoretically im supposed to be under deadline [21:44] ExsysHost has joined the channel [21:45] jkridner_ has joined the channel [21:46] jmoyers: alright [21:46] jmoyers: i can give rides [21:47] ddollar: i would like to have the node-related .h files in a non-standard path.. is there some environment variable that i can set to have them found? specifically trying to install mongodb from npm [21:47] jmoyers: DTrejo isaacs all still need it? [21:47] AvianFlu has joined the channel [21:47] ExsysTech has joined the channel [21:48] DTrejo: jmoyers: yep :) [21:48] DTrejo: jmoyers: YOU ROCK [21:48] isaacs: jmoyers: yessir [21:48] ddollar: CPATH seems to get me part of the way but sometimes v8.h is still not found [21:48] isaacs: ddollar: INCLUDE_PATH, i think? [21:49] jmoyers: isaacs DTrejo k, pick a spot. I'll be coming straight down market if you guys are dt [21:49] jmoyers: from the twin peaks side [21:49] lightcap has joined the channel [21:49] isaacs: market and montgomery? [21:51] sebbie has joined the channel [21:52] ExsysTech has joined the channel [21:53] DTrejo: that works for me [21:53] DTrejo: 6pmish? [21:53] DTrejo: can irc do group private chats> [21:53] DTrejo: ? [21:53] guybrush: its called "channel" [21:53] DTrejo: !!?? [21:54] guybrush: just tell all guys in your group to /j secretPrivateChannel [21:54] jmoyers: 6pm works fine [21:54] jonaslund: and do mode /mode #secretPrivateChannel +s so the channel doesn't show up if people look at you [21:54] omni5cience_ has joined the channel [21:55] ExsysTech has joined the channel [21:55] DTrejo: thanks jonaslund [21:55] DTrejo: jonaslund++ [21:55] v8bot: DTrejo has given a beer to jonaslund. jonaslund now has 2 beers. [21:56] idefine has joined the channel [21:56] jonaslund: :) [21:57] idefine: is there a way to do a parent child templates with the jade template engine [21:57] idefine: do parent child templates* [21:58] tjholowaychuk: express provides partial() [21:58] tjholowaychuk: but jade itself no [21:59] tjholowaychuk: i might add static include support to jade but that's about it [21:59] fson has joined the channel [22:00] cha0s has joined the channel [22:00] ExsysTech has joined the channel [22:00] davidwalsh has joined the channel [22:01] Xano has joined the channel [22:01] sechrist has joined the channel [22:01] sandropadin has left the channel [22:01] idefine: tjholowaychuk: I'm new to node, thanks for the quick response! i'll checkout partials in express. [22:02] briznad has joined the channel [22:02] dmcquay has joined the channel [22:03] ExsysTech has joined the channel [22:03] mscdex: DTrejo: or you can set a key/password on the room [22:05] ExsysHost has joined the channel [22:05] postwait has joined the channel [22:05] aliem has joined the channel [22:07] willwhite has joined the channel [22:07] dmcquay_ has joined the channel [22:08] timmywil has joined the channel [22:10] jslatts has joined the channel [22:10] SubStack: isaacs: I'll be in SF tomorrow so I'll swing by node office hours [22:10] SubStack: not obvious how that eventbrite stuff works though [22:11] DTrejo: I only use sites that are navigable with `links` [22:11] Opaque has joined the channel [22:12] ExsysTech has joined the channel [22:13] SubStack: isaacs: nevermind, found it [22:16] lackac has joined the channel [22:16] Marak has joined the channel [22:16] Marak: anyone in the bay area, its node.js trampoline dodgeball time tonight [22:17] Marak: i got 10 free tickets for #node.js peeps [22:17] Marak: http://groups.google.com/group/nodejs/browse_thread/thread/cc90ed12a8f22c [22:17] DTrejo: Marak: jmoyers, isaaacs and myself are making it [22:17] Marak: DTrejo: OHH ITS ON [22:17] Marak: DTrejo: FEAR MY ASYNCHRONOUS WRATH [22:17] Marak: ;-) [22:17] davidascher has joined the channel [22:18] DTrejo: i hate it when I lose a callback [22:18] sirdancealot has joined the channel [22:19] jbpros has joined the channel [22:19] context: antelopesalad: socket.io has no "myevent" event. simply put... you're doing it wrong. [22:20] context: antelopesalad: http://socket.io/ read the site. it gives simple examples in the first paragraph of sending data. [22:20] Marak: AntelopeSalad: I'm not sure what are you doing, but you probably want to use https://github.com/substack/dnode instead of raw socket.io [22:22] AntelopeSalad: yeah context [22:23] AntelopeSalad: when i mentioned custom event, i meant my own custom event [22:23] context: wel... are you emiting the event [22:23] joshontheweb has joined the channel [22:24] context: socket.io doesn't know what 'myevent' is so its not going to emit it [22:24] SubStack: AntelopeSalad: you'd have to build your own thing on top of socket.io to do that [22:24] jerrysv: oh, hey marak [22:24] timmywil has joined the channel [22:24] AntelopeSalad: i thought socket.io allowed me to add my custom events (.on or .addlistener), isn't that what you said before? [22:25] jerrysv: ok, new active group, trying my question again :) [22:25] jerrysv: i am attempting to create/convert a node::Buffer from c++, but it is very very slow -- hoping someone has some tips/pointers ? [22:25] secoif has joined the channel [22:26] baudehlo: how slow? [22:26] context: [_________________] <-- this slow? [22:26] hassox has joined the channel [22:26] jerrysv: baudehlo: as slow as what context said [22:27] baudehlo: yeah that's expected then. [22:27] jerrysv: baudehlo: let me get you an example, hold on (real numbers coming in s sec) [22:28] jerrysv: baudehlo: with strings coming out of c++, i get 14.69/sec [22:29] Maximosis has joined the channel [22:29] jerrysv: baudehlo: with buffer, about 1/10 that [22:30] jmoyers: AntelopeSalad 0.7 has custom events [22:30] incon has joined the channel [22:30] jerrysv: baudehlo: i see that node itself is passing in a buffer and operating on that, but i do not know the size until i get the data back [22:30] jmoyers: its also super trivial to re-emit custom events [22:31] jmoyers: pre 0.7 [22:31] Skipants has left the channel [22:31] baudehlo: *shrug* I honestly don't know. I've yet to do any node/c++ stuff. I was just curious how slow :) [22:31] AntelopeSalad: do you have an example jm? (pre- 0.7) [22:31] materialdesigner has joined the channel [22:31] jmoyers: sure [22:31] jmoyers: sec [22:32] AvianFlu has joined the channel [22:32] jerrysv: baudehlo: doh! [22:32] jerrysv: baudehlo: if you're curious what i'm doing: https://gist.github.com/1003522 [22:33] jmoyers: shit, im snorfeling around for the actual example [22:33] jmoyers: cant find it [22:33] jmoyers: but, for instance, say you get this over the wire [22:33] jmoyers: {type: 'someEventType', data: {}} [22:33] idefine: tjholowaychuk: looks like partials will do what I need. The examples provided in the source are great. Thanks! [22:33] tjholowaychuk: np [22:34] jmoyers: on('message', function(data){ socket.emit(data.type, data.data); }); [22:34] jmoyers: or something along those lines [22:34] AntelopeSalad: ah [22:34] AntelopeSalad: so you're using message to kind of fake "custom" events [22:35] jmoyers: well its like a 2 line shim [22:35] jmoyers: but yes indeed [22:35] Bradleymeck has joined the channel [22:36] jmoyers: that way i can link up the socket and the models ez peezy [22:36] jmoyers: and such [22:36] jmoyers: a million use cases [22:36] jmoyers: which 0.7 does for you, along with channels [22:36] jmoyers: though, it should be mentioned [22:37] jmoyers: some folks around these parts prefer rpc setups like dnode [22:37] jmoyers: some use cases i think that makes sense, others i prefer this direction [22:37] rfay has joined the channel [22:39] blup has joined the channel [22:39] AntelopeSalad: yeah i think your way makes more sense too for this type of use case [22:40] blup has joined the channel [22:41] AntelopeSalad: would you say 0.7 is stable enough to actually use? [22:41] davidban_ has joined the channel [22:44] blup has joined the channel [22:45] patrickarlt has joined the channel [22:47] sudhirjonathan has joined the channel [22:47] johnnywengluu: when till socket.io 0.7 be ready? [22:48] copongcopong has joined the channel [22:49] [[zz]] has joined the channel [22:50] blup has joined the channel [22:51] hellp has joined the channel [22:51] Adman65 has joined the channel [22:52] jerrysv: anyone know a clean way to check for equality in buffers? other than iterating through every value and comparing? [22:52] ack has joined the channel [22:52] blup has joined the channel [22:53] heavysixer has joined the channel [22:55] blup has joined the channel [22:59] jmoyers: jerrysv to you know the contents? [22:59] jmoyers: encoding [22:59] jmoyers: etc [23:00] temp01 has joined the channel [23:00] jmoyers: if its utf8 or some such, you can just toString() == [23:01] jerrysv: jmoyers: it's definitely binary, i just wanted a faster way to verify the data coming back is correct [23:01] EyePulp has joined the channel [23:01] Wizek has joined the channel [23:01] jerrysv: ACTION knows it *is* correct, but wants tests to prove it [23:01] BinaryMuse has joined the channel [23:01] tcurdt has joined the channel [23:02] EyePulp: yo ho ho. how do I tell npm to get the latest release of a package? [23:02] EyePulp: or does it do that by default [23:02] isaacs: EyePulp: latest is default [23:02] isaacs: EyePulp: npm install foo ==> npm install foo@latest [23:02] isaacs: EyePulp: if you want a different version or tag, then put it after the @ [23:02] jmoyers: jerrysv ah, yeah, nothing on the prototype [23:02] isaacs: you can also do: npm install foo@">=1.2.4 <1.5.7" [23:02] jmoyers: and clearly == and === fail [23:02] jmoyers: presumably its pointer [23:03] jerrysv: jmoyers: exactly, there's a discussion on the google group, but it's older [23:03] m00p has joined the channel [23:03] blup has joined the channel [23:03] jerrysv: jmoyers: was hoping it had become a solved problem [23:05] blup has joined the channel [23:05] cognominal_ has joined the channel [23:08] jmoyers: maybe its complicated by implementation details [23:08] jmoyers: but seems like memcmp would be trivial [23:09] cincinnatus has joined the channel [23:09] yozgrahame has joined the channel [23:11] skm has joined the channel [23:11] cognominal_ has joined the channel [23:11] skm has joined the channel [23:12] skm has joined the channel [23:13] skm has joined the channel [23:13] copongcopong has joined the channel [23:14] FireFly|n900 has joined the channel [23:15] jerrysv: jmoyers: yeah, i agree [23:15] cjm_ has joined the channel [23:16] cjm_: What's the best way to inspect objects with circular structure? [23:16] SubStack: console.dir() works [23:17] SubStack: you can use traverse to scrub circular refs if you want too [23:17] k1ttty has joined the channel [23:17] cjm_: awesome, thanks [23:18] SubStack: https://gist.github.com/1003582 [23:18] SubStack: cjm_: ^^ [23:20] dgathright has joined the channel [23:20] cjm_: ahh, nice, thank you [23:21] hij1nx: SubStack: x.on('foo/*/bar', function() { ... }); // here it is -- https://github.com/hij1nx/EventEmitter2 [23:21] SubStack: nifty [23:21] hij1nx: =) [23:22] jmoyers: bah! [23:22] jmoyers: i just did something identical [23:22] hij1nx: SubStack: Namespaces, Wildcards, TTL (enhances the `once` concept) [23:22] azeroth_ has joined the channel [23:22] hij1nx: jmoyers: link? [23:23] jmoyers: its not an github, and its written in coffeescript ;-) [23:23] SubStack: TTL looks super sweet [23:23] hij1nx: jmoyers: bah [23:23] bbrandon has joined the channel [23:23] jmoyers: ACTION chuckles [23:23] jmoyers: i just needed something for wildcard pub sub [23:23] jmoyers: that wasn't linked to some message queue library [23:23] jerrysv: ok, if anyone is interested, judy arrays now supporting binary data [23:23] jmoyers: will have to look at your data structures [23:24] hij1nx: jmoyers: what data structures? [23:24] jmoyers: without doing regex a thousand times per second, i came up with some sort of hybrid tree structure [23:24] niftylettuce has joined the channel [23:24] jmoyers: for storing the listeners and such [23:24] hij1nx: jmoyers: uh.. i lost you =) [23:24] hij1nx: jmoyers: ah! [23:24] hij1nx: jmoyers: i dont use regex [23:25] hij1nx: jmoyers: (for this) =) [23:25] jmoyers: i see that, looks like you are exploding on delimeters and such [23:25] SubStack: v8: var t0 = Date.now(); for (var i = 0; i < 1000; i++) 'foo'.match(/oo/); Date.now() - t0 [23:25] v8bot: SubStack: 1 [23:25] hij1nx: yes, according to the benchmarks, it performs better than EventEmitter [23:25] jhurliman has joined the channel [23:25] charlesjolley- has joined the channel [23:26] SubStack: doesn't seem like a significant thing to optimize [23:26] SubStack: v8: var t0 = Date.now(); for (var i = 0; i < 100000; i++) 'foo'.match(/oo/); Date.now() - t0 [23:26] v8bot: SubStack: 80 [23:26] jmoyers: me likey [23:26] hij1nx: SubStack: yeah, but it would be unacceptable if it performed worse [23:26] dyer has joined the channel [23:26] dyer has joined the channel [23:27] SubStack: I would suppose that doing a custom parser would be slower than regex most of the time [23:27] jmoyers: reaally? [23:27] SubStack: since the regex engine is heavily optimized and can memoize expressions it has seen before [23:27] hij1nx: the construct is quite well-known [23:27] SubStack: in perl this is absolutely the case [23:28] willwhite has joined the channel [23:28] jmoyers: doesn't seem right [23:28] SubStack: plus the regex engines are written in highly optimized c [23:28] jmoyers: since no matter what [23:28] jmoyers: if you are using regex [23:28] jmoyers: you're iterating over a list of listeners and matching a path [23:28] SubStack: it's basically like writing in a highly optimized pattern language instead of javascript [23:28] spcshpopr8r has joined the channel [23:28] mintbridge has joined the channel [23:29] jmoyers: well this is what most message queues do [23:29] jmoyers: except most message queues are linked to... a message queue [23:29] jmoyers: which i dont need for development [23:29] jmoyers: i think its a nice use case personally [23:29] jmoyers: i need an in process pub sub that can later transition to a pluggable message queue [23:30] hake has joined the channel [23:30] hij1nx: writing EventEmitter2 was a biproduct writing this https://github.com/hij1nx/EventVat [23:30] spcshpopr8r: good morning #node.js ...I'm new at this (node and javascript), just discovered hotonode.org and would like to follow along...cloned the repo...dropped into it and did an "npm install wheat" that all worked..now what? [23:30] jmoyers: seems like you can do a lot of work on the store side, ie when you add listeners [23:30] MooGoo: spcshpopr8r: create the next facebook [23:30] hij1nx: EventVat is basically Redis for the browser, or Redis-in-process w/only javascript [23:30] ChrisPartridge has joined the channel [23:31] hake: hi, anyone can help install nodejs with Nginx on ubuntu 10.10 linode hosting ? [23:31] hij1nx: hake: why put Nginx in front? [23:31] DTrejo: hake: npm view node-static [23:31] hij1nx: hake: just install node and go [23:31] DTrejo: npm docs node-static [23:31] DTrejo: * [23:32] spcshpopr8r: yes MooGoo, that's the idea right... [23:32] hij1nx: npm install DTrejo [23:32] hij1nx: that will help a lot ;) [23:32] spcshpopr8r: sorry, I'm getting an error if I "node app.js" I get "Error: Cannot find module 'connect'" [23:32] isaacs: hij1nx: nginx is WAY better than any node program for serving static files from disk. [23:32] augustl: can I "mount" express to an existing node http server? I already have a server doing some things, and want express to use that same http server. [23:32] DTrejo: hij1nx: wait so you are making eventVat like redis in the browser but backed by localStorage and other things? [23:32] sechrist has joined the channel [23:32] spcshpopr8r: eh? do I have to install additional deps?...didn't "install wheat" do all that? [23:32] hij1nx: DTrejo: yes [23:33] DTrejo: will it also back up to the server? [23:33] DTrejo: in addition to local? [23:33] hij1nx: isaacs: thats true, but it also incurs its own overheads [23:33] DTrejo: like learning how to use it ;) [23:33] hij1nx: DTrejo: yep [23:34] isaacs: hij1nx: well, just that it owns whatever port you put it on [23:35] isaacs: but you can put your static images and such on a different hostname, and also get the DNS lookups in parallel [23:35] isaacs: the ideal is to have 4-8 resources per hostname, iirc. [23:35] niftylettuce: cheers!! \o [23:35] cpolis has joined the channel [23:36] jmoyers: or better yet [23:36] jmoyers: push your statics to a cdn [23:36] enotionz has joined the channel [23:37] cummingscm has left the channel [23:37] cummingscm has joined the channel [23:38] materialdesigner has joined the channel [23:39] descipher_ has joined the channel [23:40] wookiehang0ver has joined the channel [23:41] spcshpopr8r: can someone please point me in the right direction? (getting wheat to serve howtonode.org just on my local box) [23:41] Opaque has joined the channel [23:42] Swimming_bird has joined the channel [23:43] hake: people i'm following this tutorial http://www.freshblurbs.com/install-node-js-and-express-js-nginx-debian-lenny but something wrong [23:43] jerrysv: spcshpopr8r: did you npm install connect? [23:43] hake: when i check node with node -v [23:43] spcshpopr8r: jerrysv: yes and got another error [23:43] hake: node seems are installed [23:43] Skipants has joined the channel [23:43] jerrysv: what was the error? [23:44] hake: forgot [23:44] hake: is working now [23:44] hake: cache problem [23:44] jerrysv: spcshpopr8r: what was the error with npm? [23:44] tonymilne has joined the channel [23:44] spcshpopr8r: jerrysv: sorry, no error with npm [23:44] dguttman has joined the channel [23:44] spcshpopr8r: after "install connect" I got: [23:45] spcshpopr8r: TypeError: Object function createServer() { [23:45] spcshpopr8r: ... [23:45] spcshpopr8r: } has no method 'conditionalGet' [23:45] jerrysv: spcshpopr8r: what version of node are you sporting? [23:45] spcshpopr8r: v0.4.8 [23:46] reid has joined the channel [23:46] jerrysv: spcshpopr8r: do you have a gist of the js you're running? [23:46] springmeyer_ has joined the channel [23:46] hake: spcshpopr8r i install nodejs right now using this tutorial http://www.freshblurbs.com/install-node-js-and-express-js-nginx-debian-lenny [23:46] hake: works fine [23:46] hake: with nignx [23:47] igl has joined the channel [23:47] hake: check here working socialveo.com:3000 [23:47] hake: with express [23:47] spcshpopr8r: jerrysv: I've not pasted to gist before...should be easy right [23:48] jerrysv: spcshpopr8r: very [23:48] blup has joined the channel [23:49] spcshpopr8r: jerrysv: I'm going to repro and paste [23:50] DTrejo: jmoyers: updated address of the place: http://www.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=House+of+Air,+926+Mason+Street,+San+Francisco,+CA+94129&aq=0&sll=37.0625,-95.677068&sspn=52.285401,118.300781&ie=UTF8&hq=House+of+Air,&hnear=926+Mason+St,+San+Francisco,+California+94129&z=17 [23:50] jmoyers: crissy field right? [23:50] jmoyers: yea [23:51] DTrejo: cool [23:51] yhahn has joined the channel [23:52] neoesque has joined the channel [23:53] tjholowaychuk: isaacs is node_modules ignored by default? [23:53] davidascher has joined the channel [23:53] isaacs: tjholowaychuk: ignored when you publish a package? yes. [23:53] tjholowaychuk: hmm [23:53] perezd: so the socketio bug re overriding heartbeat settings is pretty serious :( [23:53] incon has joined the channel [23:53] tjholowaychuk: isaacs https://github.com/LearnBoost/stylus/issues/275 [23:53] isaacs: tjholowaychuk: more specifically: it ignores any listed dependencies that are not on the bundledDependency list [23:53] tjholowaychuk: not sure what's up there [23:53] philtor has joined the channel [23:53] isaacs: tjholowaychuk: if it's not a dependency, it bundles it. [23:53] konobi: hockey time! woot woot! [23:53] isaacs: tjholowaychuk: if it's explicitly a bundledDependency, then it bundles it [23:54] spcshpopr8r: npm install seems to be hanging for me [23:54] tjholowaychuk: hmm [23:54] isaacs: tjholowaychuk: so, connect was in there, but isn't listed as a dep. [23:54] pifantastic has joined the channel [23:55] isaacs: tjholowaychuk: so npm said, "Oh, TJ probably knows what he's doing,but since connect isn't listed in the package.json, it won't get installed automaticaly, so i'd better include it" [23:55] tjholowaychuk: oh i see [23:55] tjholowaychuk: i must have just pulled down connect to test one of the examples [23:55] isaacs: the goal is that whatever things look like when you publish, or what you declare in the package.json, that's what they'll look like when you install. [23:55] isaacs: yeah, i've done that a few times. [23:56] isaacs: tjholowaychuk: you could have a "scripts" : { "prepublish" : "npm prune" } just to be sure [23:56] tjholowaychuk: yeah that sounds good [23:56] RORgasm has joined the channel [23:56] isaacs: an alarming number of folks just don't declare dependencies, and then are alarmed when they're not bundled. [23:56] isaacs: (i found this out in early 1.0 rc times) [23:57] spcshpopr8r: jerrysv: I hope you're still around and can look at this: https://gist.github.com/1003634 [23:57] tjholowaychuk: haha yeah, just a bit of a gotcha, but makes sense now that I know how npm is thinking [23:58] jerrysv: spcshpopr8r: i will be in a sec, gotta help someone local, for like, real work [23:58] jerrysv: spcshpopr8r: back in a few [23:58] briznad has joined the channel