[00:00] tapwater_ has joined the channel [00:04] malkomalko: anyone deploy a node app via capistrano yet? [00:05] isaacs: tlrobinson: so, i think i'm gonna follow up on ryah's task and port (that is, copy) narwhal's uri.js to nodejs. [00:06] tlrobinson: isaacs: ok [00:06] isaacs: and send a patch suggestion that removes the params parsing stuff from node. that should happen higher up, it seems we all agree. [00:06] isaacs: and then thems that like foo[]=bar&foo[]=baz can have it [00:07] tlrobinson: i foresee a lot of duplicated efforts if we just copy/paste modules though [00:08] tlrobinson: i mean it's better than rewriting the same thing, but then we have the same code in two places that needs to be maintained [00:08] isaacs: tlrobinson: true [00:08] isaacs: it does seem a bit silly [00:08] isaacs: otoh, it's also silly to have a project with a single file that both narwhal and node depend on [00:08] isaacs: for incidental/small things like this [00:08] tlrobinson: yeah [00:09] tlrobinson: perhaps we could split narwhal up [00:09] isaacs: o_O? [00:10] tlrobinson: have a project that provides pure js modules that can be used in node and narwhal [00:10] isaacs: i see [00:10] isaacs: that could be fairly awesome [00:10] RayMorgan has joined the channel [00:10] tlrobinson: that was sort of the original intent [00:10] isaacs: the issue i could see is having to double-test things, but that's sort of already an issue. [00:10] tlrobinson: but narwhal also includes the module system with hooks for native modules, etc [00:12] tlrobinson: another alternative is to make node purely about IO, and make it work with narwhal as a narwhal "engine" [00:12] tlrobinson: narwhal could provide all the commonjs stuff [00:12] tlrobinson: aside from low level io [00:13] isaacs: tlrobinson: well, that could work, but the problem i'd see is that node's io and http approaches are sort of designed to be async all the way down. [00:14] tlrobinson: yes, that has been the main thing blocking us from making it work with narwhal [00:14] isaacs: ie, saying "node provides io" is great, but if you assume that your io isn't asynchronous, then that means doing a lot of Promise.wait() stuff [00:14] isaacs: which defeats the purpose. [00:14] isaacs: don't get me wrong, i definitely <3 narwhal [00:14] isaacs: and node. [00:14] isaacs: the fact that they don't get along causes me great [11:10] simoncpu: yepp, but how do i add it to nodejs' build script? [11:11] simoncpu: i tried doing conf.env.append_value('CCFLAGS', '-lkvm') to no avail [11:38] webben has joined the channel [11:38] simoncpu: ok, i've found the solution... [11:39] simoncpu: btw, is gnutls really required for node? [11:47] Micheil_away: simoncpu: no [11:48] Micheil_away: node works fine without it, it just adds encrypted or secure socket support, iirc [11:48] simoncpu: i was wondering why node crashes with the http unit tests [11:48] Micheil_away: yeah [11:48] simoncpu: i thought it needed gnutls or something [11:48] Micheil_away: i mentioned it to ryan yesterday [11:49] simoncpu: btw, i posted something about it in the mailing list, but my post didn't get through... [11:49] simoncpu: btw, i have a working getmem() for freebsd, and everything builds fine [11:49] simoncpu: one problem though: am i supposed to return vsize and rss as 1024 bytes? [11:49] simoncpu: like in ps output? [11:50] Micheil_away: I would have no idea ;P [11:50] simoncpu: *1024 byte units [11:50] Micheil_away: either ask ryah_away when he get's back, or pop it on the ML [11:51] simoncpu: aha... new members are moderated [11:52] Micheil_away: are they? [11:52] simoncpu: ...according to http://groups.google.com/group/nodejs/about [11:59] sudocarl has joined the channel [12:10] rbranson_ has joined the channel [12:11] mlouro has joined the channel [12:14] chris_ has joined the channel [12:17] chris_ has left the channel [12:18] Tautologistics has joined the channel [12:22] Tautologistics has left the channel [12:23] Micheil_away: oh man, that guy who's developing node SQLite has to be one of the only guys contributing who's using svn [12:24] richardb: it's using hg, isn't it? [12:25] richardb: yes: http://code.google.com/p/node-sqlite/source/checkout [12:26] Tautologistics has joined the channel [12:26] Tautologistics has left the channel [12:27] simoncpu: at least it's not cvs [12:33] simoncpu: aha! it's in hg! w00t! [12:33] simoncpu: ACTION loves hg than git [12:33] simoncpu: hg was my first love... first love never dies <3 [12:35] alex-desktop has joined the channel [12:37] Tautologistics has joined the channel [12:39] Micheil_away: I thought gcode only did svn? [12:39] Connorhd_: they added mercurial a while ago now [12:39] Tautologistics has joined the channel [12:52] shoez has joined the channel [12:52] shoez: hi all! [12:52] shoez: is it me... or do multi-line regexp's not seem to work ? [12:55] shoez: I do a... /^(\d\d) (.*)$/m.exec('some data with new lines...'); and it cuts off at the new line mark [12:55] shoez: really odd! [12:57] Micheil_away: you'd need I think the /g flag [12:57] shoez: I've even tried /mgi [12:58] Micheil_away: oh [12:58] Micheil_away: it's the last $ [12:58] Micheil_away: that matches the end of a line [12:58] Micheil_away: https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/multiline [13:00] shoez: Bizarre... yeah - I've even tried removing the ^ and $ - no joy [13:00] Micheil_away: no idea then [13:01] shoez: Yeah me either.. I'm so confused [13:04] Connorhd_: . doesn't match \n [13:05] Micheil_away: ([\S\s]*) [13:05] Connorhd_: for example /.*/.exec("a\nb"); matches "a" /[^c]*/.exec("a\nb"); matches "a\nb" [13:06] alexiskander has joined the channel [13:10] shoez: Ahh... [13:12] shoez: Thanks! [13:26] Micheil has joined the channel [13:37] quirkey has joined the channel [13:38] Micheil: hmm.. jake looks interesting: http://github.com/280north/jake/ [13:38] Micheil: despite being a Narwhal component, It could probably easily be ported to standalone v8 or something [13:39] soveran has joined the channel [13:40] Micheil: is it possible to access v8 without loading up Node.js (from within a node.js server?) [13:41] frodenius: not without altering node's source [13:41] Micheil: okay [13:42] Micheil: mm... nothing quite like a hot orange peko tea... [13:44] pdelgallego has joined the channel [13:45] shfx has joined the channel [13:45] jasondavies has joined the channel [13:54] malkomalko: how about a nice new york bagel? [13:54] malkomalko: :) [13:55] Micheil: malkomalko: no thanks.. it's 1am [13:55] malkomalko: lol [13:56] Micheil: not to self, in this english essay, don't accidentally type Peter Weird instead of Peter Weir [14:01] pmuellr has joined the channel [14:19] jasondavies has joined the channel [14:28] davidsklar has joined the channel [14:35] cloudhead has joined the channel [14:47] rbranson_ has joined the channel [15:24] Tautologistics: Anyone here familiar with erlang/mochiweb/webmachine? [15:26] ciju has joined the channel [15:34] aurynn has joined the channel [15:34] voodootikigod: Tautologistics: yea whats up [15:35] apgwoz has left the channel [15:36] Tautologistics: Ever developed a complete app with webmachine? [15:37] Tautologistics: I'm almost done porting it to node (nodemachine) and starting to question if it's a good idea [15:44] voodootikigod: haha [15:44] voodootikigod: how close is almost [15:44] voodootikigod: there is an awful lot in there [15:45] voodootikigod: but in terms of a restful toolkit [15:45] voodootikigod: its pretty much top notch [15:51] Micheil1 has joined the channel [15:52] rtomayko has joined the channel [15:52] jasondavies: Tautologistics: I've heard good things about webmachine [15:53] malkomalko: think I'm going to bring some wine tonight voodootikigod [15:53] jasondavies: Tautologistics: never actually developed a complete app though [15:53] voodootikigod: hahah [15:53] voodootikigod: malkomalko: just to snub my beer geekery? [15:53] malkomalko: just to have a few more options :) [15:56] binary42 has joined the channel [16:00] simoncpu: malkomalko: i'm going to drink tuba, fermented coco nectar! [16:00] simoncpu: die, wine-loving-heathens, die!!!! [16:00] malkomalko: hAHA [16:00] malkomalko: hey nowwwww [16:01] simoncpu: die you all beer drinkers out there! [16:01] simoncpu: beer drinkers with large tummys and bad breath!!!!! [16:01] simoncpu: diiiiiieeeeee [16:01] simoncpu: ACTION is obviously bored [16:03] bentomas has joined the channel [16:04] Micheil: hmm.. how would one implement email sending on top of node.js [16:05] dnolen has joined the channel [16:05] aurynn: write an smtp library on tcp [16:06] simoncpu: i can't play with node.js because it crashes on bsd :( [16:06] Micheil: aurynn: nah duh. [16:06] Micheil: ;P [16:06] aurynn: Micheil, SMTP is well-known.. :) [16:06] Micheil: aurynn: I'm just trying to figure out how to do that [16:07] aurynn: read the RFC. Figure out the req/response pattern. [16:07] aurynn: Each request is a callback. [16:07] Micheil: hmm.. [16:07] Micheil: I'd probably use.. promises I guess [16:07] apgwoz has joined the channel [16:10] aurynn: probably. :) [16:11] Micheil: I don't know why, but I keep read SMTP as SNTP [16:13] mediacoder: Micheil: http://pastie.org/737427 [16:13] Tautologistics: Well, the port is done except for some encoding support. The work left is finishing tests to exercise all the decisions and fix the found bugs [16:13] Micheil: mediacoder: wouldn't wanna be quick or anything? [16:14] mediacoder: huh? just read "send email" ..thats how i quick n dirty send email [16:14] Tautologistics: I haven't commited the latest code but on github it's about 90% done: http://github.com/tautologistics/nodemachine [16:14] Micheil: mediacoder: I said I'd try and implement it, and then kaboom! it's there almost with you [16:14] Micheil: ;P [16:15] mediacoder: well.. my stuff is not tested, or anything..:-) currently im just playing and having fun..with node [16:19] Micheil: mediacoder: I'm thinking I'll base my off Ruby's Net::SMTP module [16:19] Micheil: it looks like it has a good API [16:21] aurynn: Tautologistics, neat :) [16:22] mediacoder: Micheil: great. i just needed a quick thing, that sends me an email once in a while ..so this worked out for me :-) [16:22] Micheil: mediacoder: yeah, I'm looking to create and contribute back into node more modules [16:22] mediacoder: yea, sae here.. wish i was better in js and had more time tho :-) [16:23] Micheil: mediacoder: I'm actually coming from frontend js to serverside, so that's why I do things the long way, because I don't have that serverside backing [16:24] Micheil: anyone know of an SMTP server that I could use for testing this on? [16:27] Micheil: oh well, night folks (expect a possible SMTP lib from me in the coming weeks.) [16:35] johan-s has joined the channel [16:36] rtomayko has joined the channel [16:38] DanWrong has joined the channel [16:40] aurynn: ooh, that's something I should do. Write a twitter library. [16:45] scudco has joined the channel [16:52] jasondavies: aurynn: yes, I would use it [16:54] DanWrong_ has joined the channel [16:55] sudoer has joined the channel [17:02] mediacoder: aurynn jasondavies: i have a quick n dirty twitter oauth-client implementation and a twitter streaming-api client http://github.com/mediacoder [17:03] jasondavies: mediacoder: cool [17:03] aurynn: mediacoder, definitely putting together the node infrastructure :) [17:04] RayMorgan has joined the channel [17:04] mediacoder: lol.. if i can do it, anyone could..shows how great nodejs is :-D [17:08] aurynn: And how good a coder you are ;) [17:12] mediacoder: ;-) [17:21] simoncpu: hi [17:21] simoncpu: is ryan online? [17:22] simoncpu: anyone here familiar with the code? what file/section do i need to explore to see how nodejs listens for connections? [17:22] aurynn: *deploys a backhoe to ryan's location* [17:22] aurynn: No, no he's not. [17:22] simoncpu: i'm especially interested on making IPv6 work [17:22] saikko has joined the channel [17:22] simoncpu: it looks like a good hobby [17:25] voodootikigod: any have or working on a good csv parser? [17:28] ashb: DanWrong: http://github.com/ashb/template/blob/master/lib/Template.js#L346-364 [17:28] ashb: was taht what you were after [17:28] ashb: ah nm [17:28] aguynamedben has joined the channel [17:28] simoncpu: uh.... [17:29] simoncpu: how do you guys explain node.js to your girlfriend? [17:29] simoncpu: "i'm here at the office right now playing with node.js" [17:29] DanWrong: I want a deep merge, but that would nearly do it...and its cleaner than jquery's extend [17:29] DanWrong: although ive just noticed proces.mixin _is_ jquery's extend [17:29] DanWrong: so going to use that [17:30] deanlandolt_ has joined the channel [17:30] ashb: i stole that function fomr somewhere else [17:30] ashb: i oporbably should have attirbuted it [17:30] mlouro has joined the channel [17:31] DanWrong: simoncpu: I'd say just don't try to explain..."im here at the office working" is enough detail :) [17:32] simoncpu: but i'm not really working [17:32] simoncpu: and it's 1:34am here in my timezone =) [17:32] simoncpu: "honey, i'm playing with grand theft auto 4 and with node.js" [17:33] simoncpu: "node.js is an exciting game too, just like gta4, except that it's useful" [17:34] voodootikigod has joined the channel [17:36] rektide: ashb &all: i'd like to work with the envjs people to get envjs running on node.js [17:36] rektide: the main issue seems to be that envjs is a simulated web environment [17:37] rektide: which means everything goes into the global namespace [17:37] rektide: everything is built on "this" [17:37] jasondavies: simoncpu: just say "I'm having an affair but don't worry, it's purely intellectual" [17:37] simoncpu: hahaha [17:38] rektide: i'm wondering what kind of containerization node.js has, how i might be able to allow multiple instances of envjs to run, and how to keep them polluting a global namespace [17:38] ashb: *keep them from polluting [17:39] rektide: so, in envjs, you might call load("env.rhino.js");window.open("http://slashdot.org") to load the envjs runtime and open slashdot.org [17:40] rektide: slashdot.org js might define, i dunno titles = ["RMS living in basement again", "node.js takes over planet", "eric raymond sitll crazy"] [17:40] jasondavies: heh [17:40] rektide: the intepretter now has a this.titles set [17:41] rektide: i'd like a way to containerize envjs [17:41] jasondavies: is envjs synchronous? [17:41] ashb: it tries to emulate the browser [17:41] deanlandolt_: jasondavies: as syncronous as a browser...so, not very [17:42] rektide: it tries to emulate the browser, yes [17:42] deanlandolt_: presumably require could provide a sandboxed global to each frame node wants to kick off [17:42] jasondavies: might be better spawned as a separate process, that way you can keep node.js lean and mean, and also maintain a separate namespace [17:42] rektide: what i'd like to divise is a way to have multiple sandboxed browsers [17:42] jasondavies: deanlandolt_: ah ok [17:42] rektide: deanlandolt_: thats exactly what i'm looking for, a sandbox [17:43] rektide: does each require() create a sandbox and re-run the init code for the module ? [17:43] onar has joined the channel [17:43] deanlandolt_: not automatically but it can be provided in a sandbox [17:44] deanlandolt_: how narwhal does it: http://github.com/280north/narwhal/blob/master/lib/sandbox.js [17:47] scudco has joined the channel [17:57] rektide: is brian hammond / fictorial around at all? he suppoesdly had a node-sandbox at some point [18:02] rektide: i might be able to spend a week staring at narwhal's sandbox and only half understand. however, it seems to use a lot of eval()... i can only assume thats comes with a significant performance penalty [18:03] soveran has joined the channel [18:07] eddanger has joined the channel [18:13] ericflo has joined the channel [18:21] aurynn has joined the channel [18:24] jasondavies: is there a way to gracefully terminate node.js i.e. wait for all pending events to finish but don't accept any new connections? [18:25] Wes- has joined the channel [18:25] ashb: if not there should be [18:26] jtaby has joined the channel [18:27] jasondavies: I guess it's only particular events that I care about i.e. any pending writes to disk or to a database [18:27] malkomalko has joined the channel [18:28] ashb: well you want to shut down the http acceptor [18:29] ashb: and then anything else should finish and then the loop.run() would stop of its own accord (if i grok libev right) [18:29] Tautologistics: Everything is just an event emitter so there's no way to know that there are more events expected [18:29] ashb: sure, but the important one is the http acceptor [18:29] Tautologistics: As an developer, one could keep track of what has not wrapped up yet and wait on the, [18:29] ashb: for oms t cases [18:29] ashb: *most [18:30] Tautologistics: you mean close the socket [18:30] ashb: if you want to be techmical about it, sure [18:30] ashb: :( [18:30] ashb: ACTION likes to deal in conceptual [18:30] ashb: (i dont, thats a huge lie) [18:31] jasondavies: Tautologistics: so I could keep a special queue of critical events and then wait on them before actually exiting, hmm good idea [18:31] jasondavies: is it possible to listen for the event that's triggered by ctrl+c? [18:31] Tautologistics: yes [18:32] jasondavies: is it "SIGINT" or something else? [18:32] aurynn: probably sigint. [18:32] Tautologistics: process.addListener("SIGINT", function () { ... }); [18:32] aurynn: you can listen for the one from sigkill, too, but you don't get much time to run code in a sigkill [18:34] Tautologistics: You're the only one that can know there are more events expected so I don't think you'd ever see this deferred shutdown as core feature [18:34] aurynn: if something ignores a sigint, I break out sigkill. [18:35] jasondavies: cool, it worked [18:37] isaacs has joined the channel [18:39] jcrosby has joined the channel [18:46] sudoer has joined the channel [18:55] ciju has joined the channel [18:55] jed has joined the channel [18:59] jasondavies: is it possible to listen on multiple ports simultaneously? I see that server.listen(...) is synchronous... [19:01] aurynn: I suspect that'll need to wait for either threaded v8, or just running multiple instances on different ports [19:01] jasondavies: ah, maybe the docs are out of date? I managed to run two server instances on different ports within the same node.js instance [19:02] jasondavies: server.listen(...) doesn't appear to be synchronous after all [19:02] JimBastard: i think node_debug works like this [19:02] JimBastard: it runs on another port while your node app runs on its regular port [19:02] jasondavies: in fact the hello world example has a sys.puts(...) call after server.listen(...) [19:04] rektide: aurynn: "threaded v8"... is that being worked on? what are the goals? [19:04] aurynn: rektide, I have no idea [19:04] aurynn: I doubt it, given that chrome uses a multi-process model [19:05] aurynn: and each window just gets its own v8 process, internally [19:05] jasondavies: so we are agreed, server.listen() is async? I updated the docs and I'll send a pull req [19:06] hassox has joined the channel [19:07] jed has left the channel [19:20] ciju has joined the channel [19:20] the_undefined has joined the channel [19:24] the_undefined_ has joined the channel [19:27] inimino: rektide: someone has a Web Workers implementation, check the mailing list [19:28] JimBastard: i use to be a web worker, until i got fired [19:28] aurynn: ACTION is impressed with the speed at which node infrastructure is being put together [19:29] lmorchard has joined the channel [19:29] inimino: jasondavies: server.listen is synchronous, in that it returns when the socket is open [19:30] jasondavies: inimino: aha, ok [19:30] inimino: jasondavies: I never read the docs any other way, but maybe they can be clarified [19:30] jasondavies: yeah I will update it then [19:32] jan____: yo jasondavies! [19:32] jan____: whatcha doing here? :)\ [19:32] jasondavies: jan____: hey :) [19:32] jasondavies: jan____: discovering the awesomeness, what else :) [19:33] JimBastard: anyone else going to the nyc.js meetup tonight? [19:33] aurynn: Sadly no, as I'm very far from nyc. [19:33] jan____: jasondavies: good highfives! [19:34] jasondavies: jan____: ^5 [19:36] teemow has joined the channel [19:50] cmlenz has joined the channel [19:51] Tautologistics: Where is the nyc.js? [19:54] aurynn: nyc, I'd imagine [20:01] rbranson__: nyc is a big place [20:07] j4c has joined the channel [20:09] j4c: hello, I try to grab an image from a server and forward it to the client on every HTTP request, but it doesn't work :( See my current code here: http://gist.github.com/253621. Any ideas? [20:15] michaelk^ has joined the channel [20:18] sudocarl has joined the channel [20:20] isaacs: j4c: i'm trying your code with the latest nodejs from ry's repo [20:21] isaacs: for starters, webserver.get(... should be webserver.request("GET", ... [20:21] nefD: can anyone remember when firebug used to be fairly quick? [20:21] nefD: ahh, those were the days [20:23] j4c: isaacs: what's the difference? [20:23] isaacs: j4c: just new preferred style, so that we can support arbitrary request verbs without adding new methods [20:24] isaacs: i'm getting a message in my web browser that the image contains errors and cannot be displayed [20:25] j4c: I get something like that when I try it within safari [20:25] j4c: when I save the image, I also can't open it with any image tool [20:26] mediacoder: j4c: response.sendBody(webserverChunk,"binary"); [20:27] Tautologistics: Damn you encoding! [20:27] mediacoder: heh [20:27] isaacs: ah [20:27] isaacs: yeah, that fixes it [20:27] bentomas has left the channel [20:27] j4c: :) I already thought it was the encoder, but I didn't knew how to set the encoding of the output [20:27] j4c: thanks a lot :) [20:27] mediacoder: :-) [20:28] isaacs: j4c: also, you don't need to buffer it [20:28] isaacs: don't bother with the webserverChunk var, just send each piece as you get it [20:28] isaacs: the only reason why you'd need to buffer is if you don't know the size. [20:28] j4c: I don't wanted to do it, but the example code did it so I thought, it might be recommanded [20:28] isaacs: but, since the backend server told you the size, you don't need that bit [20:30] isaacs: imagine you were proxying a 300gb file. [20:30] isaacs: trying to buffer it in memory would be prohibitive [20:32] j4c: so, this is okay: webserverResponse.addListener("body", function (chunk) { response.sendBody(chunk); });? [20:38] isaacs: j4c: webserverResponse.addListener("body", function (chunk) { response.sendBody(chunk, "binary") }); [20:38] aurynn: read a buffer, raise that you have the buffer filled, read the buffer, write that you have it filled, et [20:39] j4c: yeah, of couse [20:42] isaacs: heh, that'd be a good use case for _ify [20:43] aurynn: It seems reasonable to me to do the buffer like that for all cases [20:43] isaacs: webserverResponse.addListener("body", response.sendBody._(_,"binary")) [20:43] aurynn: IE, let the underlying application determine when to emit amFull [20:43] aurynn: or whatever [20:43] isaacs: aurynn: if you want to be a buffer, sure. [20:43] isaacs: if you want to just be a direct dumb proxy that does nothing with the data, no need to buffer more than the size of a single chunk. [20:44] aurynn: even then, you say "I have filled my buffer, and here's an EOF." [20:47] aurynn: or raise an eof, so whatever's reading from the buffer knows to stop caring [20:47] isaacs: aurynn: i'm not sure i grok the use-case you're talking about. [20:47] isaacs: it sounds kinda interesting, though [20:47] isaacs: got any code that describes it more explicitly? [20:48] aurynn: anything that reads from a file, or a web app that writes stuff piecemeal [20:48] aurynn: fx [20:48] aurynn: emit a haveData every time you've read some from the disk (or generated a piece of content) [20:48] aurynn: and at the end just emit EOF [20:49] aurynn: so upstream listeners know they can ignore you now [20:49] isaacs: aurynn: doesn't node already give you that with the posix module methods? [20:50] aurynn: right, so why not replicate that for server methods? [20:51] ashb: how do you registerd for reading on the http body? [20:51] isaacs: aurynn: well, you kinda do have that... [20:52] aurynn: nvm, I'm not being clear :) Carry on [20:52] isaacs: an http client emits a "body" event whne it's read a few bytes... [20:52] isaacs: that's why i was asking for code, not (just) to be a dick. [20:52] isaacs: :) [20:52] isaacs: i think node gives you what you need to make that happen. i'm curious about the api that you have in mind, since it sounds like it could be handy. [20:53] aurynn: Unfortunately, I don't have time to put it to code right now :( [20:53] isaacs: it would be good to have a fileStream type of thing that worked a bit like an HTTP client [20:54] ashb: isaacs: this is going ot be a stupid question, but how do i registerd for an event? :D [20:54] ashb: this is the first time i've actually written any node code [20:55] isaacs: ashb: blah.addListener(event, listener) http://nodejs.org/api.html#_events [20:55] ashb: ah i missed than i a quick skim [20:55] isaacs: ashb: promises have sugar methods to add listeners to the "success" and "failure" events. [20:55] ashb: yeah say that [20:55] ashb: *i saw [20:55] ashb: thanks [20:55] isaacs: ashb: myPromise.addCallback(successHandler).addErrback(failHandler) [20:55] isaacs: kewl [20:55] ashb: ACTION goes to pick up the takeaway [20:56] isaacs: aurynn: anyway, yeah... maybe something like: fs = new FileStream("/etc/passwd"); fs.addListener("data", handleData); fs.addListener("eof", closeThingie); fs.read(); [20:57] isaacs: and then it could have stuff like fs.stop(), fs.rewind(), fs.goto() etc. to control the flow. [20:57] aurynn: fs.addListener("eof", handleDataandClose); [20:57] isaacs: rightright [20:57] ciju has joined the channel [20:57] isaacs: that'd be a hell of a lot handier than nesting a dozen promises jsut to read a file. [20:58] isaacs: especially for really big files, or file-ish fifo's that might not even have an end. [20:58] isaacs: aurynn: ok, you've got a spec now, go write it ^_^ [20:58] ashb: isaacs: fs.addListeners("data", hD)("eof", close); [20:59] isaacs: ashb: does addListeners exist and return itself? [20:59] aurynn: And if you were sufficiently bored [20:59] ashb: not yet [20:59] ashb: was an idea [20:59] jed has joined the channel [20:59] aurynn: you could implement an XML SAX parser like this [20:59] ashb: it would return a bound function [20:59] isaacs: ashb: pitch it. i like it. [20:59] isaacs: right [20:59] ashb: isaacs: consider it pitched :D [20:59] ashb: i'm on enough mailing lists [20:59] isaacs: aurynn: or you could implement something that kills fewer kittens than SAX [21:00] isaacs: but yeah [21:00] isaacs: it would make it possible to do some interesting token-stream and parser type things [21:00] aurynn: xml = new XmlReader("xml"); xml.addListener("open", openTag); xml.addListener("close", closeTag); xml.addListener("eof", validateXml); [21:00] isaacs: without having to buffer tons of stuff in memory [21:00] kassandry has joined the channel [21:01] mattly has joined the channel [21:01] isaacs: whoa, promise.cancel, where have i been! promise.addCancelback(listener) nice! [21:02] voodootikigod[tr has joined the channel [21:03] isaacs: aurynn: honestly, i'm less excited about SAX style parsers, and more interested in using fifo's as message queues a la erlang-style mailboxes. [21:04] aurynn: isaacs, Can definitely do that. You can implement most parsers like this [21:04] isaacs: not sure if it'd be terribly efficient. might be better to do it different ways. [21:04] isaacs: ie, without getting the FS involved. [21:07] aurynn: Hitting the FS will kill you, performance-wise [21:18] pdelgallego has joined the channel [21:19] quirkey has joined the channel [21:20] teemow has joined the channel [21:21] sudoer has joined the channel [21:26] JimBastard has joined the channel [21:34] hassox has joined the channel [21:36] tomdale has joined the channel [21:41] jcrosby has joined the channel [21:43] michaelk^_ has joined the channel [21:50] dnolen has joined the channel [21:52] pmuellr has left the channel [22:04] tapwater has joined the channel [22:08] jcrosby has joined the channel [22:16] emyller: hey :) is there any performance difference between | foo = foo || {} | and | if (!foo) foo = {} | ? [22:17] JimBastard: 42 [22:19] sudocarl: emyller, I wouldn't think so... [22:19] frodenius: emyller: not really [22:19] sudocarl: both involve testing foo [22:19] Micheil: only slight [22:19] sudocarl: but I think the first is better wouldn't it? [22:19] Micheil: i do believe that foo = foo || {} is quicker [22:19] sudocarl: since it won't do a test if food isn't null [22:19] emyller: sudocarl: it can save some bytes :) [22:19] frodenius: you can write !foo || (foo={}) [22:19] Micheil: as it a ternary operator or something [22:19] sudocarl: emyller, :D [22:20] Micheil: besides, it's easier to read foo = foo || {} [22:20] emyller: yea [22:20] emyller: i'm just worried if can an assignment cost something [22:21] frodenius: imo it's easier to read if(!foo)foo={} [22:21] emyller: if yes, frodenius' suggestion 'd be better [22:21] frodenius: well, foo=foo||whatever makes an assignment in any case [22:21] Micheil: emyller: you could try and benchmark it, although, you'd probably get environmental errors in your benchmarks [22:22] frodenius: but this is really not a performance problem [22:22] Micheil: you bigger performance problems will be on how you iterate arrays and objects [22:22] Micheil: *your [22:23] emyller: | if (!foo.bar.baz) foo.bar.baz = []; foo.bar.baz.push(item); | against | (foo.bar.baz = foo.bar.baz || []).push(item) | [22:23] Micheil: true [22:23] Micheil: although if typeof foo.bar.baz == string, then you have a problem [22:23] Micheil: you also have problems if foo doesn't exist [22:24] emyller: not in my case, foo.bar must exist in my piece of code [22:24] Micheil: and that's possibly when you need something like a namespacer [22:24] sudoer has joined the channel [22:25] Micheil: reference: http://github.com/Miksago/Jet-js/blob/master/src/jet.js#L126-152 [22:26] frodenius: in that case if(!..) is fastest because it only needs to make the three variable lookups once [22:26] Micheil: resolves about 40 levels deep in < 5ms [22:27] Micheil: .. the commented out part was where I was trying to make it faster or better at some stage [22:27] Micheil: oh well, bye folks [22:28] frodenius: ok try http://pastie.org/738019 [22:28] frodenius: on my machine, the second is fastest [22:29] emyller: frodenius: what tool do you use for benchmarkings? [22:30] frodenius: hm i usually code up a small test case file and run it with several js shells [22:31] frodenius: no specific tools really [22:31] emyller: ah :) [22:31] frodenius: but i don't do a lot of extensive benchmarking [22:31] JimBastard: can anyone see whats malformed about this request? [22:31] JimBastard: http://retardbox.com:8000/images/corky.jpg [22:31] JimBastard: i think im having a mime type / encoding issue? [22:32] JimBastard: anyone? [22:33] emyller: no idea. [22:34] JimBastard: does the header look okay? [22:34] murz has joined the channel [22:36] sudocarl: does anyone know how to install d8 (the v8 debugger) [22:36] JimBastard: negatron [22:36] JimBastard: do you know whats wrong with my request sudocarl? [22:36] sudocarl: lemmi check [22:36] JimBastard: thanks man [22:37] davidsklar: sudocarl:try scons d8 console=readline [22:37] sudocarl: davidsklar, will do in a sec :D thanks [22:37] davidsklar: http://groups.google.com/group/v8-users/browse_thread/thread/9c5f75ac682bd142/57561d28277463a2 has a bit more info too [22:38] sudocarl: davidsklar, thanks :) [22:38] sudocarl: JimBastard, ....... hmmmm [22:38] JimBastard: nice i can see all your requests in the node_debug [22:38] sudocarl: it looks like it shoudl work [22:38] JimBastard: resp.sendHeader(200,{'Content-Type':'image/jpeg', "Content-Length":jsPage.length ,'Set-Cookie':session.setCookieHeader()}); [22:38] JimBastard: resp.sendBody(image); [22:38] sudocarl: take off the set cookie [22:38] JimBastard: tried that [22:38] JimBastard: maybe its posix.cat ? [22:38] JimBastard: should be open? [22:39] sudocarl: perhaps [22:39] mediacoder: resp.sendBody(image,"binary"); [22:39] sudocarl: can I see your code? [22:39] JimBastard: posix.cat("./" + req.uri.path).addCallback(function (image) { [22:39] mediacoder: i should get a dollar everytime i say this [22:39] JimBastard: its a huge block of crap [22:39] sudocarl: try what mediacoder said [22:39] JimBastard: aight [22:39] JimBastard: i tried setting the encoding manually [22:40] JimBastard: yeah no dice [22:40] JimBastard: i had .setEncoding before [22:40] JimBastard: doesnt work that way either [22:40] sudocarl: huh weird [22:40] sudocarl: so your catting the jpeg [22:40] sudocarl: have you tried printing out image [22:40] JimBastard: is that wrong? [22:40] sudocarl: see if cat is actually reading the right thing? [22:41] JimBastard: hrmm [22:41] sudocarl: see what "./"+req.uri.path is actually building [22:41] JimBastard: ohh yeah [22:41] JimBastard: its an image [22:41] sudocarl: I think that it builds: .//blah.jpeg [22:41] JimBastard: i did a sys.puts and its a bunch of binary info [22:41] sudocarl: ok [22:41] JimBastard: looks just like when i a did a dump of an image before [22:41] JimBastard: could it be something with multipart? [22:41] sudocarl: then your sending it to the browser [22:41] sudocarl: maybe it needs to be chunked? [22:42] mediacoder: JimBastard: i actually get some data, which looks binary, seems to be a broken image [22:42] JimBastard: where do a specify that? [22:42] emyller: another question: i am about to start the development of the public face of http://mandoojs.com/; i really want to do it with node, but i dunno if i can go safely; i need some couchdb connection, a wiki parser and basic functionalities. [22:42] Tautologistics has joined the channel [22:42] emyller: should i proceeed with node.js? [22:42] sudocarl: if you want to send it chunked send the body in multiple pieces [22:42] JimBastard: hrmm mediacoder the image can be viewed [22:42] sudocarl: emyller, what is that site going to be about? [22:42] JimBastard: just not via node.js [22:43] emyller: sudocarl: about my javascript library; must have docs, some dynamic pages and some interactivity with users (comments, custom pages, etc) [22:44] JimBastard: you should probaly just use couchdb + sammy.js [22:44] sudocarl: then yea build it with node for sure :) [22:44] sudocarl: whats sammy? :) [22:44] mediacoder: emyller: sure, why not. [22:44] JimBastard: google sammy.js [22:44] JimBastard: node.js is pretty cool, but a lot of goodies arent built in yet [22:44] JimBastard: just starting to get made [22:44] sudoer has joined the channel [22:45] onar has joined the channel [22:45] sudocarl: ah I see [22:45] sudocarl: :) [22:45] isaacs: emyller: node.js is like python, not django [22:45] isaacs: er... sudocarl, that is [22:45] emyller: "Sammy is a tiny javascript framework built on top of jQuery" « :( [22:45] JimBastard: ? [22:45] JimBastard: whats wrong with that [22:45] sudocarl: isaacs, I get that :) I just hadn't heard about sammy [22:46] emyller: i dont like jquery's philosophies. that's why i created the project the site will be about [22:46] sudocarl: JimBastard, [22:46] sudocarl: http://github.com/carlsverre/node-router/blob/master/node-router.js#L267 [22:46] emyller: but thanks for the suggestion, i'll take a look at it anyway [22:46] sudocarl: an example of a working static handler [22:46] JimBastard: yeah yeah [22:46] JimBastard: ive been looking through all the routing frameworks [22:46] JimBastard: and fu.js [22:47] JimBastard: the code is all there [22:47] sudocarl: weird... [22:47] sudocarl: maybe try a different image [22:47] sudocarl: or just a text file [22:47] JimBastard: im just gonna give up for now [22:47] JimBastard: ive got a presentation tonight [22:47] sudocarl: lol [22:47] JimBastard: showing off node [22:47] cmlenz has joined the channel [22:47] mediacoder: JimBastard: i get data which looks like jpeg, but it obvoiusly is not a correctly encoded image..otherwise it would show [22:47] JimBastard: ill just get the hash table of all the mime types [22:47] JimBastard: and hook that up [22:48] onar_ has joined the channel [22:48] emyller: sudocarl, mediacoder, isaacs: i'll give node.js my first try, then :) [22:48] JimBastard: http://retardbox.com:8000/ [22:48] JimBastard: there we go [22:48] sudocarl: emyller, good stuff :) [22:48] JimBastard: check it out, debugger running in real-time [22:48] JimBastard: http://retardbox.com:8080/ [22:48] sudocarl: very awesome JimBastard [22:48] sudocarl: :) [22:48] isaacs: http://retardbox.com:8000/flerg [22:49] JimBastard: Lapeeeedooo [22:49] rolfb has joined the channel [22:49] isaacs: hey, the picture didn't get uploaded. [22:49] isaacs: wtf, mang? [22:49] JimBastard: yeah ill comment that out [22:49] JimBastard: sorry [22:49] isaacs: hehe [22:49] JimBastard: so check this out [22:49] emyller: is there any wiki-based language parser out there? [22:49] JimBastard: http://retardbox.com:8000/session.html [22:49] JimBastard: try #mediawiki [22:49] JimBastard: they use markdown i think [22:50] emyller: JimBastard: in js, that work on node.js :) [22:50] JimBastard: http://retardbox.com:8000/debug.html [22:50] JimBastard: dont really know what you mean [22:50] sudocarl: like a markdown parser in js? [22:50] emyller: yea [22:50] JimBastard: there is a wiki node application [22:50] JimBastard: its on the github [22:50] sudocarl: JimBastard, lol open requests: -28 [22:50] aurynn: There's a lot of cool node shit already :) [22:50] JimBastard: ahaha yeah i know [22:50] JimBastard: im on it [22:50] JimBastard: also retardbox is techinically a wiki, but i wouldnt recommend using it [22:51] emyller: well, if there's not any i'll write a parser. that seems to be quite easy :) [22:51] JimBastard: aight fixed and restarted, http://retardbox.com:8000/debug.html [22:51] JimBastard: you should just use mustache [22:51] JimBastard: and html [22:51] sudocarl: davidsklar, that scons thing didn't work? [22:51] JimBastard: yaarg [22:51] JimBastard: brb [22:51] sudocarl: davidsklar, error: gnu/stubs-32.h: No such file or directory [22:51] Connorhd_: emyller, wikicreole or something i think [22:52] davidsklar: sudocarl: ruh roh. [22:52] JimBastard: silly edge cases [22:52] davidsklar: sudocarl: I asked The Google about that error message and got back: http://www.cyberciti.biz/faq/x86_64-linux-error-gnustub-32h-missing-error-and-solution/ [22:52] sudocarl: haha I coulda done that :D thanks :) [22:52] davidsklar: n/p :) [22:53] Connorhd_: emyller, http://www.ivan.fomichev.name/2008/04/javascript-creole-10-wiki-markup-parser.html [22:54] JimBastard: ohh yeah now i remember, wikimedia uses that crazy markup that makes no sense [22:54] the_undefined has joined the channel [22:54] JimBastard: i wish someone made a nice html markup language like html, on nm [22:54] emyller: Connorhd_, JimBastard: ty :) [22:55] JimBastard: np [23:02] sudocarl: random humor I just found during a 404 search: http://www.ziff.net/404/404.htm [23:13] tapwater: what's the current status of node binary data support? [23:13] sudocarl: JimBastard, did you figure out the problem? [23:13] soveran has joined the channel [23:13] sudocarl: or are you leaving the jpeg stuff? [23:15] mahemoff has joined the channel [23:15] mahemoff has left the channel [23:16] mahemoff has joined the channel [23:17] sifi has left the channel [23:18] alex-desktop has joined the channel [23:28] JimBastard: im coming back to it [23:28] JimBastard: for now [23:28] JimBastard: gtg [23:28] JimBastard: demo time [23:29] mediacoder: JimBastard: good luck [23:29] sudocarl: JimBastard, good luck :) [23:30] JimBastard: thanks! [23:48] nefD: *huge* ups to Guille for node.dbslayer.js ..! [23:57] aurynn: that reminds me, I need to hack on postgres.js tonight. [23:57] aurynn: and I should define a DBI api [23:59] jcrosby has joined the channel