[00:02] sechrist: wooo framework partyyyyy [00:03] mattly_ has joined the channel [00:03] cloudhead has joined the channel [00:05] _announcer: Twitter: "@webr3 Haven't benchmarked against Zend yet... Monarch at 10K concurrent connections: 9786 requests/sec / Node.js at 10K: 3534 requests/sec" -- Manu Sporny. http://twitter.com/manusporny/status/16106816390 [00:08] bpot has joined the channel [00:11] nicolaerusan has joined the channel [00:11] nicolaerusan: hey guys [00:11] nicolaerusan: got a quick question [00:11] nicolaerusan: is there a way to detect what type of content the user is requesting (e.g. xml, vs. json, vs. http)? [00:12] mde: nicolaerusan: In an HTTP request, you mean? [00:12] nicolaerusan: yup [00:12] nicolaerusan: so i want to specify [00:12] chilts: that's up to you how you define what a URL should do [00:12] nicolaerusan: in the ajax request that i want ajax vs html [00:12] nicolaerusan: and i'd like to handle it in the same contorller method [00:12] mde: There's an Accepts header that tells you what the client can handle. [00:13] chilts: nicolaerusan: or just link to page.json or page.html depending on your context [00:13] nicolaerusan: ok [00:13] nicolaerusan: that works [00:13] nicolaerusan: thx [00:13] mde: So yeah, you can rely on the path extension if its there, or the Accepts header. [00:13] jbrantly has joined the channel [00:13] chilts: or include a parameter saying what you want back [00:13] nicolaerusan: ok [00:13] nicolaerusan: the accepts header [00:13] nicolaerusan: is likely the route i will go [00:13] nicolaerusan: does that seem reasonable [00:13] nicolaerusan: or are there issues with doing that? [00:13] mde: Geddy's controller code has a bunch of content-negotiation code that works with that. [00:14] chilts: I don't think that answers your question but hope you work it out :) [00:14] mde: Well, the Accepts header usually includes a list of what the user-agent can accept. [00:15] nicolaerusan: yah [00:15] mde: So if there's a path extension, just return what the client asked for. [00:15] nicolaerusan: i was trying to use the ajax object from jquery [00:15] nicolaerusan: yah the path extension [00:15] nicolaerusan: may be the way to go [00:16] nicolaerusan: i would need to parse the request [00:16] mde: But if there isn't one, you do the content-negotiation dance. [00:16] nicolaerusan: and then return appropriately [00:16] gwoo has joined the channel [00:16] mde: You can take a look at what Geddy does: http://github.com/mde/geddy/blob/master/geddy-core/lib/controller.js [00:17] mde: The interesting stuff is in negotiateContent [00:17] mde: There's also something called "quality factors," but I'm not bothering with that yet. :) [00:18] isaacs_mobile has joined the channel [00:19] nicolaerusan: so would there be any reason to not just use the accept headers? [00:20] nicolaerusan: (i.e. if we abandon the extensions route for the time being?) [00:20] nicolaerusan: i am reading the Geddy code now [00:20] TommyM: ollym: have you tried Connect? [00:20] mde: Yeah, just have some reasonable default content-type, and make sure the client can accept it. [00:21] nicolaerusan: hmm ok [00:21] nicolaerusan: that makes sense [00:21] mde: And if not, fall back to something else. [00:21] mde: So, with Geddy controllers, you can specify an array of formats in the respondsWith property. [00:22] mde: And it will mate the first available format with the first accepts entry that matches it. [00:22] mde: A lot of clients end up including */* which means "I'll take whatever you've got." [00:25] linuxsable has joined the channel [00:27] softdrink has joined the channel [00:27] _announcer: Twitter: "@dcurtis node.js installer for cydia." -- Scott Fitchet. http://twitter.com/figital/status/16108110938 [00:29] jakehow has joined the channel [00:30] steadicat has joined the channel [00:32] _announcer: Twitter: "nodejs for Windows - node-v0.1.98 | Google Groups http://bit.ly/b6Cg80" -- Scot Gellock. http://twitter.com/sgellock/status/16108399004 [00:36] linuxsable has joined the channel [00:37] fictorial has left the channel [00:37] fictorial has joined the channel [00:38] mtodd has joined the channel [00:43] Validatorian has joined the channel [00:44] _announcer: Twitter: "@webr3 Node.js benchmark src: http://pastebin.com/hQxRUcQf - performance graph vs. Monarch & Apache2+PHP5: http://imgur.com/a82vS.png" -- Manu Sporny. http://twitter.com/manusporny/status/16109129531 [00:45] skampler has joined the channel [00:48] [[zz]] has joined the channel [00:50] adamwiggins: is there a way to end the event loop after all the output queues have been flushed? calling process.exit() can result in truncated output [00:50] charlesjolley- has joined the channel [00:52] kevm has joined the channel [00:52] adamwiggins: so far I'm using this workaround: setTimeout(function() { process.exit(code) }, 50) [00:53] Tim_Smart has joined the channel [00:55] linuxsable has joined the channel [00:55] fictorial: adamwiggins: I haven't tried this, but can you add a listener for 'drain' on process.stdout that calls process.exit? [00:56] fictorial: you'd need to enable the exit conditionally though; hmm. [00:56] xla has joined the channel [00:57] adamwiggins: fictorial: thanks, good suggestion - trying now [00:57] adamwiggins: but yeah sounds like it will require setting some kind of all_done global [00:58] adamwiggins: yep that works [00:59] fictorial: adamwiggins: great. how's the node.js tcp (not http) support coming for heroku? [01:00] fictorial: a) on the roadmap b) in progress c) shutup kid [01:00] adamwiggins: heh, that would imply we have something as fancy as a "roadmap" [01:00] adamwiggins: ;) [01:01] adamwiggins: would love to see that for sure, but it's a fair departure from all the routing mechanisms we have in place today [01:01] fictorial: true [01:01] fictorial: ok, thanks [01:01] ph^ has joined the channel [01:03] _announcer: Twitter: "Okay, should I make a Sinatra, RoR, or Node.js app for my new blog? (on bradjohansen.com) Most likely to be hosted by @Heroku." -- Brad Johansen. http://twitter.com/johansenbrad/status/16110318365 [01:08] Validatorian: fictorial: would you be able/willing to look at something for me? I'm having trouble wrapping my head around how I would get these values from redis, due to it being async, i've been hacking at it for a few hours, and I'm sure it's a simple solution. [01:08] Validatorian: https://gist.github.com/b790efcd9d184478651a [01:09] fictorial: sure, I'll take a look [01:09] mikeal has joined the channel [01:09] Validatorian: the issue is getting the values from the auction details [01:10] Validatorian: I want to put the object containing the x auction detail objects, along with the keys in them, as the value for auctionDetails within the locals: [01:10] keeto has joined the channel [01:11] fictorial: ok [01:11] fictorial: what seems to be the problem, officer? [01:12] Validatorian: well, I'm not sure how to do it :-/ by the time the self.render runs, it hasn't returned a value for the variable I'm setting within the loop above it [01:13] Validatorian: but I don't want to put the rest of that code in the for loop [01:13] fictorial: you might consider using the 'flow' module [01:14] fictorial: I use it in nodered and love it -- there are others ('step' and 'do' I believe) [01:14] fictorial: with flow, you can fire off a number of async requests and wait for all of them to return before working on the result(s) [01:14] ditesh|cassini has joined the channel [01:14] fictorial: also, your code is not checking errors [01:15] Validatorian: I know, this is very early, just a demo page [01:15] fictorial: perhaps you have a 'no such key' or 'wrong type' error [01:15] fictorial: ok [01:15] Validatorian: when I sys.puts the data within the for loop, it's there [01:15] Validatorian: so shouldn't be an issue with redis or the data -- it's just my code [01:17] fictorial: so, the thing is that by the time your callback fires on line 26 the var i has changed [01:17] fictorial: you can fix that in a number of ways... [01:17] fictorial: you could call a function whose parameter "locks-in" the value of i from just before the call to hgetall on line 26 [01:18] fictorial: or you could use 'flow' with the this.MULTI() feature, like I do here: [01:18] fictorial: http://github.com/fictorial/nodered/blob/master/bin/nodered.js#L101-162 [01:19] tilgovi has joined the channel [01:19] Validatorian: interesting, I'll give that a shot [01:19] Validatorian: thanks fictorial [01:22] fictorial: glad to help... that issue has come up before. referring to the index var value of a for-loop in a callback... by the time the callback fires, the value has been incremented. if the callback fires on nextTick or thereafter, i will be equal to liveAuctions.length for each of the callbacks... so I bet you see that auctionDetailList only has one element in it. [01:22] fictorial: anyway, use flow/step/do as it'll tidy up the code as well w.r.t. nesting. [01:26] jashkenas has joined the channel [01:27] jakehow has joined the channel [01:32] ako has joined the channel [01:42] hammerdr_ has joined the channel [01:45] joshbuddy has joined the channel [01:48] jashkenas: yo Validatorian: still around? [01:48] Validatorian: yep [01:48] jashkenas: I was just reading through the backlog, and noticed your inner-function-not-closing-over-variables perdicament. [01:49] jashkenas: I had just committed a CoffeeScript patch that fixes this for comprehensions that contain inner functions, and gave your example a spin. [01:49] jashkenas: Here's a gist with the translation, and the JS it produces, if you're interested: [01:49] jashkenas: https://gist.github.com/be5f10c57b5f377bafd1 [01:49] rictic has joined the channel [01:50] fictorial: yeah, the js code on line 26 there is closing it in a function like I mentioned earlier. nice. [01:51] jashkenas: fictorial: we can detect at compile time if you're creating a function inside the body of the loop, and inject the closure if you are... [01:51] fictorial: wow, that's slick. I was just going to ask you if that's what was happening. [01:54] rictic has joined the channel [01:54] Validatorian: that is slick :) [01:55] Validatorian: thanks for that -- auctionDetails is coming up null though, I'll have to figure out why [01:55] Validatorian: auctionDetailList, I mean [02:00] Validatorian: so _d has the data, but when it gets to the self.render, auctionDetailList = [] [02:01] jashkenas: Validatorian: I wasn't quite sure what you were trying to do in the innermost part of the original gist... [02:01] jashkenas: you're checking for auctionDetailList.i ... do you mean auctionDetailListp[i] ? [02:02] jashkenas: If so, you set it to an empty array, and then immediately set it to an object literal. [02:02] Validatorian: probably [02:03] jashkenas: auctionDetailList will still be [], if there's nothing in the auctionDetails object... [02:03] Validatorian: there's certainly data being returned with auctionDetails [02:04] _announcer: Twitter: "@connorlacombe So what do you think, should I create my own blog with Rails, Sinatra or Node.js?" -- Brad Johansen. http://twitter.com/johansenbrad/status/16114087384 [02:04] Validatorian: so, redis.zrange('site:1:open'... returns an array of ids, [1, 2, 3]; -- then redis.hgetall( uses each id to get the details of each, which returns an object... I think.. maybe an array. The buffer response throws me off -- fictorial would know :) [02:05] jashkenas: you can always puts inspect it and find out... [02:05] Validatorian: that gives me the buffer [02:05] fictorial: there are examples of usage for supported redis commands in test/test.js in redis-node-client. [02:06] Validatorian: that's why I toString(), which gives me the data, not the buffer -- not sure how to convert the buffer to an array/object though -- I couldn't get the convertMultiBulkBuffersToUTF8Strings to work, but I'm sure I was jsut doing it wrong [02:06] _announcer: Twitter: "@connorlacombe What the Javascript beast hasn't used Node.js? :P http://nodejs.org" -- Brad Johansen. http://twitter.com/johansenbrad/status/16114260742 [02:07] fictorial: commands that return an array of values will be an array of Buffer objects... it's common for the Buffers to be UTF-8 encoded strings, hence that verbosely-named helper function. [02:07] Validatorian: oh, I see what I did wrong with the utf8 thing [02:08] charlesjolley-_ has joined the channel [02:09] adamwiggins has joined the channel [02:11] _announcer: Twitter: "writing a new post about first impressions on using Express for node.js to the sound of Massive Attack" -- Hernan Garcia. http://twitter.com/theprogrammer/status/16114581756 [02:13] user9 has joined the channel [02:14] kersny has joined the channel [02:14] jakehow has joined the channel [02:15] fictorial has left the channel [02:15] fictorial has joined the channel [02:23] _announcer: Twitter: "@ahmednadar: I though about it but I'm very focus on Mongo, Ruby and now, node.js. Not loving .net at the moment :-)" -- Hernan Garcia. http://twitter.com/theprogrammer/status/16115364663 [02:25] jedschmidt has joined the channel [02:33] Kiba: The Cult of Node will Rise! [02:39] user9: need more tiberium [02:40] SamuraiJack has joined the channel [02:42] fictorial: oh wow I have not seen Samurai Jack in years! [02:54] markwubben has joined the channel [03:00] JimBastard has joined the channel [03:01] mrjjwright_ has joined the channel [03:06] ditesh|cassini has joined the channel [03:10] _announcer: Twitter: "@chasesechrist, @grantmichaels, @miksago: What the hell am I doing wrong here? http://pastie.org/1003326 - That's my node.js setup + siege" -- Keith Hanson. http://twitter.com/keith_hanson/status/16118579787 [03:10] mtodd has joined the channel [03:13] cloudhead has joined the channel [03:14] Tim_Smart has joined the channel [03:15] maushu: So, what is the most stable database connector now available? [03:19] TommyM has joined the channel [03:19] TommyM has left the channel [03:21] siculars has joined the channel [03:25] _announcer: Twitter: "@bjschaefer Or is a web app a shitty thing to write your first nodejs app in? :P" -- Keith Hanson. http://twitter.com/keith_hanson/status/16119445064 [03:28] jsilver has joined the channel [03:31] jsilver: l/list [03:35] Tim_Smart: maushu: I have found cradle to be qutie nice [03:35] Tim_Smart: *quite [03:35] maushu: Hmmm. [03:35] jsilver: what's everyone's opinion of CoffeeScript [03:35] Tim_Smart: jsilver: I use it regularly and love it [03:35] jsilver: awesome [03:35] jsilver: :) [03:35] jsilver: i am looking into it and it looks good [03:36] jashkenas: jsilver: it's my experiment, so feel free to ask me anything here or on #coffeescript. heading out soon though. [03:36] jsilver: awesome will ajoin thanks jashkenas [03:37] jsilver: is coffeescript compiled at runtime when used with node? [03:37] jsilver: by coffee [03:38] jashkenas: It can be, but it's always recommended to compile first, if you're working on something major. [03:38] jsilver: that makes sense to me [03:38] jashkenas: Much more convenient to debug with the JavaScript in-hand, instead of through an eval() [03:38] jsilver: very true [03:38] jashkenas: If you require 'coffee-script' first ... Node will automatically be able to run ".coffee" files. [03:38] jashkenas: Thanks to Tim. [03:39] jsilver: nice! i just discovered it the other day and showed it to my friend, we're coming from Ruby and think that it's excellent [03:39] Tim_Smart: I usually run my stuff directly with the coffee binary [03:39] jsilver: or interesting [03:39] jashkenas: Same rule of thumb for working in the browser with "text/coffeescript" tags. [03:39] Tim_Smart: "coffee run.coffee" [03:39] jsilver: hmm [03:40] jsilver: i think it's a lot more realistic to write a complex javascript program in something like Coffee than just having to deal with it [03:40] Tim_Smart: where "run" is the file name [03:40] jsilver: does coffee know about node or something? i'm about to install and play with it, probably watch some screencasts [03:40] jashkenas: Yep, it runs on Node these days ... you'll have to install Node first. [03:40] jsilver: ahh [03:40] Tim_Smart: jsilver: I think where coffeescript shines is the fact that it works seamlessly with other libraries [03:41] jsilver: i have installed node so that's good [03:41] jsilver: trying to learn Async architecture really well and write better (scalable) apps [03:41] jsilver: coming from the rails (non-async) world [03:41] jashkenas: aren't we all. ;) [03:41] jsilver: :) [03:41] jsilver: i'm also getting my friend who learned rails with me to learn coffee and node apparently [03:42] jsilver: and we may contribute some patches if we can [03:42] hammerdr_: fictorial: I'm not too familiar with redis. Is it possible to serialize javascript objects into native redis data structures? E.g. sets, hashes, arrays, strings [03:42] Tim_Smart: jsilver: Cool. Well as jashkenas pointed out, chuck your coffeescript comments and queries on #coffeescript , and everything else on this channel :) [03:43] jsilver: awesome [03:43] jsilver: no prob [03:43] visnup: jsilver: we're using coffee + node (and mongodb) for the node knockout website: http://github.com/gerad/nodejs-knockout [03:43] jsilver: visnup: sweet, ill have a look [03:43] visnup: not sure if everything's the best way to do it, but it's working for us so far [03:44] jsilver: visnup: awesome to have an example of async arch tho [03:44] visnup: jsilver: it's definitely weird to think in async coming from rails [03:45] Tim_Smart: I'm lucky in that I never got as far as rails before node came aloong [03:45] jsilver: yeah, I think I'm over it but it seems like a lot of Rails people are scared of Node [03:45] jsilver: but I agree Rails is completely sync [03:45] jashkenas: visnup: your Mongo model is really interesting: http://github.com/gerad/nodejs-knockout/blob/master/models/mongo.coffee [03:45] jsilver: and the fact that it's sync makes it wrong [03:45] jsilver: imo anyway [03:45] Tim_Smart: But also unlucky in the fact that I worked with PHP a bit. Most of my experience is JS though [03:46] jsilver: PHP is a sad thing [03:46] hammerdr_: i don't think that's a fair comparison [03:46] jsilver: PHP :( [03:46] hammerdr_: async programming isn't popular in general [03:46] jsilver: true [03:46] jsilver: Imo Async is the only way to write a reliable server [03:46] jsilver: and the rest is a silly joke [03:46] jsilver: basically same viewpoint as ry [03:47] jashkenas: visnup: lines like this are pretty awesome: [03:47] jashkenas: [@user, @password]: uri.auth.split(':') if uri.auth? [03:47] jashkenas: that's got a lot going on. [03:47] _announcer: Twitter: "Hmsauce... I'm thinking Node.js's Mongodb adapter is slow. Anyone have any pointers? http://pastie.org/1003347" -- Keith Hanson. http://twitter.com/keith_hanson/status/16120751179 [03:47] fictorial: hammerdr_: re: redis, not from Node.js, no. from Ruby, yes (Ohm). [03:48] jsilver: visnup: I am gonna watch that project on Github [03:48] visnup: jashkenas: oh yeah, we go back and forth on as terse as possible and not [03:48] fictorial: ryah: what's up with this TODO? it looks like that feature is actually implemented. http://github.com/ry/node/blob/02da5ed4a1f63bb0990b8e7b1fd0793cd045cbb0/lib/dgram.js#L69 [03:48] Validatorian: fictorial: do you see any issues with the flow usage here? http://gist.github.com/437253#file_with%20flow -- it seems to be hanging -- it looks like flow wants a callback or something, I'm not sure. The gist at the bottom of the page is the script without the flow and it 'works' except it doesn't have the data [03:49] visnup: jsilver: cool [03:49] gerad has joined the channel [03:50] fictorial: Validatorian: yeah, that's not at all how to use flow. [03:50] Validatorian: lol [03:50] Tim_Smart: Validatorian: Another 'parallel' library to check out http://github.com/Tim-Smart/node-common/tree/master/lib/parallel/ [03:50] Validatorian: I looked at the examples, and it's... similar [03:51] fictorial: read the docs again and check out that example of how NodeRed uses it... you'll want to do something very very similar. [03:53] hammerdr_: fictorial: re: redis.. ah, alright. Probably be easier for me to use couch in this case then :) [03:54] Validatorian: looks like another fundamental misunderstanding... from the docs/example, it looks like I should have a callback for getAuctionDetails, and call it like this: getAuctionDetails(i, this); -- but that defeats the purpose [03:55] fictorial: no, it doesn't. you want a function per 'stage' (each hgetall, etc.)... then for the stage in which you have a for-loop, use 'this.MULTI()' [03:55] fictorial: look at the nodered example [03:55] ewdafa has joined the channel [03:56] Validatorian: I swear I'm staring at your example right now -- I'm just slow ;) [03:57] fictorial: another example: http://github.com/fictorial/nodered/blob/master/lib/ext/pubsub.js#L201-225 [03:58] visnup: jsilver: fyi, a lot of the CRUD stuff to/from mongo is still being written [03:58] jsilver: visnup, interesting, me and my friend want to get involved with contributing to code we like/care about [04:02] _announcer: Twitter: "Really loving #nodejs http://www.nodejs.org/" -- Samer Ziadeh. http://twitter.com/samerziadeh/status/16121581592 [04:05] gerad: jsilver: may push some stuff tonight, if I can get happy with it [04:06] gerad: jsilver: (along the mongo CRUD lines) [04:06] jsilver: well dont over work yourself is what I try to say :) [04:06] jsilver: but cool! [04:06] gerad: jsilver: alternatively, would be happy to use somebody else's library too! [04:06] jsilver: would be a good blog article if ya found one ya liked [04:06] jsilver: id be interested to hear [04:16] tilgovi has joined the channel [04:20] cloudhead has joined the channel [04:22] mrjjwright_ has joined the channel [04:24] Validatorian: fictorial: I'm going to have to call it a night, it's just not clicking with me. I'm pretty sure I did it right for the getAuctionDetails function, but I have no idea how to add it to the bottom part, to ensure that all the getAuctionDetail functions were run before hitting the self.render. http://gist.github.com/437270 [04:24] Validatorian: thanks for your help though [04:24] jsilver: yay I'm watching [04:24] jsilver: http://vimeo.com/9968301 [04:27] jsilver: better than his Yahoo talk [04:31] isaacs has joined the channel [04:34] _announcer: Twitter: "Drinking the Node.js kool-aid: http://journal.paul.querna.org/articles/2010/06/12/node-js/" -- Mark Mayo. http://twitter.com/mmayo/status/16123191691 [04:37] magcius has joined the channel [04:40] JimBastard: so does anyone wanna help me "port" node to the browser? i have the first two iterations mapped out. at the end of the first sprint there will be a slick online demo ready. [04:40] JimBastard: im a little busy this week or else id be working on it right now [04:41] JimBastard: doing o-behave stuff [04:41] JimBastard: >.< [04:42] markwubben has joined the channel [04:44] jsilver: how so and what browser [04:44] jsilver: and why [04:49] hammerdr has joined the channel [04:49] hammerdr has left the channel [04:50] hammerdr has joined the channel [04:50] hammerdr: anyone know which is more mature/better maintained.. node-couch or node-couchdb? [04:50] jsilver: i would check the commits and stuff [04:55] _announcer: Twitter: "#Faye — simple pub/sub messaging for the web #ruby #nodejs" -- outpunk. http://twitter.com/outpunk/status/16124204597 [04:58] Validatorian: Tim_Smart: do you have any usage examples for that parallel library? [05:00] Tim_Smart: Validatorian: Sure. I had some on gist I can dig up. [05:01] Validatorian: I would really appreciate it, I've been working on this seemingly tiny issue all day long [05:01] keeto has joined the channel [05:02] Validatorian: http://gist.github.com/437290 -- trying to get self.render to wait until getAuctionDetails has finished running [05:02] nsm has joined the channel [05:03] Tim_Smart: OK I'll see if I can hack a example around that [05:03] Validatorian: oh, that would be awesome :) [05:04] dabreaka has joined the channel [05:04] Tim_Smart: OK so every call to getAuctionDetails calls async code? [05:05] Validatorian: not sure I understand the question [05:06] Tim_Smart: getActionDetails functions calls a async redis function right? [05:06] Validatorian: yes [05:06] Tim_Smart: ok [05:07] admc has joined the channel [05:10] jbrantly has joined the channel [05:16] joshowens has joined the channel [05:16] Tim_Smart: Validatorian: http://gist.github.com/437298 [05:17] Tim_Smart: I also use Parallel in my node-asset module here: http://github.com/Tim-Smart/node-asset/blob/master/src/index.coffee#L57 [05:19] utgo has joined the channel [05:22] JimBastard: yo Tim_Smart , ive got a solid plan to "port" node to the browser [05:23] isaacs: JimBastard: omg, me too! [05:23] JimBastard: let you run node code in the browser completely unmodified [05:23] isaacs: JimBastard: step 1: build a web browser in node [05:23] isaacs: JimBastard: step 2: ... [05:23] JimBastard: i think we might be talking about something diffirent [05:23] jbrantly: JimBastard: you get your "simple require"? [05:24] JimBastard: jbrantly: i did the ole 4 liner with script tags and a queue [05:24] JimBastard: im just gonna enforce a ready block [05:24] JimBastard: like jquery does [05:24] JimBastard: thanks for all the good links [05:24] JimBastard: that was good stuff [05:24] jbrantly: np [05:26] Tim_Smart: JimBastard: Hmm... The only thing I would be interested in is porting commonJS to the browser [05:26] Validatorian: Tim_Smart: seems to make the script hang -- suppose it might be an issue with express, though [05:26] Tim_Smart: ok. Let me check my gist again [05:27] Validatorian: Tim_Smart: here's mine, with your code implemented: http://gist.github.com/437307 [05:28] Tim_Smart: Are you getting the sys.puts output from getAuctionDetails? [05:28] JimBastard: Tim_Smart: there are require solutions [05:28] JimBastard: that part is easy [05:28] Validatorian: Tim_Smart: yes [05:29] Validatorian: but it doesn't get to the self.render, is my guess [05:29] Validatorian: or it's waiting for it to, rather [05:29] Tim_Smart: JimBastard: Yeah it is :) Whats the use case? [05:29] JimBastard: if i show you, will you be a hater :-( [05:30] Tim_Smart: Validatorian: Put in a sys.puts call in the run callback like this: http://gist.github.com/437298 [05:31] Tim_Smart: and let me know the output [05:32] Validatorian: nada -- didn't hit it [05:33] _announcer: Twitter: "Connect: Great middleware for Node! http://zi.mu/l3p node.js 威武!" -- Chris. http://twitter.com/Chris_Ys/status/16125960332 [05:33] Tim_Smart: Validatorian: No errors or anything/ [05:33] Validatorian: just hanging still [05:34] Tim_Smart: OK, then it is doing something [05:34] Validatorian: you only added line 18 there, right> [05:34] Tim_Smart: Wait a sec [05:34] Tim_Smart: getAuctionDetails needs a callback >.> [05:35] JimBastard: http://www.nodejsjs.org/demo [05:35] JimBastard: Tim_Smart ^^^ thats like a 30 minute brain dump, nothing works and its all vapor [05:35] Tim_Smart: Validatorian: Take another look at http://gist.github.com/437298 [05:35] Tim_Smart: (the getAuctionDeatails function in particular) [05:35] JimBastard: i had to stop because of a hosting problem (domain forwarding fucking up with iframe). gonna get back on it in a few days [05:35] Validatorian: ... sorry :-/ [05:36] Tim_Smart: Validatorian: The second 'callback' parameter, and the call to callback() on line 8 [05:37] Tim_Smart: Make those two changes and let me know how that works [05:38] Tim_Smart: JimBastard: OK. I'm not too sure how I would make use of it quite yet, but nice work none-the-less [05:39] JimBastard: ill map out more examples soon enough [05:39] JimBastard: will be a little pet project i can add to the massive list [05:39] Tim_Smart: Cool. Examples would help considerably :) [05:39] Validatorian: huzzah! :) thanks Tim_Smart [05:45] mikeal has joined the channel [05:51] dabreaka_ has joined the channel [05:54] jbrantly: JimBastard: I don't think you're going to be able to do what you want to do with "injector" [05:55] jbrantly: it's not quite as easy as you initially think to write require :) [06:02] daqing has joined the channel [06:02] daqing: hi, hi, How can I run shell script from node.js? [06:02] JimBastard: jbrantly: i think i will [06:03] mikeal: http://nodejs.org/api.html#child-process-83 [06:03] JimBastard: maybe not [06:03] JimBastard: i might need a regex [06:03] JimBastard: but its gonna work [06:03] mikeal: daqing: ^^ [06:03] jbrantly: JimBastard: when the "load" event fires, the code has already run [06:03] JimBastard: i know [06:03] JimBastard: im letting it hit the document [06:04] visnup has joined the channel [06:04] JimBastard: then im pulling it back out, toString() it, wrapit, and eval it into my namespace [06:04] JimBastard: its executing everything twice [06:04] JimBastard: :-D [06:04] jbrantly: JimBastard: eww? [06:04] JimBastard: jbrantly: you cant argue with results [06:04] JimBastard: who knows [06:04] jbrantly: JimBastard: it results in massive global namespace pollution [06:04] JimBastard: < 30 minutes [06:04] JimBastard: ill think about it [06:04] JimBastard: did you read the comments? [06:04] JimBastard: lol [06:05] JimBastard: im working on it [06:05] JimBastard: i can make it work for some basic demos im sure [06:05] sechrist: okay so if a tcp socket doesn't like you and it throws a ECONNREFUSED -- how the hell do you catch this? [06:05] sechrist: so I can elegantly degrade [06:05] JimBastard: i would shake the shit out the tcpip socket [06:05] mikeal: that's an error event [06:05] sechrist: I can catch unhandled exceptions -- but that throws me out of context [06:05] sechrist: yeah [06:05] mikeal: on the client [06:05] sechrist: yeah [06:05] daqing: mikeal: oh, thank you [06:05] sechrist: try{} around the http.client code is uh not getting it [06:06] mikeal: yeah, it won't [06:06] sechrist: so I have no idea how to get catch it in context [06:06] sechrist: :\ [06:06] jbrantly: JimBastard: try, for instance, loading a module consisting of the following: "var require = undefined", and then try to load any module after that :) [06:06] mikeal: client.addListener('error', function(err){}) [06:06] mikeal: if you don't have a listener on an error even then it will throw [06:06] JimBastard: jbrantly: did you read the docs [06:06] mikeal: but if you do have one then it'll be fine [06:06] jbrantly: JimBastard: yes? [06:07] mikeal: sechrist: ^^ [06:07] JimBastard: .// pray that the "require" variable isnt already taken // consider CONFLICT mode on at all times [06:07] JimBastard: i think im pretty clear ahahaha [06:07] JimBastard: but yo [06:07] JimBastard: toString() + static code analysis [06:07] JimBastard: i can do pretty much ANYTHING [06:07] JimBastard: its metamagic [06:07] sechrist: mikeal: thanks -- makes sense -- may need to hack up express tho :\ [06:08] jbrantly: JimBastard: eh.. GL I guess, but it seems incredibly hacky/unstable as-is [06:08] JimBastard: you mean in the 30 minutes i took to write all that? [06:08] JimBastard: i agree [06:08] mikeal: this is why there are so many objections to all these layers of abstraction people are working on [06:08] JimBastard: ill work on it! [06:08] jbrantly: JimBastard: not your proof-of-concept, but your whole design :P [06:08] JimBastard: well [06:09] JimBastard: if i get the proof of concept working [06:09] JimBastard: then we can talk about that [06:09] JimBastard: deal? [06:09] jbrantly: lol, fine fine [06:09] JimBastard: kk [06:09] sechrist: mikeal: I agree -- I'm against frameworks -- I had a discussion in here earlier about them [06:09] sechrist: but express just made something that would normally take 25 lines -- like 4 [06:09] mikeal: i've been really happy not using a framework [06:09] sechrist: it handles redirects and all that crap in it's http.client [06:10] sechrist: so I just chose it for a hacky POC [06:10] mikeal: just use request [06:10] mikeal: it's a lot simple and exposes the client [06:10] mikeal: er simpler [06:10] mikeal: http://github.com/mikeal/node-utils/tree/master/request/ [06:10] mikeal: var opts = {uri:'http://google.com'} [06:11] mikeal: request(opts, callback) [06:11] mikeal: opts.client.addListener('error', function ......) [06:11] Sudar has joined the channel [06:11] tisba has joined the channel [06:14] rope has joined the channel [06:15] softdrink has joined the channel [06:16] sechrist: heh speaking of abstractions -- I was surprised to find out that you can't just provide a fd to http.client to pick the outgoing IP. had to hack up net.js and recompile node [06:16] sechrist: works fine tho [06:16] jbrantly has left the channel [06:17] jsilver: what's the offical way of using coffee with node now [06:18] jsilver: #!/whatever/coffee right [06:21] sechrist: I usually put it in a cup [06:21] sechrist: with some creamer [06:21] mikeal: haha [06:21] mikeal: yeah, i thought people were over that? [06:21] sechrist: capistrano mmmmm [06:22] bmizerany has joined the channel [06:26] shahbaz: hi, what book should i get as a java programmer trying to get into server-side javascript (such as node.js) [06:29] jetienne has joined the channel [06:29] SubStack: delicious coffee [06:29] SubStack: shahbaz: why do you need a book? [06:30] jetienne: fs.close(fd, callback) <- what are the parameters of the callback ? [06:30] SubStack: I hate books. Can't click links or search for text. [06:30] jetienne: oreilly provides chm version i think [06:31] markwubben has joined the channel [06:31] jetienne: and i agree books are heavy and become large with time [06:31] shahbaz: SubStack, most of the web 'tutorials' seem to be for web developers who want to change images on roll-over (or something similar) [06:31] shahbaz: I keep tripping over "this" (even after reading an aritcle or two on it) ... figured I needed a fresh overview, rather than thinking of js as java-lite [06:32] hammerdr has joined the channel [06:32] SubStack: shahbaz: https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference is pretty good [06:32] jetienne: "javascript the good parts" [06:33] SubStack: the ecma spec is pretty worthless, also [06:33] SubStack: and only distributed as a pdf [06:33] jetienne: http://oreilly.com/catalog/9780596517748 [06:33] jetienne: http://www.youtube.com/watch?v=hQVTIJBZook [06:33] SubStack: I hate it so much. [06:33] NazariusK has joined the channel [06:33] SubStack: ACTION is a kind of hate machine [06:34] shahbaz: wow, video of "The Good Parts" I've seen it mentioned before, didn't know of the video, thanks jetienne! [06:35] mfeiri_ has joined the channel [06:35] jetienne: shahbaz: google tech talks at youtube contains a lot of good things [06:35] rictic has joined the channel [06:38] dabreaka has joined the channel [06:42] jetienne: my node code is leaking memory. is there a way to know what is leaking ? [06:42] micheil: not really [06:43] micheil: create a gist of your code, link me and I'll see if I can spot anywhere It may be leaking [06:43] JimBastard: jetienne: you should keep a count of open connections [06:44] JimBastard: or figure it out [06:44] JimBastard: not closing requests will do ya [06:44] jetienne: http://gist.github.com/437355 <- this function is the leaker [06:44] jetienne: but IF i remove the hash, it is no more leaking [06:44] jetienne: JimBastard: ok [06:46] jetienne: hash.update(chunk); <- this is the bad line [06:46] jetienne: apparently hash keep a ref on chunk... but chunk i never released from ram [06:48] derbumi has joined the channel [06:49] micheil: would that example work by doing.. [06:50] micheil: response.addListener("data", hash.update); ? [06:51] jetienne: response.addListener('data', hash.update); <- this causes the following error [06:51] jetienne: events:25 [06:51] jetienne: this._events[type].call( this [06:51] jetienne: ^ [06:51] jetienne: TypeError: Illegal invocation [06:51] jetienne: at IncomingMessage.emit (events:25:26) [06:51] jetienne: at HTTPParser.onBody (http:103:23) [06:52] jetienne: at Client.ondata (http:859:22) [06:52] jetienne: at IOWatcher.callback (net:373:31) [06:52] jetienne: at node.js:204:9 [06:52] jetienne: paste error [06:55] erichocean-away has joined the channel [06:58] erichocean-away: I'm having difficulty with websockets using http://github.com/miksago/node-websocket-server on Solaris [06:58] erichocean: after the handshake (successful), the connection is immediately dropped [06:58] erichocean: any ideas? [06:59] erichocean: I'm also not getting a close event, but I can see that the connection is dropped on the client side [07:00] jetienne: erichocean: ask micheil [07:02] sveimac has joined the channel [07:06] _announcer: Twitter: "先是用sinatra写了个小小的git代码部署系统,然后用Node.js重写" -- Daqing Zhang. http://twitter.com/daqing/status/16129846794 [07:08] _announcer: Twitter: "Node.js确实非常优美,值得推荐。" -- Daqing Zhang. http://twitter.com/daqing/status/16129911031 [07:08] micheil: sup? [07:09] micheil: erichocean: browser please. [07:09] erichocean: micheil: hi, I'm trying out your code on Solaris [07:09] zomgbie has joined the channel [07:09] erichocean: Chrome 5 [07:09] micheil: okay [07:09] erichocean: also my Cocoa websocket fails [07:09] erichocean: both work with Mac OS X, same code [07:09] micheil: :/ [07:10] micheil: this seems annoying [07:10] erichocean: I'm trying the latest node build now [07:10] micheil: ryah: I think there may be an issue with the http_parser on the upgrade headers on unix type systems. [07:11] saikat has joined the channel [07:12] genbit has joined the channel [07:13] erichocean: sweet, latest version appears to work [07:13] micheil: okay, what were the two node versions? [07:13] erichocean: I was running 0.1.94 before [07:13] micheil: okay, upgrade was added in 0.1.96, irrc [07:13] erichocean: I'm now running v0.1.98-5-g02da5ed [07:14] micheil: yeah [07:14] micheil: that's what I'm running too [07:14] erichocean: okay, sweet [07:14] erichocean: sorry for the noise [07:14] erichocean: you may want to update the README to spec 0.1.96 and later (i think it's 0.1.94 now) [07:15] micheil: okay [07:15] erichocean: BTW, I'm using it as part of NodeRed [07:16] micheil: looks like http://groups.google.com/group/nodejs/msg/22d4804ab030e5e1?hl=en [07:16] micheil: was the version to first support upgrade [07:17] SvenDowideit has joined the channel [07:17] genbit: Hi all, I'am trying to use node.js. How i can get POST data from request object? [07:17] _announcer: Twitter: "I have the following running on my machine at the same time right now: V8 (Node.js), JSC (Narwhal), TraceMonkey (Couch). Mmm.. javascript." -- Derek Hammer. http://twitter.com/hammerdr/status/16130287573 [07:19] micheil: erichocean: I just need to check out the infos on what tag was closest to b5bdf94 [07:20] erichocean: ok [07:20] erichocean: you could also just say that Solaris isn't known to work until v0.1.98-5-g02da5ed [07:20] micheil: yeah [07:20] erichocean: I could be the only guy who is testing it [07:22] felixge has joined the channel [07:22] felixge has joined the channel [07:22] felixge: good morning node-verse [07:23] javajunky has joined the channel [07:23] SvenDowideit has joined the channel [07:24] virtuo has joined the channel [07:28] jetienne: btw why couchdb has its own js engine... [07:29] Validatorian: gsf: you around? [07:29] jetienne: oh maybe this is because couchdb is mainly access thru http, so it doesnt matter much [07:29] jsilver has joined the channel [07:34] micheil: erichocean: I currently run the problem that I can test on any other system other then arch [07:34] micheil: erm [07:34] micheil: mac os x [07:35] nsm has joined the channel [07:36] Aikar has joined the channel [07:36] micheil: erichocean: I really need to write proper tests for the websocket server [07:37] jetienne: micheil: do you have a node client for websocket ? [07:37] micheil: sort of [07:37] micheil: there's one that's a work in progress from pgriess [07:37] micheil: I have a fork of it [07:37] jetienne: micheil: your server and his client are compatible ? :) [07:37] micheil: yes [07:38] jetienne: micheil: so a test is not hard to write [07:38] jetienne: no? [07:38] micheil: or, yes as of latest release [07:38] micheil: well, there's the problem [07:38] micheil: how do you then test the client? [07:38] micheil: which is broken, client or server? [07:39] micheil: so, all tests will be done over the net or http modules, which are heavily tested [07:39] erichocean_ has joined the channel [07:39] teemow has joined the channel [07:40] jetienne: micheil: what i would do is "pure node client+server test" and then "browser + server test"... thus you get automatic testing fully in node [07:40] micheil: well, currently the only way I have to do tests is using the browser. [07:40] jetienne: micheil: and if the webserverclient is crappy, you still have many browser implementation... this gives you the info to locate and fix the bugs, i think [07:40] micheil: I am going to automate them on the browser at some stage though [07:41] micheil: some how. [07:41] jetienne: in anycase the browser as a client gonna be the most used [07:42] micheil: yes [07:42] JimBastard: hey is anyone awake to test a new repo i just made [07:42] JimBastard: http://github.com/Marak/play.js [07:42] JimBastard: its really quick [07:42] JimBastard: mac os only [07:45] sechrist: neat [07:45] sechrist: I don't have node set up on my mac but that's neat [07:46] _announcer: Twitter: "play.js - play sound files from #node.js to your speakers, simple as cake and kid approved! http://github.com/Marak/play.js #nycjs #nodejs" -- marak squires. http://twitter.com/maraksquires/status/16131370255 [07:46] micheil: does socket.write() return a bool? [07:46] JimBastard: sechrist: check out my other libs yo [07:46] JimBastard: im on fire [07:46] JimBastard: you cant stop me [07:46] sechrist: quantity > quality obviously [07:46] sechrist: :P [07:47] sechrist: afplay is so cheating [07:47] hammerdr: jetienne: my guess is that couchdb runs its own tracemonkey environment because doing otherwise wasn't really possible when the project started [07:47] sechrist: you can't do any kind of processing in node at this rate [07:47] sechrist: JimBastard: create a universal bin that allows pcm streaming to the sound device, n00b [07:48] JimBastard: sechrist: i am setting up pieces [07:48] JimBastard: its important to break everything down into small pieces [07:48] sechrist: reeses pieces? [07:48] JimBastard: we are working on audio [07:48] JimBastard: have you seen my JSONloops? [07:48] sechrist: nah [07:48] JimBastard: im working on browser + node audio [07:48] JimBastard: tmpvar is on the openAL [07:48] JimBastard: im doing the html5 audio [07:48] micheil: do you think it would be wise to have my websocket server automatically encode things that are strings into JSON? [07:48] sechrist: Oh I see [07:48] micheil: erichocean_: ^^ [07:48] JimBastard: im on it [07:48] JimBastard: baby steps yo [07:49] erichocean_: micheil: no [07:49] micheil: k [07:51] sechrist: meh -- asynchronous db queries in node force me to think about how to render pages [07:51] sechrist: blaaaaaaaah [07:52] javajunky: yeah, it gets fun when you've got partials in play, most of the templates expect all their data up-front [07:52] JimBastard: sechrist: pages render on the client? [07:52] JimBastard: with javascript? [07:52] sechrist: eh no [07:52] JimBastard: you know?!?! [07:52] sechrist: server [07:52] JimBastard: no [07:52] JimBastard: client [07:52] JimBastard: with javascript [07:52] JimBastard: trust me [07:52] JimBastard: ahaha [07:52] sechrist: sorry I want to be able to use lynx [07:53] JimBastard: whats that? [07:53] JimBastard: like the video game? [07:53] JimBastard: handheld atari? [07:53] sechrist: nah broski [07:53] JimBastard: thats kinda old man [07:53] JimBastard: handheld jaguar is mad old [07:53] sechrist: hmm, what about this promise thing [07:53] JimBastard: http://www.kitami.tv/4portable_jaguar_2.JPG [07:53] JimBastard: what promise [07:54] sechrist: troll [07:54] _announcer: Twitter: "Back to work... very much realizing how handy evented I/O would be in #php after #dpc10 talk on node.js for an app in a SOA" -- relaxnow. http://twitter.com/relaxnow/status/16131671536 [07:54] sechrist: see I need to execute a dynamic number of redis calls before I return the html [07:54] sechrist: and with everything callback based [07:55] sechrist: i'm like wtf [07:55] javajunky: yeah you'll probably want to look at one of the flow control libraries (personally I loved promises for that sort of stuff, but they turned out not to be popular here) [07:55] sechrist: I imagine promise is sort of a context switching kind of thing [07:55] _announcer: Twitter: "Node.js, a toolkit for writing extremely high performance non-blocking event driven network servers in JavaScript: http://nodejs.org/" -- PerS. http://twitter.com/soderlind/status/16131729080 [07:56] sechrist: hard to pull off efficiently I bet [07:56] sechrist: soderlind is slooww [07:56] javajunky: sechrist: no, not really, closer to the Java 'futures API' .. [07:57] sechrist: hundreds of callbacks in order sounds like it would smash the stack [07:57] sechrist: lulz [07:57] sechrist: or virtual stack [07:57] javajunky: in order i.e. sequentially would be fine [07:57] javajunky: nested callbacks, more of an issue, but you can go pretty deep [07:58] sechrist: yeah nested callbacks [07:58] micheil: I'm waiting for the person to write the db api with a caching mechanism on top [07:59] micheil: so it proxies all db request to the cache, if they aren't cached, then it loads from the db [07:59] sechrist: uh [07:59] sechrist: that doesn't exist? [08:00] sechrist: also it's not difficult to add a caching layer [08:00] sechrist: redis and shiz [08:00] micheil: yeah, true [08:01] micheil: but I just think that'd save a lot of people some worry [08:01] daqing has joined the channel [08:01] sechrist: more like be idiot-proofing a la magic_quotes_gpc [08:01] sechrist: people that know there's a problem with running the same query over and over know how to cache it [08:01] pquerna: hmm. new v8 out. [08:02] dabreaka has joined the channel [08:03] steadicat has joined the channel [08:04] mscdex: V8: 100% vegetable juice. [08:04] sechrist: low sodium v8 is disgusting [08:04] DracoBlue has joined the channel [08:05] micheil: ACTION is redoing / rearrange a lot of the websocket server code. [08:05] mscdex: links needs websocket support :-D [08:06] sechrist: that would be like [08:06] sechrist: instant ncurses gui [08:06] sechrist: ACTION lolz [08:07] hammerdr has joined the channel [08:08] mscdex: maybe you could automate browser-based websocket tests using browsershots [08:09] daqing: hi, all: could anyone help me look at my problem: https://gist.github.com/db4bb14a83ec9d620817 [08:09] fdmanana has joined the channel [08:09] DracoBlue: daging: when do you call response.end() ? [08:10] mscdex: yeah, posting your code would be helpful [08:10] daqing: mscdex:at the end of my script.. [08:11] daqing: ok [08:12] daqing: here's my code: https://gist.github.com/34a7b28260cc5380767e [08:13] mscdex: send the content-length header [08:13] DracoBlue: and call res.end() after line 22 and once after line 26 [08:13] mscdex: and/or add the 'Connection' header and set it to 'close' [08:14] mscdex: i'd create a body variable, fill it with data, then do the writehead with the content-length and other headers. then write the body and end() [08:15] daqing: mscdex: I could't calculate the content-length up front [08:15] daqing: DracoBlue: why? [08:15] erichocean has left the channel [08:15] mape: I really want a multiple vnc-boxes -> canvas in the browser, one cursor movement is replicated through all the boxes to make testing stuff easier [08:17] DracoBlue: daging: because you end the connection, before the callback is triggered. [08:17] _announcer: Twitter: "#reddit play.js - play sound files from node.js to your speakers, simple as cake and kid approved!: submitte... http://bit.ly/90zPYi #rulez" -- REDDITSPAMMOR. http://twitter.com/REDDITSPAMMOR/status/16132498815 [08:17] daqing: DracoBlue: ok, I see. [08:18] DracoBlue: about the content length [08:18] mscdex: DracoBlue: well, unless he's just spawning processes and not needing to wait on their output [08:18] jetienne: JimBastard: http://ubuntuforums.org/showthread.php?t=593291 this is a ubuntu package which seem to provide "say" exec [08:18] DracoBlue: just do like mscdex said, and write the head right when you know how much content you will have [08:18] jetienne: http://epos.ure.cas.cz/documentation/epos-4.html#ss4.4 <- javajunky [08:18] jetienne: JimBastard: see above [08:18] JimBastard: jetienne: could you pleeeasse add that as any issue? just copy paste any info [08:18] JimBastard: with links [08:18] jetienne: ok [08:18] JimBastard: thanks man [08:18] JimBastard: im not sure how to handle package manage stuff like that [08:19] JimBastard: can npm do apt-get and yum installs and what not? [08:19] mpoz2 has joined the channel [08:19] DracoBlue: daqing: https://gist.github.com/955d254f3a1f81d33184 [08:20] daqing: DracoBlue: what if I call writeHead() multi-times? [08:20] felixge has joined the channel [08:20] DracoBlue: mscdex: guess he wan'ts the output as response, not sure about that. [08:20] DracoBlue: api says: "This method must only be called once on a message and it must be called before response.end() is called." [08:20] DracoBlue: :D [08:21] daqing: DracoBlue: yeah, I'd like to see the output in my browser. [08:21] JimBastard: thanks jetienne [08:21] felixge has joined the channel [08:21] felixge has joined the channel [08:21] mscdex: here's another way that's more DRY: https://gist.github.com/dd869ecac5ece7843752 [08:22] DracoBlue: oh noes, error handling ;) *joking* [08:22] mscdex: heh [08:23] Ori_P has joined the channel [08:23] daqing: DracoBlue: mscdex: cool! thanks for your wonderful reply! just learned a lot from you guys! [08:23] jedschmidt has joined the channel [08:24] DracoBlue: you're welcome ;) have fun [08:24] mscdex: and you could even change the http status code if there's an error or something if you want [08:25] keith_hanson has joined the channel [08:25] daqing: mscdex: yeah, thanks for your tip. [08:25] keith_hanson: anyone here familiar with express and node-mongodb? [08:26] keith_hanson: specifically, I'm having issues trying to get node-mongodb to execute my find() callback [08:28] xla has joined the channel [08:30] JimBastard: hey mscdex did you see my latest shop? http://github.com/Marak/play.js [08:30] JimBastard: also, best wordplay project name EVER [08:30] JimBastard: like EVR [08:31] margle has joined the channel [08:32] genbit: I am trying remove doc from mongodb: collection.remove({_id: '4c15e8a9f50b5c6f3b000001'}, callback); but it not removed [08:32] genbit: help me, please [08:32] javajunky: genbit: it is unlikely that's the correct id to be removing [08:33] javajunky: something like ObjectId.createFromHex('4c…') [08:33] javajunky: keith_hanson: I wrote a blog post on it if you're interested http://howtonode.org/express-mongodb [08:34] keith_hanson: javajunky: sweet :D [08:34] javajunky: genbit: also check my article, it covers your case: ObjectID.createFromHexString is the correct method [08:35] genbit: javajunky, thanks [08:35] keith_hanson: hmm [08:35] keith_hanson: javajunky: you're using mongodb-native? [08:35] keith_hanson: javajunky: have you found it to be sluggish at all? [08:36] keith_hanson: javajunky: I did some simple benchmarking and just pulling back 50 records and iterating over them, tossing them into an array, turned a vanilla express app from 1.5k req/sec to 4 req/sec [08:36] keith_hanson: javajunky: http://pastie.org/1003347 [08:37] keith_hanson: there's a whole lot wrong with that, but it's my first dive into nodejs :P [08:39] mape: keith_hanson: that sounds really strange.. [08:39] keith_hanson: yeah, agreed, heh [08:39] mape: or pulling back 50 reords == db access? [08:39] mape: *records [08:40] keith_hanson: right. I'm just executing a simple find, limiting it from 0, 50 [08:40] javajunky: 4 req/sec seems very low.. I"m not overly familiar with the flow control framework so I can't really say what that is responsible for, however I think you can deal with the resulst as a block of results and not have to callback for each record .. I can't remember, take a look at my example code. [08:40] mscdex: JimBastard: the logo(s) don't show up? [08:41] mape: keith_hanson: is the responce insanely long strings or something? [08:41] JimBastard: what mscdex ? [08:41] _announcer: Twitter: "Introduction to NodeJS http://www.yuiblog.com/blog/2010/05/20/video-dahl/ (YUI Theater)" -- Martin Grandrath. http://twitter.com/MartinGrandrath/status/16133382496 [08:41] mscdex: on your play.js repo [08:41] JimBastard: http://github.com/marak/play.js doesnt work for you? [08:41] keith_hanson: mape: it's only rendering "hi" :) One of the things I was trying to figure out, so decided not to render it. [08:41] JimBastard: you dont see play and the output text? [08:41] JimBastard: wtf [08:41] JimBastard: thats not right [08:41] JimBastard: can you inspect? [08:41] JimBastard: where did the image go? [08:41] JimBastard: http://github.com/marak/play.js [08:42] JimBastard: http://i.imgur.com/FLLGe.png [08:42] keith_hanson: javajunky: hm. the toArray? But surely simply iterating over each result from a cursor isn't causing the app to be sluggish? [08:42] keith_hanson: hmm [08:42] mscdex: i meant the both images give me 403 forbidden [08:42] _announcer: Twitter: "There'll be a new version of node-websocket-server / npm:websocket-server coming out in the next few hours. #node.js #websockets" -- Micheil Smith. http://twitter.com/miksago/status/16133425972 [08:42] keith_hanson: suppose it likely is :P [08:42] mape: keith_hanson: what if you profile it? [08:42] micheil: oh, hey keith_hanson [08:43] keith_hanson: micheil: are you miksago? :) [08:43] micheil: yup [08:43] mscdex: JimBastard: both image urls give 403: http://i.imgur.com/FLLGe.png and http://i.imgur.com/KRkGO.png [08:43] keith_hanson: haha, hiya! [08:43] keith_hanson: :) [08:43] keith_hanson: yay insomnia ;) [08:43] mape: The whole not using the same nick isn't ok :D [08:44] JimBastard: wtf [08:44] JimBastard: anyone else? [08:44] micheil: keith_hanson: I was actually in your timezone.. sleep at 7:30am. [08:44] keith_hanson: mape: what should I use for profiling? [08:44] mscdex: maybe they have to be made public? :S [08:44] mape: JimBastard: works fine [08:44] keith_hanson: mape: just a simple timer? [08:44] mscdex: huh [08:44] JimBastard: i guess new image host [08:44] mscdex: weird [08:44] keith_hanson: micheil: you ARE in CDT? [08:44] mape: keith_hanson: there is stuff built in [08:44] JimBastard: gimme a sec ill swap [08:44] micheil: keith_hanson: nup, AEST, GMT +10:00 [08:44] keith_hanson: micheil: ah haha [08:45] mscdex: ok, the images show up now [08:45] keith_hanson: mape: well, I did a simple start/stop, and the query seemed to be taking about 0.1 seconds, but every 10th or so, hung and took 1 full second (sometimes longer) [08:45] JimBastard: hrmm [08:45] JimBastard: i guess its nothing [08:45] JimBastard: i think i need to release more projects [08:45] JimBastard: ive kinda been slacking [08:45] mape: keith_hanson: node --prof --logfile=%t.log [08:46] keith_hanson: ooh [08:46] javajunky: keith_hanson: might be something to do with how you're creating the connection I don't know .. check my stuff, see if I"m creating in the same way maybe [08:46] N` has joined the channel [08:46] mscdex: no kid 'n play? :P [08:46] javajunky: there are issues with that driver under heavy load, I think you can overflow the request queues (to mongodb) [08:46] keith_hanson: ahh [08:46] JimBastard: mscdex thats the joke [08:46] JimBastard: its just play.js [08:46] JimBastard: but its kid approved [08:46] mape: keith_hanson: then run deps/v8/tools/linux-tick-processor on that output to get a nice profiling [08:46] keith_hanson: well, I'm putting 10 concurrent users on it? is that considered heavy? [08:46] mscdex: psh [08:47] JimBastard: ill make kid.js soon enough [08:47] javajunky: keith_hanson: not really no [08:47] mAritz has joined the channel [08:47] keith_hanson: javajunky: weird. ok. lemme roll back my code and see [08:47] keith_hanson: going to get a minimally viable solution here and report back :P [08:47] JimBastard: whatever, you come up with a punny-er nodejs project and we can talk [08:47] JimBastard: im putting you on notice mscdex [08:47] mscdex: nein [08:48] _announcer: Twitter: "I released #josi, a #nodejs web framework. An easy way to play with the awesome node for #aspnetmvc/#rails/#django devs http://bit.ly/aD9nbO" -- Matt Lee. http://twitter.com/thatismatt/status/16133628511 [08:49] mscdex: http://i46.tinypic.com/8yuayp.jpg [08:49] _announcer: Twitter: "play.js - play sound files from node.js to your speakers, simple as cake and kid approved!: submitted by JimBasta... http://bit.ly/90zPYi" -- Miss Susie. http://twitter.com/msusies/status/16133688442 [08:49] mape: Still works [08:50] mscdex: heh... "JimBasta" [08:51] keith_hanson: micheil: quick question. You mentioned that nothing is global unless specifically assigned as global. What about variable without the var declaration? Aren't those suppose to be global? [08:51] micheil: no [08:51] micheil: keith_hanson: when modules are loaded, to my understanding, some funky stuff happens, and then they are put into a closure. [08:51] micheil: which effectively catches all variables [08:51] JimBastard: <3 nodejs [08:51] JimBastard: no homo [08:52] keith_hanson: eesh. makes my brain hurt, haha [08:52] mscdex: micheil: probably using Script.runInNewContext [08:52] mscdex: or something [08:52] _announcer: Twitter: "Hello World Benchmarks for #nodejs Web Frameworks http://bit.ly/bdMruS" -- DracoBlue. http://twitter.com/DracoBlue/status/16133801189 [08:52] micheil: mscdex: no idea really.. [08:52] mscdex: where you can get at the sandbox contents [08:53] mscdex: dunno [08:54] nicolaerusan has joined the channel [08:55] mravaux has joined the channel [09:05] _announcer: Twitter: "@ciaran_j: I think so. I launched it with EXPRESS_ENV="production" node express_sample.js" -- DracoBlue. http://twitter.com/DracoBlue/status/16134261065 [09:06] _announcer: Twitter: "Sitting in a cafe and processing the feedback ;) I was pretty much grilled for the node.js thingie." -- Sebastian Schürmann. http://twitter.com/sschuermann/status/16134306467 [09:07] felixge has joined the channel [09:07] keith_hanson: ok... this is about the simplest I know of, and it's slow as hell: http://pastie.org/1003571 [09:12] keith_hanson: micheil: javajunky: ^^ in case you were interested [09:12] keith_hanson: is it that I'm using a single connection maybe? [09:13] micheil: sorry, no idea [09:13] micheil: I don't do much with the actual routers and frameworks in node, I'm a protocol hacker. [09:13] keith_hanson: heh. damn :P [09:13] keith_hanson: ah :) [09:13] steadicat_ has joined the channel [09:14] micheil: hence my work on smtp, websockets, mpd, etc. [09:14] micheil: man.. mpd was fun to hack: my brother had it on an open port, so I telnet'd his mpd server, and stopped his music remotely. [09:14] _announcer: Twitter: "@sschuermann are the slides of the nodejs talk online? I'm interested in seeing them! :)" -- kamme. http://twitter.com/kamme/status/16134616462 [09:15] keith_hanson: mpd? [09:15] keith_hanson: :) [09:16] javajunky: keith_hanson: seems ok, surprised at those speeds you're seeing :( ..might be worth hitting up christkv about it [09:16] javajunky: w/o the sys.puts is it any better ? [09:17] keith_hanson: javajunky: nah :/ [09:17] keith_hanson: javajunky: still about 200ms [09:17] javajunky: if you use curl to make requests to mongodb (can you do that with mongodb I forget ?) is that returning ok ? [09:17] keith_hanson: javajunky: with no concurrency, btw [09:17] javajunky: (i.e. how hard can you hit mongodb) [09:18] javajunky: what do the —prof tell you ? [09:18] keith_hanson: hm [09:18] keith_hanson: oh, right. haven't done the prof, one sec [09:20] keith_hanson: uh, christ [09:20] keith_hanson: :P Lots going on [09:20] keith_hanson: lemme post [09:21] keith_hanson: javajunky: http://pastebin.com/TzhXiByP [09:26] _announcer: Twitter: "As it looks like i need to cut down the node.js talk into 3 different ones. caching/async remoting with php/node.js" -- Sebastian Schürmann. http://twitter.com/sschuermann/status/16135064181 [09:29] _announcer: Twitter: "Play.js - http://github.com/Marak/play.js - Play sound files from Node.js to your speakers" -- Umar. http://twitter.com/umaar/status/16135177103 [09:29] javajunky: keith_hanson: ughh no idea how to intepret that I'm afraid, looks like plenty of time spent in deserialise by the mongo driver, but not all *that* muich time! [09:29] javajunky: fwiw when I was testing my system I was doing something similar and my times were not up in the 200ms area. [09:30] javajunky: they weren't < 20ms though iirc [09:30] javajunky: however con-currency didn't particularly affect the times (which is what you really want, consistencey) [09:31] keith_hanson: right, definitely what I was hoping for heh [09:31] keith_hanson: 20ms would be insanity coming from ruby land :P [09:31] keith_hanson: javajunky: that said, I'm consistently getting 200ms :) [09:32] keith_hanson: javajunky: so.. something somewhere is consistently screwed up lol [09:33] javajunky: keith_hanson: are you *Expecting* mongo to perform better than that, i.e. do you have prior experience that your mongodb installation responds more quickly than that ? [09:33] javajunky: might be worth using the client to do some testing (mongo client0 [09:34] _announcer: Twitter: "play.js - play sound files from node.js to your speakers http://github.com/Marak/play.js #code" -- Wahid Rahim. http://twitter.com/wrahim/status/16135368683 [09:34] keith_hanson: javajunky: well, I suppose I am expecting that. MongoDB is supposedly fast. NodeJS is supposedly fast. 200ms isn't so noteworthily fast, haha [09:34] keith_hanson: javajunky: as well, I'm only pulling back the _id field, just to ensure it's not a query problem with too much data or something. [09:35] keith_hanson: javajunky: what's your blog example in the post perform at? [09:35] keith_hanson: javajunky: I'm really just hoping my setup is incorrect or something. [09:36] keith_hanson: I'm using mongodb 1.4.2 [09:36] javajunky: keith_hanson: I actually don't know, never tested it ;) think its faster than 200ms per request though [09:36] keith_hanson: err, 1.4.3 [09:36] DracoBlue: keith_hanson: are you running mongodb on the same machine? [09:36] keith_hanson: DracoBlue: yup [09:36] keith_hanson: DracoBlue: is that bad? [09:36] DracoBlue: what specs has the test pc? [09:37] DracoBlue: I was testing (read 1 one entry of a collection) on a quad core and got like 10.000 req/s from node to mongodb, using node-mongodb-native driver. [09:37] keith_hanson: DracoBlue: lemme get specifics, but I'm running Ubuntu 10.04, 4 Gigs of Ram, Intel Core 2 Duo 2.something :P [09:37] keith_hanson: hmmm [09:38] keith_hanson: DracoBlue: well, I'm getting 542 req/sec now, reducing it to 1 record. [09:38] keith_hanson: DracoBlue: what version of mongodb? [09:38] DracoBlue: gimme a second ;) [09:39] keith_hanson: kk :) [09:39] DracoBlue: 1.4.2 [09:39] javajunky: ok, mongo lets you enable profiling, might be worth playing with that [09:40] javajunky: alternatively sack off express and go straight to raw server, try to isolate the layer.. I still think you should be seeing better results. [09:40] keith_hanson: k, one sec... [09:41] DracoBlue: keith_hanson: In my example I was using only one mongodb-native connection, too. But calling those 10.000 requests async from node and waiting until all of them finish. [09:41] javajunky: it should be fine to do that [09:43] caolanm has joined the channel [09:47] keith_hanson: javajunky: tossed express. same speed [09:47] keith_hanson: def something going on with mongo [09:48] javajunky: keith_hanson: thats good I guess… see how the shipped mongo client behaves, look at its profile stuff [09:52] pandark_ has joined the channel [09:56] _announcer: Twitter: "Node.js Websocket-Server v1.2.00 Released: http://is.gd/cOEc4 #node.js #websockets" -- Micheil Smith. http://twitter.com/miksago/status/16136208342 [09:59] keith_hanson: javajunky: client is heeeeella fast :) [09:59] keith_hanson: javajunky: 0.001 seconds to pull back 155 records (all of them) [10:00] javajunky: seems reasonable to expect similar behaviour from node then :( [10:00] javajunky: shame no mongo brains about at the mo :( [10:06] keith_hanson: heh heh, no worries. I filed an issue. I bet it something basic ;) [10:09] keith_hanson: javajunky: thanks for the help :) Finally gonna try and get some sleep, heh heh [10:11] _announcer: Twitter: "Creating an app with node.js, websockets and redis. The future, right here. :)" -- Olav Bjorkoy. http://twitter.com/vandelay/status/16136801239 [10:12] javajunky: keith_hanson: gl ;) [10:12] _announcer: Twitter: "Too much to learn! - Node.js, jQuery, Python, Adobe AIR, Ook!, Django, Kohana, Phonegap, Cocoa, Scripty2,... http://tumblr.com/xtrbj0ark" -- Aaron Bassett. http://twitter.com/aaronbassett/status/16136829242 [10:16] felixge has joined the channel [10:16] felixge has joined the channel [10:19] gormer has joined the channel [10:21] derbumi has joined the channel [10:23] mape: Is there any way of converting an object to a hash? [10:23] mravaux has joined the channel [10:23] mape: like md5({'my': 'object'}) [10:24] mape: So I can check if they match, in a quick and performant way [10:24] genbit has left the channel [10:26] hellp has joined the channel [10:27] pandark_: mape, do you mean something like crypto.createHash(algorithm) ? [10:27] _announcer: Twitter: "http://bit.ly/dmqXJl <-- Faye, Simple sistema de mensajería basada en el protocolo Bayeux. #nodejs" -- Andrés Nieto. http://twitter.com/aNieto2k/status/16137446049 [10:28] mape: pandark_: I want to be able to match an object to another [10:28] mape: if oldObj == newObj [10:28] mape: where newObj is created from json [10:28] mape: So I figured it would be easier to just create a hash [10:29] Ori_P has joined the channel [10:30] derbumi has joined the channel [10:30] saikat: if I want to do func.apply(, [arg1, arg2]), how do i refer to the object instance if the instance was created by doing new ClassName(); ? [10:31] saikat: when I'm calling this method, I'm in a context where "this" doesn't refer to the instance of the object but I also don't have a handle to the object instance (since it's being called in a callback inside one of the object's methods) [10:34] rnewson has joined the channel [10:34] mravaux has joined the channel [10:37] mravaux has joined the channel [10:37] markwubben has joined the channel [10:43] caolanm: saikat: could you create a gist on github or something? [10:43] caolanm: I'm not sure I follow... [10:43] saikat: sure [10:43] saikat: one sec [10:43] user9 has joined the channel [10:44] saikat: caolanm: http://gist.github.com/437539 - that is the class I have [10:44] saikat: I make new message queue managers by doing [10:45] saikat: msgQueueManager = new MessageQueueManager() [10:45] saikat: the problem arises with line 30 [10:45] saikat: I expect my messages to have a "consume" function that will call the provided callback [10:45] saikat: when they complete [10:45] saikat: in this case, I want the provided callback to do some maintenance on the instance of the message queue manager - like remove the lock on the queue that's being processed [10:46] saikat: however, in consumeCallback, the callback I'm passing to my message's consume method, this is referring to the global object [10:47] saikat: which is also strange - i'd expect it to refer to the message object if anything [10:47] caolanm: saikat: unless you explicitly set the context using call or apply, this will just refer to what preceeds the '.' when calling a function, or the global object if there is nothing preceeding it [10:47] saikat: right - so that's my question [10:47] saikat: I understand how to do somuthing like [10:47] saikat: apply when I have the name of the object [10:48] saikat: but from within this code, where i don't have a handle to the particular instance of this class that i'm using [10:48] saikat: how would I use apply? [10:48] saikat: I can't simply call apply using MessageQueueManager, since that just refers to the function object [10:48] caolanm: one convention is to set a variable the points to 'this' [10:48] caolanm: var that = this; [10:48] saikat: hm, i thought i tried that - maybe i didn't do it correctly [10:48] caolanm: then the variable 'that' will stay in scope [10:49] caolanm: and you can refer to the object using it [10:49] saikat: ah i see [10:49] caolanm: put it at line 3, after the opening '{' [10:49] caolanm: var that = this; [10:49] caolanm: then use that instead of this ;) [10:50] saikat: oh the thing i actually tried was [10:50] saikat: let me show you [10:50] caolanm: :) [10:50] saikat: http://gist.github.com/437539 [10:50] saikat: actually, i'm getting a different error now so maybe that did work [10:50] saikat: but i put [10:51] saikat: var that = this above message.consume [10:51] saikat: and applied using that [10:51] caolanm: that would only work if you called processQueue with the right instance [10:51] caolanm: which, you probably would ;) [10:51] saikat: which i should have to do right? [10:51] caolanm: yeah [10:51] caolanm: personally, I avoid using 'new' and 'this' whenever possible [10:51] saikat: ok cool - yeah i think i actually had that working earlier then and just missed that it was a separate error heh [10:51] saikat: interesting [10:52] saikat: i see the logic behind avoiding this - it gets confusing [10:52] saikat: why avoid new? [10:52] saikat: how do you handle state without ending up with a bunch of singletons? [10:52] caolanm: because if you have a function that requires new, but you call it without new, it modifies the global object [10:52] caolanm: ;) [10:52] caolanm: and I don't see the need for it [10:52] saikat: what do you do instead though? [10:52] caolanm: you can create a new object by just doing var obj = {} [10:53] caolanm: so inside a function which creates a new object I do that, modifiy it, then return it [10:53] saikat: ohh i see so you would instead do something like [10:53] caolanm: function createObj(){return {test: 'myobj'};} [10:53] caolanm: ...or something along those lines [10:53] saikat: createMessageQueueManager { return {'queues' : {}, 'func' : func} } [10:53] saikat: right [10:53] caolanm: yeah [10:54] saikat: interesting i hadn't thought about doing it that way, i think i like that better [10:54] saikat: thanks [10:54] caolanm: and if you assign it to a variable first then you can use that instead of this [10:54] caolanm: function createObj(){ var obj = {test: 'myobj'}; return obj; } [10:54] caolanm: then you don't have to use 'this' either [10:54] zomgbie has joined the channel [10:54] caolanm: and you always know it will be correct [10:55] saikat: right [10:55] caolanm: but its just a question of taste [10:55] saikat: though someone mentioned in here earlier today [10:55] saikat: that they actually find the dynamic binding of this to be a feature [10:55] caolanm: yeah, some people find it useful [10:55] saikat: i'm having a hard time finding a use case where it isn't more confusing [10:55] caolanm: me too ;) [10:56] saikat: anyway, thanks for the tips! [10:56] caolanm: np [10:56] caolanm: have fun [10:57] Tim_Smart has joined the channel [11:07] polo has joined the channel [11:22] geeks_bot has joined the channel [11:23] teemow has joined the channel [11:25] JimBastard has joined the channel [11:25] JimBastard: anyone alive [11:26] margle: I am. [11:26] MattJ has joined the channel [11:26] JimBastard: i figured out a way to order my gitub repos [11:27] JimBastard: its fairly epic [11:27] javajunky: nope. [11:27] JimBastard: anyone wanna watch my repos get orderd? lol [11:27] JimBastard: i just started with 5 [11:27] JimBastard: gonna do 20 next [11:27] JimBastard: http://github.com/marak [11:27] margle: JimBastard: ordered? [11:27] JimBastard: man teechno weenie is gonna get mad [11:28] JimBastard: yeah you know, order of projects on your home page [11:28] JimBastard: i told my kohai to do it [11:28] JimBastard: hes pretty good [11:28] margle: JimBastard: how are they ordered by default? [11:28] margle: JimBastard: omf you have a lot. [11:29] JimBastard: margle: they are ordered by last commit [11:29] JimBastard: brb 4 minutes, making a list [11:30] zomgbie has joined the channel [11:30] admc has joined the channel [11:31] margle: JimBastard: hehehe [11:33] JimBastard: okay i just made big list [11:33] JimBastard: im gonna run this thing and pray it works [11:33] JimBastard: and doesnt overwrite all my repos with trash [11:33] JimBastard: thats VERY possible [11:34] JimBastard: hrmm gotta normalize some readmes, brb [11:35] mape: http://ajaxian.com/archives/jsonduit-turn-the-web-into-a-json-feed [11:35] mape: nice [11:39] JimBastard: its kinda working [11:40] JimBastard: just gotta fix a few more things [11:43] nostromo has joined the channel [11:46] JimBastard: yeah i am getting crazy random errors [11:46] JimBastard: with utf [11:46] JimBastard: again [11:46] JimBastard: buffer:46 return this.utf8Write(string, offset); ^ [11:50] JimBastard: so yeah [11:55] _announcer: Twitter: "just did a gem update on nodejs and re-compiled, new version seems to have a better console." -- Nigel. http://twitter.com/nr99/status/16141511331 [12:01] joshowens has joined the channel [12:11] Judofyr has joined the channel [12:11] Judofyr: is there a sync-version of path.exists? [12:11] keeto has joined the channel [12:12] genbit has joined the channel [12:13] genbit: Does somebody use node.js with dbus? [12:13] micheil: dbus? [12:13] micheil: Judofyr: not sure. [12:16] zomgbie has joined the channel [12:16] genbit: micheil, yes d-bus [12:17] micheil: Judofyr: you could try using fs.statSync(path); [12:18] micheil: but you'd need to try{}catch{} that [12:18] kocolosk has joined the channel [12:19] genbit has left the channel [12:20] micheil: Judofyr: this would do the job, but you shouldn't be doing stuff Sync. http://gist.github.com/437617 [12:22] caolanm: Judofyr: out of interest, what's the use case? [12:23] jetienne: anybody knows a large static file available on the web ? i need this url to write a testcase for crypto module memory leak [12:23] Judofyr: micheil: thanks (and yes, I know I shouldn't be doing it sync) [12:24] Judofyr: caolanm: I'm writing a Ruby interpreter in JS, and require() is sync in Ruby ;) [12:24] caolanm: Judofyr: sounds pretty epic! [12:25] caolanm: :) [12:26] Judofyr: thanks :) [12:29] phiggins has joined the channel [12:29] mfeiri has joined the channel [12:31] behmann has joined the channel [12:37] zomgbie has joined the channel [12:38] _announcer: Twitter: "@laktek at the moment, yes. That's why I'm so interested in Node.js, Web Sockets, etc!" -- Neil Cauldwell. http://twitter.com/NeilCauldwell/status/16143964779 [12:40] jetienne: /dev/full /dev/null etc... are available on macos ? [12:41] micheil: yeah, I think so [12:41] jetienne: http://pastebin.com/vd3MDg3h <- somebody else can try that ? this is a demo of the memory leak in cyrpto hash [12:41] micheil: no /dev/full [12:42] jetienne: micheil: ok [12:42] Ori_P_ has joined the channel [12:44] _announcer: Twitter: "Played "jack user" - installed imagemagick for node.js without even having imagemagick. I can tell you, it fails badly and doesn't say why.." -- Daniel Herzog. http://twitter.com/danfooo/status/16144321790 [12:44] micheil: jetienne: I'd expect that to leak badly, considering the number of hash objects you're creating [12:44] micheil: see: [12:44] micheil: exports.createHash = function(hash) { return (new Hash).init(hash); }; [12:45] jetienne: micheil: how do i close/destroy such object ? [12:45] kriszyp has joined the channel [12:45] micheil: not sure, checking [12:46] micheil: looks' like there's no way to empty a hash. [12:47] jetienne: hmm ok [12:47] jetienne: forced to leak kindof [12:50] micheil: k, so, create one hash. [12:50] micheil: outside the for loop [12:50] micheil: then inside the for loop, do: [12:50] micheil: hash.init("md5").update(data).digest("hex") [12:51] micheil: that shouldn't leak memory. [12:51] jetienne: http://github.com/ry/node/blob/master/src/node_crypto.h#L34 [12:51] jetienne: there is a Close... how do i call that from js :) [12:52] micheil: that's secureContext [12:52] micheil: not has [12:52] micheil: *hash [12:52] jetienne: micheil: yep it is a workaround to create a global... but not clean [12:52] jetienne: micheil: where is hash in C ? [12:52] micheil: node_crypto.cc [12:54] micheil: I think, in theory based on this leak, that my websocket server may leak memory or use extra memory when a large number of clients are connected [12:55] jherdman has joined the channel [12:55] jetienne: yep this is definitly a leak [12:56] TomY has joined the channel [12:57] micheil: so, maybe there needs to be a way of disposing of hashes? [12:57] micheil: ryah: any ideas? [12:57] jetienne: just to be able to remove/close the object [12:57] micheil: what about deleting the hash after you've used it? [12:57] micheil: delete digest_hex; [12:58] jetienne: micheil: still leak [12:59] micheil: hmm.. [12:59] micheil: probably hit the mailing list. [12:59] jetienne: mailing or github issue ? [12:59] micheil: both? [12:59] micheil: I dunno. [12:59] jetienne: ok [13:03] olivvv has left the channel [13:12] mtodd has joined the channel [13:16] bradleymeck has joined the channel [13:18] mitkok has joined the channel [13:20] jedschmidt has joined the channel [13:26] JAAulde has joined the channel [13:26] dabreaka has joined the channel [13:38] _announcer: Twitter: "Node.js surprises me. It's server-side JS but I don't immediately want to puke. http://nodejs.org/ I've only used Twisted for comparison" -- BinaryParadox. http://twitter.com/BinaryParadox/status/16147814813 [13:43] zaach has joined the channel [13:47] jeffreyt has joined the channel [13:52] ryan_gahl has joined the channel [13:52] mtodd has joined the channel [13:52] softdrink has joined the channel [13:52] femto has joined the channel [14:00] teemow has joined the channel [14:00] ceej has joined the channel [14:00] pgriess has joined the channel [14:04] jakehow has joined the channel [14:05] softdrink has joined the channel [14:05] _announcer: Twitter: "a node.js coding competition: http://nodeknockout.com/" -- Daniel Hofstetter. http://twitter.com/dhofstet/status/16149709150 [14:10] gf3 has joined the channel [14:11] Ori_P has joined the channel [14:15] _announcer: Twitter: "Node.js _announcer I want your attention. :-(" -- Moon Smith. http://twitter.com/moonsmithy/status/16150357711 [14:16] jetienne: :) [14:19] ceej: lol [14:19] ceej: we should only be allowed to talk on IRC through _announcer :) [14:21] _announcer: Twitter: "I just built a simple schema migration system on node.js + node-sqlite. Node is so nice to use now that binary data uses Buffers." -- phil jordan. http://twitter.com/pmjordan/status/16150815674 [14:23] jedschmidt has joined the channel [14:26] gerad has joined the channel [14:28] bradleymeck: http.HttpRequest fails on access-control-request-headers :(( [14:30] kocolosk has left the channel [14:37] micheil: bradleymeck: how so? [14:38] micheil: there is no http.HttpRequest, it's http.createClient or http.client [14:49] felixge: pgriess: re: http://github.com/pgriess/node-jspack [14:49] felixge: pgriess: I think ryan wants to have this for the core [14:49] pgriess: felixge: no arguments from me. its not my code anyway. i just wrapped it up w/ CommonsJS sugar [14:50] sr: yo, anyone played with connect yet? i am trying to write a middleware to setup a default content-type [14:50] pgriess: felixge: BSD licensed from "Fair Oaks Labs", whatever that is [14:50] felixge: pgriess: well, he might want to do it in C++ anyway [14:50] sr: not if that is even possible, given if i understand correcly, one can't set response headers once writeHead has been called [14:50] felixge: pgriess: but this should be nice to use as a spec :) [14:50] pgriess: felixge: going down the road of the Buffer.unpack() and Buffer.pack() stuff is going to perform much better. i just didn't feel like writing that code [14:51] pgriess: felixge: yeah [14:51] ajpiano has joined the channel [14:51] felixge: pgriess: the code you contributed is more awesome anyway :) [14:51] pgriess: felixge: haha [14:52] jbrantly has joined the channel [14:52] felixge: pgriess: you could probably run facebook on a single machine now (given it has enough cores) :D [14:52] pgriess: felixge: i'd argue if i could [14:52] Yuffster has joined the channel [14:52] felixge: (and network adapters) [14:52] user9: and memory [14:53] pgriess: felixge: close to getting websocket client working in node [14:53] pgriess: felixge: most machinery was already there, but needed a few tweaks for the client-side portion [14:53] felixge: pgriess: why would you want web socket clients in node? [14:54] felixge: I don't even know if I like the websocket spec ... [14:54] felixge: nor web workers [14:54] pgriess: felixge: its a long story, but basically i want to use it for communication between web workers [14:54] pgriess: felixge: it makes for a decent framing protocol and, with that, i can use JSON.stringify() for IPC and get rid of the msgpack dependency [14:54] felixge: ah, that would be very nice [14:55] felixge: I wasn't sure why you went through all the trouble with msgpack [14:55] pgriess: felixge: and hopefully get webworkers into node core [14:55] felixge: other than speed [14:55] pgriess: felixge: dependency on msgpack is the major drawback at this point [14:55] pgriess: felixge: the msgpack wrapper was pretty simple. it seemed easier to just do it rather than argue about it [14:56] felixge: :) [14:56] pgriess: felixge: and it is more performant than JSON, for those who care [14:56] felixge: JSON is fast enough for me :) [14:56] pgriess: felixge: for webworker IPC, the extra overhead of JSON isn't a huge deal IMO [14:56] pgriess: yeah [14:56] felixge: and if it could be optimized, you just need to let the v8 team know [14:56] felixge: their crazy for speed optimizations [14:56] felixge: :) [14:56] felixge: * they're [14:56] pgriess: felixge: yeah [14:57] pgriess: felixge: de-serialization is the place where msgpack really puts the spurs to json [14:57] felixge: pgriess: did you have some time to play with formidable yet? [14:57] pgriess: but that's a problem w/ the format, not the impl [14:57] pgriess: felixge: no, but i'll be doing that this week [14:57] felixge: I added support for urlencoded forms the other day [14:57] pgriess: felixge: did i read your tweet right that it has a streaming x-url-form-encoded parser? [14:57] felixge: not with the same kind of nifty streaming parser, but I'll do that once I have some time for it [14:57] pgriess: felixge: hoping to do streaming-decode of form params [14:58] felixge: no, right now only multipart forms are streaming [14:58] pgriess: felixge: k [14:58] felixge: but I want it for urlencoded ones as well [14:58] felixge: it just always takes me a day or two to write a decent parser [14:58] felixge: and I needed something usable quicker [14:58] felixge: :) [14:58] felixge: I'll do it before I tag 1.0 so [14:59] pgriess: felixge: awesome [14:59] teemow has joined the channel [14:59] felixge: pgriess: for now you can just post forms as multipart, even if they have no files [14:59] felixge: there shouldn't be any reason not to, right? [15:00] pgriess: felixge: yeah, true enough [15:00] deanlandolt1 has joined the channel [15:02] felixge: pgriess: btw. if you discover any API stuff you don't like with formidable, let me know - this is a good time to break things before 1.0 :) [15:02] pgriess: felixge: sure will [15:03] carsonm has joined the channel [15:03] gf3 has joined the channel [15:06] kriszyp_ has joined the channel [15:10] creationix has joined the channel [15:14] micheil: pgriess: hey [15:14] pgriess: micheil: howdy [15:15] micheil: any more luck with the client? [15:15] pgriess: micheil: yeah, i've got client upgrade working now [15:15] micheil: cool [15:15] pgriess: micheil: http.js needed some extra love in the response codepaths (just copy + paste from the request codepaths) [15:15] micheil: no more commits? [15:15] pgriess: micheil: needs a fix to node/lib/http.js [15:16] pgriess: micheil: but its minimal [15:16] micheil: okay, link me. [15:16] pgriess: micheil: cc you on the patch req? [15:16] micheil: k [15:17] pgriess: micheil: ok. prob be a few days. have some higher-priority stuff at work to get done first [15:17] micheil: okay [15:17] pgriess: micheil: i want to get the client fully working before i send out a patch to make sure that i got everything [15:17] micheil: okay [15:17] mfeiri_ has joined the channel [15:18] micheil: any early previews? [15:18] micheil: pgriess: also, I pushed the new version of my server today, it now uses that linked list connection store [15:18] LowValueTarget has joined the channel [15:18] pgriess: micheil: yeah, i saw it. looking forward to checking it out. [15:18] pgriess: micheil: implemented high-bit framing yet? [15:18] micheil: it's pretty good. [15:19] micheil: I haven't found a client that uses high bit, and the spec is rather confusing on it, so I'm leaving it for now. [15:20] pgriess: micheil: you'll be seeing one soon ;) [15:20] micheil: yeah, fun. [15:20] micheil: if you can implement it correctly on the client side. [15:20] pgriess: micheil: yeah i'll give it a whack [15:22] fictorial: pquerna: ping [15:27] phiggins has joined the channel [15:30] jos3000 has joined the channel [15:33] _announcer: Twitter: "Drinking the Node.js Kool-Aid. http://bit.ly/d5NBd5 Server side Javascript coming of age?" -- Bill Stoddard. http://twitter.com/BillStoddard/status/16156031267 [15:34] pgriess: micheil: updated code pushed to http://github.com/pgriess/node-websocket-client (includes required patch) [15:35] micheil: k [15:35] pgriess: micheil: i'm not validation the server handshake yet, but this will get you the raw socket on upgrade [15:36] micheil: pgriess: I'm going to need to check out the node source for reference on that. [15:37] pgriess: micheil: k [15:37] pgriess: micheil: the patch is literally just adding the behavior that already exists for server-side upgrade support to the client codepath [15:37] pgriess: micheil: this is probably doable w/o copy/paste, but that was the least invasive way to do it [15:39] micheil: okay.. soo... [15:40] micheil: you've deprecated parser.incoming.upgradeHead? [15:40] micheil: which was already deprecated in http.server [15:42] micheil: pgriess: line 13 of your patch, you need a ; [15:42] micheil: self.onend = null [15:43] micheil: should be [15:43] micheil: self.onend = null; [15:45] micheil: pgriess: http client, does that have req.socket? [15:46] tmpvar has joined the channel [15:47] micheil: pgriess: okay, I've retrofitted that patch to my node (retyped it.) [15:48] micheil: pgriess: we'll need tests for this, any ideas? [15:48] JimBastard has joined the channel [15:49] jbrantly has left the channel [15:50] pgriess: micheil: re semicolon yeah, ok. that missing semicolon existed before my patch but i'll fix it while i'm in there [15:50] micheil: yeah [15:50] bradleymeck: micheil sorry about the late response but just the ServerRequest just fails, says 'access-control-request-headers': 'Content-Type' [15:51] micheil: hmm.. [15:51] micheil: bradleymeck: could you write up a simple example / test of this? [15:51] micheil: just use http.Server and http.Client to simulate it [15:51] tjholowaychuk has joined the channel [15:52] pgriess: micheil: http.client tries to be a socket [15:52] bradleymeck: can't simulate it so easy so be a min, was the ajax from browser that got that result [15:52] pgriess: micheil: questionable design decision, but there it is [15:52] micheil: bradleymeck: yeah, you can definitely simulate it. [15:52] bradleymeck: yea, just have to dig out what was actually sent etc [15:52] pgriess: micheil: yeah, an echo test would be good. but more client-side code needed for that. i'll provide a test when i finish up the rest of the client side [15:53] micheil: have a look at ryah's tests for upgradeHead [15:53] micheil: they're really good [15:53] mikeal has joined the channel [15:53] pgriess: micheil: ok [15:53] JimBastard: http://github.com/marak/play.js [15:53] JimBastard: but project pun name EVER [15:53] JimBastard: like EVER [15:53] JimBastard: :-D [15:54] micheil: pgriess: tests/simple/test-http-upgrade2.js [15:54] micheil: although, switch clients for servers and such [15:54] pgriess: micheil: yup [15:55] micheil: pgriess: that's my patch version: http://gist.github.com/437872 [15:55] phiggins: seems a lot of node.js stuff is just calling spawn() [15:55] micheil: you actually could get away with not declaring req var [15:55] phiggins: ;) [15:56] micheil: phiggins: howdy' been a while? [15:56] JimBastard: phiggins: you finally breaking down and learning javascript? [15:56] phiggins: i fucking hate javascript [15:56] JimBastard: i was thinking of making an exec plugin, but that would be mean [15:56] micheil: naturally, phiggins would have to hate javascript, being project lead on the Dojo Toolkit. [15:56] micheil: >_> [15:57] JimBastard: micheil: whats dojo? [15:57] micheil: http://dojotoolkit.org/ [15:57] JimBastard: whats that? [15:57] phiggins: javascript. just like common js, but working implementations [15:58] gf3: What's a javascript? [15:58] bradleymeck: nevermind, seem chrome just sends it oddly... wierd [15:58] micheil: phiggins: I noticed there was the 1.5 release of dojo, wasn't there? [15:58] phiggins: couple of weeks [15:58] mattly has joined the channel [15:58] phiggins: rc is cut [15:59] micheil: phiggins: cool; I'm still trying to figure out if I really want to use dojo on a project, because I'm not sure what I really need. [15:59] micheil: phiggins: are there any good guides on the build tools yet? [15:59] _announcer: Twitter: "My next Node.js app will be: spawn("php", ["-q", "somethingusingGDlib.php"])" -- Peter Higgins. http://twitter.com/phiggins/status/16158113608 [15:59] phiggins: yes? I have like 10 screencasts on just the build in various places [15:59] phiggins: ;) [16:00] k23z__ has joined the channel [16:00] phiggins: and the docs of course. and examples. [16:00] _announcer: Twitter: "@ivanlaksana Python MongoDB or NodeJS MongoDB is del.icio.us :) use it as backend and hire whatever junior programmer to do frontend :)" -- Didiet. http://twitter.com/lynxluna/status/16158178167 [16:00] micheil: phiggins: please, do link me; that's possibly the most confusing part I found in the dojo stuff; [16:01] micheil: phiggins: the last project I worked on with dojo, I had the guys from uxebu doing compiling [16:01] micheil: erm, building. [16:01] phiggins: yah they are good guys [16:01] micheil: yeah, I know; I was working with them for a bit (contractor) [16:02] micheil: phiggins: do you know if there's any dojo websocket work happening? [16:02] phiggins: not off the top of my head [16:02] micheil: like, wrappers around fallbacks [16:09] JimBastard: phiggins: you should port node to work on dojo [16:10] phiggins: it does [16:11] phiggins: small patchset, but it works just fine [16:11] micheil: phiggins: watch the switch, node on dojo, not dojo on node [16:11] phiggins: why? [16:11] micheil: that's what JimBastard said. [16:12] phiggins: I should port dojo.Deferred to node [16:12] phiggins: oh wait [16:12] micheil: doesn't require.js also work on node [16:12] phiggins: requireJS implements commonjs transport/c which works ss and browser side [16:12] phiggins: iirc [16:12] micheil: / when or has dojo moved it's require to requireJS? [16:12] phiggins: 2.0 [16:12] micheil: :( [16:12] micheil: :P [16:12] phiggins: there is a branch with 1.x using it [16:13] phiggins: but not widely publicized [16:13] micheil: ah, okay [16:13] micheil: this is where having it all on github would be awesome [16:13] micheil: svn's too closed and private. [16:13] phiggins: fair enough. requirejs is github no? [16:13] micheil: yeah [16:13] phiggins: dojo is cloned from trunk on github [16:14] micheil: but the branches aren't there. [16:14] phiggins: all the projects individually even [16:14] phiggins: yah [16:14] phiggins: real men work from trunk [16:14] micheil: it'd be awesome to see dojo move to github, seriously. [16:14] markwubben has joined the channel [16:14] micheil: then just have trunk mirrored on svn or something [16:14] micheil: actually, no even [16:14] phiggins: yah we can't really  well until we reorg the projects [16:14] micheil: github has svn support. [16:15] phiggins: out svn layout is not conducive to mirroring in github really [16:15] phiggins: we were going to look at the svn bridge ... [16:15] micheil: yeah, true [16:15] phiggins: but any change takes time [16:15] micheil: you'd probably create a "dojo" account [16:15] micheil: and then make dijit, core (? dojo), dojox, etc as projects [16:15] micheil: then just have one repo that uses submodules [16:16] mattly has joined the channel [16:16] phiggins: http://github.com/dojo [16:16] micheil: like that. [16:16] phiggins: thats the mirror of trunk [16:16] _announcer: Twitter: "@hibri http://kayakhttp.com/ is the most full-featured open-source managed HTTP server there is. I think we need nodecs i.e. nodejs in C# :)" -- Demis Bellot. http://twitter.com/demisbellot/status/16159288446 [16:16] micheil: so what's the branching model like, currently? [16:17] phiggins: we never really branch, we tag from 5 different trunks/ into one tags/verison/ [16:18] micheil: ah [16:18] phiggins: so dojo/trunk -> tags/version/dojo/ dijit/trunk -> tags/version/dijit [16:18] phiggins: we want to decouple all the release cycles [16:18] stepheneb has joined the channel [16:18] micheil: you could possible still do that, but yes, decoupling would be best [16:18] micheil: you could probably put that decoupling in progress on the svn system with the 1.5 release, no? [16:18] phiggins: (not to spam the #nodejs room with #dojo talk ... sorry) [16:19] micheil: phiggins: pchat? [16:19] phiggins: no, I've decided to leave cycles coupled until 2.0 (not saying that we won't go 1.6 -> 2.0, but we won't be "dropping" the established 1.x when we go 2.0 like we did with 0.x -> 1.0) [16:19] phiggins: too much pain there. [16:19] phiggins: or take it to #dojo, I'm always there [16:19] micheil: okay, fair enough [16:26] technoweenie has joined the channel [16:28] jbrantly has joined the channel [16:34] micheil: ryah: checkout http://gist.github.com/437842 & http://gist.github.com/437872 [16:34] micheil: ryah: we should try and get these commited once we have tests. [16:35] micheil: ryah: it'll mean that we can do the same stuff as far as websockets that we can already do in server [16:37] ryah: micheil: okay [16:37] ryah: micheil: do you have a little test for the http client? [16:37] micheil: I'll work on a test for it tomorrow afternoon [16:37] micheil: pgriess: is the original author. [16:38] pgriess: ryah micheil: that patch is untested in the extreme [16:38] pgriess: (fyi) [16:38] ryah: i just want something that exercises the funtionality, then i'm happy to commit it [16:38] micheil: it should work though [16:38] mikeal: anyone else see this homebrew issue [16:38] mikeal: Error: Failure while executing: ./configure --prefix=/usr/local/Cellar/node/0.1.98 [16:38] micheil: logics say it works [16:39] pgriess: i still owe ryah one unit test. i don't know if i can go 2 in the hole ;) [16:41] ryah: pgriess: for listenFD? [16:41] micheil: pgriess: I'll try and write a unit test for the http client stuff, if you want? [16:41] micheil: I already have an idea of how to. [16:41] pgriess: ryah: yeah. i'll get to it in the next day or two. just been slammed w/ internal deadlines [16:41] stevendavie has joined the channel [16:41] pgriess: micheil: sure, go for it [16:42] felixge has joined the channel [16:42] felixge has joined the channel [16:42] fictorial: ryah: wondering if you have seen this issue previously? sending on a fd causes read events to trigger but doesn't send. thus, an echo server gets stuck in an infinite loop of sorts. http://bit.ly/9rswYi http://gist.github.com/437301 [16:42] femto has joined the channel [16:43] ryah: fictorial: udp? [16:43] fictorial: yes [16:43] fictorial: unix domain datagram socket in particular [16:43] ryah: i just merged it on friday, i haven't used it yet :) [16:43] ryah: but i know what you mean [16:44] ryah: the idea was to recv messages on the port you've just opened [16:44] fictorial: right, wondering if you have seen that 'class' of error before and if it was something simple to fix -- I looked at the code and it looks ok but I'm not 100% sure what the deal is with setting read/write event watchers conditionally [16:44] fictorial: it seems like the sendto is simply sending to itself in essence [16:44] JimBastard: yo ryah, i was getting some fucking strange UTF issues with fs late last night. i was reading a bunch of files and writing to them in a loop and was getting sporadic UTF bombs [16:45] JimBastard: im going to see if i can trap and isolate later tonight [16:45] JimBastard: get a test case [16:45] fictorial: since the bound socket has a read event watcher [16:45] ryah: fictorial: do you want to try to modify deps/simple/test-udp.js to make it do that? [16:45] fictorial: odd [16:45] ryah: er [16:45] ryah: test/simple/test-udp.js [16:45] fictorial: sorry? [16:46] ryah: sorry, test/simple/test-dgram-pingpong.js [16:46] fictorial: to fail you mean? [16:46] ryah: yes [16:46] fictorial: ok, hang on [16:46] ryah: i'll fix it if you do that :) [16:46] fictorial: gotcha [16:46] fictorial: would love to understand the root cause [16:50] brianmario has joined the channel [16:51] pgriess has joined the channel [16:53] softdrink: quick poll: what's everyone using for server-side js unit testing? [16:55] tjholowaychuk: softdrink: I use http://github.com/visionmedia/expresso [16:55] cloudhead has joined the channel [16:55] zomgbie has joined the channel [16:56] _announcer: Twitter: "Understanding node.js http://is.gd/cP2lu. Great post! by @felixge" -- Hernan Garcia. http://twitter.com/theprogrammer/status/16161847669 [16:56] fictorial: ryah: so, that test won't show the error unless the /PING/.exec test is removed, making the test an echo server instead of a echo-PONG-on-PING server. Anyway, http://gist.github.com/437301#file_test_dgram_pingpong.js.diff [17:00] sveimac has joined the channel [17:01] fizx has joined the channel [17:01] rope has joined the channel [17:03] felixge: JimBastard: I think there is a know utf8 bug right now [17:03] JimBastard: yeah man [17:03] JimBastard: it was kinda frustrating, i would help if i knew what to do [17:03] felixge: JimBastard: http://github.com/ry/node/issues/#issue/156 [17:03] JimBastard: cool [17:03] JimBastard: i made this project that allows you to change the order of your github repos [17:04] JimBastard: involves some magic [17:04] JimBastard: it works now, just need to polish for release [17:04] JimBastard: yeah, the UTF for me bombs on somewhat normal chars too [17:04] JimBastard: randomly [17:04] mitkok has joined the channel [17:04] JimBastard: like i can read in a file, write the same file, then try to read it in again and it bombs [17:05] hdon has joined the channel [17:05] felixge: JimBastard: interesting [17:06] felixge: hm, I wonder if readstream has my utf8 decoder in it [17:06] felixge: and if that has bugs or now [17:06] felixge: * or not [17:06] felixge: :) [17:06] JimBastard: ive seen several UTF bombs in the past few weeks [17:06] JimBastard: i was able to work around most by removing the offending chars [17:06] felixge: JimBastard: you're calling setEncoding() ? [17:06] felixge: JimBastard: on your readStream? [17:06] JimBastard: probably not [17:07] ryah: fictorial: can you paste me the whole file? [17:07] JimBastard: if thats the fix, i should at least get some sort of warning or message [17:07] felixge: JimBastard: probably [17:07] ryah: fictorial: let's just make test-dgram-infinite-loop.js out of it [17:07] ryah: fictorial: keep the old test, that is [17:07] felixge: actually, by default it should emit buffers [17:08] felixge: so if you're getting utf8 you must be calling setEncoding [17:08] fictorial: ryah: ok [17:08] ryah: felixge: i need help with fs.writeFile if you're feeling contribute-y :) [17:09] bpot has joined the channel [17:09] ryah: felixge: http://github.com/ry/node/issues#issue/156 [17:10] felixge: ryah: I'm leaving for beach volleyball in 30min, but I'll look at it now [17:10] felixge: ryah: btw. the new node is still über-awesome for us, not a single crash, no memory leaks, just pure joy :) [17:10] ryah: oh, glad to hear [17:10] ryah: what version are you on? [17:11] felixge: ryah: each video upload on our clients site spawn ~100 command line utilities, so it's pretty intense stuff :) [17:11] felixge: ryah: 0055dd133d108f5f02f9cfec1253cbcf7862c213 (June 3rd) [17:12] felixge: we'll probably do the next upgrade when I add workers [17:13] _announcer: Twitter: "Check out lazeroids - MMO asteroids in HTML5 + node.js - http://lazeroids.com/" -- Jon Raasch. http://twitter.com/jonraasch/status/16162864101 [17:13] stevendavie has joined the channel [17:13] tilgovi has joined the channel [17:14] sanderjd has joined the channel [17:14] fictorial: ryah: sent you a pull request for the test-dgram-infinite-loop.js [17:14] ryah: fictorial: thanks [17:14] ryah: bbiab [17:15] micheil: just thought I'd throw it out there, the next module I'll probably be working on is the smtp one, to bring it up to date. [17:16] charlesjolley- has joined the channel [17:17] charlesjolley- has joined the channel [17:19] markwubben has joined the channel [17:22] mscdex: smtp: the next generation :-D [17:22] micheil: mscdex: very much so [17:22] JimBastard: picard is way better imho [17:23] micheil: picard? [17:23] jbrantly: janeway ftw [17:23] micheil: picard as in http://github.com/dantebronto/picard ? [17:24] bmizerany has joined the channel [17:24] micheil: oh well, night chaps. [17:25] mscdex: wow, the acceleration on that lazeroids game sucks :S [17:26] _announcer: Twitter: "Stoked! The folks @heroku just styled me with the experimental node.js account! Massive win." -- Joe McCann. http://twitter.com/joemccann/status/16163626554 [17:26] sr: tjholowaychuk, yo [17:26] bradleymeck: w = win in lazeroids [17:28] tjholowaychuk: sr: hey whats up [17:28] gerad: mscdex: what is your complaint, we've been tweaking it here and there [17:28] mscdex: it accelerates way too quickly [17:28] mscdex: for a small duration of the button press [17:28] visnup: mscdex: it needs a max speed [17:28] sr: tjholowaychuk, hey. been playing with connect... love it [17:29] tjholowaychuk: sr: awesome! good to hear [17:29] sr: tjholowaychuk, are you gonna hack express to use it? [17:29] visnup: mscdex: along with something for mousedown and hold [17:29] tjholowaychuk: sr: that is the plan I think, eventually at least [17:29] gerad: visnup: I think it might be the different network frame rates too [17:29] mscdex: i guess a handbrake or sudden stop key would help too [17:29] visnup: maaaybe.. I think it's people holding down the forward key [17:29] mscdex: or something [17:29] sr: tjholowaychuk, also. is there a way to access POST stuff buit-in? been looking at the source, couldn't find anything [17:30] visnup: unfortunately I have client work today [17:30] gerad: mscdex: I've been arguing with visnu about brake for a week now [17:30] mikeal has joined the channel [17:30] mscdex: ah [17:30] visnup: gerad: brakes are for losers [17:30] gerad: mscdex: we used to have it, but he took it off because he thought it made it too easy [17:30] tjholowaychuk: sr: body-decoder buffers / supports application/json and application/x-www-form-urlencoded so far [17:30] mscdex: well something to help ease the crazy acceleration issue :S [17:30] sr: oooh right. damn i actually looked at the code. sweet. thanks man [17:31] gerad: visnup: you sound like a fixie riding hipster :-) [17:31] mscdex: bbiab [17:31] felixge: ryah: I think the bug is here: http://github.com/ry/node/blob/master/lib/fs.js#L370 [17:31] gerad: mscdex: easter egg, if you warp it will stop you [17:31] gerad: in the meantime, it's easy enough to turn down the acceleration [17:31] felixge: ryah: since written returns bytes, but String.length is the character count [17:31] visnup: gerad: if you consider fixie-riding a video game, then yes [17:32] felixge: ryah: question: is it correct to try writing more data if written < what was expected? [17:32] charlesjolley- has joined the channel [17:32] _announcer: Twitter: "hyped for #amc2010 liveblogging powered by #nodejs (this is also a test tweet)" -- Benjamin Chodoroff. http://twitter.com/bnchdrff/status/16163991471 [17:33] stevendavie has joined the channel [17:35] gerad: mscdex: deployed it with slower acceleration, not sure if that will make it feel better or not [17:35] gerad: mscdex: http://lazeroids.com [17:35] b_erb has joined the channel [17:35] felixge: JimBastard: were you using fs.writeFile? [17:35] JimBastard: aye felixge [17:36] felixge: ryah / JimBastard: this should fix it: http://github.com/felixge/node/commit/e0f8d6bdedb8a2f40e3003f405a1dbf91832489d [17:36] JimBastard: felixge: i cant really test that until after work [17:37] JimBastard: the project i was having issues with isnt work related at all, but i can check later tonight [17:37] felixge: JimBastard: it passes this mean looking unit test: http://gist.github.com/433772 [17:37] felixge: so it should work :) [17:37] felixge: JimBastard: all projects are work related [17:37] JimBastard: cool [17:37] JimBastard: felixge: hee hee [17:37] JimBastard: i guess [17:37] felixge: I mean it has to do with the idea of working, and your boss is surely not trying to get in between you and working, right? [17:37] JimBastard: i can try tonight for sure [17:38] felixge: k :) [17:38] JimBastard: yeah, i mean i could do it [17:38] JimBastard: i meant to say, im busy working on "real" work [17:38] JimBastard: lol [17:38] felixge: hah [17:38] felixge: alright :) [17:38] JimBastard: behaviors library isnt going to write itself [17:38] JimBastard: except for the part that writes itself [17:38] felixge: behaviors? [17:38] JimBastard: yeah [17:38] JimBastard: think widgets or components library on crack [17:39] JimBastard: its really bad ass [17:39] JimBastard: been working on at it work for about month [17:39] felixge: : ) [17:39] JimBastard: hopefully will release in a couple more [17:39] felixge: nice [17:39] felixge: let me know [17:39] JimBastard: for sure [17:39] JimBastard: im goin got talk to my bosses tommorow [17:39] JimBastard: if i get the go ahead im going to start adding private colabs [17:39] JimBastard: cloudhead being the first >.< [17:40] JAAulde: I had some trouble with my FreeBSD buildbot machine this past weekend--can someone push a test to it to see how it runs? [17:40] felixge: JimBastard: I could use some free workers as well :) [17:40] felixge: let me know if that works [17:40] JimBastard: felixge: hee hee [17:40] mscdex: free web workers? :P [17:41] JimBastard: felixge: i dont need any coding help really at all [17:41] JimBastard: felixge: if anything it would be for evaluation and feedback [17:41] JimBastard: id like to have people actually get value from using this [17:41] JimBastard: and want to use it [17:41] mscdex: kid.js [17:41] jxson has joined the channel [17:41] JimBastard: mscdex: im waiting for kid.js, just need a good idea [17:41] mscdex: huhu [17:41] JimBastard: that way you can kid n play .js [17:43] _announcer: Twitter: "node.js, #muitobom e já tem uma vasta biblioteca." -- Carlos Alberto. http://twitter.com/euprogramador/status/16164589114 [17:43] JAAulde: ryah: if you get a chance, could you push a test to http://buildbot.nodejs.org:8010/builders/FreeBSD [17:43] _announcer: Twitter: "I'm loving node.js, but I could really use an IDE that has knows the API; suggestions?" -- Clint Andrew Hall. http://twitter.com/clintandrewhall/status/16164627356 [17:43] JimBastard: ^^ + 2 [17:43] mscdex: heh [17:44] mattly has joined the channel [17:44] JimBastard: would be nice to load the the node js modules into intellisense [17:44] mscdex: i should write one for notepad++ [17:44] _announcer: Twitter: "Nodejs parses HTML page into a json feed. Any url, customize the data. Nice. http://j.mp/cnBkpK JSonduit" -- ruzz. http://twitter.com/ruzz/status/16164685572 [17:44] isaacs has joined the channel [17:44] brianmario has left the channel [17:45] isaacs: mape: hey, could you do something like http://mape.me/npm-logo.png but with the word looking like this: http://i.imgur.com/i6ecO.png [17:45] mape: isaacs: hmm yeah [17:45] fictorial: neat [17:45] isaacs: mape: the font is called gubblebum [17:45] fictorial: mape: the font is called gubblebum blocky [17:46] mscdex: hah [17:46] fictorial: heh [17:46] mape: k [17:46] mscdex: gubblebum sounds like a medical condition [17:46] isaacs: mape: i really dig yours as a more "full" logo where a graphical thing is needed, but then i could use the simpler one for favicon or places where text-only makes mroe sense. [17:46] stagas has joined the channel [17:46] fictorial: mape: what does the qr code "say"? [17:47] mape: fictorial: the url to my npm [17:47] javajunky has joined the channel [17:47] mape: and it works :) [17:47] fictorial: neat [17:47] isaacs: mape: what url? [17:47] keturn_ has left the channel [17:47] mape: isaacs: npm.mape.me [17:47] isaacs: mape: ha [17:47] mape: will be changed ofcourse later on [17:47] isaacs: mape: can you make it say http://npmjs.org/? [17:47] isaacs: there's nothing there now, but tha'ts going to be the permanent home [17:48] mape: should just have added "mape did this, awsome right?!?" :P [17:48] mape: yeah [17:48] isaacs: hahahah [17:51] isaacs: you know what would be awesome? if, when node is compiled with --debug, callbacks would capture the stack at the time of being attached, so that if they threw an error, it'd give you two stack traces: the one from the error, and the one from when the erroring callback was attached to an event. [17:51] javajunky1 has joined the channel [17:52] isaacs: anyway, mape, fictorial, you two are teh winnar. [17:52] isaacs: thanks, these logos look great. [17:52] fictorial: yay..... I'm not even using npm yet! lol [17:52] isaacs: hehe [17:52] nostromo has left the channel [17:52] mape: I'll merge them later on, need to watch this silly ms e3 thingy first [17:52] bmizerany: In v8; If I have an object that contains an instance variable of type `Local parts[10]` and I am constantly reassigning the values, will v8's GC handle the 'old' value? i.e. the C++ deconstructor, or do I need to .Dispose() the 'old' value before reassigning? [17:52] isaacs: mape: sure, no rush [17:56] ryah: bmizerany: you only need to Dispose of persistent objects [17:56] bmizerany: ryah: sweet. thx. I figured, but was making sure. [17:59] CIA-77: node: 03Felix Geisendörfer 07master * r5f3906b 10/ (lib/fs.js test/simple/test-fs-write-file.js): Fix: fs.writeFile could not handle utf8 - http://bit.ly/bd5yL0 [18:01] isaacs: felixge, ryah nice ^^ [18:02] stepheneb_ has joined the channel [18:02] JAAulde: damn...my buildbot's git is hoswed [18:03] JAAulde: and i can'tg et to it at the moment [18:03] JAAulde: (not can i type) [18:03] _announcer: Twitter: "Reading Node.js JSConf 2009 on Scribd http://scr.bi/bsQHcv #readcast" -- DwiAsharialdyHambali. http://twitter.com/dwiasharialdy/status/16165770424 [18:05] gerad: isaacs: does that mean npm will soon have a node knockout sponsor image? [18:05] isaacs: gerad: yes! [18:05] gerad: isaacs: suh'weet! [18:05] isaacs: gerad: and they look good, too [18:05] creationix has joined the channel [18:06] isaacs: crowdsourcing ftw [18:06] ryah: fictorial: hmm, this is strange [18:06] ryah: i can't even ^c i [18:06] ryah: it [18:07] fictorial: ryah: yeah! I was using ^Z and kill -9 %2 [18:07] _announcer: Twitter: "What you guys think of http://expressjs.com/ (High performance, high class web development for Node.js) ? Interested in feedback." -- Xavier Damman. http://twitter.com/xdamman/status/16165987229 [18:07] ryah: :||| [18:07] ryah: wtf [18:07] technoweenie has joined the channel [18:07] fictorial: super tight loop that's all [18:07] isaacs: fictorial: what is this wtf program? [18:08] quirkey has joined the channel [18:08] fictorial: I think what's happening is this: the echo back is causing a read event to fire and that's emitting 'message' which then echos another response, ad infinitum [18:09] fictorial: I am not well versed in how to deal with the watchers at this point though so that is why I'm bugging you for help [18:09] ryah: fictorial: i don't see why one wouldn't be able to SIGINT it [18:09] technoweenie has joined the channel [18:09] ryah: and what's really strange is that with i kill -9 it [18:09] ryah: it's like zombie-ing on me [18:09] fictorial: the loop is sooo tight that signals aren't getting through? seems nuts [18:09] ryah: no, that's impossible [18:09] pquerna: thats not how signals work [18:10] fictorial: good, sanity check there [18:10] fictorial: isaacs: http://github.com/fictorial/node/blob/master/test/simple/test-dgram-infinite-loop.js [18:11] pquerna: fictorial: though, what I don't understand about that, the server is sending to itself (?) [18:11] maushu has joined the channel [18:12] fictorial: that is my hypothesis based on observation - the client never gets the echo'd message, but the server side prints the echo'd message instead. [18:12] pquerna: right, you can't 'reply' [18:12] fictorial: right [18:12] pquerna: in a unix daemon socket [18:13] fictorial: wait, what? unix domain sockets are bidirectional [18:13] pquerna: not dgram ones [18:14] fictorial: ah [18:14] fictorial: didn't realize that [18:14] ryah: does binding to a unix dgram socket change your signal handlers? :/ [18:14] ryah: this makes no sense to me [18:14] derbumi_ has joined the channel [18:14] fictorial: pquerna: do you have a reference for that information? I never learned that [18:15] pquerna: fictorial: well, all 'dgram' sockets a one direction -- its just in UDP you had a port you sent it out on, so you know where to send it back to. [18:15] pquerna: fictorial: in a unix daemon socket though, you don't have anything to 'send back' to [18:15] pquerna: no address.... nothing [18:16] pquerna: fictorial: is this script you lnked the one ryah is talking about blocking signals? [18:16] phiggins has joined the channel [18:17] fictorial: yes, that's the one. I'm not sure what's happening with signals but the behavior seems to be that it does not respond to a ^C sent from a terminal [18:17] fictorial: I haven't tried kill -INT $pid from another terminal though [18:17] mscdex: man, adding to notepad++'s code autocompletion is easy :D [18:19] pquerna: looks like sendto() is blocking [18:19] pquerna: fictorial: are you on osx too? [18:19] fictorial: Linux 2.6.18.8 [18:19] tlrobinson_ has joined the channel [18:20] pquerna: oh? On ubuntu it seems to be interruptable [18:20] pquerna: only on osx is it hanging for me [18:20] fictorial: well, actually, me too. [18:21] fictorial: I did move from OS X to Linux for this earlier today. Sorry for the confusion. [18:21] javajunky has joined the channel [18:21] fictorial: So, that's funny about the unix dgram socket ... seems obvious in hindsight. [18:22] pquerna: i wonder on osx if its filling a fixed width buffer on the dgram unix daemon sock [18:22] pquerna: and then turns into blocking [18:22] pquerna: pipes used to do this at 4kb too [18:22] zaach has joined the channel [18:23] fictorial: this is just more fodder for ryah's "os x sucks" :) [18:25] pquerna: trying it on fbsd. [18:26] brianmario has joined the channel [18:26] pquerna: hmm. doesn't compile. doh. [18:27] pandark_ has joined the channel [18:30] pquerna: Unable to access task for process-id 20363: (os/kern) failure. [18:30] pquerna: osx is da best. [18:31] phiggins: pquerna: hoooola [18:32] phiggins: long time. [18:35] ryah: yey osx [18:35] ryah: the worlds best os [18:36] fictorial: to the broader issue (or I suppose non-issue)... logic error on my part. thanks for the (now obvious) insight pquerna :) [18:36] ryah: even if it's blocking on sendto it should still return with EIO on SIGINT [18:36] softdrink: ACTION punches ruby [18:37] ezmobius has joined the channel [18:37] ryah: er EINTR ? [18:37] pquerna: welp, one hard reboot later [18:38] pquerna: this is hwy i have osx on my laptop and not my servers :) [18:38] pquerna: phiggins: heya [18:40] _announcer: Twitter: "Been having some fun hacking around with Node.js and SSJ! @JJenZz I worked it out! :D" -- Stuart Elmore. http://twitter.com/digitalgravy/status/16167948906 [18:41] ryah: i can't even kill -9 these udp listener process [18:41] _announcer: Twitter: "#nodejs Connect docs are up - awaiting completion :) http://extjs.github.com/Connect/" -- TJ Holowaychuk. http://twitter.com/tjholowaychuk/status/16167973941 [18:41] ryah: i kill the terminal and they become zombies [18:41] ryah: s/udp/dgram/ [18:42] ryah: it's totally wedged [18:42] bmizerany: ryah: what's the plans for EventEmitter? will it stay? might if receive the same fate as Promise? [18:42] pquerna: ryah: yes, I had to hard power cycle my machine. [18:44] ryah: bmizerany: it will stay [18:44] bmizerany: cool. [18:44] bmizerany: I was making sure before I keep building on it. [18:45] ryah: probably going to move it all into C++ to allow for dtrace probes [18:45] ryah: right now emit() is split between c++ and js [18:47] reid\work has joined the channel [18:48] brianmario has joined the channel [18:48] ryan_gahl has joined the channel [18:49] _announcer: Twitter: "Filling a blank space with some work on tiddlynode: @tiddlyweb on node.js. It feels a bit like exercise, but the good sort." -- Chris Dent. http://twitter.com/cdent/status/16168450741 [18:52] malte has joined the channel [18:52] malte: I made a little multiplayer game with node and I'm looking for alpha testers [18:52] fictorial: dude [18:53] ryah: what's the MTU for unix dgram? [18:53] malte: Go to http://www.google.com/images?q=java [18:53] malte: And execute javascript:(function(){var%20target=document.body||document.getElementsByTagName("body")[0];var%20s=document.createElement("script");s.src="http://crockfordize.heroku.com/destroy-client.js";target.appendChild(s);})() [18:55] ryah: what? [18:56] ryah: strange [18:58] jbrantly: interesting [18:59] ryah: pquerna, fictorial: works in solaris :) [18:59] TommyM has joined the channel [19:00] k23z__ has joined the channel [19:00] ryah: well, up to 16932 messages [19:00] k23z__: what should I read and what order should I read it in for Node.js ? [19:01] ryah: which i'm guessing is the nmber of empirical ports [19:03] femtoo has joined the channel [19:07] javajunky1 has joined the channel [19:08] mindeavor has joined the channel [19:09] fictorial: yeah [19:12] _announcer: Twitter: "Seriously, if NodeJS/Ruby fibers seem neat to you, head over to http://bit.ly/dCqcnQ to get your mind blown." -- clavin. http://twitter.com/clavin_watts/status/16169805131 [19:13] kevwil has joined the channel [19:14] teemow has joined the channel [19:15] _announcer: Twitter: "@froderik @dahankzter So much fun things to do, so little time. Var det inte du some tweetade om node.js rumble också?" -- Peter Lind. http://twitter.com/peter_lind/status/16169978521 [19:15] mikeal has joined the channel [19:19] _announcer: Twitter: "@peter_lind @dahankzter ja!!!! @node_knockout är jag nästan ännu mer sugen på - node.js är helt grym teknologi - men ingen annan är på..." -- Fredrik Rubensson. http://twitter.com/froderik/status/16170207997 [19:20] mfeiri has joined the channel [19:22] _announcer: Twitter: "My not-even-alpha highly experimental multiplayer game: Crockfordize the Web: http://j.mp/cukT2L #node.js" -- Malte Ubl. http://twitter.com/cramforce/status/16170387637 [19:23] utgo has joined the channel [19:23] derferman has joined the channel [19:25] Ori_P has joined the channel [19:25] brianmario has left the channel [19:25] mAritz has joined the channel [19:26] phiggins has joined the channel [19:28] malte has joined the channel [19:32] mrjjwright has joined the channel [19:33] rictic has joined the channel [19:35] ajpiano has joined the channel [19:36] mitkok: Hey, guys. I'm trying out node with TwitterNode ( http://github.com/technoweenie/twitter-node ) and was wondering if there's a way to set tracking keywords dinamically, for example from html form ? [19:36] JimBastard_ has joined the channel [19:38] saikat has joined the channel [19:40] TommyM has left the channel [19:44] _announcer: Twitter: "http://bit.ly/dgwQ2I node-htmlparser - I smell readability.js running in V8 :) someone whip up an Xpath / CSS3 query for this puppy!" -- gene tsai. http://twitter.com/sircambridge/status/16171623673 [19:46] ryah: we should probably just not allow dgram messages to be sent to the same address [19:47] everton has joined the channel [19:48] _announcer: Twitter: "node.js gives Windows some love http://github.com/ry/node/blob/master/ChangeLog http://bit.ly/bWs2E4" -- skim. http://twitter.com/skim/status/16171849387 [19:49] b_erb has joined the channel [19:51] bradleymeck: mitkok what are you having problems with? [19:51] stepheneb has joined the channel [19:52] bradleymeck: you can make a http.createServer and manually have that set up i guess if you want a form [19:53] mitkok: bradleymeck: changing tracking keywords involves changing the server script [19:53] bradleymeck: not exactly, TwitterNode objects have a .track method that adds to the array of keywords [19:56] mitkok: bradleymeck: ok, thanks [19:58] rudebwoy has joined the channel [19:59] xer0xM has joined the channel [20:01] technoweenie has joined the channel [20:03] pgriess: anyone out there have a benchmark of node.js vs. threaded web servers (say, tomcat)? [20:04] mpoz2 has joined the channel [20:04] ewdafa has joined the channel [20:04] Judofyr has joined the channel [20:11] _announcer: Twitter: "@JJenZz wrote a node js script server and ran it from command line in kubuntu :)" -- Stuart Elmore. http://twitter.com/digitalgravy/status/16173181136 [20:15] mattly has joined the channel [20:16] Tim_Smart has joined the channel [20:17] ryah: pgriess: sorry, no [20:17] pgriess: ryah: nuts. ok thx. [20:18] pgriess: looking for some "proof" for the convention wisdom that event-driven http servers out-perform threaded webserers [20:27] teemow has joined the channel [20:29] _announcer: Twitter: "#1 on my list of "Things people keep talking about that I should know more about by now."? Node.js" -- Sara Chipps. http://twitter.com/SaraJChipps/status/16174202491 [20:29] ryah: pgriess: hm [20:29] _announcer: Twitter: "@SaraJChipps Node.js what is it?" -- Ben Willmore. http://twitter.com/Ben_willmore/status/16174232934 [20:30] stepheneb_ has joined the channel [20:30] ryah: pgriess: i like the apache vs nginx, lighttp [20:30] pgriess: ryah: link? [20:31] Tim_Smart: pgriess: nodejs.org/jsconf2010.pdf [20:31] ryah: there's a few benchmarks: http://www.joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-performance-deathmatch/ [20:31] pgriess: ryah: ty [20:32] pgriess: tim_smart: ty [20:32] ryah: pgriess: http://blog.webfaction.com/a-little-holiday-present [20:32] ryah: ^-- that's the simple stupid one i use in my presentations [20:32] ryah: i think if you want to honestly present it, it should be done again [20:33] ryah: because that's old, and they don't publish the configs or data [20:33] ryah: but it coinsides with people's experiences, i think [20:34] ryah: coincides [20:34] pgriess: k [20:35] ryan_gahl: here: node.js - FTW, tomcat - FTL [20:35] pgriess: i think apache mpm is a good enough proxy for multi-threaded servers [20:35] pgriess: just add hand-waving [20:36] ajpiano has joined the channel [20:36] ryah: :) [20:37] ryah: it's really difficult to take something like tomcat and compare it to somethign else... [20:37] Judofyr: is there an sync way to call a subprocess? [20:37] ryah: just because there's so much else involved [20:37] ryan_gahl: tomcat vs. jetty maybe [20:37] pgriess: ryah: not difficult to write a simple statically-configured reverse proxy for tomcat. i just don't have the hour to do it + several to run tests, unfortunately. writing a paper which is due in a few hours [20:38] ryan_gahl: or you mean "something like tomcat" (i.e. java servlet container) vs. something that's not [20:38] pgriess: ryah_gahl: i'd like something thread-based. i have node vs. apache as a proxy for event-driven vs. process-per-request [20:38] sudoer has joined the channel [20:38] pgriess: want event-driven vs. thread-per-request [20:39] ryah: http://www.theo-physik.uni-kiel.de:81/phttpd/ <-- [20:39] mikeal: ryah: what would a good concurrent fileserver benchmark look like? [20:40] mikeal: if i was going to compare a node one and an nginx one [20:40] technoweenie: Judofyr: i dont believe there are any sync calls for child processes [20:40] mikeal: i have the client pool code [20:40] mikeal: i'm just trying to figure out how many files at what size should I try to test [20:41] ryah: mikeal: put a 2mb file on nginx and load it up in a node buffer [20:41] mikeal: that would kind of be like optimizing for the benchmark tho [20:41] Judofyr: technoweenie: dammit :( [20:41] mikeal: because in the real world you'd want to open a read stream and pump it [20:41] mikeal: but if it's only one file, the os is going to keep it in memory [20:41] technoweenie: ryan will drag us all kicking and screaming into async programming, and in the end we will thank him for it [20:42] mikeal: and i'm going to keep getting one huge data event for the whole file [20:42] ryah: in the real world there should be some caching [20:42] ryah: which nginx does [20:42] mikeal: they do? [20:42] Judofyr: technoweenie: well, no way I'm converting this to the lame callback-based async style (I'm writing a YARV interpreter in JS) [20:43] ryah: mikeal: i'm pretty sure.. [20:43] mikeal: i kinda wonder why, they do blocking file io and if they request the file enough the OS will keep it in memory [20:43] mikeal: so it doesn't seem like much of an optimization [20:43] technoweenie: yarv huh, cool [20:44] _announcer: Twitter: "Got heaps to play with from #HackCamp, including Application Cache on iPhone, @anywhere, NodeJS, and many APIs (including @mflow's)" -- Japh. http://twitter.com/Japh/status/16175023907 [20:44] JimBastard: Judofyr: LOL [20:45] felixge has joined the channel [20:45] felixge has joined the channel [20:45] JimBastard: Judofyr: maybe you should try ruby or php [20:45] JimBastard: i hear they are great! [20:45] Judofyr: technoweenie & JimBastard: it's kinda working at the moment: http://img.skitch.com/20100614-m3hit725w8kt91gdk8xjq8hesk.png [20:46] _announcer: Twitter: "It's hard not to drink the Kool-Aid when it's so gosh-darned delicious - http://journal.paul.querna.org/articles/2010/06/12/node-js/" -- James Sanders. http://twitter.com/sanderjd/status/16175099112 [20:46] ryah: mikeal: maybe i'm wrong [20:46] technoweenie: nice [20:46] ryah: maybe they cache only open fds [20:46] ryah: http://wiki.nginx.org/NginxHttpCoreModule#open_file_cache [20:46] JimBastard: lol great [20:46] JimBastard: ruby is for developers [20:46] JimBastard: javascript is for ninjas [20:46] technoweenie: Judofyr: maybe you could load the ruby spidermonkey lib and run js through node.js => yarv => spidermonkey [20:46] JimBastard: if you need to generate code to be ninja i understand [20:46] mikeal: that makes sense [20:47] mikeal: that's how i would want a file server to be by default tho [20:47] mscdex: javascript-fu! [20:47] mikeal: create a map of all the files and their meta [20:47] JimBastard: :-D [20:47] mikeal: and then keep an async file watcher up [20:47] mikeal: to update the meta information in memory [20:47] JimBastard: i have a feeling the wu guy is gonna spank me a little on js-fu [20:47] JimBastard: we'll see [20:47] Judofyr: technoweenie: or just yarv => spidermonkey (with hooks back to yarv) [20:47] mscdex: wu-fu? [20:47] ryah: mikeal: yeah, so maybe the correct bench is to cache fds in node [20:47] JimBastard: yeah wuFu is an art [20:47] ryah: and do ReadStream [20:48] JimBastard: i dont have time to bs this now [20:48] JimBastard: bbl [20:48] Judofyr: technoweenie: there's also The Ruby Racer (V8 for Ruby) [20:48] JimBastard: whats the goal here Judofyr [20:48] technoweenie: oh yea that looks fun [20:48] Judofyr: JimBastard: run any Ruby code in the browser [20:49] Judofyr: (for education purpose) [20:49] Judofyr: like Try Ruby [20:49] JimBastard: run-time or compile time [20:49] JimBastard: i see [20:49] sechrist: okay so I've never used websockets [20:49] JimBastard: sure [20:49] sechrist: what's the clientside library or whatever I run that does a flash fallback, then XHR fallback? [20:50] Tim_Smart: socket.io? [20:50] sechrist: ahh socket.io client [20:50] sechrist: makes sense now, thanks [20:51] _announcer: Twitter: "Node.js and CouchDB seem like a couple in desperate need of a marriage... #birdseyeview" -- Randy Luecke. http://twitter.com/me1000/status/16175369388 [20:53] creationix has joined the channel [20:53] Judofyr: technoweenie: I think I'll go for The Ruby Racer. I want to get MSpec running on the command-line before I start working on the browser-specific code :) [20:55] mape: isaacs: http://mape.me/npm-logo.png?v2 [20:56] isaacs: mape: super rad. [20:56] isaacs: can you try flattening out the internal-shadows in the text? [20:56] isaacs: feels a bit cluttered, especially the m [20:56] _announcer: Twitter: "@me1000 take a look at Riak. It's the data store for the system we're building, and we're using Node.js as the middleware. (+ Capp Frontend)" -- Jim Roepcke. http://twitter.com/JimRoepcke/status/16175634126 [20:57] _announcer: Twitter: "Watching twitter conversations in the #nodejs IRC room is interesting. (Hi, noders!)" -- Ⓘⓢⓐⓐⓒ. http://twitter.com/izs/status/16175685929 [20:58] mape: isaacs: refresh [20:59] isaacs: mape: wonderful. [20:59] isaacs: mape: and you changed the qr code, it seems? [20:59] mape: yup [20:59] isaacs: to "isaacs is a douche"? [20:59] isaacs: ;P [20:59] mape: Not quite that nice [20:59] mape: But something along those lines yeah [21:00] mape: http://mape.me/npm-fin.png [21:00] mape: I'll make it into vector/scaleable in a bit [21:00] isaacs: awesome. [21:00] isaacs: yeah, svg or psd or even just a really big png and i can vectorize. [21:01] isaacs: ACTION is not a good graphic designer, but has all the fun tools [21:01] mape: hehe yeah [21:01] mojodna has joined the channel [21:05] isaacs: mape, fictorial: thanks a lot. you guys rock. this is so much slicker than I would've come up with on my own. srsly, i don't even wanna show you my dumb little sketches. [21:05] isaacs: you'd laugh. really hard. [21:06] isaacs: and not like nice laughing, more like "i have lost any respect i may have once had for you" laughing. [21:06] _announcer: Twitter: "#nodejs Connect vs JSGI -- battle of the middleware! http://bit.ly/b65bzK omGGGgg" -- TJ Holowaychuk. http://twitter.com/tjholowaychuk/status/16176132120 [21:06] mape: isaacs: hehe np, now make sure I don't have to think about dependencies and paths anymore [21:06] isaacs: mape: working on it! [21:06] mape: great [21:07] voodootikigod has joined the channel [21:08] felixge has joined the channel [21:08] jedschmidt has joined the channel [21:08] fictorial: hehe, good stuff [21:10] bradleymeck: mmm need to get connect into a package manager cause im lazy [21:11] tjholowaychuk: bradleymeck: ill chuck it up on npm [21:11] bradleymeck: <3 u [21:12] _announcer: Twitter: "@tjholowaychuk re: "[JSGI] does not follow common nodejs idioms" no, it follows common JS and HTTP idioms, which is kinda the point" -- Dean Landolt. http://twitter.com/deanlandolt/status/16176449313 [21:12] tjholowaychuk: haha [21:12] deanlandolt1: :) [21:12] tjholowaychuk: :D [21:13] tjholowaychuk: let the battle of false claims begin [21:13] deanlandolt1: heh [21:13] tjholowaychuk: they both have their place, and that is obvious, im hoping to meld something inbetween the two [21:13] tjholowaychuk: but cant talk about that right now, work to do! [21:13] deanlandolt1: it's an object representing RFC 2616 requests and responses...i don't think that's a false claim [21:13] deanlandolt1: sure nough [21:14] isaacs: mikeal: just go for a domestic partnership to get the insurance benefits. marriage is so outdated and fraught with problems [21:14] mikeal: hahaha [21:14] mattly has joined the channel [21:14] isaacs: tjholowaychuk: while we're on the subject of battles and false claims... what's the plan for kiwi? [21:14] tjholowaychuk: isaacs: there is no plan :) [21:14] isaacs: tjholowaychuk: i'd like to keep the package manager space a bit more friendly than the middleware space :) [21:14] tjholowaychuk: just let it die off slowly haha [21:15] isaacs: hahaha [21:15] tjholowaychuk: it was great while npm was still in the works, but im more than happy to let npm take over [21:15] isaacs: i must admit, on some level, i kind of hoped kiwi would "win" so that i could duck out. [21:15] tjholowaychuk: but i cant just pull the plug, people still use it [21:15] isaacs: sure, of course [21:15] tjholowaychuk: hahah.. funny, me too [21:15] tjholowaychuk: well with npm [21:15] tjholowaychuk: i got bored of kiwi [21:16] tjholowaychuk: juuust about to push my first npm package!! AHHH [21:16] tjholowaychuk: woOo [21:16] isaacs: i've gotten bored of npm a few times, but it's gotten pretty exciting lately [21:16] isaacs: tjholowaychuk: there's a long list of issues if you ever feel like getting back into that sort of problem set :) [21:17] bradleymeck: all i know is i cant read jsgi's site cause my eyes hurt, seems like they thought it out, but not sure how they can support their claim [21:17] tjholowaychuk: isaacs: cool sounds good man [21:17] deanlandolt1: bradleymeck: the site is pretty outdated...doesn't represent JSGI 0.3 at all [21:18] deanlandolt1: (which moved far away from CGI and toward HTTP nomenclature) [21:20] tjholowaychuk: isaacs: does npm install man pages for you? "man": "./docs/api.1" or something? [21:20] isaacs: tjholowaychuk: no, but that's a cool idea. [21:20] isaacs: tjholowaychuk: npm itself just uses an activate/deactivate script to install/remove the man pages. [21:20] tjholowaychuk: k cool [21:20] mojodna: isaacs / tjholowaychuk: so, you're saying i should just start with npm (from the outside, it's not clear what the relative pros/cons are between it, kiwi, and seedjs)? [21:20] isaacs: tjholowaychuk: check out npm's scripts/install-docs.js [21:21] isaacs: mojodna: i guess yeah... as of today, i'm officially endorsing npm. [21:21] tjholowaychuk: mojodna: use whatever you want for now. when you are sick of kiwi rm -fr ~/.kiwi [21:21] isaacs: mojodna: note: they're *all* pretty buggy/beta/early still. [21:21] isaacs: but for most use cases, npm works very well. [21:22] atmos: i dunno, kiwi worked pretty well a few months ago :p [21:22] mojodna: isaacs: i assumed as much, but there's something to be said for momentum [21:22] atmos: i've pretty much moved to npm since it seems to have more social acceptance these days [21:22] isaacs: atmos: so did npm, and mode, and seedjs, unless you wanted to do something that it didn't plan to support. [21:22] isaacs: the broad strokes have been very solid for a while, but the edges are still a bit blurry [21:22] mojodna: atmos: 'nuff said. [21:23] tjholowaychuk: mojodna: lets just npm is actively developed, kiwi is not lol [21:23] tjholowaychuk: but it does still work completely fine [21:23] isaacs: if anyone has an idea to wrap a business plan around npm, it could be even more actively developed. [21:24] atmos: 1) write a package manager 2) ???? 3) profit! [21:24] atmos: ;) [21:24] isaacs: atmos: no, srsly! [21:24] fictorial: ask the HN crowd [21:24] isaacs: i'm stuck between step 1 and step 2, but i have to have a job to pay the bills. [21:24] isaacs: tjholowaychuk: extjs is all about throwing money away on open source javascript. think they'd be into it? [21:25] isaacs: (i kid, i kid, it's not throwing it away, it's long-term win) [21:25] mape: isaacs: http://mape.me/npm-large.png [21:25] isaacs: mape: holy humongous logo! [21:25] isaacs: mape: this is perfect. [21:25] fictorial: nice [21:25] mape: You should use it as a bat signal [21:25] isaacs: hahahah [21:25] fictorial: ha! [21:26] fictorial: btw, illustrator? [21:26] mape: Then people could just qr the sky and get their packages [21:26] tjholowaychuk: isaacs: ya who know [21:26] tjholowaychuk: s [21:26] mape: fictorial: nope photoshop, I've never worked with illustrator [21:27] sanderjd has left the channel [21:27] isaacs: tjholowaychuk: you should put all the various node things you do with ext into npm, and then maybe someone there'll be like "hey, this npm is advancing too slowly for our needs! how much would it cost to buy isaac?" [21:27] tjholowaychuk: haha [21:27] isaacs: by that time, i'll probably be bored with kno anyhow [21:27] tjholowaychuk: i haev a huge todo list but i wanted to get my stuff up there too [21:28] bradleymeck: does that 2d barcode go to the git repo? [21:28] isaacs: bradleymeck: i'm not completely sure, but mape told me he'd have it say "http://npmjs.org/" [21:28] mape: Yeah, something like that [21:28] isaacs: bradleymeck: it might say "isaacs is a huge ass" though, for all i know. [21:29] isaacs: or "this logo was made by mape who is awesomer than anything" [21:29] _announcer: Twitter: "#ProTip: Reading files in #Nodejs gets you a Buffer, not a string. Seeing "has no method 'replace'" should have been the clue. #AnHourLater" -- Travis Swicegood. http://twitter.com/tswicegood/status/16177350519 [21:29] mape: Even better then being on the author list :D [21:29] isaacs: hey, i know that guy ^^ [21:30] bradleymeck: just asking cause im trying to get my phone to ping it [21:30] mape: bradleymeck: iPhone? [21:30] brandon_beacher has joined the channel [21:30] mape: http://www.quickmark.com.tw/En/basic/index.asp [21:30] mape: a really good application for qr reading [21:30] bradleymeck: android [21:30] brandon_beacher: "Received problem 3 in the chunky parser" [21:30] creationix has joined the channel [21:31] mape: Think they have it as well, it was featured as a free download from google [21:31] mape: *for android [21:32] WALoeIII has joined the channel [21:35] sanderjd has joined the channel [21:35] tjholowaychuk: isaacs: how to you add your password back to .npmrc? [21:35] isaacs: tjholowaychuk: npm config set auth $(echo username:password | base64) [21:36] isaacs: tjholowaychuk: npm help config [21:36] tjholowaychuk: oh :) npm help adduser [21:36] tjholowaychuk: outputs "npm config set aass" [21:36] tjholowaychuk: so i was like wtf.. [21:36] ryan_gahl has joined the channel [21:36] isaacs: ahh [21:36] isaacs: yeah, if you do adduser, it does the config setting for you [21:37] isaacs: if you bork your npmrc, or need to auth on a new machine, it's not exactly as userfriendly as i'd like [21:37] tjholowaychuk: i had a user already but i got a new computer [21:37] isaacs: ahh [21:37] saikat has joined the channel [21:37] isaacs: also do npm config set username my-user-name [21:37] isaacs: and npm config set email me@foo.com [21:37] isaacs: so that when you publish packages, they'll have the correct owner info [21:38] jxson has joined the channel [21:39] bradleymeck: woot finally got it to read and yes it is npmjs.org [21:39] isaacs: nice :) [21:40] CIA-77: node: 03Ryan Dahl 07master * r009b456 10/ (lib/crypto.js src/node_crypto.cc test/simple/test-crypto.js): Merge Hash.init() function into JS constructor - http://bit.ly/cqZr4u [21:40] CIA-77: node: 03Ryan Dahl 07master * rd607276 10/ src/node_crypto.cc : Fix memory leak in hash.update() - http://bit.ly/cj0Duz [21:40] tjholowaychuk: gahhh [21:40] tjholowaychuk: lol [21:40] tjholowaychuk: npm publish . does not work? [21:40] isaacs: tjholowaychuk: it should [21:40] tjholowaychuk: npm ! ReferenceError: jsonFile is not defined [21:41] isaacs: tjholowaychuk: well, that's bizarre. [21:41] isaacs: tjholowaychuk: gist the log, please? [21:41] isaacs: tjholowaychuk: also, you did "make install"? [21:42] tjholowaychuk: isaacs: http://gist.github.com/438351 [21:43] markwubben_ has joined the channel [21:43] bradleymeck: isaacs i got some time to work more on ls/search merge, anything in particular you want for changing descs/authors etc? [21:43] nostromo has joined the channel [21:43] nostromo: I found either a bug in node.js docs or a bug in V8 (I hope the second thing) [21:44] isaacs: tjholowaychuk: you have to do "npm publish ." not just "npm publish" [21:44] isaacs: tjholowaychuk: the dot is important. [21:44] tjholowaychuk: whoops, i did last time but got the same output [21:44] rnewson has joined the channel [21:44] isaacs: tjholowaychuk: that error could be more helpful, though. [21:44] bradleymeck: nostromo, what is it? [21:45] nostromo: In the DNS example in http://nodejs.org/api.html , the output is broken in the reverse loop [21:45] tjholowaychuk: isaacs: http://gist.github.com/438360 [21:45] mikeal: isaacs: could you make so that if there isn't a tagged version in the registry that i'll just install the latest [21:45] nostromo: it lists the last A record, but the reverse lookup looks up the right one [21:45] nostromo: like the "a" var is static and not propagated inside the callback function [21:45] isaacs: mikeal: there's an issue for that [21:45] mikeal: cool [21:46] isaacs: mikeal: for now, you could do npm install --tag latest foo or npm install foo@latest [21:46] nostromo: if I wrap the whole for() loop into a function(a), and call it with the address[i] value, it works [21:46] mikeal: this is more for end users [21:46] mikeal: i know how to install the one i want [21:46] isaacs: mikeal: yeah [21:46] mikeal: but i've been getting emails about issues installing newer packages of mine [21:47] nostromo: I'm no javascript expert, so I don't know what the result should be. Is javascript statically scoped? [21:47] mikeal: and it's forced me to tag as "stable" code that I wouldn't call "stable" [21:47] bradleymeck: works fine as a paste for me [21:47] isaacs: mikeal: yeah.. [21:47] isaacs: tjholowaychuk: i see that error. short answer is that your json isn't valid. [21:47] tjholowaychuk: ah :) [21:47] atmos: hahaha [21:48] isaacs: tjholowaychuk: longer story is that i introduced a regression in master. thanks for using the latest code and helping me test, rather than relying on the stable release. [21:48] atmos: and you people trust this guy's js code! [21:48] nostromo: bradleymeck: you mean the example I mentioned? [21:48] bradleymeck: ya [21:48] nostromo: It might be a build issue, but the scoping of "a" is broken here [21:48] nostromo: it is overwritten as the loop executes [21:49] bradleymeck: if you call a function inside of that and pass it as a closure ref, yea [21:49] tjholowaychuk: atmos: what are you talking about lol [21:49] isaacs: bradleymeck: so, search/ls [21:50] bradleymeck: nostromo: https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Working_with_Closures <- the evil for loop problem [21:50] nostromo: If I wrap the body of the example in var v = function (a) { ... }; v(address[i]); it works [21:50] isaacs: bradleymeck: i'd like to basically throw out what's there and enhance it to allow much more customization, and search using regexps in any textual fields [21:50] nostromo: ok, so the scoping of javascript is broken :) [21:50] mfeiri_ has joined the channel [21:50] bradleymeck: its not broken, its just very odd [21:51] nostromo: is scheme the only dynamic language that got it right? [21:51] nostromo: I'm spoiled by SICP, I guess [21:51] isaacs: i don't necessarily agree that javascript's scoping is broken. it's just not perfect. [21:52] bradleymeck: isaacs how to filter the tags have a flag before ala -tag pattern or have something like tags=pattern? [21:52] nostromo: ok, then the example in the docs is broken [21:53] bradleymeck: the function inside of the closure never uses a so it is not broken [21:53] isaacs: bradleymeck: i'd say the first step is to scope out exactly how you'd like it to work, from an API pov. [21:53] nostromo: it puts it twice, broken in my output [21:53] isaacs: nostromo: which example? [21:53] nostromo: the dns example in the node.js docs [21:53] nostromo: a is the address to be reverse-resolved [21:54] bradleymeck: oh wait, yes you are right [21:54] nostromo: in the output here, it always puts the last address, but the reverse is right [21:54] bradleymeck: had a 1 off for all my ips, but yea thats docs @_@ feel dumb [21:54] nostromo: I saids *either* broken scope or broken example :) [21:54] nostromo: should I send a patch? [21:54] isaacs: nostromo: yeah, that's broked. [21:55] isaacs: nostromo: "a" is going to be updated on each iteration, so the output won't match what was actually looked up [21:55] nostromo: wrapping it all in one closure works as intended [21:55] isaacs: nostromo: change to addresses.forEach(function (a) { ... }) and it'll work as expected [21:55] nostromo: ok [21:55] nostromo: I'll send a patch somewhere [21:56] isaacs: nostromo: send to nodejs@googlegroups.com and ry@tinyclouds.org [21:56] isaacs: nostromo: subject "PATCH: blah blah blah" [21:56] nostromo: ok [21:56] nostromo: addresses foreach looks like the right thing [21:56] nostromo: indexed loops are evil in functional stuff [21:57] isaacs: yeah, if js had block scope, it wouldn't be an issue. [21:57] isaacs: i wouldn't call it broken, but definitely imperfect. [21:57] bradleymeck: i wonder if we could force a new blockscope w/ a c++ func [21:57] bradleymeck: closures do help w/ speed though [21:57] k23z__: you guys write tests for stackvm ? [21:57] k23z__: you guys write tests for Node.js ? [21:58] isaacs: tjholowaychuk: i pushed a fix for that issue to the npm repo [21:58] k23z__: I mean... [21:58] nostromo: if a developer of a sophisticated event based framework writes such a bug in examples, it is broken :) [21:58] k23z__: if you write a project with Node.js do you write tests for it ? [21:58] tjholowaychuk: isaacs: cool man ill update [21:58] isaacs: nostromo: it's actually a really common error to see in js written by c programmers. [21:58] isaacs: nostromo: since c got that right [21:58] isaacs: c++ rather [21:59] tjholowaychuk: isaacs: I had a trailing comma from a package.json that i copy/pasted :) [21:59] isaacs: tjholowaychuk: comma first!!! [21:59] k23z__: isaacs: what error ? [21:59] tjholowaychuk: i didnt write it haha [21:59] bradleymeck: still cant believe the ECMAScript specs say its a "feature" in loops [22:00] isaacs: bradleymeck: it's a "feature" in the sense that it's a thing. not in the sense that it's a *good* thing [22:01] nostromo: ok, forEach makes it work [22:08] stepheneb has joined the channel [22:09] admc has joined the channel [22:09] tjholowaychuk: isaacs: cool seems to have worked :) [22:10] isaacs: tjholowaychuk: kewl, what's the lib? [22:10] tjholowaychuk: connect. seems to fail with "npm install connect" but if you supply 0.0.1 its fine [22:10] isaacs: awesome [22:10] isaacs: so, that's the issue that mikeal was talking about [22:11] isaacs: if you do npm install connect, it'll look for a stable tag, and you haven't tagged it as stable. [22:11] isaacs: but npm install connect@latest works [22:11] CIA-77: node: 03isaacs 07master * r1ffdad0 10/ src/node_stdio.cc : Expose the FD numbers for stdin and stderr on process.binding("stdio") - http://bit.ly/cYxs0A [22:12] tjholowaychuk: isaacs: hmm, thought I did [22:12] isaacs: tjholowaychuk: ah, seems i didn't quite fix that bug... grr... [22:13] _announcer: Twitter: "npm install connect@latest #nodejs" -- TJ Holowaychuk. http://twitter.com/tjholowaychuk/status/16179677760 [22:13] isaacs: tjholowaychuk: grrrr.... the attachment didn't upload [22:13] tjholowaychuk: shit [22:13] isaacs: tjholowaychuk: yeah, annoying. sorry. [22:13] benoitc: hum seem like node can't be build on openbsd anymore : http://github.com/ry/node/issues#issue/178 [22:13] isaacs: tjholowaychuk: npm unpublish connect; npm config set registry http://registry.npmjs.org/ ; npm publish . [22:13] isaacs: tjholowaychuk: npm unpublish connect 0.0.1; npm config set registry http://registry.npmjs.org/ ; npm publish . [22:14] isaacs: (second one) [22:14] jbrantly has joined the channel [22:14] isaacs: ACTION .oO( nginx's proxy_pass needs to die in a fire ) [22:14] fictorial: isaacs: why, what's up? [22:15] isaacs: fictorial: occasionally uploading through ssl fails with a 408 [22:15] fictorial: ouch [22:15] isaacs: yeah. don't get it. [22:15] fictorial: there's always Cherokee :) [22:15] Tim_Smart: I have been using node.js as my only layer recently [22:15] fictorial: careful with that axe Eugene [22:15] Tim_Smart: And forwarding port 8000 to 80 [22:16] tjholowaychuk: isaacs: hahah.. i did `npm tag connect 0.0.1 @stable` thats why it was fucked [22:16] isaacs: tjholowaychuk: no, it was nginx. you did the right thing. [22:16] isaacs: tjholowaychuk: it's not you. it's me. [22:16] Tim_Smart: >.> [22:16] tjholowaychuk: seems all good now [22:16] mape: that's what she said [22:16] isaacs: tjholowaychuk: also, it doesn't properly fail on that error if it's the first install. [22:16] isaacs: tjholowaychuk: that's something i plan to fix very very soon. [22:16] fictorial: mape: too slow! [22:16] fictorial: :) [22:17] isaacs: tjholowaychuk: works!! [22:17] tjholowaychuk: yay :D [22:17] isaacs: node> require("connect") [22:17] isaacs: { version: '0.0.1' [22:17] isaacs: , Server: { [Function] super_: { [Function] super_: [Object] } } [22:17] isaacs: , createServer: [Function] [22:17] isaacs: } [22:17] isaacs: w00t!! [22:17] tjholowaychuk: party time [22:17] isaacs: fr srs [22:17] tjholowaychuk: new repl is fucken sexy [22:23] Tim_Smart: Does the crypto bindings do its stuff in threads, or does it run in the same stack as the event loop? [22:24] k23z__: hello ? [22:25] Tim_Smart: k23z__: Hi. [22:26] micheil: Tim_Smart: I think it's the same event loop, but I could be wrop. [22:26] pquerna: Tim_Smart: its currently inline, but ryan was talking about doing SSL in a seperate thread last week [22:26] micheil: *wrong [22:26] pquerna: it is mostly that it might end up being pretty slow and moderately difficult for some things [22:26] pquerna: running a few aes cycles vs a context switch [22:27] Tim_Smart: pquerna: micheil: Cheers. Was just thinking that if you were to do a lot of crypto calls it might start affecting the ability to serve requests [22:27] k23z__: hi Tim [22:28] micheil: Tim_Smart: so far I haven't noticed this, but I'm only use crypto md5 [22:28] fizx has joined the channel [22:28] k23z__: Tim_Smart: you could hook up the crypto calls inside a custom build of v8 and then you can recompile node.js with that [22:28] k23z__: Tim_Smart: what I mean is, you can make it faster by making them part of JS itself [22:29] Tim_Smart: Yeah. For things like oauth though... [22:29] k23z__: like built-in functions [22:29] k23z__: hmm, never dealt with oauth [22:29] k23z__: is oauth hard to set-up/understand ? [22:29] Tim_Smart: I guess you could fork off a child_process and delegate [22:29] pquerna: well, there are native cyrpto functions [22:29] pquerna: for all of the methods you need in oauth [22:30] pquerna: (rsa, hmac, shas) [22:30] pquerna: only one that I'd be scared of running inline is rsa [22:30] mape: isaacs: Any reason npm list shows all versions of a package? [22:31] _announcer: Twitter: "Node.js has to be one of the open source projects with more explosive growth in the last few years. http://wiki.github.com/ry/node/modules" -- Guillermo Rauch. http://twitter.com/rauchg/status/16180668847 [22:31] isaacs: mape: because that was easier to build and get working quickly. at the time there were like 10 things on there, so it wasn't a big deal :) [22:31] isaacs: mape: bradleymeck is reworking that a bit [22:31] mape: Ah k [22:31] isaacs: mape: (i think?) [22:31] Tim_Smart: pquerna: Yeah I'm not too concerned, except with things like RSA or maybe hmac [22:31] pquerna: nah, hmac is fine [22:31] mape: Any plants on a update-all command? [22:31] isaacs: mape: coordinate with him if you'd like to rejigger it somehow [22:31] mape: *pans [22:31] bradleymeck: mmm? [22:31] mape: ...*plans [22:32] isaacs: mape: first step is an "update" command. update-all would loop through installed packages updating. [22:32] pquerna: Tim_Smart: hmac is just 2 hash function calls, its really not that bad [22:32] pquerna: rsa generation though... [22:32] isaacs: mape: check out http://github.com/isaacs/npm/issues [22:32] micheil: isaacs: any thoughts on gemcutter? [22:32] rnewson has joined the channel [22:33] mape: isaacs: Ah yeah [22:33] mfeiri has left the channel [22:33] pquerna: Tim_Smart: there are things you could do though -- webworkers for example [22:33] pquerna: Tim_Smart: and i'd be up for doing rsa in a thread anyways [22:34] Tim_Smart: Yeah. Webworkers have landed have they? [22:34] tjholowaychuk: ACTION does not like where the + key is on the new macbook [22:34] Tim_Smart: Old Macbook Pro's ftw [22:35] twomashi has joined the channel [22:35] k23z__: I did exports.server = http.createServer... and then I tried from another module(which loads the previous one with require) to sys.inspect(server); and it turns out it's {server: undefined}; <-- WHY ? and how can I fix that ? [22:35] twomashi has left the channel [22:35] micheil: k23z__: we'd need full code to help [22:35] isaacs: micheil: so, something rubygems.org-like would be neat. but there are bigger rocks to crack first. [22:35] micheil: isaacs: that's pretty much where I can see npm going on the web [22:36] micheil: on the client side, my biggest request has to be an `npm search keyword` [22:36] isaacs: micheil: that's what bradleymeck is working on. [22:36] isaacs: micheil: for now, "npm ls keyword" works pretty good [22:36] micheil: awesome! [22:37] isaacs: micheil: adding author, description, keywords, etc. though is better [22:37] Tim_Smart: isaacs: You are using couch as the backend right? [22:37] isaacs: Tim_Smart: for now, yeah [22:37] Tim_Smart: isaacs: Have you played with couch-lucene yet? [22:37] isaacs: Tim_Smart: some time this summer, i plan to abandon it in part or total. [22:37] JimBastard has joined the channel [22:37] micheil: ohh? [22:37] micheil: isaacs: which db would you go to? [22:38] k23z__: micheil: fixed [22:38] isaacs: micheil: yeah. npm has all that info locally, and should just be its own host [22:38] isaacs: micheil: npm [22:38] isaacs: so, it won't have any clever searching, but meh. [22:38] derbumi has joined the channel [22:38] isaacs: it's hardly any text data anyhow [22:38] micheil: isaacs: I'd still like to see a version hooked up permanently to a web store [22:39] isaacs: micheil: right, there'll be an "authoritative" version running on npmjs.org [22:39] isaacs: where the couchapp is now [22:39] micheil: k [22:40] k23z__: how do I initialize a 2D array in JS with some strings for each position ? [22:40] micheil: you could almost make an npm repo similar to a git repo, so you can have a .npm directory with config & stuff [22:41] isaacs: micheil: sort of, yeah [22:41] JimBastard: k23z__: JSON man [22:41] micheil: k23z__: as in myarr["test"], that's done using objects. [22:41] isaacs: micheil: that's kind of how it already works, with the .npm folder in your .node_libraries [22:41] JimBastard: k23z__: go luck up basic javascript stuff man [22:41] micheil: so, myarr = {"test": value} [22:41] JimBastard: JSON [22:41] isaacs: micheil: then there are symlinks that dive into the .npm folder [22:41] micheil: isaacs: yeah, to extend on that, you could add in hooks [22:41] isaacs: micheil: and a .npm/.cache with package.tgz and package.json files for each thing it has info about [22:41] k23z__: JimBastard: sorry, you're right, I should've thought about JSON [22:42] k23z__: so I do array2D = JSON.parse("....") ? [22:42] JimBastard: dude [22:42] JimBastard: JSON [22:42] JimBastard: RTFM [22:42] micheil: k23z__: no. [22:42] JimBastard: YOU GO READ NOW [22:42] JimBastard: var fuuu = []; [22:42] isaacs: micheil: please send all brilliant ideas to npm-@googlegroups.com [22:42] JimBastard: fuu.push('uuuu'); [22:42] JimBastard: fuu.push('uuuuuuuuu'); [22:42] micheil: isaacs: so it's a good idea? [22:42] JimBastard: fuu.push('uuuuuuuuuuuuuuuuuuu'); [22:42] isaacs: micheil: it's an idea. not sure, maybe good, maybe horrible. who knows? [22:42] micheil: JimBastard: that only allows finding by index [22:43] JimBastard: var fuu = {"fuck":"uuuuu"} [22:43] Tim_Smart: JimBastard: Fuu and your spam [22:43] ryah: isaacs: i'm having trouble upgrading npm [22:43] ryah: tar: Truncated tar archive: Inappropriate file type or format [22:43] ryah: tar: Error exit delayed from previous errors. [22:43] ryah: ? [22:43] isaacs: ryah: that's weird [22:43] k23z__: JimBastard: what you wrote is an associative array [22:43] k23z__: JimBastard: I need a 2D array [22:43] isaacs: ryah: try downloading the code from the git repo, and doing "make" [22:43] JimBastard: k23z__: var fu = []; fu[0] = 'fuck you'; [22:44] JimBastard: fu[1] = "just kidding you are alright" [22:44] micheil: 'isaacs sent./ [22:44] ryah: isaacs: that works [22:44] ryah: isaacs: so am i upgraded now? [22:44] k23z__: and fu[2] = "fuck you too Jim Bean" ? [22:45] isaacs: ryah: npm ls npm @active [22:45] isaacs: ryah: what's that say? [22:45] ryah: ryan@mac:~/src/npm% npm ls npm @active [22:45] ryah: npm configfile /Users/ryan/.npmrc [22:45] ryah: npm sudo false [22:45] ryah: npm cli [ 'ls', 'npm', '@active' ] [22:45] ryah: npm version 0.1.16 [22:45] ryah: npm GET / [22:45] ryah: npm@0.1.16 @active @installed @remote @stable @tag=latest @tag=stable [22:45] ryah: r [22:45] isaacs: w00t. [22:45] isaacs: it worked [22:46] micheil: --out. [22:48] [[zz]] has joined the channel [22:51] k23z__: can I keep you guys updated on my progress with writing a chess game server in Node.js ? [22:53] bradleymeck: of course [22:53] JimBastard: i should be nicer to this guy, my family surname comes from milan [22:53] JimBastard: well, one of them [22:53] k23z__: JimBastard: what guy ? [22:53] JimBastard: aight time to go drink [22:54] isaacs: didn't realize "bastard" was an italian name... [22:54] k23z__: J&B [22:56] jashkenas has joined the channel [23:01] saikat: tjholowaychuk: in expresso, is there a way to check, once a test and all its asynchronous callbacks have finished, that all my callbacks were actually called (basically, can i pass the test itself a callback to get called once a test is done? [23:01] tjholowaychuk: saikat: I use process.addListener('exit' [23:01] tjholowaychuk: would be nice to have a shortcut for that tho [23:02] saikat: yeah, but that should work for me - thanks [23:02] isaacs: saikat: check out the tests in node's test folder. [23:02] isaacs: saikat: a lot of them use the addListener("exit" approach [23:03] k23z__: how do I exit from a Node.js script ? [23:03] k23z__: exit(0) [23:03] k23z__: ? [23:03] k23z__: sys.exit ? [23:03] k23z__: or ... ? [23:03] jashkenas: process.exit [23:03] k23z__: great [23:03] Tim_Smart: k23z__: All the generic environment methods and variables are attached to process [23:05] Tim_Smart: isaacs: What is the process for making a module npm friendly? [23:06] isaacs: Tim_Smart: provide a package.json file in the root that has the info relevant to installing that package. [23:06] isaacs: Tim_Smart: npm help json [23:06] isaacs: Tim_Smart: and also check out the Packages/1.1 spec on the commonjs wiki [23:06] Tim_Smart: OK cheers [23:07] mattly has joined the channel [23:07] isaacs: Tim_Smart: the most important bit is generally: name, version, "directories" : { "lib" : "./lib/or/whatever" }, and main [23:07] isaacs: main is a module reference [23:07] isaacs: like "main" : "./lib/foo" [23:07] isaacs: whatever you want require("foo") to do [23:07] Tim_Smart: isaacs: I'll try it with http://github.com/Tim-Smart/node-asset [23:07] Tim_Smart: will give dependency support a good test [23:11] isaacs: yikes [23:11] isaacs: yeah it will [23:11] isaacs: Tim_Smart: so, you expect that compress will be available as require("node-compress") or require("compress")? [23:12] isaacs: Tim_Smart: oh, yeah, hrm. a bunch of those deps don't have package.jsons in them [23:12] Tim_Smart: Yeah, a fork + patch will be needed [23:12] saikat: tjholowaychuk: i added a listener to my .test.js file and running it with node fires my listener's callback, but not when i run the .test.js script using expresso - i see that you force a call to process.reallyExit in the expresso bin [23:12] isaacs: suresure [23:12] saikat: so that means if your event fires before mine [23:12] saikat: won't it cause my event never to fire? [23:12] isaacs: Tim_Smart: note, you don't have to publish in order to install. [23:12] isaacs: Tim_Smart: just npm install . or npm link . will put it there. [23:12] isaacs: Tim_Smart: but please don't publish something on the registry if its dependencies aren't there first. [23:13] tjholowaychuk: saikat: shit, right. thats a bug. I needed to reallyExit() to alter the exit status [23:13] isaacs: i mean, nothing stopping you, but it's kinda sloppy sloop that way [23:13] Tim_Smart: isaacs: Yeah, I'll get the dependencies sorted before publishing node-asset [23:13] isaacs: kewl [23:13] isaacs: in the future, that won't be possible. [23:13] isaacs: i mean, publishing if the deps aren't published there. [23:13] softdrink has joined the channel [23:14] Tim_Smart: Makes sense. [23:14] isaacs: i've got a big architectural sketch in the works that should make it nearly impossible for installs to fail in all but the most abnormal cases. [23:14] isaacs: failing silently due to human error means that your package manager isn't doing its job. [23:16] saikat: yeah i see - not sure how you would fix that without a state check in your exit event listener i guess - check if it's been called already, and if not, change the exit code and just call process.exit again with the changed status code? [23:18] _announcer: Twitter: "Just noticed that YUI Theater put up an Intro to NodeJS video a few weeks ago. http://yhoo.it/crPAnd" -- Rob Flaherty. http://twitter.com/ravelrumba/status/16183372392 [23:18] jashkenas: saikat: can't you check for the expected condition, as part of your last callback being fired? [23:18] _announcer: Twitter: "Just got rdflib (tabulator js rdf parser) working on node.js #v8 server side :) - it's damn quick" -- nathan. http://twitter.com/webr3/status/16183382161 [23:19] softdrink: i need a good diagramming app [23:19] saikat: jashkenas: yeah, but that's not quite as fail-proof [23:19] jashkenas: why not? [23:19] saikat: because it's relying on the code that i'm testing to call my callback properly [23:19] saikat: if i break that code somehow, assertions i make in my final callback might never happen [23:19] saikat: and now my tests all pass even though my code is broken [23:19] jashkenas: I see... that's a conundrum. [23:20] saikat: well the thing with process.exit seems like a good way to fix this conundrum [23:20] saikat: er, the thing with listening to exit [23:20] isaacs: saikat: yeah, process.exit [23:20] isaacs: that's the way to go [23:20] isaacs: saikat: and have only one set of tests per file. [23:20] saikat: well [23:20] saikat: don't necessarily have to [23:21] isaacs: saikat: then do something like for i in test/*.js; do node $i; done [23:21] saikat: i can set a bunch of variables to make sure my callbacks are fired [23:21] saikat: and in process.exit, test all of them [23:21] isaacs: exactly [23:21] isaacs: and then just assert that they're all set proper [23:21] saikat: right [23:21] saikat: but i do like expresso [23:21] tjholowaychuk: we can fix that [23:21] saikat: so want to get this working in the expresso context [23:21] tjholowaychuk: no worries [23:21] saikat: not worried, i trust you =) [23:22] tjholowaychuk: its nice running all in one process so that you can report coverage n shit as well, but iterating the files works fine too [23:22] saikat: yeah [23:22] tjholowaychuk: i think i ran into that problem the other day too, ill look into it asap [23:22] saikat: i like the coverage stuff in expresso, and also just the syntax [23:22] saikat: helps me remember what each test was when i look at the file again [23:22] tjholowaychuk: the runner is handy too, will be better when i get watcher support as well [23:30] _announcer: Twitter: "interesting - following @web3r toying with node.js here: http://webr3.org/blog/experiments/server-side-js-with-v8/" -- temojin. http://twitter.com/temojin/status/16184069450 [23:34] isaacs: w00t, qunit has a package.json [23:34] isaacs: it's got a bit of tuskisms in it, but still, neat [23:36] _announcer: Twitter: "@tswicegood if you specify an encoding, e.g. utf-8, you'll get a string. #nodejs" -- Marco Rogers. http://twitter.com/polotek/status/16184404577 [23:36] hassox has joined the channel [23:37] kevm has joined the channel [23:37] mrjjwright_ has joined the channel [23:41] zaach has joined the channel [23:43] kersny has joined the channel [23:46] k23z__: how do I export a function from a module ? [23:46] k23z__: exports.stuff = fun_name; ? [23:46] tjholowaychuk: ya [23:46] tjholowaychuk: you got it [23:48] k23z__: and then I need to use module.stuff right ? [23:48] k23z__: why can't I just use stuff ? [23:48] tjholowaychuk: then you require('foo').bar() [23:49] jashkenas: var stuff = exports.stuff = function(){ ... }; [23:49] tjholowaychuk: you could do "var foo = exports.foo = function(){} [23:49] tjholowaychuk: " [23:49] jashkenas: jinx [23:49] tjholowaychuk: and then use foo() throughout your file [23:49] tjholowaychuk: hahah [23:51] isaacs: k23z__: you can also do: exports = module.exports = thing [23:51] isaacs: k23z__: then you'll just export the thing, whatever it is [23:51] isaacs: k23z__: this is handy when it makes sense for a module to export a single function/class/whatever [23:52] k23z__: isaacs: if I want to export like EVERYTHING ? [23:52] jlilly has joined the channel [23:52] isaacs: k23z__: then just do exports.foo instead of var foo [23:52] isaacs: EVERYWHERE!! [23:52] isaacs: k23z__: you could also shorten it if you want with a local alias, like: var e = exports; e.foo = thing [23:53] jashkenas: Or you can make everything into an object literal, and assign that to module.exports. [23:54] isaacs: with javascript, your own limitation is your own imagination! [23:55] tjholowaychuk: well said lol [23:57] cloudhead: module.exports = {foo:1} [23:57] mqt has joined the channel [23:57] isaacs: unless you imagine python... or function blocks... or lexical scoping... [23:58] isaacs: though coffeescript does show how easy it is to escape to a language you like. [23:59] jashkenas: isaacs: agreed. with a little elbow grease, I'm not sure what you *can't* do in JavaScript.