[00:05] the_undefined_: fictorial: what are you expeciting? [00:06] the_undefined_: to write a byte with the value 42? [00:06] tapwater: does process.fs no longer have the method cat? [00:06] mediacoder: tapwater: its posix.cat now [00:07] _ry: can i change "posix" to "fs" ? [00:07] the_undefined_: _ry: fine with me [00:07] tapwater: ah, thanks mediacoder [00:07] mediacoder: but wait, maybe ry is about to change it :-P [00:08] tapwater: well whatever happens, node_chat depends on it [00:09] _ry: oh yeah [00:10] the_undefined_: _ry: if node.js had fastcgi I would throw out nginx for debuggable.com I think :) [00:10] the_undefined_: _ry: actually lighttpd [00:10] the_undefined_: _ry: no more tinkering with config files, pure JS control :) [00:12] inimino: _ry: 'fs' is pretty short for a top-level module, maybe just 'posix' [00:14] tapwater: yeah, looks like the new node updates break node_chat [00:16] sudoer has joined the channel [00:21] cloudhead has joined the channel [00:22] frodenius: _ry: do you still have your ircd script up somewhere? [00:24] _ry: frodenius: https://gist.github.com/a3d0bbbff196af633995 [00:24] frodenius: thx [00:24] _ry: wow there are a bunch of forks [00:26] malkomalko has joined the channel [00:39] JimBastard has joined the channel [00:40] _ry: inimino: is too short a problem? :/ [00:41] JimBastard: who was working on the monogodb bindings for node [00:51] Connorhd__: JimBastard, I dunno if anyone is doing it properly [00:53] JimBastard: damn [01:01] inimino: _ry: well, I wouldn't rename the JavaScript Date object 'D', for example... 'posix' seems more descriptive [01:01] inimino: _ry: I don't have any particularly strong feelings about it if other people prefer 'fs' though [01:05] orlandov: JimBastard: i'm fooling around with wrapping the mongodb C bson lib, but mostly as a learning excercicse [01:05] orlandov: havent touched the protocol yet [01:06] orlandov: urgh something somewhere is mangling my doubles! >:O [01:10] ashb: orlandov: i've got some code you might be able to look at for the mognodb BSON stuff [01:10] ashb: http://github.com/ashb/mongodb-flusspferd/blob/master/src/mongodb.cpp#L99-227 [01:11] ashb: not sure if much of it is relative to you/node's C api [01:12] ashb: oh adn the next 4 functions too [01:14] iamstef has joined the channel [01:14] iamstef: good evening [01:16] orlandov: ashb: here's what i've got so far, it's quite simple at the moment and probably leaks memory (my c++ is rusty at best :) [01:16] orlandov: http://github.com/orlandov/node-mongodb/blob/master/bson.cc [01:17] orlandov: i've almost a set of symmetrical decoding functions done that i'll post tonight [01:17] orlandov: fg [01:17] ashb: nothing glaring from a quick glance [01:18] orlandov: i think i just figured out my double problem [01:18] orlandov: thanks to _ry's Encode function [01:20] jtaby has joined the channel [01:20] orlandov: next i want to figure out how to extend the C++ EventEmitter [01:43] sudoer has joined the channel [02:07] majd has joined the channel [02:11] JoePeck has joined the channel [02:11] jed has joined the channel [02:16] mattly_ has joined the channel [02:21] RayMorgan_ has joined the channel [02:21] sudoer has joined the channel [02:43] jtaby has joined the channel [02:52] majd has joined the channel [03:06] alexiskander has joined the channel [03:24] jtaby has joined the channel [03:35] fictorial has joined the channel [03:45] fictorial: orlandov: what was your doubles problem? [03:46] fictorial: (for the logs:) the_undefined: my problem with http://gist.github.com/252049 is that I want to write out 8 bytes for a double/number (e.g. 42) and even though I'm using 'binary' encoding, it's being cast to the string "42" [03:47] fictorial: (or for _ry ^^^) [03:47] jed has joined the channel [03:48] fictorial: orlandov: I just read http://pastie.org/734539 ... sure that'd work I guess but that's really inefficient. has to be a better way (from JS) [03:49] fictorial: s/$/using Node's API/ [03:52] jtaby_ has joined the channel [03:58] dnolen has joined the channel [04:00] paan has joined the channel [04:01] soveran has joined the channel [04:06] JimBastard has joined the channel [04:10] scudco has joined the channel [04:15] frodenius: it could be made faster with bit shifts [04:16] frodenius: a little little bit [04:17] frodenius: oh and storing the codes in an array and mapping them on fromCharCode and then using join [04:17] frodenius: will probably bring a few ms [04:19] fictorial: yeah this isn't the right way to write out binary data though. proper blobs are needed. [04:20] fictorial: it shouldn't take thousands of cycles to write out a few ints :) [04:22] RayMorgan has joined the channel [04:23] fictorial: I think I'm just going to create a C++ based add-on for my node project/experiment [04:23] fictorial: I need mmap anyway [04:24] aurynn: What are you trying to do? [04:24] rbranson_: http://wiki.github.com/rbranson/node-ffi/node-ffi-tutorial [04:24] rbranson_: anyone want to start testing this? :D [04:25] aurynn: hmm. It's weird getting my head into a callback mindset [04:26] fictorial: rbranson_: keep up the good work! lots of commits flying by. great project [04:26] rbranson_: getting callbacks passed to async FFI calls was a biotch [04:26] rbranson_: well, getting them to execute properly anyway [04:26] rbranson_: since V8 can only execute from a single thread really [04:27] aurynn: V8 needs to be multithreaded! [04:27] aurynn: So [04:27] rbranson_: thanks... hopefully some people will start testing it out so I can find/squash threads [04:27] aurynn: I'm writing prepared statements in postgres.js [04:27] fictorial: heh your Pointer looks like a good basis for a "blob" type [04:28] rbranson_: except that it's totally unchecked [04:28] rbranson_: :) [04:28] aurynn: and I'm trying to figure out how to make this callbackable. [04:28] Connorhd: wow rbranson_ that looks awesome [04:28] rbranson_: standing on the shoulders of giants [04:29] rbranson_: node, libev, and libeio made this a cakewalk [04:30] fictorial: ACTION needs to learn the v8 api [04:30] rbranson_: v8 has a great API as well [04:30] fictorial: rbranson_: where'd you pick it up from? [04:30] rbranson_: coding this basically [04:30] Connorhd: ACTION needs to learn C, C++, etc etc :( [04:30] fictorial: rbranson_: ok [04:30] rbranson_: unfortunately it's not so well documented [04:30] rbranson_: the best docs are in v8.h [04:31] fictorial: k [04:32] aurynn: the flow is var s = db.prepare("query"); s.execute([args],callback); [04:32] aurynn: but blocking on .prepare seems.. wrong [04:32] Micheil: hmm? [04:32] aurynn: but I can't see any other way to do it [04:32] alexiskander has joined the channel [04:32] Micheil: someone doing db stuff? [04:32] aurynn: yes, I am [04:33] Micheil: aurynn: what backend? [04:33] aurynn: postgres [04:33] rbranson_: yeah, query preparation in postgres COULD hit the disk [04:33] dnolen has joined the channel [04:33] ciju has joined the channel [04:34] rbranson_: it's likely that in any real world app it won't though... I'd think all that metadata should be cached in memory [04:34] aurynn: issuing the prepare is a DB query itself. So I'm not sure how this should work. [04:34] rbranson_: well, it does have to travel over the network, so :) [04:34] aurynn: well, yes. [04:35] aurynn: I'm getting at "Hey, I don't get how to handle this could be done with callbacks, plz help" [04:35] aurynn: :) [04:35] Micheil: aurynn: perhaps using promises? [04:37] aurynn: hmm [04:37] aurynn: ACTION reads on promises [04:37] rbranson_: yeah, it'd be like... db.prepare("query").addCallback(function (query) { query.execute(...).addCallback(...) }); [04:37] rbranson_: promises are how all of the posix I/O stuff works [04:37] aurynn: hm [04:38] aurynn: so .prepare returns a promise.. which raises a "success" event, which'll call what was provided in .addCallback [04:38] aurynn: Sexy. [04:38] rbranson_: you create a Promise, return it to the caller, then whenever your event happens, you just call promise.emitSuccess(args); [04:38] rbranson_: yee [04:38] aurynn: Okay. [04:39] aurynn: Okay.. [04:39] aurynn: I see how to do this now [04:41] aurynn: Wow. This is brilliant. [04:41] frodenius: fictorial: ryan already did a blob v8 patch [04:43] frodenius: i believe, maybe not, can't find it [04:44] fictorial: frodenius: hmm, I saw the String hack earlier which referenced a google groups thread that ended in someone from google asking ryan to submit his code for review [04:44] fictorial: and just now I noticed ByteString... reading... [04:45] Micheil: aurynn: you could also use the lower level process.EventEmitter [04:46] aurynn: Micheil, a Promise seems to be close to what I want [04:46] aurynn: success or error [04:46] Micheil: aurynn: okay [04:46] rbranson_: yeah, a DB prepare only really executes a single event [04:46] kassandry has joined the channel [04:47] alex-desktop has joined the channel [04:47] aurynn: now to remember the scoping rules for this [04:49] fictorial: frodenius: yeah, that's not it or at least it seems like the start of it; nothing uses it yet [04:53] RayMorgan: ACTION wishes there was a faster way to go from v8::String to char* [04:54] aurynn: does V8 have list comprehensions? [04:55] RayMorgan: no [04:55] fictorial: see you local python dealer [04:55] aurynn: I'm generally a pythonista. [04:55] aurynn: hence, listcomps are win [04:55] fictorial: I gathered as much :) [04:55] fictorial: they are nice, indeed [04:56] RayMorgan: They are following the ECMA script standard pretty closely (at least so far). I know that SpiderMonkey has list comprehensions [04:57] aurynn: node isn't on spidermonkey, sadly. [04:57] fictorial: or gladly ;0 [04:57] rbranson_: gladly for sure [04:57] aurynn: I dunno. No list comps.. [04:57] aurynn: ;) [04:58] fictorial: if that's your #1 sticking point ... [04:58] fictorial: heh [04:59] alex-desktop has joined the channel [05:00] Micheil: aurynn: __noSuchMethod is also awesome [05:00] aurynn: Micheil, ? [05:00] fictorial: like method missing in ruby I take it? [05:00] rbranson_: like method_missing in ruby [05:00] rbranson_: jinx [05:01] fictorial: dang got me [05:01] Micheil: aurynn: something that the mozilla engine added, it allows you to create a method on an object like method missing in ruby [05:01] aurynn: Oh, sweet. [05:01] aurynn: really? [05:01] aurynn: ACTION senses disgusting metaprogramming [05:01] rbranson_: javascript already has plenty of disgusting meta :) [05:02] Micheil: aurynn: it allows for things like really dynamic Model constructors and stuff [05:02] aurynn: and dynamic functions, and all sorts of fun stuff [05:02] aurynn: similar to AUTOLOAD in perl or __getattr__ in python [05:02] rbranson_: it also screws up performance alot :) [05:02] Micheil: rbranson_: sadly, I'm sure. [05:02] rbranson_: it's far better to create dynamic prototypes [05:03] rbranson_: that way all of the V8 magic inline caching nonsense can work it's voodoo [05:03] Micheil: rbranson_: I was going to use it in a project that did similar to .require(), and have it "autoload" in code [05:03] aurynn: hm. How do I raise an error? [05:03] Yuffster has joined the channel [05:04] RayMorgan: throw("error"); [05:04] rbranson_: Micheil, autoload would be sweet [05:04] Micheil: rbranson_: yeah, but as few browsers support it, I couldn't use it. [05:05] dnolen_ has joined the channel [05:05] RayMorgan: aurynn: or more properly: throw(new Error("error")) [05:05] aurynn: Aah. [05:06] rbranson_: yeah, if you don't do throw new Error... you won't actually get the error output, just the line of code it happened at [05:06] Micheil: RayMorgan: or just: throw new Error("error") [05:06] RayMorgan: yeah [05:09] fictorial: the v8 api is nice (so far)... I grok Handle, Local, Persistent, HandleScope so far... next up are ObjectTemplate and FunctionTemplate [05:09] Micheil: fictorial: are you learning the C++ api? [05:09] alex-desktop: fictorial: Yeah, v8's not bad once you get used to it... [05:09] fictorial: Micheil: yes [05:09] alex-desktop: but garbage collecting things that can be used both from C++ and JavaScript can be a pain. [05:10] fictorial: alex-desktop: good to know. I'll keep an eye for that. [05:10] alex-desktop: I'm not sure what node.js does (maybe everything is controlled by JavaScript so it is not an issue?) [05:11] fictorial: well, Value's design seems like a big wart at first blush... "IsBoolean" [05:11] fictorial: DIY RTTI FTW [05:11] alex-desktop: GC-wise, It's just that, you can't get rid of the object from C++ until JavaScript is done with it, but can't get rid of it from JavaScript until it is done in C++. [05:12] alex-desktop: As for that RTTI, I think it makes sense because JavaScript has only a strict, limited set of types [05:12] rbranson_: yeah, JavaScript's type system is way different [05:12] fictorial: alex-desktop: indeed, it's just not common for base classes to know or care about subclasses [05:13] aurynn: hm. Okay, I think this does prepared statements now. [05:13] fictorial: it's thus more of a facade I guess... need to read it more closely [05:16] dnolen_ has joined the channel [05:21] _ry: morning [05:21] _ry: ACTION still jet lagged [05:22] rakeshpai has joined the channel [05:45] alex-desktop has joined the channel [05:48] rakeshpai has joined the channel [05:51] Micheil: morning ry [05:51] Micheil: erm, _ry [05:57] aurynn: ACTION just about has a stupid implementation of prepared queries working [05:57] rbranson_: error: ISO C++ forbids declaration of ?Promise? with no type [05:57] rbranson_: nice [05:59] eddanger has joined the channel [06:01] alex-desktop has joined the channel [06:05] brosner has joined the channel [06:37] binary42 has joined the channel [06:39] cmlenz has joined the channel [06:42] dnolen_ has joined the channel [06:45] Micheil: aurynn: I don't suppose you're the tim guy on the mailing list, are you? [06:45] aurynn: nope :) [07:00] rakeshpai has joined the channel [07:25] Micheil: anyone know what conference is on at the moment? [07:28] rbranson_: hmm... V8 can execute function abs(val) { return val >= 0 ? val : val - (val * 2); } a million times in 0.018s :D [07:31] frodenius: why val - val^2 ? why not just -val? [07:32] rbranson_: i dunno, it's late and this is just a test :) [08:12] CIA-28: node: 03Ryan Dahl 07master * ra30ac92 10/ (src/node_binary.cc src/node_binary.h): Remove accidentally committed files. - http://bit.ly/6XKUoJ [08:12] CIA-28: node: 03Ryan Dahl 07master * r45a806a 10/ (12 files): [08:12] CIA-28: node: Statically define symbols [08:12] CIA-28: node: ~7% improvement in hello world HTTP response bench. - http://bit.ly/4rXRyF [08:20] jtaby has joined the channel [08:20] Micheil: hmm.. _ry I keep getting an error on `make test` [08:20] Micheil: the error appears to do with TLS support [08:21] Micheil: although, it's difficult for me (on ubuntu) to get the required version of gnutls [08:26] _ry: Micheil: what exactly is the error? [08:26] Micheil: https://gist.github.com/0fef11241b9ecbdc9472 [08:27] _ry: it's okay, you just odn't have tls support [08:27] Micheil: I'm just trying to make and install the latest gnutls, the one that's in the ubuntu repos is about 4 versions back (2.4.1 vs 2.8.5) [08:27] Micheil: _ry: is it possible to disable the tls tests if tls isn't compiled in? [08:28] _ry: Micheil: probably - i haven't thought about it much [08:28] Micheil: okay [08:28] Micheil: also, have you had a chance to look over that cookie setter/getter code I posted to the mailing list? [08:30] Micheil: also, on make of node, I'm getting a few warnings come up, I'm not sure exactly what they're about though [08:33] Micheil: hmm, with a newer gnutls build, all tests pass :) [08:45] _ry: Micheil: hmm [08:45] _ry: no i haven't looked at the cookie thing yet [08:45] _ry: actually i forgot about it [08:47] the_undefined has joined the channel [08:57] johan-s has joined the channel [08:59] Micheil: _ry: okay, well, when you get a chance, it'd be appreciated [09:06] _ry: Micheil: yeah looks good [09:06] _ry: Micheil: how could i alter the interface so you didn't have to rewrite sendHeader? [09:07] Micheil: I'm not sure [09:07] JoePeck has joined the channel [09:08] Micheil: maybe have an internal cookie object, and when setHeaders is called mixin the Set-Cookie header into the cookies object [09:08] Micheil: then stringify them and send them along or something [09:21] mediacoder: onBeforeSendHeaders event, where you could alter the headers, then send them [09:23] _ry: meh [09:24] _ry: i guess he just needs a setHeader() type thing [09:25] _ry: what if res.headers is a blank object [09:25] _ry: and people can just set them [09:25] Micheil: yeah, that sounds good [09:26] _ry: then at some point you do res.sendHeader(200) [09:26] Micheil: yeah [09:26] Micheil: or preferably: res.sendBegin or res.sendStatus() [09:26] _ry: res.begin(200) [09:26] _ry: res.finish() [09:26] _ry: kind of nice [09:27] Micheil: yeah [09:27] Micheil: or res.start(200); res.finish(); [09:27] Micheil: (it could almost reference a race.. :P ) [09:28] Micheil: actually, yeah, res.start() makes sense, because the start is the opposite to the finish [09:28] Micheil: so, the api would be something like: res.start(/*Integer*/ statusCode ) [09:29] _ry: Micheil: yeah that looks good [09:29] _ry: hmm [09:29] Micheil: I guess you could leave in sendHeaders for backwards-compat, but make it interface with res.start() and res.headers [09:30] _ry: sendHeaders would ignore res.headers? [09:31] CIA-28: node: 03Ryan Dahl 07master * r4ddfd8a 10/ src/node_file.cc : Fix posix.statSync() - http://bit.ly/8dfSRG [09:31] Micheil: no, it'd process.mixin() them [09:31] cmlenz has joined the channel [09:32] _ry: ok [09:33] Micheil: that also means in theory you could do multiple sendHeaders [09:34] _ry: nah, should raise an error if you try it again [09:34] Micheil: okay [09:34] Micheil: so you'd need to set a flag on the res object that the sendHeaders has already been called. [09:34] Micheil: or alternatively make it a self deleting method [09:35] Micheil: (that could trip developers out badly though) [09:36] brosner has joined the channel [09:37] _ry: Micheil: yeah just some flag would work [09:37] Micheil: I wish there were more docs on writing tests.. [09:38] _ry: Micheil: for the assert stuff? [09:39] Micheil: yeah, I'm wishing to write some tests for the sessionmanager code I'm working on [09:39] _ry: Micheil: sounds like a great way to contribute! [09:39] _ry: patch doc/api.txt :) [09:40] Micheil: ACTION only started writing tests for code a few months back, so is still rather foreign to it [09:40] _ry: just got to look in assert.js and write it down [09:40] Micheil: _ry: I'll create a ticket on the github tracker, and assign it to myself, I've got holidays in just under a week [09:43] Micheil: http://github.com/ry/node/issues#issue/25 [09:43] Micheil: bbs [09:58] Micheil: _ry: are the api docs in markdown? [10:00] Micheil: bbl again. [10:01] tlrobinson has joined the channel [10:01] xantus_ has joined the channel [10:01] hassox has joined the channel [10:09] sveisvei has joined the channel [10:16] jcrosby has joined the channel [10:18] michaelk^ has joined the channel [10:19] tlrobinson has joined the channel [10:19] xantus_ has joined the channel [10:19] hassox has joined the channel [10:23] JimBastard has joined the channel [10:28] simoncpu has joined the channel [10:28] simoncpu: hi. i'm trying to compile nodejs on freebsd [10:28] simoncpu: i get this error: [10:28] simoncpu: hmmm... where did i put my error [10:29] simoncpu: node-v0.1.21/deps/v8/src/platform-freebsd.cc:45:56: error: execinfo.h: No such file or directory [10:29] simoncpu: what lib do i need to install for execinfo.h? [10:29] simoncpu: ah, libexecinfo [10:31] simoncpu: do you guys have a wiki or something so that i can paste this note? [10:32] JimBastard: probaly the github [10:32] simoncpu: oki [10:32] JimBastard: create an issue? [10:34] Nailor: That's not an issue [10:34] ciju has joined the channel [10:38] simoncpu: yepp, not really an issue [10:38] simoncpu: but noting it will save other people headache [10:39] Nailor: There's a wiki in github too, so maybe you can add some notes there [10:39] JimBastard: sweet ive got retardbox.com kinda working now [10:40] JimBastard: photo upload time maybe [10:40] JimBastard: http://retardbox.com:8000/ [10:40] JimBastard: ahh i think i killed it ahaha [10:40] JimBastard: oops [10:41] mediacoder: :-) [10:41] JimBastard: almost [10:41] JimBastard: saw mediacoder's request [10:41] JimBastard: coffee time [10:41] mediacoder: hehe, didnt get through tjo [10:41] mediacoder: *tho [10:41] JimBastard: yeah i saw that [10:41] JimBastard: it hung, looking for a file that wasnt there [10:42] JimBastard: its a bit strange like that [10:47] JimBastard: hey mediacoder [10:48] JimBastard: you wanna try again? http://retardbox.com:8000/ [10:51] JimBastard: well it will be up and down [10:51] JimBastard: for a bit [10:52] simoncpu: yikes [10:52] simoncpu: puts() can no longer be used, right? [10:53] JimBastard: sys.put() [10:53] JimBastard: ? [10:53] JimBastard: sys.puts() [10:55] simoncpu: yepp [10:55] simoncpu: sys.puts [10:56] tlrobinson has joined the channel [10:56] xantus_ has joined the channel [10:56] hassox has joined the channel [10:58] sveisvei: jim, you just got spammed :) [10:58] JimBastard: you could do MUCH worse [10:59] sveisvei: is that a dare :)? [10:59] JimBastard: noooo [10:59] JimBastard: lol [10:59] sveisvei: hehe, oki :) [10:59] JimBastard: i think its possible to escape the templating [10:59] JimBastard: let me see what i can do [11:00] sveisvei: substr :P [11:00] JimBastard: can you make this page inject? http://retardbox.com:8000/Hax [11:00] JimBastard: i have debugger running [11:02] JimBastard: lol drop tables [11:02] jcrosby has joined the channel [11:03] JimBastard: sup jcrosby [11:04] jcrosby: JimBastard: sup [11:04] JimBastard: messing around with http://retardbox.com:8000/ [11:05] JimBastard: http://retardbox.com:8000/session.html [11:05] JimBastard: session history [11:05] JimBastard: http://retardbox.com:8000/debug.html (messed up stats) [11:05] JimBastard: you can click through each session and track everyones history [11:06] JimBastard: {"id": "VggfLtdXtDJ", "data": {"history": ["/Hax", "/favicon.ico", "/", "/js/debug.js", "/js/jquery.js", "/js/json.js", "/mediacoder", "/mediacoder", "/mediacoder"], "counter": 8}, "path": "/", "persistent": true, "lifetime": 604800, "expiration": 1260961532761} [11:06] mediacoder: so thats the enxt nodebased dropbox killer? :-) [11:07] JimBastard: ? [11:07] mediacoder: wondering if retardbox runs on mongodb (guess thats only funny, if you know german :-D) [11:07] JimBastard: no database used [11:07] JimBastard: ^_^ [11:07] JimBastard: lolwut [11:07] mediacoder: JimBastard: whats that thing for [11:07] _ry: simoncpu: hey [11:08] JimBastard: http://retardbox.com:8000/RetardBox [11:08] JimBastard: mediacoder ^^ [11:08] mediacoder: JimBastard: hm.. cant grasp the full concept yet :-) [11:08] JimBastard: its all posix right now, ill probaly switch to redis (or mongo if someone makes the driver) [11:08] JimBastard: once i start adding images you'll see [11:08] mediacoder: hehe, ok [11:08] JimBastard: i might just keep it posix and use git [11:09] JimBastard: that would be insanely retarded [11:09] mediacoder: hehe [11:09] JimBastard: i think someone haxed it [11:09] mediacoder: ACTION is innocent [11:10] jcrosby: ACTION is also innocent [11:10] JimBastard: ACTION shuts it down [11:10] sveisvei: :P [11:10] simoncpu: _ry: wazzzzup [11:10] JimBastard: :-D [11:11] jcrosby: JimBastard: i'll be back in IRC in a few hours. need to get some sleep before going in to the office. [11:11] JimBastard: peeace [11:11] JimBastard: i dont know if anyone actually haxd it [11:11] JimBastard: i saw a smiley face in the log and got scared [11:12] webben has joined the channel [11:14] JimBastard: how the hell do i delete this wonky file name now [11:14] JimBastard: "'(function(GLOBAL){} GLOBAL.x = "AsdasD"; debug.log(x); )(); [11:14] sveisvei: lol, you cant? [11:15] JimBastard: im kinda a linus noob [11:16] sveisvei: <- same, so cant help you there. [11:17] _ry: simoncpu: hey would be cool if wscript exited with a message telling you to install libexecinfo [11:17] JimBastard: you broke out of the wrong security box lol [11:17] JimBastard: that executes code client-side [11:17] JimBastard: which doesnt really do anything [11:18] simoncpu: _ry: hahaha... one patch coming up [11:18] simoncpu: =) [11:20] simoncpu: _ry: yikes, there is already a check at line 120 [11:20] simoncpu: but i dunno why it didn't work [11:21] _ry: simoncpu: oh yeah. maybe you can get it to work? [11:21] mediacoder: _ry: what is libexecinfo for? i also dont have it and everything works so far (for some weeks) [11:21] _ry: mediacoder: freebsd thing for backtraces [11:21] Micheil: simoncpu: I'd just create a wiki page "Installing Node.js on FreeBSD" [11:21] mediacoder: ah, ok [11:22] simoncpu: Micheil: http://wiki.github.com/ry/node/freebsd [11:23] malkomalko has joined the channel [11:24] Micheil: oh, yeah, _ry: what's the syntax used for the api docs? [11:24] Micheil: markdown doesn't convert it, is it textile or something? [11:25] JimBastard: i always wondered what was wrong with thml [11:25] JimBastard: html [11:25] _ry: Micheil: asciidoc [11:25] Micheil: ah [11:25] Micheil: okay thanks [11:27] mediacoder: _ry: http://pastie.org/735204 [11:28] _ry: mediacoder: ? [11:29] _ry: at the end of 'make' ? [11:29] mediacoder: no idea. just wanted to build [11:29] mediacoder: yea [11:29] mediacoder: all is successful though [11:30] _ry: hmm. something is funky with waf and threads [11:30] _ry: can't figure out what it is [11:30] _ry: maybe i should update to the latest version [11:30] mediacoder: i remember seeing this some weeks ago.. then all was fine, and this just reappeared [11:36] paan has joined the channel [11:43] tlrobinson has joined the channel [11:43] xantus_ has joined the channel [11:43] hassox has joined the channel [11:43] webben1 has joined the channel [11:56] the_undefined: _ry: how do you want to go about the whole Deferred thing? I.e. do you want people to discuss it on the mailing list, or would you like me to start working on a patch for node? [11:58] malkomalko: what are the benefit of deferred's over promise's? should I just go take a look at the dojo deferred's, is that where your getting the idea from? [11:58] the_undefined: malkomalko: yes, I ported dojo deferreds to node.js [11:58] the_undefined: malkomalko: with one exception, I made the automatic try...catch mechanism optional [11:58] the_undefined: here is my code: http://github.com/felixge/node-deferred/ [11:59] the_undefined: and here are the docs: http://api.dojotoolkit.org/jsdoc/1.2/dojo.Deferred [11:59] malkomalko: I haven't followed the node commits lately.. I'm giving a node intro talk at nyc.js tomorrow [11:59] malkomalko: if this is coming soon, maybe I should talk about it? [12:15] nefD has joined the channel [12:19] _ry: erikcorry: does this make sense to do http://pastie.org/735253 [12:19] _ry: erikcorry: it allows charCodeAt() to work with ExternalAscii strings [12:19] _ry: (for high valued characters) [12:21] erikcorry: You won't get that into V8, I'm afraid. [12:21] erikcorry: Ascii strings don't have high valued characters. [12:21] Micheil: _ry: I'll need a had in a sec, I'm having trouble compiling that documentation still [12:21] erikcorry: By definition. [12:22] Micheil: _ry: I keep getting the error: https://gist.github.com/57f4435c687d1fc9c67a [12:22] erikcorry: We would be more likely to add an assert there that the character wasn't high valued. [12:22] erikcorry: The problem is that if we allowed 8 bit characters in ASCII strings there are a lot of things that would be buggy,. [12:22] _ry: erikcorry: yeah, trying to hack it for storing binary :) [12:23] Micheil: _ry: are you using any special flags within asciidoc? [12:24] _ry: Micheil: use "make doc" [12:24] Micheil: _ry: uhh...https://gist.github.com/57f4435c687d1fc9c67a [12:25] _ry: the_undefined: maybe we should discuss it on the list. i like the deferreds though. [12:25] erikcorry: _ry: You have to use ExternalUnsignedByteArray. [12:25] the_undefined: _ry: ok, I'll try to make a good post explaining the situation and benefits from deferreds for the list [12:25] erikcorry: That means it's not a string. [12:26] erikcorry: I don't see what you can do about that. [12:26] erikcorry: Well, OK, how about this. [12:26] erikcorry: If there are bits of the data that are ASCII you can put an external string on that. [12:26] _ry: erikcorry: yeah - i think that's a good alternative. what would be cool with the string would slicing it. like reading a buffer from a socket and slicing out the http header parts [12:26] erikcorry: And at the same time put an ExternalUnsignedByteArray over the wole thing. [12:27] erikcorry: I think we are saying the same thing here. [12:27] erikcorry: You can keep a reference count on your buffer. [12:27] erikcorry: When you get a callback you decrement. [12:27] erikcorry: So when the last string and the last nsigned byte array has stopped using the buffer you can free it up. [12:28] erikcorry: I suppose you could even have the ExternalAsciiString cover the whole buffer. [12:28] erikcorry: We probably wouldn't notice as long as you don't actually try to access the non-ASCII parts of it. [12:29] erikcorry: Though I wouldn't want to guarantee that. [12:30] _ry: i did a few tests where using string[i] and charCodeAt seemed to work okay. but, yeah, if you say that it's going to break i believe you [12:30] erikcorry: It probably works. [12:30] erikcorry: But if you use the API to get a UTF8 version of that string it will copy it 1:1 [12:30] erikcorry: Which I guess might be OK if it actually is UTF8 [12:31] erikcorry: If it's Latin1 you lose. [12:31] _ry: the cool think about doing the ExternalAsciiString over the whole thing is that if i'd slice it in js, i v8 will keep trace of the references for me [12:31] erikcorry: If you do a regexp on it it will fail in strange ways,. [12:31] erikcorry: Unfortunately we dropped sliced strings in V8 [12:31] erikcorry: As part of an ongoing simplification of strings. [12:31] _ry: oh, does it copy it? [12:31] erikcorry: These days a string slice does a copy. [12:31] erikcorry: It turned out basically it wasn't being used. [12:31] _ry: ah, okay. well nevermind then [12:32] erikcorry: The few places where it was we could make a JS object with a string, length and offs.et [12:32] erikcorry: In other words the same thing, but it's not a String. [12:32] erikcorry: So all the places where we have to handle strings we don't have to check for sliced strings any more. [12:33] erikcorry: Sorry about that. [12:33] erikcorry: But we had 4 kinds of strings: cons, slice, external, sequential. [12:33] erikcorry: Then we had ASCII and UTF16 [12:33] erikcorry: Then we had symbol and non-symbol [12:33] erikcorry: Then we had short, medium and long ways to encode the length/hash field [12:34] _ry: i think having the big ExternalUnsignedByteArray giving it some special "asciiSlice" methods might be good [12:34] erikcorry: The complexity was making it impossible to implement anything in generated code. [12:34] _ry: using the ExternalAsciiString [12:34] erikcorry: We had to do all strings in C++ code. [12:34] erikcorry: I think that sounds sensible. [12:35] erikcorry: But we also want to optimize ExternalUnsignedByteArray. [12:35] erikcorry: For example I could see us making [] fast on it if it isn't already. [12:35] erikcorry: It would return a number unlike [] on strings that returns a short string. [12:36] alex-desktop has joined the channel [12:36] _ry: i don't expect people to be hitting that much - likely it will be usually an opaque object for passing binary between c++ modules in node [12:36] erikcorry: Yeah. [12:36] _ry: by 'that' i meant [] [12:36] erikcorry: sure [12:37] erikcorry: I wonder whether we could make String.prototype.indexOf work fast on External unsigned byte arrays. [12:39] erikcorry: I'm not sure what that would look like in terms of compatibility on the web... [12:39] _ry: without coercing it into a string? would be great [12:40] erikcorry: Comment from the implementation of indexOf: [12:40] erikcorry: // We have an ASCII haystack and a non-ASCII needle. Check if there [12:40] erikcorry: // really is a non-ASCII character in the needle and bail out if there [12:40] erikcorry: // is. [12:41] erikcorry: So if you search for ä in a 100 million byte ASCII string it returns -1 without looking. [12:44] simoncpu: uh... [12:44] simoncpu: how can i attach a patch to googlegroups? [12:44] _ry: simoncpu: just attach it to your email (or you can just email me the patch) [12:45] simoncpu: oki [12:45] simoncpu: ry@tinyclouds.org, right? [12:48] Micheil: simoncpu: yus, that'd be ry's email [12:49] ryah_away: simoncpu: yeah [12:52] Micheil: ryah_away: any ideas about the asciidoc errors? [12:52] sztanphet has joined the channel [12:56] ryah_away: Micheil: nope, not off hand [12:56] Micheil: it was my asciidoc version [12:56] Micheil: fuck I hate ubuntu. [12:57] Micheil: [12:58] Micheil: ryah_away: are the docs on the site out of date? [12:59] Micheil: or not [13:00] Micheil: ryah_away: where should I add in the docs for the testing framework? [13:01] rakeshpai has joined the channel [13:08] webben has joined the channel [13:12] simoncpu: hey [13:13] simoncpu: who turned off the retardbox? [13:13] simoncpu: hehehe [13:13] simoncpu: !seen JimBastard [13:13] simoncpu: there goes my evil plans of pasting a goatse image [13:18] soveran has joined the channel [13:21] Micheil: simoncpu: can I shoot you just for mentioning it? [13:23] Micheil: ryah_away: Is this close to what you're looking for? http://github.com/Miksago/node/blob/master/doc/api.txt#L1434 [13:23] ryah_away: Micheil: just somewhere at the end (before repl?) [13:24] Micheil: yeah, it's directly above repl [13:24] ryah_away: Micheil: mostly - don't put a table and you should show the arguments of the functions [13:24] Micheil: okay [13:25] Micheil: so, remove the table for the AssertionError, as it's a semi-private api? [13:27] ryah_away: simoncpu: thanks for the patch [13:29] CIA-28: node: 03Ryan Dahl 07master * ra73227b 10/ (46 files in 4 dirs): Upgrade waf to 1.5.10 - http://bit.ly/5tArac [13:29] CIA-28: node: 03Simon Cornelius P. Umacob 07master * re801f42 10/ wscript : Use conf.fatal() instead of fatal() in order to abort the configure script - http://bit.ly/7NqsMh [13:29] sztanphet has joined the channel [13:29] Micheil: ryah_away: hmm.. something more like http://github.com/Miksago/node/blob/master/doc/api.txt#L1430 ? [13:30] ryah_away: Micheil: yep looks good [13:30] Micheil: okay [13:30] Micheil: I'll flesh it out in full over the weekend [13:30] Micheil: (I've got a few assessment tasks due before hand, so I've gotta focus on them) [13:31] ryah_away: Micheil: i think that's good enough [13:32] simoncpu: ryah_away: cool [13:32] simoncpu: ryah_away: btw, i'm experimenting with the sample code... [13:32] simoncpu: it's pretty cool to write a web server in just a few lines [13:32] simoncpu: i'm curious though, does the http module support ipv6? [13:32] simoncpu: according to sockstat, node only listens to tcp4 connections [13:36] pmuellr has joined the channel [13:43] wattz has joined the channel [13:44] Micheil: ryah_away: do you think it'd make sense to place Node behind something like nginx and varnish? [13:44] sveisvei: Varnish would only apply if its flat files, like html files [13:46] simoncpu: varnish works ok with dynamic files [13:46] simoncpu: as long as the output is... static [13:46] simoncpu: hehehehe [13:46] edwinjm has joined the channel [13:48] Micheil: sveisvei: yeah, and if you're creating something like an MVC framework, varnish would be fine in front of it [13:48] Micheil: and nginx could handle all other data types [13:49] sneeu has joined the channel [13:49] Micheil: wattz: get caught out by not reading the full site? :P [13:50] ashb: sveisvei: go lerna about varnish's ESI [13:50] wattz: Micheil: i guess i missed it, i have lived on the site for 3 days [13:50] wattz: so i guess glazed over and missed it :P [13:50] Micheil: heh heh :P [13:52] nefD has joined the channel [13:53] sveisvei: :P [13:55] sveisvei: I dont see the point mem-caching via varnish if the content is dynamic.. oh esi, that looks good :) [14:02] simoncpu: node just coredump on my system [14:03] simoncpu: how can i compile node with debugging, so that i the coredump would be meaningful? [14:03] simoncpu: aha [14:03] simoncpu: make all-debug? [14:05] simoncpu: or ./configure --debug [14:06] Micheil: sveisvei: well, if you're using nodejs as a semi static webserver instead of a dynamic event driven server, then it could be handy [14:13] sveisvei: Indead, then Varnish is the best there is. Using it at work, great performance [14:14] sveisvei: We load dynamic content with ajax when using varnish, and just set the headers correct [14:14] sveisvei: so they dont cache [14:16] sveisvei: Q: What linux distros works best with node.js out of the box?� [14:16] simoncpu: hmmm node_net.cc already takes into account IPv6.... [14:16] simoncpu: ACTION explores the code [14:24] simoncpu: hi [14:24] simoncpu: node_g is the debug version of node, right? [14:29] erikcorry: probably [14:29] Micheil: sveisvei: umm.. probably archlinux [14:29] erikcorry: With extra asserts [14:30] alexiskander has joined the channel [14:30] Micheil: sveisvei: I wouldn't recommend ubuntu, as it's repositories are really out of date (I've had to build some libraries to get node working correctly on it) [14:31] Micheil: sveisvei: you'd want something that had a rolling release cycle, not a periodical one [14:33] erikcorry: I didn't have any trouble with ubuntu, but I may already have upgraded the stuff node needs. [14:34] Micheil: erikcorry: then again, I am running 8.10, so that could be an issue [14:34] ryah_away: sveisvei: one would hope all distros - it doesn't really have dependencies beyond python [14:35] Micheil: ryah: the only deps are those checked in ./configure [14:35] Micheil: like gnutls and libexecinfo [14:35] sveisvei: Ill give it a go [14:37] ryah: Micheil: they're optional (execinfo is only for mac 10.4 and freebsd?) [14:38] richardb has joined the channel [14:39] Wes--: Micheil: 8.10 is very old [14:39] Micheil: ah [14:40] Wes--: 9.10 is current, 9.04 is actually long in the tooth (firefox 3) [14:40] Micheil: Wes--: yeah, I haven't had a chance to update yet [14:40] Wes--: I don't blame you, I hate updating. [14:40] Micheil: Wes--: I'm thinking of going over to an archlinux based system [14:40] Micheil: it's not the updating part, it's the how do I do this update part [14:41] Micheil: as in, do I do a complete reinstall or just a rolling update [14:44] Micheil: ryah: I know we use the Assert module from commonJS, but do we also use the Test module? [14:45] fictorial has joined the channel [14:45] simoncpu: 9.10 breaks on a lot of system [14:45] ryah: Micheil: shrug - I don't think so [14:45] Micheil: ryah: hmm.. okay [14:45] simoncpu: when i switched to 9.10, it was then that i realized the value of LTS.... [14:46] simoncpu: =) [14:46] oleg has joined the channel [14:46] Biscuits has joined the channel [14:46] Micheil: simoncpu: not only that, but I've run out of hdd space, and can't afford any more right now [14:47] simoncpu: Micheil: serves you right for downloading lots of porn [14:47] simoncpu: :p [14:47] Micheil: ryah: do you think it'd be benefical to have something like Test? [14:47] Micheil: simoncpu: heh, funny that... It's actually about 4 vm's and the rest music and websites. [14:48] Micheil: (it's only a 160GB drive though) [14:49] ryah: Micheil: maybe at some point. [14:49] Micheil: ryah: hmm.. [14:50] Micheil: ryah: I might actually write a testing framework, just need to figure out exactly what I need to power it though [14:54] cmlenz has joined the channel [14:55] Micheil: ryah: also.. test/mjsunit/test-assert.js is kind of ironic, in the sense that it's testing it's self. [14:55] Micheil: ryah: also, line 15, there's a missing semi-colon [14:55] ryah: Micheil: post-modern [14:55] Micheil: ;P [14:56] Micheil: should I document Assert.fail() ? [14:58] cloudhead has joined the channel [15:06] jasondavies has joined the channel [15:10] Micheil: ryah: okay, I'll add a bit more detail in soon, as to how one should write and structure tests, but here's the basic Asserts: http://github.com/Miksago/node/blob/master/doc/api.txt#L1430 [15:11] noxa has joined the channel [15:18] sneeu has left the channel [15:22] ciju has joined the channel [15:31] rakeshpai has joined the channel [15:39] mediacoder: rakeshpai: you still planning on rewriting your jaxer memcached client based on libmemcached? :-) (i have a bad port of your client to node ;-)) [15:40] mlouro has joined the channel [15:40] rakeshpai: mediacoder: In fact, it's almost complete. Just waiting to sort out some edge case problems, and I shall release it [15:40] mediacoder: ah, thats great [15:40] rakeshpai: mediacoder: It's not going to be based on libmemcached though. It'll be all pure JS. [15:41] mediacoder: still jaxer, or node? :-) [15:41] mediacoder: ah, i see [15:41] rakeshpai: mediacoder: node. I've moved away from Jaxer since I had a bad production issue with it. [15:41] mediacoder: perfect :-) [15:47] binary42 has joined the channel [15:48] mlouro has joined the channel [15:49] hober has joined the channel [15:50] bentomas has joined the channel [15:58] rbranson_ has joined the channel [15:59] fictorial: hmm does v8 have a built-in json parser? doesn't seem like it. [15:59] aurynn has joined the channel [16:00] frodenius: fictorial: yep, JSON.parse [16:01] fictorial: that's in Javascript... I mean v8's C++ API [16:02] dnolen has joined the channel [16:02] fictorial: but that probably answers the question implicitly :) [16:04] malkomalko: lol [16:07] tmpvar_ has joined the channel [16:09] aurynn: And now, to learn how to push my changes to github. [16:15] mburns has joined the channel [16:15] rudebwoy has joined the channel [16:15] m1631_ has joined the channel [16:15] Nailor has joined the channel [16:15] jspiros has joined the channel [16:15] onar has joined the channel [16:15] [i]chuck has joined the channel [16:15] hober has joined the channel [16:15] edwinjm has joined the channel [16:15] Atmoz has joined the channel [16:15] intellectronica has joined the channel [16:15] [k2] has joined the channel [16:15] rektide has joined the channel [16:15] apgwoz has joined the channel [16:15] tmpvar_ has joined the channel [16:15] dnolen has joined the channel [16:15] aurynn has joined the channel [16:15] rbranson_ has joined the channel [16:15] bentomas has joined the channel [16:15] mlouro has joined the channel [16:15] binary42 has joined the channel [16:15] ciju has joined the channel [16:15] noxa has joined the channel [16:15] jasondavies has joined the channel [16:15] cloudhead has joined the channel [16:15] cmlenz has joined the channel [16:15] Biscuits has joined the channel [16:15] oleg has joined the channel [16:15] richardb has joined the channel [16:15] alexiskander has joined the channel [16:15] nefD has joined the channel [16:15] wattz has joined the channel [16:15] pmuellr has joined the channel [16:15] sztanpet has joined the channel [16:15] soveran has joined the channel [16:15] hassox has joined the channel [16:15] xantus_ has joined the channel [16:15] tlrobinson has joined the channel [16:15] malkomalko has joined the channel [16:15] simoncpu has joined the channel [16:15] sveisvei has joined the channel [16:15] brosner has joined the channel [16:15] johan-s has joined the channel [16:15] the_undefined has joined the channel [16:15] kassandry has joined the channel [16:15] scudco has joined the channel [16:15] keeto has joined the channel [16:15] cadorn has joined the channel [16:15] rbranson__ has joined the channel [16:15] rtomayko has joined the channel [16:15] gwoo has joined the channel [16:15] frodenius has joined the channel [16:15] populuxe has joined the channel [16:15] Micheil has joined the channel [16:15] Sembiance has joined the channel [16:15] mikekell1 has joined the channel [16:15] ryah has joined the channel [16:15] inimino has joined the channel [16:15] halorgium has joined the channel [16:15] Connorhd has joined the channel [16:15] beppu has joined the channel [16:15] mediacoder has joined the channel [16:15] jan____ has joined the channel [16:15] CIA-28 has joined the channel [16:15] lmorchard has joined the channel [16:15] Sinjo has joined the channel [16:15] sr has joined the channel [16:15] careo has joined the channel [16:15] shfx has joined the channel [16:15] voodootikigod has joined the channel [16:15] mies has joined the channel [16:15] sifi has joined the channel [16:15] ashb has joined the channel [16:15] erikg has joined the channel [16:15] tlockney has joined the channel [16:15] skampler has joined the channel [16:23] binary42 has joined the channel [16:37] brandon_beacher has joined the channel [16:50] aurynn: http://github.com/aurynn/postgres-js [16:53] malkomalko has joined the channel [16:58] RayMorgan has joined the channel [17:08] jtaby has joined the channel [17:09] mlouro has joined the channel [17:10] aurynn: and now reading more, explains how to do this even better than my poorly hacked together concept. [17:24] davidsklar has joined the channel [17:25] eddanger has joined the channel [17:28] nefD: blargh.. methinks I need to read up more on JSONP before I'll be able to use node as an ajax server for my apache hosted php files due to the 'same origin policy' =\ [17:30] scudco has joined the channel [17:34] mediacoder: nefD: you could ProxyPass the requests to node from apache or use a good webserver/proxy, instead of apache :-) [17:35] Biscuits: Has anyone considered writing a proxy in node.js ? [17:35] inimino: Biscuits: I wrote one by accident, it's not too hard [17:35] nefD: hmm.. im not familiar with ProxyPass.. is that some kind of port redirection that takes place from the initial apache request handler? [17:35] Biscuits: Like write something that states pass everything to apache at port x, but anything starting with /xxx to (another instance of) node at port x, etc [17:35] nefD: I'd much prefer to avoid apache altogether and simply hit node at it's specified port (which is still hosted on the same domain, mind you) [17:36] inimino: oh, a reverse proxy, to [17:36] inimino: s/to/no/ [17:36] Biscuits: Prolly shouldn't be too hard if you rip out the standard HTTP response stuff [17:37] nefD: im able to do an ajax request on the same domain/diff. port by doing a getJSONP with jquery.. but a javascript error comes up, im guessing because its expecting a JSONP formatted response (and possibly the appropriate header along with it) [17:37] inimino: nefD: isn't getting around the same-origin policy the very reason JSONP exists? [17:37] Biscuits: just parse the GET/POST line + headers, adjust the GET/POST line, and then simply open a connection to apache, re-send the headers, and link it up with the original socket [17:37] nefD: inimino: Thats what i'm beginning to learn, I 'spose :P [17:38] nefD: I just need to find a good article or guide on how I need to format a proper jsonp response [17:39] Connorhd: jsonp is just example/json?callback=somefunctionname returns somefunctionname(JSON) [17:39] mediacoder: nefD: just wrap your response in a js function onCAllback(yourdataAsJSON) and have a js function with the same name on your client :-) [17:42] nefD: hmm.. i think i understand.. so with my ajax call, i'd hit my node server with json?callback=somefunction, and within node, my response should be in the form of a JS function with my data as the function parameters, and have an identically named function on the client which accepts the passed data parameters? [17:42] Connorhd: using jquery you don't need to worry about the client side stuff [17:42] jcrosby has joined the channel [17:42] RayMorgan_ has joined the channel [17:43] nefD: so I just need to ensure the returned response is in JS code format? [17:43] Connorhd: and the function name is the one given by the callback parameter [17:44] nefD: ok, so jquery's callback query parameter specifies the name of the function I need to use in my return? [17:44] nefD: (sorry for being so dense with this, just trying to wrap my head around it) [17:44] Connorhd: so just request.uri.callback+"("+JSON.stringify(objecttosend)+")" [17:45] Connorhd: yeh [17:45] Connorhd: you can force jquery to send a specific callback if you want [17:48] rakeshpai has joined the channel [17:53] tlrobinson has joined the channel [17:53] xantus_ has joined the channel [17:53] hassox has joined the channel [17:55] nefD: hmm.. request.uri.callback is undefined, but when I do a sys.inspect(request.uri), I can see it in the params [17:56] nefD: im guessing i need to do request.uri.params.callback [17:56] nefD: holy shart it worked..! [17:57] mediacoder: yea [17:57] nefD: thanks muchly for the help, you guys! [17:57] mediacoder: hehe [17:57] rbranson__: I love 7.5x speedups [17:57] nefD: hrm- I wonder if a php session id gets passed through ajax requests, and if I can capture it from within node [17:58] nefD: hmmm yep, comes through in the cookie [18:00] nefD: awesomeawesomeAWESOME. [18:00] nefD: next iteration of my browser based rpg is GO for GREAT JUSTICE [18:02] inimino: hehe [18:03] fictorial: nefD: url? [18:04] nefD: the old one is unavailable, I sold it to a company and they currently have it offline [18:04] nefD: fuckers [18:04] fictorial: lol [18:04] nefD: it was called Heroic Ages [18:05] nefD: im glad i sold the old code and not the WIP new code, though.. the new stuff is leagues better, even in its currently infantile stages [18:05] tapwater has joined the channel [18:05] nefD: brb, cancer treat [18:08] binary42 has joined the channel [18:08] mdg has joined the channel [18:08] mdg: the_undefined: just read http://debuggable.com/posts/rightjs-1-5-6-8-times-faster-than-jquery:4b1fc009-1940-4d26-bdc6-0af2cbdd56cb , very nice [18:09] nefD: whee! though.. I wonder if i'll be able to keep a node ajax connection 'alive' a la the nodechat example if i'm going with the jsonp route.. [18:10] quirkey has joined the channel [18:16] mdg has left the channel [18:16] inimino: nefD: alive as in long-polling? [18:16] saikko has joined the channel [18:16] nefD: right [18:17] inimino: sure you can do that [18:17] inimino: you just can't send more than one message per request [18:17] nefD: I'm still not sure yet whether long polling will be necessary, but I'm still curious if it'll be an option [18:17] nefD: *nod* understandable.. [18:18] inimino: any HTTP response can be delayed [18:18] nefD: for my needs though, the node connections will not be consistently active through the game, only during certain parts.. and it's critical that I can verify the identity of the requester to ensure I'm fetching, processing and returning the proper data, which I plan to do via php session id;s [18:19] sveisvei: the_undefined:Indead, nice article. [18:19] the_undefined: sveisvei: thanks :) [18:19] nefD: i'll be using php worker child processes (thanks again, undefined!) to interface with a mysql db and do the heavier number crunching [18:20] sveisvei: whats the word, Shenanigans? [18:20] inimino: ew, PHP [18:21] noxa- has joined the channel [18:21] nefD: *shrug* i've been working in the php field for 6 or so years, so its a good fit for me personally [18:22] nefD: sure, I could go with something faster, or (insert positive adjective here), but I can bang out php code faster and easier, which is a huge benefit [18:26] simoncpu: the_undefined: i hereby baptize you, John Doe [18:26] simoncpu: behold, for the_undefined is now defined! [18:26] simoncpu: go forth into the world, John Doe, and multiply! [18:26] sveisvei: lol [18:27] simoncpu: ei, do you guys know how to make nodejs work with freebsd? [18:27] simoncpu: or do you know at what point nodejs worked? if so, then maybe we can inspect the changes from that point to the present [18:29] the_undefined: simoncpu: I'd suggest posting your build output to the mailing list. Ryan seems have an awesome intuition for what is causing the problems [18:30] simoncpu: i've already posted it at github's issue tracker... [18:30] simoncpu: ACTION reads the google groups' past e-mails... [18:30] the_undefined: simoncpu: usually the mailing list is your best shot, I don't think ryan likes the github issue tracker, but you can't disable it [18:34] isaacs has joined the channel [18:38] simoncpu: btw, how can you run gdb if you need to pass a parameter [18:39] simoncpu: if you use gdb node_g example.js, gdb assumes that example.js is a coredump [18:39] rbranson__: gdb --args [18:40] simoncpu: ah, "run" also works [18:40] rbranson__: gdb --args node_g example.js [18:40] simoncpu: oki, i'll try that [18:40] rbranson__: if you're doing a C++ extension, make sure you're building it in debug [18:40] rbranson__: node-waf configure --debug [18:41] simoncpu: yepp, i've already build node with debug [18:47] simoncpu: aha [18:48] simoncpu: lots of crashes when i did "make test" [18:50] jed has joined the channel [18:51] jasondavies: hmm I get a test failure when testing with gnutls support [18:51] jasondavies: ah, not compiled with TLS support [18:52] jasondavies: need to install libgpg-error [18:53] jasondavies: I have it installed already, but it can't find gpg-error during ./configure [18:54] jasondavies: this is on OS X [18:54] jasondavies: any ideas? [18:58] simoncpu: hmmm... getmem() looks interesting [18:58] simoncpu: i haven't read the whole code yet, but what is rss and vsize? [18:58] simoncpu: what values does node expect? [18:59] rbranson__: rss = the amount of resident physical memory [18:59] rbranson__: vsize = the size of the virtual memory area for the process [19:00] inimino: see ps(1) [19:00] simoncpu: awesome [19:02] hassox has joined the channel [19:07] dnolen has joined the channel [19:07] rakeshpai_ has joined the channel [19:09] apgwoz has joined the channel [19:09] rakeshpai__ has joined the channel [19:16] dnolen has joined the channel [19:23] scudco1 has joined the channel [19:23] the_undefined_ has joined the channel [19:40] rtomayko has joined the channel [19:54] Connorhd: rbranson__, node-ffi segfaults on test.js with the latest node for me [19:54] aguynamedben has joined the channel [19:55] rakeshpai has joined the channel [19:58] isaacs: nice. i've got a susestudio appliance that comes equipped with node (and pretty much nothing else) and fires up /etc/node/start.js on boot [19:59] rbranson__: Connorhd: I'm having the same issue on a certain Linux box, but others are fine [20:00] rbranson__: Ubuntu 8.04 32-bit [20:00] Connorhd: this is debian 32bit [20:00] rbranson__: I spun up an EC2 instance of 64-bit Ubuntu 9.10, and it was fine [20:01] rbranson__: well if you can compile it in debug and then run gdb --args node_g test.js [20:01] rbranson__: it faults on this Ubuntu box on ffi_call() in FFI::FFIAsyncCall [20:09] mlouro has joined the channel [20:17] jcrosby has joined the channel [20:17] tapwater has joined the channel [20:24] sudoer has joined the channel [20:30] johan-s has joined the channel [20:34] xantus has joined the channel [20:35] tlrobinson has joined the channel [20:37] bert__ has joined the channel [20:49] rakeshpai has joined the channel [20:54] jed has joined the channel [21:03] rakeshpai has joined the channel [21:07] JoePeck has joined the channel [21:08] rakeshpai has joined the channel [21:16] rakeshpai has joined the channel [21:21] edwinjm has left the channel [21:23] the_undefined has joined the channel [21:28] rakeshpai has joined the channel [21:34] elliottcable has joined the channel [21:42] scudco has joined the channel [21:43] rakeshpai has joined the channel [21:43] scudco1 has joined the channel [21:46] CIA-74 has joined the channel [21:50] mattly has joined the channel [21:53] rakeshpai has joined the channel [22:03] lattice has joined the channel [22:04] RayMorgan has joined the channel [22:04] the_undefined has joined the channel [22:06] lattice: Hi all; Is there some reason that process.stdio.write() and process.(debug|puts) don't emit anything from within an HTTP server handler? [22:07] lattice: I've just started in on node.js, and can't find any documentation that suggests that this wouldn't work, but could imagine that STDOUT is being hidden from the HTTP handler in the interests of non-blocking-ness. [22:07] isaacs: lattice: what is it you're trying to do? i'm a bit confused.. [22:07] isaacs: you want to output to the http client from the server, or to the server's stdout? [22:08] RayMorgan_ has joined the channel [22:09] lattice: to the server's stdout [22:09] lattice: e.g. [22:09] lattice: http.createServer(function (request, response) { [22:09] lattice: sys.debug("Incoming request"); [22:09] lattice: response.sendHeader(200, {"Content-Type": "text/plain"}); [22:09] lattice: response.sendBody("Hello World\n"); [22:09] lattice: response.finish(); [22:09] lattice: }).listen(8000); [22:09] lattice: the expected behaviour here is that sys.debug issues a blocking write to STDOUT, but that doesn't appear to be happening when I run the above code. [22:10] isaacs: um... what do you see when you run the above code? [22:10] isaacs: it works as expected for me, but maybe we have different expectations. [22:11] lattice: I don't see any output with the above code. Do you get the debug output? [22:12] lattice: oh. weird, nevermind. it appears that apachebench wasn't actually making requests to the node.js http server. [22:13] isaacs: yep, works for me [22:13] isaacs: oh, that would explain it, then :) [22:13] lattice: making a request by hand, I do get the debug output. Sigh. Why do I ever bother with ab? ;-) thanks for the sanity check. [22:13] isaacs: no problem. [22:15] malkomalko: anybody use capistrano deploying their node apps? I'm trying to figure out some restart/monit strategies [22:45] Connorhd_ has joined the channel [22:48] Connorhd_: rbranson__: Just tried ffi with node_g, it does fault in the same place [22:51] sveisvei has joined the channel [22:52] scudco has joined the channel [22:52] sudoer has joined the channel [22:55] rtomayko has joined the channel [22:55] sudocarl has joined the channel [22:55] sudocarl: hello :) [22:56] isaacs: sudocarl: hi [22:57] sudocarl: how is the session framework coming? [22:59] isaacs: ryah: you around? [23:00] isaacs: or actually, anyone can weigh in.. [23:01] isaacs: how would you feel about adding more advanced query string parsing to node? is that something that belongs in the core, or should it be a separate module? [23:01] isaacs: i have the code already, which would make node parse the QS the same as narwhal, php, django, and rack/rails [23:02] mediacoder: isaacs: wasnt there something on the mailing list? about request-url parsing in general? [23:02] isaacs: mediacoder: maybe [23:02] isaacs: was it a task that i missed? [23:03] mediacoder: yea, i think it was offered as a task, but lemme find it [23:03] isaacs: oh, neato. [23:03] isaacs: i could just copy-paste that one. [23:03] jed: isaacs: Task: "Build a better, tested URI parser" [23:03] isaacs: sweet! [23:03] jed: isaacs: on Mon, Dec 7, 2009 at 10:29 PM [23:03] mediacoder: http://groups.google.com/group/nodejs/browse_frm/thread/2769af5e0b1afd9d# [23:03] isaacs: yeah, i wrote it for narwhal/jack and also for yui [23:04] jed: looks like he's thinking of its own module. [23:04] jed: which makes a lot of sense. [23:04] isaacs: absolutely [23:04] mediacoder: so there u go :-) [23:04] isaacs: it's enough code to be its own thing. just wondering if it goes in node/lib, or should be its own thing [23:05] isaacs: erm... first "own thing" = "separate file from http.js", second "own thing" = "separate project" [23:05] jed: isaacs: i'll take door number two (first "own thing") [23:05] isaacs: ACTION is so confused.. [23:06] isaacs: anyway, it's considerably more complicated in the presence of multipart and file-upload posts, but you can use the same logic to pull out POST data. [23:06] isaacs: i think that someone made that work in the commonjs land, i could probably just take a look at what they did. [23:07] sveimac has joined the channel [23:07] mediacoder: isnt there multipart-parsing an the like already there? [23:07] isaacs: already in node, or already in commonjs? (either way, i think the answer is "yes") [23:07] mediacoder: hehe, yea :-) [23:09] isaacs: it's more important to get the file upload stuff right, i think, but it's very handy to have something liike response.body.params.foo rather than parsing out response.body yourself [23:10] mediacoder: ah, yea. i think this task rather refers to uri-parsing which is broken atm, i think [23:11] inimino: yes [23:11] isaacs: well, broken is a harsh term. [23:12] isaacs: or do you mean, relative uri stuff? [23:12] inimino: the URI-parser should just give the query-string as an opaque string [23:12] inimino: no I mean the test case given in that email... though I don't know if that was a valid URI or not [23:12] inimino: because of the @ [23:13] isaacs: ah, right [23:13] isaacs: again, this would be a good case to just copy what narwhal does. [23:13] inimino: but I think it probably is [23:13] inimino: very likely [23:13] isaacs: in fact, i'm pretty sure you could just grab kriskowals [23:13] isaacs: ' [23:13] isaacs: in fact, i'm pretty sure you could just grab kriskowals' uri.js wholesale [23:15] inimino: especially if they have tests for it, that would be great [23:15] isaacs: yep :) [23:15] isaacs: i'm talking more about the fact that when i send a request to my node.js server with ?foo=bar&baz, it doesn't put a "baz" key in the params. [23:15] isaacs: and ?foo[]=bar&foo[]=boo doesn't turn it into an array. [23:17] inimino: yeah, I'm not sure we want to copy that last PHP misfeature [23:17] isaacs: inimino: i'm not a php cheerleader by any means. but it's sort of become a standard that a lot of frameworks use. [23:18] isaacs: the ?foo[bar]=boo&foo[baz]=bla is also really handy [23:18] inimino: but the &baz should work [23:18] isaacs: to get params = { foo: { bar:"boo", baz : "bla" } } [23:18] isaacs: inimino: should, yes. doesn't. [23:18] isaacs: if there's no =, node skips past it. [23:19] inimino: ah [23:19] inimino: yeah I would stick with whatever the HTML www-form-data stuff said in parsing [23:20] isaacs: http://github.com/ry/node/blob/master/lib/http.js#L148 [23:20] inimino: anything else can be done in post-processing by frameworks [23:20] isaacs: inimino: from that pov, i think that means that we don't even try to parse the query string or provide a bag of params [23:21] inimino: isaacs: well, HTML 4.01 specified the www-form-urlencoded or whatever it is, I think it's reasonable to parse that (but not in a raw URI parsing library) [23:22] isaacs: inimino: http://www.w3.org/TR/html401/interact/forms.html#didx-applicationx-www-form-urlencoded [23:23] isaacs: it's not exactly clear from that what to do in the case of duplicate key names. [23:23] isaacs: and perl/python/ruby all copy php. imo, that means there's a quorum. [23:23] inimino: well, HTML5 fixes that [23:23] isaacs: oh? where's the html5 idea? [23:24] inimino: I think the foo[] thing is hideous personally [23:24] inimino: but as long as it's in a layer above, I think that's great [23:24] inimino: I'lll look it up [23:24] isaacs: inimino: i'd much prefer to just have foo=bar&foo=baz to get an array [23:24] rtomayko has joined the channel [23:24] isaacs: but i was told that this causes problems, and there's an open issue against me in narwhal about it [23:24] isaacs: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#url-encoded-form-data [23:25] isaacs: yikes, ok, this is much more specified [23:25] isaacs: i'd just reverse-engineered what i saw in practice. [23:25] inimino: yeah there we go [23:26] inimino: isaacs: I'd much rather stick to the specs and if people want some sugar ala PHP it can be added in a layer above [23:26] isaacs: right [23:26] isaacs: well... but that seems like an argument for just not having node do ANY url param parsing [23:27] isaacs: break up the protocol, host, path, and querystring, but then leave the rest to the server code running on top of it. [23:27] inimino: well, here's what I'm arguing [23:27] isaacs: personally, i'd be fine with that. [23:27] jcrosby has joined the channel [23:28] inimino: yeah, that's all a URI parser should do, absolutely [23:28] inimino: and then above that, if there's going to be something like the multipart stuff that's there now, that people can use to parse form data, then it should do whatever HTML5 says [23:29] inimino: and then above that, if people want something like PHP, it should be a third layer [23:29] isaacs: the problem i have is this: if node's http.js is going to provide me with a "params" object that seems like it contains the query string params, and it seems to work, i'm gonna start using it. [23:29] dnolen has joined the channel [23:29] isaacs: then when it doesn't work, i'll be annoyed, scared, and sad. [23:29] isaacs: where "work" = "behave as i expect it to, like django and rails and php and perl do" [23:30] isaacs: the nodely solution seems to be "great, let's rip out that step, make it a bit faster, and you can do whatever you want with the bare queryString" [23:30] isaacs: i don't want to pretend that "whatever HTML5 says" is a static or ideal answer. [23:30] isaacs: imo, doing "whatever perl does" is probably a better idea. but choices are good. [23:31] inimino: well, ok [23:32] inimino: I tend to prefer a standard, where there is one, to "whatever perl does," but leaving all this to a higher layer is probably better [23:32] isaacs: but, if i'm gonna send a patch to the mailing list that rips out the params object, i'd like to also send along a way to get that functionality back, ideally in a better/fixed way, and if everyone wants it in the core of nodejs, then that's up to ryah or whoever. [23:32] inimino: and there's no standard in HTML for parsing query strings, I expect, probably just producing them [23:32] isaacs: inimino: right [23:33] isaacs: the standard (in http) for parsing them just says "this part is the query string" [23:33] inimino: yes [23:33] inimino: I'm in complete agreement on the URI parser only doing URI parsing [23:36] inimino: actually I didn't know it even did that params stuff [23:42] jed: one thing i don't quite understand is why the params object has a "fragment" member. [23:42] jed: i always thought it was never sent to the server, and was only for the client. [23:44] ericflo has joined the channel [23:48] tlrobinson: isaacs: narwhal also has a "uri" module [23:48] tlrobinson: which just does the splitting of url parts [23:49] inimino: jed: it's not, but it's a general purpose URI parser [23:49] inimino: jed: and there's also a media ranges/fragments proposal floating around somewhere in the W3C IIRC [23:49] jed: inimino: interesting. so it's there because it's parsed anyway, so why not, right? [23:50] inimino: (which probably would send fragids to the server) [23:50] inimino: yes [23:50] ashb: oh the foo[] thin again [23:51] rbranson_ has joined the channel