[00:19] cloudhead has joined the channel [00:24] Connorhd_ has joined the channel [00:24] JoePeck has joined the channel [00:26] JimBastard: can someone help me with an easy multipart.parse question? i feel like im being retarded right now [00:26] JimBastard: http://gist.github.com/251291 [00:26] JimBastard: debug.log('multipart') seems to want to fire, i think i have my events out of order [00:26] JimBastard: doesnt seem to want to fire* [00:30] isaacs: JimBastard: There's a syntax error, and your whitespace is atrocious! tabs or spaces are fine, but please pick one and stick to it. http://gist.github.com/251295 [00:30] JimBastard: i just copy pastied, my editor has fucked up tabs / whitespace [00:30] JimBastard: sorry about that [00:30] isaacs: you should un-fuck-up them, or get a new editor ;P [00:30] isaacs: ACTION is feeling ocd, sorry [00:31] JimBastard: thats fine you are right [00:31] isaacs: i forked and fixed [00:31] JimBastard: im still trying to figure out multiparse though [00:32] isaacs: yeah, i don't really know much about it. just checked out the gist, and went "GAHH!" and was compelled to fix the layout, like finding a knotted telephone cord or unpopped bubble wrap. [00:32] isaacs: that kinda thing [00:32] isaacs: sorry for distracting. [00:32] JimBastard: you should lay off the pills [00:32] JimBastard: ;-) [00:36] inimino: haha [00:36] JimBastard: sup inimino [00:36] inimino: hey JimBastard [00:36] JimBastard: http://gist.github.com/251291 never wants to fire [00:36] jed has joined the channel [00:37] JimBastard: its annonying getting stuck trying to figure out form posts for a day [00:37] JimBastard: or two [00:37] inimino: is that the whole thing? [00:37] JimBastard: no [00:37] inimino: anyway, I've never used that API, sorry [00:37] JimBastard: http://gist.github.com/251291 [00:37] JimBastard: thats more of it [00:37] JimBastard: how the hell you doing form posts? [00:38] inimino: I'm not [00:38] JimBastard: ohh [00:38] JimBastard: sounds complicated [00:39] inimino: it's pretty easy, not doing something [00:39] RayMorgan: JimBastard: try something like: var stream = new multipart.Stream(req); stream.addListener('part', function(part) { [00:40] inimino: setTimeout...? [00:40] RayMorgan: (got that from test-multipart.js in the node src) [00:42] JimBastard: RayMorgan - what if i want to continue processing the request after all that [00:42] JimBastard: like all i want to do is a simple form post and get those variables scoped so i can pass it along the request [00:43] mattly has joined the channel [00:43] RayMorgan: you still have access to req [00:44] inimino: hm... [00:44] inimino: you need to add the listener for the body events /before/ the whole thing streams in [00:44] inimino: I don't know wtf that setTimeout call is for [00:44] elliottcable: what inimino said. [00:44] RayMorgan: yeah, the setTimeout will probably mess it up [00:45] RayMorgan: since request will emit a body event before the setTimeout function fires [00:46] jtaby has joined the channel [00:47] JimBastard: word [00:47] JimBastard: should i take the setTimeout out? [00:47] RayMorgan: yeah [00:47] JimBastard: why is that used in the demo [00:47] RayMorgan: just to show that the server won't block [00:47] elliottcable: ACTION doesn’t remember a setTimeout in any demo o_O [00:47] elliottcable: oh [00:47] inimino: ACTION hasn't read too many demos [00:47] RayMorgan: he is talking about the first example on the node js site [00:48] RayMorgan: (I assume) [00:48] inimino: ah... I know the one now [00:48] inimino: the one-second-later hello world [00:48] RayMorgan: yeah [00:48] JimBastard: ohhhhhhhhhhh shiiiit [00:48] JimBastard: works now [00:48] RayMorgan: :) [00:48] JimBastard: awesome thanks [00:48] RayMorgan: yeah, np [00:49] JimBastard: what is the setTimeout for? limiting requests? [00:49] inimino: :) [00:49] inimino: it's just an example [00:49] JimBastard: what does it do? [00:49] RayMorgan: it is to show that the server will not wait for the setTimeout to finish before starting the next request [00:49] isaacs: maybe that example is not such a good example. [00:49] inimino: it delays the response by a second [00:49] JimBastard: ohhh [00:49] JimBastard: well it seems to mess up multipart [00:49] isaacs: it was confusing to me, too [00:50] RayMorgan: yeah it will [00:50] isaacs: "here's how you can slow down your server's response, isn't that great?!" [00:50] isaacs: seems like an anti-use case [00:50] inimino: well... it ... ok maybe the example should be changed [00:50] inimino: hehe [00:50] inimino: well, it stands in for some real work... but I guess that's not obvious [00:50] JimBastard: yeah that seems to be really easy now [00:51] isaacs: i mean, it's great and all that if your server takes 3 seconds to load up something, and you do it async-stylie, it won't bork your whole stack like it would it some other languages i know. [00:51] JimBastard: i was going a little crazy trying to figureit out [00:51] JimBastard: you could do a settimeout on the response.finish() instead [00:51] JimBastard: maybe noti [00:51] isaacs: having worked in some crazy multi-server type contexts at yahoo, i can say, keeping pipes open while waiting for stuff can really destroy your responsiveness [00:52] inimino: that wouldn't be quite the same [00:52] inimino: it's probably the multipart stuff that needs better docs [00:52] inimino: I assume if you were reading the request body raw it'd have been less confusing [00:52] JimBastard: i was trying to do that, but it NEVER had my data in it [00:52] JimBastard: i wonder if its there now [00:52] RayMorgan: it is the fact that the first body event from the request gets emitted immediately when the http.createServer(function (req, resp) { ... }_ returns [00:53] RayMorgan: so all the body events emitted, and then the setTimeout fired.. but now there is no more body data to read [00:54] RayMorgan: that didn't make very much sense :( [00:55] JimBastard: so if i have multipart.parse(req).addCallback(function(parts) { debug.log(parts); }); , is it safe to continue processing the request or do I have to execute inside the context of this event? [00:55] RayMorgan: you should do it inside the callback function (ie: function(parts) { debug.log(parts); }); ) [00:56] JimBastard: got ya [00:56] JimBastard: IoC time [00:56] JimBastard: ^_^ [00:59] inimino: ACTION just wrote some racy-as-hell streaming code [00:59] JimBastard: databinding? [01:00] inimino: HTTP client, writing chunks to the server and sending them out as they come in [01:00] inimino: kind of a caching proxy kind of thing [01:00] JimBastard: got ya [01:02] JimBastard: so if i want posted form data available to the entire request, would i have to wrap the request in multipart.parse(req).addCallback(function(httpParams) { ... [01:04] jtaby: Hey, i've implemented a long-polling chat server using node.js, but in webkit, the address bar keeps saying "loading" [01:05] jtaby: indefinitely [01:05] inimino: jtaby: are you using an iframe? [01:05] jtaby: inimino: nope [01:06] inimino: oh, I vaguely recall Safari doing that [01:06] jtaby: but, chat.nodejs.org doesn't do that [01:06] inimino: I think I decided not to care [01:06] JimBastard: if the poll is open, its still loading [01:06] xantus: safari sucks btw [01:07] jtaby: xantus: umm, what makes you say that/ [01:07] jtaby: safari is the best browser IMO [01:07] jtaby: especially webkit [01:07] JimBastard: k [01:07] jtaby: (nightly builds) [01:07] JimBastard: good luck with that bug [01:07] jtaby: but, that's not a discussion for this channel :) [01:07] xantus: ;) [01:08] orlandov: i agree, safari (the browser, not webkit) is really bad [01:08] xantus: I developed comet stuff for various toolkits and browsers [01:08] jtaby: orlandov: xantus why do you guys say that? [01:08] orlandov: jtaby: command-1 doesn't do the right thing! [01:08] binary42 has joined the channel [01:08] orlandov: that's inexcusable [01:09] jtaby: what's "the right thing"? [01:09] xantus: I have some experience with it...I started the Cometd project [01:09] orlandov: jtaby: go to the first tab [01:09] jtaby: orlandov: that's what firefox does [01:09] orlandov: jtaby: yeah but safari doesn't [01:09] jtaby: I much prefer safari's implementation [01:09] orlandov: safari gos to the homepage or soemthing retarded [01:09] jtaby: makes browsing to common sites much easier [01:09] jtaby: orlandov: command 1-9 goes to bookmarks 1-9 [01:10] orlandov: jtaby: understood, but what do you use more? tabs? or bookmarks [01:10] jtaby: orlandov: I go to my most popular sites more often than I navigate explicitly to the first tab (also considering that I can navigate tabs using cntrl-tab) [01:11] orlandov: i guess we'll have to agree to disagree :) [01:11] jtaby: haha yeah, differences of opinion [01:12] jtaby: tbh, I used firefox for a few months, and after a while I got used to its implementation [01:12] jtaby: it's just a matter of habit [01:12] orlandov: jtaby: yeah totally [01:12] xantus: keyboard nav on mac os in general sucks [01:12] jtaby: xantus: again, I have to wonder why you say that [01:12] JimBastard: sup binary42 [01:12] jtaby: I do most everything on my mac using the keyboard [01:13] xantus: move a window from one space to another using your keyboard [01:13] binary42: JimBastard: Heya [01:13] binary42: JimBastard: Going to make it to NYC.js? [01:13] xantus: I'm trolling btw ;) [01:13] JimBastard: hell ya [01:13] xantus: it was a little quiet in here [01:13] binary42: JimBastard: Good to hear. [01:13] JimBastard: i wanna show off node_debug [01:14] JimBastard: xantus - you should blog about that [01:14] orlandov: speaking of js meetups... there's going to be a vancouver js usergroup on wednesday - topic is SSJS iirc [01:14] binary42: Oh sweet. Damn... this is going to rock. [01:14] JimBastard: we are about to go see eclectic method in flatiron [01:14] xantus: JimBastard: :) [01:14] JimBastard: they going on at 10 [01:15] JimBastard: video remix guys [01:15] binary42: JimBastard: Awesome. [01:15] JimBastard: http://www.eclecticmethod.net/2009/11/12/relix-holiday-party-blender-theater-nyc/ [01:16] binary42: What's the cover? [01:17] JimBastard: freeeeeee [01:17] JimBastard: open bar from 7-9 [01:17] binary42: Damn... I'm there I think. [01:17] binary42: I was going to port homebrew to Ruby+CouchDB but I'd rather do that. :P [01:18] malkomalko: interesting [01:18] isaacs: binary42: where are you putting couchdb in homebrew? [01:19] binary42: isaacs: I'm doing it so I can mirror my setup between multiple machines. [01:19] binary42: More on it later I hope... but it can wait. [01:19] malkomalko: shit that's tonight! [01:19] malkomalko: Damn rehearsal! [01:19] binary42: Heheh. I need to finish eating ... just got home but I'm out after that. [01:21] binary42: ACTION signs out. [01:24] postfuturist has left the channel [01:26] eddanger has joined the channel [01:34] shfx has joined the channel [01:36] JimBastard: whats wrong with: posix.write('xxx.html', 'blah blah blah'); [01:39] rtomayko has joined the channel [01:48] JimBastard: anyone [01:49] JoePeck has joined the channel [01:50] JimBastard: whats the easiest way to create and write to a file in node? [01:50] Connorhd_: thats not the right syntax, read the docs? [01:50] JimBastard: ive been reading the docs [01:50] JimBastard: for weeks [01:50] JimBastard: and debugging the posix object [01:50] JimBastard: http://nodejs.org/api.html#_posix_module [01:51] Connorhd_: you need to use posix.open to get an fd [01:51] JimBastard: so is write in the callback for open? [01:51] JimBastard: will .open create a file? [01:51] Connorhd_: I believe so [01:51] JimBastard: posix.open('xxx.html'); [01:52] JimBastard: bad argument [01:52] Connorhd_: man open [01:54] JimBastard: ? [01:56] Connorhd_: http://linux.die.net/man/2/open [01:56] JimBastard: saaaaampppllleee code [01:56] JimBastard: its one line [01:57] JimBastard: posix.open('xxx', 'O_CREAT'); ? [01:58] Connorhd_: "See open(2). The constants like O_CREAT are defined at process.O_CREAT." [01:58] Connorhd_: I don't know you'll have to try it [01:59] JimBastard: you make it sound like im not reading the docs or trying [02:00] inimino: well... [02:00] Connorhd_: well the docs say "'See open(2). The constants like O_CREAT are defined at process.O_CREAT." [02:00] inimino: http://boshi.inimino.org/3box/revstore/dispatch.js [02:01] inimino: JimBastard: search for 'writeFile' there [02:01] inimino: search for 'function writeFile', and probably writeChunks too [02:01] JimBastard: what is that all about inimino [02:02] inimino: JimBastard: it's a bunch of stuff in one file because my http server doesn't quite support loading modules yet [02:02] JimBastard: lol [02:02] JimBastard: got ya [02:02] inimino: JimBastard: anyway, those functions should show you what you need to do [02:03] JimBastard: thanks [02:03] inimino: or you can just copy them [02:03] inimino: writeFile(path,string,encoding,mode) returns a Promise [02:03] inimino: and you can find examples of use in that same file [02:04] cdorn has joined the channel [02:04] JimBastard: awesome that worked [02:05] JimBastard: just didnt know exactly what the arguments were suppose to look like [02:05] JimBastard: :-) [02:05] JimBastard: im letting anonymous users create abitrary files and content, this should be fun to watch [02:06] inimino: you, me, and Wikipedia [02:06] JimBastard: yeah the old version of this site used mediawiki [02:06] JimBastard: what shit software [02:07] inimino: it's pretty bad [02:07] JimBastard: not meant for lots of edits i can tell you that [02:07] binary42 has joined the channel [02:08] inimino: it's what you get when you start with something small and crappy in PHP and then add things to it for years [02:10] binary42: JimBastard, made it a little early. iPhone irc ftw. [02:10] JimBastard: lol [02:10] JimBastard: i think we going in a few [02:11] binary42: Cool. You have my Twitter handle right? [02:11] JimBastard: whats twitter [02:11] binary42: It's not written with node.js, that's for sure. [02:12] JimBastard: theres only one person i update my status for , and thats jesus [02:12] JimBastard: fuck twitter ahahaha [02:12] binary42: Good enough for me. I guess you could pig my cell? [02:13] binary42: Or do you hate phones too? [02:13] JimBastard: im sure ill see you there [02:13] JimBastard: ahaha [02:13] binary42: :-). Works well enough though my eyes aren't that sharp. [02:14] binary42: This last group was actually good. Crowd is slowly growing. [02:15] binary42: ACTION goes to the gallery between sets. Ttyl. [02:20] aguynamedben: lol JimBastard I want to OH you so bad right now [02:23] Achilles has joined the channel [02:26] JimBastard: you want to what? [03:09] tlrobinson___ has joined the channel [03:10] markmuskardin has joined the channel [03:10] markmuskardin: hello everyone [03:15] markmuskardin: *crickets* [03:18] aguynamedben: JimBastard: you heard, OH you [03:21] inimino: ACTION blinks [03:23] Achilles has joined the channel [03:29] paan has joined the channel [03:51] brosner has joined the channel [03:58] JimBastard: aguynamedben lolwut [03:59] dnolen_ has joined the channel [04:02] jtaby has joined the channel [04:04] eddanger has joined the channel [04:31] binary42 has joined the channel [04:38] JimBastard: those guys are pretty cool right binary42? [04:39] binary42: Yeah. I actually knew who they were... just hadn't seen them live. [04:39] JimBastard: my friend is working on a language at columbia right now that does interactive mixing of video and audio [04:39] binary42: I'm big into remix-culture. [04:39] binary42: Cool. [04:40] binary42: What kind of language is it? Similar to chuck or more visual? [04:40] JimBastard: its real low level [04:40] JimBastard: ill link one sec [04:41] JimBastard: http://github.com/indexzero/celluloid+ [04:41] JimBastard: http://github.com/indexzero/celluloid [04:41] JimBastard: it still is being built, prototype in java at end of semester i think [04:42] JimBastard: they been meeting here [04:42] binary42: Cool. [04:43] binary42: Reminds me subtly of how Max works... but in a textual form. [04:43] CIA-28: node: 03Ryan Dahl 07master * ree8530e 10/ (3 files in 2 dirs): offload method look up to http-parser - http://bit.ly/7SiPxV [04:43] CIA-28: node: 03Ryan Dahl 07master * rc1baa70 10/ (10 files): Attach/Detach -> Ref/Unref - http://bit.ly/4rMtSj [04:43] JimBastard: i think the idea is to hook it into a multi-touch sdk like direct x10 or something [04:43] CIA-28: node: 03Ryan Dahl 07master * r71680f5 10/ src/node.js : Give default encodings for posix.read and posix.write - http://bit.ly/7YdSiU [04:43] CIA-28: node: 03visionmedia 07master * r501b4a5 10/ lib/http.js : [04:43] CIA-28: node: Export STATUS_CODES [04:43] CIA-28: node: Express (my framework) uses them as a default [04:43] CIA-28: node: response body when non is present. Others [04:43] CIA-28: node: might use them for something as well. [04:43] CIA-28: node: Beats duplicating the list :D - http://bit.ly/61yiSg [04:44] JimBastard: spam! >. [04:44] JimBastard: < [04:44] _ry: sorry! [04:44] JimBastard: :-) [04:44] JimBastard: spam away [04:44] binary42: JimBastard: I see. Jitter is pretty nice for that. I've been thinking of embedding V8 in Max to get better perf. than the native JS implementation it has. [04:45] JimBastard: i think this would a replacement for max [04:46] JimBastard: not 100% sure [04:46] binary42: Heheh. I should talk to him sometime then as I like Max quite a bit. [04:47] binary42: Not that I don't think it could be improved... it's just hard to get to the same level. I do think things like OpenCL will help DSP implementations flourish though. [04:48] JimBastard: ill try to get him to come on thursdays [04:51] binary42: ACTION is looking forward to Thurs... already exhausted before the show now doubly so. later. [04:53] cloudhead: is there an easy way to include/execute a non-module file? [04:55] aurynn has joined the channel [04:56] inimino: cloudhead: process.fs.cat + eval or process.compile [04:56] inimino: s/process.fs/posix/ [04:56] _ry: inimino: process.fs.cat is depreciated [04:56] _ry: posix.read() [04:56] _ry: er [04:56] _ry: file.read() ? [04:56] _ry: posix.cat() maybe [04:57] inimino: is there a file module now? [04:57] _ry: has been for a long time [04:58] aurynn: anyone worked with postgres.js? Am I missing something, or does the documentation lie? [04:58] _ry: aurynn: i haven't tried it [04:59] cloudhead: `file` isn't documented.. but it looks like posix.cat will do the trick [04:59] gwoo has joined the channel [05:00] JimBastard: i think it would be best to try and adhear to the module system and stay away from posix.cat and eval() [05:00] JimBastard: unless you have a real specific reason [05:03] cloudhead: JimBastard: well, the code I'm executing isn't a module, it's extensions to core objects, such as Array/String etc.. [05:04] cloudhead: could it still be done as a module? [05:04] inimino: _ry: hm, that file.js stuff looks useful [05:05] inimino: cloudhead: it would go against the spirit of CommonJS modules [05:06] cloudhead: inimino: yea that's what I was thinking [05:08] JimBastard: i was just talking about how its great that posix.cat won't execute code inside of files it READS :p [05:08] _ry: it needs documentation [05:08] JimBastard: ahhh caps [05:12] _ry: i wish i knew how to apply a broken patch without resetting until it did work and rebasing [05:12] _ry: seems like overkill [05:12] fictorial has joined the channel [05:12] aurynn: Ah. [05:12] aurynn: The problem was that I cannot read documentation. [05:12] aurynn: :) [05:13] _ry: aurynn: are you the wait() user? [05:13] aurynn: hm? No [05:13] _ry: oh nm [05:13] aurynn: I just started working with node tonight [05:21] cloudhead: _ry: posix.cat/file.read is async, which is a problem when loading dependencies : / [05:22] _ry: cloudhead: posix.readSync() exists [05:23] cloudhead: aha great, I'll look into that [05:23] _ry: it's the low-level read though [05:23] cloudhead: hmm [05:25] aurynn: hmm [05:25] aurynn: node.js is fun, so far. [05:25] CIA-28: node: 03Johan Dahlberg 07master * r9599d2d 10/ src/node.js : (log message trimmed) [05:25] CIA-28: node: Added superCtor to ctor.super_ instead superCtor.prototype. [05:25] CIA-28: node: This way let's us do deep comparison between object instances. [05:25] CIA-28: node: I have a suggestion for the sys.inherits function. Today it's impossible to [05:25] CIA-28: node: deep comparison between instance and class. [05:25] CIA-28: node: Take this snippet for example: [05:25] CIA-28: node: function ClassA() {} [05:26] _ry: cloudhead: you can also try posix.cat().wait() [05:26] _ry: cloudhead: but only if you're not doing it in a busy process [05:29] cloudhead: _ry: that sounds good, it's only at startup, so that's fine [05:32] malkomalko has joined the channel [05:37] RayMorgan has joined the channel [05:39] JimBastard: hey inimino do you know the easiest way to combine / append objects in JS? using something like http://documentcloud.github.com/underscore/ maybe? [05:40] inimino: JimBastard: sure, that or process.mixin, or write a tiny function to do it [05:40] inimino: I'm not a huge fan of underscore [05:40] JimBastard: ohh mixin [05:40] JimBastard: that looks about right [05:41] inimino: function(a,b){var p; for(p in a) a[p] = b[p]} [05:41] JimBastard: yeah but thats not a deep copy right? [05:41] inimino: neither of them is (whatever you mean by that) [05:43] dnolen has joined the channel [05:43] inimino: ACTION looks at process.mixin source [05:43] JimBastard: imagine you had two JSON trees that you wanted to combine [05:44] JimBastard: you wouldnt just overwrite the top level, you'd drill down all the branches and copy / append at the lowest node possible [05:44] inimino: I would write a function to do it [05:44] inimino: maybe [05:44] JimBastard: i think mixin does it [05:44] JimBastard: its nothing hard, just no need to repeat [05:44] inimino: mixin has an optional first argument [05:45] inimino: read the source, or look at the jQuery documentation [05:46] JimBastard: it seems to be working [05:46] inimino: I'm curious where you're using it [05:47] inimino: I can't remember ever wanting a function that does what this does :/ [05:47] JimBastard: im combining multipart form data and uri query string variables into a common scope, httpParams [05:48] JimBastard: im giving the form data priority over url data, so if both exist the form data wins [05:48] inimino: eww [05:48] JimBastard: lol [05:48] inimino: sounds like PHP [05:48] JimBastard: its a common technique [05:48] JimBastard: makes things a bit easier [05:49] inimino: where, btw, that "feature" led to a lot of security holes [05:49] JimBastard: uhh huh [05:49] inimino: well, anyway... wouldn't that be only one level deep anyway? [05:49] JimBastard: probaly for most cases [05:49] JimBastard: but it could get fancy [05:50] aurynn: Is there string parameter replacement in JS? [05:51] aurynn: (stupid question, I know) [05:51] inimino: aurynn: if you mean something like Python or printf, no [05:52] JimBastard: you mean like .replace()? [05:52] mattly has joined the channel [05:52] aurynn: Hm. Sorta. [05:52] aguynamedben has joined the channel [05:53] CIA-28: node: 03Ryan Dahl 07master * rdbb1a26 10/ src/node.js : Fix ARGV[0] weirdness - http://bit.ly/7KLCoy [05:55] aurynn: hm. .split might do what I want.. [05:57] inimino: what do you want? [05:58] aurynn: I'm looking at implementing parameterized queries in postgres.js [05:58] inimino: ah [05:58] cloudhead: string interpolation [05:58] inimino: use replace with a callback function [05:58] aurynn: inimino, ? [06:00] inimino: x.replace(/%([^%]*)%/,function(match){ ... [06:00] aurynn: oh, strings have callbacks ? nice. [06:01] inimino: https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/String/Replace [06:02] aurynn: Aahh. [06:03] aurynn: Thanks :) [06:04] _ry: we need a better url parser [06:05] aurynn: didn't gruber post one of those recently? [06:05] JimBastard: agreed [06:05] JimBastard: whats the main issue with it? [06:05] _ry: its broken [06:06] JimBastard: are you talking about req.uri.params or something else? [06:06] inimino: what breaks it? [06:06] _ry: "http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=" [06:07] inimino: ACTION tests [06:07] JimBastard: eeek [06:07] JimBastard: you should just be able to steal the logic from some other framework [06:07] JimBastard: its been done a bunch [06:07] _ry: it needs to be fixed and it needs tests [06:08] inimino: I get ({protocol:"http", domain:"mt0.google.com", port:(void 0), path:"/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=", query:(void 0), fragment:(void 0)}) [06:08] inimino: from the regex I threw together yesterday [06:08] RayMorgan: In v8 what is the fastest way to turn a v8::Handle into either a c++ string or char*? Right now I am doing: v8::String::AsciiValue data(args[0]->ToString()); but that seems somewhat slow [06:09] _ry: inimino: cool [06:09] _ry: inimino: are you intersted in porting http://github.com/sporkmonger/addressable/blob/master/spec/addressable/uri_spec.rb#L309-3729 [06:10] _ry: RayMorgan: yeah, i think that's the way to do it [06:10] _ry: RayMorgan: you can also args[0]->ToString()->Write() [06:10] _ry: if you have a buffer prepared [06:11] inimino: wtf is all of that [06:11] _ry: inimino: tests :) [06:11] _ry: very verbose tests [06:11] inimino: ok [06:11] JoePeck: hmm, what was the URL regex you used? [06:11] JoePeck: I just happened to write one today, that broke urls into those exact components [06:11] inimino: that's the sort of thing only a Ruby hacker could love I suppose [06:11] JoePeck: (only I called domain "authority") [06:12] inimino: I almost went with that [06:12] inimino: more URI-ish [06:12] cloudhead: JoePeck: the default Node parser [06:12] _ry: i would love to have a patch which fixed parseUri and added a test/mjsunit/test-parse-uri.js [06:12] cloudhead: http.parseURI if I remember [06:12] JoePeck: gotcha, thanks [06:12] inimino: but I'm only parsing HTTP URIs so the authority is always going to be a domain [06:13] JoePeck: in case anyone is interested, there is a rather complex parser at http://www.blackmesatech.com/2009/03/wah5/uricalc.html [06:13] _ry: i've heard that ^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$ [06:13] JoePeck: I'm not sure how up to date it is [06:13] _ry: is a good RE for URIs [06:14] inimino: var parseURI_re=/(https?):\/\/([^:/?#]+)(?::(\d+))?(\/[^?#]*)(?:\?([^#]+))?(?:#(.*))?/ [06:14] inimino: that is the one I wrote yesterday, here is the function that goes with it: http://www.pastie.org/733207 [06:14] JoePeck: I used /^(?:(\w+):(?:\/\/)?)?([^\/:]+)(?::(\d+))?(?:(\/[^\?#]*)(?:\?([^#]*))?(?:#(.*))?)?$/; [06:14] JoePeck: wow, that is earily close [06:15] JoePeck: mine from today [06:15] JoePeck: http://pastie.textmate.org/private/mu5q4ygwjli0bcny6ih94w [06:15] JoePeck: and I think I see a mistake I have already, but it didn't seem to matter [06:16] JoePeck: my scheme part is optional and the // part of :// is optional to support mailto [06:16] JoePeck: anyways, just thought it was interesting, considering I spent some time on it this morning, that it came up =o [06:17] inimino: it is interesting that we all wrote something so similar :) [06:17] _ry: inimino: so, going to patch me? or should post a task on the mailing list? :) [06:17] JoePeck: _ry: I had a simpel typo fix to the docs, I didn't feel like making a patch for it =/ [06:18] _ry: JoePeck: where at? [06:18] inimino: _ry: post it, I don't fancy writing all those tests at the moment [06:18] inimino: (though I agree it should be done) [06:18] JoePeck: _ry: here was the typo => http://pastie.textmate.org/private/b5i0puyzzjkb61nfxgfneq [06:18] _ry: inimino: me neither :) [06:18] inimino: hehe [06:18] JoePeck: I was trying to find the time to properly read the docs and find more then 1 typo fix =/, but I haven't gotten the time yet [06:19] JoePeck: that patch may be out of date, I haven't updating since you posted a new version [06:19] _ry: JoePeck: thanks [06:19] JoePeck: _ry: cheers [06:20] RayMorgan: args[0]->ToString()->Write() doesn't seem to be any faster when profiling it [06:28] isaacs has joined the channel [06:36] JimBastard: anyone know why posix.write is hanging here when the file already exists? posix.open(path,process.O_CREAT,mode).addCallback(function(fd){ posix.write(fd,httpParams.pageContent).addCallback(function(){ [06:40] cmlenz has joined the channel [06:51] ciju has joined the channel [06:58] xantus_ has joined the channel [07:20] tlrobinson_ has joined the channel [07:21] emyller has joined the channel [07:27] dnolen has joined the channel [07:36] Micheil_away: hmm.. http://code.google.com/p/v8cgi/wiki/API_HTTP [07:54] kriskowal has joined the channel [08:02] tlrobinson__ has joined the channel [08:10] the_undefined has joined the channel [08:28] johan-s has joined the channel [08:34] cmlenz has joined the channel [08:49] sudoer has joined the channel [08:51] Achilles has joined the channel [09:13] Micheil has joined the channel [09:59] Achilles has joined the channel [10:19] tisba has joined the channel [10:25] jtaby has joined the channel [10:25] Achilles has joined the channel [10:26] jtaby: hey, how can i get the body of a post? [10:28] Biscuits has joined the channel [10:30] jtaby has joined the channel [10:34] jtaby: sorry, I got disconnected: [10:34] jtaby: hey, how can i get the body of a post http request? [10:37] jtaby: nvm [10:37] jtaby: http://github.com/ujh/coltrane/blob/master/coltrane/http.js [10:37] jtaby: looks like I need to steam the POST body [10:40] mediacoder: jtaby: there is a "Body" event, when the body is coming, buffer the body to some var, then you can decode it [10:41] jtaby: mediacoder: yup, just picked that up :) [10:52] majd has joined the channel [11:00] jtaby has joined the channel [11:05] Achilles has joined the channel [11:07] Achilles_ has joined the channel [11:10] majd has joined the channel [11:19] CIA-28: node: 03Ryan Dahl 07master * r89df4d1 10/ doc/api.txt : fix typo - http://bit.ly/5BQWCA [11:19] majd has joined the channel [11:19] Achilles has joined the channel [11:19] emyller has joined the channel [11:19] xantus_ has joined the channel [11:19] gwoo has joined the channel [11:19] cadorn has joined the channel [11:19] hassox has joined the channel [11:19] Wes- has joined the channel [11:19] nefD has joined the channel [11:19] olivvv has joined the channel [11:19] keeto has joined the channel [11:19] Atmoz has joined the channel [11:19] intellectronica has joined the channel [11:19] [k2] has joined the channel [11:19] rektide has joined the channel [11:19] apgwoz has joined the channel [12:00] keeto has joined the channel [12:00] nefD has joined the channel [12:00] Wes- has joined the channel [12:00] cadorn has joined the channel [12:00] hassox has joined the channel [12:00] xantus_ has joined the channel [12:00] emyller has joined the channel [12:01] olivvv has joined the channel [12:01] Atmoz has joined the channel [12:01] intellectronica has joined the channel [12:01] [k2] has joined the channel [12:01] rektide has joined the channel [12:01] apgwoz has joined the channel [12:01] majd has joined the channel [12:01] gwoo has joined the channel [12:07] gwoo has joined the channel [12:07] majd has joined the channel [12:07] apgwoz has joined the channel [12:07] rektide has joined the channel [12:07] [k2] has joined the channel [12:07] intellectronica has joined the channel [12:07] Atmoz has joined the channel [12:07] olivvv has joined the channel [12:07] keeto has joined the channel [12:07] nefD has joined the channel [12:07] Wes- has joined the channel [12:07] cadorn has joined the channel [12:07] hassox has joined the channel [12:07] xantus_ has joined the channel [12:07] emyller has joined the channel [12:13] gwoo has joined the channel [12:13] majd has joined the channel [12:13] apgwoz has joined the channel [12:13] rektide has joined the channel [12:13] [k2] has joined the channel [12:13] intellectronica has joined the channel [12:13] Atmoz has joined the channel [12:13] olivvv has joined the channel [12:13] keeto has joined the channel [12:13] nefD has joined the channel [12:13] Wes- has joined the channel [12:13] cadorn has joined the channel [12:13] hassox has joined the channel [12:13] xantus_ has joined the channel [12:13] emyller has joined the channel [12:17] cadorn has joined the channel [12:17] Wes- has joined the channel [12:17] nefD has joined the channel [12:17] keeto has joined the channel [12:20] olivvv has joined the channel [12:20] emyller has joined the channel [12:20] xantus_ has joined the channel [12:20] hassox has joined the channel [12:21] majd has joined the channel [12:21] gwoo has joined the channel [12:22] careo has joined the channel [12:22] sr has joined the channel [12:22] Sinjo has joined the channel [12:22] lmorchard|away has joined the channel [12:22] CIA-28 has joined the channel [12:22] jan____ has joined the channel [12:22] mediacoder has joined the channel [12:22] beppu has joined the channel [12:22] jtaby has joined the channel [12:23] Atmoz has joined the channel [12:23] intellectronica has joined the channel [12:23] [k2] has joined the channel [12:23] rektide has joined the channel [12:23] apgwoz has joined the channel [12:28] the_undefined: does anybody know what 'Rhys' nickname is in here? [12:31] mediacoder: the_undefined: hm, not sure, but i remember seeing Rhys__ signing in here yesterday.. not sure if its waveto [12:32] the_undefined: mediacoder: ok, thanks [12:32] brosner has joined the channel [12:33] the_undefined: damn, this whole AES encryption thing is much more painful than I thought it would be:) [12:33] the_undefined: why can't I just use Rot13 :| [12:33] [i]chuck has joined the channel [12:33] onar has joined the channel [12:33] rbranson has joined the channel [12:33] jspiros has joined the channel [12:33] Nailor has joined the channel [12:33] m1631_ has joined the channel [12:33] rudebwoy has joined the channel [12:33] mburns has joined the channel [12:33] the_undefined: what's up with all those people dropping in and out, is freenode having issues? [12:34] mediacoder: the_undefined: whats the problem you having, im using aes-256-cbc without problems [12:34] mediacoder: the_undefined: some US-hub dying i think [12:34] the_undefined: http://groups.google.com/group/nodejs/browse_thread/thread/9fd8f84119463525 [12:34] the_undefined: is my issue [12:34] the_undefined: do you use it on linux? [12:35] mediacoder: yea [12:35] the_undefined: could you by any chance try my test case real quick? [12:35] the_undefined: http://gist.github.com/251594 [12:36] mediacoder: yea, one sec [12:36] the_undefined: mediacoder: cool, that would rock [12:36] majd has joined the channel [12:39] mediacoder: the_undefined: can you confirm the code working at all? [12:39] the_undefined: mediacoder: yeah, why? [12:39] the_undefined: ig [12:39] the_undefined: oh [12:39] the_undefined: you may have to replace ./crypto with just crypto [12:39] the_undefined: in the require on top [12:40] the_undefined: I was testing inside the node-crypto git repo [12:40] mediacoder: i have it copied to my lib folder.. hmm [12:40] the_undefined: yeah, just change the relative include [12:40] the_undefined: use this: [12:40] the_undefined: var crypto = require("crypto"); [12:40] the_undefined: that should do the trick [12:40] mediacoder: na, crypto is successfully loaded, i just dont have DEcipher method [12:40] jtaby has joined the channel [12:41] the_undefined: mediacoder: whuut? [12:41] the_undefined: this is the point where it gets wild :) [12:41] mediacoder: hmm [12:41] the_undefined: mediacoder: how do you do aes-256? [12:41] the_undefined: can you paste the code you are using? [12:41] mediacoder: yea, sec [12:42] mediacoder: http://pastie.org/733473 [12:43] the_undefined: so you are using Cipher for dephier? [12:43] the_undefined: hm [12:43] mediacoder: yea, with true/false flag [12:43] the_undefined: I guess that works as its symmetric encryption? [12:44] mediacoder: itleast it works..i havent had bigger tests tho.. just currently trying to encrypt some session-data [12:44] the_undefined: mediacoder: ok, I'm gettin bus errors now [12:44] the_undefined: interesting [12:44] mediacoder: my crotpo object doesnt even have a decipher method [12:45] the_undefined: and weird ouput [12:45] ashb: oooh a crypto module. [12:46] majd has joined the channel [12:46] the_undefined: mediacoder: ok, I can't get your crypto.Cipher thing to work with false as the last parameter at all [12:46] the_undefined: are you on an old version? [12:47] mediacoder: hm, i had the old version which had no cipher support, got the patch from Biscuits , which was then merged to the main repo, which i run now :-) [12:47] the_undefined: mediacoder: so you are on the latest version of the main repo? [12:47] mediacoder: not sure if the latest (including that utf8 thing) [12:48] the_undefined: yeah, that's the latest [12:48] the_undefined: how come you not have the Decipher method? [12:48] the_undefined: you sure you copied the new build into your lib dir again? [12:48] mediacoder: hm, no idea.. i have some symlinks to the actual libs..maybe something is messed up there [12:49] mediacoder: no, i have a symlink there, which points to the freshly built versions [12:49] the_undefined: bool CipherInitIv(char* cipherType, char* key, int key_len, char *iv, int iv_len) [12:49] the_undefined: there is no mention of that true / false thingy [12:49] the_undefined: but there is a Decipher class [12:50] mediacoder: yea, then i guess im still running the old verson..not sure why tho [12:50] jtaby has joined the channel [12:50] mediacoder: i didnt make it up with true/false :-P i read it somewhere [12:50] the_undefined: :) [12:50] mediacoder: i have to take off and walk the dog now..then i can retry and pull the latest [12:51] the_undefined: mediacoder: can you figure out how to run on the latest version? [12:51] the_undefined: ah cool [12:51] the_undefined: that would be really really appriciated [12:51] mediacoder: yea, in 30 mins :-) [12:51] the_undefined: this has been blocking me for days [12:51] the_undefined: cool ,thanks [12:54] mediacoder: the_undefined: yea, i wasnt up to date, sorry [12:54] mediacoder: but i have untruncated output [12:54] the_undefined: mediacoder: what linux? [12:54] mediacoder: centos [12:54] the_undefined: that's an abomination [12:54] the_undefined: weird that it would work there [12:54] the_undefined: :) [12:55] the_undefined: I figured out one more piece to the puzzle [12:55] mediacoder: :-) [12:55] the_undefined: it seems like the deciper.final() method is not returning anything on Linux for me [12:55] the_undefined: but it does on OSX [12:55] the_undefined: so it is holding the missing bytes hostage [12:56] mediacoder: ok, now i go :-) bbl (ah.. and the_undefined i bet at some point you going to do some libavcodec bindings with node-ffi? :-P) looking forward to [12:57] the_undefined: mediacoder: no, so far I'm happy/busy enough using ffmpeg from the command line [12:57] the_undefined: :) [12:57] jtaby has joined the channel [12:57] the_undefined: but later when we get funding we might have time for stuff like this :) [12:58] mediacoder: hehe, kool :-) [13:00] majd has joined the channel [13:24] rhys__ has joined the channel [13:25] mediacoder: the_undefined there u go :-) [13:25] the_undefined: mediacoder: ? [13:25] mediacoder: look who joined ;-) [13:25] the_undefined: ohh [13:25] the_undefined: rhys__: hey [13:25] the_undefined: rhys__: yt? [13:25] rhys__: hey, how are things? [13:25] mediacoder: hi there [13:25] rhys__: Hi. [13:26] the_undefined: rhys__: still hunting for those 16 bytes swallowed by node-crypto :) [13:26] the_undefined: rhys__: do you have some time to help me figure this out? [13:26] rhys__: ah.. any test code? [13:26] the_undefined: http://groups.google.com/group/nodejs/browse_thread/thread/9fd8f84119463525 [13:26] the_undefined: this is the test case: http://gist.github.com/251594 [13:27] jtaby has joined the channel [13:27] the_undefined: on OSX, it runs just as expected. On Linux (Karmic 9.10) however, it swallows the last 16 bytes [13:27] the_undefined: mediacoder says he doesn't have the same problem with CentOS [13:27] the_undefined: I just started debugging it and it seems like the problem is in DecipherFinal [13:27] rhys__: ok, that's interesting - let me set up an Ubuntu 9.10 vmware and take a look. [13:27] pmuellr has joined the channel [13:27] the_undefined: rhys__: int r = cipher->DecipherFinal(&out_value, &out_len); [13:27] the_undefined: I get r = 0 [13:28] the_undefined: even so there should still be some more data in there [13:29] the_undefined: ah nvm [13:29] the_undefined: I get r = 1 [13:29] the_undefined: but out_len is 0 [13:31] the_undefined: rhys__: cool, thank you so much! [13:31] rhys__: no probs - I'll post back when I have something. [13:31] the_undefined: rhys__: alright, I'll be around [13:32] the_undefined: rhys__: I could also give ssh access to my vm if that's more convenient for you [13:32] rhys__: the_undefined: ok, might need that if I cannot replicate - but let me try the vmware first. [13:33] the_undefined: rhys__: alright, ping me :) [13:47] majd has joined the channel [13:49] fictorial has joined the channel [14:00] jtaby has joined the channel [14:27] majd has joined the channel [14:30] Achilles has joined the channel [14:33] jtaby has joined the channel [14:35] fictorial: statSync is causing a bus error [14:35] fictorial: http://gist.github.com/251675 [14:36] fictorial: v0.1.21-5-g756544f [14:36] jtaby has joined the channel [14:41] majd has joined the channel [14:47] jtaby has joined the channel [14:59] pdelgallego has joined the channel [15:06] fictorial: hmm there's no way of seeking in files in nodejs? [15:07] nefD: the_undefined: Yao! [15:07] nefD: the_undefined: I've been messing with your php worker scripts quite a bit [15:07] the_undefined: nefD: jo [15:07] dnolen has joined the channel [15:07] nefD: the_undefined: I'm at the point now where i'm trying to figure out a good method of utilizing sessions somehow [15:09] nefD: seems like someone who hangs around in here was working on some kind of session/cookie based project, but I don't recall what it was [15:09] fictorial: re: seek, ok good. libeio uses lseek and read/write take a 'position' argument. [15:15] _ry: fictorial: wouldn't be hard to add [15:16] fictorial: I don't think it's needed... point of seeking is to ultimately read/write and if read and write support positions and seek to such first, that's fine [15:16] jtaby has joined the channel [15:17] _ry: fictorial: i think it's needed [15:17] fictorial: incremental reads/writes? [15:17] _ry: no, just generally [15:17] fictorial: well, ok, no complaints here... I could use a __L__seek [15:17] _ry: maybe for interfacing with other processes? shrug [15:19] fictorial: funny you should mention I was just reading a paper on the use of sparse files for distributed application information sharing... weird premise. so yeah, maybe interfacing... I too shrug [15:20] malkomalko has joined the channel [15:20] fictorial: while we're on topic, in node_file.cc why is the read buffer at most 16KiB? I'm curious about the rationale. [15:21] cloudhead has joined the channel [15:26] rakeshpai has joined the channel [15:27] malkomalko: good morning everyone [15:27] nefD: blargh.. screwed by same origin policy on ajax calls =\ [15:28] Wes-: fictorial: IME throughput does not increase significantly with buffers bigger than ~8KB on most platform. Plus, as a guess, node doesn't want the kernel to block looking for more disk blocks. (Although, at least on some arches, memory mapping is faster/cheaper/better than large reads) [15:29] fictorial: right on, thanks [15:29] Wes-: fictorial: that's an interesting idea (sparse files) - you could use seek offsets as information addresses of a sort [15:29] fictorial: I was just wondering what the magic number meant [15:29] fictorial: bingo! [15:29] fictorial: exactly what I'm doing [15:30] isaacs has joined the channel [15:30] fictorial: re: 16KiB, for my app, that's quite huge. I've lots of small reads. [15:31] fictorial: I doubt there's _much_ overhead in allocating that much on the stack [15:31] Wes-: fictorial: magic number is a multiple of common physical disk block size. If you have a RAID with a particular stripe size, I would recommend setting node's block size to an even multiple (maybe even same). 32KB is the high bounds of common stripe sizes IME, 8 and 16 are still common. [15:32] fictorial: yeah for my app I was actually planning on setting a tiny block size of 1KiB but I'm not a fs expert [15:32] malkomalko: fictorial: you going to make it down thursday? [15:32] Wes-: fictorial: if you're using small reads are sparse files, you are straying away from what typical OS and software system designers expect, your tuning parameters might be quite difference [15:32] Wes-: fictorial: how big are your sparse files? [15:32] Wes-: fictorial: do you have good locality of reference within? [15:33] fictorial: Wes, let me pm you - don't want to hog the channel on this. [15:33] fictorial: malkomalko: I cannot this week :( [15:33] malkomalko: poopy [15:34] _ry: fictorial: 16kb - randomly choosen [15:35] fictorial: _ry: ok [15:36] jtaby has joined the channel [15:37] nefD: hrm.. using JSONP requests seems to allow for an apache served php file to call upon on a running ajax node just fine.. yay! [15:40] _ry: gr. i wish binary didn't suck so hard in v8 [15:41] Wes-: _ry: 16KB not a bad choice, also, I think Ondras may have implemented binary/b for v8cgi, you could maybe yank for experiments / benchmarks [15:42] _ry: i don't really like binary/b [15:43] _ry: i want strings. it's so close to being possible, and yet, not there :( [15:43] Wes-: _ry: There are things about it I like, things I don't... I have an implementation; the stuff I didn't really like I wrote in script. ;) -- but if you don't like Binary/B, you should consider contributing to the Binary/D discussion! [15:43] _ry: Wes-: i don't like discussions either :) [15:44] Wes-: _ry: they are the most effective way of arriving at specifications you want to implement! :) [15:45] _ry: i don't want to implement specifications :P [15:46] _ry: just want something that works :/ [15:46] _ry: but - yeah - packing binary in strings seems like a lost cause. going to use some opaque object [15:47] _ry: i guess some opaque object with String.prototype in it's prototype chain [15:47] _ry: then a toString() method [15:47] _ry: s/it's/its/ [15:51] _ry: or maybe just use explicit decoding? [16:03] Wes-: "explicit decoding"? [16:06] isaacs has joined the channel [16:21] johan-s has joined the channel [16:25] majd has joined the channel [16:28] isaacs: anyone ever play with susestudio? [16:30] aurynn has joined the channel [16:31] isaacs: i'm considering making a nodejs appliance (mostly just for kicks) [16:31] aurynn: what will you apply it to? [16:32] isaacs: well, with susestudio, you can create a VM setup, and then have it build you a vmdk or xen image or iso [16:32] isaacs: with all your customized software pre-installed and ready to rock [16:33] jtaby has joined the channel [16:34] isaacs: _ry: that is why you're awesome, and nodejs is awesome. don't discuss. jfdi, and it let the others follow. [16:35] aurynn: ACTION hopes to have parameterized queries in postgres.js working tonight [16:36] ashb: _ry: what exactly about the String api is it that you want on blobs? [16:38] _ry: ashb: indexOf , concat, can slicing [16:38] _ry: ashb: which obviously can all be reimplemented- i just don't want to reimplement when there exists super good implementations already in v8 [16:38] ashb: just copy/create those moethod then. I dont think having String in the proto chain is right [16:39] ashb: Blob.prototype.concat = String.prototype.concat; [16:39] ashb: etc [16:42] _ry: what i'd really like is to be able to allocate memory in v8's heap and recv() data directly into it [16:42] _ry: then be able to pass it to another c module, which could open it up and read directly from the memory there [16:42] ashb: does it make much diff if it so n v8's heap or not? [16:43] _ry: if it's not then i have to worry about fragmentation and shit [16:43] _ry: probably end up making my own memory pool eventually [16:43] ashb: passing heap refererences is possibly dangerous, since some things might hold onto it [16:43] _ry: yes, which is why i can't do it [16:43] ashb: welll unless you have a method to create an immutable copy of it [16:43] _ry: what i'd like to be able to do is tell the GC not to run for some time - so i can be sure that it stays in place [16:43] ashb: c_ptr(); or some such [16:44] ashb: 'for some time' could possible by a very long time [16:44] ashb: depending on where exactly you pass it [16:45] _ry: well we always return to the event loop quickly, so maybe that's not much of a problem [16:45] ashb: would make me nervous [16:46] _ry: i wouldn't hold c pointers for more than one callback [16:46] _ry: what would be cool is if i could ensure that gc only got called from the event loop - not in arbitrary operations [16:46] the_undefined: rhys__: yt? [16:46] rhys__: the_undefined: yep, just sent over some test files [16:47] the_undefined: rhys__: yip, saw that [16:47] the_undefined: rhys__: I'm generating the cipher with PHP actually [16:47] the_undefined: rhys__: but I'm able to encrypt and decrypt in PHP without any problems [16:47] the_undefined: rhys__: I suppose OpenSSL wants more padding in the encrypted string, and PHP doesn't [16:47] ashb: hmmm i really dont like that promise API for async JSGI that is being proposed [16:48] rhys__: the_undefined: could be - could you send over some example PHP? [16:48] the_undefined: rhys__: yes [16:49] ashb: _ry: how hard would it be to implement this API on/for node http://gist.github.com/251577? [16:49] the_undefined: rhys__: http://bin.cakephp.org/view/1694806303 [16:49] ashb: _ry: or conversely to create the he current node api to work like that under the hood etc. [16:49] ashb: *change the current [16:50] rhys__: the_undefined: ok, will take a quick look. [16:50] the_undefined: rhys__: the "masterkey" is the one I had in my node example [16:50] _ry: ashb: i think that can be done on top of the node api [16:50] the_undefined: rhys__: the "128" is the blocksize [16:51] the_undefined: (I think) [16:51] ashb: _ry: and the other way round - so that node http apps could be wrapped in middleware like that? [16:52] softdrink has joined the channel [16:53] _ry: ashb: how are requests streamed in? (uploads to an http server) [16:53] Connorhd__ has joined the channel [16:53] ashb: _ry: not clear yet, but probably request.input.chunkAvailable callback or similar [16:54] ashb: _ry: that is just a proposal i cooked up based on perl's Plack example [16:55] ashb: _ry: the key part is the responder function gives you a way to hook into headers/body resp for middleware [16:55] binary42 has joined the channel [16:55] isaacs has joined the channel [16:56] rhys__: the_undefined: seems like padding between Rijndael / formal AES [16:56] rhys__: the_undefined: adding an extra 0 seems to fix it [16:56] rhys__: the_undefined: encrypted+='00' (in hex) [16:57] the_undefined: rhys__: is that a legit fix or an ugly hack that will give me nightmares? [16:58] halorgium has joined the channel [16:58] inimino has joined the channel [16:59] _ry has joined the channel [17:01] brandon_beacher has joined the channel [17:01] ashb: damn netsplits [17:01] ashb: _ry: did you say something during it? [17:01] the_undefined: also, it still doesn't explain why I get it to work on OS 10.5 without adding '00' [17:01] _ry: ashb: no [17:01] ashb: k [17:02] mikekell1 has joined the channel [17:02] aurynn has joined the channel [17:02] dnolen has joined the channel [17:02] pdelgallego has joined the channel [17:02] Connorhd_ has joined the channel [17:02] populuxe has joined the channel [17:02] sztanphet has joined the channel [17:04] Sembiance has joined the channel [17:05] RayMorgan has joined the channel [17:06] cloudhead has joined the channel [17:06] malkomalko has joined the channel [17:06] Achilles has joined the channel [17:06] fictorial has joined the channel [17:06] rhys__ has joined the channel [17:06] tisba has joined the channel [17:06] Micheil has joined the channel [17:06] cmlenz has joined the channel [17:06] the_undefined has joined the channel [17:06] ciju has joined the channel [17:06] mattly has joined the channel [17:06] mikekelly has joined the channel [17:07] aurynn has joined the channel [17:07] dnolen has joined the channel [17:07] pdelgallego has joined the channel [17:07] Connorhd_ has joined the channel [17:07] populuxe has joined the channel [17:08] ashb: _ry: http://gist.github.com/251804 [17:10] the_undefined: rhys__: ok, thans a ton for looking into this. I'm really new to encryption so I'm sorry if I'm wasting your time to this [17:10] populuxe has joined the channel [17:10] the_undefined: at least the first issue I reported seems to be a legit issue with node-crypto so :) [17:11] sudoer has joined the channel [17:16] populuxe has joined the channel [17:16] cloudhead has joined the channel [17:16] malkomalko has joined the channel [17:16] Achilles has joined the channel [17:16] fictorial has joined the channel [17:16] rhys__ has joined the channel [17:16] tisba has joined the channel [17:16] Micheil has joined the channel [17:16] the_undefined has joined the channel [17:16] ciju has joined the channel [17:16] mattly has joined the channel [17:16] mikekelly has joined the channel [17:19] aurynn has joined the channel [17:19] dnolen has joined the channel [17:19] pdelgallego has joined the channel [17:19] Connorhd_ has joined the channel [17:21] the_undefined: jo freenode needs to be rewritten in node.js :) [17:21] malkomalko: lol [17:21] n8o has joined the channel [17:23] _ry: ashb: if the discussion is how to support middleware - i would rather do this in terms of a data stream api where people which supports filters [17:23] majd has joined the channel [17:23] rbranson: i dunno, the ircd code is like 25 years old :) [17:24] ashb: _ry: its partyl that, partly what API asnyc JSGI requests should have [17:24] _ry: ashb: i think it would make sense to have req.body and res.body be data streams (one in, one out) which would be have similar interfaces to other streams (tcp sockets, stdin, stdout, etc) [17:24] ashb: _ry: and filtering on headers? [17:25] rhys__: the_undefined: Just tested on OSX 1.5 - it's down to the version of openssl [17:25] cmlenz has joined the channel [17:25] rhys__: the_undefined: 0.9.7 works ok, 0.9.8 not [17:25] the_undefined: rhys__: huh, interesting [17:25] _ry: ashb: yeah - shrug, headers can just be sent around as an object or something. maybe add a res.setHeaderLine() res.removeHeaderLine() [17:25] ashb: is there any reason to send headers one at a time instead of all at once? [17:26] _ry: i think headers should always be sent at once [17:26] ashb: thats what i thought to. isn't node .sendHeader()? [17:27] rbranson: is there a way to force a GC for testing purposes? I've been using --gc_interval=5 and a for loop that allocates like 25 things, but that's kind of lame [17:27] jtaby has joined the channel [17:27] Achilles_ has joined the channel [17:27] the_undefined: rhys__: so you think I should fix this in PHP? [17:28] _ry: ashb: yeah [17:28] rhys__: the_undefined: I'm just diff'ing openssl 0.9.8 and 0.9.7 to see if I can put a workaround in node-crypto [17:28] rhys__: the_undefined: bound to catch other platforms also [17:29] the_undefined: rhys__: cool, thank you so much for working on this [17:29] the_undefined: don't know what I would do without node-crypto :) [17:29] pdelgallego has joined the channel [17:31] aurynn has joined the channel [17:31] Achilles has joined the channel [17:33] eddanger has joined the channel [17:37] pdelgallego has joined the channel [17:37] populuxe has joined the channel [17:37] cloudhead has joined the channel [17:37] malkomalko has joined the channel [17:37] fictorial has joined the channel [17:37] rhys__ has joined the channel [17:37] tisba has joined the channel [17:37] Micheil has joined the channel [17:37] the_undefined has joined the channel [17:37] ciju has joined the channel [17:37] mattly has joined the channel [17:38] populuxe has joined the channel [17:39] bobaman has joined the channel [17:45] pmuellr has joined the channel [17:47] aguynamedben has joined the channel [17:48] bentomas has joined the channel [17:48] Achilles_ has joined the channel [17:49] saikko has joined the channel [17:49] majd has joined the channel [17:49] n8o has joined the channel [17:49] Achilles_ has joined the channel [17:52] Achilles_ has joined the channel [17:52] Achilles__ has joined the channel [17:53] jed has joined the channel [17:57] aurynn has joined the channel [17:57] kriskowal has joined the channel [18:02] Achilles__ has joined the channel [18:05] Wes- has joined the channel [18:07] jtaby has joined the channel [18:10] Achilles___ has joined the channel [18:11] jtaby has joined the channel [18:20] dnolen has joined the channel [18:22] jtaby has joined the channel [18:26] rhys__ has joined the channel [18:29] cmlenz has joined the channel [18:29] johan-s has joined the channel [18:29] cadorn has joined the channel [18:29] nefD has joined the channel [18:29] keeto has joined the channel [18:32] malkomalko has joined the channel [18:45] isaacs has joined the channel [18:55] jtaby has joined the channel [19:00] majd has joined the channel [19:10] frodenius has joined the channel [19:11] jtaby has joined the channel [19:20] jcrosby has joined the channel [19:24] kriskowal has joined the channel [19:33] the_undefined_ has joined the channel [19:33] isaacs: heh... [19:33] isaacs: [11:31:44 3258] $ brew info node [19:33] isaacs: node 0.1.20 [19:33] isaacs: http://nodejs.org/ [19:33] isaacs: Not installed [19:33] isaacs: http://github.com/mxcl/homebrew/commits/master/Library/Formula/node.rb [19:33] isaacs: neat [19:37] inimino: what's brew? [19:37] frodenius: neat [19:37] frodenius: like macports [19:37] inimino: oh ok [19:38] jtaby has joined the channel [19:43] cmlenz has joined the channel [19:46] jtaby has joined the channel [19:52] jtaby has joined the channel [19:55] jtaby has joined the channel [20:06] ciju has joined the channel [20:08] olivvv_ has joined the channel [20:08] sveisvei has joined the channel [20:10] jtaby has joined the channel [20:22] sveisvei: I love node.js :) [20:22] aurynn: it is pretty sexy [20:30] gwoo has joined the channel [20:30] jtaby has joined the channel [20:40] jcrosby has joined the channel [20:46] jtaby has joined the channel [21:06] mattly has joined the channel [21:07] rhys__: the_undefined_: Fix applied to node-crypto with workaround for 0.9.7 / 0.9.8 differences [21:07] tlrobinson has joined the channel [21:07] tapwater has joined the channel [21:08] rhys__: the_undefined_: just use .finaltol() rather than .final to call the tolerant version in the Decipher method [21:10] majd has joined the channel [21:15] fictorial: posix.open is acting strangely [21:16] fictorial: node.O_CREAT is not creating the file if it does not exist [21:18] rakeshpai has joined the channel [21:18] inimino: fictorial: do you have write permissions on the directory? [21:19] fictorial: Yes. [21:19] jed has joined the channel [21:19] inimino: is there an error? [21:19] fictorial: No such file or directory [21:20] fictorial: var fd = posix.open("/tmp/checkme", node.O_CREAT | node.O_TRUNC | node.O_RDWR, 0666).wait(); [21:20] inimino: that usually means the path doesn't exist [21:20] inimino: odd [21:20] fictorial: /tmp is there and writable [21:20] scudco has joined the channel [21:22] scudco has left the channel [21:23] onar: fictorial: you have to pass process.O_CREAT I think [21:23] onar: what does node point to? [21:23] inimino: oh, good point [21:23] fictorial: nope... file.js uses node.XYZ [21:23] scudco has joined the channel [21:23] rtomayko has joined the channel [21:24] fictorial: ok wth [21:24] inimino: s/node/process/g [21:25] onar: which file.js? [21:26] fictorial: this is odd.. i have both /usr/local/lib/node/libraries/file.js and /usr/local/lib/node_libraries/file.js [21:26] fictorial: and was looking at the one that still uses node.O_CREAT [21:26] fictorial: weird [21:27] aconran has joined the channel [21:28] Wes-- has joined the channel [21:29] fictorial: ACTION needs a nap after the dentist visit [21:30] tapwater: is there an easy way to manage the number of bytes received in a tcp.connection? [21:32] inimino: tapwater: what do you mean? [21:32] fictorial: throttling? [21:33] tapwater: like making the connection wait to receive n number of bytes before tossing a "receive" event [21:35] the_undefined_: rhys__: wow, thank you so much [21:35] the_undefined_: rhys__: will give it a go [21:37] rhys__: the_undefined_: ok, just do a decrypted += decipher.finaltol("utf8"); to see if it works. [21:44] jed has joined the channel [21:44] johan-s has joined the channel [21:44] cadorn has joined the channel [21:44] nefD has joined the channel [21:44] keeto has joined the channel [22:02] Micheil: the_undefined_: node.js wouldn't solve a netsplit. [22:02] fictorial: anyone have any advice on "helping" out the garbage collector? is it worth setting vars to null if I have a place that _know_ I will no longer need the object? [22:02] the_undefined_: Micheil: lies, dirty lies [22:03] jcrosby has joined the channel [22:03] the_undefined_: Micheil: node has a quantum communication module :) [22:03] the_undefined_: fictorial: I think you need to remove all pointers to your vars [22:03] Micheil: the_undefined_: :P [22:03] the_undefined_: fictorial: if the scope still exist and could be entered again, the var will stay [22:04] Micheil: fictorial: you could use delete ...; [22:04] the_undefined_: yip, that will work for partial object GC [22:04] rbranson__ has joined the channel [22:04] fictorial: thanks that's about what I figured; heh [22:05] inimino: the_undefined_: I heard the quantum communication module is still buggy [22:05] inimino: fictorial: if things are going to go out of scope anyway you generally don't need to worry about it [22:07] fictorial: inimino: indeed... but I worry. and I can be explicit in places where I'm dealing with "big" objects, great. what I was wondering if that would matter much. [22:08] inimino: if the objects are going out of scope anyway it won't matter at all [22:10] inimino: lots of people have null-setting habits from bad old IE, but it shouldn't be necessary in respectable engines, where memory leaks are actually treated as bugs and bugs are actually fixed... [22:10] jtaby has joined the channel [22:10] fictorial: oh I gave up caring about IE years ago. that's not me. [22:11] inimino: ok [22:11] fictorial: that being said I think I see a mem leak in node_file.cc [22:11] fictorial: and at least something inefficient [22:12] fictorial: time to fork on github for a fix [22:14] the_undefined_: rhys__: awesome, your fix works like a charm [22:15] sudoer has joined the channel [22:16] fictorial: how are you guys writing binary values to files? e.g. a 4 byte integer... is there something handy to pack a string as a blob and then use 'binary' encoding or am I missing the boat? [22:16] the_undefined_: fictorial: you just tell node to read in "binary" and write in "binary" [22:17] the_undefined_: fictorial: v8 strings are capable of handling it [22:17] the_undefined_: (that's my understanding from ryan explaining it to me once, I think the v8 strings are just not highly efficient at holding binary) [22:18] the_undefined_: I think node just sees it as invalid utf8 [22:18] the_undefined_: * v8 [22:18] the_undefined_: but I could be wrong [22:18] inimino: JavaScript strings can handle arbitrary byte values [22:18] erikcorry: It's handled as a two-byte string. [22:19] erikcorry: So 16 bits per character. [22:19] erikcorry: But each character is only representing 1 byte [22:19] erikcorry: So only values from 0-255 are in use. [22:19] erikcorry: So not too efficent, o. [22:19] inimino: yeah, in the binary encoding [22:19] erikcorry: But null characters are not a problem. [22:21] malkomalko: sidenote: it's always sunny in philadelphia season 3 is the best tv of all time [22:23] Micheil: aww... twitter need's to be rewritten in nodejs, it's over capacity again :( [22:24] Micheil: :P [22:24] rbranson__: node.js = the chuck norris of application platforms [22:24] Micheil: heh heh [22:25] mediacoder: hehe..a new meme is born "do it in node.js" :-) [22:26] fictorial: hmm this is not doing what I expect [22:26] Micheil: do it in node.js then, kthnxbia [22:26] fictorial: http://gist.github.com/252049 [22:27] Micheil: hmm.. _ry, what's your twitter nick, if you have one? [22:31] isaacs: Micheil: _ry is http://twitter.com/ryah [22:34] Micheil: thanks [22:36] malkomalko: hmmmm [22:39] aurynn: an ffi interface too? How sweet is this. [22:40] rbranson__: a nearly async ffi interface :D [22:41] aurynn: so we'd be able to grab any lib and treat it asyncly/ [22:41] aurynn: ? [22:41] isaacs_ has joined the channel [22:41] rbranson__: basically, yes [22:41] aurynn: how sweet is this? [22:41] rbranson__: using the libeio thread pool [22:41] aurynn: you rock. :) [22:42] mediacoder: definitely :-) [22:43] aurynn: clearly, libdispatch has to fit in here somewhere. [22:44] jed has joined the channel [22:44] johan-s has joined the channel [22:44] cadorn has joined the channel [22:44] nefD has joined the channel [22:44] keeto has joined the channel [22:49] rektide: is there a handy link for the async ffi interface? [22:49] rektide: i feel a sick urge to integrated dbuas [22:49] rbranson__: it's still under construction [22:49] rektide: was thinking i was going to have to implement it myself, which would only take ~8 months of time [22:49] rbranson__: the ffi on github is sync [22:55] aurynn: async will be sweet indeed. :) [22:55] aurynn: ACTION thinks about how to do prepared queries in postgres.js [23:00] the_undefined_: mediacoder: you around? [23:01] the_undefined_: mediacoder: how did you resolve your issues upgrading node-crypto? [23:01] the_undefined_: mediacoder: it seems like I have trouble getting my version updated as well [23:01] mediacoder: hm, i think i was just dumb, not seeing a merge conflict with my previously patched crypto.cc [23:02] mediacoder: (and just rebuilt and installed the old) [23:02] the_undefined_: mediacoder: thanks, same here. Not the merge conflict, but the being dump [23:02] the_undefined_: mediacoder: :) [23:02] mediacoder: :-) [23:03] the_undefined_: * dumb [23:03] the_undefined_: had multiple version installed in different require.paths [23:03] the_undefined_: smart me [23:03] mediacoder: hehe [23:06] aurynn: Woah. New Thunderbird. [23:16] jed has joined the channel [23:30] fictorial: bah I give up; cannot get this to write actually binary out... keep getting string rep. [23:30] orlandov: fictorial: what are you doing? [23:30] fictorial: http://gist.github.com/252049 [23:31] orlandov: ah [23:32] orlandov: odd [23:33] orlandov: fictorial: seems like the 42 is getting cast to a string somewhere along the line [23:33] aurynn: wow - thunderbird 3 is pretty slick [23:33] Biscuits: fictorial: try String.fromCharCode(42) or maybe [42] [23:33] orlandov: fictorial: fwiw _ry told me about this a few days ago: http://github.com/ry/node/blob/c3e0a4bc7c89e6eace8d4652092b0a37dac65d8b/src/node.cc#L68-161 [23:34] orlandov: also maybe try writing out "\x2a" [23:34] mediacoder: fictorial: im using something like this..not sure if totally neccessary tho: http://pastie.org/734539 [23:47] isaacs has joined the channel