[00:13] rictic has joined the channel [00:22] onar has joined the channel [00:23] charlenopires has joined the channel [00:26] yaroslav has joined the channel [00:28] unomi has joined the channel [00:28] JimBastard has joined the channel [00:30] bentomas has joined the channel [01:08] dandean has joined the channel [01:16] stepheneb has joined the channel [01:17] joshbuddy has joined the channel [01:17] joshbuddy has joined the channel [01:24] aguynamedben has joined the channel [01:25] dnolen has joined the channel [01:28] JimBastard: hey creationix do you feel like upgrading http://github.com/creationix/node-persistence to node 1.29? [01:29] JimBastard: even if its just the memory adapter that would allow us to stub it out [01:32] dnolen_ has joined the channel [01:33] RayMorgan has joined the channel [01:36] mattly_ has joined the channel [01:39] voodootikigod_ has joined the channel [01:39] mattly has joined the channel [01:42] mattly_ has joined the channel [01:43] creationix: JumBastard: Why not 0.1.30? [02:07] JimBastard: hey why hasn't anyone made javascript on jails [02:13] stepheneb has joined the channel [02:14] rtomayko has joined the channel [02:21] bpot has joined the channel [02:24] dnolen has joined the channel [02:31] RayMorgan_ has joined the channel [02:33] JimBastard: http://github.com/creationix/node-persistence/commit/6ff7fcd6828c8efea1a1a1a4a9d643c7b8ffb964 wooot [02:33] creationix: working on the the test suite now [02:33] JimBastard: you the man [02:33] JimBastard: ACTION gives creationix three internet dollars. [02:34] creationix: sweet, I'll cash when I'm in town [02:34] JimBastard: i don't think they are re-deemable [02:35] creationix: :P [02:37] dnolen has left the channel [02:37] creationix: btw, I'll be in NY for a business trip sometime in march, it would be cool to meet some of you [02:39] stephenlb: non-blocking AWS libs on Node? for S3 [02:40] dnolen_ has joined the channel [02:41] JimBastard: yaya ill take you to the place where naked women serve you deep fried coca cola twinkies [02:41] JimBastard: yo creationix im looking through the lib again, do you actually have any of the mongo stuff connected? [02:41] stephenlb: ! [02:42] creationix: JimBastard: nope [02:42] JimBastard: errr fuck [02:42] creationix: but it will be added [02:42] JimBastard: whats the best approach with that? is there a native node driver yet? [02:42] creationix: yep, http://github.com/christkv/node-mongodb-native [02:43] Tim_Smart: But it needs to be updated [02:43] JimBastard: Working against node 0.1.30 [02:43] Tim_Smart: no it doesn't actually [02:43] JimBastard: :-D [02:43] Tim_Smart: ^^ [02:43] JimBastard: ya so i dont mind having to be in memory for now [02:44] JimBastard: can persist store data as a flat file as well? [02:47] JimBastard: something like this ? http://gist.github.com/314169 (not so great code) [02:58] RayMorgan has joined the channel [02:58] creationix: btw you can use "w" instead of process.O_CREAT|process.O_WRONLY|process.O_EXCL now [03:01] adamv has joined the channel [03:01] stepheneb has joined the channel [03:03] JimBastard: thats some old copypasta [03:03] JimBastard: not good eats [03:03] JimBastard: but yeah, that will store application state in flat file when server shuts down or when you ask it to save [03:03] JimBastard: and loads it to memory on boot [03:04] JimBastard: not a lot of lines [03:04] JimBastard: process.addListener("SIGINT", function(){ application.end();}); [03:04] JimBastard: something like that [03:06] creationix: JimBastard: that's the functionality I want to add to my memory driver [03:06] JimBastard: you can pull it off in very few lines [03:06] creationix: yep [03:06] JimBastard: i can add it if you tell me where to do it [03:06] creationix: I'm updating the sqlite driver now, it's a bit more work [03:08] creationix: you're welcome to add it, or wait till I'm done updating the other drivers [03:08] jtoy has joined the channel [03:09] JimBastard: ill let you do your thing and watch the repo for today [03:09] creationix: ok, cool [03:15] creationix: changing from promises to callback is fun (delete, delete, delete, comma, delete...) [03:19] dnolen has joined the channel [03:19] isaacs has joined the channel [03:38] steadicat has joined the channel [03:44] jashkenas: creationix: did you ever find a good JS syntax highlighter? [03:45] creationix: nope [03:45] tlrobinson_ has joined the channel [03:45] creationix: my last idea before I gave up was to wrap pygments in a child process [03:46] mumrah_ has joined the channel [03:46] creationix: but it spawned way too many processes for my program [03:46] jashkenas: you were highlighting every code snippet in howtonode in a separate process, huh. [03:46] creationix: yep, and thanks to the parallel nature of node, they all happened at once! [03:47] jashkenas: fork bomb style [03:48] creationix: someone needs to port pygments to js, and that someone won't be me [03:48] creationix: (not any time soon at least) [03:49] mumrah_: anyone know if JS passes objects by value or reference [03:50] creationix: reference usually [03:51] creationix: well, I guess always since primitives are immutable [03:51] mumrah_: sweet [03:54] arlolra has joined the channel [03:55] mumrah_: sometimes i miss pointers [03:55] mumrah_: but then, most of the time - i dont' [03:58] creationix: yeah, references are better most of the time (and a lot simpler) [03:59] cloudhead has joined the channel [04:00] JimBastard: sup jashkenas [04:00] jashkenas: yo. [04:01] JimBastard: chillin having a javascript party [04:01] JimBastard: i got this neat web project going [04:01] JimBastard: should be doing private beta soon [04:01] JimBastard: node based [04:02] jashkenas: this is your new job? [04:02] JimBastard: negative, a side project [04:03] JimBastard: a free web hook platform [04:03] jashkenas: this is what you need the persistence for [04:03] JimBastard: among other things [04:03] JimBastard: ive got a few node apps [04:07] jtoy has joined the channel [04:11] steadicat has joined the channel [04:20] brainproxy has joined the channel [04:31] mumrah_ has left the channel [04:31] brainproxy has joined the channel [04:47] steadicat has joined the channel [04:56] binary42 has joined the channel [05:01] jcrosby has joined the channel [05:04] alexiskander has joined the channel [05:11] kriszyp_ has joined the channel [05:23] creationix has joined the channel [05:27] chakrit has joined the channel [05:44] mikeal has joined the channel [05:49] mikeal: i keep reading these PyCon blog posts about all the "huge changes" happening in Python [05:50] mikeal: and i can't help but smile [05:50] mikeal: like "you know what happened this month in node, Ryan broke ALL THE CODES" [05:50] mikeal: it's awesome [05:55] fwg: :D [06:12] bentomas has left the channel [06:12] bentomas has joined the channel [06:12] bentomas: ryah: did you see the patch I sent to the mailing list? [06:12] ryah: bentomas: yeah [06:13] ryah: just haven't gotten to it yet [06:13] bentomas: just curious as to what you thought of it. I'm going to bed, so I guess I'll see in the morning [06:13] bentomas: sorry to bother! [06:14] steadicat has joined the channel [06:33] bpot has joined the channel [06:37] micheil_mbp has joined the channel [06:40] joshbuddy has joined the channel [06:40] joshbuddy has joined the channel [06:44] creationix has left the channel [06:45] micheil has joined the channel [06:50] dnolen has joined the channel [06:52] bentomas has joined the channel [06:53] kennethkalmer has joined the channel [07:09] micheil has joined the channel [07:14] gwoo has joined the channel [07:19] mjr_ has joined the channel [07:26] kjeldahl has joined the channel [07:31] dekz_ has joined the channel [07:52] maushu has joined the channel [08:01] mikeal has joined the channel [08:01] bentomas: Couldn't sleep, so instead decided to write up another patch for Node [08:08] bentomas has left the channel [08:26] rictic has joined the channel [08:45] zmoog has joined the channel [08:46] teemow has joined the channel [08:46] eikke has joined the channel [08:59] felixge has joined the channel [08:59] felixge has joined the channel [09:06] eikke has joined the channel [09:07] olivvv has joined the channel [09:10] tisba has joined the channel [09:22] eikke has joined the channel [09:23] markwubben has joined the channel [09:38] BBB has joined the channel [10:09] markwubben has joined the channel [10:14] eikke has joined the channel [10:28] felixge has joined the channel [10:28] felixge has joined the channel [11:03] ithinkihaveacat has joined the channel [11:04] jashkenas has joined the channel [11:09] pdelgallego has joined the channel [11:32] teemow has joined the channel [12:05] caolanm has joined the channel [12:06] BryanWB has joined the channel [12:07] BryanWB: do i need to recompile node.js after pulling new changes from the git repo? [12:09] micheil: yes [12:09] BryanWB has joined the channel [12:11] emyller has joined the channel [12:11] Spot_ has joined the channel [12:15] lifo has joined the channel [12:15] beppu has joined the channel [12:16] jazzychad has joined the channel [12:16] konobi has joined the channel [12:16] martyn__ has joined the channel [12:16] orlandov has joined the channel [12:16] trodrigues has joined the channel [12:16] elbart has joined the channel [12:16] er1k757 has joined the channel [12:18] BryanWB: anybody here familiar w/ creationix's do library? [12:19] BryanWB: his syntax throws me off a bit and am wondering if it is specific to ecma5 [12:21] happyelephant has joined the channel [12:23] fwg: ecma5 is not out yet [12:24] micheil: ecma5 is out iirc. [12:25] micheil: BryanWB: it's got a different syntax, check the articles on howtonode.org [12:25] BryanWB: it was ratified early december [12:25] BryanWB: micheil, that's what i am doing ;) [12:25] BryanWB: micheil, going thru excellent "do" tutorial [12:26] fwg: the spec yes, but no implementation [12:26] fwg: and v8 only has a few bits like Object.create [12:28] nefD has joined the channel [12:28] BryanWB: fwg, ok I am confused by syntax like that used in the divide method here http://gist.github.com/314503 [12:29] fwg: ok, i confused your understanding of syntax and semantics [12:30] BryanWB: it doesn't look like valid js 1.5 but I could be mistaken [12:30] jashkenas has left the channel [12:34] fwg: i think there are programmes that can confirm wether a file adheres to some syntax rules [12:41] BryanWB: where do i put libraries so node's require can find them? [12:41] BryanWB: i put do.js in lib/ but require('do') doesn't work [12:42] sztanpet has joined the channel [12:44] micheil: BryanWB: it has to be in your require.paths [12:45] micheil: BryanWB: and that code works similar to a closure [12:46] micheil: var myfn = (function(x){ return x;}); (myfn)(2) // => 2 [12:46] BryanWB: micheil, tks [12:46] micheil: we're just creating a new function with two arguments, callback and success [12:46] BryanWB: micheil, like (function($){...})(jQuery); [12:46] micheil: yeah [12:46] micheil: although, in this case it's more like: [12:47] micheil: var myfn = (function(x){ return x();}); (myfn)(function(){ return 2;}) // => 2 [12:47] micheil: sort of. [12:47] BryanWB: neat stuff [12:47] micheil: so, divide(100, 10) // => function(){} [12:48] micheil: then you're just invoking that function with the given arguments [12:48] micheil: so specifically: divide(100, 10) // => function(callback, errback){} [12:50] BryanWB: micheil, do i need to recompile whenver i pull lots of changes from node's git repo? [12:50] micheil: yes [12:50] micheil: just a `make && make test && make install` should do the job [12:51] micheil: (make test is optional, but I recommend it) [12:51] BryanWB: micheil, great, so don't need to do ./configure [12:51] micheil: no [12:51] micheil: and it'll use the cache, so only things update will be recompiled [12:54] markwubben has joined the channel [13:06] mahemoff has joined the channel [13:15] jashkenas has joined the channel [13:27] kennethkalmer has joined the channel [13:31] charlenopires has joined the channel [13:33] mAritz has joined the channel [13:49] steadicat has joined the channel [13:51] gf3 has joined the channel [14:01] vdrab has joined the channel [14:04] kriszyp has joined the channel [14:11] n8o_ has joined the channel [14:16] n8o_ has joined the channel [14:18] kennethkalmer has joined the channel [14:18] pdelgallego has joined the channel [14:22] caolanm has joined the channel [14:22] joshbuddy has joined the channel [14:22] joshbuddy has joined the channel [14:23] mumrah has joined the channel [14:23] mumrah has left the channel [14:23] caolanm: working up the courage to upgrade to 0.1.30 this evening, but the lack of guidance on async APIs after the removal of promises is a bit confusing... what sort of API should my modules be exposing? [14:23] mumrah has joined the channel [14:24] jashkenas: module.method(function(error, arg1, arg2){ ... }) [14:25] markwubben has joined the channel [14:25] jashkenas: pass a single callback that takes an error object as its first argument. If you get an error, deal with it or raise it (or pass it to your callback if you're async yourself). [14:25] ashb: btw - has no one commented on how foolish an idea it was to do a major API breaking change on a fucking point release? [14:26] caolanm: yeah, this upgrade is going to be *painful* [14:26] ashb: it screams "we dont care about our users" [14:26] ashb: http://semver.org/ [14:27] ashb: tho that does say 'Major version zero (0.y.z) is for initial development. Anything may change at any time.' [14:27] caolanm: jashkenas: so you'd expect all modules exposing async functions to match the callback style node.js uses in the fs module (and others) [14:27] caolanm: ? [14:27] ashb: still - would it have been to much to bump to 0.2? [14:27] sztanpet: ashb node has done this all the time [14:27] BryanWB has joined the channel [14:27] sztanpet: 0.2 will bring a stable api [14:28] jashkenas: caolanm: yep. I think that the current plan is that if you do that -- libraries can be built on top that combine callbacks into Promises, continuables, and whatever you need. [14:28] mumrah: anyone here privy to any plans to make node.js scalable on a process level? [14:28] ashb: why not 1.0 be hte stable api, and minor versions indiciate api breaking changes? [14:28] sztanpet: why should it? [14:28] ashb: so you can easily see if you cna upgrade [14:29] mumrah: i read something about message passing on the About page [14:29] ashb: upgrading from 0.1.29 to 0.1.30 to most people wouldn't indicate that all your code will stop working [14:29] mumrah: just wondering if there is a solid roadmap that includes this [14:29] caolanm: I'm a bit concerned about the lack of direction on more advanced async APIs though... The idea that for any one project I'm likely to need Promises, Do... and probably some others, is a bit strange [14:29] sztanpet: again, your talking like node is production quality code with a mature codebase [14:29] BryanWB: mumrah, i think there is a plan for ipc btw node processes [14:30] BryanWB: mumrah, but don't know details [14:30] mumrah: BryanWB: thanks [14:30] vdrab: Hi. I was wondering, how "useful" do you find Node's IO model for general scripting tasks? Meaning, when you're not serving up 1000's of connection on a server but when all you're doing is the usual perl/python/ruby text mangling, opening files, doing some regex matching, and so on. Do you find it useful / efficient / elegant / whatever for those scenarios too, or does it become more of a pain? [14:31] ashb: i personally find it a fucking pain for that case [14:31] mumrah: fwiw, i'd like to see message passing as an IPC method [14:31] BryanWB: vdrab, i think it is useful for general scripting tasks, esp. build scripts [14:31] mumrah: specifically something like MPI (with dynamic typing, of course) [14:31] BryanWB: vdrab, but i haven't tried it for that purpose yet [14:32] vdrab: thanks. mumrah: as in, the MPI C library? inter-process messaging? [14:32] caolanm: vdrab: doing everything async for simple scripts is a pain, but with the right mix of sync and async (now there are sync fs functions) it can be quite nice to use [14:33] caolanm: still, not sure I'd recommend it over something like python yet [14:33] caolanm: its a joy to use for other stuff though :) [14:34] vdrab: I see. thanks for the info [14:34] mumrah: vdrab: well MPI is an API specification - there are implementations in C, C++, Fortran, etc [14:34] bryanl has joined the channel [14:34] vdrab: mumrah: right. Are you saying node implements it too? that would be wicked [14:34] mumrah: vdrab: I'm saying i would vote for it [14:35] mumrah: if a solid IPC scheme hasn't been decided upon [14:35] vdrab: hehe, oh ok. [14:35] ashb: json as the IPC ftw :) [14:36] ashb: send json over a socket/pipe between processes [14:36] BryanWB: ashb, and not XML? [14:36] BryanWB: ACTION ducks [14:36] mumrah: ^^ [14:36] vdrab: hehe [14:37] mumrah: clearly, a SOAP interface described by a WDSL is the solution [14:37] vdrab: with a 2mb xml schema [14:37] caolanm: so what's the state of the more advanced async APIs? what are people using? sticking with promises or taking the opportunity to try something else? [14:38] mumrah: caolanm: what type of APIs? [14:38] caolanm: I mean the modules like node-promise and Do [14:38] mumrah: also, async what? I/O? [14:38] mumrah: ook [14:38] caolanm: sorry, not very clear ;) [14:39] caolanm: I'm hoping theres a really nice style I can pick up to sweeten the pill of v0.1.30 [14:39] caolanm: heh [14:39] jashkenas: caolanm -- with 0.1.30, watch out for the error object. You're going to silently swallow all errors that you don't check for and throw yourself. [14:40] mumrah: personally, i've just been using EventEmitter and a stack of callbacks [14:40] caolanm: jashkenas: yeah, I've been seeing a lot of if(err) throw err; at the top of callbacks [14:41] jashkenas: It's pretty bad. I think that errors should have a different path for async code. having to deal with them is the whole reason that simple callbacks don't just work in the first place. [14:42] jashkenas: I'd rather see simple callbacks with no special convention. And a top level EventEmitter for exceptions. [14:42] jashkenas: If you throw one, the callback doesn't fire, but the top-level emitter fires the event, if there's no handler for it, you get a real exception, instead of a silently ignored one. [14:43] caolanm: but then how do you know the context of the exception? [14:43] jashkenas: And then it's a matter of registering handlers that can deal with the exceptions you can be reasonably expected to handle. [14:43] mumrah: just to satisfy my curiosity, could everyone say in a few words what they're using node.js for? [14:43] jashkenas: You'd include it as a part of the exception. [14:43] jashkenas: Everything that you need to handle it. [14:44] caolanm: I see. [14:44] jashkenas: If that means attaching the callback, or variables from the context where it occurred, fine. [14:44] jashkenas: The goal being that while it's all still async, exceptions behave more as if you have a real call stack and not an event loop. [14:45] davidsklar has joined the channel [14:45] jashkenas: There would be a fallback, catch-all event at the top level emitter, if you were running something like a server where the process shouldn't die, no matter what happens. [14:46] jashkenas: Anyhow, that's my take. [14:48] mumrah: everyone ignored my census :( [14:48] jashkenas: mumrah: sorry, CoffeeScript. [14:48] mumrah: i'll start: I'm working on a backend for a 2d in-browser game [14:50] caolanm: mumrah: sounds fun :) [14:50] mumrah: caolamn: hopefully! [14:52] cloudhead has joined the channel [15:03] mumrah: the first thing i'm doing for it (the 2d game engine) is implementing a quadtree [15:03] mumrah: which felt really, really strange to do in JS [15:04] BryanWB: mumrah, i dream of redoing moodle w/ an architecture that seamlessly scales from a small school to whole school district [15:05] mumrah: what is moodle? [15:05] Booster has joined the channel [15:05] BryanWB: mumrah, learning management system for schools [15:05] mumrah: neat! [15:06] mumrah: is it akin to Blackboard? [15:06] BryanWB: mumrah, yeah, a foss competitor [15:06] mumrah: i wish you all the best with that [15:06] mumrah: i hear BB is a really carnivorous company [15:06] caolanm: that sounds interesting too :) [15:06] BryanWB: mumrah, it is just an idea right now [15:07] BryanWB: mumrah, i know, i used to work there [15:07] mumrah: ! [15:07] caolanm: BryanWB do you work with moodle? [15:07] BryanWB: caolanm, yeah, we use it on my project but it is a resource hog [15:07] BryanWB: caolanm, and takes a lot of tweaking to handle heavy usage [15:08] mumrah: sounds like BB ^^ [15:08] caolanm: so you have some fairly big deployments of it? [15:08] mumrah: ever semester in college it would go down during registration [15:08] BryanWB: caolanm, no, we run an individual server per school [15:08] mumrah: JSP ftw [15:08] caolanm: still, good to hear schools making use of FOSS :D [15:12] caolanm: mumrah: to answer your question, I'm playing with the idea of JSON document publishing... I use zope a lot, and don't really get on with the idea of Object publishing. However, through seperating the data and behaviour more cleanly I think it could be much nicer to work with... [15:13] caolanm: but, I'm just exploring some ideas for now :) [15:13] mumrah: cool [15:13] caolanm: I'm liking all the development going on regarding web frameworks for node.js [15:14] atcrabtree has joined the channel [15:18] mumrah: yea, it will be interesting to see what comes out on top [15:18] mumrah: i played around with regex url routing the other day [15:19] mumrah: worked fine, but certainly not as clean as the python frameworks i'm used to [15:26] jashkenas has left the channel [15:26] Harrison has joined the channel [15:38] kriszyp_ has joined the channel [15:44] binary42 has joined the channel [15:45] binary42 has joined the channel [15:46] caolanm: what are people using for unit testing with node.js ...I've been using qunit, because I'm used to it, but it doesn't work well with the module system [15:47] caolanm: I've hacked around that and have a nice little test runner script, but it would be nice to switch to something which integrates better [15:52] creationix has joined the channel [15:53] binary42 has joined the channel [15:55] alex-desktop has joined the channel [15:55] dnolen has joined the channel [16:02] arlolra has joined the channel [16:04] mumrah: i think it uses msjunit [16:05] mumrah: mjsunit * [16:05] paulca has joined the channel [16:05] mumrah: have you used the "assert" module http://nodejs.org/api.html#_assert_module ? [16:06] ollie has joined the channel [16:08] arlolra_ has joined the channel [16:09] Spot_: Is there anyway to get access to my 'sys' var from within a module? [16:11] morgan has joined the channel [16:11] alexiskander has joined the channel [16:12] sudoer has joined the channel [16:15] morgan: Is the a way to suppress sys.puts output? [16:15] inimino: caolanm: I'm just updating the continuables library I use for 0.1.30 [16:15] morgan: I'm having an odd issue [16:15] inimino: morgan: >/dev/null [16:15] morgan: a sys.puts in one constructor is not working when being created from another require [16:16] morgan: I mean from withing Node [16:16] morgan: there should be output and I'm not getting it [16:16] inimino: got a small test case? [16:16] morgan: and in this case, if I just put sys.puts('here') at the top of lib/http.js I get nothing [16:16] morgan: oh wiat..... [16:17] inimino: ashb: there have been breaking API changes in just about every version so far... [16:17] ashb: inimino: nothing that major before tho? [16:18] inimino: well, major in the sense of "we moved some names around and all your code will break" [16:19] teemow has joined the channel [16:20] caolanm: inimino: link to your continuables lib? [16:21] inimino: caolanm: I'm just updating the documentation then I'll release 0.2, the original code and explanation is here: http://inimino.org/~inimino/blog/fileio_first_release [16:22] inimino: caolanm: and the current code is here: http://boshi.inimino.org/3box/fileIO/ [16:23] inimino: (and it should run in 0.1.30, but the README needs to catch up to the code) [16:25] inimino: caolanm: if you like functional programming style it might appeal to you, otherwise take a look at kriszyp's Promise library or maybe even the bare node API [16:26] caolanm: inimino: yes, I like functional programming style [16:26] caolanm: :) [16:26] caolanm: don't really feel comfortable with OO [16:26] eikke has joined the channel [16:29] caolanm: inimino: just looking through the README, looks nice :) [16:29] Booster has joined the channel [16:29] caolanm: inimino: I'll be sure to have a go with it once its updated [16:29] inimino: ACTION is writing the new README [16:29] inimino: cool [16:32] nsm has joined the channel [16:34] PowerToExt has joined the channel [16:38] lifo_ has joined the channel [16:40] stepheneb has joined the channel [16:40] mahemoff has joined the channel [16:43] adamv has joined the channel [16:47] dnolen has joined the channel [16:47] aguynamedben has joined the channel [16:47] JimBastard has joined the channel [16:48] rednul_ has joined the channel [16:52] steadicat has joined the channel [16:55] jcrosby has joined the channel [17:01] fwg_ has joined the channel [17:03] jashkenas has joined the channel [17:05] around has joined the channel [17:08] RayMorgan has joined the channel [17:10] keeto has joined the channel [17:13] pyrotechnick has joined the channel [17:13] pyrotechnick: Property 'tcpSetSecure' of object # is not a function [17:13] pyrotechnick: anyone know why? [17:14] JimBastard: maybe an update? [17:15] JimBastard: did you upgrade recently? [17:15] bryanl has joined the channel [17:17] kennethkalmer has joined the channel [17:17] pdelgallego has joined the channel [17:18] bpot has joined the channel [17:20] fwg_: um, wtf [17:21] fwg_: process.nextTick(function(){try{process.compile('?','whatever')}catch(e){}}) [17:22] fwg_: should not give an exception, or am i being a complete moron? [17:23] brandon_beacher has joined the channel [17:23] fwg_: (btw, it does here, complains about the ? being a syntax err in the file being executed, not "whatever") [17:24] fwg_: err, disregard the last senctence, it complains correctly for whatever [17:34] sudoer has joined the channel [17:36] fwg_: ah, i'm being a moron [17:36] fwg_: ACTION should look into source right away next time [17:38] stephenlb has joined the channel [17:41] fwg_: ryah: ping [17:43] ryah: fwg_: hey [17:43] ryah: um, process.compile() might have a special exception [17:43] fwg_: yeah [17:43] ryah: let me look [17:44] fwg_: well, node exits on syntax errors [17:44] fwg_: thats probably what should happen when node loads modules [17:44] jashkenas has left the channel [17:44] fwg_: i'm using it for my own "plugins", and i would like to handle syntax errors myself [17:45] ryah: yeah - Compile doesn't throw errors it handles them itself [17:45] ryah: and.. i forget why [17:45] fwg_: although i could eval [17:48] ryah: i guess Compile should be fixed [17:48] ryah: looking at the blame, i can't figure out why it's that way [17:49] JimBastard: ryah did you see thread about the nginx creator talking about v8? is there any merit to what he is saying? [17:51] stephenlb: JimBastard: what'd the creator say? [17:52] JimBastard: theres a thread going on the mailing list, its converted from russian so its a bit hard to decipher [17:52] bentomas has joined the channel [17:52] stephenlb: ah [17:52] JimBastard: but he was pretty much saying that v8 is geared more towards chrome itself and not handling a shit ton of concurrent requests [17:52] JimBastard: because of some things that are a bit above my pay-grade [17:53] stephenlb: hm :/ [17:53] JimBastard: check the mailing list [17:53] ryah: JimBastard: sure - mainly context creation is slow [17:53] fwg_: it's basically about creating a new execution context (fresh global objects) per request [17:53] ryah: JimBastard: node only uses one context - so it's not slow [17:54] JimBastard: ryah: so is what he saying not really an issue with node? [17:54] JimBastard: or is this something that can be improved on [17:54] fwg_: reusing contexts is hard atm because one cannot freeze the global object, and so cannot prune any stuff a script might have changed [17:55] JimBastard: im not too concerned with high performance or scalability today, but tomorrow might be a different story [17:55] fwg_: more specific one can not freeze the premordials [17:55] ryah: no -i suppose the out-of-memory problem is valid [17:55] ryah: s/valid/applicable/ [17:56] ryah: JimBastard: node is pretty fast [17:56] JimBastard: is this something i should be worrying about? [17:56] fwg_: no [17:57] JimBastard: aight ill forget about it until it becomes an issue then [17:57] JimBastard: thanks for explaining [17:58] ryah: i mean - it's not going to be an issue - because we're always going to use one context per process [17:58] stephenlb: even with recommended setup for Tornado + Nginx and Starman/Starman + Nginx, Node is still the faster. using ab. [17:58] ryah: well - node isn't going to be faster than pure nginx - ever [17:58] ryah: that's reality [17:59] JimBastard: nginx in its raw state is just a web server right? [17:59] ashb: yes [17:59] stephenlb: JimBastard: yup [17:59] JimBastard: so yeah of course node would be slower [17:59] JimBastard: that makes perfect sense [17:59] ryah: but we can be faster, hopefully, than all dynamic web servers [17:59] JimBastard: i hope so too [18:00] ryah: just because v8 is a really good vm [18:00] stephenlb: ryah: i see that happeing. [18:00] JimBastard: we could always port node.js to the actionscript virtual machine right? i hear thats pretty fast [18:00] ryah: i haven't done benching lately- but in november it wasn't far off [18:00] JimBastard: ;-) [18:00] konobi: tamarin [18:00] JimBastard: avm is the worst [18:01] ashb: avm? [18:01] ashb: isn't that called Tamarin? [18:01] JimBastard: they could call it free beer and cake and it would still suck [18:01] stephenlb: heh [18:01] fwg_: avm2 === tamarin [18:03] Atmoz has joined the channel [18:07] stephenlb has joined the channel [18:08] aho has joined the channel [18:10] atcrabtree has joined the channel [18:19] isaacs has joined the channel [18:20] mattly has joined the channel [18:21] felixge has joined the channel [18:21] felixge has joined the channel [18:24] Spot_: Please excuse my ignorance if this is a newb question. I have this thing serving just fine, and I'm calling close on the response object, but still almost every time I load it with a browser, I get a working icon far after the content has loaded. Anyone experienced this? [18:25] unomi has joined the channel [18:26] mumrah: is the browser looking for favicon.ico? [18:26] Spot_: ahhh is that it? [18:26] JimBastard: yeah Spot_ i was getting that as well [18:26] JimBastard: make sure you have a close handler for unexpected requests [18:26] Spot_: mumrah, I will mention that I am detecting that and returning a 404 immediately [18:26] mumrah: i was confounded for a while when my counter was incrementing by 2 [18:26] JimBastard: whats your http request event handler look like [18:27] Spot_: JimBastard: A lot like a block of code [18:27] JimBastard: are you doing a proxy pass to node? or is node standalone [18:27] Spot_: :P [18:27] JimBastard: i got a better one [18:27] Spot_: Are you wanting me to paste it here or something? :) [18:27] JimBastard: what does JimBastard look like when hes not helping people [18:27] JimBastard: brb [18:27] Spot_: node is standalone [18:27] mumrah: pasetbin [18:29] qFox has joined the channel [18:29] Spot_: I am hesitant to post this code, as it's quite a mess. [18:29] Spot_: :) [18:30] fwg_: pastie.org [18:30] fwg_: we are used to, well, almost anything [18:30] JimBastard: gist.github.com [18:30] mumrah: Spot_: don't worry we will, err won't, judge you [18:30] JimBastard: i'll judge [18:30] fwg_: (oh, forgot, this is not ##js) [18:30] JimBastard: but still try to help [18:31] isaacs: gist is much better than pastie, imo [18:31] JimBastard: you can fork gists [18:31] mumrah: isaacs: agreed actually [18:31] mumrah: that's what she said [18:31] isaacs: Spot_: code must be shared. especially when you are unsure of its quality. [18:31] jcrosby has joined the channel [18:31] JimBastard: its a fucking blizzard here damn [18:31] isaacs: disconnect the ego, and pursue better software. [18:32] JimBastard: yeah Tim_Smart has been working on refactoring a shitton of my code. i wrote some really really hacky stuff, but it worked and contained the core business logic [18:32] Spot_: isaacs: sure.. but this is a first draft for functionality. I haven't done any kind of refactoring :P [18:32] JimBastard: no shame writing shit to get it to compile if you are new [18:32] isaacs: Spot_: ok. great. so you can probably get the best advice now, before you go too far with it. [18:32] mumrah: just paste it already [18:32] JimBastard: best practice dont mean shit if your app dont compile [18:32] isaacs: Spot_: as in, most useful [18:32] mumrah: >< [18:32] bentomas: either you want us to look at it and help or you don't [18:33] isaacs: Spot_: don't be shy. we'll tell you if your code is shit, but we'll still like you as a person. [18:34] Spot_: http://gist.github.com/314864 [18:34] mumrah: my eyes!! [18:34] mumrah: ;) [18:35] fwg_: lol [18:35] mumrah: so without actually reading what it does, i'd say separate out the nested functions [18:35] mumrah: that can kill readability real quick [18:36] fwg_: first thing i'd do is change my editor to 4 space expanding tabs [18:36] fwg_: <( [18:36] fwg_: ;) [18:37] stephenlb: tabs :( [18:37] Spot_: I just switched IDEs [18:37] Spot_: and half of this was written in vim, and the other on the desktop [18:37] mumrah: set tw=4 [18:37] Spot_: We have an internal style guide on that stuff. [18:37] mumrah: set smarttab [18:37] mumrah: ah [18:38] Spot_: mumrah: vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: [18:38] Spot_: already in the file :) [18:40] bentomas: There is a lot going on in this code, my advice to trouble shoot would be to start removing parts one by one until you have the smallest code possible that makes the requests hang [18:40] bentomas: that'd make it a lot easier to find the problem [18:41] Spot_: This thing primarily handles pulling css files off the disk, based on scope (live, or a sandbox) and skin, then parses the files so the images point to the proper location (again based on scope and skin) and hands them back [18:42] Spot_: bentomas: Sure, that's the next step. I was originally just asking in here to make sure I had not hit up on a common mistake. Then the request for the git. [18:42] bentomas: Are you sure close is getting called every time? [18:43] mikeal has joined the channel [18:43] bentomas: do you not neeed a close after line 121? [18:43] Spot_: yeah.. i' [18:43] Spot_: i've actually put a puts() right after the closes to make sure [18:43] bentomas: (just glancing through) [18:43] Spot_: it fires everytime [18:43] JimBastard: back [18:44] Spot_: or it's skipping the close to get to the puts() [18:44] Spot_: :) [18:44] JimBastard: so Spot_ the issue is the browser is keeping requests open [18:44] JimBastard: you are seeing status icon or something [18:44] caolanm has joined the channel [18:44] Spot_: bentomas: You mean the sendResponse line? [18:44] Spot_: It calls close itself [18:45] bentomas: ahhh [18:45] Spot_: JimBastard: In the browser? Yes [18:45] JimBastard: so Spot_ you do have a lot going on here [18:45] Spot_: JimBastard: Also experiencing quite a delay in pay rendering on a page which uses this as a css source [18:46] JimBastard: pay rendering? [18:46] Spot_: page [18:46] bentomas: where is sendResponse declared? [18:46] JimBastard: so Spot_ [18:46] JimBastard: first off [18:46] JimBastard: you should have an error handle on your posix calls [18:46] JimBastard: n.fs.readFile [18:46] Spot_: JimBastard: Again.. this is a first draft [18:47] JimBastard: second i would place a a sys.puts() before your .close [18:47] Spot_: bentomas: Outside this event handler [18:47] JimBastard: and a sys.puts in your event handler start for httprequests [18:47] JimBastard: you'll figure out real quick whats not being closed [18:48] JimBastard: more then likely you arent trapping a condition and .close is never being called [18:48] Spot_: JimBastard: I mentioned up there that I've done that. close() fires everytime [18:48] JimBastard: how do you know [18:48] JimBastard: if you arent logging the start of the request [18:48] JimBastard: things could be requested from the browser you arent aware of [18:48] Spot_: Not in the git no [18:49] Spot_: I've been working on this for a while. Debug code goes in long enough for me to verify something, and then it comes out. [18:49] JimBastard: also, if you are reading files you should be using binary mode [18:50] JimBastard: log every incoming request, trap and log every .close, switch your posix operations to binary for binary files [18:50] JimBastard: if you do that and still are having issues let me know [18:50] Spot_: Like I said, I've done everything there except the binary reads. Maybe those rogue reads are causing the hang. I'll get right on that. [18:51] Spot_: Thanks for the help [18:51] JimBastard: the binary reads are causing your lag [18:51] JimBastard: and also i dont see you .close [18:51] JimBastard: its missing [18:52] JimBastard: sendResponse( response, finalData, isGzip ); return false; [18:52] JimBastard: shouldnt there be a .close there? [18:52] Spot_: http://gist.github.com/314894 [18:52] Spot_: As I stated before... sendResponse handles that [18:53] bentomas: Spot_: sorry we couldn't help more! Usually when my requests hang it is because I have accidentally caught an error and close isn't getting called, but I didn't find any try/catches in your code [18:54] bentomas: Spot_: my guess is that somehow, some time, close isn't getting called [18:54] JimBastard: i see [18:54] Spot_: bentomas: No worries. I was not desperately against a wall. Simply asking incase it was something common I missed. I'll continue with my usualy debugging cycle. Thanks [18:55] JimBastard: well there is no error handler for fs.readFile [18:55] JimBastard: so if an error occurs im assuming it wont .close? [18:55] Spot_: Correct [18:55] bentomas: but he says that the close is getting called, he has thrown in some sys.puts calls [18:55] Spot_: I'll look into it [18:56] JimBastard: if you were trapping the requests correctly like ive advised you'd know exactly which request was causing the issue [18:56] JimBastard: if the browser thinks a request is still open, it probaly is [18:56] Spot_: Are you ignoring everything I have said? [18:56] JimBastard: i ran into very similar issues when working on routing [18:56] JimBastard: no, i just dont believe you [18:56] Spot_: I've done all the debuging you have asked, except for the fs error handling, which I am doing now. [18:57] Spot_: JimBastard: Sounds like a personal problem for you then. [18:57] JimBastard: speaking of personal problems, best of luck [18:57] JimBastard: going back to work [19:00] isaacs: Spot_: so, what's "n"? [19:00] Spot_: isaacs: I just scope all the node objects there [19:00] isaacs: i see [19:00] dnolen has joined the channel [19:01] tisba has joined the channel [19:03] JimBastard: is it bad practice to let fs.readFile() err handler determine if a file doesnt exist? [19:03] Spot_: I just put all the close debugging back in just in case I missed something. Close is being called on every request. [19:03] JimBastard: what about open nigga [19:04] charlenopires has joined the channel [19:04] JimBastard: are you logging the start of every request? [19:04] Spot_: Yes [19:04] Spot_: Even dumping the request string to make sure [19:04] JimBastard: and the amount of opens equals the amount of closes? [19:04] Spot_: Still looking though [19:04] Spot_: Yes [19:04] JimBastard: and you are still getting browser spin? [19:04] Spot_: yes [19:04] JimBastard: is this a public facing site? [19:04] Spot_: but, please.. don't bother with me [19:05] Spot_: You can hit it sure [19:05] JimBastard: k [19:05] Spot_: but not the debug [19:06] Spot_: on a load.. i have the request i intended.. the contents load.. close is called... i see the favicon request.. and close is called [19:06] Spot_: ahh.. need to put in the file handler check [19:06] Spot_: maybe that's it [19:07] Spot_: ahh [19:07] Spot_: that's interesting [19:08] caolanm: does anyone have a handy script for running suites of tests using the assert module? [19:08] isaacs: caolanm: this works for me: http://github.com/isaacs/sax-js/blob/master/test/index.js [19:09] Spot_: Whoa.... that's weird... ok .. so i see the main request... and then the favicon.. both closed... but the browser is still spinning... after a while the browser times out and stops spinning.. and node spits out another request to favicon request and a close [19:09] isaacs: caolanm: check out the other scripts in that folder to see how it's used. http://github.com/isaacs/sax-js/blob/master/test/cdata.js [19:09] joshbuddy has joined the channel [19:09] joshbuddy has joined the channel [19:10] isaacs: Spot_: so the browser is requesting the favicon twice? [19:10] Spot_: yeah [19:10] Spot_: that's fucking wild [19:10] JimBastard: i could see the browser doing that, either way node should return 404 instantlly [19:10] caolanm: isaacs: at first glance that seems quite specific [19:10] Spot_: this is chrome.. going to switch to something else and check [19:10] Spot_: JimBastard: And yes.. it should [19:10] isaacs: Spot_: btw, here it is with consistent spacing: http://gist.github.com/314903 [19:11] JimBastard: it could be to some of that custom cache stuff you are doing [19:11] bentomas: yeah, I often times get upwards of 3 favicon requests for a given page, it is a pain [19:11] isaacs: caolanm: well, the test function is. but check the bottom bit. [19:12] Spot_: JimBastard: Yeah, I'll pull that out and see what I get. However... I do get this same problem even when it uses the live route. [19:12] isaacs: caolanm: http://github.com/isaacs/sax-js/blob/master/test/index.js#L42-68 [19:12] isaacs: basically, it just goes through all the files in the folder, and if they throw an error when they're loaded, then it reports the failure. [19:13] Spot_: isaacs: Thanks (git) [19:13] caolanm: isaacs: thanks [19:13] Spot_: yeah ripped out the caching and still happening [19:14] Spot_: Also something weird.. is that I kill the loading esc.. the final favicon spits out immediately [19:14] JimBastard: this workins perfectly for me [19:14] JimBastard: http://gist.github.com/314924 [19:14] isaacs: caolanm: using the same approach here: http://github.com/isaacs/arg-parse-js/blob/master/test/index.js (just one test in that dir atm, though) [19:15] Spot_: JimBastard: Oh yes, I know it's a problem with my code. Simply trying to find out what. [19:15] maritz has joined the channel [19:16] JimBastard: probaly that block i sent you [19:16] JimBastard: your gist isnt doing what i sent at all [19:16] JimBastard: at least the last version [19:16] Spot_: Also, as I mentioned before, this causes a page render to hang for a while, and if this is just being used as a css source, then the favicon would never be requested at all. So it has to be something more general than a bad filetype. [19:17] JimBastard: could be mime type [19:17] Spot_: True [19:17] JimBastard: update your gist with the binary content setting [19:17] Spot_: ahh ok [19:18] JimBastard: ohh dude [19:18] JimBastard: options['Content-Type'] = 'text/css'; [19:18] JimBastard: FAVICO IS NOT OF CSS [19:18] JimBastard: is not text/css [19:18] JimBastard: this should help [19:18] JimBastard: one sec [19:18] bentomas: JimBastard: that shouldn't cause it to hang [19:18] Spot_: yeah, but anything that is not .css ext is immediately closed [19:19] JimBastard: i dont see the code that does that [19:19] JimBastard: i see delete fileStack[i]; [19:20] isaacs: try doing a curl -i blerg/favicon.ico [19:20] Spot_: yeah but below that [19:20] Spot_: if the filestack is empty it drops a close [19:20] isaacs: Spot_: what do you get when you curl -i the favicon url? [19:20] Spot_: and when a single file is requested.. there is nothing left [19:20] JimBastard: why would you ever be requesting more then one file at once? [19:20] JimBastard: how would you even do that? [19:21] mattly has joined the channel [19:21] isaacs: JimBastard: look at where he's splitting the request.url by %7C [19:21] isaacs: Spot_: i take it this is some kind of css concatenation script? [19:21] JimBastard: i saw that too, i think i see the big picture now [19:21] Spot_: http://css.spot.sb.napalmriot.com:4512/legacy/42%7C/napalm.css%7C/layouts/user.css%7C/common.css [19:21] JimBastard: yeah [19:21] Spot_: a multifile request can look like that [19:22] Spot_: first section is skin.. the 42 is just a cb [19:22] JimBastard: is this for concatting CSS files into a single request? [19:22] Spot_: It does that... it's not FOR that [19:22] JimBastard: got ya [19:22] isaacs: so, you're returning a 404 for the favicon. that's weird. [19:22] isaacs: and no body [19:22] Spot_: I paste This thing primarily handles pulling css files off the disk, based on scope (live, or a sandbox) and skin, then parses the files so the images point to the proper location (again based on scope and skin) and hands them back [19:23] JimBastard: you probaly want to return a non-null body? [19:23] Spot_: isaacs: If you ask for just the favicon it doesn't hang tho [19:23] Spot_: JimBastard: Ok [19:23] JimBastard: resp.write('404 file not found'); [19:23] isaacs: looks like it crashed [19:24] isaacs: ? [19:24] Spot_: http://css.spot.sb.napalmriot.com:4512/favicon.ico [19:24] isaacs: just getting a white page now [19:24] Spot_: working for me [19:25] ashb: why %7C? | isn't a reserved char is it? [19:25] ako has joined the channel [19:25] Spot_: ashb: No, but the browser converts it, so by the time node gets it, it's %7C and | doesn't match :) [19:25] ashb: oh curious. [19:25] ashb: i'd use a ',' then :) [19:26] ashb: thats what... something else does [19:26] ashb: perlbal i think [19:26] Spot_: ashb: Sure.. this isn't in production yet, so that's all variable [19:26] Spot_: ashb: Hasn't even made it to staging, obviously :) [19:26] ashb: trying to think what else ti is that does it [19:26] dnolen has joined the channel [19:26] bentomas: ryah: what is the best way to send you patches? I have another one, should I send it to the mailing list or tell you about it here? [19:27] isaacs: Spot_: it's working when i request just a single css file. [19:27] isaacs: but even then, it's hanging [19:27] Spot_: you might be getting a white page on the multiple if you removed the skin by chance [19:27] Spot_: the 'legacy' [19:28] isaacs: Spot_: http://css.spot.sb.napalmriot.com:4512/legacy/42|/napalm.css|/layouts/user.css|/common.css [19:28] isaacs: that's blank white page [19:28] Spot_: hmmmm [19:28] Spot_: loads fine for me [19:28] Spot_: that's disconcerting [19:29] ashb: i get content too [19:29] bentomas: me three [19:29] isaacs: weird [19:30] isaacs: curl does, too [19:30] isaacs: firefox got confused or something [19:30] ollie has joined the channel [19:30] JimBastard: any reason you are using pipes instead of & for seperating url query params? [19:30] ashb: "This source file is bound by United States copyright law." is 1) odd, 2) incorrect, and 3) you haven't got an "All Rights Reserved" or similar [19:30] ashb: browser wont cache with & [19:30] JimBastard: really? [19:31] isaacs: ashb: i don't think that's true [19:31] JimBastard: a browser won't cache a link that has query params? [19:31] ashb: its less likely too [19:31] JimBastard: im not sure about that at all [19:31] isaacs: ashb: in fact, i'm 100% certain that's not true [19:31] bentomas: the browser will cache it if the headers tell it to cache it [19:31] JimBastard: yeah man [19:31] ashb: bentomas: AHAHAH [19:31] ashb: its never that simple [19:31] JimBastard: URI format is somewhat regardless [19:32] isaacs: the combo script used by YTS uses & to separate filenames, and it's used extensively by yahoo to serve all their stuff. [19:32] isaacs: they've got a team of researchers on this. [19:32] ashb: oh i'm remembering it hte wrong way round wher eIE will cache gets when it shouldn't [19:32] JimBastard: i just didnt think that pipes were safe to use in URLs [19:33] JimBastard: and then Spot_ 's code has a bunch of wierd double escaping [19:33] ashb: pretty much anything but / is [19:33] JimBastard: # isn't [19:33] ashb: yes it is. [19:33] ashb: its just reserved [19:33] isaacs: yeah, the crap you can put in a url is amazing. [19:33] ashb: thats why its getting %escaped [19:33] JimBastard: in most browsers if you copy paste a url with a location.hash value, its not going to send the location.hash value to the server as part of the request [19:34] ashb: (it = '|') [19:34] isaacs: even # is allowed, it's just that the browser won't send it [19:34] JimBastard: yep [19:34] JimBastard: i learnt that the HARD way [19:34] isaacs: but it's allowed as per the format. if you escape it, or use curl, you can verify this. [19:34] JimBastard: had a routing system setup to do location.hash navigation and it was working great from terminal [19:35] JimBastard: but when you tried to actually copy pasta the link it was epic fail [19:35] ashb: schoolboy error there ;) [19:35] JimBastard: you have to create an ajax request onready to update state, which sucks ass [19:35] bentomas: ryah: well, anyway, if you want to look at the patch: http://gist.github.com/314937 [19:35] javajunky has joined the channel [19:35] javajunky: evening:) [19:35] JimBastard: sup [19:37] javajunky: I'm struggling to move away from my beloved promises to the callback stance (since there is currently no compelling module system to guarantee a promise library .. but thats another story ;) ) … one of the nice things previously about promises was that the 'error' passed in addErrback wasn't specified, so I was returning a literal consisting of 'code' (numeric) and 'message' (string)…. it isn't entirely clear to me if I can still pass this argument to [19:38] bentomas: javajunky: why don't you use http://github.com/kriszyp/node-promise and continue to use promises? [19:40] javajunky: oh I could do that of course, but since there's currently no guaranteed package management (npm or kiwi still aren't there, and I just don't know which to help out on ;) ) I'd not want to keep pulling in the dep :( [19:41] bentomas: you can checkout node-promise into ~/.node_libraries [19:42] bentomas: and then add an index.js symlink to promise.js and then use "require('promise')" everywhere you want it [19:42] javajunky: ;) yup thanks this is true, but I'd rather that my lightweight apis don't have any external dependencies (as soon as there's a supported/reliable way of supporting cross module dependencies then I'd be much much happier at doing that :) ) [19:43] javajunky: Putting the 'use a promise library' argument to one side for a second .. what *should* I be doing re the error argument to be node.js idiomatic :) [19:44] unomi has joined the channel [19:44] kriszyp: should I make node-promise a commonjs package (or something else)? [19:44] kriszyp: didn't think anyone was using package managment on node... [19:45] bentomas: javajunky: so you are writing a library that provides a callback interface and you want to know how to do errors? [19:45] javajunky: yes :) [19:45] ryah: bentomas: could you add docs to your require patch? [19:46] bentomas: javajunky: they can be any kind of object you want, they just need to be the first argument to the callback [19:46] bentomas: ryah: oops, forgot about that, I'm on it [19:46] javajunky: bentomas: thanks, but is there a defined convention that I ought to follow ? [19:47] bentomas: javajunky: though I believe all of Node's errors are instanceof Error and then use different error numbers to indicate different errors (in addition to the message) but I have not idea how to do that [19:47] CIA-77: node: 03arlolra 07master * r04fac19 10/ (185 files in 23 dirs): Split tests. - http://bit.ly/aZiS5x [19:48] javajunky: bentomas: this is the kind of thing I'm looking for ! .. I grok'd the node.js (javascript) code and couldn't see any examples in there. [19:59] javajunky: so I guess there *isn't* a convention on the passed error then ? :( [20:02] bentomas: how do I make the documentation? [20:02] bentomas: make doc? [20:03] maushu has joined the channel [20:03] Tim_Smart has joined the channel [20:05] ryah: bentomas: yeah [20:06] ryah: bentomas: you probably have to 'apt-get install asciidoc' [20:06] CIA-77: node: 03Ryan Dahl 07master * rb08f2af 10/ test/common.js : Update common.js path for new test layout - http://bit.ly/9jUoUL [20:07] bentomas: yeah, 505MB of asciidoc is downloading now! [20:07] r11t has joined the channel [20:07] ryah: oh.. painful [20:08] kriskowal has joined the channel [20:09] bentomas: 20min left to go, I guess that means it's lunch time [20:10] JimBastard: bentomas: why arent you working? im waiting for apt-get to finish! [20:10] JimBastard: i swear! [20:10] atcrabtree has joined the channel [20:11] binary42: My tests are running. My ajax got stuck in Fiji. I think my todo app is experiencing downtime. [20:12] JimBastard: I"M COMPILING [20:14] maushu: Why are there so many key value stores? [20:14] maushu: I want my tables. [20:15] binary42: keys with values that are tables. Done. [20:15] binary42: Or tables that have keys and values as a column. Also done. [20:15] maushu: I want my tables with columns. [20:15] binary42: (postgresql at least) [20:15] JimBastard: rdbms isn't that great if you dont have an ORM built for you [20:15] maushu: That is because you are lazy. [20:16] binary42: JimBastard and I are proud of that. [20:16] maushu: Real men use rdbms with orm and love it! [20:16] JimBastard: http://en.wikipedia.org/wiki/Object-relational_impedance_mismatch [20:16] maushu: *without. [20:16] JimBastard: real men have read that article multiple times [20:16] maushu: Fredianfreudian slip [20:16] maushu: ... [20:16] binary42: Real men don't talk about real men. [20:17] maushu: This reminds me of that orm I coded in C#. [20:17] JimBastard: yaya we've all coded ORMs before [20:17] maushu: No xml. At all. I got lazy when I reached the many to many problem. [20:17] binary42: LINQ is pretty awesome. Too bad C# isn't Haskell. [20:17] JimBastard: every .net person i know using linq [20:17] JimBastard: for the most part [20:18] binary42: LINQ is basically monads for the java generation. [20:18] maushu: Does redis keep *everything* in memory? [20:18] binary42: ACTION gets back to work... but let him know if you need more sarcastic slander. [20:18] binary42: maushu: yes until 1.3 which does have a VM system. [20:19] maushu: Wat. [20:20] maushu: My vps only has 360mb, should I use redis? [20:21] binary42: You can use it... but anything interesting including redis will get slow (disk speed) depending on how big your active set is. [20:23] maushu: Hmmm. [20:23] brandon_beacher has joined the channel [20:24] binary42: maushu: CouchDB seems to work well in small footprints. Redis can be bound to specific memory use too which is a big win for your case. [20:25] binary42: I'd look at 1.3 series in the git repo. It's sort of beta but not so bad. [20:25] maushu: Huh, how is that a big win? I have more disk space than memory. [20:25] chakrit1 has joined the channel [20:25] maushu: I know memory is fast but loading the whole database (some part of it that might not even be used?) to memory? Insane. [20:25] binary42: It's a win because you can count on a static size for the process. [20:25] binary42: Last thing you want is induced swapping. [20:26] binary42: That will kill everything, not just your DB. [20:26] maushu: Ah, I understand it now. [20:26] maushu: Of course, writes will start to fail then. :p [20:26] binary42: Nah. Not fail. [20:26] binary42: Just very very slow... but that is true of anything disk bound. [20:27] binary42: And redis is pretty efficient for in memory representation. [20:27] binary42: With 1.3 the only constraint is that the key map has to fit into memory since only values are swapped out, but this is done very well as is. [20:27] maritz has joined the channel [20:28] binary42: ACTION really gets back to work. If you really want the full FAQ treatment, check out #redis. [20:29] chakrit has joined the channel [20:29] tisba_ has joined the channel [20:31] maushu has joined the channel [20:35] rictic has joined the channel [20:36] halorgium has joined the channel [20:40] bentomas: ryah: http://gist.github.com/315010 [20:40] bentomas: the resolve patch with documentation. I added a line about require.async because it wasn't in the docs anywhere either [20:42] bentomas: ryah: did you see the sys.inspect patch I posted earlier? [20:44] kriszyp has joined the channel [20:49] bentomas: isaacs: what's the status on your headers patch? The one that makes it easier to send multiple headers... [20:49] bentomas: ooops, isaacs isn't around, I guess I'll ask him later [20:50] r11t has joined the channel [20:53] stepheneb has joined the channel [20:54] isaacs has joined the channel [20:55] sveisvei has joined the channel [20:58] ryah: bentomas: please rebase onto ry/master [20:58] mumrah has left the channel [20:59] happyelephant has joined the channel [21:00] dandean has joined the channel [21:04] jspiros has joined the channel [21:05] CIA-77: node: 03Benjamin Thomas 07master * rb1b8496 10/ (19 files in 5 dirs): Rename writeHeader to writeHead - http://bit.ly/bFYfF4 [21:10] joshbuddy has joined the channel [21:10] joshbuddy has joined the channel [21:12] mikeal has joined the channel [21:16] bentomas: ryah: I updated my sys.inspect patch to works with master: http://gist.github.com/314937 [21:19] CIA-77: node: 03Benjamin Thomas 07master * ra2714be 10/ (doc/api.txt lib/sys.js test/simple/test-sys.js): Add optional third argument sys.inpect to indicate how many times you want it to recurse - http://bit.ly/c8ypUa [21:20] bentomas: well, that's embarrassing, I misspelled "inspect" [21:21] bentomas: *must reread commit messages in the future* [21:27] maushu: Maybe I'm missing something... but how do I get the name of the file when using multipart? [21:30] maushu: I see that the filename is in the Content-Disposition. [21:31] maushu: ...and there is a part.filename in the manual related to this header... [21:32] maushu: ...which works perfectly. [21:32] maushu: ACTION hides under a rock. [21:35] charlenopires has joined the channel [21:36] guan has joined the channel [21:36] ryah: bentomas: [21:36] ryah: > ./node test/simple/test-require-resolve.js [21:36] ryah: Error: Cannot find module './common' at loadModuleSync (node.js:842:13) at require (node.js:949:12) at Object. (/Users/ryan/projects/node/test/simple/test-require-resolve.js:1:77) at Module._loadContent (node.js:981:21) at node.js:1009:20 at node.js:595:25 at node.js:1070:9 [21:37] bentomas: oops [21:37] joshbuddy has joined the channel [21:37] joshbuddy has joined the channel [21:40] bentomas: sorry, fixing now [21:40] felixge has joined the channel [21:46] ryah: felixge: re [21:47] felixge: ryah_away: heya [21:50] guan has joined the channel [21:52] kriszyp_ has joined the channel [21:57] peburrows has joined the channel [21:58] paulca has joined the channel [21:59] hassox has joined the channel [22:02] geoff_blair has joined the channel [22:07] geoff_blair has joined the channel [22:07] geoff_blair has left the channel [22:08] mjr_ has joined the channel [22:22] brandon_beacher has joined the channel [22:25] javajunky: This may be a somewhat embarrassing question, but would people here expect: JSON.parse("\\'") to work ? [22:25] JimBastard: define work [22:26] fwg: javajunky: no, i woulnt [22:26] fwg: +d [22:26] dekz has joined the channel [22:27] JimBastard: yeah i mean im pretty sure it wants something that looks like json javajunky [22:27] javajunky: well I get an illegal token .. which I guess is fair enough if the escape code \' is meaningless... [22:27] JimBastard: \' doesnt look like JSON to me [22:28] JimBastard: JSON.parse("{'prop':'value'}") [22:28] javajunky: yeah thats my issue .. this has come back from a flickr API response. [22:28] javajunky: JSON.parse("{foo:\"\\'\""); [22:28] javajunky: yeah sorry I was simplifying it down to my actual problem [22:28] JimBastard: well that makes more sense [22:28] javajunky: ;) [22:29] javajunky: I'm a bit puzzled as to what to do really, flickr's response contains json who's character literals appear to escape single quotes, which JSON.parse seems unhappy with ! [22:32] aho: JSON.parse("{foo:\"\\'\""); <- makes no sense whatsoever [22:32] javajunky: you're perfectly right of course (http://tools.ietf.org/html/rfc4627) states fairly unequivocably that this isn't a valid escape :( … but I swear this used to work with node [22:32] aho: closing curly is missing [22:32] aho: quotes around the property are also missing [22:33] javajunky: ah, yes sorry thats just a stupid typo on part… I was expanding it in the irc window :) (the token: ILLEGAL error still gets thrown with JSON.parse("{\"foo\":\"\\'\"}"); [22:33] javajunky: I take it the JSON.parse is part of v8 [22:34] aho: JSON.parse('{"foo":"\'"}'); [22:34] aho: that works for example [22:35] aho: your line is basically the same... just with \\' instead of \' [22:35] bentomas: but they are different lines [22:35] javajunky: thats a diofferent string though [22:35] bentomas: in your example foo = "'" [22:35] javajunky: I'm deliberately escaping the slash to reproduce the fault over the wire ? [22:35] bentomas: in the other one foo = "\'" [22:36] javajunky: it does look like I'm a little stuffed, this remote api (from flickr) is returning 'invalid' json :( .. I'll check the packets just to make sure nothing funky's happening between the server and me. [22:38] nodejs_v8 has joined the channel [22:39] Tim_Smart: nodejs_v8: JSON.parse("{'prop':'value'") [22:39] nodejs_v8: Tim_Smart: Exception: SyntaxError: Unexpected token ILLEGAL [22:39] Tim_Smart: nodejs_v8: JSON.parse("{'prop':'value'") [22:39] nodejs_v8: Tim_Smart: Exception: SyntaxError: Unexpected token ILLEGAL [22:39] inimino: javajunky: "\'" is definitely not a valid string in JSON [22:39] inimino: and putting single quotes around strings is not either [22:39] bentomas: inimino: why not? [22:40] Tim_Smart: nodejs_v8: JSON.parse("{'prop':'value'}") [22:40] nodejs_v8: Tim_Smart: Exception: SyntaxError: Unexpected token ILLEGAL [22:40] inimino: bentomas: because of the incorrect backslash-escape [22:41] fwg_ has joined the channel [22:41] bentomas: inimino: but the string was "\\'" [22:41] aho: nodejs_v8: JSON.parse('{"prop":"value"}') [22:41] nodejs_v8: aho: {"prop": "value"} [22:41] aho: nodejs_v8: JSON.parse('{"prop":"\\"}') [22:41] javajunky: the RFC does state that it is invalid ( http://tools.ietf.org/html/rfc4627 ) … but I swear this did used to work, it does seem a little specific given that JSON isn't entirely finished being specified is it ? … I guess I'll just search for \' in strings and replace it with ' before parsing it :( [22:41] nodejs_v8: aho: Exception: SyntaxError: Unexpected token ILLEGAL [22:41] aho: nodejs_v8: JSON.parse('{"prop":"\\\\"}') [22:41] nodejs_v8: aho: {"prop": "\"} [22:41] inimino: bentomas: no, the string was "\'" [22:41] paulca has joined the channel [22:41] aho: aah :] [22:42] inimino: javajunky: it's 100% finished being specified [22:42] inimino: just ask Crockford, he'll tell you :-) [22:42] stephenlb: heh [22:42] aho: nodejs_v8: JSON.parse('{"foo":"\\\\\'"}'); [22:42] nodejs_v8: aho: {"foo": "\'"} [22:42] inimino: and it's nailed down in ES5, and that's definitely not allowed [22:42] javajunky: great, someone should tell flickr ;) [22:43] inimino: javajunky: if V8 allowed that syntax it'd be in violation of ES5 :) [22:43] inimino: javajunky: you should tell them :) [22:43] javajunky: there's no 'lax' setting ;) [22:43] bentomas: inimino: I must have misread it then, thanks:) [22:43] aho: it's \\\\ because \\ should arrive in the string, which then gets parsed down to \ [22:53] bentomas has left the channel [22:58] brandon_beacher_ has joined the channel [23:03] vdrab has joined the channel [23:05] atcrabtree has joined the channel [23:11] mjr_: \\\\ is hilarious [23:19] aho: well, that's only necessary because it's a javascript string literal [23:19] aho: it's the usual \\ in a response from a server [23:21] dekz has joined the channel [23:22] around has joined the channel [23:26] mikeal: for anyone in the bay area [23:26] mikeal: couch.io is having a party tomorrow [23:27] mikeal: everyone here is invited [23:27] mikeal: i'm getting a keg, it should be fun [23:27] paulca has joined the channel [23:27] mikeal: 825 washington st Suite 201 Created. [23:27] mikeal: Oakland [23:27] mikeal: http://www.mobaganda.com/couchioadminparty [23:27] mjr_: Is it really Suite 201? [23:28] mikeal: yes [23:29] mjr_: I'm planning on coming. [23:29] mikeal: because it's 201 Created :) [23:29] mjr_: I love 201 created. Sadly, many XHR implementations do not. [23:29] mikeal: haha [23:30] mikeal: we got to pick our suite number, it just had to be in the 200s and couldn't be 200 exactly because that was already taken [23:30] mjr_: Which is why I have a node proxy to convert 201 to 200. [23:30] mikeal: and jchris was like, we need to be 201 created [23:30] mjr_: That's cool. [23:31] JimBastard: mikeal: can you please fedex me my plane ticket, ill be there [23:32] mikeal: i don't think fedex can deliver it fast enough :) [23:32] mjr_: Do they still have things called "plane tickets"? [23:32] mjr_: I thought they were all e these days. [23:33] tisba has joined the channel [23:34] gf3 has joined the channel [23:34] mikeal: when you print them they're just called tickets :) [23:37] unomi has joined the channel [23:37] joshbuddy has joined the channel [23:37] joshbuddy has joined the channel [23:39] mumrah has joined the channel [23:40] mumrah: anyone have experience dealing with binary files in node? [23:40] mumrah: is there something like struct in python that lets you pack things for binary writes [23:41] inimino: mumrah: 'binary' encoding in node [23:43] inimino: and you use strings [23:43] JimBastard: plain tickets [23:43] JimBastard: they just arent that fancy [23:46] mumrah: hmm [23:47] mumrah: so i'd need JSONify objects then? [23:47] isaacs has joined the channel [23:48] JimBastard: what you trying to do mumrah ? [23:48] JimBastard: destroy the thundercats? [23:48] mumrah: yes, by means of file descriptors [23:48] mumrah: i'm not trying to do anything in particular [23:49] mumrah: just playing around [23:49] orlandov: mumrah: maybe this is what you want? http://github.com/jfd/datatypes-js [23:49] mumrah: yes indeed [23:49] JimBastard: THUNDER HOOOO [23:50] JimBastard: snarff [23:50] orlandov: lol [23:50] technoweenie has joined the channel [23:50] JimBastard: aight drink time [23:50] orlandov: i find it hard to believe it hasn't started yet ;) [23:51] Tim_Smart: What am I missing out on? [23:51] Tim_Smart: ACTION blames the scientists for inventing teleportation [23:51] Tim_Smart: *for not [23:51] jashkenas has joined the channel [23:52] JimBastard: Tim_Smart: i'll be back online later i got my gf coming into the city so i gotta go defrag her scsi drive [23:52] JimBastard: with my 3.5 floppy disk [23:52] JimBastard: if you know what i mean ;-) [23:52] JimBastard: i got a chance to read through your whole codebase btw, the event emitting is pretty cool [23:55] Tim_Smart: JimBastard and his floppy disks >.> [23:55] Tim_Smart: saving the world from fragmentation [23:55] jashkenas has left the channel