[00:00] inimino: yep [00:01] inimino: bit operations work perfectly, within the defined limits [00:02] inimino: which are 32-bit ints [00:03] Azeroth has joined the channel [00:05] JimBastard has joined the channel [00:05] JimBastard: can't sleep javascripts will eat me [00:06] bradleymeck: with relish or wine? [00:08] jedschmidt has joined the channel [00:08] bradleymeck: mmmm anyone know how to capture tty responses from Node (ie. cursor position report from '\e[6n') [00:09] JimBastard: bradleymeck: im not sure if its what you are talking about, but someone did a ncurses binding recently [00:09] bradleymeck: kinda, but i dont want curses to take over the tty :/ [00:10] JimBastard: not really sure, im more of a web guy myself [00:10] JimBastard: sorry [00:11] JimBastard: stick around, someone will help you [00:11] JimBastard: :-D [00:13] mjr_: bradleymeck: how would you get those in say, C? [00:15] bradleymeck: that is rather hard to do actually, but basically get the non-flushed stdin in raw tty mode, but even w/o raw mode you can get it from the non-flushed input-buffer [00:20] darkf_ has joined the channel [00:20] _ry: bradleymeck: i wouldn't mind binding tcsetattr [00:22] JimBastard has joined the channel [00:22] mscdex has joined the channel [00:22] bradleymeck has joined the channel [00:22] freshtonic has joined the channel [00:22] N` has joined the channel [00:22] trochala has joined the channel [00:22] KungFuHamster has joined the channel [00:22] tk has joined the channel [00:22] Wes- has joined the channel [00:22] NickP has joined the channel [00:22] deanlandolt has joined the channel [00:22] JimBastard: splitta [00:23] _ry: if we had tcsetattr() we could do whatever vt100 codes or whatev [00:25] WALoeIII has joined the channel [00:25] mattly has joined the channel [00:25] konobi: _ry: could always do it as a seperate library, right? [00:27] mjr_: Hey look, network packet capture and decoding in mostly JavaScript: http://github.com/mranney/node_pcap [00:27] Aria has joined the channel [00:28] _ry: mjr_: what was the problem before on mac? [00:28] mjr_: dude [00:28] _ry: (or did you fix it?) [00:28] mjr_: So I guess bpf is broken in OSX because of them accepting a patch from FreeBSD to fix a different bug [00:28] _ry: bpf? [00:28] mjr_: Yes, there's a workaround, which I've applied. [00:29] _ry: what is bpf, sorry? [00:29] mjr_: http://github.com/mranney/node_pcap/blob/master/binding.cc#L104-109 [00:29] mjr_: Berkeley Packet Filter [00:29] _ry: huh [00:29] _ry: ACTION shakes his head in disgust [00:30] mjr_: It's possible that under high load that with this change applied we'll get behind and drop packets. [00:30] mjr_: Without it, you have to build up many, many KB of packets before select will return true. [00:30] mjr_: And then you are always many KB behind, with no way to drain the buffer. [00:31] _ry: mjr_: this lib is _rad_ [00:31] mjr_: Thanks, it's going to get even cooler in a couple of days when I feed the HTTP payload data from pcap back into the HTTP parser. [00:32] _ry: can i suggest that you camelCase your methods? [00:33] mjr_: BTW, you'll find that tcpdump on OSX has some similar buffering issues. You'll often not be displaying the packets you think you should be. [00:33] mjr_: But with this lib, you get piping hot, fresh packets. [00:33] JimBastard: camelCase for javascripts, underwhores for ruby [00:33] JimBastard: under_whores [00:33] mjr_: Sure, I'll CamelCase the C++ stuff. The underscored ones were from my previous C program. [00:34] mjr_: I also have no idea what I'm doing with V8, so I might be doing stupid things that are slow or leaky. [00:34] jbrantly has joined the channel [00:34] JimBastard: actually isnt it, CamelCase, and mixedCase ? [00:35] JimBastard: http://en.wikipedia.org/wiki/CamelCase [00:35] _ry: JimBastard: lowerCamelCase UpperCamelCase [00:35] _ry: mjr_: going to look it over right now - i'll let you know if i see anything [00:35] mscdex: http://upload.wikimedia.org/wikipedia/commons/e/ef/CamelCase.svg [00:35] mscdex: huhu [00:36] mjr_: I've got a bunch more C++ work to do, because right now you can only listen on one interface at a time. This is fine for many things, but I need multi-interface capture. [00:37] mattly has joined the channel [00:37] _ry: mjr_: what's the limit on the number of interfaces in linux? [00:38] mjr_: actually, Linux has a magic value of "any" that will listen on all interfaces. [00:38] mjr_: Do you mean the number of interfaces that can exist, or that you can capture on? [00:38] _ry: mjr_: you should have a HandleScope here http://github.com/mranney/node_pcap/blob/06423e3dc34a3bc2422d26818d3ae3b0777d97ad/binding.cc#L39 [00:38] konobi: aliased interfaces too [00:38] _ry: mjr_: that can exist [00:40] _ry: mjr_: are you testing with node_g ? [00:41] _ry: mjr_: here too http://github.com/mranney/node_pcap/blob/06423e3dc34a3bc2422d26818d3ae3b0777d97ad/binding.cc#L117 [00:41] _ry: i'll make you a patch [00:41] _ry: mjr_: also, MIT? [00:42] mjr_: Is it different if I test with node_g? I've been using regular node. [00:43] mjr_: I dunno how many interfaces can exist. The pcap API only accepts one at a time. [00:44] mjr_: I gotta run, but I'd appreciate advice on HandleScope or whatever other V8 stuff I need to do. [00:44] liucougar has joined the channel [00:44] mjr_: This can be MIT or whatever license you prefer. [00:44] mjr_: Ideally, I'd like it if other people maintained it after I get what I need from it. :) [00:49] aaronblohowiak has joined the channel [00:50] aaronblohowiak: JimBastard: trying to get vows working, there is an external dep on eyes... grrrr.. the dependency situation sucks [00:50] JimBastard: i know [00:50] JimBastard: i can assist [00:50] JimBastard: cloudhead [00:50] JimBastard: you see this lol [00:50] JimBastard: i told you [00:50] JimBastard: im switching to http://debuggable.com/posts/git-fake-submodules:4b563ee4-f3cc-4061-967e-0e48cbdd56cb right now [00:50] JimBastard: for my projects [00:51] JimBastard: aaronblohowiak: cd into the vows folder [00:51] JimBastard: and git submodules update --init [00:51] tilgovi_ has joined the channel [00:52] aaronblohowiak: JimBastard: also, using relative paths to a dependency is not good, use $NODE_PATH for that plz [00:52] Aria: ++ [00:52] aaronblohowiak: JimBastard: ah, the submodules init grabbed it. ty [00:53] cloudhead: hmm yes [00:53] cloudhead: when is npm going to be ready? [00:53] isaacs: cloudhead: it's ready now for a lot of things. [00:53] JimBastard: cloudhead use fake submodules mang [00:53] JimBastard: git submodules are kinda fail [00:54] isaacs: npm dependencies are a hell of a lot easier than git submodules. [00:54] JimBastard: ^^ [00:54] JimBastard: +2 [00:54] isaacs: and you can use the "link" hash to put them wherever you want them. [00:54] cloudhead: JimBastard: fake submodules make me commit 3rd party projects inside my current project [00:54] cloudhead: so it's not a solution [00:54] aho has joined the channel [00:54] cloudhead: isaacs: is there a central repo? [00:54] JimBastard: whats so bad about that? [00:54] aaronblohowiak: cloudhead ++ [00:54] JimBastard: its your library anyway [00:54] cloudhead: JimBastard: huh? [00:54] cloudhead: dude [00:55] JimBastard: eyes? [00:55] cloudhead: I don't want a mess of commits [00:55] JimBastard: is that not you [00:55] cloudhead: from different libs [00:55] JimBastard: it doesnt work like that [00:55] isaacs: cloudhead: http://github.com/isaacs/npm is the npm repo, or do you mean http://registry.npmjs.org/? [00:55] cloudhead: yea it is [00:55] JimBastard: hrmmm maybe it does [00:55] cloudhead: isaacs: yea I meant the reg [00:55] isaacs: cloudhead: npm install websockets-server [00:55] isaacs: it works [00:55] JimBastard: lets all just get on nmp [00:55] JimBastard: npm [00:55] _ry: isaacs: question - is there a way to self update npm? [00:55] JimBastard: ?case closed [00:55] cloudhead: isaacs: how to add to the npm registry? [00:55] JimBastard: aye [00:55] JimBastard: ^^ [00:55] cloudhead: yea, I'd rather start using npm, I have package.json files in all my project [00:55] cloudhead: s [00:56] isaacs: _ry: i'm working on an update command, but for now, you can do: npm --auto-activate always install npm [00:56] isaacs: cloudhead: install npm, and then do man npm-developers [00:56] cloudhead: isaacs: cool. [00:56] cloudhead: gonna see if I can get all my projects on there [00:56] isaacs: cloudhead: or read http://github.com/isaacs/npm/blob/master/doc/developers.md#readme if you're lazy :) [00:56] aaronblohowiak: isaacs: exposing more of the man pages on the github page would be good for adoption [00:57] isaacs: aaronblohowiak: good point. [00:57] _ry: isaacs: also, your querystring patch - which generally looks okay [00:57] _ry: is failing for node_g on many tests [00:57] JimBastard: aight so im gonna add json.package to all my stable projects and get them on there [00:58] _ry: isaacs: e.g. build/debug/node_g /Users/ryan/projects/node/test/simple/test-url.js [00:58] JimBastard: aaronblohowiak: drop me a message if you get stuck with the format.js stuff [00:58] isaacs: _ry: oh, there was a problem with the patch that i sent. i meant to send the fixed one to you. you can pull from my querystring-baddata-fix branch [00:59] rauchg has joined the channel [00:59] isaacs: _ry: aheckmann spotted it. [00:59] _ry: ok [00:59] aaronblohowiak: JimBastard: will do. Will you accept a patch for string.js to accept all javascript numbers? (floating point, 10e2, etc) ? [00:59] isaacs: _ry: sorry, been a busy day :) [01:00] isaacs: aaronblohowiak: pushed an updated README.md. thanks [01:02] jedschmidt: isaacs: i installed npm using the directions in the README, but get this when i man npm: No manual entry for npm [01:03] isaacs: jedschmidt: the activate failed, that means [01:04] isaacs: jedschmidt: you can copy the contents of the "man" folder to whatever "man1" is in your manpath [01:04] isaacs: jedschmidt: it probably gave you some kidn of warning when it installed. [01:05] jedschmidt: isaacs: okay, going to give it another go. [01:07] jedschmidt: isaacs: i nuked it and tried the same steps again, but still get it: http://gist.github.com/407064 [01:08] JimBastard: npm failed on me, but im running an old node [01:08] JimBastard: updating node and trying again [01:09] isaacs: jedschmidt: ah, do make uninstall and then sudo make [01:09] isaacs: sorry [01:09] Tim_Smart: running old node is like stale bread >.> [01:09] isaacs: jedschmidt: it's saying "i already have the stable version of npm, dude!" [01:10] jedschmidt: isaacs: success! [01:10] jedschmidt: isaacs: thanks, going to give it a test run with cookie-node [01:10] JimBastard: Tim_Smart: but like, you can still make french toast [01:10] JimBastard: and that shit is delicious [01:11] Tim_Smart: Of course, old node certainly has its uses, but fresh bread is definitely better [01:11] JimBastard: word life [01:11] Tim_Smart: more nom [01:15] mscdex: that reminds me, i'm hungry [01:15] mjr_ has joined the channel [01:15] mjr_: _ry: Thanks for the patch. I was wondering how those V8 objects would get collected. [01:16] isaacs: jedschmidt: awesome! [01:22] creationix: _ry: is Joyent smart using node? [01:26] _ry: creationix: some of the support code is using node [01:27] ditesh|cassini has joined the channel [01:27] creationix: ok, because it looks nothing like node to me [01:27] creationix: (the js api) [01:29] _ry: yeah, it's not node [01:33] steadicat has joined the channel [01:34] airportyh has joined the channel [01:40] bolson has joined the channel [01:45] charlesjolley has joined the channel [01:46] aconbere: http://gist.github.com/407098 [01:46] aconbere: I updated node today and my app returns this error [01:47] aconbere: I'm not super hip to encoding errors [01:47] aconbere: I rebuilt node with debugging enabled, and my build passes the test suite [01:47] aconbere: (minus two tests in http) [01:54] maushu: I need a xml parser. [01:55] Tim_Smart: maushu: http://wiki.github.com/ry/node/modules#parsers-xml ? [01:55] maushu: Not having much luck. [01:56] maushu: http://github.com/polotek/libxmljs seems excelent, for some reason find isn't working well or perhaps it's just me. [01:56] aconbere: reverting to v0.1.95 fixed my issue [01:56] aconbere: so... some kind of awesome there [01:58] aconbere: maushu: does your document have namespaces in it [01:58] aconbere: that always gives me hell when constructing xpaths [01:58] mscdex: maushu: what kind of problems? [01:58] aconbere: I suppose it would help if we knew the xpath that was failing [01:58] maushu: aconbere, let me check that might be it. [01:58] aconbere: and the document it was being run against [01:59] maushu: It's a feed. [01:59] maushu: http://stackoverflow.com/feeds/tag/node.js [02:00] JimBastard: uhhh [02:00] JimBastard: buffer:46 return this.utf8Write(string, offset); [02:00] JimBastard: TypeError: Offset is out of bounds [02:00] maushu: I tried /feed/entry feed/entry //entry ./entry [02:00] maushu: Heck, the only thing I seem to able to do is / and *. [02:01] aconbere: JimBastard: that's the bug I just posted! [02:01] aconbere: :) [02:01] JimBastard: fffffffffffffffffffffffffff [02:01] JimBastard: lol [02:01] JimBastard: roll back [02:01] aconbere: :) [02:01] aconbere: yep! [02:01] aconbere: maushu: try calling find in its second form [02:02] aconbere: find(xpath, ns_uri) [02:02] aconbere: passing in the ns_uri [02:02] maushu: ...ah [02:02] maushu: and what is the ns_uri? [02:02] aconbere: lord only knows [02:02] aconbere: :) [02:02] maushu: Great. [02:04] aconbere: hehe [02:04] aconbere: well so in python [02:04] aconbere: it would be something like [02:04] joshbuddy has joined the channel [02:04] aconbere: {'t': 'http://codespeak.net/ns/test1',...} [02:04] aconbere: and you would prefix your xpath with something like [02:04] aconbere: /t:feed [02:04] sudoer has joined the channel [02:05] aconbere: it says... okay... you want all the feed elements that have been namespaced [02:05] aconbere: but ns_uri seems very... opaque [02:05] aconbere: ah! [02:05] aconbere: look [02:05] aconbere: doc.find("ns-1:child1/ns-2:child2", {"ns-1": "ns:uri1", "ns-2": "ns:uri2"}) [02:05] aconbere: further down the page [02:05] alexiskander has joined the channel [02:06] aconbere: in general... I find that if something I'm doing in xml isn't working [02:06] aconbere: it's probably namespaces at fault [02:07] JimBastard: hey isaacs any idea http://github.com/Marak/Faker.js/blob/master/json.package [02:07] JimBastard: what im doing wrong? [02:07] mscdex: i find that if i'm doing something in xml, i'm doing it wrong. json ftw! :D [02:08] Tim_Smart has joined the channel [02:10] waterdoggie has joined the channel [02:15] JimBastard: hey is there are preferred way to keep your projects sorted on your homepage in a fixed order? [02:16] Tim_Smart has joined the channel [02:18] jedschmidt: JimBastard: you mean github? make sure you always commit in the order you want. [02:18] JimBastard: >.< [02:18] JimBastard: okay [02:18] JimBastard: im on it [02:28] Tim_Smart: Hmm latest node is having problems building on ubuntu 10.04 [02:28] _ry: Tim_Smart: ? [02:29] Tim_Smart: Yeah putting together a gist now [02:30] Tim_Smart: _ry: http://gist.github.com/4071241 [02:33] konobi: skip the 1 at the end [02:35] ssteinerX has joined the channel [02:35] _ry: Tim_Smart: make? [02:36] _ry: oh nm [02:36] ssteinerX has left the channel [02:36] _ry: Tim_Smart: try 'make distclean' [02:36] _ry: then configure and make again [02:36] Tim_Smart: ok [02:38] mscdex: did anyone ever make an xml2json converter that's compatible with node? [02:39] creationix has joined the channel [02:40] Tim_Smart: _ry: That did the trick [02:44] bmizerany has joined the channel [02:44] bradleymeck has joined the channel [02:45] smtlaissezfaire has joined the channel [02:51] felixge has joined the channel [02:51] felixge has joined the channel [02:53] fizx has joined the channel [02:54] yatiohi has joined the channel [02:55] bradleymeck: just noticed, might want to change extern 'C' to have double quotes in the docs [02:56] fizx has joined the channel [03:00] softdrink has joined the channel [03:04] mattly has joined the channel [03:13] mape has joined the channel [03:13] polotek: Hmmm. did aconbere get his libxmljs issue sorted out? [03:15] darkf has joined the channel [03:15] alexiskander has joined the channel [03:19] alexiskander has joined the channel [03:24] morganallen_ has joined the channel [03:25] bmeck has joined the channel [03:27] bmeck: is there a way to combine the .node addon modules with regular javascript without using a require (ie one file or something prevent reading 2 files on including the addon)? [03:31] bolson has joined the channel [03:32] polotek: bmeck: you're gonna have to read the files at some point [03:32] polotek: but if you want the module in one file check out libxmljs does it [03:32] bmeck: k [03:32] polotek: the js files get loaded and run inside the addon on initialization [03:34] polotek: http://github.com/polotek/libxmljs/blob/master/src/libxmljs.cc#L158 [03:39] alexiskander_ has joined the channel [03:39] PyroPete1 has joined the channel [03:40] liucougar has joined the channel [03:45] Tim_Smart has joined the channel [03:45] bmizerany: _ry: sick http://github.com/ry/node/issues/closed#issue/149/comment/244675 [03:45] bmizerany: _ry: damn you're fast. :) [03:48] JimBastard: hey bmizerany [03:48] bmizerany: yo [03:48] JimBastard: i didnt realize you were the sintara guy, props [03:48] JimBastard: sinatra [03:48] bmizerany: JimBastard: ha. thanks man. :) [03:48] JimBastard: :-D [03:49] JimBastard: i dont do rails but ive used that shit mad times [03:49] JimBastard: good stuff [03:49] JimBastard: routing is fun [03:49] JimBastard: routing on the browser, fun too [03:49] bmizerany: yeah. I like it. :) [03:49] bmizerany: haven't touched Rails in over a year. it's been great. [03:52] mape_ has joined the channel [03:52] Aria: Nice [03:53] wilmoore has joined the channel [03:55] _ry_ has joined the channel [03:55] Tekerson_ has joined the channel [03:55] tilgovi_ has joined the channel [03:55] joshthecoder_ has joined the channel [03:56] polyrhyt1mic has joined the channel [03:57] ajpiano has joined the channel [03:57] ssteinerX has joined the channel [03:58] felixge has joined the channel [03:58] JimBastard: good v8 vid [03:58] JimBastard: http://www.youtube.com/GoogleDevelopers#p/c/412372BDDAEAFB41/1/KTkTBKSnqbA [03:59] smtlaissezfaire has joined the channel [03:59] gwoo_ has joined the channel [04:02] Yuffster has joined the channel [04:04] mscdex: JimBastard: "This video is unavailable" [04:04] bmizerany: JimBastard: that link isn't working [04:04] polotek: JimBastard: which one is it [04:04] bmizerany: ah. I'm not the only one [04:04] JimBastard: fail [04:04] polotek: that link doesn't work [04:04] mscdex: heh [04:06] mcarter has joined the channel [04:06] JimBastard: ugh im retarded anyway, its from dec 09 [04:06] JimBastard: http://www.youtube.com/watch?v=KTkTBKSnqbA [04:06] Tim_Smart: Coffeescript + node is awesome for shell scripts :p [04:06] JimBastard: +1 Tim_Smart [04:06] jsilver has joined the channel [04:08] polotek: man this is just talking about why v8 is awesome [04:08] polotek: I need some good info on type conversion [04:10] siculars has joined the channel [04:11] saikat has joined the channel [04:19] Tim_Smart: fs.readFile is acting weird [04:21] Tim_Smart: Hmm might do a make test [04:22] Tim_Smart: 'make test' gives two errors on Ubuntu 10.04 [04:22] Tim_Smart: http://gist.github.com/407196 [04:23] _ry_: Tim_Smart: that's okay [04:23] _ry_: one is because you dont have curl [04:23] _ry_: the other is a known issue [04:25] mscdex: polotek: what's the easiest way to insert a root node with the document's existing child nodes in libxmljs? [04:25] Tim_Smart: OK cool. Also, when I fs.readFile on a non-existing file, the error is thrown instead of being passed to the callback [04:26] mscdex: erm, set the existing child nodes as the children of the new root node [04:26] _ry_: Tim_Smart: hm [04:27] polotek: mscdex: not sure what you mean [04:27] Tim_Smart: Actually, only in a special case [04:27] mikeal has joined the channel [04:27] polotek: what do you mean "new root node" [04:27] mape_: "VP8 will live or die based on whether porn producers adopt it." [04:27] mape_: hehe [04:27] mscdex: polotek: if i load in an xml document with libxmljs and there is no root node, just several nodes, how can i add a root node and assign those several nodes to the new root node? [04:28] mape_: Duh, I read that as V8, now less fun. Morning spoiled [04:28] Tim_Smart: _ry_: Nevermind, I was doing it wrong [04:28] Ned_: mikeal: Hmmm, it seems that after a client disconnects, server.broadcast still tries to send to them [04:28] Ned_: :-( [04:28] Ned_: and you get happy "Stream is not writable" errors [04:28] Ned_: :-( [04:28] polotek: there is always a root node [04:28] polotek: if not it wouldn't parse [04:29] polotek: I don't think it supports fragments right now [04:29] mscdex: ah ok... well the documentation says Document.root() says it can possibly return null, and i took that to mean a Document could have no root node [04:29] mscdex: -says [04:29] bmizerany: is it me, or does node not ignore a #!? [04:30] polotek: yeah if you create a document with new Document there's no root [04:30] polotek: you have to set it with doc.node [04:30] polotek: or doc.root(new Element) [04:30] mscdex: oh ok, but if you're parsing it'll just set an error? [04:30] polotek: but if you parsed a string and got a document with no root, that's a problem [04:31] polotek: no error, should return null for the doc [04:31] siculars has joined the channel [04:31] mscdex: okie awesome [04:33] aconbere: polotek: not my issue [04:33] aconbere: I was sort of helping mausha [04:33] aconbere: or whatever his name was :) [04:34] aconbere: mostly I was just confusing the matter by reminding everyone that xml namespaces suck [04:34] polotek: yeah they do [04:34] polotek: anyway thanks [04:34] polotek: the api for libxmljs is weird when it comes to namespaces [04:35] aconbere: ACTION nods [04:35] polotek: but honestly that's the way it has to work in order to treat them correctly [04:35] aconbere: are you the author? [04:35] polotek: the spec for namespaces is broken [04:35] polotek: currently maintaining [04:35] aconbere: yeah I mean... I mostly just looked for the version of find that resembled the one I knew [04:35] aconbere: and it was there [04:35] polotek: didn't write the initial version [04:35] aconbere: cool [04:36] aconbere: well... it was similar enough to lxml in python [04:36] aconbere: that it wasn't hard [04:36] aconbere: the documentation seems pretty good [04:36] polotek: I'm planning on updating it to be more js friendly [04:36] aconbere: :) [04:36] polotek: but the v8 C++ api is a beast [04:36] polotek: tripping me up in a lot of places [04:37] bmizerany: nope. it was just me. (re: the #!) [04:38] aconbere: polotek: fun, my only experience with C++ was in college and I sucked at it then. Now it just baffles me. [04:39] polotek: that has not changed [04:39] polotek: there's just very little concrete documentation about how it's supposed to work [04:40] wilmoore_ has joined the channel [04:42] creationix has joined the channel [04:48] admc has joined the channel [04:48] _ry_: polotek: what's tripping you up/ [04:48] bpot has joined the channel [04:48] _ry_: i will soon improve the addon docs [04:51] polotek: _ry_: that would be appreciated [04:51] polotek: I just get really stuck on type conversions between js space and C++ [04:51] polotek: the way libxmljs is set up [04:52] smtlaissezfaire has joined the channel [04:52] polotek: there are two versions of every public method on an object [04:52] joshbuddy has joined the channel [04:52] polotek: the v8 version that takes Arguments& array and inspects it. converts types [04:53] polotek: then passes the types into the C++ function that does work and passes back the output to be rewrapped for js space [04:53] polotek: the problem when I find bugs and have to change the types of various variables [04:53] polotek: I just get bogged down in all these errors [04:53] polotek: can't convert "value" to "bool" [04:54] polotek: I know none of that is helpful [04:54] polotek: so here's a concrete issue I'm working on now [04:55] polotek: _ry_: http://github.com/polotek/libxmljs/blob/master/src/xml_element.cc#L28 [04:55] mscdex: _ry_: is there a particular reason why object properties that don't start with a letter should not be displayed in sys.inspect? [04:56] polotek: the 4th argument is the content of the xml node [04:56] polotek: but right now it only uses it if IsString() is true [04:56] polotek: so if you pass in a none string, you get an empty node [04:56] polotek: rather than converting it to a string as you would expect [04:56] polotek: I tried just removing the If check and letting ToString do it's thing [04:57] polotek: got lots of fail from that [04:57] polotek: so now I'm trying to create a char * that is an empty string [04:57] polotek: then checking args[3] for null or undefined [04:58] polotek: and if not, passing it to Utf8Value so I can get the char * from there [04:58] polotek: but any combination of syntax I try gives me some type of error [04:59] polotek: actually it worked at one point [04:59] _ry_: mscdex: no? [04:59] polotek: but it would convert null and undefined values to literal "null" and "undefined" [05:00] _ry_: polotek: why allocate content n the heap? [05:01] _ry_: polotek: just stack allocate it [05:01] _ry_: 'content', the variable, i mean [05:01] polotek: _ry_: I'm not even sure how to parse that statement. example? [05:02] _ry_: you have v8::String::Utf8Value *content = NULL; [05:02] _ry_: a pointer [05:02] _ry_: just do v8::String::Utf8Value content; [05:03] _ry_: or better yet v8::String::Utf8Value content(args[3]->ToString()) [05:03] polotek: that's what was there before [05:03] _ry_: polotek: you know how to use gdb? [05:03] polotek: oh I see the difference now [05:04] polotek: not well. I've also been trying to get up to speed with C debugging [05:04] _ry_: polotek: it's worth spending some time learning [05:04] polotek: does it give better errors than compile time? [05:04] _ry_: then you can break on that and step through [05:04] _ry_: look at what each variable is [05:05] polotek: okay so I'm changing the allocation of content to be what you suggest [05:05] polotek: but I have to put it in a Null check [05:05] polotek: which means I need to declare the content variable outside of that [05:06] bpot has joined the channel [05:08] mscdex: nevermind about sys.inspect haha, it's late here ;-) [05:13] polotek: _ry_: here's what I changed it to, along with the awesome compile error [05:13] polotek: http://gist.github.com/407224 [05:16] ozgrub has joined the channel [05:20] aaronblohowiak: i wonder why nickserv says jimbastard was last seen 3 days ago [05:24] _ry_: polotek: http://gist.github.com/407229 [05:25] polotek: lol [05:25] polotek: _ry_: now I feel better [05:25] polotek: that's what I ended up with after some trial and error [05:25] polotek: makes me feel a little better [05:25] polotek: I just thought it was ugly and I was missing a simpler way [05:26] Tim_Smart: Hmm who was the person working on the node scraper? [05:26] Tim_Smart: / crawler / data miner [05:26] _ry_: Tim_Smart: aria [05:26] polotek: _ry_: I shouldn't have to free(content) right? Since it was allocated by v8, it'll be cleaned up when the Utf8Value get's clean up? [05:26] _ry_: polotek: correc [05:27] Tim_Smart: _ry_: OK thinks. Do you know his github? [05:27] Tim_Smart: *thanks [05:27] _ry_: Tim_Smart: http://github.com/aredridel/html5 [05:28] Tim_Smart: Thanks again :) [05:28] mape_: He is moving along nicely, think he stated to only have 1 testcase left out of like 456 [05:28] pkrumins: _ry_: could you look into Buffer problem at some point? Just to remind you, if you make constructors and the destructor public, and create a Buffer object, it crashes node when its destructor gets called. [05:28] mape_: And that was a real wonky one not really found in "live" sites [05:29] _ry_: pkrumins: do i have an issue for that? [05:29] pkrumins: on github? [05:29] mscdex: polotek: i've discovered some seemingly strange behavior with libxmljs [05:29] pkrumins: i didn't create one yet [05:29] pkrumins: gonna create now [05:29] _ry_: pkrumins: please do - i'm backed up like 2 days [05:29] pkrumins: alright! [05:30] pkrumins: I'll create two tickets [05:30] inimino: _ry_: was it you that linked to this? http://freemusicarchive.org/music/Chromix/ [05:30] pkrumins: cause there are two problems [05:30] bradleymeck has joined the channel [05:30] _ry_: inimino: yea, rad, isn't it? [05:30] inimino: yes :D [05:30] polotek: mscdex: do tell [05:32] mscdex: polotek: i noticed that when i'm recursively traversing an element's children, the text() method doesn't seem to return the text between the node's tags. it's not until it reaches the internal text node of the element (1 more level deep) does it return the text [05:33] mscdex: the element is returning a child node called "text" which returns another element [05:34] pkrumins: _ry_: done! [05:34] mscdex: polotek: so, foo.text() == "" but foo.child(0).text() == "the text of foo" [05:35] jedschmidt has joined the channel [05:36] mscdex: and for some elements, there are a bunch of children contain text() values of '\n ' [05:36] mscdex: *that [05:37] polotek: mscdex: yeah I noticed the "\n" thing. [05:37] polotek: at some point the to string method was changed [05:37] polotek: so that it preserved newlines [05:38] polotek: from the original doc, or something about how it was parsed [05:38] polotek: still looking into that [05:38] polotek: the text() issue I haven't heard though [05:38] polotek: can you create issues for both of those? [05:39] mscdex: sure [05:39] aaronblohowiak: _ry_: this seems really odd: http://christiankvalheim.com/post/612792033/buffers-not-the-way-for-mongodb [05:39] polotek: mscdex: what version are you using? are you on the master branch or refactor? [05:40] mscdex: master [05:40] fictorial: megaman music - love it [05:41] mscdex: fictorial: ftw! :D [05:41] fictorial: btw, "chiptune" is a great genre name... so is idm [05:41] _ry_: aaronblohowiak: hm [05:42] polotek: mscdex: I'm not getting that, but I just made some minor changes [05:42] polotek: still want to see your example [05:42] polotek: _ry_: He's probably doing it wrong [05:42] polotek: ;) [05:43] joshbuddy has joined the channel [05:43] aaronblohowiak: polotek: that was my assumption as well.. he is talking about 100mb files, i don't know if the tests have gone up that high [05:43] _ry_: polotek: hard to say [05:45] polotek: _ry_: yes it is hard to say if you're doing it wrong. that's the major problem I'm having. [05:45] _ry_: http://github.com/christkv/node-mongodb-native/blob/586251ecb1ab34a60204a48a6b8b5f51e7bc823c/lib/mongodb/bson/bson.js#L79 [05:45] _ry_: ^-- this is clearly bad [05:46] _ry_: he seems to be doing that a lot [05:47] _ry_: it should be like zero alocations, 10 cpu instructions [05:47] _ry_: this is like at least 2 v8 allocs, and many calcuations [05:48] _ry_: i'm guessing that's just a 32bit network byte order int [05:48] polotek: he seems to want to go back and forth between a Buffer and a String like it's free [05:48] linuxsable has joined the channel [05:49] polotek: the blog post makes it sound like he's doing lots of string manip before sending to mongo [05:50] _ry_: i suppose people probably want .... [05:51] _ry_: i forget what it's called [05:51] _ry_: whatever - common binary element parsing [05:52] _ry_: like buffer.parseInt32(index) [05:53] mscdex: polotek: done. i included a gist containing the code i'm using and partial output [05:53] _ry_: ruby has some fancy name for what that's called [05:54] fictorial: "ByteBuffer" in Java IIRC. [05:55] hobson has joined the channel [05:55] _ry_: unpack! [05:55] aaronblohowiak: _ry_: unpack? [05:55] _ry_: yeah [05:56] _ry_: i'd rahter have indiviual methods for each type though [05:56] _ry_: i think that's faster maybe [05:56] fictorial: e.g. http://java.sun.com/j2se/1.4.2/docs/api/java/nio/ByteBuffer.html#getInt%28%29 [05:57] _ry_: for node-amqp i just did this all manuall [05:57] _ry_: which was pretty annoying but not so bad [05:57] _ry_: http://github.com/ry/node-amqp/blob/master/amqp.js#L238 [05:57] _ry_: i guess having that in the standard library would be reasonable [05:58] _ry_: okay.. but first have to fix this querystring thing :/ [05:59] stalled has joined the channel [05:59] polotek: mscdex: are you talking about this line? jsobj['#'] = (children.length == 0 ? obj.text() : ""); [06:00] polotek: children.length is not 0. so wouldn't you be getting the empty string? [06:01] nsm has joined the channel [06:01] _ry_: ndb --local my_js.js [06:01] _ry_: ^-- rad [06:02] polotek: _ry_: you should add a description to node-amqp [06:03] polotek: I forgot about it. I'm gonna use it to scratch an itch that just came up. [06:05] micheil has joined the channel [06:05] pquerna: any suggestions on a single-file-or-damn-near templatin system to just make a simple admin-Ui thingy? just kinda want... pass a js object in as context, simple if/else and while loops? [06:06] polotek: mscdex: I'm fixing a different issue where using a non-string as content defaults to null [06:06] polotek: right now text() returns null if no content has been set [06:07] polotek: I'm actually thinking it should return "" [06:07] polotek: as the default state [06:07] aaronblohowiak: pquerna: http://github.com/deadlyicon/jerb [06:07] polotek: I think that's consistent with other implementaitons [06:08] pquerna: aaronblohowiak: awesome. [06:08] aaronblohowiak: pquerna: that is 128 lines, and then adapters for jquery or prototype for the client side are extra ( http://github.com/deadlyicon/jerb/blob/master/src/jerb.js ) [06:08] aaronblohowiak: pquerna: send jared a message if you use it. he's great! [06:11] mscdex: polotek: i had that line because otherwise an element's text() would show the text of all of its children -- something i don't want [06:11] linuxsable has joined the channel [06:14] polotek: maybe it's not so consistent [06:18] isaacs_home has joined the channel [06:19] polotek: but it's happening :) [06:19] mscdex: polotek: http://gist.github.com/407260 [06:19] mscdex: polotek: that gets me closer to what i'm wanting (minus the newline and spacing problem), but what if an element actually has a child node named 'text'? [06:20] mscdex: time to test heh [06:20] isaacs_home: _ry_: so, when do we get the full wonderbar nick? [06:20] polotek: yeah that's also a known issue [06:21] isaacs_home: ___ry___ [06:22] mscdex: polotek: ah ok, it just adds the explicit 'text' element as a child to the automatically added 'text' child [06:23] polotek: mscdex: I'm going to be adding a Node#type() method [06:24] _ry_: isaacs_home: hey [06:24] _ry_: heh [06:24] _ry_: isaacs_home: this urlDecode thing you did [06:24] _ry_: it's just cause it throws? [06:24] _ry_: isaacs_home: i think i'm going to do my own implementation in c [06:24] isaacs_home: well, it's because it throws any time there's invalid utf8 [06:24] isaacs_home: but doing it in c would be cool. [06:25] _ry_: basically cause i don't like allocating little buffers [06:25] isaacs_home: it'd be nice if there was a decodeURIComponent that returned a buffer rather than a string. [06:25] _ry_: why? [06:25] isaacs_home: but it would be possible to write a similar one that never uses a buffer. [06:26] isaacs_home: people want to get at the data when you have random bytes encoded in the query string [06:26] isaacs_home: javascript is kinda dumb about how it lets you decode that [06:26] _ry_: hm [06:26] _ry_: really? [06:26] _ry_: people want to encode raw binary in query strings? [06:26] polotek: _ry_: not me [06:27] isaacs_home: _ry_: i'm told that this is important to bittorrent [06:27] jedschmidt: isaacs_home: would like to ask you about some npm issues when you have a chance. [06:27] _ry_: ACTION squints [06:27] isaacs_home: crap, that idea made him lose an _ [06:27] polotek: lol [06:27] mjr_: not a lot of extra underscores to go around [06:28] polotek: so that's how you know ry is having a good day. Count the "_"s [06:28] isaacs_home: jedschmidt: fire away. [06:29] scudco has joined the channel [06:29] isaacs_home: _ry: at the very least, even if it doesn't interpret the bytes more forgivingly, it'd be good if it at least didn't throw, but maybe fell back to unescape or something. [06:29] jedschmidt: isaacs_home: http://gist.github.com/407064 [06:30] jedschmidt: isaacs_home: but no lib shows up in my .node_libraries dir. [06:30] jedschmidt: isaacs_home: so i can't "require" it... what am i doing wrong? [06:30] isaacs_home: jedschmidt: it's probably in /usr/local/node/lib [06:30] isaacs_home: jedschmidt: which is just as good [06:30] bradleymeck has joined the channel [06:31] isaacs_home: jedschmidt: so you should be able to require("cookie"), no? if that still don't work, check "npm config ls" and see what your "root" config is [06:31] polotek: isaacs_home: npm reads node/lib now? [06:31] ditesh|cassini has joined the channel [06:31] isaacs_home: polotek: no, node does [06:32] isaacs_home: polotek: if you install npm with sudo, then it acts like a multi-user package manager, and uses the global nodepath as its root [06:32] polotek: yeah I but the installed command checks in there for the full list of modules [06:32] polotek: ah [06:32] polotek: that makes sense [06:32] isaacs_home: polotek: it checks wherever it's configured to look, that's all [06:32] jedschmidt: isaacs_home: npm config root "/Users/jed/.node_libraries" [06:32] isaacs_home: polotek: you could set it to live wherever you want. [06:33] isaacs_home: jedschmidt: and there's no .node_libraries/cookie? [06:33] jedschmidt: isaacs_home: npm shows up in .node_libraries, but no cookie. [06:33] jedschmidt: isaacs_home: that's correct. only npm.js, npm, npm-0.1.11, npm-0.1.11.js [06:33] isaacs_home: jedschmidt: what's your package.json look like? [06:34] jedschmidt: isaacs_home: http://github.com/jed/cookie-node/blob/master/package.json [06:35] isaacs_home: jedschmidt: you gotta give it a "main" or a "lib" or something [06:35] isaacs_home: jedschmidt: you probably want to add this: "main" : "./index" [06:35] isaacs_home: jedschmidt: you could also do this, which would result in the same thing: "directories" : { "lib" : "." } [06:36] polotek: isaacs_home: it would be nice to have a wiki page or something that explains how npm interprets package.json [06:37] smtlaissezfaire: polotek: I echo that request. [06:37] isaacs_home: polotek: http://github.com/isaacs/npm/blob/master/doc/json.md#readme [06:38] jedschmidt: isaacs_home: thanks, that did the trick. [06:38] smtlaissezfaire: isaacs_home: I think for the next release of ndb I'm going to get an npm package out for it. [06:39] isaacs_home: smtlaissezfaire: nice [06:39] _ry: so if it doesn't encode utf8 [06:39] _ry: fall back on what was there? [06:39] isaacs_home: you mean, decode utf8? [06:39] smtlaissezfaire: isaccs_home: What's your impression on usage of npm vs other package managers for node? [06:39] polotek: isaacs_home: I never did get the docs to install, and thus never really looked at them :) [06:39] _ry: %f2%01 ? [06:39] mscdex: woot, after i add in a kludge to handle the 'text' element, xml2json works :D [06:39] _ry: isaacs_home: yes, decode [06:40] wilmoore has joined the channel [06:40] mscdex: no more xml for me hehe [06:40] isaacs_home: _ry: i guess the issue there is that encode(decode(notutf)) !== notutf [06:40] _ry: isaacs_home: is that what your current version does? [06:40] isaacs_home: _ry: no, it sort of just does the buffer-to-string thing, and still isn't perfect, but gives it a better try. [06:40] smtlaissezfaire: isaacs_home: I gave kiwi a shot, it wasn't very turn key and bombed on me a few times. I'm hoping for something better with npm. [06:40] bmeck has joined the channel [06:41] polotek: isaacs_home: nothing about the "main" or "lib" properties [06:41] _ry: isaacs_home: what do the tests show? [06:41] isaacs_home: smtlaissezfaire: i don't really have much of an opinion. kiwi seems alright. so does mode. [06:41] _ry: isaacs_home: for none utf8 stuff [06:41] polotek: smtlaissezfaire: agreed [06:41] isaacs_home: _ry: the tests show it throwing, or not throwing and doing the right thing [06:41] polotek: couldn't get kiwi to just install a module from the source checkout [06:42] isaacs_home: smtlaissezfaire: you will probably find that npm still has plenty of bombs. [06:42] _ry: ACTION shakes his head [06:42] _ry: i can't believe query strings are so hard [06:42] polotek: npm rocks if you don't want to care much about your package manager. no offense ;) [06:42] isaacs_home: polotek: that's kinda the idea. [06:42] polotek: as I told tjholowaychuk, it bombs sometimes on install after some update [06:43] chilts has joined the channel [06:43] jedschmidt: well, i just got cookie-node published on npm. [06:43] polotek: but once you get it to install, it just works for the most part [06:43] isaacs_home: _ry: or you could just leave decoding to the client, and just pass it along as-is [06:43] polotek: the most annoying thing is when people don't put package.json in their modules [06:43] isaacs_home: _ry: i mean, it's a largely unspecified spec. [06:43] isaacs_home: _ry: splitting on & would be nice, but the exact semantics of what foo=bar means are very organically evolved in different languages. [06:43] polotek: un*spec*ified *spec* [06:43] polotek: gotta love it [06:44] _ry: polotek: ? [06:44] _ry: oh [06:44] isaacs_home: polotek: yeah, exactly. [06:45] isaacs_home: the url rfc's are so far from any actual implementation, it's ridiculous [06:45] _ry: isaacs_home: is it the case that everyone, always wants to decode query strings? [06:45] _ry: because i could do it as it came out of the parser [06:46] _ry: before it went into js [06:46] polotek: _ry: you should always decode query strings [06:46] polotek: because you should always encode query strings [06:46] isaacs_home: _ry: i can't think of any situation in which you'd want the un-decoded % stuff. [06:46] _ry: :/ [06:46] polotek: but I wouldn't make it default [06:46] polotek: because lots of people don't encode them [06:46] isaacs_home: _ry: browsers won't even *let* you send utf chars in the url [06:46] isaacs_home: polotek: if you send %20, it's *going* to be decoded by any server you send it to. [06:47] _ry: i can think of a situation: a proxy which forwards a request [06:47] polotek: proxies always muddy the waters [06:47] polotek: cause you have to guess at how dumb they are going to be [06:47] pquerna: proxies generally do decode, and re-encode [06:48] pquerna: speaking from the apache httpd side, it keeps stores an never-decoded raw in the request_rec, and the decoded one. 98% of use cases want the decoded one. things like access logs being one good exception. [06:48] isaacs_home: _ry: you could solve that by giving them a reference to the undecoded string, and a hash of the decoded key-val query [06:48] _ry: nah, i'll leave req.url as it came in [06:49] polotek: I like isaacs_home's idea [06:49] polotek: go ahead and decode, but if you don't like how it turned out, do it yourself [06:49] SamuraiJack has joined the channel [06:49] isaacs_home: _ry: so req.query could be an object. split on &, then split on =, the key is param[0], and the val is the param.slice(1).join("=") [06:50] _ry: that stuff is fine to do in js [06:50] _ry: i just want to do the decode in c because it's easier to shuffle bytes around [06:50] isaacs_home: yeah, totally [06:50] _ry: not because i'm concerned about speed [06:51] isaacs_home: the only way to reliably shuffle bytes around in js is with a buffer. strings suck for that. we've learned this. we know this now. [06:51] _ry: yeah [06:53] isaacs_home: _ry: if you do it in C, you should still expose the function to the JS, so that there's a "decode this query string exactly like node decodes query strings" function. [06:54] isaacs_home: like, even if it's just something like: exports.decode = require("http").HTTPServer.prototype.querystringDecode [06:54] isaacs_home: er, incomingservermessage, rather. whatever. [06:54] _cheerios has joined the channel [06:56] rra has joined the channel [06:57] _ry: isaacs_home: yeah, that's what i'll do [06:57] _ry: just replacing your function [06:57] isaacs_home: sweet [06:58] phoenixsol has joined the channel [06:59] polotek: see you guys [06:59] polotek: _ry: thanks for the help [06:59] _ry: polotek: later [06:59] polotek has left the channel [07:00] qFox has joined the channel [07:01] bradleymeck has joined the channel [07:07] jedschmidt: isaacs_home: is there any way of tagging an existing version with "stable"? [07:07] bradleymeck has joined the channel [07:07] isaacs_home: jedschmidt: npm tag [07:07] isaacs_home: jedschmidt: npm tag cookie 1.0.0 stable [07:08] markwubben has joined the channel [07:08] jedschmidt: isaacs_home: but how do i them push that? [07:08] jedschmidt: using publish? [07:08] isaacs_home: jedschmidt: yeah [07:08] jedschmidt: isaacs_home: "Error: forbidden cannot modify existing version" [07:08] _ry: isaacs_home: also i want to update my packages but man npm-json doesn't show me how to make it use node-waf [07:08] _ry: isaacs_home: or how to set the main script [07:08] _ry: ACTION has to go [07:09] _ry: until tomorrow - [07:09] jedschmidt: see ya, _ry. [07:09] isaacs_home: oh, yeah, guess it doesn't have the script stuff in there [07:09] isaacs_home: g'nite [07:09] isaacs_home: jedschmidt: then you already published that version. [07:09] isaacs_home: jedschmidt: so just tag it. tag is a registry operation, not a local operation. [07:09] jedschmidt: isaacs_home: ah, okay. i was in git mode there. [07:10] jedschmidt: isaacs_home: sure enough, it's tagged. thanks for all your work on npm, isaacs_home. really looking forward to everyone getting into it. [07:11] isaacs_home: jedschmidt: thanks. if you feel like helping out, there are bugs. [07:12] jedschmidt: isaacs_home: jah, let's talk once i get the next v5 of (fab) pushed. [07:12] isaacs_home: jedschmidt: kewl. i'm gonna be unable to do much with it for the next few weeks. [07:13] jedschmidt: well, it seems like it's in pretty good shape... all the trouble i had was just my own errors. [07:16] smtlaissezfaire has joined the channel [07:17] charlesjolley has joined the channel [07:23] Yuffster_ has joined the channel [07:25] rektide: cant sleep, async callbacks gonna get me [07:25] keyvan has joined the channel [07:25] isaacs_home: rektide: you can simulate a sleep with setTimeout [07:26] tlrobinson_ has joined the channel [07:26] rektide: too much async work going on in the background [07:26] rektide: need to put the event loop to rest for a while [07:27] bradleymeck has joined the channel [07:32] jedschmidt: can't decide if rektide is talking about node or using it as some sort of life metaphor. [07:32] mjr_: I'm sure that's the one he's doing. [07:35] scudco has joined the channel [07:40] admc has joined the channel [07:41] keyvan has joined the channel [07:43] ditesh|cassini has joined the channel [07:45] siculars has joined the channel [07:47] TomY has joined the channel [07:48] bradleymeck has joined the channel [07:51] keyvan has joined the channel [07:53] Phazm has joined the channel [07:55] k3yvn has joined the channel [07:57] keyvan has joined the channel [08:00] nsm|away has joined the channel [08:00] derbumi has joined the channel [08:05] Tim_Smart has joined the channel [08:06] ac94 has joined the channel [08:07] jedschmidt has joined the channel [08:13] bmeck has joined the channel [08:16] tpryme has joined the channel [08:20] MattJ has joined the channel [08:21] margle has joined the channel [13:23] frigg: VERSION [13:23] nodelog has joined the channel [13:23] felixge_: mscdex: seems like the server got rebooted [13:23] Tim_Smart: ohai nodelog [13:23] mscdex: yey :D [13:23] felixge_: mscdex: need to add an upstart script for this some day [13:24] Tim_Smart: Argh, where is creationix [13:24] Tim_Smart: I need to beat him with a stick... gently [13:27] keeto has joined the channel [13:31] scudco has joined the channel [13:32] ncampbell has joined the channel [13:36] maushu: felixge_: Upstart, USE IT! [13:39] isaacsu has left the channel [13:40] FoxFurry has joined the channel [13:42] smtlaissezfaire has joined the channel [13:42] Tim_Smart: Can you write buffers in a http response? [13:43] felixge_: Tim_Smart: yeah [13:43] Tim_Smart: response.write(buffer); ? [13:47] jherdman has joined the channel [13:47] morganallen_ has joined the channel [13:49] ncampbell: Tim_Smart: you'd have to have a reader for the buffer and write the chunks as they came through [13:50] ncampbell: I don't believe the machinery exists yet to just pass a buffer in [13:50] sechrist: so no binary protocols in pure js yet? [13:50] ncampbell: Tim_Smart: see the 'pump' function in this example. http://wiki.github.com/ry/node/streams [13:50] kevwil has joined the channel [13:52] Tim_Smart: ncampbell: http://nodejs.org/api.html#stream-write-34 [13:53] sechrist: oh so we can, interesting! [13:53] ncampbell: Tim_Smart: ahh so it does :)( [13:53] sechrist: is "binary" an acceptable encoding for writable stream? [13:53] sechrist: but then we have to worry about packing and other crap depending on the protocol -- yey [13:55] airportyh has joined the channel [13:55] KungFuHamster: the google font api would be more impressive if there were more fonts, most of them didn't suck [13:55] KungFuHamster: +and [13:58] maushu: KungFuHamster: Stop reading hacker news and work. [13:59] mape_: KungFuHamster: copy paste squirrel fonts? :P [14:01] bmeck has joined the channel [14:02] nsm has joined the channel [14:03] margle: KungFuHamster: http://www.fontsquirrel.com/fonts/list/mostdownloaded [14:03] sechrist has joined the channel [14:03] bradleymeck has joined the channel [14:05] KungFuHamster: the google font api thing is a lot easier to use, no downloads, just a few lines of html [14:05] keeto has joined the channel [14:05] quirkey has joined the channel [14:06] KungFuHamster: I already have hundreds of fonts :) [14:06] margle: KungFuHamster: lol, ok. [14:06] ncampbell: KungFuHamster: there are font-kits on the site [14:09] mape_: Only thing I find strange is that they have no info on how to add fonts [14:10] smtlaissezfaire has joined the channel [14:10] pandark_: KungFuHamster, The thing is you downoad several small css files from an other site instead of writing them in your common stylesheet, right ? [14:10] gf3 has joined the channel [14:10] botanicus has joined the channel [14:11] KungFuHamster: it's just easier to use the google font api than code in all the backwards-compatible code myself [14:11] ithinkihaveacat has joined the channel [14:12] maushu: KungFuHamster: text-shadow is your friend. [14:12] Tim_Smart: Wow buffers are fast :o [14:12] pandark_: KungFuHamster, wher do you see any backwards-compatibility ? http://fonts.googleapis.com/css?family=Tangerine [14:14] KungFuHamster: http://code.google.com/apis/webfonts/faq.html [14:17] Tim_Smart: OK who wants to see the buffer vs string results for serving static content? [14:17] kriszyp has joined the channel [14:18] Yuffster has joined the channel [14:18] pjb3 has joined the channel [14:18] blowery: me me me! [14:19] maushu: him him him! [14:20] Tim_Smart: blowery: http://gist.github.com/407612) [14:20] Tim_Smart: Serving a roughly 30kb image [14:21] pandark_: KungFuHamster, well no answer there :) It's just supposed to be faster because 1) it's served by google 2) it's (according to google) going to be used by several websites. Apart from that, it's just what I said : splitting your css file, one for each font� [14:22] Tim_Smart: Buffers are almost 2x faster [14:23] maushu: Fontsquirrel doesn't seem to be free. ;_; [14:23] maushu: They lied! [14:23] bradleymeck has joined the channel [14:27] rnewson: Tim_Smart: I'm struggling to work purely with buffers doing http to fs and back again. are you having success? [14:28] Tim_Smart: fs to http is fine [14:28] Tim_Smart: not sure about http to buffer though [14:28] ncampbell: Tim_Smart: that's nice [14:28] ncampbell: :) [14:29] rnewson: Tim_Smart: yes, I have it pure buffer for GET but not PUT. :( [14:29] rnewson: actually, scratch that. I need resp.write(chunk, 'binary') for the GET too, otherwise the data is wrong. [14:29] rnewson: 0.1.95 [14:30] Tim_Smart: OK. I'm just writing everything as binary [14:31] rnewson: I didn't think binary was the same as the Buffer, just a form of encoding a string. [14:31] Tim_Smart: Let me gist the gist of what I am doing [14:31] rnewson: heh, thanks. [14:32] bradleymeck has joined the channel [14:35] Tim_Smart: rnewson: http://gist.github.com/407628i [14:36] rnewson: Ah, very cool. I was using writeable/readableStream directly. [14:36] rnewson: this holds up well for large files, though? [14:37] Tim_Smart: A lot better than strings would ever be [14:37] ncampbell: rnewson: i'd imagine better than reading the file into memory first [14:37] rnewson: but the buffer object is holding all the bytes of the file? [14:37] ceej has joined the channel [14:37] Tim_Smart: You could do it chunk per chunk if you want [14:37] rnewson: ok, an easier one. does this work if some_file.html is larger than available RAM? [14:37] rnewson: so .. no then? [14:38] ncampbell: hmmm, Tim_Smart do you have a test with a streaming file? [14:38] rnewson: I'll stick with the streaming stuff I have, I just wish each chunk could have been a buffer and not a string. [14:38] Tim_Smart: you would use fs.read instead of fs.readFile [14:38] rnewson: it seems most of the pieces are there but you can't quite do it yet. [14:38] pdelgallego has joined the channel [14:39] rnewson: Is there a difference between fs.read vs fs.createReadStream in performance terms? [14:40] Tim_Smart: Ah never noticed createReadStream [14:40] rnewson: heh, np, I think it's fairly new. [14:40] Tim_Smart: You could just create a pump [14:40] rnewson: that's what I am doing now except one side of the pump is not a buffer. [14:41] rnewson: I don't think it's possible, is my point, I was just checking if I was wrong. [14:41] ithinkihaveacat has joined the channel [14:41] mikeal has joined the channel [14:41] Tim_Smart: rnewson: Are you using setEncoding anywhere? [14:41] rnewson: you can't write a buffer to writeStream, the bytes never appear in the file, you have to set an encoding. [14:42] rnewson: yes. I *have* to add setEncoding('binary') on the http request or the chunk variable cannot be written to the writeStream [14:42] Tim_Smart: rnewson: http://nodejs.org/api.html#readable-stream-21 "The 'data' event emits either a Buffer (by default) or a string if setEncoding() was used." [14:42] rnewson: its silently not written. [14:42] rnewson: understood, yes. [14:43] bmeck has joined the channel [14:43] Tim_Smart: rnewson: So the write(buffer) isn't working as it should? http://nodejs.org/api.html#stream-write-34 [14:43] rnewson: appears not to. the file remains at zero bytes throughout [14:44] Tim_Smart: Ah ok. That is a bug then :p [14:44] rnewson: I deliberately upload an ISO, I know I pass the 670M or so through, I even calculate the md5 as it passes, but the file is empty. [14:45] Tim_Smart: File a issue report on the node project page if you haven't (or someone else hasn't) already [14:45] rnewson: righto. [14:45] Tim_Smart: Anyway, I need some sleep. [14:46] rnewson: We all need sleep, you just need it *now* ;) [14:46] Tim_Smart: :p [14:47] jedschmidt has joined the channel [14:47] bradleymeck has joined the channel [14:57] texodus has joined the channel [15:03] ssteinerX has left the channel [15:05] zomgbie has joined the channel [15:12] cloudhead has joined the channel [15:13] maushu has joined the channel [15:13] maushu: Ah crap. [15:13] maushu: My faith on my startup project is wavering again. [15:13] maushu: VODKA TIEM! [15:14] steez has joined the channel [15:14] ncampbell: maushu: lol [15:14] JimBastard has joined the channel [15:16] tmpvar has joined the channel [15:17] sechrist: what's a solution for code that used process.mixin? [15:18] mape_: JimBastard: wtf? [15:18] JimBastard: ? [15:18] JimBastard: what [15:18] mape_: Why are you the looser in this race? http://ajaxian.com/archives/mock-data-randomizer [15:18] JimBastard: did i get drunk last night and spam the channel [15:19] mape_: What did you do wrong? [15:19] mape_: This doesn't seem as potent? [15:20] JimBastard: ? [15:20] mape_: That is why I as you [15:20] mape_: *ask [15:20] jan____: where's the ryah / lennon tweet again? [15:21] JimBastard: yeah mape_ , not that im bias or anything [15:21] JimBastard: but my lib is way better [15:21] JimBastard: it has more data [15:21] JimBastard: and way more variations [15:21] JimBastard: i tried to comment on that article but it required registration [15:21] jan____: JimBastard: you know that, who tweeted that pic? [15:22] mape_: JimBastard: well tell them [15:22] JimBastard: i tried to watch the project.....and its google code [15:22] JimBastard: sup jan____ [15:22] sechrist: was process.mixin renamed or what? [15:22] JimBastard: sechrist: its gone [15:22] mape_: removed [15:22] jan____: I need the ryah/lennon tweet, pls help :) [15:22] JimBastard: jan____: its on the mailing list, intro thread [15:22] sechrist: JimBastard: So, I have to write something, that will likely be less efficient, to combine objects? [15:22] JimBastard: yeah sechrist [15:22] JimBastard: proto [15:23] JimBastard: one sec [15:23] JimBastard: http://github.com/creationix/proto [15:23] sechrist: woo [15:23] sechrist: thank you JimBastard [15:24] jan____: please to be helpin' me, this is of utmost importance :) [15:24] sechrist: do the needful [15:25] sechrist: so I've been doing git clones for all of the modules i've been using -- are any of the module managers any good? [15:25] JimBastard: jan____: i told you were to go [15:25] JimBastard: sechrist: npm [15:25] jan____: JimBastard: I'm blind, thanks [15:26] tmpvar: lol [15:26] tmpvar: JimBastard, what up [15:26] JimBastard: sup [15:29] rramsden_ has joined the channel [15:31] ssteinerX has joined the channel [15:32] JimBastard: any idea why changes arent showing up in my fork queue [15:32] JimBastard: worked for one set of commits, then didnt seem to pick up some other laters [15:33] jan____: JimBastard: damnit, can't find it :( do you remember the twitter nick? [15:33] JimBastard: you are should a noob jan____ [15:34] JimBastard: Here is a picture of me in Germany from halloween http://farm3.static.flickr.com/2013/1815263310_e5d87b7034_b.jpg [15:34] jan____: that's not the one [15:34] JimBastard: lol [15:34] JimBastard: i dunno then [15:34] jan____: hehe [15:34] jan____: the one of ryan that is like this http://untossedcoin.files.wordpress.com/2008/05/john_lennon_2.jpg [15:34] jan____: ANYONE?! [15:34] JimBastard: jan____: [15:34] JimBastard: google "ryan dahl" [15:34] JimBastard: first result in google iamge [15:35] tmpvar: lmfao [15:35] tmpvar: lmgtfy.com [15:35] JimBastard: http://jsconf.eu/2009/assets_c/RDahl_sw.jpg [15:35] ncampbell: sometimes google images scares me [15:36] brianmario has joined the channel [15:36] ncampbell: for this reason: http://media.photobucket.com/image/ryan%20dahl/crowmonty/Poorlittlepuppies.jpg [15:36] JimBastard: inappropiate [15:37] ncampbell: I put a semi warning [15:37] steadicat has joined the channel [15:37] tmpvar: ACTION spanks nc* with a noob stick [15:37] ncb000gt: o.0 [15:37] aho: ACTION grabs a bottle of mind bleach [15:38] ncb000gt: ahh my job is done [15:38] ncb000gt: >=D [15:38] jan____: JimBastard: that is not the one [15:38] jan____: I can google [15:39] JimBastard: well like wtf lol [15:39] sechrist: poor dogs got hasslehof'd [15:39] ncb000gt: jan____: I warn you, be careful with google images [15:39] jan____: haha [15:39] sechrist: I hate my mac [15:39] ncb000gt: sechrist: i hate your mac too [15:40] sechrist: I swear i've had nothing but dns problems since going to SL [15:40] sechrist_ has joined the channel [15:40] sechrist_: yeah [15:41] jan____: http://www.flickr.com/photos/jsconf/4587440314/ that's the one jesus JimBastard you suck :D [15:41] sechrist_: is that one of those expensive shirts that come with the holes [15:41] sechrist_: or is it just his style [15:41] JimBastard: jan____: i got some naked pictures of your mom if that helps [15:41] ncb000gt: lol [15:42] JimBastard: (my mom is dead jimbastard) [15:42] JimBastard: OHH I KNOW [15:42] JimBastard: which reminds me, i also stole your shovel [15:42] ncb000gt: not the shovel [15:42] ncb000gt: anything but the shovel [15:42] maushu: Mommy...? *sniff* ;_; [15:43] JimBastard: GET BACK IN THE BATHTUB maushu AND WASH YOUR ASS [15:43] maushu: Bawwwwwwwwww [15:43] JimBastard: naah im just kidding you guys are alright [15:43] JimBastard: ;-) [15:43] JimBastard: i was at this dev shop last night getting some design work done for nodejitsu [15:44] JimBastard: and one of the junior devs i know overheard us talking and was like, doesnt node require you use ruby? [15:44] jan____: JimBastard: hah [15:44] JimBastard: this was proceeded by a 15 minute rant by me [15:44] sechrist: junior dev [15:44] sechrist: rofl [15:44] JimBastard: in all fairness the guy is like 17 but still [15:45] maushu: KILL HIM WITH FIRE. [15:45] sechrist: I was 17 a few weeks ago [15:45] JimBastard: i still had to assist [15:45] sechrist: but still [15:45] sechrist: obviously he doesn't read hacker news [15:45] sechrist: thus he should die [15:45] maushu: LET THE HOLY FIRE CLEANSE HIM OF HIS NODE SINS. [15:46] avidal: man, i need to change my digest settings for the mailing list [15:46] avidal: made the mistake of instant notification [15:47] JimBastard: if he was reading hacker news, i wouldnt have had to tell him ive been killing it on github >.< [15:47] ncb000gt: JimBastard: what's a git hub? [15:47] ncb000gt: /duck [15:48] JimBastard: unsuccessful troll is unsuccessful [15:48] ncb000gt: agreed [15:48] JimBastard: if you really want to step up your game [15:48] JimBastard: you gotta go into #RoR [15:48] JimBastard: and start talking about how bad RoR because it cant talk to mysql [15:48] ncb000gt: meh, you fire a few shots and hope one lands [15:48] ncb000gt: lol [15:48] JimBastard: and that you cant build webapps without mysql [15:49] JimBastard: then when someone says your wrong, deny it [15:49] JimBastard: until they provide at least 2 links [15:49] JimBastard: then say you are using an older version that can only talk to text files [15:49] JimBastard: then deny there are new versions until they provide at least 2 links [15:49] texodus: you're clearly speaking from personal experience [15:49] ncb000gt: lol [15:49] JimBastard: follow in this pattern for 15 minutes or so before you "give up" and declare JAVA is better [15:50] JimBastard: then argue about JAVA for 5 minutes before /quit [15:50] tmpvar: java is better [15:50] JimBastard: see [15:50] texodus: quite [15:50] JimBastard: learning already [15:50] tmpvar: <3 me some good old java [15:50] colincampbell has joined the channel [15:50] tmpvar: <3 me some 30 minute deploy cycles, 300mb war's etc [15:50] JimBastard: did you try winrar? [15:50] JimBastard: i hear that helps with deploys [15:50] JimBastard: makes them uber fast [15:50] sechrist: hmm [15:51] tmpvar: hah, no [15:51] chakrit: ACTION watching java*couch*android on google I/O [15:51] texodus: excuse me for a second, I have to go change one method name and 300 lines of spring config xml to support it [15:51] JimBastard: ohh wait, WAR [15:51] sechrist: node -- a trendy new technology with a community that hates ruby [15:51] sechrist: I like you guys [15:51] chakrit: s/couch/cough [15:51] JimBastard: i like ruby [15:51] colincampbell has left the channel [15:51] sechrist: no you don't [15:51] nefD: i make the poop on ruby! [15:51] JimBastard: its a neat language [15:51] JimBastard: i fucking hait the rails community [15:51] JimBastard: hate [15:51] sechrist: yes but rails has just become a retarded cliche [15:51] JimBastard: yeah [15:52] JimBastard: im thinking node will not succumb to that until there are really good easy to use flow control libraries [15:52] JimBastard: until then, the complete retards cant handle async [15:52] ncb000gt: lets not make those then [15:52] JimBastard: just the partial ones like me [15:52] rra has joined the channel [15:52] sechrist: well, building dom objects dynamically is something needed [15:52] JimBastard: mmmmm [15:52] sechrist: other than that, most of rails is useless in node [15:53] sechrist: I need to 1. talk to mongo (done) 2. do image manipulation (done) 3. spit out long polling ajax (done) [15:53] sechrist: :D [15:53] JimBastard: so inflectors are passing all tests now for singularize and plural [15:53] JimBastard: http://github.com/Marak/format.js/blob/master/lib/inflector.js [15:53] phiggins has joined the channel [15:53] chakrit: v8 is going into android!! ... does that means node.js on android? [15:53] tlrobinson_ has joined the channel [15:54] scudco has joined the channel [15:54] JimBastard: http://github.com/Marak/format.js/blob/master/lib/inflections.js [15:54] ncb000gt: chakrit: sexy time [15:54] ncb000gt: :) [15:54] sechrist: is there a node-gtk yet? :D [15:54] JimBastard: http://github.com/Marak/format.js/blob/master/tests/inflector.js [15:54] ncb000gt: sechrist: there is node-gui and i've forked it to node-gtk [15:55] ncb000gt: and am going to be working on it [15:55] sechrist: no way [15:55] ncb000gt: aye [15:55] sechrist: ncb000gt: hi5 [15:55] sechrist: when I was a lot noobier I used to use the php-gtk library [15:55] sechrist: that thing is so broken [15:56] ncb000gt: hah [15:56] sechrist: and it was introduced before php even had a (crappy) gc [15:56] ncb000gt: time for food, i'll be back to fail at trolling later [15:56] JimBastard: if anyone wants to halp, exports.camelize = function() {}; exports.classify = function() {}; exports.constantize = function() {}; exports.dasherize = function() {}; exports.demodulize = function() {}; exports.foreign_key = function() {}; exports.humanize = function() {}; exports.ordinalize = function() {}; exports.tableize = function() {}; exports.titleize = function() {}; exports.underscore = function() { [15:56] JimBastard: :-p [15:56] sechrist: camelize eh? [15:56] JimBastard: the latest and greatest project [15:56] JimBastard: http://github.com/Marak/format.js [15:57] JimBastard: ive decided to put an end to all formatting issues [15:57] sechrist: but formatting should be a problem [15:57] JimBastard: (warning repo shouldnt even be public yet) [15:57] gwoo: JimBastard: awesome [15:57] JimBastard: sechrist: here is new Date().getTime(), please tell me what day it will be 5 days from now [15:58] mjr_ has joined the channel [15:58] sechrist: add 432000 to the timestamp first [15:58] sechrist: np [15:58] JimBastard: ? [15:58] JimBastard: i wanted a day [15:59] JimBastard: like Monday or Tuesday [15:59] sechrist: why would you want something so archaic [15:59] JimBastard: k [15:59] JimBastard: back to work [16:01] chakrit_ has joined the channel [16:04] linuxsable has joined the channel [16:04] bpot has joined the channel [16:08] rramsden_: I'm having some difficulty understanding continuables and callbacks for creating asynchronous methods in node.js, does anyone know where i can find some information on the two methods maybe compares and contrasts both styles? [16:12] JimBastard: rramsden_: have you checked out howtonode.org [16:12] felixge has joined the channel [16:12] felixge has joined the channel [16:14] bradleymeck: http://howtonode.org/do-it-fast <- fair explanation [16:16] rramsden_: JimBastard, bradleymeck: thank you, i'll check it out [16:18] bmeck has joined the channel [16:18] admc has joined the channel [16:19] voxpelli-laptop has joined the channel [16:25] sechrist: JimBastard: So, anywhere that process.mixin was used I could now put GLOBAL.mixin? [16:25] sechrist: with proto require'd in? [16:25] JimBastard: sup [16:26] JimBastard: now its Object.mixin [16:26] JimBastard: Obj1.mixin(Obj2) [16:26] JimBastard: instead of [16:26] JimBastard: process.mixin(ob1,obj2) [16:26] sechrist: process.mixin(exports,YAML); -> exports.mixin(YAML); [16:26] sechrist: ah ok [16:26] JimBastard: yeah [16:26] sechrist: that 's a lot more logical imo [16:26] JimBastard: someone should really blog about this [16:27] sechrist: well it's used so much in node-s3 [16:27] sechrist: and probably a lot of the other modules on the list [16:27] sechrist: trying to get them to work with 0.1.95 is probably not trivial for people like me that are just coming into node.js [16:27] SamuraiJack has joined the channel [16:29] _ry: hello world [16:29] sechrist: allo [16:31] mape_: JimBastard: so where did you go wrong? [16:32] JimBastard: mape_: with what? [16:32] mape_: the random data thing! [16:35] pandark_ has joined the channel [16:35] sechrist: bleh, the node-s3 demo app won't even run now after I replaced everything with Object.mixin [16:35] sechrist: hmm [16:35] sechrist: well it runs but nothing shows up in a browser -- connect gets reset [16:37] tpryme has joined the channel [16:38] tpryme has joined the channel [16:41] SamuraiJack has joined the channel [16:43] CIA-74: node: 03isaacs 07master * r5b740c4 10/ lib/fs.js : Fix a leaking global - http://bit.ly/aWxK7p [16:43] CIA-74: node: 03Ryan Dahl 07master * r1440363 10/ src/node_buffer.h : Make buffer's c++ constructor public - http://bit.ly/cyDE2E [16:44] stevendavie has joined the channel [16:44] felixge has joined the channel [16:44] felixge has joined the channel [16:44] _ry: force push sorry [16:44] CIA-74: node: 03Ryan Dahl 07master * r44ad6a7 10/ src/node_buffer.h : Make buffer's c++ constructor public - http://bit.ly/9iZk1o [16:45] rramsden_: bradleymeck: Still a bit confused, this article explains how to work with existing async functions. I just want to create my own asynchronous function, would I need to look into process.nextTick? [16:45] felixge: just released a little mocking / behavior verification library called gently: http://github.com/felixge/node-gently [16:45] felixge: for those mockist among you :) [16:45] sudoer has joined the channel [16:45] maushu: ACTION dances naked. Gently. [16:45] tmpvar: eh? [16:45] sechrist: modules for everything [16:45] _ry: i want to release 0.1.96 tonight [16:45] felixge: maushu: let me in on your stash ;) [16:45] _ry: felixge: would be cool to get that fs.read patch [16:45] felixge: _ry: you need the fs.read() ? [16:46] maushu: Ack! The bot is online again! [16:46] maushu: NOTHING HAPPENED. [16:46] felixge: _ry: ok, I figured as much :) [16:46] sechrist: _ry how do you have so much time to work on node? is it sponsored? [16:46] _ry: sechrist: it's sponsored [16:46] micheil: felixge: sorta but not really what I suggested last night? [16:46] sechrist: incredible [16:46] maushu: ...this is the first time I've heard it. [16:46] felixge: micheil: I don't know what you were suggesting last night in detail [16:46] richcollins has joined the channel [16:46] felixge: micheil: I just knew what I needed :) [16:46] micheil: felixge: fair fair [16:47] micheil: it still looks cool. [16:47] felixge: micheil: what's missing for you? [16:47] micheil: still checkin' the examples [16:47] andrewhampton has joined the channel [16:47] andrewhampton has left the channel [16:47] richcollins: dj isn't really working for me. It doesn't reload on each request and sometimes it doesn't reload at all. Is there any way to invalidate the modules cache? [16:47] andrewhampton has joined the channel [16:47] _ry: sechrist: node is the next php. it's not that incredible. [16:47] _ry: ;0 [16:48] micheil: _ry: node better not be the next php ;P [16:48] creationix has joined the channel [16:48] _ry: in that 90% of websites will be writte on it in approximately 18 months [16:48] micheil: (it the sense of massively bloated code base, and terrible code that's written by users) [16:49] phiggins has joined the channel [16:49] felixge: micheil: I think node will see people writing terrible code in it, it's actually pretty easy :) [16:49] micheil: true, but there's a threshold really [16:50] sechrist: _ry: that's an optimistic approach but yes I sure hope so [16:50] sechrist: asynchronous awareness [16:50] richcollins: ... [16:51] maushu: 5 years later. [16:51] micheil: felixge: basically the idea is something similar, although, you actually attach listeners to events, so you can check that the args back are equal to a predefined set of assert tests [16:51] maushu: "Node.js is bloated! Don't use it! Code looks like mutant spaghetti!" [16:51] sechrist: PHP 7 beats Node.js 0.1.999999999999999973 in performance [16:51] bmizerany has joined the channel [16:51] felixge: micheil: gently.expect(obj, 'addListener', function() {...}); [16:52] _ry: sechrist: :) [16:52] micheil: yeah, but that creates an addListener member on the obj, not a real event [16:52] _ry: aim high - hit somewhere in the middle [16:52] maushu: "Node.js decides to sell it's soul and changed name to Node.js.NET" [16:52] felixge: micheil: you mean you want to fire an event and see how the object reacts? [16:52] richcollins: I'd by happy with a simple explanation of how require works, so I can implement something similar that doesn't cache in development [16:52] micheil: felixge: yes [16:53] felixge: micheil: well, you get your reference to the listener as I showed, and then you just fire it [16:53] kriszyp: does anybody know the url to look at packages in nvm? [16:53] micheil: felixge: for instance, testing my websocket library, I need to use net.Client to fire specific data at it, and I know it should react and emit certain events through that [16:53] creationix: kriszyp: nvm or npm? [16:53] felixge: micheil: should all be doable with gently [16:53] kriszyp: npm [16:53] kriszyp: sorry [16:53] micheil: felixge: hmm.. I'll have to try it out, consider me a skeptic [16:54] creationix: kriszyp: http://registry.npmjs.org/ [16:54] micheil: felixge: does that have a package.json & is it on npm? [16:54] creationix: is that what you mean? [16:54] richcollins: How about at least a "go fuck yourself" so I know that my messages are reaching the channel :-) [16:54] micheil: richcollins: settle down mate. seriously. [16:54] felixge: micheil: no, but let me publish it [16:54] richcollins: heh sorry don't want to break flow [16:55] micheil: richcollins: first of all, what is this dj you speak of? [16:55] richcollins: just wondering how I can reload modules on each request [16:55] richcollins: http://github.com/lrbabe/node-DJs [16:55] micheil: you can't, afaik. [16:55] richcollins: It monitors files and reloads them [16:55] kriszyp: nodules does auto-reloading [16:55] felixge: micheil: should be published [16:55] scudco has joined the channel [16:55] richcollins: kriszyp: thx I'll have a look [16:55] kriszyp: with dep-tracking, I don't think DJ is very smart about reloading [16:55] samsonjs has joined the channel [16:56] micheil: richcollins: try nodules, or try contacting the author [16:56] felixge: micheil: 'npm install gently@0.1.0' [16:56] micheil: felixge: nice! [16:56] richcollins: kriszyp: I just want require to do an eval + whatever else is required to expose the symbols [16:56] micheil: felixge: I'm making having things with a package.json and module hosting a bit of a req. before promoting them [16:56] felixge: micheil: :) [16:56] felixge: micheil: cool [16:57] kriszyp: does anybody know if npm still requires a "engines" property in package.json? [16:57] felixge: kriszyp: I don't think it's required [16:58] richcollins: kriszyp: Looks like nodes does way more than I need. I just want to avoid doing a ctl-c each time I make a change [16:58] wilmoore has joined the channel [16:58] richcollins: I was just going to monkey patch require [16:59] deanlandolt: richcollins: that's probably not so wise...i hear thar be dragons [16:59] richcollins: deanlandolt: This is development [17:00] richcollins: what is the worst that could happen [17:00] richcollins: as long as I consider this while writing my code its worth the tradeoff [17:00] richcollins: ctl-c is a serious drag on development [17:01] micheil: _ry: now it just needs to have map/reduce :P [17:01] richcollins: Something that exited the process and restarted it would be fine as well [17:01] tmpvar: you think control-c is bad? try using java without hot-deploy :P [17:01] micheil: richcollins: it's not that much of a drag, besides, nodules is awesome. [17:01] richcollins: micheil: seems overly complicated for my needs [17:02] micheil: richcollins: you could also do node file && clear [17:02] micheil: :D [17:02] richcollins: micheil: Hrm what does that do? [17:02] micheil: but no, something like Shotgun (ruby) for node may be good, but you'd have to watch it. [17:02] micheil: richcollins: clears the output log when you close node? [17:03] richcollins: Something like Shotgun would be great [17:03] richcollins: node starts pretty quickly [17:03] micheil: _ry: next major improvement for node: non-blocking processes :D (you know, like it almost daemonizes, but doesn't and it just *works* :P ) [17:04] richcollins: micheil: Is there a way to run a system call that doesn't wait for the result [17:04] micheil: richcollins: that's the point, if you've used shotgun, you'll know that it takes a while to start, and even then, it won't reload all your code. [17:04] richcollins: I could just run a command on exit that restarts the process [17:04] jedschmidt has joined the channel [17:04] micheil: richcollins: not sure, I haven't needed to yet [17:04] richcollins: guessing that there isn't ow that would be the preferred solution [17:05] jedschmidt_ has joined the channel [17:06] micheil: richcollins: you can do one of three things, really: use something like nodules, use ctrl+c, or build it yourself and then share it [17:07] N` has joined the channel [17:07] richcollins: micheil: I'm fine with the third option as long as the solution is simple [17:07] richcollins: micheil: I've heard that fork has lots of gotchas, but I don't know what they are, personally [17:07] micheil: each to your own, I prefer the second ;P [17:08] micheil: all I can say is that from what I've heard, hot-code loading is difficult unless you know all the gotchas [17:08] richcollins: micheil: Right, that is why the goal isn't to hot code load [17:09] richcollins: but to just emulate clt-C [17:09] sechrist: var mp = multipart.parse(req),params = url.parse(req.url, true).query,name; [17:09] richcollins: but automate the process [17:09] micheil: richcollins: man.. that almost screams developer laziness ;P [17:09] sechrist: that line is in node-s3's demmo app, but it seems to be broken [17:09] richcollins: micheil: The best developers are lazy :-) [17:09] richcollins: that is the point of software [17:09] richcollins: avoid unnecessary manual labor [17:09] sechrist: facebook developers are lazy? [17:09] sechrist: haha [17:09] deanlandolt: richcollins: just create simple daemon folder listener that kills and kicks off node...that should be like, maybe 20 lines of code? [17:10] micheil: sechrist: yeah, cos' they pretty much forgot how to delete accounts. [17:10] deanlandolt: micheil: heh! [17:10] richcollins: deanlandolt: sounds good. It would just watch for file changes and then restart the process? [17:10] sechrist: that's a management decsion -- says nothing about the skill of their engineers [17:10] deanlandolt: richcollins: sure...you can yank the code right out of nodules [17:10] creationix: yeah, I've been playing around with something that starts apps in subprocesses, it's not too hard, the tricky part is if you want the master process accepting the http requests [17:10] richcollins: micheil: Laziness is separate from lack of discipline [17:10] JimBastard: whats shotgun [17:11] creationix: because then it has to proxy or hand them off to the children [17:11] richcollins: ctl-c should be avoided if possible [17:11] richcollins: its just busy work, its not helping me write better code [17:11] deanlandolt: neither's chitchatting in irc...but we're all doing that :) [17:11] micheil: JimBastard: a ruby library that starts up a server that hot-loads code [17:11] richcollins: deanlandolt: Only because no one would help me if I didn't entertain them a bit ;-) [17:11] JimBastard: ahh i see we have a new person or two today [17:11] JimBastard: must be a busy day in the blogosphere [17:12] indiefan has joined the channel [17:12] JimBastard: you can always use the repl [17:12] richcollins: btw Steve Dekorte and I just published the project that we're working on in node.js [17:12] richcollins: http://github.com/stevedekorte/VertexJs [17:12] richcollins: a port of http://github.com/stevedekorte/vertexdb2 [17:12] bmeck has joined the channel [17:13] richcollins: but swapping out Lua with Javascript [17:13] micheil: ah... vertex, is this the one which did Math stuff? [17:13] richcollins: No it is a graph database based on paths [17:13] richcollins: the url resource maps directly to a node in the database [17:14] deanlandolt: richcollins: that's....AWESOME [17:14] richcollins: I'm sure it does plenty of "math stuff" but that isn't its point :-) [17:14] richcollins: deanlandolt: thanks :-) [17:14] rictic has joined the channel [17:14] richcollins: although it was Steve's idea so I won't take credit for it [17:14] richcollins: Steve is the creator of Io, he does good work [17:15] deanlandolt: what's the license? [17:15] richcollins: not sure we've added on yet but it will be whatever Io is [17:15] deanlandolt: i've been meaning to screw around with neo4j but it's AGPL so pretty much worthless to me [17:15] richcollins: MIT I think [17:15] sechrist: can somebody explain this line? var mp = multipart.parse(req),params = url.parse(req.url, true).query,name; [17:15] richcollins: deanlandolt: We will support posting of javascript to traverse the graph [17:16] deanlandolt: it's setting multiple vars (the last two to undefined) [17:16] sechrist: so name is just declared? [17:16] sechrist: okay [17:16] richcollins: deanlandolt: Neo is interesting and probably faster for some things but we didn't want to develop in Java [17:18] deanlandolt: heh...yeah, you could use rhino to bridge to it [17:18] richcollins: deanlandolt: Another interesting property of Vertex, is that you can use it like a filesystem [17:18] JimBastard: so the new hotness is graph based databases lol [17:18] deanlandolt: i noticed...that's nice [17:18] deanlandolt: JimBastard: well, if you're working with graph data it's pretty hawt [17:18] richcollins: The original version supports Fuse [17:18] JimBastard: yeah i havent even installed R yet [17:19] deanlandolt: JimBastard: heh...umm...that's not what we mean by graph [17:19] JimBastard: >., [17:19] deanlandolt: think social graph, or DAG (directed acyclic graph) [17:19] mertimor has joined the channel [17:19] tmpvar: dag's are fun [17:19] richcollins: deanlandolt: Steve observed that most websites are graphs, especially the navigation [17:19] deanlandolt: a DAG is like a big tree...a lot of data's tree-based [17:19] JimBastard: http://en.wikipedia.org/wiki/Graph_database [17:19] deanlandolt: the web is a graph [17:19] richcollins: so we're working on a framework that uses the graph structure to automatically render the user interface [17:20] JimBastard: i see now [17:20] CIA-74: node: 03Ryan Dahl 07master * r022c083 10/ lib/sys.js : Deprecate sys.p() - http://bit.ly/9JPuAO [17:20] CIA-74: node: 03rentzsch 07master * r36a45c4 10/ (lib/path.js test/simple/test-path.js): [17:20] CIA-74: node: FIX path.dirname('/tmp') => '/'. [17:20] CIA-74: node: Previously path.dirname('/tmp') incorrectly returned '.'. [17:20] CIA-74: node: Unfortunately module.js incorrectly thinks dirname('/a/b/') should [17:20] CIA-74: node: yield '/a/b', so I can't strip trailing slashes yet. Once module.js [17:20] CIA-74: node: is fixed, then the commented-out code should be activated and a test [17:20] CIA-74: node: written for it. - http://bit.ly/d86K0V [17:20] richcollins: For instance, take his blog [17:20] richcollins: http://dekorte.com/blog/blog.cgi [17:20] richcollins: You can represent every element on that page as a node in the graph [17:20] richcollins: and then tell the database to render the website [17:21] richcollins: So creating new sites is as easy as adding the data to the db and then configuring the views [17:21] richcollins: no code required [17:21] deanlandolt: yeah, graph dbs solve that kind of problem elegantly [17:21] micheil: richcollins: I'll let you keep it, I like writing code personally. [17:22] deanlandolt: but kinda create others, or so i imagine...you can traverse your graph but you lose the ability to do any kind of dimensional query [17:22] richcollins: micheil: It gives you the option of working on things that interest you rather than doing things that should be automated ;-) [17:22] micheil: richcollins: you missed my point, I like working with _all_ code ;P [17:22] richcollins: deanlandolt: What is a dimensional quire? [17:23] richcollins: micheil: Did you write your own assemlber? [17:23] richcollins: Or do you rely on othe rpeople who solved that problem for you [17:23] deanlandolt: foo=bar&baz>1 [17:23] micheil: richcollins: oh, naturally, isn't that what everyone does? [17:23] felixge: _ry: http://github.com/ry/node/commit/022c0838480ddec334e85dd8a8ca7d376eb26d95 !?!?!?!? [17:23] felixge: _ry: that's just mean [17:23] _ry: sys.p ? [17:23] felixge: _ry: yeah [17:23] felixge: _ry: I use that every day [17:23] _ry: sorry [17:24] felixge: _ry: why do you want to get rid of it? [17:24] richcollins: micheil: Did you write the irc client that you're using [17:24] _ry: unnecessary [17:24] _ry: just use sys.inspect [17:24] richcollins: deanlandolt: Why can't you do that for vertices? [17:24] micheil: richcollins: well, of course I would've it's the in thing, isn't it? [17:25] micheil: richcollins: I'm just saying I disagree with my database handling my views. [17:25] felixge: _ry: it was a nice alias :( [17:25] sechrist: code stops executing on this line for me -- var params = url.parse(req.url, true); req.url is /bucket?b=test [17:25] sechrist: no idea what is wrong [17:25] richcollins: micheil: It isn't a panacea but it lets you create things really quickly [17:25] sechrist: I have sys.puts before and after that line -- the second doesn't execute [17:26] richcollins: micheil: It will support using your own views as well [17:26] richcollins: But that isn't the default [17:26] micheil: richcollins: it might, but as far as I'm concerned, my database will always only be for data. [17:26] richcollins: micheil: Code is data [17:26] _ry: sechrist: use sys.error(), it's synchronous [17:26] micheil: richcollins: not at all. [17:26] deanlandolt: richcollins: perhaps you can...but don't you have to know that stuff up front? i thought it was a difficult problem but again, haven't played around too much w/ graph dbs yet [17:27] deanlandolt: micheil: it is if you like eval :) [17:27] inimino: or stored procedures [17:27] andrewhampton has left the channel [17:27] richcollins: micheil: Does your code come out of the ether or is it kept in some sort of storage media? [17:28] micheil: richcollins: I'm not in favour at all of databases understanding my data, that's for my application to do; it's great though if the database can follow relationships and such like that too. [17:28] stevendavie has joined the channel [17:28] micheil: richcollins: and yes, my code does come out of the ether. [17:28] richcollins: micheil: The application still interprets the data, but the data is organized in a predictable format [17:28] deanlandolt: micheil: i'm with you...that's why js data stores are so interesting though -- you write the logic once and have it work at your db layer or in your client [17:29] richcollins: So the application can easily display it [17:29] micheil: I've got a very good keyboard that actually writes code straight to the ether, then I've mod'ed node to handle loading modules from the ether as well — works a charm [17:29] richcollins: It is taking the Rails concept of convention to the next level [17:29] richcollins: It also lets you easily port to other clients [17:29] micheil: yeah, and as far as I'm concerned rails takes it far enough; this is the same reason I don't like couchdb [17:30] richcollins: you just change the view code to interpret the data for the constraints of the new environment [17:30] creationix: What's this I hear about sys.p being removed? I guess that's what I get for using undocumented APIs [17:30] micheil: yeah, alright, map/reduce on the server is great, but I want those methods I'm doing to come from my application code, so that if anything ever happens to my data, I don't loose my application [17:31] micheil: richcollins: as far as I can see, changing stuff in the database just for a different environment is painful [17:31] richcollins: deanlandolt: I'm glad you like Vertex, we would love to have you contribute [17:31] richcollins: or anyone else here for that matter [17:31] creationix: More and more, I'm starting to realize that node is not meant to be used by itself to make user facing apps, it's only for framework developers [17:31] micheil: especially when I can use riak or mongo and access my data in X number of different languages [17:31] deanlandolt: richcollins: i've got a full plate right now but i'll definitely take it for a spin -- i've got some data that could really use some graphdb love [17:32] richcollins: micheil: That is the point, you wouldn't change the db for different environments [17:32] micheil: richcollins: uh, I don't. [17:32] richcollins: they would know how to display the data based on conventions [17:32] Ori_P has joined the channel [17:32] micheil: riak and mongo work on js, ruby, c++, c, python, php, etc. [17:32] richcollins: deanlandolt: OK we just ported it yesterday so it needs a lot of polish [17:32] technoweenie: oh a new graph db?? [17:32] micheil: and the ORM's are also basically the same [17:32] richcollins: hey technoweenie :-) [17:32] technoweenie: hey rich [17:33] richcollins: technoweenie: http://github.com/stevedekorte/VertexJs [17:33] richcollins: Also see http://github.com/stevedekorte/vertexdb2 and http://github.com/stevedekorte/vertexdb [17:33] technoweenie: cooool, saving me from neo4j [17:33] technoweenie: well i dont have any real reason for a graph db yet but i wanted to play with one [17:34] richcollins: technoweenie: It isn't as far along as neo4j, but we do use it for http://stylous.com/ [17:34] micheil: technoweenie: btw, https://gist.github.com/ef3cbce3363fb9780961 [17:34] richcollins: and http://shop.stylous.com/ [17:35] micheil: night chaps' [17:35] micheil: 335am. [17:36] richcollins: micheil: night [17:39] mjijackson has joined the channel [17:39] richcollins: deanlandolt: You suggested listening for folder changes. Is there a OS X api that does this recursively? [17:39] mjijackson: Good morning node. [17:39] richcollins: deanlandolt: I suppose I could just crawl the graph and register all files and folders [17:39] mjijackson: Is there any place where V8's JS API's are documented? [17:40] mape has joined the channel [17:40] deanlandolt: richcollins: poke at nodules -- it already does this [17:40] deanlandolt: (you can just rip out that little bit of code if you don't want all the rest) [17:41] richcollins: deanlandolt: OK I'll peruse the readme and see if it will work [17:41] deanlandolt: by the time you get through doing all that you may just end up using nodules...but hey, worth a shot :) [17:42] aconbere: how are people distributing executable node scripts? [17:42] richcollins: That is fine as long as I don't have to jump through a bunch of hoops [17:42] aconbere: maybe npm is my answer really [17:42] deanlandolt: aconbere: scripts or packages? [17:42] richcollins: aconbere: github of course :-) [17:42] aconbere: haha [17:42] deanlandolt: gist.github.com works nicely as a script distribution form ;) [17:43] stephenlb has joined the channel [17:43] aconbere: I mean more like this... I have a little static website generator I wrote [17:43] deanlandolt: you may even be able to use nodules to require it directly [17:43] aconbere: you can execute it's entry point [17:43] aconbere: its [17:43] aconbere: but to use it you don't want to have to link into lib/myapp.js [17:43] aconbere: or to make people cd there [17:44] mscdex: mjijackson: not that i'm aware of, but you can generate them with doxygen and the node.js source [17:44] aconbere: in python I would package an egg, and then define an executable entry point to the egg [17:44] aconbere: since it's installed in a central location we can access it from an executable just about anywhere [17:44] mjijackson: mscdex: thanks. why do i need the node source? [17:45] mscdex: it contains the V8 headers [17:45] mscdex: which contain the info [17:45] wilmoore has joined the channel [17:46] mjijackson: and v8 doesn't contain the v8 headers? [17:46] mscdex: it does, i just thought more people would have the node source and not just v8 ;-) [17:47] kevwil has joined the channel [17:47] mjijackson: mscdex: i see. thanks! [17:47] mscdex: anyway, just put this file into the root of your V8 source directory (i.e. deps/v8 in the node source package): http://v8-users.googlegroups.com/web/Doxyfile?gda=b0ZBlzoAAACHpROxHgsZwD74FzesMpLhR0UZYonDyXMEvlwr87YWNfxomvRFNBi6i_fp1nzw-Xv97daDQaep90o7AOpSKHW0 [17:47] kevwil has joined the channel [17:48] mscdex: and then run doxygen from the same dir [17:50] aconbere: ahh... so maybe... index.js inside my directory [17:50] aconbere: that includes all my other bits [17:50] aconbere: and then an executable script that imports that [17:52] Ori_P has joined the channel [17:53] tmpvar: hey _ry our videos just got posted [17:53] V11 has joined the channel [17:53] V11: v [17:54] devinus has joined the channel [17:54] devinus: is it a small optimization to save a property lookup like this.myfunc() and save it in a variable? var myfunc = this.myfunc; myfunc() if its in a loop ? [17:55] V1: That would be rather easy to benchmark ;) [18:00] mjijackson: mscdex: i'm looking through the doxygen docs, but i don't see anything about the js api, just the C++ api [18:00] mscdex: the js api? [18:00] mjijackson: yeah. like the js functions and properties [18:01] mscdex: oh, well V8 implements ECMA-262 3rd edition [18:02] mscdex: so: http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf [18:02] Ori_P has joined the channel [18:03] mjijackson: mscdex: ah, that's what i was looking for. sorry for not being more clear from the start [18:04] mscdex: although, that's actually 5th edition, so it may not be 100% equivalent, i'm not sure [18:05] jan____ has joined the channel [18:06] jan____ has joined the channel [18:06] Ori_P_ has joined the channel [18:06] fizx has joined the channel [18:07] markwubben has joined the channel [18:08] stevendavie has joined the channel [18:08] creationix: mscdex: mjijackson: v8 actually implemented most of ECMA5, see the node wiki for a list of progress. http://wiki.github.com/ry/node/ecma-5mozilla-features-implemented-in-v8 [18:10] creationix: How do I get my http server to be accessable outside the local machine [18:10] fizx has joined the channel [18:10] creationix: I'm binding to "0.0.0.0" with no luck [18:10] mjijackson: creationix: that is an excellent list. did you create it? [18:10] creationix: mjijackson: I started it and did most of it [18:10] creationix: but it's a wiki, it's been updated since [18:11] mjijackson: of course. thanks. that's a great resource. how did you find out all the info? did you read the source? [18:16] mikeal has joined the channel [18:17] sechrist: bah, now that I get the S3 app working -- files uploaded to s3 are missing chunks [18:17] joshbuddy has joined the channel [18:18] richcollins: kriszyp: Is there any way to tell nodules to automatically load all of the modules in a folder? ./lib for example? [18:18] ncb000gt: creationix: if you have a static IP you can bind to that instead of 0.0.0.0 [18:18] rramsden_: anyone know what I need to look into for creating my own standalone asynchronous function in node.js? [18:18] kriszyp: you mean to preload them without a require? [18:18] kriszyp: no [18:18] richcollins: rather than explicitly adding them to an index.js file? [18:18] stevendavie has joined the channel [18:18] kriszyp: no, everything has to be require'd [18:19] richcollins: kriszyp: So I could just write something that traverses the folders and requires them? [18:19] richcollins: nodules would be cool with that? [18:19] kriszyp: I suppose that should work [18:19] richcollins: kriszyp: Just trying to avoid bookkeeping if possible [18:20] richcollins: I'd like to just drop things into folders and have it work based on convention [18:27] konobi: _ry: think it'd be crazy to write a dhcp server with node? [18:27] creationix: so does anybody know how to bind to all ip addresses in node? [18:27] _ry: konobi: sounds cool - why? [18:28] konobi: some internal stuff... requires dhcp, but with the ability to do dynamic lookups for available IPs, etc. [18:29] konobi: creationix: server.listen('5050'); [18:30] creationix: konobi: no, that listens to a local unix socket called '5050' [18:30] konobi: not according to the docs [18:30] pandark_ has joined the channel [18:30] konobi: oh [18:30] creationix: I'm trying listen(8080) and listen(8080, "0.0.0.0") and both are binding to 127.0.0.1 [18:30] konobi: what's netstat -an telling you ? [18:31] creationix: tcp4 0 0 127.0.0.1.8080 *.* LISTEN [18:31] creationix: and I can't hit it from other machines [18:31] creationix: node v0.1.95 [18:31] _ry: creationix: listen(8000) [18:32] pandark_ has joined the channel [18:32] creationix: _ry: alright, that fixes the netstat output [18:32] creationix: tcp4 0 0 *.8080 *.* LISTEN [18:32] creationix: must be a bug in something else [18:32] _ry: konobi: what's the dhcp lib? [18:32] _ry: konobi: is there one? [18:33] _ry: a c lib? [18:33] konobi: _ry: not sure [18:34] creationix1 has joined the channel [18:34] konobi: _ry: isc has a libdhcp i think [18:35] creationix has joined the channel [18:37] konobi: _ry: however... the protocol is surprisingly simple [18:43] scott_gonzalez has joined the channel [18:45] scott_gonzalez: in an HTTP request, is request.socket._idleTimeout set by the client or Node? [18:45] mikeal: _ry: node should include this mDNS library [18:46] mikeal: it's seriously awesome [18:46] _ry: mikeal: i was thinking about that [18:46] _ry: it is seriously awesome [18:46] creationix: mDNS would rock [18:46] zomgbie has joined the channel [18:46] mikeal: i'm not very in to adding libraries to node, but this one feels like it really belongs there [18:47] _ry: yeah [18:47] _ry: it would be cool to have that functionality built in [18:47] mikeal: this, and UDP someday :) [18:47] _ry: but it's a lot of code [18:47] _ry: and i don't know how portable it is [18:48] sechrist: a node DNS daemon [18:48] creationix: _ry: so to follow up with my issue, a plain listen(8080) works correctly, my problem was that ab doesn't seem to support name based hostnames for local servers [18:48] sechrist: hoo boy :D [18:48] _ry: creationix: oh, right [18:48] creationix: if I ab to 127.0.0.1 and then manually set the Host header it works [18:51] saikat` has joined the channel [18:57] _ry: in npm how do you tell it to build a binding? [18:57] devinus: wow [18:57] devinus: it's been so long since i've used a do...while loop [18:57] jspiros has joined the channel [18:57] _ry: mikeal: --^ [18:58] mikeal: install directive [18:58] mikeal: or maybe build? [18:58] mikeal: basically, you give the package.json a script [18:58] mikeal: there are a couple different directives for different types of scripts [19:01] derbumi has joined the channel [19:01] maushu has joined the channel [19:01] rictic has joined the channel [19:02] maushu: aconbere, I'm still looking at what you said yesterday. [19:05] charlesjolley has joined the channel [19:06] maushu: _ry, why would a self-signed certificate work perfectly but not a commercial one? [19:08] admc has joined the channel [19:10] jaw6 has joined the channel [19:10] sechrist: does JS not require semicolons after function calls or something? [19:10] sechrist: I'm seeing them all over node code without semicolons and I twitch each time [19:11] richcollins: kriszyp: have you seen the __dirname is not defined error when using nodules? [19:11] ssteinerX has joined the channel [19:11] jaw6 has joined the channel [19:11] richcollins: sechrist: js doesn't require any semicolons [19:11] sechrist: how annoying [19:12] richcollins: sechrist: Its only annoying because js syntax is ambiguous in some cases :-( [19:13] kriszyp: no, I haven't, can you show me how to reprodcue it? [19:13] technoweenie: in a browserless world, semicolons are the first to go [19:14] cloudhead: curly braces look weird without semicolons [19:14] richcollins: kriszyp: https://gist.github.com/2fb37473f145680cd485 [19:14] cloudhead: it's a delicate balance [19:15] technoweenie: js syntax is pretty ugly, so w/e [19:15] richcollins: technoweenie: Are the ambiguities related to the browser? [19:15] richcollins: actually, using brackets after a function call is ambiguous [19:15] technoweenie: richcollins: i believe some browsers handled the ambiguities differently, so the general rule was to always include them [19:15] richcollins: ah I see [19:16] richcollins: another bit of evidence for simple syntax [19:16] richcollins: *in favor of [19:16] technoweenie: i really like comma-first too: http://gist.github.com/357981 [19:16] richcollins: kriszyp: Any idea why __dirname wouldn't be defined in that context? [19:16] kriszyp: oh, I see, richcollins , the problem is that nodules isn't providing __dirname, right? [19:17] kriszyp: I suppose I can add that [19:17] kriszyp: hmm, have to think about how to do that... [19:17] kriszyp: __dirname is the directly of the current module? [19:17] kriszyp: directory... [19:17] cloudhead: of the current file [19:17] cloudhead: of __filename [19:18] admc_ has joined the channel [19:18] pkrumins: anyone knows what 'Fixed in 1440363.' means? [19:18] maushu: aconbere, I think that with your help yesterday I might be able to fix this. Thanks. Btw, you are right. It is the namespaces fault. [19:19] pkrumins: ry replied to me telling the issue i submitted was fixed in 1440363. [19:20] technoweenie: maybe semicolons had something to do with minification too -- which isn't a node.js concern [19:20] cloudhead: pkrumins: the commit hash [19:20] phiggins has joined the channel [19:20] _ry: pkrumins: i fixed the commit [19:20] _ry: pkrumins: http://github.com/ry/node/commit/44ad6a7db28578d0828fc3ceade7a6a12ebe7852 [19:20] _ry: pkrumins: i'd like a test to show how it segfaults [19:20] pkrumins: _ry: hey thanks, but please see issue 152. [19:20] pkrumins: yeah, right. [19:20] pkrumins: oh. [19:21] pkrumins: ok, i am creating one right now [19:21] _ry: just update the issue with it [19:21] pkrumins: basically just create Buffer anywhere. [19:21] pkrumins: kk [19:21] pkrumins: 5 mins [19:21] richcollins: kriszyp: current file [19:21] _ry: ACTION bbiab [19:22] richcollins: technoweenie: comma first does look better -- thx for sendingthat [19:22] kriszyp: richcollins: do you want __filename and __dirname? [19:22] richcollins: kriszyp: I think that most people would expect that .. [19:23] richcollins: so yes, thanks [19:28] kriszyp: richcollins: pushed, can you see if that works as expected? [19:28] richcollins: sure one sec [19:28] richcollins: Need to get it working first without nodules [19:30] aconbere: maushu: rad! I had XML namespaces [19:30] aconbere: er [19:30] aconbere: hate [19:30] aconbere: "I had xml namespaces once, they were delicious" :P [19:31] mde: I was thinking "I had XML namespaces, but they cleared up on their own." [19:32] aconbere: hahaha [19:32] aconbere: not mine! [19:32] aconbere: I had to get some creams from the pharmacist [19:32] mde: Haha [19:34] wilmoore has joined the channel [19:37] tilgovi has joined the channel [19:38] ineation has joined the channel [19:38] ineation has left the channel [19:38] mattly has joined the channel [19:39] pkrumins: oh snap, took me 18 mins. [19:39] pkrumins: anyway, [19:39] pkrumins: _ry: here is all you need to reproduce the crash http://github.com/ry/node/issues/issue/152/#comment_247832 [19:40] joshbuddy has joined the channel [19:41] ineation has joined the channel [19:41] sudoer has joined the channel [19:43] joshbuddy has joined the channel [19:46] mjr_ has joined the channel [19:46] saikat` has joined the channel [19:47] jherdman has joined the channel [19:47] inimino: people sure get worked up over semicolons :/ [19:48] inimino: ACTION regrets getting involved [19:49] margle has joined the channel [19:50] maushu: aconbere, doc.find("/atom:feed/atom:entry", {"atom": "http://www.w3.org/2005/Atom"}); [19:51] dridge has joined the channel [19:52] rolfb has joined the channel [19:55] creationix: inimino: absolutely, it's 99% personal taste, but being programmers, we want to find a concrete reason for the other 1% of why we do it [19:56] WALoeIII has joined the channel [19:56] mjr_: inimino: I think it's great that so many people care about doing JavaScript well. [19:59] bradleymeck: and there are advantages to both sides so arguing is natural [19:59] creationix: does node's tcp client and server rechunk messages [19:59] creationix: or send them as is? [19:59] creationix: actually, this is for over stdin and stdout for a child process [20:00] creationix: so when I write to a child's stdin, will it recieve exactely 1 data event for each write call [20:00] creationix: _ry: ^ [20:00] derbumi has joined the channel [20:00] richcollins: kriszyp: It doesn't return the absolute path: [20:00] richcollins: lib/nodules/nodules/Users/rcollins/projects/VertexJs/autolib [20:00] richcollins: instead of [20:00] richcollins: /Users/rcollins/projects/VertexJs/autolib [20:02] inimino: creationix: yeah, I just wish people could discuss the 1% without getting emotionally involved. [20:03] bradleymeck: i dont think the child stdin will fire it until it gets newline chars unless you mess with the terminal settings creationix [20:04] creationix: bradleymeck: It's a child process, so new lines don't matter here [20:04] creationix: the parent process is piping binary data to the child [20:05] creationix: in my testing the write calls are 1-to-1 with the data events in the child, but I'd like to know if this is a safe assumption to make [20:05] creationix: because in general tcp with c it's not [20:05] mikeal: Gmail needs a way to ignore a mailing list thread [20:05] mjr_: mikeal: mute [20:06] mjr_: next request, please [20:06] mikeal: oh awesome [20:06] mikeal: no more semicolon thread :) [20:06] ncb000gt: OMG SEMICOLONS! [20:06] inimino: I think it's done anyway [20:06] ncb000gt: mute me now! [20:06] ncb000gt: <.< [20:07] gwoo has joined the channel [20:07] mde: Oh, did I miss the semicolon thread? Goddammit. [20:07] bmizerany has joined the channel [20:07] mjr_: creationix: if the child process is unable to drain its buffer fast enough, for whatever reason, the writes will stack up on the writing process. When that queue drains, they may arrive on the reader as different sized messages. [20:07] mde: I'm always late to the party on this shit. [20:08] creationix: mjr_: so the size is completely arbitrary just like with tcp sockets then? [20:09] mjr_: yeah, in order to do it safely, you'll need some kind of message boundary / framing. [20:09] jherdman has joined the channel [20:09] creationix: mde: what part of town do you live in, I'm down in Palo Alto [20:11] mjr_: There are now 200 people in #node.js. Getting popular in here. [20:11] inimino: mde: permathreads are like witches, you can always bring them back ^.^ [20:11] mde: creationix: I'm in Pacifica, just south of the city. I sent you an e-mail the other day -- did you get it? [20:12] mikeal: did my patch make it to the list? [20:12] mde: inimino: Good point, maybe I need to throw some more gasoline on that fire. [20:12] mikeal: hrm..... [20:13] mikeal: _ry: did you get that asserts.ifError patch? [20:13] creationix: mde: don't think so, what was the subject [20:13] creationix: tim@creationix.com [20:14] gf3: NO U [20:14] tmpvar has joined the channel [20:14] bmeck has joined the channel [20:15] morgan has joined the channel [20:16] mjr_: I can't tell if the node mailing list is a useful tool for anything other than announcements. [20:17] KungFuHamster: semicolon discussion explosion [20:17] Phazm: are there more announcements there than on IRC? I hate mailing lists, but I hate missing out on cool new projects even more [20:18] mjr_: yeah, I like all the announcements, because I often miss things here. [20:19] mjr_: But threads that are, "Is there a node bug in my code?" feel out of place on an announcements list. [20:20] KungFuHamster: ACTION wants a forum with announcements, help, modules, works in progress, etc. [20:22] Phazm: ACTION wants what KungFuHamster wants [20:22] Ori_P has joined the channel [20:22] KungFuHamster: then I could subscribe to the topics I'm interested in :) [20:23] Phazm: especially regarding modules (announcements when they are updated or added, not just a big list like it is now) and significant changes (like how sys.p just got deprecated) [20:26] felixge has joined the channel [20:27] fictorial: Phazm: Yes, I hate seeing "XYZ edited a page in the ry/node wiki about 2 hours ago" since I don't know what's changed. [20:28] fictorial: GH should show diffs on wiki edits. [20:28] _ry: mikeal: i didn't get the one with docs [20:28] mikeal: hrm.... [20:29] _ry: creationix: you can't be guarenteed on how the chunks will arrive [20:29] _ry: mikeal: :) [20:29] mikeal: i'll email you a new one [20:29] creationix: _ry: thanks [20:30] creationix: does anyone have a library that helps with re-forming messages that are recieved in chunks [20:30] _ry: creationix: you need to do framing yourself [20:31] creationix: I know, I'm just wondering if there is a framing library somewhere [20:31] _ry: creationix: what do you want to do actually? [20:31] _ry: send a json or something? [20:31] creationix: rather, I've got a protocol, part of the fixed-size header has the body of the variable-length binary body [20:32] towski has joined the channel [20:32] creationix: I'm writing the logic to reconstruct the original message from many chunks, but it's nasty logic [20:32] creationix: seems like this would be a common pattern in c programs [20:32] creationix: *header has the length of the body [20:32] _ry: eh, it should be okay [20:33] derbumi has joined the channel [20:33] devinus: http://pastie.org/970085 [20:33] devinus: that's pretty clever [20:33] mnutt has joined the channel [20:34] creationix: _ry: btw, are there plans to adding Buffer support to stdin streamd? [20:34] creationix: s/streamd/streams/ [20:35] _ry: creationix: it's there already [20:35] creationix: really, when I don't set then encoding I still get strings [20:36] creationix: using stdin = process.openStdin() [20:36] sveisvei: wow, grats on post 200 ppls in #Node.js [20:36] creationix: hmm, but I'm on v0.1.95, maybe it's a recent addition [20:37] _ry: creationix: no, it should give you buffers [20:37] richcollins has joined the channel [20:37] _ry: maybe they're being cooerced into stirngs [20:37] _ry: *coerced [20:38] mde: creationix: Sorry, got pulled into an impromptu meeting. It was about book stuff. I'll re-send. :) [20:38] creationix: mde: cool [20:39] _ry: mde: :) [20:39] mjr_: creationix: one simple example of message framing is the websockets protocol, but since their payload format is utf8, there are two characters that are perfect for framing. [20:40] mjr_: creationix: for a binary body of unknown length, you probably want something like chunked encoding in http. [20:40] creationix: yeah, I can't use that kind of framing since my data is raw binary data [20:41] creationix: hopefully my stream never gets out of sync [20:41] creationix: _ry: https://gist.github.com/b102c6ba7cc11830cf6c [20:43] fernmicro has joined the channel [20:43] creationix: mjr_: my framing is simple, the first 5 bytes are the version of the protocol and the size of the rest of the message, then the rest is binary data [20:44] _ry: creationix: [20:44] _ry: ryan@mac:~/projects/node% ./node stdin.js [20:44] _ry: hello [20:44] _ry: DEBUG: object [20:44] _ry: blah [20:44] _ry: DEBUG: object [20:44] _ry: creationix: this wasn't changed recently [20:44] _ry: node -v ? [20:44] creationix: _ry: I tested on v0.1.95 and v0.1.95-16-g0a53986 [20:45] creationix: you just ran my gist standalone right? [20:45] _ry: yes [20:45] _ry: what type of computer? [20:45] mde: creationix: I don't know if it matters, but I sent it to .org and not .com -- that's what's on your GitHub profile. [20:45] mjr_: surely you added sys = requrie('sys') to that gist. :) [20:45] _ry: mac? [20:45] _ry: mjr_: yes [20:45] creationix: _ry: yes, mac. I get object when I run it standalone too [20:46] creationix: but in my use case, it's a subprocess [20:46] _ry: ah [20:46] creationix: I wonder if that makes a difference [20:46] _ry: it does [20:46] _ry: and that work is nearing completeion [20:46] _ry: waiting on felix actually [20:46] creationix: mde: good to know, thanks [20:46] kuya: hi - does anyone have anything like jsdom or envjs working on node? [20:46] creationix: ACTION updating my github profile [20:47] _ry: kuya: jsdom works on node [20:47] creationix: _ry: so why is it different for a subprocess, I would think it's the same since it's a separate process [20:48] kuya: _ry: ive tried but im failing with jsdom [20:48] kuya: _ry: do you know of any example code? [20:48] _ry: creationix: node uses isatty() on the stdin fd [20:49] devinus: what do you guys put in a generic commonjs project directory? i've got my code in lib/ [20:49] _ry: if it's not a tty then it assumes it's a file [20:49] devinus: my tests in test/ [20:49] _ry: kuya: nope. ping tmpvar [20:49] devinus: and a package.json [20:49] kuya: thanks _ry [20:49] devinus: not sure what else i should put in there [20:49] kuya: tmpvar: ping [20:49] _ry: creationix: file i/o has to be done in the thread pool - it can't be polled on [20:49] _ry: creationix: hence the difference [20:49] _ry: for a subprocess stdin is a pipe [20:50] _ry: (which can be polled on - i just don't know how to discover it) [20:50] _ry: maybe getsockopt? [20:50] indiefan_ has joined the channel [20:50] _ry: getsockopt(SO_TYPE) ? [20:51] _ry: (funny how no one really knows posix) [20:51] creationix: _ry: sorry, I'm not much help on that one [20:51] creationix: but that's why node is awesome, it does all that for us :) [20:52] _ry: ACTION is going to go to some talks, i guess [20:52] creationix: for now, I'm just using binary encoding and converting the string to a buffer in my app [20:52] creationix: slower, but it works for now [20:53] richcollins: kriszyp: Looks like cachePath("file:///Users/rcollins/projects/VertexJs/lib/autolib.js") is returning the wrong path [20:53] ewdafa_ has joined the channel [20:53] devinus: creationix: coolest project http://github.com/creationix/postgres-js [20:55] felixge: ok, I'll do the fs.read stuff now [20:56] creationix: devinus: thanks [20:56] creationix: felixge: that would be awesome! [21:02] mnutt: Does anyone know of something that would cause the following error when serving http requests behind nginx? node_g: ../src/node.cc:891: ssize_t node::DecodeWrite(char*, size_t, v8::Handle, node::encoding): Assertion `b[1] == 0' failed. [21:02] rictic has joined the channel [21:04] StackNode has joined the channel [21:04] maushu: !so-last [21:05] maushu: !so-next [21:05] maushu: ...hmmm. [21:06] morgan has joined the channel [21:06] StackNode has joined the channel [21:06] sechrist: hmm, I can't figure out how to copy/copyresample a png with transparency in node-gd and keep transparency [21:06] maushu: !so-last [21:06] StackNode: Latest Question: "Channels in Socket.io" by mat3001. [21:06] maushu: !so-next [21:06] StackNode: Time left for the next fetch: 01:59:44 [21:07] richcollins: kriszyp: I pushed a possible fix. Have a look at your fork queue. [21:08] saikat` has joined the channel [21:08] richcollins: kriszyp: However, it still doesn't appear to reload modules [21:08] maushu: Great, I think it works. Now everytime a new question shows up regarding node.js it is announced here. This should help any SO users that are using node.js [21:09] sechrist: that's neat! [21:11] sechrist: http://pastie.org/970167 anybody know how to make img retain it's transparency? it's coming up black [21:13] maushu: sechrist, Does "createTrueColor" create a transparent image? Does "copyResampled" overwrite alpha? [21:14] sechrist: createTrueColor provides a black image -- I think copyResampled does [21:14] sechrist: in php there's a saveAlpha method that the guides show [21:14] sechrist: taggon didn't implement it afaik into node-gd, I might do that if that's the cause [21:14] sechrist: http://php.net/manual/en/function.imagecreatefrompng.php [21:15] sechrist: the first user response there outlines my problem but I am doing what it does as far as I know [21:16] lolninja has joined the channel [21:17] lolninja has left the channel [21:18] thotypous has joined the channel [21:18] demolithion has joined the channel [21:21] bradleymeck: do we have a solution for addons that compile differently in different operating systems (ie mac v linux where ifdef applies different behaviour)? [21:22] _ry: ? [21:23] mjr_: what sort of a solution are you imagining? [21:25] fizx has joined the channel [21:25] bradleymeck: not sure, but since linux and mac osx have a slight diff on an ioctl id still like it to work on both with a single .node addon file. [21:26] mjr_: And CPP directives don't do what you need? [21:27] sechrist: maushu: I added saveAlpha to node-gd's cc and it worked :) [21:27] maushu: sweet [21:27] sechrist: what's the proper method of submitting a code suggest through github, do I email the author, or what? I don't even have a github account [21:27] sechrist: ACTION ducks [21:27] maushu: WAT. [21:28] pdelgallego has joined the channel [21:28] maushu: ...do you at least use git? [21:28] sechrist: I have the client installed for cloning node stuff [21:28] sechrist: i've never commited with it [21:28] maushu: You can create a patch then. [21:28] _ry: bradleymeck: don't distribute binary .node file [21:28] sechrist: maushu: gnu patch file? or something git uses? [21:29] _ry: or if you do it should be clear what platform it's for [21:29] maushu: Something git uses, don't remember how to do it. I did it once for gf3 irc bot. [21:29] tmpvar has joined the channel [21:30] gf3: yo [21:30] mattly has joined the channel [21:30] sechrist: maushu: I'll email the guy a diff -crB [21:30] sechrist: lol [21:31] maushu: gf3, created the stackoverflow announcer using your irc thingy. [21:31] maushu: I wanted to use jerk but I didn't find a way to send messages anytime we wanted. Just when it received something. [21:31] gf3: maushu: hot! [21:31] gf3: link? [21:31] maushu: Link? [21:32] maushu: For the source? I still have to connect myself to github again. [21:32] maushu: *sigh* [21:32] maushu: All that silly config. [21:32] maushu: !so-next [21:32] StackNode: Time left for the next fetch: 01:33:27 [21:33] gf3: maushu: how was working with IRC-js? [21:34] gf3: sechrist: http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/ [21:35] maushu: gf3, pretty easy. Nothing like jerk, but easy. [21:35] sechrist: gf3: thanks [21:35] gf3: maushu: nice, let me know if you run into any troubles [21:35] felixge: _ry: is readSync supposed to work with buffers yet? [21:35] sechrist: I need to learn how to use git, but I'm so attached to Coda and it's SVN :| [21:35] felixge: _ry: it seems there is no code for it in node_file.cc [21:35] maushu: I checked jerk's code to see what to do. (aka irc needs more docs :p) [21:35] joshbuddy has joined the channel [21:36] gf3: maushu: yea :( the docs are all inline, I need to generate them [21:36] charlesjolley has joined the channel [21:36] sechrist: maushu: yeah I don't know how any newbie developers could just jump in and use node [21:36] sechrist: it requires at least a few years of programming understanding to be able to use it in it's current condition of madness [21:37] sechrist: and _why isn't around to write a poignant guide to node :P [21:37] mde: sechrist: Some of us are working on that problem. [21:37] sechrist: mde: Oh I know, I'm not blaming anybody [21:37] sechrist: it's too new [21:38] mde: Nah, just so you know, we're on it. :) [21:38] felixge: _ry: nvm [21:38] felixge: _ry: gotta debug further [21:38] maushu: mde, I want to connect my mind to node so that it creates anything I can think of. [21:38] charlesjolley has joined the channel [21:39] mde: maushu: It's a pretty long list of modules, there's probably a project working on that. :) [21:40] maushu: node-skynet [21:41] sechrist: I thought ~/.node_libraries was an interesting choice [21:42] sechrist: I saw it also hits /usr/local after an strace [21:44] ssteinerX has joined the channel [21:48] _ry: felixge it does [21:48] felixge: _ry: yeah, I got it going now [21:48] felixge: _ry: should have the patch ready in a bit [21:49] sechrist: so how would a shared hosting environment work with node? I guess similar to how rails works. Spawn it through cPanel and then proxy through apache? :\ [21:49] sechrist: ACTION waits for incoming flames [21:50] bmizerany: is Rob Righter here? [21:50] bmizerany: I have a node-xml question. [21:51] MattJ: He is sometimes, but not at the moment I think [21:51] mjr_: sechrist: I think that's the currently accepted way to solve that problem. node likely isn't stable or secure enough to run as root and own port 80 in that kind of environment. [21:51] bmizerany: MattJ: cool. thx [21:51] ssteinerX has joined the channel [21:51] bmizerany: can anyone help with a node-xml question? [21:53] wilmoore has joined the channel [21:53] smtlaissezfaire has joined the channel [21:54] sechrist: bmizerany: maybe if you asked the question [21:54] sechrist: lol [21:54] bmizerany: haha [21:54] bmizerany: true [21:54] bmizerany: so http://github.com/bmizerany/swirl-node/blob/master/lib/swirl.js [21:55] bmizerany: let me gist something with that [21:55] bmizerany: https://gist.github.com/4bf7f2ce633ee1efb099 [21:55] sechrist: ec2 client eh? I thought EC2 was the VPSes on the cloud [21:55] sechrist: I use S3 and SimpleDB [21:55] aconbere: I think we beat Twisted and EM in terms of usability [21:56] aconbere: that's pretty good [21:56] bmizerany: aconbere: yes. the crypro and http and querystring lib made it a fkn cinch [21:56] aconbere: of course part of the problem is that there really aren't very good educational resources on JS [21:56] bmizerany: so my question is [21:56] bmizerany: that gist does 100 DescribeInstances [21:57] sechrist: anybody running 100 ec2 instances [21:57] sechrist: has a deep wallet [21:57] bmizerany: and bombs with undefined on gist#L18 [21:57] bmizerany: sechrist: hehe. it's s DescribeInstances [21:57] bmizerany: not running anything [21:57] bmizerany: I was testing swirl under a large load [21:58] sechrist: I left an ec2 running, not even doing anything, small type, and it cost me like $60 in one month [21:58] sechrist: I was like wut [21:58] bmizerany: sechrist: yeah. need to watch taht. ;) I had the same with Rackspace this month. found out it had been running of 4 months. unused. hah [21:59] bmizerany: anyway. I think there is something wrong with my swirl lib, because the callback is being called with `undefined` caused a null reference [21:59] brianmario has joined the channel [22:00] bmizerany: I'm trying to track wich iteration it is, but, I don't know now how (in JS) to keep `i` scoped to the callback so it does't print 10 on each call [22:00] mjr_: sechrist: $60/mo is a lot cheaper than paying a fulltime ops person to fiddle around with individual computers in some sort of colo, health insurance, office space, etc. [22:00] bmizerany: mjr_: it gets even better with Heroku ;) [22:00] mjr_: bmizerany: there is only one i, created in the outer scope. [22:01] sechrist: mjr_: not as cheap as running vpses at prgmr, but yeah ec2 is obviously a lot more durable, and gives lan latency to simpledb/s3 [22:01] gf3: bmizerany: closure [22:01] sechrist: labor wise I suppose so [22:01] bmizerany: sechrist: any ideas on how to keep `i`'s value as that of it's value at the point in time I create the closure? [22:01] mjr_: Your anonymous function callback has a reference to the one and only i. [22:01] gf3: bmizerany: or you can use `with` :) [22:01] gf3: I wish V8 implemented `let` [22:01] bmizerany: oof. pappa Crockford warns against `with` [22:01] mjr_: bmizerany: you need a function maker [22:02] bmizerany: mjr_: where can I purchase one of those? [22:02] gf3: bmizerany: sure, it can fuck with you, but it's useful if you know what you're doing [22:02] mjr_: bmizerany: ec2.call("DescribeInstances", query, get_callback(i)); [22:02] bmizerany: mjr_: AH [22:02] bmizerany: that's what I was missing. thx [22:03] mjr_: function get_callback(i) { return function (o) { debug (i); }} [22:04] gf3: curry! [22:05] Tim_Smart has joined the channel [22:05] mjr_: curry is delicious, and also what that pattern is called. [22:06] mitkok has joined the channel [22:06] sechrist: curry is a neurotoxin [22:06] mikeal has joined the channel [22:06] mjr_: I wish I had some curry right now. [22:06] gf3: http://gist.github.com/132012 [22:06] mikeal: i just finished some grubhub [22:06] mikeal: chicken tikka :) [22:07] softdrink has joined the channel [22:07] sechrist: what does that do? [22:07] mjr_: breads of india? [22:07] elbartus has joined the channel [22:07] Noya has joined the channel [22:07] sechrist: creates a function that chops up a string? i'm a little confused [22:08] samsonjs has joined the channel [22:08] sechrist: ah, 2010 and we still have netsplits :) [22:08] ryan[WIN] has joined the channel [22:08] mjr_: All descriptions of functional "curry" that I've read seem so abstract and not useful. The example that bmizerany has is what always comes up. [22:08] tlrobinson has joined the channel [22:08] hellp has joined the channel [22:09] chrismcg has joined the channel [22:09] avidal has joined the channel [22:10] ditesh|cassini has joined the channel [22:11] bmeck has joined the channel [22:12] ineation has joined the channel [22:13] admc has joined the channel [22:13] ineation has joined the channel [22:13] rra has joined the channel [22:17] wilmoore has joined the channel [22:18] kkaefer: mjr_: currying is useful in a dom context when assigning event handlers, for example [22:19] maushu: !so-next [22:19] StackNode: Time left for the next fetch: 00:47:16 [22:19] kkaefer: $('#foo').click(this.handle.curry(this)); [22:19] kkaefer: something like that [22:19] felixge: _ry: http://github.com/felixge/node/commit/bf2839ff85a4a8dcae10ea06358e31d835f78f16 [22:19] mjr_: kkaefer: Yeah, for sure. It is a crucial concept to understand for effective programming in JavaScript. [22:20] _ry: felixge: wow look at all that c code go away [22:20] felixge: _ry: yeah, it's awesome :) [22:20] mjr_: I'm objecting to the way that currying is described in the literature. It doesn't seem as useful as calling it "function maker" or something, and showing that kind of "callbacks in a loop" example. [22:21] sechrist: i'm going to ignore whatever curry is until I have an obvious need for it [22:22] mjr_: sechrist: as soon as you find yourself defining anonymous function callbacks in a loop, you'll want to remember this discussion. :) [22:23] sechrist: i'll remember the word curry, mjr_ [22:24] CIA-74: node: 03Ryan Dahl 07master * rcbd2c39 10/ (5 files in 3 dirs): [22:24] CIA-74: node: Throwing in a callback should kill the process [22:24] CIA-74: node: There is a difference between errors which happen to a socket - like [22:24] CIA-74: node: receiving EPIPE - an exceptional situation but ultimately okay and the [22:24] CIA-74: node: situation where code throws in a callback - which is not okay. [22:24] CIA-74: node: Fixes test/simple/test-http-exceptions.js [22:24] CIA-74: node: TODO: explain this in docs. - http://bit.ly/9nKPfA [22:25] sudoer has joined the channel [22:25] mjr_: _ry: what do you want the docs to say about this exception handling thing? [22:25] mjr_: Is there something that users need to understand about this that isn't obvious? [22:26] _ry: mjr_: not sure [22:26] _ry: throwing in callbacks is bad [22:26] _ry: or throwing in general [22:26] _ry: one should not expect to recover from it [22:27] mjr_: yeah, if your callback throws, then that's very bad. [22:27] sechrist: that's why you catch [22:27] sechrist: but that gets nasty [22:27] mjr_: It should kill the process with a stack trace. [22:27] o_o has joined the channel [22:27] sechrist: so there shouldn't be exception handling in node? like, on error, or anything? it should be a separate callback? [22:28] derbumi has joined the channel [22:29] _ry: sechrist: you can do process.addListener('uncaughtException') [22:29] _ry: which will make it not exit the process [22:29] felixge: I only use throwing in my libraries to indicate a "compile time error". By that I mean an error that is due to improper calling of a function [22:29] felixge: runtime errors shouldn't throw [22:29] _ry: error handling is hard [22:29] sechrist: well, _ry, in a production environment where node should stay up, what if a http library throws something because of a 403 or 404 or something? it needs to stay up imo [22:29] mjr_: felixge: the tricky case is actual errors, not explicit throws. [22:30] felixge: mjr_: ? [22:30] _ry: sechrist: handle the exception [22:30] sechrist: _ry: bingo LOL [22:30] derferman has joined the channel [22:30] _ry: :P [22:30] tommost has joined the channel [22:30] mjr_: So what if you have an error in a callback, inintentional, and it causes V8 to throw. [22:31] _ry: then your program is broken [22:31] mjr_: for sure [22:31] gf3 has joined the channel [22:31] fernmicro has joined the channel [22:31] mjr_: and it should die. [22:31] _ry: yes [22:31] mjr_: take that, broken program [22:31] maushu: BARBARIANS! [22:31] maushu: ASSASSINS! [22:31] sechrist: like earlier today I was working with node-s3, and with invalid credentials it was throwing, process just stopped without any handling [22:31] ac94 has joined the channel [22:31] sechrist: I went whut [22:31] _ry: a bit sad we don't have small processes like erlang [22:32] felixge: _ry: so think the patch looks good? [22:32] _ry: cause bringing down a whole process could be a big deal [22:32] stephenlb: erlang++ [22:32] _ry: felixge: yeah [22:32] mjr_: sechrist: the "silent failure" case is the worst of both worlds. [22:32] maushu: _ry, huh, contexts? [22:32] _ry: maushu: maybe there are 1000 concurrent clients on it [22:32] sechrist: and one api call fails that was triggered by a client [22:32] _ry: in erlang those are all separate processes [22:33] _ry: so it can recover without terminating the other connections [22:33] maushu: Well, the only way is creating more node.js processes. [22:33] robotarmy: anyone have success with express dumping json to the browser? [22:33] felixge: I like the way node is now throwing 'error' events and using err as the first callback param [22:33] _ry: but we have shared memory in node - so unhandled state is difficult to recover from [22:33] felixge: it's IMHO a very good scenario for error handling [22:33] stephenlb: robotarmy: express dumping? [22:33] maushu: Drat. [22:34] _ry: i expect it doesn't matter much :) [22:34] mjr_: _ry: I think as node matures that we'll be able to get a lot of that kind of isolation using JavaScript. [22:34] _ry: mjr_: we could do it now [22:34] robotarmy: stephenlb: i'm trying to dump some simple json out to the the brower [22:34] _ry: mjr_: v8 context creatin is too slow to make it very viable [22:34] _ry: but it's not, like, very magic, i think [22:35] derbumi has joined the channel [22:35] felixge: _ry: it's like 2ms / context, right? [22:35] _ry: yeah [22:35] mjr_: Yeah, I don't think we need another V8 context, just really good V8 performance. Using JS language features, I think we can build up the same kind of abstraction that makes error handling in proxies work. [22:35] tommost has left the channel [22:35] _ry: mjr_: you could - but [22:35] _ry: well like using promises [22:35] _ry: but i think it's annoying [22:36] _ry: kriskowal and i were discussing this yesterday [22:36] _ry: basically - js sucks [22:36] mjr_: Yeah, for sure. Which is why building a solid, fast low-level interface is theright thing to do. [22:36] _ry: and, well, this is good enough :) [22:36] sechrist: "js sucks" -- Creator of node.js [22:36] mjr_: If you want that kind of abstraction, you can build something out of JS bits. [22:36] _ry: yes, but i think it will look annoying [22:36] inimino: building really nice abstractions in JavaScript is really hard [22:37] _ry: for example you can't just do setTimeout [22:37] _ry: you'll have to have it return some promise object [22:37] mjr_: Yeah, I never said that they'd be "really nice" abstractions. [22:37] sechrist: i've seen stack traces in callbacks get hairy very fast [22:37] _ry: which then you return from what ever callback you did [22:37] felixge: ACTION hates error handling [22:37] mikeal has joined the channel [22:37] stephenlb: ACTION too [22:38] sechrist: felixge: that's why you write perfect code with perfect input [22:38] sechrist: no errors to handle! [22:38] CIA-74: node: 03Felix Geisendörfer 07master * rcbbf9e4 10/ (5 files in 4 dirs): [22:38] CIA-74: node: Deprecate string interface for fs.read() [22:38] CIA-74: node: This patch makes buffers the preferred output for fs.read() and [22:38] CIA-74: node: fs.readSync(). The old string interface is still supported by [22:38] CIA-74: node: converting buffers to strings dynamically. This allows to remove the [22:38] CIA-74: node: C++ code for string handling which is also part of this patch. - http://bit.ly/cQb9ja [22:38] inimino: yes! [22:38] mjr_: I think the right abstraction will emerge as long as the low level bits are trustworthy. [22:38] felixge: whuuut, buffer mania! [22:38] felixge: :) [22:38] inimino: ACTION is very happy to see that commit :) [22:38] _ry: sechrist: what you do if use the process boundary [22:38] _ry: s/if/is/ [22:39] _ry: a program should be borken into small processes [22:39] inimino: wait, how do you deprecate a feature and remove the code in the same patch... [22:39] _ry: each part of the program shouldn't rely on the other parts being there [22:39] _ry: inimino: he reimplemnted it [22:39] inimino: s/deprecate/remove/ ? [22:39] inimino: oh, ok [22:39] sechrist: well erlang does that for hotswapping code [22:39] _ry: inimino: http://github.com/ry/node/commit/cbbf9e43d1770047e98fe65d5f710815f432a5b4#L1R148 [22:40] _ry: inimino: it's easy to do the legacy interface now that buffer is there [22:40] sechrist: .95 tonight? :D [22:40] sechrist: er .96 [22:40] mjr_: I'm really enjoying direct byte access from buffers. [22:40] _ry: "deprecate" because it's no longer mentioned in the docs [22:40] _ry: aka a "light deprecation" [22:41] felixge: _ry: now I can release: http://github.com/felixge/node-formidable [22:41] _ry: we'll move to a "heavy deprecation" before removal (which outputs a warning) [22:41] richcollins has joined the channel [22:41] felixge: :) [22:41] sechrist: are the "function x is depreciated, use y" messages going to stay in indefinitely? [22:41] felixge: mjr_: yeah, direct buffer access rocks [22:42] _ry: felixge: so ReadStream still emits strings by default, right? [22:42] felixge: _ry: unless you fixed it up [22:42] felixge: yeah [22:43] felixge: _ry: need to get some more work done now, but I can patch this over the next few days [22:43] felixge: _ry: readFile / readFileSync / writeFile / ... all need patching too [22:43] inimino: felixge: I think that's leaking a global [22:43] felixge: I think [22:43] felixge: inimino: where? [22:43] _ry: felixge: readFile already is done [22:43] inimino: line 146 vs. 150 [22:43] inimino: "encoding" [22:43] SubStack: buffers! [22:44] felixge: inimino: yeah, thanks [22:44] sechrist: everybody is excited about buffers [22:44] felixge: _ry: do you want to force push a fix? [22:44] SubStack: ACTION wrote http://github.com/substack/node-bufferlist  [22:44] felixge: _ry: or seperate commit? [22:45] SubStack: ACTION should add a bit about the binary parser to the readme too [22:45] _ry: felixge: i fixed it already [22:45] sechrist: felixge: formidable as a replacement for multipart? [22:45] felixge: _ry: ok, cool [22:45] sechrist: I was having issues with multipart earlier [22:45] sechrist: chunks in wrong order [22:45] sechrist: pissed me off :| [22:45] felixge: sechrist: formidable is actually meant to be a high-level lib that focuses on parsing and submitting forms [22:45] felixge: sechrist: it even stream file uploads directly to disk [22:46] felixge: sechrist: if you just want the multipart parser, that's standalone: http://github.com/felixge/node-formidable/blob/master/lib/formidable/multipart_parser.js [22:52] sechrist: felixge: neaaaat [22:53] JimBastard: red wizard needs food badly [22:53] sechrist_ has joined the channel [22:54] pedrobelo has joined the channel [22:55] pedrobelo: hey guys, is there any limitation on the number of http requests I can make when processing a request? [22:56] felixge: pedrobelo: ask your CPU / Network :) [22:56] pedrobelo: I have a proxy working, and whenever I add an extra call on it it just hangs [22:56] felixge: pedrobelo: you'll run out of ports eventually [22:56] felixge: pedrobelo: could be a node bug [22:56] smtlaissezfaire has joined the channel [22:57] pedrobelo: huumm ok just checking if there's any known limitation. I'll reduce this to a simple example [22:57] mjr_: pedrobelo: are you calling request again, or createClient + request? [22:57] pedrobelo: createClient + request [22:58] mjr_: I've got code that makes two outgoing HTTPs based on one incoming HTTP, so it is somehow possible. [22:58] pedrobelo: do you create the client twice? [22:58] mjr_: well, the two connections are to different hosts, so yes. [22:59] Phazm: pedrobelo: Mine connects to the same hosts, and it was hanging before I added another client [22:59] Phazm: now I have: [22:59] Phazm: site = http.createClient(80, siteURI); [22:59] Phazm: auctionSite = http.createClient(80, siteURI); [22:59] Phazm: and it works great [23:00] pedrobelo: humm interesting. ok let me come with a simple test case [23:06] StackNode: Latest Question: "how do i create a non-blocking asynchronous function in node.js?" by Richard. [23:06] felixge: uh oh [23:06] _ry: O_O [23:06] Phazm: ... [23:06] Tim_Smart: lolwut [23:07] Tim_Smart: lol @ the while (true) [23:08] felixge: I was talking about something else [23:08] felixge: my patch might be bad [23:08] felixge: very bad [23:08] pjb3 has joined the channel [23:08] _ry: felixge: why? [23:08] felixge: _ry: it seems like node is broken ;) [23:09] _ry: felixge: ? [23:10] felixge: _ry: well, if readFileSync is broken, module loading will be as well [23:10] felixge: _ry: making all tests "seem" to pass [23:10] felixge: ;) [23:11] JimBastard: StackNode: lol [23:11] JimBastard: l [23:11] jedschmidt has joined the channel [23:11] _ry: felixge: :) [23:12] felixge: _ry: trying to figure out what I screwed up :) [23:12] CIA-74: node: 03Ryan Dahl 07master * re84395f 10/ (5 files in 4 dirs): [23:12] CIA-74: node: Revert "Deprecate string interface for fs.read()" [23:12] CIA-74: node: This reverts commit cbbf9e43d1770047e98fe65d5f710815f432a5b4. - http://bit.ly/b05GLO [23:12] SubStack: is there a cpan-style module repository for javascript yet, or should I start building this? [23:12] sechrist: xd at kenny's response [23:13] SubStack: or perhaps scoped monkey patching would be a better next mini-project [23:13] SubStack: (Array could use some stuff) [23:13] felixge: ok, I found it I think [23:13] felixge: will have a fixed patch in a sec [23:13] sechrist: node worker looks interesting -- I haven't looked at it's code. Are there shared memory spaces and locks/mutexes? [23:14] _ry: felixge: fix that global var leak too? [23:14] felixge: _ry: sure [23:14] _ry: felixge: http://gist.github.com/408253 [23:14] felixge: _ry: is the c-ares test supposed to run long? [23:15] _ry: felixge: no not really - it does a dns look up [23:17] felixge: _ry: it's hanging forever for me [23:17] felixge: _ry: weird [23:17] pedrobelo: ok this is my test case: http://gist.github.com/408254 [23:17] felixge: all other tests pass now [23:18] pedrobelo: it works the way it is, but if you change line 20 it freezes [23:18] pedrobelo: what stupid thing am I doing? heh [23:22] mjr_: pedrobelo: does line 13 print? [23:23] pedrobelo: mjr_: yep [23:23] hassox has joined the channel [23:23] felixge: _ry: http://github.com/felixge/node/commit/79f5267fa26d4e10463907010dec6377398bff83 [23:23] felixge: _ry: http://github.com/felixge/node/commit/79f5267fa26d4e10463907010dec6377398bff83#L1R95 [23:23] felixge: was the problem [23:23] mscdex: maushu: you should remove the ">" after the link to the SO question, otherwise autolinking causes it to be embedded in the link [23:23] maushu: mscdex, drat. [23:23] felixge: I was using fs.read instead of fs.readSync [23:23] felixge: stupid me :) [23:25] maushu: mscdex, you have a silly client if it does that. [23:26] maushu: Btw, it seems to be a complete success. felixge answered the question. :p [23:26] mjr_: pedrobelo: I don't know why that doesn't work. [23:26] maushu: He wouldn't have if the bot didn't announce it me thinks. [23:27] saikat` has joined the channel [23:30] StackNode has joined the channel [23:30] maushu: !so-last [23:30] StackNode: Latest Question: "how do i create a non-blocking asynchronous function in node.js?" by Richard. < http://stackoverflow.com/questions/2878008/how-do-i-create-a-non-blocking-asynchronous-function-in-node-js > [23:30] _ry: felixge: okay [23:30] maushu: Perhaps I should parse the url to make it smaller. [23:30] mjr_: I wouldn't have signed up for an SO account if the bot didn' link it. [23:31] maushu: mjr_, yeah, SO should pay me to advertise them. [23:31] maushu: :p [23:31] maushu: Anyways, I'm going to short the url, doesn't need to have the title of the url. [23:32] _ry: maushu: real urls are better [23:32] _ry: maushu: take out the < > chars [23:32] maushu: _ry, ...you mean with the whole title? [23:32] pedrobelo: mjr_: thanks for taking a look [23:32] _ry: maushu: sure [23:33] _ry: maushu: i think it's a good idea [23:33] maushu: It's huuuuge! [23:33] _ry: it'll make us be more engaging [23:33] felixge: maushu: yeah this is nice [23:33] maushu: ACTION facepalms. [23:33] bmeck has joined the channel [23:33] felixge: some people just don't hang out in IRC [23:33] StackNode has joined the channel [23:33] pedrobelo: well. I'll make another node app to make the rest call and spawn it heh [23:33] maushu: !so-last [23:33] StackNode: Latest Question: "how do i create a non-blocking asynchronous function in node.js?" by Richard. http://stackoverflow.com/questions/2878008/how-do-i-create-a-non-blocking-asynchronous-function-in-node-js [23:34] inimino: maushu: so just linking to /questions/2878008/ would work too? [23:35] CIA-74: node: 03Felix Geisendörfer 07master * rc93e0aa 10/ (5 files in 4 dirs): [23:35] CIA-74: node: Deprecate string interface for fs.read() [23:35] CIA-74: node: This patch makes buffers the preferred output for fs.read() and [23:35] CIA-74: node: fs.readSync(). The old string interface is still supported by [23:35] CIA-74: node: converting buffers to strings dynamically. This allows to remove the [23:35] CIA-74: node: C++ code for string handling which is also part of this patch. - http://bit.ly/93gGPt [23:35] maushu: inimino: Yes, but _ry doesn't like it. [23:35] SubStack: buffers \m/ [23:35] maushu: I agree since it works pretty well for some browsers. The size makes me twitch though. [23:35] mscdex: buff furs [23:35] inimino: maushu: I think he was talking about url shorteners [23:35] maushu: ... [23:36] mscdex: like bit.ly [23:36] maushu: _ry, were you talking about url shorteners? [23:37] maushu: inimino, They put the whole title there so that people know something about the question. [23:38] maushu: It's a way to prettify urls where there is a large number contents that would be impossible to use "normal" pretty urls. [23:38] inimino: yeah, and if it already has the title once in the post... make it easier for people to copy and paste from IRC [23:38] inimino: yeah, and the title of a question can change [23:38] maushu: If some people didn't have such half-assed irc clients. :p [23:39] maushu: The url changes when the question changes. [23:39] _ry: maushu: yes - don't use url shorteners [23:39] maushu: _ry, I meant just the base url without the title. [23:39] maushu: I don't like url shorteners either. [23:39] maushu: Like this: http://stackoverflow.com/questions/2878008/ [23:40] bradleymeck has joined the channel [23:43] StackNode has joined the channel [23:43] maushu: !so-last [23:43] StackNode: Latest Question: "how do i create a non-blocking asynchronous function in node.js?" by Richard. http://stackoverflow.com/questions/2878008 [23:43] maushu: Like this. [23:45] smtlaissezfaire has joined the channel [23:46] wilmoore has joined the channel [23:49] mjr_: I like that format better. [23:49] mjr_: Now can you make it so that SO doesn't have so many ads? [23:51] MattJ: It was fine until they started putting the horizontal banner ads between answers [23:52] MattJ: Now I don't use it, except when told to by Google [23:52] mjr_: When Google demands something, you must obey. [23:53] MattJ: Undoubtedly [23:53] felixge: MattJ: adblock? [23:54] MattJ: Some of us don't use Firefox :) [23:54] mjr_: Yeah, I really only see the ads when I use Safari/WebKit. Chrome/FF have ad blockers that are pretty good. [23:54] MattJ: I use Epiphany w/ webkit [23:56] mscdex: there's always privoxy and/or /etc/hosts [23:56] mscdex: :P [23:56] mjr_: Let me go figure out what that is before I get back to having opinions about ads. [23:56] admc has joined the channel [23:56] Aria has joined the channel [23:56] rednul has joined the channel [23:57] Aria has joined the channel