[00:00] _ry: if i had reason to believe it did, i would change it [00:00] devinus: _ry: oooo, ooo one more ? now that you're back, am i being really stupid trying to do this fs.stat recursively to get the stats of all the entries in a fs.readdir async? http://pastie.org/892756 [00:00] devinus: i didn't want to do statSync, and thats all i could think of... [00:01] statim: i tried to get http://github.com/masuidrive/node-mysql working but i think it may not work on the current node (or it could be im still learning and am doing something wrong). but is there anything besides that one and the other one i know of http://github.com/Sannis/node-mysql-sync that may be more up to date? [00:02] fredsa: _ry, suppose I want to write a function to return today's date?... [00:02] devinus: fredsa: return new Date(); ? [00:02] fredsa: suppose that Date() doesn't exist [00:03] devinus: statim: what about dbslayer? [00:03] fredsa: and I have to use a linux command like date [00:03] statim: devinus: looked interesting, looked like a little extra work with an extra http layer but maybe its actually the easiest... ill give it another look [00:04] devinus: fredsa: erm... var p = process.createChildProcess('date', []); ? [00:05] devinus: fredsa: then add an output listener? [00:07] fredsa: devinus, I did start down that route but it kinda breaks the elegance of var d = current_date(); [00:08] fredsa: devinus, unless you can think of a way to wrap it all into a function, which I can't [00:08] devinus: fredsa: im assuming you're not actually doing this with dates [00:08] fredsa: quite so [00:09] devinus: fredsa: and i'll spare lecturing you on "why even use node if you want sync code" [00:09] devinus: fredsa: hrm...i may be able to think of one way, one sec [00:11] fredsa: devinus, well, I wanted an opportunity to give node.js a try and an exercise I'm working on gave me the chance [00:11] fredsa: it is proof of concept code, not real life [00:12] devinus: fredsa: well, to be honest i find async code and just using callbacks more elegant. there really is very little to say about node if you're keeping it sync other than "it's still JS" [00:15] fredsa: devinus, is your lecture online anywhere? [00:16] devinus: fredsa: oh, no. just a figure of speech i was using [00:16] _ry: fredsa: the thing is, if it performs i/o then there there needs to be a callback [00:16] _ry: fredsa: it keeps the process from locking up [00:17] sh1mmer has joined the channel [00:17] _ry: creating an external process = i/o [00:17] _ry: this sounds annoying - but it forces you to program in a way that is not slow [00:18] fredsa: _ry, I understand the principle. The trouble is that in this case I want slow. Every solution I've thought of so far results in a race condition [00:19] _ry: what's your situation, actually? [00:19] fredsa: It's a background app, not a web app btw, so I realise that I'm bending node for my own use [00:19] fredsa: it's a simple little excercise for a job I'm applying for. I thought it would be fun to do it in js [00:19] fredsa: node.js is the only cli lib that I know of [00:21] _ry: i assure you you can do it, whatever it is, without a race condition [00:21] fredsa: oh crap, I've just seen the time [00:23] ssteinerX has joined the channel [00:24] fredsa: If I haven't worked it out for myself I may come back and ask you to expand on that. Right now I've gotta get to bed. [00:24] fredsa: 'night [00:25] tmpvar has joined the channel [00:30] joshholt_ has joined the channel [00:30] cdorn has joined the channel [00:40] cdorn has joined the channel [00:41] devinus has left the channel [00:41] devinus has joined the channel [00:45] cdorn has joined the channel [00:48] cadorn has joined the channel [00:51] silentrob has joined the channel [00:51] cdorn has joined the channel [00:54] binary42 has joined the channel [00:54] sp160n has joined the channel [00:56] binary42 has left the channel [00:56] binary42 has joined the channel [00:57] cadorn has joined the channel [01:06] dgathright has joined the channel [01:23] ditesh|cassini has joined the channel [01:26] softdrink has joined the channel [01:31] ditesh|cassini has joined the channel [01:34] isaacs has joined the channel [01:36] keeto has joined the channel [01:38] RayMorgan has joined the channel [01:54] jed__ has joined the channel [02:02] hobson has joined the channel [02:15] ako has joined the channel [02:29] nsm has joined the channel [02:43] fizx has joined the channel [02:52] fizx has joined the channel [03:00] creationix has joined the channel [03:06] steadicat has joined the channel [03:11] statim has left the channel [03:12] steadicat has joined the channel [03:28] BryanWB has joined the channel [03:32] mikeal has joined the channel [03:37] pavelz_ has joined the channel [03:41] bronson has joined the channel [03:42] ditesh|cassini has joined the channel [03:45] zuk has joined the channel [03:49] icey: if I wanted to implement a multi-room chat, would it be correct for me to create multiple eventemitters? (i.e. one for each channel) [03:50] bronson has joined the channel [03:52] tmpvar: take a look at node_chat or http://toylanguage.com [03:54] icey: tmpvar: that's where i started, but both of those examples are single channel chats only - they both just send messages to everyone connected [03:55] icey: tmpvar: i also went through the source for Ajax.IM, but that is direct messaging only [03:57] tmpvar: ah [03:57] Tim_Smart: Some needs to implement a chat protocol to replace IRC [03:57] tmpvar: well, it doesnt seem too hard to adapt [03:58] mikeal: Tim_Smart: you are the first person to ever say that :P [03:58] mikeal: i'm drunk [03:58] mikeal: ignore me [03:58] tmpvar: lol [03:58] icey: tmpvar: yeah, that's what i'm doing now; i'm just not sure if it's idiomatic for me to create an eventemitter per channel or roll my own solution [03:58] Tim_Smart: /ignore mikeal [03:58] icey: i am also drunk [03:58] tmpvar: its sunday night [03:58] mikeal: i have this great rum and ginger beer, Dark and Stormy FTW! [03:59] icey: tmpvar: i'm an early optmizer [03:59] Tim_Smart: tmpvar: It's monday afternoon :p [03:59] tmpvar: icey, bad habit [03:59] tmpvar: i need a smoke [03:59] mfeiri_ has joined the channel [04:01] fizx has joined the channel [04:19] ayo has joined the channel [04:23] dgathright_ has joined the channel [04:38] derferman has joined the channel [04:41] jed_ has joined the channel [04:44] dnolen has joined the channel [04:56] emyller has joined the channel [05:01] bacon has joined the channel [05:03] dnolen has left the channel [05:04] dnolen has joined the channel [05:05] eyzn: why do u want to make a multiroom chat? just make some instances of node_chat or this node_mini_chat :) [05:06] icey: eyzn: it seemed like it would be a good learning exercise :D [05:06] eyzn: true [05:28] isaacs has joined the channel [05:37] sudoer has joined the channel [05:48] juvenn has joined the channel [05:54] juvenn has left the channel [05:54] juvenn has joined the channel [06:02] aguynamedben has joined the channel [06:10] fizx has joined the channel [06:10] fizx has joined the channel [06:13] JimBastard has joined the channel [06:13] JimBastard: Connorhd: you alive? [06:14] keeto has joined the channel [06:28] joshbuddy has joined the channel [06:28] joshbuddy has joined the channel [06:30] qFox has joined the channel [06:30] yatiohi has joined the channel [06:30] juvenn has joined the channel [06:30] jed_ has joined the channel [06:30] atmos has joined the channel [06:30] hassox has joined the channel [06:30] kriskowal has joined the channel [06:30] Iveaux has joined the channel [06:30] webben has joined the channel [06:30] Pilate has joined the channel [06:30] charlesjolley has joined the channel [06:30] evilhackerdude has joined the channel [06:30] philippbosch has joined the channel [06:30] shirro has joined the channel [06:30] WHARGARBL has joined the channel [06:30] ashb has joined the channel [06:30] tlockney_ has joined the channel [06:30] cainus_ has joined the channel [06:30] _ry has joined the channel [06:30] Wes- has joined the channel [06:30] unomi has joined the channel [06:30] bajeczka has joined the channel [06:30] mjr_ has joined the channel [06:30] jan____ has joined the channel [06:30] deanlandolt has joined the channel [06:30] frodenius has joined the channel [06:30] rudebwoy has joined the channel [06:30] rednul has joined the channel [06:30] adovenmuehle has joined the channel [06:30] marienz has joined the channel [06:30] inimino has joined the channel [06:30] zimbatm has joined the channel [06:30] dmpk2k has joined the channel [06:30] eyzn has joined the channel [06:30] ec has joined the channel [06:37] marienz has joined the channel [06:44] marienz has joined the channel [06:46] nsm has joined the channel [06:46] nsm: hi, what would be a replacement for process.mixin() now that it is deprecated? [06:49] r11t_ has joined the channel [06:49] mfeiri_ has joined the channel [06:53] r11t__ has joined the channel [07:08] nsm has joined the channel [07:11] felixge has joined the channel [07:11] felixge has joined the channel [07:13] markwubben has joined the channel [07:15] Tim_Smart: nsm: Your own implementation [07:15] nsm: Tim_Smart: sorry? [07:16] Tim_Smart: nsm: process.mixin [07:16] nsm: Tim_Smart: oh, ya, ok [07:17] Tim_Smart: Not this one "1269846916661.6245" [07:17] Tim_Smart: oops [07:34] kixxauth has joined the channel [07:39] JimBastard has joined the channel [07:39] JimBastard: heh we should do a Summer of Node since google can suck a fat one [07:40] JimBastard: _ry , make it only node.js related projects [07:50] Gruni has joined the channel [07:59] piranha has joined the channel [08:04] teemow has joined the channel [08:15] BryanWB has joined the channel [08:18] CIA-77: node: 03Ryan Dahl 07master * r40ea061 10/ (25 files in 5 dirs): Upgrade V8 to 2.2.0 - http://bit.ly/9qZbOG [08:20] aguynamedben has joined the channel [08:24] jspiros has joined the channel [08:25] derbumi has joined the channel [08:25] derbumi_ has joined the channel [08:26] juvenn has joined the channel [08:30] juvenn_ has joined the channel [08:34] Iveaux_ has joined the channel [08:38] JimBastard has joined the channel [08:38] JimBastard: awesome, just got node_debug added as a submodule to hook.io [08:38] JimBastard: now you can toggle the node_debug on and off with a hookIO config setting [08:47] hassox has joined the channel [08:49] xla has joined the channel [09:01] Iveaux_: when i run "make test", i get the following error: [09:01] Iveaux_: Error: Connection error [09:01] Iveaux_: at Client. (http:711:28) [09:01] Iveaux_: at net:731:27 [09:01] Iveaux_: at IdleWatcher.callback (node.js:256:5) [09:01] Iveaux_: at node.js:814:9 [09:02] Iveaux_: how can i solve this ? [09:06] javajunky has joined the channel [09:08] jfd has joined the channel [09:09] felixge has joined the channel [09:09] felixge has joined the channel [09:09] xla has joined the channel [09:14] Gruni has joined the channel [09:21] alx_ has joined the channel [09:24] piranha has joined the channel [09:40] BryanWB has joined the channel [09:55] ithinkihaveacat has joined the channel [10:14] MattJ has joined the channel [10:19] BryanWB has joined the channel [10:25] Tim_Smart: Hmm, http://crockfordfacts.com/ is getting terribly lame. It needs serious moderation [10:48] keeto has joined the channel [10:52] mfeiri_ has joined the channel [10:55] BryanWB has joined the channel [11:01] ssteinerX has joined the channel [11:16] rolfb has joined the channel [11:17] nsm has joined the channel [11:23] hellp has joined the channel [11:24] nsm has joined the channel [11:24] nikhil_ has joined the channel [11:26] tisba has joined the channel [11:31] jed_ has joined the channel [11:42] piranha has joined the channel [11:50] dnolen has joined the channel [12:05] markwubben has joined the channel [12:08] pdelgallego has joined the channel [12:15] JimBastard has joined the channel [12:16] JimBastard: does anyone know the iptables rule for blocking all outside world traffic to a port but still allow the traffic on the lan port? i cant block all. something like iptables -A INPUT -p tcp --dport 8080 -j DROP [12:19] broofa has joined the channel [12:19] broofa has left the channel [12:26] broofa has joined the channel [12:34] binary42 has joined the channel [12:35] JimBastard: iptables -A FORWARD -p tcp --dport 8080 -j DROP [12:35] JimBastard: seems to work [12:35] JimBastard: sup binary42 [12:35] binary42: JimBastard: yo [12:35] JimBastard: delete fuuucking everythiiing [12:35] JimBastard: hook.io now has a built in console debugger / repl / ide [12:35] JimBastard: http://hook.io/debug/ [12:36] micheil: binary42: the same binary42 as is on twitter & github? [12:36] binary42: :-P [12:36] micheil: which looks to be true, nice to meet you [12:36] JimBastard: got node_debug in as a submodule [12:37] JimBastard: i was talking to tmpvar about flow control stuff [12:37] binary42: JimBastard: Not everything. Just a lot that people somehow decided to call it a _why. [12:37] JimBastard: ahahahah [12:37] micheil: binary42: why the repo's though :( [12:37] JimBastard: i think it would be not too hard to put many listeners on a hook [12:37] binary42: all the GH stuff is going to be republished anyway. Most of them were old and unmaintained. [12:37] micheil: admittedly I did find the code through google's cache ;P [12:37] JimBastard: so it would be many listeners to many actions [12:38] JimBastard: i just thought it was funny [12:38] JimBastard: brb [12:38] micheil: binary42: so more of a refresh than an act of disappearance [12:38] binary42: Yeah. Reboot. [12:38] micheil: ACTION follows on github for when that happens :D [12:39] binary42: Well, I have 2 GH accounts ;-). One is lesser known for my start-up. You'll see forks go out though so no worries. [12:41] JimBastard: yourmomma? [12:41] JimBastard: at least 3 ! [12:42] binary42: Okay, 3. I'll admit that one still exists, though it's JimBastard's mom's in proxy. [12:43] kriszyp has joined the channel [12:44] JimBastard: proxy mom [12:46] sschuermann has joined the channel [12:46] binary42: Written in node, no less. [12:46] sschuermann: heya [12:48] sebs: guys a question: i started to develop a finite state machine as commonjs module. Somone told me there is a chance that there is something already [12:48] sebs: didnt really find something via the normal channels [12:50] broofa has left the channel [12:50] broofa has joined the channel [12:52] broofa has left the channel [12:52] broofa has joined the channel [12:53] broofa has left the channel [12:53] broofa has joined the channel [12:53] sschuermann_ has joined the channel [12:57] bronson has joined the channel [12:57] derbumi has joined the channel [12:57] ditesh|cassini has joined the channel [12:58] mfeiri_ has joined the channel [13:03] jfd has joined the channel [13:08] TheEnd2012 has joined the channel [13:12] jed_ has joined the channel [13:14] lars_smit has joined the channel [13:14] derbumi has joined the channel [13:17] jherdman has joined the channel [13:21] alx_ has joined the channel [13:28] confounds has joined the channel [13:31] mcarter has joined the channel [13:37] gf3 has joined the channel [13:42] maritz has joined the channel [13:43] lars_smit: Just created an node.js group on Linkedin. Feel free to join. [13:44] jherdman: do people actually use those groups? [13:44] jherdman: (not trying to knock your idea. just curious0 [13:45] sschuermann_: requested ;) [13:45] sebs: sometimes [13:45] sebs: it's a good feature to set a mark what you care about [13:46] jherdman: i figured that's pretty much what it's about. cool. [13:48] sebs: just to bring up my question again: anyone is aware of libraries for finite state machines in nodejs? [13:51] lars_smit: jherdman: I use those groups sometimes, don't know about others [13:54] KungFuHamster has joined the channel [13:54] eelco has joined the channel [13:55] mattly has joined the channel [14:04] bpot has joined the channel [14:04] softdrink has joined the channel [14:05] eelco has joined the channel [14:09] taf2 has joined the channel [14:10] binary42 has joined the channel [14:15] cedricv has joined the channel [14:16] deanlandolt has joined the channel [14:19] nsm has joined the channel [14:19] nikhil_ has joined the channel [14:19] rtl has joined the channel [14:22] sudoer has joined the channel [14:24] Yuffster has joined the channel [14:24] joshbuddy has joined the channel [14:27] voodootikigod_ has joined the channel [14:27] felixge has joined the channel [14:27] felixge has joined the channel [14:27] jbrantly has joined the channel [14:28] gf3 has joined the channel [14:31] aryounce has joined the channel [14:31] derbumi has joined the channel [14:36] alex-desktop has joined the channel [14:37] unomi has joined the channel [14:39] taf2: did ejs go away for express? [14:41] brianm has joined the channel [14:43] stepheneb has joined the channel [14:46] kixxauth has joined the channel [14:47] tbassetto has joined the channel [14:47] creationix has joined the channel [14:53] jake_ has joined the channel [15:00] gwoo has joined the channel [15:03] steadicat has joined the channel [15:06] jake_: I'm getting EAFNOSUPPORT [15:06] jake_: how should I fix it? [15:07] jake_: running ubuntu on EC2, presumably it's because sockets are disabled [15:09] joshbuddy has joined the channel [15:12] derbumi has joined the channel [15:19] lars_smit has left the channel [15:20] mattly: i have to wonder why there still isn't any kind of strftime implementation on Date in standard ECMA [15:25] tlrobinson has joined the channel [15:28] derbumi has joined the channel [15:30] broofa has joined the channel [15:32] alexiskander has joined the channel [15:35] jake_: getting: address family not supported any ideas? [15:41] devinus has joined the channel [15:46] arlolra has joined the channel [15:47] johan-s has joined the channel [15:47] johan-s has joined the channel [15:47] johan-s has joined the channel [15:47] derbumi has joined the channel [15:48] johan-s has joined the channel [15:48] dgathright has joined the channel [15:48] johan-s has joined the channel [15:50] tav has joined the channel [15:55] sh1mmer has joined the channel [15:57] mfeiri_ has joined the channel [16:00] JAAulde has joined the channel [16:03] brianm has left the channel [16:05] mattly has joined the channel [16:07] dandean has joined the channel [16:11] RayMorgan has joined the channel [16:11] sh1mmer has joined the channel [16:13] CodeOfficer has joined the channel [16:14] mjr_: jake_: I remember someone else having that as well with a recent build from head. Does it happen on older releases? [16:16] jake_: hmm let me try [16:17] gbot2 has joined the channel [16:17] mjr_: also, I assume this is Linux, and not OSX, right? [16:18] jake_: yep [16:18] jake_: running off of an ubuntu box in EC2 [16:19] mjr_: I need to go for a while. If you can't get it figured out, I think this is worth a mailing list post. [16:19] jake_: how far back of a version do you think? [16:19] mjr_: I'm running on EC2 as well, 9.10, with no issues that I know of. [16:19] jake_: gotcha [16:20] mjr_: But you aren't the first person to notice this, so it is worth figuring out. [16:20] jake_: yeah [16:24] jan____ has joined the channel [16:27] silentrob has joined the channel [16:28] brapse has joined the channel [16:29] jake_: getting: address family not supported. any ideas? [16:29] creationix has left the channel [16:29] steadicat has joined the channel [16:30] Gruni has joined the channel [16:30] fizx has joined the channel [16:31] mikeal has joined the channel [16:42] isaacs has joined the channel [16:43] nikhil_ has joined the channel [16:43] fizx has joined the channel [16:43] BRMatt has joined the channel [16:44] bronson has joined the channel [16:51] dgathright has joined the channel [16:52] Gruni has joined the channel [17:00] nefD has joined the channel [17:01] mjr_ has joined the channel [17:04] broofa has left the channel [17:05] broofa has joined the channel [17:08] felixge has joined the channel [17:12] dnolen has joined the channel [17:25] creationix_ has joined the channel [17:26] larssmit has joined the channel [17:26] mjr_ has joined the channel [17:27] larssmit: Created an LinkedIn Node.js group. Feel free to join! [17:28] alex-desktop_ has joined the channel [17:28] mjr_: What's the benefit of these Linkedin groups? [17:32] BRMatt has joined the channel [17:34] aguynamedben has joined the channel [17:35] aguynamedben has joined the channel [17:37] javajunky has joined the channel [17:38] sh1mmer has joined the channel [17:39] larssmit: mrj_: it can help you stay informed and keep in touch with people that share your interest in Node JS. [17:39] sh1m has joined the channel [17:43] JAAulde: larssmit: i just joined the grou [17:43] JAAulde: name is Jim Auldridge [17:44] JAAulde: mjr_: my purpose for joining the Linked in Groups is to stay up to date, and network within a specific community [17:45] JAAulde: It looks like I'll be job hunting as of Wed, so the more contacts I have in different areas, the better [17:50] felixge has joined the channel [17:50] felixge has joined the channel [17:52] sh1m has joined the channel [17:52] larssmit: mjr_: I just approved your request to join the group [17:53] JAAulde: I got an email saying mine was approved, but the site says the request is still pending [17:53] larssmit: And I changed the settings of the Node.js group: no need for approval fot this group anymore [17:55] larssmit: mjr_: in the group dashboard it says you 're a member now [17:55] JAAulde: rebooting for OS X 10.6.3 [18:00] brapse has joined the channel [18:01] creationix has joined the channel [18:02] sh1mmer has joined the channel [18:02] sveisvei has joined the channel [18:06] kriskowal has joined the channel [18:08] erikvold has joined the channel [18:13] _ry: mrd`: mranney? [18:13] mjr_: yo [18:13] _ry: hey [18:13] mjr_: mjr was already taken on GH [18:13] _ry: I love that you're working on beefing up the docs [18:13] tmpvar has joined the channel [18:13] _ry: I was just wondering what your plan was for the examples? [18:13] mjr_: Yeah, we need good docs badly. [18:14] mjr_: I'm putting them all into individual files, but just hand-verifying them for now. [18:14] mjr_: And hand cutting and pasting them into the markdown file, which is tedious and error-prone. [18:14] _ry: are they going to be separate from the markdown? [18:15] mjr_: I think they should be, but then somehow pulled into the markdown file by an automated process. [18:15] _ry: does markdown have includes? [18:15] mjr_: or perhaps some other generated file, maybe the markdown file just links to them. [18:15] mjr_: It has links, but I haven't played with it. [18:16] _ry: my concern is only maintaining all these files [18:16] mjr_: creationix isn't here, but it would be good to get his take on this. I'm hoping that eventually we can use his fancy viewer, but that his fancy viewer will read the same markdown file. [18:16] _ry: it seems like they could go stale quickly [18:16] mfeiri_ has joined the channel [18:16] javajunky has joined the channel [18:16] mjr_: Yeah, if they aren't run automatically, then they'll atrophy. [18:17] mjr_: I think the same will happen if they are embedded into the doc. [18:17] mjr_: WIthout an automated way to run them all, something will change and the docs won't get updated. [18:17] mjr_: What if all of the examples were part of tests? [18:19] _ry: well. if there was just some way to automatically run them... [18:20] isaacs has joined the channel [18:20] mjr_: How does the test suite run everything now? [18:20] _ry: Anyway. Can I take your changes without all the example files for now? [18:20] _ry: there is a test runner [18:20] mjr_: Just run all scripts in the same dir, and check the exit status? [18:21] _ry: it's a bit more complicated than that, but basically [18:21] _ry: checkout the Makeifle [18:21] alx_ has joined the channel [18:21] hober has joined the channel [18:21] mjr_: That logic would be a reasonable way to run all of the examples as well. Not completely thorough, but it would at least catch basic things. [18:21] mjr_: Yes, if you like the content, by all means pull the markdown file. [18:23] joshbuddy has joined the channel [18:23] joshbuddy has joined the channel [18:25] teemow has joined the channel [18:25] drostie has joined the channel [18:25] admc has joined the channel [18:26] CIA-77: node: 03Matt Ranney 07master * r7c77a56 10/ doc/api.markdown : Improve documentation. - http://bit.ly/a5RNSm [18:26] _ry: mjr_: ---^ [18:26] mjr_: Nice. [18:26] mjr_: I'll keep the examples current by hand for the next couple of weeks, at least until I make it all the way through the whole document. [18:27] mjr_: And then hopefully we can figure out some automated way of testing them and then generating the document from them. [18:29] mjr_: _ry: do you like that REPL patch I sent out a while back if it had a test? [18:29] _ry: mjr_: i forget now... [18:29] mjr_: multi-repl, listening on multiple sockets and pulling out the state into per-repl vars. [18:30] felixge: we really need curses bindings for the repl [18:30] felixge: that would it make nicer [18:31] mjr_: felixge: I know, I want curses bindings as well. Actually tab completion first. [18:31] felixge: mjr_: wouldn't tab completion be something we would need curses for? [18:32] mjr_: felixge: well, you can do tab completion with pure \r's, as long as the terminal is in cbreak mode. [18:32] _ry: yes curses [18:32] _ry: mjr_: i did like it! [18:32] felixge: just looked at the new docs [18:32] felixge: looks really nice [18:32] felixge: I like it [18:33] mjr_: cool, thanks. [18:33] felixge: but no more ToC, right? [18:33] felixge: (table of contents) [18:33] _ry: no - i find that annoying too [18:33] mjr_: the new viewer will have a very fancy TOC and browsing interface. [18:34] felixge: mjr_: ok, I'm sold :) [18:34] mjr_: felixge: with my REPL patch, you can use socat to talk to node, and socat has full readline. [18:34] Aduros has joined the channel [18:34] felixge: mjr_: looking at it, can you give me the synpopsis of what this will bring to the table? [18:35] mjr_: My change makes each repl have its own state, as well as read/write from its own stream. [18:36] felixge: mjr_: wouldn't each repl process have it's state anyway? [18:36] mjr_: not in the current lib/repl.js [18:36] felixge: why? I mean it's a seperate node instance, no? [18:36] mjr_: It is very much shared state in the module. [18:36] felixge: mjr_: oh, you mean if you embedd the repl into your own app? [18:37] mjr_: I mean multiple repls talking to the same node instance, potentially over different streams, like one on stdin, one on a unix socket, and one on tcp. [18:37] felixge: rather than calling up node-repl ? [18:38] _ry: felixge: you can connect to the process through unix sockets instead of stdio [18:38] _ry: which allows the possibility for the process to be detached from a terminal [18:39] felixge: _ry: nice! [18:39] _ry: but still accessable via repl [18:39] felixge: very cool [18:39] _ry: socat is telnet but for unix sockets instead of tcp [18:39] mjr_: oh right, thanks. I was confused about what you were asking, felixge. [18:39] felixge: I like [18:39] felixge: but it wouldn't support auto-complete ever? [18:39] felixge: or would it send over keyboard events as well? [18:39] _ry: it's line buffered [18:39] mjr_: Look at this example program: [18:39] mjr_: http://gist.github.com/340924 [18:39] _ry: afaik [18:40] felixge: _ry: so that's a no, right? [18:40] _ry: right [18:40] kriskowal has joined the channel [18:40] felixge: well, that's ok [18:40] _ry: we need curses for that stuff [18:40] felixge: I guess I need the tab complete mostly for trying out stuff, not for debugging a server [18:40] kriskowal_ has joined the channel [18:41] deanlandolt has joined the channel [18:42] mjr_: The thing is, once we have curses, then we'll need to rebuild all of readline in JS. [18:42] mjr_: or at least, all of the parts we care about. [18:43] felixge: hm, I have never used curses directly, so I wouldn't know [18:43] devinus: _ry: i think i found a bug in path.join [18:43] felixge: how does python/ruby do it? [18:43] felixge: for their shells? [18:44] pavelz_: i wonder how exceptions can be handled in event driven environment. should exception have a handle on all resources associated with the event? since there is not stack to execution order ... [18:44] _ry: devinus: what isit? [18:45] kixxauth has joined the channel [18:45] _ry: mjr_: that'll be fun for someone :) [18:45] devinus: _ry: path.join('', 'Trash') => '/Trash' ... in ruby/python it would be 'Trash' [18:45] felixge: pavelz_: you pass the exception as the first error to your callback [18:45] _ry: anyway - i'm sure it can be done in a few lines [18:45] _ry: devinus: ah okay [18:45] _ry: devinus: do you want to patch it? [18:46] devinus: _ry: i would if i knew where to look [18:46] _ry: devinus: src/node.js [18:46] devinus: _ry: but i failed to find where it's actually defined :-/ [18:46] devinus: _ry: k [18:46] devinus: _ry: pull request ? [18:46] larssmit has joined the channel [18:46] _ry: devinus: add a test too [18:46] felixge: pavelz_: or do you mean sync functions that may be used within an async function? [18:46] devinus: _ry: k [18:46] _ry: devinus: test/simple/test-path.js i think [18:47] tjholowaychuk has joined the channel [18:47] pavelz_: felixge: yeah, if there is an exception is thrown from within a call back, where does it go? [18:48] mjr_: up [18:48] felixge: pavelz_: it's going to node's global exception handler which gives you a chance to handle it via the 'uncaughtException' event [18:48] felixge: but you won't get any context out of that [18:49] felixge: so you'd have to attach any context / state to the error object before [18:49] mjr_: pavelz_: a common way to address this is to define your callbacks inline, as anonymous functions that close over the surrounding state. [18:49] pavelz_: thats what I meant now do resources get cleaned up on execption [18:49] pavelz_: felixge: ah, ok [18:49] felixge: pavelz_: anything that has no more references to it will get eaten by v8's GC at some point [18:49] RayMorgan has joined the channel [18:50] mjr_: But in your callback, you'll need to try/catch if you want to catch any exceptions that your callback throws. [18:52] alex-desktop_ has joined the channel [19:04] alexiskander has joined the channel [19:08] isaacs: i sort of consider it bad form for callbacks to throw errors [19:08] isaacs: or rather, for callback-taking functions to throw errors [19:09] isaacs: throwing seems like a very violent way to signal a problem [19:12] isaacs: felixge: was it clear what i was saying about forking the module cache? [19:12] bpot has joined the channel [19:12] isaacs: felixge: that stuff gets confusing, and it's tricky to explain, but the test cases cover it pretty well. [19:13] isaacs: felixge: i feel like life would be easier if we did things with some kind of inter-continental shared whiteboard [19:13] felixge: isaacs: heh [19:13] felixge: isaacs: well I understand your concern [19:14] isaacs: herby's approach will work for your use case, as well, though [19:14] felixge: isaacs: users of require.uncached() would need to make sure they don't create cyclic problems [19:14] isaacs: because everything that descends from the require.uncache() loaded module will be in its own cache [19:14] felixge: I mean it's not hard to avoid when you keep it in mind [19:14] isaacs: right [19:14] isaacs: most users are not felixge, though, unfortunately. [19:15] felixge: isaacs: now we have 2 problems [19:15] felixge: :) [19:15] isaacs: hahah [19:15] felixge: isaacs: not sure I saw herby's approach [19:16] isaacs: well, basically, instead of just copying the parent's moduleCache, or creating a whole new one, the require.uncache() loaded child gets Object.create(parent.moduleCache) [19:16] isaacs: so the new entries won't go into the parent's cache, but it'll still get the cached versions of anything loaded in that "branch", or in the trunk beforehand [19:18] felixge: isaacs: well, but if the parent already loaded some of the children of the module you are trying to require.uncached, those won't be reloaded [19:18] felixge: isaacs: what would work is to create a new module cache and only populate it with the parent? [19:18] isaacs: but what if you have this case: [19:19] isaacs: the parent loads A B and C. then, ti uncached loads D and E [19:19] isaacs: D loads F and G, and E loads F and H [19:19] isaacs: so, if D does require(A) or require(B) or require(C), then it'll get the preloaded ones [19:19] isaacs: which is expected, imo [19:19] isaacs: but if D does require(H), it'll load it fresh, because D and E are forked off of one another [19:20] isaacs: (you see why we need a whiteboard?) [19:20] felixge: not sure I follow, where is that inter-galactic whiteboard you mentioned? [19:20] felixge: ;) [19:21] xla has joined the channel [19:21] javajunky: hmm inter-galactic whiteboard, sounds like an excuse to play with canvas, web sockets and node.js ;) [19:23] isaacs: felixge: http://www.scriblink.com/index.jsp?act=phome&roomid=2659&KEY=55E779C3CA43E6B053E920E8155188B7 [19:25] isaacs: felixge: so, A does require(B) and require(C) [19:25] felixge: still connecting to your galaxy, hang on [19:25] isaacs: then A does require.uncached(E) and require.uncached(F) [19:26] isaacs: someone decided to deface it a little [19:26] isaacs: screw it, maybe skitch would be better... [19:26] felixge: isaacs: yeah this one is giving me an infinite monster AJAX spinner [19:26] felixge: but not much more [19:26] felixge: ;) [19:27] voodootikigod_: hehe [19:27] isaacs: no worries, working on a diagram in skitch [19:28] larssmit has left the channel [19:32] isaacs: felixge: http://skitch.com/isaacschlueter/nhky6/require.uncached-spec [19:32] KungFuHamster: would appreciate someone taking a look at this and giving a newb feedback http://paste2.org/p/744298 [19:32] xla has joined the channel [19:33] schuyler1d has joined the channel [19:35] felixge: isaacs: so E is required regular and F via uncached? [19:36] isaacs: green == uncached [19:36] isaacs: A does require.uncached(E); require.uncached(F) [19:36] felixge: isaacs: yeah this highlights my problem exactly [19:36] felixge: isaacs: I need B & C to be fresh in E & F [19:37] isaacs: felixge: so, you want the child moduleCache to contain ONLY the parent, then? [19:37] felixge: isaacs: because B/C could be utility libs like a string class [19:37] felixge: isaacs: yeah [19:37] isaacs: hm. [19:38] isaacs: couldn't you do that by just having a single entry point that does that stuff? [19:38] sh1mmer has joined the channel [19:38] felixge: isaacs: well I have a single entry point, but I don't want to limit it to not use any other utility modules [19:38] isaacs: i see [19:38] isaacs: and you want it to reload those things [19:38] felixge: isaacs: yeah [19:40] sh1m has joined the channel [19:41] isaacs: well, what if you just had a SIGHUP listener (like you do) that does stringUtil = require.uncached("./utils/string")? [19:43] felixge: isaacs: that wouldn't update it for child modules that use it [19:43] felixge: isaacs: oh wait, I guess it would [19:43] isaacs: hm, you're right [19:43] felixge: since they do require() again [19:43] isaacs: right, but they'd get the cached one, not the new one [19:43] felixge: and the uncached() version has overwritten the parent [19:43] felixge: well they get the one that was last cahced? [19:43] isaacs: unless require.uncached refreshed the cache [19:44] felixge: right [19:44] felixge: I don't see why it shouldn't [19:44] icey has joined the channel [19:44] isaacs: hm. that does open some odd edge cases in terms of module's referential integrity. [19:44] icey: If I wanted to create a multi-channel chat application, would it be idiomatic to use an EventEmitter per channel? Or should I go about it another way? [19:44] isaacs: ie, require(A) might not === require(A) another place. [19:44] felixge: isaacs: yeah [19:45] isaacs: just because someone else did require.uncached(A) at some point [19:45] felixge: isaacs: I mean I like my solution best because it's the simplest and easiest to understand [19:45] felixge: isaacs: and it's not hard to avoid cycles [19:45] isaacs: for your app, yeah [19:45] felixge: isaacs: and if you get them - you'll know! [19:45] felixge: :) [19:45] isaacs: well, unless they happen at request time [19:45] felixge: isaacs: not sure what other use cases there are for require.uncached() [19:45] isaacs: then you'll just suddenly wonder why your app segfaults [19:46] felixge: icey: yeah, that would work. [19:46] schuyler1d has left the channel [19:46] isaacs: it's stuff like this that makes me kinda see the value in the pythonic religion. [19:46] icey: felixge: awesome, thanks. it looks like it works fine in the code; i just wanted to make sure it wasn't one of those "OMG NEVER DO THAT" sort of things [19:46] felixge: isaacs: pythonic religion? [19:46] isaacs: at least there's only ONE crazy insane stupid way to do most things... [19:46] larssmit has joined the channel [19:47] isaacs: icey: you know, writing a chat server in javascript was once one of those "OMG NEVER" things.. [19:47] felixge: isaacs: what about require.force() [19:47] felixge: isaacs: sounds more dangerous [19:47] felixge: ;) [19:47] felixge: I don't really see a value in a require.uncached() function that isn't "deep" [19:47] isaacs: i see. [19:48] isaacs: require.uncached to me should mean "bypass the cache" [19:48] isaacs: but not having the parent in the cache means that you'll get crazy spirals almost immediately [19:48] isaacs: so a cache with JUST the parent kind of makes more sense than a cahce that inherits the parent's cache. [19:48] felixge: (brb phone) [19:49] icey: isaacs: haha good point [19:49] isaacs: felixge: also, i've started rewriting my module.js. too many changes, it's starting to develop scar tissue already. [19:49] felixge: ouch : ) [19:49] felixge: isaacs: the module system is a really difficult piece of code [19:49] isaacs: felixge: you're telling me! [19:49] felixge: so I'm not surprised [19:49] felixge: :) [19:49] isaacs: so many edge cases! [19:50] pedrobelo has joined the channel [19:50] sh1mmer has joined the channel [19:51] tmpvar has joined the channel [19:53] _ry: yes [19:53] _ry: it's difficult [19:53] _ry: i think you have to write it a few times to get it right [19:54] isaacs: _ry: i think most code worth writing is worth writing at least 3 or 4 times. [19:55] around has joined the channel [19:55] around: Hello everyone. I am having trouble running Node.js: http://pastie.org/894079 [19:56] around: Looks trivial, did I miss something? [19:56] around: Node just exits without any output.. [19:57] mjr_: works on my machine [19:57] mjr_: waits 2 seconds, and then sends hello world. [19:57] pavelz_: mjr_: thats classic :) [19:57] pavelz_: http://www.codinghorror.com/blog/2007/03/the-works-on-my-machine-certification-program.html [19:58] mjr_: you shouldn't need to run it as root [19:58] mjr_: I wasn't aware that WoMM was so rigorously specified. [19:58] xla has joined the channel [19:59] xla has joined the channel [19:59] xla has joined the channel [20:00] hellp has joined the channel [20:00] binary42 has joined the channel [20:00] _ry: around: what version [20:01] _ry: around: what os? [20:02] softdrink: so… who's going to write qt4 bindings for me? ¬¬ [20:02] mjr_: softdrink: let me find my hourly rate sheet. [20:03] softdrink: but it would be great for your code portfolio! *duck* [20:03] xla: clientsfromhell.tumblr.com/ [20:04] fictorial has joined the channel [20:05] _ry: qt bindings would be great [20:05] _ry: node really fits well with qt [20:05] softdrink: xla: so depressing hehe [20:05] xla: softdrink: it is, but the qt4 bindings are neat [20:06] mjr_: Yeah, it'd be useful, especially if we had node on Windows. [20:06] isaacs: around: you're using a very old version of node [20:06] isaacs: around: writeHead was introduced in 0.1.30-something, and your node is 0.1.12 [20:07] around: _ry: click the link, http://pastie.org/894079 its Snow Leopard [20:07] softdrink: qt bindings would be a TON of work [20:07] _ry: around: upgrade to the latest node [20:07] isaacs: around: get 0.1.33 from http://nodejs.org/#download [20:08] RayMorgan has joined the channel [20:08] xla: brew install node ;) [20:08] tjholowaychuk: kiwi install node [20:08] tjholowaychuk: :p [20:08] tjholowaychuk: lol [20:08] around: isaacs: got it [20:09] around: isaacs: thing is it would seem like an error message would be appropriate here.. [20:09] isaacs: around: sure. lemme just fire up my time machine and go back and add an error message to 0.1.12 ;P [20:09] isaacs: around: if you try to call a function that isn't a fucntion now, it should throw as well as crash [20:10] around: isaacs: dude, i mean it should complain when there is an undefined function [20:10] isaacs: around: yeah. it should now. [20:10] around: isaacs: no need for sarcasm [20:10] isaacs: around: there was a bug back then where an error in the main module wouldn't be reported, it'd just die [20:10] isaacs: around: that bug has since been fixed. [20:10] around: isaacs: gotcha [20:10] around: isaacs: thanks much [20:11] Ramone: hey... can anyone tell me what I'd want execinfo for? [20:11] isaacs: around: np. not trying to be a douche with the sarcasm, just having fun. if you upgrade, it'll work. [20:11] mjr_: I wonder if stack traces should include the version number. That way when people send problem output, it'd be easier to identify. [20:11] RayMorgan_ has joined the channel [20:11] xla: mjr_: too much LOD [20:12] mjr_: Also, I guess stack traces should include the bug, the solution, and a piece of good advice from an old person. [20:12] isaacs: mjr_: that would be kinda nice. in this case, to his credit, around did have $ node -v in his pastie [20:12] isaacs: which is very very helpful [20:13] around: _ry: isaacs: yeah, got it working.. thanks guys [20:13] isaacs: yay [20:13] isaacs: _ry: say, the version on the docs in 0.1.33, but node -v shows v0.1.32-189-g7c77a56 in HEAD [20:13] isaacs: _ry: is that normal? [20:15] tjholowaychuk: HEAD's version is always fucked up for me [20:16] mjr_: mine shows v0.1.33-179-g3f7367f [20:16] _ry: isaacs: yes [20:16] isaacs: kewl [20:16] _ry: :) [20:17] _ry: git describe [20:24] hellp has joined the channel [20:27] rictic has joined the channel [20:29] mattly has joined the channel [20:33] aguynamedben has joined the channel [20:34] BRMatt|away has joined the channel [20:35] around: i love node.. it drops latency from 400ms to 80ms.. that feels so snappy [20:36] around: WebKit almost cant keep up :) [20:39] xla has joined the channel [20:41] sudoer has joined the channel [20:41] Ramone: niiiiiiice.... my segfault got fixed somehow in a recent update [20:41] Ramone: thanks whoever :) [20:42] RayMorgan has joined the channel [20:44] r11t has joined the channel [20:45] felixge: isaacs: re [20:45] isaacs: felixge: yo [20:46] felixge: isaacs: I'm fine with the parent being in the cache [20:46] felixge: but even without I don't think " you'll get crazy spirals almost immediately" [20:46] isaacs: well, no, but i'm just predicting it'll be a common subject of IRC and email wtfs. [20:46] felixge: you will only get those if the child requires the parent, which IMHO would never happen if you have a thin entry-point module that you just use as the base for reloading [20:47] isaacs: i have a lot of code that requires the parent in the child. [20:47] felixge: isaacs: weird, I never do :) [20:47] isaacs: it's not terribly uncommon [20:47] felixge: isaacs: no we have to find out who is the weirdo :) [20:47] isaacs: hahah [20:47] felixge: * now [20:47] Tim_Smart has joined the channel [20:47] felixge: anyway, I think with the parent being in cache the problem is largely a non-problem [20:48] isaacs: for example, in npm, install and link both call npm.build() [20:48] isaacs: which is a top-level function [20:48] isaacs: if you're ok with the parent staying cached, then i'm ok with that. [20:48] isaacs: that solves my issue, and yours. [20:48] felixge: yeah [20:48] isaacs: so we dont' have to worry about who's the weirdo [20:48] felixge: so basically you get a new cache object with nothing but the parent in it, right? [20:48] r11t_ has joined the channel [20:49] isaacs: right [20:49] isaacs: t [20:49] felixge: makes sense [20:49] Tim_Smart: felixge: So why do you need uncached for every file upload? [20:49] felixge: Tim_Smart: I essentially delegate every new file upload to module [20:49] felixge: so when my code changes, I want that module (and all of the modules it requires) to be reloaded [20:50] felixge: * to a module [20:50] isaacs: Tim_Smart: he's actually not doing uncached() for every upload. he just swaps out the locally held upload handler function on SIGHUP [20:50] felixge: So I want to be able to update my reference to the 'upload_handler' module in my entry point module which has the http server [20:51] felixge: isaacs: exactly [20:51] icey has left the channel [20:53] binary42 has joined the channel [20:53] Tim_Smart: felixge: I would put the server in a child process myself, and the parent module would just manage the processes etc [20:53] isaacs: it's actually a fairly elegant way to do hot-swapping [20:53] isaacs: assuming that you don't accidentally have some memory leaks. [20:54] mikeal has joined the channel [20:54] Tim_Smart: when new code comes in, send a message saying "stop", and the process stops listening to incoming connections and the new process starts a new server [20:54] felixge: can I close my server without dropping connections already established? [20:54] isaacs: Tim_Smart: IPC would certainly work, but as we don't have a way to transfer a TCP connection into the subprocess, there's no way to do that without dropping connections. [20:55] isaacs: Tim_Smart: which is not a big deal, but the uploads can be hours long. [20:55] isaacs: *not normally a big deal [20:55] Tim_Smart: isaacs: You start the connection inside the process. You can close the server without dropping connections [20:55] Tim_Smart: You just stop listening for new ones [20:56] around: Are you guys using Dropbox to store youre repos? [20:56] Tim_Smart: The only problem is, is that the change will be hard to make 'seam-less' [20:56] Tim_Smart: around: github.com [20:56] xla: around: github.com [20:57] isaacs: i see, so you start up a new server, and send a signal to the sub proc to do server.close() [20:57] bronson has joined the channel [20:57] xla: tjholowaychuk: any plans to release a homebrew Formula for kiwi? [20:57] Tim_Smart: isaacs: Yup [20:57] around: Tim_Smart: xla: github is wack, requires git push [20:57] xla: around: bitbucket.com [20:57] Tim_Smart: around: What is wrong with git? git is awesome [20:57] isaacs: around: but... that's.. a good thing? [20:57] xla: around: require hg push [20:57] tjholowaychuk: xla: I dont know much about homebrew (aside from using it a few times) but if its quick then yeah forsure [20:58] around: Is there a user profile module or class within node/node-based framework? I need simple user profiles.. [20:58] felixge: Tim_Smart: I think what you are proposing could work [20:58] xla: tjholowaychuk: I'd like to see that, imagine: brew install node kiwi ;) [20:58] felixge: Tim_Smart: but I'd still have a small window of time where the old server is closed and the new one is not ready yet, right? [20:58] around: isaacs: no its not, Dropbox is completely transparent [20:58] tjholowaychuk: xla: :d [20:58] tjholowaychuk: :D [20:58] felixge: what I like about my uncached() approach is that it's literally seamless [20:58] mikeal: this error throw stuff is funny [20:59] tjholowaychuk: xla: maybe post an issue on github so I can get to it when I have some time :D [20:59] around: isaacs: i use Dropbox to host my git checkouts then push to github or unfuddle or whatever [20:59] isaacs: around: i use dropbox, too [20:59] around: only when i need to [20:59] mikeal: because i've actually gotten used to node doing nothing but something not working as meaning there was an error thrown :) [20:59] isaacs: around: but git is better for code. [20:59] mikeal: someone was talking about writing dropbox clone that uses CouchDB [20:59] xla: tjholowaychuk: either that, or baking the Formula myself [21:00] around: isaacs: But dropbox lets you share checkouts across laptop+workstation+ipad+ipod+whatever [21:00] mikeal: i would love that [21:00] devinus: i need a naming convention. what should I call my functions called "getFile" and "gotFile" :( [21:00] devinus: ? [21:00] Tim_Smart: around: Just go learn git, and you will pretty much become a ninja [21:00] isaacs: around: so does git. you just push it there. [21:00] around: Tim_Smart: youre not listeining, i just git daily [21:00] tjholowaychuk: xla: that would be great, appreciate any help [21:00] mikeal: don't checkin too many binary files in to git [21:00] mikeal: it's a bad idea [21:00] mikeal: especially if you plan on updating them often [21:00] isaacs: around: and dropbox doesn't have branching, which is pretty much the *point* of a scm system [21:00] Tim_Smart: around: Your not communicating what you are doing well [21:00] mikeal: i know some companies that have done this and it takes hours to rebase [21:01] felixge: mikeal: amend, binary files & git are not friends :( [21:01] isaacs: mikeal: yeah, binary files don't belong in scm. [21:01] felixge: * amen [21:01] around: isaacs: i am all for scm, my point is dropbox+distributed scm = win [21:01] isaacs: the "sc" is "source code" [21:01] tjholowaychuk: _ry: eyyy, did you ever get my read/write stream prototype patch? right now its all this.foo = function(){} [21:01] felixge: isaacs: that sucks, I'd love scm's to support htem [21:01] felixge: isaacs: I need binary files as fixtures for my tests [21:01] mikeal: if you've got like one favion image, whatever, but don't start using it as your sole deployment system [21:02] isaacs: felixge: well, just checking them in is fine. but changing them a bunch and using the scm to track changes is not goo. [21:02] isaacs: good [21:02] around: So is there a user profile module or class within node/node-based framework? I need simple user profiles. [21:02] felixge: tjholowaychuk: this is called 'privileged' methods [21:02] isaacs: there are better tools for that [21:02] mikeal: yeah, they are called CouchDB :) [21:02] tjholowaychuk: felixge: I know but its slow [21:02] felixge: tjholowaychuk: you will run out of file descriptors before you can measure the time elapsed ;) [21:02] Tim_Smart: dropbox probably uses a git backend [21:02] around: tjholowaychuk: CouchDB is slow? GImme a break.. [21:03] tjholowaychuk: around: no lol [21:03] felixge: tjholowaychuk: not sure we share a definition of slow [21:03] isaacs: Tim_Smart: last i heard, it used svn [21:03] isaacs: Tim_Smart: but that was a few years back [21:03] felixge: tjholowaychuk: if object creation would actually matter for this I would probably agree, but it really doesn't [21:03] around: The whole fixture thing will evolve into something better, you'll see [21:03] felixge: tjholowaychuk: and v8 actually optimizes constructors like this [21:04] isaacs: around: using git inside dropbox is failsome because of the fix-hosts thing. it makes it impossible to *not* be in sync between two machines, and breaks pushes/pulls between them. [21:04] isaacs: tjholowaychuk: when you say "slow", what benchmarks are you referring to? [21:04] around: isaacs: youre right, but the thing is that i want my repos be same across all my workstations at all times [21:05] around: isaacs: even for scm [21:05] isaacs: around: imo, it's the "s" on "workstations" that is the source of your problem ;P [21:05] around: isaacs: like, work vs home vs laptop [21:05] isaacs: ACTION is very monogamous with his macbook [21:05] mikeal: i love my bigass iMac [21:05] tjholowaychuk: isaacs: its common knowledge that this slows things down.. maybe not drastically but it does. not worth arguing about though lol [21:05] isaacs: sistertrain-lm is how i access other machines. [21:05] around: isaacs: i am sure you've got 2+ machines youreself that you use for development [21:05] mikeal: and when I'm home and travelling I've got my Air [21:05] around: isaacs: cheapo [21:05] mikeal: so EVERYTHING is in github or couchdb [21:05] isaacs: tjholowaychuk: i wrote node-bench precisely because the "common knowledge" about software speed is almost ALWAYS wrong. [21:06] charlesjolley has joined the channel [21:06] isaacs: tjholowaychuk: words like "slower", "efficient", "faster", etc, generally have no meaning whatsoever unless accompanied by a benchmark. [21:07] mikeal: benchmarks can be misleading [21:07] mikeal: performance is relative [21:07] mikeal: so what is this slow relative to? [21:07] isaacs: tjholowaychuk: i can say "running is way faster than driving your car, because my feet are so much lighter." but the minute you measure that bit of common knowledge, you'd find it's completely bogus. [21:07] around: mikeal: +1 [21:07] tjholowaychuk: benchmarks in JS are insanely unreliable [21:07] isaacs: mikeal: exactly [21:07] isaacs: tjholowaychuk: check out node-bench. it's insanely reliable. [21:07] mikeal: tjholowaychuk: depends on what you're doing, i have an awesome node concurrent performance tester for CouchDB [21:07] mikeal: and it's highly reliable [21:07] isaacs: tjholowaychuk: i abstract out all the common sources of irregularity, and come up with a very reliable processes/second measurement. [21:08] mikeal: i don't do quantitative numbers [21:08] mikeal: i do qualitative comparison numbers [21:08] isaacs: tjholowaychuk: of course, it's a micro-bench platform, so it's only as valid as the tests you throw at it, and doesn't do end-to-end testing like ab, which is more useful in the macro qualitative sense. [21:08] mikeal: so i run many times against a target and a baseline live datasource [21:08] mikeal: and then chart the difference between them [21:08] xla: from DB performance to js bench reliability, LMAO [21:09] joshholt_ has joined the channel [21:09] mikeal: that way any differences in hardware are minimized because they are run at nearly the same time [21:09] mikeal: and i don't have to worry about historical numbers and re-baselining old data [21:09] isaacs: around: i have a few linux hosts, a few linux VMs, a mac mini server for entertainment. but my laptop is the portal to all of them. [21:10] isaacs: tjholowaychuk mikeal: the main issue is, for js benchmarking, you must measure runs-per-time, not time-per-run. the GC will turn your margin of error into much greater than 100% [21:11] felixge: isaacs: I have a little benchmark thingie I'm working on as well. Basically your benchmark needs to accept an 'iterations' parameter, and my module will call up the function while doubling the iterations number each time until the benchmark runs for X-ms. Then this 'iterations' number is re-used for any additional repetitions to get a smooth answer. Also calculates stuff like avg, median, variation, etc. [21:12] mikeal: i run for quite a while [21:12] mikeal: and run the same test many times [21:12] mikeal: so difference in when it decides to GC are minimized [21:12] isaacs: felixge: node-bench supports that, but it doesn't double the iterations for each pass. [21:12] felixge: isaacs: what's cool about this is that you define "how long" your benchmark will run instead of having to find the right "iterations" number by hand to get a reasonably long running one [21:12] mikeal: but I'm actually testing the average response time of the remote service [21:12] mikeal: so it's much less of an issue for me [21:12] isaacs: felixge: right, node-bench lets you set the number of runs per test, and the total time to run. [21:13] felixge: isaacs: that's problematic since you have to check the time every x-repetitions [21:13] felixge: isaacs: I only have to check the time at the beginning and the end of each run, completely eliminating any influence of it [21:13] isaacs: felixge: well, it's up to you to set the reps high enough to make the time check not relevant. [21:14] isaacs: felixge: i've played around with measuring the actual effect of the time check, and you can see pretty clearly that the the effect gets asymptotically smaller as the reps get higher. [21:14] around: isaacs: you havent played me [21:15] felixge: isaacs: right, but you have to hand-tune your 'rep' number [21:15] pyro_ has joined the channel [21:15] pyro_: has anyone fixed gnutls on osx? [21:15] isaacs: felixge: so i default the reps to 1000 and the timeout to 1000ms per run, because for the kinds fo things that node-bench is good at testing, that's about an order of magnitude more than necessary. [21:15] felixge: isaacs: and some weird regression may cause you to have to completely re-calibrate to get any results at all [21:15] pyro_: i have installed it through homebrew but it keeps failing to configure [21:15] mjr_: I like the auto-scaling of the iterations. [21:15] felixge: isaacs: you use setTimeout() ? [21:16] felixge: isaacs: that wouldn't fire for pure JS tests, no? [21:16] isaacs: felixge: no, it wouldn't. i check the clock. [21:16] isaacs: mostly i use it for sync tests. [21:17] isaacs: like checking which way of calling functions is fastest. (turns out, obj.foo() is MUCH faster than foo.apply(obj)) [21:17] felixge: isaacs: I use it to test the behavior of arrays and objects :) [21:17] felixge: for dirty [21:17] isaacs: rigt [21:17] felixge: isaacs: anyway, I'd have to look more closely at how your implementation does it [21:18] isaacs: felixge: i'd love any feedback you have on node-bench. [21:18] felixge: isaacs: I dislike you use C++ [21:18] felixge: I don't really know why [21:18] brapse has joined the channel [21:18] isaacs: felixge: that's only because osx doesn't let you shebang to a shebang script [21:18] isaacs: it's only a few lines of c [21:18] felixge: isaacs: oh, it's because you really really want your own executable? [21:19] isaacs: well, i want to be able to shebang to it [21:19] isaacs: having an executable is perfectly doable in js [21:19] jazzychad has joined the channel [21:19] isaacs: anyway, i really dig the auto-tuning the reps and doubling the count on each pass. it'd just have to do that for everything in the test set, otherwise it could skew the results. [21:20] felixge: right [21:20] tjholowaychuk: doesnt even work for me, node-bench just sits around forever [21:20] tjholowaychuk: docs / makefile are off too [21:22] gJ|Alex has joined the channel [21:22] tilgovi has joined the channel [21:24] technoweenie has joined the channel [21:24] isaacs: tjholowaychuk: it might need to be updated for the latest node. [21:25] tjholowaychuk: isaacs: ps. were you contacted by heroku for npm? [21:26] isaacs: tjholowaychuk: nope. [21:26] isaacs: tjholowaychuk: who's heroku? [21:26] tjholowaychuk: isaacs: the ruby host guys, heroku.com [21:26] tjholowaychuk: but nvm answers that haha [21:28] isaacs: not sure what they'd want from npm. [21:28] isaacs: are they doing node hosting now? [21:29] felixge: I would not want to be a node.js hosting company for another year or so :) [21:29] tjholowaychuk: haha yeah no doubt [21:29] tjholowaychuk: would be hell right now [21:30] felixge: In fact, I'm not writing a single line of node.js code anymore that is not fully unit tested, I learned this the very hard way [21:30] felixge: :) [21:30] felixge: actually, not just unit tested, also integration tested and system tested [21:30] felixge: that helps me sleep these days [21:30] _ry: api stability is near [21:31] fictorial: yay! [21:31] _ry: i will make explicit promises [21:31] xla: _ry: why? [21:31] technoweenie: a stable node makes for a happy community [21:32] tjholowaychuk: wahoo! so stoked [21:32] felixge: _ry: NOOOO!!!! Do not take my justifications for perfectionism from me [21:32] technoweenie: felixge: what do you use for testing? specifically for async stuff [21:32] tjholowaychuk: felixge: i feel the pain! anything left untested will surely bite you in the ass later [21:32] isaacs: _ry: do you mean promises or Promises? [21:32] felixge: technoweenie: assert.js with a few tiny ahcks on top [21:32] technoweenie: i still havent settled on a testing setup that i really like. i had something but it used promises which are now gone [21:32] felixge: * hacks [21:32] isaacs: _ry: because callbacks do just fine. [21:33] pavelz_: isaacs: ha [21:33] felixge: technoweenie: let me paste you some samples [21:33] pyro_: has anyone got node with gnutls compiling on 64bit Snow Leopard? [21:33] felixge: technoweenie: this is the main utility function I rely on: http://gist.github.com/348433 [21:33] pavelz_: well there is jspec... [21:34] _ry: pyro_: yes [21:34] xla: pyro_: + [21:34] technoweenie: i had some problems doing stuff in the process.exit event [21:34] technoweenie: some stuff wouldnt work because it thought the process was exiting or something [21:34] felixge: technoweenie: and this is about as complex as I go for a single test case: https://gist.github.com/1206f5eb26bf3c28121e [21:34] felixge: I use 1 file per test case (which is usually a single function) [21:34] xla: technoweenie: thought process.exit() isnt for code execution [21:35] technoweenie: xla: in the gist, he's listening for the process.exit event [21:35] technoweenie: he's not calling process.exit() [21:35] felixge: technoweenie: imho the only thing that should not work is firing of new I/O calls from within exec() [21:35] RayMorgan_ has joined the channel [21:35] technoweenie: felixge: yea, so its just one test per file? my projects usually have thousands of tests [21:35] felixge: technoweenie: any sync calls (like throwing an error) should work [21:36] felixge: technoweenie: https://gist.github.com/c3b6e150776d539feb59 [21:36] technoweenie: well my node projects are considerably smaller i guess [21:36] felixge: ;) [21:36] pyro_: _ry: i just formatted my macbook this morning and have done nothing else but install homebrew and gnutls with that but still no luck :( [21:37] pyro_: my business partner also formatted today aswell and followed the same steps and his works so i imagine it's tied to 64bit [21:37] xla: pyro_: do u installed latest xcode? [21:37] pyro_: xla: are you serious? [21:37] felixge: technoweenie: I don't see anything wrong with lots of files [21:37] xla: pyro_: rather often [21:37] felixge: it's actually the easiest for me to navigate [21:37] pyro_: xla: we both figured that wouldnt cause a problem :( are you serious :O [21:37] felixge: and it makes sure that each individual test runs *very* fast [21:37] technoweenie: what do you use to run them all [21:37] felixge: I hate tests that run longer than ~100ms [21:37] technoweenie: do you have a makefile for that [21:38] jed has joined the channel [21:39] felixge: technoweenie: for small projects I stick to makefiles, here I'm using rake: https://gist.github.com/8a71cf1d34eab6538e7b [21:39] _ry: pyro_: HEAD or 0.1.33? [21:40] tjholowaychuk: ruby will just slow it down tons lol i cant stand waiting for ruby [21:40] Tim_Smart: felixge: cake ftw hehe [21:40] tjholowaychuk: in most cases its a bad idea not to run all the tests IMO you never know what your fucking with [21:40] felixge: tjholowaychuk: it's actually just as fast for running a bunch of 'sh' calls as a makefile is [21:41] felixge: (I know because I benchmarked it) [21:41] tjholowaychuk: felixge: not for me lol I some how managed to bog it down tons though, not even sure how [21:41] tjholowaychuk: ruby runs like shit for me now [21:41] felixge: tjholowaychuk: weird [21:41] Tim_Smart: Have a look at Coffeescript's cake utility [21:41] felixge: actually the 'rake' command may have an increased startup time [21:41] Tim_Smart: async cakefiles [21:41] tjholowaychuk: like for my jspec shit, jspec run --node is sooo much slower than just node spec/node.js [21:41] felixge: but that becomes irrelevant for a longer running suite [21:42] gwoo has joined the channel [21:42] technoweenie: you might have ruby compiled wrong [21:42] technoweenie: theres some cli switch that fucks ruby up on osx [21:42] tjholowaychuk: i think disable-pthread or something [21:43] felixge: pyro_: I had no luck with gnutls on OSX period. I have it installed but ./configure does not pick it up [21:43] technoweenie: disable-ruby more like it amirite [21:43] tmpvar: ls [21:43] tmpvar: wow [21:43] tmpvar: ACTION goes back to lurking [21:43] technoweenie: jed: hey do you have a working example of ternary apps? a friend and i tried like hell to get something working [21:43] felixge: technoweenie: anyway, I'm not really sure if node would benefit from an all fluffy testing framework / dsl [21:44] technoweenie: for bigger test suites it would [21:44] felixge: technoweenie: imho the nested callbacks from async calls just cry for a hard-core purist approach to things [21:44] felixge: ;) [21:44] technoweenie: but node is pretty damn fast its not a big deal [21:44] technoweenie: yea, well in my wheres-waldo tests i'd just do promise.wait() and wait for them to return [21:45] bpot has joined the channel [21:45] technoweenie: http://github.com/technoweenie/wheres-waldo/blob/master/test/waldo_test.js [21:45] tjholowaychuk: I just assign fs.readFile etc to fs.readFileSync and wrap making things "appear" async [21:45] tjholowaychuk: lame hack but it works [21:45] felixge: technoweenie: you can't do that anymore *g* [21:45] tjholowaychuk: and still runs 400+ specs in ~200ms [21:45] isaacs: tjholowaychuk: fixed node-bench. should work in teh latest nodejs now. [21:45] jed: technoweenie: "path" is a ternary app: http://github.com/jed/fab/blob/v3/lib/common/path.js [21:46] tjholowaychuk: isaacs: cool man I will check it out [21:46] technoweenie: hm ok [21:46] technoweenie: well zenhob discovered it broke on node master or something [21:46] technoweenie: he couldnt get binary apps to work because he was on a fairly old node, i made him upgrade and that worked [21:46] technoweenie: but we gave up on ternary apps :) [21:47] jed: technoweenie: ha ha. [21:47] technoweenie: jed: he spent the weekend fucking with fab, came in this morning like "i now know javascript" [21:47] jed: technoweenie: did you try something like function( app1, app2, app3 ){ ... } [21:47] technoweenie: yea, i'll downgrade to the latest node stable and try again. i felt like i was really close to getting it [21:48] jed: technoweenie: i'm using it with the latest node without issue so far. [21:48] technoweenie: hmm ok [21:48] felixge: I can't await for my next excuse to play with fab [21:48] jed: technoweenie: do you know where he's having issues? and are you use he's using v3? [21:48] micheil: hmm... it's a technoweenie... [21:48] felixge: it's just such a good concept [21:48] isaacs: ternary app? [21:48] jed: felixge: (and i'll be using node-dirty on my next project..) [21:49] technoweenie: isaacs: it's a type of app that fab.js v3 accepts. [21:49] technoweenie: felixge: i guess my beef w/ all those test files is the fact that you're starting up and tearing down a server in each file [21:49] felixge: Maybe I should call 'dirty' NoSqlLite [21:49] felixge: :) [21:49] isaacs: so the "ternary" is just cuz it's v3? [21:49] devinus: what's faster, pop() or arr[arr.length-1] or reverse().shift() ? [21:49] technoweenie: maybe its not a big deal [21:49] jed: isaacs: yeah, i'm rewriting (fab). it's a pretty interesting concept. [21:49] technoweenie: isaacs: no, because it takes 3 parameters [21:49] isaacs: devinus: fastest is to keep track of the length yourself. [21:49] felixge: technoweenie: why am I starting up a server in each file? [21:49] isaacs: devinus: but pop() is faster if you don't already know the length. [21:49] felixge: technoweenie: this was an integration test, so it had to do this [21:50] isaacs: devinus: revers().shift() is slowest [21:50] felixge: technoweenie: most of my tests are much simpler [21:50] devinus: isaacs: ah. good, i do. [21:50] isaacs: devinus: at least, last i measured. [21:50] jed: isaacs: http://gist.github.com/327241 [21:50] technoweenie: yes, in the integration tests [21:50] felixge: technoweenie: http://gist.github.com/348456 [21:50] technoweenie: or do you just startup a server and pass a port to it [21:51] felixge: is what a pure unit test looks like for me [21:51] technoweenie: pass a port to the test [21:51] isaacs: jed: i see. so it's a router. [21:51] felixge: technoweenie: I have a common.js file which has a default port configured [21:51] isaacs: jed: er, a switch [21:51] technoweenie: ah ok hm [21:51] jed: isaacs: yeah, just like a ternary operator. [21:51] isaacs: jed: "if X, then do the first one, otherwise, do the second, and here's the responder" [21:51] jed: isaacs: right. [21:51] isaacs: got it [21:51] isaacs: neat! [21:51] technoweenie: felixge: that makes sense then [21:52] jed: isaacs: i've taken everything else out. the only way to write a fab app is to write unary, binary, and ternary apps. [21:52] technoweenie: felixge: the test dsl stuff helps w/ clean error messages and spec-like output. also, exceptions in one part of the test file dont affect the rest of the test file [21:52] isaacs: jed: that's the way to do it [21:52] isaacs: ok, need lunch [21:52] technoweenie: but yea, splitting files up works too. its just different, im sure i can get used to it :) [21:52] isaacs: wow, very busy day here today. lotta chatter. this is fun. [21:52] technoweenie: as long as your shits fucking tested, who cares [21:52] felixge: technoweenie: yeah, but that stuff is really hard to manage once you go asynchronous [21:53] xla: tjholowaychuk: homebrew Formula is done [21:53] tjholowaychuk: xla: awesome! [21:53] charlesjolley has joined the channel [21:54] tjholowaychuk: technoweenie: its not that bad check out express` specs if your find with little hacks to spec async stuff in a bdd fashion [21:54] tjholowaychuk: isaacs: worken now! whoop [21:54] technoweenie: i dont care for those tests *at all* actually [21:54] technoweenie: i'm not a fan of rspec [21:55] tjholowaychuk: to each their own [21:55] technoweenie: yea :) [21:55] isaacs: rspec, like so many ruby utils, strikes me as something where "make it look cool" is the top priority, and "make it useful" is a very distant second. [21:55] tjholowaychuk: its about organization [21:55] tjholowaychuk: not just a big shit ball of tests [21:56] aryounce has joined the channel [21:56] technoweenie: thats all on teh project, not the framework [21:56] isaacs: it("has a face", function () { punch("omg i hate this") }) [21:56] technoweenie: i write shitty tests in test/unit and rspec [21:56] tjholowaychuk: what do you use? [21:56] technoweenie: test/unit [21:56] isaacs: i use require("assert") [21:56] technoweenie: but i've used all of them [21:56] isaacs: assert is like a 3 line function in javascript [21:57] pyro_: _ry: i'm having the gnutls problems on HEAD [21:57] isaacs: just use that. [21:57] tjholowaychuk: you just said you write bad tests with test/unit [21:57] technoweenie: yea [21:58] technoweenie: isaacs: those test descriptions are helpful, they give useful output when stuff breaks [21:58] _ry: pyro_: use tcp_old [21:58] technoweenie: if done well, they can give osme insight on why the test was written that way, they can provide some documentation on how to use your library too [21:58] isaacs: function assert (test, reason) { if (!test) throw new Error(reason) } [21:58] _ry: pyro_: or use a release [21:58] isaacs: assert(a == b, "a should equal b") [21:58] technoweenie: sure, and when one test fails, it quits running the rest of the file [21:58] isaacs: look, i just saved you a KLOC [21:58] _ry: pyro_: bleeding edge = bleeding [21:59] isaacs: technoweenie: as it should be. [21:59] pavelz_: its all about motivation and where does action originate, if it's a clients wish then you write a spec and bang out a code for that. If I am hacking on my own, most often am meandering and dont really know what I would like to do, tests are hard to write then, because you dont know what the end result will be. [21:59] tjholowaychuk: lol [21:59] tjholowaychuk: grump [21:59] isaacs: you pass all tests, or you fix it until you do [21:59] isaacs: or you comment out the tests that you don't mean to pass. [21:59] isaacs: it's a brilliantly simple approach that is just crazy enough to be awesome. [21:59] tjholowaychuk: I like seeing how it affects the whole suite, gives me a better idea of what went wrong [21:59] technoweenie: i like seeing all the errors up front [21:59] isaacs: require("assert") has some other handy bits, like deepEqual, etc. [21:59] technoweenie: i use the assert lib that node shits with [22:00] technoweenie: ships* [22:00] isaacs: i'll leave "logging all the failing errors instead of throwing" as an exercise for the reader. [22:00] isaacs: it should be doable in no more than 5 more lines of code. [22:00] isaacs: rspec is fetishistically bloated. [22:00] isaacs: <3 the software,