[00:07] noonat: isaacs: hrm... maybe you could pipe the input from stdin on the node process into the child stdin? [00:07] isaacs: noonat: right, but the issue there is that i'm not sure when to close stdin, or if it even needs to be opened [00:08] isaacs: noonat: it's like i need to just hand the stdin handle over to the child, and then get it handed back when it's done. [00:11] noonat: there's the sendFD/recvMsg pair for doing that via a socket on the net binding... I don't think it's exposed in user space though [00:13] sveimac has joined the channel [00:14] Aria: What you need is the unix system() function. [00:16] noonat: i think system() blocks though :/ [00:17] mattly has joined the channel [00:18] sudoer has joined the channel [00:19] maushu: Configure seems to not be able to find openssl. [00:19] maushu: Why? [00:20] maushu: Checking for openssl : not found [00:20] maushu: Checking for function SSL_library_init : yes [00:20] maushu: Checking for header openssl/crypto.h : yes [00:20] maushu: ...wat. [00:22] maushu: Perhaps shared libraries? Hmm. [00:27] admc__ has joined the channel [00:27] maushu: Anyone was able to make openssl work on debian/ubuntu? [00:27] Yuffster has joined the channel [00:29] isaacs: i've started only using semicolons where necessary. it's affecting my brain. i've started tending to leaving off the period on the last sentence of each paragraph [00:29] maushu: . [00:45] inimino: heh [00:47] dbathurst has joined the channel [00:48] jamesduncan has joined the channel [00:55] bolson has joined the channel [01:00] voodootikigod has joined the channel [01:06] brianmario has joined the channel [01:10] mjr_ has joined the channel [01:12] ditesh|cassini has joined the channel [01:15] towski has joined the channel [01:15] ditesh|cassini has joined the channel [01:18] sh1mmer has joined the channel [01:22] Yuffster_ has joined the channel [01:25] blazzy_: maushu: openssl is found on my debian and ubuntu. machines. are you shure you have the relevent -dev package installed? [01:26] ncb000gt: i have ubuntu and openssl works [01:27] blazzy_: maushu: libssl-dev or something like that. [01:27] maushu: Already have that. [01:28] ncb000gt: the libs in /usr/include? [01:28] ncb000gt: err headers [01:28] ncb000gt: not libs [01:28] maushu: Yes, there is an openssl in /usr/include. [01:30] ncb000gt: I'm using ubuntu [01:30] ncb000gt: and i have the same [01:30] ncb000gt: and you have /usr/lib/ssl [01:30] ncb000gt: ? [01:31] ncb000gt: it checks: '/usr/lib', '/usr/local/lib', '/opt/local/lib', '/usr/sfw/lib' [01:31] ncb000gt: for ssl [01:31] blazzy_: maushu: node uses pkg-config to find it i think. do you have that installed? [01:32] maushu: I'm pretty sure I do. [01:32] maushu: Or it wouldn't find other things. [01:32] Tim_Smart has joined the channel [01:33] blazzy_: maushu: what does "pkg-config openssl -libs" do? [01:33] maushu: Humn [01:33] ncb000gt: --libs [01:34] maushu: -lssl -lcrypto [01:34] ncb000gt: maushu: is there an ssl directory in one of the paths I listed above? [01:34] maushu: Wait, hold our horses. [01:34] ncb000gt: heh [01:35] maushu: I just ran conf again and it now shows up. [01:35] ncb000gt: lol [01:35] maushu: Magic? [01:35] ncb000gt: IT WORKS! [01:35] ncb000gt: now run away before it stops [01:35] maushu: That doesn't make sense. I didn't do anything besides running what blazzy_ said. [01:36] ncb000gt: hmm [01:37] maushu: Well, if I don't touch it, it doesn't break. [01:48] keeto_ has joined the channel [01:53] keeto_ has joined the channel [01:58] cloudhead has joined the channel [02:00] voodootikigod has joined the channel [02:05] gleicon has joined the channel [02:05] gleicon: hello [02:06] gleicon: any tip on how to check if an hash (associative array) has more than 0 elements ? [02:06] gleicon: I'm a kinda avoiding patch Object with a function looping over it [02:08] james has joined the channel [02:10] ncb000gt: function hasProperties(o) { for (var p in o) if (o.hasOwnProperty(p)) return true; return false; } [02:10] ncb000gt: I wouldn't attach it to Object [02:10] ncb000gt: that'll let you call it without attaching to Object [02:10] ncb000gt: or should [02:11] ncb000gt: assuming I didn't botch anything [02:11] ncb000gt: :) [02:11] jherdman has joined the channel [02:13] ncb000gt: if you have a property that you always expect to be there you could use something like this: [02:13] ncb000gt: if ('prop_name' in o) {} [02:13] ncb000gt: but thats less robust [02:15] rtomayko has joined the channel [02:15] gleicon: hm [02:15] gleicon: I thouht about it [02:16] gleicon: initializing it before [02:16] gleicon: it may be because I'm porting a pythonic stuff to node [02:16] gleicon: I have a hash of lists [02:16] ncb000gt: ok [02:16] gleicon: to prevent needless work, I check if there is anything at all in the hash [02:16] ncb000gt: sure [02:17] gleicon: I am affraid to loop over it everytime my timer starts [02:17] ncb000gt: well, if you start looping and nothing is there, then it wont matter [02:17] gleicon: a len or size method would suffice... or any kind of introspection too, like keys() [02:17] gleicon: you're right [02:17] ncb000gt: afaik that doesn't exist [02:17] gleicon: I dont need the exact size, just need to check if there is anything at all [02:18] ncb000gt: the function i provided above should give that [02:18] gleicon: givint it a try [02:18] ncb000gt: if there is anything that is a property, it should return [02:18] ncb000gt: on the first key [02:18] ncb000gt: otherwise it'll return false [02:18] ncb000gt: w/ key will return true [02:18] gleicon: what does properties means in js ? [02:19] gleicon: is it like the method dict on python ? [02:19] ncb000gt: sorry, it's really the key [02:19] ncb000gt: key -> value [02:20] ncb000gt: but since it's an object, as is everything in JS, we call them properties [02:20] ncb000gt: since objects have properties not keys [02:20] ncb000gt: does that make sense? [02:21] gleicon: sure [02:22] gleicon: specially because it has a kind of "data as code, code as data" feeling as lisp [02:22] ncb000gt: yea [02:22] ncb000gt: { 'prop1': 1, 'prop2': function() {return 'blah';}} [02:22] gleicon: its a kinda confusing because I did a for over this hash and over a nested list, and sometimes I get an index, somethins an object [02:23] gleicon: when you serialize it, how does it treats the function ? [02:23] ncb000gt: depends. [02:23] ncb000gt: depends on the serializer [02:23] ncb000gt: it's not going to call it if that's what you mean [02:23] ncb000gt: it'll likely, if anything, just return the function as a string [02:24] ncb000gt: otherwise it may just say something to the effect of "" or something similar [02:26] gleicon: hm [02:26] gleicon: makes sense [02:27] gleicon: everytime I get back to node I like js a little more heh [02:27] gleicon: right now it may solve a problem for me: nginx has no websockets proxy [02:27] ncb000gt: haha [02:27] ncb000gt: ahh, interesting [02:27] gleicon: I am planning a node for a project of mine, RestMQ [02:27] ncb000gt: I've really only just started looking at nginx [02:27] ncb000gt: cool [02:27] gleicon: this way I can provide read only parts of it with node [02:27] gleicon: just reading straight from redis [02:27] ncb000gt: there are a few MQ projects iirc [02:27] gleicon: yup [02:27] ncb000gt: nice [02:28] gleicon: mine is a simpler one, uses python, http, json and cyclone - a tornado clone [02:28] KungFuHamster: MQ? [02:28] ncb000gt: mq == message queue [02:28] ncb000gt: nice [02:28] gleicon: I use it for messages, jobs, map reduce and now as a websockets endpoint [02:29] gleicon: I was programming an erlang frontend, but I think node.js makes more sense for what I want. its everything already there [02:29] gleicon: (except my js skills) [02:29] ncb000gt: yea, we have a couple of projects at the office where we're using MQ's to offload tasks asynchronously [02:29] ncb000gt: brb [02:30] gleicon: is there any kind of repr on js ? to show a representation of a given obj ? [02:30] gleicon: oh, ok [02:33] ncb000gt: not in JS specifically but there are a couple of things [02:33] ncb000gt: in node: JSON.stringify(o) or if you require sys, sys.inspect(o) [02:33] ncb000gt: i think it's inspect [02:39] voodootikigod has joined the channel [02:42] gleicon: hm, cool [02:42] gleicon: sys.inspect worked great [02:43] ncb000gt: cool [02:43] gleicon: just for exploration [02:43] gleicon: heh [02:43] ncb000gt: yea. :) [02:44] gleicon: thanks a lot for the help [02:44] gleicon: I already have the basic comet server, and the polling scheduler [02:44] gleicon: I think a little bit more hacking to put a redis client there and I end up with a complete read-only endpoint for restmq [02:48] joshr has joined the channel [02:48] ncb000gt: very cool [02:48] ncb000gt: and np [02:49] ncb000gt: I'm trying to get the xmppjs stuff working on the backend of some django stuff I've got going on (since django is crud for long running requests) [02:50] ncb000gt: plus, eventually i'd like to turn it all into node [02:50] ncb000gt: once node stablizes a bit [02:50] gleicon: hm [02:50] gleicon: sounds like you could use cyclone... its easy to setup comet stuff with it [02:51] gleicon: but node.js makes it a breeze too [02:51] gleicon: there are some gists I posted when I first tried comet on node. the interface was very intuitive for me [02:51] ncb000gt: is cyclone for the browser? [02:52] gleicon: no, cyclone is a port of tornado to run over twisted [02:52] gleicon: so you can take advantage of all twisted drivers and protocols [02:52] ncb000gt: ahh interesting [02:52] ncb000gt: yea [02:52] gleicon: a friend of mine did it, and I put the websocket interface there [02:52] ncb000gt: i just found it [02:52] ncb000gt: :) [02:52] gleicon: fiorix [02:52] ncb000gt: yep [02:53] ncb000gt: i'll have to take a look [02:53] ncb000gt: if this stuff fails [02:53] ncb000gt: :) [02:53] gleicon: ;) [02:53] gleicon: just drop a line if you need anything [02:53] ncb000gt: cool, thanks [02:53] gleicon: mine acc is github.com/gleicon [02:53] gleicon: ops [02:53] gleicon: my [02:54] fizx has joined the channel [02:54] ncb000gt: yep, i saw :) [02:55] RayMorgan has joined the channel [02:56] tekky has joined the channel [02:58] dbathurst has joined the channel [03:04] brianmario_ has joined the channel [03:15] saikat_ has joined the channel [03:18] mikeal1 has joined the channel [03:24] PyroPete1 has joined the channel [03:46] hassox has joined the channel [03:48] jpoz has joined the channel [03:50] tmpvar has joined the channel [03:50] RayMorgan has joined the channel [03:52] mkovacs has joined the channel [03:53] magcius has joined the channel [03:53] magcius: so [03:53] magcius: what am I supposed to use as a replacement for "multipart"? [03:54] fizx has joined the channel [03:57] ncb000gt: magcius: not sure [03:57] ncb000gt: there was that module I had linked, alternatively, you could fork node and try to use the old module with the latest [03:57] ncb000gt: see if that works [03:58] magcius: ncb000gt: can you link it again? [03:58] ncb000gt: i'll try to find it [03:59] tmpvar: umm [03:59] tmpvar: the old multi-part lives.. [03:59] magcius: http://github.com/isaacs/multipart-js/ [03:59] tmpvar: here : http://github.com/isaacs/multipart-js/blob/master/lib/old.js [03:59] ncb000gt: actually, this would be good [03:59] ncb000gt: http://groups.google.com/group/nodejs/browse_thread/thread/d8f9439d4d2e0cb8/96ea28a7f969287c?show_docid=96ea28a7f969287c [04:00] ncb000gt: yea [04:00] ncb000gt: what tmpvar linked [04:00] ncb000gt: :) [04:00] ncb000gt: you can use the old one like I was saying [04:00] isaacs: i'd prefer it, if possible, if you could (at least try to) use the new stuff in multipart.js [04:00] isaacs: rather than the old one [04:00] magcius: okay [04:00] magcius: I was considering that [04:00] magcius: are there docs? [04:00] tmpvar: what up isaacs [04:00] isaacs: yo, tmpvar [04:00] isaacs: magcius: http://github.com/isaacs/multipart-js/blob/master/README.md [04:01] isaacs: magcius: check the "usage" bit [04:01] magcius: isaacs: why are you using .onfoo instead of .addListener("foo") [04:01] isaacs: magcius: becasue it's not node-specific [04:01] magcius: ah [04:01] isaacs: magcius: also, that's faster [04:01] magcius: isaacs: well [04:01] magcius: isaacs: require() is node specific [04:01] magcius: and so is exports.lib [04:01] isaacs: magcius: no, it's not. [04:02] isaacs: magcius: it's commonjs-specific [04:02] magcius: wait, it's not? [04:02] ncb000gt: magcius: require is commonjs [04:02] isaacs: magcius: but it works on a bunch of commonjs things [04:02] isaacs: and, maybe someday, even the browser [04:02] ncb000gt: hopefully. :)\ [04:02] magcius: I hate JavaScript so much [04:03] ncb000gt: lol [04:03] magcius: [] == [] is false [04:03] magcius: WTF [04:03] Ned__: magcius: they're two different references [04:03] magcius: why did they define a "===" strict equality operator [04:03] magcius: if == is going to compare references [04:03] isaacs: magcius: because 0 == false [04:03] isaacs: magcius: but 0 !== false [04:03] magcius: oh [04:03] isaacs: magcius: objects have identity. arrays are objects. [04:03] Ned__: magcius: what language have you come from ? [04:03] magcius: Ned__: python [04:04] Ned__: right [04:04] magcius: so the classes in the stdlib get specical treatment [04:04] magcius: isaacs: but [04:04] magcius: isaacs: does new Number(0) == false? [04:04] isaacs: magcius: not to say that js doesn't have a shit ton of wtfs, mind you ;) [04:04] Ned__: magcius: I believe so [04:04] isaacs: magcius: yeah [04:04] tmpvar: Ned__, do i know you? [04:04] Ned__: but no === [04:04] Ned__: tmpvar: I don't know ... [04:04] tmpvar: thats a negative :P [04:05] Ned__: tmpvar: I'm in Wellington NZ [04:05] Ned__: that help ? [04:05] tmpvar: sure! [04:05] isaacs: magcius: when you do ==, it coerces. since the Number object has a ".valueOf" builtin, it uses that, and gets its value as a 0, which then coerces to "false" to make them both bookleanish [04:05] tmpvar: I know a ned in boston ma [04:05] Ned__: tmpvar: heh, pretty that's not me ;-) [04:05] magcius: isaacs: can I define my own valueOf? [04:05] isaacs: magcius: i'm not sure, exactly [04:06] magcius: there are some things that are brilliant about JS [04:06] magcius: the simplicity of scoping is one [04:06] isaacs: magcius: yes, you can! neat! [04:06] isaacs: node> x = {valueOf:function () { return "foo" } } [04:06] isaacs: { valueOf: [Function] } [04:06] isaacs: node> x == "foo" [04:06] isaacs: true [04:06] magcius: heh [04:06] tmpvar: alright folks, time to wind down. long day of travel. [04:06] tmpvar: peace! [04:07] magcius: from a JS-intepreter standard [04:07] inimino: ACTION points at js> [04:07] magcius: there's only two differences between function(); and new function(); [04:07] isaacs: if anyone cares, npm's CLI got a lot less user-hostile this weekend. [04:07] isaacs: added a help command, make doc, and "man npm" [04:08] inimino: js> 42 [04:08] gbot2: inimino: 42 [04:08] inimino: isaacs: nice [04:08] magcius: when you do "new function();", it creates a new activation object, calls the function with the "this" object being that activation object and returns it [04:08] magcius: the activation object's prototype is the function's prototype [04:08] isaacs: still need to encrypt the username and password, and build the remote-install [04:08] inimino: activation objects don't have prototypes [04:09] magcius: inimino: oh sorry [04:09] isaacs: magcius: i think you're confusing "activation object" with "context object" [04:09] inimino: magcius: ok, there is something called an 'activation object' but that is not what it is [04:09] inimino: that's just an object [04:09] isaacs: ACTION sees that inimino's got this... [04:09] magcius: isaacs: eek, what's the activation object again? [04:09] isaacs: ACTION points at inimino [04:09] inimino: it's a technical detail of function evaluation [04:10] inimino: you can just think of it as the function scope or stack frame [04:10] magcius: I come from Tamarin [04:10] magcius: where we have a "newactivation" opcode [04:10] magcius: and whatever goes in there is the "this" object in functions. [04:10] inimino: hm, I see [04:10] magcius: i.e. newactivation, pushbyte 2, setproperty ::a [04:11] inimino: right... odd name choice ;-) [04:11] magcius: yeah [04:11] isaacs: whether a particular implementation uses the same bit of code to do "activation objects" as it does for constructor calls is an implementation detail. [04:11] isaacs: from the pov of the spec and the terminology there, they're different, even if they're not actually different in the code. [04:12] magcius: isaacs: alright [04:12] inimino: true [04:12] isaacs: i'm not familiar with tamarin. maybe in context it makes sense. [04:12] isaacs: ACTION should be shot for that pun... [04:12] inimino: heh [04:13] inimino: ACTION needs to dig into V8 one of these days [04:22] kriszyp has joined the channel [04:30] magcius: okay [04:30] magcius: where did the "body" event go? [04:30] silentrob has joined the channel [04:40] inimino: magcius: data [04:45] _ry: hello [04:47] admc__ has joined the channel [04:47] admc_ has joined the channel [04:47] admc has joined the channel [04:47] ncb000gt: hey _ry [04:47] ncb000gt: how was the weekend? [04:48] _ry: lovely [04:48] ncb000gt: good to hear [04:49] Aria: Yagh. Another process exit(1)ing after printing just node.js:164:9 [04:50] ncb000gt: aria: i got those a lot when i fudged some c/c++ in one of my modules. [04:50] Aria: Yeah. [04:50] Aria: I'm not using any native modules other than node's builtin. [04:50] ncb000gt: yea, i kind of figured [04:50] ncb000gt: :) [04:52] _ry: Aria: backtrace it [04:52] Aria: Heh, trying to figure out what I need to do to do so. [04:52] _ry: Aria: ./configure --debug && make; gdb --args ./node_g myscript.js [04:52] Aria: Aright. I can do that. [04:53] Aria: Oh, nice, and this is on the mac where I'm not forcing it to use system libraries. [04:53] Aria: Should be tidy and not my system's fault then [04:54] Aria: Heh, nice, _ry. I love that stretch of coast. [04:55] Aria: Guess driving up the left coast was the in thing this weekend. A friend of mine did that this weekend too. [05:00] WALoeIII has joined the channel [05:01] Aria: Any idea where to set the breakpoint, _ry? [05:02] _ry: Aria: try node::ReportException [05:02] Aria: Alright. [05:03] Aria: https://gist.github.com/5bfc75b27d7a7a60d4ef [05:04] Aria: This is in code doing a readFile and a readdirSync [05:07] _ry: hm [05:08] _ry: no stack trace.... [05:09] _ry: but no error message either.. [05:11] _ry: not sure why that's happening [05:13] Ned__: if I ctrl-c my app, and I have child processes (who also get the SIGINT), what's the "correct" way to wait for them ? [05:16] nsm has joined the channel [05:16] Aria: Yeah. Nor I. [05:18] _ry: Ned__: you should probably child.addListener('exit') [05:18] _ry: and process.addListener('SIGINT') [05:18] Ned__: _ry: yeah, I've done that ... [05:18] _ry: i the SIGINT handler kill the child [05:18] _ry: in the child exit listener, exit the main process [05:19] Ned__: _ry: except for ones that have already exited ? [05:19] _ry: you'll have to keep track of which are done [05:20] Aria: Hrm. The try_catch is saying it's caught something . . [05:20] Aria: Weird. [05:20] Ned__: _ry: yeah, so I'll just have some global data structure [05:25] Ned__: _ry: Hmmm, there are issues [05:25] Ned__: like, the child dies before I get to the "kill" [05:25] Ned__: _ry: I really just need a way of waiting for the exit events to roll in [05:27] Ned__: is there some way to wait for processes ? [05:27] Ned__: err, block waiting for events even [05:27] Ned__: ? [05:28] ncb000gt has left the channel [05:30] jazzychad has joined the channel [05:31] _ry: Ned__: are the children getting the SIGINT too? [05:31] _ry: i don't know what happens when you ^C a program [05:32] Ned__: _ry: yes, the children are getting it too [05:32] Aria: The entire process group should get the signal. [05:32] Ned__: so I'm calling .kill() on processes that are already gone :-( [05:32] Ned__: _ry: I think the best way to deal with this is [05:32] Aria: You'd have to setsid etc. to dissociate from that. [05:32] _ry: Ned__: so just wait for them? [05:32] Ned__: _ry: yes, but how ? [05:32] Ned__: how do you just wait for events ? [05:33] Ned__: I thought the promise stuff did that, but it doesn't exist anymore ? [05:33] _ry: child.addListener('exit') [05:33] Ned__: yes, I have that [05:33] Ned__: for each child (there's 6 in total) [05:33] _ry: no you can't block and wait for it [05:34] Ned__: but the parent is exiting before those events fire [05:34] Ned__: i think [05:34] sudoer has joined the channel [05:34] Ned__: ah ha [05:34] Ned__: no it's not ... [05:34] _ry: so override the parents sigint handler [05:34] Ned__: nah, wait ... I think I found my issue [05:34] Ned__: the child processes were going out of scope [05:35] Ned__: crap ... [05:35] Ned__: now the thing isn't existing :-9 [05:35] Ned__: gah ... new problem [05:35] Ned__: it waits for my 6 children to die [05:35] Ned__: then just hanges :-( [05:36] Ned__: oh, duh ... [05:36] Ned__: okay, I need to override the SIGINT handler .... [05:37] Ned__: and I need some way (inside the handler) to "wait" for the child processes to exit [05:37] Ned__: then I can exit the main process [05:38] Ned__: I think I've figured out a way [05:38] Aria: Hm, _ry, in this the v8::Message is null -- ->Get() on it returns 0x0 [05:39] Ned__: Hmmm, if you have an object {}, there's no length property [05:40] Ned__: is there an easy way to get the length ? [05:40] _ry: Ned__: you have to explicitly exit [05:40] _ry: Ned__: if you override the sigint [05:40] Ned__: _ry: yeah, figured that out :-) [05:40] _ry: process.exit(0) [05:41] Ned__: I just need some way of figuring out how many entries there are in an object now [05:41] Ned__: {}.length == undefined [05:41] _ry: Aria: hmm [05:41] Ned__: [].length == 0 (I guess because that's an Array) [05:41] _ry: Aria: i wonder what's causing that exception [05:41] _ry: Aria: something inside the callback of the fs.read() i guess [05:41] gwoo has joined the channel [05:42] Aria: Yeah. That's what I'm seeing. [05:42] _ry: Ned__: you have to loop and count them yourself [05:42] Ned__: _ry: :-( [05:42] Aria: But without a backtrace, it's hard to find. [05:43] _ry: Aria: *nod* [05:43] _ry: Ned__: use a different datastrucutre :) [05:43] _ry: so many emails :( [05:43] Ned__: _ry: are there hash-like structures ? [05:44] Ned__: ACTION looks at documentation some more [05:44] Ned__: there's no suitable native type right ? [05:44] blazzy_: Ned__: right [05:44] jazzychad: hi all [05:44] Aria: Hash-like structures? All objects are hash-like [05:44] jazzychad: i've just pushed a fanout message server using node to github [05:45] jazzychad: http://github.com/jazzychad/fanout.node.js [05:45] Aria: Oh, fun. The callback to fs.read is round-tripped through libeio [05:45] _ry: http://wiki.github.com/ry/node/library-compatibility [05:45] Ned__: Aria: well yes, but with some useful functions ... like keys() [05:45] Ned__: or something [05:45] _ry: jazzychad: --^ [05:46] jazzychad: _ry: ? [05:46] _ry: jazzychad: you should add fan out to http://wiki.github.com/ry/node/library-compatibility [05:47] jazzychad: _ry: oh, right.... /edits [05:49] Aria: Ned__: function keys(h) { var r = []; for(var k in h) r.push(k); return r; } [05:49] Aria: keys(obj) [05:57] Aria: Hm. Looks like the callback isn't entirely there in the backtrace. Not that I'm positive I know what to look for. [06:09] silentrob has left the channel [06:09] _ry: it might be that the stderr buffer just isn't getting flushed? [06:09] _ry: so it isn't displayed? [06:09] _ry: :/ [06:09] _ry: fflush(stderr) is there ... but i don't kow [06:15] CIA-77: node: 03Ryan Dahl 07master * rcee9080 10/ (doc/api.markdown lib/events.js): Fix typos - http://bit.ly/bmBqVM [06:15] CIA-77: node: 03Jonas Pfenniger 07master * rdf07a71 10/ (2 files in 2 dirs): [06:15] CIA-77: node: New test-case: signal unregistration [06:15] CIA-77: node: The default signal-handler should be restored if no handlers are [06:16] CIA-77: node: assigned. - http://bit.ly/ba0BeW [06:20] Aria: I got it! [06:20] Aria: _ry, here's a minimal test case: require('fs').readFile('/etc/hosts', 'r', function() { JSON.parse(undefined) }); [06:21] Aria: JSON's 'illegal access' error inside a callback goes boom. [06:24] _ry: hm [06:26] Aria: (I failed and only had a 'data' arg instead of 'error, data' arg to my callback -- so I passed JSON an undefined.) [06:26] Aria: Boom. [06:26] _ry: Aria: rad [06:27] Aria: Hehe, I'm psyched. That was really stuffing me up. [06:28] _ry: hm. i don't get what JSON.parse() does [06:28] _ry: it's not really trhwoing an error? [06:28] Aria: I'm not entirely sure. It looked weird. [06:29] Aria: Oh, hey! JSON.parse(undefined) alone in a file goes boom. [06:29] Aria: But it returns to the prompt in the repl. [06:29] Aria: It trips a TryCatch, so yeah, it throws an error. [06:29] Aria: But perhaps badly, doing it under the hood? [06:30] mikeal1 has joined the channel [06:33] _ry: i think i need to notify v8 about it [06:33] mape: To the bat mobile! [06:33] Aria: Awesome. [06:35] _ry: fictorial: jefe. great! [06:35] _ry: can get a node.js irc bot now? [06:35] fictorial: oh hey, thanks! [06:36] _ry: :) [06:36] fictorial: oh yeah, sure [06:36] _ry: i think that was the main problem [06:36] Aria: Hehe. arias_todo_list.push('irc bot framework for _ry to have a node.js bot with') [06:36] jazzychad: fictorial: related - have you seen Dr Eval? http://github.com/progrium/DrEval [06:36] Aria: Oh god. The pun. [06:37] _ry: jazzychad: interesting [06:37] _ry: so now fictorial can release the same api without dependency on twisted :) [06:37] fictorial: jazzychad: I think I have yes. [06:37] jazzychad: yes... thank goodness [06:37] fictorial: I'm trying to find my notes on the thing from way back when [06:37] _ry: fictorial: do you reuse the child process if possible? [06:37] jazzychad: he has a version running somewhere, but i can't remember the url [06:38] fictorial: I only recall that ampoule was very sorely lacking in docs and the maintainer was like "use the source" [06:38] fictorial: _ry: indeed [06:38] _ry: fictorial: or do you start a new one for each eval? [06:38] _ry: cool [06:39] fictorial: run [min,max] children in the pool, reuse each as long as you want via recycleAfterN (requests) option [06:39] fictorial: I'd love to have folks find problems in jefe - I plan on using it in production as soon as I feel comfortable with it [06:40] SamuraiJack has joined the channel [06:41] fictorial: ugh - it's really late now. bye! [06:41] jazzychad: ciao [06:42] _ry: ACTION sleep. ciao [06:42] jazzychad: woah, when was querystring included as a native module? [06:54] bpot has joined the channel [06:55] _ry: man. i hope this http://ajaxian.com/archives/aves-game-engine?utm_source=twitterfeed&utm_medium=twitter&utm_campaign=Feed:+ajaxian+(Ajaxian+Blog) [06:55] _ry: has node.js somewhere in it [06:57] hassox has joined the channel [06:59] markwubben has joined the channel [07:06] jazzychad: that is madness [07:06] teemow has joined the channel [07:06] _ry: http://twitter.com/vanriper/statuses/12847785002 [07:06] qFox has joined the channel [07:10] jazzychad: they must be using a fanout server of their own :p [07:10] mape: _ry: Someone mentioned it earlier? [07:11] mape: 01:14:28 < RayMorgan> just got a Node.js shout out at jQuery conf [07:11] mape: 01:15:31 < RayMorgan> by Paul Bakaus who is writing a realtime game engine for the browser. Very, very impressive stuff. [07:11] mape: 01:29:50 < mape> know paul irish looked at it as well so [07:11] mape: So looks plausible :) [07:12] martoche has joined the channel [07:12] mape: And I read like a donkey [07:12] mape: nm [07:12] jazzychad: mape: hey, just saw your lib for prowl [07:12] _ry: sweet. [07:12] mape: jazzychad: Worked for you? :) [07:12] _ry: mape: hey did you see the post with the search added to the docs? [07:13] jazzychad: mape: yeah... thought of doing a similar one for Notifo? [07:13] mape: _ry: Ah yeah [07:13] _ry: mape: it's cool - or? [07:13] _ry: mape: btw - what timezone are you? [07:13] mape: _ry: Well it is a total rewrite of the js, but yeah, I just use the native browser search since it is all in one page [07:14] mape: Not sure if people need stuff removed, but could see people like it. [07:14] mape: _ry: Sweden, GMT+1 [07:14] mape: jazzychad: Hmm never really looked at notifo, better then prowl? Same kinda api? [07:14] _ry: mape: yeah good point [07:15] jazzychad: mape: yeah, notifo is my project... simliar api, yes... will support more clients, and is free [07:15] mape: Free? [07:15] mape: What a load of crap [07:15] mape: :P [07:15] jazzychad: hah [07:15] mape: I'll check it out [07:15] jazzychad: cool.. notifo.com [07:16] mape: You can style the notifications as well? [07:16] mape: Add images and what not? [07:16] martoche_ has joined the channel [07:17] _ry: groan.. so many bugs [07:17] mape: Hmm the subscription step is a must? Can't just add my api key and start sending myself stuff? Need to setup a feed for each app and subscribe to it? [07:17] mape: _ry: What about the timezone? [07:17] mape: Btw the js markdown switch is set in stone == should be looked at? [07:18] jazzychad: mape: yeah... style, images, url redirection, etc... [07:18] jazzychad: mape: sec... you can send yourself notifications from your User account w/o subscription step [07:18] jazzychad: mape: http://blog.notifo.com/send-notifications-with-your-user-account [07:19] Aria: ACTION yawns. Alright. Test data loaded, time for bed. [07:19] mape: jazzychad: Ah good, less steps is always good [07:20] jazzychad: mape: the subscription step is just for service providers that send to other end users beside themselves [07:20] mape: Ah k [07:22] ahc has joined the channel [07:26] magcius: js> Boolean("") [07:26] gbot2: magcius: false [07:27] magcius: js> -5 % 100 [07:27] gbot2: magcius: -5 [07:28] mape: js> iWannaGoHome('right now'); [07:28] gbot2: mape: Error: ReferenceError: iWannaGoHome is not defined [07:28] mape: Gah [07:33] mape: jazzychad: Nice idea might be to have a "test api" button on the settings page [07:33] mape: wanna try the app but can't real easily :) [07:36] mape: jazzychad: Only subscribers can add pics? [07:40] jazzychad: mape: only service providers can set the images right now, but i could add that ability for straight user messages [07:40] mape: submit a url or whatnot perhaps? [07:40] jazzychad: yeah [07:41] jazzychad: might need an app update tho... [07:41] mape: Hehe the horrid app updates [07:41] jazzychad: so assume it won't be there for a while :) [07:41] mape: How long until you have android support? [07:41] jazzychad: soon (i hope) working on the app now [07:41] mape: And are you doing push as well? [07:41] mape: Just that it isn't centralized? [07:41] mape: But you roll your own server that clients are connected to? [07:42] jazzychad: trying to figure that one out... i've seen ppl try to use xmpp for push [07:42] jazzychad: well, needs a centralized server for apple, too (so does prowl) [07:42] mape: Yeah I mean apple has everything in one pull [07:43] mape: android has nothing centralized so each app has to host their own push server? [07:43] mape: Rather then just send them to apple [07:43] jazzychad: ah yeah... well there doesn't seem to be any sort of push mechanism except for xmpp.. which i think would just appear as gtalk chats [07:43] jazzychad: otherwise the app will have to poll every so often for new notifications :( [07:44] mape: ah neat [07:44] jazzychad: btw, you can test the app/api w/o installing the app... there's a notification log on the site as well [07:46] romainhuet has joined the channel [07:48] towski has joined the channel [07:52] javajunky has joined the channel [07:58] towski has joined the channel [07:58] teemow has joined the channel [08:00] derbumi has joined the channel [08:00] hassox has joined the channel [08:05] N` has joined the channel [08:07] hellp has joined the channel [08:10] hassox has joined the channel [08:18] javajunky1 has joined the channel [08:18] jwa has joined the channel [08:24] jwa: any possible solution yet to install node.js on windows/apache? [08:33] micheil: someone after me? [08:35] blazzy has joined the channel [08:39] micheil: kjeldahl / javajunky1: Yeah, I'm sort of working on a Spec compliant and hixie-draft-75 compliant websocket server and client, so far just the server that there's any code on, but I've gotten busy over the past week and haven't gotten much more done on it [08:43] mikemike86 has joined the channel [08:45] tisba has joined the channel [08:52] TomY has joined the channel [08:53] tisba has joined the channel [08:57] derbumi has joined the channel [08:59] xla has joined the channel [09:03] nsm has joined the channel [09:05] javajunky has joined the channel [09:11] Nohryb has joined the channel [09:26] hellp has joined the channel [09:27] derbumi has joined the channel [09:28] ithinkihaveacat has joined the channel [09:43] ithinkihaveacat has joined the channel [09:59] mfeiri_ has joined the channel [10:04] mfeiri has joined the channel [10:15] pkrumins: I am getting a lot of these: node http server: Error: EPIPE, Broken pipe [10:15] pkrumins: Any ideas how to handle them? [10:21] pkrumins: Also getting exceptions sometimes, Error: EINTR, Domain name not found [10:21] CodeOfficer has joined the channel [10:24] maritz has joined the channel [10:27] pdelgallego has joined the channel [10:49] dekroning has joined the channel [10:56] kjeldahl has joined the channel [11:00] spoob has joined the channel [11:11] kjeldahl has joined the channel [11:11] bpot has joined the channel [11:14] voodootikigod has joined the channel [11:41] TheEnd2012 has joined the channel [11:59] polo_ has joined the channel [12:02] polo has joined the channel [12:02] polo: hi [12:02] mape: hey [12:08] polo: mmm quite hard ! [12:08] polo: I can't find a simple way to modify the express' Class file in order to add a super object !! [12:08] polo: someone knows a good class impl ? [12:09] hassox has joined the channel [12:11] N` has joined the channel [12:13] javajunky: what does '.extend' return ? [12:15] micheil: I don't think it does [12:15] polo: I don't think there is a .extend ! but let's try [12:15] polo: .extend is for Class [12:15] javajunky: yeah I get undefined. [12:16] javajunky: __proto__ ? [12:16] polo: nop [12:16] polo: yeah undefined [12:18] javajunky: hmm no idea ;) [12:21] polo: I thought it should be __proto__ too [12:21] polo: but it doesn't work :( [12:22] SamuraiJack: polo: take a look: http://joose.it [12:23] SamuraiJack: its a good class implementation ) [12:23] polo: ok thanks [12:23] polo: I hope it's not very different from the express one [12:23] SamuraiJack: probably it is [12:25] javajunky: its weird, I on't quite undertstand, probably worthasking TJ, but the documentation for his 'class' (devmag) actually does contain a reference to __super__ which would do what you want, ubt the current 'class' git project doesn't. [12:25] polo: :s I wouldn't like to modify all my classes [12:26] polo: javajunky: interesting ! [12:27] polo: maybe I could contact him [12:27] javajunky: polo: just ask over on github, perhaps raise an issue for comment, [12:28] javajunky: http://github.com/visionmedia/class.js/issues but theere's like a bazillion class implementations out there :) [12:28] polo: yep [12:28] polo: but the code isn't very long [12:28] polo: it souldn't be too hard to correct it [12:37] creationix has joined the channel [12:39] kriszyp has joined the channel [12:41] creationix: There is something very strange and hard to reproduce on howtonode.org [12:41] creationix: after a few days it will simply stop accepting responding to connections, memory and cpu use will be super low [12:42] creationix: there is no exception anywhere, and restarting the node process fixes it right up [12:45] MattJ has joined the channel [12:45] romainhuet has joined the channel [12:46] gf3 has joined the channel [12:47] Krowbar has joined the channel [12:51] herbySk has joined the channel [12:56] SamuraiJack_ has joined the channel [12:57] polo: creationix: You may want to check if it aways happens after the same amount of time [12:59] javajunky: creationix: you're using monit arent' you ? [13:00] javajunky: creationix: does that give you an indication on the period ? .. .. Could be connection leakages , are there loads of them hanging around in TIME_WAIT etc. ? [13:02] creationix: no, I'm not using monit [13:02] N` has joined the channel [13:02] creationix: just a straight proxy_pass from nginx [13:03] creationix: time_wait, huh, how do I check that on Linux? [13:03] javajunky: weird, sorry I thought you'd written the article on it, too many tims I guess ;) .. monit would help though by restarting when it stopped responding to connections (obviously not ht eunderlying issue) [13:03] javajunky: netstat [13:04] javajunky: (Um I've only looked at TIME_WAIT issues on windows before now, so for all I know there's some fundamental difference that means its a non-issue ;) ) [13:04] creationix: hmm, I've got a few TIME_WAITS and CLOSE_WAITS [13:05] creationix: They seem to slowly grow and not go away [13:05] javajunky: I think a few are perfectly normal, they'll hang about to… ah yes that could be a problem them ... [13:05] javajunky: s'abit weird though I'd think someone would've noticed if there was an issue like that [13:05] javajunky: do they grow when you hit it bypassing nginx ? [13:06] creationix: I wonder if switching to unix sockets would go around the issue [13:06] javajunky: my head ———————— > Where you're at ;) [13:06] javajunky: (over is hard to convey horizontally, turns out) [13:06] creationix: javajunky: not sure, I've never had real traffic on the node app directly [13:07] javajunky: nginx does have some settings in this area as i recall,lt me take a look at my config [13:07] creationix: well, now it's down to just 2 TIME_WAIT connections again [13:07] creationix: maybe they do go away, just slowly [13:08] javajunky: yeah, you'd expect it to , the issue is I wouldn't expect to see them all the time, and you will run out of sockets if the rate of new connections exceeds the rate in which they atrophy. [13:10] javajunky: personally I'd hammer it with ab to see how it reacts through nginx… then again without … [13:10] javajunky: but it may be a red herring :) [13:10] creationix: I just hit it with ab from my local laptop and it gets a TIME_WAIT for every hit [13:11] javajunky: thats not what I'd personally expect, but I'm not expert, far from it :) [13:12] creationix: hmm, hitting it directly does the same thing [13:13] creationix: though the difference is that the client port is a local port when using nginx [13:13] javajunky: yeah my reading about is that time_Wait is probably nothing to stress about … [13:13] javajunky: ( http://blog.port80software.com/2004/12/07/hurry-up-and-time_wait/ ) ..whilst about IIS + windows, was fairly useful [13:14] javajunky: have you got apache on the box, you could hit that too, and assume its behaviour is 'correct' ;) [13:14] creationix: no, no apache [13:14] javajunky: netstat is your friend though when it does stop 'responding' to requests. [13:16] voodootikigod has joined the channel [13:16] javajunky: just out of interest what arguments are you passing to netstat, I get no time_waits on my live node system. [13:16] creationix: nothing, just netstat [13:16] creationix: then I grep on the port of my node app [13:16] milythael has joined the channel [13:17] javajunky: for me sudo netstat | grep TIME_WAIT returns nothing [13:18] javajunky: ah, until I load the system heavily, then I get me. [13:18] javajunky: but as *Soon* as I kill the ab test (-n10000 -c5) they all go. [13:19] creationix: I get them on almost every connection, irrelevant to the load [13:19] javajunky: I'd look at tweaking your time_wait values if they're hanging around [13:19] javajunky: I suspect I'm getting them, they're just disappearing damn fast [13:19] javajunky: (this server is node 0.1.91 .. the app is express) [13:19] maushu has joined the channel [13:20] creationix: it's not safe to have low timeouts though [13:20] maushu: FFFFFFFFFFFFFFFF- A new opponent has appeared! [13:20] javajunky: cat /proc/sys/net/ipv4/tcp_fin_timeout [13:20] javajunky: == 30 for me. [13:20] maushu: I really need to start my startup. [13:20] creationix: 60 [13:21] javajunky: there is *no* way my connections are staying in TIME_WAIT for 30 seconds, they disappear instantly for me. [13:22] jherdman has joined the channel [13:22] creationix: Isn't the number of ephemeral ports fairly large on linux [13:22] creationix: but still, if every connection is holding a port for 60 seconds, I can see how that would use up ports [13:23] kjeldahl has joined the channel [13:26] milythael: Does anyone have any idea why node would segfault in v8/src/handles-inl.h:48 (0.1.92) with too many dns requests? We are deep into ares_process trying to trace a callback calling itself twice just before the segfault but I'm not sure we aren't chasing the wrong trail. [13:30] creationix: milythael: sorry, no clue on that one [13:30] creationix: I haven't messed with DNS yet [13:34] milythael: It looks like a problem in c-ares. [13:37] creationix: javajunky: I'm just going to have to wail till my server is unresponsive again, not sure what the problem is [13:37] javajunky: :( poop [13:37] javajunky: I am interested in why my sockets don't sit in TIME_WAIT for 30 seconds, but yours apparently do, if I had more time I'd look into it for you :( [13:38] kjeldahl has joined the channel [13:38] creationix: javajunky: I only get 5000 visitors on a good day, that's no way enough to use up all the ports [13:38] mape: creationix: howtonode? [13:38] javajunky: true [13:39] creationix: unless someone is hitting my server with ab or something (google analyics won't see that) [13:39] creationix: ACTION checks the nginx logs [13:39] creationix: mape: yes [13:40] creationix: nope, that's not it, about 800 total request per day lately [13:41] javajunky: god knows. [13:44] creationix: (strange how when I don't have time to write good articles, my traffic plummets) [13:44] milythael has left the channel [13:52] N` has joined the channel [13:57] nsm has joined the channel [13:57] dekroning has joined the channel [14:02] jedschmidt has joined the channel [14:04] SamuraiJack__ has joined the channel [14:11] davidsklar has joined the channel [14:13] N` has joined the channel [14:19] kjeldahl has joined the channel [14:19] mattly has joined the channel [14:20] stepheneb has joined the channel [14:22] TheEnd2012 has left the channel [14:27] jedschmidt_ has joined the channel [14:28] herbySk: aaah! I was eloborating last hour around strange behaviour after I realized that for(var ... in ...) is really strangely broken... copy props to array and doing forEach over that array solved it. [14:29] nefD: ACTION loves the new docs [14:35] mape: creationix: Any idea if http://howtonode.org/facebook-connect still works? [14:40] creationix: mape: as far as I know, he never updated the article [14:40] mape: ok [14:40] alex-desktop has joined the channel [14:40] creationix: it's still tagged v0.1.31 [14:40] mape: Perhaps have a big flag at the top? New people might get annoyed when stuff don't "work" [14:42] tek has joined the channel [14:43] tmpvar has joined the channel [14:45] tmpvar: hello [14:46] Yuffster has joined the channel [14:46] polo_ has joined the channel [14:53] softdrink has joined the channel [14:55] steadicat has joined the channel [14:56] creationix: tmpvar: hello [14:57] quirkey has joined the channel [15:02] mape: If you require a dir, does it fetch all .js in the dir? [15:03] mape: or do you need an index that does that? [15:06] SamuraiJack__ has joined the channel [15:08] stepheneb_ has joined the channel [15:17] creationix: mape, you need the index [15:17] creationix: require only loads one file [15:18] mape: Hmm k, seems express worked using just that require.. [15:18] mape: Or sorry, they did have an express in there [15:19] herbySk: mape: plus, if you have ./the/path.js, it load it instead of ./the/path/index.js [15:19] mape: Seems they merge all kinds of fun stuff into the global element [15:19] herbySk: (I would propose that index.js be loaded if and only if you issue require(./the/path/') (with the slash) [15:20] fictorial: creationix: how would you be using ephemeral ports for inbound connections? are you talking about some sort of proxy on the server that connects somewhere else per client connection? [15:21] creationix: fictorial: the nginx uses then to proxy pass to the node app [15:21] fictorial: right - so there's the proxy - ok [15:22] fictorial: fwiw cherokee uses http 1.1 to upstreams which is kind of nice [15:22] javajunky has joined the channel [15:33] creationix: fictorial: am I right in assuming that using sockets instead of tcp ports for the upstream would solve the problem as well [15:34] fictorial: you mean UNIX sockets? [15:34] creationix: yep [15:34] creationix: sorry, they're all sockets [15:34] sudoer has joined the channel [15:35] creationix: or do UNIX sockets use tcp as well, just bind differently [15:35] binary42 has joined the channel [15:36] fictorial: they do not use the tcp stack, no - [15:37] fictorial: they don't use ephemeral ports either - but I'm unsure of how multiplexing works on them. _ry would surely know off the top of his head :) [15:38] dandean has joined the channel [15:38] _ry: creationix: unix sockets are like tcp, just - not [15:38] _ry: :) [15:39] _ry: they're still streams [15:39] _ry: but instead of listening on a port you listen on a filename [15:39] creationix: so when nginx connects to them will it use ephemeral ports [15:39] _ry: i don't think so [15:39] creationix: plus it's a little faster from what I hear [15:40] RayMorgan has joined the channel [15:40] _ry: it's a little faster, yes [15:40] polo_ has joined the channel [15:40] _ry: ports are an IP thing [15:40] creationix: either way, I don't think it's the TIME_WAIT ports causing me trouble [15:40] creationix: I don't get enough traffic for that to matter [15:40] _ry: and by IP i mean TCP?IP [15:41] creationix: _ry: of course :) [15:41] _ry: but using unix is definitely recommended behind nginx [15:41] _ry: more secure [15:42] creationix: I thought using 127.0.0.1 was the same security of a UNIX socket [15:42] creationix: either way you have to be on the local machine to see it [15:42] CodeOfficer has joined the channel [15:42] towski has joined the channel [15:42] shirro has joined the channel [15:42] Tekerson has joined the channel [15:43] creationix: so, as I discovered by accident, all it takes to use a UNIX socket is to pass a string to listen() (even if that string is "8080") [15:43] tmpvar has joined the channel [15:44] kjeldahl_ has joined the channel [15:46] ditesh|cassini has joined the channel [15:47] mrjjwright has joined the channel [15:48] _ry: creationix: yeah - that's probably not ideal [15:48] creationix: drove me crazy because I was accepting the port number from bash, and argv comes in as all strings [15:48] jtoy has joined the channel [15:49] Roflrilla has joined the channel [15:50] creationix: is there a proper uri for http servers on unix sockets? [15:50] creationix: unix://foo/bar ? [15:50] creationix: http://unix://foo/bar [15:51] hsuh has joined the channel [15:51] creationix has joined the channel [15:51] Roflrilla: Has anyone stress tested node.js yet and see the amount of simultaneous connections compared to lets say, lighttpd or nginx? [15:52] devinus has joined the channel [15:52] devinus: looks like the commonjs mailing list is pissed off [15:53] mattly has joined the channel [15:54] mikeal1 has joined the channel [15:54] maushu: creationix: That link connected me to somekind of list of games. [15:54] maushu: Oooh, Global Thermonuclear War. I'm gonna play this. [15:54] deanlandolt: eh, we're not all so sensitive :) [15:54] creationix: cool, I just get a 404 [15:55] nefD: blargh. anyone have any suggestions or tips on converting a RFC 3339 timestamp (used in ATOM feeds) into a more, er, compatible javascript timestamp or date? [15:55] N` has joined the channel [15:56] creationix: nefD, does the Date constructor not understand it? [15:56] nefD: hrmm, i just kinda figured it wouldn't, i should give that a shot [15:56] deanlandolt: nefD: it's in es5..not sure if it's made it to v8 [15:57] creationix: I seem to remember it working [15:57] deanlandolt: http://dansnetwork.com/2008/11/01/javascript-iso8601rfc3339-date-parser/ [15:57] deanlandolt: if it's not there [15:58] creationix: I think I'll use the same url syntax as nginx upstreams (http://127.0.0.1:8080 vs unix:/tmp/sock) [15:58] maushu: upstreams? In my node.js?! [15:59] devinus: "The Node developers are clearly not interested in conforming with the CommonJS standard. Perhaps, we should move forward and forget about Node." [15:59] devinus: -- CommonJS mailing list [15:59] devinus: wtf is going on!? [15:59] deanlandolt: devinus: i know... [16:00] RayMorgan has joined the channel [16:00] deanlandolt: george gets pissed because app engine doesn't do async yet... [16:00] deanlandolt: and all node all the time really screws him up...which i can totally understand [16:00] devinus: it sounds like a bunch of people afraid of simply redesigning their apps with async IO in mind [16:00] mape: Anyone happen to know how to fetch get/post data in express? [16:00] deanlandolt: devinus: it's a bunch of people who realize that there are good reasons for sync [16:01] deanlandolt: for instance -- there's no need to do async in the startup phase of your node apps -- it just complicates matters [16:01] mape: nm, params [16:01] devinus: deanlandolt: sure, but Node demonstraits a clear sync api along-side the async api [16:01] deanlandolt: some people don't /only/ write servers -- sync io provides a nice control flow [16:01] bpot has joined the channel [16:01] sh1mmer has joined the channel [16:01] deanlandolt: it does [16:02] devinus: i don't understand the hostilities :-/ [16:03] devinus: frankly, i'm doing stuff in Node because every other language has burned me. i'm done with sync IO. trying to make my python web apps scale was a constant fucking battle [16:03] deanlandolt: heh [16:04] devinus: i'm just not smart enough to put sqlalchemy in some separate thread for twisted [16:04] deanlandolt: yeah, the hostilities need to settle down -- it's weird, because it seems like we're /just/ getting on the same page, node and the other commonjs folks [16:04] deanlandolt: devinus: yeah, i definitely get that [16:04] deanlandolt: it's just so much easier to not think about threads entirely [16:04] mrjjwright: I think async versus sync is kind of like the anti-aliasing debate early CG firms used to have, e.g. Pixar versus it's competitors. Pixar believed that aliasing issues were best solved by disciplined anti-aliasing techniques while others that that new modern powerful computers would create such high resolutions where these techniques were not important. [16:05] mrjjwright: In a similar way a lot of people believe that co-routines and STM and the like will make the need for async programming go away [16:05] deanlandolt: mrjjwright: that's an interesting analogy [16:05] mrjjwright: in the end Pixar was proven right, their early movies showed much higher quality at low resolution [16:06] devinus: deanlandolt: i'm afraid feelings such as that may prevail, and we may end up with a CommonJS standard that completely disregards Node because all these little JS implementors who have *zero* users feel differently [16:06] deanlandolt: devinus: i very seriously doubt that! [16:06] deanlandolt: you /can't/ disregard node [16:06] mrjjwright: by enforcing disciplined techniques with their animators they created high quality movies [16:06] creationix: I wonder if what I said the other day got misunderstood [16:07] deanlandolt: however, devinus: to say these other js implementors have /zero/ users is a mistake -- and also pretty hostile ;) [16:07] creationix: I had mentioned that when node was first created, commonjs compat was not a goal [16:07] mrjjwright: i think the node.js community is right being kind of disciplinarian about good async practices. So few libraries use streaming, async notifications and other things that are the building blocks of highly performing efficient apps [16:07] deanlandolt: take all the other engines and add up their users and i *guarentee* you'll eclipse node by an order of magnitude or two [16:07] deanlandolt: (don't forget yahoo's heavy use of rhino for pipes and yql, for instance) [16:08] devinus: deanlandolt: you're right... [16:08] devinus: ACTION sheepishly retracts statement [16:08] deanlandolt: mrjjwright: fwiw i agree -- someone needs to be disciplinarian -- but we all have to coexist [16:08] deanlandolt: i'm with Wes-: standards are hard...let's not call them that [16:08] creationix: I don't see why commonjs can't move on with sync apis while still developing the async apis [16:08] sh1mmer: devinus: actually there are about a cajillion spidermonkey based implementations around [16:09] sh1mmer: deanlandolt: did you talk to Brendan about that at all? [16:09] sh1mmer: he had a ridiculous list [16:09] deanlandolt: sh1mmer: no, but i wish i had [16:09] deanlandolt: it'd be cool to get a list out there -- it's pretty cool to learn about all this work that's been pretty much in the dark [16:11] deanlandolt: ryan thinks it's premature to standardize -- perhaps he's right...some of think that if we can get the basics wrapped up we'll see a cambrian explosion...we won't know until we try [16:11] mrjjwright: not sure all our libs have to coexist, we can build better ones, it seems to me that leadership is needed more than diplomacy in this case. [16:12] deanlandolt: mrjjwright++ [16:12] deanlandolt: (though diplomacy is about all i can offer these low-level efforts, sadly) [16:16] hsuh` has joined the channel [16:17] creationix: deanlandolt: I think we could be more active to do the easy things (like rename process.argv to whatever commonjs uses, or at least alias it) [16:17] deanlandolt: creationix: yeah, and ryan's been incredibly receptive to that kind of stuff [16:18] creationix: I think once node hits v0.2.0 and our apis are stable we can start to propose async standards based on the current node api of the time [16:18] deanlandolt: and kriskowal's been all over it w/ narwhal...and with kriszyp's package mapping stuff eliminates much of the direct conflicts [16:19] deanlandolt: yeah, i'm hoping -- that really needs to be hammered out...the problem as i see it is event-based apis are HARD to specify [16:19] creationix: deanlandolt: yes, that's why node has been changing it's apis every month [16:20] fizx has joined the channel [16:20] deanlandolt: heh :) [16:20] creationix: it's kinda of a chicken and egg problem, we don't know if the api is good till lots of people use it in real world apps, and most people won't touch it till the api stabilizes [16:20] deanlandolt: yep [16:20] deanlandolt: at least in node's case, sure -- you can't /standardize/ until you stabilize [16:20] jan____ has joined the channel [16:21] deanlandolt: there's not a lot of prior art here -- which is kinda cool but yeah, kinda scary [16:21] tisba has joined the channel [16:22] jedschmidt has joined the channel [16:23] creationix: I do agree with kriszyp that we should standardize on things like Buffers [16:23] creationix: they are useful and don't imply any sync/async mess [16:23] deanlandolt: exactly :) [16:24] creationix: node is still somewhat lacking in areas like cryptography, compression, and other binary formats that probably have libraries already in commonjs land [16:24] mjr_ has joined the channel [16:24] creationix: with fast buffers we can actually write useful libraries in js [16:24] deanlandolt: yeah -- encodings is another thing that you have to depend on your engine for [16:25] creationix: I imagine that c-based modules will never be cross-platform [16:25] spoob: not if cross platform includes the web [16:25] deanlandolt: creationix: perhaps not -- but one should be able to write a fat-binary like /package/ [16:25] deanlandolt: heh...true :) [16:26] deanlandolt: spoob: a lot of things can be done in js -- just really slowly [16:26] creationix: because even with buffers, some things still aren't plausible in pure js [16:26] creationix: but they sure help [16:26] spoob: http://crypto.stanford.edu/sjcl/ <=- look at performance [16:26] atmos: is not cross-platform now ? [16:27] atmos: err is node [16:27] deanlandolt: atmos: crossplatform -windows [16:27] deanlandolt: but cross-platform in this discussion means so much more...it means cross engine, cross-environment...there are a lot of dimensions here :-/ [16:27] spoob: webgl will also make a lot of other things possible, so javascript will be more of a high level controlling language [16:28] creationix: when i say cross-platform I mean across rhino, spidermonkey, node, and others [16:28] atmos: deanlandolt: so you mean more as js itself evolves instead of just hte future of node ? [16:28] atmos: gotcha [16:28] joshbuddy has joined the channel [16:28] JimBastard has joined the channel [16:28] deanlandolt: atmos: i mean i'd really like for people to be able to write comprehensive packages that do cool shit /whereever/ they run [16:29] JimBastard: god dammit [16:29] JimBastard: my roommate and i grabbed the wrong laptops this morning [16:29] atmos: HAH [16:29] JimBastard: what a shitty morning at work for both of us [16:29] creationix: and I would like to be able to do stuff like md5 in node without having to port some arcane browser library to a node module [16:29] JimBastard: WHY [16:29] JimBastard: WHY MUST WE BOTH HAVE THE SAME MACBOOK [16:29] creationix: JimBastard: sue apple ;) [16:29] atmos: stickers, dude [16:29] JimBastard: i should have just sold his box to the nytimes [16:29] creationix: hmm, I should probably add stickers before I go to my next conference [16:29] JimBastard: im sure there is some scandelous banking info somewhere on it [16:30] JimBastard: making me walk across down [16:31] daschl has joined the channel [16:32] creationix: _ry: I switched howtonode to run on a UNIX socket and I don't get anymore TIME_WAIT ports from nginx anymore :) [16:33] creationix: hopefully that will fix the intermittent downtime issue, but I'm guessing that was never the issue [16:33] stepheneb has joined the channel [16:33] dgathright has joined the channel [16:33] creationix: only time will tell [16:33] mjr_: unix sockets are great [16:33] daschl: hey guys, how difficult is it (for a "newbie") to implement udp-support? or is it coming anyway [16:34] brapse has joined the channel [16:34] creationix: daschl: how much C do you know? [16:35] mjr_: And have you ever worked with V8's C++ API? [16:35] daschl: well.. i'd say basics.. im more comfortable with c++ [16:35] daschl: nope [16:35] mjr_: you probably should try it anyway [16:35] creationix: I'm not sure if it's on the way, _ry would know for sure [16:35] daschl: yea i found some discussions on google groups going on [16:36] mjr_: I've gone down that road a couple of times, and got lost in too many libraries that I didn't understand. [16:36] creationix: it's good to learn either way, you'll need to know V8's C++ and probably a bit of libeio/libev's C api [16:36] daschl: i thought about implementing an snmp agent with node.js but without udp this is not possible [16:36] creationix: udp would be cool [16:37] jedschmidt_ has joined the channel [16:37] nefD: Hm.. im trying to have a module extended the Date object prototype.. if I include the code inside that module file into my main script it works fine, but trying to utilize the new prototype method after module requirement, it complains that the module cant be found.. is there some kind of gotcha involved in extending object prototypes from a module? [16:38] nsm has joined the channel [16:39] creationix: nefD: I believe that is indeterminate behavior [16:40] creationix: but that's what my proto library does [16:40] deanlandolt: creationix: indeterminate? that's interesting -- how so? [16:40] creationix: what do you mean "the module can't be found" [16:40] ditesh|cassini has joined the channel [16:40] creationix: deanlandolt: I was under the impression that messing with globals from a module is a no-no under securable modules [16:41] nefD: well, the 'module cant be found' thing might be PEBKAC, chekcing out your proto module now [16:41] creationix: it happens to work in node, but it shouldn't [16:41] daschl has left the channel [16:41] deanlandolt: creationix: no, it's acceptable if your implementation isn't /secure/ -- you either get a handle on the native prototypes or not [16:41] deanlandolt: if you do, it should Just Work -- if it doesn't i'd consider that a bug [16:42] creationix: fair enough, but there is nowhere in the node docs that promise you'll have access to them [16:42] creationix: so I guess it's more on the level of an undocumented feature [16:42] jbrantly has joined the channel [16:42] deanlandolt: creationix: gotcha...that's fair [16:42] creationix: but like I said, I rely on the behavior, so I like how it is [16:43] deanlandolt: yeah -- i think everyone wants that behavior sans crock, mark miller, ihab and the ocap guys :) [16:44] creationix: heh, especially with node exposing the "globals" object, you can do anything from a module [16:44] deanlandolt: but that's what securable means -- you can get put into a sandbox -- you can still extend the natives but it won't work it's way into the global env [16:44] mythz has joined the channel [16:44] deanlandolt: creationix: exactly...the important part is that it's secure*able* [16:45] creationix: thanks for the clarification [16:46] nefD: yea, pebkac strikes again [16:46] nefD: ACTION has lost 23 XP! [16:46] creationix: nefD: what's pebkac? [16:47] creationix: ahh, nevermind, it's an acronym [16:47] nefD: problem exists between keyboard and chair [16:47] nefD: hehe [16:49] derbumi has joined the channel [16:50] creationix: I hear implementing database wire protocols yields high XP returns [16:50] creationix: though usually causes a temporary loss in INT and STR [16:50] ncb000gt has joined the channel [16:50] nefD: everyone on the forums are saying that grinding doc boss mobs is th best way to level up [16:51] creationix: :) [16:51] ncb000gt: o.0 [16:51] ncb000gt: where are the epix? [16:53] spoob has left the channel [16:53] creationix: that reminds me, I still need to write a real-time game for TXJS [16:53] creationix: why did I sign up to speak at so many places right after finals? [16:54] mkovacs has joined the channel [16:55] polo has joined the channel [16:57] WALoeIII has joined the channel [17:00] mape: Anyone know of any module that makes twitter connect/oath any easier? [17:04] binary42 has joined the channel [17:04] binary42_ has joined the channel [17:05] binary42 has joined the channel [17:05] RayMorgan_ has joined the channel [17:05] rictic has joined the channel [17:09] devinus: creationix: TXJS ? [17:10] creationix: http://texasjavascript.com/ [17:11] towski has joined the channel [17:11] siculars: hey gang, quick (hopefully) question... here's the code http://pastie.org/935806 , fyi. on line 51 i call a function (line 26) that only returns data in it's callback. what i want to do is get that return back for use but it seems like the callback won't set the val correctly. i believe this is a scope thing that i don't know how to get out of... thank you ! [17:12] devinus: creationix: how did i not know of this!? i'm in austin [17:12] creationix: really, that sucks, it's been sold out for a while and it was really cheap [17:14] devinus: creationix: fffffffffuuuuuuuuuuuuuu [17:14] Tug has joined the channel [17:14] atmos: mape: nope [17:14] creationix: devinus: you can always get on the wait list, you never know what will happen [17:14] dandean has joined the channel [17:14] devinus: creationix: doing that.... [17:14] atmos: mape there's an express oauth module but i haven't used it yet, thusfar i've just been using facebook auth [17:15] mape: atmos: Yeah just got facebook working [17:15] fizx has joined the channel [17:15] atmos: mape the oauth lib is available in kiwi if you're looking for it [17:15] sh1mmer has joined the channel [17:15] saikat has joined the channel [17:15] atmos: i'd really like to wrap it up as a trivial express plugin though [17:15] creationix: siculars: did you mean to pass the function to sys.log instead of passing the return value? [17:16] creationix: siculars: oh, nevermind, I read that wrong, just a sec [17:16] siculars: creationix: thanks... i actually want the value... if i do var datumKey = utils.createDatum; sys.log( datumKey ); i get the func returned [17:17] lifo has joined the channel [17:17] siculars: it looks like im gettin my key returned as it's default cause the internal callback (db.save) is not updating the return val [17:17] creationix: siculars: so the problem is that you're getting an empty string, but expect the actual value with? [17:18] siculars: creationix: bingo [17:18] creationix: correct, async callbacks won't modify the already returned key from the outer sync function [17:18] mape: atmos: that is what I'm doing, getting it into express that is [17:18] creationix: siculars: key gets returned before db.save's callback ever gets called [17:19] creationix: sadly it's impossible to wrap an async function to look like a sync function [17:19] siculars: creationix: any way out of this ? like i seem to recall in the api chaining to wait on return [17:19] atmos: mape: got the code up somewhere ? [17:20] creationix: siculars: anything that wraps an async function has to be itself async as well, you have to chain the callbacks [17:20] creationix: it gets real ugly real fast if you aren't careful [17:20] creationix: I write several articles about managing this on howtonode.org [17:21] creationix: my most recent library that helps is the Step library [17:21] dgathright has joined the channel [17:21] manv has joined the channel [17:22] mape: atmos: http://mape.me:9999/ [17:22] mape: Only facebook working [17:22] creationix: siculars: http://github.com/creationix/step [17:23] creationix: and if you want a more oo style http://github.com/kriszyp/node-promise [17:23] siculars: pulled up the docs.. search for chain , brings you to an fs.rename example [17:23] mape: The code is still dirty and not published anywhere [17:23] fizx has joined the channel [17:24] joshbuddy has joined the channel [17:24] isaacs has joined the channel [17:24] creationix: siculars: which docs? [17:24] siculars: nodejs.org/api.html [17:24] creationix: all the node api docs [17:24] creationix: *ahh [17:24] creationix: yes, to manually chain stuff, you have to nest the callbacks [17:25] atmos: mape: http://github.com/atmos/webhooks.js uses http://github.com/atmos/facebook.js [17:25] creationix: that works for small stuff, but it's not maintainable [17:25] Vladimir11 has joined the channel [17:25] siculars: good thing i got small stuff !!! [17:25] atmos: i've been meaning to do a twitter auth, been busy with work lately though :( [17:25] joshbuddy_ has joined the channel [17:25] creationix: siculars: node used to have promises and a special promise.wait() that did some crazy magic to turn async functions into sync functions [17:25] mape: a simple express app to try to proxy web requests to IRC ? [17:25] creationix: but it has some nasty side effects so it was removed [17:26] siculars: so im should look into integrating step , eh [17:26] atmos: map, basically you can post to a url and have a bot post that message to a channel [17:26] mape: Hmm k [17:26] Vladimir11: Hello, folks! Is there any console debugger for node.js, like "import pdb; pdb.set_trace()" in python? [17:26] mape: And that uses facebook how? [17:27] ncb000gt: mape: there is a node-oauth module, I hadn't gotten to using it this weekend tho [17:27] atmos: it just uses auth so you can create a few things and scope them to a user [17:27] atmos: mape so your stuff is separate from mine [17:27] mape: atmos: yeah I tried using the one from howtonode but that didn't work [17:27] mape: So modded it and got it working [17:27] atmos: yeah i wrote that stuff based on the howtonode article [17:27] atmos: iirc i mentiond it in the comments [17:28] mape: hehe [17:28] mape: but I wanna build my own wheel! It is going to be so round [17:28] creationix: ACTION is sad when he accepts articles for howtonode and then hears about how they don't work for people [17:28] mape: creationix: Guess it is just old [17:28] atmos: creationix: it worked at the time, but the example addressed 2 things [17:29] mjr_: node moves so fast that it is tough keeping all of the documentation up to date. [17:29] atmos: and as a result of being awesome and robust it didn't work later and was kinda confusing [17:29] creationix: I did add versions to the site now [17:29] atmos: i forked the dude's code and sent him a message, posted a comment, i feel like i did my part! :) [17:29] creationix: maybe I should put a warning at the top when an article falls behind [17:29] creationix: the little tags in the sidebar aren't very visible [17:29] mjr_: a warning sounds like a good idea [17:30] mjr_: Maybe use even larger avatar images if the article has fallen behind [17:30] creationix: lol [17:31] mape: atmos: any idea if you can use twitter oath in an iframe on a foreign site? [17:32] atmos: i don't think you'd want to [17:32] atmos: mape have you done an oauth app w/ twitter before ? [17:32] mape: I'm trying to make a small chat that allows users to iframe a domin.td/mychatroom [17:33] mape: and then auth through facebook and twitter [17:33] mape: on their own site [17:33] mape: atmos: I've used classes, never written one, or used in iframe [17:33] atmos: so only auth, no real api usage on behalf of the user ? [17:33] atmos: yeah, i'm not sure about the iframe, if it's auth'd on your site i'd guess you'd be fine [17:34] JimBastard: stupid backend team [17:34] mape: atmos: Well, yeah done that as well [17:34] mape: Just never written core oath stuff though [17:34] JimBastard: Vladimir11: there is node_debug [17:34] JimBastard: which is a web console debugger [17:34] atmos: mape yeah, you should be able to do that [17:34] JimBastard: but there is also the REPL and the console [17:35] sprsquish1 has joined the channel [17:35] atmos: if you wanna just focus on the app and use facebook for he time being i'll hook up twitter auth in the next day or so [17:35] atmos: if you beat me to it please hit me up here or on github so i don't duplicate effort :) [17:35] mape: atmos: I'll poke at it for the learning and then use yours if it works ;) [17:35] mape: You are doing it as an express module? [17:36] atmos: that's the plan [17:36] mape: neat [17:38] mrjjwright has joined the channel [17:44] mape: atmos: http://github.com/ciaranj/express-auth [17:45] mape: suppose to have at least working twitter [17:45] atmos: mape: awesome, that will be awesome if it's done [17:45] JimBastard: ive got a basic auth twitter module working [17:45] atmos: i've been holding out on doing that for a while now [17:46] atmos: JimBastard: link ? [17:46] JimBastard: one sec [17:46] atmos: oh, yeah [17:46] mape: damit everyone has one :P [17:46] atmos: basic auth is going away in like a month [17:46] JimBastard: http://github.com/Marak/twitscript [17:46] mape: oh no oath :/ [17:46] JimBastard: its a fork [17:46] mape: u [17:46] JimBastard: yeah oauth [17:46] JimBastard: need the oauth [17:46] JimBastard: ive been behind all week with this new job [17:46] JimBastard: :-( [17:46] atmos: JimBastard: yeah i think everyone is in the boat [17:47] JimBastard: must not get to work at 12pm with the wrong laptop, its killing my night time producativity [17:47] atmos: err, that boat [17:47] atmos: http://countdowntooauth.com/ :P [17:47] mape: nice site [17:51] binary42 has joined the channel [17:52] nsm has left the channel [17:52] creationix: ncb000gt: I added some basic package virtualenv to nvm [17:52] dekroning has joined the channel [17:53] ncb000gt: creationix: cool, i'll pull it down tonight [17:53] ncb000gt: been sidetracked with another big project [17:53] creationix: no problem, it's not much [17:53] ncb000gt: I'm gonna have to hack and slash the xmppjs code [17:54] bolson_ has joined the channel [18:00] N` has joined the channel [18:06] stepheneb has joined the channel [18:06] maushu has joined the channel [18:07] RayMorgan has joined the channel [18:07] sveimac has joined the channel [18:12] sh1mmer has joined the channel [18:18] stephenlb has joined the channel [18:18] mfeiri_ has joined the channel [18:21] nefD: are there any docs anywhere for all of the methods of the JSON object? I tried googling but filtering through the 12 trillion results in tiresome [18:21] kriszyp: there should be parse and stringify [18:21] deanlandolt: nefD: stringify and parse are all you need [18:21] mjr_: and also all you get [18:22] nefD: well.. so.. I have a fairly gigantic generated JSON object, and I need to filter through this gigantic JSON object and pull out either an array or a seperate JSON object containing only members which have a particular key value, and i'd prefer to not do it the hard way [18:23] deanlandolt: nefD: ummm...yeah, there's no such thing as a json object...that's just an object :) [18:23] mrjjwright: nefD: yajl-js pehaps [18:24] nefD: deanlandolt: erm- yeah.. sorry.. im in a bit of a code daze at the moment, thats what I meant :P [18:24] nefD: mrjjwright: Thanks, i'll check that out [18:24] mjr_: nefD: you can use Object.keys to convert all of the properties into an array, and then use the fancy array methods to filter it [18:24] nefD: mjr_: Hrmmm yeah.. thats a good idea [18:25] mjr_: So first make your giant JSON string into a real JS Object with JSON.parse(), and then start filtering it with the native JS methods. [18:25] mjr_: Once it becomes an Object, it is just JavaScript. JSON is merely a serialization format so you can easily move it over a network or disk or whatever. [18:26] deanlandolt: but as mrjjwright points out, it may be /too/ giant to buffer -- in that case, something like yajl-js perhaps [18:27] nefD: *nod*.. thanks for the help guys.. will be try and be a bit less dense before asking somewhat basic questions :P [18:28] deanlandolt: nefD: it's how ya learn -- i've learned more than i can remember by /other/ people asking these questions :) [18:28] mjr_: Oh, I hadn't considered the case of an object too giant to fit into memory. That is an interesting problem. [18:28] atmos: that's also a lot of text [18:28] nefD: I basically end up with an object formatedd version of an html page [18:28] nefD: so its not *transformer* huge, but its big [18:31] brianmario has joined the channel [18:33] JimBastard has joined the channel [18:33] JimBastard: why did i just get a voicemail that was a 3 minute conversation between a met life service agent and some random woman? [18:33] JimBastard: why do these things happen to me? [18:33] mape: JimBastard: Bad crowd? [18:33] JimBastard: like, i just got an entire copy of this service call for no reason [18:33] JimBastard: it has literally nothing to do with me [18:33] mjr_: as if your own service calls weren't bad enough. [18:34] JimBastard: i dont use metlife [18:34] JimBastard: i just dont get it [18:38] tlockney has left the channel [18:38] aho has joined the channel [18:39] gwoo has joined the channel [18:42] lifo has joined the channel [18:44] Aduros has joined the channel [18:46] _ry: 'lo [18:46] isaacs: _ry: 'i [18:46] mjr_: hey _ry, how goes the Sea of Bugs? [18:47] tmpvar: yop [18:47] tmpvar: yo* [18:47] JimBastard: sup tmpvar [18:47] tmpvar: howdy [18:48] tmpvar: whats good? [18:48] JimBastard: work work ill catch you on gchat later [18:49] mjr_: It seems like a lot more people are using node after the last release. jsconf publicity? better docs? [18:51] JimBastard: traction [18:51] JimBastard: it builds over time [18:51] JimBastard: also ive been telling literally every single CS person i know to use node [18:51] JimBastard: so i gotta assume at least 1 person is my fault [18:52] deanlandolt: i bet it has to do with rumors of impending stability [18:54] kriszyp has joined the channel [18:55] kriszyp: is there anyway to run node --debug and listen on a different interface than just the local (so I can connect to the debugger from another machine)? [18:56] JimBastard: kriszyp: there is a web console debugger, dont know if that counts [18:56] kriszyp: no, I want the real debugger [18:57] JimBastard: yeah, sorry [18:57] JimBastard: not sure [18:58] Aria has joined the channel [18:59] fictorial: neat: jefe is a "trending repo" on github: http://github.com/explore [19:00] kjeldahl_: I'm trying to combine a node http server with two-way messaging support, using node-router and faye. Looks simple (untested); http://pastebin.com/JhWu4Xw6 Better suggestions? [19:02] JimBastard: jefe looks cool fictorial i need something like that [19:03] JimBastard: ill probaly be testing it in a week or two [19:03] fictorial: JimBastard: thanks! great! break it! [19:04] isaacs: fictorial: jefe is neat. [19:04] _ry: mjr_: not changing the api :) [19:05] siculars: creationix: read through your post on step. and looked at your examples. so should i wrap db.save in a step? would that be the right place to put it ? (http://pastie.org/935806 line29) [19:05] _ry: mjr_: sea of bugs - still dealing with the sea of email [19:05] isaacs: fictorial: i'm glad you did this. now there's a url to send people to rather than just vague suggestions when they ask how to run in a sandbox [19:05] fictorial: isaacs: thanks, wanted to ask you in particular to try to break it. you had mentioned memory monitoring. that was a can of worms but if you wouldn't mind checking it out, I'd love feedback. [19:05] _ry: but it looks like we might have a fix to the 'long response' problem [19:05] creationix: siculars: yeah, that should work [19:06] mjr_: fictorial: do you crank down the memory usage with ulimit? [19:06] isaacs: fictorial: what happens when you try to make an infinite chain of objects? [19:06] tisba has joined the channel [19:06] mjr_: _ry: long response problem is really important to a bunch of people, even if they don't realize it yet. [19:06] fictorial: mjr_: no, I just look at a busy child process from the outside and if the memory grows too much, kill it. [19:07] isaacs: fictorial: something like this: var r = {}, c = r; while (true) { c = c.c = {} } [19:07] fictorial: isaacs: http://github.com/fictorial/jefe/blob/master/examples/while_true.js [19:07] fictorial: I think that covers your example in general - right? [19:07] isaacs: fictorial: no, that covers infinite loops, but not infinite object creation. [19:07] isaacs: fictorial: i don't know, but i suspect that you'll run out of memory before you run out of time. [19:07] fictorial: well, more generally, if the child does not respond within 'maxTime' it's dead [19:08] fictorial: you can make sure that the child does not use too much memory too [19:08] fictorial: 'maxMem' (or 'maxMemPercent') [19:08] Aria: Oof, _ry, I found a non-IO-related, non-JSON case for that bug from last night. "throw('Boo')" in one file, require('the other file') in a second. Goes boom with just node.js:164:9 [19:08] mjr_: mjr_: it seems like setting any and all available ulimits to conservative levels is the way to go when running untrusted code. [19:08] fictorial: isaacs: http://github.com/fictorial/jefe/blob/master/examples/kill_mem.js [19:08] _ry: mjr_: i believe it [19:09] mjr_: I sent a message to myself because someone was in my office and I was ignoring them while typing into IRC [19:09] martoche has joined the channel [19:09] _ry: Aria: can you update the issue and/or mailing list thread? [19:09] Aria: Sure thing [19:09] _ry: Aria: cause i can't look at it immediately [19:09] isaacs: fictorial: that's similar, yes [19:10] fictorial: ulimit is great of course. my thought with jefe was that if you can monitor usage you can _know_ why the child died other than trying to figure out _why_ v8 or node got an out of memory condition - your fault? script's fault? so jefe has its own ulimit then I guess you could say [19:12] mjr_: fictorial: yeah, that makes sense. I'd still want to set ulimits as a safety in case the explicit checks fail or get cleverly subverted. Maybe set ulimits to higher levels. [19:14] fictorial: you could do that as an ultimate safety net sure. to me, if the checks fail, that's a bug that must be fixed. [19:14] Aria: Of course, _ry. Issue 126. [19:15] fictorial: e.g. I don't know how to monitor the memory usage of a child process (not via process.memoryUsage) from the parent on OS X. Linux has /proc which makes it easy. So that's a bug that needs fixin' [19:15] fictorial: (but I use Linux for Node stuff so it's lower priority for now) [19:16] kriskowal has joined the channel [19:20] teemow has joined the channel [19:22] _ry: Aria: thanks [19:22] stepheneb has joined the channel [19:27] stepheneb_ has joined the channel [19:31] ayo has joined the channel [19:42] nefD: call me crazy, but i'd love to have a c style printf function in node :P [19:42] deanlandolt: nefD: crazy [19:42] tmpvar: i thought someone did that [19:43] tmpvar: i know i saw a gist at some point [19:43] ncb000gt: It'd be pretty easy to have. [19:43] deanlandolt: should be able to require something in [19:43] ncb000gt: err do [19:43] tmpvar: http://phpjs.org/functions/printf:494 [19:43] nefD: HMMMmmm [19:43] tmpvar: that is a decent starting point i believe [19:44] tmpvar: http://phpjs.org/functions/sprintf:522 -- rather [19:44] nefD: this'll be the second or third time i've knabbed code from phpjs, and each time I do I feel slightly dirty for doing so :P [19:44] felixge has joined the channel [19:44] felixge has joined the channel [19:44] charlesjolley has joined the channel [19:44] ncb000gt: lol [19:45] deanlandolt: nefD: next time you do that, just package it up as a commonjs module and push it to github...then nobody else has to feel as dirty :) [19:45] tmpvar: lol [19:46] tmpvar: we should just rip all that code into a php.js commonjs module ;) [19:46] tmpvar: remove the dom requirements and bam. [19:46] deanlandolt: wait...umm....nevermind -- they're building that in [19:46] deanlandolt: (commonjs compat) [19:46] JimBastard: if we are porting PHP, i must insist we change the function names [19:47] JimBastard: to something that makes sense if you arent an ADHD rhesus monkey [19:47] tmpvar: ha, yeah [19:47] tmpvar: maybe use objects? omgz [19:48] nefD: deanlandolt: I know nothing at all about proper packaging of modules or of making github projects, and i'd hate to make a fool of myself and/or create more work for anyone else who'd have to come behind me and clean up :P [19:48] kjeldahl_: Hey, it worked! Too easy.. ;-) [19:48] ncb000gt: also [19:48] ncb000gt: http://github.com/visionmedia/ext.js [19:48] ncb000gt: has printf [19:48] ncb000gt: it has much more, but printf is there [19:48] deanlandolt: nefD: no bother -- the phpjs team is doing that for you [19:49] mape: Anyone has a good suggestion for http://twitter.com/mape/nodejs ? [19:49] jedschmidt has joined the channel [19:50] mjr_: You mean a good suggestion for other twitter people to put on that list? [19:50] mape: yeah [19:51] mape: node related ofcouse :) [19:52] jazzychad: http://twitter.com/jazzychad/nodejs [19:52] mape: 500 people? [19:52] jazzychad: it autofollowed ppl that tweeted about node.js in some regard... it's not very well maintained, but you can use it as a base of ppl maybe [19:53] _ry: fictorial: are you chrooting your jefe processes? [19:53] mape: jazzychad: Hmm k I'll take a look, thanks :) [19:53] mjr_: mape: I think a useful service would be a more hand-curated list of node-related tweets. Everybody that works with node usually tweets about non-node related things. For some reason. [19:54] mjr_: Like how much they hate OSX, for example. [19:54] mape: hehe [19:54] jazzychad: mjr_: lol [19:54] cloudhead has joined the channel [19:54] mape: mjr_: Well yeah, just a tad to much work to do it, easier to just add good people [19:55] jazzychad: oh jeeze, doing a twitter search for "node" returns a gajillion links of drupal sites with "node" in the url [19:55] mape: #nodejs :) [19:56] jazzychad: well yeah, but not everyone uses the hashtag [19:56] jazzychad: otherwise you could easily use the streaming api and make a site like 4squarevision.com to stream the tweets to browsers [19:57] jazzychad: (which, of course, uses node in the backend) [19:57] mape: Should get a organized effort together, the play fun things community team and the ones that actually do proper stuff for node :P [19:58] creationix has joined the channel [20:01] ncb000gt: mape: probably want to add @polotek [20:01] mape: Done and done [20:09] rolfb has joined the channel [20:11] charlesjolley has joined the channel [20:14] bolson has joined the channel [20:15] admc_ has joined the channel [20:15] admc has joined the channel [20:15] admc__ has joined the channel [20:15] romainhuet has joined the channel [20:18] ncb000gt has left the channel [20:18] bmizerany has joined the channel [20:21] charlesjolley has joined the channel [20:25] mkovacs has joined the channel [20:27] ncb000gt has joined the channel [20:28] ncb000gt: mape: also prolly mikeal [20:29] mape: :) [20:29] maushu has joined the channel [20:37] sztanpet has joined the channel [20:41] mikeal: waht? [20:41] javajunky has joined the channel [20:41] javajunky: mape: how you getting on with that oauth [20:41] mape: javajunky: Killing myself, if I didn't have snus I would have been dead [20:42] javajunky: snus ? [20:42] javajunky: my client not working for you then ? [20:42] mape: ciaran_j? [20:42] javajunky: yeah [20:42] mape: ah not really.. Rather the module hassle, ./ __dirname kiwi() modulename [20:43] mape: And it is turning into a pile of mess with dirs with git repos and plugins and whatnot [20:43] javajunky: err you shouldn't need that, the oauth module itself shoudl be package agnositc. [20:43] mape: Well yeah, I'm to daft to make it work that way though, so I need something that I can look at and dissect [20:43] mape: make sence of [20:44] javajunky: so you do want the apckage stuff ? [20:44] javajunky: well all you need to connect to twitter can be gleaned from : http://github.com/ciaranj/node-oauth/tree/master/lib [20:44] mape: All I want is for the user to click the image, sparkly magic happens and I have their name, username and picture in session data [20:44] javajunky: and FROM http://github.com/ciaranj/express-auth/blob/master/lib/express/plugins/auth.strategies/twitter.js [20:46] mape: Thanks, I'll beat my head against it [20:47] kevwil has joined the channel [20:47] javajunky: well yeah my framework gives you that out of the box if you happen to be using express, but if you're not , just put a dependency on my oauth module (either kiwi or submodule it, then make a call to the 'GetOuahtRequestToken … once you've got this you have to redirect your user to http://twitter.com/oauth/authenticate?oauth_token= …. once the user has signed-in (or automatically if they're allready signed in with a cookie l [20:48] mape: I am using express, which makes it even more comical [20:48] javajunky: oauth2 will make this a lot simpler, but i don't think https clients are working in node.js just yet.. at least I can't see them roight now.. secured connections… really…. err my framework which isn't finished will 'just work' ? [20:49] mape: Hehe I seem to be able to break it [20:50] mfeiri_ has joined the channel [20:52] ncb000gt: javajunky: afaik oauth doesn't work with the streaming api yet correct? [20:52] ncb000gt: twitter specific [20:54] jazzychad: ncb000gt: correct, twitter streaming api still basic auth only [20:54] ncb000gt: i wonder when they plan to change that since they are doing away with basic auth [20:54] mjr_: then how are they dumping basic auth? [20:55] ncb000gt: mjr_: probably dumping basic auth for their main api [20:55] ncb000gt: and transitioning the streaming stuff over at some point [20:55] mjr_: The "REST" API? [20:55] ncb000gt: it's def clunky [20:55] ncb000gt: aye [20:55] javajunky: they're swapping to oauth2 for everything [20:55] mjr_: I actually really like Twitter's API, especially the streaming stuff. I just cringe every time I look at oauth, so I haven't done it yet. [20:56] WALoeIII has joined the channel [20:56] ncb000gt: mjr_: oauth is a pita, oauth2, from what i've read looks really simple as javajunky has said. [20:57] mjr_: oh, neat. I'll have to check it out. The user streams API is really great from what I've seen so far. [20:57] ncb000gt: they have done some nice things with it for sure. [20:57] ncb000gt: javajunky: i didn't know they were moving to oauth2, that's nice [20:59] javajunky: ncb000gt yeah as soon as node support https clients (easily) I'll push it out [20:59] javajunky: err I mean update my package to support it :) [20:59] ncb000gt: haha [20:59] mjr_: I thought openssl went in recently, and now life is good in https-land, no? [21:00] mikeal: it still takes some work [21:00] ncb000gt: lol, node-crypto was included into node, not sure that the client portion deals with https yet tho [21:00] mikeal: you can do https tho [21:00] ncb000gt: ahh nice [21:01] javajunky: yeah I figure I could if I manage the certs myself, I just figured someone brighter than me would be all over it like a rash :) [21:03] jedschmidt has joined the channel [21:08] rictic has joined the channel [21:11] fictorial: _ry: no chroot no (not yet?) [21:14] tekky has joined the channel [21:14] felixge has joined the channel [21:14] felixge has joined the channel [21:18] fictorial: _ry: would you chroot just to be safe? I mean, I don't think any user script should be given the facility to do any I/O. [21:19] mjr_: They might blow something up in an unexpected way that gives them access to the filesystem. [21:19] fictorial: wouldn't you want to do that at the node / app level when you fire up your service (that may use jefe)? [21:19] fictorial: or really just for the child processes? [21:20] fictorial: parent+children in chroot or just children in chroot? [21:20] jedschmidt: hey all, can someone point me to a good async template implementation? [21:21] kriskowal_ has joined the channel [21:21] mjr_: I'd try to put the children in chroot, personally. But the more that I think about it, it all depends on the consequences of somebody breaking it. Maybe just allocating a VPS for untrusted code is fine, and who cares if hax0rs find a way to mess with it? [21:21] deanlandolt: jedschmidt: i think mustache does async [21:21] fictorial: ok I'll look into chrooting the children then - there's no native binding in node for chroot already correct? [21:22] jedschmidt: deanlandolt: hmmm, maybe there are different definitions of async, [21:22] mjr_: I don't think so, but you probably want to write a C helper program that node starts which sets ulimits and then chroots. [21:22] deanlandolt: jedschmidt: well, there definitely are..but perhaps i'm wrong -- i haven't ever used it, just thought i'd read that somewhere [21:22] jedschmidt: deanlandolt: i'm looking at RayMorgan's mu right now. [21:22] JimBastard: Mu does async [21:22] JimBastard: thats the node port of mustache [21:23] jedschmidt: the functions in mu return values. [21:23] jedschmidt: that's not async, no? [21:23] JimBastard: ask RayMorgan [21:23] jedschmidt: aka taxed_value: function() { return this.value - (this.value * 0.4); } [21:23] jedschmidt: i mean, it may call it async, but the function itself needs to return. [21:24] deanlandolt: jedschmidt: rendering can be streamed [21:25] drostie has joined the channel [21:25] jedschmidt: deanlandolt: right, but if the functions themselves are sync it kinda defeats the purpose for me. [21:25] drostie_ has joined the channel [21:25] jedschmidt: it's funny how viral the async thing is... once you need it somewhere, you need it everywhere. [21:25] deanlandolt: jedschmidt: i thought you said that made things /easier/ ;) [21:26] jedschmidt: deanlandolt: ha ha. i eat async for breakfast. [21:26] deanlandolt: jedschmidt: what do you want the fns to return? promises? [21:26] jedschmidt: it's like the prisoners dilemma. all async is pretty easy, all sync is really easy. [21:26] jedschmidt: but the in between is a bitch. [21:27] jedschmidt: deanlandolt: streams. [21:27] kriskowal has joined the channel [21:27] jedschmidt: basically, i want to write the (fab) approach to templates. resig's stuff isn't great for that. [21:27] kriskowal has joined the channel [21:27] jedschmidt: i'm thinking of building an n-ary app, where the arity is the number of apps you pass it. [21:27] deanlandolt: jedschmidt: what's wrong w/ this? http://github.com/raycmorgan/Mu/blob/master/demo.js#L17-33 [21:28] jedschmidt: the ctx.taxed_value function is sync. [21:28] jedschmidt: i'm thinking that i'd build a template engine where the variable slots can only be (fab) apps. [21:30] deanlandolt: interesting -- i imagine you'll have to start from scratch there [21:30] jedschmidt: deanlandolt: yeah. [21:30] jedschmidt: deanlandolt: shouldn't be that hard, i think, [21:31] deanlandolt: perhaps not, given how many hundreds (or thousands?) of template engines there are :) [21:32] deanlandolt: the hard part: make lexing pluggable so you can support any syntax :D [21:32] jedschmidt: deanlandolt: i'd sidestep that entirely. [21:32] deanlandolt: how? [21:32] _ry: fictorial: yeah, just to be safe [21:32] ncb000gt: famous last words- "shouldn't be that hard" [21:32] _ry: just incase they figure out some way to jail break [21:32] Aria: The inbetween is a bitch without promises [21:32] jedschmidt: the syntax would look like this "{{0}} people are watching {{1}}" [21:33] jedschmidt: the engine would defer to each app for each slot. [21:33] deanlandolt: yeah...that's pretty slick [21:33] jedschmidt: ncb000gt: yeah, tell me about it. [21:33] deanlandolt: doesn't sidestep the syntax question...invariably someone's gonna bitch about the curly braces ;) [21:33] jedschmidt: well, since i'm not allowing arbitrary javascript, it should be easier. [21:33] deanlandolt: and you'll say..."what, mustaches are sexy...STFU" [21:33] kriskowal_ has joined the channel [21:34] jedschmidt: i mean, you could always define your own ala underscore's implementation. [21:34] jedschmidt: or better yet. [21:34] jedschmidt: i'll just use regexps replace syntax? [21:34] deanlandolt: everybody knows it [21:34] jedschmidt: "$1 people are watching $2 [21:34] Aria: [21:34] deanlandolt: since you're only supporting positionals, why not [21:35] jedschmidt: deanlandolt: that could be kinda hawt. [21:35] jedschmidt: and super-easy to parse. [21:36] jedschmidt: i wouldn't need buffers at all... each app would just dump straight into the resposne. [21:38] nefD: @all: Mape and I are thinking about a good domain name for a node news site.. would mainly focus around module releases & updates, but would also aggregate blog and news posts from related sites.. any suggestions? [21:39] jazzychad: nodenews ? [21:39] JimBastard: blarg developers call [21:39] jedschmidt: "in the node" [21:39] JimBastard: nefD: gotNode? [21:39] deanlandolt: inthenode...i like! [21:39] mape: In the node is neat, in the node how.. [21:39] JimBastard: getNoded [21:39] jedschmidt: "doncha node?" [21:40] jedschmidt: whoever gets get 10% of your adsense, okay? [21:40] JimBastard: nodejsownsyourface.com ? [21:40] nefD: "node news is good news!" ....:P [21:40] mape: nodejs-zune.com? [21:40] jedschmidt: "The Wonrdrous JimBastard's Node Menagerie" [21:40] nefD: intheno.de [21:41] bmizerany has joined the channel [21:41] mape: Sounds like a german death metal band [21:41] jedschmidt: nefD: that'd be awesome. [21:41] ncb000gt: nefD: that's prolly the best one so far [21:41] bmizerany has joined the channel [21:41] jedschmidt: ACTION rushes to namecheap.com [21:42] ncb000gt: tho it does have obvious other insinuations... [21:42] mape: nefD: Do you happen to be german? [21:42] mape: jedschmidt: they have de? [21:42] mape: Some eu contries have som messed up td rules [21:42] jedschmidt: mape: yes [21:43] jedschmidt: intheno.de AVAILABLE [21:43] hsuh` has left the channel [21:43] hsuh has joined the channel [21:43] JimBastard: terrible domain jedschmidt [21:43] mape: Hmm would people get the domain? [21:44] jedschmidt: mape: i think they would eventually. [21:44] mape: deli.cio.us [21:44] jedschmidt: people like my email address once they get it (tr@nslator.jp) [21:44] mape: Hehe that is neat [21:45] hsuh has joined the channel [21:45] jedschmidt: "hey i sent you an email to tr@nslator.com" AAAARGH [21:46] nefD: what about infono.de rather than intheno.de? [21:46] javajunky has joined the channel [21:46] jedschmidt: i am fond, of the entendre. personally. [21:46] mape: I like the pun of in the know (how) [21:47] mape: Hmm perhaps that isn't even proper english.. [21:48] JimBastard: yaaa towski time! :-D [21:49] mrjjwright has joined the channel [21:49] deanlandolt: my favorite entrendre...i have a shirt that says "condoms are for pussies"...it turns out it's a triple entrendre w/ an anti-gay message...now i feel like i should add an addendum: "(and for assholes too)" [21:51] mape: how rude [21:54] _ry: i've been thinking that node should be smarter about memory [21:54] _ry: for example: suppose someone wrote while (true) { puts("what"); } [21:54] _ry: that would spin v8 as fast as possible [21:55] deanlandolt: _ry: you're not proposing node solve the halting problem are you? :) [21:55] _ry: filling up memory with "what" because it couldn't push to console fast enough [21:55] _ry: i think node should sense that a certain buffer is getting filled [21:55] derbumi has joined the channel [21:55] _ry: and stop v8 [21:55] _ry: pause it [21:55] _ry: wait for the buffers to drain [21:55] _ry: garbage coolect [21:55] _ry: then continue [21:56] JimBastard: sounds problematic [21:56] deanlandolt: what's the downside to that? is there a lot of overhead in monitoring buffers? [21:56] _ry: it should know it's in bad shape and just stop what it's doing [21:56] _ry: not really [21:57] _ry: the down side is hitting situations where you'd rather thrash than stop accepting connections [21:57] deanlandolt: it could formally enforce the "don't buffer" ethos [21:57] _ry: or stop creating new data [21:57] deanlandolt: you're still accepting connections, though, right? [21:57] ncb000gt: it would queue them not drop them yea? [21:58] _ry: hm [21:58] deanlandolt: you can just tell them to cool off for a bit [21:59] _ry: it's a bit hard to break out of while(true) { puts('hello'); } [21:59] deanlandolt: it's impossible :) [21:59] _ry: well - i control 'puts' [21:59] javajunky: Sorry _ry, when's the next release scheduled for ? …also rather than me ask you all the time is there a magical page on the wiki I should know about ? :) [21:59] deanlandolt: http://en.wikipedia.org/wiki/Halting_problem [21:59] _ry: javajunky: release is every week [21:59] _ry: javajunky: approximately [21:59] javajunky: . [22:00] _ry: so, friday [22:00] javajunky: right cool, that'll do me, its Friday, unless it isn't … ;) [22:00] _ry: unless something is majorly broken [22:00] javajunky: (thx) [22:00] javajunky: cu. [22:01] _ry: i can just have puts check memory [22:01] _ry: if it is, i can start a new execution stack where i wind down the buffer [22:02] _ry: what i can't do (without a lot of tech) is preemtively interrupt while (true) { a++ } [22:02] deanlandolt: certainly not...but yeah, i see what you're saying -- that seems easy enough [22:02] mape: 2.0 friday? [22:02] _ry: no [22:02] deanlandolt: wouldn't you have to do that w/ all of your io though? [22:03] _ry: deanlandolt: yeah [22:03] _ry: maybe it's too tricky [22:03] _ry: but all my i/o basically sits on one thing [22:03] _ry: so i can insert some logic into every "write()" thing rather easily [22:04] isaacs_ has joined the channel [22:04] deanlandolt: if there's not much overhead in checking memory that doesn't seem so bad... [22:04] _ry: well - it's a system call at best [22:04] deanlandolt: better to slow things down a bit than barf at a memory limit [22:04] mape: God damit :/ The germans! Reason for Cancellation : Contact(s) do not meet residency requirements [22:04] _ry: so they would need to be some caching involved [22:06] deanlandolt: what are the consequences of /not/ doing it? you just get further behind when you start swapping? [22:07] nefD: nooooo! [22:07] nefD: there goes our sweet intheno.de domain name =| [22:07] ncb000gt: lol [22:07] deanlandolt: well, actually, swapping would allow you to catch up -- but at the cost of, well, swapping :) [22:07] JimBastard: just get the germans on it [22:07] JimBastard: we've got a few hanging around [22:09] mape: JimBastard: They are in on it :/ [22:09] CIA-77: node: 03Jérémy Lal 07master * r14d1ab5 10/ (4 files): Apply unreleased upstream patch to support parse_mx_reply. - http://bit.ly/9YOMMV [22:09] CIA-77: node: 03Jérémy Lal 07master * r5caf53a 10/ (lib/dns.js src/node_cares.cc test/disabled/test-dns.js): Add support for MX queries in dns module, works with c-ares upstream patch. - http://bit.ly/b5FFyL [22:09] CIA-77: node: 03Jérémy Lal 07master * r0802326 10/ test/disabled/test-dns.js : test-dns so that NXDOMAIN does not rise errors - http://bit.ly/bSfzar [22:10] JimBastard: mr simpson, we are germans. we are from the land of chocholate [22:10] ncb000gt: o.0 [22:10] JimBastard: mmmm land of chocholate [22:10] JimBastard: spelling fail [22:14] joshr has joined the channel [22:17] darkf has joined the channel [22:23] steadicat has joined the channel [22:25] martoche has joined the channel [22:31] fictorial: _ry: sounds like you want the equivalent of lua's debug.hook [22:32] fictorial: er, sethook [22:37] _ry: fictorial: ? [22:37] fictorial: Lua has hooks that call back a function every time another function is called, when N lines of code have been evaluated, etc. If v8 had that you could somehow get out of while (true) { puts(...) } [22:38] fictorial: sorry, I was reading scrollback from an hour ago :) [22:40] hsuh: i think that's only easy because lua has a simple interpreter [22:46] pdelgallego has joined the channel [22:49] mjr_: _ry: for your while (1) puts() thing, I think you'll need to come up with a bufferable way to do puts that can exert backpressure. Once you have that, then you can enforce some kind of max buffer size for stdout and truncate anything new that's added to stdout beyond that size. [22:50] mjr_: But with the current API, there's an assumption that everything you puts will make it to stdout at some point, so you can't really enforce any max buffer size. [22:50] sudoer has joined the channel [22:51] _ry: mjr_: i can slow down the process though [22:51] gf3 has joined the channel [22:51] mjr_: sounds dangerous [22:51] _ry: while the tty catches up [22:52] _ry: maybe - but migth be cute [22:52] mjr_: IMO if you depend on everything that you puts() making it to stdout, then the current API doesn't work. [22:52] fictorial: JimBastard: this you? http://github.com/Marak/jefe Are you going to break it? :) [22:52] mjr_: or rather, it works, but only if you have a lot of memory. [22:53] mjr_: _ry: granted it would be very cute, but kind of anti-node, if you know what I mean. [22:53] _ry: i agree, it's less ideal for programs that need heavy control of thier i/o [22:53] mjr_: non-blocking, events, etc. [22:53] _ry: to buffer data [22:53] mjr_: Which is why people use node in the first palce. [22:54] _ry: but most people just want to print something to console [22:54] _ry: and they don't want to think about the kernel buffer possibly being filled [22:54] mjr_: yeah, and for those people, if their console output got truncated because they got into some fast loop, would they care? [22:54] _ry: you're saying just dump data? [22:54] mjr_: oh yes [22:54] _ry: i hadn't considered it [22:55] _ry: might be good [22:55] deanlandolt: mjr_: the same goes for other apis though, right? what about writing to a file? [22:55] mjr_: However, we need a way to reliably write a shitload of data to stdout [22:55] deanlandolt: mjr_: print :) [22:55] mjr_: But that probably needs the rest of the buffering stuff, drain, high water mark, etc [22:55] mjr_: or however you are going to solve this monster problem. :) [22:56] _ry: yeah, drain, etc [22:56] deanlandolt: would you really want file writes dropped arbitrarily? [22:56] mnutt has joined the channel [22:56] deanlandolt: like, ever? [22:56] mjr_: I would be sad if my files had corrupted data in them [22:56] _ry: deanlandolt: i guess you need to properly throttle your streams then [22:57] _ry: deanlandolt: not push too much to buffer at once [22:57] _ry: wait for drain [22:57] mjr_: My point is that puts is a console logging kind of thing, and if it backs up, I think the right thing to do is dump data. [22:57] deanlandolt: fair enough...doctor, it hurts when i ignore the api :) [22:57] mjr_: Do we get drain on stdout these days? [22:57] towski_ has joined the channel [22:57] _ry: mjr_: yea [22:57] mjr_: well shit [22:57] mjr_: Everybody wins. [22:58] _ry: but i'm not necessaraly talkign about stdout [22:58] _ry: any socket could fill up too much [22:58] mjr_: I do hope that we can do shell pipeline kind of things with node where writing to stdout is how the pipeline is throttled. [22:58] _ry: due to thoughtlessness [22:59] _ry: also - at what limit do you start dumping data? [22:59] mjr_: any http could fill up despite the programmer's best effort to listen for drain. :) [22:59] _ry: if your machine is out of rss? [23:00] freshtonic has joined the channel [23:00] mjr_: _ry: yeah, when to start dumping data is kind of problematic. I'm only suggesting it for the case of puts. But, I dunno, 1MB of data max? [23:01] deanlandolt: seems like the better punishment for not properly throttling is forced throttling, not a haircut for your data :-/ [23:01] mjr_: yeah, this is tricky business for sure. [23:02] _ry: i kind of like the idea of just saying "okay. stop. all you socket - just cool off for a few seconds" [23:02] _ry: like just stop everything [23:02] deanlandolt: _ry's idea about forced buffering may seem un-nodelike but if the alternative is lost data it seems way better [23:03] deanlandolt: yeah -- after all, it's operator error that got you into this mess in the first place, right? [23:03] _ry: it's definitely a lot harder to slow down the entire process vs. dumping data [23:03] mjr_: Now I feel like a heretic for suggesting that we dump data. [23:03] _ry: also - dumping data might only affect one part of the program where as slowing down everything will make it all slow. [23:04] deanlandolt: true, that one part could be logging -- who cares -- or it could be your backing data store...whoops [23:04] _ry: but it basically that's what you want to do right? [23:04] _ry: just chill out of ra few minutes [23:04] _ry: while the other side catches up [23:04] cruxst has joined the channel [23:04] _ry: although in a server you want to do that for just one connection - not the whole thing [23:05] jedschmidt has joined the channel [23:05] trochala has joined the channel [23:05] mjr_: The multiple connection case is what concerns me. I'd hate it if the whole 10K connections got slow because stdout, redirected to a file on disk, got slow. [23:05] mjr_: And all stdout was doing is logging. [23:05] _ry: mjr_: yeah [23:06] deanlandolt: true dat [23:06] deanlandolt: that's just a waste [23:06] _ry: maybe write() returns true if flushed to kerenel [23:06] _ry: false if buffered [23:06] _ry: and NaN if dumped [23:06] mjr_: ha [23:06] _ry: :) [23:07] JimBastard: fictorial: thats me [23:07] JimBastard: and i do break stuff [23:07] fictorial: good [23:07] JimBastard: but not anytime soon i think, im backlogged [23:07] JimBastard: stepping through our giant JS app here showing the junior dev why errant commas are death for IE [23:07] _ry: yeah, i think the logging example is really good [23:07] _ry: most people - are just going to write the log [23:07] mjr_: To be clear, I think there the dumping case shouldn't be something you stumble onto accidentally when you thought you were using a reliable API. But particularly with logging, there's a clear priority to the data, and logging data can often safely be dumped. [23:07] _ry: they're not going to check the return value of puts() [23:08] _ry: that doesn't make them bad programmers [23:08] mjr_: Yeah, checking the value of puts? That'd be really ugly. [23:08] mjr_: Plus, what do you do with that information? [23:08] fictorial: I should put a "try to break Jefe" page up on a Linode. Submit JS and run it through Jefe/Node. If someone gets root they get $100. [23:08] _ry: mjr_: dump data yourlsef [23:08] martoche has joined the channel [23:08] mjr_: fictorial: that sounds awesome, as long as you have an extra $100. [23:09] fictorial: heh [23:09] fictorial: tax writeoff! [23:09] mjr_: Form 1040A Section 12.3.2 Losses Due To Hacker Contents [23:09] fictorial: :) [23:09] mjr_: er, Contests. Tax joke fail. [23:11] mjr_: _ry: I think that for cases where node is copying from one socket to another, it is reasonable to make people enforce their own backpressure. If they blow up their memory because they did a shitload of writes that node buffered for them, oh well. [23:11] mjr_: But for logging, that's going to keep biting people where they wonder, WTF, node is slow when I go over 50 connections or whatever. [23:12] mjr_: not that I have any opinions on this issue. [23:14] deanlandolt: mjr_: i think it's better to bite with performance than byte with data loss/corruption ;) [23:15] deanlandolt: so what if people hit the mailing list with "WTF: i thought node was supposed to be fast" ... a simple RTFM with a link will clear that up [23:16] mjr_: The issue is that as resources are exhausted, something's got to give. The API for puts() doesn't make it obvious how to react. [23:17] mjr_: I guess if people complain about stdout buffering, we can just tell them to write their own logger that'll manage the buffering and dump data as necessary. [23:17] mjr_: Yeah, maybe that's better. [23:17] deanlandolt: exactly...stdout isn't really a logger anyway (though it's all i ever use!) [23:18] mjr_: I've worked on a couple of python-based server programs that have run into this exact same issue. [23:18] deanlandolt: what was done? [23:19] mjr_: If logging can't keep up, you gotta throw some of it away until it can. [23:19] deanlandolt: oh, well yeah -- but just logs [23:19] mjr_: Also, log in a different process. The Linux IO scheduler is not always good at handing out CPU to your process when you start doing tons of disk IO. [23:20] mjr_: Even though you might have 4 threads on a 4-way box, Linux ends up not scheduling all threads, even if you have work to do. [23:20] mjr_: But if you do the disk IO in a different process, then it works way better. [23:20] mjr_: So I've found. Maybe I was doing it wrong. [23:20] noonat has joined the channel [23:21] mjr_: But yeah, only throw away logging data if it backs up. That's the only workable backpressure strategy for data that's generated internally. [23:23] hassox has joined the channel [23:33] kriszyp_ has joined the channel [23:35] kriskowal has joined the channel [23:35] noonat: _ry: sorry for the blank pull request... one button click too many :P [23:35] steadicat has joined the channel [23:42] Noya_ has joined the channel [23:47] pkrumins has joined the channel [23:51] stepheneb has joined the channel [23:58] hassox has joined the channel [23:58] creationix has joined the channel