[00:01] bruse: the simple fact is, if you get into an account that is a sudoer, you've automaticly gotten into any account this user can sudo to [00:02] isaacs: jashkenas: yeah, but i still LET you use sudo, i just tell you how unnecessary and unsafe it is [00:02] [[zz]] has joined the channel [00:04] bpot has joined the channel [00:05] benburkert has joined the channel [00:05] Yuffster has joined the channel [00:05] tilgovi has joined the channel [00:06] danielzilla has joined the channel [00:09] tilgovi_ has joined the channel [00:10] mikeal has joined the channel [00:11] jacobolus has joined the channel [00:12] ThePub has joined the channel [00:14] nsm has joined the channel [00:14] TheEmpath: how can i read the contents of a file in node? [00:15] ezmobius has joined the channel [00:16] tjholowaychuk: TheEmpath: fs.creadReadStream() [00:16] tjholowaychuk: TheEmpath: or fs.readFile() [00:17] tjholowaychuk: TheEmpath: or fs.open() / fs.read() etc [00:17] tjholowaychuk: everything you would expect [00:17] TheEmpath: i shee [00:17] TheEmpath: nifty [00:20] mjr_ has left the channel [00:23] jameshome_ has joined the channel [00:23] MikhX_ has joined the channel [00:24] derferman has joined the channel [00:27] tmpvar has joined the channel [00:32] ngw has joined the channel [00:34] maqr has joined the channel [00:34] banjiewen_ has joined the channel [00:35] bradleymeck has joined the channel [00:37] TheEmpath: ahhh addListener [00:37] TheEmpath: haven't seen you on so long [00:37] TheEmpath: ACTION snuggles next to addListener. [00:38] tjholowaychuk: TheEmpath: I think everyone uses on() now, not sure if addListener is going to be removed [00:38] tjholowaychuk: or not [00:38] TheEmpath: oooo even sexier [00:39] TheEmpath: fs.createReadStream('public/client.html' { gives me SyntaxError: Unexpected token { on the / [00:39] JimBastard_: ./public/client.html ? [00:39] bradleymeck: tjholowaychuk.on("win",doEverydayActivity) [00:39] JimBastard_: ohhg [00:39] JimBastard_: comma [00:39] JimBastard_: wheres the comma at [00:40] TheEmpath: hiding [00:40] TheEmpath: its still wounded [00:40] isaacs: jashkenas: hey, you know, you can ignore all those errors by just doing this: sudo npm config set loglevel win --global [00:41] TheEmpath: yessssssssss [00:42] isaacs: Tim_Smart: hey, btw, the return val from setTimeout is not an int in node. [00:42] Tim_Smart: Oh ok. [00:42] isaacs: (was going through the logs looking for something else, spotted that) [00:42] Tim_Smart: Never noticed. [00:42] isaacs: it is in most browsers [00:42] isaacs: but the spec is pretty vague, from what i can tell. [00:43] isaacs: ie, the dom spec says "the return value is a token that can be used to cancel the timeout" [00:43] isaacs: but no mention of what the token looks like [00:43] Tim_Smart: Yeah its an object in node... interesting. [00:44] isaacs: god, node *really* needs a -e "some code" [00:44] Tim_Smart: OK vim is open. Time for business. [00:44] isaacs: i catch myself doing this by accident sometimes [00:44] isaacs: Error: ENOENT, No such file or directory '/Users/isaacs/dev-src/js/npm/setTimeout(function(){})' [00:45] isaacs: (while testing my memory before correcting Tim_Smart) [00:45] dnolen has joined the channel [00:45] charly1 has joined the channel [00:45] Tim_Smart: Does node support running code on stdin? [00:46] isaacs: Tim_Smart: nope. [00:46] isaacs: it'd be nice, though, eh? [00:46] Tim_Smart: echo "win();" | node -s or something [00:46] isaacs: sure [00:46] isaacs: curl http://npmjs.org/install.js | node [00:46] Tim_Smart: :p [00:47] isaacs: or even node <(curl http://npmjs.org/install.js) [00:47] isaacs: that also doesn't work [00:47] tjholowaychuk: id like that stuff too [00:47] pquerna: node -e 'console.log("hello")' [00:47] pquerna: would be nice too [00:47] Tim_Smart: unix magic please. [00:47] AAA_awright has joined the channel [00:47] Tim_Smart: ryah needs to sprinkle his fairy dust and make it happen. [00:48] isaacs: technoweenie: :D [00:48] Tim_Smart: "Tim_Smart, patch please!" [00:48] Tim_Smart: Aw :( [00:48] isaacs: technoweenie: my final word on the matter, i think. [00:48] technoweenie: thats the final word on anything basically [00:49] mAritz: Tim_Smart, npm biggie-orm please! [00:49] isaacs: technoweenie: every word is 100% true./ [00:49] mAritz: isaacs: npm password reset please! [00:50] mAritz: ACTION takes cover [00:50] mAritz: :D [00:50] Tim_Smart: mAritz: There will be a time sir, when it shall have npm good-ness. [00:50] mAritz: like in a few minutes? :/ [00:50] Tim_Smart: But for now, it is under development, and is hiding. [00:50] Tim_Smart: It needs docs and stuff before I "release" it. [00:50] tilgovi: isaacs: the end result of my investigation was that the host header is *just* the host (duh. should have been obvious) [00:51] tilgovi: so, parse the upstream location header, swap the host, format and return [00:51] isaacs: tilgovi: yeah, it always is [00:51] isaacs: tilgovi: sorry, id idn't realize that's what you were doing. [00:51] isaacs: j:) [00:51] tilgovi: for some reason I thought it was just the host because I was dhitting it with curl and not specifying protocol [00:51] tilgovi: overthink [00:53] sh1m has joined the channel [00:53] mikeal has joined the channel [00:55] isaacs: zorzar_: hey, you around? [00:59] derferman has joined the channel [00:59] tjholowaychuk: isaacs: woah you dont use semi-colons anymore? I thought you were all anti no-semi-colons before [00:59] isaacs: tjholowaychuk: semicolons are like pants. [00:59] tjholowaychuk: I see that haha [00:59] isaacs: tjholowaychuk: you need them at work, but otherwise, fuckit. [01:00] tjholowaychuk: I was always against them for SSJS but everyone bitched at me :p [01:00] SubStack: but what if you begin a statement with parens‽ [01:00] tjholowaychuk: I have grown to be totally fine with them but I totally agree that it is more error prone to use them [01:00] tjholowaychuk: SubStack: ;(function(){})() [01:00] tjholowaychuk: for example [01:00] tjholowaychuk: is what I used to do [01:01] tjholowaychuk: and that was one of the only cases I would use it [01:04] matt_c has joined the channel [01:05] isaacs: SubStack: it's not "use semis vs don't use semis" it's "use semis at the end of every line vs use semis only where they're relevant" [01:05] Yuffster_work has joined the channel [01:05] isaacs: SubStack: personally, i htink the pro-semi people should just indent with semicolons [01:06] isaacs: why not? [01:06] isaacs: it's safer, right? [01:06] isaacs: :P [01:06] tjholowaychuk: hehe [01:11] ginader has joined the channel [01:11] dannycoates has joined the channel [01:12] bruse has joined the channel [01:14] tmpvar_ has joined the channel [01:14] dannycoates: konobi: pinq [01:15] MikhX has joined the channel [01:17] necrodearia has joined the channel [01:17] ezmobius has joined the channel [01:18] bradleymeck: i never did understand the arguments about semicolons being magical... if you have a valid statement on a line it ends there, if the following line is a binary operator it will act as if on previous line. [01:18] mikeal has joined the channel [01:18] tjholowaychuk: bradleymeck: yeah I have no clue.. some people dont seem to get that you can do whatever you want with a grammar [01:18] tjholowaychuk: as far as willingness to implement it at least [01:19] tjholowaychuk: the whole "semi-colon insertion" blah blah thing is weird [01:19] Tim_Smart: bradleymeck: Most likely people switching between C and ecma frequently. [01:19] Tim_Smart: + people form a secret love for their habits, and defending them like they are children. [01:20] Tim_Smart: s/defending/defend/ [01:20] bradleymeck: well its not even insertion actually, that term is misleading, *pout* [01:21] Tim_Smart: I insert them because it plays along with the general ecmascript convection. [01:21] JimBastard_: i have a rule [01:21] JimBastard_: always use semi-colons [01:21] JimBastard_: period [01:21] JimBastard_: usually works out [01:22] Tim_Smart: Yeah I have my own set of style guidelines embedded in my head... [01:22] JimBastard_: doesnt really leave room for interpretation [01:22] JimBastard_: its more of a sanity thing i guess [01:22] JimBastard_: 10 years of browser JS gives you a healthy fear for missing semicolons [01:22] hober: my style guide is "when js2-mode bitches at me, it's wrong" [01:23] webr3: try removing every single semi colon and see if it still works.. [01:23] JimBastard_: IE6 just said woah buddy [01:23] JimBastard_: lulz [01:23] Tim_Smart: webr3: If you indent well, it will still work. [01:24] bruse: how will indentation affect it? [01:24] webr3: Tim_Smart, have you actually tried.. [01:24] Tim_Smart: webr3: On occasion, yes. [01:24] jashkenas: it would be nice if there was a configuration file for a JS linter that we could all agree on for Node libraries... [01:24] jashkenas: I'll volunteer this one for starters ;) http://github.com/jashkenas/coffee-script/blob/master/extras/jsl.conf [01:26] Tim_Smart: bruse, imagine if you wrote: var test = 123\nbacon = 321 as var test = 123 bacon = 321 [01:26] JimBastard_: but then who was bacon [01:26] bruse: ah, got you [01:26] voodootikigod: JimBastard_: I have bacon [01:26] voodootikigod: all of it [01:27] JimBastard_: please send [01:27] creationix: Tim_Smart: so it's not indentation that matters, but newlines [01:27] JimBastard_: .on('bacon', function [01:27] Tim_Smart: creationix: Yeah, my bad, that is what I meant. [01:27] isaacs: jashkenas: never gonna happen. [01:27] isaacs: jashkenas: javascript is ANARCHY man! [01:27] isaacs: we BURN things here!! [01:27] isaacs: we can't be tamed like we're your ANIMALS, man! [01:29] creationix: burnt bacon? [01:29] isaacs: I'manna go write my OWN javascript linter! With hookers! and blackjack!! [01:29] banjiewen has joined the channel [01:29] isaacs: on second though, forget about the javascript linter! [01:29] creationix: isaacs: btw, we wear pants in my house ;) [01:29] isaacs: even the toddlers!!? [01:30] creationix: yep [01:30] smtlaissezfaire_ has joined the channel [01:30] creationix: well, diaper covers [01:30] sprout has joined the channel [01:30] creationix: but they looks like pants [01:31] creationix: isaacs: your pants analogy was more accurate than I think you realize [01:31] davidascher has joined the channel [01:31] isaacs: oh, i totally realize it. [01:31] creationix: very nice though [01:31] isaacs: i've been thinking this for a long time now, pretty much since the last outbreak of semicolon weirdness. [01:31] isaacs: but it was after that thread had died down, and i didn't want to feed it [01:32] bradleymeck: i more want everyone to know what causes semicolon insertion, cause god knows ppl wont use linters 100% the time [01:32] creationix: for the same reason I can't explain to you why wearing pants is important even when nobody is home, I can't explain why I prefer semis [01:33] creationix: sure technically it doesn't matter when nobody is looking, but there are cultural implications [01:34] mAritz: for me wearing pants even when no one is home is easy: too cold without. [01:34] jashkenas: Be careful -- if you put Isaacs' analogies together, you'll end up wandering your house pantsless, wrapped in condoms... [01:34] jashkenas: safety and comfort first, I guess. [01:34] isaacs: hahahaha [01:34] creationix: comfort... [01:34] bradleymeck: in texas pants are a bad thing in summer [01:34] isaacs: jashkenas: have you been to my house? because that's disturbingly accurate. [01:35] creationix: semi-first is very uncomfortable [01:35] creationix: till you're used to it [01:35] creationix: then anything else is almost unberable [01:35] isaacs: creationix: just like pantslessness [01:35] creationix: exactely [01:36] isaacs: creationix: the issue is that once you get used to a clothing optional home, you see the cultural folly for what it is. [01:36] isaacs: the emperor loses his clothes, so to speak. [01:36] isaacs: suddenly every semicolon jumps out at you, its utter irrelevance screaming like a knife in your brain. [01:37] isaacs: learning to bridge both worlds is not a journey for the faint of heart. [01:37] creationix: speaking on knife in the brain, we need something better than step for control flow [01:37] isaacs: hahahah [01:37] Tim_Smart: creationix: Native functions ftw. [01:37] bradleymeck: what are the requirements? [01:38] isaacs: creationix: i think you just burned yourself pretty harsh there, guy [01:38] tilgovi has joined the channel [01:38] creationix: I mean, proper error handling and control flow is painful [01:38] creationix: harsh? [01:38] isaacs: well, i mean, if i'd said that, it'd be kinda insulting. [01:38] isaacs: maybe true, and maybe worth saying, but still [01:39] creationix: I mean, step is my favorite of everyhing I've tried, but it's not without warts [01:39] isaacs: yep [01:39] creationix: I'm hoping to eventually find something better [01:39] isaacs: and i think it's not as fast as it could be. [01:39] zpoley has joined the channel [01:39] creationix: yeah, there is a little overhear [01:39] isaacs: the try/catch is unnecessary [01:39] creationix: I talked with kriskowal at jsconf and finally understood promises [01:39] isaacs: feh. promises. [01:40] creationix: the abstraction is nice and elegant, but it's a rather high abstraction [01:40] isaacs: like driving to the supermarket in a tank. [01:40] bradleymeck: promises arent bad, but it can be a bit overbearing for when you just want a callback [01:40] isaacs: ok, train time. [01:40] creationix: and it requires two closures and two objects per event [01:40] bradleymeck: the security of knowing that you have an object is nice [01:41] creationix: bradleymeck: yeah, the concept is great, but it's a pretty heavy abstraction, and I'm generally against abstractions unless they are required [01:42] creationix: and even if I liked the abstraction, the implementation is probably too heavy for many node servers [01:42] rex_fernando: Is it bad to do this? http://gist.github.com/612660 [01:42] ezmobius has joined the channel [01:42] creationix: rex_fernando: what is it trying to do? [01:43] bradleymeck: so we need a structure that can register a branch in control flow and get something back (continuation key?), that you can make a continuation after it, or you can bring multiple continuations together, is that about it for control flow handles? and then we need to handle errors how? [01:43] bradleymeck: rex_fernando if you want to modify the prototype and not the object itself, i guess? [01:43] gleicon has joined the channel [01:43] gm__: howdy [01:43] rex_fernando: I want an array that does something to each object when the object is added [01:44] bradleymeck: howdy gm__ [01:44] creationix: rex_fernando: yeah, I don't think that's doing what you think it's doing [01:44] gm__: hey bradleymeck [01:44] tpryme has joined the channel [01:44] rex_fernando: I'm not modifying to prototype, am I? [01:44] creationix: what is __proto__ for an Array instance? [01:44] gm__: any ideas on how to detect if an event received form an emitter was sent by yourself ? [01:45] nerdEd has joined the channel [01:45] creationix: is it Array.prototype? [01:45] bradleymeck: gm__ how else would it be emitted? [01:45] creationix: yes, sorry (I've had a long day) [01:45] bradleymeck: creationix yes [01:45] gm__: I am broadcasting messages thru emitters but I end up receiving a copy of the message [01:45] Evet: to set nginx front of node.js affects node.js's sync feature? [01:45] bradleymeck: but doing so will have the global as its context [01:45] rex_fernando: woah yeah I'm adding the element to the array's prototype lol [01:45] rex_fernando: that's the problem [01:45] derferman has joined the channel [01:45] creationix: rex_fernando: you're calling Array.prototype.push with Array.prototype as the "this" property [01:46] creationix: which will likely throw an error [01:46] gm__: bradleymeck: code in question is this one: http://github.com/gleicon/pubsub_ws/blob/master/pubsub_standalone.js [01:46] bradleymeck: evet it shouldnt change node's behavior [01:46] creationix: or possibly modify the prototype for all arrays [01:46] rex_fernando: so do I do this.__proto__.push.apply(this, [o]); [01:46] creationix: rex_fernando: or just this.push(0) [01:46] creationix: this.push === this.__proto__.push [01:46] gm__: for each conenction I would like to sent messages, but I am bound to the same emitter, so I end up receiving them in the same conn that sent it [01:46] creationix: and then "this" is already what you want [01:47] bradleymeck: gm__ im still not understanding the question [01:47] softdrink has joined the channel [01:47] rex_fernando: yeah but aren't I changing that when I define the array's push method to be something different? [01:47] creationix: oh, right [01:47] creationix: then you need apply or call [01:47] bradleymeck: gm__ why not make an emitter per connection? [01:47] gm__: bradleymeck: in this code qhen I receive a message thru a websocket, I broadcast them to everyone bound to e_msg emitter [01:47] steadicat has joined the channel [01:48] gm__: bradleymeck: hm, how I would broadcast a message to all connections ? [01:48] murphy has joined the channel [01:48] sprout has joined the channel [01:49] bradleymeck: gm__ that looks like what you are doing [01:49] gm__: first I used an array of conenctions instead of emitter [01:49] creationix: I should make a site that takes js snippets and generates graphs like this http://howtonode.org/object-graphs/functions.dot [01:49] rex_fernando: ok thanks [01:49] gm__: but it seems like emitters are more easier to deal with [01:49] creationix: rex_fernando: Array.prototype.call(this, o) [01:49] softdrink: mmm onigiri for dinner [01:49] creationix: rex_fernando: or if you want it 100% generic: this.__proto__.push.apply(this, arguments) [01:50] bradleymeck: i wish i had onigiri [01:50] abiraja has joined the channel [01:51] softdrink: ACTION shares [01:51] softdrink: homemade [01:51] gm__: send. [01:51] creationix: rex_fernando: sorry, that was Array.prototype.push.call(this, o) [01:51] creationix: I had a migraine earlier today and it seems my brain isn't quite better yet [01:52] rex_fernando: ok thanks guys [01:53] creationix: does anyone know of a library that generates ASTs from js code? [01:53] gm__: bradleymeck: is it too costly to remove a connection from an emitter and put it back again to avoid feedbacking ? [01:53] guybrush: mhh the crypto-module has gone? [01:53] elijah-mbp has joined the channel [01:53] softdrink: ugh migraines usually take me out for a day or two [01:53] creationix: gm__: when I made custom emitter objects, I just added a sender id and caused the listener to ignore events with my id [01:54] creationix: softdrink: I took 800mg of ibuprofin in time, so it never hurt [01:54] creationix: but I seem not quite all here [01:54] softdrink: post-migraine haze? [01:54] creationix: yep [01:54] creationix: braindamage++ [01:54] v8bot: creationix has given a beer to braindamage. braindamage now has 1 beers. [01:54] smtlaissezfaire_ has joined the channel [01:55] bradleymeck: gm__ it is generally unwise to do so, but probably not terribly costly [01:55] gm__: creationix cool, instead of sending a text message, do you send a json message ? [01:55] softdrink: that's funny on several levels. [01:55] creationix: gm__: yeah, it was for my chat system [01:55] gm__: will give it a try. thanks for the tip [01:55] leedo has left the channel [01:56] DozyPieman has joined the channel [01:56] creationix: gm__: if an object per event it too expensive you can just have two arrays and make sure to keep them in sync [01:56] paulr has joined the channel [01:56] gm__: will try to find an uuid [01:56] creationix: one for ids and one for the event [01:56] gm__: no, I think its not that expensive [01:56] gm__: its a simple pub/sub channel [01:56] gm__: at least I think so, just need to get more used to node [01:56] creationix: if any internet is involved, then the cost of the object in ram is nothing in comparison [01:57] creationix: inimino: you around? [01:57] gm__: yup [01:57] gm__: interwebs involved [01:57] creationix: gm__: then go for an object, it's easy [01:57] gm__: thats why I wanted to keep it on a single emitter [01:58] creationix: gm__: though faye has pub/sub built-in I think [01:58] gm__: I trying an uuid generator here, seems easy [01:58] inimino: creationix ⋱ yeah [01:58] gm__: yeah, Ive checked it, but I just need a small part, like the one I pushed here: http://github.com/gleicon/pubsub_Ws [01:58] jacobolus has joined the channel [01:58] creationix: inimino: do you know of any AST generators for javascript [01:59] creationix: inimino: I want to make a service like gist of pastie, but generates trees and diagrams from the code like http://howtonode.org/object-graphs/functions.dot [01:59] jashkenas: creationix: http://mxr.mozilla.org/mozilla/source/js/narcissus/jsparse.js [01:59] jashkenas: perhaps. [01:59] creationix: jashkenas: true, but I doubt it runs in v8 [01:59] creationix: I can try [01:59] creationix: I know the runtime won't run in v8, but maybe the parser will [02:00] jashkenas: creationix: do you have a snippet of example JavaScript you'd like graphed? I'd like to try something.. [02:00] inimino: creationix ⋱ npm install PanPG // there's an AST generator in there for JavaScript now. [02:00] creationix: jashkenas: the snippets from my latest howtonode article [02:00] creationix: I had to make the graphs by hand [02:00] jashkenas: creationix: roger. [02:00] creationix: but it would be nice to automate it somehow [02:01] creationix: inimino: ah, I thought you might have something [02:01] inimino: creationix ⋱ http://boshi.inimino.org/3box/PanPG/build/js_ast.html -- online demo [02:01] bradleymeck: inimino so the parser is on npm now? [02:01] inimino: You could probably make dot files from the AST I guess. [02:02] inimino: bradleymeck ⋱ Yep. [02:02] creationix: inimino: doesn't seem to work [02:02] creationix: does it need firefox or something? [02:02] jashkenas: creationix: here's what "coffee --nodes" gives you: http://gist.github.com/612679 [02:03] inimino: creationix ⋱ Ah, I've probably only tested it in Firefox and Chrome, what did you test in? [02:03] jashkenas: creationix: you'll need something fancier than an AST for object references... [02:03] creationix: hmm, I really need the in-memory object structures more than the ast [02:03] inimino: Yeah, you'll have to do some processing on the AST. [02:03] bradleymeck: js_ast.js is giving 404 [02:03] creationix: otherwise how will I know that two references point to the same object [02:03] inimino: bradleymeck ⋱ Oh, whoops, haha. [02:03] jashkenas: creationix: yep. I don't think you're going to be able to automate that. [02:04] jashkenas: ASTs are nice for debugging though. [02:04] inimino: I just reorganized the files earlier today, forgot that the demo is using that... [02:04] creationix: too bad I can't get at closures at runtime [02:04] creationix: or I could just use introspection [02:04] inimino: ...should be fixed now. [02:05] creationix: inimino: nice [02:05] creationix: so I could write a simple interpreter from the ast to generate my structures? [02:05] creationix: don't want to re-implement too much of js though [02:05] inimino: let me look at your diagram again... [02:06] creationix: closures are especially painful [02:06] JimBastard_: hrmmm [02:06] JimBastard_: Error: ECONNREFUSED, Could not contact DNS servers [02:06] creationix: otherwise it's pretty simple [02:06] inimino: Oh yeah, I read this post. [02:06] inimino: Hm, I'm not sure how much you'd have to do. [02:06] sstephenson: UglifyJS will give you an AST: http://github.com/mishoo/UglifyJS/blob/master/lib/parse-js.js [02:06] gm__: bbl guys [02:07] creationix: I wonder if I was lying when I said all immutable primitives were singletons in memory. [02:07] jashkenas: Lisp-to-JavaScript port -- neat. [02:07] inimino: creationix ⋱ If you're interested in simple examples, you could get it from an AST pretty easily, but if it's for general use... [02:07] creationix: from the surface it makes sense [02:08] creationix: inimino: yeah for simple stuff [02:08] creationix: so if someone has a question on irc I can type up a quick example complete with graph [02:08] inimino: creationix ⋱ Ok, I think that wouldn't be hard for examples like you have in the article. [02:08] inimino: OK, yeah, that should be pretty easy. [02:08] bradleymeck: creationix, most modern implementations use singletons [02:08] benreesman has left the channel [02:08] bradleymeck: it doesnt have to be, but for programming purposes /shrug [02:08] inimino: You could hook it up to graphviz on the server and make it real-time, even. [02:08] creationix: I even went on to say that === means both sides are the same object in memory [02:09] MikhX has joined the channel [02:09] creationix: inimino: yeah, that's what howtonode does now, but I have to type the dot file by hand [02:09] creationix: at least the png is auto generated [02:10] brodyberg has joined the channel [02:10] creationix: inimino: ok for this one it's easy once I have a list of the free variables http://howtonode.org/object-graphs/objects.dot [02:10] inimino: Yeah, you could plug something like that AST demo plus that together and have code in, PNG out. [02:10] creationix: but what about generated closures as return values from functoins [02:11] brodyberg has left the channel [02:11] inimino: That's a little harder. [02:11] bradleymeck: creationix you can check for generated closures and leaks [02:11] bradleymeck: i might have one lying about [02:11] creationix: I'd rather just have some sort of run-time introspection [02:11] inimino: You can emulate the call to that function, create the environment with the variables declared in it, and return an object... [02:12] creationix: inimino: ok, so the write a mini runtime idea then? [02:12] inimino: But there's all kinds of assignment that can happen so you'd have to implement most of JavaScript to make it industrial-strength. [02:12] inimino: I mean presumably you want to record which things are references to the same object, which in full generality means you have to run the code. [02:13] kjy112 has joined the channel [02:13] creationix: exactely [02:13] creationix: which would be fun [02:13] creationix: :D [02:13] creationix: but a lot of work [02:13] bradleymeck: if you had grant money backing you [02:13] creationix: nope, lol [02:14] inimino: hehe [02:14] davidascher has joined the channel [02:14] inimino: Well, maybe not that hard, I guess BESEN was put together pretty quickly ^_^ [02:15] inimino: But you could start with narcissus or BESEN or one of those (if there are any others...) and add some instrumentation for introspection if you wanted to do it that way. [02:15] creationix: well, the goal is to save time. so it needs to be quick and easy [02:15] creationix: or I'll keep writing dot files by hand [02:15] creationix: maybe make a mini language that describes the graphs and compile it to dot? [02:16] inimino: Yeah, for simple examples like what you have, you could probably do something quick and easy. [02:16] creationix: I just need a proper data structure to define my graphs, and then find out how to get that structure [02:16] inimino: And maybe for examples with closures too, if you just made some simplifying assumptions, or did some manual fixups after or something. [02:17] creationix: true, I found that closures often need some manual placing to make them readable [02:17] inimino: You could get something from the AST that has all the variables that are declared and all the functions, and then do some of the rest by hand. [02:17] creationix: well, even if I knew the names of the closure variables, I wouldn't have access to their value [02:17] creationix: that would only work for top-level variables [02:18] inimino: hm, yes [02:18] creationix: is there a way in v8 to get a list of all values and references to them? [02:18] creationix: ruby kinda has that [02:18] creationix: (ruby has a lot of things it probably shouldn't) [02:19] bradleymeck: creationix, i dont think you can use it as is, but heres an example of something to detect closures : http://gist.github.com/612700 using inimino's parser ast [02:19] inimino: the fixups would probably have to include something like 'x has value y' then... I don't know about V8 but I rather doubt it... [02:19] inimino: It doesn't have a debugger API I guess though, so there might be something. [02:20] creationix: bradleymeck: did you just type that!? [02:21] bradleymeck: i have many things lying around [02:21] bradleymeck: many things [02:21] creationix: ahh [02:21] inimino: heh [02:21] bradleymeck: dont end up using most, but i dont have the funding to complete most [02:22] creationix: I understand that [02:22] smtlaissezfaire_ has joined the channel [02:22] creationix: there is a reason I have 50+ github repos [02:22] creationix: and that's the ones I took time to publish [02:22] bradleymeck: yea [02:23] inimino: looks cool [02:23] bradleymeck: i wish i had a job that let me hack stuff, or just a new job lol [02:23] inimino: hehe [02:24] inimino: I've been hacking on the pretty-printer to go with the AST generator but it's taking a while... what with having to pay bills and all. [02:25] creationix: I know about bills and all, I live in Palo Alto now! [02:25] bradleymeck: inimino the one in that gist is mostly done for es3 def not es5 rd though [02:25] bradleymeck: inimino, amen to not enough time [02:25] bradleymeck: how is that compared to tx? [02:25] JimBastard_: creationix: i read somewhere you were the top developer in palo [02:25] creationix: JimBastard_: :D [02:25] dguttman_ has joined the channel [02:26] creationix: bradleymeck: my house in Texarkana (edge of Texas) 16k for 3 acres, my condo in Dallas 75k for small yard and 2bed2bath, in Palo Alto $2000/month for super tiny 2bed1bath with no yard at all [02:26] inimino: bradleymeck ⋱ nice [02:27] inimino: creationix ⋱ Ouch. [02:27] inimino: ACTION afks [02:28] creationix: afks? [02:29] robotarmy has joined the channel [02:30] inimino: ACTION goes afk [02:30] inimino: ACTION verbs with abandon [02:30] creationix: ACTION understands [02:31] bradleymeck: ACTION eats cookies [02:31] bpadalino: wow, you have a lot of places to live for being just one person [02:31] creationix: bpadalino: I did sell the house in Texarkana (for 25k :D ), but I still have the other two [02:31] bpadalino: ah [02:32] bradleymeck: i thought the one in dallas was sold? to those squating ppl? [02:32] bpadalino: $2k/mo sounds pretty terrible for the palo alto apt :( [02:32] creationix: bradleymeck: nope, we ended up kicking them out [02:33] creationix: bpadalino: actually that's a good deal, average for an appt like mine here is abour $2400 [02:33] JimBastard_: gypsies [02:33] JimBastard_: everytime [02:34] bpadalino: ouch [02:34] creationix: Downtown Palo Alto is one of the more expensive parts of the bay area [02:35] creationix: a medium house with a small yard can easily be 4.5 million [02:35] bradleymeck: idk if anything would be worth it at that price [02:36] creationix: if you make a few million a year then it's not that bad [02:36] creationix: I certainly don't make that much though [02:37] jameshome has joined the channel [02:39] creationix: hey, what should my next howtonode article be? [02:40] creationix: maybe I'll take another stab at something like step, but better [02:40] mAritz: conductor is better :P [02:40] mAritz: just lacks good error handling imo [02:41] Tim_Smart: Hmm, "26G 13M". Fields are from top: (a node process). What is size? [02:41] creationix: mAritz: you actually use condictor? [02:41] mAritz: yep [02:42] jashkenas: creationix: I'd like to see your take on a "why you don't need to use step" article... [02:42] mAritz: a lot [02:42] mr_daniel has joined the channel [02:42] creationix: Tim_Smart: sounds like size it the virtual memory size [02:42] creationix: not sure [02:42] creationix: jashkenas: what do you mean? [02:42] Tim_Smart: jashkenas: I found some problems with the closure route... [02:42] creationix: I haven't been able to write a non-trivial node app without something like step [02:43] jakehow has joined the channel [02:43] jameshome_ has joined the channel [02:44] bradleymeck: creationix, how about something like different container types, how objects are not hashes, how to make object dictionaries, arguments object vs arrays [02:44] jashkenas: breadleymeck: ++ [02:44] creationix: bradleymeck: heh, I use objects as hashes all the time [02:44] creationix: ;) [02:45] creationix: bradleymeck: good idea though [02:45] bradleymeck: yea but the difference is killer to new ppl [02:45] creationix: especially php people [02:46] creationix: how do you make object dictionaries? [02:46] creationix: Object.create(null) ? [02:46] bradleymeck: you have to manually use arrays :( [02:46] creationix: how so? [02:46] bradleymeck: and the arrays leak unless dispose methods are used etc [02:46] creationix: oh, you mean object as the key? [02:46] bradleymeck: yes [02:46] jashkenas: bradleymeck: what are the killer gotchas for objects-as-hashes... in your opinion? [02:47] konobi: dannycoates: ping [02:47] benburkert has joined the channel [02:47] dannycoates: konobi: hey [02:47] bradleymeck: v8: var a={},b={},dict={};dict[a]=1;dict[b]=2;dict[a] [02:47] v8bot: bradleymeck: 2 [02:47] derferman has joined the channel [02:48] creationix: bradleymeck: yep, keys are always strings [02:48] ezmobius has joined the channel [02:48] creationix: bradleymeck: what's a practical use of objects as keys? [02:49] jashkenas: bradleymeck: is string keys your only problem with em? [02:49] bradleymeck: thats a pretty large problem in my book [02:49] technoweenie has joined the channel [02:49] bradleymeck: the difference of [0] vs ["0"] on arrays [02:50] bradleymeck: idk if that still exists though in node [02:50] creationix: so essentially objects as keys provide a way to have secret keys, but where is that useful [02:50] creationix: I guess it keeps you from having to name everything with a uuid [02:51] bradleymeck: i dont care if they are public, but being able to map one object to another without using a mixin an keeping it O(1) is a big speed boost vs O(n) [02:51] creationix: yeah, my implementation would be O(n) [02:51] bradleymeck: for example, holding a list of dom elements that contain ids [02:51] creationix: can you do it O(1) in ES5? [02:52] bradleymeck: no, in harmony you can with the 2 map types though [02:52] JimBastard_: hey guys [02:52] creationix: true [02:52] JimBastard_: switch / case aint so bad [02:52] bradleymeck: amen! [02:52] JimBastard_: lets stop the hating [02:52] creationix: JimBastard_: yeah, it's fast [02:52] JimBastard_: ahaha [02:52] creationix: and goto is nice too [02:52] bradleymeck: switch on string is stupid fast [02:52] bradleymeck: in v8* [02:52] creationix: bradleymeck: faster even to use ints [02:52] creationix: I think [02:53] bradleymeck: not when i benched it [02:53] bradleymeck: it converts numbers from float to int :( [02:53] Tim_Smart: strings > ints when I last checked as well. [02:53] hzin has joined the channel [02:54] bradleymeck: i forget why exactly but it looked like the singleton nature without needing to resolve the value allowed for real jump tables [02:56] jameshome has joined the channel [02:56] creationix: yay for singleton primatives [02:56] AAA_awright_ has joined the channel [02:57] bradleymeck: now if they would just optimize those math operations [02:57] bradleymeck: anywho, bed time, then more data entry day job [02:57] bradleymeck has left the channel [02:59] Evet: do you store all pages of your web app in a single .js file? [03:00] dipser_ has joined the channel [03:00] jameshome_ has joined the channel [03:01] creationix: Evet: only for very small apps [03:02] tmpvar: once you breach 500 lines is a good time to split it out [03:03] tmpvar: (for me anyway) [03:04] siculars has joined the channel [03:05] tmpvar: Evet, I've actually heard of people (not node specific) splitting out every resource in their "restfull" applications into a new file/class/etc [03:06] tmpvar: creationix, how you doin? [03:06] creationix: good [03:07] creationix: home alone while my fam is in texas [03:07] technoweenie: party at tims [03:07] tmpvar: ah, yeah i saw that tweet. hack time no doubt [03:08] tmpvar: creationix, btw, I'm re-writing conductor to be more "general purpose" [03:08] tmpvar: i may rename in the process.. should be done by the weekend if you care to check it out [03:08] tmpvar: errr. if you care to check it out I can link you when its "ready" [03:09] creationix: cool [03:10] tmpvar: yeah, im getting to the point with composer that I need multiple callbacks and other fun stuff that the original conductor doesnt take into acount [03:10] tmpvar: i'd like to get your opinion if you're up to it here in a couple days [03:13] creationix: perhaps [03:13] creationix: I'm on phone atm [03:13] hzin has joined the channel [03:13] ysynopsis has joined the channel [03:16] scnd has left the channel [03:17] bencc has left the channel [03:18] smtlaissezfaire_ has joined the channel [03:19] jacobolus has joined the channel [03:20] Lerchmo has joined the channel [03:22] gerred has joined the channel [03:25] ezmobius_ has joined the channel [03:26] noahcampbell has joined the channel [03:30] jameshome has joined the channel [03:35] ezmobius has joined the channel [03:36] JimBastard_: what github, problem? http://github.com/Marak [03:37] dicon has joined the channel [03:39] Evet: tmpvar: they run multiple node.js servers? [03:39] deepthawtz has joined the channel [03:40] JimBastard_: Evet: i run multiple node.js servers [03:40] JimBastard_: at all times [03:40] JimBastard_: tmpvar magic keeps them running [03:40] JimBastard_: :-D [03:41] dnolen has joined the channel [03:42] zpoley has joined the channel [03:42] creationix: back [03:43] Evet: JimBastard_: you run a node.js per page? [03:45] JimBastard_: Evet: per application [03:45] Evet: JimBastard_: do you use any framework or templating solution? [03:45] creationix: jashkenas: I just saw your email about semis [03:46] creationix: awesome work [03:46] JimBastard_: ive played with most of them [03:46] JimBastard_: go use jade and socket.io [03:46] Tim_Smart: creationix: semi-colons? [03:46] Tim_Smart: Where? [03:46] technoweenie: trucks [03:46] JimBastard_: Evet: http://github.com/learnboost/nodestream [03:46] creationix: mailing list Re: Actual drawbacks to omitting semi-colons? [slightly OT] [03:46] JimBastard_: i hear all the cool kids get down on the real-time templating [03:47] dbathurst has joined the channel [03:47] creationix: corn ftw [03:47] dbathurst_ has joined the channel [03:47] creationix: JimBastard_: ^ [03:47] creationix: simple yet powerful [03:47] technoweenie: i remember it being a performance boost in php to buffer output [03:47] dbathurst_ has left the channel [03:47] JimBastard_: i use JUP myself [03:47] JimBastard_: i want my views as data, sorry [03:47] creationix: http://github.com/creationix/grain/blob/master/examples/corn.js [03:48] JimBastard_: whats wrong with JSON.parse [03:48] technoweenie: JSON.parse is synchronous [03:48] JimBastard_: so is your mom [03:48] emmanueloga has joined the channel [03:48] JimBastard_: >.< [03:49] JimBastard_: i still think its gonna be faster then any parser [03:49] JimBastard_: someone is working on a streaming json.parse [03:50] technoweenie: yajl, done [03:50] meso has joined the channel [03:50] technoweenie: well, not every app can send json back and forth. [03:50] technoweenie: or _should_ [03:50] JimBastard_: hrmm [03:50] creationix: technoweenie: have you seen dav glass's yui+node talk? [03:50] technoweenie: yea [03:50] creationix: pretty neat idea [03:50] JimBastard_: we are going a django like style, but each app has a routing map, an eventemitter, and a json-rpc [03:50] technoweenie: well, i saw one at jsconf in dc [03:51] leeeb has joined the channel [03:51] creationix: technoweenie: well, I think it's a lot farther along now [03:51] creationix: tons of code reuse and graceful fallbacks [03:51] technoweenie: cool [03:52] technoweenie: i like that there are a ton of options [03:52] hsuh_ has joined the channel [03:52] Tim_Smart: JimBastard_: http://github.com/pgriess/node-msgpack [03:52] technoweenie: i personally dont want to pass json around all the time or manage dom objects [03:52] creationix: string concat teplates are still the fastest, but the dom stuff seems the easiest and more flexible [03:52] Tim_Smart: Faster than JSON in some places. [03:52] technoweenie: Tim_Smart: yea but will it parse on the client [03:52] JimBastard_: Tim_Smart: that looks sexy [03:52] nerdEd has joined the channel [03:52] creationix: too bad browsers don't speak msgpack [03:52] JimBastard_: Tim_Smart: once we have a need for something that beefy... [03:52] jacobolu_ has joined the channel [03:52] technoweenie: msgpack is way cool for server to server shit [03:52] JimBastard_: we havent really hit any bottle necks yet [03:53] noahcampbell has joined the channel [03:53] creationix: I wish node had msgpack built in [03:53] JimBastard_: even with terrible code and no caching we can still do like 400 requests per second [03:53] creationix: then I could use it for nStore [03:53] Evet: is it really hello world example on nodejs.org can handle thousands of visitors? [03:53] creationix: Evet: yep [03:53] JimBastard_: Evet: yes. [03:53] technoweenie: Evet: per second, yea [03:53] Tim_Smart: For sure. [03:54] Tim_Smart: Lol [03:54] JimBastard_: Evet: you might have to configure your boxen to behave [03:54] creationix: a stock hello world can handle about 10k/sec [03:54] JimBastard_: there are os limits in place [03:54] technoweenie: but real apps wont see anywhere near that [03:54] Evet: JimBastard_: what are these os limits? [03:54] mattly has joined the channel [03:54] creationix: ACTION goes off to bench howtonode.org [03:54] JimBastard_: Evet: let me know when you hit them [03:55] creationix: Evet: number of ports [03:55] creationix: number of file handles [03:55] creationix: concurrent clients [03:55] JimBastard_: 1 gig ram limit? [03:56] creationix: that's a v8 thing, not os [03:56] JimBastard_: yeah [03:56] creationix: howtonode.org/object-graphs Requests per second: 2302.79 [#/sec] (mean) [03:56] JimBastard_: Evet: what you trying to build? [03:56] creationix: how's that for a real app [03:57] JimBastard_: not to shabby [03:57] creationix: considering how much is does to load a page, let's just say it's a good thing to cache smartly [03:57] technoweenie: yea thats pretty rad [03:57] technoweenie: though you'd get like 5x that if you let nginx do it :) [03:57] jashkenas: creationix: isn't that just a static page, effectively? [03:58] creationix: jashkenas almost [03:58] creationix: jashkenas: but the cache is smart, based on git shas [03:58] creationix: and it does have to at least check if the HEAD version has changed [03:58] JimBastard_: i created a dumb stupid node http cache [03:58] creationix: if I push to howtonode.org, it's picked up within a second [03:58] JimBastard_: it usually turns sites into 4400 or so [03:59] JimBastard_: holds everything in memory [03:59] creationix: nginx caches would really cause stale data [03:59] JimBastard_: does one http-proxy the first time [03:59] hzin: I hear all these SSL issues with node.js, does that also affect using SSL in client socket, e.g. node.js app connecting to an SSL-enabled webservice [03:59] Evet: JimBastard_: get content from database, manipulate it, serve [03:59] creationix: hzin: sadly, yes [03:59] jashkenas: quick question: do any of y'all do any MVC-ish stuff client-side these days? And if so ... are you using a library for it? [03:59] JimBastard_: Evet: thats easy as cake, dont worry about 10k requests per second [04:00] creationix: jashkenas: topcloud! [04:00] creationix: though I haven't used it in over a year [04:00] JimBastard_: Evet: i did a fresh site today from scratch using couchdb and request module and jquery [04:00] JimBastard_: took 2 hours [04:00] jashkenas: TopCloud interface language ... holy cow. [04:00] creationix: jashkenas: interestingly, I never used extjs [04:00] creationix: :D [04:01] creationix: topcloud has real potential, I just never marketed it [04:01] jashkenas: creationix: you realize that your interface language is basically valid coffeescript ... [04:01] creationix: hah, interesting [04:01] derferman has joined the channel [04:01] murphy has joined the channel [04:01] JimBastard_: http://github.com/creationix/topcloud [04:01] hzin: creationix: so do you think it is a bad idea to use SLL in production at the moment? [04:02] creationix: hzin: if you care about data integrity, yes [04:02] murphy has joined the channel [04:02] jashkenas: new Dialog width: 400, height: 250, title: "Blah" ... yep. [04:02] JimBastard_: >.< [04:02] creationix: the bugs cause it to occasionally eat data [04:02] JimBastard_: we kinda have to use it [04:02] creationix: ryah and pquerna are working on it [04:02] JimBastard_: caused a few issues with http.Client already [04:02] Evet: JimBastard_: nice, my dbms provides restful api too. did you use any template engine? [04:02] JimBastard_: Evet: i template client-side exclusively [04:02] creationix: jashkenas: nice [04:02] JimBastard_: so i used jquery and some JUP [04:03] creationix: I guess I've been writing compilers for longer than I realized [04:03] JimBastard_: JUP is not recommended http://github.com/hij1nx/JUP [04:03] JimBastard_: not for you [04:03] creationix: my older jup-like engine http://github.com/creationix/jquery-haml [04:03] creationix: the base for TopCloud [04:03] JimBastard_: unless you prefer to write in JSON instead of HTML [04:03] JimBastard_: ive got a bunch of JUP commits waiting for a push [04:03] creationix: read this source for fun http://static.creationix.com/jquery-haml/examples/index.html [04:03] JimBastard_: perhaps a blog post later this week [04:03] technoweenie: wow ugh no thanks [04:04] Evet: JimBastard_: you write html page, and it talks with node.js via ajax? [04:04] JimBastard_: Evet: 10-4 [04:04] creationix: err this source http://static.creationix.com/jquery-haml/examples/js/ui-demo.js [04:04] JimBastard_: i use node-static to server html5boilerplate [04:04] JimBastard_: then i connect jQuery.ajax() to the http server and node-static (easy) [04:04] JimBastard_: then i have a route in my request handler for /apps or whatever [04:04] JimBastard_: and they does a request to one couchone.com account [04:04] JimBastard_: BOOM [04:05] JimBastard_: serve the JSON to the browser [04:05] creationix: wait, you can't say BOOM, that's trademarked by steve [04:05] JimBastard_: inject it into pimp jquery plugin [04:06] ctp has joined the channel [04:06] JimBastard_: so little lines of code [04:06] Evet: JimBastard_: dont you use another http server front of node.js? [04:06] JimBastard_: Evet: look at this: http://gist.github.com/612807 [04:07] JimBastard_: (what im working on now) [04:07] creationix: JimBastard_: file.serve is a valid connect layer [04:07] MikhX has joined the channel [04:07] JimBastard_: creationix: sup? [04:08] creationix: how does it compare to Connect.staticProvider or paperboy? [04:08] siculars: JimBastard_: is that you, marak, from nyc? [04:08] JimBastard_: it works, is very clean, is fully tested [04:08] creationix: does it have sendfile? [04:08] JimBastard_: is written by cloudhead [04:08] JimBastard_: maybe [04:08] JimBastard_: siculars: aye [04:08] creationix: cloudhead writes good code generally [04:09] JimBastard_: i like my middlewares to be decoupled and work standalone [04:09] siculars: you hear from brian ? he supposed to line up some space for the next nycjs meetup [04:09] JimBastard_: so i can do as i please with them [04:09] creationix: JimBastard_: agreed [04:09] JimBastard_: siculars: pivotal? [04:09] JimBastard_: we are in GA next month [04:09] JimBastard_: so then we'll do it there [04:09] JimBastard_: in the GIGANTIC office [04:09] creationix: JimBastard_: people don't realize it, but all connect middleware layers can be used standalone like you just did [04:09] siculars: last i spoke to him he said oct14th [04:09] JimBastard_: creationix: i find i can re-use connect middle wares in my apps [04:09] JimBastard_: yes [04:09] JimBastard_: i use auth like that [04:10] creationix: and it's probably faster that way too [04:10] JimBastard_: possibly [04:10] JimBastard_: for me its about simplicity in evolving software [04:10] JimBastard_: easier to keep a mental model of the whole app if you have less pieces [04:11] siculars: JimBastard_ if it ever gets settled im doing a talk on riak-js module for node which talks to ... riak ;) [04:11] siculars: thanks to technoweenie for the protobuf stuff [04:11] technoweenie: oh that bullshit needs to be rewritten [04:11] Tim_Smart: Generating client side models without using any filesytem apis? Hot. [04:12] technoweenie: hopefully this week [04:12] Tim_Smart: file-system* [04:12] siculars: hehe , frank06 also had to walk me through getting protobuf working with node [04:12] AAA_awright_ has joined the channel [04:12] siculars: it needs an npm script or something [04:12] creationix: so jup is poor mans e4x [04:12] technoweenie: oh for node-protobuf [04:12] siculars: ya [04:12] technoweenie: its kinda crazy [04:14] JimBastard_: creationix: lol [04:14] creationix: wow, mozilla even has querySelector built in [04:15] creationix: you can implement sizzle in 4 lines [04:15] derferman has joined the channel [04:16] JimBastard_: its pretty hard to write JUP by hand [04:16] creationix: yeah, the trailing braces and brackets are a mess [04:16] cataska has joined the channel [04:16] creationix: but it beats writing html inside strings [04:16] JimBastard_: i kinda like that [04:17] JimBastard_: views as data makes you really think about data-binding [04:17] Evet: yay. now im serving a dynamic content \o/ [04:17] JimBastard_: lots of fun things you can do [04:17] JimBastard_: Evet: lol for real? [04:17] mikeal has joined the channel [04:17] Evet: JimBastard_: yeah [04:17] JimBastard_: what did you use? [04:18] Evet: http client request to my database's restful api [04:18] JimBastard_: Evet: whats your dev system? [04:18] JimBastard_: are you on mac os? [04:19] Evet: debian linux [04:19] JimBastard_: word [04:19] JimBastard_: so i think with enough requests you will max out the os FD limit [04:19] micheil: Tim_Smart: ping [04:19] JimBastard_: concurrent requests [04:19] Yuffster has joined the channel [04:19] Tim_Smart: micheil: ping [04:19] Tim_Smart: :p [04:19] Tim_Smart: pong [04:20] micheil: just trying to find what the message was that you sent me. [04:20] micheil: Tim_Smart: I've started to rewrite, and found some interesting things [04:21] Tim_Smart: micheil: Oh, something along the lines of "hows the rewrite going?" [04:21] micheil: - packets that are greater then about 30720 bytes get split [04:21] Tim_Smart: micheil: Yeah that is to be expected. [04:21] micheil: - small packets fired by setInterval(ƒ, 0); don't squish into a single packet in chrome and safari [04:22] ryah: did anyone try the parallel GC patch? [04:22] micheil: ryah: not I. [04:22] Tim_Smart: Not yet, I have been thinking about dual sided models most of the day. [04:22] micheil: ryah: is it by any chance possible to block the event loop, or to stop / pause it? [04:23] Tim_Smart: while (true) {} hehe [04:23] micheil: because if I can do that, then I might be able to see if the data event will emit joint packets. [04:23] ryah: micheil: well... would you like the answer with or without snark? [04:24] micheil: ryah: it's purely to simiulate crash style things [04:24] Evet: JimBastard_: /proc/sys/fs/file-max says 816536. yet enough? [04:24] ryah: joint packets? [04:24] micheil: ryah: so use the most appropriate tone [04:24] mikeal has joined the channel [04:24] ryah: micheil: it's not possible from JS currently - but it could be [04:25] micheil: ryah: yeah, generally it seems that the browsers will flush after writing data, so you'll get only ever packets of |0x00test0xFF| [04:25] micheil: but I'm wondering if there's any chance that I could receive something like 0x00test0xFF0x00test0xFF [04:25] micheil: in a single data event [04:25] ryah: micheil: that is certainly possible [04:26] micheil: okay [04:26] ryah: micheil: you basically can't trust packet framing at all [04:26] micheil: I'll take your word for it then; I haven't been able to create such a situation yet though. [04:26] micheil: okay [04:26] rphillips has joined the channel [04:26] ryah: (for tcp) [04:26] overra has joined the channel [04:27] micheil: Tim_Smart: also, the benchmarks aren't that impressive when you level the playing field by making them all return UTF8 strings. [04:27] creationix: micheil: when I was writing fs.readFile, I was unable to test the branch of the code where the bytes read were less than what you expected, but technically it could happen [04:27] Tim_Smart: micheil: Yeah, toString is really expensive. [04:27] ryah: Tim_Smart: yeah... [04:27] micheil: but the new methods are still faster [04:27] rphillips has joined the channel [04:28] micheil: so, new Buffer([...]) is kinda slow. [04:29] micheil: Tim_Smart: I think I need to counter for the split packet scenario more so then the broken packet scenario [04:29] micheil: erm [04:29] micheil: joint not broken. [04:29] Tim_Smart: micheil: It isn't too hard. [04:30] Tim_Smart: Just keep reference to the offset and the buffers as they come in, until you find the end. [04:30] micheil: I'm guess that when I reach the end of the first data event, then I store off that buffer, then create a new buffer that is length of last data event + length of current data event [04:31] Tim_Smart: micheil: Too many ops. Just push it to an array, then join them all together when you know the entire data length. [04:31] hdon_ has joined the channel [04:31] micheil: hmm.. [04:31] micheil: okay. [04:32] ryah: clang <3 [04:32] Tim_Smart: You can't copy as you go, as there is no length header fielding, and shrinking growing the buffer means more copying ops. [04:32] ryah: can we make a list of projects that we <3 ? [04:32] ryah: there used to be a website called sweetcode [04:33] Tim_Smart: field* [04:33] creationix: Tim_Smart:where is parseUrl defined [04:33] micheil: ryah: go for it. :P [04:33] Tim_Smart: creationix: What for? [04:33] creationix: Tim_Smart: I'm trying to use your sendfile as a connect middleware [04:33] ryah: it was lovely [04:33] Tim_Smart: Oh right. [04:33] creationix: pathname = request.parseUrl().pathname; [04:34] creationix: is that just a wrapper around Url.parse(request.url) ? [04:34] Tim_Smart: Yeah, http://github.com/biggie/biggie-router/blob/master/lib/biggie-router/request.js [04:34] micheil: Tim_Smart: so, after I have an array of the previous buffers, I should then loop that to calculate total length and join it, or would calling Buffer(Array) be quicker? [04:34] derferman has joined the channel [04:35] Tim_Smart: creationix: I want to create a repository of middleware, that frameworks can just clone in. [04:35] creationix: good idea [04:35] Tim_Smart: Then everything is namespaced. [04:36] Tim_Smart: Maybe with a index.js file that requires them all into a hash, then exports. [04:37] mikeal has joined the channel [04:37] Tim_Smart: http://github.com/biggie/biggie-router/blob/master/lib/biggie-router/modules/index.js [04:37] creationix: I like how you made it follow the connect style, but went your own way [04:37] sechrist: facebook going down [04:37] sechrist: is not cool [04:38] ajpiano has joined the channel [04:38] Tim_Smart: I deleted my Facebook account, I now have more free time. [04:38] sechrist: I develop facebook apps and shit [04:38] sechrist: so right now [04:38] sechrist: I can't work on my side project [04:39] sechrist: I spend more time in test accounts than I do my actual facebook account #funfact [04:41] micheil: sechrist: I'm just wondering' how my peers are copeing. [04:41] sechrist: foursquare and facebook are failing today [04:41] sechrist: I bet twitter fails too when all of the facebook users go over to twitter [04:41] badaxx has joined the channel [04:41] badaxx: creationix: are you there? [04:41] creationix: badaxx: yes [04:42] badaxx: creationix: you told me about some javascript library to handle long polling etc. in all browsers. what was it? [04:42] sechrist: http://dev.twitter.com/status [04:42] sechrist: 88% uptime for home_timeline [04:42] creationix: badaxx: socket.io [04:42] sechrist: yep.. twitter gon fail [04:42] badaxx: creationix: ah perfect, thank you [04:42] creationix: no problem [04:42] creationix: mongo is web scale [04:42] Tim_Smart: sechrist: Don't they use rails? [04:42] creationix: sechrist: ^ [04:43] creationix: twitter has some rails, but not for the data intensive stuff [04:43] nroot7 has joined the channel [04:43] creationix: I seem to remember it's mostly scala [04:43] Tim_Smart: Oh right. [04:43] sechrist: they went through a large infrastructural change since their railness [04:43] sechrist: but facebook going down is a larger event than the world cup [04:43] sechrist: and twitter couldn't handle the world cup [04:44] sechrist: ACTION gets popcorn [04:44] nroot7: I just cloned howtonode.org and installed wheat, the index page shows up alright but all links return 404 [04:44] brianmario has joined the channel [04:44] technoweenie: dropbox was down today too [04:44] technoweenie: twitter of course [04:44] MikhX has joined the channel [04:45] tpryme has joined the channel [04:45] sechrist: dropbox going down can actually be a major problem for some people [04:46] technoweenie: http://scripting.com/stories/2010/10/05/dropboxIsDown.html [04:46] technoweenie: scripting.com was down at the time too, i dont know if THAT was dropbox related to sheesh [04:47] sechrist: dropbox has a good track record [04:47] sechrist: according to their status page [04:47] badaxx: creationix: do you know how to use socket.io with express / connect? where do I get the actual server instance to pass it to socket.io? [04:47] creationix: badaxx: yeah, it basically bypasses the connect stuff [04:48] creationix: the server from connect is the same as the regular node http server [04:48] creationix: just mount socket.io to it [04:48] badaxx: creationix: hm okay but I get "Illegal transport socket.io.js" [04:48] creationix: not sure about that one [04:48] creationix: I've never used express, but this is a connect app with socket.io [04:48] badaxx: gonna fetch it from github... npm seems to be broken [04:48] creationix: http://github.com/creationix/adventure [04:49] creationix: live site here http://creationix.no.de/#0/0 [04:49] creationix: Tim_Smart: ab doesn't seem to like sendfile [04:49] Tim_Smart: Right. Worked fine for me. [04:49] creationix: it freezes after a bunch of requests as if I ran out of ports [04:50] Tim_Smart: That is how I benched it. [04:50] derferman has joined the channel [04:50] creationix: but I don't have very many TIME_WAITs at all [04:52] creationix: Tim_Smart: https://gist.github.com/233a9f5f3903db92a1a5 [04:52] sechrist: getting the coupon for joyent is failing for me :( [04:54] creationix: Tim_Smart: with a large file I get pretty good performance though 453196.89 [Kbytes/sec] received [04:54] aconbere has joined the channel [04:54] creationix: (On a mac mini) [04:54] Tim_Smart: Oh cool. [04:54] creationix: now to try it for creationix.com [04:55] sechrist: "curl -k https://api.no.de/♥ -X POST -u my_username:secret" = unauthorized! [04:55] Tim_Smart: Does biggie-router's senfile freeze up as well? [04:55] sechrist: :( [04:57] creationix: Tim_Smart: hmm, doesn't seem to work on node 0.2.0 [04:57] Tim_Smart: Oh right. I have ported it to node 0.3 I think. [04:57] creationix: I was running it with 0.2.3 on my desktop [04:57] creationix: I guess sendfile is a new thing? [04:57] creationix: since 0.2.0 [04:57] Tim_Smart: I.e. require('constants') etc. [04:58] Tim_Smart: Shouldn't be. [04:58] creationix: yeah, it runs fine on 0.2.3 on my mac, but dies with 0.2.0 on my linux server [04:58] creationix: I'm only using sendfile and it's deps, not the whole framework [04:59] sechrist: ah there [04:59] sechrist: stupid bash! [05:00] creationix: Tim_Smart: interesting, it's fs.open that's failing [05:00] Tim_Smart: API change or something? [05:00] creationix: shouldn't be [05:02] creationix: Tim_Smart: I think it's your null in fs.open [05:03] creationix: Tim_Smart: yep, if I replace the null with 0644 then it works fine in node v0.2.0 [05:03] Tim_Smart: Ah ok. [05:03] creationix: ryah: is that an API change in the 0.2.x branch? [05:05] statim has joined the channel [05:06] kriszyp has joined the channel [05:07] saikat has joined the channel [05:09] rex_fernando: creationix: why do you use connect for wheat instead of using express or something else slightly higher-level? [05:09] creationix: because I like low level [05:09] creationix: and wheat was written long before connect [05:10] creationix: originally it was on top of node-router [05:10] dannycoates has left the channel [05:10] rex_fernando: fair enough [05:11] creationix: rex_fernando: you're welcome to rewrite wheat to make the code cleaner [05:11] creationix: it sure could use it [05:12] rex_fernando: creationix: lol, I was just curious [05:13] creationix: :) [05:13] Tim_Smart: creationix: Is wheat still a static site generator? [05:14] dilvie has joined the channel [05:15] creationix: Tim_Smart: sortof, it generates the html on the fly and caches it in ram [05:15] ryah: creationix: api change? [05:15] creationix: the data source is 100% a git repo [05:16] creationix: fs.open seems to accept null for the third argument now [05:16] creationix: it didn't in 0.2.0 [05:16] Tim_Smart: creationix: According to the docs, 0666 is the default. [05:16] creationix: yeah, those are the 0.2.3 docs [05:17] creationix: in 02.0 I get TypeError: Bad argument [05:17] creationix: at Object.open (fs:145:11) [05:17] creationix: maybe it was more a bug fixed than an api change? [05:18] hassox has joined the channel [05:19] dilvie: what's the easiest way to convert a regular expression to a string? [05:19] creationix: .toString() ? [05:20] Tim_Smart: v8: /test/.toString() [05:20] v8bot: Tim_Smart: "/test/" [05:20] dilvie: I need it without the forward slashes. =) [05:20] Tim_Smart: v8: typeof /test/ [05:20] v8bot: Tim_Smart: "function" [05:20] Tim_Smart: :/ [05:20] micheil: v8: (new Regexp("/test/")).toString() [05:20] v8bot: micheil: ReferenceError: Regexp is not defined [05:20] micheil: hmm.. [05:20] micheil: v8: (new RegExp("/test/")).toString() [05:20] v8bot: micheil: "//test//" [05:21] dilvie: v8: /test/.toString(); [05:21] v8bot: dilvie: "/test/" [05:21] Tim_Smart: v8: /test/ instanceof RegExp [05:21] v8bot: Tim_Smart: true [05:22] Tim_Smart: Object.getOwnPropertyNames(/test/) [05:22] Tim_Smart: v8: Object.getOwnPropertyNames(/test/) [05:22] v8bot: Tim_Smart: ["lastIndex", "multiline", "global", "source", "ignoreCase"] [05:23] creationix: Tim_Smart: wow, your sendfile thing does 304 responses? [05:23] JimBastard_: v8: 42 [05:23] v8bot: JimBastard_: 42 [05:23] ryah: creationix: hm yeah [05:23] Tim_Smart: creationix: Yeah... [05:23] dilvie: v8: var re = /test/; test.toString().substring(1, re.length-1); [05:23] v8bot: dilvie: ReferenceError: test is not defined [05:23] dilvie: v8: var re = /test/; re.toString().substring(1, re.length-1); [05:23] v8bot: dilvie: "/" [05:23] ryah: creationix: looks like gb9ca843 is the commit [05:24] creationix: ryah: so did the docs always say it was optional, if so, then it's a bug fix and not an api change [05:24] dilvie: v8: var re = /test/.toString(); re.substring(1, re.length-1); [05:24] v8bot: dilvie: "test" [05:24] dilvie: there we go. [05:24] dilvie: thanks. =) [05:25] ryah: creationix: well - bug fix or not it's apparently breaking things :) [05:25] creationix: only when I try to run code written for 0.2.3 on a 0.2.0 runtime [05:25] dilvie: ryah: I love breaking things. [05:25] creationix: I mean, there will always be code that works in a newer version, but not the old version, at least if you're fixing bugs [05:26] creationix: it's then stuff works in 0.2.0, but then breaks when someone upgrades to 0.2.3 that you have issuea [05:26] creationix: *issues [05:29] dilvie: v8: var re = /test/.toString().substring(1, re.length-1); [05:29] v8bot: dilvie: TypeError: Cannot read property 'length' of undefined [05:29] dilvie: chaining is good. [05:30] Tim_Smart: var re; (re = /test/.toString()).substring(1, re.length - 1); [05:30] creationix: Tim_Smart: creationix.com is now powered by your sendfile! [05:31] Tim_Smart: <3 [05:31] Tim_Smart: Did you sort out the benchmarks? [05:31] creationix: http://creationix.com/wordle.jpg can now handle 3701.98 [#/sec] (mean) [05:31] dilvie: Tim_Smart: lol [05:31] creationix: ab is still funny sometimes [05:31] dilvie: I don't think sometimes. [05:31] creationix: 4k/sec isn't bad for a 100k+ jpeg [05:32] creationix: now the real test is to upload some media files and try to stream them [05:34] micheil: hmm.. there'd have to be libraries to handle benchmarking right? [05:36] creationix: proper benchmarking requires more than software [05:36] creationix: I know some guys in Santa Clara that sell an appliance you put on your lan [05:36] statim: anyone know why i cant get my process.on('exit' function to get called? the process dies while i kill -TERM it, but doesnt do whats in process.on('exit'..). [05:39] creationix: Tim_Smart: nice, check out this in chrome http://creationix.com/BigBuckBunny_640x360.m4v [05:39] creationix: I'm still downloading the movie file to my server, but you can stream what's already there [05:40] creationix: only 20% is actually on the server [05:40] creationix: statim: maybe you need to catch the signal [05:40] creationix: the exit event it calls when the event loop is empty [05:40] creationix: *called [05:41] Tim_Smart: creationix: My interweb is too slow for that stuff :p [05:42] path[l] has joined the channel [05:42] Yuffster has joined the channel [05:42] statim: creationix: k will try that [05:43] unomi has joined the channel [05:44] pgriess has joined the channel [05:46] micheil: creationix: that's kinda awesome. [05:46] micheil: creationix: must be at about half way. [05:47] creationix: it seems to have issues when the browser requests a range that's not all there [05:47] micheil: yeah [05:47] micheil: it just stops and the controls disable [05:48] pquerna: ab-- [05:48] v8bot: pquerna has taken a beer from ab. ab now has -1 beers. [05:49] creationix: micheil: is that you hitting it from ubuntu 10.04? [05:49] micheil: no [05:49] micheil: I'm os x. [05:49] statim: with the evented nature of things, if i call process.exit() will it abruptly interrupt something that may still be going? if so, would putting it inside process.nextTick be any better, or does that stuff not guarantee the nextTick is after everything that is queued up or may be in the process of being queued up in any existing callbacks? [05:49] creationix: I wonder what my monthy upload limit is on linode? [05:49] micheil: I currently only have one machine available.. the other one (that was ubuntu) broke [05:50] creationix: ok, download complete, it should work now [05:51] Nohryb has joined the channel [05:51] creationix: yeah, something isn't quite right [05:52] creationix: statim: it won't interrupt and active code, but it will cancel any pending events [05:52] creationix: setTimeout(fn, 0) will put it at the end of the queue [05:52] Tim_Smart: creationix: Starting work on client side models ;) http://github.com/biggie/biggie-sync/blob/master/lib/sync.js#L50-106 [05:52] Tim_Smart: No filesystem used :p [05:53] creationix: Tim_Smart: fun [05:54] Tim_Smart: Kinda funny really - JSON with functions... [05:56] creationix: heh, chrome supports SDCH encoding [05:56] creationix: http diffs over the wire [06:01] hassox has joined the channel [06:02] ezmobius has joined the channel [06:02] creationix: yeah, I don't know why chrome can't stream the entire movie [06:02] creationix: you're sending the right mime type and seem to support range requests [06:06] micheil: Tim_Smart: is that a generator for other js code there? [06:06] dbathurst_ has joined the channel [06:06] Tim_Smart: Yeah. [06:07] Tim_Smart: Takes compiled (live) models, and creates a version for the browser. [06:07] Tim_Smart: I still need to create the browser library to power them though. [06:09] micheil: browser ORM's are kinda hard. [06:09] SamuraiJack has joined the channel [06:09] micheil: just because of how to actually store stuff [06:09] micheil: and how to write the api. [06:09] Tim_Smart: micheil: Yeah, this will just mirror the models from the server to the client, and hook them up with socket.io. [06:10] micheil: there is no way it is 5pm.. [06:10] micheil: Tim_Smart: pst. node-eventstream ftw. [06:10] micheil: (or nodestream, but it depends on jquery) [06:11] Tim_Smart: Yeah, I will take a look at all that soon. [06:11] jesusabdullah: dnode has something for sending events back and forth [06:11] micheil: :D [06:11] Tim_Smart: Anyway, I'm off for a while. [06:11] micheil: k [06:11] jesusabdullah: I don't think it's documented very well, but it's in there [06:11] jesusabdullah: Acts a lot like node EEs iirc [06:11] evl has joined the channel [06:11] micheil: node-eventstreams api == node eventEmitter's api. [06:11] micheil: pretty much [06:12] micheil: like, the only difference is where the data for the event comes from [06:12] micheil: emits send data out [06:12] micheil: and triggers are on the receive of data [06:13] evl: what's the fastest way to clone an object? I'm really just looking to add a new property to an object without messing with the original [06:14] micheil: isn't there an ECMA262 Object.clone method? [06:14] evl: TypeError: Object # has no method 'clone' [06:14] ezmobius has joined the channel [06:15] micheil: yeah [06:15] micheil: my bad [06:15] micheil: anyway --out. [06:15] evl: I thought about JSON.stringify/parse but that seems icky [06:15] creationix: Tim_Smart: streaming is working now, it was an issue with my browser's cache having invalid data [06:16] sprout has joined the channel [06:16] peritus- has joined the channel [06:16] Tim_Smart: creationix: Great. Anyway, I gotta run. [06:16] creationix: cool [06:16] amerine has joined the channel [06:20] sprout has joined the channel [06:20] nofxx has joined the channel [06:20] sprout has joined the channel [06:21] rex_fernando has joined the channel [06:21] badaxx has joined the channel [06:22] micheil: creationix: "don't abuse my bandwidth" that's somewhat just asking for it. :P [06:22] creationix: I'm watching the logs [06:22] micheil: haha. [06:22] creationix: immediately someone hit it with pycurl [06:22] micheil: HN. [06:22] creationix: I seem to be capped at 5mb/sec up [06:22] alexb_ has joined the channel [06:22] hassox has joined the channel [06:23] creationix: still, that would use up my limit in 11 hours [06:23] jameshome has joined the channel [06:27] statim: anyone thats interested and could help me comprehend the internals of node, check out this example: http://titanpad.com/atp6zXCEzP if you run this as-is, all the callbacks print and then the program exits. [06:28] statim: if you then uncomment line 31 and change the exiter to one of the types ive put in there, you can see how it changes things. [06:28] statim: basically the default, without the exiter line, leads me to believe somehow node has a way to know 'when nothing else is going to happen' and it exits. im trying to figure out how to get the same programatically [06:30] statim: because, say for instance your in the middle of a function thats doing all sorts of stuff, making http requests, etc, and you need to shut the program down. you should be able to do that after all callback spaghetti has finished i would think? [06:34] creationix: statim: if you stop the long running stuff (like network servers) then node will shutdown when everything else is done [06:34] creationix: that's the theory at least [06:35] creationix: otherwise you have to instrument ALL your events and keep track of them in user-space [06:37] statim: creationix: ok, makes sense… ill see if i can get that to work then. i tried server.close() on an express/connect app, but the app didnt exit, so maybe i had something else still on [06:37] creationix: not sure, I've not actually tried it [06:37] creationix: setInterval also is long running [06:37] creationix: fs.watchFile [06:37] badaxx has joined the channel [06:38] creationix: maybe server.exit ? [06:38] TomY_ has joined the channel [06:39] creationix: statim: let me know what you find out [06:39] creationix: I want this so I can intercept SIGINT and do a graceful shutdown [06:39] creationix: IE let all pending HTTP requests finish before exiting, but not accept any new ones [06:40] statim: creationix: will do. ya thats exactly what i need too [06:40] creationix: I want to be able to do graceful reloads of http clusters (when code gets upgraded) [06:41] creationix: so I have several servers sharing a single port and so the users never notice any downtime [06:42] JimBastard_: creationix: we do that [06:42] statim: creationix: ok, so it is as simple as server.close() [06:43] creationix: statim: cool [06:43] creationix: JimBastard_: what lib are you using? spark, multinode, your-own-thing? [06:43] statim: creationix: but only worked on a plain testcase… i must have other stuff in my app open too that i also need to close [06:43] JimBastard_: creationix: custom [06:43] Evet: omg node.js is so exciting [06:43] ahmet has joined the channel [06:43] JimBastard_: creationix: its all database backed too [06:44] JimBastard_: lots of bells and whistles [06:44] Evet: hi ahmet [06:44] creationix: JimBastard_: nice [06:44] creationix: statim: do you have a database connection maybe? [06:45] statim: creationix: yep.. and socket.io connections too that i probably need to close… and probably have to take care to shut the db connection gracefully as well :) [06:45] ahmet: how to nodejs on titanium desktop sdk used? [06:45] hannesw_ has joined the channel [06:46] creationix: statim: maybe just set a timeout after closing the http listener and then severing everything [06:47] norviller has joined the channel [06:48] hassox_ has joined the channel [06:52] hoodoos has joined the channel [06:54] badaxx has joined the channel [06:54] sveimac has joined the channel [07:00] hassox has joined the channel [07:01] jetienne has joined the channel [07:03] jakehow has joined the channel [07:08] ctp has joined the channel [07:11] aubergine has joined the channel [07:11] nofxx: Creating a simple http push server here but I need auth, here's the architecture: User logins, I create a ~50digit id for him, print that to the browser client and write in redis a json array with the channels the user can join under that key. Then the browser client connects, node checks redis... It's working but, better options? did I missed something ? [07:11] alexb_: Does crypto hash work with UTF8 strings? [07:13] micheil: alexb_: I believe it should [07:13] micheil: if it doesn't, I'd think it a bug. [07:13] alexb_: Amazons md5 calculation isn't agreeing with mine :( [07:17] badaxx has joined the channel [07:19] martin-g has joined the channel [07:20] adambeynon has joined the channel [07:20] matjas has joined the channel [07:20] jetienne: nofxx: to have it working is always a good sign :) [07:20] jetienne: hi [07:20] liesen has joined the channel [07:22] nofxx: jetienne: heheh [07:25] alexb_: How about httpclient is that UTF8 safe? How do i tell it what type of data is coming back? [07:29] daglees has joined the channel [07:31] virtuo has joined the channel [07:32] shockie has joined the channel [07:33] micheil: alexb_: all of that stuff deals with buffers, so should be [07:34] rex_fernando has joined the channel [07:34] shockie has joined the channel [07:37] ph^ has joined the channel [07:38] sebs has joined the channel [07:38] sschuermann: hello :)== [07:40] JimBastard has joined the channel [07:41] shockie has joined the channel [07:42] norviller has joined the channel [07:42] micheil: hmm.. no tim and no felix.. [07:44] shockie has joined the channel [07:45] shockie has joined the channel [07:47] shockie has joined the channel [07:48] alexb_: Thanks it was an issue with buffers i think, I converted my string to a UTF8 buffer and that fixed things [07:54] badaxx_ has joined the channel [07:55] gf3 has joined the channel [08:01] maqr has joined the channel [08:14] SvenDowideit has joined the channel [08:18] ctp has joined the channel [08:18] herbySk has joined the channel [08:20] evl has joined the channel [08:26] micheil: ryah: do you think I could use the boyer-moore derived algorithm to skip the bulk of the websocket packets? [08:26] micheil: because I've got to find either a 0x00 or 0xFF [08:27] micheil: and in between may be any other sort of data (utf8 or possibly binary) [08:30] norviller_ has joined the channel [08:35] badaxx has joined the channel [08:37] badaxx: can you tell me how to set the port io.socket() is connecting to? [08:38] norviller has joined the channel [08:40] hansek_____ has joined the channel [08:42] cferris has joined the channel [08:44] mlangenberg has joined the channel [08:44] badaxx_ has joined the channel [08:45] micheil: badaxx_: you do it on the httpServer [08:46] micheil: http.createServer().listen(PORT [, HOST] ) [08:46] micheil: then io.socket() listens on the httpServer [08:46] stephank has joined the channel [08:47] micheil: I don't think you can actually tell socket.io to listen on a specific different port to the httpServer you have it listening on [08:48] peritus- has joined the channel [08:51] aubergine has joined the channel [08:55] evl: You'd need two instances afaik since socket.io just listens to on('listen') and latches on [08:56] jesusabdullah: Man where's a learnboost person when I want to talk to one? [08:56] jesusabdullah: Probably sleeping, but that's beside the point [09:01] ooooPsss has joined the channel [09:02] mattcodes has joined the channel [09:02] mattcodes: ah this is better.. more participants.. end up in nodejs channel [09:03] mattcodes: looks at webframeworks in nodejs, want something close to asp.net mvc, supports model binders etc..? suggestions as to which one to spike with first? [09:03] hellp has joined the channel [09:03] evl: Any good Node books? [09:04] mattcodes: evl, probably best to look at node as a platform with a few APIs built in, the best bits are in apis such geddy, expressjs etc.., but if JS (or async in general) then start with crockford [09:05] evl: mattcodes: what's it called+ [09:06] mattcodes: look at the Crockford series at: http://developer.yahoo.com/yui/theater/ [09:06] mattcodes: ooohh.. there a new video with crockford and node.js on the front page.. [09:11] jesusabdullah: asp.net? :C [09:11] jesusabdullah: evl: Javascript: The Good Parts [09:11] mattcodes: jesusabdullah i was referring to asp.net mvc [09:13] hzin_ has joined the channel [09:16] micheil: jesusabdullah: maybe I could lend a hand, I'm becoming fairly familiar with some of their opensource projects [09:17] xla has joined the channel [09:20] badaxx has joined the channel [09:20] xla has joined the channel [09:21] mbrochh has joined the channel [09:21] mbrochh has joined the channel [09:23] Tim_Smart has joined the channel [09:27] q_no has joined the channel [09:28] murphy has joined the channel [09:28] murphy has joined the channel [09:29] aubergine has joined the channel [09:30] path[l] has joined the channel [09:31] aubergine_ has joined the channel [09:31] jetienne has joined the channel [09:32] christophsturm has joined the channel [09:35] hzin_ has joined the channel [09:36] badaxx has joined the channel [09:37] badaxx_ has joined the channel [09:39] hzin_ has joined the channel [09:42] peritus- has joined the channel [09:43] Druid__ has joined the channel [09:45] norviller has joined the channel [09:46] omarkj has joined the channel [09:48] aubergine has joined the channel [09:50] disqk has joined the channel [09:51] Druid_ has joined the channel [09:51] daglees has joined the channel [09:52] langworthy has joined the channel [09:57] adambeynon has joined the channel [09:57] badaxx has joined the channel [09:58] Gruni has joined the channel [09:59] micheil: ryah: how is node currently handling CONNECT requests? [09:59] micheil: is there an event emitted for them or something? [10:03] stagas has joined the channel [10:03] Ori_P has joined the channel [10:06] rnewson has joined the channel [10:06] aliem has joined the channel [10:09] hassox has joined the channel [10:10] mbrochh has joined the channel [10:10] mbrochh has joined the channel [10:12] badaxx has joined the channel [10:15] agnat has joined the channel [10:23] badaxx has joined the channel [10:24] SvenDowideit has joined the channel [10:32] Evet: JimBastard_: html5boilerplate looks gorgeous [10:35] jetienne: Evet: im looking at it right now... it seems messy from here... you tried it ? is it actually doing what is claimed ? [10:36] jetienne: i still have a lot to learn [10:36] Evet: jetienne: im also newbie too frontend development. it seems exotic to me, but idk [10:37] jetienne: http://net.tutsplus.com/tutorials/html-css-techniques/the-official-guide-to-html5-boilerplate/ i will watch this video when time allows [10:38] adambeynon has joined the channel [10:39] djwm has joined the channel [10:40] djwm: Quick question: There is process.nextTick and setTimeout for scheduling callbacks to occur in the future. Is there means of achieving process.someTick() which would just go to the end of the queue? [10:41] djwm: I can specify a made-up time to setTimeout but that isn't quite the same thing. [10:42] djwm: If there isn't, does anyone else see it as useful? If so I may try to contribute a patch for the capability. [10:43] liesen has joined the channel [10:43] adambeynon has joined the channel [10:44] jetienne: like a "run on idle time" thing ? [10:44] djwm: Yep. [10:44] djwm: Well, kind of. [10:45] djwm: The callback would be entered at the 'back' of the queue at the time of insertion. Assuming such a queue exists; I've not looked at the source yet. [10:45] jetienne: djwm: i think i saw something like that... but i dont remember if it was on stream io or on time [10:46] jetienne: djwm: so better ask some more before starting to code.. i may already exist [10:46] djwm: If its a documented API I must have missed it. But I'll keep looking. [10:46] djwm: Thanks. [10:52] adambeynon_ has joined the channel [10:53] sideshowcoder has joined the channel [11:07] fermion has joined the channel [11:12] zorzar has joined the channel [11:15] badaxx has joined the channel [11:18] delapouite has joined the channel [11:21] Akufen has joined the channel [11:21] Akufen has joined the channel [11:22] djwm: jetienne: turns out nextTick is called from an idle watcher anyway so it is actually wanted I wanted already. [11:22] teemow has joined the channel [11:24] jetienne: djwm: you sure ? nextTick meants something different to me and the doc seems clear about it [11:24] jetienne: "On the next loop around the event loop call this callback" http://nodejs.org/api.html#process-nexttick-76 [11:24] jetienne: this is not "when i got time" [11:25] djwm: Indeed. That was what I thought too. But that's my impression from reading node.{cc,js}. [11:25] djwm: The ev_idle watcher is called after other, higher, priority watchers have run. [11:26] djwm: Now, unless everything is being run at the same priority, which it might be, that would suggest nextTick isn't quite 'next'. But I could be wrong, I've only been looking at the source for a few minutes. [11:27] jetienne: djwm: im not convinced, but if you are happy, this is good enougth for me :) [11:27] ekidd has joined the channel [11:27] djwm: maybe I'll test it out later, for now it doesn't matter too much for me either, I was just curious. [11:27] ekidd has joined the channel [11:33] agnat has joined the channel [11:37] Evet has joined the channel [11:43] cnu has joined the channel [11:45] badaxx has joined the channel [11:46] Lerchmo has joined the channel [11:52] mikew3c has joined the channel [11:54] agnat has joined the channel [11:58] hellp has joined the channel [12:00] throughnothing has joined the channel [12:00] sschuermann: re [12:02] mAritz has joined the channel [12:08] karboh has joined the channel [12:15] peritus- has joined the channel [12:18] rauchg_ has joined the channel [12:21] kriszyp has joined the channel [12:32] c4milo has joined the channel [12:34] rvanrooy has joined the channel [12:40] derferman has joined the channel [12:44] cferris has joined the channel [12:46] MattJ has joined the channel [12:46] rvanrooy: anyone working with connect-redis? [12:46] sechrist: I am [12:46] rvanrooy: how can I access the session given the session ID hash [12:46] rvanrooy: ie. not from a req [12:47] sechrist: get an instance of the redis client (or open up another) and .get(req.sessionID) [12:47] sechrist: the sessionID is the key [12:47] sechrist: if you have the session ID without req, same thing applies [12:48] sechrist: then just JSON.decode the return iirc [12:48] rvanrooy: easier than I thought [12:49] rvanrooy: thanks [12:49] sechrist: np [12:49] rvanrooy: i was trying to get it from the connect-redis library [12:49] rvanrooy: with not much luck [12:50] sechrist: you might be able to grab it's redis client from it and call it through there [12:50] sechrist: it uses one of the popular redis clients as a submodule [12:50] sechrist: so somewhere in that object should be the redis driver instance [12:51] rvanrooy: thanks, I'll have a look [12:51] sechrist: (I just have two redis connections, but whatever) [12:54] sechrist: anybody know how to turn off the server tag and x-powered-by in connect without hacking up source? [12:57] Anti-X has joined the channel [13:00] saimon_ has joined the channel [13:00] ysynopsis has joined the channel [13:01] ysynopsis has left the channel [13:01] paulr_ has joined the channel [13:06] ysynopsis1 has joined the channel [13:07] stagas: sechrist: server.showVersion = false [13:09] sechrist: stagas: where is the server instance from express? [13:10] stagas: sechrist: dunno [13:12] ben_alman has joined the channel [13:12] stagas: sechrist: it should be inherited in the express server instance [13:13] ajpiano has joined the channel [13:13] davidsklar has joined the channel [13:15] evl_ has joined the channel [13:15] sechrist: tried app.set('showVersion', false) and app.showVersion = false.. neither had any effect [13:16] jherdman has joined the channel [13:18] ben_alman has joined the channel [13:19] victorcoder has joined the channel [13:20] boaz has joined the channel [13:20] evl has joined the channel [13:22] evanpro has joined the channel [13:22] trotter has joined the channel [13:23] ekidd has joined the channel [13:25] adambeynon has joined the channel [13:25] sudoer has joined the channel [13:26] badaxx has joined the channel [13:30] liesen has joined the channel [13:31] victorcoder has joined the channel [13:33] martin-g has left the channel [13:36] EyePulp has joined the channel [13:41] gerred has joined the channel [13:41] heavysixer has joined the channel [13:42] hannesw has left the channel [13:43] evl has joined the channel [13:44] hpoydar has joined the channel [13:46] davidwalsh has joined the channel [13:52] bootlaces has joined the channel [13:52] emmanueloga has joined the channel [13:53] bootlaces: Hiya all, having some problems with 0.3.0-pre. When it's attempting to compile the css, it's throwing me a binding.open bad argument exception [13:53] nsm has joined the channel [13:53] bootlaces: http://pastebin.ca/1955601 [13:53] zemanel has joined the channel [13:54] bootlaces: Anyone have any ideas why? [13:56] evl_ has joined the channel [14:00] hoodoos: hey, i'm troubled with finding working mysql node.js driver, have you seen any or better used one? :) [14:00] figital has joined the channel [14:00] micheil: hoodoos: you could try node-mysql by felixge [14:01] micheil: but it's under active development [14:01] micheil: not sure if it's production ready [14:01] fcoury has joined the channel [14:02] hoodoos: i can't find anything that gives atleast sufficient results.. some are really fast, but blocking for some reason and have some strange issues when used in async mode.. well, i'll keep looking [14:03] brainfck` has joined the channel [14:03] teemow has joined the channel [14:06] matjas has joined the channel [14:09] dnolen has joined the channel [14:09] jacobolus has joined the channel [14:10] ysynopsis has joined the channel [14:11] _numbers has left the channel [14:12] zemanel has joined the channel [14:13] nerdEd has joined the channel [14:16] davidwalsh has joined the channel [14:17] jetienne has joined the channel [14:23] aconbere has joined the channel [14:25] evl has joined the channel [14:27] jlecker has joined the channel [14:28] jpld has joined the channel [14:28] jpld has joined the channel [14:28] figital has joined the channel [14:29] davidascher has joined the channel [14:37] bradleymeck has joined the channel [14:38] mlangenberg: Hi all [14:38] jtsnow has joined the channel [14:39] mlangenberg: I am using Node.js in combination with Rails because of its websocket support. Now I am facing an authentication issue. Is it possible to forward the user's session/cookie from the node server to a rails app? [14:40] mlangenberg: For example to check some user permissions. [14:41] rasputnik has joined the channel [14:41] softdrink has joined the channel [14:44] bradleymeck: mlangenberg is the node app sending http request to rails? [14:46] davidascher has joined the channel [14:47] dshaw has joined the channel [14:47] mlangenberg: bradleymeck: yes, in order to check permissions. [14:48] mlangenberg: bradleymeck: I have a node server running at chat.domain.com, app is at www.domain.com. [14:48] gerred has joined the channel [14:48] mlangenberg: bradleymeck: I would like to do a GET to the Rails app to check permissions before establishing a 'websocket' connection. [14:49] bradleymeck: you could attach them to those request by copying the headers then, although many websockets do not give out cookies if you want to authenticate based off the websocket connection rather than an http one. if you do want to authenticate through websocket, have an xhr get a one time use cookie over ssl then send it through the websocket [14:49] micheil: hmm? [14:49] bradleymeck: well by one time use cookie more, a one time use key [14:49] bradleymeck: micheil the persistent want of ppl to validate session of a websocket [14:49] micheil: mlangenberg: is there anything specific the websocket server needs to do? [14:50] liesen has joined the channel [14:50] mlangenberg: micheil: It's a chat backend based on Faye. [14:50] micheil: mlangenberg: if it's a simple chat style application, then I would recommend you look at using PusherApp, as they would better suit your needs, I think. [14:51] ehaas has joined the channel [14:51] marshall_law has joined the channel [14:51] mlangenberg: Oh no way, I don't want that in the cloud. [14:52] micheil: uhh [14:53] micheil: mlangenberg: what do you mean? [14:53] micheil: is this some internal app or is it a public app? [14:54] mlangenberg: Highly sensitive data. [14:54] micheil: mlangenberg: pusher do take privacy extremely closely. [14:55] micheil: and there I am making mistakes in what I'm saying. [14:55] micheil: pusher take privacy as a very important issue. [14:55] micheil: iirc, they will even use secure websockets or websockets over tls if told to. [14:55] mlangenberg: The difference is in using websockets bidirectional or not. [14:56] bartt has joined the channel [14:56] mlangenberg: If a new chat message is a POST to the Rails app, the Rails app will do authentication and connect over internal network to a Node server. [14:56] micheil: at any rate, the only way to do any form of "authentication" with websockets at the moment between different applications is to store from say rails, an authentication token in a database (like redis) [14:57] bartt has left the channel [14:57] mlangenberg: At what rate would you expire those tokens? [14:57] micheil: then when you receive a websocket connection, you listen for the first data packet, and check if that authentication token exists in redis [14:57] micheil: mlangenberg: no idea. [14:57] mlangenberg: Maybe I could just use the browser session id? [14:58] micheil: mlangenberg: well, in current websocket implementation, while Set-Cookie and Cookie headers are allowed to be forwarded, they aren't [14:58] Yuffster has joined the channel [14:58] micheil: so basically you have a token that rails know's about, which says "yes, this is a valid websocket connection request" [14:58] dnolen has joined the channel [14:59] micheil: then when you get a connection, you listen for the first message, say {"evt":"auth","data":"HMAC-SHA1"} [15:00] micheil: then you look for that HMAC-SHA1 in the database, if it's not found or not the one allowed for the specific resource or something, then you simply close the connection [15:00] micheil: conn.close(); [15:00] mlangenberg: I see. [15:00] micheil: else, you know that you're authenticated. [15:00] mlangenberg: I could use the session id for that. [15:01] micheil: from the client side, when you request the page, the rails app would store the HMAC-SHA1 in the database, then also set that as a variable on the page to use [15:01] matt_c has joined the channel [15:01] Evet has joined the channel [15:01] micheil: mlangenberg: as long as it can be access by another means, not just from the rails app. [15:01] micheil: you need a way to communicate it to the websocket server [15:02] micheil: and you need a way that the websocket server can get to it to check it's valid. [15:02] micheil: I should write an article on how to do this one day. [15:03] mikeal has joined the channel [15:04] micheil: mlangenberg: also, I'd recommend that you don't use the Websocket resource to handle routing, as it may break in later versions of the protocol. [15:04] micheil: (I'm awaiting information from IETF folks as to what the go is there) [15:04] micheil: morning mikeal [15:05] mikeal: morning [15:05] micheil: mlangenberg: did I answer your problem? [15:05] Me1000 has joined the channel [15:05] mlangenberg: on the phone ... [15:05] micheil: >_> [15:06] micheil: I'm going to get back to writing the new websocket parser.. ping me if needed. [15:06] mlangenberg: I'm back [15:07] mlangenberg: I will try if I can fit this into the way how Faye is working. [15:07] micheil: mikeal: what do you think a parser should emit when it's bad data? [15:07] dohtem has joined the channel [15:07] dohtem has joined the channel [15:07] micheil: mlangenberg: uhh.. [15:08] mikeal: error? [15:08] micheil: mikeal: yeah, but then that will bubble badly through the event system. [15:08] mikeal: will it? [15:08] mlangenberg: Like you can only subscribe to channels if you pass the token along with the subscription. [15:08] micheil: uncaughtError and all that. [15:08] mikeal: i mean, if it's bad data the parsing can't be recovered, correct? [15:08] micheil: sort of. [15:08] mikeal: then it needs to error [15:09] micheil: hmm.. [15:09] mikeal: someone should handle it, or it'll throw [15:09] mikeal: which, in production, won't bring down the process but will show the exceptions [15:09] micheil: trying to figure out this: [15:09] micheil: 1. If /type/ is not a 0x00 byte, then the server may abort these [15:09] micheil: steps and either immediately disconnect from the client or [15:09] micheil: set the /client terminated/ flag. [15:09] mikeal: that sounds like you should error for sure [15:10] micheil: do you think if /type/ is say, 0x01, then it should error and not continue past step 1? [15:10] mikeal: error is usually emitted before the connection is closed [15:10] mikeal: i'm confused by the wording [15:10] mikeal: what do they mean by "may abort" [15:10] mikeal: does it *have* to? [15:10] mikeal: is there enough info to continue parsing? [15:10] micheil: everything in this speak is "may do something" [15:11] rauchg_: one of you has to change their nickname [15:11] mikeal: this is a w3c spec? [15:11] micheil: there's nothing saying you should just skip that bit and continue [15:11] micheil: mikeal: IETF [15:11] micheil: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76#section-5.3 [15:11] mikeal: IETF relaly does mean MAY then [15:11] micheil: rauchg_: why? [15:11] rauchg_: im kidding, too similar [15:11] mikeal: this is very draft [15:11] micheil: rauchg_: yeah, working on that new parser for node-websocket-server [15:11] mikeal: MAY and MUST are usually capitalized [15:12] micheil: mikeal: that's actually an old draft, but the current implementation one [15:12] dylang has joined the channel [15:12] mikeal: this wording is terrible [15:12] mikeal: and it's why the ietf is nazi about language [15:12] mikeal: so liek [15:12] mikeal: it *sounds* [15:13] micheil: rauchg_: check this out.. http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol [15:13] mikeal: like the server has either the choice to close the connection or set the terminated flasg [15:13] mikeal: er flag [15:13] micheil: right. [15:13] mikeal: but the MAY before the OR definitons make it sound optional [15:14] mikeal: i would say it's an error if it's not 0xFF [15:14] mikeal: sorry, 0x00 [15:14] micheil: mikeal: in which case probably skip that pos in the buffer, or would you discard the whole buffer? [15:14] mikeal: i was looking down a little [15:14] mikeal: discard, disconnection [15:14] mikeal: emit('error', info); socket.forceClose(); [15:15] micheil: hmm.. [15:16] micheil: rauchg_: the next websocket protocol release draft will change quite a lot on how we do the routing of channels [15:17] benv has joined the channel [15:17] micheil: rauchg_: see this as well: http://www.ietf.org/mail-archive/web/hybi/current/msg04285.html [15:17] evl has joined the channel [15:18] rauchg_: micheil: [15:18] rauchg_: what are the biggest changes ? [15:18] micheil: well, the latest handshake proposal is to use CONNECT instead of POST [15:18] mikeal: shameless plug for my friend's company [15:18] mikeal: http://itunes.apple.com/us/app/instagram/id389801252?mt=8 [15:18] mikeal: Instragram is in the app store :) [15:18] Anti-X: shame [15:18] micheil: mikeal: small world, huh. [15:19] mikeal: CONNECT would be better [15:19] mikeal: but it would break through proxies most likely [15:19] micheil: yeah, read the google document, looks like it's better [15:19] mikeal: not because it's out of spec but because proxies are poorly written [15:19] Anti-X: mikeal are the pics tagged with gps position? [15:19] micheil: CONNECT 1C1BCE63-1DF8-455C-8235-08C2646A4F21.invalid:443 HTTP/1.1 [15:19] micheil: Host: 1C1BCE63-1DF8-455C-8235-08C2646A4F21.invalid:443 [15:19] micheil: Sec-WebSocket-Key: [15:19] micheil: would be the request [15:19] mikeal: better, tagged with a foursquare location [15:20] mikeal: when foursquare is up :) [15:20] Anti-X: dunno what that means, but ok [15:20] mikeal: you tag it with a location of a place, not just lat/long [15:20] mikeal: so My Local Coffee Shop [15:20] rauchg_: mikeal: was just downloading it [15:20] mikeal: not just 14.03/334.3 [15:21] micheil: k [15:21] mikeal: it can't hit the login server [15:21] mikeal: i think they are getting flooded [15:21] micheil: mikeal: also, poorly written proxies are probably likely to interpret this request as a HTTPS Connect request [15:21] mikeal: right [15:22] micheil: so, it should be more reliable then the current handshake [15:22] mikeal: the websocket people just need to get more comfortable with the fact that they are breaking HTTP [15:22] mikeal: and that's ok [15:22] micheil: which just dies on proxies. [15:22] mikeal: yeah, but the proxy also might slowly reach it's file handler limit opening up SSL tunnels :) [15:23] mikeal: or crash trying to parse the location of the remote SSL server and not forward anything [15:23] pablort has joined the channel [15:23] rauchg_: "Signup errors, etc. are all coming from the fact that we're having overwhelming demand. Thanks for hanging with us." [15:24] mikeal: i blame Python [15:24] mikeal: node.js FTW :) [15:24] rauchg_: yeah they're using django [15:24] micheil: mikeal: tell you're friend that they should be using node.js, I'd love to see the response :D [15:24] mikeal: i hope it's Python and not postgres [15:24] ysynopsis has left the channel [15:24] mikeal: cause it's easier to fix the Python side than swap db's [15:26] jesusabdullah: rauchg_: does learnboost do quizzes? [15:26] rauchg_: jesusabdullah: not yet [15:26] rauchg_: but soon [15:26] jesusabdullah: Awesome. My school uses Blackboard, and it's a piece of crap. [15:27] jesusabdullah: rauchg_: I noticed that learnboost was free to use--how do you guys make money, then? [15:27] jesusabdullah: :) [15:27] mikeal: rauchg_: what are you guys putting in Mongo? [15:27] rauchg_: we don't [15:27] rauchg_: money is overrated [15:27] mikeal: i thought you were for some reason [15:27] jesusabdullah: wat [15:27] mikeal: haha [15:27] rauchg_: haha j/k [15:27] rauchg_: freemium model [15:27] jesusabdullah: ah [15:27] rauchg_: we need to get all our features in first [15:28] micheil: hmm.. [15:29] micheil: I'm still wanting to know what sort of thing tj could be working on if it requires C/C++ [15:29] mikeal: there are lots of things you would want bindings for [15:30] mikeal: i want ImageMagik bindings so bad [15:30] rauchg_: mikeal: what for [15:30] mikeal: streamed scaling of images :) [15:30] tj has joined the channel [15:30] rauchg_: transloadit ! [15:30] micheil: uh-oh, here's trouble :P [15:31] mikeal: i wouldn't wanna do that for like, thumbnails [15:31] c4milo: mikeal: aren't they already implemented ? [15:31] rauchg_: you probably want http://www.GraphicsMagick.org/ bindings [15:31] rauchg_: hi Guest41199 [15:31] mikeal: because of the extra roundtrips [15:31] mikeal: part of me wonders how much better this stuff is than just using a subprocess [15:31] jesusabdullah: rauchg_: Cool. It'd be really nice to see Blackboard replaced here. It looks like Learnboost is already kicking its pasty ass [15:31] rauchg_: we're gonna eat their lunch [15:32] rauchg_: and use their bathrooms [15:32] jesusabdullah: Awesome [15:32] mikeal: haha [15:32] jesusabdullah: Oh, have you heard of OWL? We had to use it in chemistry class [15:32] jesusabdullah: It's online chemistry homework/quizzes, and it's loads worse than blackboard [15:32] mikeal: the semantic web thing? [15:33] mikeal: http://www.w3.org/TR/owl-features/ [15:33] jesusabdullah: not in this case [15:33] micheil: rauchg_: feel free to replace the really crap online tests that the NSW Board of Studies uses.. [15:33] mikeal: aweful stuff [15:33] jesusabdullah: http://www.cengage.com/owl/ [15:33] jesusabdullah: Yeah, online testing is in a pretty sad state right now :( [15:34] jesusabdullah: I think a good quiz module for learnboost would be a good start [15:34] jesusabdullah: Hmm [15:35] jesusabdullah: I think the problem with OWL is that all the people working on it are chemists, not computer people [15:35] matt_c has joined the channel [15:35] rauchg_: owldemo.cgi [15:35] rauchg_: i think they're using node [15:36] steadicat has joined the channel [15:36] jesusabdullah: XD [15:37] herbySk1974 has joined the channel [15:38] evl has joined the channel [15:42] micheil: rauchg_: is that thread on the socket.io mailing list basically describing what node-eventstream does? [15:42] streampunk has joined the channel [15:42] micheil: (because I was hoping to take it to socket.io, I've just had other things to do first) [15:43] rauchg_: micheil: yeah, people want to relay custom events [15:43] Ori_P has joined the channel [15:43] rauchg_: but they don't understand that socket.io is not meant to do that out of the box [15:43] micheil: yeah [15:43] micheil: that's fair enough. [15:43] wilmoore has joined the channel [15:45] bradleymeck: bleh, i miss node's module system when working in python [15:49] bradleymeck: creationix about? [15:49] creationix: ? [15:50] cha0s has joined the channel [15:50] cnu has joined the channel [15:50] bradleymeck: how about for your next article going on about authentication schemes in node? from websockets session keeping to connect-auth? [15:50] ginader has joined the channel [15:50] micheil: bradleymeck: I was thinking of writing that sort of thing. [15:50] creationix: sounds good, but I'm not experienced in that [15:51] creationix: someone else should write it [15:51] bradleymeck: honestly at this point i think we need to just make a access token module that spews out single use tokens for websocket consumption [15:52] micheil: bradleymeck: actually, there should be a module + library for it. [15:52] dnolen has joined the channel [15:52] matt_c: jamescarr_: Hey, I noticed that you rescheduled the node-stl meetup. Are you still going to be in town for Strange Loop? I'm wondering out loud if it's worth trying to get node folks together while a bunch of out-of-towners (like me) will be there. [15:52] bradleymeck: idk if we need to go so far as a library [15:53] micheil: bradleymeck: yeah, saves people implementing shit. [15:53] aubergine has joined the channel [15:53] micheil: standards ftw. [15:53] bradleymeck: fair enough, now go write me up a standard :) [15:53] micheil: >_> [15:53] dbathurst_ has joined the channel [15:55] dshaw: jesusabdullah: Interviewed with those guys. Got turned down because I was "too interested in emerging tech". [15:55] ph^ has joined the channel [15:55] bradleymeck: XD [15:56] dshaw: Not the OWL team, but I think it might be indicative of organizational focus. [15:56] sprout has joined the channel [15:56] creationix: emerging tech is very distracting [15:57] creationix: but being interested in it generally means you care about programming [15:57] dshaw: Blackboard is insanely bad software. [15:57] dshaw: creationix: totally agree [15:57] creationix: dshaw: yes it is! [15:57] jesusabdullah: dshaw: which guys? [15:58] creationix: I was almost driven to form a company just to make something better when I was in school [15:58] dshaw: Worst UX evar. [15:58] bradleymeck: i would just say xhr up on the websocket port over ssl with the header: "x-access-token-request: simple", binds the token this session to a one time use key, spews back base64 string for the key, ws spews up the key before it spews up any other messages, and viola [15:58] jesusabdullah: OWL or Blackboard [15:58] dshaw: owl [15:58] dshaw: Used Blackboard at school. [15:59] dshaw: jesusabdullah: it was cengage [15:59] bradleymeck: there is another one what is it...moodle!, never got into that [16:00] admc has joined the channel [16:00] admc_ has joined the channel [16:00] dshaw: creationix: I know the feeling. As an engineer, using Blackboard you just think "you have to work hard to suck this bad". [16:01] teemow has joined the channel [16:01] creationix: dshaw: java does make it a lot easier to suck though [16:02] badaxx has joined the channel [16:02] nofxx has joined the channel [16:02] badaxx: hey, what is a good and fast way to merge 3 big files in node.js? [16:03] bradleymeck: merge how? [16:03] saimon_ has joined the channel [16:03] badaxx: i've got three parts of a file which I want to merge into one file [16:04] badaxx: but the parts are up to 20mb [16:04] dshaw: creationix: yeah, there's a huge baseline of suck with circa '90s tech in the browser. It doesn't justify the end-to-end poor experience though. [16:04] bradleymeck: badaxx concatenate? [16:04] badaxx: yep [16:05] badaxx: was that a question or a suggestion? [16:05] micheil: bradleymeck: not quite. I don't think. [16:06] bradleymeck: it was a question on how you were merging [16:06] bradleymeck: i would honestly spawn a worker to do it, be it from spawn or webworker module [16:06] creationix: badaxx: shell to bash and use cat and >> [16:07] badaxx: creationix: sounds good... [16:07] creationix: badaxx: or use the fs streams [16:07] tjholowaychuk: badaxx: $ cat file1 file2 file3 > out [16:08] badaxx: I'll try the cat method. thanks so far! [16:09] micheil: does this look right.. this.emit("error", new Error("Malformed Frame")); [16:10] bradleymeck: seems ok to me as long as this is an emitter and you are doing it at the right time [16:10] micheil: bradleymeck: yeah. [16:11] Sami_ZzZ has joined the channel [16:15] hansek has joined the channel [16:16] paulr__ has joined the channel [16:17] zpoley has joined the channel [16:17] jakehow has joined the channel [16:18] creationix: bradleymeck: what's the fastest way to do a shallow clone in es5? [16:19] bradleymeck: prototype shallow or own shallow [16:19] creationix: I want an object just like the old one, but with a new __proto__ [16:19] creationix: do I just make a new object and enumerate over the properties? [16:20] bradleymeck: Object.getOwnPropertyNames [16:20] bradleymeck: and yea make the obj then spew em onto it [16:20] ajpiano has joined the channel [16:20] creationix: ACTION goes to look for getOwnPropertyDescriptors in the es5 spec [16:21] creationix: it's just one at a time right? [16:21] bradleymeck: hehe yea [16:21] tmpvar has joined the channel [16:21] bradleymeck: would be nice to have full on clones [16:21] pgriess has joined the channel [16:21] creationix: so loop over the OwnPropertyNames, calling getOwnPropertyDescriptor for each, built an object of all descriptors, and then pass it to Object.create? [16:21] creationix: then you get a perfect shallow clone with a new object? [16:22] hansek_ has joined the channel [16:22] markwubben has joined the channel [16:22] bradleymeck: Object.create the prototype you want, then loop [16:23] bradleymeck: you should [16:23] creationix: so don't bother creating a single object with all the descriptors [16:23] creationix: yeah, I guess that's slightly faster and creates less throw-away objects [16:23] deepthawtz has joined the channel [16:23] creationix: especially since Object.create is implemented in js in V8 [16:24] bradleymeck: for now~ [16:25] bradleymeck: i wonder if reprototype on an object in overload is faster than object.create [16:25] creationix: reprototype? [16:26] creationix: like obj.__proto__ = foo? [16:26] muk_mb has joined the channel [16:26] Yuffster has joined the channel [16:26] bradleymeck: kinda but using the c++ api [16:27] bartt has joined the channel [16:27] banjiewen has joined the channel [16:28] saikat has joined the channel [16:28] bencc has joined the channel [16:29] muk_mb has joined the channel [16:29] aconbere has joined the channel [16:30] bpot has joined the channel [16:30] sprout has joined the channel [16:31] muk_mb has joined the channel [16:31] sprout has joined the channel [16:32] evl has joined the channel [16:32] evl has joined the channel [16:32] sprout has joined the channel [16:34] matt_c has joined the channel [16:34] TheEmpath has joined the channel [16:35] nroot7 has joined the channel [16:37] dahankzter has joined the channel [16:39] [[zz]] has joined the channel [16:40] peritus- has joined the channel [16:41] isaacs has joined the channel [16:42] micheil: Has anyone noticed an empty message being emitted from node-websocket-server on connection by any chance? [16:43] bradleymeck: i did a while back, but havent looked into it recently [16:44] slashxr has joined the channel [16:45] noahcampbell has joined the channel [16:46] mjr_ has joined the channel [16:46] proppy has joined the channel [16:46] proppy: Hi, is it possible to catch EADDRINUSE from js code ? [16:47] proppy: try/catch around server.listen doesn't seems to help [16:48] halfhalo: I know for tcp I can listen to error which gives me the error messages instead of throwing and exiting the app, have you tried that? [16:50] mjr_: I'm not sure it emits an error [16:50] micheil: bradleymeck: yeah, there was an issue with the connection handling, I only just picked it up with this new parser. [16:51] mjr_: proppy: I think the answer might be no, unfortunately. [16:51] langworthy has joined the channel [16:51] mjr_: proppy: it seems like it should emit an error or do something though. [16:51] proppy: halfhalo: nice idea I will try this [16:51] rauchg_ has joined the channel [16:52] proppy: mjr_: I'm not listening on error event, maybe that's why [16:52] halfhalo: ACTION has it working for him for his tcp irc thingie [16:52] mjr_: Looking at the source code, I'm not seeing where bind() errors would emit [16:52] mjr_: But maybe I missed it. [16:53] proppy: mjr_: it doesn't work you're right [16:53] siculars has joined the channel [16:53] creationix: hmm, I hate it when I'm writing an article about javascript and my assumptions are wrong [16:53] proppy: socket.addListener('error', function(error) { [16:53] proppy: console.log('error'); [16:53] proppy: }); [16:53] creationix: I thought the object from "new Foo()" has .constructor === Foo [16:54] mjr_: proppy: I think you need something in net.js, like 1141 [16:54] Pilate: i hate people who write articles with wrong assumptions too [16:54] creationix: Pilate: lol, that why I actually execute my code and show the output live [16:54] creationix: keeps the lying to a minimum [16:55] halfhalo: unless you lie on PURPOSE!!! [16:55] proppy: mjr_: actually _doListen is throwing EADDRINUSE [16:55] proppy: not bind [16:55] tjholowaychuk: creationix: new Foo().constructor === Foo [16:55] tjholowaychuk: is true [16:55] tjholowaychuk: ? [16:55] creationix: I thought it was, bit in my test it's === Object [16:56] creationix: hmm, and it even works in the repl [16:56] creationix: strange [16:56] mjr_: proppy: oh, OK, so put a try/catch on 1177, and then emit("error", err) in the catch [16:56] mjr_: er, this.emit("error") [16:56] tjholowaychuk: creationix: it should be.. [16:56] creationix: v8: function Foo(){};(new Foo).constructor [16:56] v8bot: creationix: function Foo(){} [16:56] proppy: mjr_: I don't think so, since putting a try catch in the client code doesn't help [16:56] viktors has joined the channel [16:56] proppy: hooo waiit [16:56] creationix: function Foo(){};(new Foo).constructor.name [16:57] proppy: it is because of process_nextTick [16:57] mjr_: proppy: it'll work there because doListen runs in a new stack [16:57] mjr_: yeah, from nextTick [16:57] creationix: v8: function Foo(){};(new Foo).constructor.name [16:57] v8bot: creationix: "Foo" [16:57] proppy: mjr_: thanks :) [16:57] tjholowaychuk: :p [16:57] vnguyen has joined the channel [16:57] mjr_: proppy: but it'd be in a new stack if you had to wait for DNS also [16:57] proppy: async exception FTW :) [16:57] vnguyen_ has joined the channel [16:57] creationix: tjholowaychuk: now I'm really confused, I wonder if I've hit upon an v8 bug [16:57] mjr_: Yeah, dealing with exceptions that aren't on your stack is annoying. [16:58] tjholowaychuk: creationix: not sure what you were doing before should be fine though [16:58] Evet has joined the channel [16:58] mjr_: proppy: when you get it working, send the patch to the ml. This is a pretty useful thing to be able to detect. [16:58] creationix: tjholowaychuk: https://gist.github.com/49d0ef4962197b44d16d [16:58] mjr_: proppy: also really need a test for this. [16:59] tjholowaychuk: creationix: because you are using Object.create() [16:59] proppy: mjr_: yes, I already wrote a test for websocket [16:59] creationix: tjholowaychuk: only for Square's prototype [16:59] proppy: but it should be easy to port it to net.js [16:59] creationix: that shouldn't affect new Rectangle [16:59] micheil: proppy: ? [16:59] micheil: a test for websocket? [16:59] paulwe has joined the channel [17:00] claudiu__ has joined the channel [17:00] proppy: micheil: I mean a test for my client code using websocket, and checking that it was automaticly incrementing the port number if already used [17:00] tjholowaychuk: creationix: add constructor: Rectangle to your proto [17:00] pengwynn has joined the channel [17:00] creationix: tjholowaychuk: sure, but I shouldn't have to [17:00] tjholowaychuk: creationix: when you are assigning it to Rectangle.prototype [17:00] creationix: new sets constructor for you [17:02] creationix: hmm, maybe it's because I'm overriding prototype and that's where constructor is set [17:02] creationix: not at runtime with new [17:03] tjholowaychuk: yeah [17:03] mbrochh has joined the channel [17:03] creationix: is that in the spec? I don't remember that part [17:03] mbrochh has joined the channel [17:04] mjr_: I find it interesting that you can effectively use JavaScript and it's prototype system without actually understanding this [17:04] zorzar: isaacs: ping [17:04] admc__ has joined the channel [17:05] creationix: mjr_: define "effectively" [17:05] isaacs: zorzar: hey [17:06] derencius has joined the channel [17:06] isaacs: mjr_, creationix: what's the puzzle? this conv. looks interesting. [17:06] creationix: isaacs: the question is where the magical .constructor property comes from on object "instances" [17:07] rwaldron has joined the channel [17:07] TheEmpath has joined the channel [17:07] amerine has joined the channel [17:07] creationix: I thought it was inserted at run-time by "new", but it seems it done elsewhere via an implicit .prototype property on functions [17:07] isaacs: creationix: iirc, and i'm about to test this, but answering before testing to see if i actually know it, the Function#prototype is set up automatically to contain a .constructor non-enumerable. if you do MyCtor.prototype = {some object} then you lose it [17:08] davidascher has joined the channel [17:08] creationix: isaacs: that's what I'm seeing in practice [17:08] isaacs: ie, it is not created at run-time by "new" [17:08] creationix: just wondering where that is in the spec [17:08] isaacs: hmm.... [17:08] isaacs: probably in section 10 somewhere where it describes function objects? [17:09] creationix: yeah, it seems to set the .prototype property for all functions when they are created [17:09] creationix: and here I thought I finally understood "new" [17:09] trotter has joined the channel [17:10] creationix: and it seems if you override .prototype with a new object, then .constructor on instances will fall through to the base object and give Object as the constructor [17:10] sanderjd has joined the channel [17:10] zorzar: isaacs: what did you want [17:10] pablort has joined the channel [17:11] sanderjd has left the channel [17:11] isaacs: zorzar: oh, right, so you were talking about using npm with sudo for multiple users, right? [17:11] benburkert has joined the channel [17:12] creationix: isaacs: yep, section 15.3.3 says "A prototype property is automatically created for every function, to provide for the possibility that the function will be used as a constructor." [17:12] zorzar: isaacs: no i'm usin npm in ~/.local [17:12] zorzar: isaacs: i installed node with my package manager [17:12] isaacs: zorzar: oh, ok. i thought that you'd been interested in installing npm globally for all users, and then having each of them run it locally [17:13] zorzar: isaacs: hmmm this is just my single user laptop [17:13] isaacs: oh, ok :) [17:13] zorzar: isaacs: is there something like ruby's bundles planed? [17:14] isaacs: zorzar: npm help bundle [17:14] tjholowaychuk: creationix: http://gist.github.com/613704 [17:14] zorzar: isaacs: oh cool :) [17:14] creationix: tjholowaychuk: is that V8 source? [17:14] tjholowaychuk: yup [17:14] tjholowaychuk: from apinatives.js [17:14] tekky has joined the channel [17:15] creationix: strange quasi js [17:15] tjholowaychuk: yeah they have a special % prefix thing for interfacing with c++ [17:15] creationix: I should really re-read the ecma5 spec some day, I think I'd absorb a lot more this time around [17:15] tjholowaychuk: the parser has an alternate mode [17:15] micheil: I sure hope this new parser works >_> [17:15] tjholowaychuk: ive never read it haha I just look at source [17:15] micheil: and by works I mean: doesn't have random unreproducable bugs [17:16] creationix: well, I'd read v8 too, but it's a LOT more reading [17:16] zorzar: isaacs: i'm still not sure if i like the aproach of language specific package managers but i'll live with it for now [17:16] ph^ has joined the channel [17:16] zorzar: isaacs: besides that npm seems to be pretty cool [17:16] Twelve-60 has joined the channel [17:17] creationix: zorzar: what would you rather have? platform specific package managers? [17:19] zorzar: creationix: packages for my os' package manager yeah [17:19] bartt has joined the channel [17:19] digitaltoad has joined the channel [17:19] isaacs: creationix, zorzar: npm really IS a platform-specific package manager. [17:19] isaacs: where platform == node [17:19] zorzar: isaacs: yeah but node isn't my os [17:19] isaacs: you *can* install bash or perl or c programs with it. anything that has a package.json [17:19] zorzar: isaacs: and package management is something my os should do [17:20] creationix: zorzar: sure, but who is going to maintain that. I mean the node people aren't going to manage package systems for every possible os platform out there, and os vendors don't care enough about node to built it [17:20] isaacs: zorzar: it'd be nice if any OS did package management well. [17:20] zorzar: isaacs: yeah and i don't think that's cool [17:20] isaacs: zorzar: what's not cool? installing non-js things wiht npm? [17:20] isaacs: or that on OS does package management well? [17:21] isaacs: s/on/no/ [17:21] halfhalo: ACTION grabs some popcorn [17:21] csullivan__ has joined the channel [17:21] zorzar: isaacs: i know at least one os that does package management pretty fine at least with the distro i use ;) [17:21] isaacs: sure, i suppose that's not quite fair. no OS does dependency management well. [17:21] zorzar: and yeah if it's a "platform specific" package manager it shouldn't install stuff that isn't platform specific [17:22] isaacs: zorzar: by platform-specific, that just means "you have to have node to use this program" [17:22] bruse: zorzar: node libs will get added to your platforms package libraries if they get popular enough [17:22] bruse: don't worry [17:23] creationix: I used to do ruby and python before that [17:23] isaacs: bruse: if history is any indication, no, they won't [17:23] halfhalo: ACTION points out that ruby gems are not in most os specific package managers [17:23] creationix: I NEVER had luck with debian packages for either python or ruby libs [17:23] proppy: mjr_: http://github.com/proppy/node/commit/52a55f210b72ce442cd8f15705c0828be123b9ef [17:23] isaacs: bruse: yum install pear ; pear install symfony [17:23] bruse: isaacs: so everyone will just package all their deps when they build packages for apt or something then? [17:24] jesusabdullah: ubuntu packages for python work okay, sometimes [17:24] isaacs: bruse: no, they'll just package npm for apt, and then use that [17:24] jesusabdullah: though I usually use pip for stuff [17:24] isaacs: bruse: just like they do with rubygems and pear and cpan and pip [17:24] bruse: ok [17:24] jesusabdullah: What's pear for? [17:24] zorzar: jesusabdullah: php [17:24] isaacs: pear is the php installer thingie [17:24] halfhalo: stupid debian rubygems with gem update --system disabled... [17:24] bruse: i install php packages through apt though [17:24] jesusabdullah: Pretty sure I still have python 2.6 though, which is a bit of a bummer [17:25] zorzar: i just see how people use gems for stuff that isn't just a ruby library and i think that's wrong [17:25] proppy: mjr_: should I send a mail to the ml or a pull request throught github ? [17:25] mjr_: proppy: LGTM, but ryah is the only committer. Send that patch to the mailing list. [17:25] stephenjudkins has joined the channel [17:26] jetienne: in my opinion, the question is more "how come everybody is doing its own package management ?" seems like nobody is willing to reuse other works [17:26] zorzar: i use os packages for python libs i install and i like that [17:26] mjr_: proppy: the dev ml is the right place. [17:26] jetienne: even != linux distro use != package managements :) [17:26] isaacs: proppy: mailto:nodejs-dev@googlegroups.com [17:26] mjr_: proppy: Subject: [PATCH] emit error on listen failure [17:26] mjr_: or something like that [17:27] isaacs: git format-patch, email the file as an attachment [17:27] zorzar: jetienne: well i think it's ok that different distributions have different approaches for installing software [17:27] jetienne: zorzar: i dunno any difference between their package managements [17:28] zorzar: jetienne: there are a lot [17:28] jetienne: zorzar: give one ? [17:28] proppy: mjr_: isaacs mail sent to the ml, thanks for the guidline [17:28] zorzar: jetienne: debians packages are precompiled, gentoos packages aren't [17:28] proppy: subject 'net listen should emit eaddrinuse error [17:28] proppy: ' [17:29] jetienne: zorzar: debian source package exists. gentoos binary packages exists [17:29] halfhalo: ACTION has an issue with rubygems. If a gem needs another gem to build then instead of just crashing and burning INSTALL THE DAMN GEM! [17:29] jetienne: zorzar: where is the diff ? [17:29] sprout has joined the channel [17:29] proppy: see you [17:29] proppy has left the channel [17:29] halfhalo: ACTION looks at mkmf [17:30] CrabDude has joined the channel [17:30] creationix: tjholowaychuk: added constructor links, works great now https://gist.github.com/49d0ef4962197b44d16d [17:30] zorzar: jetienne: that debian's default packages are compiled and you can get the sources. with gentoo the default way is to compile packages that suit your USEflags [17:30] creationix: yay for not teaching lies [17:30] tjholowaychuk: creationix: woot :D [17:31] creationix: I'm not happy with the Object.create line, but I'm not sure of a more elegant way to do that [17:31] pgriess has joined the channel [17:31] zorzar: jetienne: isn't that a difference? [17:31] jetienne: zorzar: this is one line in one config file. both packages system can perform the same features [17:31] jetienne: zorzar: not a diff in a pacakge system. just a diff is a config file [17:32] creationix: archlinux ftw! [17:32] zorzar: jetienne: so USEflags exist in debian? [17:32] zorzar: creationix: yeah ;) [17:32] halfhalo: Windows FTW!!! Wait.... [17:32] creationix: ACTION kicks halfhalo  [17:33] Ori_P has joined the channel [17:33] halfhalo: hehehe..... [17:33] benv has joined the channel [17:33] creationix: anyway, back to writing my article, hopefully I get it done today [17:33] jstemmer has joined the channel [17:36] q_no has joined the channel [17:43] sanderjd has joined the channel [17:43] sanderjd has left the channel [17:43] hsuh has joined the channel [17:44] tmpvar: with the dx10/11 stuff in gallium, I hope to never have to use windows again [17:44] creationix: who here has extensive experience in prototypal inheritance and oo design? [17:44] creationix: This really doesn't seem ideal https://gist.github.com/e96c85b7889a3e6c8551 [17:44] elijah-mbp has joined the channel [17:45] creationix: the rectangle/square example seems biased towards constructor patterns [17:45] creationix: I would like a different use case where pure prototypes would be ideal [17:46] bradleymeck: mmm [17:47] creationix: the constructor gives you a lot of power to encapsulate all kinds of ugly [17:47] bradleymeck: creationix the way to really make prototypal stand out is a. class variables, b. multiple types from a parent type [17:47] creationix: with pure prototypes it's all out in the open, can't hide much [17:47] bradleymeck: and speed gain oh god on large constructions [17:47] wink_: car -> make -> model? [17:48] creationix: the thing is that plain javascript constructor functions are almost pure prototypes [17:48] creationix: they just add this nice setup step [17:48] agnat has joined the channel [17:49] creationix: and Object.create is really verbose [17:49] creationix: bradleymeck: speed gain? new is much faster than object.create in V8 [17:50] bradleymeck: ah, new is, but that means you arent using .prototype / mixing in much [17:50] bradleymeck: give something 20 properties with those 2 and bench [17:50] creationix: hmm [17:50] bradleymeck: granted lookups of existing properties will cost more [17:51] bartt1 has joined the channel [17:52] micheil: debugging massive buffers is seriously not fun. [17:52] bradleymeck: v8: var a=Object.create({b:1});a.b=2;delete a.b;a.b //but use of defaults can be nice [17:52] v8bot: bradleymeck: 1 [17:52] zemanel has joined the channel [17:52] bradleymeck: agreed on the debugging [17:52] micheil: can anyone see anything wrong with this? http://gist.github.com/613774 [17:53] micheil: I see to have the parser get reset before all the data has come in. [17:53] bartt2 has joined the channel [17:57] creationix: I with js had a construct like this [17:57] creationix: {Rectangle width: 6, height: 4} [17:57] creationix: where it's an object literal, but the __proto__ is Rectangle [17:57] creationix: I could pretty easily write a pre-processor that does that [17:58] bradleymeck: you with js had? [17:59] creationix: *wish [18:00] creationix: would someone be interested in a pre-processor like that? [18:00] creationix: it could translate to an Object.create call and preserve line numbering [18:00] creationix: also maybe add aliases like ƒ for function [18:01] bradleymeck: mmm wouldnt be hard to preprocess, but then we would need to preprocess js, and accidental omissions could be an issue {foo/*oops meant to be a mapping*/\n x:,y:2,z:3} [18:01] creationix: mapping? [18:01] bradleymeck: "foo" to a value {foo:bar} [18:01] creationix: ahh [18:01] creationix: well, that's not terrible is it? [18:02] bradleymeck: no, but should be noted [18:02] creationix: it will likely give a run time error since foo wasn't defined [18:02] creationix: so you'd find the error pretty quick [18:02] bradleymeck: as long as foo was undefined :) [18:02] tjholowaychuk: creationix: you will run into edge cases unless you parse the entire grammar [18:02] pablort has joined the channel [18:02] tjholowaychuk: for example in strings [18:02] tjholowaychuk: unless you have crazy regexps [18:02] bradleymeck: strings are easy to resolve out [18:03] creationix: no, I think a simple state machine will do [18:03] bradleymeck: labels are going to be evil though [18:03] streampu_ has joined the channel [18:03] tjholowaychuk: just sayin, doomed from the start :p [18:03] creationix: well, the ƒ alias is easy :P [18:03] tjholowaychuk: yeah but why bother [18:03] bradleymeck: hehe [18:03] creationix: why not [18:03] tjholowaychuk: why not just use js as js [18:04] creationix: is there a way in node to hook up a pre-processor to require? [18:04] tjholowaychuk: creationix: yup [18:04] tjholowaychuk: it was registerExtension() i think before [18:04] tjholowaychuk: and now it is register() i think [18:04] creationix: well, that's not the same thing [18:04] creationix: I want plain js files to be pre-processed and still use the normal js parser afterwards [18:05] creationix: I guess changing the extension isn't a terrible idea though [18:05] tjholowaychuk: ohh [18:05] tjholowaychuk: yeah I would not use .js [18:05] mjr_: Isn't that what coffeescript does? [18:05] creationix: mjr_: I guess so, hmm [18:06] creationix: it all translates to js in the end [18:06] creationix: too bad we can't just patch v8's tokenizer and parser at run-time [18:06] creationix: that would be fun [18:07] dpritchett has joined the channel [18:07] matt_c has joined the channel [18:07] creationix: then I wouldn't have to re-implement half the language just to add in a small change [18:07] mjr_: I've noticed an odd thing lately. I find myself looking at the node source code more than looking at the documentation. [18:08] mjr_: Is that because the docs are bad, or just because my problems are hard? [18:08] creationix: mjr_: both [18:08] creationix: the docs actually aren't that bad, just really hard to read [18:09] mjr_: Knowing where things are in the source code is really useful, but it seems kind of strange to keep looking in there. [18:10] Gruni has joined the channel [18:11] creationix: I suppose if you have to go to the source to understand how to do something, then that's a problem with the docs [18:11] creationix: nobody who's simply using node should have to read the source code [18:11] franksvalli has joined the channel [18:11] creationix: though sometimes it really helps [18:11] mjr_: it is kinda fun [18:12] creationix: I read v8 source sometimes, and others I read the ES5 spec [18:12] Anti-X: the docs should be updated a bit [18:13] creationix: so from a "are the docs as good as they should be" point of view, then yes, it's a problem [18:13] creationix: but that doesn't mean there is anything wrong with you reading source [18:13] nroot7 has joined the channel [18:14] nerdEd has joined the channel [18:14] creationix: s/should be/could be/ [18:15] tpryme has joined the channel [18:18] matt_c_ has joined the channel [18:19] codetonowhere has joined the channel [18:19] d0k has joined the channel [18:21] franksvalli has joined the channel [18:21] LowValueTarget has joined the channel [18:23] DozyPieman has joined the channel [18:24] overra has joined the channel [18:29] mif86 has joined the channel [18:31] micheil: hmm.. I think I need a writeQueue in this new parser.. anyone have any ideas on how to best write one? [18:32] micheil: in the sense that calling: parser.write(buffer) [18:32] micheil: will not actually handle the buffer, but instead just push it to a queue [18:33] kjeldahl has joined the channel [18:33] brodyberg has joined the channel [18:34] brodyberg has left the channel [18:37] Ori_P has joined the channel [18:38] Druide__ has joined the channel [18:38] dipser_ has joined the channel [18:39] dpritchett: socket.io has some of that, look at the bottom of this page: http://github.com/LearnBoost/Socket.IO-node/blob/master/example/server.js [18:39] bradleymeck: micheil, why do you need a queue? [18:39] micheil: bradleymeck: because, write() doesn't seem to block. [18:39] hsuh has joined the channel [18:39] rnewson has joined the channel [18:40] Sami_ZzZ has joined the channel [18:40] themiddleman has joined the channel [18:40] micheil: bradleymeck: basically I can make two large frames collide. [18:40] bradleymeck: didnt creationix have an expanding array that could compact / had modulo wrapping [18:40] micheil: with very big ease. [18:40] technoweenie has joined the channel [18:40] micheil: technoweenie: howdy. [18:41] technoweenie: micheil: i'm not your buddy, pal! [18:41] micheil: alrighty. [18:41] technoweenie: (reddit/southpark meme) [18:41] micheil: >_> [18:42] technoweenie: sup [18:42] micheil: working on a websocket parser [18:42] micheil: and having loads of issues. [18:42] technoweenie: so i hear [18:42] technoweenie: my riak parsers having issues too. sigh [18:43] micheil: yeah, I have one bug which happens randomly, but seems to not be happening at the moment [18:43] micheil: and another which is where the write() calls collide with parsing [18:44] ajpiano has joined the channel [18:45] creationix: bradleymeck: you talking about my fast queue? [18:45] bradleymeck: i guess if thats what it was called :) [18:46] micheil: creationix: what were the use cases? [18:46] creationix: I had a queue that could handle lots of push and shift calls without ever slowing down [18:46] creationix: regular arrays really suck at queueing large lists [18:48] kevwil has joined the channel [18:48] micheil: so, with fast queue, I could push and shift items from it very fast? [18:48] sanduz2 has joined the channel [18:48] creationix: you can push 1,000,000 items and then shift 1,000,000 times very quickly [18:48] creationix: can't do that with plain arrays [18:50] micheil: k [18:50] micheil: creationix: was there a version that was separate from patterns? [18:50] creationix: for example: [18:50] creationix: a = [];for(i=0;i<1000000;i++){a.push(true)};while(a.pop()){} [18:50] creationix: micheil: it's pretty easy to port to plain constructors [18:50] micheil: okay [18:50] creationix: pop is fast, but change that for a shift and it will never finish [18:51] micheil: wow. [18:51] micheil: well, yeah, fast queue definitely looks useful. [18:52] creationix: just make sure to make your consuming loop use shift() to find the end and not .length [18:52] creationix: otherwise the internal arrays will never get 100% cleaned [18:52] micheil: yeah [18:53] aubergine has joined the channel [18:55] micheil: hmm.. that does look like an easy port. http://gist.github.com/613878 [18:56] halogenandtoast has joined the channel [18:57] micheil: creationix: what's the license on the code? [18:57] mjr_: micheil: I adapted it here: http://github.com/mranney/node_redis/blob/master/index.js#L294 [18:57] programble has joined the channel [18:57] programble has joined the channel [18:57] micheil: mjr_: right. [18:57] creationix: micheil: it's MIT, but I won't make mjr_ link back to mine [18:58] micheil: k, I'm just putting in a quick comment at the top noting who originally wrote it and where it came from [18:58] creationix: I wish there was a license like MIT that didn't require attribution for honest people [18:58] ooooPsss has joined the channel [18:58] micheil: wow. the sun is rising late today... [18:59] creationix: now any code snippet on howtonode.org is public domain [18:59] creationix: micheil: wow, you get up early over there [19:00] Egbert9e9 has joined the channel [19:00] creationix: so how is Thursday looking so far [19:00] micheil: creationix: ... I haven't slept yet. [19:00] micheil: thursday's looking kinda crap unless I can work out the kinks in this new parser. [19:00] creationix: hopefully the day gets better before it makes it over here [19:01] micheil: I'm guessing sunrise will be 6.50am, instead of 5.50am it was last week, because we changed to GMT + 11 or +9 [19:01] hoodoos has joined the channel [19:01] joncurra has joined the channel [19:02] matt_c has joined the channel [19:03] hoodoos: guys, if somebody's looking for mysql client this one is the most fast I found: http://github.com/Sannis/node-mysql-libmysqlclient [19:03] micheil: hoodoos: felixge's will be. I'm pretty sure on that. [19:03] micheil: either that, or that one there isn't non-blocking or something [19:03] hoodoos: micheil, this one is written in c =) [19:04] creationix: written in c doesn't always mean faster [19:04] creationix: usually though [19:04] hoodoos: creationix, yeah, it should be faster with equal curcumstances :) [19:04] muk_mb has joined the channel [19:05] hoodoos: *damn word, too complex for me to write correctly :) [19:05] creationix: hoodoos: not really, there are advantages that js has over a static compiler [19:05] chewbran1a has joined the channel [19:05] creationix: besides, inside node, c objects have to be wrapped to be usable from js [19:05] creationix: js compiles to assembly at runtime using runtime knowledge [19:06] creationix: one of my main goals with node is to make it possible to write pure-js modules that compete with c modules in performance [19:06] hoodoos: creationix, that would be very nice ofcause, but there's always such overhead as V8 itself, no? :) [19:07] Neura has joined the channel [19:07] creationix: hoodoos: right, but in any node system, you've got that [19:07] creationix: so c-extensions to node aren't always faster than js modules to node [19:07] hoodoos: creationix, i really hope it's true [19:07] creationix: especially when most the work is IO related [19:08] creationix: node's network stack is nice [19:08] mjr_: V8 is astoundingly fast [19:08] tpryme has left the channel [19:08] hoodoos: so mysql nodejs client has nice chances to be equal fast or maybe faster :) [19:08] hoodoos: because there's network operations mostly [19:08] creationix: now if you want to calculate 1000 PI digits, then you'd be better off with c [19:09] hoodoos: okay, i got it :) [19:09] creationix: for some reason V8 isn't very good at that one [19:09] bradleymeck: ACTION waves fist at the ecma gods for their screwy math requirements [19:10] micheil: creationix: with fast queue, is it okay to still access the length property every now and then? [19:10] creationix: bradleymeck: yeah, that makes it hard to optomize [19:10] micheil: like, console.log it. [19:10] creationix: micheil: sure, it's not terrible slow, just make sure to call shift at the end [19:10] mqt has joined the channel [19:10] creationix: it's fine to use length anywhere except the while loop for consuming the queue [19:11] micheil: okay [19:11] creationix: though, actually if you're using a syncronous while loop, then a plain for(;;) loop might be faster than lots of shifts [19:11] creationix: depends on your use case [19:12] brianmario has joined the channel [19:12] bradleymeck: i mean, lua beats the pants off js at math and that shouldnt be true [19:13] pedrobelo has joined the channel [19:14] micheil: wtf. [19:14] mjr_: creationix: just saw you preso on node community. Looks pretty good. [19:14] micheil: the bug's disappeared again./ [19:14] micheil: :( [19:14] mjr_: creationix: number one howtonode city is London? [19:14] creationix: mjr_: yeah, strange [19:14] mjr_: I would have figured SF for sure [19:14] micheil: mjr_: preso? [19:14] creationix: I know like 3 people who actually live in london [19:14] creationix: micheil: creationix.com/what-does-node-need-from-us.pdf [19:15] micheil: this bug is sooo fricking annoying. [19:15] hoodoos: 9.2 mbs of needs? :) [19:15] bradleymeck: of pdf [19:15] creationix: I've got creationix.com serving files using fs.sendfile now, it's fast [19:15] creationix: thanks to code from Tim_Smart [19:16] V1 has joined the channel [19:16] 77CABBJDL has joined the channel [19:16] admc_ has joined the channel [19:16] admc has joined the channel [19:17] hoodoos: god bless all of you guys :) [19:18] ph^ has joined the channel [19:18] hoodoos: (any god you prefer really) [19:18] EyePulp: using socket-io-node - is there a way for me to get a specific client object if I know its sessionId? [19:20] micheil: creationix: good preso, thanks for sharing. [19:20] micheil: EyePulp: yes [19:20] creationix: micheil: :D [19:20] micheil: EyePulp: let me recall how though. [19:20] micheil: socket.clients[client id].send('some string'); [19:21] micheil: given: var socket = io.listen().on(...); [19:21] matt_c: ACTION finds himself referring to http://github.com/LearnBoost/Socket.IO-node/blob/master/lib/socket.io/listener.js#L83-90 a lot. [19:22] micheil: matt_c: ya, the source code helps [19:22] micheil: the mailing list is also good [19:22] micheil: rauchg_ is also good. [19:22] micheil: (when he's about & not busy) [19:23] bartt has joined the channel [19:24] EyePulp: micheil: danke [19:24] micheil: EyePulp: no worries :) [19:25] ajpiano has joined the channel [19:25] richcollins has joined the channel [19:27] micheil: creationix: I think fastqueue fixed one of my issues. [19:27] micheil: and the other one is no longer occuring [19:28] bradleymeck: hidden relationship? [19:28] MikhX has joined the channel [19:29] rubenfonseca has joined the channel [19:29] creationix: micheil: sweet [19:29] mjr_: micheil: sounds like you get to sleep then [19:29] rubenfonseca: hi @all, how can I close a http client connection ? say I'm connection to a twitter stream, but I want to end the connection [19:29] MikhX has joined the channel [19:30] mjr_: rubenfonseca: you need to destroy() it [19:30] rubenfonseca: mjr_: humm never saw it on docs :/ is it a ClientResponse method? [19:30] hoodoos: btw, is there any image manipulation libs for node? [19:31] mjr_: rubenfonseca: it's on the client itself, I believe [19:31] ryan[PRE] has joined the channel [19:31] rubenfonseca: mjr_: ok, let me try it :) [19:32] mjr_: rubenfonseca: it's in there somewhere. Just sys.inspect() what you've got until you find the thing that has destroy on it. [19:32] dshaw: hoodoos: http://github.com/ry/node/wiki/modules#graphics [19:33] hoodoos: thanks [19:33] rubenfonseca: mjr_: it worked woot!!! thank you!!! [19:33] hoodoos: oh man I always forget to look in modules.. [19:33] dshaw: :) [19:33] benreesman has joined the channel [19:33] hoodoos: i even tried google, really :)) [19:33] derferman has joined the channel [19:33] benreesman: sannis in the house? [19:34] mjr_: node's common name makes it hard to google for. [19:34] ryan[PRE] has left the channel [19:34] cloudhead has joined the channel [19:34] bradleymeck: nodejs generally works, or node javascript [19:35] robotarmy has joined the channel [19:37] ryan[LOL] has joined the channel [19:37] bradleymeck: lol? [19:37] antares_ has joined the channel [19:37] Gurpartap: ? [19:37] ryan[LOL]: yes. lol. [19:37] Gurpartap: k [19:37] justin__ has joined the channel [19:37] ryan[LOL]: laughin' out loud bro [19:38] mAritz: ROFL [19:38] Gurpartap: kk [19:38] Gurpartap: :p [19:40] mAritz: how do you guys manage deamonizing node apps? i was using monit to automatically restart and stuff, but that somehow stopped working and i already spent 2 hours looking for the problem - without success... :x [19:40] justin__: so i'm running code coming from a client with "Script.runThisInNewContext", but when I "eval" something in my client code, it doesn't seem to have access to globals defined previously by the client code [19:40] justin__: any ideas what's going on there? [19:40] mAritz: newcontext = new context [19:40] bradleymeck: its a new context, new global area [19:40] technoweenie: mAritz: loook at fugue [19:40] micheil: benreesman: sannis.. as in the github-spider project? [19:40] mAritz: technoweenie: i will, thanks :) [19:41] benreesman: don't know about that, i'm working with the mysql lib [19:41] justin__: yeah, i understand... so let's say by client script is " A = 1 eval('A = 2')" [19:41] technoweenie: mAritz: http://github.com/pgte/fugue/wiki/Why-does-Fugue-exist%3F [19:41] justin__: actually, let's go with "A = 1 eval('A = A + 1') [19:41] digitaltoad has joined the channel [19:41] justin__: tells me A is undefined [19:42] justin__: if i run that as the input to runScriptInNewContext [19:43] bradleymeck: process.binding("evals").Script.runInNewContext("A=1;eval('A=A+1')") working fine here [19:43] bradleymeck: the semicolon? [19:43] justin__: no, that was just an example.... apparently I'm full of it, though there is a more complex case I can't get working [19:43] bootlaces has joined the channel [19:43] bootlaces has joined the channel [19:44] justin__: let me hack on it a little more... [19:44] bradleymeck: there is probably some logic hiccup [19:44] mAritz: justin__: yes, that's because runInNewContext creates a new context which does not have the same globals as where you're calling runInNewContext from. you'd either have to use eval or provide the stuff you want access to as the new context. [19:45] dahankzter has joined the channel [19:45] justin__: mAritz: I understand, i just want it to have access to the globals in its sandbox when i eval stuff in the sandbox... which does work in my trivial example, but not in the code I actually have, which now implies i have other problems [19:46] mAritz: you eval something in a sandbox? :D [19:46] ryan[LOL]: the old sandbox'in and eval'in trap [19:46] ryan[LOL]: something is amiss [19:46] justin__: mAritz: yup :) [19:47] mAritz: uarg... [19:47] mAritz: ACTION runs [19:47] ryan[LOL]: justin__ quick question, what is being parsed/rendered/whatever that is making you want to go to a sandbox [19:47] justin__: ryan[LOL]: JS template [19:47] justin__: usually rendered client side [19:48] justin__: but there are times when we want to render them server side [19:48] justin__: i could just use eval [19:48] justin__: but it feels so dirty [19:49] ryan[LOL]: i see [19:49] mAritz: technoweenie: do you know whether fugue works with express? [19:49] mAritz: (should, right?!) [19:49] technoweenie: no but i dont see why not [19:50] ryan[LOL]: i'm not sure what you mean by a JS template exactly [19:50] tjholowaychuk: mAritz: the Express server inherits from http.Server so it should work with anything compatible [19:50] mAritz: awesome, thanks. :) [19:50] ryan[LOL]: when i hear "JS Template" that could mean a million things [19:51] ryan[LOL]: that you're treating JS as some sort of document presentation language and intersplicing in your various stuff with it [19:51] ryan[LOL]: a data structure template for some metaprogramming type things [19:51] justin__: yeah, basically we're compiling a template language to a JS function [19:51] justin__: I'll open source it at some point [19:52] ryan[LOL]: ok and you're rendering it in a sandbox to make sure it doesn't do anything wacky right [19:52] justin__: right [19:52] justin__: cause you can just execute arbitrary JS [19:52] hsuh_ has joined the channel [19:52] ryan[LOL]: ok you've run into an issue because once you eval() something you can't ever be certain of its state or that it will ever even return [19:53] justin__: no, the issue is that something wacky is going on with my sandboxed scope.... still tracking it down though [19:53] karboh has joined the channel [19:54] stagas has joined the channel [19:55] ryan[LOL]: ok well one way you could approach it is to treat the globals you want to keep as a structure like a stack or hash or what have you [19:55] ryan[LOL]: so instead of doing like [19:55] ryan[LOL]: var a = 1; [19:55] ryan[LOL]: you'd do something similar to myglobals.push("a",1); [19:56] ryan[LOL]: then you would do something like var myworkingvar = getglobal("a"); [19:56] sh1mmer has joined the channel [19:56] ryan[LOL]: then you could have a routine like export [19:56] ryan[LOL]: which would generate an eval()'able copy of its internals [19:57] ryan[LOL]: i don't understand your approach but this is the best advice i can give as far as trying to get it abstracted enough to rig together [19:57] justin__: yeah, that might work [19:58] isaacs: polotek++ [19:58] v8bot: isaacs has given a beer to polotek. polotek now has 1 beers. [19:58] isaacs: :D [19:58] olauzon has joined the channel [19:59] bradleymeck: ryan i did notice something odd, you can delete x created by 'var x' in the runInNewContext, but it shouldnt be deletable? [19:59] joncurra has joined the channel [19:59] ajpiano has joined the channel [19:59] micheil: fffuuu... the bug reappeared. [19:59] creationix: I thought delete for free variables was undefined behavior [20:00] micheil: http://gist.github.com/613968 [20:00] derferman has joined the channel [20:00] ryan[LOL]: justin__ you're starting to jump into a dense territory [20:00] ryan[LOL]: which is how to build fault tolerant software [20:00] bradleymeck: delete of global vars is ok, local vars in global scope? *checks spec* [20:01] jpld has joined the channel [20:01] jpld has joined the channel [20:02] micheil: creationix: with that error, do you think I should just try / catch it? [20:03] micheil: because it's a very big fringe case. [20:03] creationix: micheil: eww, that's a nasty one [20:03] micheil: packets > 30,000 bytes [20:03] creationix: what's causing it [20:03] micheil: no idea. [20:03] justin__: interesting, 'global' isn't defined in the new context... so it's just a raw v8 context, I take it [20:03] micheil: I can't really stack trace it. [20:03] micheil: I have no way to recreate or debug it reliably. [20:04] micheil: I think i'll get tim_smart to look at it. [20:06] ryan[LOL]: justin__ in the future you might take a look at how some other environments (especially erlang) have handled the issue you are talking [20:06] ryan[LOL]: about. [20:07] micheil: creationix: the bad part though? The old parser was fault tolerant of that. [20:07] creationix: yeah, that's not good [20:07] ryan[LOL]: what you're basically doing is creating jailed processes and analyzing their states/sending them data/receiving [20:07] dxld has joined the channel [20:08] micheil: but this new parser is certainly going to be better when it all works. [20:08] justin__: yup [20:08] bradleymeck: creationix seems any delete not on an object is ill defined [20:08] ryan[LOL]: and that is an area where if you tread lightly it will come back to bite [20:08] devinus has joined the channel [20:08] ryan[LOL]: http://www.erlang.org/download/armstrong_thesis_2003.pdf [20:08] devinus: when was node.js first announced to the world? [20:08] ryan[LOL]: this is an excellent paper and most of the concepts in there have nothing to do with erlang [20:09] justin__: well, i generally trust the code, so i'm not too worried about it... yeah, i've read it [20:09] justin__: it's very good [20:09] ryan[LOL]: ok [20:09] DrunkDwarf has joined the channel [20:09] ryan[LOL]: just as long as you're prepared :) [20:09] creationix: bradleymeck: yeah, that's what I remember [20:09] bradleymeck: in crockford mode it throws errors [20:09] tzmartin has joined the channel [20:10] justin__: this article is a pretty awesome overview of how delete should and actually does behave: http://perfectionkills.com/understanding-delete/ [20:10] justin__: required reading i think for hardcore JS folks [20:10] ajpiano has joined the channel [20:10] micheil: wooo! I can reproduce it. [20:11] micheil: send to massive packets one after each other [20:11] micheil: conn.send(pkt); [20:11] micheil: conn.send(pkt); [20:11] micheil: where pkt is of 1024*1024 length [20:12] creationix: justin__: yep, I've read that one [20:12] seanouimet has joined the channel [20:13] mAritz: so what exactly does the daemonize option of fugue do? (it's awesome btw :) ) [20:13] micheil: I wonder what would happen if I sent 1 Gb of data to.. say pusherapp? [20:13] kuya: what options do i have for defining property getters/setters in node? [20:14] rcy has joined the channel [20:14] ryan[LOL]: i wasn't really aware that you could even use "delete" in js [20:14] ryan[LOL]: probably does nothing more than hint the garbage collector [20:14] hannesw has joined the channel [20:15] bradleymeck: justin__ interesting but i still didnt figure out why repl follows non-eval rules and runinnewcontext does [20:16] bradleymeck: ryan yes, it is useful if you need to get rid of things in a set that is really long lived / need to have x in y become false [20:17] ryan[LOL]: ok [20:17] ryan[LOL]: usually i just redefine [20:17] ryan[LOL]: and let god sort 'em out [20:17] ryan[LOL]: ;d [20:17] bradleymeck: better for most use cases in v8 to reassign [20:18] ryan[LOL]: maybe i can see using delete if you're rapidly creating large structures and you need fast operation [20:18] ryan[LOL]: like a framebuffer for a game [20:18] ryan[LOL]: it might be better to incur a small predictable hit [20:18] ryan[LOL]: than to let things accumulate and then lag the game out for a second or two [20:20] wink_: screw deterministic behavior, random stutters give your game character! :) [20:20] zemanel has joined the channel [20:21] bradleymeck: ryan[LOL] in v8 deleting a property is a costly operation [20:21] bradleymeck: it swaps out some hidden classes on objects [20:21] ryan[LOL]: yeah [20:21] ryan[LOL]: i don't think i've ever used "delete" even once in js [20:21] bradleymeck: i have a few times [20:22] ryan[LOL]: what was the reason? [20:23] cognominal has joined the channel [20:23] ThePub has joined the channel [20:23] bradleymeck: umm i can dig them up [20:24] tjholowaychuk: ryan[LOL]: arm delete http://gist.github.com/614011 [20:24] bradleymeck: but generally for long lived structures and object keyed dictionaries [20:24] tjholowaychuk: does quite a bit [20:25] bradleymeck: oh, and if you modify dom with the dot operator in ie6 [20:25] streampunk has joined the channel [20:25] V1: Is it "common" for node to spam the log with a load of ECONNRESET issues after each other? I can understand if it happens once in a while.. But not in bursts like this: http://gist.github.com/614008 . Yes they captured by my on("error") event. But still.. It's odd to see it happen in my error log.. [20:26] blowery has joined the channel [20:26] c4milo has joined the channel [20:27] aconbere has joined the channel [20:28] bootlaces has joined the channel [20:28] bootlaces has joined the channel [20:29] dmcquay has joined the channel [20:29] shockie has joined the channel [20:30] EyePulp: anyone using mongoose and happen to know how I do a .find() on sub object properties? .find( {foo.bar:true} ) ? or do I need to quote the keyname if it's got a dot-notation? [20:31] claudiu_ has joined the channel [20:31] rauchg_: EyePulp: [20:31] rauchg_: 'foo.bar': true [20:31] rauchg_: just like in the mongodb console [20:32] EyePulp: rauchg_: gotcha - I'm still learning my way around the console... and mongo... and node & mongoose =) [20:32] EyePulp: slowly but surely. [20:32] MikhX has joined the channel [20:32] Evet has joined the channel [20:33] V1: argh, can't seem to figure out this last memory leak -_-! [20:34] EyePulp: rauchg_: I've been meaning to ask - under socket.io, when I do not use websockets or flashsockets as a transport, I notice the client code still tries to call the .swf resource. It's only fixed if I specify a window.WEB_SOCKET_SWF_LOCATION value [20:34] benreesman: best way to get libeio installed on "os x" [20:34] mAritz: this is weird: if i do "kill -USR2 " it doesn't restart fugue. at least not consistently. i believe one time it did restart it, but not the other 20 times :( [20:34] benreesman: ? [20:34] benreesman: not for building node, for building a module [20:34] ph^ has joined the channel [20:35] devinus: anybody know when node.js was announced? [20:35] micheil: not really [20:35] saikat has joined the channel [20:35] micheil: but it was started in February 2009, iirc. [20:35] ryan[LOL]: devinus it wasn't really announced [20:35] ryan[LOL]: it sort of crept into working alphas [20:35] micheil: anyway, night folks, it's 7:35am. [20:36] devinus: ryan[LOL]: interesting...i do remember when the cat was sort of let out of the bag [20:36] devinus: because overnight i started hearing everywhere about it [20:36] devinus: i thought that was the announcement [20:36] ryan[LOL]: word of mouth [20:36] devinus: hrm... [20:37] ryan[LOL]: it was great because it let people like me get into web app dev [20:37] ryan[LOL]: on a reasonable timeline [20:37] ryan[LOL]: before i'd be making stupid crap with c/c++ and my own vms and lua and it was not as clean [20:37] stagas_ has joined the channel [20:37] bradleymeck: ACTION wants lua bindings just for the math [20:37] ryan[LOL]: nor was it as fast [20:37] ThePub has joined the channel [20:38] sideshowcoder has joined the channel [20:38] ryan[LOL]: v8 is really, really nice [20:38] dilvie has joined the channel [20:39] Tim_Smart has joined the channel [20:40] bradleymeck: once the math computation speed is upped itll be amazing [20:40] creationix: devinus: jsconf.eu 2009 was when node really started to grow [20:40] creationix: so just over a year ago [20:40] devinus has left the channel [20:41] ceej has joined the channel [20:41] dilvie: I have a github-hosted lib I want to include in my project. Is there a way to tell git to track that repo for changes to the lib? [20:41] micheil: dilvie: git submodules [20:42] devinus has joined the channel [20:42] creationix: dilvie: yes, but you have to manually update the submodule when you want a new version [20:42] dilvie: micheil: Thanks a ton. =) Googling. [20:42] devinus: creationix: ah, so nov. 2009 [20:42] creationix: it point to a specific sha [20:42] dilvie: creationix: That's cool. =) [20:42] devinus: nice [20:42] dilvie: you guys are rockstars. [20:42] devinus: i was trying to place this idea i had independently of node [20:42] devinus: it was before i had heard about node [20:42] devinus: http://devintorres.com/post/455328585/javascript-the-fastest-dynamic-language [20:42] zorzar: devinus: there's a gitcast on submodule [20:42] zorzar: devinus: +s [20:42] creationix: I started with node summer 2009 [20:42] creationix: it was just starting to be stable enough to start writing small things [20:42] bradleymeck: i started around may and its been soo much fun [20:43] dilvie: I haven't been using git for very long... working on my first big project. [20:43] rauchg_: i started using node before ryah [20:43] rauchg_: those were rough times back then [20:43] bradleymeck: anyone interested in making a layout engine for js (containing blocks + units + relative v absolute)? [20:44] dilvie: btw, if anybody's interested, I'm writing a module that validates form inputs against an HTML5 page using the new validation features in html5. Works on both the client and server (using node for the server bits). [20:44] creationix: bradleymeck: http://github.com/creationix/topcloud/blob/master/lib/TC.js [20:44] dilvie: the node module isn't done yet.. planning to tackle it in a few days. =) [20:45] creationix: rauchg_: I'll bet [20:45] dilvie: makes heavy use of jQuery... does anybody have opinions about using jQuery with node? [20:45] f00li5h has joined the channel [20:45] hassox has joined the channel [20:45] bradleymeck: creationix, thats a whole lot of code [20:46] creationix: bradleymeck: it works in ie6 [20:46] creationix: otherwise it would be a lot smaller [20:47] ehaas has joined the channel [20:47] bradleymeck: yea... ie6 [20:47] TheEmpath: okay so i got a basic file server up... not using express yet, still learning the ropes. basically, you access the server and it transmit the contents of the public/client.html to the user, which established the socket,io connection to the server http://gist.github.com/614049 [20:47] TheEmpath: im curious what i do now [20:48] indexzero has joined the channel [20:48] zorzar: dilvie: just saw that: http://blog.nodejitsu.com/jsdom-jquery-in-5-lines-on-nodejs [20:48] amerine has joined the channel [20:48] indexzero: zorzar: sup [20:48] mAritz: technoweenie: does restarting fugue with kill -USR2 work for you? because for me it doesn't reload the code as I think it should... [20:48] bradleymeck: dilvie, i care more about working than how it got working [20:48] technoweenie: mAritz: i havent used fugue [20:48] mAritz: :( [20:49] TheEmpath: now i know i should have something like http://server:port/initialize as the client access point so that sokcet.io requests can be heard [20:49] mAritz: has someone here used fugue? [20:49] zorzar: indexzero: hmm? [20:49] TheEmpath: but im curious about the client itself.. how do i broadcast events? .send) [20:49] TheEmpath: .send()? [20:49] technoweenie: mAritz: ask on the node mailing list, or the github issues for that repo [20:49] indexzero: zorzar: nothin', just saw you drop that link to my article [20:49] tzmartin: developers/ [20:49] indexzero: isaacs: you around? [20:50] isaacs: indexzero: yo [20:50] zorzar: indexzero: ah :) i just found nodejitsu and am browsing around atm [20:51] bencc has joined the channel [20:52] mikeal has joined the channel [20:52] nsm has joined the channel [20:52] bencc has left the channel [20:52] dmcquay has joined the channel [20:53] bencc has joined the channel [20:53] bradleymeck: creationix, does that handle the off by 1px ie6 bug? [20:54] creationix: not sure what that is [20:54] creationix: I haven't touched it for over a year [20:54] tzmartin has left the channel [20:54] bradleymeck: in ie6 depending on aspect ratio for resolution absolutely positioned elemnts inside of relatives can be off by one px left or right [20:55] sechrist: hey creationix, what's the best way to cache a static html file in memory with connect/express? I'm bashing my node instance with ab and i'm running out of fds quickly [20:55] sechrist: so I assume it's not being cached with just use(cache()) [20:55] creationix: sechrist: cache defaults to a 0 length cache [20:55] creationix: but it should solve the fd issue [20:55] creationix: since concurrent requests share the same fd [20:56] hellp has joined the channel [20:56] creationix: I'm using Tim_Smart's sendfile module currently [20:56] sechrist: too many open files '/path/to/html/file' etc [20:56] creationix: it's so fast you don't need in-memory caching [20:56] tjholowaychuk: sechrist: check your ulimit too [20:56] margle has joined the channel [20:56] tjholowaychuk: unless someone said that already [20:56] sechrist: ! ulimit [20:56] sechrist: that's probably it! [20:57] Tim_Smart: creationix: sendfile already uses caching. [20:57] Tim_Smart: kernel level caching though. [20:57] sechrist: well I'm using staticprovider [20:57] sechrist: but on some routes it's res.sendfile('htmlfile') [20:57] creationix: sechrist: https://gist.github.com/e095c7fdbcbdbc72b152 [20:58] creationix: Tim_Smart: exactely [20:58] c4milo has joined the channel [20:58] creationix: by "in-memory" I meant in-node [20:58] ajpiano has joined the channel [20:58] creationix: ACTION loves abusing gists as mini git repos [21:00] sechrist: ulimit -Hn = 1024 [21:00] technoweenie: ha as long as you're not storing movies and shit in gist [21:00] sechrist: :| [21:00] matt_c_ has joined the channel [21:00] creationix: technoweenie: no, 5 small code files max [21:01] Tim_Smart: git add the_dark_knight.mp4 && git commit -m "<3" && git push [21:01] bradleymeck: i have lots of gists, wish they could be managed a bit better [21:01] hassox has joined the channel [21:02] creationix: mde: I should probably start heading up your way, I need to be there at 3 [21:05] nefD: that cloud9 JS ide is pretty nice [21:05] bradleymeck: http://macournoyer.wordpress.com/2008/09/02/ruby-on-v8/ ... is this still true? [21:07] creationix: hmm seems I missed the caltrain, oh well [21:07] sechrist: I missed the caltrain at milbrae the other day [21:07] sechrist: I was sad [21:07] bootlaces has joined the channel [21:07] bootlaces has joined the channel [21:08] javajunky has joined the channel [21:08] javajunky: evening/morning ;) [21:08] techwraith has joined the channel [21:08] javajunky: I don't suppose *either* a twitter platform dev is hanging around today, or someone better than me at OAuth is around ? [21:09] pquerna: i have implemented oauth. i don't know if that makes me qualified. [21:09] pquerna: javajunky: what specifically is the problem? [21:09] javajunky: probably more than me ;) [21:10] javajunky: Just had a bug raised against my client (github.com/ciaranj/node-oauth) … but as far as I can tell, Twitter is broken :( … which clearly can't be correct … it must be a bug in my code... [21:10] techwraith: Anyone have any experience using this? http://github.com/caludio/node.xmlrpc-c [21:10] javajunky: http://dev.twitter.com/pages/auth documents their signing… but as far as I can tell, that is *NOT* what either the 1.0 or 1.0A specs allow [21:11] techwraith: It seems like overkill - just trying to post to WordPress through node.js [21:11] stephenjudkins has joined the channel [21:12] pquerna: javajunky: yeah, i know less about oauth specifically with twitter, but i remember something about them not quite being oauth 1.x, and the complication of implementation is one of the big drivers for 2.0 [21:12] sideshowcoder has joined the channel [21:12] wink_: not that i have any experience with oauth, but i remember reading a large rant about their implementation sucking hard [21:12] wink_: their meaning twitter [21:12] javajunky: well its never really been an issue for me (or people using my client) [21:12] javajunky: but it appears to break for url parameters that contain a comma (,) [21:12] javajunky: ..which the new user-streams & site-streams stuff require [21:13] techwraith: So I guess my question is: Anyone have a good resource to figure out what data I need to post to WP's xmlrpc file? [21:13] Nevtus has joined the channel [21:14] dahankzter has joined the channel [21:14] techwraith: Not really node related I suppose. lol [21:19] dshaw: (crickets) [21:21] mAritz: how can it be that on my vps require.paths is undefined? [21:21] sechrist: creationix: 'undefined' is coming out of sendfile before my html :) hmm [21:21] tilgovi has joined the channel [21:21] sechrist: undefined is no longer supported (except in PM). Try v8: or v8> [22:06] rauchg_: hahahahha [22:06] rauchg_: v8 'kind of complex' [22:06] v8bot: rauchg_: v8 is no longer supported (except in PM). Try v8: or v8> [22:06] isaacs: v8: "kind of complex" [22:06] v8bot: isaacs: "kind of complex" [22:07] sh1mmer has joined the channel [22:07] ryah: so, next step is the writev madness [22:07] bradleymeck: ryah <3 [22:08] ryah: linked list of fd that have been written to, each having a linked list of string adn buffers to go out [22:08] ryah: in a ev_prepare handler it will try to push it all out [22:08] mjr_: I think write aggregation is going to make my app go a lot faster. [22:09] ryah: for strings it will attempt to use v8::String::Pointers [22:09] ryah: which will work for ascii strings.. JSON and such [22:10] mjr_: I find myself doing a lot of req.end(JSON.stringify(someobj)); [22:10] ryah: those v8::String::Pointer structs will just be massaged into iovecs [22:11] isaacs: ryah: turns out json isn't ascii, necessarily [22:12] ryah: in those cases they'll get bumped to the slow case [22:12] isaacs: v8: JSON.stringify("éüî") [22:12] v8bot: isaacs: ""\u00e9\u00fc\u00ee"" [22:12] isaacs: hah, that's not what v8 actually does, afaict, though [22:13] dylang: mikeal: so far it's working hitting http directly. could it be a bug in the request module? [22:15] derferman has joined the channel [22:17] mikeal: hrm..... [22:17] pedrobel_ has joined the channel [22:18] mikeal: add a print in there to see what the port/host/secure settings are [22:18] mikeal: and the headers [22:20] dylang: mikeal: it's making two requests - the first one is 443 'hire.jobvite.com' true, the second one is undefined, undefined, true [22:21] mikeal: wow [22:21] mikeal: does that return a forward? [22:21] dylang: mikeal: this is in the response header - could relative paths break request? location: '../Home/Dashboard.aspx?login=1' [22:21] mikeal: that server is an asshole [22:22] isaacs: v8: (""+(!!""))[(+"")]+([][+!!""]+"")[+!" "]+(({})+"")[+!""+(+!""<StreamCreator::StreamCreatorIterator>); [23:01] mikeal: there was a great quote [23:01] mikeal: "Twisted is like node.js in Java in Python" [23:02] mikeal: in C++ it's probably less code [23:03] jarfhy has joined the channel [23:04] mAritz: and some crazy bitflag shifting with pointers in a memory reference. (i have no clue what i'm talking about... does that show?) [23:05] bradleymeck: http://macournoyer.wordpress.com/2008/09/02/ruby-on-v8/ + rhino + dvorak jvm + qemu = win [23:05] kjy112 has joined the channel [23:06] aconbere has joined the channel [23:06] hassox has joined the channel [23:08] webr3 has joined the channel [23:13] dylang has joined the channel [23:13] Tim_Smart: Oh wow, heap snapshots in node-inspector will be super useful. [23:14] slashxr has joined the channel [23:15] sanderjd has joined the channel [23:16] sanderjd has left the channel [23:17] ysynopsis has joined the channel [23:18] sanduz2 has joined the channel [23:20] tjholowaychuk: Tim_Smart: does it work ok? he said it was buggy [23:20] tjholowaychuk: or something [23:21] Tim_Smart: It is pretty decent, still has rough edges though. (A bit intermittent) [23:25] cloudhead has joined the channel [23:27] Tim_Smart: tjholowaychuk: I'm just doing some performance testing of biggie-orm [23:27] tjholowaychuk: Tim_Smart: ah :) cool man [23:27] Tim_Smart: Might throw rapid in the mix, see how it goes :p [23:27] tjholowaychuk: sure lol its very incomplete though [23:27] tjholowaychuk: what is there is reasonably complete, but not much is there [23:28] EyePulp: okay, I got screwed up again... if I'm using socket.io - under node, how do I pull back a specific client, assuming I know the client sessionId? [23:28] Tim_Smart: Well, just basic model inserts / updates / deletions [23:28] tjholowaychuk: and no optimizations yet via indexing or anything so it will be slow in that regard [23:28] Tim_Smart: No associations etc. [23:28] EyePulp: do I have to loop through the io.clients array and do comparisons, or is their a more direct route? [23:29] fresch has joined the channel [23:29] Me1000 has joined the channel [23:32] Tim_Smart: tjholowaychuk: Interesting results with inserts only... [23:32] tjholowaychuk: Tim_Smart: yeah? [23:32] tjholowaychuk: I havent even really benchmarked it much [23:32] Tim_Smart: Might be the uid generation or something, but biggie was around 1 sec for 10k, 6sec for rapid. [23:33] tjholowaychuk: hm [23:33] tjholowaychuk: yeah could be all sorts of things, didnt get into optimizations yet [23:33] Tim_Smart: Mind you, I do optimise for collection saves [23:34] Tim_Smart: I'll try saving each model individually. [23:36] tjholowaychuk: yeah ~5 seconds for 10k [23:38] tjholowaychuk: im kinda to lazy to profile right now lol seeing as im not using it yet [23:39] tjholowaychuk: the merge() etc could be optimized a lot [23:39] tjholowaychuk: uid() [23:39] tjholowaychuk: etc [23:40] quirkey has joined the channel [23:40] abiraja has joined the channel [23:41] Tim_Smart: Yeah who knows. [23:41] digitalspaghetti: tjholowaychuk: please find the person at Sencha that implemented ExtDirect Forms and kill them please :D [23:41] tjholowaychuk: digitalspaghetti: haha :p [23:42] digitalspaghetti: the good news is i've started improving my ExtDirect handler for connect to support forms, but i won't have time to finish it soon as i'm on a deadline, so it's back to standard Ajax RESTy stuff [23:43] Tim_Smart: tjholowaychuk: Just a heads up, I think there might be something weird happening, because after the 10k inserts, node is using 20mb RAM while idle. [23:43] tjholowaychuk: Tim_Smart: hmm, I will try and look into it sometime [23:43] Tim_Smart: The GC is a weird thing... [23:44] digitalspaghetti: Tim_Smart: my website (tanepiper.com) will use anywhere between 20-60mb [23:44] tjholowaychuk: rapid is not even really usable yet so im not to worried haha, would be great to get it to that point [23:44] digitalspaghetti: and it;s only 4 static pages and some fetching and caching of remote data [23:44] tjholowaychuk: but im super busy [23:45] Tim_Smart: digitalspaghetti: Yeah, I did have a something to compare to :p [23:45] digitalspaghetti: but i suspect it;s using YUI that's pushing up the memory [23:45] Tim_Smart: Possibly. [23:46] digitalspaghetti: using the GC module to clear it did help some ways, but generally it started at 16mb, GC took it down to 11Mb then any views pushed it way over 40mb [23:46] digitalspaghetti: then it would never come below 20mb [23:46] Tim_Smart has joined the channel [23:47] TheEmpath: woah [23:47] Tim_Smart: digitalspaghetti: I have done some tinkering with implementation and the GC, and found closures can lead to bad memory problems. [23:47] TheEmpath: v8 goes from javascript to assembling in two steps? [23:47] WALoeIII has joined the channel [23:47] TheEmpath: assemby* [23:47] TheEmpath: assembly** [23:47] TheEmpath: ass embly*** [23:48] digitalspaghetti: ass deep ins assembly [23:48] Tim_Smart: TheEmpath: Yeah. Goes straight from source to machine code. [23:48] digitalspaghetti: anyway, bedtime [23:48] TheEmpath: wow [23:48] TheEmpath: no wonder its stupid fast [23:51] jashkenas: it's totally impossible to add properties to JS strings, or JS String('s'), right? [23:52] bpadalino: what do you mean properties ? [23:52] jashkenas: "string".prop = 1 [23:52] tjholowaychuk: jashkenas: yup [23:52] reid has joined the channel [23:52] jashkenas: right because they're globally unique... [23:52] tjholowaychuk: valueOf() to get the primitive back [23:53] reid: Is there a way to pass variables to a layout in Express? [23:53] tjholowaychuk: reid: just pass them to your page view [23:53] tjholowaychuk: via { locals: {} } [23:54] jacobolus has joined the channel [23:54] reid: tjholowaychuk: cool, thanks! [23:55] jamescarr has joined the channel [23:56] jamescarr: whats up dogs [23:56] sstephenson: jashkenas: you can wrap them in new String(...) [23:59] jashkenas: sstephenson: hmm, tried that. [23:59] sstephenson: e.g. http://github.com/sstephenson/eco/blob/master/lib/eco/compiler.coffee#L35-42