[00:09] isaacs: hey, anyone wanna have an opinion? [00:09] JimBastard: i'd like to have one, one day isaacs [00:09] isaacs: hehe [00:09] isaacs: so, npm needs a way to say "my package depends on postgres", for instance. [00:09] isaacs: but not referring to the npm "postgres" package, but rather an underlying lib or something [00:10] JimBastard: lol [00:10] JimBastard: olo [00:10] JimBastard: lol [00:10] isaacs: like a gzip lib would depend on their being gzip installed on the system [00:10] JimBastard: WELCOME TO DEPENDENCY MANAGMENT HELL MY FRIEND [00:10] JimBastard: :-D [00:10] polotek: isaacs: what are you trying to npm do about these dependencies? [00:10] isaacs: JimBastard: man, please. i've been here for years. i'm the king of this dump. [00:10] JimBastard: json.package doesnt have anything to do with this [00:10] JimBastard: hee hee [00:11] JimBastard: err [00:11] JimBastard: i mean [00:11] JimBastard: json.package doesnt have support for this right? [00:11] isaacs: no. [00:11] isaacs: well, kinda. but in actual reality, no [00:11] isaacs: only in the spec. [00:11] JimBastard: i would thinking extending the json.package spec is the idea [00:11] isaacs: which just kinda assumes you'll use magic orsomething [00:11] JimBastard: but how would you know if that lib is installed [00:11] polotek: that was my question [00:11] isaacs: right. [00:11] mscdex: maybe allow a pre-install test or something [00:11] mscdex: heh [00:12] JimBastard: you can catch the error and give a helpful message [00:12] isaacs: so, you *can* do that now [00:12] polotek: you don't want npm to try to install it right? [00:12] JimBastard: but the error might not be correct [00:12] isaacs: { "scripts" : { "preinstall" : "check-for-stuff.sh" } } [00:12] isaacs: or even { "preinstall" : "which gzip" } [00:12] isaacs: polotek: no, definitely nop [00:12] mscdex: that's what .deb does i think, has a pre-install and post-install step [00:12] isaacs: i'm talking about the kind of stuff that apt-get or yum or homebrew would be used for. c libs stuff [00:13] isaacs: mscdex: npm supports install, activate, deactivate, test, stop, start, and uninstall scripts, and "pre" versions of each. [00:14] polotek: isaacs: so you just want to let the user know if any dependencies aren't available? [00:14] isaacs: so it's already pretty easy to hook into the installation lifecycle wherever you need to [00:14] isaacs: polotek: right. [00:14] mscdex: stop and start? [00:14] isaacs: mscdex: it makes sense if it's a blog or something [00:14] isaacs: mscdex: stop would stop the server, start would start it, etc. [00:14] polotek: I think the package/module should be responsible for that [00:15] mscdex: what server? [00:15] isaacs: mscdex: the server you get when you do "npm install my-awesome-web-server-program" or whatever. [00:15] mscdex: hmm [00:15] isaacs: mscdex: basically, it's just a generic lifecycle script that npm can run for you easily [00:15] gwoo has joined the channel [00:15] mscdex: isn't that what "service" and "/etc/init.d/" are for? :S [00:16] isaacs: mscdex: eventually i'd like to have a hook where npm ties into /etc/init.d with a script that npm-start's all the started packages [00:16] JimBastard: do you guys think there is an utility in making an apache ab like / tsung tool in node? [00:17] JimBastard: probaly not [00:17] isaacs: polotek: so you're saying that the story should be "if you have external deps, check for them in a preinstall script"? [00:17] isaacs: polotek: as opposed to say, something like, { "external" : [ "git", "libgzip.h" ] } or something? [00:19] sh1mmer has joined the channel [00:19] mscdex: i would say yes [00:19] mscdex: because a preinstall script could check more than just file or package existance [00:19] isaacs: true [00:20] isaacs: but it's silly if a lot of packages have the same preinstall script that just does one thing over and over again. [00:20] isaacs: at that point, why even have a pm at all? [00:20] isaacs: i guess i'll punt on that feature for now, and deal with it if it becomes an issue [00:20] mscdex: well, you could limit it some by providing some handy checking functions [00:20] mscdex: like checking for file existance and stuff [00:20] polotek: isaacs: actually all I was thinking is that the package/module knows why and how it uses the package [00:20] mscdex: checking file size [00:20] polotek: it would be difficult to communicate context [00:21] tmpvar: _ry, i guess libeio still uses pthread's [00:21] mscdex: stuff like that -- that's what wpkg does, another project i help with [00:21] polotek: so that npm could do anything useful [00:21] polotek: besides say "I couldn't find these in the usual places" [00:21] tmpvar: it atleast checks for it in the configure step [00:21] isaacs: right [00:21] isaacs: ok, thanks, guyus [00:21] aaronblohowiak: can i modify the nodejs include path with an env var [00:22] mrjjwright has joined the channel [00:22] isaacs: aaronblohowiak: NODE_PATH [00:22] wilmoore has joined the channel [00:22] aaronblohowiak: isaacs: you are a scholar and a gentleman [00:22] isaacs: :) [00:22] isaacs: aaronblohowiak: note that $HOME/.node_libraries and $PREFIX/lib/node is *always* in the path [00:23] polotek: tmpvar: thanks for the info earlier. HasInstance is what I needed [00:23] cloudhead: what's the quick & easy way to convert a Buffer to a string? [00:23] isaacs: cloudhead: myBuffer.toString() [00:23] aaronblohowiak: isaacs: :-) cool [00:23] isaacs: cloudhead: or myString + myBuffer does it, too [00:23] cloudhead: isaacs: hmm, I must be having other issues then [00:23] sh1mmer: can anyone give me an example of using assert()? I was looking at the core test cases and I can't see where the output goes [00:23] isaacs: cloudhead: might want to specify the encoding there. buff.toString("ascii") [00:24] tmpvar: polotek, np [00:24] sh1mmer: is there some test harness I'm missing? [00:24] cloudhead: ok [00:24] isaacs: sh1mmer: the core tests are run by a python program that doesn't print the output unless the test throws [00:24] isaacs: sh1mmer: make test [00:24] sh1mmer: isaacs: bleh. anyway to do that in just javascript? [00:24] isaacs: sh1mmer: the output goes wherever errors go, stderr by default. the assert functions just throw an error if they fail [00:25] isaacs: sh1mmer: i usually just use asserts, and then do: node my-test-prograj.ms [00:25] isaacs: s/j.m/m.j/ [00:25] alexiskander has joined the channel [00:25] sh1mmer: isaacs: ok, I'm going to dork with it some more then [00:25] sh1mmer: how's managing packages going? [00:27] wilmoore has joined the channel [00:29] tsyd2 has joined the channel [00:31] tmpvar: libeio just has to be a pain doesnt it. [00:31] JimBastard: tmpvar: like i use to tell my ex girlfriend about sex, if its not painful you aren't doing it right [00:32] tmpvar: and thats why she's an ex [00:32] tmpvar: baboom [00:34] tk has joined the channel [00:34] cloudhead: anyone know what's going on here: http://friendpaste.com/53E0QNtX8GRqnU5v7LUcju ? [00:34] cloudhead: it's thrown somewhere from JSON.parse [00:34] JimBastard: hrmm odd one [00:34] tmpvar: _ry, can we throw out libeio? [00:35] _ry: tmpvar: no [00:35] _ry: why? [00:35] cloudhead: wait no, not from json.parse, more like sys.print [00:37] tmpvar: _ry, half joking, but it looks like it relies on a pthreads_atfork [00:38] tmpvar: which is not covered by the win32 port of pthreads, fun :) [00:38] zomgbie has joined the channel [00:38] _ry: tmpvar: not really [00:38] _ry: i mean, it just uses that to empty the queue at fork [00:38] _ry: we can just ifdef that out [00:39] _ry: we're not going to fork anwyay [00:39] tmpvar: ah, got ya [00:39] _ry: oh i just saw your mingw paste [00:39] _ry: thank you [00:39] tmpvar: np [00:40] sh1mmer: isaacs: so just to be clear from what you said and reading the doc, assert doesn't output pass/fail, it just outputs fails [00:40] _ry: i think it should be able to comile without pthreads [00:40] isaacs: sh1mmer: true. on success, it does nothing. [00:40] tmpvar: as a heads up, there is some weirdness with paths in python/waf that i have sort of worked around [00:40] isaacs: sh1mmer: on faiure, it throws [00:41] _ry: tmpvar: node has its own versin of waf - so i think that shouldn't be necessary to install it [00:41] _ry: ACTION boots up his windows thing [00:41] _ry: it'd be great if i could ssh in [00:41] _ry: i wonder if there is someway to ssh into msys [00:41] tmpvar: _ry, you can.. i think you have to simply install openssh [00:42] sh1mmer: isaacs: thanks. [00:42] tmpvar: _ry, atleast i think you can. hrm [00:45] tmpvar: http://sshwindows.sourceforge.net/ -- not sure if the PATH will be setup correctly. it may? i'm not sure how jumping between cygwin / mingw could be healthy [00:50] _ry: i'm reinstalling to avoid cygwin corruption [00:50] ceej_ has joined the channel [00:51] tmpvar has left the channel [00:51] tmpvar has joined the channel [00:52] dgathright has joined the channel [00:52] tmpvar: _ry, according to schmorp, libeio will not compile under windows (it's not supposed to work, really [00:52] tmpvar: (windows doesn't support 99% or so of the required api) [00:53] wilmoore has joined the channel [00:53] _ry: ithink i can fix it [00:53] rictic: Should I be able to use a try/catch to catch errors thrown by net.Stream.write? http://pastie.org/963188 [00:54] _ry: tmpvar: what does he mean though? :/ [00:55] tmpvar: not sure exactly, he's in #schmorp if you want to dig deeper heh [00:55] mattly has joined the channel [00:56] mumrah_ has joined the channel [00:56] mumrah_: anyone know how to pass an array of arguments to a function? [00:56] mumrah_: like func(*args) in python [00:56] rictic: function.apply(null, array) [00:56] mscdex: .apply [00:56] mscdex: heh [00:57] rictic: (the first argument to apply is the "this" value for the body of the function) [00:58] mumrah_: thank you [00:58] mumrah_: not sure why i didn't think of that [00:58] JimBastard: THUUUUNNNNDERRRR HOOOOOOOO [00:58] JimBastard: :-D [00:59] tmpvar: _ry, to what extent do we use libeio? [01:00] dgathright has joined the channel [01:02] tylerstalder has left the channel [01:03] tylerstalder has joined the channel [01:05] mscdex: what's the best way to create a static read-only js object with v8? [01:05] mscdex: that's a property of a class [01:06] rictic: seal and freeze aren't supported in v8 yet, but I guess you could create a a getter but no setter [01:06] rictic: http://wiki.github.com/ry/node/ecma-5mozilla-features-implemented-in-v8 [01:07] mscdex: in c++? [01:07] dgathright_ has joined the channel [01:08] mscdex: what i'm trying to do is have a property that is a hash/object containing a bunch of constants that are determined at runtime [01:08] rictic: Ah, I'm not sure then [01:12] Tim_Smart has joined the channel [01:12] rictic: Does anyone have any advice on writing to a socket that might be closed? [01:13] ditesh|cassini has joined the channel [01:19] jedschmidt: _ry: have you considered bringing the require statement more in line with the filesystem APIs? specifically, require( name ) and requireSync( name, callback ), where the callback becomes the `exports` object in the module? [01:19] _ry: jedschmidt: not really [01:20] tmpvar: _ry, I honestly think we can link against visual studio's libc.lib and be fine with some of this [01:20] tmpvar: *some* [01:20] rictic: http://github.com/ry/node/issues/issue/146 created - attempting to write to a closed socket throws an uncatchable error [01:21] jedschmidt: _ry: i guess async require isn't really a priority for you. i'm ending up building it myself, but it seems like something that would be better off in node-land. [01:22] _ry: tmpvar: i think so too [01:22] _ry: tmpvar: i understand pretty well how libev and libeio work - it's not beyond our ability to modify them [01:22] alexiskander has joined the channel [01:22] _ry: "pretty well" [01:23] _ry: ;) [01:23] tmpvar: heh heh [01:23] _ry: jedschmidt: there is require.async() [01:23] tmpvar: i love how he just completely shut me up, instantly [01:23] tmpvar: ACTION cries in the corner [01:23] Aria: Oh, speaking of modifying to suit node, did 0.1.94 modify the DNS library? [01:24] _ry: tmpvar: that's his style [01:24] _ry: he's allowed to because he puts out really great code :) [01:24] tmpvar: haha, well good for him [01:24] _ry: for free :) [01:24] _ry: Aria: not that i remember [01:24] tmpvar: anyhow, we shouldnt use cygwin if at all possible [01:24] _ry: okay [01:24] _ry: i agree [01:25] _ry: mostly because porting v8 to cygwin sounds painful [01:25] Aria: Huh. I had trouble building with a system copy. I'll have to dig. Something about MX parsing if I remember. [01:25] Aria: Oh, ew. Yeah. That and the whole trying-to-be-something-it's-not of cygwin [01:26] _ry: i already maintain the solaris port - i don't want to add another [01:27] _ry: it'd be so great to run natively on windows [01:27] _ry: i don't really care if unlink doesn't behave exactly as it should [01:28] jedschmidt: _ry: the author of a module has no control over when the require.async callback is called, right? [01:28] tmpvar: _ry, why do we have deps for libev and libeio? [01:29] _ry: jedschmidt: not really [01:29] _ry: tmpvar: node sits pretty heavily on both [01:29] tmpvar: k, i'll have to spend some time digging [01:30] _ry: tmpvar: libev is an event loop abstraction - so we don't call select() directly [01:30] saikat` has joined the channel [01:30] tmpvar: got ya [01:30] _ry: on diferent platforms we compile to different i/o demultiplexers (or whatever they're called) [01:30] _ry: e.g. epoll on linux [01:30] tmpvar: for sockets/pipes/fds, correct? [01:30] ditesh|cassini has joined the channel [01:31] _ry: yes [01:31] _ry: libeio is used for all the file system io [01:31] _ry: blocking syscalls [01:32] _ry: it's a thread pool [01:33] _ry: tmpvar: http://s3.amazonaws.com/four.livejournal/20100516/arch.png [01:34] tmpvar: thanks [01:37] _ry: tmpvar: can you link me to your gist with the mingw stuff? [01:37] _ry: i lost it [01:37] _ry: found it nm [01:41] mrjjwright has joined the channel [01:50] JimBastard has joined the channel [01:50] JimBastard: does anyone know if there are any http benchmarking / stress testing tools written in node yet/ [01:52] softdrink has joined the channel [01:52] tmpvar: avi flax wrote one and put it on the ml [01:52] softdrink1 has joined the channel [01:52] jedschmidt has joined the channel [01:53] JimBastard: ohh yeah [01:53] JimBastard: i thought i remember hearing about one, brb [01:54] JimBastard: http://github.com/tautologistics/node_loadtest [01:54] mumrah_ has joined the channel [01:55] JimBastard: THUUUNNNDDEERRRR HOOOOO [01:58] cezarsa has joined the channel [01:59] JimBastard: has anyone tried to do any R bindings for node [01:59] JimBastard: does that even make sense [02:01] matthew_y has joined the channel [02:01] dgathright has joined the channel [02:02] cezarsa: hey guys, quick question, once I open a connection with http.createClient() and client.request() is there a way to forcibly close this connection without waiting for the server to finish sending data to us? [02:03] cezarsa: btw, I'm really new to node.js [02:03] cezarsa: and I'm finding it ultra awesome [02:03] JimBastard: hello [02:03] JimBastard: can you call .end() [02:03] JimBastard: or .close() [02:03] polyrhythmic has joined the channel [02:04] cezarsa: end() on who? request.end() doesn't seem right [02:05] cezarsa: client.end() ? [02:05] Aria has joined the channel [02:06] JimBastard: request.end() Finishes sending the request. If any parts of the body are unsent, it will flush them to the stream. If the request is chunked, this will send the terminating '0\r\n\r\n'. [02:06] JimBastard: http://nodejs.org/api.html ? [02:06] mikeal has joined the channel [02:06] JimBastard: hey cezarsa just wondering, where did you hear about node [02:08] cezarsa: yeah, I'm already doing that to send the request to the server, my question is, what if the sever doesn't close the connection after that and keeps streaming data to me? calling request.end() won't help because my request has already been finished, I'm just receiving data now [02:08] mumrah_ has left the channel [02:08] JimBastard: ? [02:08] cezarsa: I heard about node.js in some blogs, mainly after doing some research about websockets [02:09] JimBastard: what do you mean if the server doesnt close the connection? [02:09] JimBastard: you just called .end() [02:09] JimBastard: thats it [02:09] _ry: tmpvar: what is msysCORE-1.0.14-1-msys-1.0.14-src.tar.lzma [02:09] polotek: cezarsa: it sounds like you're using http client to send a request to a remote server [02:09] cezarsa: polotek: yep [02:10] JimBastard: proxy? [02:10] cezarsa: the problem is that this server (actually twitters streaming API) [02:10] polotek: request.end() doesn't close the connection to the server [02:10] JimBastard: ohhh [02:10] polotek: it just signals that your initial request is finished [02:10] cezarsa: yeah, I figured that out [02:10] _ry: tmpvar: and more importantly - what does one do with that? [02:10] polotek: then the server will start the response [02:10] polotek: at which point your should only be dealing with the response object [02:11] cezarsa: oh right, so I can end() the response object? [02:11] JimBastard: cezarsa - this might help a little http://github.com/technoweenie/twitter-node [02:11] tmpvar: _ry, extract into c:\msys\1.0 [02:11] JimBastard: that should be node implementation to talk to twitter streaming api [02:12] mumrah_ has joined the channel [02:13] tmpvar: that may just stream until you control^c if though [02:13] tmpvar: s/if/it [02:13] mumrah_: anyone have experience processing a high volume of keys with redis (via node.js) [02:13] polotek: come to think of it [02:13] cezarsa: JimBastard: cool, I'll check that out, I'm trying to do something similar except that it's using the new users streams API and exposing it as a websocket connection [02:13] polotek: it's not in the api that you can call end() on response [02:13] JimBastard: word [02:13] cezarsa: something like twitter streaming API -> node.js -> Websockets -> Some browser [02:14] polotek: http://github.com/polotek/evented-twitter [02:14] JimBastard: yeah when i first started i didnt read any of the docs, i just debug.log() every single object [02:14] polotek: cezarsa: that's my version [02:14] polotek: it's pretty similar to twitter-node at this point [02:14] polotek: but I plan to do some different things with it [02:15] polotek: let me try response.end(). I don't think I ever have [02:15] deanlandolt_home has joined the channel [02:16] cezarsa: polotek: I can see in the docs that there's a response.pause(), but it doesn't seem to really close the connection [02:18] SvenDowideit_ has joined the channel [02:18] JimBastard: yo _ry im thinking about getting R to play nice with node. what you think about that? any utility? thinking of three approached : custom C module, tcpip to http://rosuda.org/Rserve/, or sys.exec to R binary. comments? [02:18] keeto has joined the channel [02:19] polotek: response should inherit from ReadableStream which has an end() [02:19] polotek: but I'm not sure what it does [02:19] polotek: in the context of an http response [02:21] cezarsa: polotek: I couldn't find this information about objects hierarchy in the docs, are they somewhere else? [02:23] Aria: They're mostly mentioned ad hoc, not prominently [02:23] polotek: yea, it's just stated in the api [02:23] polotek: "The response implements the readable stream interface." [02:25] cezarsa: polotek: oh yeah, saw that now, sorry, i'm just testing response.end() now, I'll let you know in a few seconds [02:25] polotek: TypeError: Object # has no method 'end' [02:25] polotek: don't bother :) [02:26] polotek: is _ry still around? [02:26] polotek: sounds like ClientResponse doesn't implement end() [02:26] polotek: and subsequently there's no way to close a response short of shutting down the server [02:26] polotek: unless I"m missing something [02:26] cezarsa: polotek: too late :) got the same error in here [02:27] JimBastard: i think hes working out some windows binary stuff with tmpvar [02:27] _ry: plhw_: hey [02:27] _ry: polotek: hey [02:28] JimBastard: _ry did you see my R question? [02:28] polotek: _ry: did you get that? http.ClientResponse doesn't respond to end() [02:28] cezarsa: polotek: what about a lower level interface (the socket or something) can't I have access to it and close it? [02:28] JimBastard: :p [02:28] polotek: what's the recommended way to close a response before the remote server does? [02:28] cezarsa: ACTION just trying to sys.inspect(response, true, 10) :) [02:28] mjijackson has joined the channel [02:29] _ry: JimBastard: someone already did some R integration [02:29] JimBastard: link? name? mailing list? [02:29] chakrit has joined the channel [02:29] polotek: cezarsa: you can try the net module [02:29] JimBastard: R is kinda hard to google [02:29] _ry: polotek: it's a readable stream it emits 'end' [02:29] polotek: tcp is more consistent then http [02:29] polotek: at least it was last time I heard [02:29] polotek: _ry: yeah but what if you're reading a stream and you wanna bail? [02:29] polotek: you'll never get the end event [02:30] polotek: JimBastard: haha [02:30] _ry: polotek: hm? [02:30] polotek: So is C and Go [02:30] polotek: the twitter streaming api never shuts down [02:31] polotek: it keeps sending "\n" as a keep-alive" [02:31] polotek: so currently there's no way to disconnect from it on the client end [02:31] JimBastard: i still dont understand why you cant just close the request [02:32] cezarsa: JimBastard: closing the request simply starts the process of sending it to the server [02:32] polotek: request.end() finishes sending the request and initiates the response [02:32] JimBastard: ahhhh [02:32] JimBastard: ohh hrmm [02:32] JimBastard: ACTION opens up the broodmother code [02:32] _ry: polotek: client.close() [02:33] _ry: polotek: does that work? [02:33] _ry: er [02:33] _ry: destroy [02:33] _ry: client.destroy() [02:33] polotek: yeah that's what I had been doing [02:33] _ry: or client.end() [02:33] cezarsa: _ry: that's not in the docs, but I'm just trying it now [02:33] scudco has joined the channel [02:34] polotek: _ry: so you'll get the "end" event from response once you call client.destroy()? [02:34] polotek: cezarsa: it's there [02:34] JimBastard: yeah, im not dealing with that right now [02:34] polotek: I'm using it [02:34] JimBastard: i always assume its responding [02:34] polotek: I think I just wasn't listening for end [02:34] polotek: JimBastard: for shame ;) [02:34] JimBastard: i mean [02:34] JimBastard: im reverse proxying a bunch of shit [02:34] JimBastard: it hasnt come up yet [02:35] _ry: polotek: if you client.end() i think yo'll get the 'end' event [02:35] mumrah_: does 23 seconds sound like a long time to average 10e6 floats? [02:35] mumrah_: i'm just playing around with redis+node [02:36] matthew_y has joined the channel [02:36] mumrah_: trying to get an idea for speed of processing large data sets [02:37] fictorial: mumrah_: let me know if you have any issues with the redis client [02:38] mumrah_: fictorial: will do - it'd be nice if mset would accept an array like mget does [02:38] polotek: _ry: not working for me right now [02:38] mikeal: where is the node mdns module? [02:38] polotek: but I'm in my twitter module which is non-trivial [02:38] polotek: I'll work up a simple test [02:38] fictorial: mumrah_: hmm, it doesn't? I'll double check a bit later. [02:38] mikeal: found it [02:39] polotek: I can call client.destroy() I don't get the "end" event [02:39] mumrah_: fictorial: not that i saw, could have been mistaken [02:39] polotek: the client request just hangs there waiting [02:39] cezarsa: polotek: just tried client.end() and it does't error, but it also doesn't close the connection nor fires the end event, trying destroy now [02:41] JimBastard: so what do we have to profiling tools? [02:41] JimBastard: for* [02:41] JimBastard: what do we have for profiling node scripts [02:43] fictorial: mumrah_: works ok me thinks. added this to test.js: client.mset([ 'a', 'b', 'c', 'd', 'e', 100 ], expectOK("testMSET")); // a=b, c=d, e=100 [02:43] chakrit has joined the channel [02:48] polotek: JimBastard: was wondering that earlier [02:51] justinlilly has joined the channel [02:54] JimBastard: sup [02:54] JimBastard: yeah polotek im thinking there are defintley ones for plain js [02:55] JimBastard: i think with some magic and new Date().getTime() can you profile [02:57] polotek: yeah I've been doing it the dirty way with new Date [02:58] bpot has joined the channel [02:58] tilgovi: anyone think there's enough value in an overlay swiss army knife for nodejs? I'm thinking something like http://overlayweaver.sourceforge.net [02:58] mfeiri_ has joined the channel [02:58] tilgovi: Like, should I be building this right now? [02:58] JimBastard: polotek: you wanna colab on a Prof.js? [02:58] JimBastard: i think i have a good idea or two in the pocket for this [02:58] JimBastard: i gotta assume someone has built this already for the browser though [02:59] polotek: quick google is turning up nothing [02:59] JimBastard: http://getfirebug.com/javascript [02:59] polotek: most things are integrated with a tool [02:59] polotek: firebug [02:59] JimBastard: yeah [02:59] JimBastard: there MUST be some good code in there [02:59] JimBastard: also, the prof should output data for R [02:59] JimBastard: :-) [02:59] JimBastard: as well as do A/B [03:00] JimBastard: ive done a bit or profiling work in java and php [03:00] polotek: not excited about crawling through code trying to rip out the profiling bits [03:00] JimBastard: well, a little [03:00] JimBastard: hee hee [03:00] JimBastard: im gonna grab some food and ill be back [03:02] erichocean has joined the channel [03:02] erichocean: I'm having trouble with Script.runInNewContext(): http://pastie.org/963283 [03:03] erichocean: I get "Error: No such module" with the above pastie [03:03] cezarsa: so only to let you know, client.destroy() did the trick, thanks a lot guys [03:03] erichocean: node --version is v0.1.33-187-g38041fc [03:03] polotek: cezarsa: did you get the "end" event? [03:03] cezarsa: client.end() actually also closed the connection, but left it in FIN_WAIT_2 state [03:04] cezarsa: nope, no end event [03:04] polotek: and your request ended? [03:04] cezarsa: http://gist.github.com/403347 [03:04] polotek: yeah I'm not getting it either [03:04] cezarsa: the request ended yeah [03:05] erichocean: I get the same "No such module" error when running the example in the docs [03:06] jedschmidt: hey, is there a global way to access require? global.require / process.require don't do it. [03:06] polotek: require should always be available in any context [03:07] polotek: odd that global.require doesn't work [03:07] polotek: but you shouldn't need it [03:07] smtlaissezfaire has joined the channel [03:07] polotek: _ry: definitely don't get an "end" event from streams, even when calling client.end() and client.destroy() [03:08] jedschmidt: polotek: well, i'd like to have a local var named require, but i guess i can't without losing it? [03:09] Aria: You could save it, jedschmidt ... foo = require; require = bar ... [03:09] jedschmidt: Aria: good point, thanks! [03:11] erichocean: okay, what's the deal with node versioning? [03:11] polotek: Aria: sweet [03:11] erichocean: I'm on commit 45948e054d13fdf8ae7c8bfd12d7da58c94666b9 [03:11] polotek: that works in the node-repl [03:12] erichocean: and it installs with node --version as v0.1.33-433-g45948e0 [03:12] erichocean: I thought we were at node v0.1.95 ? [03:12] Aria: erichocean: 0.2.0 will have a more stable API, 0.1.9x are leading up to that.; 0.1.33 is the older release with some more significant API changes [03:12] erichocean: well, 0.1.33 is broken for me [03:12] erichocean: how do I get a working node version [03:12] steadicat has joined the channel [03:13] erichocean: the examples in the docs don't even work [03:13] Aria: 0.1.95 or git head should be good. [03:13] Ned_: anyone know how to do comments in markdown?, or if it's even possible ? [03:13] Aria: I don't believe it's possible Ned_ [03:13] Ned_: :-( [03:14] Aria: erichocean: my recent git pull reads v0.1.95-1-g4e40e88 [03:15] mattly has joined the channel [03:15] erichocean: okay, the tagged v0.1.95 appears to be working [03:15] erichocean: thanks [03:15] Aria: There's a new release once a week right now. [03:16] Aria: So you don't get terribly far behind sticking to tags. [03:17] JimBastard: yeah polotek im not sure if there are any pure JS, JS profilers? [03:17] JimBastard: thats strange [03:17] polotek: _ry: do you want an issue logged? http://gist.github.com/403355 [03:18] polotek: JimBastard: usually you want more in depth profiling beyond what js can give you in the browser [03:19] polotek: which is probably why people end up going with something that can actually instrument the code [03:19] JimBastard: maybe targeting the browser isnt the best idea [03:19] polotek: agreed [03:19] JimBastard: im gonna try something with node [03:19] polotek: I tried looking into the v8 profiler [03:19] JimBastard: i think i can profile without touching v8 or C [03:19] polotek: but didn't have the brain power at the time [03:20] JimBastard: well, shitty profiling [03:20] polotek: http://code.google.com/p/v8/wiki/V8Profiler [03:24] isaacs has joined the channel [03:27] _ry: polotek: please [03:27] chakrit has joined the channel [03:28] JimBastard: NEW BOONDOCKS IS ON [03:28] JimBastard: wuuuuut [03:28] _ry: erichocean: your git repo probably hasn't pulled the tags [03:29] erichocean: yeah, I had to do git fetch [03:29] erichocean: it's weird that git pull doesn't pull tags by default [03:29] _ry: it must be an option... on mine it does [03:31] gwoo has joined the channel [03:31] admc has joined the channel [03:32] polotek: erichocean: it's an option to git fetch [03:32] polotek: you can probably set it in git config somewhere [03:32] polotek: mine doesn't do it by default either [03:32] smtlaissezfaire: git pull --tags [03:33] smtlaissezfaire: actually, git fetch --tags [03:35] wilmoore has joined the channel [03:36] tilgovi: can anyone explain to me how Buffer acquires a toString method? [03:36] tilgovi: I'd like to understand how to add toString to my own addon code objects [03:37] isaacs: tilgovi: just put a function called toString in the prototype [03:37] tilgovi: isaacs: I meant in the C++ [03:37] tilgovi: but, maybe I see what you're getting at [03:38] isaacs: same answer, different syntax :) [03:38] isaacs: check node_buffer.cc [03:38] tilgovi: yah, that's what I'm looking at [03:38] tilgovi: there's no toString...damn [03:39] tilgovi: ahh..it's in the js [03:39] tilgovi: calls into the slice functions [03:40] polotek: _ry: http://github.com/ry/node/issues/issue/147 [03:41] polotek: tilgovi: yeah you have to look in three places for methods in an addon [03:42] polotek: C++ functions [03:42] polotek: js functions added subsequently [03:42] polotek: and inherited objects [03:42] tilgovi: ACTION nods [03:42] PyroPete1 has joined the channel [03:42] polotek: in herited in js or C++ :) [03:43] polotek: so technically 4 places [03:44] polotek: tilgovi: a bit of advice, do some memory profiling on your addon code [03:44] polotek: it's easy to leak memory if you don't handle the transition between js and C correctly [03:44] tilgovi: haha. funny you should say that. my mind was just wandering to buffer pools [03:50] tilgovi: but you pulled me out of it thank god. premature optimization kills me every time. [03:52] mikeal: _ry: this mDNS modules is seriously hot [03:52] mikeal: er module [04:04] alexiskander has joined the channel [04:08] polotek has left the channel [04:12] nsm has joined the channel [04:32] avidal: hrm [04:32] avidal: anything fancy going on in the node world [04:33] chilts: ACTION read that as 'nude' world [04:33] avidal: probably should subscribe to the list [04:35] Aria: Lots of shiny in nodeland. [04:35] Aria: But sometimes all you notice is the woosh as it goes by, 'cause it's so damn fast. [04:36] avidal: Thinking about picking up my mud project using node [04:36] avidal: Thinking about whether or not I should start with a websockets + web client implementation, or start with traditional telnet mode then perhaps start adding in web support [04:37] avidal: i can see some kick-ass web-based integration for builders and a map-viewer and such [04:37] Aria: Sure. I'd keep the core logic relatively separate so it's not hard to add other interfaces later! [04:37] Aria: Try to get into thinking event-orientedly. [04:38] avidal: Yeah, perhaps.. [04:38] avidal: A well-built web client would be pretty awesome [04:41] avidal: i'm also thinking about things like on-line creation that would be MUCH easier with a web-client [04:41] avidal: typically it's all text-based in telnet, but a proper web-client could detect you entering an edit mode and provide a proper UI [04:51] wilmoore has joined the channel [04:51] saikat` has joined the channel [04:57] foucist has joined the channel [04:57] foucist has left the channel [04:57] matthew_y has joined the channel [04:58] Aria: Woot! 28/465 failing in the html5 parser! [04:58] chilts: nice [04:59] Aria: Yeah! I'm getting into the seriously esoteric, picky cases now. [05:00] mape: Aria: does the ruby parser handle all those? [05:00] Aria: (foobarbaz -> foobarbaz
) [05:00] Aria: Yep. [05:00] Aria: I stole the test suite from the ruby parser. [05:00] mape: So you are just implementing the fallback stuff piece by piece? [05:00] Aria: And it passes all 465 [05:00] Aria: Yeah, debugging all the tricky cases -- it does serious magic to handle broken code. [05:01] mape: Hehe I can imagine [05:01] Aria: Amazingly clearly specified, too. The spec really rocks. [05:03] Aria: Heh, paying more attention to numbers: All 465 test cases parse in 580ms on my macbook. [05:04] Aria: (that's total, instantiating a new parser for each snippet.) [05:04] Aria: (but not reparsing the parser code, which _is_ big.) [05:04] Aria: I'm shocked at just how fast V8 is. [05:05] Aria: Roughly equivalent, the ruby test suite runs in 1.6s. [05:05] Aria: Though I found several cases I could probably make faster in the ruby code too. [05:05] aaronblohowiak has joined the channel [05:11] mape: Nice [05:11] Aria: That's what I said! [05:11] mape: Can't wait to hook that into jsom, get jQuery working so one can do some nifty parsing of websites [05:12] mape: How big are those test cases? Small snippets with errorous code or entire large "real life like" pages? [05:13] tilgovi has joined the channel [05:13] Aria: Small snippets. [05:13] Aria: Some large, like 1K or 2K, but not many. [05:14] mape: Would you be able to time parsing something like techcrunch? [05:14] Aria: Sure. [05:15] mape: And if possible http://aftonbladet.se/ [05:17] azeroth: All hail to the fail before you inhale just remember to exhale before chasing that tail with a sail. [05:18] Aria: 1.2s, including startup time. [05:19] mape: For techcrunch? [05:19] Aria: Yeah. [05:19] Aria: 3.2s for aftonbladet.se [05:19] mape: Not bad [05:19] Aria: Yeah, not too shabby, considering the size. [05:19] avidal: what are you working on aria? [05:19] avidal: just an html parser? [05:19] Aria: (I also wonder how many retokenizes I get from hitting the edge of the buffer at a bad time.) [05:19] avidal: turn it into a clean dom? [05:20] Aria: Yeah. HTML5-spec parser. [05:20] Aria: It can deal with some really insane code. [05:20] mape: Yeah just a html parser, I could throw that together in a couple of minutes using regex... ;) [05:20] Aria: (by the way, mape, aftonbladet.se caught a bug in the parser. thanks for that one.) [05:20] Aria: ACTION laughs. [05:20] mape: :) [05:20] avidal: haha, i didn't mean 'just' as in 'not a big deal' [05:21] isaacs has joined the channel [05:21] Aria: 5K lines of code later... [05:21] avidal: but 'just' as in, specifically an html parser vs a larger project! [05:21] Aria: Yeah, html parser as a separate project. I have some use cases in mind, but now I'm obsessed with this on its own right [05:21] mape: Those things tend to be more interesting since they can be used by other people is interesting projects [05:21] avidal: yeah [05:22] avidal: so, thinking more on a websockets-driven mud, i guess i should have multiple output modes, one in json, one in plain text [05:22] Aria: Okay, I guess I don't hate my API TOO much yet: var s = fs.createReadStream('tc.html'); var p = new HTML5.Parser(s) [05:23] Aria: That's it. You get a parse tree at p.tree after the stream has emitted 'end'. [05:24] isaacs: Aria: can you get intermediate events? [05:24] isaacs: tagStart, tagEnd, that kinda stuff? [05:24] Aria: yes, kinda. [05:24] isaacs: i mean, html kinda doesn't let you do that.. [05:24] Aria: HTML5 style parsing does some element re-arranging, so you can't get a truly linear stream. [05:24] isaacs: right [05:24] Aria: But I do have it in mind to emit elements as they're added. [05:24] Aria: (the tokenizer's inherently linear, so emitting there might work) [05:25] avidal: I'd imagine using something like couch would be appropriate also, versus flat-file storage [05:26] isaacs: Aria: also, is the parser node-specific or jsut javascript? [05:26] avidal: gonna need to eval() though for this to work! [05:26] avidal: since ideally admins would be able to write room/object/etc scripts in-game, and they would just be pure js, vs some dsl [05:27] Aria: Node specific, but honestly, emulating async IO as an event stream to do it in another JS engine would be trivial. [05:27] Aria: I intend to write that, but haven't yet. [05:28] sechrist has joined the channel [05:29] Aria: (It's so much easier to fake async with a sync engine than vice versa!) [05:29] isaacs: true that [05:29] Aria: (No promises needed!) [05:29] isaacs: being node-specific isn't bad. [05:29] isaacs: just curious [05:29] Aria: Yeah. I fully intend to make it work on rhino with env-js [05:30] Aria: The buffering code may have to be rewritten for that, and a fake event emitter made. [05:30] isaacs: what's with this bit? this.HTML5 = this; [05:30] Aria: Which file? [05:30] isaacs: http://github.com/aredridel/html5/blob/master/lib/html5.js [05:30] Aria: Oh, just stringing things together so that all the parts can add to their var HTML5 [05:31] Aria: I really don't like that part, it's just as close as I could get to the ruby implementation. I'll clean up the whole gross structure after I get the test cases passing. [05:31] isaacs: kewl [05:31] avidal: hrm, you can't eval() within a specific context? [05:32] isaacs: avidal: check out the stuff on process.binding("evals") [05:32] Aria: It just makes it so that require('html5').HTML5 returns the right thing. [05:32] isaacs: i see [05:32] isaacs: it'd be better to do exports.HTML5 = exports then [05:32] Aria: It ain't pretty. [05:32] Aria: Oh, sure. this and exports are equivalent in there. [05:32] isaacs: rather than rely on "this" being something specific, since it varies across commonjs impls [05:32] matthew_y has joined the channel [05:32] Aria: Ah, does it! [05:32] isaacs: and is unspecified [05:32] isaacs: yeah [05:33] Aria: Any idea which ones? [05:33] Aria: (sounds like something I should know) [05:33] isaacs: i think in narwhal it's either the global or the "module" object. [05:33] isaacs: it actually makes more sense to be the module object, imo [05:33] isaacs: so this.exports === exports [05:33] isaacs: and this.id === module.id, etc [05:33] Aria: Yeah, I agree. [05:33] isaacs: require(this.id) === this.exports [05:33] isaacs: but, others have argued that "this" should always be the global, or should be the global sometimes, etc. [05:34] isaacs: it's definitely not a unanimous specified position or anything [05:34] avidal: ah [05:34] avidal: processbinding('evals').Script.runInThisContext [05:34] isaacs: avidal: that's the one [05:35] isaacs: you can also use the process.binding("evals").Script class to do some creative things. [05:35] avidal: Yeah [05:35] avidal: mostly thinking to lock any user-written scripts (like mob or room scripts) to a specific context [05:36] avidal: so they can't go modifying player sockets for instance [05:36] avidal: vs writing a dsl for it [05:36] avidal: ah, more likely to use runInNewContext [05:36] avidal: with a context created out of basically the object the script is attached to [05:37] cij_ has joined the channel [05:38] avidal: does the filename argument matter for the script methods? I see it mentioned in the docs but it doesn't say what it means. [05:39] isaacs: avidal: it only matters if you care about useful debugging messages. [05:39] isaacs: avidal: it doesn't affect the execution at all, but it makes the stack traces better. [05:39] avidal: ah [05:39] avidal: so the stack trace can specify the 'filename' [05:39] isaacs: right [05:40] avidal: so i can use some arbitrary filename, like, for a room script, 'ctx-rooms-.js' [05:40] isaacs: i usually leave the .js off of virtual files [05:40] isaacs: but yeah [05:40] avidal: sounds good [05:40] isaacs: you'll note that stack traces eventually get down to "http:102:13" or whatever. [05:40] isaacs: that's the http module, like 102, char 13, but i'ts not an actual physical js file [05:41] avidal: sounds good [05:41] isaacs: (i mean, it IS, but it's statically compiled into the node binary) [05:42] avidal: I may start with porting an async python mud server to node and then work from there [05:42] avidal: perhaps use couch instead of fs storage, but i'm not set on that yet [05:43] avidal: maybe fs + redis, although redis is probably overkill in this case, since the persistence features aren't really necessary, it's mostly useful as a cache [05:43] Aria: One down, 27 to go! [05:44] isaacs: Aria: hey, this style leaks a global: http://github.com/aredridel/html5/blob/master/lib/html5/parser.js#L8 [05:44] isaacs: Aria: i think you mean "var Parser = HTML5.Parser = function HTML5Parser" [05:44] Aria: Oh, why yes, it does. [05:44] Aria: Nice catch. [05:44] Aria: (Aren't globals sealed off among modules?) [05:44] isaacs: Aria: nope. [05:45] Aria: Huh. I coulda sworn I tested that. [05:45] isaacs: Aria: all modules share a global space. they're just run inside a closure [05:45] isaacs: so you still gotta use var [05:45] isaacs: (or build your own module system that uses Script.runInNewContext, but that exposes a lot of sharp edges) [05:46] Aria: Huh. Weird. Wonder what I screwed up in my testing. [05:46] Aria: Thanks for the heads up. [05:46] isaacs: np [05:46] isaacs: this is a cool program. [05:46] Aria: Hehe, thanks. [05:46] isaacs: also, jesus christ, html is a HUGE freaking language. [05:46] Aria: Isn't it? [05:46] isaacs: like, DAMN. [05:46] isaacs: and i mean, it's not even a proper programming languag! [05:46] Aria: It's like a 100-line XML parser, plus 4900 lines of error handling. [05:47] isaacs: it literally can't do anything besides hello, world [05:47] isaacs: i mean, hello world with pictures, but still... [05:47] Aria: Hehe. Yep. [05:47] Aria: Once again, I start to think data is key. [05:47] pavelz has joined the channel [05:48] aaronblohowiak: HTML < XML [05:48] Aria: All of my favorite programs are big huge data structures and then code that's network or disk-bound. [05:48] Aria: I get less and less interested in computations of things, and more interested in how to connect and relate things. [05:49] Aria: Maybe I'm just a data geek at heart, and that's why I love parsers so much [05:49] isaacs: Aria: totally hear that. [05:49] isaacs: but html is like the most psychotic of languages. [05:49] aaronblohowiak: Aria: I am more interested in state machines and their transitions [05:49] isaacs: parsing natural english is less insane. [05:49] Aria: ACTION laughs. Not even hardly. HTML's just been abused so much that we now have to handle every possible failure gracefully. [05:50] isaacs: that's what i mean [05:50] Aria: ACTION laughs. You haven't parsed natural English much then ;-) [05:50] isaacs: i have! [05:50] Aria: ACTION giggles. [05:50] Aria: That shit is insane. [05:50] isaacs: it is [05:50] isaacs: and hello

world not bold!

isn't? [05:50] Aria: You should see the parser I wrote for the most natural-language wikimarkup you've ever seen. It's the ugliest crud I ever wrote. [05:51] Aria: ACTION laughs. That at least makes sense to me.  [05:51] isaacs: right, you have to turn that into hello

world not bold!

[05:51] isaacs: and the table stuff, and so on. [05:51] isaacs: it'snuts [05:51] Aria: Yeah. [05:52] Aria: Oh dear god. I haven't even touched list misnesting yet. [05:54] Aria: ... That was easy. [05:54] avidal: you did it in 1 minute 40 seconds? [05:54] Aria: Well, correcting already written code. [05:55] Aria: I spent nearly ten hours translating from Ruby, the whole kit n' caboodle, before I ran any tests. [05:55] jsilver has joined the channel [05:55] Aria: Aside from a couple syntax errors, it actually ran ;-) [05:55] avidal: yeah i can see the change [05:55] Aria: Spent another ten hours solving all kinds of trivial problems, little things that my brain screwed up translating languages. [05:56] wilmoore has joined the channel [05:56] Aria: Then the last twenty or so on this project have been fixing the bigger crazier parts of the code, with the subtle off-by-one sorts of problems, early bailouts, the kind of thing where misnesting a loop will screw things up. [05:56] keyvan has joined the channel [05:57] jsilver: hey Keyvan [05:57] keyvan: yo [05:57] jsilver: we gotta make something on Node.Js [05:57] jsilver: someday [05:57] jsilver: let's read the jitters in this channel [05:57] jsilver: we will become node masters [05:58] keyvan: yeah we will... id rather contribute to node than rails quite frankly.... [05:58] keyvan: by using it, we're contributing... just need to find time. [05:58] keyvan: rails is like my moderately attractive girlfriend that makes me dinner and does my laundry.... [05:59] keyvan: and node.js is like the supermodel that gave me her number last week and im kinda hesitant to call her yet [05:59] keyvan: ;) [06:00] Aria: Heh, wow. Guess you know you're doing something right in the javascript world when Paul Irish follows your code. [06:03] avidal: ah, thought i recognized that name [06:03] avidal: not only from jquery, but someone linked his blog on reddit a few days ago [06:03] avidal: with that cool background effect [06:04] mape: He hid some nice css3/font/modernizer things [06:04] Aria: Hehe. Yeah. [06:04] mrjjwright has joined the channel [06:05] dgathright has joined the channel [06:07] micheil has joined the channel [06:08] avidal: one thing i really miss from python whenever i get into other languages is keyword arguments [06:08] avidal: as well as, of course, list/dict expansion [06:12] aaronblohowiak: avidal: keyword arguments? is that like named parameters? [06:12] avidal: yeah [06:12] aaronblohowiak: ah, cool. [06:12] avidal: def foo(a,b) and you can do: foo(b=1,a=2) if you want [06:12] avidal: or, def foo(*args, **kwargs) to support an arbitrary amount of positional args (no names) and keyword args [06:13] aaronblohowiak: you could do this in js [06:13] aaronblohowiak: but you're right. having it baked-in is nice. [06:13] mape: it is the same as doing function(args){mixin args and defaults} ? [06:13] mape: only perhaps not as clear [06:14] aaronblohowiak: and function.length is a lie [06:14] avidal: well yeah you could mock it in js, but it's not true named arguments [06:15] aaronblohowiak: avidal: right. also, no static analysis support =/ [06:15] tmpvar has joined the channel [06:20] aaronblohowiak: How do you know when to use eventEmitter and when to just store a bunch of callbacks? [06:26] aaronblohowiak: also, is Array.prototype.splice slow ? [06:28] dgathright has joined the channel [06:28] SubStack: slow is subjective [06:28] SubStack: not easily verified! [06:28] isaacs: aaronblohowiak: for what splice does, for most cases, no, splice is not slow. [06:29] isaacs: aaronblohowiak: if you're bound by the speed of splice, then something is very unique about your app. [06:29] isaacs: avidal: you can do foo({a:1, b:2}) [06:30] cij has joined the channel [06:30] aaronblohowiak: isaacs: good point. [06:30] quirkey has joined the channel [06:31] isaacs: aaronblohowiak: also, myArr.splice(0, 2, "a", "b", "c") is a lot clearer than myArr = myArr.slice(2).concat("a", "b", "c") [06:32] avidal: isaacs: yeah i understand that, but it still isn't quite the same! [06:32] avidal: it's not a deal-breaker though [06:32] avidal: so back to my MUD ideas! [06:32] isaacs: avidal: mud!! omg!! [06:32] isaacs: i was just talking about that with a friend of mine [06:32] isaacs: now that we have ncurses, we should write a nethack mud [06:32] aaronblohowiak: isaacs: totally. that makes sence. [06:32] avidal: i suppose it would be "easy" enough to support both standard telnet and websocket clients [06:32] isaacs: yeah [06:32] avidal: a char socket is one of two types, websocket or telnetsocket [06:33] avidal: only thing is that the gameloop needs to start a websocket server and a telnet server [06:33] aaronblohowiak: JimBastard_ is working on a zzt-based rpg [06:33] avidal: but once the client is connected, each socket type implements its own .send() methods [06:33] isaacs: i'll be impressed when i see the first pvp nethack [06:33] isaacs: first on node, that is [06:33] avidal: and it uses some standard format for specifying colors and stuff [06:33] isaacs: yep [06:34] avidal: perhaps some json that the telnet socket interprets as ansi codes, and the websocket one probably just sends straight through [06:34] isaacs: forget websockets [06:34] isaacs: just use tcp [06:34] isaacs: then add websockets as another layer later [06:34] lolninja has joined the channel [06:35] avidal: yeah true, probably easiest that way [06:35] aaronblohowiak: ahave you guys seen this: http://github.com/marak/zztmmo [06:35] technoweenie has joined the channel [06:35] isaacs: aaronblohowiak: yah, but that's like the opposite of what i'm suggesting [06:35] isaacs: i'm saying, play it on your terminal [06:35] isaacs: nethack-style [06:35] avidal: although if all of the socket writing methods used a standard format for the data, then it should be trivial to support a new socket type [06:36] aaronblohowiak: isaacs: aaaaah, i see [06:36] aaronblohowiak: so node is a tty host [06:36] smtlaissezfaire has joined the channel [06:36] isaacs: sorrrta [06:36] avidal: ch.sock is just a reference to a websocket or a tcpsocket [06:36] isaacs: but the client would be ncurses and a tcp client, and the server would be just a tcp server with a persistent map object [06:37] isaacs: i haven't gotten around to playing with the ncurses stuff [06:37] avidal: but a good websockets implementation could make for an awesome admin client [06:37] aaronblohowiak: ahhhh, that is neat [06:37] isaacs: screw all this web stuf [06:37] isaacs: too complicated. [06:38] isaacs: terminals and tcp, man [06:38] avidal: creation stuff like adding rooms and scripts and so on in an html ui vs text-based line editor.. [06:38] aaronblohowiak: avidal: a visual basic interface? [06:38] isaacs: hehe [06:38] avidal: lol [06:38] isaacs: avidal: what's wrong with just editing a json file? [06:38] isaacs: or a plain text file or something [06:38] avidal: well for instance, if you have builders [06:38] avidal: instead of giving them shell access [06:39] avidal: they can do editing in-game [06:39] cij_ has joined the channel [06:39] isaacs: feature creep. stop it [06:39] avidal: plus, some stuff is -way- easier in-game vs using vim [06:39] avidal: well those are standard features for a mud server [06:39] isaacs: no map editing in game. [06:39] isaacs: (at first) [06:39] avidal: i would even say it's a make-or-break feature, since pretty much every mud server supports olc [06:40] avidal: for instance, building out a zone is difficult if you are just editing text files [06:40] avidal: mostly for the layout, like exits and so on [06:40] isaacs: avidal: sure, eventually. but rome wasn't built in a day [06:40] avidal: whereas most mud servers support the 'dig' command, where you can type 'dig e' and it'll create a new room 1e of where you are [06:41] avidal: true [06:41] avidal: i guess you can get most of the core together using plain-text before you start dicking around with json dumps and on-line editing [06:42] avidal: maybe something like yaml to start with, since it's a bit easier to hand-edit than json, and is still fairly robust [06:44] avidal: o shi- [06:44] avidal: it's pretty late, i'm gonna head to bed [06:44] avidal: i might get started on some node-mud tomorrow [06:44] avidal: i created a git repo for it like months ago but haven't put anything there yet [06:46] mfeiri_ has joined the channel [06:47] isaacs: g'nite [06:50] dekroning has joined the channel [06:54] SamuraiJack has joined the channel [06:56] qFox has joined the channel [06:57] aaronblohowiak: isaacs: what would you think about having some form of continuous integration with npm, so we can automatically know what versions of node a project works with [06:58] isaacs: aaronblohowiak: it's actually very much in the plan. [06:58] isaacs: aaronblohowiak: that's why i built nave. [06:59] aaronblohowiak: ah, v cool. [06:59] aaronblohowiak: man, you're smart =) [06:59] isaacs: i mean, npm itself won't do that for you. but if you have a "test" script, then it won't be too hard to run it through nave in all different versions of node [06:59] isaacs: maybe something scriptable. [06:59] _cheerios has left the channel [07:00] erichocean has left the channel [07:00] aaronblohowiak: if npm had a webhook or offered to publish a stream of events, then someone else could build npm-status that could run CI and maintain the status of all packages across all versions of node. [07:00] isaacs: what i'm struggling with atm is how to deal with situations where you can get different dependencies that don't claim to work in the same version of node. [07:01] mfeiri_ has joined the channel [07:01] isaacs: aaronblohowiak: the registry is a couchapp, so it has the _changes stream [07:01] isaacs: mscdex: you around? [07:01] isaacs: mscdex: ncurses doesn't wanna build. [07:03] mfeiri__ has joined the channel [07:18] bmizerany: so why are .inspect and .inherits in the sys module? it seems like they might be better placed in a new module called 'objects' or 'models' or something the says it's for introspecting values and modifying them at the prototype level? [07:20] isaacs: bmizerany: you are not alone in this feeling. [07:20] isaacs: s [07:20] isaacs: but i think the overriding sentiment is "meh" [07:20] bmizerany: isaacs: oh good. I'm not in the deep-end on this. heh. [07:20] isaacs: we seem to not want a fancy "Class" helper thing [07:20] isaacs: and i think the conclusion is always that those two are pretty useful, and relatively simple, so may as well leave them in. [07:21] bmizerany: yeah. I understand that. but they are fancy class helpers. [07:21] isaacs: well, inspect is a fancy object inspector, which is a huge win for any env [07:21] isaacs: i mean, that's like half of what you DO when you're programming node. [07:21] isaacs: but inherits is definitely classy helper magic [07:22] mfeiri_ has joined the channel [07:24] bmizerany: isaacs: yeah. p() something I use a *TON* in Ruby too. when I saw that it was like christmas morning. heh. [07:24] isaacs: there used to be a sys.p. wonder if it's still there [07:24] bmizerany: isaacs: yeah. not worth battling. I was just wondering [07:24] bmizerany: isaacs: it is [07:24] bmizerany: I've been using it [07:24] isaacs: ah, kewl [07:24] bmizerany: that better stay! [07:24] bmizerany: :) [07:25] isaacs: i usually write a function that wraps sys.error around sys.inspect [07:25] bmizerany: isaacs: yeah. I was doing that for a long time before I say sys.p [07:25] bmizerany: *saw [07:25] isaacs: http://github.com/isaacs/npm/blob/master/lib/utils/log.js [07:28] bmizerany: isaacs: ah man. is there a "in a nutshell"/"cheatsheet" for ecma-262 out there? the only thing I can find is the pdf, which is meant more for implentation purposes, not users. [07:28] bmizerany: hard to search [07:28] kixxauth has joined the channel [07:28] SubStack: bmizerany: same! [07:28] SubStack: I hate that pdf [07:29] bmizerany: haha [07:29] isaacs: bmizerany: yeah.... um... i dunno, i usually go to the spec with any questions. mostly the Objects and Functions chapters. [07:29] SubStack: the spec is written with implementation in mind, not development [07:29] isaacs: bmizerany: apart from that, there are a few blog posts out there. and you can hang out in this room :) [07:29] bmizerany: it's wonderfully indepth, but I just want quick answers most of the time [07:29] isaacs: right [07:29] isaacs: "Wait, what's the third arg to Object.create for again...?" that kinda sfuff. [07:30] bmizerany: can someone explain what sys.inherits is doing? I'm trying to wrap my head around it; I mean, it's replacing the objects prototype? I had no idea you could do that. [07:31] SubStack: bmizerany: I like https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference though [07:31] bmizerany: SubStack: does that include their sugar stuff too? or does Core mean "no sugar"? [07:32] SubStack: the DOM stuff is separate at least [07:37] isaacs: bmizerany: pretty sure it has stuff that's not core es5: https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for_each...in [07:39] scudco has joined the channel [07:40] javajunky has joined the channel [07:48] ncursestest has joined the channel [07:48] ncursestest: hey, it's  working [07:48] mscdex: isaacs: i figured there might be a problem [07:48] mscdex: hehe [07:48] mscdex: :) [07:49] ncursestest: mscdex: got it sorted [07:49] ncursestest: this is isaacs [07:49] micheil: isaacs: this is mongodb awesomeness: http://gist.github.com/403510 [07:49] ncursestest: wee, ncurses [07:49] micheil: ncursestest: nice! [07:49] mscdex: what was the issue? [07:50] isaacs: mscdex: well, there were a few things that made it not compile right [07:50] isaacs: mscdex: and the test folders have some path issues, i'm finding, so i'll send another patch for that [07:50] isaacs: i assume it worked on some systems, but not mine, not tonight. [07:50] ncursestest:  [07:51] mscdex: heh crash? [07:51] isaacs: tried to exit with ^D [07:51] isaacs: forgot it's not ircii [07:51] isaacs: :) [07:51] mscdex: oh [07:51] mscdex: :) [07:52] isaacs: mscdex: http://github.com/isaacs/node-ncurses/commits/master [07:53] isaacs: micheil: neat. what's that showing? [07:53] mscdex: ah, ok i think i see why it didn't work now... [07:53] micheil: isaacs: the speed. [07:53] mscdex: i updated the repo from a windows machine [07:53] mscdex: :> [07:53] mscdex: so that executable flag must have been lost [07:53] isaacs: mscdex: interesting [07:54] mscdex: i'm guessing anyway [07:54] isaacs: windows has done nothing good for me ever. [07:54] isaacs: even windows on other peoples' computers messes me up by proxy. [07:54] isaacs: i swear [07:56] isaacs: mscdex: this is cool stuff. [07:57] Ned_: isaacs: did you win at that man -w issue ? [07:57] Ned_: ACTION should just look at the github project probably :p [07:57] isaacs: Ned_: oh yeah, should work now with what's in git [07:57] isaacs: Ned_: not pushed yet [07:57] Ned_: right [07:57] Ned_: pushed? [07:57] Ned_: you mean to npm ? [07:57] isaacs: fetch and then make install [07:57] isaacs: i mean, yeah, not published as a new version [07:57] Ned_: right [07:57] Ned_: :-) [07:58] isaacs: gotta run. [07:58] Ned_: later [07:58] isaacs: lmk if it dies in new ways. [07:58] mscdex: so github's fork queue is full of fail on chrome [07:58] mscdex: well, chromium i should say [07:59] micheil: mscdex: report it as a bug then. [07:59] micheil: #github or support.github.com [07:59] mscdex: i will [07:59] mscdex: their custom javascript markdown preview doesn't work under chromium either [08:01] hellp has joined the channel [08:02] xla has joined the channel [08:09] N` has joined the channel [08:26] jedschmidt has joined the channel [08:28] SvenDowideit_ has joined the channel [08:32] SvenDowideit has joined the channel [08:41] SvenDowideit has joined the channel [08:41] ineation has joined the channel [08:51] SvenDowideit has joined the channel [08:54] dekroning has joined the channel [08:56] SvenDowideit has joined the channel [08:59] zomgbie has joined the channel [09:00] Ned_: ah ha [09:00] Ned_: I found the npm bug :p [09:01] mape: treasure hunt? [09:01] Ned_: ah ha! [09:01] Ned_: victory! [09:02] Ned_: I should send isaacs a patch [09:03] markwubben has joined the channel [09:03] Ned_: Hmmm, so err, is there a fancy way to use github to do this ? [09:03] mape: fork fix pull request [09:04] mape: I'm awful at GIT though [09:04] derbumi has joined the channel [09:04] mape: Guess you could send a patch file as well [09:04] Ned_: oh, I know git really well [09:04] Ned_: just not github [09:04] mape: Ah hehe [09:04] Ned_: so err, [09:04] Ned_: ACTION forks [09:04] Ned_: is there some button for that :p [09:05] Ned_: oh, I see it :p [09:05] Ned_: oh, nifty [09:09] Ned_: okay, forked, pushed my commit [09:09] Ned_: just need to figure out the pull request stuff :p [09:09] maushu has joined the channel [09:09] maushu: http://ircgraph.mape.me/ [09:10] maushu: ORGY! [09:10] mape: Cross pollination [09:10] mscdex: Ned_: just click the Pull Request button at the top of the repo page :> [09:10] mape: maushu: http://jquerysocialgraph.mape.me/ from #jquery (takes a while to load..) [09:11] Ned_: yeah, I see :p [09:11] Ned_: mscdex: ta [09:11] Ned_: awesome, I show up on the little graph :p [09:11] mscdex: the ircgraph page has people cut off at the top of the canvas [09:12] mape: Yeah, haven't had time to fix it, doing other small projects [09:12] mscdex: oh [09:12] mape: http://gyazo.com/310d3b2577d7555818ef159e281926a9.png [09:12] Ned_: mape: is that still using my irc lib ? [09:12] Ned_: :p [09:12] mape: the jquery room [09:13] mape: Ned_: jup [09:13] Ned_: holy shit ... [09:13] mscdex: there's a minor typo on it too, it should be "to use your Gravatar" [09:13] Ned_: the jquery one is a monster1 [09:13] mape: :P [09:13] maushu: mape: You could link to the google cdn instead of hosting jquery yourself. [09:13] mape: Yeah I guess, just feels better to have it hosted on my own [09:13] mape: if I were to github it ofsite linking seems strange [09:13] Ned_: mape: how do I change my image on ircgraph.mape.me ? [09:13] maushu: LINK IT, your feeling don't matter. [09:14] mape: Ned_: use !register your@mail.td [09:14] Ned_: !register martyn@dollyfish.net.nz [09:14] DrFlaska: Registered: martyn@dollyfish.net.nz [09:14] Ned_: :-) [09:14] Ned_: cool [09:15] maushu: SubStack [09:15] maushu: Yay, back to the screen. [09:15] SvenDowideit has joined the channel [09:15] mscdex: !register mscdex@mscdex.net [09:15] DrFlaska: Registered: mscdex@mscdex.net [09:18] TomY has joined the channel [09:18] mscdex: quick question: how does one know which data type the "data" event for a stream will use? [09:18] mscdex: it says a buffer OR a string [09:18] mscdex: :S [09:20] Ned_: mscdex: doesn't it say based on the encoding ? [09:20] Ned_: or smoething ? [09:20] Ned_: ACTION vaguely recalls [09:21] mscdex: no, encoding is a separate thing [09:21] Ned_: oh .. right [09:21] mscdex: ACTION checks the net module... [09:21] derbumi has joined the channel [09:22] SubStack: maushu? [09:24] DracoBlue has joined the channel [09:25] ithinkihaveacat has joined the channel [09:26] Ned_: micheil: ? [09:26] micheil: baH? [09:26] Ned_: so you wrote websocket-server [09:26] Ned_: on npm [09:26] Ned_: it seems npm has a bit fail ,and I can't actually see where I could get source from ? [09:26] Ned_: is it on github ? [09:26] Ned_: ACTION was going to have a poke around :p [09:27] Ned_: ah duh [09:27] Ned_: http://github.com/miksago/node-websocket-server [09:27] Ned_: :p [09:27] micheil: Ned_: it's there. [09:27] Ned_: yup, just figured that out ;-0 [09:28] micheil: Ned_: whatcha need to know? [09:28] Ned_: oh, I was just looking for the source [09:28] Ned_: trying to work out which one was the one in npm [09:28] Ned_: it turns out figuring out you wrote it was enough to track it down [09:28] Ned_: I wanted to do some websocket stuff [09:28] Ned_: I figured I'd use the one in npm [09:28] Ned_: because that's easy [09:28] Ned_: :-) [09:29] micheil: Ned_: I'd appreciate feedback on how well it works :) [09:29] Ned_: cool [09:29] Ned_: well if I do anything useful [09:29] Ned_: I'll let you know [09:29] micheil: Ned_: I'm meaning to rewrite a section which is currently a memory / speed issue [09:29] micheil: (the storage of connections and routes) [09:29] Ned_: right, nothing I'm doing is likely to reach any speed limits :p [09:30] micheil: yeah, I think I've currently got some code that may be causing a slowcase [09:30] Ned_: I'd almost be tempted to try use it to write a web-based IRC client :p [09:30] micheil: Ned_: http://thenoded.com/ [09:30] Ned_: combine it with my module and some jQuery UI [09:30] micheil: Ned_: that's very doable. [09:30] Ned_: indeed [09:30] Ned_: and it'd be quite cool :-) [09:31] Ned_: in a not-terribly-useful-but-kinda-cool way [09:31] SvenDowideit has joined the channel [09:31] Ned_: my main goal is to make a file-tailer, but instead of outputting to a terminal, outputting to a web browser [09:31] Ned_: (over a websocket) [09:31] Ned_: and provide some nice jQuery magic to filter lines etc [09:31] micheil: Ned_: give it good logging support + good command support and it'd be very useful [09:31] Ned_: for use when doing web development [09:31] micheil: that wouldn't be too bad [09:32] micheil: Ned_: in future versions, the server.broadcast will be a lot quicker [09:32] Ned_: oh well, the documentation makes it seem pretty easy [09:32] Ned_: should I use "stable", or "latest" from npm ? [09:32] micheil: umm.. [09:33] SvenDowideit_ has joined the channel [09:33] micheil: damn. npm's buggered up for me [09:34] Ned_: heh [09:34] Ned_: micheil: I just put a pull request in to fix a bug I found [09:34] Ned_: but there's definitely a few others that need fixing ;-0 [09:34] micheil: damn, you're quick. [09:34] Ned_: I've been harassing isaacs about it :p [09:34] micheil: oh [09:34] micheil: wait! lol. [09:34] Ned_: heh, no [09:34] Ned_: I didn't just fix your bug ;-0 [09:34] Ned_: ACTION isn't that quick [09:34] Ned_: I found a bug to do with a custom binroot [09:34] micheil: I thought you meant websocket-server [09:35] Ned_: oh, no [09:35] Ned_: npm [09:35] Ned_: I can't push new versions to npm at the moment :-( [09:35] Ned_: not sure why, I don't get any failures [09:35] micheil: how do you uninstall npm? [09:35] Ned_: err, [09:35] Ned_: rm ~/.node_libraries [09:35] Ned_: was my technique [09:35] Ned_: a little heavy handed [09:35] Ned_: but it works [09:35] Ned_: :p [09:36] micheil: and as for the npm binary? [09:38] SvenDowideit has joined the channel [09:39] felixge has joined the channel [09:40] hellp has joined the channel [09:40] Ned_: micheil: oh, I just removed that manually [09:41] Ned_: micheil: I've been kludging around with npm so much, I've kind of got used to rm'ing stuff everywhere ;-) [09:41] micheil: ACTION is trying to do it [09:41] SvenDowideit_ has joined the channel [09:41] Ned_: :-) [09:41] micheil: just removed node in the process >_> [09:41] Ned_: oh noes! [09:41] Ned_: ACTION built a debian package for node [09:41] micheil: reinstalling, naturally. [09:42] Ned_: so that's reasonably nicely installed [09:42] Ned_: and easy to remove/upgrade [09:42] micheil: ACTION did contribute patches to homebrew for node, but it was too much to manage [09:43] javajunky: kiwi works atm ;) (for me) [09:43] micheil: I couldn't push to kiwi. [09:43] javajunky: really ? [09:44] javajunky: did you register a user [09:44] micheil: yes [09:44] javajunky: weird [09:44] javajunky: what happened [09:45] micheil: not sure [09:45] javajunky: that sucks :) [09:46] micheil: can someone build HEAD and run make test and tell me if they get an error in test-http-exception [09:46] javajunky: as long as you have an empty line at the bottom of your seed.yml it seems to work ok for me by and large :) [09:46] micheil: that also annoys me about kiwi, it requires that extra seed file. [09:46] javajunky: I juzt wish _ry would give the nod on an official one so everyone can join forces and sort out package management .. but I kinda get why he's not that pro. [09:47] javajunky: ;) it predates the package.json, but there is a branch to get package.json working. [09:47] micheil: ACTION won't push to kiwi until it uses package.json. [09:47] javajunky: *will keep pushing to things that work* ;) [09:48] mape: Feels like getting an "offical" one would be benificial [09:48] mape: The next step would be making sure all the developers add their packages [09:49] SvenDowideit has joined the channel [09:49] micheil: mape: we really need to have a proper web interface to it. part of something I'm working on will go towards that. [09:49] mape: npm that is? [09:49] nsm has joined the channel [09:49] javajunky: mape: any solution [09:49] franksalim has joined the channel [09:49] javajunky: (needs a proper web interface) [09:50] mape: Well yeah [09:51] micheil: mape: yeah, I'm looking at actually rewriting the server with mongo, because I think it'll work better with mongo [09:51] micheil: and from that I'm going to be adding a frontend [09:51] mape: Ah k, http://npm.mape.me/ [09:51] javajunky: I thought npm was sponsorder by couch ? [09:51] micheil: but the project I talked of is a different one [09:52] micheil: javajunky: currently it is couch [09:52] mape: What is so much better using mongo over couch? [09:52] SvenDowideit_ has joined the channel [09:53] micheil: because, mongo can store very no-relational data, meaning I just make the package.json the document I store in mongo [09:53] Ned_: micheil: does mongo do multi-master replication ? [09:53] micheil: and then I can implement all sorts of package finding stuff [09:53] micheil: Ned_: yes [09:53] Ned_: ACTION was playing with couch a while back, and it just wasn't "quite there" yet .... [09:54] Ned_: micheil: mongo is older/more stable ? [09:54] micheil: Ned_: master master, master master slave, slave master, etc [09:54] Ned_: ACTION starts reading ... [09:54] micheil: I guess it's more stable [09:54] micheil: it's used at sites like Sourceforge amongst others [09:54] Ned_: cool [09:54] micheil: imports like.. 358,000 records in < 33sec. [09:54] Ned_: nice [09:55] Ned_: and debian packages ;-) [09:55] micheil: yes [09:55] javajunky: I do like mongo .. I've a tutorial on using it with mongodv-native with express + node.js up on howtonode http://howtonode.org/ if you're interested http://howtonode.org/express-mongodb .. I'm updating it in a bit to talk abou tmongoose [09:55] Ned_: ACTION adds it to the list-of-shit-to-play-with [09:55] micheil: Ned_: grab them from the mongo repo though [09:55] Ned_: micheil: why ? [09:55] javajunky: http://www.learnboost.com/mongoose [09:56] micheil: because it's maintained by mongo, hence more up-to-date [09:56] Ned_: micheil: oh, you mean the mongo debian repo ? [09:56] micheil: http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages [09:56] micheil: yeah [09:56] Ned_: cool [09:57] Ned_: ACTION will have to play later [09:57] Ned_: ACTION is going to watch Simpsons now ;-) [09:57] micheil: haha :) [09:57] nsm has joined the channel [09:57] Ned_: priorities! [09:57] Ned_: :p [09:58] SvenDowideit_ has joined the channel [09:59] Tim_Smart has joined the channel [10:00] ineation has joined the channel [10:01] maushu has joined the channel [10:02] micheil: Ned_: npm install websocket-server [10:03] Ned_: you updated stable ? [10:04] mitkok has joined the channel [10:04] micheil: yes [10:04] Ned_: cool [10:04] Ned_: :-) [10:04] Ned_: ta [10:04] micheil: it should be 1.0.4 [10:11] felixge has joined the channel [10:11] felixge has joined the channel [10:11] mfeiri_ has joined the channel [10:12] felixge_ has joined the channel [10:12] felixge_ has joined the channel [10:35] botanicus has joined the channel [10:38] andrewhampton has joined the channel [10:43] MattJ has joined the channel [10:45] Ori_P has joined the channel [10:51] fermion has joined the channel [10:56] spoob has joined the channel [10:56] keeto has joined the channel [10:58] derbumi has joined the channel [10:59] SvenDowideit has joined the channel [10:59] samsonjs_afk has joined the channel [11:00] ineation has joined the channel [11:06] nsm has joined the channel [11:18] jedschmidt has joined the channel [11:19] stalled has joined the channel [11:28] pandark_ has joined the channel [11:34] olegp has joined the channel [11:41] saikat has joined the channel [11:44] cij_ has joined the channel [11:45] drudge has joined the channel [12:20] nsm has joined the channel [12:24] cij_ has joined the channel [12:24] ineation has joined the channel [12:30] tobeytailor has joined the channel [12:40] Ori_P_ has joined the channel [12:41] maushu: So, npm is the package manager of the moment? [12:41] felixge_: how do I cast a Local into an array in v8? [12:41] ashb: does Local a(my_val); [12:41] ashb: work? [12:41] ashb: modul typo [12:43] kriszyp has joined the channel [12:46] gwoo_ has joined the channel [12:52] nsm: felixge_: try ToObject() [12:52] nsm: v8 Arrays are just Objects [12:53] nsm: you can use integer indexing to get the elements [12:53] gsf has joined the channel [12:53] felixge_: nsm: I ended up using: Local a = Local::Cast(args[0]); [12:53] nsm: Local array = args[0]->ToObject() ? more sensible I think [12:54] jherdman has joined the channel [12:55] nsm: but then you'll still have to downcast to get the Length() method [12:56] Ori_P has joined the channel [12:58] Ori_P has joined the channel [13:00] felixge_: nsm: yeah, I need Length() [13:00] felixge_: nsm: adding some love to the buffer constructor right now [13:00] nsm: felixge_: that is odd, why have an Array type just for the length I wonder? [13:00] felixge_: nsm: arrays don't behave like objects in JS [13:01] felixge_: if you do: var a = new Array(); a[5] = 'test'; [13:01] felixge_: then a[0..4] will be initialized and set to 'undefined' [13:01] nsm: I meant in v8, why have the separation, perhaps you have a point [13:01] hassox has joined the channel [13:02] spoob: so a[549856349875498353] is a nice quick way to crash thing... [13:02] hassox has joined the channel [13:04] pgriess has joined the channel [13:05] ashb: spoob: shouldn't be [13:06] Ori_P has joined the channel [13:07] robrighter has joined the channel [13:11] sveisvei has joined the channel [13:16] jedschmidt has joined the channel [13:18] softdrink has joined the channel [13:18] thoolihan has joined the channel [13:18] jedschmidt_ has joined the channel [13:25] Ori_P_ has joined the channel [13:26] ditesh|cassini has joined the channel [13:27] jedschmidt has left the channel [13:27] kixxauth has joined the channel [13:33] peutetre has joined the channel [13:35] mjijackson has joined the channel [13:38] pandark_ has joined the channel [13:43] pjb3 has joined the channel [13:45] cij_ has joined the channel [13:50] bweaver has joined the channel [13:55] maushu: ☺ [13:56] mape: That is not allowed [13:58] pandark_: ⋅⌣⋅ [14:04] bpot has joined the channel [14:04] skeleton_jelly: i am a skull jelly? [14:04] skeleton_jelly: no! [14:04] skeleton_jelly: i am a skeleton jelly! [14:06] jan____ has joined the channel [14:06] ssteinerX has joined the channel [14:08] derbumi has joined the channel [14:12] ceej has joined the channel [14:13] fernmicro has joined the channel [14:14] wilmoore has joined the channel [14:15] mfeiri has joined the channel [14:16] ithinkihaveacat has joined the channel [14:17] melgray has joined the channel [14:18] maushu: BLOOD FOR THE BLOOD GOD! SKULLS FOR THE SKULL THRONE! [14:18] gf3 has joined the channel [14:18] pkrumins: IM SKELETON JELLY [14:19] maushu: BLOOD FOR THE BLOOD GOD! SKULLS FOR THE SKULL THRONE! [14:19] tmpvar has joined the channel [14:19] maushu: That reminds me. [14:19] maushu: I feel like coding a irc log parser to parse debuggable logs. [14:19] felixge_: maushu: what do you want to parse? [14:20] maushu: The logs. [14:20] maushu: Perhaps put a pretty view there, a search engine? [14:20] skeleton_jelly: I'm pkrumins [14:20] maushu: Something like that. [14:21] pkrumins: skeleton_jelly: didn't see that coming :D [14:22] felixge_: maushu: would be fun [14:22] felixge_: maushu: :) [14:22] bajeczka has joined the channel [14:22] Yuffster has joined the channel [14:24] mjijackson has joined the channel [14:30] wilmoore has joined the channel [14:30] robrighter has joined the channel [14:36] peutetre_ has joined the channel [14:36] tsyd2 has joined the channel [14:36] ncb000gt has joined the channel [14:43] Ori_P has joined the channel [14:43] ssteinerX has joined the channel [14:44] _cheerios has joined the channel [14:45] maushu: felixge_: ...and add a little web 2.0 [14:45] maushu: Everyone loves web 2.0. [14:45] felixge_: maushu: ;) [14:46] SvenDowideit has joined the channel [14:46] mjijackson: whoa. the web is version 2.0 now? [14:47] ajpiano has joined the channel [14:47] maushu: With this I hope to aggregate peer-to-peer ecologies, disintermediate embedded podcasts, harness standards-compliant value, integrate authentic network effects, reinvent long-tail weblogs and remix embedded life-hacks" [14:48] KungFuHamster: I guess synergy and paradigm are web 1.5 [14:49] Ori_P has joined the channel [14:49] nefD: We have to synergize our mindshare and crowd source our forward web social interconnectedness [14:49] nefD: Welcome to.. Interweb 6.0.2 [14:50] maushu: o_o [14:50] nefD: (release candidate 3) [14:50] nefD: i say we all go back to bbs'es [14:50] mjijackson: all your interweb 6.0.2 are belong to us! [14:51] nefD: mjijackson set us up the bomb..! [14:51] dshaw has joined the channel [14:51] micheil: hmm.. can node do peer to peer and find networks? [14:51] mjijackson: it's you! [14:52] micheil: well, rather, has anyone implemented it [14:52] KungFuHamster: node can do anything, you just have to write it [14:52] micheil: / do people think it's possible [14:53] nefD: you have no chance to survive make your time. [14:55] felixge_: _ry: you up yet? [14:56] andrewhampton has joined the channel [14:57] micheil: felixge_: 8am. [14:58] felixge_: micheil: so? I got up at 5:30 this morning ;) [14:58] felixge_: jet lag ftw [14:58] micheil: oh damn. [14:58] felixge_: btw. any node people in ATL ? [14:58] micheil: ATL? atlanta? [14:59] ncb000gt: micheil: HOTlanta [15:00] felixge_: micheil: y [15:00] felixge_: ncb000gt: +1 [15:00] felixge_: :) [15:00] ncb000gt: :) [15:00] micheil: felixge_: no reason, I just don't get airport codes [15:01] avidal: so, i'm struggling to find a way to make gameplay fair without having a synchronous event loop in a mud [15:01] avidal: if it all stays async, then the best link wins everytime [15:02] avidal: not to mention you couldn't really enforce 'pulses' [15:02] steadicat has joined the channel [15:03] micheil: avidal: queue. [15:03] steez has joined the channel [15:04] steez: hey i'm trying to get node to serve some files and i'm having trouble getting it to serve images -- http://pastie.org/963845 [15:04] avidal: micheil: basically the same as what i'm talking about [15:04] avidal: the command processor would push a function onto the queue to be executed in N pulses, by default N = 1 (to be executed on the next pulse) [15:05] ncb000gt: steez: have you looked into paperboy? [15:05] avidal: so all user input/output is still async, but commands are processed in a queue [15:05] micheil: besides, in mud isn't it that faster connection wins? [15:05] steez: do i need to set the encoding in readFileSync to something other than utf8? [15:05] steez: nope ncb000gt [15:06] ncb000gt: it's built purely to handle static content [15:06] ncb000gt: pretty nice actually [15:06] ncb000gt: http://github.com/felixge/node-paperboy [15:06] avidal: micheil: usually, yes, but there are some things you can do to make it just a little more fair [15:07] ncb000gt: steez: might be overkill for what you're trying to do, but if you plan to do static content from a webserver, i'd recommend that [15:07] avidal: i figure the event queue is actually a queue of queues [15:07] avidal: the 'top' queue is based on 'pulses' (similar to fps for a mud) [15:07] steez: it looks very nice, in the source code nwo [15:08] steez: i'll run it and make sure that it can serve these gifs correctly [15:08] avidal: so if you push an event onto the queue to be executed in N pulses, it's inserted into event_queue[N] [15:08] avidal: every cycle of the game loop pops the top queue off of the event manager and processes all of those callbacks [15:08] ncb000gt: steez: i had images and other content pushing out through that on a project I had. it worked nicely though I can't recall if I had any GIF's specifically. [15:09] steez: i'll let you know in ~30 secs, not sure why gifs are giving me trouble, or if it's just files in gen [15:09] ncb000gt: yea [15:09] ncb000gt: seems odd, are they large files? [15:10] zomgbie has joined the channel [15:10] Ori_P has joined the channel [15:11] sh1mmer has joined the channel [15:15] maushu: http://www.w3schools.com/browsers/browsers_display.asp [15:15] peutetre has joined the channel [15:15] maushu: 640x480 died in 2005. [15:15] ncb000gt: steez: did that work? [15:15] maushu: We should have a minute of silence for it. [15:16] ncb000gt: maushu: lol! [15:16] maushu: I SAID SILENCE! [15:16] ncb000gt: NOU [15:16] nefD: the minimum res we design for where i work is always 1000px wide :P [15:16] maushu: ACTION hits ncb000gt with a dirty fish. [15:16] ncb000gt: *ouch* [15:16] maushu: 800x600 should die next year. [15:17] maushu: Hang in there buddy! [15:22] hellp has joined the channel [15:23] steez: ncb000gt yeps crashes a bit though [15:24] ncb000gt: steez: hmmm how so? [15:24] steez: i'll see if it's straightforward [15:24] steez: " throw new Error("This type of response MUST NOT have a body."); " [15:26] ncb000gt: can you put your code in a gist so i can look? [15:27] steez: oh weird it's in the example that's throwing the error, are you the maintainer? [15:28] ncb000gt: steez: no [15:28] JAAulde has joined the channel [15:28] steez: it's a callback from after the file is being served throwing an error, so i just killed that function and i'm happily serving my gifs [15:28] ncb000gt: steez: felixge_ is the creator but a number of people have contributed to it [15:29] steez: i'll like gitblame that line in the example [15:29] steez: it's Andrew Cholakian's fault :) [15:29] ncb000gt: lol [15:30] ncb000gt: time to get the tar and feathers [15:34] thotypous has joined the channel [15:35] rednul has joined the channel [15:36] javajunky: ha, totally missed the thread on semaphores in the mailing list. doh. [15:39] peutetre has joined the channel [15:43] cij_ has joined the channel [15:43] joshr has joined the channel [15:44] felixge_: has anybody written some code to handle utf8 buffer streams in node? [15:44] felixge_: I think node's internal encoding feature for net / http is broken [15:44] felixge_: since it doesn't respect incomplete utf8 sequences [15:48] quirkey has joined the channel [15:52] peutetre has joined the channel [15:52] felixge_: guess it's time for a utf8 stream [15:55] sh1mmer has joined the channel [15:59] tmpvar has joined the channel [16:01] TomY has joined the channel [16:03] Ori_P has joined the channel [16:05] steadicat has joined the channel [16:07] steadicat has joined the channel [16:07] ineation has joined the channel [16:10] gwoo has joined the channel [16:11] lobridge has joined the channel [16:13] peutetre has joined the channel [16:18] _ry: felixge_: yes [16:18] felixge_: _ry: morning : ) [16:18] ssteinerX has joined the channel [16:18] felixge_: _ry: got the buffer constructor patch done [16:19] _ry: cool [16:19] felixge_: http://github.com/felixge/node/commit/001334154ece1855201d73b87b55cc7af8b3c3b5 [16:19] harryv has joined the channel [16:19] felixge_: _ry: I was also wondering how you feel about having Buffer.concat -> http://github.com/felixge/node/commit/e416a93c1de418a37539d98fe756716ad3fa9994 [16:21] dgathright has joined the channel [16:22] linuxsable has joined the channel [16:22] harryv: hey, does anybody have experience with the graphics libs? that is, node-gd, magickal-node and node-imagemagick. in particular which is fastest for resizing images, mostly jpg's [16:23] mape: imagemagick is supposetly better then gd but the api is shit [16:24] felixge_: I had no idea there were 3 bindings already :) [16:25] felixge_: harryv: you should do a benchmark [16:25] harryv: felixge_: already on it. [16:25] harryv: any quick'n'dirty benchmark module, like ruby [16:25] harryv: *like in ruby [16:25] blackbrrr has joined the channel [16:25] felixge_: harryv: I think there is node-bench from isaacs [16:27] andrewhampton has joined the channel [16:28] nefD: having worked with gd and imagemagick in php, if the experience there translates to what youd get from node, gd is easier to use, but imagick does a lot more and yields higher quality results.. not sure about speed [16:29] harryv: I just need to resize to thumbnails, so speed is of main concern [16:29] _ry: felixge_: i feel that concat encourages its own use :) [16:29] _ry: and people shouldn't do that [16:30] felixge_: _ry: not sure [16:30] mape: http://dreamfall.blogspot.com/2008/02/php-benchmarks-gd-vs-imagemagick.html [16:30] felixge_: _ry: I have a stream of utf8 data coming in that I want to buffer completely [16:30] felixge_: _ry: and then decode to utf8 once it's completely buffered [16:30] felixge_: _ry: how would you do that without concat? [16:31] _ry: felixge_: we need to be able to stream decode utf8, yes [16:31] KungFuHamster: no graphs? I can't be arsed to compare a bunch of numbers manually [16:31] felixge_: _ry: I was thinking of a class called Utf8Stream that you can write buffers to, and that only fires it's on onData event for buffers that are "safe" [16:31] felixge_: if the end of a buffer is an in-complete utf8 sequence it's cached in a 3 byte long lookbehind buffer [16:32] maushu: How hard would it be to write a simple ssh server? [16:32] maushu: In node.js obviously. [16:32] felixge_: which will be flushed together with the next '.write()' if that has the remaining bytes [16:32] _ry: felixge_: i think this can be done better at the c level [16:32] avidal: you know what would be awesome for a mud? if the object files were a hg/git repo that was auto-committed and tagged for every autosave and manual save in the game [16:32] felixge_: _ry: how so? [16:32] avidal: so you could easily update the object files to an older revision if you introduce some bug [16:33] _ry: felixge_: by keeping state while decoding the string in some object [16:33] felixge_: _ry: I mean I need this as an own interface, not hard coded into the net stuff [16:33] _ry: well, actually just as you said [16:33] ineation has joined the channel [16:34] felixge_: _ry: since my multipart parser is emitting buffers [16:34] maushu: avidal: So... using the repo as template database? [16:34] avidal: not as a collab database, just a local revision history [16:35] avidal: like let's say builder A changes room B [16:35] felixge_: _ry: I don't even think there would be a performance penalty on doing it in JS since you only have to look at the last 3 bytes of any given buffer [16:35] avidal: when they save it, they get prompted to put in a commit message [16:35] dgathright has joined the channel [16:35] avidal: or they could commit an entire zone instead of just that one room [16:36] JimBastard has joined the channel [16:36] avidal: and integrate revision history into the game itself, so a builder could revert a room/zone in-game [16:36] JimBastard: http://github.com/explore :-D [16:36] _ry: felixge_: but you would then need to prepend those 3 bytes to the new buffer [16:36] JimBastard: thats 3 this month, all node [16:36] avidal: JimBastard: nice [16:37] JimBastard: http://thechangelog.com/ [16:37] micheil: mannn.. french radio stations have some good stuff playing at 2:30am [16:37] avidal: well, almost all node [16:37] JimBastard: ? [16:37] felixge_: _ry: no, if my lookbehind buffer is 4 bytes I can fill it with the sequence I need, emit a slice (or all) of it, and then also slice the rest of the new buffer [16:37] avidal: intridea/oauth2 > a ruby wrapper for oauth 2.0 [16:37] avidal: (not node) [16:37] felixge_: _ry: so no memcpy would be needed [16:37] JimBastard: avidal: i meant 3 of my projects hit the front-page this month [16:37] JimBastard: all of them node [16:38] avidal: oh, duh [16:38] avidal: :P [16:38] felixge_: _ry: well, at most I would have to copy 4 bytes [16:38] avidal: didn't notice that [16:38] _ry: felixge_: ah okay [16:38] avidal: but i did notice most of the projects on the front-page are js, if not node [16:38] felixge_: _ry: but not an entire buffer [16:38] JimBastard: JS is dangerously close to taking over ruby on github [16:39] felixge_: _ry: if you'd be interested in such a Utf8Stream class I can code it up [16:39] avidal: yeah, 16% js vs 19% ruby [16:39] _ry: felixge_: what do you think the api would look like? [16:40] _ry: like a normal duplex stream? [16:41] joshr has joined the channel [16:44] maushu: JimBastard: Time to monetize this! [16:44] maushu: CHAAARGE! [16:44] JimBastard: you cant monetize internet money [16:44] JimBastard: ive been trying to years [16:44] maushu: internet money? [16:44] JimBastard: ive got at least a million internet dollars banked by now [16:44] JimBastard: yeah [16:44] maushu: Duh, you need to trick people to pay you with real money. :p [16:45] maushu: That is what you have been doing wrong. [16:45] felixge_: _ry: https://gist.github.com/8d28c9754959883032f9 [16:45] JimBastard: maushu: read this in your bathtub, http://en.wikipedia.org/wiki/Canada_on_Strike [16:46] _ry: felixge_: onData(string) you mean [16:46] felixge_: _ry: no, I meant buffer [16:46] felixge_: _ry: I guess it could be converted to a string at that point [16:46] _ry: felixge_: oh [16:46] _ry: yeah why not just convert to a string [16:47] felixge_: _ry: I don't see why not I guess [16:47] felixge_: _ry: just thought it'd be neat to not do it ;) [16:47] felixge_: _ry: anyway, think this could work? [16:48] _ry: felixge_: yes, i think so too [16:48] felixge_: _ry: cool, I'll work on a patch later on today. I'll ping you :) [16:49] felixge_: _ry: gotta go now, will be back in 2-3h [16:52] richcollins has joined the channel [16:54] ssteinerX has left the channel [16:55] mjr_ has joined the channel [16:55] mfeiri_ has joined the channel [16:58] felixge has joined the channel [17:03] jan____ has joined the channel [17:06] felixge_ has joined the channel [17:06] felixge_ has joined the channel [17:14] tmpvar has joined the channel [17:14] JimBastard: sup tmpvar [17:19] SamuraiJack has joined the channel [17:20] ineation has joined the channel [17:23] mitkok has joined the channel [17:25] bradleymeck has joined the channel [17:27] avidal: JimBastard: you wanna make me a kick ass websocket client for my node-based mud server? [17:27] JimBastard: avidal: you wanna pay me? [17:27] avidal: no [17:27] JimBastard: lol [17:27] avidal: :D [17:27] JimBastard: figured id ask [17:27] JimBastard: where is the server? [17:28] avidal: at this point, the mud server is just an idea, but i hope to start working on it soon [17:28] JimBastard: id need to see quality of said code [17:28] avidal: of course [17:28] JimBastard: because i do need a game mud websocket server for zztmmo [17:28] avidal: i have it on github, created it over a month ago but i haven't done anything yet [17:28] JimBastard: i can do hosting too [17:29] avidal: i'm thinking the mud server will have transport socket types for each player, so there's no reason telnet + websocket clients can't communicate [17:29] avidal: the transport layer will handle translating the messages to the appropriate format, of course [17:30] avidal: but to start with, when you start the mud, it will boot up three servers, a basic web server, a websocket server, and a regular tcp/telnet server [17:30] KungFuHamster: room-based? /go east [17:30] avidal: the web server is for site integration, like getting a list of online players [17:30] JimBastard: i see avidal , so you want to support terminal as well [17:30] avidal: of course, it's a mud [17:30] avidal: KungFuHamster: probably, it's what i'm most familiar with [17:30] jan____ has joined the channel [17:30] KungFuHamster: change to coordinates and you have an mmo [17:30] avidal: standard cardinal directions, room-based mud [17:31] sh1mmer has joined the channel [17:31] avidal: yeah but coords in a mud is a bit of a pain in the ass, dealing with what you can see when [17:31] avidal: i've only seen a couple of good implementations of it [17:31] KungFuHamster: nod [17:31] avidal: it's easier using graphics, since you can just use line of sight/field of view [17:31] avidal: but with a mud, you need textual descriptions [17:31] JimBastard: yeah avidal, i'd like to see a generic game engine [17:31] Ori_P has joined the channel [17:32] KungFuHamster: I've seen a tacked-on "exploration mode" for certain areas that looked like a roguelike [17:32] avidal: honestly i'd like to not over-engineer this project and at least start with a traditional room-based 'real-time' mud server [17:32] JimBastard: ACTION nods [17:33] avidal: but a websocket client would be sweet for things like OLC (on-line creation), using a real HTML ui instead of some whacky ass line-mode menu chooser and script editor [17:33] avidal: you write room/object/player scripts in javascript of course, and they are executed in a sandbox for the appropriate object, etc [17:34] avidal: could make a cool interactive map using the googlemaps api [17:34] avidal: which would be one purpose of the generic web server being separate from the websocket server [17:34] avidal: the ws server is strictly for player interaction, whereas the web server is for integration services [17:34] JimBastard: avidal: i dont see why the webserver wouldnt be something like antinode [17:34] JimBastard: completely static [17:35] avidal: i haven't looked into antinode, but i see no reason why not [17:35] jan____ has joined the channel [17:36] avidal: oh, well, in regards to completely static, the webserver should serve some dynamic content, like a list of users that are currently logged in, or access to the mailbox for a specific player, etc [17:36] avidal: i suppose it could be antinode just serving json files that are written to by the regular server [17:36] avidal: which is what you are talking about i guess [17:37] avidal: but that seems like a lot of needless disk i/o when the webserver could just pull some data from the redis instance, for example [17:37] dgathright has joined the channel [17:38] avidal: unless you're referring to antinode for serving the resources for the ws client [17:39] avidal: in which case that makes sense, but there's no point in running 4 servers imo (ws server, telnet server, antinode ws client, 'api' server) [17:39] avidal: might as well just bundle the ws client server and the api server in one and define a few static resources for the ws client resources [17:40] ncb000gt has left the channel [17:40] ncb000gt has joined the channel [17:41] ncb000gt: avidal: you could use something like node-paperboy which does static content for something you specify...if you tie paperboy and something like fab together you can get route based static content and then other routes to be purely dynamic [17:41] avidal: sounds good [17:41] kevwil has joined the channel [17:42] ncb000gt: http://github.com/jed/fab [17:42] ncb000gt: http://github.com/felixge/node-paperboy [17:42] tylerstalder has joined the channel [17:42] ncb000gt: antinode is a server itself IIRC, whereas paperboy is just a module so you can use it for whatever static content you want [17:44] avidal: fab certainly looks interesting.. [17:44] micheil: fab is absolutely fabulous! [17:45] towski has joined the channel [17:48] devinus has joined the channel [17:49] ncb000gt: :) aye, it's nice [17:49] ncb000gt: there are others too if fab doesn't strike your fancy [17:49] avidal: yeah, i'll look into it [17:49] avidal: the webserver part of it will be the last thing, more than likely [17:49] ncb000gt: yea [17:49] JimBastard: one day i hope im smart enough to understand fab [17:49] avidal: haha, yeah [17:50] ncb000gt: well, regardless, it's pretty easy to make a web server [17:50] ncb000gt: with node that is [17:50] avidal: yeah for sure [17:50] ncb000gt: ;D [17:50] ncb000gt: so even if you had to do it yourself, it's straightforward [17:50] avidal: it's mostly going to serve as a "RESTful" API (about as restful as most APIs are these days) [17:51] ncb000gt: haha [17:51] cloudhead has joined the channel [17:52] avidal: have redis or something running as well to store things like locks (so two people don't edit the same room at the same time) and other such misc data [17:52] andrewhampton has joined the channel [17:52] ncb000gt: yea [17:53] avidal: thought about storing the actual object files in couch as well, but i'll probably stick with traditional flat-file store [17:53] avidal: couch for something like this isn't really that useful [17:54] avidal: since most stuff in a mud is about following links and acting on what's in your room, which would all be stored in the cache [17:54] avidal: everything else is just serializing/deserializing the objects from storage [17:55] cij_ has joined the channel [17:55] avidal: although using couch would make it easy to support versioning for specific objects [17:55] avidal: so a builder can roll-back a specific room [17:55] JimBastard: http://muq.org/~cynbe/hackers-code.html [17:58] bengl has joined the channel [18:01] maushu has joined the channel [18:02] avidal: another thing that would be interesting is a project like 'rope' for js [18:02] JimBastard: ? [18:02] JimBastard: whats rope [18:02] JimBastard: tried to google [18:03] JimBastard: >.< [18:03] avidal: rope is a python library to assist with things like intellisense and refactoring [18:03] JimBastard: almost as bad as R [18:03] avidal: http://rope.sourceforge.net/ [18:03] ssteinerX has joined the channel [18:03] ncb000gt: avidal: what editor are you using? [18:03] JimBastard: sup ssteinerX [18:04] avidal: vim [18:04] JimBastard: come to soak up some of my internet fame [18:04] ncb000gt: *cough*BOOOOOO*cough* [18:05] ncb000gt: i'm not sure of intellisense features for VIM, or for emacs for that matter, I just don't use it for whatever reason... [18:05] eck has joined the channel [18:05] eck has joined the channel [18:06] isaacs has joined the channel [18:10] kriszyp_ has joined the channel [18:11] creationix has joined the channel [18:11] thotypous has joined the channel [18:12] ssteinerX: hey JimBastard [18:12] JimBastard: sop [18:13] JimBastard: did i spam you yet? im front page of github again today [18:13] JimBastard: ive been yelling it at everyone all day [18:13] JimBastard: ACTION is annonying [18:14] isaacs: JimBastard: front of gh where? [18:15] JimBastard: isaacs: http://github.com/explore [18:15] WALoeIII has joined the channel [18:15] isaacs: nice [18:15] JimBastard: also i got on thechangelog [18:15] JimBastard: :-D [18:15] JimBastard: open source owns! [18:16] JimBastard: my new hobby is porting popular ruby gems to node [18:16] JimBastard: ACTION is taking suggestions [18:16] creationix: JimBastard: rails [18:16] creationix: only make it not suck [18:16] JimBastard: creationix: cloudhead and i are secretly on it.... [18:16] JimBastard: i mean [18:16] JimBastard: nothing [18:16] JimBastard: carry on [18:17] JimBastard: ;-) [18:17] creationix: haml? [18:17] JimBastard: you did haml already i thought [18:17] creationix: sort of [18:17] creationix: I have a very haml like language [18:17] JimBastard: i dont care much for haml anyway [18:17] creationix: true [18:18] JimBastard: but yeah, node.js rails is coming soon [18:18] JimBastard: a lot of the pieces have already been released.... [18:18] JimBastard: i should be quiet now [18:18] ncb000gt: LOL [18:20] kixxauth has joined the channel [18:24] mattly has joined the channel [18:24] avidal: if module A requires C then B, and B requires C, is C loaded from the module cache? [18:24] isaacs: avidal: yes. [18:24] mde: I guess it's not entirely surprising a lot of people are working on Rails-alikes for Node. [18:24] avidal: thoguht so [18:24] avidal: thought* [18:24] isaacs: avidal: except in some cases. there's a bug, and i have a fix, but it's a rewrite of module.js, and out of sync now. [18:24] avidal: i'd like to see more node stuff that isn't http oriented [18:25] isaacs: avidal: same here [18:25] mde: There's a lot of interesting stuff to solve in there. [18:25] isaacs: a chat client would be cool. [18:25] avidal: a jabber server [18:25] isaacs: or a multiplayer game [18:25] isaacs: yeah [18:25] isaacs: client + server [18:25] avidal: ncurses based irc client [18:26] isaacs: avidal: the node-ncurses comes with one of those [18:26] mde: Trying to make the async thing understanable and palatable to unsophisticated devs is one of the big ones. [18:26] avidal: oh yeah, i saw that [18:26] ncb000gt: avidal: +1 wrt/ non-webserver [18:26] avidal: udp :( [18:26] isaacs: bindings to real graphics would be cool. [18:27] isaacs: even if it's only x/gtk stuff [18:27] ncb000gt: it's just so easy to do web stuff with it that a lot of ideas present themselves when the solution is so easy [18:27] isaacs: but it'd be nice to write a "real" program in js [18:27] voodoo1 has joined the channel [18:27] ncb000gt: isaacs: I was considering doing a node-gtk lib [18:27] mjr_: You have non-HTTPers seen the mDNS addon? Pretty neat. [18:27] avidal: yeah, well when the hello world is a web server it's hard to break that perception [18:27] cij_ has joined the channel [18:28] isaacs: node *does* excel at web servers. nothing wrong with that. [18:28] isaacs: it's a program *for the web* [18:28] isaacs: but still. [18:28] isaacs: graphics are fun [18:28] ncb000gt: agreed [18:28] voodoo1: just one question as a lack of understanding: i don't have to code thread-safe in node.js, because nothing is executed in parallel, right? [18:28] ncb000gt: time for node-gl [18:28] mde: So yeah, Rails for Node is coming, that's for sure. :) [18:28] avidal: voodoo1: correct [18:28] ncb000gt: voodoo1: as I understand it, yes, it's sequential [18:29] avidal: there's only one execution stack [18:29] avidal: one thread [18:29] ncb000gt: mde: refer to it as something else please. rails makes me break into hives. [18:29] ncb000gt: :) [18:29] voodoo1: this means "functions" are executed until they eventually return, and then the next function is executed on the stack/loop [18:29] avidal: nails [18:29] ncb000gt: haha [18:29] avidal: node on nails [18:29] ncb000gt: on a chalkboard? yea [18:29] mde: ncb000gt: Actually what I'm working on is closer to Merb for Node, but I'm trying to take good ideas from both. :) [18:30] ncb000gt: gotcha [18:30] mde: Yeah, Rails is way too ponderous, doesn't fit well with the JS nimbleness. [18:30] ncb000gt: and a lot of baggage from the community [18:30] ncb000gt: imo [18:31] mde: Yeah, I was doing bits of Ruby before Rails mainstreamed, and the community changed a lot after that. [18:31] voodoo1: other question: which couchdb module would yo currently go for? [18:31] jashkenas has joined the channel [18:32] avidal: so what's the current best practice for external libraries? distribute a specific version in the lib/ directory of your source tree? [18:32] mikeal has joined the channel [18:32] saikat has joined the channel [18:32] avidal: or is npm wide-spread enough to use it? [18:33] ncb000gt: avidal: depends, i don't think any package manager is widespread yet [18:33] ncb000gt: npm is a strong runner [18:34] ncb000gt: and it'd be good to use it [18:34] ncb000gt: but if you need something then you can put it there [18:34] ncb000gt: you could do git submodules [18:34] avidal: yeah i suppose one can only gain traction if people use it [18:34] jashkenas: Quick question: How happy is everyone with the current error-as-first-argument-to-the-callback style for everything async in Node? Are ya'll actually handling them? Or is there just a ton of "if (err) throw err;" going on... [18:34] ncb000gt: you could just tell people to use the libs [18:34] avidal: i'll probably use npm honestly [18:34] ncb000gt: you could even have a make file orsomething [18:34] avidal: for anything that's supported in npm [18:38] CIA-74: node: 03Felix Geisendörfer 07master * r0a53986 10/ (3 files in 3 dirs): [18:38] CIA-74: node: Support arrays and strings in buffer constructor [18:38] CIA-74: node: This is be very useful for testing code that deals with buffers. - http://bit.ly/ab2deH [18:38] ncb000gt: jashkenas: I've never had a problem with it [18:38] voodoo1: i want to implement a restful webservice using node.js. is there an framework module you would suggest me to use, or should i just use a router (which one?) and code the rest by myself? [18:38] isaacs: w000ttt!! yes, use npm!! [18:38] ncb000gt: lol [18:38] mde: jashkenas: It's a useful convention -- I'm actually passing errors back to templates for form-input validation, pretty standard stuff. [18:38] ncb000gt: isaacs is biased [18:39] ncb000gt: ;D [18:39] voodoo1: there are so many modules but it's hard to get an overview by some snippets [18:39] isaacs: when it breaks, send me bugs! i want this thing to be stable, and i can't make it stable unless we all try hard to break it. [18:39] jashkenas: Reading through the API again, it seems like 2/3 of the core API uses event emitters with "error" events, and only the Filesystem stuff, really, uses the error-as-first-argument now... [18:41] jashkenas: The reason I ask is because gfxmonk is getting close to a decent stab at "defer" for CoffeeScript, which means that you can write async callback code that looks synchronous, with implicit continuations... [18:41] ncb000gt: voodoo1: i think it depends on what you're looking to do, fab is pretty swanky but there are other frameworks out there like express and such [18:41] ncb000gt: fab and express seem to be the "framework" leaders [18:41] ncb000gt: from what I've seen in here [18:41] voodoo1: well my "webservice" is rather some layer between my couchdb stuff and the clients [18:42] voodoo1: so i only have to handle json data (in/out) and add some features [18:42] mde: voodoo1: I'm biased, but: github.com/mde/geddy [18:42] voodoo1: so i think a router might be enough [18:42] ncb000gt: ahh geddy too, that one seems pretty popular as well [18:42] mde: It does basic resource-based routes, content-negotiation, etc. [18:43] voodoo1: hmm seems to be already heavy [18:43] JimBastard: hey voodoo1 [18:44] JimBastard: why dont you build your own router, i think node could use a few more [18:44] JimBastard: ... [18:44] voodoo1: :p [18:44] JimBastard: :-) [18:44] mde: Haha [18:44] jashkenas: Here's a gist if anyone's curious: http://gist.github.com/404084 Two nested async calls, one in a conditional branch that depends on the result of the other. [18:44] voodoo1: so tell me which router to take… ;) [18:44] jashkenas: But it runs, and prints the contents of package.json... [18:44] JimBastard: sup jashkenas [18:44] jashkenas: 'sup. [18:45] JimBastard: voodoo1: i would suggest journey [18:45] JimBastard: http://github.com/cloudhead/journey [18:45] JimBastard: cloudhead is pretty hardcore, and i have it on good authority that, that router might be part of some top secret project [18:46] voodoo1: you must be a real insider [18:46] JimBastard: https://github.com/marak [18:46] JimBastard: you tell me [18:46] JimBastard: ;-) [18:47] voodoo1: oh, all that github stuff, i feel so 2000 with using svn and having no clue about git [18:47] ncb000gt: ewww svn [18:47] ncb000gt: :) [18:47] voodoo1: yeah i know [18:48] rictic has joined the channel [18:48] voodoo1: on the other hand, i want to use node.js for a university stuff [18:48] ncb000gt: the agency i work for still uses svn, but if i do push code into their repos i use git-svn [18:48] voodoo1: all of the people i tell to use javascript for our server think i'm crazy [18:48] ncb000gt: haha [18:48] voodoo1: well, just wait for the outcome :D [18:48] ncb000gt: i know the feeling [18:49] ncb000gt: it's hard to convince people that JS can be used anywhere and work well [18:49] voodoo1: in the end we will probably use javascript for all server stuff (couchdb / node.js), and mostly java for the clients [18:49] voodoo1: sounds so wired at first [18:49] ncb000gt: haha [18:49] voodoo1: but it just rocks [18:49] ncb000gt: why java for the clients? [18:49] voodoo1: well and i'm responsible for the server stuff [18:50] voodoo1: the other guys will create a web frontend for the service using GWT and probably restlet [18:50] dgathright has joined the channel [18:50] mscdex: isaacs: someone did make a gtk binding for node [18:50] voodoo1: ok, for me it's a client, for them it's a server [18:51] ncb000gt: mscdex: really? where at? [18:51] dgathright has joined the channel [18:51] mikeal: there is been talk on the gtk list for a while about v8 bindings [18:51] mikeal: but i wasn't aware that anyone had written them [18:51] voodoo1: but i think it's definetly time for getting into this git stuff now [18:51] mscdex: http://github.com/brainfucker/node-gui [18:51] ncb000gt: voodoo1: no better time to start than now [18:52] ncb000gt: :) [18:52] ncb000gt: mscdex: sexy time :) [18:52] mscdex: heh [18:53] voodoo1: i find it so refreshing not having to think about concurreny anymore [18:53] ncb000gt: mscdex: awesome! that's almost exactly what I had been doing over the weekend [18:53] voodoo1: i think i'm in love, sorry guys for getting on your nerves ;) [18:53] JimBastard: mscdex: is that creating html fragments on the server? [18:53] ncb000gt: glad someone else started it and is further along [18:53] ncb000gt: time to fork :) [18:54] JimBastard: node-gui? [18:54] mscdex: JimBastard: no, gtk windows [18:54] JimBastard: on the desktop? [18:54] ncb000gt: yes [18:54] mscdex: yes [18:54] JimBastard: like desktop apps? [18:54] JimBastard: ahh [18:54] JimBastard: interesting [18:54] WALoeIII has joined the channel [18:54] ncb000gt: yarp [18:54] ncb000gt: it's like python-gtk but for JS [18:54] ncb000gt: :) [18:54] avidal: should probably be node-gtk and not node-gui [18:54] JimBastard: i stopped writing desktop apps in 2000 with VB6 [18:55] ncb000gt: avidal: i agree [18:55] voodoo1: haha [18:55] JimBastard: yep avidal [18:55] ncb000gt: jimbastard: that's not writing...that's drag and drop [18:55] avidal: or gnome bindings can be called gnode [18:55] avidal: :3 [18:55] voodoo1: wirting guis is using null layout [18:57] brianmario has joined the channel [18:57] ncb000gt: getting desktop libs involved will help push node away from just a web server framework too [18:57] polo has joined the channel [18:57] ncb000gt: the ncurses stuff is good too, but that is targeted to a certain group of people [18:58] JimBastard: ncb000gt: you couldnt handle my AOL 3.5 VB apps [18:58] JimBastard: id have your CC in two seconds [18:58] JimBastard: and ring up your usage to 1000 bucks on AOL [18:58] JimBastard: :p [18:58] ncb000gt: JimBastard: AoHELL baby! [18:58] maushu: I need a win32 version. [18:58] JimBastard: lolz [18:59] ncb000gt: maushu: i cry at night for you [18:59] maushu: Good. You should. [18:59] ncb000gt: lol [18:59] ncb000gt: only single tears tho [18:59] JimBastard: give maushu a break, he programs from the bathtub [19:00] ncb000gt: o.0 [19:00] maushu: I'm that awesome. [19:00] ncb000gt: :s/awesome/*special*/ [19:03] maushu: specially awesome. [19:08] voodoo1: ah, another one: how do you could with node? which editor? how do you debug? [19:08] ncb000gt: lol [19:08] avidal: vim and sys.puts [19:08] ncb000gt: I use emacs [19:09] mscdex: notepad++ :> [19:09] voodoo1: oh sounds like war [19:09] avidal: could use jslint as well i suppose [19:09] ncb000gt: debugging, usually sys.puts [19:09] mscdex: sys.debug :) [19:09] ncb000gt: there are a lot of testing frameworks too if you like that sort of thing [19:09] ncb000gt: :) [19:09] voodoo1: recently saw a guy who integrated debugging into eclipse [19:09] ncb000gt: ndb too [19:09] voodoo1: but i'm not sure if it is worth it [19:10] ncb000gt: eclipse? not really unless you are working with java, _a lot_ [19:10] ncb000gt: and even then I'd push netbeans [19:10] andrewhampton has joined the channel [19:10] voodoo1: i'm using it anyway right now [19:10] mikeal: eclipse is a good place to store 2gigs of unused memory [19:10] ncb000gt: LOL [19:10] mscdex: man, firefox 3.6's canvas performance is crap [19:10] mscdex: :( [19:10] voodoo1: but he managed to some stack tracing using the eclipse debugger. that looked promising [19:11] mikeal: mscdex: it's *way* better in trunk [19:11] mikeal: graphics acceleration FTW [19:11] ncb000gt: :) [19:11] mscdex: on chromium it's smooth like butter [19:12] mikeal: that's because Apple has already done a ton of graphics acceleration work in WebKit [19:12] mikeal: they kinda needed it for mobile :) [19:12] mscdex: heh [19:13] mscdex: i'm looking at that three.js 3d engine [19:19] nefD: hah! [19:19] nefD: the one on mrdoob.com? [19:19] mscdex: yeah [19:20] nefD: wow. that depth of field demo is pretty awesome.. [19:22] JimBastard: mrdoob is badass [19:22] JimBastard: seriously [19:22] JimBastard: badass [19:32] ncb000gt: nefD: yea it is quite cool [19:32] N` has joined the channel [19:33] ncb000gt: aka "IT'S PERTY!" [19:34] pgriess has joined the channel [19:35] mscdex: i wish it had .3ds support :P [19:35] mscdex: or vrml [19:35] ryan[WIN] has joined the channel [19:36] bengl has joined the channel [19:44] bweaver has left the channel [19:44] dgathright_ has joined the channel [19:45] drostie has joined the channel [19:47] bigwavejake has joined the channel [19:47] bigwavejake: what's a good tool for debugging node.js scripts from emacs? [19:47] JimBastard: i mean, im a fan of the debugging web console [19:47] JimBastard: i seem to be somewhat alone in that regard [19:48] bigwavejake: JimBastard, node_debug ? [19:49] JimBastard: aye [19:50] JimBastard: apparently you can do real debugging though [19:50] JimBastard: http://github.com/smtlaissezfaire/ndb [19:50] bigwavejake: i've been looking at that one [19:50] bigwavejake: not too excited about rolling my own emacs debug mode for that bad boy [19:50] JimBastard: yeah i mean [19:50] JimBastard: for what i do, having debug.log() is good enough [19:53] scudco has joined the channel [19:53] stephenlb has joined the channel [19:54] TobiasFar has joined the channel [19:54] robrighter_ has joined the channel [19:57] mertimor has joined the channel [19:57] Ori_P has joined the channel [20:01] _ry: mjr_: http://github.com/clifffrey/ssl-hostname-parser [20:01] mjr_: huh [20:01] mjr_: I was just fiddling with pcap stuff today actually. [20:02] Ned_: isaacs: so err, no more news on the publish thing ? [20:05] creationix: _ry: since fs.readFile is using stat internally to get the file size, could we store a reference to that stat object on the resulting buffer? [20:05] creationix: I need the mtime for setting the "Last-Modified" headers [20:06] creationix: and my readfile looks just like the built-in one, except it also stores mtime from stat [20:06] ashb: why the hell is readFile stating? [20:06] creationix: ashb: to get the size of the buffer to create [20:06] creationix: buffers are fixed size [20:06] admc has joined the channel [20:06] ashb: and what if the file size changes? [20:07] creationix: ashb: what's the chances of that [20:07] ashb: its the FS. it will happen at some point [20:08] creationix: yeah, but then you'd get somewhat corrupt data [20:08] creationix: considering the file is changing that fast, I would think that's ok [20:08] creationix: or maybe throw an excepption [20:08] maushu: _ry, in the background when node.js doesn't have to do anything and just wait for a timeout to end, does it waste cycles with, for example, a loop? [20:09] maushu: I don't think so since it uses os events, just to confirm though. [20:09] isaacs: Ned_: i can't seem to reproduce what you were describing. [20:09] isaacs: Ned_: does it still fail with the latest code, if you do "make install" or "make link"? [20:09] creationix: ashb: the other options involves a lot of memory copying, fs.readFile is for the simple case anyway [20:10] ashb: creationix: do you you want the code of your porject to only be right 'most of the time'? [20:10] _ry: maushu: no, it idles [20:11] creationix: ashb: no, I just don't think it's right to make fs.readFile slow and complicated for a particular use case that it's not meant for in the first place [20:11] mattly has joined the channel [20:11] _ry: creationix: eh, i don't know [20:11] _ry: ashb: good point [20:11] ashb: ;) [20:11] creationix: _ry: well, if you remove stat, then my question doesn't matter [20:11] maushu: _ry, so if I don't mind keeping node.js in memory (since I'm going to use it anyways) I can use it like cron? [20:12] creationix: (meaning remove stat from the fs.readFile function) [20:12] Ned_: isaacs: yeah, still fails [20:12] maushu: If I don't use cron it's one less stuff I have to handle. [20:12] ncb000gt: isaacs: I was having an issue installing npm on my system where it was installing the docs [20:12] Ned_: publish reports no errors :-( [20:12] Ned_: isaacs: are there any logs server-side that help explain what's happening ? [20:12] isaacs: ncb000gt: yeah, that'll be fixed soon [20:12] Phazm has joined the channel [20:13] isaacs: Ned_: i don't believe it. i'll bet it spit out ahuge log of info. [20:13] isaacs: Ned_: maybe not a thrown error, but still, something [20:13] Ned_: heh [20:13] Ned_: I'll paste it [20:13] ncb000gt: isaacs: cool, I would have fixed it but my self-diagnosed ADD got the best of me over the weekend [20:13] Ned_: just trying again now [20:13] ncb000gt: :) [20:13] isaacs: :) [20:14] Ned_: isaacs: http://paste.dollyfish.net.nz/5e3b6e.txt [20:15] creationix: ashb: is there a os level function that allows you to get the size of a file and a handle to read all at the same time? [20:15] ashb: not that i'm aware of [20:15] creationix: of course if someone is writing to the file using non-atomic writes, aren't you screwed either way [20:15] ashb: don't think so [20:16] isaacs: Ned_: so, it does the tarball line, and then just dies? [20:16] Ned_: err, [20:16] Ned_: yup [20:16] Ned_: that's the last line of output [20:16] isaacs: Ned_: ok. do this: npm cache clean irc [20:16] isaacs: and then try again [20:17] creationix: I mean, the only common case I can think of is someone tries to serve a file as you're saving over it, even without a separate stat call, won't you get inconsistent data [20:17] Ned_: http://paste.dollyfish.net.nz/99f7d8.txt <--- cache clean output, looks fine :-) [20:17] Ned_: running publish now ... [20:17] isaacs: great [20:18] Ned_: isaacs: same output on publish [20:18] Ned_: :-( [20:18] ineation has joined the channel [20:18] quirkey has joined the channel [20:19] isaacs: Ned_: ok, i'll push a change with some more logging, gimme a second [20:19] creationix: ashb: but now that I think about it, the overhead of the memcopy needed by the non-stat version of fs.readFile is probably nothing compared to the fs read [20:19] Ned_: isaacs: ta :-) [20:19] quirkey has joined the channel [20:21] ashb: creationix: probably :) [20:22] isaacs: Ned_: think i found the bug. odd that this didn't affect me, maybe it's another mac/linux difference or smoething [20:23] Phazm: Error: ETIMEDOUT, Connection timed out\n at IOWatcher.callback (net:738:22)\n at node.js:176:9 [20:23] Phazm: anyone else get that? [20:23] Ned_: right [20:23] isaacs: Ned_: pull, please, and try again. if it fails, paste the log. [20:23] Ned_: righto [20:23] Ned_: ACTION will try ... [20:23] isaacs: awesome [20:24] isaacs: Ned_: btw, thanks for the persistence and for having such an odd environment. [20:24] ssteinerX has joined the channel [20:24] Ned_: ACTION is the king of odd ;-) [20:24] JimBastard: ACTION is the king of even [20:26] _ry: maushu: you can use it like cron [20:27] _ry: maushu: there is actually a not-yet-exposed funtionality to schedule callbacks at certain times [20:27] _ry: like (at 2pm tomorrow, execute this) [20:28] _ry: maushu: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#code_ev_periodic_code_to_cron_or_not [20:29] hellp has joined the channel [20:31] maushu: Well, that isn't a big problem, just calculate the time based on current time. [20:31] _ry: i guess [20:32] javajunky has joined the channel [20:32] Phazm: _ry: issues #143 and #148 are keeping me from being able to use my app -- is there any way I can make those at least fail without bombing? Maybe if I put the site.request() in a try/catch? [20:32] Ned_: isaacs: ah ha [20:33] _ry: Phazm: i can fix the dns one today, i think [20:33] isaacs: Ned_: break in a new way? [20:33] Ned_: well, it didn't seem to upload did it :-9 [20:34] _ry: Phazm: i beleive 148 is the same as 143 [20:34] Ned_: http://paste.dollyfish.net.nz/308dbd.txt [20:34] Ned_: new output [20:34] Ned_: isaacs: ^^ [20:34] _ry: Phazm: i'm going to have these errors forwarded to the 'error' event of the client [20:34] isaacs: k, this just got weirder... [20:34] _ry: Phazm: is that okay? [20:34] Phazm: yea, that would be great, _ry [20:34] Ned_: isaacs: indeed [20:35] Ned_: isaacs: whatever you did made it better [20:35] isaacs: Ned_: nope, just noisier [20:35] Ned_: do it again! ... :p [20:35] isaacs: still failed [20:35] Ned_: oh, right [20:35] _ry: just want to fix this v8 patch i'm working on [20:37] Ned_: isaacs: it seems to pause for a very long time after outputting that last line [20:37] Ned_: I almost wonder if there's some sort of network timeout ? [20:38] isaacs: Ned_: that could actually really explain it [20:38] isaacs: also your ls stuff [20:38] Ned_: oh, ls stuff works now [20:38] isaacs: you're in uk, right? [20:38] Ned_: it started working after I deleted a bunch of crap [20:38] Ned_: isaacs: I'm about as far from the UK as possible ;-) [20:38] Ned_: NZ :p [20:38] isaacs: ah, even worse ;P [20:38] isaacs: from a network pov [20:38] Ned_: yeah [20:38] mscdex: interwebz! [20:39] Ned_: we just have the one shared dialup for the country ;-) [20:39] mscdex: is it AOL? [20:39] isaacs: Ned_: ok, do it again, i've logged every point in the upload, hopefully that'll shed some light [20:39] Ned_: running now [20:39] isaacs: if that doesn't fix it, it'll have to wait until i get outta work, i've got some real things to do today [20:39] Ned_: isaacs: faire nough :-) [20:40] Ned_: ACTION twiddles thumbs ... still going :p [20:40] Ned_: done [20:41] felixge has joined the channel [20:41] felixge has joined the channel [20:41] ncb000gt: isaacs: don't lie [20:41] isaacs: Ned_: maybe what i need to do is not be lazy and actually stream the tgz instead of putting it all in memory with fs.readFile [20:42] DracoBlue has joined the channel [20:42] isaacs: Ned_: i kinda figured that the tgzs are pretty small, and most devs have plenty of memory on hand. [20:42] isaacs: or are you doing this from your ipad or somethign? [20:42] Ned_: isaacs: 4GB RAM in the local machine [20:42] kixxauth has joined the channel [20:42] Ned_: :p [20:42] isaacs: how big is the tarball? [20:42] Ned_: you people and your Macs :p [20:42] Ned_: npm bytes 18814 [20:43] Ned_: I assume that big ? [20:43] isaacs: hm. yeah, that's not big at all. [20:43] isaacs: that's 18kb [20:43] isaacs: teeny [20:43] Ned_: yes [20:43] isaacs has left the channel [20:43] Ned_: err, buh bye! [20:43] Ned_: :p [20:43] ncb000gt: lol [20:43] ncb000gt: ninja quit [20:43] Ned_: indeed [20:43] Ned_: conversation over ;-) [20:44] felixge_ has joined the channel [20:44] felixge_ has joined the channel [20:54] aho has joined the channel [20:54] nym has joined the channel [20:54] nym: hey [20:55] nym: _ry: curious what you think of http://www.usenix.org/events/hotos03/tech/full_papers/vonbehren/vonbehren_html/index.html [20:55] ncb000gt: nym: hey [20:55] ewdafa_ has joined the channel [20:55] nym: ncb000gt: yo [20:56] nym: anyone here with chrome 5? http://173.203.79.64/index.html [20:56] nym: oh, n/m [20:57] richcollins has joined the channel [20:59] _ry: Phazm: ping [20:59] Phazm: _ry: pong [21:00] _ry: Phazm: you should already be able to catch that 'error' event [21:01] _ry: nym: subjective and published in 2003 [21:01] tmpvar: heh [21:02] tmpvar: locking is bad mkay? [21:02] nym: i have a friend who does tilecaches with nginx [21:02] markwubben_ has joined the channel [21:02] Phazm: _ry: in a try/catch, or do you mean from the error response for a request? [21:02] isaacs has joined the channel [21:03] nym: i told him to try doing it with node, if only to see what the results were [21:03] voodoo1 has left the channel [21:03] _ry: Phazm: i mean client.addListener('error') [21:03] nym: i could be wrong but i think tilecache servers are pretty simple in design [21:03] _ry: i don't know what tilecache is [21:03] Phazm: ah, okay. Is that required to handle this, or can I just leave it out and it will fail silently? (I have a new http request every second, don't need to know if it errors out on one of them) [21:04] nym: _ry: they're used for serving up map tiles for applications like google maps [21:04] _ry: Phazm: you can just ignore it [21:04] Phazm: thanks _ry [21:04] _ry: Phazm: but you have to give an error handler [21:05] tilgovi has joined the channel [21:05] nym: _ry: it's kind of the 100 concurrent user, 1mb request problem you talked about at cinco de node [21:06] isaacs: Ned_: got a lot from the latest drop? [21:06] isaacs: *log [21:06] tmpvar: speaking of which, where is the video, lol [21:06] derbumi has joined the channel [21:06] isaacs: sorry for the ninja quit, cmd-W in the wrong window *^_^* [21:06] mjr_: _ry: can I bug you about pcap and eio? [21:06] _ry: mjr_: sure [21:07] CIA-74: node: 03Ryan Dahl 07master * r1036aa9 10/ src/node_cares.cc : Fix errno display in c-ares exceptions - http://bit.ly/9p22S7 [21:07] ncb000gt: _ry: I have a "srs bzns" question. Have you considered a music video for node? [21:07] mjr_: so pcap is basically a blocking loop of its own, you go into pcap_loop, and the library calls back a C function whenever a new packet is ready. [21:07] _ry: mjr_: groan [21:08] mjr_: so I need to set up a new thread to run this in, i guess, and then translate the callbacks from there to something that'll run a JS to handle the packet. [21:08] _ry: mjr_: yeah [21:08] _ry: mjr_: since you just have one fixed thread, i would suggest just using pthreads directly? [21:08] mjr_: All of the eio examples I've seen look like one off threads just for the purpose of running a blocking call, then they exit. [21:09] mjr_: hmm, yeah I guess doing pthreads manually might be the right way. But how to signal back to libevent or whatever the main event loop is called? [21:09] mjr_: set up a pipe? [21:09] _ry: mjr_: using ev_async [21:09] _ry: mjr_: which is a nice way of doing the self-pipe trick [21:10] _ry: (libev already has some pipes that it uses, so instead of maintaining your own you can just use its pipe) [21:11] _ry: more portable and easier to use [21:11] _ry: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#code_ev_async_code_how_to_wake_up_an [21:11] _ry: basically call ev_async_send() from your thread [21:11] _ry: then you setup a callback function in the main thread [21:11] _ry: ncb000gt: eh. no music videos :) [21:12] ncb000gt: _ry: a movie then? could be a thriller...lots of drama...maybe a romantic comedy... [21:12] ncb000gt: ? [21:15] felixge_: ACTION working on that Utf8Stream thingy now [21:15] jherdman has joined the channel [21:15] _ry: felixge_: my sort of edge case worry - utf8 has no maximum length on how long characters can be [21:15] robrighter has joined the channel [21:15] KungFuHamster has joined the channel [21:16] felixge_: _ry: it does [21:16] _ry: i thought i saw some hack to get arbitrarally long characters [21:16] felixge_: _ry: it's 4 bytes max [21:16] felixge_: _ry: that is not part of the spec and not of practical concern to us, I think [21:16] felixge_: http://en.wikipedia.org/wiki/Utf8#Description [21:17] _ry: i guess [21:17] _ry: well whatever [21:17] isaacs_ has joined the channel [21:17] _ry: also i was thinking - we should probably have the concept of a filter [21:17] _ry: for a stream [21:17] felixge_: _ry: yeah, that'd be nice [21:18] felixge_: _ry: even so this is no filter, it's just a throttler [21:18] felixge_: I guess [21:18] _ry: filter = constant time conversion of a stream [21:18] felixge_: I mean the output is not modified in anyway [21:18] felixge_: oh ok [21:18] _ry: constant-time isn't the right word [21:18] _ry: i/o-less conversion [21:19] _ry: which would be different than say a zlib compression which used the thread pool [21:19] felixge_: _ry: do you want this to be something that can be applied? i.e. req.applyFilter(Utf8Stream) [21:19] _ry: felixge_: well it should be for both outgoing and incoming? [21:19] felixge_: _ry: yeah [21:20] felixge_: _ry: I guess it should just be a stream that accepts another stream in the constructor ? [21:20] felixge_: var stream = new Utf8Stream(req); [21:21] felixge_: hm, we'd have to propagate any events that are being emitted I guess [21:21] _ry: ideally we coudl do this with ssl as well [21:21] _ry: it's also a i/o-less conversion [21:22] felixge_: well, the simplest way would just be to hjack the 'emit' function of the stream that is being modified [21:22] felixge_: req.emit = function(){...} [21:22] _ry: that's not so clean [21:23] felixge_: this way we could fairly easily modify or propagate any event [21:23] felixge_: _ry: not clean, but simple [21:23] Ned_: isaacs: sorry, back now [21:24] Ned_: err, basicalyl it was just more of the same [21:24] Ned_: I thought you were doing logging server side? [21:24] Ned_: did you do another commit with more client side logging ? [21:24] felixge_: _ry: what are your ideas for doing this? [21:24] _ry: stream.filterOutput(function) ? [21:25] _ry: not sure [21:25] Ned_: ah ha, indeed you did [21:25] Ned_: ACTION runs it again ... [21:25] _ry: so that setEncoding('utf') could just be [21:26] _ry: stream.filterOutput(net.decodeUtf8) [21:26] felixge_: _ry: well a simple function won't cut it here, since you need a 4 byte buffer [21:26] felixge_: _ry: you need some sort of state [21:26] _ry: maybe decodeUtf8 returns a colsure with the state [21:27] Ned_: isaacs: http://paste.dollyfish.net.nz/ae30b7.txt [21:27] isaacs: Ned_: no, client-side logging [21:27] Ned_: that's the latest [21:27] _ry: felixge_: or if we want to be more OO [21:27] _ry: stream.filterOutput(new Utf8Decoder) [21:27] bmizerany has joined the channel [21:28] isaacs: ok, so it does the write, and never comes back. [21:28] isaacs: Ned_: i really think at this point that it's some kind of network latency thing. [21:28] Ned_: isaacs: really ? [21:28] isaacs: Ned_: maybe we need to replicate the registry to a server in NZ [21:28] isaacs: yeah [21:28] _ry: felixge_: this is getting pretty close to normal i/o streams though [21:28] isaacs: but i think refactoring to use fs.read instead of fs.readFile would probably be better. [21:28] Ned_: surely not, I mean, I can do all sorts of traffic all over the world with no issues :p [21:29] isaacs: Ned_: sure. [21:29] _ry: felixge_: maybe we should just be pumping data though a filter? [21:29] Ned_: right [21:29] Ned_: you think it might just be a bit brittle ? [21:29] noder has joined the channel [21:29] isaacs: Ned_: could be [21:29] Ned_: right ... [21:29] Ned_: oh well, I'm at work now too :p [21:29] felixge_: _ry: through a filter as in filter function? [21:29] _ry: felixge_: whatever that would mean? :) [21:29] isaacs: of course, it's nginx as a proxy, so streaming is probably not great, either. [21:29] Ned_: so I might look again this evening [21:29] isaacs: i'll have to play around with it [21:29] Ned_: see what I can see :-0 [21:29] isaacs: it might be a bug in node, even ;) [21:29] _ry: felixge_: so basically - i don't know [21:29] felixge_: _ry: :) [21:29] haxd has joined the channel [21:29] _ry: felixge_: i think we should have a filter of some sort though [21:29] robinduckett: yo [21:30] _ry: i could hack that onto net.Stream [21:30] felixge_: _ry: we also still need that pump() function [21:30] felixge_: _ry: maybe filter() should be similar [21:30] isaacs: Ned_: the relevant code is in lib/utils/registry.js [21:30] felixge_: _ry: maybe a 'stream' module [21:30] robinduckett: ?_? [21:30] isaacs: Ned_: please be gentle in there. the registry should be pretty hardened against mistakes, but if it gets fubar, then i'll have to fix it by hand. [21:30] isaacs: Ned_: but maybe you can add additional log() statements, track down the error. [21:30] felixge_: _ry: with a stream.filter(req, stream.Utf8Filter) [21:30] felixge_: hm [21:31] Ned_: isaacs: yeah, I'll try not to bust anything ;-) [21:31] _ry: computers are hard [21:31] felixge_: _ry: abstractions are hard [21:31] Ned_: _ry: imagine if they were squishy though! [21:31] felixge_: _ry: shit is really easy if you just duck-tape it together [21:31] felixge_: :) [21:32] _ry: lets look at what AnyEvent does [21:33] ncb000gt has left the channel [21:33] _ry: basically we want to transform 'data' events before they get to the user [21:33] _ry: we could just tell users to transform shit themselves [21:33] _ry: which would be great [21:34] felixge_: _ry: well, what about other events besides 'data' ? [21:34] ryan[WIN] has joined the channel [21:34] felixge_: _ry: A filter could also do error-handling on a malformed stream that would normally emit an error [21:34] _ry: well you need to handle 'end' too [21:34] robinduckett: I wonder if _ry is _why... [21:35] _ry: i'm no [21:35] robinduckett: :P [21:35] felixge_: robinduckett: _ry is john lennon [21:35] nym: they don't look anything alike [21:35] tmpvar: namespaced events? [21:35] _ry: felixge_: that sounds too crazy though [21:36] steez has joined the channel [21:36] nym: _ry looks like http://jsconf.eu/2009/assets_c/RDahl_sw.jpg [21:37] nym: _why looks like http://en.wikipedia.org/wiki/File:Whytheluckystiff.jpg [21:38] _ry: felixge_: i'd like to make people convert their stuff [21:38] _ry: streams emit buffers [21:38] robinduckett: if _ry gained a few pounds, lost the glasses and grew the hair out... [21:38] robinduckett: Noses are dissimilar but _why could have had plastic surgery [21:38] _ry: felixge_: obviously we've got this existing api where 'data' can emit strings - [21:38] _ry: but we should treat that as a legacy interface [21:39] felixge_: robinduckett: I found the pics: http://twitter.com/jedschmidt/status/13669222311 [21:39] _ry: or - wha do you think? [21:39] _ry: man i hate that picture [21:39] felixge_: _ry: so you're saying we should not provide an abstract filter, or we should limit it? [21:40] felixge_: _ry: for the longest time, people only knew what your feet looked like ;) [21:40] _ry: felixge_: i'm saying we shouldn't expose any new API for now [21:40] charlesjolley has joined the channel [21:40] felixge_: _ry: fine with me [21:40] stevendavie has joined the channel [21:41] robinduckett: haha _ry does look like lennon [21:41] felixge_: _ry: I just needed to deal with utf8 stream and was gonna write this class for it anyway [21:41] felixge_: _ry: would you still like to do the Utf8Stream class? [21:42] _ry: felixge_: yeah [21:42] _ry: but let's just use it internally for doing setEncoding() until we can figure out a good plan [21:42] felixge_: _ry: ok, so no docs for it? [21:42] _ry: right [21:43] felixge_: _ry: alright, cool [21:43] felixge_: _ry: then I'll continue and ping you once I can show my initial code [21:45] temp02 has joined the channel [21:48] mjr_: _ry: what's the right way to check for and include pcap in a wscript file? [21:51] andrewhampton has joined the channel [21:51] hassox has joined the channel [21:51] _ry: mjr_: see efence in node's wscript [21:52] _ry: mjr_: or libdl [21:52] Tim_Smart has joined the channel [21:52] JimBastard: hey re: the mailing list [21:52] JimBastard: process.setuid() and process.setgid() [21:53] JimBastard: why are those not documented? [21:53] JimBastard: or am i being stupid [21:55] _ry: mjr_: btw it seems pcap_get_selectable_fd() negates the need for a pthread [21:56] mjr_: did you read the ominous sounding warnings in the osx manpage for that? [21:57] _ry: we use select() in mac osx [21:57] _ry: osx is a broken operating system [21:58] mjr_: yeah, but it is pretty [21:58] ryan[WIN]: osx is only broken if you are trying to do anything that's not python or java or something [21:58] tmpvar: java is horrible on osx [21:59] ryan[WIN]: but it's way better than mac os classi [21:59] ryan[WIN]: classic [21:59] ryan[WIN]: oh god [21:59] _ry: i wonder if kqueue is working in 10.6 [22:00] _ry: Note also that poll() doesn't work on character special files, including BPF devices, in Mac OS [22:00] _ry: X 10.4 and 10.5, so, while select() can be used on the descriptor returned by [22:00] _ry: pcap_get_selectable_fd(), poll() cannot be used on it those versions of Mac OS X. Kqueues also [22:00] _ry: don't work on that descriptor. poll(), but not kqueues, work on that descriptor in Mac OS X [22:00] _ry: releases prior to 10.4; poll() and kqueues work on that descriptor in Mac OS X 10.6 and later. [22:00] mjr_: so sad [22:00] _ry: sad that it's actually an os with funding [22:01] _ry: that people pay money for [22:01] _ry: and you can't even do the most trivial things [22:01] _ry: but yes, bubbly icons [22:01] tmpvar: thats all that matters [22:03] ryan[WIN]: and itunes!! [22:04] bmizerany: hrm. got a crazy little problem here with 0.1.95 and stdout redirection [22:05] bmizerany: when I dump ~8k of text to stdout, I see it. But when I `node test.js > foo`. nothing is written to foo [22:05] robrighter has left the channel [22:05] creationix: serving a 1mb js file from disk with no caching 286287.23 [Kbytes/sec] received [22:05] creationix: enable in-memory cache, about twice that [22:05] creationix: buffers are awesome [22:06] _ry: bmizerany: node > file invokes different code than when printing to console [22:06] bmizerany: I ran dtruss (OS X Snow Leopard) with `node test.js`, I see all the writes. but with redirection, I get -1 Err#1 on stat64 [22:06] _ry: (writing to files is blocking and needs to use the thread pool) [22:06] bmizerany: _ry: oh crazy. [22:06] _ry: (you can poll on tty fds) [22:07] bmizerany: _ry: what do you mean? in node? [22:08] _ry: bmizerany: yeah - node uses non-blocking socket i/o for printing to tty but uses thread pool file stream pipe to disk [22:08] _ry: bmizerany: but sounds like a bug [22:08] mfeiri_ has joined the channel [22:08] melgray has joined the channel [22:08] _ry: bmizerany: we've got a test for that somehwere, i think [22:09] _ry: test/simple/test-stdout-to-file.js [22:09] bmizerany: _ry: checking [22:10] _ry: but apparently it only prints "test" [22:10] _ry: we should try increasing that [22:10] bmizerany: _ry: yeah. it works when I used foo. [22:10] hassox has joined the channel [22:10] bmizerany: _ry: I'll try to add another with ~10k or so [22:11] _ry: bmizerany: if you change that test to use test/fixtures/print-chars.js instead of fixtures/stdout.js [22:11] _ry: then you can modify how much it prints [22:11] mcarter has joined the channel [22:11] bmizerany: _ry: ok. let me get my head around it. I'm not sure what you mean yet. [22:14] tylerstalder has joined the channel [22:15] temp01 has joined the channel [22:16] melgray has joined the channel [22:18] felixge_: bah, that buffering that utf8 stuff is hairy [22:19] richcollins: Do I have to use a listener to get the post body? [22:19] tmpvar: woah [22:19] aho: x_x [22:20] tmpvar: ls [22:20] richcollins: or is that handled behind the scenes before request is emitted? [22:21] _ry: bmizerany: i have a patch for that test - which maybe makes it better [22:21] bmizerany: _ry: I'm updating too [22:22] richcollins: Guess the lack of anything related to body on the request proto points to the former [22:22] bmizerany: _ry: hrm. can't seem to break it. [22:22] _ry: bmizerany: /test-stdout-to-file.js [22:22] _ry: er [22:23] bmizerany: yeah. that's what I tweaked [22:23] _ry: bmizerany: http://s3.amazonaws.com/four.livejournal/20100517/0001-Improve-test-stdout-to-file.js.patch [22:23] bmizerany: one sec. pushing [22:23] _ry: me neither [22:23] _ry: that does 10mb, but seems to work [22:25] bmizerany: _ry: http://github.com/bmizerany/node/commit/bdfe84f9650bd6088ffc2bad048fe7250913d23a [22:25] _ry: bmizerany: yeah.. [22:26] _ry: so i wonder what's happening with yours? [22:27] isaacs: richcollins: yes, you must listen to "data" events. [22:27] isaacs: richcollins: your request handler is called after the head, but before the body. [22:27] isaacs: richcollins: so it literally hasnt' been sent yet, and thus, can't be exposed to you yet. [22:28] richcollins: isaacs: OK so I can just buffer the data to a body slot on the request and listen for the end of the request before I dispatch it [22:28] pjb3_ has joined the channel [22:28] richcollins: isaacs: I don't need streaming so shouldn't be an issue [22:28] isaacs: richcollins: sure. but just be careful about dying when it gets too big [22:29] richcollins: isaacs: Should be easy to do that in the buffering closure [22:29] isaacs: richcollins: you don't want to run out of memory if someone decides to upload their webcam stream. [22:29] richcollins: thx [22:29] richcollins: heh [22:30] ddollar: anyone involved with express.js around? i'd like to reopen http://github.com/visionmedia/express/issues/closed#issue/276 but i cant seem to make github cooperate [22:30] gf3 has joined the channel [22:31] bmizerany: _ry: yeah. not sure. using sys.print(data8k) [22:32] bmizerany: _ry: oh. wait. let me trying something [22:33] richcollins: Thats odd. require("http).ServerRequest is undefined [22:33] felixge_: turns out textmate doesn't know utf8 [22:33] felixge_: :D [22:33] felixge_: at least 4 byte chars [22:33] felixge_: it fucks up [22:33] jwm: hehe [22:33] richcollins: require("http").ServerRequest [22:33] richcollins: that is [22:33] jwm: textmate doesn't like network shares either heh [22:33] _ry: felixge_: i've know a minimal test case for large utf8 strings [22:33] _ry: er [22:33] _ry: character [22:34] _ry: we should really have a test where we send like half a character [22:34] _ry: and make sure the other side gets it correctly [22:34] felixge_: _ry: ok, here is what I came up with: https://gist.github.com/4f088745385772d3ccc0 [22:34] felixge_: not sure if can be simplified [22:34] felixge_: but that would be nice [22:36] _ry: c >>> 5 == 6 [22:36] _ry: what is >>> ? [22:36] _ry: bit shift? [22:36] felixge_: _ry: https://developer.mozilla.org/en/core_javascript_1.5_reference/operators/bitwise_operators [22:36] felixge_: _ry: yeah [22:36] felixge_: _ry: shifts bits to the right, inserting zeros from the left [22:37] _ry: is it not just >> ? [22:37] bmizerany: _ry: didn't budge here either http://github.com/bmizerany/node/commit/24e301078992a8e13462da7c9af743ed5af519fa [22:37] richcollins: Can anyone tell me why http.ServerRequest is undefined? https://gist.github.com/1efe59f6e5418d3d7f6e [22:37] _ry: richcollins: it's internal [22:37] richcollins: _ry: No way to add slots to it? [22:37] avidal: does >>> shift then assign or something? [22:38] _ry: richcollins: no [22:38] felixge_: _ry: https://gist.github.com/4f088745385772d3ccc0 (updated it with some comments indicating the bit-prefix that is being matched) [22:38] avidal: so c = c >> 5 is the same as c >>> 5? because i'm confused also :P [22:38] richcollins: Guess I could use __proto__ [22:38] _ry: richcollins: i think we could expose it if you wanted [22:38] avidal: oh i see the docs now [22:38] richcollins: _ry: No big deal in this instance [22:38] felixge_: According to the mozilla docs >> does not guarantee that zeroes will be inserted on the left [22:38] richcollins: just wanted to add a place to buffer the request bidy [22:38] felixge_: (so potentialy random bits could show up?) [22:38] rictic: I'm really having trouble dealing with this problem of uncatchable errors thrown from writing to a closed socket. I've posted a reduced script which reproduces the error. Can someone please look at it and tell me if I'm doing something obviously stupid? http://github.com/ry/node/issues#issue/146 [22:38] inimino: >> is sign-preserving, >>> is zero-fill [22:38] richcollins: I can just stick a slot on it [22:39] felixge_: inimino: so in my case (values from 0...255) it shouldn't make a difference? [22:39] mikeal has joined the channel [22:39] inimino: felixge_: yes [22:40] inimino: js> [ -16 >> 2 , -16 >>> 2 ] [22:40] gbot2: inimino: [-4,1073741820] [22:40] _ry: felixge_: i think c & 0xc0 looks nicer? [22:40] felixge_: _ry: how would that work exactly? [22:41] _ry: i think that's equivelent (someone check my shifting) to c >>> 5 == 6 [22:41] richcollins: rictic: Don't you need to catch the error in the callback? [22:41] richcollins: or use writeSync [22:41] n8o has joined the channel [22:41] felixge_: _ry: hm, I guess I could change that around [22:41] inimino: js> (6 << 5) .toString(16) [22:41] gbot2: inimino: "c0" [22:41] felixge_: _ry: think the rest of the code makes sense? [22:42] avidal: js> [ 5 & 0xc0 , 5 >>> 6 ] [22:42] gbot2: avidal: [0,0] [22:42] rictic: richcollins: which callback, the client's data listener? [22:42] avidal: js> [ 5 & 0xc0 , 5 >>> 5 ] [22:42] gbot2: avidal: [0,0] [22:42] avidal: js> [ 7 & 0xc0 , 7 >>> 5 ] [22:42] gbot2: avidal: [0,0] [22:42] avidal: whatever [22:42] rictic: richcollins: it's the server that throws the error, not the client, if you run the server and the client in different processes, the server crashes [22:42] _ry: felixge_: oh i have to read through it still [22:42] _ry: :) [22:43] felixge_: _ry: k :) [22:43] felixge_: _ry: let me add the test cases I have so far [22:43] felixge_: _ry: https://gist.github.com/4f088745385772d3ccc0 [22:43] richcollins: rictic: Ah I guess write doesn't take a callback to tell you if it failed to write [22:44] rictic: richcollins: Yeah, it just returns true or false. In my full script i'm looking at that result and handling it, but that code never gets called because an uncatchable exception is thrown [22:44] inimino` has joined the channel [22:44] richcollins: rictic: Can't help then. I don't know the internals [22:45] rictic: likewise :( [22:45] felixge_: can't believe the EURO sign takes 2 more bytes than the dollar - that would explain why apple charges more for products in europe - bigger IT costs ;) [22:46] marienz: prod me or some other staff member if there's a reason to put idoru back in here, assuming she'll listen to me when I tell her to leave [22:46] inimino`: yay, that was quick [22:46] KungFuHamster: those umlauts and accents aren't cheap [22:46] _ry: felixge_: http://github.com/ry/node/blob/45948e054d13fdf8ae7c8bfd12d7da58c94666b9/deps/v8/test/cctest/test-strings.cc#L314-326 [22:47] _ry: felixge_: i think that's a good test [22:48] inimino: marienz: ok, thanks [22:48] felixge_: _ry: ok let me try [22:48] _ry: "\u02e4\u0064\u12E4\u0030\u3045" [22:48] _ry: like make a buffer with all those bytes [22:49] _ry: and try feeding the stream various lengths [22:49] _ry: (all possible lengths :)) [22:50] bmizerany: _ry: here is the project I'm working on. it's the one causing the crazy stdout bug. http://github.com/bmizerany/swirl-node/blob/master/lib/swirl.js#L67 [22:51] inimino: ^.^ [22:52] inimino: avidal: it should be safe to play with the bot again (without getting me and it k-lined) [22:52] inimino: hm, I guess I should resurrect the bot too [22:53] gbot2 has joined the channel [22:54] WALoeIII has joined the channel [22:55] _ry: felixge_: some comments in there would be great [22:55] javajunky has joined the channel [22:55] _ry: i find it difficult to read [22:55] felixge_: _ry: k, adding them [22:56] _ry: felixge_: this is one of these bugs that's been keeping me up at night [22:56] _ry: bmizerany: seems like that should work.. [22:57] felixge_: _ry: hitting utf8 boundaries with setEncoding? [22:57] _ry: yes [22:58] _ry: felixge_: maybe we should call it Utf8Decoder utf8decoder.js [22:59] bmizerany: _ry: would the dtruss output help? [23:02] _ry: bmizerany: sure let's paste it [23:03] felixge_: _ry: https://gist.github.com/4f088745385772d3ccc0 [23:03] felixge_: _ry: let me know if this is easier to digest [23:04] bmizerany: _ry: https://gist.github.com/2568df9e46974bf759e6 [23:05] bmizerany: _ry: x.sh is a wrapper script for `node test.js > out` [23:06] _ry: bmizerany: i think you need to get it to follow the fork [23:06] freshtonic has joined the channel [23:07] _ry: this is only a trace of x.sh [23:07] bmizerany: _ry: ah [23:07] _ry: dtruss -f [23:07] darkf has joined the channel [23:09] _ry: felixge_: what do you think about concating little strings with bigger ones [23:09] _ry: so you don't get single character 'data' events [23:10] _ry: felixge_: i mean the small string gotten from line 27 [23:10] felixge_: _ry: not sure I understand [23:10] felixge_: _ry: you talking about the test case? [23:10] _ry: felixge_: no, in the write function [23:11] charlesjolley has joined the channel [23:11] micheil: isaacs: hmm.. you should set master as default branch [23:11] isaacs: micheil: whu? [23:11] isaacs: isn't it already? [23:12] _ry: felixge_: like if there are more bytes in the buffer - then decode them and prepend the character to the beginning [23:12] micheil: nup [23:12] micheil: I did a fresh checkout yesterday, and I noticed the error I reported when I went to install [23:13] bmizerany: _ry: sorry. had to clean my keys from the trace. here it is: https://gist.github.com/b05f45ee64c3b8e4c1e0 [23:13] felixge_: _ry: I mean I'm essentially combining single byte buffers into the charBuffer until it makes a complete char [23:13] isaacs: micheil: ok, now master is the *only* branch on my npm [23:13] felixge_: _ry: not sure what you want to change [23:13] isaacs: micheil: maybe you have isaacs/stable set up as a remote or something? [23:13] micheil: nup [23:13] isaacs: micheil: anyway, i just deleted all the others [23:14] isaacs: micheil: so you should need a time machine to pull any other branch [23:14] _ry: felixge_: but you do onData() for tht single char [23:14] micheil: isaacs: btw, on the tags, use annotated tags. [23:15] micheil: git tag -a vX.Y.Z -m "Releasing version X.Y.Z" [23:15] isaacs: micheil: oh, hey, the simple install uses that tarball from the stable branch [23:15] isaacs: i see [23:15] _ry: felixge_: i'm saying maybe you can wait until you toString() the rest of the buffer [23:15] felixge_: _ry: yeah [23:15] _ry: and do at the end onData(singleChar + rest) [23:15] felixge_: _ry: well, how would I do that without memcpy'ing the entire buffer? [23:15] _ry: just store that singleChar in a local variable [23:15] _ry: concating strings = cheap [23:15] felixge_: _ry: oh [23:16] felixge_: _ry: I see what you mean [23:16] felixge_: _ry: yeah, that can be done [23:16] felixge_: I guess I'm still emitting buffers not strings yet [23:16] _ry: i wish you could link to line numbers in gists [23:16] felixge_: mainly because its nice to test [23:17] felixge_: _ry: ok, I have to run to the apple store buying overpriced adapters - but yeah I think your idea is good - I'll do that [23:18] bmizerany: _ry: yeah. does 401 mean anything to you? [23:19] _ry: bmizerany: i was just thinking about it [23:19] _ry: i don't think we call ioctl anywhere.. [23:20] bmizerany: 0x1 was a dup of 0x3 which was returned by open() [23:20] bmizerany: ACTION keeps a strait face to keep the others assuming he knows what he's talking about [23:20] _ry: yeah [23:20] sudoer has joined the channel [23:21] _ry: it's just the normal STDOUT_FILENO [23:21] bmizerany: ah [23:21] bmizerany: I figured. wasn't sure [23:21] _ry: i don't know what that dup2 buisness is about [23:21] bmizerany: I just saw it raise and error after open. [23:21] bmizerany: heh. is the shell redirection? [23:21] _ry: i guess? [23:21] _ry: it must be sh that calls it [23:22] _ry: opens out [23:22] _ry: then dup2s it [23:22] _ry: yeah sure [23:22] _ry: there should be some call to the thread pool though.. [23:23] _ry: maybe node is getting confused and thinking that stdout is a tty [23:24] bmizerany: _ry: I thought it might be my term or screen session. I quite them both and tried again. nada [23:24] bmizerany: _ry: hrm [23:24] _ry: bmizerany: lets put a little debug output in there [23:24] bmizerany: _ry: ok. suggestions to where? [23:24] _ry: http://github.com/ry/node/blob/1036aa9762c7f08a0f0e9552da7c4fbbb6eec091/src/node.js#L154 [23:24] pjb3 has joined the channel [23:25] _ry: on both branches of that condition [23:25] bmizerany: _ry: k. one sec. [23:25] _ry: put like debug("blocking") debug('notblocking') [23:25] _ry: then run NODE_DEBUG=1 node file.js > out [23:25] _ry: (you have to recompile) [23:26] bmizerany: _ry: I'm on 0.1.95; do you think I should try to debug this version? [23:26] mjr_: _ry: when you make it through your mental event loop, can you look at this libev pcap integration issue: https://gist.github.com/ffb96f7bc09dc3548cdd [23:26] _ry: bmizerany: it's the same as HEAD [23:27] _ry: we should assign office hours in #node.js [23:27] mjr_: ha [23:27] bmizerany: ahah [23:27] _ry: bmizerany: i expect it to output 'blocking' [23:27] _ry: bmizerany: we're piping to file, we should use the thread pool to write to it [23:28] bmizerany: _ry: I think you may have a chicken or egg problem here. :) [23:28] bmizerany: trying to write to stdout before stdout [23:28] _ry: bmizerany: debug writes to stderr [23:28] mjr_: _ry: my issue is that ev seems to be buffering the output somewhere before waking me up. When my pcap_readable() function is called, there is actually quite a bit of data available to read, but it doesn't call me until lots of data gets built up behind it. [23:28] _ry: stderr is special [23:28] bmizerany: ah right [23:29] bmizerany: ACTION goes for smoke while this compiles [23:29] _ry: mjr_: camel case in js :) [23:29] _ry: clearly your problem :) [23:29] mjr_: oh shit [23:30] mjr_: I'll get on that right away [23:30] mumrah_ has joined the channel [23:30] mjr_: So are lines 84-87 right? [23:30] _ry: mjr_: just a sec, trying to grok this [23:32] _ry: yes, seems so [23:33] mjr_: The odd part here is line 45, pcap_readable is called by libev when the pcap fd is readable, but all three reads succeed. [23:33] mjr_: I'd expect the second and third to block. [23:34] bmizerany: _ry: how do I get access to sys in src/node.js? require doesn't seem to be working in there [23:34] _ry: what does pcap_dispatch do? [23:34] mjr_: Further, there's a huge delay before the first time pcap_readable gets called. None of the data gets lost though [23:34] _ry: bmizerany: debug() itself is defined [23:34] mjr_: pcap_dispatch reads from the pcap fd, in this case, stopping after 1 packet. [23:35] mjr_: packet_ready is the callback from pcap_dispatch [23:35] _ry: mjr_: could it be that pcap is buffering? [23:35] mjr_: yeah, it could be that. How can I debug this with libev? [23:35] isaacs: gr, multiple desktops are lame. it's like, "context switching isn't expensive enough, let's make it even easier to forget about stuff" [23:36] _ry: mjr_: well you an dtruss it [23:37] _ry: but i expect the error isn't with libev [23:37] _ry: should you maybe also wait for EV_WRITE ? [23:37] mjr_: that fd shouldn't ever be writable though [23:37] bmizerany: _ry: http://github.com/bmizerany/node/commit/db0ac32e02557c91d8cbf577bdb52c22a516ad16 [23:38] bmizerany: _ry: nothing is printed in debug [23:38] mjr_: Yeah, I'm thinking that this is some interaction between pcap and libev, but I'm new to both, so it's hard to say. [23:38] _ry: bmizerany: you have to setenv NODE_DEBUG=1 [23:38] bmizerany: oh [23:39] _ry: mjr_: libev is pretty simple - it should just be calling select() on your fd [23:39] bmizerany: _ry: self flush readyState = open --- that's all she wrote [23:39] _ry: bmizerany: that's all? [23:40] bmizerany: _ry: yeah. one sec. making sure of something [23:40] _ry: bmizerany: node script >& debug_log > out [23:40] _ry: (or however that's done) [23:40] dgathright_ has joined the channel [23:40] bmizerany: _ry: heh. I got it. one sec [23:40] dgathright_ has joined the channel [23:42] _ry: mjr_: you should probably use pcap_setnonblock() [23:42] mjr_: I did not know about dtruss. Also, dtruss seems to crash node. [23:42] _ry: mjr_: dtruss = strace (but using dtrace), and wee bugs ! [23:42] mjr_: I'm used to strace on linux, and I've wanted the same thing on OSX. [23:43] mjr_: Lemme try this nonblock thing. [23:43] bmizerany: _ry: I'm doing a `make clean && make && make install` to be sure [23:43] _ry: bmizerany: ok [23:44] _ry: if it's not printing lots of stuff with NODE_DEBUG, then there are problems [23:44] bmizerany: _ry: yeah. it prints next to nothing [23:44] _ry: er [23:44] _ry: you have to use the debug build [23:44] _ry: i forgot , we compile that out for the release [23:45] _ry: ./configure --debug && make [23:45] bmizerany: ah [23:45] bmizerany: _ry: I've erraticated all presence of node. re-cloning and building. [23:46] sh1m has joined the channel [23:46] bmizerany: I had a version in homebrew too. that could have been a problem too [23:55] bmizerany: shit. forgot the --debug. err [23:57] EF has joined the channel [23:58] sh1mmer has joined the channel [23:59] steadicat has joined the channel