[00:02] ssteinerX has joined the channel [00:02] batasrki has joined the channel [00:02] mikeal: what do you think it is? [00:11] creationix has joined the channel [00:12] isaacs: if anyone is near sunnyvale, you should come to bayjax tonight [00:12] isaacs: high performance javascript [00:12] isaacs: w00t! [00:12] isaacs: at the yahoo campus [00:13] creationix has joined the channel [00:13] tmpvar has joined the channel [00:14] softdrink has joined the channel [00:19] batasrki: isaacs, do you guys record those in any way shape or form. I'd come, save for the little fact that I'm in Canada, :) [00:21] mjr_: isaacs: that sounds cool, but I wish I had more than 10 minutes notice. [00:21] stephenlb: isaacs: that's like 1 hour away. when does it start? [00:21] mjr_: This site says 5:30 - http://www.meetup.com/BayJax/calendar/13107337/ [00:21] stephenlb: ACTION googles bayjax [00:21] stephenlb: ACTION visits the link. [00:22] stephenlb: woh.. lots of ppl. [00:23] mjr_: Is there a Bay Area server side javascript group / meetup? [00:23] stephenlb: mjr_: Google and SF JS meetups often talk about ss js. [00:24] stephenlb: mjr_: http://www.meetup.com/jsmeetup/calendar/13048544/ [00:25] derbumi_ has joined the channel [00:28] RayMorgan has joined the channel [00:28] RayMorgan has joined the channel [00:29] mjr_: Hey, that one is just a block from my office. [00:35] MattJ has joined the channel [00:36] Aria has joined the channel [00:38] codehero: I have a dumb question, how does a listener function remove itself from an emitter's listener list? [00:38] codehero: I asked this on the mailing list, but every suggestion results in a runtime error: [00:39] codehero: removeListener only takes instances of Function [00:41] brapse has joined the channel [00:41] mjr_: I haven't tried this, but I assume you'll need to keep a variable around with the function in it, then use the same var to both add the listener and remove it. [00:41] codehero: I have the emitter in context [00:41] mjr_: If you add as an anonymous function, then you lose the reference. [00:41] codehero: even if the function is not anonymous I encounter the same thing [00:42] codehero: I posted all my attempts on the mailing list [00:42] malkomalko has joined the channel [00:42] codehero: tried using arguments.callee in anonymous case, no dice [00:42] mjijackson has joined the channel [00:43] creationix: were there api changes between v0.1.90-12 and v0.1.90-30? [00:43] creationix: my site won't respond to any http requests as if the event names changed on me [00:44] gwoo: mixin? [00:45] creationix: I don't use that afaik [00:45] creationix: wouldn't it throw an exception if I tried to anyway? [00:46] gwoo: yeah it should [00:47] gwoo: "Change nextTick implementation for the better" [00:47] creationix: hmm, no idea [00:47] creationix: I just updated node on my laptop too and now it's broken there, so it's not just a linux thing [00:48] creationix: ACTION debugs some more... [00:48] mjr_: codehero: removeListener takes two arguments, the event name, and then the function [00:48] mjr_: you are only giving it the function [00:48] mjr_: codehero: http://gist.github.com/365309 [00:49] creationix: wow, now I can't even start up node-repl before it throws an exception [00:53] creationix: ok, did a fresh clone and fresh compile and nore-repl is working again, now to see why my program doesn't work [00:55] codehero: wow that makes me a codedumbass [00:55] codehero: thanks [00:55] codehero: works [00:56] mjr_: wow, that's bad news on the waf failure [00:56] mjr_: or perhaps git failure. [00:56] creationix: what's it mean when code works on osx, but not on linux with the same node version? [00:57] mjr_: I believe the docs say that means it's time for a beer and fix it tomorrow. [00:57] creationix: both fresh clones with fresh compiles of v0.1.90-21-ga934566 [00:57] creationix: mjr_: I wish (not the beer part, I don't drink) [00:57] creationix: but I really need to launch this week [00:59] joshbuddy has joined the channel [01:07] jbrantly: is require.async for node documented? [01:08] jbrantly: err, it was removed yesterday? [01:09] inimino: jbrantly: yes, it's gone [01:14] jbrantly: alright. Still may be able to answer my question. Was the signature of the callback function(error)? And not function(require)? (I'm gathering this from a quick glance at the code) [01:14] inimino: I never used it, but most of the callbacks are cb(err, success) [01:15] inimino: where err will be undefined if it worked [01:16] _ry: oh what? did i miss a javascript meet up? [01:17] creationix: woot, I found the bug, it was my code, not node, see http://beta.howtonode.org:7777/ [01:17] creationix: _ry: I'm giving a presentation in dallas in a few weeks [01:17] creationix: it's probably too far to travel though ;) [01:18] _ry: yeah, just a bit :) [01:18] isaacs_mobile has joined the channel [01:19] _ry: man im so bumed i missed it [01:19] _ry: isaacs_mobile: you should have warned me :) [01:19] mcarter has joined the channel [01:20] isaacs_mobile: I had forgotten, too, sorry [01:20] isaacs_mobile: Its abouit makig js fast, too! [01:20] _ry: gr [01:20] isaacs_mobile: It'll be on yui theater [01:20] _ry: let me know if anyone mentions node [01:20] CodeOfficer has joined the channel [01:20] _ry: ACTION gtg [01:20] isaacs_mobile: Ok. I might. [01:21] quirkey has joined the channel [01:22] batasrki: isaacs_mobile, it'll be on yui theater? [01:28] charlesjolley has joined the channel [01:35] CodeOfficer has joined the channel [01:38] creationix: hmm, that's a strange one, my server is creating a file (looks like a unix socket) called 7777 when I try to listen on tcp port 7777 [01:38] creationix: but only if I specify the port number through a bash script [01:39] creationix: and of course the server can't hear anything on tcp port 7777 [01:39] mjr_: string vs number [01:39] mjr_: ? [01:41] creationix: I guess so [01:41] creationix: so listen on HttpServer must be checking the arg type [01:41] mjr_: that bit is a little too magical, I think. [01:43] creationix: yep, if I parseInt the value from argv then it binds to a tcp socket [01:44] creationix: cool, and it's running pretty fast too http://beta.howtonode.org/ [01:44] creationix: uses nginx only for the virtualhost [01:44] creationix: if you go to port 7777 then it's the node app directly [01:46] mjr_: Big demo tomorrow, but I forgot to go home and eat. [01:59] RayMorgan_ has joined the channel [02:00] psynaptic has joined the channel [02:02] mjijackson has joined the channel [02:08] kriszyp has joined the channel [02:10] brainproxy has joined the channel [02:13] creationix: Is there a working gzip compressor for node yet? [02:14] creationix: or do we just pipe it to a child process? [02:18] aho has joined the channel [02:18] brainproxy has joined the channel [02:18] dnolen has joined the channel [02:23] kriskowal_ has joined the channel [02:25] kriskowal_ has joined the channel [02:30] JimBastard_ has joined the channel [02:36] JimBastard_: does anyone feel like helping a complete noob out with some proxy_pass and 404 handler stuff? [02:36] JimBastard_: i want to proxy_pass all my incoming requests that 404 to an internal service , passing along the requested URL in whole [02:36] JimBastard_: assuming nginx is the front facing webserver [02:37] JimBastard_: all hail Tim_Smart ! [02:37] RayMorgan has joined the channel [02:37] JimBastard_: hey RayMorgan ! i had a Mu question for you [02:37] JimBastard_: if you had a sec [02:37] RayMorgan: hey, what's up? [02:38] JimBastard_: is it possible to make Mu run as sync? [02:38] JimBastard_: opposed to streaming / async? [02:39] RayMorgan: When you use the file version (Mu.render()) it asyncly reads templates off of disk, so it requires it to be async [02:40] RayMorgan: and instead of making 2 different APIs I chose to keep the text rendering the same [02:40] RayMorgan: What are you trying to do? I am working on a couple different things right now and wouldn't be opposed to adding some more features [02:41] steadicat has joined the channel [02:41] JimBastard_: well [02:41] JimBastard_: one sec, let me bring up the docs [02:42] JimBastard_: maybe i just misunderstood [02:42] JimBastard_: if i call compileText that is sync right? [02:42] JimBastard_: since i just send it text? [02:42] JimBastard_: var compiled = Mu.compileText(tmpl, partials); [02:43] RayMorgan: ah, yeah... that is sync [02:43] JimBastard_: duhh okay thanks [02:43] RayMorgan: but it still streams the output [02:44] JimBastard_: ill update my syntax and show you what im doing [02:44] RayMorgan: cool [02:44] JimBastard_: i'm using Mu as the mustache templating lib in hook.io [02:44] JimBastard_: its exposed through the mustache protocol [02:46] RayMorgan: awesome! [02:47] aho: :{ [02:48] JimBastard_: aho ? [02:49] aho: mustache [02:49] JimBastard_: lol [02:49] JimBastard_: RayMorgan: http://github.com/Marak/hook.io/blob/master/hookio/protocols/mustache.js [02:49] JimBastard_: that should work right? [02:49] Tim_Smart: JimBastard_: Why is a templating system a protocol? [02:49] Tim_Smart: lol [02:50] Tim_Smart: That is wierd [02:51] xer0x: Is the latest node 1.90 way bigger than the last? ..or is my computer getting slower at compiling [02:51] JimBastard__ has joined the channel [02:52] JimBastard__: ahhh [02:52] JimBastard__: stupid irc [02:52] JimBastard__: like i was saying, the markdown and mustache protocols are just there so users can easily access those parsing engines while building custom webhook defintions or other protocols [02:52] RayMorgan: JimBastard_: no b/c Mu.compileText() returns a function (the compiled function) that returns a stream [02:53] RayMorgan: I see what you are looking for though now [02:54] JimBastard___ has joined the channel [02:54] JimBastard___: :-( [02:54] Tim_Smart has left the channel [02:56] RayMorgan: JimBastard: does exports.start have to return syncly? [02:56] JimBastard___: no idea [02:57] JimBastard___: that shouldnt matter here? [02:57] JimBastard___: looks like 248 is the magic number [03:00] RayMorgan: JimBastard___: it would have to look more like this: http://gist.github.com/365394 [03:01] JimBastard___: wait whats updog [03:01] steadicat has joined the channel [03:02] JimBastard___: :p [03:02] JimBastard___: running the code now [03:03] JimBastard___: "hello this is a template named {tName}" [03:03] RayMorgan: it is {{tName}} to echo the var [03:03] RayMorgan: 2 {'s [03:03] JimBastard___: AHAHA [03:03] JimBastard___: okay thanks [03:04] JimBastard___: appreciate the help [03:04] RayMorgan: yep [03:04] JimBastard___: i should have just read the docs a bit better, sorry [03:04] RayMorgan: haha, no problem [03:05] JimBastard___: CrockBot: give RayMorgan +10 points [03:05] CrockBot: DouglasCrockford.constructor === function Function() { [native code] } inlibu [03:06] mjijackson has joined the channel [03:06] WALoeIII has joined the channel [03:23] mikeal has joined the channel [03:35] atmos: anyone upgraded an express app to 1.90 ? [03:36] JimBastard___: negative [03:36] atmos: it's like it never starts the event loop [03:39] JimBastard___: just send a message to TJ [03:39] atmos: oh wow [03:39] atmos: i'm retarded [03:39] atmos: i didn't have redis running [03:39] JimBastard___: oofa! silent failure? [03:39] atmos: and for some reason it'd silently exit [03:39] JimBastard___: aye [03:40] JimBastard___: patch that bitch [03:40] atmos: i think it's the way i wrote the code [03:40] atmos: pretty much everything is kicked off when it connects to the db :P [03:40] JimBastard___: failing silently is no way to fail son [03:40] JimBastard___: ahaha [03:40] freshtonic_ has joined the channel [03:40] JimBastard___: you going to jsconf? [03:40] atmos: i wish :( [03:41] atmos: i was just in dc last weekend, shoulda stayed and crashed it [03:41] jashkenas has joined the channel [03:42] atmos: JimBastard___: you going ? [03:42] JimBastard___: yeah im doing scurvyconf [03:42] JimBastard___: and try to gank a ticket for jsconf [03:42] JimBastard___: im poor [03:42] joshholt_ has joined the channel [03:42] JimBastard___: id just walk in but voodootikigod_ knows my face and said he will beat me up [03:46] JimBastard___: i think the best presentation at scurvy gets invited to talk at jsconf. they said something about votes, im not sure [03:47] PyroPete1 has joined the channel [03:48] atmos: JimBastard___: you live on the east coast ? [03:48] jashkenas: So, what's the deal with sys.puts() in Node 0.1.90? You can't pass arbitrary-length strings to it anymore? Is there a fixed-size buffer you have to know about? [03:48] JimBastard___: nyc [03:49] JimBastard___: jashkenas its not working for you? how much text are you sending it? [03:49] atmos: jashkenas: are you getting it back as data to a callback ? [03:49] atmos: the shit you get from network callbacks changed, puts didn't change afaik [03:49] jashkenas: I'm sending it a good deal of text ... a translated file's worth. atmos: the docs make it look like it hasn't changed. [03:49] jashkenas: but the behavior has. [03:50] atmos: jashkenas: i've updated a few libraries and hadn't noticed [03:50] atmos: puts is my primary debugging tool atm too :) [03:50] atmos: i'm generally doing small strings though [03:51] JimBastard___: im not having issues with puts, but im not sending it large amounts of text [03:51] JimBastard___: anything big i send to the webconsole as aysnc tree [03:51] JimBastard___: so i can drill into it [03:51] jashkenas: hmm, looks like it's not a fixed amount of characters or bytes. [03:52] jashkenas: It's deterministic though, cuts off at the same character every time, in different files. [03:52] fizx has joined the channel [03:53] fizx has joined the channel [03:53] jashkenas: curiouser ... when piping it or catting it into a file, it's fine, but when printed to the terminal, truncated. [03:54] jashkenas: Naturally, using the synchronous "debug" instead of "puts" doesn't truncate, and prints all the text. [03:54] JimBastard___: actually i just noticed the terminal acting strange [03:54] JimBastard___: when dumping huge blocks [03:54] JimBastard___: i just kinda ignored it as i shouldnt have been doing it anyway [03:54] JimBastard___: was truncating [03:55] JimBastard___: whats that about [03:55] jashkenas: Glad it's not just me. [03:55] JoePeck_ has joined the channel [03:56] dgathright has joined the channel [03:57] jashkenas: Ah, here we go. [03:57] jashkenas: Looking in Node's sys.js, puts() is simply a call to process.stdout.write(string) [03:58] jashkenas: stdout.write is like any other Node writable stream, and will return false if the buffer is full [03:58] jashkenas: But puts() ignores it. We must be overflowing the buffer. [03:59] JimBastard___: so you should add a listener for complete? [03:59] JimBastard___: or something? [04:00] jashkenas: Well, you can't from puts(), unless you get an process.stdout from another angle. [04:00] jashkenas: You might as well just use process.stdout directly. [04:01] JimBastard___: you got a gist? i should replace the line i have in my debugger that outputs to the terminal [04:01] jashkenas: _ry: could probably enlighten us further. I'm not clear if when the stream returns false, you're supposed to retry that string, or just a portion of it. [04:01] JimBastard___: brb, getting coffee and dutches [04:01] jashkenas: JimBastard: I don't. Look at stream.write(string, encoding) in the docs. [04:06] careo has joined the channel [04:07] JimBastard___: aight [04:07] JimBastard___: what node stuff are you working on jashkenas ? [04:07] careo: has anyone used mootools in node.js? I'm clearly missing something obvious as it's complaining about "ReferenceError: Class is not defined" after I require() mootools and then script that uses it [04:07] jashkenas: Just CoffeeScript. [04:08] JimBastard___: careo: what mootools lib you trying to use? [04:08] JimBastard___: jashkenas: cool. im gonna add CoffeScript support to hook.io for sure [04:08] JimBastard___: it should be pretty simple [04:08] careo: JimBastard___: it's just some a couple simple classes [04:08] JimBastard___: careo: is it written for server side? you might need a env or a dom or something [04:09] JimBastard___: i have no idea [04:09] jashkenas: careo: MooTool's probably isn't set up for server-side JS. If it doesn't add "Class" to exports, you're not going to see it in your script. [04:10] JimBastard___: i think i read a blog post about YUI and jsdom working on node [04:10] JimBastard___: tmpvar's thing [04:10] JimBastard___: jquery support coming soon maybe [04:11] jashkenas: careo: If you just want classes though, there are other ways to get them. [04:11] creationix: any nginx ninjas here? I want it to not override my "Server" http header from the reverse proxy [04:11] careo: jashkenas: there's some existing mootools code I want to magically use. [04:11] jashkenas: ah [04:11] creationix: (trying to advertise that my node based blog runs on node) [04:12] careo: that it's failing right out of the gate on "new Class" leads me to believe it's something really simple that I'm missing :) [04:12] tmpvar has joined the channel [04:15] JimBastard___: creationix: i was begging for nginx help earlier with no luck [04:16] JimBastard___: i even went into #nginx and started singing the russian national anthem (in russian) [04:16] JimBastard___: :-( [04:16] creationix: yeah, it's a slower community for sure [04:16] jashkenas: creationix: http://stackoverflow.com/questions/246227/how-do-you-change-server-tag-for-nginx [04:16] atmos: haha [04:16] jashkenas: Like everything else with nginx, recompile. [04:16] bpot has joined the channel [04:16] atmos: oh that's not true [04:17] jashkenas: whew. [04:17] atmos: changing the server name is kinda lame [04:17] JimBastard___: do you guys know the general strategy for routing all your nginx 404 requests to a proxy_pass [04:17] JimBastard___: i need node to take over the 404 handling [04:17] atmos: normally you set a location [04:17] freshtonic has joined the channel [04:17] JimBastard___: http://github.com/Marak/hook.io-frontend-website/blob/master/nginx.conf [04:18] JimBastard___: im sure its a one liner [04:20] brianmario has joined the channel [04:25] dgathright has joined the channel [04:30] creationix: JimBastard___: have you tried http://wiki.nginx.org/NginxHttpCoreModule#error_page [04:31] creationix: error_page 404 = @fallback; [04:31] JimBastard___: that looks promising [04:31] JimBastard___: but, proxy_pass http://backend; [04:31] JimBastard___: you think that will pass the path? [04:31] JimBastard___: the request path? [04:32] atmos: yeah [04:32] JimBastard___: ill try that out for sure [04:32] JimBastard___: gotta resolve some latent issues first, brb [04:33] creationix: JimBastard___: proxy_set_header may help too [04:34] jashkenas has left the channel [04:34] dgathright has joined the channel [04:36] mjr_ has joined the channel [04:38] JimBastard___: okay trying now [04:42] xer0x has joined the channel [04:43] JimBastard___: yeah that works perfectly, thanks for the tip creationix [04:43] creationix: :) [04:48] dgathright_ has joined the channel [04:49] JimBastard___: creationix: http://github.com/Marak/hook.io-frontend-website/blob/master/nginx.conf updated [04:50] creationix: cool [04:52] crodas has joined the channel [04:53] creationix: crodas: welcome [04:54] crodas: creationix: btw, there are 6 people in the wrong channel (#Node) [04:54] creationix: I saw, I'm not sure what _ry wants to do about it [04:54] creationix: I think he registered the channel with freenode [04:57] JimBastard___: what about #nodejs [04:58] JimBastard___: i just yelled at everyone in nodejs [05:00] Aria: Heh. Fix it now or forever hold your peace. #ruby vs #ruby-lang has been a problem for a while [05:03] _ry: i've registered the channel - but they've never replied [05:03] JimBastard___: TypeError: Converting circular structure to JSON at Object.stringify (native) [05:03] JimBastard___: sys.puts(JSON.stringify(request)); [05:03] JimBastard___: is that me being stupid? [05:04] atmos: is request from a callback ? [05:04] atmos: i've been adding .toString() everywhere :\ [05:05] JimBastard___: i mean [05:05] JimBastard___: request.url works [05:05] JimBastard___: and thats what i need [05:06] charlesjolley has joined the channel [05:09] Hieu has joined the channel [05:13] atmos: success! my express app now works happily on latest node :D [05:15] brianmario has joined the channel [05:16] JimBastard___: nice [05:16] keeto has joined the channel [05:16] JimBastard___: i really wanna get hook.io working as an express plugin or whatever [05:16] JimBastard___: i just havent had time [05:16] JimBastard___: or the need yet [05:16] atmos: yeah, it's just another moving target [05:17] atmos: i'm having fun with it though, doing non-trivial stuff started getting messy here [05:17] JimBastard___: well like hook.io itself is just a CommonJS module [05:17] atmos: someone wrote oauth finally so i wanna try to get a twitter client happy [05:17] JimBastard___: so in theory you could include it somewhere in express as a top level object or something [05:17] JimBastard___: and then hookIO.api.whatever() is available [05:18] atmos: interesting [05:18] atmos: what makes something a CommonJS module ? [05:18] JimBastard___: exports? [05:18] atmos: ah, cool [05:18] JimBastard___: have you seen the stand-alone server for hook.io? [05:18] atmos: ACTION is still really new [05:18] atmos: i looked through some of the code a whiel back [05:18] atmos: not recently though [05:18] JimBastard___: http://github.com/Marak/hook.io/blob/master/server.js [05:18] atmos: got a link ? [05:18] JimBastard___: its unstoppable [05:18] atmos: hah [05:18] JimBastard___: ;-) [05:19] JimBastard___: so you can do that anywhere [05:19] JimBastard___: i have a config options hash too, just gotta play with it a bit more [05:19] atmos: interesting [05:19] atmos: i'm hoping to finish writing the hooks thing i've been working on soon [05:20] atmos: the .90 upgrade kinda hurt for a few days [05:20] JimBastard___: also, http://github.com/Marak/hook.io/blob/master/.gitmodules [05:20] JimBastard___: using submodules as package manager :-\ [05:21] atmos: yeah i'm not a huge fan of that [05:21] atmos: tho tags on github could realistically work [05:21] JimBastard___: need better github api [05:21] JimBastard___: i can manage it for now [05:21] JimBastard___: as soon as it starts hitting 30+ repos ill need to fix it [05:21] JimBastard___: thats about my limit [05:22] JimBastard___: creationix: you still alive? [05:22] mikeal has joined the channel [05:22] JimBastard___: im kinda battling with node-persistence [05:22] creationix: barely, why? [05:22] JimBastard___: can you send nested search options to the store.find() in mem adapater [05:23] JimBastard___: condition => {"type":"http","config":{"path":"CustomURL"}} [05:23] JimBastard___: :p [05:23] creationix: don't think so [05:23] JimBastard___: hee hee [05:23] JimBastard___: fuuuck [05:23] JimBastard___: :-D [05:23] JimBastard___: FELIX! [05:23] JimBastard___: WHERE IS DIRTY [05:23] JimBastard___: ill just get all and filter [05:24] creationix: sounds good [05:24] gfxmonk has joined the channel [05:25] creationix: I just realized a flaw in my wheat engine, I hope google understands gzipped html [05:25] mape: Anyone in here looked at implementing a Top-N recommendation engine in JS? Using collaborative filtering [05:25] creationix: I'd have to restructure my cache to support separate caches [05:25] creationix: mape: sounds cool, no clue what that means [05:26] mape: creationix: The customer who bought this also bought that.. ;) [05:26] creationix: sounds like fun [05:27] mape: Yeah, been looking if there are anything like out already, but seems like there isn't so a neat project to spend some time on [05:27] JimBastard___: _ry: is sys.puts() fudged up? [05:27] mape: Only thing I'm wondering about is the performance of using javascript [05:27] creationix: my kids aren't sleeping well, see everyone later, g'night [05:27] mape: Or if one should try to do it in C instead and make a module out of it [05:27] mape: nite [05:27] JimBastard___: night creationix [05:28] mape: Are there any benches out on language vs language (including js on V8) doing math? [05:30] JimBastard___: why you want to know? [05:30] mape: Which is faster? [05:30] JimBastard___: yeah [05:31] mape: To know how much benefit doing it in another language would be [05:34] _ry: JimBastard___: maybe [05:35] _ry: not sys.puts() but all streams, probably [05:35] gfxmonk: anyone know if there is currently (or planned) any way of setting a global error handler, like window.onError in some browsers? [05:35] JimBastard___: 10-4 [05:35] mape: gfxmonk: there is on? adding a global event for it [05:36] mjr_: My HTTP proxy is serving up corrupted data to clients when the requests are large, I just started noticing. [05:36] mape: process.addListener('uncaughtException', function (err) {sys.puts('Caught exception: ' + err);}); [05:38] mjr_: It's proxying couchdb, just calling write back to the client in the data handler to couch. [05:38] mjr_: and some of the writes are getting truncated. [05:39] markwubben has joined the channel [05:40] mjr_: Curiously, this doesn't happen if I proxy to a slower couchdb with the same data. Some sort of write buffering deal, I guess. [05:40] _ry: i'm guessing the watcher isn't getting started again [05:40] _ry: at some point [05:40] mjr_: It seems to pick up through, just getting corrupted in the middle. [05:41] mjr_: Anything I can do to help debug it? [05:43] JimBastard___: is there test coverage for this sort of thing? [05:45] _ry: JimBastard___: there is [05:45] mjr_: This is interesting, if I buffer up the entire response from couchdb in a string, then write the entire string to the client in one go, it seems to work. [05:46] _ry: test/pummel/test-http-big-proxy-responses.js [05:46] JimBastard___: would it help if i ran that? [05:47] mjr_: oh, this is the issue 77 test that still fails, isn't it? [05:48] _ry: yes [05:48] mjr_: ha [05:49] kriskowal: someone got a hint on how to observe an aborted HTTP request? [05:50] mjr_: observe at what level? [05:50] kriskowal: something like request.addListener("end", …) in a createServer callback [05:50] kriskowal: if that works, it's not documented… i'll give it a shot [05:51] mjr_: listen out request.connection for "clone" [05:51] mjr_: er, close [05:51] mjr_: that will call you back with an error arg, which you want to check [05:51] _ry: req.connection.addListener('close', handelr) [05:51] _ry: yeah [05:51] kriskowal: okay, thanks [05:53] _ry: dtracetoolkit doesn't seem to work on osx [05:53] _ry: luckily i have this shinny joyent opensolaris zone :) [05:54] mjr_: In case you are interested, here's my HTTP proxy to couchdb that that does work by buffering up the entire response and writing it in one go [05:54] mjr_: https://gist.github.com/60e780f7f23e6f96b20b [05:54] mape: entire_fucking_body? :D [05:55] mjr_: yes, that's the one [05:56] JimBastard_ has joined the channel [05:56] kriskowal: mjr_ similar http://github.com/kriskowal/node-narwhal/blob/master/lib/narwhal/q-http.js#L84 [05:56] kriskowal: working on a narwhal/q-http promise oriented wrapper for node's http [05:56] mjr_: It is exciting because some of the responses are 2MB, so now that just hangs out in memory for as long as possible. [05:56] kriskowal: provides a "Q-JSGI" abstraction [05:57] Aria: http://dinhe.net/~aredridel/projects/js/nodenetwork/proxy.js is a proxy that doesn't buffer ;-) [05:57] kriskowal: i was really hoping that pause/resume would work for me; i haven't isolated the problem [05:57] mjr_: Aria: can you proxy multi-MB responses from couchdb with that? [05:58] mjr_: on the latest node, I mean. [05:58] mjr_: Because this line: inreq.addListener('data', function(chunk) { outreq.write(chunk); }); [05:58] mjr_: is what I used to have, and the clients were getting corrupted data. [05:59] Aria: mjr_. I've not tried that large yet. And not from couchdb at all. [05:59] Aria: What sort of corruption? [06:00] mjr_: The requesting client sees some of the data missing, up to the end of a write boundary. [06:00] Aria: Oh interesting. [06:00] _ry: mjr_: anything good at the js meetup today? [06:01] mjr_: _ry: I didn't know about until isaac mentioned it today, like 10 minutes before it started. [06:01] gfxmonk: mape: thanks! I looked for global error handlers, but couldn't find anything. Very glad it exists :) [06:05] mjijackson has joined the channel [06:06] Aria: Oooh. I'm getting some corruption, too, downloading a file through my proxy. [06:07] mjr_: at head? [06:07] Aria: No. [06:08] Aria: Not sure where yet, actually -- but the md5sums differ. [06:08] mjr_: I mean node version, is it from master sometime today? [06:08] Aria: Oh. 1.3.90 [06:10] Aria: er. 0.1.90 [06:10] Aria: man, must be getting late. [06:10] JimBastard_: yeah it is [06:10] JimBastard_: im struggling to finish getting custom url listeners working [06:10] JimBastard_: then updating production site to 0.1.9 [06:11] JimBastard_: >.< [06:26] sveimac has joined the channel [06:28] JimBastard: huzaah [06:32] sudoer has joined the channel [06:41] towski has joined the channel [06:43] dgathright has joined the channel [06:50] _ry: interesting [06:57] javajunky has joined the channel [07:16] dekroning has joined the channel [07:16] mjr_: _ry: that sys.puts magic string size is strange. It isn't magic at 2008 either. [07:16] mjr_: http://gist.github.com/365543 [07:16] mjr_: it's sort of random, failing at different lengths. [07:17] mjr_: That example has similar patterns to the corruption in my proxy server data. [07:17] _ry: mjr_: yeah [07:17] _ry: i figured out one bug [07:17] _ry: i think im close [07:17] mjr_: excellent [07:18] N` has joined the channel [07:20] _ry: offset bug as suspected [07:20] _ry: 2100 byte example is great [07:20] _ry: allows one to actually think about it [07:23] JimBastard: why the fuck is my git submodule not pulling the latest version from github [07:24] _ry: yey [07:24] _ry: fixed it [07:25] _ry: JimBastard: cd submodule; git pull ? [07:25] erichocean has joined the channel [07:25] erichocean: how can I send the byte 0xFF out over a stream? [07:26] _ry: stream.write('\u00FF', 'binary') [07:26] micheil: \u00FF [07:26] micheil: erichocean: websockets? [07:26] erichocean: yep [07:26] erichocean: I tried that, doesn't work [07:26] micheil: heh, to the spec? [07:26] micheil: \uFFFF maybe? [07:26] erichocean: sends 0xBFBF over the wire [07:26] piranha has joined the channel [07:27] erichocean: tried that too [07:27] micheil: hmm.. one sec [07:27] erichocean: what sucks is this code worked fine three monhts ago [07:27] micheil: this.socket.write("\u0000", "binary"); [07:27] micheil: this.socket.write(data, "utf8"); [07:27] micheil: this.socket.write("\uffff", "binary"); [07:27] micheil: works [07:27] micheil: (this.socket === stream) [07:28] micheil: erichocean: just watch out with the auth stuff, as you're possibly not implementing websockets correctly [07:28] erichocean: bingo, genious [07:28] erichocean: thanks [07:28] micheil: check out http://www.whatwg.org/specs/web-apps/current-work/complete.html?slow-browser=1#network for info [07:28] micheil: (may hang your browser) [07:28] tisba has joined the channel [07:29] micheil: ACTION is also working on a websockets implementation [07:29] JimBastard: thanks _ry that was it. i assumed that git submodule update --init would pull the latest from every submodule repo [07:29] erichocean: micheil: cool, thanks [07:29] micheil: ACTION is off. [07:32] JimBastard_: ohh heh sup mixin lol [07:33] JimBastard_: i knew i should have listened to those warning messages [07:33] JimBastard_: proto time! [07:34] hellp has joined the channel [07:36] CIA-77: node: 03Ryan Dahl 07master * rb8c0349 10/ (src/node_buffer.cc test/simple/test-buffer.js): Fix triple buffer slice bug - http://bit.ly/d8dRYd [07:36] _ry: ^-- bug one [07:37] javajunky has joined the channel [07:38] felixge has joined the channel [07:41] erichocean has left the channel [07:42] CIA-77: node: 03Ryan Dahl 07master * r684740c 10/ lib/net.js : net.js: Slice the right buffer in _writeOut - http://bit.ly/dBdHvA [07:42] _ry: ^-- bug 2 [07:44] kjeldahl has joined the channel [07:45] teemow has joined the channel [07:47] felixge: _ry: what's up with idle watchers being disabled? [07:47] _ry: felixge: they're not being used at the moment [07:47] felixge: I thought nextTick used them? [07:48] _ry: not anymore [07:48] felixge: ah cool [07:48] felixge: :) [07:48] felixge: _ry: btw. I'm working on a really sweet benchmarking app which draws little ASCII art graphs [07:49] _ry: cool [07:49] felixge: _ry: after / at JSConf I'd really like to start helping out with IPC [07:49] felixge: _ry: we can't launch the old transloadit version build on old node because node keeps dying (evcom() Success) [07:49] felixge: _ry: so the next version I want to make sure that certain things in the system stay seperate, hence IPC :) [07:50] _ry: felixge: you should watch this if you haven't already http://www.youtube.com/view_play_list?p=2C7B5B3A31612F95 [07:50] _ry: ascii art graphs made me think of it [07:50] felixge: _ry: I think I watched it before [07:51] felixge: can't remember any ascii art in it so [07:51] kuya has joined the channel [07:52] felixge: anyway, g2g, brb 15min [07:57] maushu has joined the channel [08:00] derbumi has joined the channel [08:01] admc has joined the channel [08:05] tbassetto has joined the channel [08:10] felixge has joined the channel [08:10] felixge has joined the channel [08:10] simoncpu has joined the channel [08:10] simoncpu: weeeee weeeeeeeeeeeeeeeeeee [08:11] JimBastard_: lol [08:11] kjeldahl has joined the channel [08:22] dekroning has joined the channel [08:22] piranha_ has joined the channel [08:26] xla has joined the channel [08:31] kjeldahl has joined the channel [08:37] simoncpu: i want an exciting project where i can use nodejs [08:37] simoncpu: blaaaaaaah [08:37] simoncpu: blah blah blaaaaaaaaaaaaaaah [08:37] simoncpu: i'm bored [08:37] dgathright has joined the channel [08:40] psynaptic has joined the channel [08:46] TomY has joined the channel [08:48] TomY has joined the channel [08:52] erichocean has joined the channel [08:52] erichocean: is there a buffered stream class in node.js? [08:52] erichocean: or is everyone implementing their own buffering now? [08:53] _ry: everyone is doing their own buffering [08:54] erichocean: k, will do, thx [08:54] micheil: hmm.. [08:54] micheil: erichocean: is your websocket implementation up on github or something? [08:54] erichocean: I've got adapted version of http://github.com/Guille/node.websocket.js [08:55] micheil: ah. it's not spec compliant [08:55] erichocean: it seems like a WebSocket client and server interface should be built into node.js [08:56] erichocean: it is a standard after all [08:57] micheil: true [08:58] micheil: I'm busy working on that spec compatible one.. turns out I now need to write a header parser.. ugh. [09:00] erichocean: you could steal the code from _ry 's http parser [09:00] micheil: not very [09:00] micheil: that'd mean I'd need to write it in c. [09:00] _ry: micheil: why do you need a header parser? [09:00] erichocean: well, if it's going to be in node.js proper, that's not really a problem [09:01] micheil: I was using _ry's parser, but because the websocket protocol sends body with a GET request, yet doesn't send content length, it fails [09:01] micheil: _ry's parser ends up eating the body [09:01] _ry: micheil: websocket doesn't have a body [09:01] micheil: yeah they do in a way [09:01] _ry: or? [09:02] micheil: http://gist.github.com/365024 [09:02] micheil: is an example packet [09:03] _ry: eh [09:03] _ry: i mean that's the whole session [09:03] _ry: you just need to handle the upgrade? [09:03] _ry: or? [09:03] micheil: I was doing the whole header parsing [09:03] micheil: so I had a http.js style object of the headers [09:04] micheil: http://github.com/miksago/node-websocket-server/blob/http_parser/lib/ws/connection.js [09:04] micheil: and http://github.com/miksago/node-websocket-server/blob/http_parser/lib/ws/http_parser.js [09:05] micheil: but I couldn't stop the http_parser from eating the last 8 bits [09:05] _ry: we should just make http_parser support websocket [09:05] erichocean: +1 [09:05] micheil: +1 [09:05] micheil: how though? [09:06] _ry: add a callback for the upgrade [09:06] micheil: because the body will only be sent on spec compliant clients when both Sec-WebSocket-Key1 and Sec-WebSocket-Key2 are set [09:06] _ry: it's not a body [09:07] _ry: i mean it's just changing the protocol [09:07] micheil: hm.. [09:07] micheil: I did try splitting the data at \r\n\r\n [09:07] micheil: but that didn't work too well [09:08] micheil: in the spec, it's called Key3 [09:09] micheil: so.. probably if headers["Sec-WebSocket-Key1"] then; split(\r\n\r\n) [09:09] _ry: no it needs support at the parser [09:09] _ry: you have to hijack the stream [09:10] _ry: the question is do i (1) support the entire web socket protocol in http-parser (2) give people a callback for the upgrade [09:10] _ry: and let them do it themselves [09:10] micheil: probably a call back for the upgrade [09:11] _ry: probably [09:11] micheil: http://github.com/miksago/node-websocket-server/blob/http_parser/lib/ws/connection.js#L44-66 [09:11] micheil: was how I was doing it [09:11] _ry: of course supportin the entire protocol wouldn't be hard [09:11] erichocean: faster too [09:11] _ry: and then we'd just have native web socket upport [09:11] micheil: true [09:12] micheil: _ry: so, how should we approach this implementation? [09:12] xla has joined the channel [09:13] _ry: i don't think i want to worry about web socket right now, acutally [09:13] _ry: i'll do the upgrade [09:13] micheil: okay [09:13] _ry: uh.. i guess you'd get a request [09:14] _ry: and you'd have to check the upgrade header [09:14] _ry: but the parser will stop when it see it [09:14] micheil: Hixie has just said that it's probably not a good idea to implement the full protocol until the specs done [09:14] _ry: sees it [09:14] micheil: hmm.. that wouldn't help [09:14] nsm has joined the channel [09:14] _ry: oh right, cause it's already read some f the connection [09:15] micheil: it just needs to return the body as what ever is after the first \r\n\r\n pair after the headers end [09:15] micheil: so, maybe set a flag to force the content-length to be 8 bytes or bits [09:16] micheil: 8 bytes. [09:16] _ry: if (req.upgrade) { [09:16] _ry: hm [09:16] _ry: req.upgradeDataHead [09:16] _ry: or something [09:16] micheil: because to be a spec compliant client, you should send the headers in a randomized order [09:17] _ry: req.upgradeHead [09:17] micheil: req.upgradeBody [09:17] _ry: ^-- that'd be the beginning of the new connection [09:17] micheil: yeah [09:17] _ry: body isn't the right word, i think [09:17] micheil: so, the 8 random bytes [09:17] botanicus has joined the channel [09:17] micheil: although, if(req.upgrade && req.sec-websocket-key1) [09:18] _ry: actually this could probably be handled at the js level [09:18] micheil: how? [09:18] _ry: without touching the c.. [09:19] _ry: returning false from onHeadersComplete ? [09:19] sveisvei has joined the channel [09:19] _ry: well i think it's good to have support form http-parser [09:21] botanicus has joined the channel [09:22] micheil: _ry: more on how I was doing the headers http://github.com/miksago/node-websocket-server/blob/f2f45961d9344eb37dff32e7eddbf4c35926528e/lib/ws/connection.js#L61-72 [09:28] kjeldahl has joined the channel [09:55] hellp has joined the channel [09:56] demolithion has joined the channel [10:02] micheil: erichocean: do you think it'd be a good idea to be able to pass into the WebSocket library an option: type: spec | draft75 [10:03] erichocean: what's the difference between draft75 and the spec? [10:06] sveimac has joined the channel [10:08] nikhil__ has joined the channel [10:17] _ry: micheil, erichocean: http://github.com/ry/http-parser/commit/88d11b394d37cb6a5420bd8b3df4d550f74c80ef [10:18] _ry: which doesn't give you node access [10:18] _ry: but it's 90% [10:19] erichocean: nice! [10:19] javajunky: sweet [10:24] hassox has joined the channel [10:31] maritz has joined the channel [10:42] felixge: _ry: no sleep tonight? [10:44] _ry: having fun :) [10:44] _ry: just about got the upgrade stuff into node [10:47] xla has joined the channel [10:50] _ry: okay going to push up some experiemental web socket stuff [10:50] _ry: it needs some tests... [10:51] _ry: i hope micheil or erichocean might help with that [10:52] erichocean: I can [10:52] erichocean: for whatever reason, I'm not getting enough "data" callbacks [10:52] erichocean: I can see the data in Wireshark, but I only get a callback on the first packet [10:52] erichocean: (or sometimes, the last) [10:55] CIA-77: node: 03Ryan Dahl 07master * raf49187 10/ (4 files): Upgrade http-parser - http://bit.ly/aljoJa [10:55] CIA-77: node: 03Ryan Dahl 07master * r760bba5 10/ (lib/http.js src/node_http_parser.cc): (log message trimmed) [10:55] CIA-77: node: Support Upgrade in HTTP messages [10:55] CIA-77: node: This allows for web servers to be "hijacked" and used as Web Socket servers [10:55] CIA-77: node: (or other). You simply listen for requests as normal, but check if [10:55] CIA-77: node: req.upgrade === true [10:55] CIA-77: node: If so, this will be the last request of the connection. It's your job now to [10:55] CIA-77: node: hijack req.connection and start reading from it. req.upgradeHead is a buffer [10:55] erichocean: _ry: any ideas? is there some special flag or listener to get all of the 'data' callbacks? [10:56] erichocean: I'm setting an encoding if that makes a difference [10:56] _ry: erichocean: not sure - there is a problem that we're having right now related to that [10:56] erichocean: the setEncoding() part? or the problem in general? [10:56] _ry: test/pummel/test-http-big-proxy-responses.js demonstrates it [10:57] _ry: large http messages seem to never get the 'end' event [10:57] _ry: not sure what's happening [10:57] erichocean: okay. I'm seeing this on a net.createServer()-created stream [10:57] erichocean: so it's not just the HTTP path [10:57] _ry: i need to go to bed now [10:57] _ry: would love a test case [10:57] erichocean: k, thx for everything [10:57] _ry: ACTION away [11:00] ssteinerX has joined the channel [11:15] spoob has joined the channel [11:40] micheil: okay.. what's the go? [11:45] hassox has joined the channel [11:54] micheil: erichocean: have you managed to get any headers back now? [11:54] erichocean: I gave up, the buffers are completely broken on my box [11:55] erichocean: I get 1 out of 3 packets [11:55] erichocean: I've got to move on to other coding tasks while this gets resolved before I spend more time on the WebSocket code [11:59] micheil: I just get a \n out of it [11:59] keeto_ has joined the channel [12:00] micheil: oh. wait. fail. I wasn't sending the upgraded body. [12:01] micheil: bingo! [12:06] micheil: actually.. I'm getting an odd error now [12:09] micheil: _ry: I think the reason why this breaks for me is because I'm just using the parser, not the http library [12:11] micheil: _ry: I'm just going to have to hand write a parser for now. [12:21] ssteinerX has joined the channel [12:23] dnolen has joined the channel [12:24] joshbuddy has joined the channel [12:24] micheil: erichocean: you about? [12:24] erichocean: yep [12:25] micheil: okay.. if I know that the first request should be in one piece [12:25] micheil: then theoretically I should be able to do: Parser.execute(data, start, end-start-10); [12:26] erichocean: that assumes you have all of the data to parse [12:26] micheil: yeah. true [12:27] micheil: but I can't get the parser working now [12:30] pjb3 has joined the channel [12:34] micheil: hmm.. [12:35] micheil: if there's no content-length, then the parser should stop parsing when it hits the \r\n\r\n terminator after the headers, at which point, it should emit onEnd, containing the buffer, the length, and the position it stopped parsing [12:35] micheil: or does that not make sense? [12:36] erichocean: I haven't looked closely at the http-parser in 6 months [12:37] demolithion has joined the channel [12:38] lifo has joined the channel [12:38] micheil: I have no idea how this is going to work. [12:38] pjb3 has left the channel [12:47] KungFuHamster: Douglas Crockford has been well described as the world�s foremost authority on JavaScript. His �JavaScript: the Good Parts� talks have been around for a while, but recently he concluded giving a five-part updated series, entitled Crockford on JavaScript. For any JavaScript developer, these videos are a must read http://net.tutsplus.com/tutorials/javascript-ajax/crockford-on-javascript-the-complete-series/?utm_source=fe [12:47] KungFuHamster: edburner&utm_medium=feed&utm_campaign=Feed%3A+nettuts+%28NETTUTS%29 [12:47] CrockBot: Douglas Crockford doesn't use try-catch. When Douglas codes there are no exceptions. gudbergur [12:47] KungFuHamster: bleh, url got split... http://net.tutsplus.com/tutorials/javascript-ajax/crockford-on-javascript-the-complete-series/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+nettuts+%28NETTUTS%29 [12:47] CrockBot: "JSLint" is really just Douglas Crockford sitting behind a computer, insulting your code. (via @tnm8 @janl) ncb000gt [12:53] erichocean has left the channel [12:57] stepheneb has joined the channel [12:58] piranha has joined the channel [12:59] mape: KungFuHamster: Thanks :) [13:06] davidsklar has joined the channel [13:14] jherdman has joined the channel [13:23] cainus_ has joined the channel [13:27] kriszyp has joined the channel [13:30] gf3 has joined the channel [13:36] voodootikigod_: someone ping me [13:36] voodootikigod_: ? [13:36] jherdman: sure [13:36] jherdman: 0.62s [13:37] jherdman: oh, that was a question... hah... sorry. [13:37] simoncpu: ping you [13:37] simoncpu: hahaha [13:41] voodootikigod_: hahaha [13:41] voodootikigod_: did someone [13:41] voodootikigod_: sorry forgot the did [13:41] voodootikigod_: I came back and it had the red one [13:53] sudoer has joined the channel [13:54] mjijackson has joined the channel [13:56] quirkey has joined the channel [13:59] BinaryPie has joined the channel [14:01] kjeldahl has joined the channel [14:09] voodootikigod_: If http://news.ycombinator.com/item?id=1264931 can hold the top spot for a full day, we will let @lazukars in! UPMOD!!!!!! [14:10] hsuh has joined the channel [14:11] gwoo has joined the channel [14:14] creationix has joined the channel [14:18] digman543 has joined the channel [14:22] gf3 has joined the channel [14:25] sveisvei has joined the channel [14:26] alex-desktop has joined the channel [14:27] aryounce has joined the channel [14:41] tekky has joined the channel [14:41] softdrink has joined the channel [14:46] qFox has joined the channel [14:46] qFox: dont suppose anyone set up node under windows or knows a tutorial? i'm getting stuck pretty fast [14:47] micheil: qFox: node won't work under windows yet as it currently requires a posix compatible system [14:47] micheil: you could, however, use a VirtualBox and load up something like Ubuntu to have it work [14:47] qFox: _will_ it not work or is it simply not supported "but go ahead and try" ? [14:47] qFox: yeah that was my backup [14:48] qFox: just figured i'd try going through the mingw hell first. for some reason [14:48] micheil: it will not work. [14:48] qFox: k [14:48] qFox: that settles it then :) [14:58] qFoxx has joined the channel [15:13] rictic has joined the channel [15:15] steadicat has joined the channel [15:18] xla has joined the channel [15:19] xla has joined the channel [15:26] herbySk has joined the channel [15:28] justinlilly has joined the channel [15:30] herbySk has joined the channel [15:31] brapse has joined the channel [15:33] mjijackson has joined the channel [15:38] jbowman has joined the channel [15:57] Krowbar has joined the channel [15:57] Krowbar: hey, anybody know how to server images using node.js using fu? [15:58] Krowbar: i can get it to server images when they are explicitly called in the address bar but not on a webpage [15:58] Krowbar: *serve [16:02] RayMorgan has joined the channel [16:06] _ry: micheil: ping [16:06] TheEnd2012 has joined the channel [16:06] micheil: pong [16:06] _ry: why not use the new code? [16:07] micheil: because, I've been implementing on top of the net.Stream constructor, not the http.Server constructor [16:07] _ry: (for the upgrade) [16:07] micheil: so, the new code doesn't really work [16:07] _ry: you want a client side one [16:08] _ry: it also should work - use httpClient [16:08] _ry: the upgrade comes on the response [16:08] micheil: erm, rather net.Server [16:09] _ry: that also works :) [16:09] micheil: hmm.. [16:09] micheil: true, it seemed to get messy [16:09] _ry: you just need to start with http.Server [16:09] micheil: yeah. something I wasn't aiming at doing [16:10] _ry: this is definitely the way to go - it's implemented at a low-level [16:10] micheil: this as in http.Server / http.Client rather then net.Server / net.Stream [16:10] micheil: ? [16:11] micheil: ACTION is just listening to the keynote from twitter [16:11] micheil: * chrip [16:11] dandean has joined the channel [16:20] PyroPeter has joined the channel [16:24] mjr_ has joined the channel [16:29] mape: Hmm I'm trying to implement a recommendation server using javascript, but the algorithm needs to be able to do Math.sqrt on a negative number, javascript doesn't like that.. How do I get around that? [16:29] JAAulde has joined the channel [16:29] JAAulde has joined the channel [16:30] felixge has joined the channel [16:30] felixge has joined the channel [16:30] mape: Just flip it, do the calulation and flip it back? [16:31] indiefan has joined the channel [16:31] mjr_: do you need imaginary number support? [16:31] mape: ? [16:32] mjr_: That's the reason I've seen people wanting that to work. Otherwise, just sqrt(abs(num)) [16:33] mape: abs? [16:33] N`: absolute value [16:33] mjr_: Also available in 8 minute variety. [16:33] mape: And then flip the value back to negative * -1 ? [16:34] N`: it depends of what you want [16:34] N`: but the square root of -1 is 'i', not a real number [16:35] mjr_: I'm guessing what you want is: var num = -123456; sys.puts(Math.sqrt(Math.abs(num)); [16:36] mape: Hmm yeah, what I'm looking for is the hypotenuse [16:37] mape: So I guess the negative value wouldn't make sence then anyway [16:37] mape: Since the distances is always positive [16:37] derbumi has joined the channel [16:37] mjr_: especially the squares of distances [16:38] mjr_: I've sort of forgotten about math, having never used it since college. [16:38] mape: Yeah same here, fun to use it again though [16:41] mjr_: mape, does _ry not like your doc reader for the main node website? [16:41] mape: Not sure :) If he wants he if free to use it [16:42] mjr_: Have you asked him about what it would take to get it in there? [16:42] mape: Nope, figured if he wanted it / needed it it would have come up [16:44] mjr_: I think you should suggest it to him. He's certainly got his own set of opinions about what docs should look like, but I think your viewer makes this whole project look way better. [16:45] bpot has joined the channel [16:45] RayMorgan_ has joined the channel [16:45] mape: I'll ask him the next time I see him [16:45] creationix: mape, I love yours except the text is less readable [16:45] creationix: it looks great though [16:46] mjr_: I'd vote for a larger font size as well. [16:46] creationix: maybe just increase the font [16:46] mape: Easy enough to fix :) [16:46] creationix: I think that would be enough [16:46] mjr_: But if there are only a few simple changes like that between what we have live and your viewer, I'd loudly vote for your viewer. [16:46] RayMorgan_ has joined the channel [16:47] creationix: maybe increase the contrast too, the code color is too dark [16:48] mape: The grey/blue? [16:49] creationix: yeah, the #DCDDDE [16:50] creationix: white looks good to me [16:52] psynaptic has left the channel [16:52] dgathright has joined the channel [16:53] mattly has joined the channel [16:55] herbySk has joined the channel [16:59] isaacs has joined the channel [17:03] PyroPeter has joined the channel [17:05] admc has joined the channel [17:15] siculars has joined the channel [17:17] paul___ has joined the channel [17:18] nefD: hrm.. im guessing there isnt a way to monitor for changes to a page on github, is there? ie: to see changes made to the node module list [17:36] _ry: mape: yeah looking nice [17:36] _ry: we should change it [17:36] mape: Anything needs altering before doing that? [17:37] _ry: mape: incrase the font [17:37] _ry: otherwise it looks really nice [17:37] mape: That enough? [17:38] mape: and should I remove the moving headline? [17:42] _ry: i like that [17:42] admc has joined the channel [17:42] mape: k I'll make sure it at least works in IE [17:44] mape: Gah, shoot me [17:45] jbowman has joined the channel [17:48] mape: Ah there we go, the god ole Doctype [17:48] samsonjs has joined the channel [17:52] CIA-77: node: 03Ryan Dahl 07master * r41ef171 10/ (168 files in 14 dirs): Upgrade V8 to 2.2.3.1 - http://bit.ly/95w0Ex [17:52] gwoo has joined the channel [17:53] micheil: _ry: question: why the dark website? [17:56] _ry: micheil: 31337 [17:56] micheil: 31337? [17:57] mape: to cool for school [18:08] stephenlb has joined the channel [18:09] piranha has joined the channel [18:10] dgathright has joined the channel [18:11] creationix: allright, got wheat pulling in external code snippets instead of having to inline them in the markdown [18:11] derbumi has joined the channel [18:11] creationix: also the link-to-raw feature links to the versioned snapshot of the file, so it will never change [18:11] mape: Docs work in IE now, the html TOC generation was wonky closing tags early [18:12] creationix: http://beta.howtonode.org/step-of-conductor (see first code block) [18:13] mape: Nice [18:13] mape: The loading an article image seems off? [18:13] creationix: image? [18:14] mape: http://gyazo.com/92ec39dfa11937ec825e658c9c4ead3b.png [18:14] creationix: oh, right, that need some css love [18:14] creationix: but it is rendering the dot file on the fly [18:14] creationix: (and caching the result of course) [18:15] creationix: and all text files should be properly gzipped as well [18:16] sudoer has joined the channel [18:20] creationix: bah, my headers are still wrong, http is going to be the death of me [18:20] creationix: node is fun, but it sure makes for some complicated logic [18:22] mape: juggeling is the fun part [18:23] creationix: sweet, got gzip working again, I had short circuited one of my if statements [18:23] creationix: I guess that's why is bad to have "too many if statements" [18:24] creationix: ;) [18:24] mape: hehe [18:25] kriskowal has joined the channel [18:26] creationix: hmm, now my 304 responses are including the body, will the pain ever end [18:27] creationix: no, it's right, Firebug just lies [18:29] WALoeIII has joined the channel [18:29] isaacs: (re: too many ifs) you know, i still don't quite grok how the OOP dharma gets around the fact that having multiple classes introduces exactly the same degree of logical cyclomatic complexity as a switch statement. [18:35] voodootikigod__ has joined the channel [18:39] inimino: I have something like the opposite of a bug [18:39] inimino: the code works, but I don't see how it possibly can [18:41] brapse has joined the channel [18:46] kriskowal_ has joined the channel [18:46] kriskowal_ has joined the channel [18:46] MattJ has joined the channel [18:47] isaacs: inimino: that's awesome! [18:47] isaacs: what is it? [18:49] towski has joined the channel [18:50] inimino: isaacs: ah, some old code that I'm updating from 0.1.25 to 0.1.90... I think I just figured it out and there are actually two bugs, and it worked but with a race condition [18:50] isaacs: i see [18:54] brapse_ has joined the channel [18:55] lifo has joined the channel [18:55] cloudhead has joined the channel [18:56] voodootikigod_ has joined the channel [18:58] CodeOfficer has joined the channel [18:59] CIA-77: node: 03Ryan Dahl 07master * r9cf2a02 10/ (3 files in 3 dirs): Add timeout and maxBuffer options to child_process.exec - http://bit.ly/dqPa5W [19:00] Iveaux has joined the channel [19:04] siong1987 has joined the channel [19:09] joshbuddy has joined the channel [19:15] javajunky has joined the channel [19:17] tilgovi has joined the channel [19:20] aho has joined the channel [19:20] mikeal has joined the channel [19:24] siong1987 has joined the channel [19:26] JimBastard_ has joined the channel [19:27] towski has joined the channel [19:27] herbySk has joined the channel [19:28] creationix: anyone using process.evalcx or process.compile [19:29] creationix: I want to add a fourth argument that lets you specify the line-number offset [19:29] creationix: would this be possible [19:30] JimBastard_: sup deanlandolt [19:30] JimBastard_: voodootikigod_: did you ever announce the node.js hackday on friday? [19:31] kriskowal has joined the channel [19:31] voodootikigod_: what do you mean [19:31] voodootikigod_: its just an open hack day [19:31] voodootikigod_: we announced it on twitter [19:31] voodootikigod_: yea [19:31] JimBastard_: fucking twitter [19:33] mape: yay, http://mape.me:9000/?similar=true&recommendations=true&id=mape [19:33] mape: Runs through 10.000 users that each have 350 reviews and finds the best match [19:33] voodootikigod_: hahah [19:34] voodootikigod_: why fucking twitter [19:34] JimBastard_: i dont use twitter [19:34] drostie has joined the channel [19:35] JimBastard_: my attention span is too low for that many chars [19:35] voodootikigod_: haha [19:35] voodootikigod_: so what info you need [19:37] creationix: mape: cool [19:37] JimBastard_: im still trying to find the post [19:37] quirkey has joined the channel [19:37] JimBastard_: just wanted to know the where / when [19:37] JimBastard_: im gonna be in town around noon on friday [19:37] voodootikigod_: ok [19:37] JimBastard_: quirkey! [19:37] voodootikigod_: so just head over to the Hotel Latham [19:37] voodootikigod_: http://www.thelatham.com/ [19:38] WALoeIII has joined the channel [19:38] JimBastard_: any room numbers or anything? [19:38] quirkey: JimBastard_: sup [19:38] JimBastard_: (sorry for being twitter retarded) [19:39] mjijackson has joined the channel [19:39] voodootikigod_: just the conference room [19:39] voodootikigod_: we have everything [19:39] JimBastard_: 10-4 [19:39] JimBastard_: quirkey did you figure out your travel arrangements yet? [19:39] quirkey: yeah, taking the train down [19:39] JimBastard_: im leaving friday morning, thinking about taking boltbus [19:39] JimBastard_: accel? [19:39] quirkey: indeed [19:39] JimBastard_: i think im gonna be cheap and take the stinky bus [19:39] quirkey: yeah, its not so bad [19:40] JimBastard_: we cant all be big ballin like quirkey [19:40] quirkey: haha [19:40] voodootikigod_: hahah [19:40] JimBastard_: also is it true you were in a rap group or is that just a joke [19:40] quirkey: no, its true [19:40] quirkey: I was the dj/producer [19:40] JimBastard_: lolwut [19:40] quirkey: Rec Circle represent [19:40] JimBastard_: i got the same background [19:40] quirkey: oh yeah? [19:41] quirkey: haha [19:41] JimBastard_: yeah man, ive produced two full instrumental albums, one rap album, one unreleased rap album, and a shit ton of internet raps [19:41] JimBastard_: like the original everquest rap from 1999 [19:41] quirkey: haha [19:42] JimBastard_: here's a defunk myspace from one of my older projects (http://www.myspace.com/yeoldewreckingshoppe) [19:42] JimBastard_: just funny, small world [19:42] quirkey: tottaly [19:42] quirkey: most of the stuff I did is still out there somewhere [19:42] JimBastard_: you still do production work? [19:42] quirkey: if you search for AQ [19:42] quirkey: nah, the rap world is sketcht [19:42] JimBastard_: lol [19:43] quirkey: haha [19:43] quirkey: i learned that the hard way [19:43] JimBastard_: all my rap songs were about being awesome and partying [19:43] quirkey: haha [19:43] JimBastard_: i sent you the reddit rap right? [19:43] javajunky has joined the channel [19:43] JimBastard_: (my latest and not so greatest exploit) [19:43] quirkey: yeah, haha [19:44] JimBastard_: :p [19:44] JimBastard_: aight ill let the train get back on track here [19:44] JimBastard_: if you ever feel like doing jams ill show you my studio setup [19:44] quirkey: tottaly [19:45] JimBastard_: voodootikigod_ i emailed with kyle a little bit but havent been confirmed for doing a scurvy talk [19:45] JimBastard_: should i be worried? [19:45] voodootikigod_: nah [19:46] derbumi has joined the channel [19:46] JimBastard_: cool, look forward to the event. looks like it will be a lot of fun [19:46] voodootikigod_: shouldnt be too shabby [19:46] nefD: ooh, i used to be into production quite a bit.. sold most of my hardware gear, though =\ [19:47] voodootikigod_: things are coming along nicely [19:47] voodootikigod_: but the hack day [19:47] voodootikigod_: is just a show up [19:47] voodootikigod_: enjoy the grub thats tehre [19:47] voodootikigod_: and rock [19:47] voodootikigod_: i may or may not be there [19:47] voodootikigod_: when you get there [19:47] voodootikigod_: i have to set up all the netwokring for the hotel around 1:30pm [19:47] JimBastard_: thats cool, im gonna be recruiting people for my cause all day [19:47] JimBastard_: im sure ill make some friends :-D [19:48] voodootikigod_: noice [19:52] isaacs: voodootikigod_: where's this hack day at? [19:52] javajunky has joined the channel [19:52] voodootikigod_: http://www.thelatham.com/ [19:54] siong1987 has joined the channel [19:54] isaacs: ah, dc [19:54] isaacs: not bay area. [19:54] voodootikigod_: ted to jsconf [19:55] piranha has joined the channel [19:59] javajunky has joined the channel [20:01] creationix: ok, here's a crazy problem [20:01] creationix: I need to execute the code samples on howtonode and print the results inline in the blog [20:01] creationix: I've got all that figured out using process.compile and some string magic [20:01] creationix: but the problem is that not all my examples are written for the same version of node as what's running the server [20:02] creationix: so basically I need something that works like process.compile, but uses any arbitrary node version [20:02] creationix: I can't figure out how to make node in s subprocess act like process.compile [20:02] RayMorgan: creationix: you could boot up X number of node processes on different versions and use stdio to pipe to those based on version needs [20:03] avidal has joined the channel [20:03] avidal has left the channel [20:03] creationix: specifically, I need to feed it code, but have exceptions show the line number relative to a syntethic filename [20:03] creationix: and I need the result on success to be the last expression [20:03] creationix: can you even pipe code to a node process, it didn't work last I checked [20:04] RayMorgan: you can just use stdio to push the code to the right process (based on the version) and then in that process use process.compile, and pipe the result (or error) back [20:04] RayMorgan: the code would just be a string at that point [20:04] avidal has joined the channel [20:04] creationix: ahh, have a script, not node directly, that might work [20:05] creationix: hmm, or just only supply this feature for the latest version of node [20:06] creationix: seems like an awful lot of work just to give premium features to deprecated versions of articles [20:06] RayMorgan: yeah [20:06] creationix: ok, I'll just disable it for older articles [20:07] creationix: but how do I know when to use the feature, I need the version of the running server [20:07] creationix: process.version seems to work [20:09] qFox has joined the channel [20:10] qFox: wrote a step-by-step tutorial to get node "on windows" without actually installing linux (obviously using virtualization); http://qfox.nl/notes/98 [20:13] creationix: qFox: awesome [20:14] isaacs: hey, can we replace the setTimeout(2000) example with a hello-world that has no timeout as the first node example? [20:15] isaacs: it sends the wrong message. [20:15] isaacs: er... it sends the right message, but it takes 2 seconds to send it. [20:15] isaacs: and that's lame. [20:19] qFox: you mean in my tut? [20:20] qFox: i actually just copied that from the other tutorial. but sure (although i think it displays part of the core of the whole event system ;) [20:21] stalled has joined the channel [20:21] qFox: there [20:25] siong1987 has joined the channel [20:26] nodejs_v8 has joined the channel [20:27] avidal: clever name nodejs_v8 [20:27] derbumi has joined the channel [20:29] joshbuddy has joined the channel [20:29] joshbuddy has joined the channel [20:30] JimBastard_: its a bot avidal [20:30] avidal: figured :P [20:30] avidal: whose bot? [20:30] JimBastard_: mine [20:30] avidal: nice [20:31] avidal: hand-rolled or are you using something like jerk? [20:31] JimBastard_: Tim_Smart set him up [20:31] JimBastard_: i think that one and CrockBot are both running Jerk [20:31] CrockBot: On the 8th day, Douglas Crockford introduced JSON. And he saw that it was good. tobeytailor [20:31] JimBastard_: i know CrockBot is running jerk [20:31] CrockBot: Everytime Douglas Crockford blinks his eyes, another IE6 instance is killed. tobeytailor [20:31] avidal: that's a bit annoying :P [20:31] KungFuHamster: yes, quite [20:31] avidal: crockford [20:31] CrockBot: God wanted his prototype to be Douglas Crockford, but Douglas Crockford refused thepalephantom [20:31] JimBastard_: what is annonying [20:31] avidal: crock [20:31] JimBastard_: is when you have two of those bots in the same wrong [20:31] JimBastard_: room* [20:32] avidal: heh, yeah [20:32] JimBastard_: they spam until discon [20:32] JimBastard_: since they trigger each other [20:32] avidal: every good bot should have an auto-ignore of *bot [20:32] KungFuHamster: every good bot should have throttling built in [20:32] avidal: and then after that, should also have flood protection [20:32] avidal: yeah [20:32] JimBastard_: try the crockfordbot at your house, i hear its great [20:32] CrockBot: When Douglas Crockford adds 0.1 and 0.2, he gets 0.3. ara_p [20:33] avidal: so what's the deal with nodejs_v8? just playing around with a bot? [20:33] JimBastard_: he evals v8 js code [20:33] JimBastard_: i forgot the trigger [20:33] avidal: ah [20:33] avidal: .v8 [20:33] avidal: .js [20:33] KungFuHamster: eval [20:33] JimBastard_: nodejs_v8: 'eval('a') [20:33] nodejs_v8: JimBastard_: Exception: SyntaxError: Unexpected identifier [20:33] avidal: .eval 1+1 [20:33] JimBastard_: nodejs_v8: ' var x = 1; [20:33] nodejs_v8: JimBastard_: Exception: SyntaxError: Unexpected token ILLEGAL [20:33] JimBastard_: nodejs_v8: var x = "a"; [20:33] nodejs_v8: JimBastard_: undefined [20:34] avidal: nodejs_v8: 1+1 [20:34] nodejs_v8: avidal: 2 [20:34] avidal: i see [20:34] avidal: there is no trigger [20:34] JimBastard_: aye [20:34] KungFuHamster: nodejs_v8: exit [20:34] nodejs_v8: KungFuHamster: Exception: ReferenceError: exit is not defined [20:34] avidal: nodejs_v8: for(;;) {} [20:34] nodejs_v8: avidal: No Output. [20:34] avidal: :P [20:34] JimBastard_: i dont think you can break him [20:34] JimBastard_: i mean, feel free to try [20:34] JimBastard_: its all open-source on github [20:35] KungFuHamster: you can open a dialog with the bot so you don't have to spam the room :) [20:35] rolfb has joined the channel [20:35] avidal: heh [20:36] bmizerany has joined the channel [20:37] mattly has joined the channel [20:38] creationix: so exceptions thrown in process.compile aren't catchable? [20:38] creationix: I seem to remember a thread about that [20:39] creationix: was there a solution? [20:40] sudoer has joined the channel [20:41] mjr_: ry posted a workaround on the list. [20:41] isaacs: that "using node in windows"... shouldn't it really be "using node in ubuntu, and using ubuntu in windows"? [20:41] isaacs: creationix: i sent a patch to the list to fix gthat [20:41] sveimac has joined the channel [20:41] isaacs: creationix: it's tricky. [20:41] markwubben has joined the channel [20:41] creationix: does it break the curte pointer that _ry wanted to keep [20:41] isaacs: creationix: basically, syntax errors are handled really oddly by v8. [20:42] isaacs: creationix: it's not just about breaking the cute pointer. it's about not having any kind of useful stack trace whatsoever. [20:42] isaacs: either you crash the process *now* (ie, it's not catchable) or you don't get to trace the error at all. [20:42] creationix: can you not at least get the line with the syntax error [20:42] isaacs: or you jump through a bunch of hoops to freeze the error message, and hten re-throw so higher up code can catch and report it. [20:43] isaacs: creationix: that's actually what you can't get. [20:43] isaacs: when you do the TryCatch::ReThrow, it loses that info [20:43] creationix: ahh [20:43] mjr_: I'd rather have them be catchable with something like, "no stack available", then for them to elude the try. [20:43] noonat has joined the channel [20:43] creationix: what about process.evalcx, it seems to work a lot like normal eval [20:44] rolfb: news on emerging frameworks for node.js? [20:44] creationix: rolfb: frameworks for what problem? [20:44] JimBastard_: sup rolfb ? [20:44] rolfb: oh right [20:44] rolfb: for webapplications [20:44] JimBastard_: ? [20:44] rolfb: sort of [20:44] creationix: I'm almost done with a git-blog engine [20:44] rolfb: RailsOnNode [20:45] JimBastard_: ExpressJS [20:45] JimBastard_: go knock yourselff out [20:45] JimBastard_: railsfags [20:45] creationix: I gave up on railsonnode, it's nto a good fit [20:45] JimBastard_: nope [20:45] JimBastard_: its a terrible fit [20:45] rolfb: i'm just asking [20:45] JimBastard_: ExpressJS [20:45] rolfb: not opinionated [20:45] JimBastard_: leading framework now, has ruby like syntax [20:45] creationix: rolfb: I don't know of anything new [20:45] JimBastard_: personally im working on hook.io which is a webhook platform [20:46] JimBastard_: a large part of most modern day web applications, but not rails at all [20:46] creationix: I use node-router for my sinatra-like stuff [20:46] rolfb: mostly i'm interested in frameworks which takes care of some of the grunt work for stuff like csrf [20:46] creationix: rolfb: If I do come across anything interesting, I'll post it to thechangelog [20:46] rolfb: creationix: url? [20:47] creationix: http://thechangelog.com/ [20:47] creationix: or maybe write a howtonode article about it [20:47] JimBastard_: csrf? [20:47] JimBastard_: cross site request forgery? [20:47] noonat: yep [20:47] JimBastard_: lulz [20:48] JimBastard_: i dont know how to address that statement [20:48] devinus has joined the channel [20:48] rolfb: creationix: cool [20:49] rolfb: seems constructive [20:49] rolfb: JimBastard_: please inform me of what you are implying [20:49] JimBastard_: why dont you tell me what you are worried about [20:50] JimBastard_: and dont just say csrf [20:50] rolfb: hmm [20:50] JimBastard_: if you have a legit csrf issue i'd be glad to assist [20:51] rolfb: valid point [20:51] JimBastard_: if you are coming from we need "H" land [20:51] JimBastard_: i dont know what to say :p [20:51] rolfb: "H" is out [20:51] rolfb: :P [20:51] rolfb: but i get your point [20:51] noonat: Can anyone explain the difference between the binary stream encoding and the ascii stream encoding? [20:52] creationix: noonat: good question [20:52] noonat: I haven't been able to get them to spit out any different bytes, and I'm having trouble wading through the V8 code to figure out what WriteAscii is doing... [20:52] creationix: ACTION checks what the new docs say [20:53] creationix: I remember that once upon a time binary was an array of integers [20:53] noonat: The old raw? [20:53] creationix: yeah [20:53] creationix: hmm, then what is binary [20:53] rolfb: JimBastard: thinking about it it is probably not a bigger issue than cleaning the strings [20:53] stalled has joined the channel [20:53] JimBastard_: rolfb: depends which side you are trying to project right? [20:53] JimBastard_: protect [20:54] rolfb: always [20:54] JimBastard_: are you worried about people attacking your site via CSRF or people using your site as a CSRF launching point [20:54] JimBastard_: i.e. are you boa or are you a blog [20:54] rolfb: boa? [20:54] creationix: hmm, just says 'ascii' and 'binary' only look at the first 8 bits of the 16bit JavaScript string characters [20:54] JimBastard_: sorry, bank of america [20:54] rolfb: ahah [20:55] noonat: creationix: DecodeWrite passes ascii through WriteAscii, but always just takes the first byte of the short for binary [20:55] rolfb: most of the times i'm close to a bank than boa [20:55] noonat: I have a suspicion that WriteAscii is doing something clever on top of that... but I can't get it to actually do anything different :( [20:55] rolfb: err [20:55] rolfb: closer to a blog than boa [20:55] creationix: noonat: ask _ry, he should know [20:56] JimBastard_: so then just don't allow fucked up hyper links [20:56] JimBastard_: or iframes [20:56] JimBastard_: theres a few things you can do, sorry i gtg [20:57] rolfb: but right, I would like to have ensurance that requests are coming from proper channels more than people using it as a CSRF launching point [20:57] rolfb: but i'll admit i like the way Rails is doing it now [20:57] creationix: rolfb: well, I'm pretty sure there aren't any frameworks or libraries that implement that yet, good luck [20:58] rolfb: :) [20:58] noonat: rolfb: csrf protection isn't bad to add yourself [20:58] creationix: I like node because it forces me to understand what I'm doing [20:58] noonat: rolfb: it just means persisting some value server-side, associating it with the user via a cookie (or some other session identifier), and ensuring that the incoming request for a form matches the one in the session [20:59] creationix: I spent the last three days implementing proper http headers for caching and gzip encoding for my site [20:59] rolfb: creationix: i like to create things that adds value to someone, not neccessarily understand everything about the materials i build it with [20:59] rolfb: knowledge is power, sure ... but abstraction isn't that bad [20:59] creationix: rolfb: you should write a form validation library that shares validation code between the server and client [21:00] creationix: that would be useful and could include the identity check [21:00] rolfb: mhm [21:00] rolfb: sounds interesting [21:01] rolfb: yay, links expressjs.com are dead [21:02] rolfb: http://expressjs.com/plugins.body-decoder.html by example [21:02] creationix: but, you're right, there's a reason that most the node community is still framework and library developers [21:02] brapse has joined the channel [21:03] rolfb: :) [21:03] JimBastard_: rolfb: if you are looking to start a node open-source project i could defintely assist in getting you on the right path [21:04] JimBastard_: anything you do for the most part should be just a CommonJS module that exports some functionality, this will allow a lot of people to easily itegrate [21:04] rolfb: right now i'm considering making an open source plugin for express [21:04] JimBastard_: thats not a bad idea [21:04] mjr_: creationix: I find that if your abstraction layer doesn't make you understand what you are doing, it'll only be a matter of time before you've caused some problem that requires you to not only know what you are doing to get out of, but might actually be impossible. [21:04] avidal: interesting idea on shared form validation [21:04] JimBastard_: i would try to aim more towards a generic node module then something express specific if you can [21:05] JimBastard_: but there is no reason it couldnt be both [21:05] rolfb: mhm [21:05] siong1987 has joined the channel [21:06] rolfb: shit [21:06] rolfb: i haven't been looking at commonjs [21:06] rolfb: well, that sure was stupid [21:07] mjr_: I just noticed that there are almost as many people on the node channel as on the couchdb channel. [21:07] avidal: that express homepage is a bit dramatic [21:07] avidal: all dark and mysterious [21:08] rolfb: avidal: did you get scared? :) [21:08] jherdman has left the channel [21:09] JimBastard_: rolfb: CommonJS is pretty easy [21:09] rolfb: JimBastard_: could you point me to a guide for making CommonJS modules and the license? [21:09] rolfb: :P [21:09] JimBastard_: its retardly simple [21:10] darkf has joined the channel [21:10] isaacs: rolfb: just look at the node docs under "modules" [21:10] isaacs: your file is your module. put stuff on the "exports" object. [21:10] isaacs: if you're using node, your'e already using commonjs modules. [21:10] rolfb: not *using* node as of now [21:11] rolfb: but very interested [21:11] KungFuHamster: node-curious [21:11] rolfb: and do believe javascript is gonna be huge on the server side [21:11] jbrantly: lol @ KungFuHamster [21:12] rolfb: isaacs: thanks [21:13] avidal: someone needs to do udp for node [21:14] KungFuHamster: seconded [21:14] mjr_: I keep meaning to do UDP. I need it. [21:14] mjr_: Then I stop because I hate C++. [21:14] rolfb: good practices on namespacing modules? [21:14] avidal: I would take a look at it, but I'm not really that good :P [21:15] avidal: it's forced into the 'namespace' from require, afaik [21:15] avidal: so, var mymodule = require('mymodule'); [21:15] avidal: forces it into 'mymodule' as a namespace [21:16] marienz has joined the channel [21:16] rolfb: so basically require just loads the code into an object [21:17] avidal: yeah, whatever you put into your exports object [21:18] derbumi has joined the channel [21:18] rolfb: sounds simple enough :) [21:18] rolfb: guess JimBastard was right [21:18] rolfb: :P [21:19] JimBastard_ has joined the channel [21:19] JimBastard_: yarg internet came back [21:19] JimBastard_: did you get a good CommonJS example? [21:19] JimBastard_: rolfb: [21:19] rolfb: JimBastard_: i got the node docs Modules [21:19] rolfb: :) [21:20] avidal: what's process.binding? [21:21] stalled has joined the channel [21:23] isaacs: avidal: it's the stuff that gets bound to the process object in c [21:23] ahaller has joined the channel [21:23] isaacs: avidal: check out src/node.cc and src/node_process.cc [21:23] avidal: hrm [21:23] avidal: roger [21:24] noonat: Er... I don't think there's a node_process.cc [21:25] noonat: It's all built out in node.cc isn't it? [21:25] rolfb: does thechangelog publish news on twitter? [21:25] rolfb: news of news [21:25] rolfb: :P [21:26] isaacs: noonat: i could be a bit out of date. it might just be node.cc [21:26] javajunky has joined the channel [21:28] marienz has joined the channel [21:30] ahaller: Hi. i've heared that node.js would be a good fit to do realtime stuff. Do you know if there are any OSC (OpenSoundControl) for node in the making? [21:30] JimBastard_: ahaller: i would talk to binary42 [21:30] nefD: ahaller: Haven't heard of anything official or otherwise along those lines, myself.. [21:31] JimBastard_: im pretty sure he has a lot of OSC experience and node experience [21:31] JimBastard_: if anyone knew what was up it would be him for sure [21:31] JimBastard_: hes on github [21:32] mattly: ahaller: i've been working on one on the backburner [21:32] ahaller: cool, @all [21:36] kenneth_reitz has joined the channel [21:36] ahaller: mattly, so you say it's feasible do to things like that with node? [21:37] voodootikigod__ has joined the channel [21:37] kenneth_reitz has joined the channel [21:37] sudoer has joined the channel [21:37] mape: Hmm if I want to send post data to the node httpd, where would I fetch that info? [21:38] JimBastard_: mape, multipart? [21:38] isaacs: mape: request.addListener("data", function (chunk) { read a bit of post data }) [21:38] mape: ok, no just text post, isaacs thanks I'll try that :) [21:38] isaacs: mape: depending on what kind of request body you're getting, you may want to wait for the "end" event to actually process it [21:39] isaacs: mape: if you're doing multipart, you can feed the chunks into a parser object from multipart-js [21:39] noonat has joined the channel [21:43] felixge: isaacs: while you're here [21:43] isaacs: felixge: yo [21:44] felixge: isaacs: I think multipart-js should emit part objects which are streams [21:44] felixge: isaacs: so we can pipe parts to files [21:44] isaacs: felixge: "which are streams"? [21:44] isaacs: you mean, automatically do the base64 decocde? [21:44] marienz has joined the channel [21:44] isaacs: because that's planned. [21:44] felixge: isaacs: well, that would be another duplex stream in between [21:44] isaacs: but if you mean that multipart-js should implement some node-specific api, then no [21:45] felixge: isaacs: no, I just mean part objects themselves having addListener('data') and stuff [21:45] felixge: isaacs: oh, why is that? [21:45] isaacs: because i want to use it on the browser, and in a non-node environment. [21:45] felixge: isaacs: :( [21:45] JimBastard_: hi felixge ;-) [21:45] felixge: JimBastard_: hey, I got a good way last night :) [21:45] isaacs: felixge: if you want to wrap it in a node-multipart project, then i'd encourage your efforts and be willing to make changes to my kit as neceesary to support you [21:45] JimBastard_: :p [21:46] JimBastard_: ive resorted to writing custom querying api calls for my specific use cases [21:46] isaacs: felixge: but multipart-js is gonna stay agnostic and just pure js [21:47] felixge: isaacs: hm, I'll look into it. But since I only care about file uploads and the server side I'm not sure yet wrapping is gonna be worthwhile [21:47] JimBastard_: i just stole the old multipart js from a previous node version [21:47] JimBastard_: as it still kinda works [21:47] felixge: :) [21:48] isaacs: i'm noticing already that my node hacking has really slowed down since i got a day job [21:48] felixge: isaacs: mine has slowed down since I got stuck with an old node version [21:48] felixge: isaacs: but luckily that one is so buggy that we can't launch transloadit now :( [21:48] felixge: so I'm back to node:HEAD :) [21:49] rolfb has joined the channel [21:49] JimBastard_: me, ive been doing something like 20+ commits a day for weeks now [21:50] JimBastard_: im approaching the end of a death march [21:50] JimBastard_: its been a good one though [21:50] JimBastard_: there is light at the end of the tunnel [21:51] felixge: isaacs: does your day job involve any node? [21:51] JimBastard_: between the front, back, and docs there is over 10k lines of code (i dont think that includes submodules) [21:51] isaacs: felixge: nope [21:51] felixge: JimBastard_: all for hook.io? [21:55] JimBastard_: aye [21:55] rictic has joined the channel [21:55] JimBastard_: lots of framework glue [21:56] dnolen has joined the channel [21:56] JimBastard_: validators, dispatchers, models, etc [21:56] JimBastard_: you'd think thats too many lines, but it all adds iup [21:56] JimBastard_: also, im using github impact numbers, so who knows [21:57] JimBastard_: i should prob get a real line count [21:57] JimBastard_: and then the front-end has like jquery UI so that is a couple k right there [21:57] JimBastard_: yeah, those numbers mean shit [22:02] maushu has joined the channel [22:05] sveisvei has joined the channel [22:07] kriszyp has joined the channel [22:07] devinus: has anybody taken up the multipart banner ? [22:08] isaacs: devinus: http://github.com/isaacs/multipart-js [22:08] devinus: isaacs: how come i knew it would be you ? :P [22:10] devinus: if i'm reading in a file should i be using += on a string or node's buffer class? [22:10] devinus: [image dara[ [22:10] devinus: data] [22:15] xla has joined the channel [22:16] marienz has joined the channel [22:22] bmizerany has joined the channel [22:23] FSX has joined the channel [22:25] gf3 has joined the channel [22:34] brianmario has joined the channel [22:37] isaacs has joined the channel [22:39] FSX: Can someone help me with a small problem? [22:39] SiVA_ has joined the channel [22:41] isaacs has joined the channel [22:41] mjr_: FSX: only one way to find out, just ask. [22:41] isaacs: FSX: sorry, this is large problem support. [22:42] isaacs: FSX: we don't do small problems here. [22:42] isaacs: FSX: i suggest you do nothing, and when it becomes a large problem, come back. [22:42] mjr_: However, we are good at converting small problems into big problems, on demand. [22:42] isaacs: devinus: the buffer class is probably way faster. [22:43] isaacs: devinus: and perhaps safer. [22:43] mjr_: Sometimes by accidental problem type coercion. [22:43] FSX: .. Right. Ok. I'm not very good with Javascript (not yet). I can't get this code working: http://pastebin.com/8Kp8qF7b [22:44] isaacs: FSX: get out of the habit of using one-true-brace style. it's dangerous in javascript. [22:44] devinus: isaacs: you know if writeFile supports buffers/ [22:44] devinus: ? [22:44] isaacs: also, no need for the extra closure. [22:44] mjr_: crockford would not approve [22:44] CrockBot: Douglas Crockford does not set his alarm, he uses setInterval wnas [22:45] FSX: isaacs: Huh? You lost me. [22:45] isaacs: FSX: don't put a \n before your { [22:45] isaacs: that's not why this particular code isn't working, but it's unsafe in several scenarios in javascript, so best to avoid altogether [22:46] FSX: I see. I'll remember that. [22:46] isaacs: FSX: so, what do you expect this code to do? [22:46] isaacs: afaict, it just exports a render function. [22:46] isaacs: it doesn't actually call anything. is that right? [22:47] FSX: Yes, that render function should read a file, parse the Haml template and return it. [22:47] isaacs: FSX: also, this is an error: [22:47] isaacs: var variables = variables || {}; [22:47] isaacs: don't var it if it's a function param [22:47] FSX: Ok [22:48] isaacs: FSX: here's an edited version: http://pastebin.com/J1XspgWt [22:48] isaacs: does that work as expected? [22:48] FSX: I'll try it. [22:48] isaacs: oh, wait a second.. [22:48] isaacs: hahaha [22:48] isaacs: wait, wait, missed the obvious bug. [22:48] isaacs: readFile is async [22:48] isaacs: so it's not actually doing the render until later. [22:48] isaacs: but you're returning "output" now [22:49] FSX: Oh [22:50] FSX: DO I need to use fs.readFileSync? [22:50] FSX: *Do [22:50] isaacs: FSX: http://pastebin.com/PPzZmJBs [22:50] isaacs: there ya go [22:50] isaacs: now it takes a cb, and if given a cb, it uses the async, otherwise it uses sync [22:51] hassox has joined the channel [22:51] isaacs: FSX: for extra credit, now both the cb and the variables hash are optional: http://pastebin.com/VaLJRjHc [22:53] FSX: Ok, thanks isaacs. Do you perhaps know a good resource to learn this Javascript? [22:53] isaacs: FSX: node's source code? [22:55] FSX: isaacs: Thanks again. I feel like I'm asking stupid question... [22:55] isaacs: FSX: no problem :) [22:56] FSX: I'm used to Python/PHP. Js doesn't really look like those languages. [22:59] JimBastard: no [22:59] JimBastard: it [22:59] JimBastard: doesnt [22:59] JimBastard: thank [22:59] JimBastard: god [22:59] FSX: Hmm? [23:00] isaacs: hahah [23:00] MattJ has joined the channel [23:00] isaacs: i'm installing ubuntu on a macbook pro. part of me is a little horrified, and another part of me is deeply gratified by this. [23:00] JimBastard: w3schools has a good noobie course into JS [23:00] JimBastard: but its a noobie course [23:00] isaacs: JimBastard: s/good/dangerously bad and misleading/ [23:01] JimBastard: i think #javascript has the funniest trigger for w3schools [23:01] JimBastard: MDC is a bit terse for a first time use [23:01] FSX: MDC? [23:02] JimBastard: http://developer.mozilla.org/ [23:02] JimBastard: https://developer.mozilla.org/En/JavaScript [23:02] JimBastard: JS is a pretty simple language overall [23:02] JimBastard: some of the DOM stuff gets a bit hairy [23:02] JimBastard: but DOM isn't JS [23:03] FSX: Thanks for the links. [23:03] isaacs: FSX: you should get Javascript: The Good Parts, and Javascript: The Definitive Guide [23:03] JimBastard: if you are doing SSJS you'll probaly need to brush up on control flow [23:03] isaacs: note that the good parts is tiny and the definitive guide is huge. [23:03] JimBastard: and async patterns [23:03] isaacs: it's mostly bad parts. [23:03] JimBastard: have you seen www.howtonode.org [23:04] FSX: I see it now. ^^ [23:04] JimBastard: there are some good posts there [23:04] JimBastard: i wouldnt go to overboard though [23:05] mikeal: isaacs: we have both of those in the office [23:06] mikeal: they are hilarious next to each other because of the size differences [23:06] JimBastard: sheet the other javascript book i got is the internet and firebug [23:06] JimBastard: the only* [23:06] JimBastard: i cant even read [23:06] freshtonic has joined the channel [23:07] mjr_: I really enjoyed "Good Parts". Highly recommended. [23:07] FSX: I'll buy it once I got money again. [23:07] JimBastard: reading tech books is like reading books about how to have good sex. sure you might get a few good pointers, but why not just go out and start fucking? [23:07] mjr_: I kinda felt dumb for writing all of that JS code before having read that book. [23:07] JimBastard: :p [23:07] atmos: haha [23:07] FSX: Got to go. Goodnight anf thanks for the help. [23:08] JimBastard: see ya FSX [23:08] JimBastard: good luck [23:08] FSX: Hehe ^^ [23:08] mjr_: Theory is meaningless without the practice. [23:08] FSX: Bye [23:09] mjr_: isaacs: did you represent last night at the Yahoo thing? [23:10] isaacs: mjr_: i did, but there was really no ssjs stuff going on [23:10] isaacs: mostly i just said hi to former coworkers and tried to recruit a few [23:11] mjr_: since you are here, do you have thoughts on this issue? [23:11] mjr_: http://github.com/ry/node/issues#issue/86 [23:12] ryan[WIN] has joined the channel [23:12] mjr_: I rewrote some of repl, and I'm about to update the docs. I'm not sure what to make of that one. [23:20] isaacs: mjr_: hey [23:20] WALoeIII has joined the channel [23:20] isaacs: mjr_: so, the issue is probably that the actual module in the repl is require("repl"), not the cwd [23:21] mjr_: I'm not sure what the expected behavior of a require from repl is though. [23:23] isaacs: mjr_: yeah, i think the expected behavior would be to load relative to the cwd. [23:23] mjr_: cwd of node itself then [23:24] mjr_: Because people starting repl might assume that it would read from wherever they started repl from [23:25] isaacs: mjr_: i'd think it was the cwd from where you ran the repl [23:25] isaacs: mjr_: ie, process.cwd() [23:26] mjr_: I guess whatever process.cwd says is about all we can do. [23:26] mjr_: The new repl lets you connect from multiple different places at the same time [23:26] isaacs: right. [23:26] isaacs: i'd say, feel free to close that as "WONTFIX" [23:27] isaacs: or at least, mark it as a module loader problem, rather than a repl problem. [23:27] isaacs: maybe the "path" of native modules should always be process.cwd() [23:27] mjr_: So if you do that .. stuff in a require inside a repl, that works as you'd expect right now? [23:27] isaacs: the issue there would be if you did a chdir, and then require("../foo") [23:27] isaacs: mjr_: well, no. [23:28] isaacs: mjr_: it says it can't find the module [23:34] kriskowal has joined the channel [23:34] mjr_: isaacs: but that's the same thing it does outside of repl, right? I had to make a test program to confirm. [23:36] paul___ has joined the channel [23:38] JimBastard_ has joined the channel [23:40] mjr_: It looks like your first comment is still an issue, although that's not the issue that's described in the bug. [23:41] NickP: Is there no more SSL in 0.1.90? [23:42] paul___ has joined the channel [23:42] creationix: spealing of repl, I just added a basic sandbox to the code samples on howtonode [23:42] creationix: http://beta.howtonode.org/prototypical-inheritance [23:42] mjr_: NickP: check http_old [23:42] creationix: the code snippets are ran server side with output shown on the page [23:43] mjr_: creationix: can you make that photo of yourself a little larger? I think there are some subtle shading and dimpling that we are missing out on. [23:43] JimBastard_: lol [23:43] creationix: mjr_: only up to 512, that's the limit on gravitars [23:43] JimBastard_: creationix: are you recompiling on page load? [23:43] JimBastard_: or is it done once and outputs static html? [23:44] creationix: it's on the fly, but with really smart caching [23:44] JimBastard_: understood [23:44] creationix: no static files anywhere [23:44] JimBastard_: thats pretty spiffy [23:44] JimBastard_: i would be careful not to dive too far into the rabbit hole [23:44] creationix: yep, just a bare git repo and a node script, nothing more [23:44] JimBastard_: or it will consume you [23:44] NickP: mjr: I'm trying to use SSL with httpClient on 0.1.33 and get an error 'Property 'tcpSetSecure' of object # is not a function' [23:45] mjr_: NickP: instead of require('http'), do require('http_old') [23:45] NickP: this is on 0.1.33 not 0.1.90 [23:45] mjr_: oh, sorry. [23:46] NickP: creationix: Nice work on Step, I'm using it in one of my projects [23:46] creationix: JimBastard_: I'm trying to figure out how I want to do partial snippets [23:46] creationix: NickP: thanks, I'm using it like crazy in the new howtonode [23:47] NickP: Yea I needed to look through your code to get my head around it properly [23:48] JimBastard_: creationix: this is all powered by your blogging engine right? the changes you make are changes in the blog engine not just howtonode right? [23:48] creationix: yep, wheat is the blogging engine [23:48] JimBastard_: awesome [23:48] bpot has joined the channel [23:48] creationix: the howtonode repo is purely data, no logic [23:48] JimBastard_: im gonna have to make the jump from radiant to wheat [23:49] JimBastard_: a solid blogging engine is always good to have [23:49] creationix: anybody want to volunteer to write me an ajax disqus client for the site? [23:49] JimBastard_: ive done a bit of work building asp id be down for talking features anytime [23:49] JimBastard_: (application service providers) [23:50] JimBastard_: usually has a blogging engine of some sort [23:50] JimBastard_: disqus ajax sucks fyi [23:50] JimBastard_: ive worked with it a bit, it blocks by default [23:50] JimBastard_: i made it nonblocking [23:50] creationix: well, my goal is for wheat to not be a framework, but rather a starting point for a project [23:50] JimBastard_: but then getting the actual callback for when it completes if torture [23:50] creationix: anyone wanting a blog or similair project would fork wheat and just customize it directly [23:51] JimBastard_: is torture [23:51] JimBastard_: totally [23:51] JimBastard_: like wordpress? [23:51] JimBastard_: (but not a bad implementation) [23:51] creationix: JimBastard_: no, wordpress is a platform [23:51] JimBastard_: hrmmm [23:51] JimBastard_: ill keep my eye on the project for sure [23:51] creationix: wheat is a prototype (in the javascript oo sense) [23:52] creationix: you just take it and customize it to fit your needs, there are no assumptions that you have to follow or be screwed [23:52] creationix: but since all the skinning and content are in a seperate repo, you can make a blog like howtonode without any changes at all [23:53] creationix: I don't like the default disqus interface, that's why I want a custom ajax interface [23:53] atmos: jekyll ! [23:53] Aria has joined the channel [23:54] creationix: can jekyll run node code and output it to the screen? ;) [23:54] atmos: nah, it's just markdown [23:54] atmos: self hosting on github is nice though [23:54] JimBastard_: im still trying to wrap my head around this git submodule strategy [23:54] creationix: node-blog is a lot like jekyll [23:55] creationix: that's what runs howtonode.org right now [23:55] creationix: but I wanted something more powerful and easier to use [23:57] JiMBasdtard has joined the channel [23:57] JiMBasdtard: ugh stupid webchat [23:58] JiMBasdtard: did my last message go through? [23:59] JiMBasdtard: to review from before...i've got an open-source project that uses several git submodules. part of our install doc is "git submodule update --init" but all the submodules point to repo's we don't control. the concern is if we have to push a patch to one of the repos we'll have to wait for the author to pull our request. [23:59] JiMBasdtard: should i just fork every project i want to use and use my fork as the submodule?