[00:00] Tim_Smart: Then we could go: MyStream.prototype = Object.create(process.Stream.prototype) or something. [00:00] halfhalo: Node needs a retard friendly file transfer thing over tcp and or udp [00:02] mjr_: Why does everything use sys.inherits() when there is Object.create()? [00:03] polotek: mjr_: sys.inherit uses Object.create, plus a few other nice things [00:03] polotek: http://github.com/ry/node/blob/master/lib/sys.js#L386 [00:04] c4milo has joined the channel [00:04] mjr_: polotek: what are the other nice things? [00:04] zk has joined the channel [00:04] polotek: super_ which gives you local access to the inherited constructor methods. not usually necessary, but sometimes it is [00:05] polotek: plus it adds the constructor property to the inherited property type and sets it as nonenumerable [00:05] dilvie: polotek: That's a neat feature. [00:05] boaz_ has joined the channel [00:05] jakehow has joined the channel [00:07] techwraith: Anyone know of a cool function (with a dictionary already built in) that can replace special characters? Some of our routes use user generated input and we need to "slugify" them - any suggestions? [00:07] tjholowaychuk: techwraith: just str.replace() em [00:08] tjholowaychuk: with whatever you consider valid [00:08] EyePulp has joined the channel [00:08] tjholowaychuk: which I guess depends what it is [00:08] mikeal: Tim_Smart: did you see the filter API? [00:08] bpot has joined the channel [00:08] Tim_Smart: mikeal: I have not. [00:08] mikeal: var f = createFilter(function (chunk, write) { } ) [00:08] mikeal: write is a funciton [00:08] mikeal: chunk is null for the end event [00:09] techwraith: tjholowaychuk: That part is easy, I guess i was asking more if anyone knows of a good dictionary to use for the replacements [00:09] mikeal: createFilter returns a valid stream [00:09] techwraith: We just got a few russian users and their entire alphabet needs to be replaced... [00:09] tjholowaychuk: techwraith: whitelist instead [00:10] tjholowaychuk: techwraith: str.replace(/[^\d\w]/g, '') [00:10] dnolen has joined the channel [00:10] tjholowaychuk: that kind of idea [00:10] techwraith: tjholowaychuk: Whitelist won't work if the input is ONLY special characters [00:10] tjholowaychuk: techwraith: you could still check string length after [00:12] techwraith: tjholowaychuk: I suppose that would work, not the most user friendly solution. But probably the easiest to implement [00:12] polotek: mikeal: have you used createFilter for anything significant? [00:12] mikeal: has the term websocket been totally co-opted now as socket.io ? [00:13] mikeal: if so, that's kinda awesome [00:13] ehaas has joined the channel [00:13] halfhalo: Store it as binary [00:13] halfhalo: :p [00:13] mikeal: polotek: no cause it's not in yet :) [00:14] mikeal: it's actually suppose to be used for simple things [00:14] dpritchett: mikeal, are you here to answer my goofy socket.io question? [00:14] polotek: mikeal: yeah but I figured you had it in your utils [00:14] mikeal: more complex stuff will want to do a full Stream [00:14] mikeal: it actually might be [00:14] polotek: I would use it in a few places in my twitter lib [00:14] mikeal: dpritchett: nope, haven't used it before :) [00:14] dpritchett: dang [00:14] dpritchett: i want to write a socket.io client app using node [00:14] aconbere has joined the channel [00:14] dpritchett: rather than a browser [00:15] mikeal: but, this does remind me [00:15] dpritchett: cant find a good resource yet [00:15] charlenopires_ has joined the channel [00:15] mikeal: i have a hilarious picture of Guillermo [00:15] mikeal: i spelled that wrong [00:15] mikeal: but it's funny [00:15] mikeal: it was in Berlin [00:15] polotek: dpritchett: what are you having trouble with? [00:15] mikeal: he fell asleep while we were eating dinner with his hands under his chin at the table [00:15] dpritchett: polotek: just don't know where to get started [00:16] dpritchett: i have a dead simple chatroom set up using socket.io and json transports back and forth from clients to the server which just rebroadcasts the json [00:16] xla has joined the channel [00:16] dpritchett: i want to build a chatbot that connects as a client to the server [00:16] dpritchett: rather than running as a component module of the chat server [00:16] dpritchett: can't really figure out where to get started with that using the socket.io libs i have on hand] [00:17] polotek: dpritchett: so use http.Client to send requests to your other running server [00:17] polotek: oh you're saying you want to get the socket.io client running from within node? [00:17] dpritchett: yeah [00:17] polotek: that I don't know about [00:17] dpritchett: a headless browser that receives chat output line by line from the client just like a browser would [00:17] polotek: I'm sure the client is attached to the browser environment (like most things) [00:18] dpritchett: and then parses it and responds just like a human could [00:18] polotek: you could try shivving it into jsdom running in node [00:18] dpritchett: yeah im trawling the jsdom docs now [00:18] dpritchett: not feeling super optimistic yet though ;) [00:22] dpritchett: varbbl [00:23] softdrink has joined the channel [00:26] mikeal: here we go [00:26] mikeal: http://picasaweb.google.com/mikeal.rogers/20100920#5524351667958476050 [00:26] voodootikigod has joined the channel [00:36] gf3 has joined the channel [00:39] c4milo has joined the channel [00:42] nroot7 has joined the channel [00:45] evanpro has joined the channel [00:47] sprout has joined the channel [00:48] deepthawtz has joined the channel [00:49] steadicat has joined the channel [00:49] rcy has joined the channel [00:52] nroot7_ has joined the channel [00:53] nroot7_ has left the channel [00:55] nroot7 has joined the channel [00:55] nornagon has left the channel [00:56] jchris has joined the channel [00:57] threeve has joined the channel [00:58] sonnym: dpritchett: just looking at what you were talking about earlier. . . look into node-websocket-client. socket.io uses it to test stuff, and I've been using it for the same purpose (making test clients). http://github.com/pgriess/node-websocket-client [00:59] osteele has joined the channel [01:00] scnd has joined the channel [01:00] Yuffster has joined the channel [01:01] dpritchett: thanks sonnym [01:03] sonnym: no problem. [01:07] bpot has joined the channel [01:09] c4milo has joined the channel [01:10] kriskowal_ has joined the channel [01:10] polotek has left the channel [01:10] steadicat has joined the channel [01:10] hzin has joined the channel [01:11] kriskowal__ has joined the channel [01:11] danielzilla has joined the channel [01:12] MikhX has joined the channel [01:15] JimBastard_ has joined the channel [01:17] matt_c_ has joined the channel [01:18] gerred has joined the channel [01:20] hsuh has joined the channel [01:26] bradleymeck has joined the channel [01:26] bradleymeck: isaacs did that kill it today? [01:26] isaacs: bradleymeck: no, but it made it trickier to prune out some invalid data that could have perhaps been contributing to it [01:26] bpot has joined the channel [01:27] isaacs: bradleymeck: so, somehow, the jsregistry database managed to work itself into a situation where it was creating a lot of extra work on the server, and lightening happened in the cloud [01:27] bradleymeck: O-o, ouch, wasnt thinking i guess when i published that, you going to slugify from now on? [01:27] isaacs: bradleymeck: i just renamed the package to JS-Entities, and put some stricter checking on the server for that and some other issues i found, and did a replicate-cleanup thing [01:28] isaacs: bradleymeck: well, i'm just gonna have npm complain about it [01:28] isaacs: slugifying is too magical [01:28] bradleymeck: i would expect a reject first, but yea [01:28] isaacs: i used to do that, and it led to a failure in my first ever npm demo :) [01:28] isaacs: because it was slugifying mjsunit.runner to mjsunit-runner [01:28] bradleymeck: hehe [01:29] bradleymeck: so just plain reject now? [01:29] banjiewen has joined the channel [01:31] isaacs: yeah [01:31] bradleymeck: as a side note, seems i am looking for work if anyone knows of a place hiring [01:31] isaacs: ohnoes? [01:32] bruse: if you want to move to sweden and work on a crappy web app for fitness tracking created on top of drupal i've got a job for you [01:32] bradleymeck: yea, one all nighter too many led to bleh [01:32] osteele has joined the channel [01:32] bradleymeck: lol i was hoping it to be node related being in here [01:33] bruse: i figured :) [01:33] isaacs: hm... seems like i broke the JS-Entities tarball. [01:33] bradleymeck: :D [01:33] isaacs: while you're here, care to republish? [01:33] bradleymeck: sure one sec [01:34] bradleymeck: overwrite or new version? [01:34] isaacs: go ahead and unpublish and then re-publish (after changing the name to JS-Entities, of course) [01:35] bradleymeck: sure thing [01:35] isaacs: npm unpublish JS-Entities ; npm publish [01:35] isaacs: that'll blow it all away and then publish the new version [01:35] creationix: JimBastard: synth fun http://creationix.com/synth/ [01:35] creationix: hook it to some real-time node server for acoustic fun [01:37] voodootikigod_ has joined the channel [01:38] bpot_ has joined the channel [01:38] isaacs: bradleymeck: it's train time, but i'll be on later, probably. if you have any issues, lmk then, or tell ircretary to tell me. [01:39] bradleymeck: isaacs http://gist.github.com/610810 [01:39] bradleymeck: sure [01:39] isaacs: bradleymeck: ha, you created it as yourself,not as the service [01:40] isaacs: just a sec... [01:40] bradleymeck: woah now im confused [01:40] isaacs: yeah... um... hm. [01:40] isaacs: also, i can't add you, becasue it keys off the email as well as the name. [01:40] isaacs: lolz [01:40] bradleymeck: XD [01:40] bradleymeck: nice thats interesting [01:40] bradleymeck: i can swap out to the other comp [01:40] bradleymeck: ill fix it in a sec [01:40] isaacs: i'd cp your .npmrc to .npmrc.service or something,a nd then npm adduser to auth as you [01:41] isaacs: i should let multiple users share an email address, though. [01:41] isaacs: that's a bug [01:41] dipser: can i broadcast to a list of clients with socket.io? [01:42] dipser: the list would be a clientID [01:42] a_meteorite has joined the channel [01:43] bradleymeck: an array of clients? arr.forEach(function(client){client.send(x)}) [01:44] dipser: will try that, could work [01:46] voodootikigod_ has joined the channel [01:47] ryah: so. i was thinking. [01:47] ryah: what if we dust off this patch: http://codereview.chromium.org/391068 [01:48] ryah: it's kind of ideal. [01:48] voodootikigod_ has left the channel [01:48] bradleymeck: generic blobs instead of buffers? [01:48] dguttman has joined the channel [01:48] ryah: that is: allocate buffers in the damn v8 heap [01:48] osteele has joined the channel [01:48] creationix: think that might help with buffer performance? [01:49] ryah: i know v8 doesn't want to expose use to the raw memory in there - but - fuck them [01:49] ryah: we can float it [01:49] bradleymeck: i think its legit as long as they are subject to gc and length checking [01:49] ryah: i think it will be pretty fast [01:49] bradleymeck: i mean ppl do crazy crap with strings already to emulate binary data [01:50] creationix: as long as v8 doesn't move it on you mid access or fragment it right? [01:50] langworthy has joined the channel [01:50] ryah: v8 is single threaded, so it won't [01:51] ryah: but you can't assume that object to be in the same place next time you ref it [01:51] pquerna: right [01:51] bradleymeck: well with handles we cant assume that right now anywho [01:51] creationix: right, so you can't fs.write a huge buffer unless it's all sendable at once [01:51] pquerna: and if you are doing out of main-thread IO [01:51] pquerna: you need to memcpy() [01:52] ryah: yeah... [01:53] ryah: which is annoying [01:53] Tim_Smart: Right, done my routine vim cleanup. [01:53] ryah: could get a lock on the vm [01:53] ryah: perhaps [01:53] creationix: so question, what does happen if I try to fs.write a 1mb buffer? Obviously the program isn't going to block. The event will continue running while the background thread flushes the buffer to disk? [01:54] gf3 has joined the channel [01:54] ryah: a lock on the gc that is [01:54] ryah: or just the compact phase [01:54] creationix: hmm, but when would you release it? [01:54] creationix: in an I/O heavy program [01:55] ryah: yeah - obviously it leads a bit to be desired... [01:55] dannycoates has joined the channel [01:55] Tim_Smart: sendfile <3 [01:56] creationix: is there something like sendfile for uploading files? [01:56] Tim_Smart: Not sure, don't think so. [01:56] Tim_Smart: Thought you were talking about sending to socket. [01:56] ryah: uploading files? [01:56] creationix: network to disk [01:56] creationix: reverse sendfile [01:56] ryah: no [01:56] creationix: still, sendfile is a nice shortcut [01:57] creationix: I think I'll start using that in connect as soon as I figure out how [01:57] Tim_Smart: Yeah, problem is, currently you can't send headers + small file in one packet. [01:58] creationix: so cache small files in in-memory buffers and stream large files via sendfile [01:58] Tim_Smart: And I think node hold's out on sending file headers straight away. [01:58] creationix: can sendfile send part of a file? (for range requests) [01:58] Tim_Smart: s/file/http [01:58] ryah: creationix: yes [01:59] Tim_Smart: creationix: Sure. I have some code you can look at (I implemented some middleware for biggie-router, should work with connect) [01:59] creationix: yeah, I really need to add sendfile support [01:59] creationix: Tim_Smart: can you link it again [01:59] Tim_Smart: I got benchmarks too :p [01:59] Tim_Smart: http://github.com/biggie/biggie-router/blob/master/lib/biggie-router/modules/sendfile.js [01:59] Tim_Smart: The interesting stuff is at the bottom. [02:00] creationix: wow, fs.sendfile is nice. How come it's not documented? [02:00] benv has joined the channel [02:01] ajpiano has joined the channel [02:01] Tim_Smart: creationix: To get headers before the file content, I had to: http://github.com/biggie/biggie-router/blob/master/lib/biggie-router/modules/sendfile.js#L68-69 [02:01] mjr_ has joined the channel [02:01] Tim_Smart: Which feels a bit hacky, I think pquerna was talking about CORK or something. [02:02] Tim_Smart: Maybe someone else. [02:02] Tim_Smart: But that is what apache does. [02:02] pydroid has joined the channel [02:02] creationix: what happens if you don't send the empty string? [02:02] Tim_Smart: Headers come after the file. [02:02] creationix: oh, is that to force node to flush the headers? [02:03] Tim_Smart: I think so. [02:03] creationix: I guess it's not a terrible hack then [02:03] creationix: maybe a flag on writeHead to flush from there would be better? [02:03] Tim_Smart: creationix: For some reason it make html5 players work weird though. [02:04] Tim_Smart: *makes [02:04] tmpvar has joined the channel [02:04] creationix: how so? [02:04] sstephenson has joined the channel [02:04] Tim_Smart: It just seems to choke a little before playing, which is eliminated when you use write stream. [02:05] ryah: we'll make this better soon, tim [02:06] Tim_Smart: Maybe I need to over-ride the chunked encoding or something, I'm all that familiar with the complexities of HTTP [02:06] Tim_Smart: *not all that [02:07] Tim_Smart: ryah: Yeah maybe we could do something similar to apache, whatever that CORK stuff is about... [02:07] voodootikigod_ has joined the channel [02:07] creationix: maybe sendfile doesn't stream? [02:08] Tim_Smart: creationix: It is all handled by the kernel... [02:08] creationix: right, so maybe it's not http chuncked encoding [02:08] creationix: since node can't see the data [02:08] Tim_Smart: I'll try that... [02:08] creationix: I guess stream isn't what I meant, I meant chunked [02:08] ryah: Tim_Smart: it seems sendfile needs to be handled in the stream and not be a separate thing [02:09] creationix: it would be neat if there was a way to detect that the source is a fd and the end is a socket [02:09] ryah: i heard you can even do non-blocking sendfile on freebsd [02:09] ryah: i wonder if that's true... [02:09] creationix: ohh, that would be nice [02:10] ryah: i think we're on the verge of rewriting lib/net.js back into c++ :) [02:10] creationix: ryah: Tim_Smart: either of you ever worked with gstreamer [02:10] Tim_Smart: creationix: Well the main thing is checking for EAGAIN http://github.com/biggie/biggie-router/blob/master/lib/biggie-router/modules/sendfile.js#L128-137 [02:10] Tim_Smart: creationix: A little. [02:10] creationix: it's basically just a series conected streams [02:10] codelotu1 has joined the channel [02:11] Tim_Smart: I have used it once or twice with rtmpdump to download ustream streams. [02:11] codelotu1 has left the channel [02:11] creationix: Tim_Smart: oh, so it does only accept so much at a time [02:11] creationix: interesting [02:11] Tim_Smart: creationix: Just like write() [02:12] codelotu1 has joined the channel [02:12] creationix: yeah, node just needs to be aware so it can inject chunked delimiters? [02:12] creationix: seems fs.sendfile bypasses all the .write stuff completely [02:13] Tim_Smart: Yes, that is correct. [02:13] jashkenas has joined the channel [02:13] creationix: interesting [02:13] Tim_Smart: maybe HttpServerResponse#sendfile? [02:13] creationix: ACTION will have to think some more [02:13] creationix: yeah, that would be nice [02:13] Tim_Smart: That would be cool. [02:13] Yuffster_work has joined the channel [02:13] ryah: Tim_Smart: nah, we should stick it on the actual tcp stream [02:13] nerdEd has joined the channel [02:13] Tim_Smart: ryah: Yeah true. [02:14] creationix: oh HttpServerResponse isn't the actual stream is it? [02:14] creationix: ryah: but the tcp stream doesn [02:14] Tim_Smart: ryah: So what is the spec for chunked encoding? [02:14] creationix: doesn't know about http chunked encoding [02:14] creationix: I'm no expert, but doesn't it need to insert delimiters [02:15] derferman has joined the channel [02:16] Tim_Smart: creationix: I think I showed you a simple benchmark using sendfile, but it is pretty awesome. [02:16] creationix: I'll bet [02:17] Tim_Smart: Ah, here it is. http://gist.github.com/570420 [02:17] voodootikigod_: ™™£ [02:20] stephenjudkins has joined the channel [02:20] creationix: voodootikigod:  [02:20] sh1mmer has joined the channel [02:20] creationix: Tim_Smart: yeah 300mb/s isn't bad for streaming [02:21] creationix: but nginx and apache can both do about 800 on my machine [02:21] q_no has joined the channel [02:21] creationix: I should run your bench on my machine too [02:21] voodootikigod_: creationix: what up [02:21] ryah: Tim_Smart: spec for chunked enocding? [02:21] ryah: Tim_Smart: rfc 2616 [02:21] creationix: voodootikigod_: you back in the US yet? [02:21] Tim_Smart: creationix: The first one is fs.readFile(), then sending the buffer with one write. [02:21] voodootikigod_: creationix: yea got home last week wednesday [02:22] voodootikigod_: creationix: you? [02:22] creationix: Tim_Smart: much better [02:22] Tim_Smart: creationix: streaming ones are the last two. [02:22] creationix: voodootikigod_: I got back last monday [02:22] voodootikigod_: creationix: did you have a good time? [02:22] ryah: Tim_Smart: here's the quick guide "LENGTH\r\nBODY\r\nLENGTH\r\nBODY\r\n...LENGTH\r\nBODY\r\n0\r\n\r\n" [02:22] creationix: creationix.com is a simple connect app with just static file serving [02:22] creationix: voodootikigod_: yep [02:22] ryah: where length is ascii hex encoded [02:23] creationix: ryah: so if I knew the length sendfile was about to send, I could do that externally? [02:23] Tim_Smart: ryah: How do I know how many bytes the kernel will write ahead of time? [02:23] ryah: Tim_Smart: you don't [02:23] creationix: I guess you can pick a size and keep sending till that many have sent [02:23] voodootikigod_: creationix: awesome, dude it was a blast - you dance like a crazy man [02:23] ryah: sendfile is only going to be useful for identity encoding [02:23] ryah: creationix: or that [02:24] ryah: usually if you're sending a file you'll know how much you want to send [02:24] ryah: so only doing identity isn't really a problem [02:24] jakehow has joined the channel [02:25] itissid: creationix: Hey this is another thing the relative links from the page at http://itissid.com:3000/ are not working... The routing seems a bit screwed up... [02:25] itissid: I dint notice before... [02:25] creationix: voodootikigod_: I did see this on the flight over to Europe http://en.wikipedia.org/wiki/StreetDance_3D [02:26] creationix: itissid: yeah, I saw that, not sure what's going on there [02:26] voodootikigod_: creationix: ahh so thats where you learned the moves [02:27] creationix: voodootikigod_: no, just got in the mood. I took dance classes my freshman year (10 years ago) [02:27] boaz_ has joined the channel [02:27] creationix: ryah: so if I pick a resonable chunk size then the clients can handle it better? [02:28] creationix: I'll just have to manually resend if my chunk size was too big [02:28] ryah: creationix: you shouldn't use chunked encoding unless you don't know the lenght [02:28] Tim_Smart: ryah: creationix: http://github.com/apache/httpd/blob/trunk/server/core_filters.c#L604 [02:28] bentruyman has joined the channel [02:28] Tim_Smart: That is what apache does. [02:28] creationix: does chunked encoding break if I saw "10" and then send two 5 length packets? [02:29] derferman has joined the channel [02:29] sh1mmer has joined the channel [02:29] voodootikigod_: creationix: nice [02:30] voodootikigod_: ok crashing, tag! [02:30] ryah: creationix: 10 = 16 [02:30] derferman has joined the channel [02:31] creationix: ryah: fine, assuming I send the length in the proper encoding, but then send the body as two more packets? is that bad [02:31] ryah: no - http is over tcp [02:31] Tim_Smart: So Apache sets NO_PUSH, which uses cork apparently, writes the headers, starts the sendfile, then unsets NO_PUSH, which un-CORKs [02:32] Tim_Smart: So you get the headers and file in one packet. [02:32] ryah: Tim_Smart: i think we can do that [02:33] creationix: nice, so super fast sendfile for small files [02:33] Tim_Smart: ryah: pquerna said he would give it a shot, but I haven't heard from him for some time. [02:33] ryah: Tim_Smart: i think it will be done as a larger effort of refactoring net.js [02:33] Tim_Smart: bravo! [02:33] Tim_Smart: :) [02:34] creationix: Tim_Smart: still, I wonder why the html5 players hate your code [02:34] creationix: are you saying chunked-encoding, but then sending identify and it's confused? [02:34] Tim_Smart: Well more 'dis-like' than 'hate' [02:34] codelotu1 has left the channel [02:35] creationix: or do they really need chunked encoding [02:35] Tim_Smart: It still works sorta [02:35] creationix: Tim_Smart: I assume you're not sending the Content-Length? [02:35] Tim_Smart: creationix: Well, I'm not using chunked at all, but I am sending content-length [02:35] creationix: hmm, so you're doing it right then [02:35] Tim_Smart: So I thought node picks that up? [02:35] creationix: and you support range and head? [02:35] Tim_Smart: Yeah. [02:36] creationix: need a better html5 player [02:36] creationix: ;) [02:36] Tim_Smart: creationix: Then why does write stream work properly? [02:37] Tim_Smart: creationix: http://github.com/biggie/biggie-router/blob/master/lib/biggie-router/utils.js#L18-37 [02:37] Tim_Smart: I think that is right... [02:38] creationix: hmm, so you're setting Content-Length and using node streams? [02:38] kgf: your README.md has a typo. "Sinitra" [02:39] Tim_Smart: Thanks. [02:39] Tim_Smart: creationix: http://github.com/biggie/biggie-router/blob/master/lib/biggie-router/modules/sendfile.js#L60-66 [02:39] MikhX_ has joined the channel [02:40] noahcampbell has joined the channel [02:41] ajpiano has joined the channel [02:41] SvenDowideit has joined the channel [02:42] mr_daniel has joined the channel [02:43] WALoeIII has joined the channel [02:43] dnolen has joined the channel [02:43] deepthawtz has joined the channel [02:49] stephenjudkins has joined the channel [02:54] nerdEd has joined the channel [02:55] ezmobius has joined the channel [03:01] dipser_ has joined the channel [03:02] ginader has joined the channel [03:04] eisd has joined the channel [03:13] auser has joined the channel [03:13] auser: hola [03:14] steadicat has joined the channel [03:17] ezmobius_ has joined the channel [03:21] bpot has joined the channel [03:23] zpoley has joined the channel [03:35] mikelsi_ has joined the channel [03:37] smtlaissezfaire_ has joined the channel [03:38] tmpvar has joined the channel [03:38] ezmobius has joined the channel [03:40] ezmobius has joined the channel [03:45] ginader1 has joined the channel [03:46] ezmobius has joined the channel [03:47] ezmobius has joined the channel [03:48] ncb000gt has joined the channel [03:48] jedschmidt has joined the channel [03:50] jedschmidt: is anyone here getting this error trying to install node on OS X? [03:50] jedschmidt: http://gist.github.com/610956 /cc ryah [03:51] WALoeIII has joined the channel [03:54] creationix: jedschmidt: I compiles v0.2.3 and HEAD earlier today without issue [03:54] creationix: *compiled [03:55] jedschmidt: creationix: odd... maybe it's a 10.5 thing? [03:55] creationix: possibly, did you make distclean [03:56] jedschmidt: i did 'make clean' [03:56] charly1 has joined the channel [03:57] creationix: for ultimate clean, rm -rf the folder and re-clone ;) [03:58] jedschmidt: creationix: heh, sounds like a feminine hygiene commercial. [03:58] jedschmidt: i'll head somewhere to plug in and try again. [03:58] jedschmidt: thanks! [03:58] creationix: sure thing [03:59] cloudhead has joined the channel [03:59] ctp_ has joined the channel [04:00] mape has joined the channel [04:05] ezmobius has joined the channel [04:07] sh1mmer has joined the channel [04:08] ezmobius has joined the channel [04:10] unomi: kriszyp: you in? [04:11] kriszyp: yes [04:11] unomi: sorted it out [04:11] kriszyp: ok [04:11] unomi: just a bit of momentary confusion re how to install http://github.com/kriszyp/persevere-example-wiki [04:12] benburkert has joined the channel [04:12] ginader has joined the channel [04:12] unomi: nodules is happily downloading away [04:16] Me1000 has joined the channel [04:20] tpryme has joined the channel [04:20] stephenjudkins has joined the channel [04:23] pufuwozu has joined the channel [04:24] ryah: dang, jed left... [04:27] softdrink: hrm. previous employer got acquired. [04:28] softdrink: not sure how i feel about that [04:28] JimBastard_: did you quit or get fired [04:28] softdrink: a bunch of us got laid off a few months ago [04:28] JimBastard_: lol [04:28] JimBastard_: im sure you did a great job [04:29] charly1: ibm? :-P [04:29] JimBastard_: thats why they fired everyone and got aquired [04:29] softdrink: http://www.marketwatch.com/story/neutron-interactive-acquires-enticelabs-2010-10-04?reflink=MW_news_stmp [04:29] JimBastard_: you arent a stock holder i take it [04:29] charly1: huh [04:29] softdrink: was :P [04:30] softdrink: oh well. new employer pays my bills and has good benefits *shrug* [04:30] JimBastard_: im self unemployeed [04:30] siculars has joined the channel [04:30] softdrink: now to create a parallel universe in which i have the time to sit down and write the app(s) i want, then merge with this universe and make gobs of dollars. [04:33] jashkenas: JimBastard: what happened to your last job? [04:33] JimBastard_: jashkenas: im full time at nodejitsu now [04:34] JimBastard_: also, the general scheme of things changed over there. i wasnt exactly trying to pair program ruby everyday [04:34] JimBastard_: still was a great job though [04:34] ginader1 has joined the channel [04:35] stephenjudkins has joined the channel [04:36] hober has joined the channel [04:39] AAA_awright has joined the channel [04:43] temp01 has joined the channel [04:43] crodas has joined the channel [04:44] tpryme: Anyone here using any of the postgres clients in production with node? [04:47] dilvie: tpryme: I'm no help, sorry. I recently decided to go with CouchDB for my current project. =) [04:47] dilvie: thinking of trying Redis for my game project. =) [04:48] overra has joined the channel [04:50] mattly has joined the channel [04:54] jedschmidt has joined the channel [04:57] jedschmidt: ryah: downloaded libeio from CVS, ./configure'd again, and sent you the config.h. let me know if you need anything else, jah? [05:02] bratish has joined the channel [05:04] bratish: Hey, how can I read last line or last few lines from a large file in node.js programmatically? [05:04] bratish: any ideas other than using tail command [05:05] crodas: hi there [05:05] crodas: I'm having a little issue [05:05] crodas: fs.writeFile('/tmp/foo', '', function() {}); [05:05] crodas: the function is never called back because I'm trying to create an empty file [05:06] crodas: is there anyway to fix it? (or another way to create an empty file?) [05:16] mikeal has joined the channel [05:25] jchris has joined the channel [05:30] sonnym: crodas: if you're sure it's because the file does not exist, you could always require("child_process").spawn("touch", ["/tmp/foo"]); [05:31] nroot7 has joined the channel [05:31] crodas: sonnym: thanks :-) [05:31] crodas: sonnym: I'm pretty sure it is falling because I want to put an empty content (if I put something, even ' ' it works fine) [05:32] benv has joined the channel [05:33] sonnym: crodas: makes sense then. could be a bug. . . I really don't have a clue what the expected behavior is ;) [05:33] ph^ has joined the channel [05:34] crodas: sonnym: me neither, that's why I'm asking [05:34] crodas: sonnym: thanks for the help [05:34] nbollom has joined the channel [05:35] sonnym: crodas: no problem. happy noding [05:36] crodas: sonnym: nodejs rules btw! :-) [05:37] devkorcvince has joined the channel [05:39] tav has joined the channel [05:42] unomi has joined the channel [05:43] tav has joined the channel [05:44] JimBastard_: thats odd i just created a couch and nothing happened [05:44] bratish: any idea for my question guys? [05:45] techwraith has joined the channel [05:45] techwraith: Anyone want to help out with a quick haml-js issue? [05:47] mape: techwraith: Probly better off if you just ask [05:47] techwraith: Mape: k [05:48] techwraith: How do I unescape text? Basically need this: "]]>" output exactly as is [05:48] sonnym: bratish: from the 0.2.0 docs: An example to read the last 10 bytes of a file which is 100 bytes long: fs.createReadStream('sample.txt', {start: 90, end: 99}); [05:48] benburkert has joined the channel [05:49] sonnym: bratish: so you could us fs.stat to grab the size, then grab the last n bytes pretty simply [05:50] sonnym: techwraith: if it's the same syntax as rails haml you need != [05:50] techwraith: sonnym: Thanks! [05:50] JimBastard_: where did maushu go [05:50] JimBastard_: wth [05:50] path[l] has joined the channel [05:51] sonnym: techwraith: http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#unescaping_html but I think the last time I checked the haml-js syntax was incomplete. dunno. [05:51] techwraith: sonnym: Yeah, that's why I thought I'd as (really wish I could switch over to a better template lang) [05:52] jchris has joined the channel [05:52] JimBastard_: hey creationix , is there a LIC for http://github.com/creationix/wheat ? [05:53] creationix: License? [05:53] JimBastard_: aye [05:53] creationix: should be MIT [05:53] creationix: does it not say [05:53] JimBastard_: i dont think there is one in the repo [05:53] JimBastard_: wheat has been working out really well over here, id like to re use it i think [05:54] creationix: done [05:54] creationix: http://github.com/creationix/wheat/commit/cb36f6fdf98c140afe848bb68fd0e1f081fdad23 [05:55] JimBastard_: awesome thanks creationix [05:55] sonnym: techwraith: I haven't really looked at the options for templating. the project I'm working on only has one html file and does everything else with js :) [05:56] hannesw_ has joined the channel [05:56] techwraith: sonnym: I like ejs for it's simplicity, but it lacks a lot of helpers, mustache is looking pretty good though [05:58] nbollom has left the channel [06:01] ryah: jedschmidt: i don't know what's happening - configure shouldn't give you config.h related to WAF [06:01] jedschmidt: ryah: yeah, i dunno what's up. rm -rf and git clone for me now, will keep you posted. [06:01] micheil has joined the channel [06:02] jedschmidt: ryah: i must be doing something wrong, don't want to bother you too much. [06:04] ryah: okay [06:04] ryah: let me know what happens... [06:05] dannycoates has left the channel [06:05] bratish: sonnym: thanks... i'll give it a try [06:07] sonnym: bratish: no problem [06:08] jedschmidt: ryah: perhaps i was sending you the wrong config.h... which one do you need? [06:09] jedschmidt: is it /build/debug or /build/default? [06:13] kojul has joined the channel [06:14] sonnym: anyone have any experience with node-websocket-client and socket.io? seems like the client interface times out after ~18 seconds consistently, but when I try in chromium, websockets persist just fine. . . [06:15] ryah: jedschmidt: i need the one that libeio generates.. [06:16] jedschmidt: ryah: http://gist.github.com/611104 [06:18] micheil: sonnym: hmm.. [06:18] gf3 has joined the channel [06:18] micheil: sonnym: are you sure it's timing out and not being closed? [06:18] ryah: jedschmidt: thanks [06:18] qFox has joined the channel [06:18] jedschmidt: ryah: np, sorry for misunderstanding. [06:19] ryah: jedschmidt: old macintosh? [06:19] sonnym: micheil: I'm getting a "Client n disconnected" message in my logs which is being generated by socket.io [06:19] micheil: hm.. [06:19] jedschmidt: ryah: OS 10.5.8 [06:19] sonnym: I'm assuming it's a problem on the client side since chromium keeps the sockets open, but that may not be entirely sound [06:19] antares_ has joined the channel [06:19] ryah: i guess they added fdatasync in 10.6 [06:20] jedschmidt: d'oh. i guess i should finally upgrade? [06:20] ryah: nah, we should just not break on missing fdatasync :) [06:21] micheil: sonnym: do a log of what is being recv'd by node-websocket-client [06:21] micheil: sonnym: my bet is that your not replying to the heartbeart messages, which in turn tells socket.io the connection is dead, closing it 8000 milliseconds after the first heartbeart is sent [06:22] micheil: (the first heartbeat is sent at 10,000 milliseconds) [06:22] sonnym: bingo. thanks. [06:22] micheil: sonnym: may I ask why this combination? [06:22] sonnym: to fix it or to sleep, that is the question :) [06:22] micheil: sonnym: it's not terrible hard to fix: [06:22] sonnym: I'm trying to write a game that will scale pretty large. . . need test clients [06:23] micheil: onmessage = function(evt){ if(evt.data.substr(0,3) == "~h~") ... [06:23] ryah: jedschmidt: check that you can compile with this fix: [06:23] ryah: curl http://gist.github.com/raw/611110/a1a2e283528d45edbd4373d0ef51242f4cd7455d/gistfile1.txt | git am [06:23] ryah: then: [06:23] ryah: make [06:23] ryah: in the node folder [06:23] micheil: sonnym: the best way to get your test clients may be by having two or more servers talking [06:24] jedschmidt: ryah: "Patch does not have a valid e-mail address." [06:24] micheil: sonnym: you'll hit a file limit on just one system [06:24] micheil: (or that's what I've seen, it also becomes really hard to test.) [06:24] EyePulp has joined the channel [06:25] sonnym: yeah, I've seen the file limit get hit, but I really just need ~10 clients to see what's going on and make sure things are sane [06:25] micheil: ryah: do you think it'd be wise to implement websocket message parsing as a readable / writable stream? [06:25] ryah: jedschmidt: sorry. [06:25] micheil: sonnym: I can tell you that socket.io should be sane at ~10 clients. [06:25] ryah: curl http://gist.github.com/raw/611112/168a067e366ca4785df9bf44581e4a2a99db154c/0001-define-HAVE_FDATASYNC-0-for-darwin-10.5-is-missing-i.patch | git am [06:26] micheil: sonnym: as for your code, I couldn't know. [06:26] ryah: micheil: how do you mean? [06:26] ryah: oh, like have the same methods? [06:26] ryah: *shrug* [06:26] micheil: well currently the biggest bottleneck in node-websocket-server is the message parsing [06:26] ryah: it's not really a stream oriented protocol... [06:26] ryah: or the parsing [06:27] ryah: hm [06:27] ryah: that's your biggest bottleneck? [06:27] micheil: say I start sending messages that are either really large or just really fast in sequence, then the server gets clogged up [06:27] ryah: that sounds wrong [06:27] stephank has joined the channel [06:27] micheil: (it's my guessed bottleneck) [06:29] micheil: unless it's the writing to the logs that's bottlenecking. [06:29] micheil: but I'm just outputting messages to stdout [06:29] sonnym: micheil: thanks for the help. I'll hopefully have something up and running within a week :) [06:29] micheil: sonnym: cool. [06:31] donnex has joined the channel [06:32] jedschmidt has joined the channel [06:32] aubergine has joined the channel [06:33] mattly has joined the channel [06:34] jedschmidt: ryah: that did the trick. works fine now. [06:34] matjas has joined the channel [06:35] ryah: jedschmidt: okay - cool [06:35] jedschmidt: ryah: many thanks. [06:35] ph^ has joined the channel [06:39] ezmobius has joined the channel [06:39] creationix has joined the channel [06:41] itissid has joined the channel [06:44] devkorcvince has joined the channel [06:45] mikeal has joined the channel [06:45] devkorcvince: Hello I'm looking for a vim-syntax for jade can anyone help me? [06:46] hansek_ has joined the channel [06:46] hannesw_ has joined the channel [06:47] devkorcvince: hahaha I Love #github it will always show me the path hehehe [06:48] micheil: ryah: actually.. I just hit something kinda odd [06:49] micheil: 249 connections to node-websocket-server [06:49] micheil: 10 msg / connection. [06:49] micheil: as soon as I hate that 249 connections, the cpu for the nws process hits 100% [06:49] hansek_ has joined the channel [06:49] micheil: memory stays constant at about 48Mb [06:50] micheil: if I kill the benchmark tool (closing all 249 connections), then the cpu drops back to 0, and memory back to 14Mb. [06:53] ezmobius has joined the channel [06:54] bratish: sonnym: just to inform that your suggestion worked :) thanksalot [06:56] sonnym: that's good to hear :) [06:57] hassox has joined the channel [06:57] SamuraiJack has joined the channel [06:57] spetrea has joined the channel [06:58] crohr has joined the channel [07:00] hassox has joined the channel [07:01] sonnym: micheil: I am quite happily watching two clients play chess against each other in my log file. thanks a lot :) [07:01] micheil: sonnym: no worries [07:01] micheil: I've found an issue I'm stumped on. [07:02] ngw has joined the channel [07:02] aubergine has joined the channel [07:03] sonnym: yeah? [07:03] micheil: yeah [07:03] micheil: my server maxes out at 250 connections. [07:03] sonnym: hmm. that doesn't sounds right at all [07:04] micheil: at 250 connections, it just refuses to accept any more connections [07:04] micheil: I think I'm hitting a limit somewhere. [07:06] ezmobius has joined the channel [07:06] micheil: O.,o [07:06] micheil: ulimit -n 0 [07:06] ngw has joined the channel [07:08] micheil: ah. [07:08] micheil: easily doing many more connections then 250 now. [07:10] daleharvey has joined the channel [07:10] tsung_ has joined the channel [07:10] sonnym: from running that ulimit command? [07:10] konobi: yar [07:10] stephenjudkins has joined the channel [07:11] micheil: yeah [07:11] micheil: oh [07:11] micheil: shit [07:11] micheil: don't run ulimit -n 0 [07:11] micheil: that's not what I thought it did. [07:11] micheil: that says set max file descriptors open to 0 [07:11] micheil: kills stuff. [07:11] micheil: ulimit -n 1024 is nice [07:12] micheil: ulimit -n 10000 works [07:12] ioNull has joined the channel [07:12] sonnym: haha. I at first thought 0 would be unlimited. [07:12] micheil: yeah, same. [07:12] liesen has joined the channel [07:12] sonnym: funny that the bash man pages says most systems don't allow you to set it [07:12] micheil: konobi: any idea how to be notified in node that you've hit the ulimit? [07:13] ioNull: :) [07:14] ioNull: Hi, all [07:14] felixge has joined the channel [07:14] delapouite has joined the channel [07:16] DoNaLd`: working anyone here on OrientDB module for NodeJS ? [07:16] boboroshi_ has joined the channel [07:16] adambeynon has joined the channel [07:17] sonnym: I better try to catch some shut eye. past 3 already. . . happy noding [07:17] q_no has joined the channel [07:18] ryah: micheil: the benchmark process hits 100% cpu or the server? [07:18] micheil: the server [07:19] micheil: and the server never drops down from 100% until the benchmark process is killed [07:19] ryah: micheil: you get EMFILE errors when you hit the fd limit [07:19] micheil: I'm not getting those. [07:19] ryah: micheil: strange [07:19] ryah: micheil: that sounds like a bug... [07:19] micheil: or I only get one, after all the connections have closed [07:20] derferman has joined the channel [07:20] ryah: micheil: can you output server.maxConnections and server.connections [07:20] micheil: hmm.. [07:21] micheil: ryah: they're on http / net servers? [07:21] ryah: both [07:21] ryah: yes [07:21] micheil: k [07:22] vejs_ has joined the channel [07:23] micheil: undefined , 249 [07:23] micheil: although.. it's really odd. [07:24] micheil: http://gist.github.com/611166 [07:24] micheil: the numbers are out of sync. [07:24] rvanrooy has joined the channel [07:24] viktors has joined the channel [07:26] V1 has joined the channel [07:26] micheil: V1: found one of the problems. ulimit -n [07:27] ryah: micheil: hm [07:27] micheil: I'd expect the number to be changing gradually, but it just spikes [07:28] martin-g has joined the channel [07:28] V1: That is interesting [07:28] micheil: the other number Manager: Attached: 62822, 16 [07:28] micheil: the 16 is number of clients the connection manager has connected [07:28] micheil: bbiam, coffee. [07:30] vejs_ has left the channel [07:30] ryah: micheil: i guess it's because it has accepted all the connections [07:30] ryah: but the handshake hasn't been done yet [07:31] ryah: server.connections increases after accept() [07:31] ryah: but you're not printing it until after the handshake (i bet) [07:31] V1: Shouldn't handshaking take place in the node core btw? [07:32] ryah: no [07:33] V1: It would certainly make it easier for users to create applications around sockets without having to re-invent the wheel each time. [07:34] pquerna: what do you mean by 'handshaking'? [07:34] virtuo has joined the channel [07:36] hannesw has joined the channel [07:39] Tim_Smart: dipser: Hey. What was that issue you had about a number being 0? (with biggie-orm) [07:39] ryah: he means socket-io upgrade headers [07:40] ryah: s/socket-io/websocket/ [07:40] V1: pquerna: http upgrade headers for websocket connections [07:41] pquerna: oh. that doesn't belong in the low level http client or server. [07:41] micheil: ryah: yeah [07:41] pquerna: higher level interface is meh, cus really upgrade is only used for like 2-3 things, websocket being the main one people care about today. [07:41] micheil: that'd be right that. [07:42] V1: depends, it just another request "type" [07:42] pquerna: s/meh, maybe it could go in, but not the low level api/ [07:42] felixge: pquerna: proxying ssl connections also uses 'upgrade' [07:42] cnu has joined the channel [07:42] micheil: websockets are fine in a library. [07:42] pquerna: felixge: huh? you mean ssl upgrade inside http? which is only used by printers pretty much? [07:42] micheil: we do have the low-level http upgrade api, which does as much as it should [07:42] micheil: but things like websockets should stay out of core. [07:43] micheil: they are too unstable still. [07:43] felixge: pquerna: no, if you're writing a http proxy server [07:43] micheil: well, not unstable, just not stable in specification [07:43] pquerna: oh, you mean CONNECT? [07:43] felixge: pquerna: yeah [07:44] martin-g has left the channel [07:44] felixge: pquerna: anyway, I think it is fine as it is [07:44] Tim_Smart: felixge: How is the mysql client going? I have been playing with protocol parsing performance lately... [07:44] pquerna: connect: doesn't use upgrade headers does it? I thought you just gave connect, proxy server then gave you a raw-ish tcp proxy [07:46] ryah: has the same function as upgrade, he means [07:46] felixge: Tim_Smart: going very well [07:47] felixge: pquerna: yeah, I don't think it sends an upgrade header, but I think node exposes it through the same event in the API [07:47] felixge: pquerna: because it is basically the same thing [07:47] felixge: Tim_Smart: any findings yet? [07:47] Tim_Smart: felixge: Nice, I learnt quite a bit while making a client for redis, which is a lot simpler than mysql though. [07:47] ryah: is httpbis doing anything to simplify that mess? [07:48] matjas has joined the channel [07:48] felixge: Tim_Smart: I thought the reddis protocol was recursive? That would make it more difficult I think? [07:48] ryah: i think a sane http subset would be a good spec [07:48] Tim_Smart: felixge: Yeah, but only recursive to one level. [07:49] pquerna: ryah: http://tools.ietf.org/html/rfc2817#section-5.2 [07:49] Tim_Smart: So you can hard code that in. [07:49] felixge: Tim_Smart: oh, I see. [07:49] felixge: Tim_Smart: the mysql protocol is very simple as well I think [07:49] Tim_Smart: OK, I haven't looked. [07:49] felixge: Tim_Smart: it's just a lot of work, and some stuff is very poorly documented [07:49] pquerna: http://trac.tools.ietf.org/wg/httpbis/trac/wiki [07:49] felixge: Tim_Smart: http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol [07:49] pquerna: i dunno, its better than it was. [07:50] felixge: Tim_Smart: the main thing is decoding multiple bytes using little endian [07:50] felixge: Tim_Smart: everything else is kind of repetitive [07:50] felixge: Tim_Smart: I do however lay it out with very little abstractions in my parser to keep performance high [07:51] Tim_Smart: Cool cool. [07:52] micheil: felixge, Tim_Smart: these are both being developed in the open, right? [07:52] Tim_Smart: micheil: http://github.com/Tim-Smart/node-redis/blob/master/parser.js [07:52] felixge: micheil: http://github.com/felixge/node-mysql/blob/master/lib/mysql/parser.js [07:53] micheil: I'm just thinking of rewriting the parse in node-websocket-server, so it's a bit nicer. [07:53] Tim_Smart: felixge: Just things like optimizing for the common use case, using user-land buffer methods where appropiate. [07:53] Tim_Smart: The mains things I came across anyway. [07:54] micheil: Tim_Smart, felixge: both these are both read/write parsers, yes? [07:54] felixge: micheil: what is a write parser? [07:54] micheil: in the sense that it parsers data being written to a socket [07:54] aliem has joined the channel [07:54] micheil: or are these just on data coming in? [07:54] ioNull has joined the channel [07:54] Tim_Smart: micheil: Just data coming in. [07:54] micheil: okay [07:55] felixge: micheil: yeah [07:55] Tim_Smart: felixge: I guess this is where all the traffic is: http://github.com/Tim-Smart/node-redis/blob/master/parser.js#L145-206 [07:57] Faustie has joined the channel [07:57] Tim_Smart: felixge: And I switched state identifiers to strings, and got some more performance. Lots of little things :p [07:57] micheil: how are you two handling utf8 stuff? [07:58] micheil: or, rather ascii [07:58] Tim_Smart: micheil: All the data is kept as buffers. [07:58] micheil: okay [07:58] micheil: Tim_Smart: also, http://github.com/Tim-Smart/node-redis/blob/master/index.js#L8 [07:58] jetienne has joined the channel [07:58] micheil: double semi-colon [07:59] Tim_Smart: Haha, nice. [07:59] Tim_Smart: Doesn't break anything, but is ugly. [07:59] digitalspaghetti: DOUBLE SEMI-COLON ALL THE WAY [07:59] digitalspaghetti: WHAT DOES IT MEAN? [07:59] jesusabdullah: IT'S SO BEAUTIFUL [08:00] micheil: heh [08:00] felixge: Tim_Smart: strings are faster than INT constants? [08:00] Tim_Smart: felixge: Yeah, something weird about switch statements, and having property lookups in them. [08:00] micheil: that's for this.flag, right? [08:01] V1 has left the channel [08:01] Tim_Smart: micheil: Yes. [08:01] micheil: iirc, switch statements do a toString first, then toValue [08:01] micheil: or something [08:01] felixge: Tim_Smart: seriously? [08:01] felixge: That's very interesting [08:01] felixge: and stupid [08:01] felixge: :) [08:01] Tim_Smart: felixge: Yeah, I did some crazy benchmarking. [08:01] felixge: I'll have to benchmark that [08:01] micheil: I forget where I heard about that one from. [08:02] Faustie: Hey people, javascript newb here [08:02] Faustie: Just been doing it since yesterday [08:02] Faustie: Anyway, I was wondering [08:02] micheil: Faustie: hi [08:02] felixge: I'll file a bug report with v8, that's just too stupid if it is true [08:02] felixge: :) [08:02] micheil: felixge: haha [08:02] micheil: felixge: probably wise. I think it's in most JS engines. [08:02] felixge: micheil: which makes it even more wrong [08:02] felixge: :) [08:02] Faustie: Is it possible to use nodejs to get info from a table in a website, that I can use in my own javascript/html page in my own table? [08:02] micheil: I think the first I heard of something like that was back when I was doing stuff on the mozilla platform. [08:03] Faustie: Basically I want to copy over and display a table from an external website [08:03] ryah: Tim_Smart: interesting [08:03] micheil: Faustie: look up YUI 3, Dav Glass and the YUI Cinema [08:03] felixge: Faustie: look at apricot [08:03] felixge: Faustie: http://github.com/silentrob/Apricot [08:03] micheil: Faustie: also, JSDom [08:03] ryah: we should check out the code that generates the switch [08:03] Tim_Smart: felixge: It couldn't have been that bad though. [08:03] felixge: ryah: sounds like quite a journey into v8 land [08:03] ryah: probably does a nice jump table for symbols [08:04] Tim_Smart: It was just me being stupidly insane, [08:04] Tim_Smart: probably* [08:04] ryah: Tim_Smart: were your integers widely spaced? [08:04] markwubben has joined the channel [08:04] Faustie: thanks guys, i'll take a look :) [08:04] Tim_Smart: ryah: I declared them with a i++, so only by 1. [08:05] micheil: I have always heard of if/else statements being faster then switch/case [08:05] cheeaun has joined the channel [08:05] Tim_Smart: micheil: Only in some cases, I tried. [08:05] micheil: I've never benchmarked it though [08:06] ryah: Tim_Smart: http://github.com/ry/node/blob/d59512f6f406ceae4940fd9c83e8255f0c03173b/deps/v8/src/ia32/full-codegen-ia32.cc#L619-692 [08:06] felixge: I mean it all depends on how fast of a difference we're talking about here [08:06] felixge: but anything making a Mhz difference would be exciting [08:06] felixge: because otherwise it's not going to be the bottleneck for parsing [08:07] Tim_Smart: felixge: Well I'm talking around 50k ops a second. [08:07] Tim_Smart: Which you wouldn't do in real life. [08:07] felixge: Tim_Smart: that's hardly noticeable [08:08] felixge: Tim_Smart: what do you mean you wouldn't do 50k ops / second? [08:08] Tim_Smart: felixge: 50k sets a second to a database? [08:08] pquerna: i do that. [08:08] Tim_Smart: 100k on a better machine. [08:08] pquerna: in production. [08:08] pquerna: against cassandra. [08:08] felixge: Tim_Smart: You have to compare it to the speed of V8's primitives, not your db [08:08] Tim_Smart: 50k on my crappy laptop. [08:08] pquerna: not from a single client, thatd be silly. [08:09] felixge: Tim_Smart: The main challenge is parsing result sets fast enough [08:09] ryah: pquerna: against one node? [08:09] pquerna: no, a decent cluster. [08:09] pquerna: all these damn monitoring metrics [08:09] Tim_Smart: felixge: Yes, so it is a pretty stupid optimization, I would admit that. [08:09] Tim_Smart: The main time sink is with buffers. [08:10] pquerna: you can do upwards of 5k on a single node i guess, main limit is how you configure the commit logs [08:10] micheil: hmm.. would it be possible to have buffers work like the V8 objects [08:10] pquerna: (if you are willing to settle for once a secon fsync, it goes up quickly) [08:10] micheil: ACTION doesn't know a whole lot about this area, but anyway [08:11] micheil: in the sense that copy'ing just moves the point and changes / updates memory when the original buffer changes? [08:11] tjgillies has joined the channel [08:12] Nacho_ has joined the channel [08:16] tobeytailor has joined the channel [08:16] micheil: Tim_Smart: is this right.. http://github.com/Tim-Smart/node-redis/blob/master/parser.js#L170 ? [08:16] rnewson has joined the channel [08:16] micheil: the comment on utils.copyBuffer is Fast copyBuffer method for small buffers. [08:16] Tim_Smart: micheil: Yeah. [08:17] jetienne: q. with socket io node, how to disable the console log on the server ? [08:17] micheil: it looks wrong [08:17] Tim_Smart: Why does it look wrong? [08:17] micheil: jetienne: not sure. I'll check. [08:17] jetienne: thx [08:17] micheil: because the buffer on L167 is 13 < [08:18] micheil: that would be a small buffer [08:18] micheil: then > 13 would be a large buffer [08:18] micheil: no? [08:18] Tim_Smart: micheil: 13 LESS_THAN buffer.length [08:18] hoodoos: Tim_Smart, can u give link on your redis client please? [08:18] Tim_Smart: so buffer.length would be larger than 15. [08:18] Tim_Smart: 13* [08:18] Tim_Smart: Sorry, remaining. [08:19] hoodoos: Tim_Smart, lol i see it =) [08:19] Tim_Smart: Cool. [08:19] micheil: Tim_Smart: oh. that just looks confusing [08:19] micheil: Tim_Smart: but yeah, you're right, my bad [08:19] micheil: :) [08:20] jetienne: micheil: got it. adding log in options does it. var io = io.listen(server, {log : function(msg){}}); [08:20] micheil: jetienne: I think there's a better way [08:21] jetienne: http://github.com/LearnBoost/Socket.IO-node/blob/master/lib/socket.io/listener.js#L36 <- micheil i got it from here [08:21] micheil: actually, yeah, there isn't. [08:21] micheil: I was more thinking if it did this.options.log && this.options.log(...) [08:21] micheil: because then you could set it to false and never invoke a noop. [08:22] jetienne: indeed it would be nicer [08:22] aubergine has joined the channel [08:26] derferman_ has joined the channel [08:27] abiraja has joined the channel [08:35] necrodearia has joined the channel [08:36] micheil: Tim_Smart: so, in the end, was using ints or strings in switch/case statements faster? [08:36] Tim_Smart: micheil: I think it was more the property lookups. [08:37] micheil: okay [08:37] Tim_Smart: micheil: I bet using plain ints would be very similar. [08:37] micheil: instead of doing like case Paser.ON_STATE [08:37] Tim_Smart: Before I had declared them as contants. E.g. RedisParser.MULTI_BULK [08:38] micheil: where as now you're doing it all inline, right? [08:38] Tim_Smart: Yes. [08:38] micheil: k [08:38] Tim_Smart: That is where I got a small speed increase. [08:38] micheil: k [08:38] Tim_Smart: Only around 20ms per 10k requests though. [08:38] TomY_ has joined the channel [08:39] micheil: I'm just trying to work out the best way to clean up node-websocket-server's parser [08:39] Tim_Smart: or 10, somewhere around there. [08:39] Tim_Smart: micheil: I can take a look sometime. [08:39] micheil: because the data received is best received as binary, i think [08:39] micheil: but then the data that reaches the end developer should be utf8 [08:39] Tim_Smart: micheil: What is the protocol like? [08:40] micheil: it's got two types of packets that are currently implemented [08:40] micheil: three in total (draft 76) [08:40] Tim_Smart: So nothing that complex... [08:40] micheil: no [08:40] Tim_Smart: Where is the current parser? [08:40] caolanm has joined the channel [08:41] micheil: http://github.com/miksago/node-websocket-server/blob/development/lib/ws/connection.js#L400-435 [08:42] micheil: it's fairly basic. [08:43] micheil: data's like: 0x00data0xFF [08:43] ioNull has joined the channel [08:44] Tim_Smart: micheil: Hmm, are you going through that data byte per byte? [08:44] micheil: yeah. [08:44] Tim_Smart: Ouch. [08:44] micheil: it's the only way to parse it it seems. [08:44] micheil: because of the start/end packet delimeters [08:45] micheil: and using things like indexOf(.. ) and such on a buffer would probably not be a good solution [08:45] Tim_Smart: What are they delimiting? It it possible to have overlapping packets or something? [08:45] micheil: no idea [08:45] micheil: the protocol is rather stupid in design [08:46] micheil: like, there are other solutions, such as: http://github.com/LearnBoost/Socket.IO-node/blob/master/lib/socket.io/transports/websocket.js#L91-106 [08:46] micheil: but that doesn't handle for a broken packet [08:46] micheil: the current implementation I have seems most robust, if quite slow [08:46] viktors has joined the channel [08:46] stagas has joined the channel [08:47] Tim_Smart: micheil: Well what happens if the data you want to send is larger than a TCP packet? [08:47] micheil: I have no idea. [08:47] Tim_Smart: Hmm. [08:47] micheil: how large can a tcp packet be? [08:47] javajunky has joined the channel [08:48] Tim_Smart: It varies, but a few kb [08:48] micheil: okay.. [08:48] Tim_Smart: I think 40kb was the normal size I encounter when parsing the redis protocol. [08:48] Tim_Smart: encountered* [08:49] micheil: what's that in bytes.. [08:49] micheil: 40960? [08:49] micheil: yeah [08:49] Tim_Smart: Then when parser gets another incoming buffer, it winds back a step and continues parsing, joining data where it has to. [08:50] micheil: yeah. I'm using array buffers. [08:50] cefn has joined the channel [08:50] micheil: which is probably really slow. [08:50] Tim_Smart: I'll take a look at the WS spec... [08:52] micheil: Tim_Smart: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76#section-5.3 [08:52] micheil: should be what you want [08:52] Tim_Smart: If the spec requires reading byte for byte, then that is really poor design... [08:52] micheil: it does. [08:52] spetrea: I'd like to have Firebug in node.js [08:53] spetrea: and an awesome ide [08:53] spetrea: although it's not needed :) [08:53] Tim_Smart: spetrea: node-inspector is pretty decent. [08:53] liesen has joined the channel [08:53] micheil: there was talk of using a new packet format, where you do: begin; frame-length; bunch-of-other-stuff; data [08:53] micheil: Tim_Smart: the spec in the mailing list is being designed to include all kind of crazies. [08:54] pquerna: you mean it could include binary data. [08:55] micheil: pquerna: that's been there from the start. [08:55] micheil: I'm meaning things like extension mechanisms [08:55] micheil: compress [08:55] micheil: erm [08:55] xla has joined the channel [08:55] micheil: compression, extensions, etc. [08:55] mbrochh has joined the channel [08:55] mbrochh has joined the channel [08:56] pquerna: ew [08:56] micheil: like, people what to stream videos to the browser via websockets. [08:56] micheil: like. 4Gb binary files. [08:56] pquerna: god [08:56] micheil: so they claim that websockets should implement compression like gzip [08:56] Tim_Smart: Hmm. [08:56] pquerna: why, it should be opaque [08:56] pquerna: write it in js if you want compression [08:56] micheil: yeah [08:56] micheil: but no. not the IETF's crowd. [08:56] Tim_Smart: It should just be a TCP socket >.> [08:57] micheil: TCP socket with basic framing. [08:57] Tim_Smart: With some security. [08:57] micheil: and that. [08:57] micheil: basic framing because it makes it slightly nicer. [08:57] Tim_Smart: micheil: Naw, leave framing up to the server / client. [08:57] micheil: nup. [08:57] micheil: because then you'd have to implement a heap more stuff at end-user level [08:58] Tim_Smart: How you delimit your data is up to you... [08:58] pquerna: well, i guess this is how the ietf ends up ow it is, no one can agree :) [08:58] Tim_Smart: Just send the raw packets in. [08:58] Tim_Smart: :p [08:58] micheil: it's a basket case, really. [08:59] pquerna: doesn't matter ,spdy is gonna win anyways. [08:59] micheil: it's been this steady stream of emails where everythings' like what-if. [08:59] micheil: hixie actually stepped down from the IETF side of the spec. [08:59] micheil: he just does the W3C web idl stuff for it now. [08:59] pquerna: yeah, i heard about that [09:00] pquerna: who is running it now? [09:00] micheil: no idea. [09:00] micheil: I've pretty much given up trying to keep up. [09:00] micheil: like, the things with protocol-level ping/pong, that's pretty nice. I can agree with that. [09:01] micheil: but protocol-level compression, frame meta-data, etc. no thanks. [09:01] Tim_Smart: micheil: So basically the fastest way to finding the delimiter, is to run a for loop over the incoming buffer, until you find the corresponding char code. [09:01] Tim_Smart: Urgh. [09:01] teemow has joined the channel [09:02] micheil: Tim_Smart: are you going to be about in, say, 1 hours time? [09:02] Tim_Smart: Yeah. [09:02] micheil: wait. which timezone are you? [09:02] Tim_Smart: NZ, +12GMT [09:02] micheil: oh. yeah./ we had this conversation yesterday :P [09:02] micheil: bbl, dinner. [09:03] saikat has joined the channel [09:03] stagas has joined the channel [09:03] pquerna: http://trac.tools.ietf.org/wg/hybi/trac/ticket/23 [09:03] pquerna: :-/ [09:04] Tim_Smart: Ooo. vim 7.3 got a new Javascript syntax definition. [09:05] Tim_Smart: Took a few tweaks to make it nice... but I'm happy. [09:05] Tim_Smart: Hmm fail. [09:05] Tim_Smart: (That ticket) [09:10] murphy has joined the channel [09:14] xla has joined the channel [09:18] jetienne: spdy is getting traction ? i find it surprising that such thing got more and less forgotten... the efficiency is great according to google [09:22] MikhX has joined the channel [09:29] stagas: jetienne: so who's gonna make a spdy server? :P [09:30] jetienne: not me :) [09:30] jesusabdullah: What's spdy? [09:30] stagas: jesusabdullah: http://www.chromium.org/spdy/spdy-whitepaper [09:31] jesusabdullah: huh [09:31] stagas: :P [09:33] stagas: it needs client code [09:33] jetienne: it has very good result vs packet loss. so should be much faster on mobile [09:35] pquerna: jetienne: goog is iterating on the spec [09:35] ooooPsss has joined the channel [09:35] pquerna: draft 3 should be out 'soon' [09:36] pquerna: chrome implements it [09:36] pquerna: and then someday goog will just turn it on for their webervers to make gmail and search faster :P [09:36] saimon_: Hi all...Does npm have a concept similar to bundler's Gemfile. i.e. a file where a project can list it's dependencies form npm to install in one command? [09:36] hellp has joined the channel [09:37] jetienne: pquerna: nice :p [09:37] stagas: pquerna: is it all or nothing? can you serve in both simple http and spdy and have the client decide? [09:37] stagas: or the server [09:38] pquerna: client decides; [09:38] pquerna: spdy is all wrapped in ssl anyways [09:38] micheil: isn't it all wrapped in tls? [09:38] micheil: not ssl. [09:38] micheil: I thought one was more updated then the other or something. [09:39] pquerna: sorry, i use the word interchangably [09:39] micheil: ah, okay [09:39] pquerna: ssl 3.0 is very very near what tls 1.0 is [09:39] micheil: Tim_Smart: ping. [09:40] Tim_Smart: pong. [09:40] pquerna: tls 1.1 is beyond what ssl does for sure, but meh, most people are still using tls 1.0 [09:40] Tim_Smart: micheil: So http://github.com/LearnBoost/Socket.IO-node/blob/master/lib/socket.io/transports/websocket.js#L91-106 assumes the data isn't malformed? [09:40] micheil: yeah [09:40] micheil: assumes that the data is one complete packet. [09:41] Tim_Smart: Oh right. [09:41] micheil: or multiple packets in one tcp frame [09:41] micheil: where as the nws one is closer to a stream [09:41] Tim_Smart: micheil: So that is possible, multiple packets in one frame? [09:41] micheil: I guess it could [09:41] Tim_Smart: Well, multiple frames in one packet. [09:41] MikhX has joined the channel [09:41] micheil: depends if a client buffers the messages before sending [09:42] Tim_Smart: OK. [09:42] micheil: like, it could very well be possible to have this as a TCP packet: [09:42] micheil: 0xF0test0x000xF0test20x00 [09:43] micheil: just as you could get | 0xF0test... | ...0x00 0xF0 test 0x00 | [09:43] micheil: (where pipe represents tcp frame boundary) [09:43] Tim_Smart: Yeah, seems like a native memory scanning function would be a help here. [09:43] Tim_Smart: But calling into c++ isn't cheap. [09:43] micheil: Tim_Smart: lame-mans terms there? [09:44] micheil: what do you mean by native memory scanning function? [09:44] Tim_Smart: micheil: There are mem* functions in C that lets you find the index of a certain byte in memory. [09:44] micheil: uh, okay, sounds nice [09:45] Tim_Smart: So you would just scan the allocated section of memory for that particular buffer. But again, C++ calls aren't cheap :) [09:45] Tim_Smart: And reading 3 bytes etc would be faster with a ecma for loop. [09:46] micheil: hmm.. [09:46] micheil: "And reading 3 bytes etc would be faster with a ecma for loop" ? [09:46] Tim_Smart: And because there is no way to tell if the upcoming data is 3 bytes or 100k bytes is stupid. [09:46] Tim_Smart: *the spec is stupid. [09:47] micheil: so, what, instead of looping over every byte in the buffer, loop over every three. [09:48] Tim_Smart: Well 3 bytes was just an example, reading three bytes one at a time with a for loop would be faster than the C call. [09:48] micheil: oh, right [09:48] hassox has joined the channel [09:49] Tim_Smart: And considering *most* websocket apps send lots of small data packets, you might as well stick with the for loop. [09:49] micheil: yeah [09:50] micheil: I think average packet size would be about < 1 Kilobyte [09:50] Tim_Smart: :/. 1kb just to send an OK message? [09:50] micheil: I mean, 1 kilobyte is 1022 chars of data. [09:51] micheil: so that's massive. [09:51] Tim_Smart: OK. [09:51] Tim_Smart: That is pretty big for simple status updates. [09:51] micheil: use say, socket.io as an example. [09:52] micheil: ~j~{"evt":"mouseMove","data":[546,642]} [09:53] micheil: or something. [09:53] Tim_Smart: micheil: It seems socket.io uses strings, and a simple .split call [09:53] micheil: yeah [09:54] Tim_Smart: Converting the buffer to a string cost quite a bit, so you could gain something there... [09:54] micheil: and with messages being less than .5 kilobytes in size, there could easily be say 60-80 messages per tcp frame. [09:54] micheil: well, the data at the end-developer has to be utf8 anyway. [09:54] micheil: socket.io makes all data received a utf8 string [09:54] Tim_Smart: micheil: But surely, if a client only want to send a message every 100ms, then it won't buffer them. [09:54] micheil: yeah [09:54] Tim_Smart: *wants [09:54] micheil: it'd flush immediately [09:55] dgathright_ has joined the channel [09:56] Throlkim has joined the channel [09:56] Tim_Smart: micheil: Well, I guess this means you will have to experiment... Send message as fast as you can to the server from chrome or something, and see if it squashes the requests together. [09:56] Tim_Smart: messages* [09:56] micheil: hmm.. [10:04] bratish has left the channel [10:04] matjas has joined the channel [10:04] stalled has joined the channel [10:06] omarkj has joined the channel [10:11] brainfck` has joined the channel [10:19] MikhX has joined the channel [10:19] ivanfi has joined the channel [10:37] liesen has joined the channel [10:40] cefn has left the channel [10:41] path[l] has joined the channel [10:42] agnat has joined the channel [10:43] V1 has joined the channel [10:44] mape: saimon_: yes, the package.json file [10:44] saimon_: mape: ok cool..I'll investigate further..thanks [10:45] mape: np [10:45] ollie has joined the channel [10:47] V1: @_@ soap parsing in node SUCKS [10:47] stride: soap parsing sucks everywhere? [10:47] V1: Who ever invented SOAP should be stabbed with 10 blunt knives >_< [10:48] V1: stride: At least there are people who created a SOAP parsing library before so we can share the joy of there tears, there isn't any SOAP library in node.. [10:49] stride: :) [10:49] codelotus has joined the channel [10:50] V1: Atleast once I got soap parsing done, we can deploy our app [10:52] stride: last time I had to deal with soap included some of this weird XML Encryption and signatures stuff. somehow I doubt I'd like to implement that myself [10:53] stride: I think that was the only time I really liked those configuration-heavy Java monsters [10:53] V1: and handshakes dear gawd [10:54] V1: So much points to consider and not forget. Atleast I got big ass SOAP manual on my desk -_-" [10:54] rnewson has joined the channel [10:54] rnewson has joined the channel [10:54] caolanm: ugh, SOAP [10:54] SvenDowideit has joined the channel [10:54] caolanm: hard luck V1... [10:54] MattJ has joined the channel [10:55] V1: Thanks.. I guess.... [10:55] fermion has joined the channel [10:55] ekidd has joined the channel [10:58] V1: I might just my co-worker a poke and have him do it instead. It will be "great" opportunity to learn node.js ;D [10:58] caolanm: cunning ;) [10:59] path[l] has joined the channel [11:00] gregerolsson has joined the channel [11:01] ekidd has joined the channel [11:03] path[l] has joined the channel [11:06] Tim_Smart: micheil: I came up with a little something that keeps everything as buffers. [11:06] micheil: hmm? [11:07] Tim_Smart: Just a rough draft: https://gist.github.com/b574e7a0455b996d6b12 [11:07] Tim_Smart: Expect errors and stuff. [11:08] Tim_Smart: Heh found a syntax error already, my bad. [11:09] micheil: Tim_Smart: could you walk me through that a little bit? [11:09] Tim_Smart: OK. When it first enters, state is at HEAD [11:10] micheil: okay [11:10] micheil: then it works out if it's a high / low bit packet [11:10] Tim_Smart: It store the first byte into c_byte, the checks if the most significant bit is set (which I stole from you) [11:10] micheil: it's the buffer copy stuff I don't get. [11:10] Tim_Smart: "If /type/ is not a 0x00 byte, then the server may abort" etc. [11:11] Tim_Smart: It then sets state to SIMPLE [11:11] sschuermann has joined the channel [11:11] micheil: if the original buffer length is 10, and I do like: buffer.copy() will that expand the original buffer? [11:11] Tim_Smart: OK, so you want case SIMPLE explained? [11:11] micheil: yeah [11:12] Tim_Smart: Basically if it isn't 0x00, then we can increment the data length by one. [11:12] agnat has joined the channel [11:12] Tim_Smart: We do that until we either: a) Run out of data, then we know it continues in the next TCP packet. b) slice out the amount of bytes we need. [11:13] path[l] has joined the channel [11:13] Tim_Smart: b) happens when we reach 0x00 [11:14] Tim_Smart: If a) happens, we push the buffer to an array, as it will need to be used later. [11:14] micheil: this makes a bit more sense when you realise it's slightly recursive [11:15] micheil: so, should using buffer.copy and keeping stuff as buffers be faster then pushing data into an array and then creating a buffer from that? [11:15] Tim_Smart: If you have a large amount of bytes yes. [11:16] Tim_Smart: I think it would break even. [11:16] Tim_Smart: (For smaller stuff) [11:16] Tim_Smart: Creating a buffer from an array still goes through a for loop from memory. [11:16] micheil: keep in mind that the data at the end should be a single utf8 string [11:16] kjy112 has joined the channel [11:18] Tim_Smart: micheil: How often do you run into the case where it isn't a utf8 string? [11:19] micheil: huh? [11:19] Tim_Smart: I.e. the msb isn't is set. [11:19] micheil: msb? [11:19] Tim_Smart: most-significant-bit [11:19] micheil: oh, right [11:19] micheil: never. [11:19] Tim_Smart: Hmm, that seems like a useful part of the spec... [11:19] micheil: because the msb is always set until browsers implement binary types in js [11:20] Tim_Smart: OK. [11:21] herbySk has joined the channel [11:21] Tim_Smart: Well it would be nice to keep it future proof. [11:21] micheil: theoretically, node-websocket-server could talk with node-websocket-client using msb off. [11:21] micheil: so, in binary [11:22] osteele has joined the channel [11:22] Tim_Smart: Yeah, otherwise doing everything in strings would be *maybe/most likely* option. [11:22] Tim_Smart: faster option* [11:22] Tim_Smart: be the* [11:22] Tim_Smart: spelling is failing. [11:23] micheil: hmm.. [11:23] micheil: well, either way, I need to transcode data across to UTF8 at some stage [11:24] Tim_Smart: Well you can't just go String.fromCharCode(), as that would only work for ascii [11:24] micheil: and being the framing bytes aren't in UTF8 range, it's better to keep it all as a buffer until I need to emit a full message [11:24] micheil: exactly [11:24] micheil: I need to use either the string_decoder or buffers [11:24] Tim_Smart: So you either start with a string, or you decode a buffer. [11:25] micheil: but if I start with a string, that would mean setting: stream.setEncoding("utf8") [11:25] Tim_Smart: 2nd option is the only way for full spec support. [11:25] Tim_Smart: Yes, it would. [11:25] micheil: in which case the data my packet parser is getting will.. yeah [11:25] micheil: which wouldn't work with the spec [11:27] agnat has left the channel [11:28] micheil: what about if I created a string decoder? [11:28] micheil: so as I read the char, I translated it to utf8? [11:30] micheil: or would that be slower? [11:31] micheil: yeah. that'd be slower. I'm thinking. [11:32] agnat has joined the channel [11:32] dmcquay has joined the channel [11:37] Tim_Smart: micheil: Yeah, doing it in one big go would be easier. [11:37] Tim_Smart: + faster most likely. [11:37] micheil: because that'd be alloc'ing less buffers [11:38] Tim_Smart: Well, actually for lots of small stuff, decoding yourself could make sense. [11:38] Tim_Smart: c++ aren't cheap. [11:38] Tim_Smart: c++ calls* [11:38] mbrochh has joined the channel [11:38] mbrochh has joined the channel [11:39] smtlaissezfaire_ has joined the channel [11:40] micheil: yeah [11:40] micheil: didn't felix write a utf8 streaming parser? [11:43] agnat has joined the channel [11:43] pandark_ has joined the channel [11:48] boaz_ has joined the channel [11:49] pandark_ has joined the channel [11:54] agnat has left the channel [11:55] mikew3c has joined the channel [12:02] overra has joined the channel [12:03] ysynopsis has joined the channel [12:04] ysynopsis1 has joined the channel [12:05] ysynopsis1 has left the channel [12:10] smtlaissezfaire_ has joined the channel [12:11] dnolen has joined the channel [12:11] adambeynon has joined the channel [12:15] daleharvey has left the channel [12:16] ysynopsis has joined the channel [12:18] Tim_Smart: micheil: You can actually beat using string in the simplest use case. [12:18] Tim_Smart: strings* [12:18] micheil: hmm? [12:19] Tim_Smart: With no error checking etc. [12:19] Tim_Smart: I'll do a gist benchmark. [12:19] micheil: k [12:21] mAritz has joined the channel [12:22] bradleymeck has joined the channel [12:23] Tim_Smart: micheil: Only if the data stays as buffers though ;) [12:23] Tim_Smart: https://gist.github.com/fe6d03ae32b5594b2606 [12:25] xla_ has joined the channel [12:27] hjjaa has joined the channel [12:29] micheil: Tim_Smart: at any rate, the ideas you've put forward are far better then the current implementation. [12:30] Tim_Smart: micheil: :) Updated the gist - had a couple errors. [12:32] mAritz: so, what do you guys think about the use of global? every other language i know (including browser js) tries to abolish this, but it seems to be the best way for some things in node.js. (like sharing models in mvc environments) [12:33] bradleymeck: mAritz i think global causes many gc problems and should be avoided like plague [12:34] mAritz: even when used for objects that shouldn't even be gc'ed because they are virtually always in use? [12:34] bradleymeck: instead of using global why not have a listing of all the models in a require module [12:35] mAritz: and then require that file again in every file that wants to use one of the models? seems a little not DRY to me [12:35] bradleymeck: mAritz no they would act as if always in use. but even then it exposes a behavior that could allow name collision, and after name collision you still get possible lookup collision [12:35] bradleymeck: DRY applies to individual sections not a global system generally [12:36] bradleymeck: ie. CSS is not dry because you repeat yourself many times in a file [12:36] bradleymeck: but if you have 2 files that repeat eachother while being independant. it is dry [12:36] Tim_Smart: mAritz: I share models on my orm, by registering them with a function. [12:36] Tim_Smart: It then stores them on a hash for association lookups etc. [12:37] bradleymeck: thats an idea, a registry function [12:37] Tim_Smart: s/on/in [12:38] mAritz: okay, what's the upside then of having a lookup function over just putting the models in exports.models[modelname] in a models.js file? [12:40] Tim_Smart: Nothing really. [12:40] bradleymeck: you could share the registry at runtime and change the modules loaded at runtime is about it [12:40] micheil: hmm.. [12:40] Tim_Smart: For an ORM, you kinda need it, to add the helpers. [12:41] micheil: heh.. Object Relation Manager.. [12:41] micheil: Tim_Smart: any ideas how the original would benchmark? [12:41] Tim_Smart: micheil: It isn't far off :) [12:42] Tim_Smart: Couple 100 ms [12:42] Tim_Smart: But you have error checking etc. [12:42] micheil: Tim_Smart: yeah. I'm just saying' you have a manager that gets shared around [12:42] micheil: like node-websocket-server [12:42] Tim_Smart: My for loop with a switch statement was pretty slow, so ignore that one. [12:43] Tim_Smart: Mainly the protocol isn't complex enough for that. [12:44] ysynopsis has left the channel [12:45] micheil: Tim_Smart: uhh.. [12:45] micheil: node-websocket-server node benchmarks/parsers.js development* [12:45] micheil: buffers 939 [12:45] micheil: original 386 [12:45] micheil: string 771 [12:45] Tim_Smart: Heh, different machine, different results... [12:46] micheil: Tim_Smart: you try it. https://gist.github.com/43addbd673abbdb5422d [12:46] micheil: because if that's so, my original implementation is far faster.. [12:46] aliem has joined the channel [12:46] micheil: (If I'm reading that right.) [12:47] hjjaa has joined the channel [12:48] micheil: smallest number is fatest, right? [12:49] Tim_Smart: micheil: How come you parser function returns undefined? [12:49] micheil: :/ [12:50] micheil: they all return undefined. [12:51] micheil: node-websocket-server node benchmarks/parsers.js development* [12:51] micheil: original 395 [12:51] micheil: undefined [12:51] micheil: buffers 986 [12:51] micheil: [12:51] micheil: string 801 [12:51] micheil: test [12:51] micheil: wtf. [12:52] Tim_Smart: :p [12:52] Tim_Smart: That is the right buffer for 'test' [12:52] saimon_ has joined the channel [12:53] micheil: yeah [12:53] micheil: but mine should certainly be working [12:54] industrial has joined the channel [12:54] industrial: Is there an easy way of looking at a file and re-running node if the modification time changes on *nix? [12:55] Akufen has joined the channel [12:55] Akufen has joined the channel [12:57] Tim_Smart: For anyone who want to try a super fast redis ORM http://github.com/biggie/biggie-orm/commit/9804e0ebcb9120d4b02baecc65d7608e14096ba4 [12:57] Tim_Smart: Hmm http://github.com/biggie/biggie-orm [12:58] kriszyp has joined the channel [12:58] Tim_Smart: I need to sleep I think. [12:58] Anti-X has joined the channel [12:58] Tim_Smart: I can't paste - and spell - right. [13:00] murphy has joined the channel [13:02] Tim_Smart: micheil: You might want to init order as 0... [13:02] spetrea: can I write like a server and test it with nodify at http://del-fuegos.no.de [13:02] spetrea: ? [13:02] micheil: Tim_Smart: I am. [13:02] Tim_Smart: You weren't in the gist. [13:02] spetrea: or do I need to install it locally ? [13:02] micheil: now I am. [13:04] micheil: Tim_Smart: that should be wroking. I'm confused. [13:04] Tim_Smart: buffers 1241 [13:04] Tim_Smart: original 9902 [13:04] Tim_Smart: string 1318 [13:04] Tim_Smart: That is what I get. [13:05] micheil: yeah. that's not working. [13:05] Tim_Smart: https://gist.github.com/633ee9901677824b0afc [13:06] micheil: is Buffer always loaded? [13:06] Tim_Smart: It's global. [13:06] micheil: ffuuu. [13:06] Tim_Smart: Well, I'm on 0.3.x [13:06] micheil: I've been doing: Buffer = require("buffer").Buffer [13:07] Tim_Smart: It hasn't always been global though. [13:07] micheil: node-websocket-server node benchmarks/parsers.js development* [13:07] micheil: buffers 852 test [13:07] micheil: original 8750 tes [13:07] micheil: erm [13:07] micheil: yeah [13:07] Tim_Smart: string? [13:07] micheil: yeah [13:07] davidsklar has joined the channel [13:07] micheil: it was the almost same as buffers [13:07] Tim_Smart: OK. [13:08] Tim_Smart: What happens if you return pkt directly? [13:08] micheil: not sure. [13:08] micheil: wtf. did you chance anything in origParser? [13:08] micheil: *change? [13:09] micheil: node-websocket-server node benchmarks/parsers.js development* [13:09] Tim_Smart: Yeah, the msb check. [13:09] micheil: buffers 873 test [13:09] micheil: original 1048 test [13:09] micheil: string 687 test [13:09] micheil: returning a buffer [13:09] Tim_Smart: What node version are you on? [13:11] mAritz: Seriously guys? 4 months ago I was looking for a redis orm. Didn't find one. So I wrote my own and now everyone else writes one too? Are you mocking me? :( [13:11] bradleymeck: XD [13:12] bradleymeck: nope, just getting time [13:12] micheil: haha. Just managed to beat buffers. [13:12] Tim_Smart: mAritz: I never say your one. [13:12] bradleymeck: did nodejobs just stop? [13:12] Tim_Smart: say/saw [13:12] micheil: 0.3.0-pre [13:12] mAritz: it's in the modules wiki page :( [13:12] mAritz: i'm sure yours is better though, that's the sad thing. [13:13] ekidd has joined the channel [13:13] mAritz: http://github.com/maritz/nohm [13:13] Tim_Smart: Ah I think I did look at that briefly. [13:13] Tim_Smart: And I didn't like the DSL or something. [13:14] mAritz: hrmph [13:15] Tim_Smart: mAritz: This sort give you an idea of biggie: http://github.com/biggie/biggie-orm/blob/master/test/associations.test.js [13:15] mAritz: good thing i didn't start using it on big projects yet so i can at least still switch to yours. [13:15] Tim_Smart: sort of gives* [13:16] Tim_Smart: I benched mine against rapid, but not against yours... [13:16] Tim_Smart: That will have to come later ;) [13:17] mAritz: i don't think you have to try that. performance was the least of my worries :D [13:17] Tim_Smart: Haha, you might have bumped into it by accident :p [13:17] mAritz: ? [13:18] Tim_Smart: Well, you weren't concerned about speed, but you might have got it fast anyway. [13:18] nerdEd has joined the channel [13:19] mAritz: i don't think so, but we might try a benchmark some time... why not? maybe mine isn't that bad after all. ^^ [13:19] micheil: Tim_Smart: the slow part of original was the conversion of an array of data to a buffer to a utf8 string. [13:19] Tim_Smart: micheil: Yup. [13:19] micheil: that said, I think one loop is better then two. [13:20] stagas has joined the channel [13:20] Tim_Smart: micheil: Not if multiple element in one packet is commonplace. [13:20] Tim_Smart: Which is why I did it. [13:20] micheil: hm, well, yeah, I don't know about that case. [13:20] siculars has joined the channel [13:21] Tim_Smart: I'm not either. [13:21] Tim_Smart: (Not sure about that case) [13:21] micheil: I might ask the pusherapp guys. [13:21] Tim_Smart: OK. [13:21] agnat has joined the channel [13:21] Tim_Smart: Anyway, I'm losing my head. Bed time. [13:21] mif86 has joined the channel [13:21] mbrochh has joined the channel [13:21] mbrochh has joined the channel [13:22] tobiassjosten has joined the channel [13:23] micheil: k, good night Tim_Smart, thanks for the help :) [13:25] fermion has joined the channel [13:26] micheil: Tim_Smart: do you have any benchmarks with that sliceBuffer function? [13:26] Tim_Smart: I don't, mjr_ did. Actually, we didn't try slice. [13:27] shimondoodkin has joined the channel [13:27] Tim_Smart: But setting the indexed properties on a object to a memory buffer is expensive. [13:27] Tim_Smart: But new Buffer suffers that as well, so I dunno. [13:27] micheil: hmm.. [13:28] micheil: just thinking, if I can manage to make use of the "fast slice" in 75% of all requests, say, on messages that are < 250 chars, then that should be good, right? [13:28] jherdman has joined the channel [13:28] cferris has joined the channel [13:29] ben_alman has joined the channel [13:31] Tim_Smart: micheil: The threshold where native slice is faster is about 20 bytes from memory. [13:31] micheil: okay [13:31] Tim_Smart: But I will have to bench that tomorrow. [13:32] ironfroggy_: anyone have tips on cross-compiling Node? [13:33] Tim_Smart: mAritz: Does nohm have a way of saving many models at once? [13:35] mAritz: Tim_Smart: it does save children of objects you're saving if the children were added but not saved yet. :D [13:35] mAritz: but otherwise, no. [13:35] Tim_Smart: OK. [13:35] mAritz: why would you want that though? [13:35] mAritz: should be a simple wrapper around your normal save operation?! [13:36] micheil: Tim_Smart: btw. slice buffer totally doesn't work. [13:36] Tim_Smart: The one I made? [13:36] trotter has joined the channel [13:36] Tim_Smart: micheil: I made an error on line 17 on the gist btw [13:36] micheil: yeah [13:37] Tim_Smart: remove the target argument. [13:37] micheil: yeah [13:38] viktors has joined the channel [13:39] matt_c has joined the channel [13:43] hpoydar has joined the channel [13:46] sonnym has joined the channel [13:46] Tim_Smart: mAritz: TypeError: Cannot call method 'fn' of undefined. at dispatch (/home/tim/Projects/nohm/lib/conductor/lib/conductor.js:147:27) [13:46] Tim_Smart: mAritz: So you have save lots of models at once. [13:47] mAritz: frag me, i hate conductor sometimes :D [13:47] jtsnow has joined the channel [13:47] mAritz: what did you try to get that error? [13:49] Tim_Smart: Try save a model on latest node. [13:49] davidwalsh has joined the channel [13:50] Tim_Smart: http://pastie.org/1200717 [13:50] mAritz: hm, haven't tested with 0.2.3 yet [13:50] Tim_Smart: 0.3.x-pre [13:51] smtlaissezfaire_ has joined the channel [13:51] mAritz: oh, okay... haven't tested with any 0.3.x yet either ;D [13:52] micheil: Tim_Smart: https://gist.github.com/95e4e929a7ec247bb001#file_results [13:52] micheil: :D [13:52] micheil: the new parsers smash the old parser out of the water [13:52] mAritz: 0.2.3 works [13:52] rauchg_ has joined the channel [13:52] micheil: rauchg_: https://gist.github.com/95e4e929a7ec247bb001#file_results [13:53] Evet has joined the channel [13:53] micheil: new parser work for node-websocket-server [13:53] poolshark has joined the channel [13:53] poolshark: hi all. Is there any tutorial online somewhere that would show me how to write to a file using node.js? [13:53] micheil: poolshark: hmm.. [13:53] micheil: poolshark: I don't know of a tutorial, but I could tell you where to find the information? [13:54] mAritz: Tim_Smart: just pushed 0.1.4 of nohm, but it probably won't work with 0.3.x yet as well. [13:54] Tim_Smart: require('fs').writeFile(path, buffer, callback) [13:54] micheil: Tim_Smart: or you could just do that. >_> [13:54] micheil: I was going to direct them to the documentation. [13:54] Tim_Smart: That is a better idea, [13:54] poolshark: micheil: that would help a lot [13:54] micheil: http://nodejs.org/api.html [13:54] micheil: then the section called fs [13:54] poolshark: Tim_Smart: your thing sounds cool, but what is buffer and is callback optional? [13:55] micheil: erm, file system [13:55] mAritz: Tim_Smart: btw: your paste wouldn't do much since you specified the name to be unique, so every save but the first would have "invalid" in the err var. [13:55] micheil: poolshark: a buffer is a special data type in node.js [13:55] Tim_Smart: poolshark: If you don't care about what happens, callback is optional. [13:55] poolshark: alright, great start [13:55] poolshark: thanks Tim_Smart, micheil [13:55] peteatolia has joined the channel [13:56] Tim_Smart: mAritz: Yeah I was supposed to omit that. [13:58] aliem has joined the channel [13:59] jchris has joined the channel [14:00] paul__ has joined the channel [14:00] mAritz: gotta go buy some food. Tim_Smart: you should go to bed so you can continue making biggie better tomorrow! ;D [14:02] matt_c has joined the channel [14:09] Evet: hey Tim_Smart, nice to see you here [14:10] dipser: . [14:11] saimon_ has joined the channel [14:12] saimon_ has joined the channel [14:12] jetienne: in js, when defining a method in a class, do you use .prototype ? or more closure with a return { all public method } ? not sure to be clear [14:12] voodootikigod: depends on your use case [14:12] voodootikigod: if you want to keep variables private [14:12] voodootikigod: the better way to do it is with a closure [14:13] voodootikigod: but dynamically appending to a class after the closure has closed is not as straight forward [14:13] voodootikigod: easier way if you dont care about private methods/values [14:13] jetienne: voodootikigod: why is it better ? currently im using closure... but im wonder as i read that google insiste on using .prototype [14:13] voodootikigod: is like this [14:13] voodootikigod: var = {} [14:13] voodootikigod: var a = {} [14:13] voodootikigod: a.prototype.run = function () { } [14:14] voodootikigod: they solve two different things [14:14] voodootikigod: closures lock the scope [14:14] joncurra has joined the channel [14:14] voodootikigod: where prototype does not [14:14] voodootikigod: there is not right or wrong way [14:14] voodootikigod: there is only if the target fits [14:14] jetienne: voodootikigod: currently i always used closure typeofobject... do you know why google insist on using .prototype ? [14:15] caolanm: using prototype is faster if you're going to be creating a lot of objects [14:15] voodootikigod: do you have a link for "insists" [14:15] charlenopires has joined the channel [14:15] voodootikigod: if you can sacrafice private variables and locked scope [14:15] voodootikigod: prototype is the way [14:15] caolanm: but personally I'll use a closure if I can [14:15] jetienne: voodootikigod: not from memory, but i read it like in 3 != sources... so i believe it [14:15] voodootikigod: in exchange you get a lot of flexibility to mutate the object at will [14:16] voodootikigod: jetienne: they probably recommend it because it is (as mentioned) faster in multiplicity [14:16] voodootikigod: jetienne: and allows for easy extension [14:16] peteatolia: Google likes the oo syntax is why ( invested in java a lot) ? [14:16] voodootikigod: via function clobbering [14:17] jetienne: ok thanks all [14:18] Me1000 has joined the channel [14:18] mikew3c has joined the channel [14:19] Evet: node.js or nginx+node.js for production? [14:20] industrial: Is there an easy way of looking at a file and re-running node if the modification time changes on *nix? I don't want to constantly restart node when I change my app [14:21] aubergine has joined the channel [14:21] jetienne: industrial: i got something for that [14:21] phiggins: nodemon? [14:21] phiggins: (question came up yesterday on twitter) [14:21] jetienne: http://github.com/jeromeetienne/www.jetienne.com/blob/master/Makefile#L11 <- industrial [14:22] peteatolia: Nodejs-autorestart [14:22] jetienne: all in the inotifywait [14:22] industrial: thanks [14:22] ivanfi has left the channel [14:25] ezmobius has joined the channel [14:26] ajpiano has joined the channel [14:26] mif86 has joined the channel [14:32] christophsturm has joined the channel [14:33] dylang has joined the channel [14:40] bradleymeck has joined the channel [14:41] deedubs has joined the channel [14:42] deedubs: anyone know of a avahi binding for node yet? [14:42] deedubs: ^(zeroconf networking) [14:42] ehaas has joined the channel [14:42] kevwil has joined the channel [14:43] tj has joined the channel [14:43] ioNull has joined the channel [14:44] bradleymeck: deedubs nope [14:44] dmcquay has joined the channel [14:45] deedubs: intersting [14:46] hannesw_ has joined the channel [14:46] bradleymeck: as always, would love to be employed just writing bindings, but thats never gonna happen [14:47] deedubs: yeah really [14:47] deedubs: I think a zeroconf binding would be pretty sweet [14:48] ph^ has joined the channel [14:49] bradleymeck: yea :/ i wanna get lua + java + python bindings done but i got work, mainly use em for nice math, and if i had enough time provide both sync and async [14:49] softdrink has joined the channel [14:49] creationix has joined the channel [14:49] Vladimir1 has joined the channel [14:49] hsuh has joined the channel [14:49] bradleymeck: tjholowaychuk did you ever get that indexed property working? [14:49] rauchg_ has joined the channel [14:50] tjholowaychuk: bradleymeck: nope, had to work on some other unrelated stuff [14:50] tjholowaychuk: will probably get back to that today [14:50] bradleymeck: gist it to me sometime [14:50] tjholowaychuk: will do [14:50] Vladimir1: Hi! How do I get the domain name of the current host running node? [14:50] Vladimir1: or the primary IP at least [14:50] rnewson has joined the channel [14:50] rnewson has joined the channel [14:52] bradleymeck: you dont generally. im sure you could do something funky to get it [14:52] mAritz has joined the channel [14:53] bradleymeck: thats kinda like asking how do i know what book i checked out from the library when you may have lent it to a friend or checked out like 10, you can do dns on a hostname but thats about it [14:54] tmpvar has joined the channel [14:55] Vladimir1: i see. thought i could dns.reverse('127.0.0.1') or such. think an external call to `ip link` or `ifconfig` is needed... [14:55] Vladimir1: or, better, analyse `route` default gw [14:57] bradleymeck: yea, need to get the external ip first [14:59] Yuffster has joined the channel [14:59] Vladimir1: heh. even better to directly pass an envvar, so to avoid child processes. thanks [15:00] fcoury has joined the channel [15:01] Vladimir1 has left the channel [15:02] langworthy has joined the channel [15:03] agnat: deedubs: not exactly avahi bindings, but there is http://github.com/agnat/node_mdns [15:03] sonnym has joined the channel [15:04] agnat: deedubs: I'm currently thinking about avahi bindings ... but I think I'll do DBus bindings and just use them to talk to avahi [15:05] deedubs: agnat: Hmm that's awesome [15:05] deedubs: there goes my reason for learning howto make node extensions haha [15:05] peritus- has joined the channel [15:05] peritus-: wink_: ping [15:06] dnolen has joined the channel [15:06] cadorn has joined the channel [15:11] agnat: deedubs: learn it anyway! there is still lots of stuff to bind :-D [15:11] peritus__ has joined the channel [15:12] Me1000 has joined the channel [15:13] charlenopires has joined the channel [15:13] peritus- has joined the channel [15:13] wink_: peritus-: pong [15:14] peritus-: wink_: tracked yesterdays error down to http://pastebin.com/ZVBgXjus [15:14] peritus-: wink_: source is here http://github.com/ry/node/blob/master/src/node.cc#L843 [15:15] wink_: peritus-: i have one change to make that may help [15:16] wink_: i think the hmac_ctx isn't being initialized properly, at least according to the ssl docs [15:17] ezmobius has joined the channel [15:17] benoitc has joined the channel [15:17] aubergine_ has joined the channel [15:18] wink_: open up node_crypto.cc, find the call to HMAC_Init, replace with: HMAC_Init_ex(&ctx, key, key_len, md, NULL); [15:18] wink_: in 0.2.0 its line 1591 [15:18] peritus-: wink_: k [15:18] steadicat has joined the channel [15:18] wink_: then rebuild and retry :> [15:19] damselem has joined the channel [15:19] nikolaiwarner has joined the channel [15:19] peritus-: wink_: still crashes (with master) [15:19] peritus-: wink_: i'll get a backtrace [15:20] nikolaiwarner has joined the channel [15:20] nikolaiwarner has left the channel [15:20] wink_: peritus-: damn, :P [15:21] damselem: quick question: How do you fire or emit an event, apart from those that are already defined ('connect', 'message', ....) from the client to the server when using Node.js and Socket.io ? [15:21] boaz_ has joined the channel [15:21] peritus-: wink_: (in gdb) i had 1 "Program exited normally" run, and three crashes. [15:21] wink_: lol yeah, thats not too shocking [15:21] peritus-: wink_: now it's not only crashing but also no longer deterministic. hurray! [15:21] wink_: ok so revert that one ;) [15:22] boaz_ has joined the channel [15:22] wink_: get a breakpoint in HmacDigest on the call to encode, i'd like to see what the 3 params look like that are being passed in [15:22] wink_: specifically md_value, md_len [15:22] beawesomeinstead has joined the channel [15:22] beawesomeinstead has joined the channel [15:22] wink_: the encode function probably isnt the real cause, it's used in lots of places [15:23] wink_: i think the init/cleanup functions are likely stomping all over the place [15:23] wink_: once you get the break, just p md_len, p md_value [15:23] wink_: see what those look like [15:24] evl has left the channel [15:24] hsuh has joined the channel [15:24] peritus-: wink_: 1 sec [15:25] aubergine_ has joined the channel [15:25] peritus-: (gdb) p md_value [15:25] peritus-: $1 = (unsigned char *) 0x100d25940 "????B? :?\f?v_j])\016?&\"" [15:25] peritus-: (gdb) p md_len [15:25] peritus-: $2 = 20 [15:27] wink_: also, p ctx [15:29] peritus-: wink_: ctx is not a local variable :/ some gdb-newb help would be awesome! [15:29] wink_: ah crap do hmac->ctx [15:30] wink_: you're broken in the static member function, gotta use the pointer to the instance of the object [15:31] kevwil has joined the channel [15:31] peritus-: wink_: http://dpaste.de/4hOz/ [15:31] EyePulp has joined the channel [15:32] peritus-: wink_: i try to match http://stackoverflow.com/questions/242665/understanding-engine-initialization-in-openssl against node_crypto.cc .. [15:32] wink_: yeah i just saw that, the engine calls look a little suspicious [15:32] wink_: however im not sure if that structure is initialized (it's all 0x0) or broken :P [15:33] wink_: peritus-: do this, change the init back to init_ex with null as the last param, add the 2 engine calls right before it [15:35] benv has joined the channel [15:35] wink_: peritus-: http://pastebin.com/MfcCHgmw [15:37] ph^ has joined the channel [15:38] peritus-: wink_: wow [15:38] wink_: ? [15:39] peritus-: wink_: crash is gone [15:39] wink_: <3 [15:39] peritus-: wink_: that's the patch: http://dpaste.de/YDRs/ [15:39] peritus-: wink_: *hugs* [15:39] wink_: perfect, what is the hash you're getting out of it [15:39] peritus-: wink_: that would've been my next question.. [15:39] wink_: haha, i can compare it to mine :p [15:40] sprout has joined the channel [15:40] wink_: http://pastebin.com/hV24kN2j [15:41] omarkj has joined the channel [15:41] peritus-: a5f7d48a8cad73d955fc447535f8db3f522b579b [15:41] mattc has joined the channel [15:41] peritus-: wink_: looks about right [15:41] wink_: close enough ;D [15:42] wink_: let me apply the patch and check it against my ssl [15:42] peritus-: wink_: still, simple/test-crypto CRASHes (as it did before) [15:43] wink_: where is that at? [15:44] wink_: nm [15:44] jakehow has joined the channel [15:44] wink_: peritus-: its crashing in the other hashes in the same way i bet [15:45] ehaas has joined the channel [15:45] peritus-: wink_: yapp, crypto is not only hmacs :/ [15:45] wink_: check HashInit (l1762), add the engine calls there too [15:48] wink_: actually, go to the very end of the file, try placing the engine calls in the init...it looks like there is an attempt being made to do something similar [15:48] wink_: i wonder why it doesnt work [15:48] stagas has joined the channel [15:49] wink_: actually, yeah just add the 2 engine* calls in the init at the end [15:49] wink_: that has a good shot at fixing all of them in one go [15:50] wink_: and by good shot, i mean should :p [15:50] wink_: although who knows [15:50] wink_: openssl is written by monkeys ;) [15:50] hoodoos: guys, if i do serverResponse.end([5MB data here]) is it considered bad practice? or node will handle it fine? :) [15:51] ceej_ has joined the channel [15:51] hoodoos: it's not 5mbs actually it's like 50-200kbs [15:52] hoodoos: or i should consider writing it in small portions with serverResponse.write? [15:53] caolanm: hoodoos: perhaps look into streams [15:53] peritus-: wink_: just using http://dpaste.de/oNDK/ brings back my initial error [15:53] hoodoos: caolanm, the data i'm giving away is result of JSON.stringify method, i should place result in stream and then write it, that way? [15:54] wink_: peritus-: k, it looks like that call needs to take place locally to the inits [15:54] caolanm: hoodoos: if its already held in memory I'd just write it [15:54] wink_: create a test using one of the hashs from the crypto test [15:54] wink_: just create an md5 hash [15:54] wink_: see if that crashes alone, if so, add those calls into the HashInit the same way [15:55] hoodoos: caolanm, yes, I guess there's no way not to keeping it in memory, it's some database response which I need whole to process [15:55] peritus-: wink_: with the test setup, is there a way to see where it crashed ? [15:55] micheil: hoodoos: if you're JSON.stringify'ing 5mb of data at once, I think you'll have a different problem to writing data to a network socket. [15:55] caolanm: ^ seconded [15:55] caolanm: ;) [15:55] peritus-: wink_: never mind [15:55] wink_: peritus-: well, you could just instrument it up with prints :) [15:55] wink_: brb [15:56] hoodoos: micheil, btw, maybe there's some streaming JSON stringifier? :) [15:56] micheil: hoodoos: not yet. [15:56] micheil: I was going to work on one, but didn't. [15:56] micheil: theoretically it's possible. [15:56] d0k has joined the channel [15:56] micheil: but it has a few other issues [15:58] tjholowaychuk: isnt there one? yajl? [15:58] hoodoos: my question actually was is there any difference (if i'm already have my 50-200 kb object in memory and then JSON.stringify it) between serverResponse.end() and serverResponse.write it in small portions in some way? [15:58] micheil: not sure on yajl. [15:58] micheil: anyway.. headphones on time. I need to finish this parser. [15:58] tjholowaychuk: :D [15:59] hoodoos: serverResponse is stream itself so writing it to socket is handled somewhere else anyways [15:59] micheil: tjholowaychuk: it speeds up websocket message decoding by about 8 times. [15:59] micheil: tjholowaychuk: early data: https://gist.github.com/95e4e929a7ec247bb001#file_results [15:59] tjholowaychuk: micheil: very nice :) [15:59] micheil: it's only possible due to tim_smart & felixge [15:59] micheil: tim for the most part. [16:00] micheil: tjholowaychuk: also, I need to catch up with you at some stage about friday. [16:00] tjholowaychuk: micheil: this week has been brutal sleep-wise so im a bit behind, but I was thinking it might be good to touch base on that after my most recent project is ready to go [16:01] bradleymeck: micheil / hoodoos i have one in pure js but its slower than native :( [16:01] micheil: okay, when would that possibly be? [16:01] micheil: tjholowaychuk: ^ [16:01] micheil: bradleymeck: hmm, okay, cool [16:02] ajsie has joined the channel [16:02] bradleymeck: plus sending chunk size is a problem cause you dont want to constantly write ~1 char [16:03] ceej has joined the channel [16:03] wink_: peritus-: back [16:03] peritus-: wink_: fails at 'var a0 = crypto.createHash("sha1").update("Test123").digest("hex")' [16:03] hoodoos: bradleymeck, is it on github somewhere? [16:04] peritus-: wink_: adding the ENGINE_* calls doesn't fix it, so I'll figure out what's different. [16:04] micheil: tjholowaychuk: are we talking next week or in a few weeks after that? [16:04] wink_: peritus-: well the hashing stuff may need a different set of initializations [16:04] wink_: openssl really is a trainwreck :P [16:05] tjholowaychuk: micheil: time-wise probably a few weeks [16:05] bradleymeck: hoodoos, the serialize isnt, but that is an enormous speed loss unless you need to be changing the object while you are streaming [16:05] micheil: hm... okay [16:05] wink_: i'll be back in a bit, i'll hit you up then [16:05] wink_: off to a meeting :| [16:05] micheil: tjholowaychuk: any more tips? [16:05] bradleymeck: enough that i scrapped it [16:05] hoodoos: bradleymeck, yeah, it's not my case, then i would need to parse it that way first :) [16:05] bradleymeck: http://github.com/bmeck/node-jsonparser <- the parse is still useful [16:06] tjholowaychuk: micheil: tips for what? [16:06] hoodoos: bradleymeck, json parseR? [16:06] micheil: tjholowaychuk: as to what said project is. [16:06] tjholowaychuk: micheil: ohh, not yet :p [16:06] micheil: tjholowaychuk: I've come to learn if you're involved then it must be kinda awesome. [16:06] hoodoos: bradleymeck, wow, nice, it's kind of SAX xml, right? [16:06] tjholowaychuk: micheil: ahahaha pff not really but thanks man lol [16:06] micheil: tjholowaychuk: I'm guessing something todo with realtime stuff. [16:07] bradleymeck: yea, its like ghetto yajl basically [16:07] micheil: tjholowaychuk: considering the company. [16:10] technoweenie has joined the channel [16:11] ginader has joined the channel [16:14] pgriess has joined the channel [16:15] sh1mmer has joined the channel [16:16] qFox has joined the channel [16:19] siculars has joined the channel [16:24] threeve_ has joined the channel [16:24] stagas has joined the channel [16:25] brianmario has joined the channel [16:26] Akufen has joined the channel [16:26] Akufen has joined the channel [16:26] siculars_ has joined the channel [16:26] bpot has joined the channel [16:28] banjiewen has joined the channel [16:29] osteele has left the channel [16:30] dstevens has joined the channel [16:31] nroot7 has joined the channel [16:31] agnat has left the channel [16:32] micheil: man.. converting a buffer to utf8 is massively slow. [16:33] jchris has joined the channel [16:34] hpoydar has joined the channel [16:35] nichdiekuh has joined the channel [16:35] mjr_ has joined the channel [16:35] sprout has joined the channel [16:37] CrypticSwarm has joined the channel [16:38] agnat has joined the channel [16:38] benburkert has joined the channel [16:39] dahankzter has joined the channel [16:41] peritus-: wink_: out of curiosity, which openssl version do you use ? [16:42] slashxr has joined the channel [16:44] DrunkDwarf has joined the channel [16:45] coffeecup: has anyone used node-couchdb to successfully retrieve attachments from the db? [16:47] mjr_: I've not put attachments in couchdb yet. [16:47] mjr_: What does node-couchdb do that's bad? [16:47] coffeecup: its workin fine so far but iam not able to retrieve attachments [16:48] auser has joined the channel [16:49] mAritz: hm, does anyone here know at what state cloud9 is supposed to be? right now nothing seems to work properly and I'm unsure whether it has something to do with my firefox version (thus I should open bugs) or if it's just that early in development. [16:49] hdon has joined the channel [16:49] sudoer has joined the channel [16:51] robotarmy has joined the channel [16:51] dohtem has joined the channel [16:51] dohtem has joined the channel [16:53] evanpro has joined the channel [16:54] dohtem has left the channel [16:54] micheil has joined the channel [16:54] auser has left the channel [16:54] zemanel has joined the channel [16:55] matt_c__ has joined the channel [16:55] MikhX has joined the channel [16:56] MikhX has joined the channel [16:56] shimondoodkin: how to know why my application is working super slow? and also writing super slow, very strange http://github.com/shimondoodkin/node-wurfl/blob/master/persist.js [16:57] shimondoodkin: it is executed thru here :http://github.com/shimondoodkin/node-wurfl/blob/master/index.js [16:58] threeve has joined the channel [16:58] cardona507 has joined the channel [16:58] mikew3c has joined the channel [16:59] shimondoodkin: v8 had some preformace stats of javascript how to do them? [17:00] shimondoodkin: maybe its the utf8 stream filter, it written the data to stream, the file did not written just created , when i ended the stream it started writing, node js CPU is at 100% and it is writing like 10K /s [17:00] noahcampbell has joined the channel [17:00] stephenjudkins has joined the channel [17:00] nsm has joined the channel [17:01] jstemmer has joined the channel [17:01] stephenjudkins has joined the channel [17:01] dgathright has joined the channel [17:03] sveimac has joined the channel [17:03] isaacs has joined the channel [17:05] benreesman has joined the channel [17:06] franksvalli has joined the channel [17:06] micheil: isaacs: would you have say five minutes to talk about a buffer / stream / parser thing? [17:06] isaacs: micheil: i saw your tweet, was thinking the same thing [17:06] micheil: heh [17:06] ircretary has joined the channel [17:06] micheil: well, it turns out most servers will flush the socket on write [17:06] isaacs: ok [17:07] micheil: so you'll actually never get a 0x00test0xFF0x00test... [17:07] micheil: packet [17:07] micheil: you'll only ever get: 0x00test0xFF [17:07] micheil: so would it make sense to still cater for the joint packet case? [17:07] micheil: (you're more likely to exceed the tcp packet size then to join packets) [17:09] deepthawtz has joined the channel [17:10] dpritchett has joined the channel [17:10] _numbers has joined the channel [17:10] aliem has joined the channel [17:10] saimon_ has joined the channel [17:10] micheil: I'm not sure if I should just write of the joint packets as a "never going to happen" case and just cater for parsing individual packets really fast [17:11] micheil: it's obviously getting too late. I'm making mistakes. [17:13] matt_c_ has joined the channel [17:13] isaacs: well, "never going to happen" usually means "never going to happen until it's a royal bitch to fix" [17:14] isaacs: so you may as well build your stuff to be flexible to that situation [17:14] _numbers: the non-blocking concept is kind of boggling my mind right now. [17:14] _numbers: does everything have to be written with callbacks? i miss being able to write blocking code [17:15] _numbers: like: step_1(); step_2(); step_3(); [17:15] dpritchett: there are special sync functions [17:15] _numbers: now its step_1(step_2(step_3())); [17:15] SubStack: it's a little different [17:15] cnu has joined the channel [17:15] _numbers: becomes really difficult to write if(step_1() && step_2()) { step_3(); } [17:15] dpritchett: shouldn't it have been step1(step2(step3))) all along? [17:16] SubStack: _numbers: the problem is that when your program is blocking you can't do anything else [17:16] dpritchett: maybe that's the FP enthusiast in me ;) [17:16] SubStack: yeah side-effects in conditionals are bad news anyways [17:16] saikat has joined the channel [17:16] mjr_: _numbers: it can take a while to get your head around purely evented systems if you've not written them before. [17:16] _numbers: what is the non-blocking equivalent of the last example w/ the if statement [17:16] SubStack: because then you rely on short-circuiting behavior and order of execution [17:16] _numbers: i need to wait for two conditions to finish executing before doing the third [17:17] SubStack: _numbers: you don't just translate synchronous code into asynchronous form, you approach problems differently [17:17] dpritchett: try the lispy way? (step-3 (step-2 (step-1))) [17:17] franksvalli has joined the channel [17:18] micheil: isaacs: I suppose. [17:18] isaacs: _numbers: check out some of the flow control libs out there [17:18] isaacs: _numbers: creationix's Step is pretty popular [17:18] micheil: isaacs: I think I've finally found a chance to properly write tested code. [17:18] isaacs: _numbers: i wrote an article on howtonode.org that you might find helpful [17:18] mjr_: _numbers: most people start with the nested callbacks method, which sorta looks like code you are used to, just indented more. [17:18] isaacs: _numbers: it's not as hard as it seems at first. [17:18] _numbers: ah ok i'll check that out [17:19] _numbers: the problem im trying to solve now is like: if (i_haz_download(file) && i_haz_resultset(sql)) { /* display user name from sql resultset beside user's picture from downloaded file */ } [17:19] _numbers: this is a picard web app [17:19] _numbers: i'll google node.js flow control libs [17:20] SubStack: _numbers: looks like you're needlessly polling [17:22] mjr_: _numbers: depending on the API you are using, you can probably do something like: download(url, function dl_callback() { db_query(file, function db_callback() { // done })}); [17:23] mjr_: Most libraries that need to do something that would block provide a way to pass in a callback to be invoked when the blocking thing is done [17:23] cferris has joined the channel [17:23] kgf: well I guess one potential question would be, why can't you do those two async ops simultaneously if they're completely independent? [17:23] jameshome_ has joined the channel [17:24] DrunkDwarf- has joined the channel [17:24] peritus- has joined the channel [17:24] jameshome_ has left the channel [17:24] kgf: funny thing is I'm pretty sure there's something in kriszyp's promise module in promised-io (and possibly others) that'd do exactly what you want [17:24] mjr_: Oh sure, you can do that [17:24] kgf: but that's only if promises are your cup of tea, obviously [17:25] mjr_: It's important to understand if you really do want them to run concurrently, or if you want serial execution. [17:25] kevwil has joined the channel [17:25] mjr_: It sounds like _numbers wants sequential, but ended up with concurrent by accident. [17:25] shimondoodkin: http://github.com/shimondoodkin/node-inflow - here is one of mine [17:25] kgf: oh. I was assuming he knew he wanted concurrent. I suppose either is possible. [17:26] tilgovi has joined the channel [17:27] vnguyen has joined the channel [17:27] micheil: mjr_: with buffers, can I copy past the end of a given buffer? [17:28] paulr_ has joined the channel [17:28] mjr_: past the end? [17:28] micheil: like, buf1 = new Buffer(26), buf2 = new Buffer(26) [17:28] micheil: can I do: [17:28] mjr_: The logic in buffer.copy() should do bounds checking. [17:28] bartt has joined the channel [17:28] Anti-X: why would you ever want to do that? [17:28] _numbers: it could be concurrent or sequential. i think they are independent and could be concurrent. the problem is actually that with Picard you have to return something to the browser. and i have to wait for both operations to finish before doing that [17:28] micheil: buf1.copy(buf2, 26, 0) [17:29] _numbers: it doesnt matter which one finishes first. but both have to be finished [17:29] micheil: so the resulting buffer == buf1 + buf2 [17:29] micheil: Anti-X: when you don't know how big to alloc buffers. [17:29] mjr_: micheil: It'll trim the copy to the length of the dest buffer [17:29] micheil: okay [17:29] davidascher has joined the channel [17:29] mjr_: which may be surprising. [17:29] Evet: which all-in-one framework you suggest to build a complete website? [17:30] isaacs: mjr_: hey, you've got some experience with streams that are flaky.. [17:30] micheil: mjr_: and buffer's can't be joint easily, can they? [17:30] aurynn: I recommend using a bunch of parts that all do what they do the best. [17:30] mjr_: isaacs: I flake streams on a daily basis. [17:30] mikew3c_ has joined the channel [17:30] isaacs: mjr_: what would be your first target ot start debugging something where the write() returns false, but drain never happens? [17:31] micheil: that's another thing node-websocket-server doesn't catch. drainage. [17:31] Anti-X: Evet, that's an invalid question [17:31] Anti-X: try again [17:31] mjr_: micheil: you'd need to make that join function yourself, I think. [17:31] jpld has joined the channel [17:31] mjr_: isaacs: what kind of writable stream? [17:31] isaacs: mjr_: http client [17:31] isaacs: your favorite :) [17:31] mjr_: ha [17:31] isaacs: apparently a new-ish problem publishing packages. [17:32] isaacs: afaict, only coincidentally related to yesterday's upset. [17:32] davidascher: i'm puzzled that require.paths is undefined, even if I define NODE_PATH. what did i do wrong? [17:32] mjr_: isaacs: Here's what I do whenever I debug streams. Go into events.js and add something that logs whenever any event is emitted. [17:33] isaacs: yikes. [17:33] mjr_: We really need some kind of general mechanism for like "event tracing" [17:33] isaacs: yeah [17:33] isaacs: Etrace [17:33] Anti-X: davidascher, did you sacrifice the mandatory badger? [17:33] davidascher: Anti-X: i substituted a beaver, was that a problem? [17:33] isaacs: mjr_: i actually built that into a system i built at yahoo once. you could listen to the "event" event [17:33] Anti-X: obviously [17:33] isaacs: (and cancel it) [17:33] mjr_: it's not that bad actually. You put in a line, you see a lot of emit this and that, and then you pretty quickly see what's going on. [17:34] mjr_: oh yeah, I guess we could have an event event, but I want it across all eventemitters [17:34] isaacs: yeah, you'd have to do emitter.on("event", function (whichEventWasIt) { ... }) [17:35] mjr_: isaacs: if I were to guess, I'd say that the stream just goes away, which is why you don't get teh drain event. [17:35] Anti-X: davidascher http://nodejs.org/api.html#require-paths-48 [17:35] nerdEd has joined the channel [17:36] mjr_: There are some strange interactions with close/end on the socket and end on the request that get confusing sometimes. [17:36] isaacs: mjr_: but this happens while i'm uploading somethign [17:36] mjr_: are you sure the connection is still up and happy? [17:36] davidascher: Anti-X: I saw that, but for me, require.paths is undefined, which seems to me means something is quite wrong. [17:36] isaacs: like, i upload 3 chunks, and then it says false, and drain doesn't show up. [17:36] Anti-X: well it doesn't say anything about NODE_PATH [17:36] davidascher: Anti-X: reconfiguring/building/installing node just in case. [17:36] mjr_: isaacs: well, shit [17:36] mjr_: isaacs: 3? [17:36] isaacs: oddly, what used to *never* work, is that if i just try to write ALL the bytes of the whole tarball, all at once, then that works. [17:37] davidascher: Anti-X: ah, but node --help does [17:37] mjr_: isaacs: that should work really well, BTW, as long as you have enough memory. [17:37] isaacs: suresure [17:37] isaacs: well, really, in this case, i should just sendfile that fucker anyhow. [17:37] mjr_: isaacs: but I'm lead to believe from massive socket queues in my redis lib that there are issues in there. [17:38] isaacs: since it's a file on disk, and i'm writing it unchanged to a socket. [17:38] mjr_: isaacs: in my redis lib, things are really solid if the node socket queue is small-ish, but intermittently get corrupted when the queue is large. [17:38] isaacs: i see [17:38] boaz has joined the channel [17:38] mjr_: isaacs: so I've been doing a lot of pause/resume action on streams lately. I haven't seen your upload thing after 3 chunks though. [17:38] dguttman has joined the channel [17:40] rauchg_ has joined the channel [17:41] davidascher: Anti-X: rebuilding & reinstalling node fixed it. weird. [17:41] Anti-X: no YOU're weird! er... [17:41] halfhalo: lol [17:42] _numbers has left the channel [17:42] isaacs: mjr_: it doesn't seem like 3 chunks is magic [17:42] isaacs: mjr_: sometimes it's 4 [17:42] Anti-X: no such thing as magic [17:43] saimon_ has joined the channel [17:43] Astro: hi [17:43] Astro: how do you like my new webapp? http://noatta.ch/r107392482 [17:44] Anti-X: Sorry, your browser lacks some important features to share files. We recommend upgrading to Firefox 3.6 or 4.0 & Chromium 6 or 7. [17:44] Anti-X: bad boy [17:44] Astro: what are you using? [17:44] halfhalo: Butbutbut... I use ie6! [17:44] Anti-X: opera [17:44] Astro: lol [17:44] deedubs has joined the channel [17:44] csullivan has joined the channel [17:45] Anti-X: you should use socket.io, may cause a little bit of extra traffic but at least you'll support almost any browser [17:45] Astro: I do [17:45] Anti-X: then: wtf? [17:45] Astro: it's just the File API opera doesn't implement [17:45] Astro: http://www.w3.org/TR/FileAPI/ [17:45] Anti-X: oh is that another new thing now [17:46] Anti-X: i think the w3c are bored out of their tits [17:46] Astro: http://caniuse.com/#feat=fileapi [17:46] Astro: bored? I used it at noatta.ch! [17:46] Astro: somebody is downloading from me already :) [17:47] Anti-X: can't you implement the file api using js? [17:47] Astro: how? [17:47] Astro: with hidden forms? ugh... [17:47] Anti-X: i mean, i assume the transfer takes place over websocket [17:47] sechrist: is there a driver for drizzle in nodejs yet? [17:47] Astro: no, it doesn't [17:47] Anti-X: oh [17:48] Anti-X: Note: Support is planned for Chrome 6, but not yet implemented [17:48] Anti-X: is what it says on that site [17:48] adambeynon has joined the channel [17:48] sechrist: socket.io is probably the most robust thing you're going to find in terms of browser compatibility [17:48] sechrist: (if you can get all of the transports working) [17:49] Anti-X: yup, it even worked on my samsung touchwiz's native browser [17:49] Anti-X: which is shit [17:49] sechrist: if you need cross domain though I wouldn't bother with socket.io [17:49] dgathright has joined the channel [17:49] Anti-X: i think they have fallbacks for that too [17:49] sechrist: they blow [17:50] sechrist: because you can really only do jsonp or similar [17:50] Anti-X: well what would you use instead? [17:50] sechrist: for crossdomain? [17:50] Anti-X: yeah [17:50] sechrist: a simple jsonp longpolling thing hand made [17:50] rauchg_: sechrist: [17:50] Anti-X: well they do jsonp long polling... [17:50] Anti-X: afaik [17:51] sechrist: yep [17:51] rauchg_: websocket, flash websocket, xmlhttprequest, xdomain in ie8, multipart in firefox [17:51] rauchg_: all handle cross domain [17:51] sechrist: since when? O.O [17:51] rauchg_: jsonp polling is only used for ie6-7 [17:51] rauchg_: since the beginnings of time? websocket has Origin negotiation [17:51] sechrist: yes but I thought it wasn't implemented [17:51] rauchg_: xmlhttprequest CORS [17:51] rauchg_: yeah it ise [17:51] rauchg_: speedo.no.de uses cross domain socket.io [17:51] rauchg_: since you include the widget in your website [17:52] Anti-X: w00t [17:52] sechrist: daaaamn alright [17:52] Anti-X: i couldn't even get it to connect to a different port! [17:52] Anti-X: maybe i did it wrong [17:53] rauchg_: Anti-X: we have an issue i think detecting different ports as cross domain haha [17:53] rauchg_: i need to merge a pull request [17:53] Anti-X: >_< [17:53] sechrist: a real product that uses konami code [17:53] rauchg_: it'll be fixed asap [17:54] Anti-X: ACTION slaps rauchg_ around a bit with programming quotes referencing humans and computers [17:54] sechrist: I've been home from the valley < 24 hours and I already miss it [17:55] halfhalo: which valley [17:55] sechrist: the silicon kind [17:55] halfhalo: Eh [17:55] DrunkDwarf has joined the channel [17:55] Anti-X: the dead one [17:55] halfhalo: To siliconey [17:55] halfhalo: Although I do like the right turn yield crap [17:55] dahankzter has joined the channel [17:55] agnat has joined the channel [17:55] halfhalo: Stupid LA and the not having that thing [17:56] sechrist: mikeal: are you aware of a drizzle client for node yet? [17:57] hannesw_ has joined the channel [18:00] benreesman: anyone's favorite example of an open source demo app using express and connecting to mysql backend? [18:01] aho has joined the channel [18:03] dgathright has joined the channel [18:04] dmcquay: ACTION <3's Astro's noatta.ch [18:04] ioNull has joined the channel [18:04] fabeat has joined the channel [18:04] ioNull: Hi.. Is there something wrong with node-static 0.5.1 and node 0.2.3? [18:04] mjr_: tjholowaychuk: know of anybody using mysql with express? [18:05] tjholowaychuk: mjr_: nope [18:05] tjholowaychuk: i dont know anyone using mysql at all actually with node [18:05] mjr_: felix is, of course [18:05] jameshome__ has joined the channel [18:05] ioNull: has no method 'copy' [18:05] ioNull: at [object Object]. (/usr/local/lib/node/.npm/node-static/0.5.1/package/lib/node-static.js:239:23) [18:05] ioNull: at [object Object].emit (events:27:15) [18:05] tjholowaychuk: yup [18:05] ioNull: at [object Object]._emitData (fs:738:29) [18:05] ioNull: at afterRead (fs:719:10) [18:05] ioNull: at node.js:768:9 [18:05] tjholowaychuk: hopefully [18:05] drudge: i have an express app with a mysql backend [18:05] tjholowaychuk: lol [18:05] mjr_: heh [18:06] drudge: using dbslayer + custom orm [18:06] ioNull: > . > Anybody knows what's wrong with node-static? [18:06] tjholowaychuk: benreesman: do you have more specific questions? you can use the configure() callbacks to connect to different databases [18:06] tjholowaychuk: based on NODE_ENV [18:06] technoweenie: mjr_: borobudur_redis: Doe anyone knows if the node.js client is a lot faster than the php one? [18:07] technoweenie: is there any work on some kind of cross platform redis benchmark tool? i'd be shocked if the php one was faster than yours [18:07] davidwalsh has joined the channel [18:07] mjr_: technoweenie: it is at least 10X faster according to someone on the redis list. [18:07] mjr_: technoweenie: node_redis is faster than php, I mean. [18:07] _numbers has joined the channel [18:08] technoweenie: cool [18:08] Astro: dmcquay: thank you [18:08] ioNull: - -. [18:09] dstevens has joined the channel [18:09] mjr_: technoweenie: I've asked on the list a couple of times if there's any way to compare performance across languages, and there's no good answer. [18:09] benreesman: tjholowaychuk: no just wondering if there was a complete app somewhere that i could study [18:10] pedrobelo has joined the channel [18:10] dmcquay: Astro: http://www.synchrosinteractive.com/blog/9-nodejs/50-noattach-instant-personal-file-sharing [18:10] Anti-X: Astro, just an html comment..

Use JS..

<-- this is where you use