[00:03] ryah: tempted to write ryan-mq
[00:05] mediacoder: :-D
[00:05] orlandov: ryah: an amqp mq or your own beast?
[00:06] ryah: to avoid amqp
[00:06] ryah: its one of the worst protocols ever
[00:06] orlandov: heh, do tell
[00:06] ryah: go download the 200 page spec
[00:07] orlandov: hah- point made :D
[00:07] ryah: you can't even write a parser for it, you have to write a parser generater
[00:07] ryah: because they wanted to be general
[00:07] ryah: "thanks!"
[00:07] orlandov: sounds a lot like xml
[00:07] ryah: it's got that too
[00:08] orlandov: i wonder why people never make these things as simple as they should be
[00:09] orlandov: and instead try to boil the ocean, as my friend ingy used to say
[00:09] ashb: STOMP is simple :)
[00:09] ryah: because it's being written by a bunch of large corperations:
[00:09] ryah: Copyright (c) 2006-2008 Cisco Systems, Credit Suisse, Deutsche Boerse
[00:09] ryah: Systems, Envoy Technologies, Inc., Goldman Sachs, IONA Technologies PLC,
[00:09] ryah: iMatix Corporation, JPMorgan Chase Bank Inc. N.A, Novell, Rabbit
[00:09] ryah: Technologies Ltd., Red Hat, Inc., TWIST Process Innovations Ltd, WS02
[00:09] ryah: Inc. and 29West Inc. All rights reserved.
[00:09] jfd: Guys, I'm developing a "game-server" + client using node.js and HTML5 exclusively. Please clone and try at http://github.com/jfd/wpilot
[00:09] ryah: yes stomp is nice. it need a little extension
[00:10] jfd: Im sure you are all familiar with XPliot! ;-)
[00:11] orlandov: jfd: cool!
[00:12] jfd: orlandov: tnx... It's the first game (what I can tell) that supports mulitplayer over HTML-standards..
[00:12] orlandov: jfd: thank you for not using flash
[00:13] jfd: orlandov: It currently lacks interpolation so if you connect to a server with bad ping, you will notice it.
[00:13] orlandov: node.js seems like it'd be a nice fit for mmogs
[00:13] ithinkihaveacat has joined the channel
[00:13] orlandov: jfd: that should just be a bit of clientside work though right?
[00:13] blackdog: orlandov: thanks for those fixes
[00:14] orlandov: blackdog: oh np, sorry it was broken
[00:14] orlandov: i think i was just tired and forgot to implement that stuff
[00:14] blackdog: no worries, working great now,
[00:14] orlandov: yay :)
[00:14] jfd: orlandov: well, Flash is used as a fallback, if you're not using a WebSocket compatible browser,
[00:15] jamiew_ has joined the channel
[00:15] orlandov: jfd: are you just using flash for WS or for display and all?
[00:15] jfd: orlandov: only for WS
[00:15] orlandov: rad :)
[00:16] steadicat has joined the channel
[00:16] jfd: orlandov: if necessary
[00:16] jfd: :)
[00:16] ryah: jfd: demo somewhere?
[00:18] jfd: ryah: I could provide a demo, but tt would be laggy for you all (if you are across europe), without network interpolation.. .
[00:19] jfd: ryah: I have a server running at http://80.216.40.142:6114/ but it's in Sweden/Europe.. You are free to try if you want
[00:21] orlandov: jfd: looks really nice man
[00:22] orlandov: i got a message about a malformed message
[00:22] orlandov: but otherwise
[00:23] jfd: orlandov: You are proably using an untested browser! :)
[00:23] orlandov: yeah im using one of the chromium nightlies :S
[00:23] jfd: orlandov: May be the reason why
[00:24] konobi: I got the same thing with Safari standard build)
[00:25] ithinkihaveacat: is there any way to set a timeout on http.ServerResponse? i.e. if response.finish() is never called, then timeout?
[00:26] ithinkihaveacat: i want to handle the response by emitting an event, and let the listeners pick it up, but if there's nothing listening for the event, then the response gets dropped
[00:26] orlandov: is that something you could accomplish with setTimeout/clearTimeout?
[00:27] jfd: konobi: It's kind of shakey with slow packets for now... It will give u an error if the connection is really slow (that's why I wouldnt provide you guys with a test link from the begining! ;-) )
[00:28] ithinkihaveacat: possibly, but something could be sending to the response really slowly ... i wouldn't want to finish() in that case
[00:28] orlandov: its too bad you can't use UDP, which is what most games use i think
[00:28] orlandov: ithinkihaveacat: ah gotcha
[00:29] jfd: konobi: I suggest that you clone the repo and try with your friends in the neighborhood
[00:29] konobi: heh
[00:29] ithinkihaveacat: oh, if i do if (emitter.listeners("foo")) { emitter.emit("foo", response); } else { response.finish(); } is that race-condition safe?
[00:30] ithinkihaveacat: i.e. can listeners get added/removed between the check at emitter.listeners("foo") and emitter.emit()?
[00:31] jfd: orlandov: Yes, but aslo, it's depends what game u are creating.. If u are developing a new QUAKE u probibally should go for UDP but else it's no big deal. Take WOW for example, it's uses TCP. No problemo
[00:31] orlandov: konobi: jfd: ryah: started a server here (linode, california) http://2wycked.net:6114/
[00:31] orlandov: jfd: oh crazy, didn't know that
[00:31] jfd: orlandov: slow
[00:31] orlandov: hehe disconnected for unknown reason, but latency was beetter
[00:32] jfd: orlandov: no response
[00:32] konobi: orlandov: ENORESPONSE
[00:32] jfd: orlandov: the main problem with my game at this point is over head using JSON as the protocol format
[00:32] orlandov: jfd: http://pastie.org/790694
[00:32] orlandov: konobi: ya crashed
[00:32] orlandov: jfd: ahh
[00:33] brandon_beacher has joined the channel
[00:35] jfd: orlandov: I will fine-tune the game protocol soon.. I'm pretty convince that U could use node.js+websocket+html5 to provide a suitable gaming environment! :-)
[00:36] orlandov: jfd: it looks great so far, i'm impressed
[00:36] orlandov: ACTION can't wait for hardware accelerated canvas
[00:40] jfd: orlandov: it's not canvas fault, its the netowrk connection! :-)
[00:42] jfd: orlandov: any how, me and two friends are implementing network interpolation soon, it will make some difference
[00:42] orlandov: jfd: connection is a big part... but canvas usually pegs my CPU
[00:42] jfd: orlandov: what is your FPS?
[00:43] orlandov: jfd: around 20-40
[00:46] jfd: ryah: speaking of websocket.. I looked into one of the latest websocket libraries(http://github.com/zimbatm/nodejs-http-websocket)... Zimbatm has patched node.js with a "hijack" the HTTP connection (it's part of the standard what I can tell).. Can we except this from nodes original implementation (I'm not that big of at fan of using patches)?
[00:47] jfd: orlandov: oh, ok.. buy a new computer.. :P Im hiting 70 FPS in safari (sitting on a macbook, last years release)
[00:48] orlandov: haha yeah
[00:48] orlandov: im on my mediocre work workstation
[00:48] orlandov: ill try it when i get home on my core2 duo :)
[00:49] jfd: ryah: It would be aweseome If U could use just one network port instead of two
[00:52] ryah: jfd: ?
[00:52] jfd: orlandov: Sounds good! :-) Any how, the game is in pre-alpha, it's alot of things that needs to be done to the network... So far I have only try'ed with good connections here in Sweden.. The test so far has been impressive... Time will tell if its possible to use WebSocket off-shore
[00:53] jfd: ryah: http://github.com/zimbatm/nodejs-http-websocket/blob/master/patches/0001-http-ServerResponse.prototype.sendHeader-change.patch
[00:53] jfd: ryah: http://github.com/zimbatm/nodejs-http-websocket/blob/master/patches/0002-http-HTTPConnection-now-has-a-hijack-method.patch
[00:54] ryah: oh interesting
[00:54] ryah: the hijack thing i want to put off until i merge net2.
[00:55] ryah: (which i should stop talking about and just do!)
[00:55] jfd: ryah: As I said earlier, I think it's part of the WebSocket standard...
[00:55] jfd: ryah: great! :)
[00:56] jfd: ryah: So, Net2 will be able to do this?
[00:59] ryah: the http binding for net2 isn't done
[00:59] ryah: but it should be easier - you won't hav to go into c++ to "hijack" the stream
[01:02] jfd: ryah: I see.. Any how, Im not that into the WebSocket standard.. But if "hijack" (I think they call i "upgrade") is part of the standard, I suggest that you take it in for a consideration.. :)
[01:03] ryah: yeah
[01:06] erichocean has joined the channel
[01:11] xnt14 has joined the channel
[01:26] bacon has joined the channel
[01:26] felixge has joined the channel
[01:26] bacon: !logs
[01:35] felixge has joined the channel
[01:37] bacon has joined the channel
[01:38] bacon: What is the latest on the max. connections thread on the list? What is the max # of clients people have gotten connected to a nodejs server?
[01:40] scudco has joined the channel
[01:51] bryanl has joined the channel
[01:57] jacobolus has joined the channel
[01:57] rednul_ has joined the channel
[02:01] pjb3: Is there a function in node.js to parse a full URL into it's parts
[02:02] pjb3: like var url = require("url").parse("http://localhost:8080/")
[02:02] pjb3: url.host = "localhost"
[02:02] pjb3: url.post == 8080
[02:03] pjb3: that kind of thing?
[02:03] pjb3: url.host == "localhost"
[02:03] bpot has joined the channel
[02:07] steadicat has joined the channel
[02:08] ithinkihaveacat: sys.puts(sys.inspect(url.parse('http://user:pass@host.com:8080/p/a/t/h?query=string#hash')));
[02:08] ithinkihaveacat: where sys = require('sys'), url = require('url')
[02:08] ithinkihaveacat: like that?
[02:09] ithinkihaveacat: see http://nodejs.org/api.html#_url_module
[02:10] ithinkihaveacat: what's wrong with what you had?
[02:25] pjb3: ithinkihaveacat: I was using host when I wanted hostname
[02:40] softdrink has joined the channel
[02:44] sprsquish has joined the channel
[02:47] RayMorgan has joined the channel
[02:51] pjb3: So I have a very simple http server: http://gist.github.com/284396
[02:52] pjb3: When I run apache bench on it
[02:52] pjb3: ab -c 5 -n 20000 http://127.0.0.1:8080/
[02:52] pjb3: Around 16000 requests, it hangs
[02:52] pjb3: http://gist.github.com/284397
[02:59] binary42 has joined the channel
[03:28] stephenlb: 16k wow
[03:30] bryanl has joined the channel
[03:41] steadicat has joined the channel
[03:52] cheapRoc has joined the channel
[03:53] aho has joined the channel
[04:25] stevestmartin has joined the channel
[04:26] scudco has joined the channel
[04:31] gf3 has joined the channel
[04:33] kriszyp_ has joined the channel
[04:58] isaacs has joined the channel
[05:05] stephenlb: !!!
[05:10] cloudhead has joined the channel
[05:10] jacobolu_ has joined the channel
[05:13] markwubben has joined the channel
[05:57] jacobolus has joined the channel
[05:58] jamiew has left the channel
[06:07] RayMorgan has joined the channel
[06:18] steadicat has joined the channel
[06:30] jacobolus has joined the channel
[06:46] achew22 has joined the channel
[06:53] micheil has joined the channel
[06:56] jacobolu_ has joined the channel
[06:58] jamiew has joined the channel
[07:00] onar has joined the channel
[07:03] jamiew has left the channel
[07:20] achew22 has left the channel
[07:37] jacobolus has joined the channel
[07:41] scudco has joined the channel
[07:44] scudco1 has joined the channel
[07:47] teemow has joined the channel
[07:56] jacobolus has joined the channel
[08:05] bentomas has joined the channel
[08:11] lifo has joined the channel
[08:20] bentomas has left the channel
[08:22] mikeal has joined the channel
[08:23] qFox has joined the channel
[08:27] aguynamedben has joined the channel
[08:27] jacobolus has joined the channel
[08:31] jamiew has joined the channel
[08:33] mikeal has joined the channel
[08:34] jacobolus has joined the channel
[08:42] aguynamedben has joined the channel
[08:48] micheil: ryah: you about?
[08:48] micheil: a few of us were getting errors in the tests yesterday
[08:50] micheil: ryah: I'm getting one on test-fs-sendfile, inimino was getting a whole bunch of promise related ones
[09:01] DamZ has joined the channel
[09:39] mattly has joined the channel
[09:43] ithinkihaveacat: what's the best way to inherit from, say, events.EventEmitter?
[09:44] ithinkihaveacat: for loop through the keys of events.EventEmitter.prototype and copy to myfunction.prototype?
[09:47] mikeal has joined the channel
[10:09] felixge has joined the channel
[10:15] ayo has joined the channel
[10:22] micheil: ithinkihaveacat: process.inherits(MYTHing, process.EventEmitter
[10:22] micheil: or events.EventEmitter
[10:22] micheil: what ever it is now
[10:23] ithinkihaveacat: ah, process.mixin() perhaps?
[10:24] micheil: no
[10:24] micheil: process.inherits
[10:24] micheil: I'm not aware of the changes around EventEmitter though, so it may be process.inherits(somethnig, events.EventEmitter);
[10:25] micheil: rather then process.inherits(something, process.EventEmitter);
[10:30] ithinkihaveacat: oh okay, looks like process.inherits() add .prototype to its arguments and does process.mixin() on them, or something close to that
[10:30] ithinkihaveacat: (there is no process.inherits documented at http://nodejs.org/api.html)
[10:35] ithinkihaveacat: sees to work fine though, thanks
[10:35] micheil: hmm.. it's definitely there
[10:35] micheil: I'll add it in
[10:39] micheil: ryah / inimino / isaacs: you guys about at all?
[10:39] inimino: micheil: yeah
[10:39] micheil: with process.inherits, would you describe it around classes or constructors?
[10:40] micheil: it uses, ctor and superctor in the source
[10:40] inimino: I haven't read the source
[10:40] inimino: pseudo-class systems built on JavaScript are generally a mistake
[10:41] micheil: I'm pretty sure it's classical inheritance.
[10:41] inimino: I consider process.inherits in that category
[10:41] micheil: it sets the prototype of one object to equal another's, then sets the constructor back to the first object.
[10:41] inimino: it's definitely in the category of things I think shouldn't be in node core :)
[10:42] micheil: inimino: although, process.inherits is needed for this sort of thing
[10:42] micheil: it's used throughout the core for all things that emit events
[10:42] inimino: sure, that could be fixed though
[10:43] inimino: or it could still be used but not exported
[10:43] ithinkihaveacat: in my case, i just want an object that i can addListener(), and emit() etc. on
[10:43] micheil: I suppose you could use process.mixin
[10:43] kennethkalmer has joined the channel
[10:43] ithinkihaveacat: i don't care whether those methods are mixed in or if prototype is changed
[10:43] micheil: ithinkihaveacat: right now, I think inherits is the best way to go
[10:43] micheil: as that's what the core codebase uses for that
[10:44] micheil: eg, line 200 of node.js: process.inherits(exports.Promise, exports.EventEmitter);
[10:44] ithinkihaveacat: okay, thanks
[10:44] felixge: in your constructor you'll also have to call the parent constructor
[10:44] micheil: ACTION never has..
[10:44] felixge: i.e. process.EventEmitter.call(this);
[10:45] felixge: Micheil: yeah, that might work because JS is cutting your some slack : )
[10:45] micheil: felixge: does that actually do much?
[10:45] felixge: but its not the way to go
[10:46] micheil: okay then
[10:46] micheil: ACTION will have to change node-smtp
[10:46] felixge: I would think it initializes the internal array for storing the listeners
[10:46] micheil: nup
[10:46] micheil: that's done in node
[10:46] micheil: if (!this._events) this._events = {};
[10:46] micheil: lines 189, 180, 167
[10:47] inimino: ACTION looks at source
[10:47] micheil: :P
[10:47] micheil: inimino: I'm on HEAD so your code may vary
[10:47] micheil: ryah: Do you want process.inherits to be documented?
[10:47] inimino: I'm on HEAD, but looking at github anyway
[10:47] micheil: k
[10:48] micheil: src/node.js
[10:48] inimino: I'm against documenting it if it encourages people to use it
[10:48] micheil: mixin is just jquery's .extend
[10:48] inimino: yes
[10:48] inimino: which I'm not a big fan of either :-)
[10:49] micheil: neither, I'm a dojo guy.
[10:49] ithinkihaveacat: inimino: don't quite follow ... what's the alternative to process.inherits()? process.mixin()?
[10:50] micheil: ithinkihaveacat: you could use: MyThing = process.mixin(true, MyThing, process.EventEmitter);
[10:50] micheil: although, it feels like a hack
[10:50] micheil: ithinkihaveacat: I think you're safest with inherits for the time being
[10:52] ithinkihaveacat: i'll stick with that, just starting with nodejs anyway
[10:52] inimino: ithinkihaveacat: no, you never need to use either one of those functions
[10:52] micheil: inimino: hmm?
[10:52] micheil: inimino: if they want a constructor that can emit events, surely they do need to use that?
[10:52] inimino: micheil: not at all
[10:53] micheil: News to me.
[10:53] inimino: simply do inheritance in the ordinary way by setting the prototype
[10:53] inimino: function MyThing(){ ... }
[10:54] inimino: MyThing.prototype=new process.EventEmitter()
[10:56] micheil: inimino: I suppose, not that anyone ever really uses ctor.super_
[10:56] inimino: I would hope not :-)
[10:56] micheil: ithinkihaveacat: do what inimino just posted ^^
[11:06] isaacs: if you want to avoid calling the parent ctor twice, you could do MyThing.prototype = Object.create(process.EventEmitter.prototype);
[11:07] isaacs: or just MyThing.prototype.__proto__ = process.EventEmitter.prototype
[11:07] micheil: heh heh new in v8, due to ES5
[11:07] ithinkihaveacat: inimino: won't that set MyThing.prototype.constructor == process.EventEmitter instead of MyThing?
[11:08] micheil: ithinkihaveacat: try what isaac says, you can always test out various ones
[11:08] inimino: ithinkihaveacat: yes
[11:09] inimino: ithinkihaveacat: if you care about the .prototype.constructor, you can set that yourself; I consider using .constructor a poor practice so I don't recommend bothering with it
[11:12] isaacs: ithinkihaveacat: if you set __proto__ directly, then no, it'll add, but it'll be deeper in the proto chain, so it won't matter, because it'll just shadow
[11:13] isaacs: but if you set it using Object.create, then it'll overwrite the whole Child.prototype with an object that has a "constructor" member.
[11:17] _sh has joined the channel
[11:42] felixge has joined the channel
[12:06] un0mi has joined the channel
[12:06] brosner has joined the channel
[12:08] brosner has joined the channel
[12:53] felixge_ has joined the channel
[13:21] elbart has joined the channel
[13:50] yaroslav has joined the channel
[13:55] micheil: hey, felixge_, did you see: http://thechangelog.com/post/341389622/node-paperboy-a-node-js-static-page-module
[13:55] felixge_: Micheil: yeah : )
[13:55] felixge_: not sure why its listed there
[13:55] micheil: because, they review and post about everything open source
[13:55] micheil: (especially stuff on github)
[13:56] felixge_: I mean its pretty much just a node's cat function hooked up to the http request ;)
[13:56] micheil: so
[13:56] micheil: it does something,.
[13:56] felixge_: I guess ^^
[13:57] micheil: technoweenie's twitter-node is also up there
[13:57] micheil: same with picard
[13:58] felixge_: yeah those are better projects
[13:58] micheil: I like paperboy.
[13:58] micheil: :P
[13:59] felixge_: yeah, but it was like a 1 hour hack
[13:59] felixge_: dirty is a more interesting project for me :)
[14:00] felixge_: I did however find the approach of returning a delegate object interesting
[14:00] felixge_: I'm wondering if 'delegate' is the right word, but the concept might work well for other stuff
[14:01] micheil: dirty?
[14:06] stevestmartin has joined the channel
[14:44] Booster has joined the channel
[14:52] kriszyp has joined the channel
[15:03] alex-desktop has joined the channel
[15:10] softdrink has joined the channel
[15:11] felixge_: Micheil: http://github.com/felixge/node-dirty
[15:12] micheil: felixge_: c?
[15:13] felixge_: Micheil: c?
[15:13] micheil: as in, is it a c/c++ lib or pure js?
[15:13] felixge_: pure js
[15:14] micheil: nice
[15:14] micheil: what's the <250 LoC mean?
[15:15] felixge_: LoC = lines of code
[15:16] micheil: oh
[15:16] micheil: also, the UUID probably isn't the best.
[15:16] felixge_: you mean the implementation ?
[15:16] micheil: hence it's dirty
[15:16] micheil: yeah
[15:16] felixge_: well, its hard to tell
[15:16] felixge_: I'm not sure how Math.random() is done in v8
[15:16] micheil: http://ajaxian.com/archives/uuid-generator-in-javascript
[15:17] micheil: more robust
[15:17] micheil: not that much extra code
[15:17] micheil: (on a quick google search)
[15:17] felixge_: I don't like the uuid spec : )
[15:17] felixge_: but it doesn't look like the uuids produced by this implementation would be any more random
[15:17] micheil: well, you don't need to use the separator characters
[15:17] felixge_: nor faster
[15:18] felixge_: yes, that's one thing I don't like
[15:18] micheil: I suppose that is using math.random too
[15:18] felixge_: also I don't see why I should set some bits just to say "Hey I'm following the spec"
[15:18] felixge_: it is
[15:18] micheil: oh well, I'm off for tonight
[15:18] micheil: G'night
[15:19] felixge_: gn8 :)
[15:37] un0mi has joined the channel
[15:43] pjb3 has joined the channel
[16:00] steadicat has joined the channel
[16:06] softdrink has joined the channel
[16:31] lifo_ has joined the channel
[16:39] jfd has joined the channel
[16:45] ayo has joined the channel
[16:52] kriszyp has joined the channel
[16:54] Booster has joined the channel
[16:58] stevestmartin has left the channel
[17:01] onar has joined the channel
[17:08] paulca has joined the channel
[17:13] pjb3 has joined the channel
[17:17] jamiew has joined the channel
[17:18] binary42 has joined the channel
[17:32] ithinkihaveacat has joined the channel
[17:43] deanlandolt has joined the channel
[17:47] ashb: felixge_: did you ever try using a bare git repo and a post-receive hook?
[17:47] ashb: <http://debuggable.com/posts/git-tip-auto-update-working-tree-via-post-receive-hook:49551efe-6414-4e86-aec6-544f4834cda3>
[18:03] elliottcable has joined the channel
[18:04] paulca has joined the channel
[18:24] felixge_: ashb: I don't use bare repos
[18:24] erichocean_ has joined the channel
[18:24] felixge_: ashb: but I would think that it should work the same
[18:25] ashb: felixge_: i'm trying right now with a non-bare repo
[18:25] ashb: using something lsighlty different
[18:25] ashb: http://toroid.org/ams/git-website-howto
[18:25] ashb: but when ever i set core.worktree git push fails with './objects/XX: No such file or directory;
[18:26] ashb: it seems that this version is igoring GIT_DIR or similar
[18:26] ashb: and trying to find the objects dir from inside the worktree dir
[18:26] felixge_: ashb: hm, old git version?
[18:26] felixge_: I usually have good look with the people in #git
[18:26] ashb: 1.6.3.3 on server, 1.6.6.1 client
[18:26] ashb: will try there
[18:31] dnolen has joined the channel
[18:59] cloudhead has joined the channel
[19:06] joshbuddy has joined the channel
[19:08] kriszyp has joined the channel
[19:10] scudco has joined the channel
[19:16] un0mi has joined the channel
[19:17] lifo has joined the channel
[19:24] quirkey has joined the channel
[19:33] bpot has joined the channel
[19:37] technoweenie has joined the channel
[19:39] bry has joined the channel
[19:48] mattly has joined the channel
[19:56] egorFiNE has joined the channel
[19:57] egorFiNE: felixge_: ping?
[19:57] felixge_: egorFiNE: sup?
[19:57] egorFiNE: felixge_: hi!
[19:57] felixge_: hi
[19:57] egorFiNE: felixge_: I think I've found a bug or smth in multipart upload module
[19:57] egorFiNE: or not a bug but a feature :)
[19:58] felixge_: shoot : )
[19:58] egorFiNE: an UTF-8 form (with files) posted to Node.js ends up being in binary rather than unicode. Which is good for files data but not for strings
[19:58] bentomas has joined the channel
[19:58] egorFiNE: means I cannot actually get a utf-8 string out of it. what to do?
[20:03] bentomas has left the channel
[20:05] felixge_: egorFiNE: can you setup a test case for that?
[20:06] felixge_: I think we can probably fix this somehow
[20:06] egorFiNE: easy
[20:06] egorFiNE: I remember the same trouble in perl in 2004
[20:06] felixge_: hadn't expected this to be a problem, but if you get me a test that shows it I'll fix it : )
[20:07] egorFiNE: they ended up with utf8/binary conversion and flagging functions that turned UTF-8 support into a real mess )
[20:07] egorFiNE: let me show you
[20:07] felixge_: probably will have to expose some function to convert unicode to utf8
[20:07] felixge_: well binary -> utf8 is lossy
[20:08] egorFiNE: depends on what you've got in that binary
[20:08] felixge_: yeah
[20:08] egorFiNE: ACTION preparing test case
[20:08] felixge_: if its valid utf8 than it shouldn't be a problem
[20:12] binary42 has joined the channel
[20:17] gwoo has joined the channel
[20:17] un0mi has joined the channel
[20:19] RayMorgan has joined the channel
[20:21] dnolen has joined the channel
[20:23] dnolen has joined the channel
[20:27] egorFiNE: damn
[20:27] egorFiNE: spent twenty minutes debugging a testcase
[20:27] gwoo has joined the channel
[20:27] egorFiNE: why? because I attached my testing server to port 8282, which was occupied by fastcgi
[20:27] egorFiNE: dumb me
[20:27] egorFiNE: felixge_: anyway, here it is: http://pastie.org/791543
[20:28] egorFiNE: felixge_: to get expected bahaviour - type in english
[20:28] egorFiNE: felixge_: to get unexpected, type in "ОСТРОВ" which is island in cyrillic
[20:28] egorFiNE: felixge_: you must have utf-8 terminal to see
[20:29] egorFiNE: felixge_: the correct look of that word is: OCTPOB (I typed that in latin letters that has the same shape as cyrillic letters in the prev. word)
[20:29] egorFiNE: felixge_: cyrillic: "ОСТРОВ"; latin: "OCTPOB", must look the same
[20:30] egorFiNE: felixge_: what happens is that I see double encoded UTF8 in terminal. You probably already understood why:)
[20:31] felixge_: egorFiNE: ok, give me a moment to look into it
[20:31] egorFiNE: sure.
[20:31] egorFiNE: thanks
[20:41] isaacs has joined the channel
[20:49] isaacs: ithinkihaveacat: oh, you know, that inheritance thing from last night...
[20:49] isaacs: ithinkihaveacat: you could just use instanceof rather than testing .constructor
[20:50] ithinkihaveacat: isaacs: that's true
[20:51] micheil: hmm.. redis looks interesting
[20:53] micheil: same with writing c modules though..
[20:53] ithinkihaveacat: there's always some subtle problem with inheritance and js ...
[20:53] isaacs: ithinkihaveacat: then it doesn't matter, as long as it's in the prototype chain
[20:53] isaacs: ithinkihaveacat: you have to think about it differently than classic inheritance, that's all.
[20:53] isaacs: it's a different thing.
[20:54] isaacs: i feel the same way about Java and PHP and C++ inheritance.
[20:58] felixge_: egorFiNE: ok, I got a test case that throws a node assert
[20:59] egorFiNE: felixge_: which means?...
[21:00] paulca has joined the channel
[21:01] felixge_: egorFiNE: that this might be a bug in node that multipart has nothing todo with: http://github.com/felixge/node/commit/17375c816c5d2a4a7f870151fc19073a2229c879
[21:02] egorFiNE: felixge_: okay, good. any quick fix for now?
[21:02] bpot has joined the channel
[21:05] mikeal has joined the channel
[21:05] felixge_: egorFiNE: the code in question has a comment saying: // THIS IS AWFUL!!! FIXME
[21:05] felixge_: :)
[21:05] egorFiNE: ah, what a relief!
[21:05] egorFiNE: :)
[21:05] felixge_: I think ryah might know what's going on here more than me
[21:06] egorFiNE: ryah: ping?
[21:06] inimino: ah, I remember that comment
[21:07] felixge_: seems like node is failing to convert the utf8 for being send
[21:07] inimino: where's the test case?
[21:07] felixge_: inimino: http://github.com/felixge/node/commit/17375c816c5d2a4a7f870151fc19073a2229c879
[21:08] felixge_: I think there might also still be a problem in multipart itself once this is fixed, but maybe not
[21:11] inimino: doesn't multipart data need to be base64-encoded?
[21:11] micheil: felixge_ / isaacs: I've been getting errors in fs-sendfile, something about unable to alloc memory, even though 50% of the four gigs in this mac book pro wear free
[21:11] micheil: *were
[21:13] felixge_: Micheil: I'm getting errors on the sendfile test myself
[21:13] felixge_: probably a mac-specific introduced by the solaris support
[21:14] mikeal: quick question
[21:15] mikeal: i have a listener for the http server for new requests
[21:15] rednul_ has joined the channel
[21:16] mikeal: is the ServerRequest instance that is passed to my callback guaranteed not to fire events until my callback has returned?
[21:18] BradleyS has joined the channel
[21:21] inimino: felixge_: that test you modified is sending data using the 'binary' encoding, but the data came from a string literal in a require'd file, so it's UTF-16 data
[21:21] inimino: felixge_: the assert() that's failing is there to help you catch misuse of the binary encoding for data that's not binary data, which is what you have there
[21:22] inimino: felixge_: "binary data" here means what node calls "binary" encoding, i.e. using the low byte of each 16-bit character in a String
[21:23] inimino: felixge_: the assert just tests that the high byte is empty, which in the case of UTF-16 data generally won't be the case
[21:23] felixge_: inimino: oh, so you're saying I should use the binary representation of the string inside the literal? ОСТРÐ
[21:23] inimino: yes, that would work
[21:23] egorFiNE: I just did a quick check - this doesn't seems to be valid UTF-16 neither
[21:23] felixge_: makes sense
[21:23] felixge_: ok, I think what's needed is to expose a function to convert a binary string to utf8
[21:23] inimino: convert the string to UTF-8 and then write that using /u escapes
[21:24] felixge_: gonna write a patch for that now
[21:24] inimino: yes, that is needed
[21:24] jamiew has joined the channel
[21:24] inimino: ok
[21:24] egorFiNE: felixge_: pls! I will be here waiting for it, ok?
[21:25] felixge_: egorFiNE: ok
[22:07] felixge_: egorFiNE: can you try if this helps you: http://github.com/felixge/node/commit/97d30a741d9391159a1b15bd76c96a9c989a47fa ?
[22:07] egorFiNE: one moment
[22:08] felixge_: forgot test case: http://github.com/felixge/node/commit/754df02bd1bb895dec4a8c1aa43fb0cebb213aa3
[22:09] egorFiNE: is there any simple way to pull this commit only from your git?
[22:09] egorFiNE: cut'n'paste is messed
[22:09] felixge_: git remote add felix git@github.com:felixge/node.git
[22:09] felixge_: git fetch felix
[22:10] felixge_: git cherry-pick 754df02bd1bb895dec4a8c1aa43fb0cebb213aa3
[22:10] egorFiNE: l/p?
[22:10] egorFiNE: fetch says I need a key
[22:10] gwoo: git remote add git://github.com/felixge/node.git
[22:11] egorFiNE: git remote add felix2 git://github.com/felixge/node.git
[22:11] gwoo: yeah
[22:11] felixge_: sorry
[22:11] felixge_: git remote rm felix
[22:11] felixge_: git remote add felix git://github.com/felixge/node.git
[22:12] egorFiNE: hmm
[22:12] egorFiNE: I was able to cherry-pick
[22:12] egorFiNE: the 754df02bd1bb895dec4a8c1aa43fb0cebb213aa3
[22:12] egorFiNE: but fatal: Could not find 97d30a741d9391159a1b15bd76c96a9c989a47fa
[22:13] egorFiNE: how do I cherry-pick the actual node.cc change?
[22:13] cloudhead has joined the channel
[22:13] felixge_: don't try 97d30a741d9391159a1b15bd76c96a9c989a47fa
[22:13] felixge_: that was my first commit, but I removed that
[22:14] egorFiNE: ah I c
[22:14] felixge_: if you cherry picked 754df02bd1bb895dec4a8c1aa43fb0cebb213aa3
[22:14] felixge_: then you need to sudo make install
[22:14] felixge_: to get the change
[22:14] felixge_: the multipart module still won't convert the string for you, I'm not sure if it should do that either
[22:15] felixge_: but you can now do it yourself using process.stringConvert(myString, "binary", "utf8")
[22:15] egorFiNE: it shouldn't
[22:15] egorFiNE: okay, here's my report
[22:16] egorFiNE: on the terminal I can see a correct string now
[22:16] egorFiNE: in the browser, I can only see the correct string if I don't stringConvert
[22:16] egorFiNE: messy I think
[22:16] egorFiNE: what's the difference between feeding the same utf-8 string into sendBody and into sys.debug?
[22:17] egorFiNE: but I can convert back to binary and then feed to browser - that works
[22:17] egorFiNE: hmm
[22:17] felixge_: you need to specify the encoding for sendBody
[22:18] felixge_: sendBody(myString, 'utf8')
[22:18] egorFiNE: works!
[22:18] egorFiNE: *yahoo*!
[22:18] egorFiNE: could it be possible to add this as a method of string, rather than process?
[22:18] egorFiNE: i.e. string.covert("binary", "utf-8")?
[22:19] egorFiNE: or even perhaps string.convertTo("utf-8") ?
[22:19] felixge_: egorFiNE: possible yes. But I don't think node should touch ECMA
[22:19] egorFiNE: ah, true
[22:19] felixge_: its a a speck we have to live with
[22:19] egorFiNE: one who wants it could easily extend String class
[22:19] felixge_: yes
[22:19] egorFiNE: I think, another method should be added
[22:19] egorFiNE: process.getStringEncoding(string)
[22:19] felixge_: I will think about adding support to this in the multipart module itself
[22:20] felixge_: egorFiNE: well guessing the encoding isn't an exact science
[22:20] egorFiNE: ah, you mean that there are no internal knowledge about this?
[22:20] felixge_: by that I mean that the encoding isn't a property of the string
[22:20] egorFiNE: ah I C
[22:21] egorFiNE: of course, then it's not feasible
[22:21] felixge_: you could merely look for characters that have the 2nd byte set
[22:21] micheil: anyone know if v8 implements MethodMissing or what ever the javascript version is?
[22:21] egorFiNE: ah, this is why binary files take 2x RAM when loaded by node.js?
[22:21] micheil: rather, __NoSuchMethod__
[22:22] egorFiNE: micheil: like, you would like to check if a given class implements a certain method?
[22:22] micheil: egorFiNE: sorta
[22:23] egorFiNE: micheil: hmm, "if (intsance.method) {" should work
[22:23] micheil: egorFiNE: __NoSuchMethod__ is cleaner
[22:23] egorFiNE: micheil: javascript has a bit different definition of "clean". :-)
[22:24] micheil: egorFiNE: javascript does have a NoSuchMethod thing though
[22:24] egorFiNE: felixge_: will your fix go into mainstream?
[22:24] cruxst has joined the channel
[22:24] cruxst: sick
[22:24] micheil: it depends as to whether the vendor implements it
[22:28] cruxst has joined the channel
[22:29] brosner has joined the channel
[22:39] felixge_: egorFiNE: I see no reason why ryan wouldn't merge it
[22:39] egorFiNE: felixge_: great! thanks again!
[22:40] felixge_: does anybody know how streaming utf8 works?
[22:41] felixge_: it seems like you'd have to have additional buffering for an incoming utf8 stream
[22:41] felixge_: in order to not accidentally utf8 encode a partial byte sequence
[22:41] inimino: felixge_: you do
[22:41] felixge_: but I don't think node is doing that
[22:42] inimino: probably net2 will fix it, if not
[22:42] felixge_: hm, either way I'd have to implement my own buffering for multipart
[22:42] felixge_: I'm thinking I'd like to have part.setBodyEncoding()
[22:43] felixge_: but since I'm receiving binary by default, I'd have to add buffering for utf8
[22:43] felixge_: how would I go about determining if a string is "complete" ?
[22:45] inimino: you look at the UTF-8 stream
[22:45] inimino: byte by byte
[22:45] egorFiNE: exactly. I've seen implementations of this routing somewhere
[22:45] inimino: if you're in the middle of a sequence it's not complete, and you need to wait for the next chunk
[22:46] felixge_: damn, that sounds slow
[22:46] inimino: then you can either send the decoded character or a decoding error
[22:47] felixge_: you could just take the end of the string and go back right?
[22:47] felixge_: seems like checking the last few bytes should do
[22:49] inimino: yes
[22:50] inimino: you have to read every byte anyway if you're decoding it, so it doesn't really cost extra
[22:50] egorFiNE: felixge_: but you cannot scan the line backwards
[22:50] felixge_: inimino: it does cost extra if you do the encoding in a different function
[22:51] felixge_: but I guess the ideal abstraction would be a Utf8Stream class in C++
[22:51] felixge_: that you write stuff into, and it emits only clean chunks
[22:52] felixge_: anyway, emailed ryan to see what he thinks
[22:53] inimino: felixge_: well, if you are sending chunks from a file or something to a browser, you don't need to worry about where it breaks
[22:54] inimino: it's only if you're decoding it that it matters
[22:54] inimino: (like if you wanted a JavaScript UTF-16 string out of it)
[22:54] felixge_: inimino: yes, the problem is that a multipart POST could contain a file (binary) and a form field (utf8)
[22:55] inimino: hm...
[22:55] felixge_: but the way multipart works, I couldn't re-configure the tcp connection to use the right encoding
[22:55] felixge_: because I would have already gotten the beginning of a part
[22:55] felixge_: before I realize what encoding I need
[22:55] felixge_: so I'm left to deal with this mess in user-space
[22:55] inimino: ah
[22:56] felixge_: unless there was some cool new Utf8Buffer() class
[22:56] felixge_: that I could write my 'binary' part data into
[22:56] inimino: taking a stream of binary to a stream of UTF-16 chunks
[22:56] felixge_: yes
[22:56] felixge_: exactly
[22:56] inimino: ok
[22:56] inimino: yeah, net2
[22:56] inimino: would be the place to build that
[22:56] felixge_: yes
[22:57] felixge_: I will do it if ryan hasn't already done so or wants to do it himself
[22:57] felixge_: and by "do it", I mean "try to" do it and hoping to come up with a patch that isn't completely terrible :)
[23:07] aguynamedben has joined the channel
[23:19] markwubben has joined the channel
[23:21] mikeal has joined the channel
[23:22] mattly has joined the channel
[23:40] joshbuddy has joined the channel
[23:55] dnolen has joined the channel
[23:58] un0mi has joined the channel