[00:00] stagas has joined the channel [00:00] sechrist: hmm [00:00] sechrist: is there any info I can get from process [00:00] sechrist: like num of polling events or something? [00:01] markwubben has joined the channel [00:04] maushu: cpu leak? lol [00:04] sechrist: polotek: I don't think it's in streaming_json_parser.js [00:04] matthew_y has joined the channel [00:06] mscdex has joined the channel [00:06] sechrist: yeah I have no idea what is going on [00:06] sechrist: this is simple stuff [00:08] polotek: turned off emitting in my lib [00:08] polotek: no change [00:08] polotek: so it's gotta be the network [00:09] _announcer: Twitter: "Web-development / Bespin perehodit of node.js http://url4.eu/3iP6P" [bg]-- RotaPost ✔ . http://twitter.com/RotaPostSEO/status/14656697451 [00:10] vnguyen has joined the channel [00:11] _announcer: Twitter: "Node.js is a toolkit for writing high-performance network servers in JavaScript. http://j.mp/aJLeQd"-- Frodo. http://twitter.com/skyizblue/status/14656836648 [00:11] polotek: 99% cpu [00:12] polotek: holding at ~60MB ram [00:12] polotek: no emitting [00:12] polotek: no output [00:12] sechrist: .. [00:12] sechrist: wat [00:13] sechrist: fuuuuu [00:14] sechrist: polotek: by network do you mean the network library in node or slow twitter? [00:14] JimBastard has joined the channel [00:14] sechrist: surely it would be idle during no i/o [00:14] JimBastard: ahhh [00:14] JimBastard: is http://webchat.freenode.net/ down for anyone else [00:14] CIA-76: node: 03Ryan Dahl 07master * re97a481 10/ lib/repl.js : Destroy REPL pipes instead of shutting down. - http://bit.ly/9v3XYG [00:14] sechrist: indeed [00:14] JimBastard: dammit, we need to get node-chat proxying to IRC already [00:15] JimBastard: i gotta make a list of opensource todo's that i have no intention of doing myself [00:15] ryah: JimBastard: seriously [00:15] sechrist: polotek: what node are you on .96? [00:15] ryah: what's taking so long? [00:15] ryah: :) [00:15] polotek: v0.1.96-6-gab5c0dd [00:15] JimBastard: ryah , working on many many libs :-( [00:15] JimBastard: also, repping nodejs as hard as i can everywhere [00:15] sechrist: polotek: i'm lazy so i'm still on v0.1.95-27-g78be1e4 [00:16] sechrist: but yeah wtf at this [00:16] JimBastard: im making rails fanboys shit their pants on the daily [00:16] sechrist: I just show hardcore engineers the http proxy that scales ridiculously in 20 lines of code [00:16] sechrist: and they go wat [00:16] mscdex: JimBastard: there's a Wishlist on the node wiki [00:17] _announcer: Twitter: "Interesting read: YUI Theater — Ryan Dahl: “Introduction to NodeJS” (58 min.) - http://is.gd/cnOVl"-- Alex Hall. http://twitter.com/devseo/status/14657132375 [00:17] JimBastard: word life [00:17] maushu: JimBastard, you could rep by making the wikipedia page better. :p [00:17] JimBastard: im on it [00:18] ryah: JimBastard: good good. we like pants shitting. [00:18] creationix: hello everyone [00:19] ryah: hi mr tim [00:19] vnguyen: hi [00:19] creationix: ryah: so when do I get to ride the train up and see your place? [00:20] polotek: ryah: did you contemplate my reference issue any more? [00:20] ryah: creationix: oh, whenever :) [00:20] JimBastard: hey creationix [00:21] Phazm: http://pastebin.com/3ku69NWH -- Why is 0.1.93-24-gea37d98 not >= 0.1.93 for npm? :'( [00:21] creationix: hey JimBastard, new job and moving has had me very busy [00:21] JimBastard: west coast? [00:21] creationix: JimBastard: btw, I finally got paid for the New York job [00:21] creationix: JimBastard: yeah, Palo Alto [00:21] JimBastard: did you bring the fam? [00:21] creationix: yep [00:21] ryah: polotek: not much. a little. [00:21] JimBastard: congrats man [00:21] JimBastard: :-) [00:21] JimBastard: you deserve it [00:22] polotek: ryah: I'm moving forward with my original setup [00:22] polotek: just gotta change that macro into an inline function [00:22] ryah: polotek: i feel that these xmlNode objects should be temporary [00:23] ryah: like you should just drop the JS ref to them [00:23] _announcer: Twitter: "Bespin is moving to http://bit.ly/augHur - http://bit.ly/b9Fgvv #bespin #mozilla #nodejs"-- Raju Gandhi. http://twitter.com/looselytyped/status/14657495960 [00:24] polotek: ryah: thought about that. but how would I make sure that they get collected? [00:26] ryah: polotek: so, like, when you xmlFirstElementChild() [00:26] ryah: (bare with me, i don' tknow the API) [00:26] ryah: you get a xmlNode back [00:26] polotek: yuh [00:26] ryah: how do you dispose of that reference? [00:26] ryah: (at the c api level) [00:27] polotek: all of the libxml funcs are wrapped in a method on my C++ object [00:27] polotek: so I never return xmlNode directly [00:27] polotek: always the C++ object [00:27] polotek: which has the public api methods on it [00:27] polotek: and also a destructor [00:28] ryah: what is the destructor? [00:28] polotek: so when the persistent handle is collected [00:28] polotek: it calls that destructor [00:28] polotek: well here's the funny part [00:28] ryah: the libxml destructor, what's that? [00:28] polotek: which took me a while to get [00:28] polotek: (not my lib originally) [00:28] polotek: the node destructor does nothing [00:29] polotek: it used to call xmlFree, but there's no way to tell if you're actually done with the xmlNode [00:29] polotek: because it can be removed from one doc and inserted in another [00:29] polotek: so the node destructor does nothing [00:29] polotek: the Document destructor [00:29] polotek: frees the libxml document [00:29] ryah: ah, xmlFreeNode() [00:29] polotek: which frees the entire node tree [00:30] polotek: so actually all of hte xmlNode structs stick around until the document is collected [00:30] ryah: right - so what i think you should do [00:30] ryah: is lazily create these xmlNodes [00:30] ryah: give them all a JS hidden reference to the document [00:30] ryah: (so that that the document cannot be destructed before the nodes) [00:31] ryah: so each time you get a new xmlNodePtr - you just create a new JS object [00:31] ryah: a new wrapper [00:31] ryah: js objects are throw away, you know [00:32] grahamalot has joined the channel [00:32] polotek: okay, but still, how do I know when to free the nodes? [00:32] polotek: they can't be freed when the js object goes away [00:32] polotek: they should only be freed when they aren't in any node tree AND there's no js reference to them [00:33] ryah: can they not just be dropped? [00:33] ryah: do you really have to call xmlFreeNode() for each xmlNodePtr you get? [00:33] polotek: yup :) [00:34] ryah: okay - so call that in the destructor of the JS wrapper [00:34] polotek: I need to read up on how the smart pointer works [00:34] ryah: but you should put a ref in each Node object to the parent [00:34] derbumi has joined the channel [00:35] ryah: e.g. xmlNode_handle->Set(String::New("doc"), xmlDoc_handle); [00:35] bigwavejake has joined the channel [00:36] ryah: polotek: actually [00:36] ryah: polotek: you should look at AddObjectGroup() [00:36] polotek: all of that is set up right now [00:37] ryah: polotek: http://github.com/ry/node/blob/e97a481785dc5920336f46c7b29c6d9ff5fe974b/deps/v8/include/v8.h#L2491-2499 [00:38] ryah: that sounds like what you need [00:38] technoweenie has joined the channel [00:38] polotek: hmmmm [00:39] ryah: in fact, that's probably made for this use-case [00:39] ryah: where you don't really want to recreate the tree with wrappers [00:39] ryah: but you don't want random parts GCed [00:41] ryah: polotek: http://www.google.com/codesearch/p?hl=en#v5ZiNKGt6cw/WebCore/bindings/v8/V8GCController.cpp&q=AddObjectGroup%20lang:c%2B%2B&sa=N&cd=6&ct=rc&l=333 [00:41] _announcer: Twitter: "Bespin to have Node.js on the serverside ? Javascript everywhere !!"-- Parashuram. http://twitter.com/nparashuram/status/14658523709 [00:43] aaronblohowiak has joined the channel [00:44] softdrink has joined the channel [00:44] polotek: ryah: how is this better than refing and unrefing? [00:45] ryah: polotek: looks easier, probably faster [00:45] ryah: so you create a doc - that's one group [00:46] ryah: each time you create a node you add it to the group [00:46] polotek: yeah [00:46] polotek: and when the doc is freed [00:46] polotek: also release the group [00:46] polotek: so the handles get GCed [00:46] vanstee has joined the channel [00:46] polotek: and free the C++ objects as well [00:47] polotek: cool [00:47] polotek: ryah: are you using this anywhere? [00:47] ryah: polotek: no [00:48] polotek: how did you find out about it? [00:48] polotek: just reading through the api? [00:48] ryah: yeah [00:48] _announcer: Twitter: "Finally getting around to learning some Node.js"-- Scott Becker. http://twitter.com/sbecker/status/14658920120 [00:50] vanstee: anyone else getting an error from the changes to the path module? [00:51] binary42 has joined the channel [00:58] _announcer: Twitter: "http://tinyurl.com/yc4g6gg Express - Node.js Web Development Framework(EXPRESSJS.COM)"-- train_boy. http://twitter.com/train_boy/status/14659441727 [00:58] Phazm: in a standard *nix environment, where is it suggested to clone the node git to? [00:58] Yuffster has joined the channel [00:59] Phazm: my dev server is quite unorganized, just throw all the modules/apps into a single directory [00:59] Phazm: threw* [00:59] mscdex: a subdirectory? :P [01:00] Phazm: not like /home//bin or something? [01:00] polotek: Phazm: doesn't matter where you clone node. make install is going to put the executables in /usr/local/bin [01:01] polotek: or wherever you ./configure [01:01] mscdex: yeah [01:01] Phazm: okay, is there a best practice then? [01:01] Phazm: as far as location goes [01:01] polotek: nah [01:01] polotek: I usually do ~/src [01:01] mscdex: i just have a ~/nodejs [01:02] Phazm: so if I have other apps, like redis, solr and flickcurl, you would put those in ~/src as well? [01:02] mscdex: and make a subdir for node and each module [01:02] polotek: and use npm to install modules into the nodepath :) [01:03] mscdex: heh [01:03] Phazm: polotek: I can't get npm to work, some version conflict: http://pastebin.com/3ku69NWH [01:03] _announcer: Twitter: "Anybody know any _awesome_ js libs to parse binary data? like this?: http://dustin.github.com/2009/10/11/ememcached.html #javascript #nodejs"-- Collin Miller. http://twitter.com/collintmiller/status/14659765801 [01:03] sechrist: polotek just got back [01:04] sechrist: did you dig into that retarded issue? [01:04] sechrist: I couldn't figure it out [01:04] polotek: nah [01:04] polotek: didn't spend much time on it [01:04] sechrist: you took the emitters out and it still did it? [01:04] polotek: ryah: were you around for this convo about the twitter streaming? [01:04] sechrist: did you take the chunked json parsing out too? [01:04] polotek: yeah, no emitters, no output [01:04] polotek: no [01:05] sechrist: I mean I don't see any code that would cause an issue, mysqld [01:05] sechrist: myself* [01:05] maushu: Huh, who was working with binary data here? [01:05] maushu: Something about pcap. [01:05] maushu: Dammit, my kingdom for a log search! [01:06] mscdex: build it into _announcer! :P [01:06] sechrist: node-tcpdump = lul [01:06] mscdex: i think it was mjr_ maybe? [01:06] JimBastard: can someone respond to that guys twitter [01:06] ryah: maushu: http://github.com/mranney/node_pcap [01:06] JimBastard: i dont twitter [01:07] maushu: Drat, thats not it ryah. Something about a packer. [01:07] polotek: JimBastard just shouts really loud at everybody [01:07] maushu: It was somehow related to pcap, don't know how. [01:08] JimBastard: polotek - I call it yell sourcing [01:08] JimBastard: but there is a sweet library for that guy [01:09] polotek: jspack? [01:09] JimBastard: i think ya [01:09] JimBastard: the new one [01:10] maushu: polotek, I think it's that one. [01:10] aaronblohowiak: JimBastard: twits call it "lazyweb" [01:10] polotek: http://github.com/pgriess/node-jspack [01:10] JimBastard: fuuuck i gotta get command line hook.io working [01:11] JimBastard: must focus [01:11] JimBastard: javascript-fu time [01:11] JimBastard: got binary42 inc and matt's already here [01:11] JimBastard: javascript fucking party [01:12] _announcer: Twitter: "@collintmiller This might help http://github.com/pgriess/node-jspack #node.js"-- Graphnode. http://twitter.com/graphnode/status/14660290936 [01:13] JimBastard: and the yell sourcing works [01:13] JimBastard: :-) [01:14] polotek: probably 80% of tweets originate with JimBastard [01:14] aaronblohowiak: polotek: if you relax the definition of originate, 98.7% of tweets source from JimBastard [01:16] maushu: Dammit JimBastard stop that. You're spamming the channel with your tweets. [01:16] mrchrisadams has joined the channel [01:17] polotek: Phazm: you still there? [01:17] polotek: are you running the most up to date version of npm? [01:17] polotek: I don't get your version problem at all [01:19] stagas: question: running node.js in portable ubuntu in windows which is based on coLinux, isn't that like running natively? since there is no virtualization or anything...? [01:21] liucougar: colinux is kind of virtualization [01:23] pgriess has joined the channel [01:23] stagas: "Cooperative Linux is the first working free and open source method for optimally running Linux on Microsoft Windows natively" [01:23] stagas: ? [01:24] pgriess has joined the channel [01:25] Aria: Hehe, yep. [01:25] Aria: Though it's relatively efficient virtualization [01:26] ditesh|cassini has joined the channel [01:26] maushu: FIRE THE HARPOONS! [01:27] stagas: lol [01:28] aaronblohowiak: you just made a nice guy lose his job, mashu. [01:28] sechrist: andlinux [01:28] sechrist: is colinux forked and improved [01:29] maushu: aaronblohowiak, how so? [01:30] aaronblohowiak: mashu: here in the states, fire is used to terminate someone [01:30] maushu: ... [01:30] aaronblohowiak: it was a terrible pun, sorry [01:30] mikeal has joined the channel [01:30] maushu: You are going to punhell. [01:31] sechrist: the harpoons really didn't deserve his job anyway [01:31] sechrist: polotek: the problem is the chunk parser [01:31] sechrist: it's apparently dumb [01:31] aaronblohowiak: some1 needs to write a better irc client for the browser based on node.js [01:31] polotek: sechrist: ? [01:31] sechrist: I stopped the climb [01:31] polotek: doesn't really surprise me [01:31] polotek: but howso? [01:32] sechrist: by commenting everything out of receive [01:32] polotek: so just passing the chunks from twitter works fine? [01:32] sechrist: what no the module is non-functioning [01:32] polotek: but collecting them into tweets causes cpu pegging? [01:32] sechrist: this just proves it's not ryan's fault :) [01:32] admc has joined the channel [01:32] sechrist: it's the chunk parser failing [01:33] polotek: when you say chunk parser? you mean in the lib? [01:33] sechrist: yeah the code in p.prototype.receive [01:33] polotek: that processes it into json tweets? [01:34] sechrist: make it empty [01:34] sechrist: yesh [01:34] sechrist: cpu usage for me starts out at like 4 [01:34] sechrist: then goes down as low as 0.5 [01:35] sechrist: and stays there [01:35] polotek: damn your'e right [01:35] polotek: wait, there it goes [01:35] polotek: still going upo [01:35] sechrist: what [01:35] sechrist: not for me O.o [01:35] polotek: wait, my fault [01:36] polotek: running again [01:36] sechrist: i'm staying right at 0.6 [01:36] sechrist: that's all relative but yeah [01:36] sechrist: 0.5 [01:37] polotek: yeah [01:37] polotek: you're right [01:37] polotek: gotta look at this parser [01:38] sechrist: one of the things I think might be happening is it's keeping the buffer and it has to retokenize it [01:38] sechrist: which would explain exponential cpu usage [01:38] sechrist: but I don't see that in the codez [01:38] polotek: it is dumb [01:38] polotek: I'm seeing lots of inefficiency now [01:38] polotek: that I'm looking for it [01:38] polotek: I'll work on it [01:38] sechrist: i'm a jsnub so yeh [01:38] sechrist: awesome [01:39] sechrist: but yeah the lib is literally unusable for streams at any sort of velocity, idk how he didn't catch this [01:40] polotek: well he told me he's not working on node-twitter at all [01:40] polotek: twitter-node rather [01:41] polotek: I'm sure he never used it for anything substantial [01:41] sechrist: do you have firehose as well? [01:41] polotek: I'll work on improving the parser for evented-twitter [01:41] polotek: it won't be tonight though [01:41] polotek: nah I don't need the firehose [01:42] sechrist: firehose kills it within a few mins [01:42] sechrist: ah ok [01:42] polotek: I haven't used my lib for anything substantial yet either [01:42] sechrist: a common keyword in the filter would work [01:42] sechrist: to get a shitload of tweets [01:42] sechrist: default rate is 50/s iirc [01:42] polotek: yeah I usually just use "twitter" [01:43] polotek: could also use "bieber" [01:44] ditesh|cassini has joined the channel [01:47] keyvan has joined the channel [01:54] mscdex: argh! websockets aren't working in socket.io, at least on latest chromium [01:54] mscdex: what's the best way to debug websockets? :S [01:56] rictic has joined the channel [01:57] inimino: mscdex: wireshark or tcpdump [01:57] bpot has joined the channel [02:00] aaronblohowiak: mscdex: the node-websocket-server fellow recently had a similar issue. i think it is draft76 [02:00] mscdex: yeah i'm thinking so too [02:00] aaronblohowiak: mscdex: http://github.com/miksago/node-websocket-server/commit/76d19167fa1a3cf5cc51409681ba018f4deff2b2 [02:05] Phazm: polotek: I ended up mv'ing node to another dir and recloning and it worked.. I think I just don't know how to use git :-/ [02:06] Phazm: i thought git stash && git pull would get the latest version? [02:08] ncb000gt has joined the channel [02:08] aaronblohowiak: Phazm: it depends on your current working branch and that may not be merging changes from remote into your local master [02:08] aaronblohowiak: dinner time!!! [02:08] Phazm: I git clone from the master head or whatever -- git://github.com/ry/node.git [02:11] JimBastard_ has joined the channel [02:15] _announcer: Twitter: "Little bit of node.js http://bit.ly/c67UQB"-- Bruno Pedroso. http://twitter.com/brunopedroso/status/14663909780 [02:16] steadicat has joined the channel [02:23] wilmoore has joined the channel [02:24] mscdex: is there an md5 binary hash function for nodejs out there? [02:25] JimBastard_: yeah mscdex [02:26] mscdex: where at? [02:27] mscdex: oh wait [02:27] mikeal has joined the channel [02:31] nex3 has joined the channel [02:31] nex3: What's the proper way to block until some event occurs? [02:33] halorgium: nex3: have a callback which is called when that event occurs ;) [02:33] nex3: :p [02:33] halorgium: setup(function () { rest.of.script() }); [02:34] nex3: I'd really rather not nest the rest of my script in a function... [02:34] polotek: nex3: why do you need to block? [02:35] polotek: instead of that, why do you have your calling code wait on an event from your script? [02:35] nex3: I'm just writing a little script for moving around some files [02:35] polotek: so when you get your sub-event, finish your work and emit "done" or whatever [02:35] nex3: Some of the file-moving stuff involves complex async code that node would be great for [02:35] nex3: But before I do that, there's some sequential stuff I want to do [02:36] nex3: And I'd like to write that without having to nest the rest of my script in a function... [02:37] JimBastard_: LOL [02:37] JimBastard_: hi nex3 [02:37] JimBastard_: welcome to control flow 101 [02:38] JimBastard_: there are some good articles on howtonode.org [02:38] JimBastard_: if you need easy stuff you should setup the "Step" library [02:38] JimBastard_: if you have some event-fu just dive into the EventEmitter module built into node (its on in the docs) [02:38] nex3: Are they all to the effect of "You really don't want to block, just use callbacks"? [02:39] nex3: I've looked into it a little [02:39] nex3: I don't think the JS-level EventEmitter stuff is sufficient to actually block [02:39] nex3: What I really want is process.unloop, but that's going to go away [02:39] JimBastard_: uhhh [02:39] JimBastard_: thats not what you really want [02:40] nex3: Okay, so what do I want? [02:40] JimBastard_: if you need easy stuff you should setup the "Step" library [02:40] JimBastard_: there are some good articles on howtonode.org [02:41] jwm: what was that url one more time? [02:41] JimBastard_: i dunno though this is my first day here [02:41] JimBastard_: im kinda new [02:41] halorgium: ACTION chuckles [02:41] nex3: Step still requires me to wrap the sequential stuff in a function [02:42] nex3: Which is fine if that's the only way to do it [02:42] aaronblohowiak: nex3: that is the way you should do it [02:42] JimBastard_: its a way to do it [02:42] nex3: I was just curious if there was a way to actually block [02:42] aaronblohowiak: nex3: what is your native language? [02:42] aaronblohowiak: nex3: actually blocking is antithetical to node [02:42] nex3: Right, I get that [02:42] nex3: Nevertheless I want to do it :p [02:42] aaronblohowiak: nex3: you could write a js preprocessor [02:43] nex3: Haha [02:43] nex3: I don't care that much [02:43] aaronblohowiak: :) [02:43] nex3: I'll just use Step, I suppose [02:43] JimBastard_: http://en.wikipedia.org/wiki/Event-driven_programming [02:43] JimBastard_: ^^^ [02:44] aaronblohowiak: nex3: node.js works fine with coffeescript if you dont like js [02:44] nex3: I understand the paradigm, don't worry about that [02:44] nex3: I'm perfectly aware that what I want is antithetical to it [02:44] aaronblohowiak: okie dokie [02:45] nex3: So what's the recommended package manager for node? [02:45] aaronblohowiak: npm [02:45] aaronblohowiak: only because isaacs hangs out here a lot and will promptly answer your queries [02:45] nex3: Heh [02:46] JimBastard_: NPM [02:46] nex3: Is there a listing of packages available? [02:48] aaronblohowiak: http://registry.npmjs.org/ [02:48] JimBastard_: modules page on the wiki [02:48] aaronblohowiak: that is good if you have a good way to read js [02:48] aaronblohowiak: ;) [02:48] JimBastard_: the package managers are still a few months away [02:49] nex3: Aw, step isn't packaged [02:49] JimBastard_: my friend doesnt like you, i dont like you either [02:51] aaronblohowiak: nex3: git clone.. [02:51] aaronblohowiak: nex3: also, tim will probably accept a package [02:51] nex3: The question is, will he maintain it? [02:52] nex3: Because I don't have the cycles to maintain a package of someone else's code in a language I don't use that often :p [02:53] polotek: http://npm.mape.me/ [03:03] houdini1 has joined the channel [03:07] JimBastard has joined the channel [03:07] JimBastard: whats the danger of prototyping Date [03:08] stevendavie has joined the channel [03:08] JimBastard: assume browser [03:08] kriskowal has joined the channel [03:09] matthew_y has joined the channel [03:09] Tim_Smart has joined the channel [03:12] alexiskander has joined the channel [03:14] nex3: There, all packaged :) [03:14] nex3: And pull request sent [03:15] mscdex: ok, so for some reason the 'data' event isn't firing for an http request with a binary body [03:17] mscdex: even though i can see the data being sent via wireshark [03:18] PyroPete1 has joined the channel [03:18] ryah: mscdex: hm [03:18] ryah: mscdex: are you sure? that sounds unlikely [03:19] mscdex: i'm continuing to debug, but i attach a listener at the request's 'data' event right inside the the http server creation function [03:19] mscdex: and it never fires [03:19] igorgue_ has joined the channel [03:20] ryah: mscdex: hm [03:20] igorgue_: var data = JSON.parse('{"name": "\"igor\""}'); [03:20] ryah: mscdex: what kind of request? [03:20] igorgue_: doesn't work [03:20] igorgue_: why??? :( [03:21] mscdex: http.serverrequest [03:22] mscdex: oh wait [03:22] ryah: mscdex: i meant more like - what is it? GET? [03:23] mscdex: ryah: it's for an upgrade request [03:24] quirkey has joined the channel [03:26] robby has joined the channel [03:26] nex3: JimBastard: So, when using step, suppose I have one step that computes a value that I want to use throughout the rest of the steps [03:26] nex3: What's the best way to do that? [03:26] nex3: Surely I'm not supposed to pass all such variables along as arguments [03:27] JimBastard: im not helping you anymore until you learn to read [03:27] JimBastard: im too busy today, sorry friend [03:27] JimBastard: if you have any questions about where to find modules or libraries ill help [03:28] polotek: igorgue_: are you doing this in the repl? [03:29] polotek: because \ needs to be escaped as well [03:29] nex3: I'd be happy to RTFM, but I'm not sure which FM I'm supposed to be Ring [03:29] igorgue_: polotek: repl and in a js file [03:29] polotek: JSON.parse('{"name":"\\\"igor\\\""}') [03:29] nex3: The step docs don't seem to have anything to say on the matter [03:29] igorgue_: ahh yeah? [03:30] JimBastard: coming from the guy who fully understands evented programming but cant compose a simple control flow [03:30] JimBastard: i need to leave again before i scare away the noobs [03:30] JimBastard has left the channel [03:30] mscdex: ryah: it looks like data is not emitted for upgrade requests? [03:30] nex3: How unhelpful :( [03:30] igorgue_: polotek: cool, it works, now I need to replace all \" with \\" on the responses [03:34] polotek: nex3: did you look at the tutorial post on howtonode? [03:34] polotek: http://howtonode.org/step-of-conductor [03:34] polotek: never used Step [03:34] polotek: But might help [03:34] nex3: No, that looks useful, thanks :) [03:36] jedschmidt has joined the channel [03:36] javarants has left the channel [03:37] mscdex: ryah: ok nevermind, it looks like the body is passed in using the upgradeHead parameter of the 'upgrade' event [03:39] ajpiano has joined the channel [03:48] mjr_ has joined the channel [03:48] javarants1 has left the channel [03:54] keyvan has joined the channel [03:59] creationix has joined the channel [04:03] softdrink has joined the channel [04:05] charlesjolley has joined the channel [04:11] ryah: mscdex: ah [04:11] ryah: mscdex: yea, sorry [04:11] ryah: mscdex: is that confusing? [04:11] mscdex: ryah: np [04:12] mscdex: ryah: maybe at the least 'upgradeHead' should be named to 'upgradeBody' if that's what it's always passing in [04:14] cedricv has joined the channel [04:20] nsm has joined the channel [04:31] burrito-eater: i'm about to record my first node.js screencast [04:31] aaronblohowiak: any suggestions about screencast recording software other than ScreenFlow? [04:32] mscdex: is there a way to convert a number in javascript to big endian format? or does it have to be done in a C++ addon? [04:32] mscdex: aaronblohowiak: what platform? [04:33] aaronblohowiak: mscdex: OS 10.6 [04:33] mscdex: aaronblohowiak: oh [04:44] wilmoore_ has joined the channel [04:47] iwasbiggs has joined the channel [04:51] aaronblohowiak: BYE! [04:51] creationix: and aaronblohowiak just left [04:52] creationix: quicktime player does a fabulous job [04:52] brapse has joined the channel [04:55] mjr_: mscdex: you could convert endianness with some awkward JavaScript bitwise operators. [04:55] mscdex: mjr_: that's what i'm trying to figure out now :\ [04:56] mjr_: Want me to give you an example? [04:58] mscdex: mjr_: sure. i've been trying to monkey around with this rstr2binb function i found that supposedly does it, but it's not doing it right i don't think [04:59] mscdex: or i'm not using it right [05:06] isaacs has joined the channel [05:12] mjr_: Does this work: http://gist.github.com/412789 [05:12] mjr_: ? [05:13] mjr_: mscdex: there are some other interesting examples here: /usr/include/libkern/_OSByteOrder.h [05:13] stevendavie has joined the channel [05:13] mjr_: assuming you are on OSX [05:13] mscdex: linux [05:13] mjr_: I'm sure there's a similar header file on Linux [05:13] mjr_: But does that swap32 thing work? [05:15] mscdex: no, got a small negative number [05:16] steadicat has joined the channel [05:16] mjr_: what number are you trying to convert>? [05:16] mscdex: numbers like this: 690360391 [05:16] mjr_: and what number do you expect? [05:17] mjr_: 1192240681? [05:17] mscdex: 1192240681 -- yep [05:17] mjr_: oh, whoops [05:17] mjr_: fucked it up [05:17] mjr_: check again [05:18] ncb000gt: ryah: yt? [05:19] mscdex: mjr_: isn't that the same output? [05:19] mjr_: swap16 also known as ntohs swap32 ntohl [05:19] mscdex: oh [05:19] mscdex: i see, let me test [05:19] mjr_: I got that number from running the JavaScript program in the gist. [05:19] mjr_: So I'm pretty sure it works. :) [05:20] mjr_: The first example I had || instead of | [05:23] mscdex: mjr_: still not getting what i'm expecting [05:23] mscdex: do i need swap16 also somehow? [05:23] mjr_: so you if you run the gist as is, you don't get 1192240681? [05:23] mscdex: i tried 197995344 as input and got 548471670 instead of the expected: 1345047819 [05:24] mjr_: yeah, you should be able to swap things back and forth a bunch of times losslessly [05:24] mjr_: assuming nothing gets corrupted in the bitwise magic [05:24] mjr_: oh, wait, that's a different thing [05:25] isaacs: hey, i had a crazy idea, and i need someone to tell me if i'm smoking the crack or if this is really as awesome as it seems. [05:25] mjr_: isaacs: are those the only two choices? [05:25] isaacs: mjr_: it's not an xor [05:25] mjr_: great [05:25] ncb000gt: lol [05:25] isaacs: i'm thinking about making each npm install act as a registry, using its cache as the data store. [05:26] isaacs: since i'm already caching the package.json data, the tarball, and the untouched thing in the cache. [05:26] isaacs: then i could do something like install from a folder on one machine, then start the registry, adn then install from that machine on a second machine. [05:26] nex3: I want to recursively remove a directory before the script exits [05:26] isaacs: nex3: http://github.com/isaacs/npm/blob/master/lib/utils/rm-rf.js [05:26] mscdex: nex3: rm -rf ;-) [05:26] mscdex: heh [05:27] nex3: Ooh, exciting [05:27] ncb000gt: nex3: be careful! [05:27] nex3: And that'll work in an "exit" listener? [05:27] JimBastard has joined the channel [05:27] isaacs: nex3: not sure. [05:27] nex3: It looks like it won't... [05:27] isaacs: nex3: replace all the fs.foo calls with fs.fooSync [05:27] isaacs: and replace the callbacks with returns [05:27] mjr_: mscdex: I get the expected results on my computer: http://gist.github.com/412789 [05:28] nex3: Oh, okay [05:28] JimBastard: ive been battling so hard with making this library. its sooo frustrating!!!!!!!!! yaaargggggggg [05:28] JimBastard: the code is simple as pie, its making it simple and easy to use thats fucking hard [05:28] isaacs: so, mjr_, awesome or crack? [05:29] nex3: Thanks! [05:29] mjr_: isaacs: I THINK it is awesome, but package management is something that I'm glad smart people like you are figuring out. It's an abstraction layer that I'm content to sit above. [05:29] isaacs: grrr that's not helpful. [05:29] mjr_: Instead I'm spending my cycles contemplating bitwise operations. [05:30] isaacs: the thing i'm not so crazy about doing would be managing the user auth stuff that couchdb gives me for free. [05:30] mjr_: Which I have to do for packet decoding anyway. [05:30] isaacs: also, i could do some interesting searching stuff, and adding new views and whatnot is so nice. plus, replication. [05:30] isaacs: but nothing says that i can't have both. [05:30] mscdex: mjr_: still no dice. input = 320791631. output = 2015494144. expected = 1340349971 [05:30] mjr_: mscdex: what kind of computer? [05:30] mscdex: 64-bit [05:30] isaacs: so you could have a circle of peers that all pull from each other or from some central repo [05:31] mjr_: isaacs: I like the idea of not depending on a central anything. [05:31] mscdex: also using 542192269 as input gave me a large negative number using swap64 [05:31] isaacs: mjr_: yeah, it's more gitlike [05:32] mscdex: -614400000 to be precise [05:32] mscdex: :/ [05:32] isaacs: mjr_: it's also more in keeping with the idea of "node" as a piece of a network that forms a big internet file system io graph or something [05:32] isaacs: like a node in a map [05:33] polotek: isaacs: how would one instance know about the others? [05:33] mscdex: bah! why couldn't they just make network byte order little endian! [05:33] isaacs: polotek: you'd tell it [05:33] mscdex: ACTION shakes a fist [05:33] polotek: so it's more like having mirrors of the registry [05:33] mjr_: mscdex: I run this program on my Snow Leopard MacBook Pro, my 32-bit Ubuntu 9.10 machine, and by 64-bit Ubuntu 9.10 machine, and I get the same result. [05:33] isaacs: polotek: like, set multiple registries, one of them is a local peer server [05:34] polotek: isaacs: and what are the benefits again, besides saving some networking? [05:34] ncb000gt: isaacs: i think that is a good way to go and you can work it into the "install" to have it auto replicate with some master servers since you're doing this with couch [05:34] mscdex: mjr_: so what do you get from swap64 on a 64-bit machine with 320791631 as input? [05:34] mjr_: Having an easy way to build a local replica of packages you depend on is pretty important. [05:34] polotek: not being facetious [05:34] isaacs: polotek: and, have a repl sitting and waiting, so you can log in and issue install commands to a server that's actually installing things in a bank of parallel node instances. [05:35] isaacs: polotek: well, it would be easier for instance to install a folder (without publishing) and then easily also install to a bunch of other computers on the network [05:35] mjr_: isaacs: the problem of "packages we depend on have disappeared from their hosting location" is a big issue, which it sounds like this idea would solve. [05:35] isaacs: mjr_: or at least, provide a bit of buffer against [05:36] mjr_: isaacs: sure, if you took the right steps to utilize it. [05:36] ncb000gt: ryah: nevermind, I learned how to read. all is well. [05:36] mjr_: mscdex: oh, lookee here, swap64 is sad. [05:37] mscdex: mjr_: ? [05:37] polotek: isaacs: I think I'm too tired to understand [05:37] mjr_: mscdex: swap32 seems to work exactly as expected though. Are you SURE you need swap64? [05:37] polotek: but it sounds cool :) [05:37] isaacs: polotek: well, you know how you can git clone right from another git folder (even on another machine)? [05:38] mscdex: mjr_: i'd need swap64 to be 64-bit compatible right? [05:38] polotek: yeah, as long as you can reach it on the network [05:38] isaacs: you'd be able to do an npm install --registry http://othermachine.local:8000/ foo [05:38] mjr_: mscdex: only if you are dealing with 64 bit numbers. [05:38] isaacs: polotek: provided that you did npm registry start on the other machine [05:38] mscdex: hmm [05:38] polotek: so essentially people could host their own code and it would still work with npm [05:38] mjr_: mscdex: and if you are, OK then, you'll need it, but a lot of data that is moved over the network is 32 bit or less. [05:38] isaacs: polotek: right [05:38] isaacs: polotek: and all they'd need to do that is npm itself [05:39] polotek: sounds like a versioning headache though [05:39] polotek: but then again npm manages versions through package.json [05:39] polotek: so all that info would come with the package [05:39] isaacs: polotek: but i'm already managing all that already. yes, it's a bit of a headache, but not a terrifically hard one to solve. [05:40] polotek: if you pulled the same version from two different registries what happens? [05:40] isaacs: polotek: well, npm would assume that they're the same thing if they have the same name/version [05:40] matthew_y has joined the channel [05:40] isaacs: you'd have to clear the cache to fetch a different one [05:40] polotek: so it would overwrite? not opposed to that as long as it's clear [05:40] isaacs: it's already fairly network efficient. [05:40] isaacs: no, it'd go "oh, i already have that, i'll just install this thing i have" [05:41] isaacs: which actually sucks sometimes, that's why there's a npm cache clean function [05:41] polotek: right, but if you gave --force or something it would reinstall from the new location [05:41] polotek: and overwrite the previous [05:41] mscdex: i dunno what it is, i'm still not getting the right numbers, even with swap32 [05:41] mscdex: blargh [05:41] isaacs: polotek: there's a difference between "what's installed" and "the cache" [05:41] mscdex: i'm about ready to try to write a node addon just to do this [05:42] joshbuddy has joined the channel [05:42] polotek: registry cache, yeah I get that [05:42] isaacs: polotek: in the cache there's a "package" folder, the parsed package.json file, and a package.tgz file for every version that it has fetched [05:42] polotek: but I'm thinking of this scenario [05:42] polotek: you installed form local registry [05:42] polotek: or whichever one you have configured [05:42] olegp has joined the channel [05:42] isaacs: right [05:42] polotek: you messed with the code or maybe it was a bad package from some dbag [05:42] isaacs: oic [05:42] polotek: so you just want to reinstall from a canonical location you trust [05:42] isaacs: you uninstall, then install. [05:43] isaacs: if you try to install something you have already, it goes "that's already installed, nothing to do" just like any other package manager. [05:43] polotek: yeah, amounts to the same thing. but more explicit so you don't have to wonder [05:43] polotek: fine with that [05:43] polotek: it was a contrived example anyway [05:43] polotek: I say do it [05:44] polotek: worst case scenario, nobody'll use it :) [05:45] polotek: you could use it for deployments [05:45] polotek: that'd be cool [05:45] JimBastard: is Kris Kowal the same one who is in here [05:45] JimBastard: kriskowal: [05:45] JimBastard: is this yours : http://stevenlevithan.com/assets/misc/date.format.js [05:45] isaacs: JimBastard: i know of only one kriskowal [05:46] kriskowal: JimBastard, i sent steven a patch for that some years ago. [05:46] JimBastard: :-) i might steal [05:46] JimBastard: testing now [05:46] mjr_: mscdex: what do you expect from swap64(320791631) ? [05:47] polotek: sweet, passed my C++ hurdle for the day. [05:47] polotek: function templates suck [05:47] hammerdr has joined the channel [05:47] polotek: but they are damn useful [05:47] mscdex: mjr_: 1340349971 [05:47] polotek: g'night folks [05:48] polotek has left the channel [05:49] hammerdr: Hey :) I'm having just a bit of trouble getting starting with modules. I come from a Narwhal/CommonJS background and I figured that Node.js would be interoperable with those modules. However, I'm not finding any documentation about how I can install modules as part of my local node.js stack. Am I missing something? [05:50] kriskowal: modules are the same. packages are different. [05:50] JimBastard: hammerdr: if its a commonjs module, you just require() it? [05:50] mape: hammerdr: Add them to .node_libraries [05:50] mape: in your home dir [05:51] kriskowal: they're structurally the same, but node doesn't do the whole automatic package discovery thing. you have to move the modules into the node path manually. [05:51] hammerdr: kriskowal: so could I set the .node_libraries path to /usr/local/narwhal/packages [05:51] hammerdr: ? [05:51] kriskowal: you can set NODE_PATH [05:52] mape: as long as the .js is in the root there [05:52] isaacs: hammerdr: npm!!!!!!!!!!!!! [05:52] isaacs: hammerdr: http://github.com/isaacs/npm [05:52] kriskowal: isaacs, does npm bring in narwhal packages? [05:52] isaacs: kriskowal: no. you can do npm install narwhal, but it kinda doesn't really work great. [05:53] mscdex: hmmm, i need a big endian 32-bit number anyway, so 64-bit doesn't matter i guess [05:54] kriskowal: hammerdr, as a base case, until you want to buy into tooling, you can definitely set the NODE_PATH to include all of the lib directories of all the packages you need. [05:54] mjr_: mscdex: but I've almost gotten swap64 working! [05:54] kriskowal: or you can port the packages to npm's style. [05:54] hammerdr: does npm handle packages? [05:54] mscdex: :S [05:54] SamuraiJack has joined the channel [05:54] isaacs: hammerdr: yeah [05:54] isaacs: hammerdr: npm is a node package manager [05:55] isaacs: hammerdr: made of new pony munchers [05:55] hammerdr: right.. I mean, does it handle commonjs packages? e.g. http://github.com/chandlerkent/growljs [05:55] mscdex: i'm gonna debug some more and see if there's something i'm doing wrong here that i'm just not seeing... [05:55] isaacs: hammerdr: who never produce mondays [05:55] hammerdr: errr... http://github.com/chandlerkent/growl-js [05:56] kriskowal: looks like that particular package would work with narwhal, and would be a bit weird to use with npm since it doesn't have an index.js [05:56] kriskowal: but it would work, i'm sure [05:56] kriskowal: using it would be different on node with npm. you'd have to do a require("growl-js/growl-js") [05:56] isaacs: kriskowal: you don't need an index.js if you have a "main" in the script. [05:56] kriskowal: i think. [05:57] sh1mmer has joined the channel [05:57] isaacs: kriskowal: yah. hammerdr: you can just add "main" : "./lib/growl-js" to the package.json [05:57] kriskowal: you mean in package.json? [05:57] isaacs: er, yeah, in teh json [05:58] alexiskander has joined the channel [05:58] hammerdr: that sounds like the route I would prefer to use, then :) Though its sad to think that some packages will be installed in two places on my system. [05:58] kriskowal: so, yeah. the difference in approach is that npm sets up a mapping for the package name as a sort of directory in the .node_library (or something else on the require.paths), while narwhal just links its lib into the require.paths [05:58] isaacs: hammerdr: it looks like growl-js is using some narwhal-specific stuff. [05:59] isaacs: hammerdr: first line: var os = require("os"); [05:59] hammerdr: isaacs: it was just an example. I'm not actually going to use that :) [05:59] isaacs: hammerdr: well, as an example, then. if your narwhal package does narwhal-specific stuff (like require("os")) then it won't work in node, at least, not today [05:59] bmizerany has joined the channel [06:00] kriskowal: yeh, there are some tricky issues in porting. you might want to look into using narwhal-lib and narwhal-node packages. require("narwhal/os") works [06:00] isaacs: hammerdr: it *might* kinda work (maybe actually work) if you install narwhal with npm [06:00] mikeal: isaacs: does sax-js not support CDATA? [06:00] isaacs: mikeal: it does. [06:00] mikeal: i'm having issues [06:00] isaacs: mikeal: myParser.oncdata = function (data) {...} [06:00] mikeal: oh shit, it's another event [06:00] isaacs: yeah [06:00] bmizerany: so, can I update the value of a Persitant(http://github.com/ry/node_postgres/blob/master/binding.cc#L10) and have the GC take cafe of the old value? [06:00] isaacs: really need to do that onEvent event [06:01] nex3: Does node have a way of reading unbuffered from stdin? [06:01] nex3: Could be Unix-dependent [06:01] hammerdr: interesting stuff. It's unfortunate that there isn't more interoperability between node and narwhal. I love narwhal for the lightweight scripting but node has some obvious advantages over narwhal for other stuff (like running a server) [06:01] bmizerany: mikeal: isaacs I wonnd up using node-xml and it works wonderfully. http://github.com/robrighter/node-xml [06:01] isaacs: bmizerany: nice [06:01] isaacs: kriskowal, hammerdr: it'd be great if npm gave you some way to add something to the NODE_PATH [06:02] mikeal: isaacs: i saw that issue you added for npm registry start [06:02] mikeal: are you implementing a new registry? or is that some kind of local debug thing? [06:02] isaacs: mikeal: yeah. still not sure if that's stupid crazy or awesome crazy? [06:02] isaacs: mikeal: i'll still have the couchapp, but that would let you install from one machine onto another = [06:02] mikeal: eventually, it would be awesome [06:02] mikeal: but first, I should add replication to node-dirty [06:03] isaacs: well, i mean, it's got a filesystem database of json files already [06:03] isaacs: which is actually organized just like the registry uriss [06:03] isaacs: kriskowal: but since node doesn't read from a conf file or anything, it's tricky [06:03] bmizerany: ryah: got any pointers on my last question? ^^ [06:03] isaacs: hammerdr: +1 [06:04] isaacs: hammerdr: like i said, there's actually not *too* much to make narwhal work on top of npm. if you're willing to add ~/.node_libraries/narwhal/ to your $NODE_PATH env var, then it pretty much works. [06:04] isaacs: *on top of node [06:04] mikeal: oh i see what you mean [06:05] mikeal: so you can get like a webpage for your locally installed packages? [06:05] mjr_: mscdex: I don't think swap64 can be done in a clean one-liner like the others. JS only does bitwise operations on a 32 bit temporary int. You'd need to first divide down the number by 4,294,967,295, and the sign bit may still be problematic. [06:05] hammerdr: isaacs: and that's installing narwhal with npm? or narwhal-lib? [06:05] isaacs: hammerdr: if you do: npm install narwhal@0.0.1, you'll get narwhal-lib and node-narwhal as deps. [06:06] isaacs: hammerdr: in npm's world, "narwhal" is a metapackage that installs the narwhal libs that run on node. [06:06] hammerdr: gotcha. Thanks for all of the info. You've all been extremely helpful :) [06:07] isaacs: :) [06:07] kriskowal: hammerdr yeah, i'm working on mashing narwhal and node together. it's messy but it works. [06:07] mikeal: isaacs: a web page for your locally installed packages would be badass [06:07] kriskowal: i did my whatsupdoc project using node as a narwhal engine this weekend [06:07] isaacs: mikeal: well, less a webpage so much as a js-registry HTTP interface. [06:08] kriskowal: generates static documentation from jsdocish comments http://kriskowal.github.com/narwhal/api/packages.html [06:08] isaacs: mikeal: so i can go over to another machine B, and install there what i just installed on machine A locally [06:08] mikeal: so what would i use it for? [06:08] mikeal: oh i see [06:08] mikeal: that makes sense [06:08] kriskowal: also working on supporting "mappings" which i think is likely to be the common ground specification between narwhal and node. [06:08] hammerdr: kriskowal: does node work well as a narwhal engine? how is it different than the v8 engine project? [06:08] bmizerany: ryah: nevermind. I think I got it figured out. [06:09] isaacs: kriskowal: what exactly do you mean by "mappings"? [06:09] bmizerany: who here knows Ragel well? [06:09] kriskowal: hammerdr, works great; all the node modules work fine, all the narwhal modules are under the narwhal/ name space. [06:09] kriskowal: kriszyp's mappings proposal on commonjs. [06:09] isaacs: kriskowal: is that like the "link" thing that npm has? [06:09] isaacs: kriskowal: http://github.com/isaacs/npm/blob/master/doc/json.md#readme [06:09] kriskowal: very similar [06:09] bmizerany: I want to work on a Node target for Ragel. I started last week, but didn't make it far but have ideas on how to do it, if anyone is interested in hacking here and there [06:09] isaacs: kewl. [06:10] isaacs: kriskowal: i'd like to do away with that feature in npm's package.json. it's weird and doesn't fit with the rest of the API surface. [06:10] isaacs: though i suspect "mappings" would be just as weird. [06:10] hammerdr_ has joined the channel [06:10] kriskowal: mappings is a sort of common ground between the require2 and npm's style. [06:11] kriskowal: http://wiki.commonjs.org/wiki/Packages/Mappings [06:11] kriskowal: not final; the details need some massaging [06:11] kriskowal: and i need to write a prototype to evaluate it. [06:11] isaacs: jar + zipball = fail. http + tgz = win. [06:11] kriskowal: yes [06:12] isaacs: also, it should just be a url to a package tarball or a package.json, or a name+version, or a name + version range [06:13] isaacs: or, just skip the urls, and give me a name and version, and i'll figure it out [06:13] isaacs: and then just link to its main and libs [06:13] isaacs: so much simpler. [06:13] mscdex: ugh, i think i'm done with this websocket challenge md5 generation crap [06:14] mscdex: it's seemingly impossible to do in javascript [06:14] isaacs: and, since you already specified that it has dependencies, you could just map whichever version of "foo" that satisfied the dep. [06:14] isaacs: "mappings" : { "foo" : "./deps/foo" } [06:15] isaacs: gah. you know, if i spent more time on words than on code, i could explain how i've already solved a lot of these problems, and it's not even the start of what's actually tricky. [06:15] isaacs: that sounds really egotistical. whatever. [06:16] nex3: Is there a way to read stdin unbuffered with node? [06:16] JimBastard: should this string be causing readFile to shit itself? [06:16] JimBastard: '…' or "…" [06:16] JimBastard: uffer:46 return this.utf8Write(string, offset); ^ TypeError: Offset is out of bounds [06:19] JimBastard: "…" [06:19] JimBastard: i can work around this easily, its just curious [06:19] JimBastard: i dont understand why it bombs on that [06:19] JimBastard: am i being stupid again? [06:19] hammerdr: isaacs: i like code better anyway. I can read it quicker than prose :) [06:20] JimBastard: ryah ? [06:21] isaacs: kriskowal: you know, it's funny, but as much as i don't really like require2, npm's folder structure actually kind of gives you a nice require("package/module") for free. [06:21] JimBastard: … [06:21] kriskowal: yeah, i noticed [06:21] JimBastard: ………………… [06:21] JimBastard: there it is [06:21] JimBastard: utf fail? [06:22] pquerna: imagine i'm a dumb javascript programer. cus I am. I kinda want something like Python decorators -- like how django has @login_required around a view -- googling around for javascript decorators.. hasn't produced much :| [06:23] isaacs: pquerna: check out fab and express. http://fabjs.org and http://expressjs.org [06:23] kriskowal: pquerna decorators in python are a shorthand for higher order functions; they're really not necessary in js [06:23] isaacs: er, http://expressjs.com/ [06:23] kriskowal: var blah = decorator(function () {}) does basically the same thing as @decorator [06:24] hammerdr: express is pretty cool, though :) [06:24] JimBastard: … [06:24] admc has joined the channel [06:25] joshbuddy has joined the channel [06:25] b_erb has joined the channel [06:25] isaacs: hammerdr: also, code is more fun to write. [06:25] pquerna: kriskowal: right, and make the decorator return a closure containing the wrapper. [06:26] b_erb: i want to fetch two web pages and then do something with the result. is there a pattern to pick up the different results without chaining everything? [06:31] kriskowal: isaacs, well if prose isn't your cuppa, maybe you ought to write a spec. it's sort of half-way. [06:32] aaronblohowiak has joined the channel [06:32] isaacs: kriskowal: a spec is like the most boring kind of prose. [06:32] isaacs: if i'm gonna write prose, i may as well write an essay or a story or a poem [06:32] isaacs: i'm actually all about writing prose, but you should use languages for what they're good at. [06:32] kriskowal: well, we need one, if mappings won't work [06:33] isaacs: maybe i could just write out what npm does, and why it's awesome and simple and easy to use and gives everybody what they need. [06:33] aaronblohowiak: isaacs: yes! and a link to the package list and you'd be done! [06:33] isaacs: i mean, on this point, i'm actually quite confident that npm's solution is the best choice. [06:34] isaacs: though it would be nice to specify a url as a dependency rather than just a name/version and rely on it being the same thing always [06:34] kriskowal: for your vision of the requirements, i'm sure [06:34] isaacs: right. it's crap for doing web-based modules in a nodule-style, or for browser-based anything. [06:34] isaacs: but for most node users, they want it to run on a machine directly, not in a browser. [06:35] kriskowal: yeh. the full story is sharing code though. [06:35] isaacs: feh. [06:35] isaacs: browsers aren't very much like servers. [06:35] kriskowal: just write about it [06:35] isaacs: ok, i'll add it to my action-items list [06:36] isaacs: :) [06:36] hammerdr: isaacs: the problem with urls is that they don't allow you to specify ranges or forward/backward compatibility [06:36] isaacs: right [06:36] isaacs: hammerdr: but that's actually not a problem. [06:37] isaacs: because npm controls the require.paths that your module sees when it runs, and you can link it into a specific package-internal location, and having multiple versions of the same thing is perfectly fine. [06:37] rictic has joined the channel [06:37] isaacs: in fact, if it always required you to specify a specific version, there'd be no conflicts at all. [06:38] hammerdr: what if I, as a library writer, want to latest and greatest? [06:38] hammerdr: the* [06:38] isaacs: but it is nice to be able to (at least, hypothetically, since this isn't implemented yet) update the deps to the new stable version [06:38] isaacs: right [06:38] hammerdr: e.g. I rely on an XML parsing library and the API is not set to change for a Major version but the speed may be increased substantially [06:39] hammerdr: so I want 2.0.0 <= x < 3.0.0 [06:40] aaronblohowiak: hammerdr: if the api doesnt change then there SHOULD NOT be a major version bump. [06:40] aaronblohowiak: woe to semver [06:40] Tekerson: b_erb, http://pastebin.com/hiMQcN4G Something along this line might be helpful? [06:40] hammerdr: aaronblohowiak: I'm not disagreeing :) [06:40] isaacs: hammerdr: yeah, npm lets you do that [06:41] isaacs: hammerdr: it's on the todolist, but i haven't implemented an "npm update" command that updates dependencies to the latest possible version. [06:41] isaacs: or the newest stable version, i should say [06:41] isaacs: not hard, just needs to be done [06:41] hammerdr: isaacs: how do you do this with urls, then? [06:41] isaacs: hammerdr: if you require a url, you don't get to specify a range, plain as that. [06:41] isaacs: hammerdr: if you say "instal this url for me", i'd just install that url, and expect it to be a package tarball. [06:42] hammerdr: okay :) that sounds reasonable [06:42] isaacs: hammerdr: but if you said, "install version 1-2 of foo for me", then i'd make sure i have that, and install it if i dont [06:42] hammerdr: ranges are a somewhat 'advanced' feature and, to be honest, unreliable in the real world [06:44] b_erb: Tekerson: thanks, i'll have a look [06:50] b_erb: what is that syntactically? that function stuff inside parenthesis? [06:50] b_erb: first of all thanks, that's what i want [06:51] Tekerson: b_erb, it's just using anonymous functions. Some of the () aren't required, just for clarity. [06:52] b_erb: ah ok thanks, never seen that before [06:52] Tekerson: the x = (function() { /*dostuff*/ })(); creates a function and runs it, assigning the return value (in that case, another function) [07:00] mrchrisadams has joined the channel [07:02] kjeldahl_ has joined the channel [07:05] virtuo has joined the channel [07:10] Nohryb has joined the channel [07:10] ctp has joined the channel [07:11] keyvan has joined the channel [07:15] gf3 has joined the channel [07:18] aconbere: mikeal: oops, found a bug in my file util [07:18] aconbere: when mkdirs returns errno 17 we're fine [07:18] aconbere: I pushed the changes to my repository [07:18] aconbere: submitting a pull request [07:19] mikeal: cool [07:20] mscdex: heh... a "get paid to play games" site [07:21] aconbere: anyone know the visionmedia folks? [07:21] mscdex: reminds me of 1999 [07:21] mscdex: :P [07:21] mikeal: folk [07:21] mikeal: it's one dude [07:21] aconbere: ha [07:21] aconbere: a very productive one man apparently [07:21] mikeal: that TJ [07:21] mikeal: er thats [07:21] mikeal: he works at ext [07:22] aconbere: heh [07:22] ajpiano has joined the channel [07:22] aconbere: okay well Iv'e seen him on here [07:22] mikeal: he's not around at the moment [07:22] aconbere: I have package.json patchs for a few of his packages [07:22] aconbere: and he hasn't accepted the pull request yet [07:22] mikeal: he wrote a competing package manager that doesn't use package.json files [07:22] mikeal: so i'm not surprised [07:23] aconbere: still [07:24] aconbere: what would he care if someone else could install his app from another manager [07:24] mikeal: preaching to the choir :) [07:25] aconbere: heh [07:28] ineation has joined the channel [07:30] Phazm has joined the channel [07:32] _cheerios has joined the channel [07:32] _cheerios has left the channel [07:32] _cheerios has joined the channel [07:35] ineation has joined the channel [07:37] bmizerany has joined the channel [07:38] aconbere: yay [07:38] aconbere: my little app is in npm [07:38] aconbere: but will not install nicely until I finally get all the dependencies there as well :P [07:38] ctp has joined the channel [07:38] isaacs: aconbere: yeah, that's how it goes :) [07:39] jedschmidt has joined the channel [07:41] isaacs: mikeal, ryah: what are you guys talking about, that party looks AWESOME. [07:42] isaacs: they even managed to get the eBay dancers! [07:44] mikeal: you know what [07:44] mikeal: it's probably the best party that's been in Utah since Sundance :) [07:45] isaacs: hahaha [07:49] kjeldahl_ has joined the channel [07:54] creationix has joined the channel [07:57] aconbere: I'm having a party here right now [07:57] aconbere: it's a raging, get ready for bed and read my book party [07:57] aconbere: and it's awesome [08:01] hellp has joined the channel [08:02] TomY has joined the channel [08:04] matthew_y has joined the channel [08:12] micheil has joined the channel [08:17] Nohryb has joined the channel [08:43] xla has joined the channel [08:47] nex3 has joined the channel [08:47] unomi has joined the channel [08:47] nex3 has left the channel [08:50] jan____ has joined the channel [08:59] jan____ has joined the channel [09:00] derbumi has joined the channel [09:02] N` has joined the channel [09:26] gwoo has joined the channel [09:27] unomi has joined the channel [09:30] hellp has joined the channel [09:34] mAritz has joined the channel [09:41] ineation has joined the channel [09:53] maushu has joined the channel [09:53] MattJ has joined the channel [09:56] maushu: Goddammit. [09:56] maushu: What the hell happened. [09:56] TomY has left the channel [09:56] TomY has joined the channel [09:58] maushu: No system boot... [09:58] aconbere has joined the channel [09:59] _announcer has joined the channel [10:00] maushu: It end down when parsing stackoverflow response. [10:00] maushu: Thanks SO. [10:03] keyvan has joined the channel [10:30] Tekerson: using http.client, is there a simple way to tell it to just follow redirects and only process the last location? [10:32] romainhuet has joined the channel [10:37] jan____ has joined the channel [10:42] jan____ has joined the channel [10:54] fermion has joined the channel [10:56] _announcer: Twitter: "Anyone know if any auction sites have adopted node.js or similar technologies yet? Would make the last 2 minutes more interesting."-- Tim Haines. http://twitter.com/timhaines/status/14685346424 [10:58] unomi: I would imagine, being in the evil money game that auction sites keep mum about what they are using [11:00] maushu: Which is usually the usual php and mysql combo. [11:00] maushu: Unless you are ebay. [11:12] keyvan has joined the channel [11:12] technoweenie has joined the channel [11:12] maushu: ryah: http client only has 2 events? [11:13] maushu: I was hoping to find the "#&$*%# twitter disconnected again!" [11:13] maushu: Event. [11:16] siculars has joined the channel [11:26] nsm has joined the channel [11:42] keyvan has joined the channel [11:46] _announcer: Twitter: "Taking a look at node.js"-- mpiccinato. http://twitter.com/mpiccinato/status/14687468176 [11:50] ditesh|cassini has joined the channel [11:53] mAritz has joined the channel [12:04] mscdex: Eureka! [12:10] _announcer: Twitter: "Bespin is switching from Python to node.js: http://bit.ly/bf2gZo (good fit for space). I wonder if they'll end up building Hg/Git.js"-- ‏Chris Adams‎. http://twitter.com/acdha/status/14688577344 [12:15] mscdex: _announcer: you're missing the author of the tweet [12:27] igorgue_ has joined the channel [12:30] _announcer: Twitter: "@ Rhiokim node.js Lang NaCl, firebreath mile and a fever again, C + + is = __ =" [ko]-- A.J. http://twitter.com/andrwj/status/14689565381 [12:31] keyvan has joined the channel [12:38] igorgue_ has left the channel [12:39] mscdex: gotta love those translations ;-) [12:42] maushu: mscdex: NOT MY FAULT. [12:42] _announcer: Twitter: "hxNode provides haxe wrappers to Node.js. http://github.com/blackdog66/hxNode"-- Dean Burge. http://twitter.com/DeanBurge/status/14690162812 [12:42] mscdex: i know that [12:46] _announcer: Twitter: "Awesome Hack Night with some node.js and coffeescript with added Islamic geometry patterns with Raphael. Thanks to Steam for hosting!"-- Josh Price. http://twitter.com/joshprice/status/14690367328 [12:47] charlesjolley has joined the channel [12:49] _announcer: Twitter: "@lachlanhardy Whatever it is... it involves node.js and scalaris so far..."-- Patrick Lee. http://twitter.com/boundvariable/status/14690540242 [12:52] mjijackson has joined the channel [12:52] _announcer: Twitter: "C + +, Objective-C methods iteotgunhyo writing! If so, Objective-C + +, Objective-C also got to make Node.JS Addon of the sound!" [ko]-- A.J. http://twitter.com/andrwj/status/14690679102 [12:53] houdini has joined the channel [12:54] _announcer: Twitter: "#Javascript is actually quite a nice language when you get rid of the DOM and #node.js actually makes it fun..."-- Brenton Alker. http://twitter.com/tekerson/status/14690782349 [12:56] ditesh|cassini has joined the channel [12:57] _announcer: Twitter: "Learning Server-Side JavaScript with Node.js http://is.gd/coxQK js # # # javascript node.js" [de]-- Vincent RABAH. http://twitter.com/itwars/status/14690937150 [13:00] jherdman has joined the channel [13:01] drudge: that is terrible [13:02] _announcer: Twitter: "language makes it the only one possible to cross all tiers with a single lang with things like node.js, mongodb/mongoose, etc..."-- Scott Walker. http://twitter.com/pragma_tech/status/14691198229 [13:02] maushu: If pokémon were real, you would be the guy with 6 magikarps! [13:04] chrismcg has left the channel [13:15] _announcer: Twitter: "@ Rhiokim node.js Addon by creating a reason not to communicate with the device? 'm Also available kernel programming bots :-)" [ko]-- A.J. http://twitter.com/andrwj/status/14691924952 [13:17] technoweenie has joined the channel [13:28] davidsklar has joined the channel [13:30] Dennus has joined the channel [13:34] ncb000gt has joined the channel [13:38] _announcer: Twitter: "@ Rhiokim Addon of the server side oneway Node.JS If we can establish by Device Javascript side no changes at all Just one shot! This makes solutions, peuhahaha, many days,,, heh ho, are you doing I-__ ㅜ a living is not easy, Damn .." [ko]-- A.J. http://twitter.com/andrwj/status/14693223352 [13:39] noustuff has joined the channel [13:39] noustuff: Hi, I had a very dumb hello world question - I am running node.js on a VPS, I am able to view http://127.0.0.1:3000 via elinks on the command line, how do I make node.js listen to outside requests via URLs, not just localhost urls ? [13:42] ncb000gt: noustuff: what params are you passing to the .listen() method? [13:43] noustuff: Just 3000 number [13:44] ncb000gt: try .listen(3000, '0.0.0.0') [13:44] xn-1L1a has joined the channel [13:45] mape: 3000, null ? [13:49] noustuff: ACTION beginning to suspect this is a firewall thing, trying to figure out how to check my iptables settings [13:52] nefD has joined the channel [13:54] mscdex: gah. i finally got the response sorted out for the draft 76 handshake for websockets and chromium still doesn't accept :-\ [13:55] joshbuddy has joined the channel [13:55] mscdex: i wish there was a draft 76-compatible server i could test against [13:57] ncb000gt: noustuff: what does netstat tell you? [13:57] noustuff: ncb000gt: Finally got it resolved, had to add an iptables rule ( http://cloudservers.rackspacecloud.com/index.php/Introduction_to_iptables#Allowing_connections_to_HTTP.2FHTTPS ) [13:58] ncb000gt: noustuff: good deal [13:58] noustuff: ncb000gt: Thanks for taking the time, just getting started, next stop ExpressJS :) [13:58] ncb000gt: my approach, sudo /etc/init.d/iptables stop [13:58] ncb000gt: :) [13:58] noustuff: ncb000gt: haha [14:00] keyvan has joined the channel [14:07] phiggins has joined the channel [14:09] mscdex: micheil: have you had any luck with getting draft 76 handshaking to work? [14:10] botanicus has joined the channel [14:13] nsm has joined the channel [14:14] kriszyp_ has joined the channel [14:16] pgriess has joined the channel [14:20] Ori_P has joined the channel [14:23] TheEnd2012 has joined the channel [14:25] _announcer: Twitter: "YUI Theater — Ryan Dahl: “Introduction to NodeJS” (58 min.) - http://su.pr/71Sm0c #ajax"-- Alex Hall. http://twitter.com/devseo/status/14696018491 [14:26] jedschmidt has joined the channel [14:26] demolithion has joined the channel [14:28] xn-1L1a has joined the channel [14:37] gwoo has joined the channel [14:37] quirkey has joined the channel [14:39] behmann has joined the channel [14:41] kevwil has joined the channel [14:42] softdrink has joined the channel [14:44] charlesjolley has joined the channel [14:46] micheil: mscdex: I haven't had a chance yet [14:47] jedschmidt has joined the channel [14:51] joshbuddy has joined the channel [14:52] Yuffster has joined the channel [14:54] _announcer: Twitter: "Last night I got all of the basic features finished on node-bus (comet-based pubsub event system with node.js) http://bit.ly/9bvYxe"-- Jason Feinstein. http://twitter.com/JasonWyatt/status/14697858485 [14:55] _announcer: Twitter: "Why You Should Pay Attention to Node.Js http://bit.ly/aF532x"-- RealTimeWeb Eqentia. http://twitter.com/rtweb/status/14697890420 [14:55] [k2] has joined the channel [14:59] steadicat has joined the channel [15:01] _announcer: Twitter: "@heroku, how long b4 we can start using node.js on Heroku?"-- Tim Matheson. http://twitter.com/tmatheson/status/14698299425 [15:04] mape: Anyone in here heard of jsDate? [15:04] mape: Apperantly some json way to describe a date object [15:05] maushu: Never heard of it. [15:05] mape: :/ [15:05] mape: Guess it is some wonky java thing [15:05] maushu: I did use a javascript class to mask dates into the formats I want. [15:05] micheil: mape: try BSON for dates [15:06] mape: micheil: BSON? I'm working for a client that has a finished API.. [15:06] maushu: ...binary dates? [15:06] mape: Doubt I can make them change it [15:06] maushu: http://crazy-frankenstein.com/entertainment-files/story-files/the-most-unnessery-gadgets-to-buy_files/binary-clock.jpg´ [15:06] mrjjwright has joined the channel [15:06] maushu: http://crazy-frankenstein.com/entertainment-files/story-files/the-most-unnessery-gadgets-to-buy_files/binary-clock.jpg [15:07] maushu: There you have it, time in binary. [15:07] maushu: No need for silly bson. [15:10] maushu: Now that I think about it, bson would be a good protocol for this. [15:10] riq has joined the channel [15:10] maushu: creationix: Wasn't you that decided to use the http client instead of using json for the reverse proxy? [15:11] micheil: mscdex: if you look at the code, it should be pretty easy for you to implement draft76+, as it's just the handshake that changes [15:11] micheil: mscdex: although, I am working on a dual mode for the server at the moment, so that it can automatically detect if a client is draft76 vs draft75 [15:12] micheil: sorta like smtp vs esmtp handshaking [15:12] mscdex: micheil: yeah, it's the binary data i'm having problems with... i almost have it but it seems that characters > 127 are giving \ufffd instead of the actual value [15:12] micheil: hmm.. odd [15:12] micheil: I guess it's because I'm writing to the stream in utf8 [15:12] mscdex: i even tried using a buffer and it acts the same [15:13] micheil: yeah, currently write() or send() doesn't know the difference between buffers and strings [15:13] mscdex: well i'm trying this on socket.io, but it's the same data [15:13] mscdex: i'm just displaying the string to stdout [15:13] mscdex: in hex [15:13] mscdex: to match it up with what the client is expecting [15:14] micheil: it would be interesting to try and write a buffer module for the server, but first I need to write tests. [15:14] mscdex: it's really the body of the upgrade request that's having the binary problem [15:15] micheil: ah, okay [15:15] mscdex: the key computations output just fine [15:15] micheil: that's a raw buffer, not sure on encoding [15:15] maushu: Damn, bson is weird. [15:15] mscdex: the upgrade's body is being passed in as a string instead of a buffer [15:16] mscdex: so maybe that could be a cause [15:16] micheil: oh? [15:16] micheil: is this in my websocket client or node? [15:16] mscdex: well, it's in node's 'upgrade' event for the http.serverrequest [15:16] pgriess has joined the channel [15:16] pgriess has left the channel [15:17] mscdex: it passes in the upgradeHead value which is a string containing the body [15:17] micheil: okay [15:17] micheil: var upgradeHead = d.slice(start + bytesParsed + 1, end); [15:17] mscdex: which is just 8 bytes [15:17] micheil: that shouldn't be a string, should it? [15:18] micheil: no, it should be a new buffer [15:18] mscdex: hmm [15:19] micheil: do a typeof or instanceof test? [15:22] micheil: mscdex: check this out too: http://github.com/miksago/node-websocket-server/blob/development/lib/ws/connection.js#L100-106 [15:23] steez has joined the channel [15:23] indexzero has joined the channel [15:24] micheil: mscdex: a very simple switch, but it may mean that if the server doesn't mandate that clients must use draft75 or draft76, then the server will automatically use both. [15:24] mscdex: right [15:24] micheil: mscdex: although, I was told that there's a push to rewrite the spec to be more like SSL or something [15:24] micheil: basically a complete rewrite, breaking all previous code. [15:24] steez: is there try/catch..? i'm not always going to be able to connect as a stream client to a tcp server, and i'm throwing a hard error whenever i can't connect [15:25] micheil: because currently it can supposedly be used to fake into other server protocols [15:25] micheil: (from the client) [15:25] steez: and standard js try{}catch{} doesn't seem to cooperate, but i could be silly right now [15:25] mscdex: sweet! i don't know how i missed that it was a buffer and not a string [15:25] micheil: steez: try{} catch {} where? [15:25] mscdex: it works now :-) [15:26] steez: arround s=new net.Stream(); s.connect(port,ip); [15:26] micheil: mscdex: the reason I made it a buffer was because the spec mandates that it's just 8 bytes, no encoding, just bytes [15:26] micheil: steez: that wouldn't / shouldn't be throwing, irrc. [15:27] micheil: actually, no, it will throw [15:27] indexzero: anything else besides node-resque for doing 'delay job' type stuff in node? [15:28] steez: micheil, is there a try catch [15:28] micheil: indexzero: not that I know of, but we're always open for new stuff [15:29] indexzero: micheil: cool, I was chatting with JimBastard about it last night. I don't need full job queue semantics [15:29] indexzero: I also would prefer not to take the redis dependency [15:29] micheil: steez: try { var s = new net.Stream(); s.connect(port, ip); } catch(e) {sys.log(e)} [15:29] JimBastard: zzzzzzzzz [15:29] micheil: (require the sys module as well) [15:29] JimBastard: im like dead right now [15:29] ncb000gt: indexzero: While it's the "mechanics" there is also ryah's node-amqp...but it doesn't have the toolage like Celery for python [15:29] blowery: mostly dead? [15:29] micheil: JimBastard: I feel like my brains on crack or something; but it's just lack of sleep + coffee. [15:30] indexzero: ACTION didn't even think JimBastard was awake [15:30] ncb000gt: indexzero: not sure what kind of yaks you're interested in shaving but a celery type module would be really useful methinks [15:32] indexzero: ncb00gt: Yeah, all of these seem to take dependencies on external queues (amqp, redis, etc). What I need is brutally simple [15:32] indexzero: Just 'do this long running operation async' basically [15:32] indexzero: I don't care about FIFO semantics [15:33] indexzero: ncb000gt: Celery is interesting ... I haven't used Python much besides playing around [15:34] ncb000gt: yea, but it still has those external dependencies [15:34] indexzero: ncb000gt: but it's semantics don't seem to dictate a need to do so [15:35] indexzero: my thought would be to just exec a new node process running some script and have it do some simple IPC [15:35] indexzero: let the OS thread scheduler figure out the important stuff [15:35] indexzero: but I suppose if you have a lot of requests coming in you could have starvation of large jobs [15:35] steez: doesnt help [15:36] noustuff has joined the channel [15:36] indexzero: ncb000gt: Either way, Celery semantics are definitely what I want, so I'll have to think about the implementation. Thanks for the inspiration [15:37] JimBastard: indexzero: IPC might be a huge PITA [15:37] JimBastard: you might be better off having the child proccesses report their status via a http call [15:38] JimBastard: setup a little restful server [15:38] indexzero: yeah, I was thinking about doing something even stupider, like having the IPC done through a file with a unique identifier for each delayed job [15:38] indexzero: unique file watcher for each file with append only strategy is simple message passing [15:39] JimBastard: that sounds bad [15:39] ncb000gt: The HTTP mechanics in node are pretty easy to setup [15:39] ncb000gt: and you could use something like node-dirty to manage it inside node [15:40] indexzero: JimBastard: very descriptive response [15:40] indexzero: ncb000gt: how would you ensure the messages are passed to the correct handler, i.e. check to see what job a message is coming from? [15:42] ncb000gt: uid of some sort [15:43] indexzero: so an id passed in the http message? that seems plauisble [15:43] ncb000gt: the process would have to be responsible for knowing it's ID [15:44] ncb000gt: or even a header, if you're controlling everything and it's fixed then you don't need to muck up payload/data with the process id [15:44] ncb000gt: unless that id _is_ the payload [15:44] maushu: I don't get bson examples. [15:44] indexzero: the payload could most likely be configurable, but the required stuff would be id / status (fail, success) [15:45] stevendavie has joined the channel [15:45] ncb000gt: yea [15:46] indexzero: ncb000gt: Thanks, I think that's enough to get me going. I need this kind of lib for a project I'm ramping up on [15:46] maushu: ACTION facepalms. [15:46] maushu: I forgot int32 uses 4 octets. [15:47] ncb000gt: indexzero: nice, gl :) [15:51] keturn_ has left the channel [15:52] keeto has joined the channel [15:52] unomi has joined the channel [15:53] technoweenie has joined the channel [15:57] igorgue_ has joined the channel [16:04] jedschmidt has joined the channel [16:04] jedschmidt_ has joined the channel [16:05] JimBastard: indexzero: im trying to get to work your breaking my balls [16:05] JimBastard: some of us were practicing our javascript-fu until the sun rose [16:06] JimBastard: aight im out , getting on the train [16:06] _announcer: Twitter: "@ Outsider__ LLVM is thought that Objective-C + + and see if I could connect Node.JS the Addon's to sell." [ko]-- A.J. http://twitter.com/andrwj/status/14702295749 [16:07] stevendavie1 has joined the channel [16:11] paul_irish_ has joined the channel [16:21] stagas has joined the channel [16:23] stevendavie has joined the channel [16:26] TobiasFar has joined the channel [16:27] steadicat has joined the channel [16:27] binary42 has joined the channel [16:35] tim has joined the channel [16:35] maushu: ...dammit, I can't only use http. I need a protocol. [16:36] maushu: I will try bson. [16:36] maushu: It's like json but it supports binary which is great. [16:36] maushu: Hopefully ryah made Buffer pretty quick. xD [16:36] keeto has joined the channel [16:37] maushu: Need a Buffer.write(Number) though. [16:37] maushu: To be faster. [16:37] brianmario has joined the channel [16:40] nefD has joined the channel [16:44] stephenlb has joined the channel [16:44] JimBastard has joined the channel [16:45] tim has joined the channel [16:46] bpot has joined the channel [16:46] maushu: Filling a 1000000 Buffer takes 10ms? Hmm. [16:47] razorsage has joined the channel [16:48] JimBastard: sup indexzero [16:48] JimBastard: you working on node stuff today? [16:49] maushu: ... [16:49] ineation has joined the channel [16:49] JimBastard: sop [16:50] JimBastard: is ryah around today, i still am trying to figure out why that special char was causing UTF file reading to fail [16:50] JimBastard: not sure if thats expected behavior or not....but im assuming one funky char shouldnt crash node [16:52] ryah: JimBastard: hey [16:52] ryah: JimBastard: can you email the list? [16:52] JimBastard: sure, i just didnt want to look like a retard [16:53] JimBastard: is it normal behavior to see fileRead bomb if it hits bad input? [16:53] ryah: no [16:53] JimBastard: aight ill email [16:53] ryah: i know the fix too [16:55] ryah: JimBastard: if you can make me a test [16:55] ryah: i would love it [16:55] maushu: ...what char is this? [16:55] maushu: I want to share the love. [16:55] JimBastard: :-\ i really want to contribute to the core but im not setup to do custom builds or anything [16:55] kriszyp has joined the channel [16:55] JimBastard: maushu: you wanna handle this? [16:55] JimBastard: its the ... [16:55] JimBastard: elipsis [16:55] maushu: ...are you kidding. [16:55] JimBastard: no [16:56] ryah: haha [16:56] ryah: utf8 elipsis? [16:56] JimBastard: yeah [16:56] ryah: what's the charcode? [16:56] maushu: I wonder what would happen if someone put that in the chat. [16:56] JimBastard: charcode unkknown [16:56] stagas has joined the channel [16:56] JimBastard: i copy pasted it like 20 times last night [16:56] ryah: JimBastard: string.charCodeAt(index) [16:56] fizx has joined the channel [16:56] JimBastard: i can find [16:56] fizx has joined the channel [16:56] technoweenie has joined the channel [16:56] maushu: http://www.fileformat.info/info/unicode/char/2026/index.htm [16:56] JimBastard: sorry for not documenting on the spot, i really just thought i was failing [16:57] MattJ: … [16:57] MattJ: \o/ [16:57] maushu: U+2026 [16:57] ryah: JimBastard: how big is your file? [16:57] JimBastard: … [16:57] ryah: 3 byte utf8 [16:57] JimBastard: not that big, maybe 800 lines of html [16:57] ryah: JimBastard: tell me in bytes [16:57] maushu: I'm in ur node.js server, sending utf8 ellipses. [16:58] JimBastard: ryah: how do i get bytes? did i have to stat? can i do it in the OS? [16:58] JimBastard: you just want the size? [16:58] Nohryb has joined the channel [16:59] maushu: ryah: Theoretically, what would happen if I pasted … into the chat? [16:59] JimBastard: 234881026 4256203 -rw-r--r-- 1 Marak staff 0 5987 "May 25 04:13:27 2010" "May 25 02:29:23 2010" "May 25 02:29:23 2010" "May 25 02:07:33 2010" 4096 16 0 dateTime.js [16:59] ryah: JimBastard: ls -l [16:59] JimBastard: 5987 [16:59] JimBastard: abouts [16:59] ryah: iok [16:59] JimBastard: i just took out the funky chars last night to fix [16:59] _announcer: New Question: "How to create a streaming API with NodeJS" by igorgue. http://stackoverflow.com/questions/2906594 [16:59] sechrist: JimBastard: sup -- how'd your hack party go? [17:00] maushu: Oh look. [17:00] JimBastard: sechrist: its going [17:00] ryah: i assume the \u2026 is at the 4096 char? [17:00] sechrist: maushu: is that a question or a statement [17:00] sechrist: lulz [17:00] ryah: s/char/byte/ [17:00] JimBastard: working hard on my javascript-fu [17:01] ryah: someone should create a rss feed of links posted in this channel [17:01] JimBastard: SOMEONE SHOULD PARSE THE IRC LOGS [17:01] JimBastard: caus you can parse all the links [17:01] JimBastard: it would be trivial to add another filter to create a rss feed of links [17:02] JimBastard: if you were already parsing [17:03] maushu: JimBastard: Your statements sound... logical. [17:03] maushu: ACTION raises eyebrow. [17:04] ryah: http://s3.amazonaws.com/four.livejournal/20100525/elipses.txt [17:04] maushu: ryah: ...don't tell me the utf8 reader crashed because of \u2026 was at the position 4096? [17:04] ryah: readFile isn't using the utf8 reader [17:05] maushu: That is... very precise. [17:05] ryah: it was getting fucked up because of char split [17:05] maushu: Ah. [17:05] JimBastard: in all fairness, i was using readSync [17:05] sechrist: speaking of link parsing [17:05] ryah: JimBastard: readFileSync? [17:05] JimBastard: yeah [17:05] maushu: So basically it separated the utf char. [17:05] JimBastard: this problem came up in my little CI script [17:05] JimBastard: so its not a server at all [17:05] JimBastard: pretty much a build script [17:05] ryah: maushu: yeah [17:06] ryah: maushu: pretty common error - we're just starting to correct them [17:06] JimBastard: the electricity guys are here [17:06] JimBastard: i might disappear [17:06] ryah: well felix did last week [17:07] mscdex: yey, draft 76 websockets working in socket.io [17:07] sechrist: what browsers support that so far? nightly builds of webkit? [17:08] mscdex: erm i dunno really. latest chromium nightly does, not sure when they started supporting it though [17:09] JimBastard: there is always flash fall back [17:09] mscdex: yep [17:09] sechrist: ah it pipes through the interface to flash on fail? [17:09] mscdex: or xhr-multipart or xhr polling :P [17:09] mscdex: *long polling [17:10] sechrist: I would hope the degrade process would be websocks -> flash -> xhr [17:10] mscdex: sechrist: it is [17:10] sechrist: apple kind of ignores the middle case [17:11] sechrist: that's neat then --- I would expect a huge increase in performance just using the flash object [17:11] maushu: ryah: Ah, I though it was specific to that char and that exactly position. [17:11] sechrist: over xhr [17:11] maushu: You can imagine my face. [17:11] mscdex: i've never used the flash websocket implementation, so i don't know how it compares to real websockets or the other transports [17:12] maushu: mscdex: It should be pretty fast. [17:12] maushu: The bottleneck is javascript <-> flash [17:12] sechrist: the only streaming application i've seen that i'm aware of that uses the interface is the jsnes that uses it for sound streaming [17:12] sechrist: and that flew [17:12] sechrist: blew* [17:12] mscdex: sound streaming? [17:12] sechrist: yeah [17:13] sechrist: well I mean the emu has to generate the sound on the fly [17:13] sechrist: no html object can do that [17:13] sechrist: so it externalinterfaces to flash [17:13] sechrist: to play it [17:13] sechrist: http://benfirshman.com/projects/jsnes/ [17:13] mscdex: yeah but that's not using networking though? [17:13] sechrist: of course not [17:13] sechrist: he said the bottleneck is javascript <-> flash [17:13] sechrist: that's externalinterface [17:13] mscdex: oh [17:14] sechrist: like you link them directly together [17:14] sechrist: and pass data [17:14] JimBastard: did anyone else get a spam email from http://www.jscrambler.com/ [17:14] JimBastard: im about to flame these guys [17:14] sechrist: but my god the sound blows in jsnes -- might not be externalinterface's fault haha [17:16] JimBastard: Protect, compress, obfuscate your JavaScript source code. JScrambler offers code size reduction, potent and resilient obfuscation transformations and anti-debugging techniques. [17:16] sechrist: antidebugging eh? [17:16] JimBastard: does that make anyone else real angry? [17:16] JimBastard: also, like wtf [17:16] sechrist: welllll -- there's a lot of companies that use flash for that reason [17:16] sechrist: it's obfuscatable [17:17] mscdex: obfuscate is a fun word [17:17] JimBastard: do i just write them a nasty email or do i sign up for the beta and write a reverser for their script? [17:17] sechrist: the second [17:17] mscdex: both! :P [17:17] JimBastard: caus i gotta assume they ship the decoding method to the browser [17:17] sechrist: do the second, then the first [17:17] sechrist: with the second inside the first [17:17] siculars has joined the channel [17:17] JimBastard: or else they couldnt make it work [17:18] sechrist: oh they could just mangle the execution order to all hell [17:18] sechrist: to where it's difficult to read [17:18] JimBastard: im just gonna write an email telling them they suck [17:18] JimBastard: and all my code is MIT [17:18] JimBastard: so fuck off [17:18] halorgium: JimBastard: nah, they have monkeys which all users gotta have sitting next to them to decode the source [17:18] mikeal has joined the channel [17:19] JimBastard: flame on [17:20] mscdex: you should send an obfuscated email [17:20] mscdex: ;-) [17:20] sh1mmer has joined the channel [17:21] sechrist: woah I clicked on a node module [17:21] sechrist: it brought me to bitbucket [17:21] sechrist: I was like WTF did github do [17:21] sechrist: then I went oooohh [17:21] mikeal: haha [17:21] mikeal: people really shouldn't do that :) [17:22] JimBastard: sechrist: liberate it [17:22] JimBastard: thats what i do with codeplex [17:22] JimBastard: just start a new repo on github and copy the code [17:22] sechrist: gitberator [17:22] sechrist: nah that sounds risque [17:22] JimBastard: stupid brits [17:22] sechrist: http://lloyd.github.com/yajl/ [17:23] sechrist: i'm going to try that to fix the twitter lib [17:23] sechrist: that shouldn't cause exponential cpu usage [17:24] sechrist: well the js version [17:25] sechrist: installing mercurial [17:26] sechrist: whyyy [17:27] JimBastard: If I wasn't so busy releasing kick ass open-source software I'd write a tool to identify sites using your "technology", reverse your "obfuscation", and publish the source code to major social media sharing sites. [17:27] JimBastard: lol [17:27] JimBastard: thats a good way to end the mail [17:28] JimBastard: DONT SPAM GITHUB DEVELOPERS [17:28] vnguyen has joined the channel [17:28] sechrist: with obfuscation technology [17:29] JimBastard: http://gist.github.com/413422 [17:29] JimBastard: i think i gave them a fair warning [17:30] JimBastard: i write obfuscated JS off the top of my head [17:30] JimBastard: let me find out [17:30] JimBastard: spamming github users [17:30] sechrist: 2. Code obfuscation in the browser causes performance issues and debugging issues [17:30] sechrist: the second they desire to cause [17:30] JimBastard: yeah [17:30] JimBastard: thats awesome [17:30] indexzero has joined the channel [17:30] sechrist: literally impossible [17:30] JimBastard: when shit works on dev and staging [17:30] JimBastard: and you obfuscate [17:30] sechrist: well 3. that goes for all code [17:30] JimBastard: and then prod fails [17:30] sechrist: you can disassemble C apps [17:30] JimBastard: sup indexzero [17:30] sechrist: but it requires a trained eye to understand it [17:31] cloudhead has joined the channel [17:31] ncb000gt: JimBastard: <-- hero [17:31] JimBastard: :-D [17:31] ncb000gt: that's awesome [17:31] JimBastard: i gave them warning, they should know better [17:32] JimBastard: you dont spam github users with that bullshit [17:32] ncb000gt: agreed [17:32] sechrist: if they respond they'll be like [17:32] sechrist: we're for companies that wish to protect their IP [17:33] ncb000gt: sechrist: and if they do just bold the line "don't spam github users!" [17:33] ncb000gt: also, why doesn't github have a " [17:33] ncb000gt: fav gist" feature [17:33] ncb000gt: :( [17:33] isaacs has joined the channel [17:33] indexzero: ACTION sees that JimBastard is finally **really** awake [17:34] JimBastard: i dont deal well with JS obfuscation indexzero [17:34] indexzero: ncb000gt: Define "hero" :-P [17:34] ncb000gt: lol [17:34] inimino: hehe [17:34] JimBastard: indexzero is the other guy doing broodmother [17:34] indexzero: ACTION will stop breaking JimBastard's balls for a bit [17:34] JimBastard: ACTION respect [17:34] aho has joined the channel [17:35] isaacs: sh1mmer: http://twitter.com/ryah/status/14706235139 [17:35] isaacs: discuss. [17:35] inimino: how well does jsbeautifier work? [17:35] inimino: has anybody actually used it? [17:35] isaacs: ACTION popcorn [17:36] ncb000gt: o.- [17:37] jbrantly: I have [17:37] jbrantly: I love it [17:37] sh1mmer: isaacs ryan I wrote that a while ago [17:37] sh1mmer: and it was a dumb thing to write, admittedly [17:38] sh1mmer: that's the problem with doing stuff on the internet, people remind you of when you are wrong :( [17:38] jbrantly: inimino: it was one of the few that got regex right [17:38] isaacs: hehee [17:38] isaacs: sh1mmer: i kind of think that's one of the wonderful things about the internet. [17:39] isaacs: sh1mmer: it's impossible to avoid the painful lessons of saying something dumb. [17:39] behmann_ has joined the channel [17:39] sh1mmer: isaacs: I was being satirical. [17:39] sh1mmer: I don't really mind being wrong [17:39] isaacs: i know, you seem to relish in the opportunity ;P [17:39] sh1mmer: although ryah shouldn't call me "Yahoo" [17:39] isaacs: j/k [17:39] sh1mmer: that's just unfair [17:39] isaacs: hahah [17:40] sh1mmer: if everyone quoted the dumb stuff I say we'd be in trouble [17:40] isaacs: really, calling anyone or any one team "Yahoo" is unfair to both, probably [17:40] isaacs: yahoo's a gigantic company [17:41] isaacs: having the pointer to node.js was a great move, though. you definitely called it. [17:42] JimBastard: the yahoo guy told me to email him my resume but then he never responded [17:43] binary42: I need to post the pictures I got at GoRuCo of people checking out node.js on their laptops... [17:43] sh1mmer: which Yahoo guy, me? [17:43] isaacs: JimBastard: clearly everyone at Yahoo is out to get you. [17:43] JimBastard: i probably should have trimmed it a little bit. i have three pages dedicated to my martial arts experience [17:43] isaacs: JimBastard: you should stick it to them by using Google for all your searches. [17:43] JimBastard: too late [17:43] JimBastard: i dunno sh1mmer , are the guy from jsconf [17:43] ncb000gt: JimBastard: is that just an ascii art picture of chuck norris? [17:43] sh1mmer: JimBastard: I was one of the guys at JSConf [17:43] JimBastard: who did i email [17:43] JimBastard: one sec [17:44] whoahbot has joined the channel [17:44] mjr_ has joined the channel [17:44] sh1mmer: If it was me I threw everything I got into the system, but I may or may not have responded to your email. Because I'm shit like that. [17:44] JimBastard: i mean, it is what it is [17:44] sh1mmer: I'm a bit crap at email. [17:44] JimBastard: i probably wouldnt work out at yahoo anyway [17:45] sh1mmer: :( [17:45] sechrist: but he could at google [17:45] sechrist: zing [17:45] sh1mmer: we have a bad rap [17:45] sechrist: also bing [17:45] sechrist: sh1mmer: you're a yahooer? [17:45] sh1mmer: ja [17:45] sh1mmer: everything that was bad is isaacs' fault and he left. [17:46] sh1mmer: :D [17:46] isaacs: sh1mmer is being too modest. [17:46] isaacs: and yes, now that i've left, yahoo is a WONDERFUL place to work. [17:46] sechrist: I'm impressed with how tied you guys are to js and web efficiency [17:46] JimBastard: still looking for the name [17:46] sechrist: everybody should read the yslow/EP tips [17:46] JimBastard: i really liked the idea of YQL though [17:46] sh1mmer: sechrist: we hire good front-end guys. always have. even if they don't have PhDs [17:46] indexzero: At least yahoo has a NYC office right? [17:47] sh1mmer: they sort of do. [17:47] sechrist: I don't think any good frontend guy that's up to date has a phd [17:47] indexzero: more real than Microsoft's, less real than Google's? [17:47] sechrist: academia sucks like that [17:47] keeto_ has joined the channel [17:47] JimBastard: Gonzalo Cordero [17:47] JimBastard: sh1mmer: [17:47] sh1mmer: we have 2 offices in nyc, one of them is full of researchers and sales, the other sales and ad engineering [17:47] sh1mmer: JimBastard: that wasn't me. [17:47] sh1mmer: JimBastard: you can email it to me if you are still looking [17:47] JimBastard: i got to talk to Gonzalo a bit at jsconf [17:48] JimBastard: i wasnt really looking, he asked me to send my info [17:48] indexzero: I used to work for a startup based in NYC that Microsoft acquired and let stay. We consistently lobbied to get a real NYC office [17:48] JimBastard: i was mildly interested [17:48] indexzero: but they won't hear it [17:48] JimBastard: thanks though sh1mmer [17:48] sh1mmer: no worries [17:48] JimBastard: im pretty sure i would crash and burn at yahoo in < 3 months [17:48] sh1mmer: we even have a node project now [17:48] JimBastard: do they require you come in before noon? [17:48] sh1mmer: but you guys wouldn't be interested in that [17:48] sh1mmer: JimBastard: I normally get in about 10 [17:49] JimBastard: yeah, i mean [17:49] JimBastard: i dunno [17:49] grahamalot has joined the channel [17:49] DaNCeR has joined the channel [17:49] JimBastard: if you guys are looking for kick ass front-end people feel free to float my github around [17:49] sechrist: JimBastard: likes to start work at 25:00 [17:49] JimBastard: im pretty happy where im at for the next few months at least [17:50] DaNCeR: hey guys was wondering if anyone could recommend a testing framework that works well in both node and the browser? [17:50] JimBastard: good question DaNCeR [17:50] DaNCeR: something that supports asynchronous testing [17:50] mcarter has joined the channel [17:50] JimBastard: does jspec work dual sided? [17:50] DaNCeR: i've used jspec before for browser stuff and did like it but had alot of problems when it came to testing async stuff inside node [17:51] DaNCeR: yeah it works in most environments i believe [17:51] DaNCeR: rhino and others as well [17:51] DaNCeR: but afaik doesn't handle testing of asynchronous code [17:51] jbrantly: qunit supports commonjs and handles async. Never actually tried it in node though. [17:51] jherdman: how does a test framework "handle" async? [17:52] DaNCeR: and when i came across that problem i was recommended to use node-async-testing by ry himself [17:52] DaNCeR: trasitional frameworks assume the test is finished when it reaches the end of the code block [17:52] sechrist: and that is a problem? [17:52] JimBastard: DaNCeR: theres a lot of async testing frameworks [17:52] sh1mmer: can someone explain to me why people like having assert throw exceptions by the way? [17:53] DaNCeR: if you're waiting for file i/o or something to finish in the background then your test hasn't finished while the block of code has and you might not have even created any assertions yet [17:53] DaNCeR: frameworks like node-async-testing give you a function that you can fire off once the test is complete [17:53] sh1mmer: what's wrong with assertions logging instead, either to STDERR or returning string? [17:54] aconbere has joined the channel [17:54] DaNCeR: sh1mmer:no reason you can't catch the exception and log it yourself and then continue [17:55] DaNCeR: well i suppose continue may not be the right word [17:55] DaNCeR: but recover [17:55] sh1mmer: right [17:55] sh1mmer: that just seems, very verbose. [17:55] JimBastard: The only thing I assert is that my code is awesome. [17:55] sh1mmer: and how many exceptions do you get on average, per day, say? [17:56] JimBastard: I can do that synchronously or asynchronously, with no framework. [17:56] sh1mmer: #BastardFacts [17:56] JimBastard: ACTION there are no exceptions [17:56] DaNCeR: JimBastard: i'm sure there are and plenty of good ones I imagine but just wondering if there have been any established as being good for both browser and server environments [17:56] JimBastard: im having the same problem now DaNCeR [17:56] JimBastard: im using Vows on the backend for now [17:56] DaNCeR: i'm thinking of giving node-async-testing a try in the browser [17:57] DaNCeR: i wrote a commonjs module loader for the browser a month or so ago [17:57] DaNCeR: so it should be able to load it fine [17:57] JimBastard: link? [17:57] JimBastard: are you using jquery.require() ? [17:57] JimBastard: or just script tags? [17:57] DaNCeR: http://github.com/DaNCeR/requisition [17:58] DaNCeR: just a script of my own that creates window.require [17:58] DaNCeR: works very similar to node [17:58] DaNCeR: so you have require.paths and you add folders into that [17:58] DaNCeR: then call require with the identifier [17:59] DaNCeR: i started it because i was looking around for one and all the ones that i could find seemed to be insistent on having to 'revise' the spec and wouldn't work with just a plain module [17:59] JimBastard: DaNCeR: where is the usage spec [17:59] jbrantly: DaNCeR: you may be interested in http://github.com/jbrantly/yabble [18:00] isaacs: DaNCeR: how do you handle the fact that require() is synchronous, and modules might not be loaded yet? [18:00] JimBastard: yeah [18:00] JimBastard: i dont believe in your require code yet [18:00] JimBastard: i gotta get back to this behavior library anyway [18:00] isaacs: DaNCeR: sync xhr! no!!!! [18:00] JimBastard: yeah [18:01] DaNCeR: and in my opinion there are ways you can do commonjs modules in the browser by using a few little tricks and node having to actually change the contents of the module [18:01] JimBastard: i think script tags are better for requiring remote script files [18:01] DaNCeR: well yeah one of my ideas relates to that [18:01] DaNCeR: but i haven't had time to finish it up yet [18:01] JimBastard: i have a much better approach, i just bundle my shit from commonjs to the browser [18:01] JimBastard: so i run a build step [18:01] JimBastard: instead of forcing it all to work dualsided [18:01] isaacs: DaNCeR: you should do something more like require.ensure that is async [18:01] DaNCeR: to each's own [18:01] isaacs: DaNCeR: sync require() doesn't make sense on teh brwoser. [18:02] JimBastard: isaacs: its called script src = [18:02] jbrantly: if you're interesting in CommonJS in the browser you should check out Yabble. It does not use sync xhr, but supports asynx xhr and script tags (you choose). It also supports require.ensure. [18:03] blowery: requirejs supports it too [18:03] DaNCeR: basically the way i see it there is nothing wrong with the idea of doing sync require in the browser except for the network latency [18:04] isaacs: ACTION doesn't care very much about code reuise [18:04] jbrantly: yes, requirejs is nice but doesn't support xhr and does that "revising" that DaNCeR referred to [18:04] DaNCeR: but i think there are ways you can reduce that to the point where it's negligible [18:04] isaacs: DaNCeR: yeah... network latency and UI blocking. that's like saying there's nothing wrong with murder except for the part about killing people. [18:04] jul__ has joined the channel [18:04] JimBastard: UI blocking is not understand when you dont write complex UIs [18:04] JimBastard: usually not noticed for what it is [18:05] isaacs: not being able to scroll the window until your thing is done downloading... that's not ok. [18:05] isaacs: it'd be better to just throw an error if the module isn't there, and have some way to pre-load it; or, make the fetches asynchronous if the module isn't loaded yet. [18:05] DaNCeR: yes but it's not frequently that you will be downloading and evaling large blocks of code after the initial load [18:05] isaacs: DaNCeR: i'm talking about the initial load. [18:06] isaacs: DaNCeR: freezing up while it's loading visual assets, that's what isn't ok. it makes performance feel like crap. [18:07] isaacs: DaNCeR: Check out nodules or yui3. they both implement an asynchronous require.ensure-type thing. yui3's is different, but mostly just because it predates commonjs by about a year. [18:07] isaacs: same basic concepts. [18:07] DaNCeR: are you talking about freezing from the xhr or from evaling the code? [18:07] isaacs: DaNCeR: from the xhr [18:07] isaacs: DaNCeR: the eval is fast. [18:07] DaNCeR: yeah just checking [18:07] isaacs: DaNCeR: in the majority of use cases in teh browser, network IO is so much slower than anything else that nothing else even matters. [18:08] isaacs: DaNCeR: after the initial load, the bottleneck is DOM access. [18:08] JimBastard: fucking eval [18:08] isaacs: (unless you're doing sync xhr, in which case, you return to having network IO matter) [18:08] pjb3 has joined the channel [18:08] DaNCeR: yeah well the way around that which i have provisioned for in my library but just haven't gotten around to implementing should make that negligible [18:09] DaNCeR: the script has a cache for jsut the scripts themselves [18:09] DaNCeR: which means that ultimately you can load all the scripts really easily as one big json file into this script cache [18:09] DaNCeR: well ultimately you can choose what you populate it with [18:10] DaNCeR: but i think that you can minimise the effect of the sync xhr enough that you wouldn't notice it [18:10] DaNCeR: but hey [18:10] isaacs: DaNCeR: sure. i'm saying that you should cut out the sync xhr, and just say that if it's not in the cache, it throws. [18:10] isaacs: DaNCeR: ie, prepopulate if you want sync require(), or else use async require.ensure or somethign [18:10] DaNCeR: if i'm wrong it'll just add one more crappy module loader to the pile:p [18:10] riq has joined the channel [18:11] isaacs: DaNCeR: sometimes you gotta do the crazy thing :) [18:11] DaNCeR: lol i'm into radical ideas and challenging the defined 'way' [18:12] DaNCeR: currently working on basically a db written in js [18:12] jbrantly: The way I support asynx xhr but sync require is through static code analysis. Not perfect but works well enough. I pull out all require()s and go ahead and load those before memoizing the original module [18:12] DaNCeR: so key value and the containers are just js objects [18:12] DaNCeR: similar to another one that already around [18:12] DaNCeR: umm dirty something i think it's called [18:13] isaacs: DaNCeR: what about something like this for crazy.... if a module does require(), and it's not in teh cache, then it throws. YOU catch it, though, and if you get one of these "module not found" errors, then you load the unfound module dynamically, and then re-run the caller module's code. [18:13] DaNCeR: but yeah i see all these modules on github to allow people to access all these key value stores from node and js already has a key value store [18:13] isaacs: DaNCeR: when i say that you load the unfound module dynamically, i mean, using a script tag or async xhr or whatever. [18:14] DaNCeR: yeah how do i recalled the code that required the module??? [18:14] DaNCeR: recall* [18:14] jbrantly: isaacs: that has issues I think. [18:14] isaacs: DaNCeR: you don't just eval it, you wrap it in a function and THEN eval it. then you call the function. [18:14] isaacs: jbrantly: but at least they're new issues :) [18:14] jbrantly: isaacs: I think I prefer my approach :) [18:14] isaacs: if you'er gonna do a crazy thing, don't do the crazy thing that everyone's seen suck already. [18:14] isaacs: do a new crazy thing. [18:15] DaNCeR: no what i mean is how do you get reference to the code that required the module in the first place [18:15] mikeal: haha [18:15] isaacs: DaNCeR: but then you have a reference to the function object. [18:15] isaacs: DaNCeR: and you hang onto that. [18:15] isaacs: DaNCeR: then you do try { compiledFunction() } catch (ex) { load the unfound module and then try again } [18:15] isaacs: DaNCeR: and you keep track of everything, and it's a huge pita [18:16] b_erb has joined the channel [18:16] DaNCeR: i dunno i think ultimately it was very short sighted of commonjs to make modules synchronous [18:16] jbrantly: sync code is "easy" [18:17] jbrantly: but they're trying to make up for it with require.ensure [18:17] JimBastard: import / export should be sync imo [18:17] JimBastard: async import / export out the box would be kinda crazy [18:17] paul_irish has joined the channel [18:17] DaNCeR: even for server environments it doesn't make sense cause you're burning cycles for no good reason [18:17] isaacs: sync makes a ton of sense for the startup phase of a server app. [18:17] mikeal: sync is basically fine for module require [18:17] JimBastard: there are libraries that deal with this [18:17] mikeal: there are so many more problems trying to do it async [18:17] isaacs: remember that "commonjs" was originally "serverjs" [18:18] isaacs: async require is kind of a pain [18:18] mikeal: and once the browsers have support that ships with the browser, it'll be really clean and painless [18:18] JimBastard: nodules does it right [18:18] markwubben has joined the channel [18:18] isaacs: there are already browser-based module systems. really nice ones. look at jquery, or yui3, or dojo [18:19] isaacs: we dont' need commonjs in the browser, imo [18:19] DaNCeR: isaacs:i absolutely disagree with you [18:19] markwubben_ has joined the channel [18:19] jbrantly: I like the idea of commonjs in the browser for the (god I hate this word) synergy [18:20] isaacs: if i were to build a web app today, there is absolutely no way in hell that i'd use a commonjs platform in the browser instead of jquery or yui3 [18:20] atmos: you completely invalidated your statement by typing that jbrantly [18:20] DaNCeR: commonjs in the browser enables client side mvc frameworks which i believe is where its gonna be at over the next few years [18:20] isaacs: node's APIs dont' make sense for the brwoser. [18:20] Aria has joined the channel [18:20] isaacs: and it's easier (and more effective) to move jquery or yui to the server than it is to move node to the client. [18:20] aconbere: can we just get commonjs in all browser extension frameworks? [18:20] jbrantly: atmos: not sure of another word that means the same thing [18:21] aconbere: :) [18:21] DaNCeR: isaacs: no not all of them but take something like modules. Just by having that defined it means that i can now load up haml-js and sass-js in the browser and send the haml and sass to the browser and compile it there [18:22] maushu has joined the channel [18:22] isaacs: DaNCeR: it's not significantly cheaper than sending markup, and it's slower to compile on teh browser. [18:22] isaacs: DaNCeR: it'd be better to compile the markup on the server. [18:22] DaNCeR: i think it's plenty fast enough [18:22] maushu: http://www.kongregate.com/games/krispykrem/the-codex-of-alchemical-engineering/ [18:23] Aria has joined the channel [18:23] isaacs: but there are use cases, i suppose. you create an object on the client, and then push it through a haml template or something. [18:23] DaNCeR: those haml files just compile down to one big js concatenation function [18:23] isaacs: it's just so easy to put that stuff into a yui3 module or a jquery plugin. [18:24] DaNCeR: but one of the big advantages of writing js for your server is that your not constantly having to switch languages and the mindset that goes with programming in them [18:24] DaNCeR: and being able to move your code seemlessly between the two extends the exact same principle [18:25] DaNCeR: i dream of the day when my web app doesn't have 2 different folders for server and client side code and just the one for both of them [18:26] JimBastard: DaNCeR: where does http.createServer go? [18:26] JimBastard: i have a few dual sided apps right now....having one folder is just semantics [18:26] DaNCeR: and just in regards to compiling haml in the browser as you said before network I/O is the biggest problem is browsers and i'd much rather shift a little more processing onto the browser and have it compile the template for each view and then only have to send it a small chunk of data possibly even over a web socket [18:27] DaNCeR: JimBastard: sorry, what do you mean? [18:28] DaNCeR: JimBastard: in regards to http.createServer [18:28] JimBastard: you can make your web app have a common code base [18:28] JimBastard: but some code is never suppose to run on the browser [18:28] jul__ has left the channel [18:28] DaNCeR: of course some code is never going to run on the browser [18:29] richcollins has joined the channel [18:30] DaNCeR: but i think if we had available the tools that i'd like (and am working on making available) that you'd have more code that could run on either then code that could only run on one [18:30] DaNCeR: but i dunno maybe i'm crazy [18:31] DaNCeR: like form validations is an example [18:32] JimBastard: you sound like me 6 months ago [18:32] JimBastard: theres code for all this stuff, its coming together [18:32] JimBastard: if you want a mature library start building one [18:32] JimBastard: or hop on someone elses [18:32] DaNCeR: if you're so inclined you'll write js (or borrow from a framework) to validate the forms on your site but you're always going to need code on the server to validate it as well [18:32] DaNCeR: as i said i'm working on it [18:33] DaNCeR: not hoping for a mature library [18:33] tilgovi has joined the channel [18:33] DaNCeR: i worked with merb for several years i'm used to unstable and immature:p [18:33] DaNCeR: just kind of want a next generation library [18:33] DaNCeR: and i kinda think i've got some ideas to make one [18:34] DaNCeR: but as i said i could very well be on the completely wrong track [18:35] JimBastard: you are on the right track friend, but the wrong train [18:35] JimBastard: you will derail without more insight [18:35] DaNCeR: lol how so? [18:35] JimBastard: :-\ [18:35] steadicat_ has joined the channel [18:35] JimBastard: write some code or a readme and put it on github for what you want to do [18:35] JimBastard: then we can talk [18:35] JimBastard: i cant understand anything but sample usage code [18:36] DaNCeR: well i can give you the basic gist of it in about one sentence [18:36] JimBastard: fail [18:36] DaNCeR: an in browser mvc framework. [18:36] JimBastard: "i wanna make an awesome awesome that does awesomeness with some awesomesauce" [18:36] JimBastard: there you go [18:37] DaNCeR: not quite what i was going for [18:37] blowery: extra awesomesauce please [18:37] DaNCeR: i never said what i was gonna make would be awesome [18:37] DaNCeR: i never even said it would be remotely good [18:37] DaNCeR: but i think the concepts that i'm basing them on do hold weight [18:38] DaNCeR: browsers are not the shitty old programming environments that they used to be [18:38] gwoo has joined the channel [18:39] olegp has joined the channel [18:41] DaNCeR: and i think the fact that we have come from a time where they were and everything needed to be done on the server has made stick to the idea of a thick server [18:42] DaNCeR: and i just think with a bit of a push we can get to what I believe to ultimately be the better solution of a thin server and a smarter client [18:44] DaNCeR: but whatever, hopefully in a couple of months i'll have something basic finished up and will make sure it has sample usage code and a readme so you can understand it:) [18:45] _announcer: Twitter: "Right, on with some node.js hackery whilst watching a dubbed Italian film in the background."-- Chris Parsons. http://twitter.com/chrismdp/status/14710735804 [18:47] JAAulde has joined the channel [18:52] progrium has joined the channel [18:52] progrium: hello hello [18:54] jedschmidt has joined the channel [18:54] progrium: quick question about monkey patching... i've seen how to do it, but is there a sane way to package it up? [18:54] wilmoore has joined the channel [18:55] jedschmidt_ has joined the channel [18:55] progrium: like if i added a method to http.ServerRequest, what's the best way to include that in several projects? [18:56] behmann_ has joined the channel [18:56] aconbere: progrium: make a new module that loads http, and replace ServerRequest [18:56] aconbere: then loop over the keys in http and add them to exports [18:56] aconbere: then import your internal module whenver you want it [18:56] behmann_ has joined the channel [18:56] behmann_ has left the channel [18:56] progrium: ah, ok. although i didn't know i had to explicit export? [18:57] progrium: aconbere: how do you add to exports? [18:57] aconbere: progrium: yep, checkout the documentation on modules [18:57] progrium: ok thanks [18:57] isaacs: aconbere: why not just use Object.create? [18:57] aconbere: progrium: exports is just an object [18:57] isaacs: looping over the keys seems weird. [18:57] isaacs: js has prototype chains [18:58] isaacs: and then instanceof would still be true :) [18:58] atmos: isaacs: ping [18:58] jedschmidt_ has joined the channel [18:58] isaacs: atmos: about to head to a meeting. i'll be back later. [18:58] isaacs: atmos: i@izs.me [19:00] jedschmidt_ has joined the channel [19:00] aconbere: hmmm... I guess I'm not sure how you would use that pattern in this instance :) [19:00] jedschmidt has joined the channel [19:00] aconbere: progrium: maybe use isaacs method [19:01] progrium: is Object.create builtin? [19:01] DaNCeR: in v8 yes [19:01] progrium: ok, nice [19:01] aconbere: oh [19:01] DaNCeR: you could also just set the prototype of your function to the http module [19:01] aconbere: hmmm I didn't know that either [19:01] DaNCeR: they both accomplish the same thing [19:01] progrium: DaNCeR: sorry, what would that look like? [19:01] DaNCeR: object.create is a bit more for ad-hoc kinda stuff [19:02] DaNCeR: progrium: 2 seconds [19:02] aconbere: yeah I'm curious too [19:03] DaNCeR: i can still show you the pattern if you want [19:03] DaNCeR: but i think i just realised [19:03] DaNCeR: inheritance won't work [19:03] aconbere: I think I get the pattern [19:03] creationix has joined the channel [19:03] DaNCeR: because iirc you can't replace the exports object inside a module [19:03] aconbere: I just don't see how it helps you provide a monkey patched http module [19:03] aconbere: right [19:03] DaNCeR: dunno if anyone can confirm/refute that [19:03] aconbere: that's why I looped over keys [19:04] aconbere: at least whenever I tried to assign to exports that didn't work [19:04] creationix: DaNCeR: sure you can [19:04] creationix: module.exports = foo [19:04] creationix: I do it all the time [19:04] DaNCeR: there you go. my mistake [19:04] aconbere: hmmmm [19:04] aconbere: but exports = myObj; [19:04] aconbere: doesn't work? [19:04] DaNCeR: nah [19:05] creationix: aconbere: correct, that would be very hard to implement if not impossible [19:05] aconbere: right [19:05] creationix: yay for references everywhere [19:06] progrium: so i'd import http, patch whatever prototype in it, then module.exports = http? [19:07] gwoo has joined the channel [19:07] DaNCeR: http://gist.github.com/413543 [19:07] admc has joined the channel [19:07] DaNCeR: that should get you started [19:08] progrium: ah, you're saying add changes directly to module.exports after that [19:09] DaNCeR: yep [19:09] progrium: DaNCeR: excellent, thanks [19:09] DaNCeR: Object.create will create a new object whose prototype is the http module [19:09] DaNCeR: you then assign anything you want into that new object and anything you haven't replaced will follow the inheritance chain and go into the http module [19:10] DaNCeR: you may also be able to reference it with exports and this [19:10] _announcer: Twitter: "Javascript is the language of the future. Why? Node.JS, CouchDB, V8 are good answers" [pt]-- Felipe Elias Philipp. http://twitter.com/felipeelias/status/14711941648 [19:10] DaNCeR: normally you can inside a module but since you've replaced the object the references to exports and this might be stale [19:10] creationix: just remember that the object.create indirection only works one level deep [19:11] DaNCeR: creationix: if you replace the object with module.exports are exports and this still valid references? [19:13] maushu: creationix, wasn't you that wanted to do a reverse proxy? [19:13] mjr_: maushu: the twitter translate mapping is pretty slick. [19:13] creationix: DaNCeR: I think that exports would then be pointing to the old object [19:13] creationix: maushu: yeah, I made a simple one [19:13] creationix: sadly, it seems really slow though [19:13] creationix: even using buffers [19:13] maushu: Json was too slow, right� [19:14] creationix: oh yeah, raw json was way too slow [19:14] maushu: Wait, what. [19:14] maushu: Didn't you end up using http client/server? [19:14] creationix: maushu: I did, it's much faster than my custom stuff, but still quite slow compared to a direct connection [19:14] maushu: Hmmm. [19:14] maushu: How about bson? [19:15] creationix: the real solution is for node to be able to pass FDs to child processes and skip the whole proxy [19:15] creationix: bson would be even worse [19:15] maushu: Why? [19:15] creationix: JSON.stringify and JSON.parse are written in c [19:15] creationix: bson would be written in JS [19:15] creationix: unless you made a c extension for it [19:15] pavelz has joined the channel [19:16] maushu: Hmmm. [19:16] creationix: but then, why not use my cstring based protocol instead, it's much simpler than bson [19:16] maushu: Do you use ab to check for speed? [19:16] creationix: yeah ab [19:16] whoahbot has joined the channel [19:16] maushu: Dammit, I need a fast reverse proxy. [19:16] creationix: http isn't bad [19:17] maushu: hmmm. [19:17] wilmoore has joined the channel [19:18] Ori_P has joined the channel [19:18] _announcer: Twitter: "Big fan of node.js' build process. You can actually tell what's going on :)"-- Phil Schalm. http://twitter.com/pnomolos/status/14712337168 [19:18] creationix: maushu: nginx is the fastest reverse proxy so far [19:19] creationix: maybe with some tweaking node could be faster [19:19] progrium: btw, my monkey patching is for a proxy toolkit of the sorts [19:19] progrium: it adds forward() to ServerRequest, and attach() to ServerResponse [19:19] creationix: I think the node slowdown is serializing and deserializing the headers to/from js objects [19:19] progrium: with hooks for filtering, etc, but makes various proxies, balancers, etc very simple [19:19] maushu: creationix, yeah, but you can't dynamically change the upstream in nginx while running. [19:20] creationix: well, a node based reverse proxy is pretty fast [19:20] maushu: creationix, I was thinking about that.... [19:20] creationix: just nothing compared to something optimized for it [19:20] creationix: and 100 times more flexible [19:20] maushu: wouldn't a binary flatten json, work? [19:20] creationix: the protocol isn't the problem, it's the overhead of converting to/from it [19:20] maushu: Basicaly, a bson with no sub-documents and only key-values. [19:21] creationix: I modeled mine after the postgres protocol for hashes [19:21] maushu: It would be basically copy paste. [19:21] creationix: key\0value\0key\0value\0\0 [19:21] maushu: Yeah, like that. [19:21] creationix: doesn't get much simpler than that [19:21] maushu: Wasn't it faster than using http? It doesn't make sense [19:21] _announcer: Twitter: "#reddit Bespin moving to node.js and jQuery: submitted by coderanger [link] [comment] http://bit.ly/bgjOiC #rulez"-- REDDITSPAMMOR. http://twitter.com/REDDITSPAMMOR/status/14712491871 [19:22] jherdman has joined the channel [19:22] creationix: maushu: like I said, it's not the protocol itself that slowing it down, it was having to handle framing and deframing in js that slowed it down [19:22] progrium: creationix: is this how you recommend doing a reverse proxy? http://gist.github.com/413565 [19:22] creationix: the http library handles all that for you in highly optimized c code [19:22] maushu: But framming and deframing *should* be fast for such protocol. It doesn't make sense! [19:23] maushu: Wait. [19:23] creationix: fast is relative [19:23] maushu: Were you using buffers or just a string? [19:23] creationix: of course buffers [19:23] maushu: Drat. [19:23] xla has joined the channel [19:24] maushu: Well, I don't have much choice. I just hope ryah improves the code. :p [19:24] maushu: Well, there is the bjon encoder/decoder in the mongodb driver written in c. [19:25] progrium: creationix: just wondering if there's a better way [19:26] creationix: you would have to modify node to enable short-circuiting some of the http code and be able to pass the raw headers through untouched [19:26] creationix: but if you want to modify the headers, then it's a little more tricky [19:26] maushu: creationix, http://github.com/orlandov/node-mongodb/blob/master/src/bson.cc [19:27] creationix: maushu: yeah, but I doubt that would help much [19:27] maushu: Well, it would be in C for starters. [19:27] progrium: creationix: tricky as in, what i'm doing? [19:27] Nohryb has joined the channel [19:28] creationix: well, you can't pass the raw headers through if you want to read and modify them [19:28] creationix: that's all I'm saying [19:28] creationix: remember that speed is relative, writing a reverse proxy in stock node is pretty fast, just not quite as fast as I expected [19:29] progrium: right, but if you want to do operations on the request (headers, data, etc) then you have to go through and set up all that glue [19:29] progrium: and that's as fast as you'll get with node as it is [19:29] creationix: so for example, serving a hello world app directly gets around 2500 reqs/sec on my laptop [19:30] creationix: passing that through a simple node reverse proxy gets about 500/sec [19:30] creationix: I would expect more around 900 at least [19:30] creationix: maybe the http client code is what's slow [19:30] ceej has joined the channel [19:31] maushu: creationix, that is what I was thinking. [19:31] maushu: ry did say it needed work. [19:31] creationix: makes sense [19:32] DaNCeR: i might have asked this before but is there a roadmap for node? [19:32] creationix: DaNCeR: I'm not sure it's published [19:32] creationix: maybe on the wiki [19:33] creationix: I know some of the high-level plans [19:33] maushu: "world domination" [19:33] maushu: "summon cthulhu" [19:34] creationix: v0.2.0 will be released when all current showstopper bugs are fixed, API will be about the same as now [19:34] saikat` has joined the channel [19:34] creationix: the v0.3.0 branch will be an unstable branch with new experimental features, most notably webworkers and passing FDs around [19:35] creationix: when it's done, it will be released as v0.4.0 [19:35] progrium: that's useful to know, thanks [19:36] creationix: there are no plans to integrate a package manager or a standard library with node, that's up to node distrubutions [19:36] kriszyp: so does node need to implement webworkers to pass around FDs? [19:36] creationix: kriszyp: I don't think so [19:36] kriszyp: just curious about the rationale behind workers being in node vs being in user land [19:36] kriszyp: oh, ok [19:36] creationix: I think the thing holding up webworkers is not having fork on windows and wanting node on windows [19:37] TobiasFar has joined the channel [19:37] creationix: ryah: correct me if I say anything incorrect :) [19:38] phiggins has joined the channel [19:39] sh1m has joined the channel [19:41] b_erb has joined the channel [19:42] stepheneb has joined the channel [19:43] kriszyp: just seems like it would be cool if cramforce's worker impl (or others could be created) that build off improvements in node wihtout being displaced by a in-core impl, but maybe there are aspects that I don't know about. [19:44] creationix: kriszyp: I don't know either, I would imagine ryah wanting to defer to the user-space implementations and just let node provide the required plumbing [19:46] kriszyp: yeah, that approach is where node really shines [19:46] bigwavejake has joined the channel [19:47] creationix: so V8 provides the language and VM, node provides the OS level stuff like IO, process management, and events, and then frameworks/libraries provide what the end-developer uses to write real user-facing apps [19:48] creationix: I think that's the goal [19:48] sh1mmer has joined the channel [19:48] creationix: I could see web workers fitting into node itself since node does other process management, or deferring to something higher-level [19:50] ncb000gt: creationix: you know of anyone working up a node distro yet? [19:50] creationix: I plan on making one when I get some time, won't be till after my two talks next week though [19:50] creationix: no promises though [19:50] ncb000gt: Gotcha [19:51] Phazm has joined the channel [19:51] ncb000gt: Meh, I'm more thinking about what the splits will be and include... [19:51] DaNCeR: sorry kriszyp this might be what you meant before but why workers in node? surely that belongs lower down in v8 [19:51] ncb000gt: splits being differentiators for distros [19:51] creationix: hopefully there will be one main distro that takes off, or at least the distros can share common packages [19:52] creationix: like how the ubuntu family works [19:52] ncb000gt: yea [19:52] Phazm: Does anyone ever feel like they are being very inefficient when learning something new, because the 'matrix auto-learning' is bound to be just around the corner? Maybe it's just me. [19:53] ceej has joined the channel [19:53] creationix: DaNCeR: V8 doesn't do any OS level stuff except for memory management [19:53] creationix: node does everything else [19:54] ncb000gt: Phazm: I do feel inefficient when I'm learning something, but what other way is there to learn something? [19:54] ineation has joined the channel [19:54] ncb000gt: You can optimize learning as much as you want but you'll still be less efficient than if you fully know something. [19:55] Phazm: ncb000gt: Well, for now, manually is the only way we have... But I just KNOW as soon as I perfect my knowledge of something many people haven't, that's when we'll be able to put a floppy disk into a computer and hit 'upload to brain' [19:56] ncb000gt: :) Maybe so. But, I personally enjoy the challenges of learning [19:56] ncb000gt: something new. [19:56] Phazm: so do I, tbh. It's just overwhelming when there are about 30 different things you need to learn in order to learn the one thing you are trying to learn [19:57] ncb000gt: Agreed. [19:57] JimBastard has joined the channel [19:57] DaNCeR: creationix: i just thought that with web workers being a feature of both chrome and node that it would be logical for it to be in the lower common denominator but I guess google must have it above v8 as well [19:58] creationix: yeah, v8 doesn't include the DOM and most the other higher-level stuff in the browser [19:58] joshbuddy has joined the channel [19:58] creationix: it's just the language [19:58] creationix: and some odd places stuff like url escaping [19:58] creationix: remember that JS was never a well though-out language, it was rushed out the door by netscape and sun [19:58] Phazm: JimBastard was saying something (or asking) about the dangers of prototyping the date object -- I'm planning on adding a 'getWeek' method to the date, does anyone foresee an issue with that? [19:58] creationix: we're lucky to have what we have [19:59] DaNCeR: yeah i dunno i guess i just figured web workers would be something that belonged inside the vm and not the software its attached to [19:59] JimBastard: yo Phazm [19:59] creationix: DaNCeR: V8 certainly exposes the tools to implement web workers [19:59] JimBastard: ive got a much saner approach then getWeek [19:59] Phazm: yo JimBastard, you weren't here a second ago. Or I'm losing my mind. [19:59] DaNCeR: creationix: fair enough [20:00] JimBastard: http://github.com/marak/javascript-fu [20:00] JimBastard: (not done) [20:00] Phazm: JimBastard: Good, because I was feeling really bad about getting my method from the same site offering the video on 'how to use bulleted lists in word 2003' [20:00] JimBastard: Phazm: what would getWeek do? [20:00] JimBastard: my approach is format masking [20:00] Phazm: JimBastard: Same functionality as getDay, but return a week, so jan 1-7 would be '1', and so on [20:01] JimBastard: got ya [20:01] JimBastard: hrmmm [20:01] JimBastard: i need to add those back in [20:01] JimBastard: i dunno how rushed you are to get that stuff done, but it would be awesome if we could collaborate [20:02] ncb000gt: Phazm: so, how do you add bulleted lists to word 2003? [20:02] rudebwoy has joined the channel [20:03] larssmit has joined the channel [20:03] Phazm: ncb000gt: it's far too complicated to explain.. you have to move this pointing device, depress a button on it in a very specific location within a section of pixels displayed on a rectangular device in front of you... I haven't fully figured it out yet [20:04] Phazm: JimBastard: I'm all for collaboration -- I think in the meantime I will just use a temporary hack to get it, and I'll enhance it with your robust solution later. There is a _LOT_ of cleanup needed in my app :-/ [20:04] ncb000gt: Phazm: useless! [20:04] progrium: can i get some feedback on the api for something i'm making myself? [20:04] progrium: http://gist.github.com/413607 [20:04] JimBastard: well Phazm if you want fork / watch that repo [20:04] larssmit has left the channel [20:05] Phazm: JimBastard: will do. How complete is it atm? [20:05] JimBastard: ? [20:05] JimBastard: did you try using javascript? [20:06] JimBastard: ohhh [20:06] JimBastard: LOL [20:06] JimBastard: misread [20:06] JimBastard: sorry [20:06] larssmit has joined the channel [20:06] JimBastard: Phazm: complete is a relative word, especially with this project. its more about the API then the code [20:06] Phazm: To create bulleted lists? Impossible! [20:06] JimBastard: there are a few hundred tests already [20:06] JimBastard: inflectors are done [20:06] larssmit has joined the channel [20:06] JimBastard: most of the isFu is done [20:06] mrjjwright has joined the channel [20:07] JimBastard: and you can DateFormat() now [20:07] JimBastard: well [20:07] Phazm: complete not meaning 'finished' -- I mean feature-complete. Support for all that is in the readme [20:07] JimBastard: new Date().format() [20:07] JimBastard: theres a lot of functionality already [20:07] JimBastard: the readme is autogeneated from the code [20:07] JimBastard: so everthing you see is at least stubbed [20:08] JimBastard: date formatting / masking is working [20:08] JimBastard: inflectors are working [20:08] JimBastard: most type checkers are working [20:08] progrium: perhaps i should send to the list instead [20:08] JimBastard: theres a lot in there [20:08] binary42: Where is toAwesome()? It's not done till there is awesome. [20:08] JimBastard: i read the gist progrium [20:08] JimBastard: binary42: what does that do? [20:08] bajeczka has joined the channel [20:08] JimBastard: i dont know how to become awesome, i was born that way [20:09] binary42: JimBastard: Make it awesome. So it should cast the object to a JimBastard format then. [20:09] JimBastard: not sure what you want me to say about it progrium [20:09] Phazm: binary42: I think there's a video for that next to the 'how to create bulleted lists' [20:09] progrium: JimBastard: well i suppose if you have nothing to say, it's not that good? [20:10] JimBastard: its just code, seems to be doing some ssl stuff [20:10] progrium: its a patch to add forward and attach to http classes [20:10] progrium: so you could build proxies, balancers, and other weird stuff (that i do often) easily [20:11] progrium: rather, its a design doc for the patch [20:11] progrium: with some use cases [20:11] JimBastard: its hard to write proxies and load balancers? [20:11] progrium: there's a level of boilerplate that's required [20:11] JimBastard: aye [20:11] Phazm: JimBastard: I'll try to fork and add a dateTimeFu for 'w' which will return '1' through '52' -- suppose I should have 'ww' as well? [20:12] JimBastard: Phazm: hrmmm [20:12] Phazm: (which would return '01' through '52' [20:12] Phazm: ) [20:12] JimBastard: so maybe w is number, ww is number padded with leading zero if under 10, www would be an ordinal? [20:12] JimBastard: First, Second, etc [20:12] JimBastard: not sure about www [20:13] progrium: JimBastard: i guess i'm looking to see if its a useful abstraction [20:13] JimBastard: yeah, im not the best person to judge that [20:13] progrium: i try to prove it by showing 3-5 line *useful* things [20:13] JimBastard: but if it saves time, why not [20:13] Phazm: define: ordinal [20:13] JimBastard: 1 = One [20:13] JimBastard: or [20:13] JimBastard: 1 = First [20:13] Phazm: someone needs to add that to _announcer [20:13] JimBastard: 2 - Second [20:13] Phazm: ah [20:13] Phazm: righto [20:13] JimBastard: there is toOrdinal() already too [20:14] Phazm: sexy [20:14] JimBastard: the build process for js-fu is a bit hectic [20:14] JimBastard: well , its not hectic you just gotta know what to do [20:14] JimBastard: the js-fu.js file is autogenerated [20:14] Phazm: 'knowing what to do' is what I do worst. [20:14] JimBastard: based on the commonjs /lib/ folder [20:14] JimBastard: so you make changes to the code inside /lib/ [20:14] JimBastard: and when you want to bundle it, you run /BUILD/build.js [20:15] JimBastard: running the build script should run all the tests, bundle the library, and regenerate the demos and documentations [20:15] JimBastard: ping me if you have issues, i gotta get back to work [20:15] Phazm: and I require js-fu in my script? [20:15] JimBastard: aye [20:15] Phazm: k, thanks [20:15] JimBastard: its the same setup as faker [20:16] JimBastard: you can require the bundle (easy) [20:16] ryan[WIN] has joined the channel [20:16] JimBastard: or you could require the whole folder as a commonjs module [20:16] JimBastard: the bundle is dual sided [20:16] JimBastard: theres no voodoo magic, you just gotta read through the comments and folder structure [20:17] Phazm: i prefer voodoo magic to reading, but alright [20:17] isaacs has joined the channel [20:18] hammerdr has joined the channel [20:21] isaacs: cloudhead: ping [20:21] creationix: am I losing my mind, I thought http request objects emitted "data" and "end" events right? [20:21] isaacs: cloudhead: it looks like less didn't upload to the npm registry properly [20:21] _announcer: Twitter: "A simple API proposal for nodejs to make various kinds of HTTP glue super easy: http://gist.github.com/413607"-- Jeff Lindsay. http://twitter.com/progrium/status/14715340866 [20:21] Phazm: wow, this library is actually extremely useful to me -- I'm already doing stuff like 'toPennies' and 'toDollars' etc. [20:22] hammerdr: isaacs: does npm handle repos like http://github.com/robrighter/node-xml ? [20:22] isaacs: hammerdr: nope. tack a /tarball/master onto that bad boy [20:22] hammerdr: isaacs: i did [20:23] isaacs: hammerdr: http://github.com/robrighter/node-xml doesn't have a package.json [20:23] isaacs: hammerdr: looks like someone needs a pull request :) [20:24] hammerdr: aight :) Was just making sure there wasn't another way before I go evangelizing packages.json when its unnecessary :P [20:24] isaacs: hammerdr: it's not unnecessary. [20:25] isaacs: hammerdr: it's blocking node-xml's users. [20:25] isaacs: hammerdr: for example, you. [20:25] inimino: evangelism++ [20:28] creationix: anyone know what would cause my http request from emitting "data" and "end" events? [20:28] creationix: s/cause/keep/ [20:28] creationix: I an sending post requests with a real body [20:28] halorgium: creationix: server-side or client-side? [20:28] halorgium: ah, server [20:29] halorgium: content length incorrect? [20:29] pkrumins: snap, i added another class to my node-png library, and now when testing it, I am getting: [20:29] pkrumins: node: /usr/local/pkg/nodejs-0.1.95/include/node/node_object_wrap.h:26: static T* node::ObjectWrap::Unwrap(v8::Handle) [with T = node::Buffer]: Assertion `handle->InternalFieldCount() > 0' failed. [20:29] creationix: the client-side code used to work, it's unchanged [20:29] pkrumins: Any ideas what causes this [20:31] creationix: nevermind, I found the bug, it's in my code elsewhere [20:31] JimBastard: progrium: i re-read, makes sense [20:32] cloudhead: isaacs: yea, something weird happened [20:32] cloudhead: but then it looked like it worked [20:33] isaacs: cloudhead: yeah, i kinda know what the issue is, but i need to fix it. [20:33] cloudhead: isaacs: it told me 'invalid json', even though it installed fine on the server [20:33] cloudhead: i mean locallh [20:33] cloudhead: locally* [20:33] isaacs: yeah [20:33] isaacs: it's not ideal. [20:33] isaacs: :) [20:33] isaacs: this is the most relevant bug for me to fix right now. [20:33] cloudhead: hehe [20:33] isaacs: what makes it worse is that it's really tricky, and i'll be unable to touch it for at least the next two weeks. [20:34] isaacs: SUCH a tease. [20:34] meadhbh has joined the channel [20:34] meadhbh: wow. lots of node.js people! [20:34] pkrumins: fixed my bug [20:34] pkrumins: never mind. [20:34] softdrink has joined the channel [20:34] JimBastard: more nubs [20:34] isaacs: cloudhead: aha. it's too big. 413 Request Entity Too Large [20:35] isaacs: stupid nginx and its http1.0 limits. [20:35] isaacs: the couchapp needs to be sitting exposed on a different host than my random dinky little blog site.s [20:35] isaacs: when i get back from vacation, i'll kick my domain admin's ass and make him get to work on this. [20:36] rnewson_ has joined the channel [20:36] cloudhead: isaacs: aha you know what, it's because of the java compiler [20:36] mikeal: isaacs: we wrote an erlang balancer or this [20:36] mikeal: or/for [20:36] isaacs: yeah [20:36] cloudhead: google closure compiler [20:36] linuxsable has joined the channel [20:37] isaacs: cloudhead: it's not all that big. it's stupid that it breaks on this. [20:37] cloudhead: yea [20:37] isaacs: nginx just isn't designed to be a proxy. [20:37] isaacs: it has proxy_pass, but if you do anything even remotely interesting, then proxy_pass sucks a lot. [20:37] cloudhead: heh [20:38] uberbrady has joined the channel [20:40] b_erb: i can second that, proxy_pass can really be pain [20:40] isaacs: jeezus, it's even failing to upload through futon directly to the couchdb. [20:41] isaacs: oh, i wasn't logged in *^_^* [20:44] softdrink: wheeee power down for the whole city [20:47] JimBastard: the powers on softdrink [20:47] isaacs: cloudhead: ok, so it's working now. if you run into that kind of thing again, email me or the npm-@googlegroups.com list [20:47] softdrink: hehe [20:47] softdrink: which also means BlueHost is down [20:49] cloudhead: isaacs: cool, thanks [20:49] cloudhead: isaacs: should I reupload? [20:50] isaacs: cloudhead: no, not yet. [20:51] isaacs: cloudhead: it's working now, but only because i dodged the npm upload and went through futon [20:51] creationix: anyone here have a sound understanding of node's event model? [20:51] creationix: I have a fun question [20:52] cloudhead: isaacs: oh ok, let me know [20:53] darkf has joined the channel [20:54] uberbrady: only very unsound [20:55] JimBastard: creationix: thats a scary question coming from YOU [20:56] isaacs: creationix: i'll bite. what's up? [20:56] creationix: trying to modify http input streams [20:58] hellp has joined the channel [20:59] atmos: isaacs: fwiw i added an npm package to homebrew today [20:59] atmos: it should be merged soonish [20:59] isaacs: neato :) [20:59] isaacs: how will it stay up to date? [20:59] atmos: tags in github [20:59] isaacs: i see. [20:59] atmos: once it's in it's pretty trivial to get versions bumped [20:59] isaacs: you can just download the npm master, and then do "make" to install whatever's stable. [20:59] isaacs: npm installs itself. [21:00] atmos: minus the executable ? [21:00] atmos: when i run make install i never get npm in my path [21:00] atmos: so i basically have it downloading the latest stuff and have a shell script that invokes cli.js [21:01] isaacs: atmos: what do you get in the node repl when you do "process.installPrefix"? [21:01] rictic has joined the channel [21:01] atmos: /Users/atmos/Developer/Cellar/node/0.1.96 [21:01] atmos: oh interesting, it's in there [21:02] maushu has joined the channel [21:02] atmos: hrmm, ok [21:02] atmos: i might change this up some [21:02] atmos: thanks [21:05] softdrink has joined the channel [21:06] ajpiano has joined the channel [21:06] charlesjolley has joined the channel [21:06] isaacs: atmos: if you put node's installPrefix in your path, then it'll see it [21:06] isaacs: atmos: er, {installPrefix}/bin [21:07] fictorial: git is making me feel stupid. [21:08] olegp has joined the channel [21:08] JimBastard: lol fictorial [21:09] fictorial: either it's been a long day or I'm just dense. why am I seeing changes made to a file in a branch on master? [21:09] fictorial: bah, this isn't the place, sorry [21:10] JimBastard: fictorial: when you did your push [21:10] JimBastard: did you specify the remote branch? [21:10] JimBastard: git push origin Notmaster [21:10] fictorial: no push, no remote, just branching locally first [21:10] JimBastard: its possible you just made the change in the wrong place [21:10] JimBastard: start over, try to replicate [21:11] mikeal has joined the channel [21:11] meadhbh: ack! just got bitten by "evolving" APIs and lagging documentation. [21:11] JimBastard: pfft [21:11] meadhbh: writing on the blackboard... "i will always double check the source" 100 times [21:12] fictorial: JimBastard: I think I'm just dense right now. I always assume I'm the dumba$$. http://gist.github.com/413698 [21:12] JimBastard: wtf [21:12] JimBastard: are you programming on mt olympus? [21:12] admc has joined the channel [21:13] meadhbh: lol. no. just lazy. saw the documentation and figured it was a good place to start. [21:13] meadhbh: and it is a good place to start [21:13] meadhbh: just not a good place to end [21:13] JimBastard: was talking to fictorial [21:13] JimBastard: ⚡ ⚡ ⚡ ⚡ ⚡ ⚡ [21:14] JimBastard: dunno fictorial looks decent enough to me [21:14] mitkok has joined the channel [21:14] JimBastard: maybe you have tracking setup [21:14] JimBastard: check your git config maybe [21:14] JimBastard: im not sure, sorry [21:15] fictorial: am I crazy though? changes made on the branch shouldn't be seen on another branch. I'm missing something here. [21:16] isaacs: fictorial: changes *committed* to a branch aren't seen on other branches. [21:16] fictorial: isaacs: sigh, ok [21:16] fictorial: it's official - I need to go outside. thanks. [21:17] isaacs: no problem. enjoy the fresh air :) [21:17] joshowens has joined the channel [21:17] derbumi_ has joined the channel [21:18] charlesjolley has joined the channel [21:19] mscdex: or in some cases -- enjoy the pollution :P [21:21] creationix: ok, isaacs, I think what I need for my event problem is proxy streams [21:21] JimBastard: ohh yeah duh fictorial [21:22] ddollar has joined the channel [21:22] JimBastard: its just a file until you commit [21:24] uberbrady: Anyone have any ideas about what to do with: ECONNRESET, Connection reset by peer [21:24] uberbrady: in the HTTP client? [21:25] riq has joined the channel [21:26] mikeal: it means the client disconnect [21:26] mikeal: it's a socket error [21:26] charlesjolley_ has joined the channel [21:26] uberbrady: yup - so I figure I put an error handler on the socket [21:26] uberbrady: and retry the connection, and I'm good, right? [21:28] uberbrady: although I thought I saw something about the errors bubbling up to the request now -if so I can certainly move them. Feels dirty to mess with the request's sockets directly. [21:29] stagas has joined the channel [21:29] derbumi has joined the channel [21:31] gf3: Anyone have that gist about iteration times of objects, Object.keys vs. for...in? [21:32] isaacs: gf3: talk to creationix. [21:32] gf3: isaacs: thanks [21:32] mape: fictorial: think it was like 10-30% faster [21:32] mape: Em.. gf3 ^ [21:33] gf3: mape: indeed [21:33] gf3: creationix: do you have the gist handy? [21:33] creationix: gf3: just a sec... [21:34] creationix: https://gist.github.com/bdd159b4f8f7c900d939 [21:34] behmann has left the channel [21:34] gf3: creationix: hot, thanks man [21:37] cloudhead: do HEAD requests through the http client not behave the same way as other methods? [21:37] binary42: JimBastard: Going to head home in a few and get some things done. Are you going to NYC.rb's hack thing or skipping? [21:39] binary42: (I'll take that as a wait and see.) [21:39] pjb3 has joined the channel [21:44] binspace has joined the channel [21:44] JimBastard: hey binary42 [21:45] JimBastard: i might swing by pivotal for a little [21:45] JimBastard: its soo close [21:45] binary42: JimBastard: Cool. I'll possibly show up. No promise. [21:45] JimBastard: aight, ill be there around 7 or so [21:45] JimBastard: then home [21:47] binary42: Word. I should get tmm1 to come hack with us. [21:49] creationix: so I'm learning the internals to the http request and response objects in node [21:49] creationix: they share the same stream object right? [21:49] isaacs: creationix: yes [21:50] binspace: Has anybody been experimenting with using the same templates to render html on both the server (for SEO) and client (for dynamic behavior and js testing)? [21:50] creationix: binspace: I did that a while back for experimental node docs [21:51] binspace: creationix: Was is worth it? [21:51] creationix: http://github.com/ry/node_docs [21:51] binspace: cool [21:51] creationix: it wasn't too hard [21:51] creationix: I just usually don't have that use case [21:51] brainss has joined the channel [21:51] brainss has left the channel [21:52] creationix: isaacs: so what I want is the ability to make a middleware type thing that intercepts the http req stream, does some async work while buffering the events, and then calls the main app, but puts the events back in the stream so the app can listen for them [21:53] mde: binspace: Geddy's EJS uses a library I originally wrote for client-side use: http://js.fleegix.org/plugins/ejs [21:53] mde: It's pretty straightforward, just embedded JS. [21:54] _announcer: Twitter: "inspiring talk on node.js: http://bit.ly/cTAtll definitely worth watching."-- Matheus Mendes. http://twitter.com/bigodines/status/14719724174 [21:55] binspace: nice, thanks. I'm actually thinking of something crazy, but it's probably just plain stupid. [21:55] mde: Sometimes stupid-crazy, sometimes like-a-fox crazy. [21:56] mde: Never know til you try. [21:57] binspace: Yeah :-) I'm having a hard time getting really productive in node at this point to create web apps, so I'm thinking of using Ruby to talk to the data store and do server side logic, and node/the browser to create the html from json + a template. [21:57] JimBastard: binspace: i gave up on that months ago in favor of doing pure client-side templating [21:57] binspace: JimBastard: Only problem is SEO, right? [21:57] JimBastard: if you are using mustache or something like that, you can still render your views on the client [21:58] binspace: hmm [21:58] mde: SEO and graceful degrdation, if you give a shit about that. [21:58] binspace: Right, nice and simple. Both javascript and ruby [21:58] binspace: That looks good [21:59] mde: binspace: You might take a look at Geddy. It's still early, but getting pretty solid. [21:59] mde: http://github.com/mde/geddy [21:59] JimBastard: fuck SEO [21:59] JimBastard: http://code.google.com/intl/sv-SE/web/ajaxcrawling/docs/getting-started.html [22:00] binspace: Interesting. I've been playing with express. [22:00] atmos: JimBastard: OMG FUCK YOU I BASE MY ENTIRE BUSINESS AROUND SEO AND I'M MAKIN' BANK! [22:00] binspace: JimBastard: Yes, fuck it to hell :-) [22:00] atmos: ;) [22:00] JimBastard: internet bidness is serious bidness [22:00] mde: binspace: Express has been around longer, so it's likely a lot more baked. [22:00] JimBastard: i once had a site that got 30k hits a day [22:00] atmos: binspace: i had fun w/ express, static files still kinda suck on heroku [22:00] JimBastard: it was the bane of my existance [22:00] charlesjolley has joined the channel [22:01] mde: But it's aimed at a different kind of app I think. [22:01] JimBastard: fuck express [22:01] atmos: haha [22:01] JimBastard: if i wanted sinatra id use rails [22:01] binspace: haha [22:01] JimBastard: or ruby [22:01] JimBastard: or whatever they call that shit [22:01] mde: I actually haven't looked at it, I have no idea if it's any good or not. [22:01] JimBastard: its great [22:01] atmos: yeah, i had to write a small service the other day and it just made more sense to use sinatra [22:01] JimBastard: if you want sinatra [22:01] atmos: mde: it's pretty good if you like sinatra [22:01] JimBastard: and cant use ruby [22:02] binspace: Not bad. Well it's faster and is evented. [22:02] mde: I just want an easy way to build JS web apps, and I don't want it to look like that. :) [22:02] JimBastard: "is evented" [22:02] binspace: well, ok, has the potential to be evented [22:02] JimBastard: o.O [22:02] atmos: potential synergy \m/ [22:02] JimBastard: i dont even know what that means [22:03] JimBastard: well, you are here now [22:03] JimBastard: and that is a great first step my friend [22:03] JimBastard: welcome [22:03] JimBastard: binspace: [22:03] binspace: thank you [22:03] JimBastard: really, i wouldnt try building any web apps in node today if i were you. [22:03] JimBastard: unless you are trying to learn node [22:03] binspace: Yeah, I'm learning that [22:04] JimBastard: node is amazing at what it does [22:04] JimBastard: but it doesnt have the 5 years of development behind it yet for the consumer side [22:04] JimBastard: we are working on it [22:04] JimBastard: hard [22:04] JimBastard: everyday [22:04] JimBastard: i can assure you of this [22:04] binspace: That's all I can ask. You guy are making so much progress too [22:04] _announcer: Twitter: "ChirpStream で Node.js さわる やつ 書いた http://github.com/swdyh/node-chirpstream" [ga]-- swdyh. http://twitter.com/swdyh/status/14720235885 [22:04] JimBastard: yeah have you seen that guy marak on github? [22:04] JimBastard: hes an animal [22:05] JimBastard: i heard he has like 4 more libs incoming [22:05] JimBastard: dude must not sleep [22:05] isaacs: I hear he's a Bastard, though [22:05] binspace: nice, must be young [22:05] isaacs: got banned from hacker news. [22:05] stephenlb has joined the channel [22:06] isaacs: JimBastard: weren't you saying something about what a jerk that guy is? [22:06] JimBastard: yeah, i keep telling him to come to IRC [22:06] isaacs: JimBastard: how you were gonna kick his ass if you ever meet in irl or something? [22:06] JimBastard: >., [22:06] JimBastard: >.< [22:08] JimBastard: anyone else in nyc going to pivotal tonight? [22:08] ryah: cloudhead: head requests are broken [22:09] ryah: cloudhead: which sounds more frightening than it actually is [22:09] cloudhead: ryah: : | [22:09] cloudhead: ryah: seems to work if I just wait for the 'response' event [22:09] keyvan has joined the channel [22:09] binspace: JimBastard: You work for Pivotal? [22:10] mjr_ has left the channel [22:10] ryah: cloudhead: it depeneds on the response - if it contains a content-length [22:10] ryah: cloudhead: there will be a problem [22:10] mjr_ has joined the channel [22:10] JimBastard: no binspace, theres a hackathon there tonight [22:10] JimBastard: i live a couple blocks away [22:10] binspace: aah, cool [22:10] JimBastard: ACTION is not a pivot [22:10] binspace: haha [22:10] JimBastard: you based in nyc? [22:11] binspace: No, SF bay area [22:11] maushu: (Pivot)JimBastard [22:11] maushu: fixed [22:11] JimBastard: i wouldnt want to work for pivotal anyway [22:11] cloudhead: ryah: hm it does include a content-length [22:11] JimBastard: they'd probaly want me to be an "all around" coder [22:11] cloudhead: ryah: actually curl doesn't deal with it nicely either [22:11] cloudhead: it waits for the content [22:12] JimBastard: what they don't understand, is like most things in life, programming languages are all just a degenerative form of javascript [22:12] ryah: cloudhead: really? [22:12] cloudhead: ryah: yea, unless I'm doing it wrong: curl -i -X HEAD 127.0.0.1:5984/test/04831b6c3f588979d040fd9f832e1871 [22:12] cloudhead: "curl: (18) transfer closed with 125 bytes remaining to read" [22:13] ryah: oh rad [22:13] cloudhead: heh [22:13] cloudhead: you can do better than curl though [22:13] cloudhead: actually [22:14] cloudhead: if I do `curl -I` it works fine [22:14] cloudhead: weird [22:14] ryah: i guess curl just closes the connection [22:14] ryah: if you do -I [22:14] cloudhead: but that explicitly tells it to just get the head [22:14] cloudhead: yea [22:15] ryah: anyway - yeah - head is broken [22:15] uberbrady: I prefer: [22:15] ryah: luckily no one really uses head [22:15] maushu: ... [22:16] uberbrady: telnet localhost 5984 ....... HEAD /test/04831b6c3f588979d040fd9f832e1871 HTTP/1.0 ....Host: localhost .... [22:16] cloudhead: ryah: is it going to get fixed? can I help? [22:16] JimBastard: Phazm: let me know if you are gonna do any commits today, we will be working on js-fu in a few hours [22:16] Phazm: JimBastard: I most likely will, but not for a bit [22:16] JimBastard: that project should be pretty active for the next week or so as we finish [22:16] sechrist__ has joined the channel [22:16] JimBastard: aight, feel free to ping me anytime [22:16] Phazm: will do, thanks [22:16] ryah: cloudhead: i can send you a patch for http_parser.c and explain to you what is wrong [22:16] ryah: you'd have to take it from there [22:17] ryah: i have it sitting here - i just haven't pushed it [22:17] maushu: What happens under the hood when a http server is started in a Script? I guess it acts like a normal server as if it were created "outside"? [22:18] JimBastard: ? [22:18] JimBastard: it should just start the service [22:18] JimBastard: dunno what outside means [22:18] JimBastard: you mean inside a require? [22:18] maushu: It means I can't reuse my sandboxes. [22:19] cloudhead: ryah: ah it's at the parser level, I could have a look yea if it doesn't take you too long to explain [22:19] maushu: I mean inside a Script, a new context, etc. [22:19] JimBastard: lol [22:19] maushu: I'm trying to be green here! [22:19] JimBastard: maushu , you are the one trying to compete nodejitsu right [22:19] maushu: You forgot me?! BLASPHEMY! [22:20] JimBastard: my sandboxing approach is extremely stupid [22:20] JimBastard: and it works surprisingly well [22:20] JimBastard: kinda like me in general [22:20] maushu: By stupid, you mean the normal way. [22:20] maushu: :p [22:20] maushu: I was trying to be smart. It didn't work so well. [22:20] JimBastard: im doing some fairly serious monkey punching to make my shit work [22:21] JimBastard: things that would make you go o.O [22:21] JimBastard: we gonna be releasing in a month or so btw [22:21] JimBastard: probaly without the cloud api stuff [22:21] JimBastard: but still multi-server [22:22] JimBastard: ACTION knocks on wood [22:23] maushu: One month to hire some decent assassin, then. [22:23] maushu: It's so hard to find good help these days. [22:24] mape: not if you have a good idea [22:24] mape: and can convince people it is a good idea [22:24] mape: and you seem like someone one would like to work with [22:24] maushu: mape, I will give you two dollars if you... dispose... of JimBastard. [22:24] _announcer: Twitter: "bespin to move to node.js and jquery! - http://www.blueskyonmars.com/2010/05/25/bespin-and-jquery/"-- scott brisko. http://twitter.com/sbrisko/status/14721260437 [22:24] Phazm: maushu: check craigslist? [22:24] Phazm: ;) [22:25] maushu: Phazm, woah, thanks. I completely forget that one. [22:25] JimBastard: heh [22:25] JimBastard: i aint never scured [22:25] Phazm: pretty sure there's a dedicated section [22:25] JimBastard: bring it bitches [22:25] mattly has joined the channel [22:25] maushu: "Dear craigslist, I'm looking for an eraser to erase competition, asap. $2 for the job. " [22:26] maushu: "Ps: You can keep the body parts." [22:27] Phazm: ahh, that ps will certainly appeal to the majority of craigslisters ;) [22:27] JimBastard: im more then 500k in debt due to lawsuit involving the internet and have been to jail. it takes more then idle irc threats to move me [22:27] JimBastard: ;-) [22:27] JimBastard: www.jimbastard.com [22:27] sechrist: JimBastard: stop cracking things [22:27] JimBastard: the only thing i cracked was that ass [22:28] softdrink: :E [22:29] maushu: ACTION drinks softdrink. [22:31] pavelz has joined the channel [22:32] kriszyp_ has joined the channel [22:35] harryv has joined the channel [22:35] jbrantly: "The girl is gorgeous and the sex is not all that revealing, while the boy in question is wearing socks." lol [22:35] Tim_Smart has joined the channel [22:35] harryv: so, how many concurrent background threads can I have going? [22:36] mape: ? [22:36] stepheneb has joined the channel [22:36] harryv: eh, wrong wording. [22:36] JimBastard: lol jbrantly [22:36] JimBastard: SOCKS [22:37] JimBastard: harryv: depends on your setup [22:37] JimBastard: harryv: if you mean what i think you mean [22:38] JimBastard: except your wording is fubar [22:38] harryv: it is. [22:38] JimBastard: you should be able to run a simple test [22:38] JimBastard: but like node can handle crazy amounts of things going on at once [22:39] harryv: that will do. [22:39] JimBastard: ive had my reverse proxy load balancer survive the frontpage of hacker news [22:40] ryah: cloudhead: okay - just need to rebase some code [22:40] JimBastard: but you might be able to make a more scientific test, like getting on the frontpage of slashdot [22:40] uberbrady: JimBastard - I'm doing something similar but it keeps blowing up. Any tricks? [22:40] JimBastard: similiar to what? [22:41] JimBastard: there is lots of code for reverse proxy [22:41] JimBastard: that one guy did a nice blog post on it [22:42] cloudhead: ryah: cool [22:43] uberbrady: I'll go google "that one guy" and "blog post" and I'm sure the article should pop right up [22:44] micheil_mbp has joined the channel [22:44] JimBastard: how about you google "jimbastard" and then "node js modules wiki" [22:45] JimBastard: also try googling "i ask obscure questions and expect detailed answers" [22:45] JimBastard: if you'd like i can just email all this to you [22:45] JimBastard: :-) [22:45] uberbrady: I'd rather you just write the code for me and then I can go have a beer [22:46] JimBastard: i can do that [22:46] uberbrady: or 4 [22:46] JimBastard: just give me the ssh info or your github info so i can upload [22:46] JimBastard: or get your party vanned [22:46] JimBastard: either way [22:46] creationix: FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData() length exceeds max acceptable value [22:46] JimBastard: :p [22:46] JimBastard: ill stop now [22:47] creationix: lack of stacktrace = fail [22:47] softdrink: lack of backface = cull [22:48] softdrink: ACTION needs sleep [22:48] mattly has joined the channel [22:52] freshtonic has joined the channel [22:54] JimBastard: freshtonic + softdrink [22:54] JimBastard: and with that im out [22:54] softdrink: STOP ABDUCTING ME [22:55] cloudhead: creationix: do you still have that code which expires keys with setTimeout? [22:55] creationix: cloudhead: which one? [22:56] cloudhead: I dont remember [22:56] isaacs: cloudhead: are you thinking about my lru-cache? [22:56] cloudhead: isaacs: maybe [22:56] isaacs: cloudhead: http://github.com/isaacs/node-lru-cache [22:56] cloudhead: I'm implementing something like that, just wanted to have some reference [22:56] creationix: cloudhead: http://gist.github.com/413798 [22:56] cloudhead: awesome, thanks guys [22:59] isaacs: cloudhead: actually, my lru-cache is a bit silly, since deleting an object member is super cheap, so using the setTimeout is a bit ridiculous. [22:59] isaacs: cloudhead: but it does add some fudge-factor room if you have something that's *about* to be used. [23:00] cloudhead: isaacs: well isn't the point to save memory? [23:00] isaacs: cloudhead: right, and if you get up to double the requested max size, it cleans up immediately. [23:01] isaacs: cloudhead: since it's tracking the last-used time of each member, deleting isn't quite free. [23:01] isaacs: but still... it's not terribly slow, eiterh. [23:01] cloudhead: right [23:02] micheil: isaacs: nextTick over setTimeout? [23:03] isaacs: micheil: even delaying it until later is dumb. [23:03] micheil: you could use a tick timer. [23:03] isaacs: it's ridiculously cheap. [23:03] micheil: x number of tick and it'll be deleted [23:03] isaacs: feh. [23:03] micheil: okay [23:03] isaacs: it's in-memory juggling. it's not worth delaying over. [23:04] micheil: one thing I wish for: extremely fast string -> sha1, sha256, md5 and base64 implementations [23:04] micheil: then you could generate a response body, use LRU, sha1 the body, store it, and then retreive it [23:04] tpryme has joined the channel [23:04] igorgue_ has joined the channel [23:04] micheil: isaacs: btw, seen freelist? [23:05] isaacs: no, what's freelist? [23:05] micheil: while it doesn't do exactly that, it does similer [23:05] charlesjolley has joined the channel [23:05] isaacs: ACTION just pushed a version of lru-cache that doesn't do that. [23:05] micheil: node/lib/freelist.js [23:05] micheil: it powers the net & http modules [23:05] isaacs: whoa, neat [23:05] micheil: (in a manner of speaking) [23:06] micheil: it was originally in net.js I think, but I pulled it out for more general uses [23:06] micheil: but we never documented it [23:07] Phazm: is there a reason chown isn't in the filesystem module? [23:07] micheil: I think because it was difficult to make async [23:07] micheil: we have to do custom libeio bindings for it probably [23:08] igorgue_ has left the channel [23:10] isaacs: Phazm: because no one has done it yet. [23:11] Phazm: isaacs: Well, I want my money back, this node thing is incomplete! [23:11] micheil: sometimes I wish node followed semver. [23:11] Phazm: can I set owner with chmod? (googling now, but just in case someone has the answer...) [23:11] isaacs: Phazm: there's a child_process spawn thing. you can just shell to it [23:12] micheil: Phazm: iirc, it's a DIY job there, fork, contribute patch. etc. [23:12] isaacs: require("child_process").exec("chown "... [23:13] Phazm: isaacs: yea, i'm using that for some stuff, was just trying to avoid it for not particular reason [23:14] isaacs: Phazm: sort of a last-resort type solution. not great. [23:16] micheil: actually, I'm sure I wrote code for chown. [23:17] micheil: or not. [23:17] micheil: chmod was what I did. [23:17] Phazm: ah [23:17] micheil: Phazm: shoot me an email micheil@brandedcode.com and I'll see what I can do about writing a patch to add it. [23:17] isaacs: micheil: if you did chmod already, chown and chgrp should be similar, yes? [23:18] micheil: yes, I think so. [23:18] isaacs: it's just setting flags on the file [23:18] Phazm: k, I'm already using exec, so I'm fine (this is a not-even-close-to-critical app, just resetting my ownership/permissions on files to I can access with windows via the share) [23:18] isaacs: the functions all have similar signatures, even [23:18] Phazm: but I'll shoot you an email for anyone else that could use it [23:19] ryah: cloudhead: sorry i can't find the code now... [23:19] micheil: case EIO_CHOWN: req->result = chown (req->ptr1, req->int2, req->int3); break; [23:19] micheil: case EIO_FCHOWN: req->result = fchown (req->int1, req->int2, req->int3); break; [23:19] micheil: case EIO_CHMOD: req->result = chmod (req->ptr1, (mode_t)req->int2); break; [23:19] micheil: case EIO_FCHMOD: req->result = fchmod (req->int1, (mode_t)req->int2); break; [23:19] ryah: i guess i lost my branch [23:20] ryah: oh maybe i stashed it [23:20] micheil: so, it looks like chown should be exactly the same as chmod for implementation. [23:21] Phazm: aren't those missing the "EI" prefix? If I learned one thing from public school, it's that it should be "E-I-E-I-O" [23:21] micheil: ryah: expect a patch on the fs module soon for chown. [23:21] micheil: Phazm: heh. [23:21] ryah: ACTION expecting [23:21] isaacs: hahahah [23:21] micheil: k. [23:21] isaacs: ryah is expecting. [23:22] cloudhead: micheil: while you're at it, can you do cp and mv ? : ) [23:22] isaacs: that explains the glow! [23:22] micheil: cloudhead: maybe. but one patch at a time. [23:22] micheil: isaacs: you made me almost choke on my tea. [23:22] micheil: :P [23:22] micheil: bbl. [23:23] behmann has joined the channel [23:23] cloudhead: ryah: hmm well if ever you find it.. [23:23] ryah: cloudhead: found it [23:24] cloudhead: ya [23:24] cloudhead: y [23:27] JimBastard has joined the channel [23:27] JimBastard: mmmm ruby hacking [23:27] JimBastard: should i start trolling the ruby guys IRL at this meetup? [23:29] [[zz]] has joined the channel [23:29] JimBastard: i'll take that as a yes [23:29] ryah: oh, i just got this error: [23:29] ryah: http_parser.c:1337: error: request for member ‘on_headers_complete’ in something not a structure or union [23:30] ryah: :D [23:30] cloudhead: hah [23:31] mrjjwright has joined the channel [23:34] ryah: cloudhead: okay. i'm going to explain now, if you're ready [23:35] bradleymeck has joined the channel [23:37] ryah: cloudhead: okay i'll write an email [23:47] mscdex has joined the channel [23:47] cloudhead: ryah: yea, email would be good, I gotta run out for an hour [23:55] Aria has joined the channel [23:55] charlesjolley_ has joined the channel [23:58] isaacs has joined the channel [23:58] _announcer: Twitter: "[Blog] Real-time Collaborative Editing with Web Sockets, Node.js & Redis - http://bit.ly/dioTEI"-- Lakshan Perera. http://twitter.com/laktek/status/14726096102