[00:01] robmason has joined the channel [00:02] isaacs has joined the channel [00:02] jashkenas has joined the channel [00:02] mikew3c_ has joined the channel [00:04] throughnothing has joined the channel [00:06] ossareh has joined the channel [00:07] booths has joined the channel [00:09] mriley has joined the channel [00:09] davidc_ has joined the channel [00:11] dnolen has joined the channel [00:12] omygawshkenas has joined the channel [00:15] paulwe_ has joined the channel [00:15] wattz: evening [00:15] naturalethic: wattzaaaap [00:15] wattz: hey, why would Handle myobj = Object::New(); [00:15] wattz: give me a bus error? [00:15] wattz: :D [00:15] wattz: GOOD ONE naturalethic [00:15] wattz: -_- [00:15] wattz: lol [00:16] naturalethic: what language is that [00:16] wattz: C++ [00:16] v8bot: wattz has given a beer to C. C now has 2 beers. [00:16] naturalethic: heh [00:16] wattz: ++C [00:16] isaacs: naturalethic is on a roll [00:16] wattz: yo isaacs [00:16] wattz: long time no talk! [00:16] wattz: :D [00:16] isaacs: hey, wattz [00:16] wattz: you doing good? [00:18] msekimur_ has joined the channel [00:18] wattz: hey isaacs [00:18] wattz: why would this throw a bus error? http://pastie.org/1336991 [00:20] warz has joined the channel [00:20] isaacs: wattz: no idea. but aren't you supposed to have a HandleScope scope; at the top and then return scope.close(exports)? [00:21] isaacs: wattz: http://en.wikipedia.org/wiki/Segmentation_fault#Bus_error has some explanation [00:21] wattz: i tried that [00:21] wattz: and i know what segfault is, lol [00:21] wattz: just weird that only object does it [00:21] iammerrick has joined the channel [00:21] wattz: string::new, objecttemplat::new all work fine [00:22] isaacs: wattz: no idea. [00:22] isaacs: probably just lucky [00:22] isaacs: but i do know that not using HandleScope is a recipe for trouble [00:23] iammerrick: I am trying to get guille's repository from jsconf up and running to start playing with Node.js [00:23] iammerrick: https://github.com/guille/jsconf-todo-demo [00:23] iammerrick: But when running sudo node run.js [00:23] iammerrick: https://gist.github.com/665219/6fb2c502b3335bb4349d517e3e24279fa3fd53e1 [00:23] iammerrick: I get that [00:23] iammerrick: anyone familiar with this is that can point me to some docs or something? [00:26] ben_alman has joined the channel [00:26] aurynn has joined the channel [00:27] warz: trying to decide which template engine to use with expressjs. heh. [00:28] warz: none are really familiar, so i think whatever i choose will involve some getting used to. [00:28] robmason has joined the channel [00:31] cafesofie has joined the channel [00:32] isaacs has joined the channel [00:32] danzajdband has joined the channel [00:33] danzajdband has left the channel [00:33] iammerrick has left the channel [00:34] naturalethic: iammerrick: looks like you need to be running mongo [00:34] naturalethic: db = mongoose.connect('mongodb://localhost/todo') [00:34] naturalethic has left the channel [00:34] naturalethic has joined the channel [00:34] naturalethic has left the channel [00:37] galaxywatcher has joined the channel [00:38] naturalethic has joined the channel [00:45] dgathright has joined the channel [00:47] pengwynn has joined the channel [00:47] dgathright has joined the channel [00:47] breccan__ has joined the channel [00:50] dipser: C++ [00:50] v8bot: dipser has given a beer to C. C now has 3 beers. [00:50] davidc_ has joined the channel [00:51] warz: warz++ [00:51] v8bot: warz: Don't cheat! You can't give a beer to yourself. [00:51] omni5cience has joined the channel [00:53] BillyBreen has left the channel [00:53] aurynn: warz-- [00:53] v8bot: aurynn has taken a beer from warz. warz now has -1 beers. [00:53] aurynn: I want possible beers. [00:55] mikeal has joined the channel [00:58] AAA_awright_ has joined the channel [01:00] dgathright has joined the channel [01:01] dguttman_ has joined the channel [01:02] isaacs has joined the channel [01:03] evanmeagher has joined the channel [01:06] bingomanatee_ has joined the channel [01:06] mscdex: node.js rules! [01:07] feedtheaimbot has joined the channel [01:07] rauchg_ has joined the channel [01:07] warz: heh. im having a difficult time wrapping my head around it all. [01:07] mscdex: like what? [01:08] jashkenas has left the channel [01:08] jashkenas has joined the channel [01:08] jashkenas has left the channel [01:08] jashkenas has joined the channel [01:09] Yuffster has joined the channel [01:10] feedtheaimbot has joined the channel [01:11] feedtheaimbot has joined the channel [01:13] jakehow has joined the channel [01:13] rfranknj has joined the channel [01:14] warz: not entirely sure. its just all very foreign to me. im not sure if i should be using it as a supliment to my my site, for stuff like socket.io. [01:14] warz: or if i should use something like expressjs and do everything with it. [01:15] naturalethic: any docs/primers on embedding node? [01:16] c4milo has joined the channel [01:18] softdrink has joined the channel [01:19] Wes- has joined the channel [01:19] aconbere has joined the channel [01:21] ajpi has joined the channel [01:21] zentoooo has joined the channel [01:21] rauchg_ has joined the channel [01:21] themiddleman has joined the channel [01:22] sprout has joined the channel [01:24] msekimura has joined the channel [01:24] davidascher has joined the channel [01:24] bbttxu has joined the channel [01:25] mbrochh has joined the channel [01:33] trotter has joined the channel [01:33] isaacs1 has joined the channel [01:33] davidc_ has joined the channel [01:34] robmason has joined the channel [01:42] derferman has joined the channel [01:43] jamescarr has joined the channel [01:43] jamescarr: I could have sworn there was something that has isFunction? [01:43] MikhX has joined the channel [01:44] isaacs: jamescarr: function isFunction (f) { return typeof f === "function" && !(f instanceof RegExp) } [01:44] isaacs: now you are that something! [01:44] cafesofie has joined the channel [01:45] jamescarr: lol [01:45] jamescarr: that is what I did [01:45] Wes-: me too! [01:45] jamescarr: I thought there was something already in node for it [01:45] isaacs: i dunno, maybe in lib/util.js for the inspect method [01:46] isaacs: jamescarr: though, a regexp kind of IS a function [01:46] m0rganic has joined the channel [01:46] isaacs: v8: re = /a(s)(df?)/ ; re("asdf") [01:46] v8bot: isaacs: ["asdf", "s", "df"] [01:47] jamescarr: wtf [01:47] isaacs: v8: re = /a(s)(df?)/ ; re("asdf") ; re [01:47] v8bot: isaacs: /a(s)(df?)/ [01:47] jamescarr: wow [01:47] jamescarr: I never would have expected [01:47] isaacs: calling a regular expression is like re.exec() [01:48] amerine has joined the channel [01:51] jamescarr: isaacs, I finally got a chance to go through all the docs on npm to see all the changes [01:51] jamescarr: good stuff [01:51] isaacs: thanks :) [01:52] isaacs: we'll have tab completion for real soon. it's pretty complete already. [01:53] throughnothing has joined the channel [01:53] SubStack: I should hope that tab completion would be pretty complete [01:53] tmpvar has joined the channel [01:54] jamescarr: the tab completion will be sweet [01:54] jamescarr: just like apt-get [01:54] DanielSim has joined the channel [01:54] jamescarr: I'm doing a node.js half day workshop on Thursday, had to review the changes to npm and update my slide deck ;) [01:54] shirro has joined the channel [01:54] shirro has joined the channel [01:58] jwl: is there a way to mix 2 object literals together [01:59] jamescarr: so... is there fiber support available in node.js? [01:59] jashkenas: jwl: not built-in to JS... [01:59] ajpiano has joined the channel [02:00] murz has joined the channel [02:01] TheEmpath has joined the channel [02:01] TheEmpath: Watson [02:01] Astro: KyleXY: thx [02:02] TheEmpath: Watap kids [02:03] isaacs1 has joined the channel [02:04] isaacs has joined the channel [02:04] eml-mobile has joined the channel [02:06] eml-mobile_ has joined the channel [02:07] jwl: jashkenas: yeah .. how do i merge then .. maybe some lib? [02:07] derferman has joined the channel [02:07] jwl: anyone: http://stackoverflow.com/questions/4320587/merge-two-object-literals-in-javascript [02:07] zentoooo has joined the channel [02:09] jashkenas: for (var key in source) target[key] = source[key]; [02:09] dguttman has joined the channel [02:09] jashkenas: jwl: just be careful if someone's extended Object.prototype. [02:09] dguttman has joined the channel [02:09] TheEmpath: That's object grafting. I dunno how to automate grafting. [02:10] jashkenas: in which case: for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key]; [02:10] jashkenas: ugly, eh? [02:10] jwl: yeah [02:10] bentruyman has joined the channel [02:10] jwl: ill try with that [02:11] jwl: js really need something powerful extending it on node.js [02:11] isaacs: jwl: http://stackoverflow.com/questions/4320587/merge-two-object-literals-in-javascript/4320620#4320620 [02:12] jashkenas: isaacs: don't you think that loops through the arguments backwards? as per your comment? [02:12] isaacs: jashkenas: hey, i'm matching the spec in the OP [02:12] jashkenas: fair enough. [02:13] isaacs: jashkenas: merge(animal, dog) [02:13] isaacs: it's a weird API, to be sure [02:13] isaacs: especially the function name. really oddball [02:13] isaacs: but whatevs. [02:14] jamescarr: hmmm [02:14] jamescarr: this might sound kinda lame, but is the no.de beta still open? [02:14] jwl: isaacs: thanks [02:14] jwl: isaacs: i c you dont use ; [02:15] jwl: you never do that? [02:15] zk has joined the channel [02:15] isaacs: jwl: i use semicolons. there are two in the for() loop [02:15] isaacs: ;) [02:16] jwl: :) [02:16] jamescarr: speaking of for loop... I discovered something cool recently [02:16] elijah-mbp has joined the channel [02:16] arpegius has joined the channel [02:16] jamescarr: for(var i = 0; i < 10; i++) if (i % 2 == 0) { console.log(i); } [02:16] elijah-mbp has joined the channel [02:17] hornairs has joined the channel [02:18] jashkenas: jamescarr: what's the trick? inline if? [02:19] jamescarr: I guess [02:19] jamescarr: I stumbled upon it on accident [02:19] kgf: you shouldn't need the other set of braces either. [02:20] kgf: but some people leave it in for (a) readability and/or (b) protection from silly mistakes when you suddenly find yourself needing 2 statements in that for or if [02:20] CIA-54: node: 03Ryan Dahl 07master * r0915736 10/ lib/crypto.js : style - http://bit.ly/i1sKDv [02:20] CIA-54: node: 03Ryan Dahl 07master * r4b94731 10/ (4 files in 2 dirs): Move root certs out of JavaScript - http://bit.ly/gLDF13 [02:20] CIA-54: node: 03Ryan Dahl 07master * rea540c9 10/ (src/node_crypto.cc src/node_crypto.h): Better verify info - http://bit.ly/g5JSlI [02:20] CIA-54: node: 03Ryan Dahl 07master * r355936d 10/ (src/node_crypto.cc src/node_crypto.h): Implement SecureContext destructor - http://bit.ly/fam6pj [02:21] kgf: jwl: I also just posted to the question you linked but you probably got enough answers already that mine is tl;dr :P [02:22] jwl: kgf: dojo could be used on node.js? [02:22] kgf: I think someone tried forking it for that [02:22] kgf: but I'm just saying take a look at that method in the source [02:22] kgf: that method itself is certainly usable (I think I tried once) [02:23] derferman has joined the channel [02:23] kgf: https://github.com/novemberborn/dojo [02:24] kgf: doesn't seem to have been touched in a while, dunno the status [02:24] whyme has joined the channel [02:25] derferman_ has joined the channel [02:25] jwl: kgf: okay [02:25] Aria has joined the channel [02:26] jashkenas has joined the channel [02:26] matt_c has joined the channel [02:26] jwl: hope more libraries will be ported soon [02:27] isaacs: jamescarr: you actually don't need the {} at all [02:27] isaacs: jamescarr: it's an inline for and an inline f [02:27] isaacs: *if [02:28] isaacs: the if is almost like a guard [02:28] jamescarr: yeh [02:28] jamescarr: the example was simplistic [02:29] jamescarr: I've been doing loops like that lately with an inline if as a guard [02:32] derferman_ has joined the channel [02:33] MikhX has joined the channel [02:33] sprout has joined the channel [02:33] isaacs has joined the channel [02:35] pengwynn has joined the channel [02:37] pengwynn has joined the channel [02:39] omygawshkenas has joined the channel [02:41] derferman_ has joined the channel [02:42] davidc_ has joined the channel [02:43] dabtop has joined the channel [02:44] killfill has joined the channel [02:45] Druid_ has joined the channel [02:45] mikeal has joined the channel [02:46] langworthy has joined the channel [02:47] timemachine3030: anyone familiar with the "Vows" test suite? [02:47] whyme: timemachine3030: killed by the huge object literial [02:48] jrun has joined the channel [02:48] timemachine3030: I don't know what that means ... I'm talking about: http://vowsjs.org/ [02:48] isaacs: jamescarr: you know, if you're doing that to use a hasOwnProperty check in a for/in, you should know that Object.keys(obj).forEach(function (k, 9) { ... }) is actually faster in v8 [02:49] isaacs: s/9/i/ [02:49] luke` has joined the channel [02:49] galaxywatcher has joined the channel [02:49] whyme: timemachine3030: um, when your test suite grows you have to write deep nested object literal [02:50] whyme: timemachine3030: I did mess up with vows a little bit. [02:50] msilverman2 has joined the channel [02:50] naturalethic has joined the channel [02:50] AAA_awright: timemachine3030: A little [02:51] timemachine3030: whyme, is that a big problem then? [02:51] indutny has joined the channel [02:51] indutny: hey everyone! [02:51] AAA_awright: hey indutny! [02:51] indutny: how it's going? [02:51] whyme: timemachine3030: I think so, 'cuz I write a lot of tests [02:52] Draggor has joined the channel [02:52] chrischris has joined the channel [02:52] whyme: timemachine3030: everytime I wanna ensure a callback is called, it goes on step deeped [02:53] derferman has joined the channel [02:53] whyme: s/deeped/deeper/ [02:53] timemachine3030: hum. well it is working out for me so far ... save that in the case of: vows.addBatch().run(callback); I the callback never called. [02:53] BillyBreen has joined the channel [02:53] omygawshkenas has joined the channel [02:55] whyme: haven't used .run(callback) [02:57] timemachine3030: I'm trying to integration test a server and I need to, at some point, close my mock server... I thought the .run(callback) would be a swell place but it never hits. [02:58] paulrobinson has joined the channel [02:59] jameshome_ has joined the channel [02:59] whyme: timemachine3030: I think vows has a basic support for teardown now [03:00] timemachine3030: oh really? I'll check the website again. [03:00] broofa has joined the channel [03:00] whyme: https://github.com/cloudhead/vows/issues#issue/14 [03:00] cheney has joined the channel [03:00] cheney: hello [03:01] indutny: hello [03:01] timemachine3030: whyme, thanks for the link. that hasn't made it into documentation yet. [03:01] cheney: lets say I have a function called prettydiff() in a file called prettydiff.js, how would I execute that function using the node command from the command line? [03:01] whyme: timemachine3030: :) [03:01] indutny: cheney: there're two ways [03:02] indutny: 1) place prettydiff() at the end of your file [03:02] indutny: 2) you can export your function: exports.prettydiff = function() { ... } [03:02] indutny: if you'll choose second path [03:02] indutny: you can run repl: "node", then "var lib = require('./prettydiff'); lib.prettydiff();" [03:03] jakehow has joined the channel [03:03] whyme: 3) if (module == require.main) prettydiff(process.argv or something) [03:03] indutny: whyme++ [03:03] v8bot: indutny has given a beer to whyme. whyme now has 2 beers. [03:03] aconbere has joined the channel [03:03] cheney: thank you guys [03:07] tekky has joined the channel [03:08] bbttxu has left the channel [03:09] tek has joined the channel [03:10] faust45 has joined the channel [03:11] pHcF has joined the channel [03:11] dmcquay has joined the channel [03:11] googol has joined the channel [03:14] losing has joined the channel [03:16] isaacs has joined the channel [03:18] MikhX has joined the channel [03:20] jwl: frustrating when you cant do simple things easily [03:20] jwl: how do i deep clone a object? [03:20] jwl: is there no easy way or do i have to write a function for myself? [03:21] ossareh has joined the channel [03:22] indutny: jwl: function clone(a) { var r = {}; for (var i in a) if (a.hasOwnProperty(i)) r[i] = a[i]; return r;} [03:22] jwl: indutny: but i have an object literal with nestings [03:22] jwl: in theory it could be 10 nestings [03:23] jwl: that takes us to another level =) [03:23] indutny: jwl: function clone(a) { var r = {}; for (var i in a) if (a.hasOwnProperty(i)) r[i] = typeof a[i] === 'object' ? clone(a[i]) : a[i]; return r;} [03:25] timemachine3030: in the case of an http server object: server = http.createServer(function (request, response) {}); server.on('request', function(request, response) {}); ... in the second listener response is undef... why is this? and is there a was to decouple the event listener from the .createServer() call. [03:25] whyme: jwl: copy-n-paste jQuery.extend or something [03:25] dguttman_ has joined the channel [03:25] jwl: im doing it on node [03:25] indutny: jwl: doesn't matter [03:25] jwl: yeah i could do that [03:25] indutny: but actually [03:25] indutny: jQuery.extend is slow [03:25] jwl: but dont want to copy paste =) [03:29] wattz: evening [03:29] noahcampbell has joined the channel [03:30] indutny: wattz-- [03:30] v8bot: indutny has taken a beer from wattz. wattz now has -1 beers. [03:30] timemachine3030: jwl, lines 13-23 https://github.com/timemachine3030/node-couchdb/blob/master/lib/couchdb.js [03:30] jwl: timemachine3030: i love couchdb! [03:30] wattz: ... [03:30] jwl: its so funny how we hack things together =) [03:30] timemachine3030: jwl, me too. :) [03:30] jwl: wish it was 100 years from now [03:30] timemachine3030: lol [03:31] jwl: so simple everything would be [03:31] wattz: i want to know why my dynamic module loading shit is throwing bus errors [03:31] wattz: and i wish i could just use node for this project [03:31] mikeal has joined the channel [03:31] wattz: hi mikeal [03:31] mikeal: hiya [03:32] wattz: mikeal: you down for some v8/C++ assist? [03:32] mikeal: nope [03:32] mikeal: :) [03:32] wattz: lol [03:32] mikeal: i don't know the v8 C++ very well at all anyway [03:33] mikeal: i just haven't had to use it yet [03:33] indutny: wattz: I've been coded for node.js [03:33] indutny: on C++ [03:33] indutny: any questions? [03:33] wattz: it's more about dlopen/dlsym [03:33] jwl: indutny: thanks for the function .. worked like a charm! [03:33] jwl: even with endless nestings =) [03:33] jwl: http://pastie.org/1337304 [03:34] wattz: i wish i could use node so i didn't have do this from scratch [03:34] whyme: jwl: beware it doesn't handle arrays [03:34] jwl: changed the typeof for more security [03:34] jwl: so new String also works [03:34] jwl: whyme: yeah ... ill figure out how to do with arrays [03:34] indutny: jwl: you're welcome [03:34] wattz: indutny: it's v8/c++ related, but not node, not for this one :( [03:35] indutny: wattz: anyway ask, may be I can help you [03:35] wattz: i implemented dlopen/dlsym [03:35] wattz: and it loads the module just fine [03:35] wattz: as long as the loaded method just printfs [03:35] wattz: if i do, Object::New or manip an object, i get a bus error [03:35] wattz: gdb gives me excess [03:36] wattz: so i know it's a memory issue [03:36] wattz: but i don't know what piece of the puzzle im missing [03:36] indutny: hm... [03:36] indutny: can I take a look at your code? [03:36] indutny: or part of it [03:36] wattz: yeah no problem [03:37] wattz: how you want it? [03:37] wattz: it's a private repo on github, but i can invite you [03:37] wattz: since im just doing the commonjs core shit for this right now [03:39] indutny: may just private gist [03:39] indutny: with a part of code [03:39] wattz: just the module stuff [03:42] wattz: indutny: http://pastie.org/private/ymmzysbxyr6vyedqej41g [03:45] davidc_ has joined the channel [03:45] polotek has joined the channel [03:45] naturalethic: not very useful isaacs! [03:45] naturalethic: joshua@ethos npm $ make [03:45] naturalethic: node cli.js install npm [03:45] naturalethic: make: *** [install] Error 1 [03:46] naturalethic: isaacs-- [03:46] v8bot: naturalethic has taken a beer from isaacs. isaacs now has 6 beers. [03:46] indutny: isaacs++ [03:46] v8bot: isaacs is getting too many beers. Don't let isaacs get drunk! [03:46] mikeal has joined the channel [03:46] meso has joined the channel [03:46] naturalethic: all excited to try npm since you all been talking about it, this is my first experience with it :( [03:47] cardona507 has joined the channel [03:47] wattz: indutny: that link work? [03:47] jchris has joined the channel [03:47] postwait has joined the channel [03:47] indutny: wattz: one moment, i've some other stuff [03:47] wattz: oh no worries [03:48] wattz: just couldn't remember if i posted the link :D [03:48] indutny: yep [03:48] indutny: it's ok [03:49] timemachine3030: naturalethic, where do you have node installed to? (bash$ which node) [03:53] davidascher has joined the channel [03:53] naturalethic: timemachine3030: i just checked it out from git, don't worry i'll figure it out :) [03:55] warz has joined the channel [03:55] timemachine3030: naturalethic, try the first set of instructions here ... it will install it to a directory under ~ so you don't need to build npm with root privs. [03:55] timemachine3030: https://gist.github.com/579814 [03:56] naturalethic: i prefer the git route so i can keep it edge [03:56] SubStack: on day 2 of my blog-each-day week, need to finish this [03:57] faust45 has joined the channel [04:01] shirro has joined the channel [04:01] shirro has joined the channel [04:02] dipser_ has joined the channel [04:02] davidascher has joined the channel [04:02] alexfner has joined the channel [04:03] polotek: SubStack: where's your blog? [04:03] SubStack: http://substack.net/ [04:03] SubStack: fixing optimist then I'll blog about it [04:04] micheil: anyone know if there's any documentation on the varios Error.codes that match up to the unix errors like ECONNRESET? [04:04] SubStack: then I'll blog about seq, chainsaw, rowbit, underwater rov, perhaps browserify [04:04] SubStack: if I can get browserify working this week [04:04] mikeal: someone should write bindings to berkeley db [04:04] timmorgan has joined the channel [04:04] SubStack: mikeal: would be pretty swell! [04:05] SubStack: I like pkrumins's quick and dirty sqlite key/value store [04:05] polotek: mikeal: I know you're biased, but worth it to get couchdb: definitive guide from o'reilly? [04:05] SubStack: an interface like supermarket on top of bdb would rock [04:05] mikeal: the newer version is online [04:05] naturalethic: timemachine3030: had to switch to v0.2 branch of node -- errorhandler failed to tell me that [04:05] polotek: oh really? [04:06] mikeal: http://guide.couchdb.org/ [04:06] polotek: sweet@ [04:06] polotek: ! [04:06] mikeal: the problem with sqlite is that the transaction overhead gets HUGE when the db gets large [04:06] mikeal: it's not designed at all for concurrent access [04:06] SubStack: yeah well it's mostly for prototyping [04:06] mikeal: it won't corrupt but it's not performant [04:07] mikeal: if i had bdb bindings I could make a couch compatible storage engine [04:07] mikeal: that could replicate [04:07] SubStack: :o [04:07] mikeal: or we could build a new different database :) [04:07] timmorgan: Noob here: are there constants defined for errorno's? Example: ECONNREFUSED == 111 but I cannot find that constant anywhere in a library [04:08] softdrink has joined the channel [04:08] mikeal: that's from epoll i belive [04:08] mikeal: might be in libev [04:08] Aria: That's from the OS [04:08] timmorgan: ok thanks [04:08] Aria: errno.h! [04:09] yatiohi has joined the channel [04:09] timmorgan: nice [04:09] timemachine3030: timmorgan, the numbers tend to change between versions. you should match against the string instead. [04:09] timmorgan: you mean err.message ?? [04:09] timmorgan: err.message.match(/ECONNREFUSED/) [04:10] timemachine3030: yeah: e.message.match(/^ECONNREFUSED/ [04:10] timmorgan: ok great [04:10] Aria: Not between versions, between OSes ;-) [04:10] timemachine3030: Aria, yes that is more-correct. [04:11] polotek: there is also an ECONNREFUSED on the process object [04:12] polotek: it != 111 though [04:12] polotek: ah, just caught up with Aria's message [04:13] Aria: And in fact, on linux, it's 111 and MacOS, 61. [04:13] timmorgan: weird -- why have numbers then [04:13] isaacs has joined the channel [04:13] MikhX has joined the channel [04:14] Aria: Because you have a C macro that always gives you the number by name. [04:14] Aria: enums, C-style. [04:14] Aria: And so, process.ECONNREFUSED does the right thing. [04:14] mikeal: because typing ECONNREFUSED is so much easier than 111 :P [04:15] cjm has joined the channel [04:15] Aria: Well, easier than if(os == 'macos') { v = 61 } elseif(os == 'linux') { v = 111 } else { throw('We don't support your OS yet') } [04:15] ryah: e.errno [04:15] mscdex: jeeeeesh. aol does some really silly things [04:15] timmorgan: yeah but process.ECONNREFUSED is undefined [04:15] Aria: Yeah? [04:15] Aria: node> process.ECONNREFUSED [04:15] Aria: 111 [04:16] ryah: e.errno == require('constants').ECONNREFUSED [04:16] timmorgan: at least on v0.3.1 [04:16] Aria: Ah, constants. [04:16] naturalethic: what is the npm command to get a list of installed packages? [04:16] whyme: naturalethic: npm ls installed [04:16] Aria: npm list installed [04:16] Aria: (cue feeling stupid in 3, 2, 1...) [04:17] timmorgan: ryah: thanks! [04:17] mikeal: i'm going to fuck that up by pushing to the registry my new package named "installed" [04:17] Aria: Whoa. I have node 0.1.102 installed on that machine. Time to fix that [04:17] Aria: mikeal ++ [04:18] polotek: Aria: you gotta remove the space. he didn't even get a beer [04:18] Aria: Bah. [04:18] Aria: mikeal++ [04:18] v8bot: Aria has given a beer to mikeal. mikeal now has 2 beers. [04:18] polotek: `v process [04:18] v8bot: polotek: No such command. [04:18] mikeal: that is hilarious [04:18] polotek: `v process.ECONNREFUSED [04:19] v8bot: polotek: No such command. [04:19] Aria: That's v8, polotek, not node. [04:19] polotek: `v process.ECONNREFUSED + '' [04:19] v8bot: polotek: No such command. [04:19] polotek: Aria: ah, makes sense [04:19] polotek: but why isn't it node? [04:19] Aria: ENOIDEA [04:19] polotek: I guess we don't want people starting servers through the channel [04:19] derferman has joined the channel [04:20] ryah: using integer error codes is probably a bit stupid [04:20] ryah: should probably just use a string... [04:20] ryah: e.errno == "ECONNREFUSED" [04:20] ryah: (making a new string is really cheap) [04:21] ryah: of course, it wouldn't be a no. anymore. [04:21] ryah: e.code == "ECONNREFUSED" [04:22] polotek: ryah: I like constants [04:22] indutny: ryah: I like them too [04:22] indutny: but difference is not big [04:22] polotek: I wish js had real enums [04:23] indutny: polotek: I wish this never will be [04:23] indutny: :) [04:23] polotek: enums are great. the way some languages do enums is not so great [04:24] indutny: I like :literals [04:24] Aria: I rather prefer the numbers, myself. [04:24] indutny: like in ruby [04:24] indutny: javascript has them tooo [04:24] indutny: but only on lower level [04:24] Aria: (and constants for reference) [04:24] indutny: and for object properties [04:24] polotek: I like ruby symbols [04:24] indutny: yeah [04:24] indutny: they're cool [04:24] polotek: but they're not enums [04:24] polotek: you can use enums as a type [04:24] Aria: Yeah. No good for interfacing to things outside Ruby. [04:25] micheil: ryah: what about using Error.name? [04:26] polotek: ryah: does yuiconf talk cover anything new? [04:28] davidc_ has joined the channel [04:28] baoist has joined the channel [04:29] timmorgan has left the channel [04:29] BrianTheCoder has joined the channel [04:30] mikeal has joined the channel [04:31] nooder has joined the channel [04:32] ryah: micheil: yeah, that sounds good. [04:34] indutny: anyone tried to request https://www.google.com/ using node.js ? [04:34] indutny: I've receive 'close' event on client, under cygwin [04:34] indutny: and 'connect' of course [04:36] belbo has joined the channel [04:38] meder: what can i use to succinctly copy resources to the filesystem ( wget )? [04:39] softdrink has joined the channel [04:42] jacksonh has joined the channel [04:44] jacksonh: Are there scripts or anything for the buffer/string benchmarks mentioned in the YUI roadmap presentation? [04:52] abiraja has joined the channel [04:58] ryah: jacksonh: hm. http://nodejs.org/jsconf_bench_data2.tar.gz [04:58] naturalethic: ryah: "subclassing" Buffer is no longer working for me after moving to v0.2 [04:59] jpld: anyone use linode for node project hosting find it works out well and want to give me your referrer code? i'd use heroku if it actually saw some attention or no.de if i actually got a coupon but alas… [05:00] JojoBoss: I'm using linode [05:00] JojoBoss: Works good so far [05:00] JojoBoss: thought i'm still in development [05:00] JojoBoss: though [05:00] googol: jpld: jsapp.us is on linode [05:01] jpld: cool, thats all i need to hear - sounds like resource wise it is a little more friendly than slicehost and cheaper [05:01] JojoBoss: fe0664d26e258d0c20fc436ebabf8fae28bcdb56 [05:01] jpld: thanks (0: [05:01] JojoBoss: thats my ref code if you want [05:01] ryah: jpld: no.de - soon.. [05:02] jpld: ryah: i was a textdrive customer in 2006 and now joyent, who do i need to beg for a coupon? (0: [05:02] jpld: if only i were in town for the node meetup, rats [05:02] JojoBoss: I used to use vpslink and i definately like linode much better [05:02] SubStack: when/where is the meetup? [05:02] jpld: the 14th i believe in san francisco [05:03] ryah: jpld: i bet if you tweet it about it someone will give you one [05:03] jpld: though i think it sold out almost immediately [05:03] SubStack: oh the class thing [05:03] ryah: i could probably do it, but i'd have to look through too much docs :) [05:03] SubStack: $35 is a bit much for me [05:03] jpld: ryah: ahhh, i keep running the clever curl no.de API POST thinking i'll hit pay dirt [05:04] jpld: $35? man, thats cheap for learning and meeting people [05:04] jacksonh: ryah: awesome thank you. [05:04] SubStack: jpld: not when you're a starving empiricist like me [05:04] SubStack: doing startups and such [05:04] jpld: SubStack: pick up a few mechanical turk jobs in your copious freetime / not sleeping time (0: [05:05] SubStack: sounds good! [05:05] SubStack: I'm pretty good at filling out captchas [05:05] SubStack: putting that on my resume [05:05] SubStack: even the tricky ones [05:06] JojoBoss: hehe [05:06] isaacs_ has joined the channel [05:07] jpld: SubStack: oh man, i get hung up on captcha all the time, i wonder what the false positive rate is [05:09] Wes- has joined the channel [05:11] SubStack: so anyways just pushed+published some stuff I'd been meaning to get around to for optimist [05:11] SubStack: --key value, .default() (at JimBastard's suggestion) [05:11] SubStack: now blogging [05:11] mikeal has joined the channel [05:12] richcollins has joined the channel [05:13] jacksonh: SubStack: you did browserling.com ? [05:13] SubStack: y [05:13] jacksonh: All week I've been planning something very similar. oh well. [05:13] SubStack: planning? [05:14] SubStack: also: ec2 micros running windows have crazy unreliable performance [05:14] jacksonh: planning as in not executing, but figuring out if it would be worth doing [05:15] SubStack: but anyways I just need to finish shaving the rdesktop yak and then we'll have a pretty kick-ass system [05:15] jacksonh: yeah it looks nice [05:15] SubStack: thanks! [05:15] whyme: SubStack: would browserling support http://localhost someday? [05:15] SubStack: whyme: y [05:16] whyme: SubStack: cool [05:16] SubStack: I'm thinking a perl script or something you run on your machine that reverse proxies with our own systems [05:17] SubStack: not very hard to do, but annoying to tie into the user system [05:18] JimBastard has joined the channel [05:18] SubStack: JimBastard: I made you a .default() ;) [05:18] JimBastard: lol for real SubStack , i came on here to ask you abou tthat [05:18] JimBastard: ill check the docs [05:19] SubStack: it's under the 'EVEN MORE HOLY COW' section of the readme [05:19] SubStack: also --key value does the same thing as --key=value [05:19] SubStack: I'm not sure why that was not already the case [05:19] indutny: JimBastard++ [05:19] v8bot: indutny has given a beer to JimBastard. JimBastard now has 1 beers. [05:19] JimBastard: i am dissappoint [05:19] JimBastard: this api displeases me [05:20] SubStack: what abouts it? [05:21] JimBastard: SubStack: i was thinking something like this: https://gist.github.com/722999 [05:21] JimBastard: now that i think more, that could have unexpected affects on legacy code [05:21] JimBastard: effects* [05:21] JimBastard: fixed typo, refresh [05:23] SubStack: JimBastard: how about generating option info for the usage string with .default() and .demand()? [05:23] JimBastard: it just seems a little more disjointed? [05:24] nbqx has joined the channel [05:24] simb has joined the channel [05:24] simb has left the channel [05:24] JimBastard: its not really a big deal either way [05:24] JimBastard: im not 100% dedicated to my idea [05:24] JimBastard: it seems to present more problems then solutions right now [05:25] SubStack: well keep milling over it [05:25] jacksonh: this pipes stuff is awesome [05:25] SubStack: default was easy to implement and fit well with the stuff already in there [05:25] gkatsev has joined the channel [05:27] simb has joined the channel [05:30] simb: Hello All [05:30] JimBastard: sup simb [05:30] JimBastard: welcome to the javascript party [05:30] simb: Learning me some node :) heard this was the place where all the cool kids were [05:31] JimBastard: SubStack is pretty cool [05:31] SubStack: fact [05:31] cjmFloating has joined the channel [05:32] SubStack: actually I need to blog more [05:32] SubStack: ACTION gets on that [05:32] simb: my blog is a desoate watesland. [05:32] JimBastard: http://blog.nodejitsu.com rocks [05:32] JimBastard: new articles every couple of weeks [05:32] SubStack: ACTION is doing a week of solid blogging [05:32] JimBastard: you gotta be solid and steady about it [05:33] simb: Work gets in the way too often [05:33] SubStack: went all of september and october with no posts :/ [05:33] simb: Either of you using express? [05:33] SubStack: simb: y [05:34] JimBastard: simb: im not really using express in my stack, but people seem to like it. if you are coming from rails its a nice transition [05:34] SubStack: ACTION is trying to build a blogging empire while also doing a startup while also pushing out tons of code to githu [05:34] warz: im using express. i hardly know what im doing, though. [05:34] SubStack: b [05:34] SubStack: warz: hah, same! [05:34] JimBastard: if you are trying to learn node i'd suggest not spending too much time in express. if you want to build a site and get it going, you should investigate it more seriously [05:34] simb: I am using the view rendering. I see how to get data into views. Is there anyway to get data into the layout? [05:34] warz: i did manage to make this syncronizing browser scroll though! http://schematico.com:8000/test.html [05:34] warz: come scroll with me [05:35] simb: Logged in As: not logged in. [05:35] simb: that kind of stuff [05:35] SubStack: simb: oh tj was just on earlier talking about this, you can set a helper [05:35] warz: yea, i see you scrolling. :P [05:35] JimBastard: well thats annonying [05:35] JimBastard: lol [05:35] warz: lol =P [05:35] SubStack: and the helper is just a variable that persists over all of your views [05:35] JimBastard: real-time collaborative scrolling [05:35] indutny: JimBastard: I love connect [05:35] indutny: with all my heart [05:35] indutny: :D [05:35] simb: I know I can set something into global and reach it, but that is bad joojoo [05:35] warz: help you, help me, help you to scroll [05:36] mattcodes has joined the channel [05:36] indutny: but more than it I like only my own framework, based on it [05:36] indutny: it's currently part of my new project [05:36] indutny: but if it succeeds I will extract it from it [05:36] whyme: persistent scroll? sounds good [05:36] SubStack: some day I'll probably write my own web framework, but I'm trying to avoid it [05:37] whyme: I'll make it into my project :) [05:37] SubStack: if I do write one, it will be mind-bendingly excellent [05:37] isaacs has joined the channel [05:37] whyme: warz++ [05:37] v8bot: whyme has given a beer to warz. warz now has 0 beers. [05:37] SubStack: with dnode everywhere 'cause that's just how I roll [05:37] warz: broke even with the beers. [05:37] yozlet has joined the channel [05:38] simb: I have written frameworks in other languages, its almost never worth the actual work of maintaining it. [05:38] simb: I'd much rather just contribute my ideas to someone else now [05:39] warz: i wrote a simple one in python with werkzeug. it was fun, but i didnt even end up using it myself. [05:39] SubStack: aim for a niche use case [05:39] richcollins has joined the channel [05:39] indutny: v8bot: new Framework(); [05:39] v8bot: indutny: Use v8: to evaluate code or "`v commands" for a list of v8bot commands. [05:39] indutny: v8: new Framework(); [05:39] v8bot: indutny: ReferenceError: Framework is not defined [05:39] ossareh has joined the channel [05:42] mh` has joined the channel [05:42] whyme: oops, I've come up with an idea [05:42] whyme: set up a shared repl server [05:42] warz: heh [05:42] SubStack: what is technically possible hasn't really caught up with what web frameworks provide [05:42] whyme: when a noob needs help he can start a session [05:42] whyme: and share that session with helpers [05:43] SubStack: I want a web framework that blurs the boundaries between server and client [05:43] whyme: s/helpers/people came to help/ [05:43] warz: substack, depending on the language [05:43] warz: a lot of things seem to be easier to implement with something that i feel is low level, such as nodejs and websockets [05:44] warz: compared to doing the same in all python for example [05:44] simb: thanks for the helper tip. With a quick search i found the dynamicHelpers. the data I need access to is on my req object [05:44] SubStack: yep! [05:51] matjas has joined the channel [05:55] mikeal has joined the channel [05:56] simb: Do you know if using express I can set some kind of before filter to check authenication? [05:56] mattcodes has joined the channel [05:57] naturalethic has joined the channel [05:57] whyme: simb: there's basicAuth in latest Connect iirc [05:58] davidascher has joined the channel [05:58] faust45 has joined the channel [05:59] mattcodes has left the channel [06:00] teemow has joined the channel [06:00] daniellindsley has joined the channel [06:03] ceej has joined the channel [06:06] rchavik has joined the channel [06:09] jpld: whyme: oh really httpdigest? [06:10] masahiroh has joined the channel [06:11] mikew3c has joined the channel [06:11] whyme: jpld: sorry, dunno what it is [06:11] jpld: there is some connect middleware http-digest that i keep meaning to migrate to from connect-auth which supports way more auth schemes than i need [06:12] jpld: JojoBoss: signed up for linode, used your referrer [06:13] brianmario has joined the channel [06:14] warz: linode is pretty good. although theyve been having stability issues lately. [06:14] warz: been using them for a few years now, though. good choice! [06:14] halfhalo: heh... silly flood at the fremont dc [06:14] warz: dallas dc prior to that, too [06:15] halfhalo: heh [06:15] MikhX has joined the channel [06:15] halfhalo: I have one at the fremont, but moving to slicehost soon [06:16] warz: i move from slicehost :P [06:16] warz: moved* [06:16] halfhalo: So did I originally [06:16] halfhalo: and from lunarpages before that [06:16] warz: why you moving back to it? [06:17] warz: looks like linodes plans still beat slicehosts [06:17] warz: ah slicehost is owned by rackspace now? when did that happen [06:17] jpld: yeah i'm moving from slicehost too [06:17] jpld: well i've been a slicehost customer for several years and have my account still, but i'm phasing it out [06:19] halfhalo: not going back for the price, but anywho [06:19] rbranson: slicehost has been owned by rackspace for like a year or so [06:19] rbranson: afaik [06:19] halfhalo: yup [06:19] warz: nice good for them heh [06:20] chapel: JimBastard: any word on fixing the provision bug on nodejitsu? [06:21] JimBastard: chapel: gonna have to be another day i think, feel free to ping @indexzero on twitter lol [06:21] JimBastard: i just bugged him again a coulpe of hours ago [06:21] chapel: no worries, just curious [06:21] JimBastard: he'll comment on ticket though for sure [06:21] JimBastard: my apologies [06:21] chapel: my app isn't ready yet, but I wanted to play with the coolness and saw it was still not working [06:21] chapel: :) [06:24] isaacs_ has joined the channel [06:25] JojoBoss: jpld: cool. hope you like it. They got a great library to on how to configure tons of different stuff. [06:26] yozlet has joined the channel [06:28] masahiroh has joined the channel [06:29] saikat has joined the channel [06:30] aconbere: isaacs_: ping [06:31] aconbere: (or really anyone whose worked on src/node.js [06:31] aconbere: ) [06:31] aconbere: is there a good way to get debug output from that location? [06:31] breccan_ has joined the channel [06:31] aconbere: (or really what strategies do we have for debugging that code) [06:32] mbrochh has joined the channel [06:33] CIA-54: node: 03Michael W 07master * r5f3464c 10/ (lib/timers.js test/simple/test-net-can-reset-timeout.js): [06:33] CIA-54: node: fixed timers, whoops. [06:33] CIA-54: node: Fixes issue https://github.com/ry/node/issues/issue/481 - http://bit.ly/gxLbBT [06:34] CIA-54: node: 03Ryan Dahl 07v0.2 * r02aaac8 10/ (src/node_crypto.cc src/node_crypto.h): Implement SecureContext destructor - http://bit.ly/h7tFPM [06:36] dabtop: sweet [06:36] dabtop: Now fix ssl :( [06:36] luke` has joined the channel [06:36] dabtop: 'cause SSL is awesome [06:37] ryah: working on it [06:37] ryah: probably will have a new api though [06:37] derren13 has joined the channel [06:38] dabtop: :o? [06:38] aconbere: ryah: what's the best way to get debug output while running the node test suite (and working in src/node.js) ? [06:39] aconbere: I've tried calling debug("blah") [06:39] dabtop: Isn't there a debug param [06:39] aconbere: and setting my NODE_DEBUG env variable to 16 [06:39] dabtop: you can pass when running? [06:39] aconbere: hmmm [06:39] aconbere: dabtop: if there is I don't know it :) [06:39] dabtop: oh ok [06:39] dabtop: You got it [06:40] abiraja has joined the channel [06:40] dabtop: Well there's --debug[=port] [06:40] dabtop: but no idea what that is tbh [06:41] aconbere: oh [06:41] aconbere: you know [06:41] aconbere: I'm doing this wrong [06:41] dabtop: rikes [06:41] dabtop: :( [06:41] shirro has joined the channel [06:41] shirro has joined the channel [06:41] ryah: aconbere: console.error() [06:42] ryah: aconbere: oh sorry [06:42] ryah: aconbere: you need to use node_g [06:42] ryah: ./configure --debug [06:42] aconbere: got that bit [06:42] ryah: also set NODE_DEBUG=7 [06:42] ryah: say [06:42] aconbere: yeah, that's the part I was doing wrong [06:42] aconbere: parseInt(x, 16) & 1 [06:42] aconbere: needs to be true [06:42] ryah: NODE_DEBUG=7 ./node test/simple/test-http-1.0.js [06:42] ryah: NODE_DEBUG=7 ./node_g test/simple/test-http-1.0.js [06:43] aconbere: yep awesome [06:43] ryah: ^- i run stuff like this about 1000 time a day [06:43] aconbere: apparently I can't do my bit arrithmatic very well [06:44] micheil: ryah: we really do need to rework that option parsing [06:44] ryah: i could probably leave those debug calls in - i doubt it's much overhead. [06:44] SubStack: require('optimist') ;) [06:45] ryah: micheil: yeah [06:51] richcollins: Where are the files referenced in this trace located on the fs? https://gist.github.com/06f0e1415c5994fe40c6 [06:52] micheil: ryah: did v8 have a setOption(char*, char*) ? [06:52] ryah: i dont think so [06:52] ryah: would be a good thing [06:52] micheil: hmm, okay [06:52] micheil: richcollins: that would be from probably net.js [06:52] ryah: micheil: you can add that to v8 [06:52] ryah: micheil: i bet they'd take it [06:52] micheil: ryah: yeah, gotta get some more stuff done for work first. [06:53] richcollins: micheil: I mean where are the files node.js and timers.js [06:53] micheil: src/* [06:53] micheil: rather, src/node.js and lib/timers.js [06:53] micheil: it's an assert call that keeps reappearing [06:54] micheil: ryah: have you been able to fix / reproduce that? [06:54] richcollins: micheil: From my install dir or somewhere in /usr/local? [06:54] ryah: what is voodootikigod's "support js" site [06:54] ryah: i've been meaning to add it to the home page [06:54] micheil: uhh.., that's where they are on the node source tree [06:54] isaacs has joined the channel [06:55] richcollins: micheil: Which isn't copied into any install folders. So I need to make sure to keep around my current build for debugging I suppose [06:55] micheil: ryah: you mean promotejs? [06:55] micheil: richcollins: the javascript files get compiled in [06:56] ryah: yes, thanks [06:56] zomgbie has joined the channel [06:56] micheil: https://github.com/ry/node/blob/master/lib/timers.js#L92 [06:57] dustinwhittle has joined the channel [06:57] micheil: ryah: it gives you a link on the site to a section of the mozilla javascript documentation [06:57] dustinwhittle has left the channel [06:59] mikeal has joined the channel [07:00] ossareh_ has joined the channel [07:01] richcollins: Any idea why that assert might be violated? [07:02] nsolsen has joined the channel [07:02] CIA-54: node: 03Ryan Dahl 07master * r0922982 10/ doc/index.html : [07:02] CIA-54: node: Add promotejs [07:02] CIA-54: node: Over 2 months late -- this is how much I procrastinate. -_- - http://bit.ly/eURDYm [07:02] rbranson: lol [07:03] luke`_ has joined the channel [07:07] zentoooo has joined the channel [07:07] benburkert has joined the channel [07:07] fangel has joined the channel [07:12] ph^ has joined the channel [07:12] aconbere: hmmm [07:12] aconbere: I'm clearly failing to rework this module path finding code [07:12] aconbere: but it's only failing in some Teensy fraction of the tests [07:13] aconbere: (2 failing tests in the first quarter of the tests) [07:13] aconbere: hmpf [07:13] dkasper has joined the channel [07:14] jchris has joined the channel [07:15] mikedeboer has joined the channel [07:17] dkasper: what's the recommended s3 library for node these days? [07:17] dabtop: I donno \__(O.o)__/ [07:17] dabtop: :( [07:22] TomY has joined the channel [07:27] isaacs_ has joined the channel [07:30] jetienne has joined the channel [07:30] mjr_ has joined the channel [07:33] themiddleman has joined the channel [07:33] MikhX has joined the channel [07:34] pquerna has joined the channel [07:37] ph^ has joined the channel [07:40] simb: anybody still hanging out? [07:40] thebigbad: simb: hallo [07:40] mattcodes_ has joined the channel [07:40] simb: hey thebigbad [07:40] mattcodes_ has left the channel [07:41] nsolsen has joined the channel [07:42] sclaflin has joined the channel [07:45] langworthy_ has joined the channel [07:47] mAritz has joined the channel [07:50] sivy has joined the channel [07:52] simb: so I am using formidable to upload files to express. Anybody got any idea how I an get that file into mongodb? I am using mongoose. [07:52] simb: Do I have to read the uploaded file off the fs and then stick it in the db? [07:53] indutny has left the channel [07:53] altamic has joined the channel [07:54] SamuraiJack has joined the channel [07:57] springify has joined the channel [07:58] isaacs_ has joined the channel [07:59] SubStack: hooray http://substack.net/posts/fcf569 [08:03] markh1 has joined the channel [08:03] markh has joined the channel [08:04] kstt has joined the channel [08:04] rbranson: SubStack: that is awesome... fuck most opt string parsers [08:04] mikew3c_ has joined the channel [08:05] paulwe_ has joined the channel [08:05] indutny has joined the channel [08:06] indutny: is https client actually working on node.js under cygwin? [08:06] indutny: v8++ [08:06] v8bot: indutny has given a beer to v8. v8 now has 0 beers. [08:06] mikew3c_: SubStack: "optimist" is a great name [08:06] mikew3c: and is that a self-portrait? :) [08:07] SubStack: rbranson: yep! [08:07] slaskis has joined the channel [08:07] SubStack: I got the idea from Getopt::Casual [08:08] SubStack: the project has been up a while but I finally got around to blogging about it [08:08] SubStack: for this, my week of blogging, wherein I blog every single day for 6 or 7 days straight [08:09] SubStack: mikew3c: yes, the one on my about page is just for show [08:09] mikew3c: heh [08:09] SubStack: have to keep up appearances [08:11] nsolsen has joined the channel [08:11] simb: Ok, so I think i am having a function scope issue. [08:12] masahiro_ has joined the channel [08:13] simb: I have a fs.readFile but I need access to my req object inside. [08:15] delapouite has joined the channel [08:22] JimBastard has joined the channel [08:22] agnat has joined the channel [08:22] cwo has joined the channel [08:23] dgathright has joined the channel [08:24] simb: ok, nevermind. I did :) [08:25] simb: Ok, so lets say I have the binary data for an image stored in mongodb. and I can retrieve said data. how would I go about having node/express output that data and having the end consumer things its really a jpeg [08:26] mikedeboer has joined the channel [08:26] mjr_: just set the content type header [08:27] mjr_: res.writeHead(200, {"Content-Type": "image/jpeg"}); [08:27] mjr_: res.end(image_data); [08:27] mjr_: I think. [08:28] simb: thats totally what I thought too [08:28] simb: res.writeHead(200, {'content-type': 'image/jpeg'}); [08:28] simb: res.end(photo_data); [08:28] simb: it what I have :) [08:28] mjr_: great! [08:28] mjr_: but... [08:29] simb: it doesnt get interpretted as an image by the browser [08:29] isaacs has joined the channel [08:29] mjr_: have a URL? [08:29] SamuraiJack has joined the channel [08:30] simb: let me see if I can publish this. [08:35] derren13 has joined the channel [08:36] [AD]Turbo has joined the channel [08:38] peutetre has joined the channel [08:39] EyePulp has joined the channel [08:40] ph^ has joined the channel [08:41] Ond: Works fine for me, simb [08:41] rchavik has joined the channel [08:41] simb: Ok, then it must be how I am storing the image. [08:41] simb: So.... :) [08:41] simb: I am using formidable to upload an image [08:41] simb: then using fs.readFile to read it from temp [08:42] polyrhythmic has joined the channel [08:42] simb: and then outputing the contents of the buffer [08:43] simb: I would think that outputing the raw contents of the file would be perfect [08:43] Druid_ has joined the channel [08:43] adambeynon has joined the channel [08:44] mjr_: Are you sure the file on disk is a valid JPEG file? [08:44] tisba has joined the channel [08:45] teemow has joined the channel [08:46] simb: I can open it locally on my computer before I upload it [08:46] simb: I can open the download the tmp file and open it. [08:48] hellp has joined the channel [08:50] breccan_ has joined the channel [08:50] simb: http://pastebin.com/Ps1rb9jR [08:50] simb: that is what I get looking at charles trying to load the url [08:50] simb: well... a ton of binary data that is not displayed there also [08:51] simb: but those are the headers [08:51] svnlto has joined the channel [08:51] rope has joined the channel [08:51] Dreamer3 has joined the channel [08:54] simb: Ok, something is getting lost in there [08:57] aliem has joined the channel [09:03] whyme has left the channel [09:07] rchavik has joined the channel [09:11] revoof has joined the channel [09:14] ntelford has joined the channel [09:16] simb: Ok, so I got the loading of the file from the fs and spitting it back out to the browser. [09:16] simb: thats cool. [09:17] pietern has joined the channel [09:17] simb: I was using fs.readFile with the binary encoding option which mjr_ pointed out is deprecated. [09:17] simb: now I am trying to store the image data in a recored in MongoDB. when it was binary it would store just fine, now when I try to insert the record its failing silently [09:18] peutetre has joined the channel [09:20] SamuraiJack_ has joined the channel [09:20] isaacs_ has joined the channel [09:22] hoodoos has joined the channel [09:24] aubergine has joined the channel [09:24] stride: morning [09:24] ropepy has joined the channel [09:24] indutny: hi [09:26] Ecu-Truin has joined the channel [09:26] Ecu-Truin: 'elo. [09:26] simb: I wonder if I need to base64 enocode the image data before storing it or something. [09:26] Ond: I wonder if it would suffice for your purposes to store the location of the image, instead of the image data. [09:27] Ecu-Truin: I have a kind of odd question, but is there any means in which to run sandboxed javascript within a node.js javascript server? Say for the sake of allowing user scriped content. [09:29] rope has joined the channel [09:31] MikhX has joined the channel [09:31] ryah: Ecu-Truin: checkout a project called 'jefe' [09:31] stride: Ecu-Truin: you can create seperate v8 contexts with the Script object http://nodejs.org/api.html#script-100 (runInNewContext) [09:31] arrty has joined the channel [09:32] stride: ryah: is that really necessary if you don't expose require and stuff? [09:34] ryah: they could block the process [09:35] stride: oh, right, good point :) [09:37] simb: Ok I finally got it. [09:37] Ecu-Truin: Jefe seems to be exactly what I want. Awesome. Now if only there was an easy hosting service for Node.js. xD I'm not fluent with Linux currently. [09:37] sprout has joined the channel [09:37] simb: I had to base64 encode the buffer to stick it in mongoDB through mongoose. [09:37] simb: then rebuild it on output as a new buffer [09:40] twoism has joined the channel [09:41] zinger_ has joined the channel [09:50] lstrojny has joined the channel [09:53] polyrhythmic has joined the channel [09:54] sclaflin has joined the channel [09:57] hoodoos: guys, what is the most awesome redis client now, any idea? :) [09:57] simb: anybody here using mongoose? [09:57] indutny: simb: I'm using [09:57] simb: this may sound silly, but how do I get the _id in a format that is useful? [09:58] indutny: haha :) [09:58] indutny: one moment [09:59] indutny: have you tried .toString() ? [09:59] indutny: or .toObject() on a whole model [09:59] indutny: instance [09:59] Naked has joined the channel [10:00] chapel: has anyone used express for file uploads? [10:00] simb: toString() is being implicitly called I think because adding that to it gets me the same mess [10:00] simb: chapel I did just tonight. [10:00] chapel: I would like to take a POST file upload and immediately pipe it to a remote api [10:00] simb: well actually i used the formidable module within express [10:00] chapel: just curious what I capture the file data with [10:00] chapel: ah [10:01] simb: formidable was super SUPER easy to use [10:03] Iszak has joined the channel [10:03] simb: indutny: the mongoose docs have a findById which I am using and works fine if I past the id [10:03] mauritslamers has joined the channel [10:03] simb: but I can't seem to sort out how to get it from a result set Model.find().all() to get an array of objects. [10:06] aubergine has joined the channel [10:08] abiraja has joined the channel [10:11] markwubben has joined the channel [10:12] isaacs_ has joined the channel [10:12] isaqual_ has joined the channel [10:14] simb: Ok. ObjectID.createFromHexString(id) looks like what I am looking for [10:14] caolanm has joined the channel [10:15] aubergine_ has joined the channel [10:18] slaskis: i just watched ryans latest presentation on yahoo. are those long stacks he was talking about available in the 0.3 branch? [10:19] Ecu-Truin: slaskis, you got a url for the presentation? I'd like to check it out. [10:19] chapel: link slaskis ? [10:19] slaskis: sure, one sec [10:19] slaskis: http://developer.yahoo.com/yui/theater/video.php?v=yuiconf2010-dahl [10:19] jwl: how do i send a file in node.js with HTTP? [10:19] aubergine has joined the channel [10:19] slaskis: Ecu-Truin, chapel: ^^ [10:19] chapel: thanks [10:19] altamic has joined the channel [10:20] Ecu-Truin: Thanks. [10:20] Iszak: jwl, response.write(fileData); perhaps? [10:20] guybrush: socket.pipe() looks awesome :D [10:20] jwl: that simple? [10:20] jwl: ill try [10:23] Naked has joined the channel [10:24] aubergine_ has joined the channel [10:25] slaskis: hmm, i guess not, can't see that patch applied in master at least [10:29] Wyverald has joined the channel [10:30] ewdafa has joined the channel [10:32] Ecu-Truin has left the channel [10:40] zomgbie has joined the channel [10:41] sprout has joined the channel [10:42] isaacs_ has joined the channel [10:43] indutny has left the channel [10:53] unomi has joined the channel [10:54] chapel: hmm, when I send a http post with an image it balks at me and says Error: bad content-type header, unknown content-type: image/png [10:54] simme has joined the channel [10:54] Iszak: what v? [10:55] chapel: express? [10:55] Iszak: no idea then, i don't use express. [10:56] Iszak: time to boot up in ubuntu [10:56] JimBastard: totally updating zztmmo to be on the nodejitsu marketplace [10:57] mauritslamers has joined the channel [10:59] mscdex: JimBastard: you're actually going to finish it? [10:59] JimBastard: mscdex: or die trying [10:59] JimBastard: one little piece at a time [10:59] mscdex: suite [11:00] JimBastard: someone sent me a cold email the other day [11:00] JimBastard: people do want it [11:00] JimBastard: mashing in socket.io should be easy peasy [11:00] JimBastard: im getting the demo back up [11:00] nooder: can someone give example of merging buffers like buf = buf1+buf2 [11:02] JimBastard: http://zzt.nodejitsu.com/ [11:02] JimBastard: there we go [11:03] nooder: JimBastard, nice work! [11:03] JimBastard: nooder: "node server.js" [11:03] JimBastard: its not that hard [11:04] JimBastard: ryan[WIN] did all the real work [11:05] JimBastard: https://github.com/ryanWIN/jzzzt [11:05] shimondoodkin has joined the channel [11:05] aubergine has joined the channel [11:05] svnlto has joined the channel [11:08] svnlto has joined the channel [11:08] iszak has joined the channel [11:08] iszak has joined the channel [11:08] hoodoos has joined the channel [11:13] vineyard has joined the channel [11:15] nooder: http://pastebin.com/1hm9Wm1H what is my mistake? first time copy is ok, but second copy breaks first part [11:15] whyme has joined the channel [11:16] zorzar has joined the channel [11:17] stride has joined the channel [11:19] nooder: why this can happen? position is ok, how can be first part affected? [11:20] aubergine has joined the channel [11:23] nooder: my mistake... [11:28] isaacs_ has joined the channel [11:29] DoNaLd` has joined the channel [11:30] Anti-X has joined the channel [11:32] hellp has joined the channel [11:32] virtuo_ has joined the channel [11:35] lolninja has joined the channel [11:35] lolninja: Hello [11:37] pt_tr has joined the channel [11:37] lolninja: What is the correct way to see if a file doesn't exist, I've tried require('fs').statSync('some/folder/that/doesnt/exist.js').isFile(); but its giving me ENOENT, No such file or directory errors [11:38] whyme: lolninja: fs.stat('/path', function(err, stat){if (err) /*doesn't exist or something*/}) [11:38] ph^ has joined the channel [11:40] proppy has joined the channel [11:40] lolninja: Ah, so you can't use the Sync version for possibly non-existent files because it doesn't return an error, or would a try-catch work? [11:40] caolanm: lolninja: path.exists ? [11:40] ivan has joined the channel [11:40] proppy: Hi, has anyone tried to connect to socket.io using a regular websocket client ? (and node socket.io client library) [11:40] proppy: s/node/not [11:40] caolanm: lolninja: just be aware that path.exists doesn't handle eg permissions errors... which I always thought was dumb [11:41] proppy: I was wondering if websocket objective-C library https://github.com/esad/zimt would be able to connect to as socket.io daemon [11:43] bahamas has joined the channel [11:43] svnlto has joined the channel [11:44] lolninja: caolanm: Ahh ok, thanks for the heads up. [11:45] caolanm: np [11:45] dark has joined the channel [11:46] stride: lolninja: try catch would work as well [11:47] unomi has joined the channel [11:47] altamic_ has joined the channel [11:49] mAritz: i'm kinda annoyed of always having to check if (typeof(variable) !== 'undefined') and it feels like i'm doing it wrong. how should i prevent "undefined has no property x" etc errors? [11:51] Spion_ has joined the channel [11:52] lolninja: stride: ah thanks [11:53] margle has joined the channel [11:54] MrNibblesFreenod has joined the channel [11:55] mscdex: mAritz: is this for assigning a variable/property a value if it's undefined? [11:56] mAritz: mscdex: yeah. but i've had problems with things like var test = variable || {}; [11:56] mAritz: don't remember what kind of problems though [11:56] mscdex: hmm, not sure what problem there'd be [11:57] mscdex: unless the value of variable === 0 [11:57] mscdex: or boolean false [11:57] mscdex: heh [11:57] mscdex: or an empty string [11:57] stagas: mAritz: the alternative isn't that clean either: if (x.y && x.y.z) true [11:58] mscdex: i think someone wrote a function to check a full "path" for a deep object [11:58] mscdex: can't remember where/who though :S [11:58] cheney has joined the channel [11:59] mscdex: anyhoo, time to dive back into OSCAR :> [12:00] stagas: mscdex: it'll still throw check(x.y.z) it needs to be given as a string or something like check(x, 'y', 'z') [12:01] cwo has joined the channel [12:03] mAritz: hm, okay. thanks [12:10] cheney: lets say I have in a file, javascriptfile.js, var a = function () {}, b = function () {}, c = function() {}; How do I execute a() from the command line? [12:10] isaacs has joined the channel [12:11] cafesofie has joined the channel [12:12] fermion has joined the channel [12:14] malkomalko has joined the channel [12:16] whyme: cheney: if (module == require.main) a() [12:16] whyme: then $ node foo.js [12:17] cheney: whyme should I create all the files to turn my function into a module? [12:17] cheney: like index.js and index.node? [12:17] whyme: cheney: no a must, just exports.a = a would work. [12:18] whyme: and require('./foo').a() outside foo [12:24] aubergine_ has joined the channel [12:25] lolninja has joined the channel [12:26] stagas: mAritz`afk: you there? here's a typeof wrapped in a function: https://gist.github.com/723408 [12:27] christophsturm has joined the channel [12:28] beawesomeinstead has joined the channel [12:33] jed_ has joined the channel [12:33] cheney: why I execute prettydiff = require('prettydiff'); from the command line my prompt changes from ">" to "..." in bash [12:34] cheney: what does that mean? [12:36] stagas: cheney: ... means it's expecting more input, the parser didn't complete a statement [12:37] ph^ has joined the channel [12:40] isaacs_ has joined the channel [12:41] jetienne has joined the channel [12:43] mAritz`afk: stagas: hm... that's worth a try. but doesn't really seem like the cleanest solution either [12:44] alup has joined the channel [12:44] stagas: mAritz: the cleanest is doing a typeof :) [12:53] guybrush: mhhh, how do you think about that? https://gist.github.com/723435 [12:55] guybrush: is there a better way to acomplish multiple prototypal inheritance [12:58] oal has joined the channel [13:00] sclaflin has joined the channel [13:02] jmpe has joined the channel [13:03] aklt has joined the channel [13:04] Anti-X has joined the channel [13:10] jed_: is anyone else having the same issues with socket.io disconnecting from websocket and then reconnecting with xhr-polling? [13:10] jed_: https://gist.github.com/723458 [13:11] ianward has joined the channel [13:12] stagas: jed_: I don't know about that, but I'm having issues with socket.io also, it doesn't like being proxied from another port so switches to xhr-polling when it should be using websockets [13:12] stagas: I don't like modules making decisions for me [13:12] jed_: stagas: thanks, glad to hear i'm not going crazy... what do you mean by proxied from another port? [13:13] jed_: i'm running the chat example as is at 8080. [13:14] stagas: jed_: I have a few node servers running on 7000, 7001, 7002 etc and I have nodejitsu's http-proxy routing them all from 80 depending on the hostname [13:14] stagas: jed_: when I run it alone on port 80 it runs fine [13:15] jed_: stagas: but i'm running the chat example on the port it wants and getting the same issue. [13:15] ebi: Is there a simple example on how I create custom events? I have this but it seems utterly wrong ;) http://pastie.textmate.org/private/0vnfzl7q4s5yjcyv86pxg [13:15] Mjollnir` has joined the channel [13:16] stagas: jed_: you're connecting with a websocket enabled client? [13:16] jed_: yeah, latest chrome and latest safari. [13:16] jed_: same issue on both. [13:17] jed_: stagas: running v0.3.2-pre [13:19] stagas: jed_: hm it runs fine here did you try running it as root? [13:20] stride: ebi: var yourThing = function(args) { EventEmitter.call(this); }; util.inherits(yourThing, EventEmitter); [13:21] stride: ebi: iirc that should work [13:21] jed_: stagas: added sudo, same issue. [13:21] jed_: stagas: what is your node -v? [13:21] stagas: 0.3.1 here [13:22] jed_: stagas: okay, just git pulled and rebuilt, and now it's working... [13:23] jed_: stagas: sorry for the trouble there. must have been a short-lived bug. [13:24] stagas: jed_: cool :) lessons learned: don't use -pre stuff unless you're working on node's source [13:24] stagas: :P [13:24] jed_: stagas: lesson learned! thanks, man. [13:24] stagas: np [13:30] charlenopires has joined the channel [13:32] micheil: hey, look, it's jed_, long time no see. [13:32] tobie has joined the channel [13:32] jed_: hey micheil, how ya been? [13:33] micheil: not too bad, just got back from a gig. [13:33] ebi: stride, I am a bit unsure how to use this correctly :) So afterwards I can do something like yourThing.emit('event' and it gets sent and on the other side I do something like yourThing.on('event', do something awesome [13:33] jed_: yeah, i've been off-list recently. only to come back and see that there's a gazillion folks here now. [13:33] jed_: micheil: a gig? [13:33] micheil: yeah, concert/band, children collide. [13:34] okuryu has joined the channel [13:34] jed_: micheil: whoa, had no idea. cool cool. [13:34] splashs has joined the channel [13:34] micheil: so.., (fab) on the client side you mentioned? [13:35] jed_: micheil: is that a tokyo phone number on your site? maybe i should call it... [13:35] micheil: umm, where? [13:35] jed_: micheil: jah, pushed a trial branch here: https://github.com/jed/fab/tree/browser [13:35] jed_: micheil: wait, here? http://www.childrencollide.com.au/ [13:35] micheil: also, that's not a tokyo phone number. [13:36] micheil: they're an aussie band [13:36] jed_: i know i know (it happens to also be a valid tokyo phone number) [13:36] d0k has joined the channel [13:36] jed_: micheil: i confused which side of the stage you were on there for a second. [13:36] micheil: that's either a victorian or queensland number, add a +61 [13:36] proppy: micheil: ping node-websocket-server [13:36] micheil: ha, I'm the audience. [13:37] micheil: proppy: email me, micheil@brandedcode.com, I'll reply in the morning. [13:37] proppy: micheil: you should have received a notification from https://github.com/miksago/node-websocket-server/issues#issue/45 :) [13:37] jed_: micheil: that's right, you're in one of the only timezones later than me. [13:37] micheil: something about write state? [13:37] pagameba has joined the channel [13:37] proppy: yep :) [13:37] Jonasbn_ has joined the channel [13:38] micheil: yeah, I'll check it out tomorrow, hopefully [13:38] proppy: with a tentative path, I can work on a proper pull request if you want to [13:38] micheil: got a few things to fix up in that library. [13:38] proppy: ok, let me know if you need anything elase on my part :) [13:38] micheil: proppy: only if you want your name next to the commit :) [13:38] proppy: I'm not sure how to forward the 'drain' event thought [13:39] hellp has joined the channel [13:39] micheil: yeah, I'll work on that. I'm actually wanting to decouple the connection and manager more [13:40] davidsklar has joined the channel [13:40] svnlto has joined the channel [13:41] micheil: proppy: just add a note about drain and resume to the bug issue, could you? [13:41] proppy: micheil: "exposing the socket 'drain' event would also be wanted." [13:42] proppy: this is already in the bug report :) [13:42] proppy: I don't know about 'resume', what is it ? [13:42] slaskis has joined the channel [13:43] micheil: streams should have a pause() resume() and drain event [13:43] stride: ebi: yep [13:43] whyme: proppy: when you are piping from a fast readable to a slow writable [13:44] ebi: stride, oh I made it working now with this: http://pastie.textmate.org/private/lh6iv6cbzugth7vobgnra [13:44] ebi: And then I have backend.backendEmitter.on('message', frontend.messageListener); [13:44] whyme: there should be pause() to hang it if writable cant handle it [13:45] isaacs_ has joined the channel [13:45] micheil: proppy: although, when draft-03+ is released, we'll have a new & faster parser, which will make a big difference [13:45] proppy: micheil: nice [13:46] stride: ebi: yeah, the only downside is that you can't use a custom / parametrized constrcutor this way I think [13:46] nsolsen has joined the channel [13:46] stride: *constructor even [13:46] ebi: Can I have dependend modules so I pass in objects or something into requires? [13:46] ebi: stride, yeah that's true but I don't need it for now so it's ok :) [13:46] stride: ebi: you can call require in your modules as well if that's what you mean [13:47] tobie: Is there an agreed upon way of creating programatically identifiable errors in third party modules (something akin to Error.errno but "namespaced")? [13:47] ebi: stride, not quite. I want to have for example a module that registers a route in the backend module [13:48] ebi: So I would have to give it the backend instance to do that, right? [13:48] ebi: Oh I could probably do that in the bootstrap file [13:49] stride: yeah but there's nothing wrong with passing a reference to the backend instance imho, if that's already initialized [13:49] Omni5cience has joined the channel [13:50] stride: depends on where you want this configuration for later changes (e.g. central config vs. self registration of your modules) [13:50] strixv has joined the channel [13:51] herbySk has joined the channel [13:52] stride: some people also use the require cache as a global singleton, the first require caches and initializes and subsequent calls just return & use this instance [13:52] ebi: stride, so everytime I require something I get the same instance? Like there is only one created? [13:52] arpegius has joined the channel [13:54] stride: ebi: if you export and use it that way, yep. you could of course only export factory methods that create new instances everytime but the code itself should only be executed once [13:55] tobie: stride: that's what the CommonJS module spec recommends. Doesn't node.js do that by default? [13:59] sclaflin has joined the channel [14:00] altamic has joined the channel [14:00] ph^ has joined the channel [14:01] sitron has joined the channel [14:03] ysynopsis has joined the channel [14:03] paulwe has joined the channel [14:03] stride: tobie: it does but module developers could implement other behaviours (which might make sense in some cases) [14:05] zinger_ has joined the channel [14:07] tobie: stride: Right. Setting module.exports, correct? [14:08] MattJ has joined the channel [14:09] stride: tobie: or stuff like exports.createSomething = function() { return new PrivateClass(); } [14:09] mbrochh has joined the channel [14:09] mbrochh has joined the channel [14:11] tobie: stride: that doesn't make the module any less of a singleton, though. [14:11] wattz: Morning all [14:11] ph^_ has joined the channel [14:11] samh has joined the channel [14:12] whyme: wattz: evening [14:12] mikew3c has joined the channel [14:12] wattz: cursing my day job as they are making write this v8 embedded app and won't just let me use node.. [14:13] stride: tobie: right, but it doesn't keep an internal state either [14:13] RevoOf has joined the channel [14:13] danoyoung has joined the channel [14:15] ysynopsis has joined the channel [14:17] cferris has joined the channel [14:17] jherdman has joined the channel [14:17] vineyard has joined the channel [14:21] splashs has joined the channel [14:22] NovaDesu has joined the channel [14:23] cwo has joined the channel [14:24] mookai has joined the channel [14:24] hzin has joined the channel [14:24] omni5cience_ has joined the channel [14:25] booths has joined the channel [14:27] hzin has joined the channel [14:28] omni5cience_ has left the channel [14:31] hellp has joined the channel [14:32] ben_alman has joined the channel [14:32] killfill has joined the channel [14:33] wattz: wth.. [14:34] stride: wattz: ? :) [14:34] wattz: hi [14:34] wattz: sorry, was venting through my fingers, lol [14:34] stride: hey [14:34] svnlto has joined the channel [14:35] EvanR-work has left the channel [14:39] wattz: trying to figure out C++ issue [14:42] postwait has joined the channel [14:46] isaacs has joined the channel [14:47] ewdafa has joined the channel [14:48] linac has joined the channel [14:49] Blink7 has joined the channel [14:51] killfill has joined the channel [14:53] jashkenas has joined the channel [14:53] jashkenas: Anyone got a favorite isNumber() implementation? [14:54] jed_: jashkenas: what's wrong with yours? [14:54] jashkenas: IE, of course... [14:54] thear has joined the channel [14:54] jashkenas: If you pass it a host object, the + coercion throws an exception. [14:54] akahn has joined the channel [14:54] jed_: jashkenas: gah. [14:54] jashkenas: Not the end of the world, but it would be nice to have a safe way... [14:54] chrischris has joined the channel [14:55] jed_: jashkenas: that coercion was mine, i think. [14:55] jashkenas: Another one I found is: typeof n === 'number' && isFinite(n); [14:55] jed_: +x === x, right? [14:55] jashkenas: yeah, for NaN... [14:55] jashkenas: right. [14:55] zinger_: jashkenas: number can be object as well [14:55] jashkenas: currently, we have: (obj === +obj) || (toString.call(obj) === '[object Number]'); [14:55] zinger_: if i = new Number(); [14:56] jashkenas: zinger_: thanks -- that's why that won't work. [14:56] gkatsev: v8: isNaN('5') [14:56] jashkenas: There's got to be a good way though... It would be impressive if it were actually impossible to write a cross-browser isNumber in js... [14:56] v8bot: gkatsev: false [14:56] zinger_: check constructor if its a object ? [14:56] boaz has joined the channel [14:56] gkatsev: v8: !isNaN('5324234342') [14:56] v8bot: gkatsev: true [14:56] gkatsev: v8: !isNaN('5324234342fdsafdfsa') [14:56] v8bot: gkatsev: false [14:57] jimt has joined the channel [14:57] mytrile has joined the channel [14:58] BillyBreen has joined the channel [14:58] lstrojny has joined the channel [14:58] jamund has joined the channel [15:00] jashkenas: so, no takers? no bulletproof isNumber() implementations floating around? [15:00] wattz: why would Local obj = Object::New(); give me a EXC_BAD_ACCESS / Reason KERN_PROTECTION_FAILURE... [15:00] lolninja has left the channel [15:00] wattz: so purplexing [15:01] ph^ has joined the channel [15:02] killfill has joined the channel [15:02] cafesofie has joined the channel [15:02] q_no has joined the channel [15:04] jashkenas: this look alright? obj === 0 || (obj && obj.toExponential && obj.toFixed); [15:05] maushu has joined the channel [15:05] paulrobinson has joined the channel [15:06] bzinger: jashkenas: convert into string then regex :) [15:06] jashkenas: bzinger: yeah, no thanks. the above doesn't work for NaN. [15:07] skohorn has joined the channel [15:07] bzinger: check for NaN first, and use converting string as last resource [15:07] rwaldron_ has joined the channel [15:07] bzinger: I know its ugly [15:08] cafesofie has joined the channel [15:08] jchris has joined the channel [15:10] tamerami has joined the channel [15:10] jashkenas: bzinger: here's what I think I'm going with: https://gist.github.com/723607 [15:12] liar has joined the channel [15:12] stepheneb has joined the channel [15:13] femtoo has joined the channel [15:14] bzinger: jashkenas: that looks fine, should be cover most of the cases:) [15:14] aheckmann has joined the channel [15:16] paulwe has joined the channel [15:16] kriszyp has joined the channel [15:17] isaacs has joined the channel [15:19] kjeldahl_ has joined the channel [15:19] svnlto has joined the channel [15:20] akahn has joined the channel [15:21] matt_c has joined the channel [15:22] cafesofie has joined the channel [15:24] tekky has joined the channel [15:25] cafesofie has joined the channel [15:26] aconbere has joined the channel [15:27] herbySk: v8: let n = NaN; typeof n.valueOf() [15:27] v8bot: herbySk: SyntaxError: Unexpected identifier [15:28] herbySk: v8: var n = NaN; typeof n.valueOf() [15:28] v8bot: herbySk: "number" [15:28] herbySk: var n = 8; typeof n.valueOf() [15:28] herbySk: v8: var n = 8; typeof n.valueOf() [15:28] v8bot: herbySk: "number" [15:29] herbySk: v8: var n = Number(3); typeof n.valueOf() [15:29] v8bot: herbySk: "number" [15:29] Anti-X: v8: typeof typeof 0 [15:29] v8bot: Anti-X: "string" [15:29] Anti-X: v8: typeof typeof [15:29] v8bot: Anti-X: SyntaxError: Unexpected end of input [15:29] Anti-X: lies [15:29] herbySk: jashkenas: wouldn't this "duck typing" number test suffice? [15:30] jashkenas: That's what I'm going to use, yes. [15:30] jashkenas: commit + tests: https://github.com/documentcloud/underscore/commit/6b8bb0cacd315ffa9bb2008cc61fa3137e77eb6b [15:31] jimt_ has joined the channel [15:32] herbySk: jashkenas: I mean, based on my tries above, that is, by checking that typeof x.valueOf() === "number" [15:32] tisba_ has joined the channel [15:32] jashkenas: let's find out... [15:32] herbySk: (but maybe it's too high-level...) [15:32] bentruyman has joined the channel [15:33] ceej has joined the channel [15:33] jashkenas: doesn't work on undefined. [15:33] Anti-X: there are some quirks that are seriously annoying... like passing undefined for a regex check automatically passes it [15:33] jashkenas: v8: typeof (void 0).valueOf() [15:33] v8bot: jashkenas: TypeError: Cannot call method 'valueOf' of undefined [15:33] Anti-X: to duck typing isn't very suitable for js [15:34] jashkenas: v8: (/abc/).test(void 0) [15:34] v8bot: jashkenas: false [15:34] Anti-X: v8: /abc/.test(undefined) [15:34] v8bot: Anti-X: false [15:35] Anti-X: hm [15:35] herbySk: jashkenas: yes, null and undefined does not have properties, of course; it needs a few checks like [15:35] herbySk: x != null && x.valueOf && typeof x.valueOf() === "number" [15:36] jashkenas: that looks pretty good. [15:36] herbySk: v8: { valueOf: function () { return 3; } } + 4 [15:36] v8bot: herbySk: SyntaxError: Unexpected token ( [15:37] herbySk: v8: ({valueOf:function() {return 3;}}) [15:37] v8bot: herbySk: {"valueOf": function () {return 3;}} [15:37] jashkenas: to change the subject -- is there any ECMA5-compliant way to stop the iteration of a forEach loop? [15:37] herbySk: v8: ({valueOf:function() {return 3;}}) + 5 [15:37] v8bot: herbySk: 8 [15:37] herbySk: yes! [15:37] herbySk: number ducktyping is actually used by v8 [15:38] herbySk: jashkenas: use every or same when you want to stop the loop [15:38] herbySk: s/same/some/ [15:38] margle has joined the channel [15:38] jashkenas: herbySk: so that's a no, then... [15:38] herbySk: jashkenas: yes [15:39] herbySk: afaict [15:39] sivy: hi folks; I'm still trying to get my head around node's callback pattern, and I have a question about "this" [15:39] jashkenas: herby: thanks. [15:39] sivy: if I'm defining an object with a method (on TheObject.prototype) and in that method I use an async callback, what is the value of "this" within the callback? [15:39] Ond: "this" isn't particular to node [15:39] sivy: Ond: I know, node is just where i started using callbacks a lot [15:40] herbySk: sivy: neither it is particular to callbacks, but go ask [15:41] herbySk: ah, you already did [15:41] jankoprowski has joined the channel [15:42] frio80 has joined the channel [15:42] Ond: "this" refers to the containing object, sivy [15:43] sivy: Ond, hm. So, this is kinda what i'm working with: [15:43] sivy: https://gist.github.com/723654 [15:43] sivy: the second [15:43] cronopio has joined the channel [15:43] sivy: "this" is the same as th firrst? [15:44] herbySk: sivy: idk. I would look into node source. But I _think_ no particular object is put as null, so it is the global object, but it is only what I presume [15:46] Ond: In that case it should refer to libdothing, sivy [15:46] Ond: (I think) [15:46] Ond: Feel free to test [15:46] cronopio: Good Morning for lovers of javascript!! [15:46] Ond: ACTION tips hat [15:46] herbySk: sivy: either libdo_thing() or global object, I'd say [15:47] herbySk: sivy: look at lib/events.js, there is the code that invokes on(...) callbacks (in emit function) [15:47] jpick has joined the channel [15:48] FuzzYspo0N has joined the channel [15:49] FuzzYspo0N: hey guys, i need some help with v8. Any ninjas around? [15:50] lin_ has joined the channel [15:50] pagameba: FuzzYspo0N: don't ask to ask, just ask :) [15:50] FuzzYspo0N: Of course. But if nobody knows v8, (cos this is more of a node channel...) [15:50] FuzzYspo0N: :) [15:51] Wyverald: Still... we wouldn't be having this conversation if you simply asked. [15:51] Wyverald: Save everyone's time, shall we? =] [15:51] sivy has joined the channel [15:51] softdrink has joined the channel [15:51] thecoon has joined the channel [15:52] FuzzYspo0N: Or if you didn't say something irrelevant :P But yea, basically im using v8 for a project and have been for like a year. But there is something weird in current svn, wondering if anyone else is seeing it (as an embedded user) [15:52] davglass has joined the channel [15:52] FuzzYspo0N: Objects coming in from callbacks have properties as undefined, but are obviously there [15:52] cafesofie has joined the channel [15:55] isaacs has joined the channel [15:56] pagameba: I haven't seen that myself yet [15:56] ivanfi has left the channel [15:59] FuzzYspo0N: pagameba, thanks. For example : v8::String::Utf8Value t1( p1->Get(0)->ToDetailString() ); [16:00] FuzzYspo0N: v8::Handle p1 = args[0]->ToObject(); [16:00] v8bot: FuzzYspo0N: SyntaxError: Unexpected token : [16:00] wattz: ryah: you around today? :D [16:00] FuzzYspo0N: It prints undefined (or at least im looking in the debugger) [16:00] benburkert has joined the channel [16:02] zomgbie has joined the channel [16:02] matt_c has joined the channel [16:03] pagameba: FuzzYspo0N: weird. I'm using ToObject in a node extension and its not giving me undefined. You said something about callbacks? [16:03] Durl has joined the channel [16:03] FuzzYspo0N: pagameba, for example a draw line function. static v8::Handle DrawLine(const v8::Arguments& args); [16:03] altamic has joined the channel [16:04] FuzzYspo0N: Inside of that, the args[0] IS an object. But it has no properties according to Get(0) [16:04] FuzzYspo0N: unless thats the wrong way to do it (iv used it before, not sure) [16:05] pagameba: FuzzYspo0N: is it a generic object created in javascript? or a v8::Object subclass? [16:06] jashkenas has left the channel [16:06] FuzzYspo0N: double test = p1->GetRealNamedProperty(v8::String::New("x"))->NumberValue(); [16:06] FuzzYspo0N: This also says NAN cos its undefined [16:06] FuzzYspo0N: pagameba, var s = new Object(); [16:06] FuzzYspo0N: s.x = 100; uii.drawLine( s, 100); [16:07] FuzzYspo0N: Either way fails, using { x:100 } , using a custom normal object in js. Its so primitive, i can't understand why its not working. I have never hit any issues with v8 till this (so its confusing) [16:07] pagameba: FuzzYspo0N: looking in my code to see if I'm doing something similar ... [16:08] FuzzYspo0N: Thanks pagameba . The 100 in the args[1] works just fine [16:08] FuzzYspo0N: as with the rest of my engine, its just an object i cant seem to get the values of. [16:08] aubergine has joined the channel [16:08] dnolen has joined the channel [16:08] EyePulp has joined the channel [16:10] booths: A little confused on how these out of memory problems are happening, and wondering if it's just because it's cygwin... heapTotal doesn't seem to be gradually spiking, granted I am parsing a lot of xml and while parsing it jumps to about 10,000,000, but it's at about 5,900,000 during idle periods... /confused [16:10] foo_ has joined the channel [16:16] jimt has joined the channel [16:21] matt_c has joined the channel [16:24] pagameba: FuzzYspo0N: sorry, work interruptiosn. I don't actually use that pattern anywhere in any of the code I wrote ... did this just start happening after a recent update to v8? [16:24] gf3 has joined the channel [16:24] FuzzYspo0N: pagameba, let me rather ask. How would i get the objects properties in the callback from c++ ? (its a lame question, but ill just start at the foundations so to be sure) [16:33] ysynopsis has joined the channel [16:33] mraleph: FuzzYspo0N: did this issue with undefined appear recently ? [16:34] FuzzYspo0N: I have used this approach before and it worked. Thats what is confusing me. the rest of the code base is using direct values for callbacks, these ones need the objects and i cant see the values. [16:34] xla has joined the channel [16:34] davidascher has joined the channel [16:34] mraleph: which V8 version are you using? [16:35] unomi has joined the channel [16:35] mraleph: recently there was a refactoring there which might have caused that. [16:35] sprout has joined the channel [16:36] FuzzYspo0N: One sec, checking svn rev and version [16:36] peutetre has joined the channel [16:36] cjmFloating has joined the channel [16:37] FuzzYspo0N: SVN : 5888 Version reports 1.5.8 [16:37] FuzzYspo0N: 2.5.8* mraleph [16:37] amacleod has joined the channel [16:39] FuzzYspo0N: Ill try updating to latest trunk and see if that changes anything in the mean time. Its just so trivial, i can't understand where the breakdown would be. Its not like i am learning the api here lol :) [16:39] FuzzYspo0N: Makes me feel stupid at times. [16:39] hamsterspider has joined the channel [16:39] strmpnk has joined the channel [16:39] mraleph: FuzzYspo0N: have you tried to use ->Get instead of GetRealBlaBlaBla [16:39] mraleph: ? [16:40] FuzzYspo0N: mraleph, if you had seen my original comment : v8::String::Utf8Value t1( p1->Get(0)->ToDetailString() ); [16:40] FuzzYspo0N: returns undefined, on a new object with lots of properties. None from Get( 0 ) all the way to 10, have anything but undefined [16:41] mraleph: a->Get(0) returns value at 0. so it's equivalent of a[0] in JavaScript [16:41] stephank has joined the channel [16:42] FuzzYspo0N: hmm, so getRealNamed? [16:43] cardona507 has joined the channel [16:43] FuzzYspo0N: Ok true, thanks mraleph then Get(0) isn't the way to do that. What is the *correct* methodology of accessing the field properties on that object according to v8 [16:43] mraleph: FuzzYspo0N: try ->Get(String::New("x")). [16:43] jacksonh has joined the channel [16:44] FuzzYspo0N: HAH. I never looked for the overloads, let me try that. [16:44] FuzzYspo0N: Sometimes i am stupid* [16:46] slaskis has joined the channel [16:46] FuzzYspo0N: mraleph, thats awesome thanks. I think i have been confused by updating the svn and refactoring too easily there. [16:46] FuzzYspo0N: back to the code [16:46] muk_mb has joined the channel [16:47] Anti-X has joined the channel [16:47] lordof3d has joined the channel [16:49] lordof3d: hi! I get the following error when running make test with node.js: AssertionError: deepEqual ["127.0.0.1"] Any ideas? [16:49] mraleph: FuzzYspo0N: so it works? [16:50] FuzzYspo0N: mraleph, perfectly [16:51] paulrobinson_ has joined the channel [16:51] bentruyman has joined the channel [16:52] bentruyman has joined the channel [16:52] maushu: lordof3d, maybe its getting localhost instead. [16:52] isaacs has joined the channel [16:52] flashingpumpkin has joined the channel [16:52] daniellindsley has joined the channel [16:54] jacksonh: are items in TODO up for grabs? [16:54] lordof3d: maushu, no it does not. when runnning the twitter example from the page, I get ECONNREFUSED Could not contact DNS servers [16:54] jakehow has joined the channel [16:54] maushu: Your resolv.conf is wrong. [16:55] simb has joined the channel [16:55] delapouite has joined the channel [16:55] simb: morning! [16:55] tobie has joined the channel [16:56] simb: any mongoose users up and about yet this morning? [16:56] drudge: probably, you should ask your question ;) [16:57] Anti-X: morning? where are you? hawaii? [16:57] matt_c_ has joined the channel [16:57] drudge: it's 11:57, still morning until 12! [16:57] simb: not hawaii but PST :) [16:57] Anti-X: and when you say 'yet' and it's 11:57... what kind of schedule are you on? [16:57] simb: I am trying to use Model.findById() to lookup an item. [16:58] simb: I am getting the id value from a model.find().all() call. [16:58] tilgovi has joined the channel [16:58] simb: but I have some monkey hex, and I need to turn it back into the decmimal equivelent and I am having trouble. [16:59] stepheneb has joined the channel [16:59] drudge: findById takes hex [16:59] RevoOf has joined the channel [16:59] simb: but I can't pass the hex via the url [17:00] simb: and if I copy the id numeral that i see int he mongo console my code works. [17:00] simb: so I need to turn { id: 'L\u00f6\u0017\u00eb\u00e8\u0097\u00df\u00b5\u008d\u0000\u0000\u0003' } [17:00] simb: into "_id" : ObjectId("4cf617ebe897dfb58d000003") [17:01] Aria has joined the channel [17:01] [[zz]] has joined the channel [17:02] amerine has joined the channel [17:03] akahn has joined the channel [17:04] jimt has joined the channel [17:05] simb: Or how about this. if I use sys.inspect to view an object that was returnd from Model.find().all() in mongoose how would I see the id property? [17:06] simb: because the _id property has that big L string. [17:06] simb: so maybe I am just trying to get the value the wrong way [17:07] bingomanatee has joined the channel [17:07] bingomanatee: any thoughts on http://groups.google.com/group/mongoose-users/browse_thread/thread/e94c2b9665374854? [17:08] Wizek has joined the channel [17:09] jimt_ has joined the channel [17:10] bingomanatee: Also as a node.js N00B I am unfamiliar with constructs such as "forEach" and "all" - are they a part of node.js and if so where are they documented? [17:10] Athox has joined the channel [17:11] caolanm: bingomanatee: no, that's not node specific [17:11] caolanm: plain 'ol javascript [17:12] caolanm: bingomanatee: https://developer.mozilla.org/en/new_in_javascript_1.6 [17:12] bingomanatee: thanks [17:12] proppy has joined the channel [17:13] caolanm: bingomanatee: don't go trying it in IE though ;) [17:13] Wizek: What is the easyest way to delete variable objects (multilevel) based off a string? Like, I have a string: "foo-baz-bar", that means, I want to delete obj.foo.baz.bar in the first turn, then eliminate all remaining objects on that way which remained empty [17:13] bingomanatee: IEEEEEE! [17:14] springmeyer has joined the channel [17:14] peritus- has joined the channel [17:16] peritus-: i see ServerRequest has three properties that could represent the incoming connection, .connection / .client / .socket - which one should i replace if i pipe the incoming connection through a filter ? [17:18] faust45 has joined the channel [17:18] peritus-: or: is there a `gzip --decompress` middleware somewhere i can look at ? one that decompresses incoming post-payloads ? [17:18] tobie has joined the channel [17:20] benburkert has joined the channel [17:21] davglass has joined the channel [17:22] tobie has joined the channel [17:22] frio80 has joined the channel [17:22] isaacs has joined the channel [17:22] aconbere has joined the channel [17:24] slloyd has joined the channel [17:25] aconbere: isaacs: when looking for modules, do we explicitly want to prefer /. over //index. ? [17:25] Aria: I would! [17:28] aconbere: we don't have any tests right now that attempt to enforce that behavior [17:28] aconbere: so currently the function could easily be rewritten without that in mind [17:30] simb: so when I use mongoose to do a Model.find().all() I get back an array of objects that looks like these http://pastebin.com/phC3VDnS [17:30] jpick has joined the channel [17:30] simb: how do I access the _id property that is in the _partial variable. [17:30] simb: item.username gets me what is in __doc [17:32] simb: what am I doing wrong that the _id is getting turned into an object I suppose is really the question at hand [17:34] CIA-54: node: 03Ryan Dahl 07master * r1fe450c 10/ doc/index.html : fix typo - http://bit.ly/er4RUC [17:34] CIA-54: node: 03Ryan Dahl 07master * r504a80d 10/ (src/node_crypto.cc src/node_crypto.h): Rename VerifyPeerError to VerifyError - http://bit.ly/eywErH [17:34] CIA-54: node: 03Ryan Dahl 07master * r28a86c3 10/ (src/node_crypto.cc src/node_crypto.h): Remove unnecessary call to X509_STORE_free - http://bit.ly/f8Vmfr [17:35] CIA-54: node: 03Ryan Dahl 07master * r855210c 10/ lib/securepair.js : add shouldVerifyPeer param to SecurePairs - http://bit.ly/gnnddF [17:35] CIA-54: node: 03Ryan Dahl 07v0.2 * r30a3dfe 10/ (src/node_crypto.cc src/node_crypto.h): Remove unnecessary call to X509_STORE_free - http://bit.ly/ef40Eh [17:35] sonnym has joined the channel [17:35] jimt has joined the channel [17:35] stepheneb has joined the channel [17:35] derren13 has joined the channel [17:37] noahcampbell has joined the channel [17:38] swistak has joined the channel [17:39] ianward has joined the channel [17:40] dguttman has joined the channel [17:40] jimt_ has joined the channel [17:43] aconbere: hmpf [17:43] sprout has joined the channel [17:44] MikhX has joined the channel [17:44] aconbere: so test_repl fails for me but it fails because it sends "require('/a.js')" [17:44] aconbere: but require shouldn't work with the extension at the end ... should it? [17:45] aconbere: it seems like that should be sending [17:45] aconbere: "require('/a')" [17:47] RevoOf: hi. in express: is there a way to get the requested url in the callback? [17:47] jed__ has joined the channel [17:47] swistak_ has joined the channel [17:48] RevoOf: e.g. http://nopaste.info/117ee40eec.html [17:49] q_no has joined the channel [17:50] mies has joined the channel [17:51] stagas: RevoOf: console.log(require('sys').inspect(req)) [17:51] msekimura has joined the channel [17:53] matt_c has joined the channel [17:54] galaxywatcher has joined the channel [17:54] RevoOf: stagas: thank you. sys.inspect seams to be useful :) ... its req.originalUrl [17:57] simb: ok mongoose is officially killing me. [17:57] V1 has joined the channel [17:57] jimt has joined the channel [17:57] dnolen has joined the channel [17:58] aconbere: simb, why not inspect what the _id object is? [17:58] aconbere: or if you want the id in the partial slot [17:58] aconbere: why not access it? [17:58] dgathright has joined the channel [17:58] booths: Anyone know of a way to debug node.js via cygwin? I keep getting CALL_AND_RETRY_2 Allocation Failed - process out of memory, but it seems to happen only have a long period of time. Also, heapTotal doesnt seem to be building gradually. [17:58] omni5cience has joined the channel [17:58] simb: aconbere: don't know how to access it :) [17:58] omni5cience has left the channel [17:59] simb: if I hit item.username it gets the values from the __doc object [17:59] simb: so i don't know how to get __partial data [17:59] simb: I'd stop trying to figure out what I am doing wrong if I could just touch that data [18:00] stepheneb_ has joined the channel [18:00] rauchg_ has joined the channel [18:01] booths: No ideas? Damn... not sure what the problem is then. [18:02] jimt_ has joined the channel [18:03] aconbere: simb: where did you get the object you linked to in nopaste? [18:03] twoism has joined the channel [18:03] simb: its one of the items in the array I got back from Model.find().all() [18:04] cafesofie has joined the channel [18:04] bartt has joined the channel [18:05] aconbere: what does item.__partial return? [18:05] simb: which I got from running console.log('pics: ' + sys.inspect(pics)); [18:05] isaacs has joined the channel [18:07] simb: undefined [18:08] jimt has joined the channel [18:08] deepthawtz has joined the channel [18:11] aconbere: bah, only one _ [18:11] aconbere: _partials [18:12] aconbere: though, the underscore propably tells us you shouldn't be using it :) [18:12] simb: I tried it with both [18:12] simb: first with one and then I saw you had two [18:12] yozlet has joined the channel [18:12] booths: isaacs: does npm have a command to show you the path it's installing to? [18:12] simb: I even tried adding a getter to the model that returns this.__partials [18:13] simb: aconbere: Do you mind looking at my model to see if I did somethign dumb? http://pastebin.com/3rwbyXBG [18:14] simb: I just added all the other stuff in troubleshooting. [18:14] simb: it used to be just the properties that were defined [18:14] modular has joined the channel [18:14] WhenRaptors has joined the channel [18:14] aconbere: heh, I don't know anything about mongoose (reading the docs right now) [18:14] WhenRaptors: what is the npm module list url? [18:14] cagdas has joined the channel [18:14] aconbere: apparently this is a deeper issue than I can figure out by just guessing :) [18:14] simb: oh, sorry. Don't go out of your way :) [18:14] simb: I appreciate the help. [18:15] aconbere: wish I could be more useful [18:16] simb: its all good. I am writing an application (personal project) i wantd to launch today. its called Decembeard. [18:16] simb: I have not shaved in 11 years and I am going to today [18:16] aconbere: haha [18:16] simb: and then take pictures each day in december as it grows back [18:16] aconbere: fear the chin [18:17] simb: I built an app that uses twitter to login, and you can take a picture using flash webcam. [18:17] simb: I store the data in the mongodb. [18:17] simb: the only piece that is left is reading the damn image out. [18:17] simb: which i have working when I hit the url pasting in the short hex that is the db objects id [18:17] simb: but I can't seem to get that damn id using mongoose. [18:18] simb: if I could get this id properly, then I could finish the webcam and people could start taking pics [18:19] davidascher has joined the channel [18:19] Aria has joined the channel [18:19] dmcquay has joined the channel [18:20] ezmobius has joined the channel [18:20] aconbere: sounds fun anyway [18:20] aconbere: minus the not fun parts [18:21] simb: I am so damn close its not even funny [18:23] qFox has joined the channel [18:28] Ond: Why is a login required for that, simb? [18:29] simb: I let people upload pictures. I need to know who you are to store your pics [18:29] benburkert has joined the channel [18:31] malkomal_ has joined the channel [18:32] vnguyen has joined the channel [18:34] jacksonh has left the channel [18:35] daniellindsley has left the channel [18:35] mjr_ has joined the channel [18:36] isaacs_ has joined the channel [18:37] pedrobelo has joined the channel [18:37] flashingpumpkin has joined the channel [18:38] dguttman has joined the channel [18:38] twoism has joined the channel [18:38] heavysixer has joined the channel [18:39] masahiroh has joined the channel [18:40] meandi has joined the channel [18:40] malkomalko has joined the channel [18:41] alexfner has joined the channel [18:41] simb: ok, screw it. I am only using one db. so I'll just make my own id's and use those [18:41] isaacs: booths: npm config get root [18:41] dguttman has joined the channel [18:42] isaacs: WhenRaptors: http://registry.npmjs.org/ [18:42] isaacs: WhenRaptors: or http://npm.mape.me [18:42] booths: Thanks isaacs [18:42] jimt_ has joined the channel [18:44] bingomanatee_ has joined the channel [18:48] dgathright has joined the channel [18:49] jimt has joined the channel [18:49] langworthy has joined the channel [18:51] paulrobinson has joined the channel [18:51] fly-away has joined the channel [18:53] twoism_ has joined the channel [18:53] jed__ has joined the channel [18:54] dguttman_ has joined the channel [18:54] jed__ has joined the channel [18:55] _mythz has joined the channel [18:55] xla has joined the channel [18:58] matt_c_ has joined the channel [18:58] jimt has joined the channel [18:59] ooooPssss has joined the channel [18:59] smcq has joined the channel [18:59] fermion has joined the channel [19:01] dguttman has joined the channel [19:03] jimt_ has joined the channel [19:06] daniellindsley has joined the channel [19:06] isaacs_ has joined the channel [19:08] daniellindsley has left the channel [19:09] booths: Is storing a large object somehow a bad idea that won't reflect in memory? I'd think if it were a problem I'd see the memory gradually build as the objects size did. [19:09] InsDel has joined the channel [19:11] technoweenie has joined the channel [19:11] technoweenie: hey is anyone working on a libgit2/node binding [19:14] booths: everyone afk? [19:15] gkatsev: any node modules to talking with Oracle sql databases? [19:15] drudge: not yet, wink_ is working on odbc bindings for node [19:16] aconbere: booths: it should be safe to expect memory to grow (perhaps not linearly) with the size of an object [19:16] V1: pew pew [19:16] gkatsev: ok, thanks. I guess I can't use node at work currently. :( Would've been awesome [19:16] drudge: gkatsev: you could always write one :) [19:16] gkatsev: drudge: heh, don't have the time. [19:17] MikhX has joined the channel [19:18] booths: aconbere: Right, I'd expect that, but I'm having an issue w/ a crash after several hours with no real pattern behind it, saying the process ran out of memory. I'm trying to figure out why. [19:19] booths: I'm debugging right now in Eclipse and I can't seem to find any variables that are sticking around. [19:19] gkatsev: drudge: if I had the time, i'd have been willing to do so. [19:19] gkatsev: and I doubt I can implement one in 2 days. [19:21] tobie has joined the channel [19:21] mikeal: ryah: looking at net.Stream [19:21] mikeal: i thought you were removing readyState? [19:22] stride: gkatsev: no more sleep and intravenous coffee, go [19:22] booths: aconbere: I'd imagine that the object would start showing an impact in memory before it'd crash because of memory. [19:23] ossareh has joined the channel [19:23] ryah: mikeal: soon [19:23] ryah: mikeal: for the callbacks use another array similar to outputEncoding [19:24] ryah: outputCallbacks [19:24] mikeal: right now i'm just poking [19:24] mikeal: i don't have time to write this today [19:25] mikeal: there is a lot more code here than I expected [19:26] mikeal: all this pooling and shifting [19:26] cjmFloating has joined the channel [19:26] rdeshpande has joined the channel [19:29] yozlet has joined the channel [19:30] agnat has joined the channel [19:33] aconbere: booths: so presumably you've taken steps to introspect the memory use of Node and you're disagreeing with it's out of memory assertion? [19:33] aconbere: or are you trying to find what's taking memory? [19:33] dabtop has joined the channel [19:34] heavysixer has joined the channel [19:34] pedrobelo has joined the channel [19:34] booths: I'm trying to find why it's crashing w/ out of memory. I'm not disagreeing that it's out of memory though. Currently I dump the memory usage every minute and it's pretty consistant over the course of the time it takes to crash, doesn't build up or anything. [19:37] rdeshpande: hey guys, im kind of lost in the number of frameworks available for node at the moment. i'm looking for something with robust logging, and a REPL to plug into production. so far i've looked at connect. we are building a chat server so don't need support for static assets, etc.. pure JSON over HTTP [19:37] isaacs has joined the channel [19:37] rdeshpande: any tips? [19:37] Aria: connect's a good place to start. [19:37] Aria: REPL is almost entirely orthagonal-- you can require the repl and just use it. [19:37] confoocious has joined the channel [19:37] confoocious has joined the channel [19:37] booths: Average heapused hovers around 6,000,000, although I'm not sure if that's what'd cause the crash. [19:37] Aria: Most of the Node frameworks are REALLY simple. Like "read, understand" simple. [19:38] adambeynon has joined the channel [19:39] Aria: And so far, most of them play nice with others to various degrees. Some want to take over the createServer functions, some slip into an existing req/response cycle. [19:39] Aria: But other than that, you can combine things in pretty arbitrary ways. [19:39] ibolmo has joined the channel [19:40] aconbere: booths: Any logging from the host side? [19:40] booths: What sort of logging? [19:40] V1: So anyone here want to help create a advent calendar for Node.js :)? [19:40] ibolmo: anyone familiar with a project that is similar to mechanize? https://github.com/tenderlove/mechanize [19:40] rdeshpande: Aria: great, thanks for the info [19:41] aconbere: well I guess I'm just wondering if you could log out the view of the memory use from the hosts side, ever 10 seconds (shove it into RRD) and watch it there [19:41] aconbere: see if you get better data [19:41] jakehow has joined the channel [19:41] agnat has joined the channel [19:42] rdeshpande: booths: just curious - what modules are you using with node right now? [19:42] rdeshpande: booths: (in the app that is having memory issues) [19:43] jvolkman-work: I've been running into performance issues processing large amounts of incoming JSON data. I put together a simple micro-bench that iterates over the characters in a string a bunch of time. Anyone know why v8's performance is so lacking in comparison to Java in this scenario? [19:43] booths: xml2js(sax) socket.io choreographer and node-mysql [19:43] jvolkman-work: https://gist.github.com/a13ce66c4b9ad29d2178 [19:43] jvolkman-work: perhaps Java is just ridiculously fast at this particular operation [19:43] booths: Although the crash happens w/o connections to socket.io and no requests to the server being made [19:44] booths: It was happening before I started using node-mysql as well, which would only leave xml2js which uses isaacs sax parser, but it doesn [19:44] aconbere: jvolkman-work: maybe write a C / C++ addon [19:44] rdeshpande: hrm [19:44] booths: doens't seem to be caused by parsing a large number of tickets, unless the parser is keeping data around somewhere, but i'd expect memory to grow [19:45] isaacs: booths: libxml2js doesn't use my sax parser, does it? [19:45] isaacs: it uses libxml2 [19:45] booths: I believe the thing said yours, i'll check again [19:45] tobie has joined the channel [19:45] booths: isaacs: yeah, yours, https://github.com/maqr/node-xml2js/ [19:46] matjas has joined the channel [19:46] isaacs: oh, hey [19:46] isaacs: that's a different thing [19:46] isaacs: libxml2js ≠ xml2js [19:46] booths: just xml2js [19:47] isaacs: right [19:47] booths: I'm not sure i understand your question then :P [19:48] booths: I could use a different parser if that's the case, but I'd prefer not having to go back and change code [19:48] sandymahalo: hm, nodeknockout seems to be down [19:49] V1: nodeknockout was probably hosted on the old no.de alpha servers [19:49] V1: And they are taken down [19:49] sandymahalo: ahh [19:49] sandymahalo: shoot [19:49] mikeal has joined the channel [19:50] sandymahalo: anyone know another place i can see a list of the teams/products? [19:50] V1: you can try the blog, [19:50] V1: http://nodeknockout.posterous.com/ [19:50] sandymahalo: also there's a techcrunch article on it that lists their favorites: http://techcrunch.com/2010/09/01/nodejs-knockout/ [19:50] sandymahalo: V1: sweet, thanks [19:51] V1: but than again, if the attendees didn't move there submission to the new no.de server ( like i did ) they might not work [19:52] svnlto has joined the channel [19:52] derren13 has joined the channel [19:53] chapel: hmm, I am trying to use formidable, but it seems it only accepts multipart headers from forms, I was trying to use it with a desktop app that posts an image, but it posts the content-type header as image/png, hmm anyone have any experience with formidable, or a simple way to capture the image data in real time and stream it to an external api? [19:54] Ond: simb is your man. [19:55] admc has joined the channel [19:55] booths: isaacs: I think it has to be that it's running through cygwin or something... I parse 1k packets on startup and the heapused is still at 5m afterwards, granted it does go a little higher while parsing, it settles back down and stays there, doesn't gradually climb or anything. There aren't really any differences between minute 1 and hour 4 in terms of functions being called. [19:56] booths: I can't really see it being anything in the code, or the memoryUsage() would reflect a difference between minute 1 and hour 4, at least I'd think so. [19:56] jacobolus has joined the channel [19:56] svnlto has joined the channel [19:56] aconbere: hmmmm [19:57] mikeal: isaacs, ryah, mjr_: you guys up for drinks on friday? [19:57] aconbere: booths: can you do a test where you just try to build a big memory hogging object [19:57] caolanm has joined the channel [19:57] mikeal: i think guillermo is in town too [19:57] aconbere: (a list with a bunch of strings in it) [19:57] mjr_: mikeal: I can probably do Friday. [19:58] aconbere: and see if memory usage reports correctly in cygwin? [19:58] aconbere: I know that python doesn't bundle a memory usage package because it's a pain to make it work on all platforms [19:58] aconbere: I wouldn't be super surprised to find out that something is weird in the environment [19:59] booths: Just a loop or something to build a huge object and see if it crashes? Okay. [19:59] aconbere: yeah [19:59] aconbere: :) [20:00] rdeshpande: booths: is there any consistency on when the crashes happen? [20:00] aconbere: secondarily, cygwin has it's own memory limit [20:00] aconbere: I wonder if you could actually be getting an out of memory signal from cygwin [20:00] aconbere: not hitting nodes internal 1 gig cap [20:00] booths: there's no consistency to the time [20:01] matt_c has joined the channel [20:01] booths: I don't think it's the size of the object now that Im' thinking about it more though, because I keep the xml data to reparse on start [20:01] booths: so when i restart it's close to the same size it was when it crashed, and it still takes another 4 hours [20:01] femtooo has joined the channel [20:01] booths: around 4 hours not exactly either... so dunno [20:02] booths: trying aconbere's test though [20:02] sfoster has joined the channel [20:02] aconbere: It should be noted that I don't know anything [20:02] aconbere: but I'm intrigued [20:03] booths: well it's still a good test [20:03] aconbere: so it's just another fools shot in the dark [20:03] booths: see if it's crashing [20:03] adambeynon has joined the channel [20:07] isaacs has joined the channel [20:08] booths: Okay, I'm adding a 1300 character string every 10ms and the heap used isn't skyrocketing, although it is growing in size, it's about 600 bytes per string in the object [20:09] booths: w/ just the timeout loop, logging the memory usage and incrementing a counter im starting at about 2m, at 4k loops and i'm at 2.4m bytes in heapUsed [20:09] booths: it appears to be stoping at 2.6m [20:09] booths: It gets there and drops to 2.4, then goes back up to 2.6 [20:10] booths: back and forth. [20:10] booths: So, this would lead me to believe it's not the object [20:10] robmason has joined the channel [20:11] booths: I'm thinking it has to be cygwin, because it's not an out of memory error, it's an allocation fail, which to me is different [20:12] mikew3c has joined the channel [20:12] booths: The parser does cause the heapUsed to double when it's parsing a ton of xml packets all at once, but it settles at around 5m, doubled at 10m bytes. [20:12] booths: So it's possible cygwin just won't allocate the memory when the parser gets hit w/ a couple packets,and it dies. [20:13] aconbere: booths: I don't know what cygwin's default memory allocation scheme is [20:13] aconbere: but they mention some issues on the docs page I found [20:13] aconbere: http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html [20:13] jimmybaker has joined the channel [20:13] dilvie has joined the channel [20:14] aconbere: "Cygwin's heap is extensible. However, it does start out at a fixed size and attempts to extend it may run into memory which has been previously allocated by Windows." [20:14] aconbere: sounds like the issue to me :) [20:14] booths: "FATAL ERROR: CALL_AND_RETRY_2 Allocation Failed - process out of memory" is the exact message [20:14] booths: Alright let me look into that [20:14] aconbere: that page shows how to increase the memory limit [20:15] booths: I wonder if convincing my bosses to let me run a linux VM in a windows VM is better than running cygwin [20:15] aconbere: hehe [20:16] dilvie: any no.de peeps hanging about? I forgot the password to my beta account. ); [20:17] mies has joined the channel [20:17] dilvie: oop [20:17] dilvie: remembered it. [20:18] dilvie: d'oh [20:18] wink_: booths: it's definitely better [20:18] wink_: :P [20:18] dilvie: my coupon code isn't working. ); [20:20] heavysixer has joined the channel [20:23] simb: chapel: I am not sure if formidable is what you are looking for based on what you describe. I am no expert on that though. [20:23] chapel: yeah, seems like it [20:23] simb: chapel: it seems you might want to see if you can use bodyDecoder to get the data that was submitted [20:23] chapel: being that formidable is for multipart data [20:23] simb: not sure if that would actually work or not though [20:24] chapel: idk, looking at the formidable code, it wont accept headers that aren't 'multipart' [20:24] simb: I am actualy about to start working on that. [20:24] simb: well not "that" but my app currently uploads a jpeg [20:25] chapel: you would think it would be simple [20:25] aubergine has joined the channel [20:25] simb: but I am building swf right now to capture the image and submit it to node [20:25] chapel: being that form data is integral part of the web [20:25] simb: so I will be working on your same issue here in a minute. [20:25] simb: I might be able to still do mine as a mulitpart though [20:25] chapel: hmm, all I want is to be able to pipe the image straight to an external api, atm I am using php to do it, and it was easy to do in php [20:25] pietern has joined the channel [20:28] booths: stupid question: the heapUsed is in bytes or bits, ie should i be counting MB or Mb [20:29] ryah: booths: bytes [20:29] booths: thanks [20:29] chapel: simb: I wouldn't mind doing some work myself to learn, but I am not familiar with the http server stuff as much as I would like to, where in your code do you handle the file processing? [20:30] isaqual has joined the channel [20:30] simb: currently just in my controller. [20:31] simb: but there is not much processing. formidable gets me the file info, I read it off the fs, and store it in a db [20:32] chapel: does the http server put it to file system automatically? [20:32] twoism_ has joined the channel [20:32] ropepy has joined the channel [20:33] HAITI has joined the channel [20:33] isaqual: Some problems getting geddy work. geddy-gen works fine but when I'm running geddy I only get permission denied error. I'm running node on snow leopard and node version is 0.3.2-pre . [20:34] booths: I'm reading that changing cygwins max memory page and it seems to state that the max allocation is whatever you set it too, does that then prevent windows from impeding on that memory? [20:37] booths: another stupid question, the rss, is that how much is allocated towards my process [20:37] isaacs has joined the channel [20:39] booths: isaacs maybe, is rss allocated memory? That's heapTotal I thought. I may be an idiot. [20:40] booths: RSS = memory held in ram iirc, so that's what's imporant I believe. [20:42] svnlto has joined the channel [20:42] tapwater has joined the channel [20:43] isaqual: Any ideas for my geddy problem ? [20:43] WhenRaptors: any suggestions on which static fileserver I should use? [20:44] pzich: your own, probably [20:45] WhenRaptors: I was just going to toss in paper boy [20:45] WhenRaptors: seems pretty light weight [20:46] dilvie has joined the channel [20:47] technoweenie: nginx [20:48] agnat has joined the channel [20:48] pagameba: nginx is getting a lot of attention lately, hope it doesn't go the way of lighttp [20:49] jchris has joined the channel [20:50] amacleod: What happened to lighty? [20:50] ryah: sex scandal [20:50] nsolsen has joined the channel [20:51] mikeal has joined the channel [20:51] pagameba: lol [20:52] softdrink has joined the channel [20:54] themiddleman has joined the channel [20:55] CIA-54: node: 03Ryan Dahl 07master * r89e398f 10/ lib/crypto.js : Better array check in Cert Authority list - http://bit.ly/gFNvLf [20:55] CIA-54: node: 03Ryan Dahl 07master * r5dab4be 10/ lib/crypto.js : Remove useless shouldVerify assignments - http://bit.ly/dPgtJp [20:55] CIA-54: node: 03Ryan Dahl 07master * rc5d32b3 10/ TODO : add todo - http://bit.ly/fLCDTV [20:55] CIA-54: node: 03Ryan Dahl 07master * r127f17a 10/ (src/node_crypto.cc src/node_crypto.h): Remove should_verify from C++ - to handle in JS land - http://bit.ly/fqFCTE [20:55] CIA-54: node: 03Ryan Dahl 07master * rec15898 10/ lib/net.js : Stop watcher before calling .set() in Stream.prototype.resume - http://bit.ly/fVpQ2d [20:57] mr_daniel has joined the channel [20:58] jherdman has joined the channel [21:01] CIA-54: node: 03Ryan Dahl 07master * rd8f2880 10/ (lib/tls.js test/disabled/test-tls-server.js): New TLS server API - http://bit.ly/hR7TlN [21:02] booths: Anyone? rss is what I'm concerned about when dealing with allocation problems, right? [21:03] benburkert has joined the channel [21:04] ossareh has joined the channel [21:04] ibolmo has left the channel [21:04] mjr_: rss is all that matters if you are looking at memory usage. [21:04] matjas has joined the channel [21:05] mjr_: virtual size is too complicated to quickly infer anything from. [21:05] booths: okay, because that's much higher than my heap used... that spikes to like 800mb when I'm parsing a ton of things, idles at 500mb [21:05] warz has joined the channel [21:05] jdrannbauer has joined the channel [21:06] pquerna: mjr_: ps_mem.py [21:06] pquerna: mjr_: http://www.pixelbeat.org/scripts/ps_mem.py [21:06] booths: mjr_: is that amount of rss outrageous? [21:06] mjr_: pquerna: does ps_mem demystify the virtual size number? [21:07] pquerna: mjr_: yes, and it handles COW stuff in linux [21:07] mjr_: booths: do you think you have about 500MB worth of data you are holding on to? [21:07] robmason has joined the channel [21:07] mjr_: pquerna: that's cool. Well booths, I guess just use that then if you ever start swapping. [21:08] isaacs has joined the channel [21:09] Nimphious has joined the channel [21:09] ryah: what do you guys think of this api: https://github.com/ry/node/blob/d8f2880ca46b12c1e39f13c3a7e91b3bc910a98b/test/disabled/test-tls-server.js#L14-29 [21:09] booths: mjr_: mjr: I dunno, it's being used as a web server w/ comet using socket.io [21:09] Nimphious: Anyone know of an IRC tunnel done using node? [21:09] Nimphious: Rather not reinvent the wheel. [21:10] mjr_: booths: that certainly sounds high to me, but I've never used socket.io. I've tested 60,000 HTTP long polls before, and my RSS was under 200MB. I forget the actual number. [21:10] pquerna: ryah: what happens when you do mid-session renegotiation [21:11] pquerna: ryah: this somewhat commonly happens if you are using client certificates + keep alive, first reuqest is to / next reqest is to /secret-path, and /secret-path requires a client cert. [21:11] ryah: pquerna: *shrug* nothing from the user level, hopefully [21:11] SubStack: Nimphious: tunnel as in proxy or something else? [21:11] ryah: i think i'll set SSL_VERIFY_CLIENT_ONCE [21:11] Nimphious: SubStack: Yeah pretty much. [21:12] booths: mjr_: I am storing a large object as well though.. wonder if that could be contributing. It's basically a workflow management tool and it's holding onto data for each event until it's completed. [21:12] booths: Testing just a large object seems to take about 182mb [21:12] ryah: pquerna: haven't thought of that [21:13] mjr_: booths: how large is the object, and how are you storing it? [21:14] booths: well, it's an object containing probably about 20 or so strings per object [21:14] booths: strings probably aren't larger than 50 characters [21:14] mjr_: That's not large at all [21:14] booths: well i have like 1k of each [21:14] booths: 1,000 of those [21:14] booths: in one object [21:15] mjr_: That's like 1MB of storage in an ideal world of like a C struct or something. [21:15] ph^ has joined the channel [21:16] mjr_: Maybe you are confusing V8 and it is wasting space, I dunno. [21:17] booths: well I"m getting about 182,845,440 rss just creating a loop to make obj[i] = "some string name", with i at about 1650, which is less than the big object would have on my server; [21:19] Me1000 has joined the channel [21:20] booths: Starts at around 229MB when logging process.memoryUsage() right on startup. [21:20] ryah: pquerna: at the moment it's requesting certs from all connections - which i guess is a lot of overhead for normal https servers. [21:21] richcollins has joined the channel [21:21] ryah: another round trip + whatever verification calcs [21:22] ryah: but. getting there. [21:22] kriszyp_ has joined the channel [21:22] ryah: feels so nice to have ssl devorced from net.js [21:22] jeremy` has left the channel [21:23] arpegius has left the channel [21:24] tanepiper: ssl now ssl.js ? [21:24] ryah: tls.js [21:25] tanepiper: gotch :D [21:25] booths: mjr_: a little more trouble shooting, I dumped the memory at the beginning and end of my file I start w/ node, I get about the same, but once the server handles a request it seems to go from 232mb to 500mb and stay there on average, even if the server doesn't do anything but writehead 200 and end... maybe it's choreographer? [21:25] ryah: tanepiper: https://github.com/ry/node/blob/d8f2880ca46b12c1e39f13c3a7e91b3bc910a98b/test/disabled/test-tls-server.js#L14-29 [21:26] aconbere: ryah: if we have questions about some of the node internals, is node-dev the best place to ask? [21:26] ryah: aconbere: or here if it's quick [21:26] aconbere: k [21:27] aconbere: test-repl requires a file that ends in .js [21:27] aconbere: I thought module names were required to not end in .js [21:27] aconbere: (so my work so far on module path loading are failing those tests) [21:27] tanepiper: CouchOne has SSL, node has near proper SSL :D [21:27] tanepiper: so happy [21:27] richcollins: My node based crawler keeps crashing intermittently and unpredictably. I'd like to just keep it running using launchd, but node fails with an error about setting raw mode on stdio [21:28] richcollins: Any ideas? [21:28] aconbere: I'm wondering if I'm confused, or if perhaps I should write some tests for modules in particular [21:28] dilvie: anybody paying attention in #joyent? =) [21:28] dilvie: Trying to get a node smartmachine going. [21:29] dnyy has joined the channel [21:29] Yuffster has joined the channel [21:29] codehero has joined the channel [21:29] mjr_: Long time listeners may remember my prediction that lack of memory profiling in JavaScript could lead to some disasters in long running servers. [21:29] mjr_: booths: even 232MB seems way too much. [21:29] mjr_: For holding essentially 1MB of data. [21:29] evanmeagher has joined the channel [21:29] Roelven has joined the channel [21:30] tg has joined the channel [21:30] pquerna: mjr_: sounds accurate :) [21:30] booths: It's holding more than just that, and that's with all the modules loaded as well, that was just the largest data that was being held on the server. [21:30] ryah: of course v8 does have memory profiling - we just don't have a nice way of accessing it [21:30] NovaDesu: Can anyone tell me how I would disconnect a socket from socket.io? I was trying to check out the client object with console.dir but the console history was too small to view the entire object and I can't find any documentation about it [21:31] codehero: hi all, I have a node script writing hundreds of megabytes of data to stdout using sys.puts; over time though the output buffer seems to be accumulating and not flushing any data to disk [21:31] SubStack has joined the channel [21:31] codehero: so I end up with an out of memory error [21:31] codehero: any ideas? [21:31] ryah: richcollins: paste the error? [21:31] codehero: FATAL ERROR: Allocation failed - process out of memory [21:31] aheckmann has joined the channel [21:31] ryah: richcollins: does your crawler have a REPL ? [21:31] sergeb has joined the channel [21:32] bentruyman has joined the channel [21:32] richcollins: ryah: https://gist.github.com/ab6348a4182a929e6cc2 [21:32] codehero: its not running with REPL [21:32] richcollins: Not ATM [21:32] pquerna: mjr_: server proceses and GCs have always been problematic; GC pauses were/are the bane of java for decades now. [21:32] richcollins: codehero: Are you certain that is the problem? [21:32] booths: getting the same thing, call_and_retry_2 [21:33] ryah: richcollins: v0.2? [21:33] richcollins: ryah: 0.3.1 [21:33] codehero: my output file doesn't grow as fast the input files are read [21:33] codehero: so the output buffer was my first guess [21:33] fallsemo has joined the channel [21:33] codehero: linearly proportional to input that is [21:34] ryah: aconbere: i don't know why it wants that... [21:34] richcollins: codehero: Is there any way to measure the buffer size directly? [21:35] nik0 has joined the channel [21:35] ryah: richcollins: does your build include this a52f59b437d669138e27a9d04880c71b5c79a9cf [21:35] codehero: not sure how the writeStream stuff is implemented, don't know [21:35] codehero: I am just using sys.puts [21:35] ryah: codehero: use proces.stdout.write() [21:35] Nimphious has joined the channel [21:35] ryah: codehero: if it returns false [21:35] booths: mjr_: I don't see the RSS growing, even if it starts off high it seems to stay consistent [21:35] ryah: stop writing [21:36] booths: mjr_: It's also running through cygwin if that has any impact. [21:36] Gruni has joined the channel [21:37] ropepy has joined the channel [21:37] fly-away has joined the channel [21:37] bingomanatee has joined the channel [21:37] killfill has joined the channel [21:37] ben_alman has joined the channel [21:37] sclaflin has joined the channel [21:37] jetienne has joined the channel [21:37] MrNibbles has joined the channel [21:37] naturalethic has joined the channel [21:37] dipser has joined the channel [21:37] devinus has joined the channel [21:37] blowery has joined the channel [21:37] kgf has joined the channel [21:37] sideshow has joined the channel [21:37] codehero: is there way to force a synchronous flush? [21:37] aconbere: ryah: if you look at moduleFileName https://github.com/ry/node/blob/master/test/simple/test-repl.js#L14 [21:37] booths: mjr_: should also be noted I have a legitimate server running the same modules minus socket.io and I'm getting 11mb of usage [21:37] aconbere: that's later sent to a server wrapped in a require [21:38] aconbere: https://github.com/ry/node/blob/master/test/simple/test-repl.js#L120 [21:38] mjr_: booths: 11MB is more or less what all of my servers idle at with no connections. [21:38] richcollins: git show a52f59b437d669138e27a9d04880c71b5c79a9cf [21:38] richcollins: ? [21:38] DoNaLd` has joined the channel [21:38] richcollins: It says "bad object" [21:38] richcollins: So I guess not [21:38] aconbere: but to me it looks like that test should always fail [21:38] aconbere: require("anything.js") should fail [21:38] isaacs has joined the channel [21:38] booths: mjr_: it is possible then, that cygwin is lending to the problem [21:39] mjr_: poor cygwin [21:39] ryah: aconbere: .js is allowed - but not encouraged [21:39] booths: mjr_: I took out all of the actual utilization of my modules (still load them) and it starts at about 238mb [21:39] ryah: (another annoying concession to commonjs) [21:39] booths: it's not even making a server anymore, it's just loading all the modules. [21:40] dguttman_ has joined the channel [21:40] mjr_: booths: well, something's out of whack there, for sure. Can you whittle down the modules and see which one it is? [21:40] booths: mjr_: trying now [21:41] twoism has joined the channel [21:41] booths: mjr_: just http/fs/util/sys gives me 183 MB [21:42] mjr_: if you just start the repl and don't load anything, what do you get? [21:42] booths: mjr_: Not a single modules, just the setinterval dumping memoryusage is 183mb [21:42] booths: err 179 [21:43] mjr_: Is that just the Windows tax? [21:43] mjr_: Yikes [21:43] booths: It's gotta be [21:43] dguttman has joined the channel [21:43] booths: Nothing else but an interval w/ memory usage [21:43] dguttman has joined the channel [21:43] CIA-54: node: 03Ryan Dahl 07master * rcd48649 10/ test/simple/test-repl.js : Require without .js in test-repl - http://bit.ly/eoDuA8 [21:43] CIA-54: node: 03Ryan Dahl 07master * r08d8116 10/ test/simple/test-repl.js : style - http://bit.ly/eATalM [21:43] mjr_: I guess you can buy more memory chips, or a new computer to run Linux. [21:43] ryah: booths: you should not use cygwin [21:44] booths: ryah: tell me about it [21:44] booths: ryah: I'd like to not, but my company doesn't want to buy linux servers because no one will support them internally. [21:44] mjr_: can you run vmware then? [21:45] ryah: aconbere: there's some fixes to that test. [21:45] isaacs: ryah: the require with .js is fine [21:45] isaacs: aconbere: responding to your email [21:45] cheney has joined the channel [21:45] booths: mjr_: I'm going to run that idea past them once I get my own dev server, a VM inside a VM. I'll admit I'm not sure how that would work as far as resolving the address from elsewhere on the network. [21:45] isaacs: in fact, requiring the exact filename is faster. [21:46] booths: mjr_: but this means my program is using about 300 peak, w/ the http server, mysql etc [21:46] niko has joined the channel [21:46] booths: is that still ridiculous? [21:46] mjr_: eh, sure, but so is Windows. [21:46] justin_ has joined the channel [21:46] booths: lol [21:47] mjr_: Might be easier to just burn some memory than fight the politics, as long as it works. [21:47] aconbere: isaacs: thanks a bunch. I know it's no fun helping the newb, so I appreciate the help :) [21:48] isaacs: aconbere: you sure are diving into some hairy territory. good way to not be a newb for long ;) [21:48] aconbere: heh [21:49] booths: mjr_: Probably, I can get a server w/ 8gb ram dedicated to this, but that doesnt alleviate my dev issues. Upon receiving an HTTP request is when it jumps from ~15mb after the windows tax, to ~300, but it can't be the module becuase it doesn't do that on my linode box [21:49] mikeal has joined the channel [21:49] jchris has joined the channel [21:49] mjr_: booths: note that V8 has a pretty small limit on the max heap size, so you'll hit that pretty soon if it keeps growing. [21:50] mjr_: Can't you just set up a proxy to your linode box and not tell anybody about it? [21:50] codehero: ok, so when I redirect stdout to a file or ramfile, process.stdout.write always returns false [21:50] cjmFloating has joined the channel [21:50] isaacs: aconbere: maybe next you can handle that whole eventemitter error stack trace chaining thing ;) [21:50] codehero: when I output directly to the console, I never see process.stdout.write return false [21:50] WhenRaptors: hmm [21:51] cjmFloating has left the channel [21:51] WhenRaptors: so need to find a decent xmpp client lib for nodejs [21:51] booths: mjr_: no it has customer information and I'm not too keen on being fired. [21:51] svnlto has joined the channel [21:51] mjr_: booths: Oh, OK. No sense in getting fired. [21:51] cjmFloating has joined the channel [21:51] booths: mjr_: I'm going to go over my bossess bosses boss and talk to the regional director about it, he's a linux guy. [21:52] aconbere: isaacs: no problem right?! [21:52] aconbere: ACTION sobs [21:52] mjr_: booths: jumping rank. That'll make you some friends. [21:52] richcollins: ryah: Pulled latest. Now I get this: https://gist.github.com/b97a676d14388de2b41f [21:52] booths: mjr_: lol, well this is a temp position anyways, if I were to get the fulltime dev position it'd be through him. [21:53] richcollins: ryah: Is there any way to disable readline when I don't need it? [21:53] richcollins: like when I'm running a script [21:53] ryah: richcollins: you can set the env var NODE_NO_READLINE=1 [21:54] ryah: but that's bandage rather than a solution [21:55] aconbere: isaacs: interestingly enough the case that we're talking about right now isn't in the test-module-loading tests [21:55] aconbere: it never requires a file named with a js extension [21:55] isaacs: aconbere: ah. it should :) [21:55] isaacs: that's a bug [21:55] techwraith has joined the channel [21:56] aconbere: cool, well I'll start there and submit a patch [21:56] aconbere: :) [21:56] isaacs: aconbere: requiring things with the extension specified is an important feature. otherwise you can't do stuff like require("foo") where you have a file named "foo" with no extension. [21:57] isaacs: ACTION thinks the "extension-agnostic" thing was a horrible horrible mistake that node should never have given in to [21:57] techwraith: Anyone have any experience with mongoose (mongodb ORM) here? [21:57] aconbere: isaacs: I am so totally with you on that one [21:57] aubergine has joined the channel [21:57] karboh has joined the channel [21:58] niko has joined the channel [21:59] cheney: how would I supply arguments to a JS function from command line execution? [22:00] gf3 has joined the channel [22:00] SubStack: cheney: http://substack.net/posts/fcf569/This-one-s-optimistic [22:00] SubStack: just wrote about this yesterday ;) [22:00] SubStack: you can also just look at process.argv [22:01] hornairs has joined the channel [22:01] siculars has joined the channel [22:02] dilvie has joined the channel [22:02] cheney: thanks SubStack [22:04] cardona507 has joined the channel [22:07] jimt has joined the channel [22:08] isaacs has joined the channel [22:08] WhenRaptors: . [22:09] niko has joined the channel [22:12] shirro has joined the channel [22:12] shirro has joined the channel [22:14] NovaDesu: Can anyone tell me how to disconnect a client from socket.io? [22:14] NovaDesu: Or where I can find some decent documentation on socket.io, I can't find any [22:15] trotter has joined the channel [22:18] NovaDesu: Anyone? [22:19] mscdex: NovaDesu: https://github.com/LearnBoost/Socket.IO-node/blob/master/README.md [22:20] sveisvei has joined the channel [22:21] niko has joined the channel [22:22] jwl: eval(uneval(parentObject)); doesnt work on node.js? [22:24] elijah-mbp has joined the channel [22:25] jwl has joined the channel [22:25] isaacs: jwl: uneval is mozilla-only [22:26] jwl: okay =/ [22:26] isaacs: what are you trying to do? [22:26] jwl: clone an object, but i have already done that with some help from yesterday [22:26] isaacs: note that JSON.stringify is a LOT like uneval [22:26] jwl: but basic things needed to do in a language should be in the core [22:27] isaacs: JSON.parse(JSON.stringify(foo)) [22:27] isaacs: they are [22:27] isaacs: the JSON object is specified in ES5 [22:27] isaacs: uneval is not. [22:27] jwl: so it could be used to copy a object? [22:27] isaacs: it could, yes. costly, though [22:27] isaacs: and carries the requirement that your object contain no functions, or loops [22:27] jwl: ah [22:27] isaacs: v8: a= {}; a.a =a; JSON.stringify(a) [22:27] v8bot: isaacs: TypeError: Converting circular structure to JSON [22:27] jwl: hmm [22:27] jwl: that is pretty good! [22:28] jwl: i just wanted to copy json strings [22:28] isaacs: v8: a= {foo:function(){}} ; JSON.stringify(a) [22:28] v8bot: isaacs: "{}" [22:28] isaacs: v8: a= {foo:function(){}} ; JSON.stringify(a, function (x) { if (typeof x === "function") return x.toString() ; return x }) [22:28] v8bot: isaacs: """" [22:28] techwraith: Whoa, V8bot is pretty cool ;) [22:28] isaacs: hrm.. whatever. i forget how that works [22:29] isaacs: jwl: if you're copying a string, then you can just say "a = b" [22:29] jwl: isaacs: really [22:29] isaacs: jwl: strings' aren't objects. copying them isn't a reference, it's a whole new string [22:29] jwl: i thought i was copying the reference not the object itself [22:29] isaacs: v8: a = "asdf" ; b = a ; a += "foo" ; [a, b] [22:29] v8bot: isaacs: ["asdffoo", "asdf"] [22:29] Nevtus has joined the channel [22:29] jwl: oh since its unmutable [22:29] isaacs: yes. natives are immutable in js [22:29] benburkert has joined the channel [22:30] jwl: great! thanks for the lessons [22:30] jwl: i pretty much love js right now [22:30] jwl: hated it so much before=) [22:30] isaacs: booleans, numbers, strings, undefined, null, and NaN [22:30] techwraith: jwl: Node has that effect on devs [22:30] sandymahalo: other than plurk's usage of node.js in production with high concurrency, does anyone know of any other production implementations that receive a lot of concurrent traffic? [22:30] jwl: yeah haha [22:30] isaacs: techwraith++ [22:30] v8bot: isaacs has given a beer to techwraith. techwraith now has 1 beers. [22:30] jwl: node = good marketing for js [22:31] jwl: isaacs: you dont use ; at the end for your lines in js? [22:31] isaacs: jwl: not at the end of lines, no [22:31] isaacs: jwl: i only use ; where they're relevant, or when contributing to projects where the owners require them used in a particular way [22:31] techwraith: sandymahalo: Storify is using node in production, I'm not able to say much about the levels of traffic, but node has been very impressive for us [22:32] jwl: isaacs: it has worked great? no errors? [22:32] isaacs: jwl: well, npm has plenty of errors, but not due to the semicolon usage. [22:33] dilvie: I use semi-colons everywhere, just because omitting them can lead to some confusing bugs. [22:33] niko has joined the channel [22:33] jwl: im starting to omitting ; too [22:33] jwl: looks cleaner , where it may hassle i put ; [22:33] jwl: its just like Ruby , you dont use ; when its not necessary [22:33] dilvie: I require the developers under me to use them, as well. I'm a bully. =P [22:33] isaacs: dilvie: omitting semicolons isn't the problem. [22:33] jwl: dilvie: "its about how you feel when you are coding" for me =) [22:33] isaacs: dilvie: the problem is not understanding linebreaks. [22:34] dilvie: isaacs: I require the whole dev team to pass their code through jslint. [22:34] jwl: isaacs: but isnt it taking longer for the interpreter to analyze there is no ; and put one there? [22:34] isaacs: jwl: see https://github.com/isaacs/npm/blob/master/doc/coding-style.md [22:34] techwraith has left the channel [22:34] isaacs: dilvie: that's too bad. [22:34] dilvie: managing complex development projects with tons of different developers all with different experience levels, it's kindof the least-difficult way to set a minimum bar on code quality. [22:35] isaacs: jwl: read the interpreter. it actually doesn't work the way the spec suggests. [22:35] isaacs: jwl: no js interpreter has done the "try and walk back" approach to ASI since MSIE 3 [22:36] dilvie: isaacs: I can write a doc saying, "here are the line-break issues you need to be aware of when you omit semicolons" or I can say, "pass lint" and be done with it. =) [22:36] sandymahalo: techwraith: oh ok, coo [22:36] sandymahalo: *cool [22:36] dilvie: the latter is an automatically-enforced way. =) [22:36] isaacs: dilvie: what if i wrote you a better linter? [22:36] jwl: isaacs: not tabs? [22:36] jwl: isaacs: tab is good! [22:36] jwl: :) [22:36] isaacs: jwl: nope. " " [22:36] jwl: but how do you jump fast then? [22:36] dilvie: isaacs: I'd be interested if it was good. =) [22:36] isaacs: jwl: i agree, philosophically. but node uses spaces, and github displays tabs badly. [22:36] isaacs: jwl: vim treats " " as a tab if you tell it to [22:37] [[zz]] has joined the channel [22:37] jwl: isaacs: yeah isaacs .. write a new linter [22:38] jwl: with focus on readability [22:38] isaacs: i've been meaning to, actually. it'd be nice to have an "isaacs-style" js lint tool. [22:38] justin_: dilvie: or you can just start using coffeescript :) [22:38] isaacs: would make it easier to contribute to npm, for sure. [22:38] ryah: http://buildbot.nodejs.org/builders/32bit%20Linux/builds/31/steps/shell_2/logs/stdio [22:38] ryah: ^-- clean build whew. [22:38] ryah: all 328 test programs :) [22:38] isaacs: w00t [22:38] isaacs: nice [22:38] dilvie: justin: I can't read coffeescript. It's too simple. =) [22:39] jpick: nice! [22:39] isaacs has joined the channel [22:39] frio80 has joined the channel [22:39] sandymahalo: fyi in case anyone else was curious about who is running node.js in production: http://www.quora.com/Node-js/What-companies-are-using-Node-js-in-production [22:39] modular has joined the channel [22:39] ryah: does anyone have freebsd here? [22:40] sandymahalo: yes [22:40] jwl: dilvie: the problem with coffeescript is that its not js syntax [22:40] mscdex: isaacs: the callback for stringify has 2 parameters, the second one is the value [22:40] ryah: test/simple/test-executable-path is broken [22:40] ryah: should be an easy fix [22:40] dilvie: jwl: isn't that the whole point? [22:40] isaacs: mscdex: ahh, i see [22:40] sandymahalo: ahh [22:40] MikhX has joined the channel [22:40] ryah: off by one error [22:40] sandymahalo: oops [22:40] jwl: yeah but its kinda its achilles heal too [22:40] jwl: or how you spell heal =) [22:40] jwl: standards are powerful cause there will be more contributions [22:40] mscdex: ryah: i have freebsd [22:41] jpick: 1 test failed with a timeout here http://build.nodejs.org/browse/NODE-UBUNTU-JOB1-41/log [22:41] ryah: mscdex: AssertionError: "/home/users/ry/bbslave/freebsd_amd64/build/build/default/node\u0000" == "/home/users/ry/bbslave/freebsd_amd64/build/build/default/node" [22:41] jwl: heel! [22:41] brianmario has joined the channel [22:41] ryah: mscdex: https://github.com/ry/node/blob/d8f2880ca46b12c1e39f13c3a7e91b3bc910a98b/src/platform_freebsd.cc#L67 [22:42] isaacs: v8: a= { foo : function () { return 1 } } ; JSON.stringify(a, function (k, v) { if (typeof v === "function") return v.toString() ; return v }) [22:42] v8bot: isaacs: "{"foo":"function () { return 1 }"}" [22:42] ryah: mscdex: probably have to do *size -=1 or osmething [22:42] isaacs: there ya go [22:42] isaacs: right, it's key, value, parent, right? [22:43] mscdex: isaacs: afaik it's just key, value [22:43] jwl: isaacs: why comma first in array elements? [22:43] isaacs: jwl: because it prevents trailing commas and missing commas. [22:43] isaacs: and visually maeks the entire structure easier to scan [22:44] jwl: isaacs: but the first one has no comma [22:44] isaacs: jwl: right. [22:44] isaacs: jwl: that would be unnecessary [22:44] niko has joined the channel [22:44] jwl: and also , in the end is in the spec [22:44] jwl: even if its the last element [22:44] jwl: so there will be no error in syntax [22:45] isaacs: jwl: true. i must admit that aspect of my style is a holdout from supporting IE, which throws on trialing commas in objects. [22:45] isaacs: jwl: but it does make missing commas easier to spot [22:45] dilvie: , on the end is in the spec? [22:45] SubStack: isaacs: but v8 allows trailing commas ;) [22:45] isaacs: jwl: https://gist.github.com/357981 [22:45] dilvie: I didn't know that. =) [22:45] jwl: dilvie: will throw no errors if you use comma in the last element of an array or object [22:46] SubStack: jwl: also objects [22:46] jwl: array i mean [22:46] isaacs: v8: [1,,,,2,,,,] [22:46] v8bot: isaacs: [1, undefined, undefined, undefined, 2, undefined, undefined, undefined] [22:46] jwl: hmm yeah objects too =) [22:46] isaacs: v8: [1,,,,2,,,3,] [22:46] v8bot: isaacs: SyntaxError: Unexpected token ILLEGAL [22:46] dilvie: jwl: I have to worry about browser support, though, so I'm not sure if I can use that. [22:46] isaacs: v8: [1,,,,2,,,3] [22:46] v8bot: isaacs: SyntaxError: Unexpected token ILLEGAL [22:46] jwl: dilvie: i feel u [22:46] isaacs: v8: [1,,,2,,,3] [22:46] v8bot: isaacs: SyntaxError: Unexpected token ILLEGAL [22:46] SubStack: same [22:46] isaacs: weird... [22:46] isaacs: wtf [22:46] jwl: better to stay on the secure side [22:47] isaacs: v8: [1,,,2,,,] [22:47] v8bot: isaacs: [1, undefined, undefined, 2, undefined, undefined] [22:47] isaacs: v8: [1,,,2,,,3] [22:47] v8bot: isaacs: [1, undefined, undefined, 2, undefined, undefined, 3] [22:47] jwl: i just like js better without ; looks more like ruby =) [22:47] isaacs: must be colloquy putting something odd in there [22:47] jwl: with ; im back on PHP [22:48] mscdex: ryah: hmm... i can't even get it to make [22:48] ossareh has joined the channel [22:48] dilvie: jwl: yeah, I maintain the javascript style guide for an entire dev team writing code for dozens of platforms... I like to keep everybody using pretty much the same style so that anybody on the team could pretty much jump in, glance around, and do what they need to do. [22:49] dilvie: basically, I'm the jerk who says, "I don't care how you're used to writing code. Do it my way." =) [22:49] isaacs: dilvie: an automated linter is a big savings in that case. [22:49] dilvie: yeah, hence the jslint requirement. [22:49] isaacs: also, switching is probably more costly than any savings. [22:49] jwl: isaacs: JSON.parse(JSON.stringify(object)); worked like a charm for {} object literals with no functions [22:50] isaacs: with npm, i was starting fresh, and my priorities were making it fun to continue building, or else it would never have happened. [22:50] dilvie: isaacs: what do you mean by "switching"? [22:50] jwl: love it [22:50] isaacs: dilvie: switching from jslint to some other linter [22:50] dilvie: oh yeah. [22:50] dilvie: =) [22:50] simb has joined the channel [22:50] ph^ has joined the channel [22:50] Kami_: mscdex: gmake? [22:50] isaacs: despite jumping into this discussion whenever it pops up, i'm actually not very dogmatic about style. i'm dogmatic about making stupid false irrational claims about style. [22:51] mscdex: Kami_: whatever is used by default [22:51] Kami_: mscdex: yeah, use gnu make [22:51] charlenopires has joined the channel [22:52] jwl: dilvie: thats a good jerk style =) [22:53] techwraith has joined the channel [22:54] techwraith: sandymahalo: Got cut off, if you have any more questions about node at scale, PM me [22:54] jwl: im on new personal project .. have not that much code atm , but maybe i should switch style and remove all ; at the ends [22:54] dilvie: I hope so. I've been at it for about a month. Still in the process of teaching everybody how to write code that passes lint. =) [22:54] jwl: dilvie: lint is good? [22:54] jwl: it helps? [22:55] techwraith: jwl: lint everything! [22:55] stagas has joined the channel [22:55] dilvie: Lint is tremendously helpful for catching / preventing common syntax-related bugs. [22:55] niko has joined the channel [22:56] dilvie: It won't prevent you from doing stupid huge datastructure traversals when they're not required, though.... so it's really just the first step in code quality assurance. [22:57] jwl: dilvie: looks nice [22:57] jwl: cant you set that ; isn't mandatory? [22:58] tswicegood: curious to see if I'm missing something here? https://github.com/ry/node/commit/f08985c193a7b55e4c82a1681290fb10a9e8471e#commitcomment-206872 [22:58] jwl: what do i choose, how i feel when i code, or how to pass a suite [22:58] techwraith: jwl, dilvie: I mainly use lint to make sure that everyone who reads my code can go into it knowing there is a common structure. Think of it as a standards doc for JS code quality [22:58] jwl: techwraith: yeah .. would be good if you could adjust the coding style though [22:58] jwl: and then use your spec to check [22:59] techwraith: I agree [22:59] ryah: we can use jslint [22:59] ryah: i've been meaning to do it for a while [22:59] techwraith: ryah++ [22:59] v8bot: techwraith has given a beer to ryah. ryah now has 1 beers. [23:00] thear: isaacs: you mentioned auto linting. I've only used jslint. Is there a way to run all your js files through some kind of command line utility? [23:00] aconbere: are we worried at all that trying to reach compliance with jslint could result in some pretty enormous patches? [23:01] ibolmo has joined the channel [23:01] isaacs: thear: right now, jslint is kinda the state of the art. i think google has some thing, too, which can even try to "fix" the "problems" it finds. [23:01] aconbere: (which makes merging in work before linting difficult) [23:01] dilvie: thear: you can use node to run jslint [23:01] thear: really? how? [23:01] ibolmo: figure i should try again.. anyone familiar with a Mechanize port (or similar) for node.js? [23:01] aconbere: there are a number of node lint projects [23:01] aconbere: thear: ^ [23:01] isaacs: npm ls lint [23:01] thear: ACTION checking [23:01] aconbere: we lint post commit here [23:02] thear: isaacs: thanks for npm. I'm loving it! [23:02] aconbere: which I find to have marginal utility [23:02] dilvie: I've found jslint to be tremendously useful for cleaning up and debugging poorly-written code. [23:03] dilvie: it catches lots of common bugs. [23:03] dilvie: It has helped me fix hundreds of bugs I didn't even know were lurking in our codebase. [23:04] dilvie: (it's a very large codebase) [23:04] ryah: how do you get jslint to ignore a line? [23:04] dilvie: ryah: that's a good question. [23:04] dilvie: fork it? =) [23:04] pquerna: so, don't suppose someone has an EventEmitter class in python :) ? [23:04] jashkenas has joined the channel [23:06] jwl_ has joined the channel [23:06] jwl: d [23:06] jwl_: h [23:06] Zebra10 has joined the channel [23:06] jwl_: ACTION is trying the new beta online irc: irccloud [23:06] jwl_: looks very solid! [23:07] jwl_: ACTION dumping freenode.net =) [23:07] niko has joined the channel [23:08] Zebra10: im trying to deploy a basically helloworld app to heroku and when i check the logs i see an error i cant seem to fix/understand [23:08] Zebra10: "/home/railgun/bin/ps-run:47:in `exec': No such file or directory - PORT=50905 node server.js (Errno::ENOENT)" [23:09] Zebra10: i assume it is talking about finding my vendor dir or something? i am using npr to bundle all the extensions into a vendor folder that is next to my server.js file [23:09] isaacs has joined the channel [23:09] Zebra10: require.paths.unshift('vendor'); [23:09] Zebra10: var express = require('express'); [23:09] Zebra10: seems to make sense [23:09] Zebra10: works locally fine [23:09] Zebra10: but when i push to heroku i keep getting that error [23:09] Zebra10: any ideas? [23:10] mscdex: ryah: which test was that? make test is getting stuck on test-cli-eval [23:11] yonkeltron has joined the channel [23:11] zomgbie has joined the channel [23:12] ryah: test/simple/test-executable-path [23:13] richcollins has joined the channel [23:14] twoism has joined the channel [23:14] sveisvei has joined the channel [23:16] ibolmo has left the channel [23:16] SubStack: I hate chaining var statements with commas. [23:17] mikeal: i'm running master and getting a terrible Buffer.slice error [23:17] mikeal: it's saying i'm out of bounds [23:17] mikeal: and i'm slicing from 0 to 563 on a buffer that is 564 in length [23:18] mikeal: also, this shouldn't even be a buffer because it came from concating a buffer.toString() [23:18] tobie has joined the channel [23:18] isaacs: mikeal: code? [23:18] isaacs: gist/etc? [23:19] niko has joined the channel [23:19] mikeal: https://gist.github.com/724430 [23:19] mikeal: lines 12 − 14 [23:19] ben_alman has joined the channel [23:21] mikeal: and here is the terminal output [23:21] mikeal: https://gist.github.com/724433 [23:21] mikeal: why the fuck is buffer.slice getting called [23:21] mikeal: it's a string [23:24] cronopio: ACTION installing cloud9 on laptop [23:25] booths has joined the channel [23:27] mscdex: ryah: yeah, *size just has to decremented by 1 right before return 0 [23:27] hassox has joined the channel [23:28] mikeal: isaacs: thoughts [23:28] hassox: hey guys [23:28] hassox: anyone know how to set the EXPRESS_ENV var on no.de so my app will use it? [23:29] mikeal: isaacs: nm, figured it out [23:30] isaacs: mikeal: yeah, chunk is a buffer. [23:30] isaacs: that's where you're calling chunk.slice [23:30] mikeal: think is [23:30] mikeal: that's really broken [23:30] frio80 has left the channel [23:30] mikeal: and this is taken from other code people are using [23:30] mikeal: so now i feel real bad [23:30] isaacs: hahah [23:30] isaacs: aww [23:30] isaacs: look at you. you're so responsible [23:30] niko has joined the channel [23:31] dnolen has joined the channel [23:33] MikhX has joined the channel [23:33] yonkeltron: why does this code fail on line 13 and not line 12? http://pastebin.com/2LhLSCk9 [23:33] yonkeltron: i might misunderstand Object.freeze but i don't see why i should be able to add another property to this object [23:34] tlrobinson has joined the channel [23:34] yonkeltron: shouldn't an error be raised? [23:34] mscdex: yonkeltron: no. see here: https://github.com/ry/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8 [23:36] yonkeltron: so it won't work but won't throw? [23:36] mscdex: that's the way it's always been, no exceptions thrown [23:36] yonkeltron: i did not know this [23:37] yonkeltron: today, i have learned something new [23:37] mscdex: that's why you check using isFrozen() first, then you know if you'll succeed or not [23:37] yonkeltron: hehe [23:37] yonkeltron: i see now [23:37] jakehow has joined the channel [23:38] pt_tr has joined the channel [23:38] dguttman_ has joined the channel [23:39] ysynopsis has joined the channel [23:39] isaacs_ has joined the channel [23:39] arpegius has joined the channel [23:40] yonkeltron: mscdex: while i have you, is there a way to inspect the arity of a function? [23:42] aubergine has joined the channel [23:42] niko has joined the channel [23:43] mscdex: yonkeltron: not really, unless you parse the parameter list from the function's source heh [23:43] arpegius has left the channel [23:43] mscdex: and that's assuming that that function doesn't have dynamic arguments [23:44] yonkeltron: indeed [23:44] mscdex: or optional arguments [23:44] yonkeltron: just wondering [23:44] yonkeltron: i know spidermoneky gives you .arity [23:44] yonkeltron: just wondering if there was some equivalent i didn't know about [23:47] BillyBreen has joined the channel [23:48] ryah: anyone know the option to allow one-line if statements with jslint? [23:48] SubStack: v8: (function (x,y) {}).length [23:48] v8bot: SubStack: 2 [23:48] SubStack: yonkeltron: ^^^ [23:49] sechrist has joined the channel [23:49] jimt_ has joined the channel [23:49] SubStack: of course, the function could be looking at the arguments list directly [23:49] deepthawtz has joined the channel [23:49] yonkeltron: SubStack: right, but good to know how it was defined [23:49] SubStack: and you can always pass more or less arguments to a function than its .length specifies [23:49] yonkeltron: SubStack: thanks, that's a huge help. [23:49] yonkeltron: indeed [23:50] paulrobinson_ has joined the channel [23:50] Twelve-60 has joined the channel [23:51] itissid has joined the channel [23:52] Spion has joined the channel [23:53] niko has joined the channel [23:54] boaz_ has joined the channel [23:54] cjmFloating has joined the channel [23:56] dguttman has joined the channel [23:57] jpick has joined the channel [23:57] mscdex: yonkeltron: here's a one-liner for getting the defined names: /^function\s*\((.*?)\)/.exec((function (foo, bar){}).toString())[1].split(',').map(function(x){return x.trim()}) [23:58] yonkeltron: whoa. [23:58] mscdex: actually, that's not completely right [23:58] mscdex: 1 sec