[00:00] Tobsn: http://www.fmylife.com/miscellaneous/12566146 [00:01] creationix: malkomalko: I think node is fast enough that this will scale fairly far [00:01] creationix: at least on par with sqlite, but hopefully much better [00:01] chrischris has joined the channel [00:01] malkomalko: yah, it's been interesting watching this developer [00:01] malkomalko: you've had this idea for a while I think right? [00:01] creationix: yep [00:02] malkomalko: I remember throwing around a similar idea a while ago and talking to you about it [00:02] creationix: I like things that make life easy for developers [00:02] malkomalko: I went down the same path and then just stopped with it [00:03] herbySk: creationix: Hmm... I was thinking about index object itself, as I wrote before, that it is needed to create good version of it. It is the data nexus... so I thought what is needed to create it minimally. I came with the API I mentioned - the elements of index need to be able to store metadata and return old (snapshotted) as well as actual value, nothing more. And index itself only needs to be able to "generation++", that is, cre [00:03] herbySk: ate a snapshot. The rest will be clients of this beast. [00:03] creationix: herbySk: interesting, I think I get it [00:04] creationix: the index is the microkernel of sorts [00:04] cheriot_ has joined the channel [00:04] herbySk: creationix: The "saveIfNotPresent()" is needed in a special case when I write the "data are in the file here and here", but someone already put new data in it, it this case, the data where in the file the saved data are, are not needed and should not be saved into index element. [00:05] herbySk: creationix: yes, it is [00:05] mtodd has joined the channel [00:07] joshbuddy has joined the channel [00:10] dipser: hi, is it possible to run a command to an specific time (milisecs) or for example 10 hours later and if there are more events on that exact time, that they run one after another? ca i trust setTimeout or should i just "ask" every second if an event happened. [00:11] JimBastard has joined the channel [00:11] JimBastard: LOL [00:11] JimBastard: CHARLIE! [00:11] JimBastard: bad indexzero [00:11] JimBastard: Charlie: fuck fuck fuck should have been testing node-cloudservers on a new account [00:11] JimBastard: he totally deleted our production server, lulz [00:11] JimBastard: good thing nothing too important is running on there right now [00:12] JimBastard: can i get a haha? [00:12] dipser: haha? [00:12] JimBastard: ahahaha [00:12] JimBastard: amen [00:13] JimBastard: pair programming at work sucks, because i cant hang out in here during the day [00:13] JimBastard: >.< [00:13] creationix: dipser: setTimeout is the best thing you can do [00:13] creationix: dipser: there is no pre-emption [00:13] dipser: whats that? [00:14] creationix: where execution is interrupted and other code gets to run [00:14] creationix: since node is single threaded, none of that happens [00:14] creationix: with setTimeout your code gets in the event loop at a specified time, but is only run after the current code (if any) is done [00:15] c4milo has joined the channel [00:16] dipser: what does happen if i have 10 setTimeouts to the same second and i have to calculate something, which data would influence the other setTimeouts in the same second [00:16] dipser: it would be just run in "paralell" right? [00:16] JimBastard: timers are not to be trifled with [00:17] geojeff_ has joined the channel [00:17] cardona507 has joined the channel [00:17] zemanel has joined the channel [00:17] creationix: nothing is run in parallel in node [00:17] creationix: only waits are parallel [00:17] creationix: but luckily there are lots of waits since I/O is non-blocking [00:18] dipser: ok so if i have 2 setTimeouts in one second and the first needs 5 seconds, the 2. setTimeout starts 5 seconds later? [00:19] creationix: dipser: if you're trying to implement a cron-like system it might be better to just have a setInterval on 1 second and check your tables each second to see who's up for execution [00:19] dipser: yeah something like that [00:19] creationix: dipser: correct, two setTimeouts with the same time length started at the same time will race [00:19] creationix: and both will execute one at a time, but try to start at the same time [00:20] dipser: ok now i am clear about it :) [00:20] dipser: thanks [00:20] fictorial has joined the channel [00:20] sh1mmer has joined the channel [00:21] Blackguard has joined the channel [00:22] tekky has joined the channel [00:22] dipser: another questions (sorry). when i run a server there and have calculated something and something went wrong somewhere and the server is killed, is there a way to save something before it is completly killed? ;) [00:23] Tobsn: ? [00:23] Tobsn: onsystemshutdown? :P [00:24] dipser: jo sowas [00:24] Tobsn: systemshutdownfunction [00:24] dipser: onsystendying ^^ [00:24] Tobsn: it exists in php [00:24] Tim_Smart: process.on('exit'); ? [00:24] Tobsn: we always called it sisterfuckdownfunction back in 2000 [00:24] maushu has joined the channel [00:25] Tobsn: aber wenn dir der prozess stirbt da wirste nichmehr viel ausführen können... ich mein wenn der prozess einfach gekillt wird durch systemf ault oder kill [00:25] dipser: my thought is to use no database, just an object, so if it dies... everything would be gone ;) [00:25] Tim_Smart: dipser: This work? http://nodejs.org/api.html [00:26] Tobsn: build in a loop that keeps saving the object every x seconds [00:26] Tim_Smart: http://nodejs.org/api.html#event-exit-53 rather [00:26] dipser: Tobsn: jo [00:26] huyhong has joined the channel [00:26] Tobsn: with some tricks and a wrapper you might be even able to work live on a saved object [00:27] Tobsn: when it gets created you create it in a db, sqlite or a textfile [00:27] Tobsn: and everytime you edit it you just call ->save() on it [00:27] Tobsn: whatever you do it will not protect you from a instant kill of the process [00:27] dipser: ok [00:27] Tobsn: besides a loop in the background [00:29] dipser: Tim_Smart: thanks i will check how it will work ^^ [00:30] Tim_Smart: You will still need to save a regular intervals or something [00:30] ajpiano has joined the channel [00:30] brainproxy: I've been experimenting whith this compression library: http://code.google.com/p/jslzjb/ [00:30] Tobsn: or you just write in every odd line number a $this->save() :P [00:31] dipser: ^^ [00:31] brainproxy: it's very fast, and you get an array of integers as output; the compression seems pretty good, as the array is often significantly shorter in length than the string input [00:31] Tobsn: lol [00:31] Tobsn: well... [00:32] Tobsn: in binary that might be true [00:32] JimRoepcke_ has joined the channel [00:32] brainproxy: but what I'm wondering about: if i toString() the array, it's often longer than the original string [00:32] JimRoepcke has joined the channel [00:32] Tobsn: but as soon as you need that in ascii the string will be longer [00:32] brainproxy: right [00:33] Tobsn: are you trying to get numbers smaller? [00:33] Tobsn: cause i wrote a super dummy function for that once [00:33] jacobolu_ has joined the channel [00:33] brainproxy: so what happens when you push stuff like that out over http; can the array end up being smaller than the string [00:33] Tobsn: turnining integers into integers and characters [00:33] geojeff_ has joined the channel [00:33] gm__: oy [00:33] Tobsn: pushing it out over http? [00:34] brainproxy: Tobsn: well with a tool like faye [00:34] brainproxy: which sends/recvs JSON [00:34] Tobsn: so you want to compress it before you send it [00:34] brainproxy: the backend transport being xhr [00:34] Tobsn: and unpack it client side [00:35] brainproxy: right, I was trying to find an efficient way to compress, but if the output array is going to be longer as a string than the original, no point [00:35] herbySk: creationix: Step = require('step'), this isn't on normal node, you use your own native module? [00:35] stride: so you want to decompress it on the client side with js? why not use a compression algorithm that the browser can handle on it's own? [00:35] Tobsn: stride? [00:35] gm__: uh, someone pointed me to a better ws lib than node.ws.js but I forgot the name [00:35] gm__: any hints ? [00:35] Tobsn: there is a build in function within javascript do decpress? [00:35] Tobsn: that would be new to me [00:35] stride: herbySk: step is at http://github.com/creationix/step if that helps [00:36] dipser: gm__: ws = websocket? socket.io? [00:36] stride: Tobsn: no in http [00:36] brainproxy: faye does websockets too [00:36] creationix: herbySk: yep, it's the only dependency in nStore [00:36] Tobsn: he wants to use faye [00:36] gm__: yep [00:36] creationix: herbySk: I may remove it not sure [00:36] gm__: websockets [00:36] stride: Tobsn: http://en.wikipedia.org/wiki/HTTP_compression [00:36] gm__: node.ws.js is very simple to use [00:36] Tobsn: but that doesnt fix his problem [00:36] stride: oh, okay, didn't catch that, sorry [00:36] gm__: that's why I choose it (node.js newby) [00:36] Tobsn: ;) [00:37] Tobsn: i know what gzip is but hes sending stuff with javascript from server to client... xhr, websocket etc. a gzip encoding header will not help with that [00:37] Tobsn: (would be nice tough) [00:37] dipser: i choosed socket.io because it hase fallbacks ^^ [00:37] dipser: websocket, flashsocket, xhr-multipart, xhr-... [00:37] brainproxy: I can try the ulzss library [00:37] brainproxy: which is javascript lzss [00:37] Tobsn: i mean try it... with a slower machine and see what happens [00:37] gm__: lemme see [00:38] brainproxy: but it's significantly slower than lzjb [00:38] Tobsn: but why do you want to compress it anyway? [00:38] sonny has joined the channel [00:38] brainproxy: I'm sending around patches and there's lots of character reuse [00:38] Tobsn: patches? [00:38] MaSch: is there a (german) Javascript help channel? [00:38] Tobsn: MaSch, ggf. im ircnet [00:38] gm__: I means server side library [00:38] brainproxy: differential sync stuff [00:38] gm__: socket.io seems to be client side [00:38] Tobsn: irc.fu-berlin.de -> #javascript [00:38] dipser: gm__: http://github.com/LearnBoost/Socket.IO [00:39] Tobsn: gm__, its both [00:39] Tobsn: http://socket.io [00:39] Tobsn: just read up on it [00:39] gm__: http://github.com/gleicon/pubsub_ws [00:39] MaSch: Tobsn: okay thanks, found one @quakenet [00:39] dipser: MaSch: quakenet auch [00:40] dipser: ^^ [00:40] Tobsn: MaSch, oh je... [00:40] MaSch: ? [00:40] gm__: node.ws.js seems ok, but I really dont know if its the best one [00:40] Tobsn: lern lieber englisch, node.js gibts auch nich in deutsch [00:41] MaSch: joar ist klar.. aber es ist spät und bei komplexeren themen tendiere ich eher noch zu muttersprache [00:41] Tobsn: (noch nich) [00:41] gm__: I like its approach just like a normal http server [00:41] Tobsn: gm__, look into socket.io - its dead simple [00:42] Tobsn: and has all the auto fallbacks build in etc. [00:42] huyhong has left the channel [00:42] statim has joined the channel [00:43] dipser: right, its working on my iphone like charm :-) [00:43] dipser: just websocket limits the userbase [00:43] gm__: ok, will do [00:44] Tobsn: gm, read about hte fallback... it has like 6 or so which is crazy. even if you have nothing installed and the oldest IE6 its still working. [00:44] dipser: gm__: if you have problems with connecting, try to deactivate flashsocket ^^ [00:44] dipser: this helped me a lot, because flashsocket needs another port or so [00:45] Tobsn: http://www.businesswire.com/portal/site/home/permalink/?ndmViewId=news_view&newsId=20100818005358&newsLang=en [00:45] dipser: nice ^^ [00:45] dipser: n8 :P [00:45] gm__: uh, tks dipser [00:45] gm__: will give it a try, fallbacks are interesting [00:46] dipser: yes the phone is using xhr-... [00:46] MaSch: i belive this is currently the only active irc channel dealing with js [00:46] dipser: and so much ppl dont have websocket [00:47] kreyman has joined the channel [00:47] dipser: #jquery too most of the time ^^ [00:47] wattz: hi [00:47] Tobsn: MaSch, its pretty late in germany too... [00:47] dipser: so n8 [00:47] MaSch: Tobsn: i know, i'm there xD [00:47] stride: Tobsn: nah, early :) [00:47] Tobsn: what time is it? [00:47] Tobsn: 2am? [00:47] MaSch: 2:47 [00:47] MaSch: AM [00:47] dipser: 3 [00:47] Tobsn: 6pm here [00:47] Tobsn: ;) [00:47] gm__: what worries me on ws is that the proxying is not resolved yet [00:48] MaSch: Tobsn: but im also in 2 international channels.. all dead [00:48] Tobsn: gm, i think they use flash for that issue in socket.io [00:48] Tobsn: MaSch, javascript is pretty dead [00:48] Tobsn: youre probably better of joining a #jquery channel or something [00:48] Tobsn: jquery is hip = more people [00:48] wattz: how goes it [00:48] Tobsn: :P [00:48] gm__: I want to keep my pub/sub simple, apart from ws stuff [00:48] MaSch: so i'll try to ask here: someone worked with yajl or something like that and/or know some nice howto's? [00:49] gm__: also, I am thinking on how to create a central presence server [00:49] gm__: now that I am using emit to pipe from redis to the ws [00:49] stride: js is dead? whut? do you work for wired? [00:49] jb55: lol [00:49] Tobsn: MaSch, no meta questions ;) [00:49] wattz: sup jb55 [00:49] jb55: hey [00:49] gm__: I would like to make node.js 'nodes' and share the same presence server [00:49] Tobsn: stride, javascript itself is a dead topic - all that builds up on javascript is hip [00:49] wattz: gm__: like xmpp [00:50] wattz: jabber? [00:50] Tobsn: i think there is a xmpp lib for nodejs [00:50] MattJ: Two in fact [00:50] Tobsn: (everyone ever wondered why there are at least two solutions for the same problem with node.js?) [00:50] Tobsn: how many memcache and mongodb drivers are there... [00:50] Tobsn: ;) [00:51] MattJ: Mine was first, so it wasn't my fault this time ;) (though it usually is) [00:51] Tobsn: ;) [00:51] gm__: wattz: yup [00:51] gm__: but simpler [00:51] gm__: smaller [00:51] MaSch: thats no meta question O.o i'm looking for howtos but these i found on the web are just showing the easy part. The part i got stuck is never mentioned [00:52] Tobsn: ha [00:52] Tobsn: well [00:52] ajpiano has joined the channel [00:53] Tobsn: im no help with your problem ;) [00:57] MaSch: yajl is a sax-like JSON parser. so i understand how to use the events and so on but i don't have a clue how to build objects from this without "real" pointers :-/ i need top have a variable that points on an entry of an array or a property of a object. I need to be able to change the value and then point to another element. .. or i need to sleep and rethink this ... [01:00] creationix: wohoo, nStore is still fast, I'm getting 15,000 inserts/second for a minute solid [01:01] creationix: (it's always disheartening to re-factor and re-benchmark only to find it's 100 times slower) [01:02] creationix: ACTION goes back to do more re-factoring and rw-writing [01:02] MaSch: creationix: nice speed [01:02] creationix: MaSch: I need indexes to make my queries faster though [01:02] creationix: MaSch: simple reads are fast, but queries are dog sloq [01:02] creationix: *sloq [01:03] creationix: **slow [01:03] creationix: hehe [01:03] MaSch: :) [01:03] Tobsn: *where slow means sloq. [01:03] creationix: *sloq = pointer to Source Line of Qode [01:04] Tobsn: creationix [01:04] Tobsn: http://www.google.com/search?client=safari&rls=en&q=define:sloq&ie=UTF-8&oe=UTF-8 [01:04] Tobsn: read the "did you mean" [01:04] MaSch: xD [01:05] samsonjs has joined the channel [01:05] Tobsn: http://www.sloq.com/ [01:05] Tobsn: lol its a quake3 clan [01:05] MaSch: ah.. i give it up.. no async parsing. I'll cach that trash and decode it in one piece [01:05] Tobsn: http://www.tastespotting.com/detail/94017/Sloq-Cooker-BBQ-Ribs [01:05] MaSch: -cool +ready [01:06] Tobsn: creationix, whats nstore using? [01:07] Tobsn: sqlite? [01:07] creationix: Tobsn: no nStore is the database [01:07] creationix: homegrown [01:07] Tobsn: oh [01:07] Tobsn: (why?) [01:07] MaSch: 'cause he can? [01:07] creationix: Tobsn: because I want somethine like sqlite, but key/value and native to ndoe [01:07] MaSch: *node [01:07] Tobsn: so 15k inserts a second are 15k lines a second written to text file? [01:07] creationix: I think it's going to be a real contender for the small site market once it's done [01:07] creationix: Tobsn: correct [01:08] Tobsn: erm... [01:08] Tobsn: you should meassure reads not writes [01:08] creationix: Plain reads are probably faster [01:08] creationix: especially once I implement ram caching [01:08] MaSch: creationix: what about read / write caching? [01:08] MaSch: ah.. okay [01:09] Tobsn: btw. what if you do save(''test',{'foo':'bar'}); save(''test',{'foo':'bar'}); [01:09] creationix: Tobsn: then it writes two lines to the file [01:09] Tobsn: btw. what if you do save(''test',{'foo':'bar'}); save(''test',{'foo':'123'}); [01:09] creationix: and when it compacts eventually, will only write the newest version [01:09] PyroPete1 has joined the channel [01:09] creationix: Tobsn: then the second one will overwrite the first [01:10] creationix: my writes are queued and written in order [01:10] Tobsn: wait a minute [01:10] Tobsn: save(''test',{'foo':'bar'}); save(''test',{'foo':'bar'}); [01:10] Tobsn: generates two keys with the same key? [01:10] Tobsn: but if i change bar to 123 its only one key?! [01:10] creationix: Tobsn: no, the second will overwrite the first in the index [01:10] creationix: but the file is append only, so nothing is changed in place, not even updates or deletes [01:10] creationix: it makes MVCC easy to implement [01:11] Tobsn: why not just use redis or memc? [01:11] MaSch: so the file will grow even if i execute delete(...)? [01:11] creationix: Tobsn: because this will be easier and simpler [01:11] creationix: Tobsn: no external database [01:11] creationix: Tobsn: no dependencies other than some js files [01:11] Tobsn: easier than memcache? [01:11] Tobsn: or redis? [01:11] creationix: Tobsn: yep [01:11] herbySk: creationix: what would you say to [01:12] herbySk: ((+new Date&0x3fffffff)+Math.random()).toString(32) [01:12] herbySk: as uuid generator? It's only some 2^64 possibilities, but it is one-liner and is generated fairly fast (and only takes up 13 chars at most)? [01:12] creationix: herbySk: I like my base 36 one, it's fun [01:12] herbySk: creationix: ok [01:13] creationix: besides, new Date is pretty expensive, it's a system call [01:13] creationix: and only has ms resolution anyway [01:13] Tobsn: herbySk [01:13] Tobsn: http://www.itu.int/ITU-T/studygroups/com17/oid.html [01:13] creationix: herbySk: I assume you saw mine http://github.com/creationix/nstore/blob/rewrite/lib/uuid.js [01:14] creationix: I really want my keys to be the full 16 bytes [01:14] creationix: but I guess that's a silly requirement [01:14] Tim_Smart1 has joined the channel [01:15] jamescarr has joined the channel [01:15] lachlanhardy has joined the channel [01:15] jamescarr: heh... I wrote integration tests against my web app using java [01:15] Tobsn: herbySk, there is also http://www.opengroup.org/dce/info/draft-leach-uuids-guids-01.txt [01:15] jamescarr: I need a node.js implementation of WebDriver :) [01:16] jacobolus has joined the channel [01:16] creationix: herbySk: though I can probably optimize my uuid code since it's in the hot path of 15k inserts/second [01:16] creationix: well, when the key isn't specified [01:16] Tobsn: herbySk, http://note19.com/2007/05/27/javascript-guid-generator/ [01:17] Tobsn: i think that was the most common used one for js [01:17] herbySk: creationix: yeah, it was kind of reaction... it's not quite kosher, since it discard leading zeroes, that's why there must be that while... so I was thinking about alternatives for myself.... I like base 32, because any random number fits its information to little number of digits [01:17] MaSch: googling for 0xcfd41b9100000 gives one result: creationix on twitter :) [01:17] creationix: :) [01:18] creationix: I like my magic numvers [01:18] MaSch: you have a new follower [01:18] creationix: :) [01:18] Tobsn: herbySk [01:18] Tobsn: http://pastebin.com/XrLrnfX3 [01:19] Tobsn: 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {var r = Math.random()*16|0,v=c=='x'?r:r&0x3|0x8;return v.toString(16);}).toUpperCase(); [01:19] Tobsn: there ya go - the one line version [01:19] creationix: hmm, so is UUID a spec somewhere then [01:20] Tobsn: i just posted all the spec links [01:20] herbySk: MaSch: well, I simply executed Math.log(0xcfd41b9100000) / Math.log(36) in node-repl... and the magic is over [01:20] Dmitry1: http://www.ietf.org/rfc/rfc4122.txt [01:20] Tobsn: from RFC to IETF [01:20] Tobsn: http://www.opengroup.org/dce/info/draft-leach-uuids-guids-01.txt [01:20] Tobsn: thats the IETF draft on it [01:21] Tobsn: (i read a lot about it cause i had to build on in php once) [01:21] creationix: so what's the advantage over rfc UUIDs and me simply making unique 16 character keys? [01:21] Tobsn: well they found out the best way [01:21] Tobsn: and you're just making unique 16 character keys [01:21] creationix: my UUIDs only need to be unique within my keyspace [01:22] Tobsn: 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {var r = Math.random()*16|0,v=c=='x'?r:r&0x3|0x8;return v.toString(16);}).toUpperCase(); <- the RFC compliant version. [01:22] creationix: (so I guess it's technically not that Universal [01:23] Tobsn: well its pretty complicated because a UUID has to be almost unique or better said as far away from the birthday paradox as possible without putting too much efford into it [01:24] creationix: so it's not really unique, just most likely [01:24] Tobsn: yep [01:24] creationix: and it's long enough that we can trust it [01:24] Tobsn: thats what the UUID spec tries to accomplish [01:24] Tobsn: be unique but not to be a hash, i guess [01:24] creationix: I have to write my keys in a text file and 36 byte keys will really bloat my memory [01:24] zapnap has joined the channel [01:24] Tobsn: you can just crc32 your keys [01:25] creationix: plus I just check the hasOwnProperty to see if it's already there [01:25] creationix: so I KNOW my keys are unique [01:25] Tobsn: it will be an unsigned integer - so its unique and tiny [01:25] creationix: well, I'm not writing binary data, so ints don't help much [01:26] Tobsn: http://github.com/tobsn/flexihash.js/blob/d4dd43f7ad7b65c0606c8c2ebcf130d2fa7bfa6f/flexihash.js [01:26] Tobsn: i build in a _working_ crc32 hash if you need it. [01:26] creationix: nah, I just need unique keys, and the simplest way is better [01:27] creationix: just wondering what the advantages of proper UUIDs are [01:27] Tobsn: as long as you use a hash and not a random number :P [01:28] ehaas has left the channel [01:28] creationix: I went for base 36 because it allows me a fairly large key space in just 16 bytes [01:28] creationix: and it's native to js [01:28] mattikus has joined the channel [01:28] herbySk: creatonix: simplest is just 'Math.number()' and I'd propose 'Math.number().toString(32).substring(2)' to cut it to as short as possible, since it's key and shouldn't bloat memory [01:28] Tobsn: 32? [01:29] creationix: herbySk: Math.number()? [01:29] herbySk: creationix: Math.random(), sorry [01:29] MaSch: does Math.number() return 42 all the time? :-p [01:30] herbySk: Tobsn: it's power of two, so putting toString() to this base means any random number ends up with little number of digits [01:30] Tobsn: i would sitll not trust math.random [01:30] creationix: herbySk: actually Math.random().toString(36).substr(2) is pretty good [01:30] herbySk: creationix: longer than toString(32) [01:31] Tobsn: i would rather go with the RFC [01:31] Tobsn: 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {var r = Math.random()*16|0,v=c=='x'?r:r&0x3|0x8;return v.toString(16);}).toUpperCase(); [01:31] creationix: herbySk: why is that? [01:31] creationix: though I see, must be something to do with precision in the conversion [01:32] Tobsn: because it uses 36 as the radix [01:32] herbySk: as I wrote to Tobsn, 32 is power two, so number in binary is converted without loss of precision into little number of digits. Base 36 is not power two, so fractional number must use mor digits to be precise [01:32] creationix: herbySk: yeah makes sense [01:32] creationix: so Math.random doesn't have that much precision after all [01:32] herbySk: toString(radix) always uses as much digits as needed to get precise answer [01:33] creationix: only about 7 base 32 digits [01:33] Tobsn: 36 is sexatrigesimal right? [01:33] herbySk: creationix: 53 (maybe 52)bits, as is the mantissa in IEEE double [01:34] Tobsn: anyway, 36 is getting complicated haha [01:34] ditesh|cassini has joined the channel [01:34] creationix: herbySk: yeah, that plenty, no database is going to have more than 52 bits worth of rows [01:35] herbySk: But in fact, it only uses 32 bits :-/ Math.random() in v8 probably generates the random number out of some 32bit int manipulation [01:35] creationix: so Math.random().toString(32).substr(2) it is then [01:35] softdrink has joined the channel [01:35] herbySk: Math.random().toString(2).length shows only numbers up to 34 [01:35] sonny has joined the channel [01:35] herbySk: in node-repl [01:35] sonny: Is anyone knows a node js web server with files directory listing? [01:35] blogometer: Anyone ever spent time in comp.lang.javascript on usenet? [01:36] blogometer: Are they are just crazy? [01:36] JimBastard: blogometer: yes [01:36] JimBastard: the only good javascript lists are nyc.js and node.js (that i know of) [01:37] blogometer: JimBastard: Like totally barking mad. [01:37] blogometer: Good to know. [01:37] herbySk: creationix: ^^^ as I found out, only 32 bits are used [01:37] creationix: 32 bits, hmm [01:37] MikhX_ has joined the channel [01:38] herbySk: creationix: so probably it should be called two times ... :-/ Math.random() has only 32bit precision [01:38] creationix: that about 4 billion right [01:38] creationix: think that's enough for a database? [01:38] creationix: or will I start hitting lots of collisions [01:38] herbySk: creationix: or, you could add remaining bits to mantissa from the local time, as I did with my Date example - 20 last bits from Date, plus random [01:39] creationix: I'd rather not use date [01:41] herbySk: then it's two times Math.random().toString(32).substring(2)... but if it is computed, then the two numbers are connected, so you anyway end up with only 2^32 possibilities - if you combine it with something else, independent (like last 20bits of Date) - you can get to higher number [01:41] herbySk: creationix: ^^^ [01:41] creationix: hmm [01:42] creationix: herbySk: Date.now().toString(32) + "-" + Math.random().toString(32).substr(2) [01:43] creationix: I see why you don't use all of Date.now() [01:43] creationix: the first half never changes [01:43] matt_c_ has joined the channel [01:44] malkomalko has joined the channel [01:45] herbySk: creationix: it does, but it takes long time :-) [01:45] creationix: yeah, I'm pretty sure in 20 years I won't be using nStore [01:45] herbySk: this is 20bits from date, rest from random: [01:45] herbySk: ((new Date & 0x3ffff) + Math.random()).toString(32) [01:47] benburkert has joined the channel [01:47] herbySk: creationix: the only bugging part is that dot, but it can be taken away... the question is, whether it pays one saved chars with loss in performance [01:48] creationix: I think I'll stick with Date.now().toString(32).substr(6) + Math.random().toString(32).substr(2) [01:48] creationix: is string concat faster then float + [01:48] creationix: hmm, maybe not [01:49] herbySk: creationix: float + is one of the fastest things in js! string concat can not compete... [01:49] creationix: ok [01:49] matt_c has joined the channel [01:49] creationix: wow, generating the key is about 30% of my insert cost [01:49] creationix: insane [01:50] herbySk: creationix: eee??? [01:50] herbySk: really? [01:50] creationix: I think so, maybe part of it is the fact that my 1,000,000 keys are now unique [01:51] creationix: before it recycled the same 1000 keys [01:51] creationix: keps the index object smaller [01:51] bronson_ has joined the channel [01:51] herbySk: creationix: ah yes, looking over 1e6 keys in an object takes time... [01:51] Validatorian has joined the channel [01:52] creationix: ohh, especially with my hasOwnProperty check [01:52] herbySk: (there's hashing, but it involves some housekeeping, too) [01:52] herbySk: creationix: that's what I'm talking about [01:52] creationix: ok, so generating he uuid is probably not a real cost in comparison [01:52] herbySk: yes [01:53] creationix: ok, so 1,000,000 unique keys (1...1,000,000) takes 73 seconds [01:53] creationix: now for random keys [01:53] herbySk: (and that's why I'm thinking having it smaller while still unique will pay in performance) [01:54] Validatorian: does ciaranj ever come into this channel? [01:55] herbySk: So I must change my proposal to (0x100000000*((new Date & 0x3ffff)+Math.random())).toString(32) [01:57] MaSch: creationix: i cant help me.. i don't understand your Queue.shift method O.o [01:58] steadicat has joined the channel [01:59] creationix: MaSch: it's a little tricky [01:59] creationix: herbySk: I like your last suggestion [01:59] creationix: It can generate 2,000,000 keys per second [02:00] creationix: fast enough I say [02:00] MaSch: i think i'll read it in some hours after i sleept some xD [02:00] MaSch: if i don't understand it than, i'll come back and ask you :) [02:00] MaSch: gn8 folks [02:01] dipser_ has joined the channel [02:01] herbySk: bye, too, going to sleep as well [02:01] creationix: night [02:02] meso has joined the channel [02:03] danielzilla has joined the channel [02:05] Validatorian: can anybody familiar with express take a look at the final draft of 'myfirstformstrategy.js' here: http://wiki.github.com/ciaranj/connect-auth/creating-a-form-based-strategy and tell me how I can make it NOT redirect to /auth/form_callback when accessing a page without access? I just want to display a login form, not redirect [02:07] Validatorian: I tried removing the redirect in failed_validation(), but then it just hangs, doesn't pass-through [02:08] Tobsn: creationix, but you cant just take random keys to store data [02:08] TommyM has joined the channel [02:09] creationix: Tobsn: people can specify their own keys, but I auto-generate if they don't specify [02:11] Tobsn: but you should use a hash for that [02:11] mscdex: BIT TWIDDLERS UNITE! [02:12] mscdex: wee.... backing up 23+ gigs of data [02:12] mscdex: gonna take 5 hours or so [02:12] mscdex: huhu [02:13] Tobsn: time capsula hurray :P [02:15] MattJ: rsync \o/ [02:15] mscdex: neop [02:15] mscdex: *nope [02:15] mscdex: tar [02:15] mscdex: :( [02:15] mscdex: and then gzip -1 [02:15] mscdex: heh [02:16] mscdex: backing up to DVDs actually [02:20] Astro: what library do I use do parse binary multipart form uploads? [02:20] Astro: the multipart pkg deals with strings :( [02:20] mscdex: Astro: node-formidable [02:21] mscdex: Astro: github.com/felixge/node-formidable [02:21] Astro: awesome [02:21] Astro: can I use it with Connect? [02:21] mscdex: that i don't know, i'm sure it's been used with it before though [02:23] micheil: ryah: would it be an idea to implement a linked list structure in the core of node? [02:23] mikeal has joined the channel [02:23] micheil: something that's an actual data structure [02:23] micheil: so, you could do something like. new process.linkedList(); [02:26] ehaas has joined the channel [02:26] mscdex: Astro: creationix is the author of connect, he could probably give you an answer, or you could post the question on the nodejs mailing list [02:26] aho has joined the channel [02:29] jchris has joined the channel [02:30] micheil: Astro: I would think that if formidable gives you a http request object or it gives you access the the http connection events, then you could use it [02:32] JimBastard: Astro: its javascript all the way down [02:32] JimBastard: you can do whatever you want with it [02:33] Astro: I'll have it done in 10 minutes if you're interested [02:33] Astro: it works nicely, I only need to remove the disk access =) [02:34] dnolen_ has joined the channel [02:36] visnup has joined the channel [02:38] JimBastard: everybody stop, javascript time [02:39] danielzilla: ACTION busts out the parachute pants. [02:39] JimBastard: ACTION puts on the fur coat  [02:40] matt_c: can't emit this. [02:42] JimBastard: 2 legit 2 emit? [02:43] malkomalko: what do people use for file uploads? formidable? [02:43] JimBastard: malkomalko: big files, hell yeah [02:43] Astro: oh shit, either I am too tired or... [02:43] daleharvey: I used formidable yeh [02:43] daleharvey: for dropup.net [02:43] malkomalko: ok [02:43] JimBastard: malkomalko: are you doing nodeknockout ? [02:43] malkomalko: I'm signed up [02:44] malkomalko: but not I may not be able to do it because I have a business trip that weekend [02:44] JimBastard: we got some sweet space at tipping point [02:44] daleharvey: codes on github if you are interesting, nothing special [02:44] malkomalko: suxs balls [02:44] JimBastard: oofa! [02:44] JimBastard: we doing a whole thing [02:44] JimBastard: you should try to come if you can [02:44] malkomalko: well [02:44] malkomalko: I'd be back on Sunday [02:44] JimBastard: free tshirts! [02:44] malkomalko: maybe I could just swing by for Sunday evening [02:44] malkomalko: would that be cool? [02:44] JimBastard: ohh yeah come on by whenever [02:45] malkomalko: sex machine [02:45] JimBastard: hopefully will be have won / been disqualified by sunday night [02:45] malkomalko: haha [02:45] malkomalko: I did like 3 rails rumbles [02:45] JimBastard: you made three todo lists? [02:46] JimBastard: brutal [02:46] malkomalko: I made three apps that couldn't scale very well [02:46] JimBastard: i think we are gonna see some insane entries [02:50] visnup: hope so [02:50] visnup: btw, we're getting like 28 palm pres [02:50] dnm has joined the channel [02:51] visnup: if you're a winner of any sort, you get a palm pre [02:51] aurynn: Never used a Pre, though the UI looked interesting [02:51] mu-hannibal has joined the channel [02:51] visnup: yeah, I'd want to play with one as an internet device [02:54] JimBastard: everyone is a winner when using node.js [02:55] esigler has joined the channel [03:00] mr_daniel has joined the channel [03:01] jamescarr: ryah, hey, when you travelling to St.Louis for Strange Loop? [03:01] aurynn: Everyone's a winner when they use Old Spice. [03:02] jamescarr: JimBastard, then they should put this on the node.js site http://is.gd/eo71f [03:02] JimBastard: is that from pro wrestling? [03:03] matt_c: ACTION is looking forward to Strange Loop. [03:03] JimBastard: it is [03:04] jamescarr: matt_c, ah, you're going? :) [03:04] jamescarr: JimBastard, yep [03:04] JimBastard: http://www.youtube.com/watch?v=UZJDkYmnPvo#t=02m08s [03:04] JimBastard: i fucking loved that game [03:04] matt_c: jamescarr: Indeed. I'm in Lawrence, KS so it's a no-brainer. [03:05] twoism has joined the channel [03:06] jamescarr: JimBastard, yep... I used to play it at wal-mart when I was little [03:06] charlenopires has joined the channel [03:06] jamescarr: it was the only arcade they had [03:07] jamescarr: matt_c, awesome. we're having our St.Louis node meetup the night before (aiming for every third thursday) so if you're in town early come join us :) [03:08] jamescarr: tomorrow night is our first meeting, so I'm excited :) [03:09] zapnap has joined the channel [03:10] sprsquish has joined the channel [03:12] matt_c: jamescarr: Cool, I'm planning on heading over that night with fellow Pragmatic Badgers Christian Metts and Daniel Lindsley. We'll definitely plan on attending if we make it in time. [03:12] sprsquish has left the channel [03:15] jamescarr: cool... I set a mailing list up for it today, http://groups.google.com/group/nodejs-stl ... I'll be making announcements there [03:16] jamescarr: we'll be meeting at 6665 Delmar that month, which is awesome because it's on the same block Strange Loop is held [03:16] danielzilla: Nice. [03:17] jedschmidt has joined the channel [03:17] BrianTheCoder has joined the channel [03:18] robotarmy has joined the channel [03:23] jamescarr: was hoping ryah would be active atm, maybe see if he could present something if he's in early for strange loop too [03:23] Astro: strange for loops, eh? [03:25] alcuadrado has joined the channel [03:27] jamescarr: any of you use disqus on a site before? [03:27] jamescarr: does it work through an API? [03:28] jchris has joined the channel [03:29] grahamalot has joined the channel [03:29] jamescarr: a script [03:29] jamescarr: haha [03:30] jamescarr: I thought it'd be an API call... it'd be better honsetly [03:32] micheil: jamescarr: there is an api you can use. [03:33] ajpiano has joined the channel [03:34] creationix has joined the channel [03:35] esigler has joined the channel [03:35] jamescarr: I'll have to investigate it [03:37] jimmybaker has joined the channel [03:40] twoism has joined the channel [03:41] softdrink1 has joined the channel [03:42] overra has joined the channel [03:49] jacobolus has joined the channel [03:50] jacobolus has joined the channel [03:50] creationix has joined the channel [03:51] quirkey has joined the channel [03:52] creationix has joined the channel [03:53] mjr_ has joined the channel [03:53] quirkey_ has joined the channel [03:57] dnolen_ has joined the channel [04:07] joshbuddy has joined the channel [04:08] twoism has joined the channel [04:11] JimRoepcke has joined the channel [04:13] jamescarr: doh... I've reached a point where I need to invent a mocking framework for node [04:15] charlesjolley- has joined the channel [04:15] joshbuddy has joined the channel [04:19] dantalizing has joined the channel [04:19] jochen has joined the channel [04:21] bradleymeck has joined the channel [04:21] bradleymeck: ACTION dances [04:23] micheil: ? [04:24] jedschmidt has joined the channel [04:24] terinjokes: ACTION dances with bradleymeck  [04:25] bradleymeck: mmm? i got my js1k submission in, trying to make it work in url format though [04:26] creationix: wohoo, nStore now can do 17k inserts/second [04:26] creationix: and I don't even have write combining [04:26] bradleymeck: nice [04:27] creationix: and it's full of all sorts of ES5 goodness [04:27] creationix: Object.freeze, Object.seal, Object.create, ... [04:28] creationix: does anyone know if V8 goes faster when you do Object.freeze, since it knows no new properties will be added [04:29] bradleymeck: it does not [04:29] creationix: Astro: btw, someone today said your gzip stuff in connect is throwing deprecation warnings [04:29] creationix: bradleymeck: it doesn't? [04:29] bradleymeck: prototypes~ wooo they haunt you [04:29] creationix: what if I lock my prototypes too [04:29] bradleymeck: nope [04:30] creationix: well, at least we get the jit stuff [04:30] bradleymeck: yea [04:30] creationix: I know that works even without freeze [04:30] creationix: by just not adding/removing props [04:30] micheil: creationix: I'm thinking if you're going to try and get things faster, then you're going to need to use some other data structure [04:31] creationix: micheil: for what? [04:31] creationix: my queue is plenty fast [04:31] micheil: well, not only the queue, but the actual storag [04:31] bradleymeck: mmm, anyone wanna take a stab at why this works in a script tag but not a url? [04:31] creationix: about 12,000,000 push/shifts/second [04:31] creationix: bradleymeck: too long? [04:31] bradleymeck: 140chars [04:32] mape: encoded it? [04:32] bradleymeck: ummm no, usually javascript: urls dont need raw encoding [04:32] creationix: micheil: I'm sticking with my data format on disk, it doesn't get much faster with the features I want (except for maybe loading at startup) [04:32] creationix: micheil: but I'll probably refactor the runtime stuff quite a bit [04:33] creationix: it's barely hitting the disk when I'm maxed out at 17k/sec [04:33] micheil: I'm just thinking like, if you used a singular linked list (in memory) and then also used say, b-tree or b+trees for indexing you could get it faster [04:33] creationix: I've seen node programs write 300MB/sec to my hd [04:33] creationix: micheil: how is that faster [04:34] creationix: my index is a plain js hash [04:34] micheil: I'm not sure [04:34] creationix: and linked lists have a LOT of objects in them [04:34] micheil: true [04:34] creationix: b-trees are great for range queries, but hash is the best for key/value stuff [04:34] micheil: unless you do: item.__prev / item.__next [04:35] creationix: true, but I'd rather just not have a million objects at all [04:35] micheil: hmm.. I wish I had more time to write a nestedList widget. [04:35] micheil: oh. so, nStore is explicitly a k/v? [04:35] micheil: I thought it was an object store. [04:36] creationix: I'm adding indexed queries later on, but externally [04:36] creationix: the core will stay k/v [04:36] creationix: my current query system just reads ALL the records from disk and then filters them [04:37] creationix: works, but it pretty slow for large data sets [04:37] stride: what are you currently storing your keys in? a hash tree? [04:37] creationix: a plain js object, so yes, a hash [04:37] creationix: {foo: {offset:234,length:23}} [04:37] micheil: hmm.. [04:38] creationix: I can insert keys into the js object amazingly fast [04:38] creationix: V8 is doing some good stuff there [04:38] creationix: it's fs.write that's my main bottleneck right now [04:39] bradleymeck: if someone is on safari can they check if: [04:39] bradleymeck: javascript:d=document.body;d.innerHTML="@";setInterval("l+=x=l&64?-x:x;d.style.paddingLeft=l+'%'",x=l=0) [04:39] creationix: hehe, here's a fun one Object.freeze(Object.prototype) [04:39] bradleymeck: works from address bar [04:40] bradleymeck: freezing the prototype of object... interesting, what if the prototype was already replaced though wit something sinister [04:40] creationix: that's why you do it first [04:41] bradleymeck: true enough [04:41] micheil: creationix: do delayed disk flushes? [04:41] micheil: or make them async? [04:41] creationix: that way you can be sure your third-party libs aren't messing with the prototype [04:41] micheil: (like, they already are async, but in the sense that you store the db in memory, but flush to disk in background) [04:41] creationix: micheil: the writes are already async [04:42] creationix: but fs operations are blocking in posix, node gets around it using a threadpool [04:42] micheil: but it's not just an fs op. [04:42] creationix: loading a large nStore database from disk, for example, is 50% cpu time on pthread mutex lock [04:42] micheil: you need to serialize the elements or something as well [04:42] creationix: micheil: yeah, JSON.stringify is somewhat of a cost too [04:43] creationix: but there isn't much getting around that [04:43] micheil: so push that into say.. process.nextTick [04:43] brainproxy: been doing some research, think I know the answer, but will basically all non-ascii unicode characters get escaped into \uNNNN when I do JSON.stringify [04:43] brainproxy: ? [04:43] bradleymeck: yes [04:43] creationix: micheil: no, process.nextTick is way too slow at this level, trust me [04:43] micheil: creationix: you know what I mean though [04:43] creationix: bradleymeck: yeah, JSON.stringify is a little overzealous [04:44] micheil: or just buffer things [04:44] creationix: micheil: like I said, I can do write combining [04:44] creationix: that will help some [04:44] micheil: so, have a 100ms delay before an insert hits disk [04:44] micheil: which.. is write combiing [04:44] micheil: *combining [04:44] dannycoates has joined the channel [04:44] creationix: yeah, it just needs to be done without timeouts or nextTicks [04:45] creationix: they are too slow when you're talking about wanting 50k/sec [04:45] creationix: or queueing up a million inserts [04:45] jamescarr: creationix, I would like to see some kind of metrics on performance of mutable vs. immutable objects in V8 [04:45] jamescarr: I was wondering the same thing [04:45] jamescarr: overall, I think it doesnt matter... [04:46] brainproxy: the json spec doesn't seem like it would HAVE to escape all non-ascii characters; but it seems like v8 is wired up that way [04:46] cardona507 has joined the channel [04:46] jamescarr: even when you freeze an object, nested objects are still mutable [04:46] creationix: jamescarr: I know that adding and removing props at runtime (after creation) slows them down a lot [04:46] stride: there are immutable objects in javascript? [04:46] Tim_Smart: creationix: Can you have two processes? One that handles all the in-memory stuff, and another that does all the JSON / fs stuff? [04:46] brainproxy: stride: strings are immutable [04:46] stride: oh, freeze & seal stuff, ok [04:46] jamescarr: stride, in ES5 yes [04:46] jamescarr: dunno if it's immutable per se really [04:46] creationix: Tim_Smart: maybe, but I want to keep it simple and the IPC overhead might be too much [04:46] confoocious has joined the channel [04:47] jamescarr: I think freeze, seal, etc just means YOU can't change them [04:47] bradleymeck: brainproxy according to json spec, if its not 0-9a-z+change you should escape it T_T [04:47] creationix: jamescarr: and thus they can't be changed [04:47] jamescarr: at they system level on the other hand.. [04:47] Tim_Smart: creationix: I think the only way to find the best solution, is to try and benchmark them all. [04:47] bradleymeck: i should test if i can still change through c++ past the ecma5 seal/freeze [04:48] creationix: Tim_Smart: I've been trying, but not seeing much difference [04:48] jamescarr: bradleymeck, yes! [04:48] jamescarr: I'd like to know if that is true [04:48] jamescarr: I think it is really just synthetic sugar [04:48] brainproxy: bradleymeck: alright, well so much for getting much use out of ulzss when the complexity and/length of a string gets beynod a few thousand characters [04:48] jamescarr: I made my own deepFreeze utility method [04:48] jamescarr: because I wanted to freeze the whole graph ;) [04:49] creationix: jamescarr: let me know your findings, but in the mean-time, I'm freezing all my prototype "classes" and sealing all my "instances" after the initialize function [04:49] creationix: forces me to code cleaner [04:49] jamescarr: creationix, well, it's the whole value object vs. entities [04:49] creationix: so I don't accidentally cause V8 to switch to slow mode [04:50] stride: freeze / isFrozen only appears in the changelog and v8natives.js so I guess there are no safeguards on the c++ side for it [04:50] jakehow has joined the channel [04:50] maqr has joined the channel [04:50] creationix: well, since I don't write or use C extensions it's the same to me ;) [04:50] creationix: ACTION likes rolling with pure js [04:51] derferman has joined the channel [04:51] stride: oh, scratch that, it's setting some writable / configurable stuff on the object [04:52] creationix: jamescarr: I'm enforcing the lockdown at my object framework level http://github.com/creationix/nstore/blob/rewrite/lib/class.js [04:53] creationix: it's almost like the "security" of strict typing [04:53] creationix: but it bit me when I wanted to write a plugin for nStore [04:53] creationix: I wasn't able to modify the nStore prototype because it was frozen [04:53] jamescarr: creationix, it's a good practice, it's what I do in java all the time [04:54] creationix: so I just replaced the nStore prototype with an extended version of itself http://github.com/creationix/nstore/blob/rewrite/test/findTest.js#L4 [04:54] creationix: which means that I can now have two versions of nStore with different plugins in the same process [04:54] creationix: this is good because every table is an nStore instance [04:54] creationix: not all need the plugins [04:58] Tim_Smart: creationix: Yeah that two-process thing won't work really, as you can't have shared memory. [04:58] creationix: I should be able to do the CPU intensive stuff while waiting for the disk IO [04:58] Tim_Smart: So the JSON.stringify has to be in the process handling the data [04:58] creationix: I just need to make sure to parallelize it correctly [04:59] Tim_Smart: creationix: Would be nice to have some shm bindings in node. [04:59] creationix: nah, then you have concurrency issues [04:59] Tim_Smart: But then you start getting into locks and stuff.. yeah. [04:59] creationix: Tim_Smart: maybe if it had the locks built-in [05:00] creationix: so js people didn't have to worry about it [05:00] Neil__ has joined the channel [05:00] bronson_ has joined the channel [05:02] jedschmidt has joined the channel [05:02] creationix: yuck I get 85 queries/second with only 200 rows [05:02] micheil: ouch [05:02] creationix: yeah, I'm going to need some indexes and caches for queries to be any fast [05:02] creationix: but I'm pretty sure I can do that all in an external plugin [05:03] creationix: and by query, I mean search the entire database for records that match a condition [05:03] creationix: simple read by key is very fast [05:03] jamescarr: cloudhead is never here when I need him :( [05:04] Tim_Smart: creationix: You definitely will need some sort of cache for conditional queries. Maybe views like couch etc? [05:04] saikat has joined the channel [05:04] creationix: Tim_Smart: yeah, I was thinking user defined indexes that are kept in ram [05:04] creationix: precomputed expressions [05:04] creationix: and if your query has that as part of it, it uses the index [05:06] creationix: also I want a read cache, so I don't keep reading the same 200 values from the disk over and over [05:06] creationix: but I need a way to control the size of the cache [05:06] creationix: sure the OS will cache the read, but I really want to cache the JSON.parse [05:07] jamescarr: its a start [05:07] jamescarr: http://gist.github.com/537096 [05:07] jamescarr: now I just need to get my async stubbing working [05:07] creationix: jamescarr: neat [05:07] stride: huh? what file system driver really reads the same stuff 200 times in a row? [05:07] creationix: Mokito :) [05:08] bpot has joined the channel [05:08] jamescarr: yeah, I'm doing some hacks on top of a javascript version of mockito someone wrote [05:08] creationix: stride: exactly but even if the OS skips the actual disk, I'm still JSON.parsing the data every time [05:08] stride: ah okay, good point [05:08] creationix: and it's my CPU that's getting hammered, not my disk [05:09] jamescarr: given(fs).readFile('foo', anyCallback()).willAnswer(null, 'result') [05:09] creationix: in theory disk I/O trumps CPU processing always, but not for this case [05:09] jamescarr: thats my target [05:09] stride: btw, anybody happens to have made bindings for http://code.google.com/p/google-sparsehash/ ? [05:09] Neil__ has joined the channel [05:09] creationix: jamescarr: that's some crazy proxying going on [05:10] amerine has joined the channel [05:10] micheil: creationix: memory mapped fs ftw. [05:10] creationix: micheil: if only [05:11] micheil: why can't you? [05:11] jamescarr: creationix, yeah... not even sure how I'm going to handle events [05:11] creationix: micheil: in pure node? [05:11] creationix: I'm not messing with C code, I want nStore portable [05:11] micheil: yeah, in pure node. [05:11] stride: wasn't there node-fuse few months back? :) [05:11] micheil: you load and parse you datastore once on load. [05:11] creationix: stride: did someone make it [05:12] creationix: micheil: yes, I'm doing that [05:12] stride: don't know, just have the name in the back of my head [05:12] micheil: creationix: so where's the slowness? [05:12] creationix: stride: I know ryah asked for one, but I don't think anyone ever made it [05:12] creationix: micheil: I'm just keeping the offsets in ram, not holding all the database [05:12] micheil: why not? [05:12] creationix: so every read needs to fs.read and the JSON.parse [05:13] creationix: micheil: so I can handle large data sets [05:13] stride: ah okay, only used it once with a java wrapper, fun but not really useful because the wrapper was somehow outdated [05:13] creationix: but with a configurable ram-cache, I get the best of both worlds [05:13] micheil: be smart about it, if the data set is less then say, 1 million items, you can probably hold it easily all in memory. [05:13] creationix: micheil: depends, mape's nStore database is only 4 documents, but they are about 10mb each [05:14] creationix: people will use stuff in weird ways [05:14] micheil: hmm.. good point. [05:14] creationix: I want some sort of system where the most recently queried N results are kept in ram [05:14] creationix: and the person using the db can set the number [05:16] mape: creationix: It isn't wierd :/ Just creative [05:16] creationix: I consider "weird" a compliment, but I guess that's not universal [05:16] creationix: mape: creative is a better word [05:16] mape: Or blunt, depending on how you look at it ;) [05:17] creationix: mape: how has nStore been working for you btw [05:17] creationix: hopefully not much lost data [05:17] mape: I don't really know to be honest, nodejs.se has been running since we spoke [05:18] mape: No hickups [05:18] creationix: mape: I noticed it stil doesn't pick up my tweets [05:18] mape: still doing #node.js? [05:18] creationix: yep [05:18] mape: That breaks even on the twitter pages so [05:18] creationix: really, hmm [05:18] stride: have you tried enclosing it as "#node.js"? [05:18] mape: http://twitter.com/creationix [05:19] creationix: I see [05:19] jamescarr: hmmm.. .what would be the proper way to emulate an async call like fs.readFile? [05:19] mape: if you check the last tweet twitter doesn't pick it up as a hashtag [05:19] jamescarr: just use an emitter and emit right away? [05:19] creationix: jamescarr: using process.nextTick for sure [05:19] mape: Plus ryan uses #nodejs so kinda assumed it was "offical" [05:20] jamescarr: creationix, example? say I wanted foo('test', cb) to be async [05:21] MikhX has joined the channel [05:21] creationix: jamescarr: I don't quite understand mocks, but if you wanted a fake foo, it would process.nextTick(function () { callback(some,args);}) [05:22] jamescarr: I figured it out [05:22] jamescarr: thanks man [05:22] jamescarr: next I'll need to fake events [05:23] creationix: jamescarr: new EventEmitter() [05:23] jamescarr: yeah, that part should be easy, trying to flesh out a syntax :) [05:25] Tim_Smart: creationix: Just a heads up on Hash, putting var declarations inside large loops can have performance implications. [05:26] creationix: really? [05:26] creationix: it's not a new scope, shouldn't matter [05:26] Tim_Smart: Yeah. Well it does on most Javascript implementations. [05:26] creationix: Tim_Smart: I know it matters for things like forEach where it's a new context each time [05:27] creationix: but I thought it didn't matter for for(;;) loops [05:27] creationix: s/context/scope/ [05:27] Tim_Smart: Well it has been a while since I benched it, I might have a another try. [05:27] twoism has joined the channel [05:31] Tim_Smart: creationix: Nope, doesn't affect V8 it seems. [05:31] creationix: cool [05:32] mikeal has joined the channel [05:33] ajsie has joined the channel [05:33] mape: visnup: Have you looked at over seas shipping as of yet? [05:33] visnup: most of the prizes we're leaving up to the sponsors to figure out how to ship internationally [05:33] mape: Hehe good tactic [05:33] visnup: and I don't even want to think of legal things [05:33] mape: Yeah it is a mess [05:33] visnup: ...nor taxes [05:37] bradleymeck: you are going to make me go broke by taxes! aaah [05:37] jamescarr: doh... I'm ready to go to sleep because my memory is getting foggy [05:37] jamescarr: how do you call a function with the arguments of another one? fn.apply(this, arguments) right? [05:38] mape: bradleymeck: Don't think they will have a one million dollar prize ;) [05:39] jamescarr: yep [05:39] hober has joined the channel [05:40] creationix: hmm, Object.getOwnPropertyDescriptor doesn't seem to work for build-in stuff [05:41] bradleymeck has left the channel [05:43] stride: nope, that was in the v8natives.js I looked at before iirc, it's hidden / disabled there [05:44] jochen has joined the channel [05:44] creationix: nevermind, it works, it just confuses the heck out of sys.inspect [05:44] stride: oh, okay [05:44] stride: that file is confusing the heck out of me :) [05:44] saikat has joined the channel [05:44] jetienne has joined the channel [05:45] creationix: stride: https://gist.github.com/c9d73c3da2d054504486 [05:45] creationix: It's a converter that takes normal Consructor based functions and creates plain prototypes with a initialize method [05:46] creationix: kinda like a sys.inherits and convert in one [05:47] mape: I'm really enjoying how http://node-monitoring.mape.me/ is turning out. Using it on the iPad feels like using a Star Trek tricoder for code [05:48] micheil: woooow... [05:48] micheil: mape: what's that actually doing? [05:48] micheil: that looks epic. [05:48] mape: Making you go wow, at least currently [05:48] mape: ;) [05:49] mape: I'm just mocking a UI right now [05:49] jamescarr: doh... whats a quick dirty way to check if an object i a function? [05:49] mape: Figured I'd be able to team up with someone later on when dtrace is landed for some node-monitor/profiling for actual implementation [05:50] stride: creationix: have to try using that, looks like a much cleaner approach than sys.inherits when you really extend the functionality [05:50] Tim_Smart: jamescarr: typeof variable === 'function [05:50] Tim_Smart: ' [05:50] micheil: mape: what js framework? [05:50] jamescarr: typeof thats right [05:50] Tim_Smart: Grrr dam cat stole my desk chair [05:50] creationix: mape: awesome, you should really apply at Sencha [05:51] micheil: creationix: there's still jobs available there? [05:51] creationix: micheil: always if you can do cool stuff [05:51] mape: micheil: Right now it is a mishmash of a little jQuery, a little protovis and some Javascript InfoVis toolkit, just prototyp now so would need to be cleaned up if it would actually be used [05:52] Tim_Smart: creationix: How are sencha using node now? [05:52] jetienne: mape: teach me ui ! you got colors ! [05:52] hober: Is Sencha interested in remote workers at al? [05:52] mape: creationix: Hehe I would just bomb the interview [05:52] hober: or is it more of an sf-only thing [05:52] creationix: we've got some remote people, but it's harder to come by [05:52] mape: jetienne: I'm colorblind, can't help you with the colors I'm afraid [05:52] creationix: tj is remote and so is Dmitry1 [05:52] jetienne: mape: then im blind [05:53] creationix: do people generally cry heretic when you modify Function.prototype or just mainly for Object.prototype [05:54] Tim_Smart: I think modifying prototypes in general (for native types) [05:54] jetienne: creationix: when you modify globals [05:54] jetienne: globals often means conflicts [05:54] creationix: I got around my need for messing with Object.prototype pretty well, but I really need a couple of things on Function.prototype [05:55] creationix: and since everyone considers it evil there won't be many conflicts right ;) [05:55] CIA-77: node: 03Ryan Dahl 07master * r0906f94 10/ deps/v8/src/utils.h : [05:55] CIA-77: node: Fix V8 build for old gcc [05:55] CIA-77: node: also sent upstream: http://codereview.chromium.org/3130033/show - http://bit.ly/cfoxMQ [05:55] CIA-77: node: 03Herbert Vojčík 07master * rc5eb1b5 10/ src/node.js : Making "root" available in both context and non-context mode. - http://bit.ly/cIXyI7 [05:55] jetienne: creationix: you are not the only lazy coder you know :) [05:55] mape: Just prefix them with your nick and you should be fine ;) [05:55] astrolin has joined the channel [05:56] creationix: lol [05:56] creationix: well, the Function.prototype thing is just a compat layer for old classes and syntax sugar at that [05:56] stride: or use JimBastards script to obfuscate the names ;) [05:56] creationix: I'll make it optional [05:57] jetienne: websocket appears in chrome resource debugger ? [05:58] csanz has joined the channel [05:58] csanz: hi [05:58] micheil: jetienne: do they? [05:58] jetienne: micheil: dunno i dont see them but i may miss them [05:59] micheil: k [06:04] CIA-77: node: 03Trent Mick 07master * r2134982 10/ lib/repl.js : repl completion: comment/TODO cleanup, no functional change - http://bit.ly/do8FZg [06:04] CIA-77: node: 03Trent Mick 07master * r5c1ffa1 10/ lib/repl.js : repl completion: completion for arguments to "require" - http://bit.ly/dhg3yU [06:04] jamescarr: damn... got to flesh out this api [06:04] CIA-77: node: 03Trent Mick 07master * r1aeaf8d 10/ lib/readline.js : repl tab completion: insert common prefix of multiple completions - http://bit.ly/as7A92 [06:04] jamescarr: given(mock).createReadStream('file').willEmit('data', null, 'contents') [06:04] CIA-77: node: 03Trent Mick 07master * r293809b 10/ lib/repl.js : drop obsolete TODO comment - http://bit.ly/ccgAcl [06:04] jamescarr: looks odd [06:05] icozzo: what did I just walk in on? [06:06] mape: Development? [06:07] icozzo: No kidding, good to see at least somebody is being productive tonight [06:10] twoism has joined the channel [06:14] hober: ryah: I'm happy to report that the solaris problem has magically gone away. [06:17] saikat has joined the channel [06:18] Tim_Smart: magic ftw? [06:19] jetienne: anybody using less.js ? is it working ok ? [06:23] ryah: hober: yeah, i just fixed it ;) [06:24] ryah: so for those who wanted unpack for buffers [06:24] ryah: peter and i agreed on something of this approach: http://github.com/pgriess/node-strtok [06:25] lhardy has joined the channel [06:25] ryah: it looks pretty good [06:27] pquerna: so, not really an unpack..but more.. iterator? [06:27] ryah: yeah [06:27] ryah: can do integers over packet boundaries [06:28] ryah: the msgpack example is great [06:28] ryah: http://github.com/pgriess/node-strtok/blob/master/examples/msgpack/msgpack.js [06:29] Throlkim has joined the channel [06:30] ph^ has joined the channel [06:31] matt_c: oh man that's a really nice interface. [06:32] ryah: ACTION agrees [06:32] ryah: looks good [06:32] lachlanhardy has joined the channel [06:32] pquerna: seems to make sense. wondering if it should just be an event emitter [06:32] pquerna: hmm [06:32] pquerna: though you return the type, so meh [06:33] twoism has joined the channel [06:34] ryah: pquerna: that was the original idea - but it seems having a bunch of functions for each state is kind of overkill [06:34] ryah: i'm not really sold on "return new strtok.BufferType(v);" [06:34] ryah: would be cool if you tell it to buffer without making a new object [06:35] ryah: return [strtok.Buffer, 10] [06:35] ryah: i guess that's also an object constructor [06:36] tpryme has joined the channel [06:36] mtodd has joined the channel [06:36] pquerna: b = new Buffer(type.len); [06:36] pquerna: this scares me a fair bit. [06:37] ryah: oh yeah [06:37] Blink7 has joined the channel [06:37] pquerna: buffer pools go go go [06:37] ryah: :) [06:37] ryah: 10 line hack [06:37] hassox has joined the channel [06:37] pquerna: well, i'm thinking we should implement buffer pooling in buffers themselves. [06:38] ryah: in c, you mean? [06:38] ryah: still a 10 line hack [06:39] pquerna: http://code.google.com/p/pocore/source/browse/trunk/src/memory.c [06:39] pquerna: well, not really [06:39] pquerna: you'd want something like that [06:39] Tim_Smart: Is this to make buffer creation cheaper? [06:40] pquerna: yea, basically, short version, you'd allocate 8kb off malloc [06:40] pquerna: and then hand that out to buffer instances as needed [06:40] pquerna: avoiding 1 byte mallocs is... key [06:40] ryah: nod [06:41] pquerna: but re-using memory you've previously handed out [06:41] pquerna: thats the hard part [06:41] ivong has joined the channel [06:41] isaacs has joined the channel [06:41] ryah: yeah - that's too hard [06:41] ryah: i think just drop the blocks after they're done [06:41] pquerna: heh [06:42] pquerna: APR does it, i thought its too hard too, so I changed us to using a simpler malloc version after the google complaints referenced in the header.. [06:43] ryah: you could have some logic where used blocks get set infront of the current block [06:43] ryah: say one ahead [06:44] pquerna: http://old.nabble.com/Poor-performance-with-new-apr_pool-td22720166.html [06:44] ryah: the rest get freed [06:45] ryah: we're going to have these queues of buffers getting sent out, per fd [06:45] ryah: which'll get writev'd [06:46] ryah: it might make sense to do the buffer pool stuff with that in mind... [06:46] ryah: i'm not sure what that'd mean [06:46] pquerna: locallity? [06:46] pquerna: only thing I could think of is tie a buffer to a fd, and slice out of that one, maybe get some nice page locallity for small things [06:47] pquerna: (slice out of that one when building something to send to it) [06:47] pquerna: so if you are lucky your entire writev contents will be inside one memory page [06:47] pquerna: seems like a pretty crazy assumption though in the end about machine paging without real data :) [06:47] ryah: yeah [06:48] pquerna: although, to be fair, that happens with httpd [06:48] pquerna: because you have a per-thread pool essentially [06:48] pquerna: so allof the reply to a client will likely be out of the same memory page [06:49] pquerna: its just in node's thrashing of jumping between thousands of clients, won't get that. [06:50] ryah: ACTION wants to try to do node-amqp with node-strtok [06:50] pquerna: ohhh ahh [06:50] ryah: currently parsing by hand, painfully [06:53] ryah: also -someone should write a dhcp server [06:53] ryah: i'll post that on the mailing list [06:54] cataska has joined the channel [06:54] ditesh|cassini has joined the channel [06:54] Tim_Smart: Everytime I go to sit down in my chair, my cat has stolen it. Geez. [06:55] matt_c: ryah: I wrote a finger daemon last week using node. It's not pretty but it was suprisingly succinct: http://gist.github.com/519344#file_finger_server.js [06:55] ryah: matt_c: ! [06:56] matt_c: It's not a full implementation of the protocol but it's enough to use a cmdline finger client against it. [06:56] saikat has joined the channel [06:56] SteveDekorte has joined the channel [06:56] ryah: oh man [06:57] ryah: i should run that on nodejs.org [06:57] ph^ has joined the channel [06:59] crohr has joined the channel [07:01] isaacs: matt_c: that's badass [07:01] dnm has joined the channel [07:02] isaacs: matt_c: dude, it'd be rad to have a finger daemon that looks up its data from twitter or something [07:02] matt_c: Scroll down :) http://gist.github.com/519344#file_twitter_finger.js [07:02] isaacs: !!!! [07:02] isaacs: omg you're awesome [07:02] isaacs: <3 <3 [07:03] matt_c: that acts as a proxy for @yourserver [07:03] ryah: finger ryan@tinyclouds.org [07:03] matt_c: ryah: awesome. [07:03] matt_c: ACTION is bringin' it back. [07:03] Tim_Smart: Hawt. [07:03] pquerna: is there something to benchmark strtok with yet? msgpack? [07:04] ryah: oh shit [07:04] ryah: crashed :) [07:04] Tim_Smart: Time to finger hot chicks. [07:04] Tim_Smart: Oh wait.. [07:04] ryah: pquerna: peter has a msgpack binding too [07:04] shreekavi has joined the channel [07:05] matt_c: ryah: oops. I didn't do much more than test it out with the finger client I had handy, so I'm sure there are a bunch of unhanded edge cases. [07:06] ryah: man, where's the announcer bot [07:07] mape: Taking a break :( [07:08] ryah: oh man [07:08] ryah: fingerd [07:08] ryah: that made my night [07:09] matt_c: ACTION loves serving ancient protocols with new tech. [07:09] ryah: yeah [07:11] voxpelli has joined the channel [07:12] blowery has joined the channel [07:15] dnm: CHAOSNET implemented in Node.js: GO! [07:15] dnm: BRB [07:16] pquerna: hmm. [07:16] dnm has joined the channel [07:17] ditesh|cassini has joined the channel [07:17] pquerna: compile faster. [07:17] frza has joined the channel [07:17] astrolin has joined the channel [07:17] pquerna: rewrite gcc in v8. go. [07:23] digitalspaghetti: make node turing complete [07:24] rnewson has joined the channel [07:27] stride: invent asynchronous wheels [07:32] dnm: "Node.js Knockout: Reinvent asynchronous wheels" ;] [07:34] stride: "Where's the car?" "Oh that.. it's a mile behind, constructing it took a bit longer." [07:34] teemow has joined the channel [07:34] twoism has joined the channel [07:36] pquerna: ryah: https://gist.github.com/e88438ab2111944d43bf [07:36] javajunky has joined the channel [07:36] pquerna: (omg it needs massive refactoring, but passes all the test cases) [07:38] ryah: that's more than 10 lines:) [07:38] jbrantly has joined the channel [07:39] pquerna: yes.. bout 50% copy paste in allocation/checking for malloc failure [07:39] pquerna: why does it check for malloc failure anyways [07:40] ryah: habit [07:43] ryah: + V8::AdjustAmountOfExternalAllocatedMemory(sizeof(BlobParent) + sizeof(Blob) + sizeof(Blob) + CHUNKSIZE); [07:44] ryah: nm [07:44] kodisha has joined the channel [07:45] ryah: seems like a memleak at line 72? [07:45] ryah: (of the diff) [07:46] ryah: oh nm [07:46] pquerna: its on purpose [07:46] pquerna: refcounting <3 [07:47] ryah: yeah seems okay [07:47] pquerna: though the free right after that [07:47] pquerna: line 74 [07:47] ryah: it's okay i hitnk [07:48] pquerna: it returned null [07:48] pquerna: it'd free(NULL) [07:49] virtuo_ has joined the channel [07:49] ryah: would be nice to alloc these struct Blob things in the pool too [07:50] ryah: struct blob { int ref; size_t len; char data[1]; } [07:50] ryah: but makes things a bit trickier [07:50] pquerna: yeah. [07:50] pquerna: well, not really [07:50] pquerna: just another offset [07:50] ditesh|cassini has joined the channel [07:51] pquerna: refcounting stays about the same [07:51] pquerna: just need to be careful about order more [07:51] tobiassjosten has joined the channel [07:51] ryah: cause the way it is we're still mallocing a blob struct for each alloc [07:52] ryah: of course we're going to have to new Buffer too [07:52] ryah: but - could remove one alloc [07:53] pquerna: alloc at the node level.. let v8 do its magic [07:53] ryah: need externals for the handle [07:54] ryah: to get the weak ref callbacks, etc [07:55] ryah: i wish i knew c++ better [07:55] ryah: there's probably a way to switch out "new" implementations [07:55] ryah: could just put that on a pool too [07:56] pquerna: http://github.com/pquerna/node/commit/b9a15d85601ca3e4a33798876263cb452d9306ef [07:56] jetienne: ryah: there is. at the global level, and at the class level [07:57] ryah: pquerna: coo [07:57] ryah: let me try it [07:59] micheil: pquerna: is that tls/ssl library of your production / development ready? [08:00] pquerna: no [08:00] pquerna: needs another weekend [08:00] pdelgallego has joined the channel [08:03] ryah: marginally faster [08:04] pquerna: wrt replacing what new did [08:04] pdelgallego has joined the channel [08:04] pquerna: long time ago... project used horde i think ? [08:04] Validatorian has joined the channel [08:04] pquerna: hoard [08:04] virtuo_ has joined the channel [08:05] pquerna: http://prisms.cs.umass.edu/emery/index.php?page=hoard [08:05] pquerna: but it was always about more threaded apps [08:05] ryah: pquerna: compare these two programs [08:05] ryah: for (var i = 0; i < 1000000; i++) { b = new String(10); b[1] = "a"; [08:05] ryah: } [08:05] ryah: ^-- program A [08:05] ryah: for (var i = 0; i < 1000000; i++) { b = new Buffer(10); b[1] = 2 [08:05] ryah: } [08:05] ryah: ^-- program B [08:06] ryah: it's really sad [08:06] micheil: which is faster? [08:06] voxpelli has joined the channel [08:06] Tim_Smart: I did a heap of benchmarking with Buffers not too long ago [08:07] ryah: ryan@mac1234:~/projects/node% time ./node string_loop.js [08:07] ryah: ./node string_loop.js 0.11s user 0.02s system 89% cpu 0.138 total [08:07] ryah: ryan@mac1234:~/projects/node% time ./node buffer_loop.js [08:07] ryah: ./node buffer_loop.js 3.74s user 0.53s system 97% cpu 4.395 total [08:07] micheil: ouch [08:07] ryah: so the buffer pool brings it from 4.5 to 4.3 seconds [08:07] ryah: but it's not really attacking the problem at hand... [08:08] ryah: which is that strings are inside fucking v8 [08:08] ryah: and they can do magic [08:08] Tim_Smart: Damn Google and their magic. [08:08] micheil: I feel like making some scones. bbl. [08:09] Tim_Smart: I feel like pulling rabits out of hats. [08:09] pquerna: hmm [08:09] pquerna: think they would accept a patch adding a native Buffer, if it could be compiled out? [08:09] pquerna: considering it would never get aded to ecma or whatever it is now. [08:09] Tim_Smart: pquerna: You subscribed to the ecmascript mailing list? [08:09] ryah: the problem is that v8 moves memory around [08:09] webr3: ryah, about 2 months ago I passed over a patch to the ssl module which gave back more details from client side certificates, but never got the unit tests done - is the code still in master or will i need to resubmit a new patch (hopefully can free time today to do new unit tests / gen new test certs) [08:10] pquerna: Tim_Smart: no, i avoid most web standards groups. [08:10] pquerna: i tried ietf stuff for awhile. can't do it. [08:10] ryah: pquerna: i did a patch for it - but they wouldn't let me expose a pointer to the memory [08:10] pquerna: ah [08:10] Tim_Smart: pquerna: They are trying to get a way of handling binary data in harmony [08:11] ryah: webr3: okay [08:11] ryah: webr3: yeah sorry, ssl has been getting the cold shoulder from me [08:11] ryah: but i'll take fixes [08:11] webr3: ryah, any particular reason / anything else needing done? [08:12] Tim_Smart: pquerna: This might be of interest http://wiki.ecmascript.org/doku.php?id=strawman:binary_data&s=binary [08:12] ryah: webr3: because the whole thing needs to be redone [08:13] webr3: lol fair enough - don't think i can pull that much time atm - will repatch against the last rev in master and get unit tests passing + new test certs gen'd then see what time i have left :) [08:15] ryah: we should find out what part of "new Buffer" is slow [08:15] ryah: it's not the malloc of blob [08:15] ryah: theory 1 check [08:16] necrodearia has joined the channel [08:17] matt_c has joined the channel [08:17] pquerna: ryah: yeah, its not malloc :) [08:17] pquerna: ryah: instruments.app... [08:19] pquerna: seems to all be in constructor_template/setting stuff on the created objects. [08:19] pquerna: 42% of time in v8::internal::Runtime::SetObjectProperty [08:20] pquerna: (downstream of Buffer::New()) [08:20] ryah: hm [08:21] ph^ has joined the channel [08:22] aubergine has joined the channel [08:24] Tim_Smart: Could it be SetIndexedPropertiesToExternalArrayData or something? [08:25] ryah: i don't see SetObjectProperty [08:26] ryah: I see AllocateMap() [08:26] Tim_Smart: I might boot into Mac and play with Instruments. [08:27] Tim_Smart: dtrace doesn't work on linux quite yet right? [08:27] pquerna: Tim_Smart: SetIndexedPropertiesToExternalArrayData is ~8% in my trace [08:27] Tim_Smart: Oh ok that is reasonable then. [08:27] pquerna: Tim_Smart: but the other SetProperty is 64% [08:27] Tim_Smart: Which one? [08:28] pquerna: node::Buffer::New -> v8::internal::SetProperty [08:28] pquerna: its getting confused though [08:28] Tim_Smart: So the actual call to New is doing it... weird. [08:30] pquerna: actually, that might be a good test. [08:30] pquerna: just how expensive is any external object [08:30] visnup has joined the channel [08:30] pquerna: buffer isn't attaching all that manythings [08:31] visnup: ryah: knockout / joyent question - are you guys thinking smart machines or smart platform? [08:31] zomgbie has joined the channel [08:31] ryah: visnup: smart machines [08:32] visnup: ryah: cool, thanks [08:32] ryah: sorry - didn't reply to your mail :) [08:32] visnup: hehe [08:32] ryah: i think cause it was a tweet or something [08:32] ryah: :) [08:33] ryah: so im not running pquerna's patch [08:33] ryah: maybe that's the diff [08:33] ryah: but i see a lot of [08:33] ryah: 188 4.2% v8::internal::ScavengingVisitor::EvacuateFixedArray [08:33] ryah: 183 4.1% v8::internal::SweepSpace [08:34] ryah: i wonder if adding a new memory region to v8's heap would be possible [08:34] ryah: one where objects don't get moved... [08:35] ryah: maybe have it specificly for buffers... [08:35] ryah: ACTION goes to sleep [08:41] Tim_Smart has joined the channel [08:43] rnewson has joined the channel [08:43] rnewson has joined the channel [08:45] xla has joined the channel [08:45] isaacs has joined the channel [08:47] christophsturm has joined the channel [08:48] ivong has joined the channel [08:48] mjr_ has joined the channel [08:48] cheriot_ has joined the channel [08:48] persson_ has joined the channel [08:48] chapel has joined the channel [08:48] admc has joined the channel [08:48] pzich has joined the channel [08:48] nuba has joined the channel [08:48] rednul has joined the channel [08:48] Connorhd_ has joined the channel [08:48] PokeBot has joined the channel [08:48] trodrigues has joined the channel [08:48] jb55 has joined the channel [08:48] jesusabdullah has joined the channel [08:48] sadiq has joined the channel [08:48] kloeri has joined the channel [08:48] donnex has joined the channel [08:48] apage43 has joined the channel [08:48] mediacoder has joined the channel [08:48] cce has joined the channel [08:49] Tim_Smart: pquerna: What instruments do you usually use? [08:50] FransWillem has joined the channel [08:51] chrischris has joined the channel [08:51] ryan[WIN] has joined the channel [08:51] mmso has joined the channel [08:57] zum_ has joined the channel [09:13] beppu has joined the channel [09:13] manveru has joined the channel [09:13] syntaxritual has joined the channel [09:13] tmm1 has joined the channel [09:13] pquerna has joined the channel [09:13] wattz has joined the channel [09:13] cha0s has joined the channel [09:13] chewbranca has joined the channel [09:13] Tekerson has joined the channel [09:13] freeformz|vacati has joined the channel [09:13] ryah has joined the channel [09:13] halorgium has joined the channel [09:13] adinardi has joined the channel [09:13] pkrumins has joined the channel [09:13] chilts has joined the channel [09:13] ice799 has joined the channel [09:13] mephux has joined the channel [09:13] elliottcable has joined the channel [09:13] stalled has joined the channel [09:13] zedas has joined the channel [09:13] srveit has joined the channel [09:13] wink_ has joined the channel [09:13] adelcambre has joined the channel [09:13] tocho-san has joined the channel [09:13] LionMade0fLions has joined the channel [09:13] inimino has joined the channel [09:13] foca has joined the channel [09:13] frode has joined the channel [09:13] er1c_ has joined the channel [09:13] shajith has joined the channel [09:13] tsyd has joined the channel [09:13] joeshaw has joined the channel [09:13] Aikar has joined the channel [09:13] ashleydev has joined the channel [09:13] ian`` has joined the channel [09:13] aconran has joined the channel [09:13] decklin has joined the channel [09:13] TrisMcC has joined the channel [09:13] tuxsbro_ has joined the channel [09:13] geeks_bot1 has joined the channel [09:13] Astro has joined the channel [09:13] Draggor has joined the channel [09:13] hdon has joined the channel [09:13] solidsnack has joined the channel [09:13] mde has joined the channel [09:13] joshthecoder_ has joined the channel [09:13] brainproxy has joined the channel [09:13] pufuwozu has joined the channel [09:13] jtsnow has joined the channel [09:13] marshall_law has joined the channel [09:13] micheil has joined the channel [09:13] sonnym has joined the channel [09:13] KungFuHamster has joined the channel [09:13] nefD has joined the channel [09:13] polyrhythmic has joined the channel [09:13] davidc_ has joined the channel [09:13] keeto has joined the channel [09:13] rphillips has joined the channel [09:13] ntelford has joined the channel [09:13] mscdex has joined the channel [09:13] stride has joined the channel [09:13] xer0xM has joined the channel [09:13] webr3 has joined the channel [09:13] rwaldron has joined the channel [09:13] sveisvei has joined the channel [09:13] themcgruff has joined the channel [09:13] Atm0z has joined the channel [09:13] Viriix_ has joined the channel [09:13] lianj has joined the channel [09:13] WALoeIII has joined the channel [09:13] TangoIII has joined the channel [09:13] sh1mmer has joined the channel [09:13] meso has joined the channel [09:13] esigler has joined the channel [09:13] jimmybaker has joined the channel [09:13] jacobolus has joined the channel [09:13] joshbuddy has joined the channel [09:13] confoocious has joined the channel [09:13] maqr has joined the channel [09:13] hober has joined the channel [09:13] tpryme has joined the channel [09:13] mtodd has joined the channel [09:13] Blink7 has joined the channel [09:13] saikat has joined the channel [09:13] SteveDekorte has joined the channel [09:13] blowery has joined the channel [09:13] frza has joined the channel [09:13] javajunky has joined the channel [09:13] pdelgallego has joined the channel [09:13] Validatorian has joined the channel [09:13] virtuo_ has joined the channel [09:13] voxpelli has joined the channel [09:13] necrodearia has joined the channel [09:13] matt_c has joined the channel [09:13] ph^ has joined the channel [09:13] Tim_Smart has joined the channel [09:13] xla has joined the channel [09:13] christophsturm has joined the channel [09:13] FransWillem has joined the channel [09:13] danielzilla has joined the channel [09:13] sztanphet has joined the channel [09:13] jspiros_ has joined the channel [09:13] russell_h has joined the channel [09:13] konobi_ has joined the channel [09:13] hoodow_ has joined the channel [09:13] dispalt_ has joined the channel [09:13] shachaf has joined the channel [09:13] dnm has joined the channel [09:13] shreekavi has joined the channel [09:13] ajsie has joined the channel [09:13] kreyman has joined the channel [09:13] [[zz]] has joined the channel [09:13] Sembiance has joined the channel [09:13] tg has joined the channel [09:13] drudge has joined the channel [09:13] mcarter has joined the channel [09:13] adrienf has joined the channel [09:13] mqt has joined the channel [09:13] ivan has joined the channel [09:13] frodenius has joined the channel [09:13] vstb has joined the channel [09:13] s0enke has joined the channel [09:13] zhesto has joined the channel [09:13] guybrush has joined the channel [09:13] evilhackerdude has joined the channel [09:13] mape has joined the channel [09:13] Roelven has joined the channel [09:13] Pilate has joined the channel [09:13] coffeecup has joined the channel [09:15] mjr_ has joined the channel [09:15] cheriot_ has joined the channel [09:15] persson_ has joined the channel [09:15] chapel has joined the channel [09:15] admc has joined the channel [09:15] pzich has joined the channel [09:15] nuba has joined the channel [09:15] rednul has joined the channel [09:15] Connorhd_ has joined the channel [09:15] PokeBot has joined the channel [09:15] trodrigues has joined the channel [09:15] jb55 has joined the channel [09:15] jesusabdullah has joined the channel [09:15] sadiq has joined the channel [09:15] kloeri has joined the channel [09:15] donnex has joined the channel [09:15] apage43 has joined the channel [09:15] mediacoder has joined the channel [09:15] cce has joined the channel [09:15] crohr has joined the channel [09:15] keeran_ has joined the channel [09:15] chrischris has joined the channel [09:15] ryan[WIN] has joined the channel [09:15] mmso has joined the channel [09:15] tav has joined the channel [09:17] ehaas has joined the channel [09:17] crohr has joined the channel [09:17] shachaf has joined the channel [09:17] dispalt_ has joined the channel [09:17] hoodow_ has joined the channel [09:17] konobi_ has joined the channel [09:17] russell_h has joined the channel [09:17] jspiros_ has joined the channel [09:17] sztanphet has joined the channel [09:17] danielzilla has joined the channel [09:17] FransWillem has joined the channel [09:17] christophsturm has joined the channel [09:17] xla has joined the channel [09:17] Tim_Smart has joined the channel [09:17] ph^ has joined the channel [09:17] matt_c has joined the channel [09:17] necrodearia has joined the channel [09:17] voxpelli has joined the channel [09:17] virtuo_ has joined the channel [09:17] Validatorian has joined the channel [09:17] pdelgallego has joined the channel [09:17] javajunky has joined the channel [09:17] frza has joined the channel [09:17] blowery has joined the channel [09:17] SteveDekorte has joined the channel [09:17] saikat has joined the channel [09:17] Blink7 has joined the channel [09:17] mtodd has joined the channel [09:17] tpryme has joined the channel [09:17] hober has joined the channel [09:17] maqr has joined the channel [09:17] confoocious has joined the channel [09:17] joshbuddy has joined the channel [09:17] jacobolus has joined the channel [09:17] jimmybaker has joined the channel [09:17] esigler has joined the channel [09:17] meso has joined the channel [09:17] sh1mmer has joined the channel [09:17] TangoIII has joined the channel [09:17] WALoeIII has joined the channel [09:17] lianj has joined the channel [09:17] Viriix_ has joined the channel [09:17] Atm0z has joined the channel [09:17] themcgruff has joined the channel [09:17] sveisvei has joined the channel [09:17] rwaldron has joined the channel [09:17] webr3 has joined the channel [09:17] xer0xM has joined the channel [09:17] stride has joined the channel [09:17] mscdex has joined the channel [09:17] ntelford has joined the channel [09:17] rphillips has joined the channel [09:17] keeto has joined the channel [09:17] davidc_ has joined the channel [09:17] polyrhythmic has joined the channel [09:17] nefD has joined the channel [09:17] KungFuHamster has joined the channel [09:17] sonnym has joined the channel [09:17] micheil has joined the channel [09:17] marshall_law has joined the channel [09:17] jtsnow has joined the channel [09:17] pufuwozu has joined the channel [09:17] brainproxy has joined the channel [09:17] joshthecoder_ has joined the channel [09:17] mde has joined the channel [09:17] solidsnack has joined the channel [09:17] hdon has joined the channel [09:17] Draggor has joined the channel [09:17] Astro has joined the channel [09:17] geeks_bot1 has joined the channel [09:17] tuxsbro_ has joined the channel [09:17] TrisMcC has joined the channel [09:17] decklin has joined the channel [09:17] aconran has joined the channel [09:17] ian`` has joined the channel [09:17] ashleydev has joined the channel [09:17] Aikar has joined the channel [09:17] joeshaw has joined the channel [09:17] tsyd has joined the channel [09:17] shajith has joined the channel [09:17] er1c_ has joined the channel [09:17] frode has joined the channel [09:17] foca has joined the channel [09:17] inimino has joined the channel [09:17] LionMade0fLions has joined the channel [09:17] tocho-san has joined the channel [09:17] adelcambre has joined the channel [09:17] wink_ has joined the channel [09:17] srveit has joined the channel [09:17] zedas has joined the channel [09:17] stalled has joined the channel [09:17] elliottcable has joined the channel [09:17] mephux has joined the channel [09:17] ice799 has joined the channel [09:17] chilts has joined the channel [09:17] pkrumins has joined the channel [09:17] adinardi has joined the channel [09:17] halorgium has joined the channel [09:17] ryah has joined the channel [09:17] freeformz|vacati has joined the channel [09:17] Tekerson has joined the channel [09:17] chewbranca has joined the channel [09:17] cha0s has joined the channel [09:17] wattz has joined the channel [09:17] pquerna has joined the channel [09:17] tmm1 has joined the channel [09:17] syntaxritual has joined the channel [09:17] manveru has joined the channel [09:17] beppu has joined the channel [09:18] ollie has joined the channel [09:18] careo_ has joined the channel [09:18] DoubleVTF has joined the channel [09:18] wang_ has joined the channel [09:18] ditesh|cassini has joined the channel [09:18] tobiassjosten has joined the channel [09:18] cataska has joined the channel [09:18] mr_daniel has joined the channel [09:18] probablyCorey has joined the channel [09:18] Sutto has joined the channel [09:18] digitalspaghetti has joined the channel [09:18] szaboat has joined the channel [09:18] DoNaLd` has joined the channel [09:18] phiggins has joined the channel [09:18] elbart has joined the channel [09:18] WarBot has joined the channel [09:18] henriklied has joined the channel [09:18] frekw_ has joined the channel [09:18] khaase has joined the channel [09:18] _announcer has joined the channel [09:18] bjartek has joined the channel [09:18] icy has joined the channel [09:18] aniero has joined the channel [09:19] adamholt has joined the channel [09:19] jetienne has joined the channel [09:19] mpoz2 has joined the channel [09:19] mAritz has joined the channel [09:19] kodisha has joined the channel [09:19] Noya_ has joined the channel [09:19] AAA_awright has joined the channel [09:19] voodootikigod has joined the channel [09:19] dnyy has joined the channel [09:19] luddep has joined the channel [09:19] _alex has joined the channel [09:19] sstreza has joined the channel [09:19] jamescarr_ has joined the channel [09:19] a_meteorite has joined the channel [09:19] populuxe has joined the channel [09:19] aurynn has joined the channel [09:19] zz_rubydiamond has joined the channel [09:19] gbot2 has joined the channel [09:19] markwubben has joined the channel [09:19] foobarfighter has joined the channel [09:19] jbrantly has joined the channel [09:19] PyroPeter has joined the channel [09:19] geojeff has joined the channel [09:19] away01 has joined the channel [09:19] justin___ has joined the channel [09:19] terinjokes has joined the channel [09:19] jwm has joined the channel [09:19] beelzabub has joined the channel [09:19] FireFoxIXI has joined the channel [09:20] ivar has joined the channel [09:20] astrolin has joined the channel [09:20] dipser has joined the channel [09:20] sr has joined the channel [09:20] ashb has joined the channel [09:20] CrabDude has joined the channel [09:20] gm__ has joined the channel [09:20] ironfroggy has joined the channel [09:20] Clooth has joined the channel [09:20] SvenDowideit has joined the channel [09:20] jdub has joined the channel [09:20] rudebwoy has joined the channel [09:20] philippbosch has joined the channel [09:20] webben has joined the channel [09:20] jakob has joined the channel [09:20] janne has joined the channel [09:20] inarru has joined the channel [09:20] MrNibbles has joined the channel [09:20] aakour has joined the channel [09:20] NickP has joined the channel [09:20] zomgbie has joined the channel [09:20] icozzo has joined the channel [09:20] ThePub has joined the channel [09:20] kriszyp has joined the channel [09:20] jhelwig has joined the channel [09:20] cferris has joined the channel [09:20] mischief has joined the channel [09:20] scoates has joined the channel [09:20] BB^101 has joined the channel [09:20] rektide has joined the channel [09:20] skampler has joined the channel [09:20] CIA-77 has joined the channel [09:20] SubStack has joined the channel [09:20] easternbloc has joined the channel [09:20] dnolen has joined the channel [09:20] dispalt has joined the channel [09:20] xer0xMA has joined the channel [09:22] mde has joined the channel [09:22] lianj_ has joined the channel [09:22] chilts_ has joined the channel [09:22] shajith_ has joined the channel [09:22] jetienne has joined the channel [09:23] Tekerson has joined the channel [09:24] solidsnack has joined the channel [09:24] themcgruff has joined the channel [09:24] robinduckett has joined the channel [09:24] robinduckett: is Nickserv down or something? [09:25] chewbranca has joined the channel [09:25] tuxsbro_ has joined the channel [09:26] TomY has joined the channel [09:30] Tim_Smart has joined the channel [09:30] aubergine has joined the channel [09:32] Tim_Smart1 has joined the channel [09:33] Tim_Smart has joined the channel [09:35] maqr has joined the channel [09:35] jetienne has joined the channel [09:35] shajith_ has joined the channel [09:35] chilts_ has joined the channel [09:35] lianj_ has joined the channel [09:35] ehaas has joined the channel [09:35] crohr has joined the channel [09:35] shachaf has joined the channel [09:35] hoodow_ has joined the channel [09:35] konobi_ has joined the channel [09:35] russell_h has joined the channel [09:35] jspiros_ has joined the channel [09:35] sztanphet has joined the channel [09:35] danielzilla has joined the channel [09:35] FransWillem has joined the channel [09:35] xla has joined the channel [09:35] matt_c has joined the channel [09:35] necrodearia has joined the channel [09:35] voxpelli has joined the channel [09:35] virtuo_ has joined the channel [09:35] Validatorian has joined the channel [09:35] pdelgallego has joined the channel [09:35] javajunky has joined the channel [09:35] frza has joined the channel [09:35] blowery has joined the channel [09:35] saikat has joined the channel [09:35] Blink7 has joined the channel [09:35] mtodd has joined the channel [09:35] tpryme has joined the channel [09:35] hober has joined the channel [09:35] confoocious has joined the channel [09:35] joshbuddy has joined the channel [09:35] jacobolus has joined the channel [09:35] jimmybaker has joined the channel [09:35] esigler has joined the channel [09:35] meso has joined the channel [09:35] sh1mmer has joined the channel [09:35] TangoIII has joined the channel [09:35] WALoeIII has joined the channel [09:35] Viriix_ has joined the channel [09:35] Atm0z has joined the channel [09:35] sveisvei has joined the channel [09:35] rwaldron has joined the channel [09:35] webr3 has joined the channel [09:35] stride has joined the channel [09:35] mscdex has joined the channel [09:35] ntelford has joined the channel [09:35] rphillips has joined the channel [09:35] keeto has joined the channel [09:35] davidc_ has joined the channel [09:35] polyrhythmic has joined the channel [09:35] nefD has joined the channel [09:35] KungFuHamster has joined the channel [09:35] sonnym has joined the channel [09:35] micheil has joined the channel [09:35] marshall_law has joined the channel [09:35] jtsnow has joined the channel [09:35] pufuwozu has joined the channel [09:35] brainproxy has joined the channel [09:35] joshthecoder_ has joined the channel [09:35] hdon has joined the channel [09:35] Draggor has joined the channel [09:35] Astro has joined the channel [09:35] geeks_bot1 has joined the channel [09:35] TrisMcC has joined the channel [09:35] decklin has joined the channel [09:35] aconran has joined the channel [09:35] ian`` has joined the channel [09:35] ashleydev has joined the channel [09:35] Aikar has joined the channel [09:35] joeshaw has joined the channel [09:35] tsyd has joined the channel [09:35] er1c_ has joined the channel [09:35] frode has joined the channel [09:35] foca has joined the channel [09:35] inimino has joined the channel [09:35] LionMade0fLions has joined the channel [09:35] tocho-san has joined the channel [09:35] adelcambre has joined the channel [09:35] wink_ has joined the channel [09:35] srveit has joined the channel [09:35] zedas has joined the channel [09:35] stalled has joined the channel [09:35] elliottcable has joined the channel [09:35] mephux has joined the channel [09:35] ice799 has joined the channel [09:35] pkrumins has joined the channel [09:35] adinardi has joined the channel [09:35] halorgium has joined the channel [09:35] ryah has joined the channel [09:35] freeformz|vacati has joined the channel [09:35] cha0s has joined the channel [09:35] wattz has joined the channel [09:35] pquerna has joined the channel [09:35] tmm1 has joined the channel [09:35] syntaxritual has joined the channel [09:35] manveru has joined the channel [09:35] beppu has joined the channel [09:40] Tim_Smart has joined the channel [09:42] tisba has joined the channel [09:47] maushu has joined the channel [09:47] maushu has joined the channel [09:52] sudhirj has joined the channel [09:52] omarkj has joined the channel [09:54] proppy has joined the channel [09:54] proppy: hi ! [10:01] rnewson has joined the channel [10:14] jetienne: hi [10:14] FransWillem: hi :) [10:18] sveimac has joined the channel [10:24] fliebel has joined the channel [10:26] saikat: when nodejs starts up, does it immediately load all requires into memory? [10:26] fliebel: Good morning(GMT+1) [10:27] saikat: including requires that are nested in files that i require? [10:28] ollie has joined the channel [10:29] jetienne: saikat: no [10:29] jetienne: saikat: only a few objects are present, the GLOBAL ones [10:29] saikat: oh really? [10:29] saikat: but doesn't it at least parse the main file [10:29] saikat: that i'm starting with node? [10:30] saikat: i would have assumed that, as a result, it would end up parsing every file i require [10:30] saikat: i should probabyl be clearer - i don't mean just starting up the node repl [10:30] saikat: i meant doing something like [10:30] saikat: node server.js where [10:30] saikat: server has require('./a') and a has require('./b') [10:30] saikat: would server, a, and b all be loaded into memory? [10:31] fliebel: saikat: you mean if require is lazy or not? [10:31] saikat: correct [10:31] jetienne: it is [10:31] junkee[] has joined the channel [10:33] jetienne: ACTION just did a http proxy which download all movies file thru p2p... in 40min [10:33] jetienne: node magic [10:34] saikat: jetienne: but i'm seeing that if i have a.js which does require('./b'), and in b.js i have a run-time error (say just one line of code doing JSON.parse on a bad JSON string), i get an error when i do node a.js [10:34] saikat: even though a isn't using any code from b [10:34] saikat: so node is running the code in b as soon as i start up a? [10:35] jetienne: and require('./b') execute b [10:35] saikat: sorry? [10:35] saikat: if require('./b') executes b, doesn't that mean that require is not lazy? [10:36] jetienne: saikat: sorry misunderstanding on where the 'lazy' is then. require('./b') will run b. no doubt about this [10:36] saikat: ah ok - so that would mean the code for b would be loaded into memory right? [10:36] fliebel: jetienne: Where is the lazy part then? [10:37] jetienne: fliebel: in the fact it is cached [10:37] saikat: what is cached? [10:37] jetienne: ./b [10:37] saikat: it is immediately cached though right? [10:37] fliebel: saikat: It isn;t going to re-run the whole thing the second time you require it I guess [10:37] jetienne: yes [10:37] saikat: right [10:38] saikat: ok cool [10:38] saikat: thanks [10:38] fliebel: So, if I require a in one place, modify its state, and require it somewhere else, what wil it return? [10:38] saikat: what do you mean by modify its state? [10:39] fliebel: (I'm still thinking Python under the hood, mind you) [10:39] saikat: change the file? [10:39] saikat: or modify the reference to a? [10:39] saikat: the reference to a, as far as i know, is locally scoped to where you required it [10:39] fliebel: modify something defined in a [10:39] FransWillem: saikat: var b1=require("./b"); var b2=require("./b");, this will only execute b once, and both b1 and b2 will be the same object (e.g. b1===b2) [10:39] saikat: oh i see [10:39] jetienne: fliebel: the second require will return the cached version (with modified state) [10:40] jetienne: http://gist.github.com/518027 [10:40] FransWillem: so let's say you did var b1=require("./b"); /*wait a bit*/; var b2=require("./b");, and change b in that wait a bit piece, those changes will not be loaded, as b was already loaded. [10:40] jetienne: http://gist.github.com/518013 [10:40] jetienne: 2 modules fun [10:41] fliebel: so I can do var a = require('./a') a.test = 5 b = require('./a') b.test == ? [10:41] jetienne: fliebel: the first one is about the changing state [10:41] jetienne: fliebel: 5 [10:41] fliebel: cool :) [10:41] FransWillem: a and b will be the same object, so yes, b.test === a.test [10:41] frank06 has joined the channel [10:42] fliebel: You should have one of those evaling bots in this chanel :) [10:43] saikat: that would make a nifty project [10:43] joeshaw has joined the channel [10:43] saikat: maybe even let it take a gist as input [10:43] jetienne: gbot2: 1 + 1; [10:44] jetienne: fliebel: gbot2 is one. dunno how to use it :) [10:44] omarkj: Have you guys heard of RX.js from Microsoft ? [10:44] omarkj: It's quite interesting. [10:44] jetienne: not sure gbot2 is not running node tho [10:44] fliebel: no, what is it? [10:44] junkee[]: its microsoft!!! [10:44] fliebel: jetienne: Should be fun to write an IRC bot in Node [10:44] omarkj: fliebel: It's called Reactive Extensions. [10:45] omarkj: Warning, marketing lingo: Rx is a library for composing asynchronous and event-based programs using observable collections. [10:45] fliebel: *googles* [10:45] SubStack: o_O [10:45] jetienne: fliebel: _announcer_ is one [10:45] jetienne: http://github.com/martynsmith/node-irc have fun :) [10:45] SubStack: omarkj: composing like function composition? [10:45] SubStack: and reactive like functional reactive programming? [10:45] jetienne: observable collections = stuff like in sproutcore ? [10:46] SubStack: lightweight function composition syntax for js would be pretty boss [10:46] omarkj: SubStack: Something like that. [10:46] omarkj: SubStack: I'm just playing with it a bit, they've got a node port somewhere. [10:47] jetienne: sproutcore observable properties were cool [10:47] omarkj: I gave up on sproutcore. :/ [10:47] omarkj: Lazy me. [10:48] omarkj: junkee[]: Yes, it's MS. But MS Research is doing interesting things. [10:48] omarkj: I'll go on the record saying that. [10:49] fliebel: How does Node relate to Rhino? Except that they both run js (if there is any relation besides that) [10:50] shreekavi has joined the channel [10:50] SubStack: rhino is the mozilla js engine, node is built on v8, chrome's js engine [10:51] junkee[]: I thought spidermonkey ist mozillas js engine... [10:52] fliebel: SubStack: So one could write something like Node based on Rhino? (theoretically of course) [10:52] fliebel: junkee[]: Both are [10:52] fliebel: junkee[]: But the spider thing is what is used in their browsers and stuff [10:53] SubStack: fliebel: I would suppose so [10:53] omarkj: How old is SpiderMonkey. [10:53] omarkj: It's been around since Netscape times, hasn't it ? [10:54] fliebel: omarkj: Yes, just like Rhino, but they've redone it a couple of times to get it up to par with webkit and chrome. [10:54] omarkj: Ok. [10:54] fliebel: I don't know about the speed of rhino though, couldn;t find any benchmarks. [10:55] SubStack: rhino seems a bit java-centered for my tastes [10:55] SubStack: but it looks like it integrates nicely enough [10:56] fliebel: SubStack: I think the Java part is nice… loads of libs :) You could for example throw Rhino in a servelet container and have an instant web framework :) [10:57] mAritz: does anyone here know what happened to tjholowayjchucks class.js? one of my projects uses it and his repo is deleted -.- [10:57] SubStack: or you could http.createServer ;) [10:58] fliebel: SubStack: Yea, Node is nice :) [10:58] omarkj: Haha [10:59] FransWillem: Huh? how come tjholoway's repo was delete ? [10:59] FransWillem: d [11:01] fliebel: mAritz: This guy? http://groups.google.com/groups/profile?enc_user=QsChxxYAAAD2OINEVEIaB6KBatlHbo1no4cocwWvDVg2RHsu8f1bCg [11:02] mAritz: FransWillem: only his class.js repo. he probably thought no one was using it and deleted it :( [11:02] mAritz: fliebel: uhm... probably. github.com/visionmedia ;) [11:02] FransWillem: shame [11:03] crohr has joined the channel [11:03] fliebel: haha [11:03] elliottkember has joined the channel [11:03] Neil has joined the channel [11:04] overra has joined the channel [11:10] jetienne: http://github.com/pavelz/class.js ? [11:12] mtodd has joined the channel [11:15] fliebel: mAritz: http://webcache.googleusercontent.com/search?q=cache:github.com/visionmedia/class.js/ Can't get byond that [11:17] fliebel: How about these: http://github.com/search?q=class.js&type=Everything&repo=&langOverride=&start_value=1 [11:18] jelveh has joined the channel [11:19] mAritz: fliebel: thanks, but that doesn't really help, since apparently google doesn't cache the files themselves. :( [11:19] sveimac has joined the channel [11:19] mAritz: jetienne: yeah, that sadly is a little outdated [11:20] fliebel: mAritz: send that guy a message maybe? [11:20] mAritz: i still have a local copy on my home computer, but i can't access that right now :( [11:20] jetienne: mAritz: i fork all my dependancies to avoid this exact problem [11:20] mAritz: jetienne: yeah, might be a good idea [11:21] fliebel: How do you usually host a Node app? [11:23] mscdex: on linux :-D [11:24] fliebel: mscdex: Oh, not BSD? No, I mean… do you need to rent a VPS at least? [11:25] mscdex: most likely something like that. i host my own [11:25] fliebel: I don't like PHP, but at least you can run it on every cheap host :) [11:26] fliebel: mscdex: Would it be possible to write a CGI adapter for Node? I sneaked a Django app on my shared host this way :D [11:26] mscdex: yes but also node is pretty new and not many web hosts know about it or have their systems configured for people to use it [11:26] mscdex: plus node is changing so much yet it would be hard for the web hosts to keep up [11:27] fliebel: http://brianmckenna.org/blog/nodejs_via_cgi [11:28] bcg has joined the channel [11:28] mscdex: hrm.. if i'm reading that right... i don't think that is a very good solution [11:29] fliebel: why not? [11:29] mscdex: assuming the .htaccess is for apache, that means you're going to have a thread for the connection [11:29] mscdex: without even connecting to node [11:30] mscdex: kinda defeats the purpose [11:30] fliebel: "connecting to node"? [11:31] fliebel: Yea, you can't have long-running processes. [11:31] mscdex: connection/redirecting [11:31] mscdex: er *connecting [11:32] mscdex: but still if you have a lot of connections coming in, it's not going to be a good situation because you're depending on apache's system resources to handle connections [11:32] junkee[]: I think if you really want to use node you have to rent a server [11:33] fliebel: mscdex: Yea, it's pure evil to use event systems with CGI, but i mgiht work for some. [11:34] fliebel: junkee[]: I feared for that... [11:34] mscdex: i know there are some providers out there that have pretty decent usage pricing though [11:34] fliebel: mscdex: I found €25/mo so far [11:34] junkee[]: fliebel: why? [11:34] junkee[]: oh... [11:35] sveisvei has joined the channel [11:35] jhelwig has joined the channel [11:35] fliebel: hmmm http://code.google.com/p/pyv8/ [11:36] mscdex: herh [11:36] mscdex: *heh [11:36] sveimac has joined the channel [11:36] mscdex: man, i need coffee [11:37] jhelwig has joined the channel [11:37] hellp has joined the channel [11:38] matthewford has joined the channel [11:43] micheil: ryah: you about? [11:43] Gruni has joined the channel [11:44] fliebel: (how old is 0.1.92?) [11:45] berset has joined the channel [11:46] kerdezixe has joined the channel [11:46] fliebel: Macports has that version in the repo [11:46] kerdezixe: friendly greetings \o/ [11:47] fliebel: greetings [11:48] ker2x: i have a little problem with my nodejs script receiving syslog message (in udp). [11:49] fliebel: (answer to my own question: April 24, 2010) [11:49] ker2x: when i pring the received message, i have tons of [11:49] ker2x: i guess i missed something :) [11:49] ker2x: server.on("message", function(msg, rinfo) { console.log(msg); } ); [11:51] fliebel: How fast does node evolve? Is a release from April 24, 2010 very old? [11:51] ker2x: i should create a new buffer ? something like new Buffer(msg) ? [11:52] mtodd has joined the channel [11:53] tisba has joined the channel [11:53] fliebel: ker2x: http://nodejs.org/api.html#buffers-2 [11:54] ker2x: exactly what i'm reading :) [11:54] ker2x: so, yes. that answer to my question, i should create a buffer :) [11:54] ker2x: thx [11:55] drudge: ACTION yawns [11:55] drudge: good morning folks [11:55] fliebel: ker2x: I think you have buffers,a nd you only need to create strings from them [11:55] bcg_ has joined the channel [11:56] fliebel: ker2x: seems like js's was to say "you gave me a buffer, not a string, but I'll print it anyway" [11:56] ker2x: indeed. but this is the 1st time i use nodejs, so ... i asked ;) [11:56] ker2x: just in case ... [11:57] fliebel: ker2x: I never used node.js in fact ;) [11:57] ker2x: :) [11:57] herbySk has joined the channel [12:02] fliebel: I'm trying to install npm, but it fails :( [12:03] fliebel: TypeError: Object # has no method 'on' [12:03] TomY_ has joined the channel [12:03] junkee[]: node version? [12:04] fliebel: junkee[]: Ah… I just asked how old 0.1.92 was :P [12:04] fliebel: junkee[]: Turns out it's to old? [12:04] junkee[]: yeah! [12:04] junkee[]: i think so [12:05] fliebel: Any new dependencies since then? [12:06] junkee[]: i dunno [12:07] junkee[]: addListener was renamed to on [12:11] aaron___ has joined the channel [12:12] fliebel: I see [12:12] fliebel: I've updated the portfile [12:13] charlesjolley- has joined the channel [12:13] jetienne: pkrumins: i posted a patch for nodejs-proxy. the one about request port handling we chatted about yesterday [12:14] sudhirj has left the channel [12:14] fliebel: jetienne: proxy? hmmm, might need that. What is it for? [12:14] rwaldron has joined the channel [12:14] jetienne: i cant get any websocket stuff on my computer... socket.io node-websocket-server none is working, grumble. [12:14] jetienne: fliebel: this is a http proxy [12:15] jetienne: fliebel: i use it for a demo where i reroute all video to webpeer to boost the download [12:15] jetienne: surprisingly easy :) [12:16] jetienne: a lot easier than websocket this is for sure :) [12:16] fliebel: jetienne: exactly what I need :) I want to proxy couchdb through node, because of the same-origin ajax restriction. [12:16] jetienne: fliebel: you cant disable it ? [12:16] dmcquay has joined the channel [12:17] fliebel: jetienne: on couchdb… maybe, in the browser, no [12:18] jetienne: fliebel: hmmm ok. strange tho [12:19] robotarmy has joined the channel [12:19] fliebel: jetienne: meh, you don't want people ajaxing your gmail inbox while you're visiting their site. [12:19] ker2x: is there a more precise documentation than api.html ? [12:20] proppy: the source code ? :) [12:20] ker2x: i tried to understand it :) [12:20] ker2x: i need more information about "rinfo" [12:20] ker2x: msg is a Buffer and rinfo is an object with the sender's address information and the number of bytes in the datagram. [12:20] ker2x: how do i retrieve the numbers of byte ? [12:24] keeto_ has joined the channel [12:24] shreekavi has left the channel [12:26] robrighter has joined the channel [12:27] dnolen_ has joined the channel [12:29] ker2x: server.on("message", function(msg, rinfo) { console.log(msg.toString(msg,0, msg.length)); } ); [12:29] ker2x: throw new Error('Unknown encoding'); [12:29] ker2x: :/ [12:29] stride: ker2x: http://gist.github.com/537754 decodeMessage is called with the buffer converted to string (msg.toString('ascii')) maybe that helps you [12:30] ker2x: look like t can't convert the received dgram to string, that's why i receive a binary Buffer [12:30] ker2x: s/receive/pring/ [12:30] ker2x: print [12:30] ker2x: bleh [12:31] hoodow has joined the channel [12:31] stride: http://gist.github.com/537759 that's the receiving part for the gist there [12:31] ker2x: reading :) [12:31] mscdex: ker2x: rinfo contains the following properties: address, port, size [12:32] keeto_ has joined the channel [12:32] mscdex: ker2x: if you want to convert the entire buffer, just use msg.toString(); [12:32] ker2x: size, thx :) [12:33] stride: ker2x: note that it's been tested for receiving from CentOS 5 syslog only, which sends somehow different packets than the stuff that's defined in that BSD syslog RFC [12:33] SamuraiJack has joined the channel [12:34] ker2x: msg.toString() almost work, it just print some stuff in front of the message [12:34] ker2x: <4>Aug 19 14:33:28 etc .... [12:34] ker2x: why the thingy ? [12:35] stride: that's encoded severity & facility [12:35] ker2x: thx :) [12:36] stride: to be precise, that pri field is facility * 8 + severity, conversion is included in syslog-messages.js::decodeMessage if you need an example [12:38] daleharvey has joined the channel [12:39] capndiesel has joined the channel [12:41] stride: oh, I just noticed that I still run this syslog thing as root.. lazy me [12:41] mscdex: setuid! [12:41] mscdex: :p [12:42] stride: chicken nuggets! [12:42] mscdex: nowai [12:42] mscdex: too early for them [12:43] mscdex: need some coffee [12:46] rkieffer has joined the channel [12:49] rkieffer: Is there an event that fires if a user closes/leaves a page before a response completes? E.g. if the user closes the browser during a long-poll request. [12:52] proppy: onclose, onexit ? [12:53] proppy: https://developer.mozilla.org/en/DOM/window.onclose [12:53] sonny has joined the channel [12:53] ehaas has joined the channel [12:55] proppy: maybe the xhr throught an abort error [12:55] proppy: http://www.w3.org/TR/XMLHttpRequest/#abort-error [12:56] fliebel: lazy noob question: Is there a node repl? just typing node at the shell didn't give me a repl, like in Python. [12:57] ker2x: ok. my tiny js syslog server handle 10KB/s of syslog message using around 1% CPU. good enough :) [13:00] wattz: moring! [13:00] wattz: mscdex: don't do it..... [13:01] FransWillem: fliebel: Actually, node should give you a repl like Python :/ [13:02] fliebel: FransWillem: It does… huh… just a moment ago, zomething that looked like node to my mind gave me a helpfull message [13:03] ollie has joined the channel [13:04] fliebel: FransWillem: Might have been npm, or something like that. Anyway, now I have a nice JS prompt [13:07] MaSch has joined the channel [13:07] blogometer has joined the channel [13:07] MaSch: hi [13:08] wattz: hi [13:09] davidwalsh has joined the channel [13:10] charlesjolley- has joined the channel [13:11] fliebel: Anyone knows how I can run the v8 benchmark in node? [13:11] fliebel: http://v8.googlecode.com/svn/data/benchmarks/v5/run.html [13:12] frza has joined the channel [13:13] codemariner has joined the channel [13:14] mscdex: wattz that? [13:16] nerdEd has joined the channel [13:16] wattz: <3 [13:17] fliebel: How do I get this to run in Node? http://v8.googlecode.com/svn/data/benchmarks/v5/run.js the load doesn't work. [13:18] d0k has joined the channel [13:18] wattz: o.O [13:19] Tim_Smart: fliebel: Node.js doesn't have a 'oad' global [13:19] Tim_Smart: *`load` [13:19] wattz: yeah [13:19] fliebel: Tim_Smart: I figured that… So how do I solve that? [13:19] Tim_Smart: fliebel: replace with `require` [13:20] jherdman has joined the channel [13:20] Tim_Smart: Well, Node.js uses a CommonJS module implementation. [13:20] mscdex: you'll probably have to attach the requires to the global object though... unless you sift through the code and change it everywhere to use the variables assigned to your requires [13:21] fliebel: mscdex: That was the problem I was having. How do I do that? [13:21] virtuo_ has joined the channel [13:21] mscdex: use a mixin function [13:21] fliebel: Tim_Smart: does CommonJS say you should use require and not load? [13:22] Tim_Smart: fliebel: http://wiki.commonjs.org/wiki/CommonJS [13:22] wattz: once i get all this stuff off my list [13:22] wattz: im going to build myself a C++ lib for v8 that is just all the default commonjs stuff [13:22] wattz: and the basics i see used over and over [13:22] wattz: ACTION adds to list [13:22] mscdex: like hello world? [13:22] wattz: mscdex: hello YOU! [13:22] wattz: :D [13:22] mscdex: NOU [13:22] wattz: ! [13:23] wattz: mscdex: you are my new best friend... for now.. [13:23] loincloth has joined the channel [13:23] mscdex: rut roe... Intel is buying McAfee [13:23] wattz: yeah no shit, at 60% too [13:23] wattz: should of bought 3 days ago.. [13:24] caolanm has joined the channel [13:24] wattz: McAfee is down real bad too [13:24] fliebel: mscdex: I didn't get the mixing thing, sorry… I'm only a enhance-html type of js programmer. [13:24] mscdex: i don't know why anyone would want the likes of McAfee [13:26] wattz: mscdex: yeah [13:26] mscdex: fliebel: something like the function here: http://github.com/ry/node/blob/62d9852c3d6ed32825abfd79645c72a66fb00e6f/src/node.js#L109-L168 [13:26] wattz: Bloomburg dropped a rumor bomb this morning that Oracle was dropping MySQL [13:26] wattz: it's costing them to much money [13:26] mscdex: fliebel: you use it to merge the result of require() with the global object [13:27] ben_alman has joined the channel [13:27] mscdex: Oracle is teh suck [13:27] wattz: ^5 [13:27] mscdex: the company and their products [13:28] wattz: i had a couple of friends work there, they hated their life.. [13:28] SubStack: how do you drop an open source project anyways? [13:28] SubStack: just stop working on it? [13:28] wattz: SubStack: it's not just open source [13:28] fliebel: mscdex: Makes sense… what is the global object, if not window or document? :P [13:28] wattz: SubStack: there are a ton of services and funding that go into it [13:29] wattz: MySQL almost went public and Oracle bought them and stopped it from happening [13:29] SubStack: was it a bargaining chip for sun? [13:29] wattz: i would assume [13:29] wattz: Sun is another company slowly fading away [13:30] mscdex: fliebel: the global object is called: GLOBAL [13:30] wattz: mscdex: so clever! [13:30] mscdex: fliebel: in caps like that [13:31] mscdex: if Sun goes away, who's going to make our javas? [13:31] fliebel: mscdex: Nice, must have been fun writing that thing :) [13:31] mscdex: :O [13:31] wattz: mscdex: there are a ton of Java alternatives [13:31] wattz: and my guess would be google [13:31] mscdex: like microsoftie's implementation? [13:31] mscdex: :p [13:31] wattz: J# [13:31] fliebel: +1 watt [13:31] wattz: J++ [13:31] mscdex: ew J# [13:32] mscdex: and J++ [13:32] wattz: lmao [13:32] mscdex: more like JKLOL [13:32] wattz: JDULL! [13:32] wattz: ohhhh burn. [13:32] wattz: >_> [13:32] mscdex: i think you mean JFLAT [13:33] wattz: shouldn't talk about my sister like that :P [13:33] mscdex: that's her nickname ?? [13:33] wattz: actually far from it :P [13:33] mscdex: sounds like an urban nickname [13:33] wattz: she is 8 years older than me [13:33] wattz: and all my friends in school always wanted to come to my house -_- [13:33] mscdex: "people call me J. FLATT" [13:33] wattz: J Flizzle. [13:34] mscdex: "yo yo yo" [13:34] wattz: Flazzle. [13:34] wattz: Flo. [13:34] wattz: mscdex: that can be your new hit song [13:34] wattz: Mscdex aka "J. FLATT" hits #1 with J Flizzle Flazzle Flo. [13:34] mscdex: flo? that's that woman from those progressive commercials [13:34] wattz: she is nerd hit. [13:34] wattz: hot [13:34] mscdex: NERD HIT [13:35] wattz: sproutcore would be cool if we had some docs.............. [13:35] pkrumins: hey jetienne [13:35] mscdex: brusselsproutcore [13:35] wattz: hi pkrumins [13:35] pkrumins: jetienne: where do i get your patch? [13:35] pkrumins: hi wattz [13:35] pkrumins: also where is twitter bot [13:35] jtsnow has joined the channel [13:35] charlesjolley- has joined the channel [13:35] mscdex: _announcer is here [13:35] mscdex: but maybe dead? [13:35] pkrumins: it seems dead [13:35] mscdex: maushuuuuuuuuuuuuuuuu [13:35] pkrumins: dead for several days already [13:36] mscdex: r.i.p. [13:36] pkrumins: :'( [13:36] wattz: ACTION attends the service...  [13:36] fliebel: mscdex: I can't figure out how to do the global object. I got into the repl, GLOBAL is empty, and defining or adding things to it doesn't help. [13:36] mscdex: guess the stream was too big and it drowned [13:36] stride: fliebel: http://frankgrimm.net/v8bench.js [13:36] mscdex: fliebel: try running node on a javascript file [13:37] mscdex: fliebel: it doesn't work on REPL [13:38] fliebel: stride: what is the difference bwtween that and the thing I got from their svn? [13:38] stride: fliebel: no idea, that's just the scripts from the url you posted merged together and with print replaced by console.log [13:40] blogometer: Hello. [13:42] fliebel: stride: you just did that, or found it? [13:42] christophsturm has joined the channel [13:42] ceej_ has joined the channel [13:43] stride: just did it, was only cat-ing it together, works fine here [13:43] dmcquay has joined the channel [13:43] blogometer: I'm trying to figure out the number of combinations of a 700MB CD. [13:44] blogometer: I can't find a calculator that can do Math.pow(2, 700 * 8 * 1024 * 1024) . [13:45] zemanel has joined the channel [13:45] fliebel: stride: something like this? ls | grep js | cat > v8bench.js [13:45] stride: blogometer: http://www.wolframalpha.com/input/?i=(700*8*1024*1024)^2 guess mathematica/maple/matlab can :) [13:46] stride: fliebel: cat *.js > v8bench.js [13:46] stride: oh I made sure that it puts base.js in front, it somehow complained the first time [13:46] blogometer: stride: You rock. [13:47] blogometer: stride: You are my hero for the rest of day. Thanks. [13:47] stride: heh, np [13:47] fliebel: stride: jea, and run at the end I think. [13:47] blogometer: Oh, bummer. It doesn't actually give you a number. [13:47] stride: fliebel: just used alphabetic order *.js gave me for the rest [13:48] blogometer: http://www.wolframalpha.com/input/?i=2^%28700*8*1024*1024%29 [13:48] blogometer: Or, uh, okay. Let me think. [13:50] blogometer: Isn't the number of different combinations of 3 bytes represented by: [13:50] stride: oh, yeah :/ not that way around it seems [13:50] blogometer: 2^3 [13:50] blogometer: and not [13:50] blogometer: 3^2 [13:50] blogometer: ? [13:51] stride: 2^(3*8) but yeah I think you're right [13:53] blogometer: Yes. Right. Bits. Not bytes. [13:53] tisba_ has joined the channel [13:53] mscdex: js> Math.pow(2, 700 * 8 * 1024 * 1024) [13:53] gbot2: mscdex: Infinity [13:53] mscdex: yes! [13:53] stride: \o/ [13:54] blogometer: Okay. I guess it is a big number. [13:54] mscdex: js: "lol" [13:54] gbot2: mscdex: "lol" [13:54] stride: js: "\0" [13:54] gbot2: stride: " [13:54] stride: heh :> [13:54] blogometer: js> 1 + 1 [13:54] gbot2: blogometer: 2 [13:55] blogometer: js> "I didn't know this existed.!" [13:55] gbot2: blogometer: "I didn't know this existed.!" [13:55] mscdex: js: require('fs') [13:55] gbot2: mscdex: Error: ReferenceError: require is not defined [13:55] mscdex: huhu [13:55] mscdex: js: process [13:55] gbot2: mscdex: Error: ReferenceError: process is not defined [13:55] fliebel: js: sys [13:55] gbot2: fliebel: Error: ReferenceError: sys is not defined [13:55] wattz: you guys are coming to the meeting with me [13:55] mscdex: wattz: nowai [13:56] aliem has joined the channel [13:57] stride: js: "\r\nPRIVMSG #Node.js :foobar" [13:57] gbot2: stride: " [13:57] maushu: TONIGHT, WE DINE IN HELL. [13:58] blogometer: Someone had done this, calculated, envelope style... [13:58] blogometer: if you printed every CD-ROM combination possible and made a stack of them... [13:58] blogometer: ... they would reach from earth to ... [13:58] maushu: js> 9000 / 0 [13:58] gbot2: maushu: Infinity [13:58] maushu: LIES. [13:58] stride: blogometer: yeah, it's a classic combinatoric problem, but I can't remember what it's called.. [13:58] mscdex: maushu: _announcer is ded :-( [13:58] maushu: WAT. [13:59] aaron___ has joined the channel [13:59] mscdex: btw, tonight we dine in koradai [13:59] maushu: Maushu to the rescue! [13:59] nerdEd has joined the channel [13:59] maushu: ACTION is defeated by the firewall. [13:59] maushu: ACTION uses bucket of water. [13:59] zapnap has joined the channel [14:00] femtoo has joined the channel [14:01] zapnap_ has joined the channel [14:01] nerdEd_ has joined the channel [14:01] _announcer has joined the channel [14:02] maushu: mscdex: When did this happen? [14:02] mscdex: maushu: i don't know, pkrumins did it [14:02] pkrumins: maushu: long time ago [14:03] _announcer: Twitter: "@ Lucabastos speaking in cep and nodejs, ann left a hj from a reader qif" [pt] -- renatoelias. http://twitter.com/renatoelias/status/21579604870 [14:05] _announcer: Twitter: "@nodejsbot #nodejs \0 #test" -- Frank Grimm. http://twitter.com/frank_grimm/status/21579778130 [14:05] stride: now that worked well.. :/ :> [14:06] fliebel: What does announcer do? [14:06] Tim_Smart: announce stuff [14:06] digitalspaghetti: mape: your system monitor thing looks awesome :) [14:07] fliebel: Tim_Smart: Just random tweets containing nodejs? [14:07] Tim_Smart: Pretty much. [14:07] mscdex: maushu.com! [14:07] maushu: Tim_Smart: You say that like its a bad thing. [14:07] SubStack: mape's stuff is categorically pretty awesome [14:08] Tim_Smart: It is cool, was just giving the facts :p [14:08] maushu: Not enough emotion. You must go like "I love announcer! I want to have its babies!" [14:09] Tim_Smart: Fine. [14:09] Tim_Smart: I love announcer! I want to have its babies! [14:09] maushu: Wait, how would that work? [14:09] joeshaw: well, when a man and a bot love each other very much [14:10] cute_babies_anno has joined the channel [14:10] maushu: Don't we need to insert tab A on slot B? [14:10] maushu: ... [14:10] blogometer: LOL! [14:10] fliebel: *impressed by the speed of v8* I ran the v8 benchmark through Rhino [14:10] blogometer: Okay. [14:11] blogometer: fliebel: Do blog. [14:11] steadicat has joined the channel [14:11] blogometer: Or post to Node.js listserv. [14:11] fliebel: blogometer: I will, if it manages to finish. [14:11] blogometer: That is a link I want to share. [14:11] blogometer: Cool. Please. [14:11] fliebel: It goes java.lang.OutOfMemoryError: Java heap space after the regex [14:12] blogometer: Block out the tests that bork, and rerun with both. [14:12] blogometer: It will be a nice bedtime story of little Node.js programmers. [14:12] sudhirj has joined the channel [14:12] blogometer: 1.84467441 × (10 ^ 19) [14:13] blogometer: Is that greater or less than? [14:13] fliebel: Any other js engines I could test? [14:13] blogometer: http://en.wikipedia.org/wiki/List_of_ECMAScript_engines [14:13] blogometer: However... [14:14] fliebel: anything of importance to node [14:14] fliebel: webkti maybe? [14:14] blogometer: You can just write your first impressions of Rhino versus Node and that is an interesting blog post. [14:14] blogometer: Then if you want a nice follow up, ask in your blog post if anyone knows of any other engines of interest. [14:14] fliebel: blogometer: I'll see what I can do. Keep an eye on pepijndevos.nl :) [14:14] blogometer: (Don't do a depth first study.) [14:15] blogometer: Or, I guess, this is breadth first. [14:15] blogometer: Anyway, I'm saying, as a reader, I would find Rhino vs V8 interesting. Don't kill yourself. [14:15] fliebel: okay :) [14:16] fliebel: Do I need to include al those "this is not representative, wrong, and don't blame me" stuuf, they usually add to those posts? [14:16] c4milo has joined the channel [14:17] dylang has joined the channel [14:18] Tim_Smart: Wow. Mozilla are making quite a bit of progress http://arewefastyet.com/ [14:19] blogometer: Tim_Smart: NO. [14:19] blogometer: The have a sense of humor. [14:19] blogometer: s/The/They/ [14:19] blogometer: fliebel: Don't apologize for your inquiries. [14:20] blogometer: Simply report what you've found. [14:20] blogometer: Then write your impressions with an editorial voice. [14:20] blogometer: It seems as though... [14:20] blogometer: Is all the disclaimer you need. [14:20] fliebel: what is an editorial voice? [14:21] Tim_Smart: Ron Burgundy. [14:21] blogometer: The police officer said that when he walked into the room Mr. Jones was standing over Mr. Smiths dead body with a smoking gun. [14:22] kodisha has joined the channel [14:22] blogometer: It would appear that the District Attorney has a solid case against Mr. Jones. [14:22] blogometer: The first is a statement of fact, the second is a statement of opinion. [14:23] emmanueloga has joined the channel [14:23] blogometer: Or put another way... [14:23] fliebel: So you're saying I should post the results and give my opinion on them? [14:23] blogometer: Don't write for the trolls. [14:24] blogometer: I'm saying, you don't have to add the paragraph preamble of disclaimers. [14:24] fliebel: that sounds like a good thing to do anyway :) [14:24] fliebel: (the first) [14:24] fliebel: well, thanks for the advice, I'll see what happens :) [14:24] blogometer: Reasonable people know that these are your observations and that you're sharing the output of hacking. [14:25] TomY_ has joined the channel [14:25] rkieffer has joined the channel [14:25] ironfroggy: I am using Socket.IO and things seem to be working after a little work. Now i am finding that clients disconnect after around 5 seconds... [14:25] mape: digitalspaghetti: Jup think it could turn out pretty cool, really love poking with it on an iPad, perfect to have besides the monitor for real time feedback on what the app is doing [14:25] blogometer: Unreasonable people want to make themselves sound clever with caveats. [14:25] wattz: your on the projector, wave!! [14:25] mape: Hai! [14:25] ironfroggy: and then any messages sent from them just log "Couldn't find client with session id ...." because the client is no longer known by the server. [14:25] mape: ( http://node-monitoring.mape.me/ for those who haven't seen it ) [14:26] _announcer: Twitter: "Force! RT @ lucabastos Here battling to contain a bug with the example in the lecture Node.js ZIP tomorrow on the trail of the SOA # TDC2010" [pt] -- Felipe Kenobi. http://twitter.com/scaphe/status/21581363213 [14:27] Tim_Smart: They need to update Hummingbird http://demo.hummingbirdstats.com/ [14:28] blogometer: fliebel: Yeah. Don't write for trolls. Don't imagine all the stupid trollish, pedantic, grammatical nonsense that people can throw at you and defend against it. Just write. [14:28] caolanm: mape: looks intersting :) [14:28] _announcer: Twitter: "In the @ lucabastos good is my tomorrow ídolo.Palestrá in our SOA track on a complex subject, CEP, taking an example Node.js # fuck" [pt] -- Felipe Kenobi. http://twitter.com/scaphe/status/21581483325 [14:28] fliebel: blogometer: Sure :) I totally agree. [14:29] blogometer: stride: Hey, follow up on my CD thing. [14:29] rektide: anyone here familiar with GObject Introspection at all? [14:30] guybrush: mape, awesome! :D [14:31] Tim_Smart: mape: How doesn't working with canvas compare to raphael? [14:31] blogometer: Or anyone who I can interest in my off topic envelope calculation. [14:31] mape: Tim_Smart: Doesn't working? [14:31] Tim_Smart: mape: Works well, just curious on your opinions of canvas vs SVG [14:31] blogometer: 2^128 / (1000 * 1000) = (3.40282367 × 10 ^ 32) [14:32] blogometer: The stellar disk of the Milky Way Galaxy is approximately 100,000 light-years (9×1017 km) in diameter. [14:32] blogometer: 9 * (10 ^ 17) [14:33] mape: Tim_Smart: Oh well, some of it is SVG, the blob in the middle is SVG, the graphs are canvas but the animations is though scroll animation. SVG is easier to work with if you want to add events and whatnot. I just need to get a better feel for both so not really sure what path to go now. [14:33] blogometer: So, if you printed every possible combination of two longs onto a CD-ROM. [14:33] blogometer: And a CD-ROM is 1mm high. [14:33] blogometer: Then the stack of them is wider than the Milky Way. [14:34] blogometer: Is that correct? [14:34] matt_c has joined the channel [14:34] Tim_Smart: Anyway, night guys. [14:35] mape: nn [14:36] sonnym has joined the channel [14:38] rsms has joined the channel [14:43] stride has joined the channel [14:46] margle has joined the channel [14:47] _announcer: Twitter: "Lakshan Perera "Real-time Collaborative Editing with Web Sockets, Node.js & Redis" client-side scripting with Web Standards http://j.mp/bpuDwX" [ja] -- lispyrabbit. http://twitter.com/lispycrispy/status/21582955217 [14:48] creationix has joined the channel [14:48] creationix: herbySk: I see you've been busy commenting on my commits ;) [14:50] herbySk: creationix: yes, btw if you're online, wouldn't this minimal thing be sufficient? [14:50] herbySk: http://gist.github.com/538040 [14:51] steadicat has joined the channel [14:52] creationix: herbySk: the whole class.js thing is an experiment with constructor-less objects [14:52] creationix: I'n not even using the code on class_compat.js yet [14:52] _announcer: Twitter: "JavaScript / MySQL support in Node.JS: node-mysql-libmysqlclient: I have quite a long time postponed the announcement, but ... http://bit.ly/9hCfj9" [ru] -- B_sheen. http://twitter.com/B_sheen/status/21583331925 [14:52] creationix: I don't like the idea of changing function.prototype [14:52] herbySk: creationix: They're not contructor-less, anyway, since you have an initialization function [14:53] herbySk: creationix: You nevertheless did it in class_compat... [14:53] creationix: herbySk: what I mean by constructor-less is it doesn't depend on "new" ".prototype" or ".constructor" [14:53] creationix: herbySk: right class_compat.js was an experiment, I'll likely move it out of nStore or just delete it [14:54] creationix: I'm experimenting with the idea of pure prototypal objects where there is no distinction between behavior and state [14:54] Yuffster has joined the channel [14:55] herbySk: creationix: never mind, I'm not going to argue, I just don't know why to reinvent the (finaly working) wheel and seal/freeze to create problems for the users [14:55] creationix: herbySk: the seal/freeze stuff is to enforce me to not change stuff after the fact [14:55] creationix: it already saved me once with the query.js plugin [14:56] creationix: I was just going to change nStore after the fact to add .all and .find, but the freeze didn't let me [14:56] aheckmann has joined the channel [14:56] creationix: instead I had to create a sub-object http://github.com/creationix/nstore/blob/rewrite/test/findTest.js#L4 [14:56] creationix: but later I realized this is a very good thing! [14:57] creationix: then the original nStore prototype doesn't get modified and other "sub-classes" of it can exist too [14:57] TheEnd2012 has joined the channel [14:57] herbySk: creationix: you cannot convince me that freeze/seal/final in java, etc. is the right thing... [14:57] sveimac has joined the channel [14:57] creationix: herbySk: I'm not trying to convince anyone, this is all internal to nStore at the moment [14:57] creationix: just experimenting with coding styles while working on my database [14:58] creationix: so far I'm really liking it [14:58] herbySk: you're cutting the power off - you prohibit users to change behaviour of objects they use [14:58] creationix: herbySk: no, they can change the behavior, I even have an example plugin with query.js [14:58] herbySk: that's the real plus of smalltalk, javascript etc. over the mainstream stuff [14:58] creationix: they just can't change the behavior for everyone [14:58] creationix: what if a plugin uses nStore too [14:59] creationix: it's the same as changing the global Object.prototype [14:59] stride: blogometer: oh sorry, they're currently changing some routerboards here. found a solution for your optimization problem yet? [14:59] daleharvey has joined the channel [15:00] ironfroggy: Anyone else have trouble with Socket.IO via xhr-polling transport closing itself after connect? [15:00] blogometer: Oh, mine was the CD-ROM problem. [15:00] herbySk: creationix: whatever :-/ [15:00] blogometer: I'm still playing with it. [15:00] creationix: ironfroggy: yeah, especially on mobile Safari [15:00] blogometer: I don't know math. [15:00] creationix: herbySk: sure, don't let it trip you up, I might not even keep it in nStore [15:00] ironfroggy: creationix: i am getting it on chrome. and i can't get websocket or flashsocket transports to even connect, or i would be using them. [15:01] creationix: ironfroggy: hmm, works fine on chrome for me, though websocket is better for that browser right? [15:01] sudhirj: anyone, does env.js work on node? I want to use it for running browser based tests using expresso [15:01] ironfroggy: creationix: as i said, i cant even get websocket to connect [15:01] ironfroggy: i would love to use that isntead, obviously [15:01] creationix: ironfroggy: oh, then I don't know [15:04] ironfroggy: creationix: when i try websocket it looks like request.headers.upgrade never gets set, so the connection fails. not sure why. [15:05] creationix: ironfroggy: are you on an old version of node? [15:05] ironfroggy: 0.1.103 [15:05] quirkey has joined the channel [15:05] creationix: hmm, plenty new [15:05] ironfroggy: wondering if i have a bad trunk from Socket.IO [15:05] ironfroggy: if so i dont know what a good version would be tho [15:05] creationix: no clue, ask rauchg_ when he gets online [15:05] ironfroggy: thanks [15:06] aubergine_ has joined the channel [15:06] creationix: ironfroggy: I'm using c173141f8bde7c745d542d122ee0623337a784cb of the node server and a8efecaa567e375c7b9b7eaf0a8c782a1a8f09ba of the client [15:06] creationix: ironfroggy: but I've tried several versions without problem on chrome [15:07] danielzilla has joined the channel [15:07] softdrink has joined the channel [15:08] ker2x: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND [15:08] ker2x: 894 root 15 0 609m 9804 4844 S 1 1.0 0:00.13 node [15:08] ker2x: any idea why i have 609m ? [15:10] EyePulp has joined the channel [15:10] perturbedpanda has joined the channel [15:10] ajpiano has joined the channel [15:11] maushu: ker2x: Memory leak? Closure rush? [15:11] JimBastard has joined the channel [15:11] JimBastard: listen, i dont mean to offend, but your project is shit and i hate you. [15:11] ker2x: okay [15:11] maushu: ... [15:11] JimBastard: mailing list lulz [15:12] ker2x: maushu: it take 609m immediatly [15:12] ker2x: however, the RES memory (actually used memory) is ok [15:12] maushu: ker2x: Then don't worry about it. [15:12] maushu: Linux doesn't eat memory. :p [15:12] ker2x: i'm sysadmin, i always worry about that kind of thingy :) [15:12] JimBastard: Linux doesn't eat memory, I EAT MEMORY. [15:12] maushu: Go away Jim. [15:13] creationix: JimBastard: was that "hate" aimed at me? [15:13] JimBastard: k [15:13] ironfroggy: creationix: are you sure thats the right commit for the client? was gonna try the same as you but that isnt a valid commit [15:13] JimBastard: creationix: no? [15:13] JimBastard: its that alligator guy and his liberal use of eval and regex [15:13] creationix: ironfroggy: he might have rebased since then [15:13] ironfroggy: O_o oh no [15:13] creationix: JimBastard: oh, because you said it in response to my grain post [15:13] JimBastard: when i see "jssp" [15:13] ironfroggy: people are not supposed to do that! [15:14] creationix: ironfroggy: of maybe I did something funny in my submodules [15:14] JimBastard: creationix: i was replying to the thread, if you read the first sentence [15:14] JimBastard: I really have to go on record again and say how much I disagree with the approach you are using for this library. I've read through http://github.com/mrohad/Alligator/blob/master/lib/jssp.js a few times this week, and I hate it. [15:14] JimBastard: im talking about the other guy [15:14] ker2x: maushu: http://pastebin.com/A3jCM0cF you see an obvious problem here ? [15:14] JimBastard: i sent him a message the other day on github with a frowny face [15:14] creationix: ahh [15:14] ker2x: other than the insane regexp ;) [15:14] creationix: ACTION was secretly hoping for some "hate" from JimBastard ;) [15:15] JimBastard: creationix: lulz [15:15] creationix: though I got plenty of criticism about my class.js stuff [15:15] JimBastard: you wish i hated you! [15:15] JimBastard: :p [15:15] creationix: lol [15:15] JimBastard: creationix: <3 [15:15] FransWillem: creationix: Hey, your postgres implementation is horrible broken :/ [15:15] creationix: FransWillem: how so? [15:15] JimBastard: ohh ohh haters! [15:15] ker2x: haters gonna hate :) [15:15] ironfroggy: creationix: in any case, the upgrade header should be set by the browsers own WebSocket type, not by the client library in use, right? [15:15] _announcer: Twitter: "hacking an IM bot with node.js. was going well until i realized i needed to spawn finite state machines in parallel. wish i knew erlang" -- Quinton Parker. http://twitter.com/quintonparker/status/21585079567 [15:15] creationix: ironfroggy: correct, it's native to the browser [15:15] stride: require('node-dalailama'); [15:16] creationix: hey, it's http://whyday.org/, lets's celebrate JS style [15:16] ironfroggy: creationix: then i can assume its more likely my problem is server-side and that its loosing the header.... somehow [15:16] FransWillem: creationix: It adds stuff to the Buffer prototype (which should already be a big no-no), the stuff it adds is non-functional (int32read and int16read are broken), the callback from query and execute are non-standard (what happens when a query returns an error) [15:17] creationix: and do crazy eval + with + Object.prototype + other unkosher things just for fun! [15:17] creationix: FransWillem: hmm, I thought I left the reads working [15:17] bronson_ has joined the channel [15:17] creationix: FransWillem: anyway I do intend to not change Buffer.prototype, the postgres-js library is incomplete [15:18] creationix: FransWillem: I just thought I left it working at least [15:18] creationix: FransWillem: oh I see, I forgot to push [15:18] FransWillem: Ah, crap [15:18] creationix: FransWillem: ok, it should work now at least [15:18] FransWillem: Was just forking it and writing a kick-ass library for handling buffer-queues [15:19] creationix: FransWillem: yeah, the version I just pushed has working int handlers [15:19] ironfroggy: creationix: i am really confused that its working for you. Socket.IO master and the commit you siad you're using have a bug that crashes for me and is very obvious. i can't see how its working anywhere else. [15:19] Aikar: "I see in your chat logs you were talking about an 'unshaven beaver stuffed with hardware blowing air out its ass'", "...... i swear we were talking about a PC!!!" [15:19] Aikar: err wrong channel lol sorry [15:20] Aikar: so you understand what i was talking about: http://www.engadget.com/2007/04/13/compubeaver-case-mod-the-pc-stuffed-beaver/ [15:20] FransWillem: creationix: Ok, that's great, mind if I still fork it and report back to you with a shitload of changes? Got some other things I'd like changed too [15:21] creationix: FransWillem: go for it [15:21] FransWillem: :) [15:22] gwoo has joined the channel [15:22] creationix: I still think it's amazing the cult culture around _why [15:22] creationix: but he did do some cool stuff [15:23] matt_c: He's the reason a lot of folks picked up Ruby. [15:23] ryan_gahl has joined the channel [15:23] creationix: matt_c: agreed, and I used to teach ruby classes [15:23] ironfroggy: creationix: what version of node are you using? [15:23] JimBastard: creationix: if i was nice and quiet, instead of loud and an asshole i'd be like the _why of node [15:23] JimBastard: but im not, so i wont get that cult following [15:23] creationix: ironfroggy: I've used v0.1.102 v0.1.103 and v0.1.104 I think [15:24] mjr_ has joined the channel [15:24] Aikar: i like doing 'abnormal things' too, like im writing a real time MMO RTS game server in PHP right now lol. starting to hit some performance issues now though since Ive got so much done, but one day it will be rewritten to node.... if i can only convince my 'manager' to let that day be sooner rather than later [15:24] creationix: JimBastard: once when I went to a ruby conference someone said I was the Zed Shaw, but without the attitude [15:24] creationix: I guess that's a compliment, not sure [15:24] JimBastard: ahahahaha [15:25] JimBastard: creationix: you are tim caswell, and no one else [15:25] JimBastard: dont let anyone tell you otherwise [15:25] JimBastard: id take a tim caswell over a zed shaw any day [15:25] mjr_: Should I use the Google to find out who Zed Shaw is, or does it not really matter? [15:26] ironfroggy: I'd take rusty nails in my pants over a zed shaw any day [15:26] JimBastard: mjr_: doesnt matter [15:26] JimBastard: blah blah mongrel, blah blah trolls [15:26] EyePulp: mongrel2 looks nice [15:26] JimBastard: i just gave you the whole low down [15:26] EyePulp: heh [15:26] JimBastard: EyePulp: im not sure about that [15:26] mjr_: JimBastard: thanks [15:26] JimBastard: ive been talking to a lot of people about mongrel2 [15:26] Draggor: for socket.io, do I add events before I call connect() or after? [15:26] EyePulp: yeah? what's the verdict? [15:26] JimBastard: it seems the really smart ones dont give a fuck [15:27] _announcer: Twitter: "Slides on concurrency features in #nodejs (and #webworkers, natch) for first-ever NodeJSTL meetup this evening: http://bit.ly/agNEz3" -- Peter Griess. http://twitter.com/pgriess/status/21585937221 [15:27] JimBastard: ill believe it when i see it [15:27] JimBastard: re mongrel2 [15:27] EyePulp: heh [15:27] FransWillem: Hmm, I just forked someones repo on github, then he pushed some updates, how do I get those update in my fork? [15:28] jon_ has joined the channel [15:29] EyePulp: I'll grant the guy's got some aggressive tendencies, but he does appear to be willing to back up claims with code. Though at the level he discusses, my knowledge is less than shallow, so my assessment of code quality in his case isn't applicable. [15:29] EyePulp: =) [15:29] creationix: FransWillem: push to your origin on github [15:29] JimBastard: FransWillem: you gotta pull [15:30] _announcer: Twitter: "JavaScript / MySQL Podderzhka in Node.JS: node-mysql-libmysqlclient http://bit.ly/cdUGZo" [bg] -- Виталий Кулёв. http://twitter.com/frumatic_ru/status/21586143800 [15:30] creationix: FransWillem: oh you want the changes from the fork source, yeah, just pull directly [15:30] FransWillem: ah, nvm, found it, it's in fork queue [15:30] JimBastard: FransWillem: the fork queue is the borked queue [15:30] creationix: will the fork-queue pull for you? I've never tried [15:30] JimBastard: re: numerous issues ive opened on support.github [15:30] FransWillem: oh, wait, no, it doesn't [15:30] JimBastard: :p [15:30] matt_c: yay _announcer! [15:31] FransWillem: Hmm, actually, seems like it did :) [15:31] FransWillem: Just had to click another button [15:32] wattz: back! [15:33] jmar777 has joined the channel [15:33] aubergine has joined the channel [15:34] rkieffer has joined the channel [15:35] pgriess has joined the channel [15:35] voodootikigod has joined the channel [15:35] mjijackson has joined the channel [15:36] _announcer: Twitter: "@petitroll Here are some interesting projects for JS: http://nodejs.org/ http://pegjs.majda.cz/" -- Mathieu Acher. http://twitter.com/acherm/status/21586618495 [15:37] cardona507_ has joined the channel [15:38] charlesjolley-_ has joined the channel [15:38] matt_c has joined the channel [15:38] voxpelli-laptop has joined the channel [15:41] EyePulp: bbias [15:41] EyePulp has joined the channel [15:42] tmpvar has joined the channel [15:43] ironfroggy: so while investigating why chrome isnt sending the upgrade header for my websocket connections, I"m noticing the websocket spec never mentions such a header at all. where does it come from and why does Socket.IO expect it? [15:45] charlesjolley-_ has joined the channel [15:46] quirkey has joined the channel [15:47] aheckmann has left the channel [15:47] JimBastard: im pair programming and i keep typing POOP [15:47] JimBastard: i think my pair hates me [15:47] JimBastard: i cant believe you're bragging about it [15:47] JimBastard: god dammit [15:47] JimBastard: dual keyboards [15:48] tmpvar: What up Bastards [15:48] creationix: so there really are two of you JimBastard [15:49] JimBastard: lol [15:49] JimBastard: jenkins isnt a bastard [15:49] _announcer: Twitter: "JS benchmark server: Node.js & Rhino http://post.ly/seh2" [de] -- Pepijn de Vos. http://twitter.com/pepijndevos/status/21587573495 [15:49] JimBastard: the dual keyboarding is just too fun though [15:49] JimBastard: poop [15:50] matt_c: JimBastard: now did you mean to type that over here or over there? [15:50] JimBastard: i cant tell anymore [15:50] rkieffer has left the channel [15:51] matt_c: "I don't know why, but I've had more poop-related syntax errors than usual today" [15:52] streampunk has joined the channel [15:55] _announcer: Twitter: "@ Cubs csgui a BNF? Interesting ... By the way, I need to talk about NodeJS ctg." [pt] -- Thiago Dantas. http://twitter.com/thiagochapa/status/21588017556 [15:55] mjr_: So that just-posted benchmark says that V8 is 34X faster than Rhino? Did I read that right? [15:55] ollie has joined the channel [15:56] mape: the formating was horrid but yeah, think so [15:56] rixius has joined the channel [15:56] mjr_: Surely the Java people will have something to say about that like, oh you didn't use the magic JIT JVM options or that test doesn't run long enough to let our JIT kick in or something. [15:57] mape: mjr_: btw updated the dtrace/monit thingy http://node-monitoring.mape.me/ :) [15:57] EyePulp: is console.log async? [15:57] mjr_: mape: awesome [15:57] mjr_: where did you get that Breakdown library? [15:57] mjr_: that makes the stacked up charts with mouseover [15:58] mape: mjr_: http://thejit.org/ [15:58] mjr_: woah, cool [15:58] mape: mjr_: http://vis.stanford.edu/protovis/ex/ also has a lot of cool stuff [15:58] wllm has joined the channel [15:58] mjr_: I've seen protovis before, but never thejit. [15:59] EyePulp: mape - that looks fantastic [15:59] JimBastard: looking nice mape [15:59] JimBastard: back to poop [15:59] mape: :) Just need it hooked into something [15:59] mjr_: mape: have you looked into populating this thing with data from oprofile? [15:59] mape: never looked at oprofile [15:59] mjr_: I haven't tried it, but I think if you build V8 witih oprofile support on linux that you'd get some good data to fill in. [16:00] mjr_: Of course it is linux only [16:00] mjr_: Not as good as dtrace, etc. [16:00] mape: a oprofile is like dtrace or system** [16:00] mape: or tries to be [16:00] mjr_: But there is direct support in V8 for oprofile. [16:00] mape: and then you listen to probes? [16:01] mjr_: eh, not really [16:01] mjr_: you run this command, and it sends back a report [16:01] mape: so it doesn't feed data it generates a report? [16:02] c4milo: mape: awesome ! [16:02] mjr_: mape: http://gist.github.com/538230 [16:03] mjr_: That's oprofile on just a random ubuntu box with stock node, no explicit V8 oprofile support. [16:03] mjr_: Or even an oprofile-able kernel. [16:03] mape: http://node-monitoring.mape.me/simple/ if you want the less bloated version [16:03] mjr_: But I think if you build V8 with oprofile support and then get a linux kernel with oprofile support that you can be partially as cool as dtrace. [16:04] fliebel: My benchmark of Rhino and Node.js: http://pepijndevos.nl/js-server-benchmark-nodejs-rhino (stride, blogometer) [16:04] mjr_: You can certainly fill in your graph with some awesome stuff. [16:04] robotarmy has joined the channel [16:04] mjr_: fliebel: did you notice the awkward formatting? [16:04] tmpvar: mape, nice job as always :) [16:04] sh1mmer has joined the channel [16:04] c4milo: mape: what are you using to design this things ? [16:04] fliebel: mir? where? [16:04] mjr_: fliebel: oh, I see you fixed it [16:05] mjr_: fliebel: or maybe posterous was mangling it for us before. [16:05] mape: tmpvar: Thanks :) Actually wanted to ask you about the canvas performance, Now I'm rendering the canvas once every 2 sec and animate the scrollLeft of the wrapper container. Feels like that should be faster then redrawing the canvas 20 times every second? [16:05] mape: c4milo: What part? [16:05] fliebel: mir: yea, I wish Posterous made it private, and let me review it online before publishing [16:05] ajsie has left the channel [16:05] rektide has joined the channel [16:06] c4milo: mape: the whole app [16:06] benburkert has joined the channel [16:06] mjr_: fliebel: have you asked a Java Person about these numbers? I have a feeling that they'll tell you some other magical command line arguments to add for better performance. [16:06] mape: c4milo: Well 2 visualization libs, some custom code, css and html [16:06] fliebel: mjr_: No, I didn't, but I will [16:06] c4milo: which libs ? [16:06] tmpvar: mape, im not sure what you mean [16:06] jelveh has joined the channel [16:07] tmpvar: oh right [16:07] tmpvar: yeah, filling less is definitely faster ; [16:07] tmpvar: ;) [16:07] mape: Barely got it running smooth on the iPad with 4 graphs [16:07] aglemann has joined the channel [16:08] aglemann has left the channel [16:08] mape: Awful performance [16:08] mjr_: mape: you could turn WAY down the animation rate and still have that thing be useful. [16:08] tmpvar: yeah, its an interesting problem (clearing ONLY the pixels that are dirty) [16:09] mape: mjr_: Oh yeah, just want it to be pretty as well ;) But yeah, easy enough to later the fps [16:09] tmpvar: mape, I had a thought, what if you render the same lines just in black when you wanted to update the graphs? [16:09] tmpvar: that way you aren't filling the entire canvas [16:10] mjr_: So is SVG just not well implemented? It seems like a good SVG implementation would be faster and more useful than all of this canvas business. [16:10] mape: well that makes sence.. But the glow would mess with it [16:10] tmpvar: right, just apply the same fx to the black line [16:10] tmpvar: should undo it [16:10] tmpvar: then render the new lines over it? i think it would work! [16:11] mape: Hmm I'll try, so fillRect is really that bad? [16:11] mjr_: Until you get pixel fuzz from sub-pixels [16:11] mape: Son of satan etc etc? [16:11] tmpvar: mape, for the most part yeah [16:12] mape: mjr_: I'm just trying out stuff, and mucking about with the UI. If It ever gets useful enough to actually warrant it a decision will be made :) [16:12] tmpvar: you are basically having to fill the canvas twice, one complete time, then draw the lines.. *slow* [16:12] tmpvar: since canvas is fill limited, less filling is better [16:12] mape: yeah just seems like the math of drawing bezier curves should be more then just filling [16:13] ironfroggy: So three days now i have been trying to get some combination of node, a websocket server, and client versions that actually work, out of the box. still nothing works. [16:13] tmpvar: that may be true, we had this conversation with wargamez, right? [16:13] ironfroggy: is that normal for these things to be so much in flux that i cant even expect them to work out og the box? [16:13] mjr_: ironfroggy: what's the latest problem? [16:13] mape: tmpvar: Yeah [16:14] omarkj: Is there a good way to convert JSON to XML? [16:14] omarkj: I know it's a horrible question.. [16:14] mape: Guess I'll have to test, tmpvar thanks for the idea, makes total sence. [16:14] mape: *sense [16:14] mape: I need to stop doing that.. [16:14] tmpvar: mape, I honestly havent gotten to the point with carena where i need to clear off bezier curves yet. soon though. [16:14] tmpvar: or arbitrary shapes for that matter [16:15] tmpvar: mape, np, let me know how it goes :) [16:15] mjr_: ironfroggy: these are very new boxes you are talking about. [16:15] mape: Will do [16:15] ironfroggy: mjr_: nothing new. if i try websocket transport, Socket.IO has an obvious bug (tries to call this.connection.setTimeout() where this.connection is actually a socket, has no setTimeout() [16:15] blogometer has joined the channel [16:15] mape: ironfroggy: tried micheils websocket server? [16:15] mjr_: ironfroggy: I haven't used Socket.IO. [16:16] ironfroggy: mjr_: and if i try xhr-polling, it connects and sends messages, but then it disconnects. ive been ablet o determine its the disconnection timeout trigged by the request end event. thats as far as i have gotten. [16:16] mjr_: But I've used websocket-server or whatever that package is called, and it works fine. I went and did my own implementation in less than a day because I wanted to understand it. [16:16] daleharvey has joined the channel [16:16] ironfroggy: mape: which one is that? [16:17] mape: the one most people seem to use [16:17] mjr_: http://github.com/miksago/node-websocket-server [16:17] ironfroggy: i dont just want websocket, i want fallback for non-websocket supporting browsers. thats why i was using Socket.IO [16:17] mape: jup that one [16:17] ironfroggy: node-websocket-server i used first ebcause i thought it had that fallback, but switched to Socket.IO yesterday [16:17] mjr_: ironfroggy: I think your issues are just client-side with socket.io. [16:17] ironfroggy: mjr_: you think? [16:18] mjr_: well, I dunno. [16:18] mjr_: What you first said was that node + websockets isn't working well, but you want more than that. [16:18] mjr_: Which is cool. [16:18] ironfroggy: mjr_: well yeah, i could have elaborated, but ive had no luck with any of it :-/ [16:19] ironfroggy: its been real frustrating. i should be nearly done with my project. instead, i have barely started. [16:19] mjr_: I know a lot of people are doing node + ws using node-websocket-server and it is working somewhat easily. [16:19] ironfroggy: i can't move forward until i have the message passing. [16:19] ironfroggy: i would use node-websocket-server if i didnt need the xhr fallback [16:19] astrolin_ has joined the channel [16:20] mjr_: rauchg is often in here. Might be best to ask him. [16:22] mape: seems like quite a bit of people are having issues with socket.io [16:22] bcg has joined the channel [16:23] mjr_: ironfroggy: you could just do your thing with XHR, get it working, and then add in WS later for more awesomeness. [16:23] mjr_: node is pretty great for handling XHR long polls. [16:26] charlesjolley- has joined the channel [16:27] twoism has joined the channel [16:27] tmpvar: so it looks like no websockets on heroku eh? shame! [16:29] ironfroggy: mjr_: been trying to do that. thats the transport that is disconnecting. [16:29] creationix has joined the channel [16:29] bpot has joined the channel [16:29] ironfroggy: maybe i can fix it [16:29] streampunk: tmpvar: Yeah. I think their request routing infrastructure doesn't really support indefinite connections. I am sure they are working on a socket proxy though. [16:29] mjr_: ironfroggy: your issue with XHR is that it disconnects after the request ends? [16:30] mjr_: er, after the response ends? [16:31] ironfroggy: yes [16:31] mjr_: That's probably just the web browser's connection pool keepalive timeout, which you don't really get to control. [16:31] mjr_: As soon as the response ends, you need to fire a new request from the client right away. [16:32] mjr_: If there's nothing for the server to send, then the server just hangs on to the req/res pair until there is. [16:32] ironfroggy: mjr_: i expected as much but i thought that was what Socket.IO handled. otherwise, whats the point? [16:33] mjr_: The point is you can write your code one way and get WS goodness if your browser has WS, and boring XHR otherwise. [16:33] jpld has joined the channel [16:34] mjr_: creationix has some great demos of driving animations from just XHRs. It's not as efficient as WS, but you can turn them around pretty quickly these days. [16:34] _announcer: Twitter: "there is some #couchdb in the air... probably with #nodejs :)" -- Florent Messa. http://twitter.com/thoas/status/21591050998 [16:34] creationix: mjr_: yeah, and node handles it pretty well, but the client doesn't like all the xhr objects [16:34] creationix: especially on mobile [16:35] mjr_: Yeah well, you could always group up the messages, you know, slow down. [16:35] creationix: it depends on if you need 10 updates per second or 40, and what your latency requirements are [16:35] aliem has joined the channel [16:35] creationix: my multi-touch demo in connect already throttles the xhr requests and groups them [16:36] creationix: otherwise it wouldn't run on iPad [16:36] mjr_: You can drive even an older laptop at 50 XHRs/sec though. [16:37] sudhirj has left the channel [16:37] ironfroggy: i just thought the point of Socket.IO was to abstract this, such that you can use it exactly the same no matter the transport. [16:37] creationix: yeah, desktop browsers can churn out the chr [16:37] mjr_: ironfroggy: does your project need the low latency of WS? If you don't really need it, XHR is a proven model for handling this stuff. [16:37] creationix: *xhr [16:38] ironfroggy: so i am surprised if it only doing a single xhr per connection and won't re-poll when it ends. [16:38] femtoo has joined the channel [16:38] creationix: ironfroggy: I think it reconnects the xhr [16:38] ironfroggy: mjr_: no, so i'm perfectly fine with xhr. but even that wont work for me yet. not the way i thought it was, anyway. [16:38] jelveh_ has joined the channel [16:38] mjr_: ironfroggy: either that, or you can try to get someone to help you with socket.io. [16:38] creationix: ironfroggy: are you behind a funny proxy or firewall? [16:38] ironfroggy: creationix: well i thought so, but it explicitly is calling the connection close function when the request ends. [16:38] mjr_: creationix: it's more of a programming model issue [16:39] ironfroggy: maybe it expects the client to send a new xhr and its not doing so? [16:39] ironfroggy: creationix: yes [16:39] ironfroggy: a proxy [16:39] joshbuddy has joined the channel [16:39] creationix: I do know socket.io's xhr has reconnect issues, but it works under normal circumstances [16:39] mjr_: ironfroggy wants a "setup a connection to the server over which I can send and receive messages" type of thing, and that's not what bare XHR provides. [16:39] jetienne: pkrumins: patch is in the issue on github [16:40] creationix: mjr_: right, but he's using socket.io. It's supposed to do that already, and works for me mostly [16:40] mjr_: It is indeed supposed to work that way. [16:40] mjr_: From what I've read anyway. [16:41] ironfroggy: creationix: so it is supposed to reconnect? ok, that is good. i was starting to think it didnt even try. [16:41] ironfroggy: something i can fix is better than something i have to implement myself. [16:41] ironfroggy: usually... [16:42] davidwalsh has joined the channel [16:44] WALoeIII has joined the channel [16:45] WALoeIII has joined the channel [16:45] _announcer: Twitter: ""UglifyJS: Fast New JavaScript Compressor For Node.js That’s On Par w/ Closure" #tech #javascript http://bit.ly/bMtqxI" -- Elijah Manor. http://twitter.com/elijahmanor/status/21591796077 [16:45] keeto has joined the channel [16:46] twoism has joined the channel [16:49] EyePulp has left the channel [16:49] EyePulp has joined the channel [16:50] EyePulp: dylang: you around? [16:51] siculars has joined the channel [16:53] ryah: mjr_: hey [16:53] ryah: mjr_: paul did a pool for buffers last night [16:53] mjr_: hey ryah [16:53] bradleymeck has joined the channel [16:54] mjr_: oh, awesome [16:54] ryah: little change in speed [16:54] ryah: the bottleneck is elsewhere. [16:54] ryah: possibly creating external objects is simply so heavy [16:54] mjr_: What's the test? [16:54] tyfighter has joined the channel [16:54] ryah: also, im collecting benchmarks [16:54] ryah: http://github.com/ry/node/blob/12a169e8ff4036e160dbdc605eb9f15eae933b47/benchmark/buffer_creation.js [16:55] mu-hannibal has joined the channel [16:55] ryah: but i just had an idea [16:55] ryah: pquerna: you here? [16:55] _announcer: Twitter: "http://github.com/brickysam26/node-proxy harmony catch-all proxies for #nodejs, word." -- rektide de la fey. http://twitter.com/rektide/status/21592505416 [16:55] mjr_: Feel free to add my proxy small chunks test. [16:55] amerine has joined the channel [16:55] ryah: anyway - instead of doing the buffer pool in c++ [16:55] ryah: we could alloc the buffer pools in js [16:55] ryah: and change the implementation of Buffer to not be the external c++ object [16:55] pquerna: ryah: yo [16:55] ryah: but just a little pure-js object [16:56] statim has joined the channel [16:56] JimBastard: im stupid and talk in irc and code javascript because i suck [16:56] JimBastard: DAMN YOU JENKINS [16:56] ryah: so that when you do new Buffer(10) [16:56] JimBastard: poop [16:56] ryah: only js is executed [16:56] ryah: (assuming you don't hit the end of the pool) [16:56] rektide: http://github.com/brickysam26/node-proxy i al so happy [16:56] rektide: am* [16:56] pquerna: ryah: hmm. interesting. [16:56] pquerna: ryah: that might be very fast :) [16:56] rektide: i thought catch-all proxy's had made it into v8 core, but icant find any evidence of that any more [16:57] ryah: Buffer.slice implementation could be changed to just return these pure JS things [16:57] ryah: obviously Buffer.toString is going to have to call some c++ [16:57] mjr_: The reason I noticed this buffer creation time thing is because I found that converting my request chunks into JS Strings and appending them is faster than allocating a buffer and doing buffer.copy() into them. [16:57] ryah: but that doesn't mean that Buffer itself needs to be an ObjectWrap [16:57] ryah: then on the c++ [16:57] ryah: side [16:57] _announcer: Twitter: "New JavaScript minifier based on node.js.. UglifyJS... http://bit.ly/bgab3P #javascript" -- Timothy Fisher. http://twitter.com/tfisher/status/21592695775 [16:58] ryah: we have Buffer::New() [16:58] ryah: which is important for addons [16:58] bradleymeck: rektide if you want a more forgiving impl check out node-overload [16:58] ryah: we'll imlement that such that it calls into js [16:58] ryah: (or something) [16:58] ryah: but i think going out of our way to make "new Buffer(10)" fast [16:58] ryah: is important [16:58] mjr_: I agree. It comes up a lot. [16:59] mjr_: At least, for me it does. [16:59] ryah: i think creating 10 million pure js objects is fast [16:59] ryah: creating 10 million c++ objects is not [16:59] mjr_: wow, why is that? [16:59] mjr_: C++ is, you know, NATIVE code. [16:59] ryah: V8 external linking... etc [16:59] ryah: no one knows [16:59] bradleymeck: is a buffer not a malloc pointer but an actual class? [16:59] ryah: but it's more than jst malloc [16:59] mjr_: So it's all the massaging converting and marshalling that V8 has to do to go into and out of V8? [16:59] ryah: v8 does a lot for external refs [17:00] deepthawtz has joined the channel [17:00] jetienne: ryah: dont you have a "contact personn" at google thanks to node ? [17:00] aubergine has joined the channel [17:01] jelveh has joined the channel [17:01] ryah: jetienne: ? [17:01] mjr_: ryah: until dtrace is done, we might be able to use oprofile on Linux to instrument the real costs of this stuff. [17:01] jedschmidt has joined the channel [17:01] jetienne: ryah: i dunno like a email of somebody in v8 teams, who is there to answer your question [17:01] mjr_: Have you tried the V8 oprofile helper? [17:01] ryah: jetienne: yes, i have v8 contacts [17:02] ryah: but they're often involved with v8 internals and not so much with binding [17:02] ryah: i really need to get to know the Chrome DOM dude [17:02] ryah: :) [17:02] _announcer: Twitter: "Fine article AkitaOnRails @ "Playing with Node.js, Tornado and Thin">> http://goo.gl/gWCr" [pt] -- Alexandre F. Menezes. http://twitter.com/ale_menezes/status/21593022955 [17:02] ryah: s/dude/dudes/ [17:02] jetienne: ryah: ok :) [17:02] fictorial has joined the channel [17:03] jelveh has joined the channel [17:04] jetienne: ACTION goes back to c++ on mac [17:04] blogometer: Mount points: [17:05] blogometer: If I build an application using Node.js. [17:05] mjr_: I need to get back to multi-pumping and complex throttling logic. [17:05] blogometer: Using /hello [17:05] benburkert has joined the channel [17:05] mjr_: But it's too hard. [17:05] blogometer: How do I go about deploying at... [17:05] blogometer: a url like /prod/hello [17:05] blogometer: or /dev/hello. [17:05] blogometer: I know the answer begins with, it depends... [17:06] ryah: ok - so mjr_, pquerna - i don't have time before node ko to do this Buffer-in-JS work [17:06] ryah: so feel free [17:06] ryah: i think it could be a big win [17:06] ryah: otherwise i'll do it after the contest [17:06] ryah: it'll be a bit of work [17:06] mjr_: ryah: I've fixed my issues by just using JS Strings, which are actually really fast. [17:06] mjr_: Though it pains me to see it. [17:06] ryah: i guess we should do some tests before going full steam into this idea [17:07] ryah: yeah.. [17:07] ryah: i think we can get around this... [17:07] mjr_: BTW, if I could pick what pquerna should work on, and of course I cannot, but I'd pick SSL. [17:07] mjr_: :) [17:07] JimRoepcke has joined the channel [17:08] JimRoepcke has joined the channel [17:08] mjr_: So ryah is ObjectWrap the culprit then? [17:08] FransWillem: Why exactly was the Buffer object made global? what was wrong with requiring it ? [17:09] ryah: mjr_: i think [17:09] mjr_: FransWillem: Buffer is such a common thing in node. You get passed Buffers in callbacks. I think it makes sense to have it globall. [17:09] tobiassjosten has joined the channel [17:09] creationix: didn't EventEmitter become global too [17:09] creationix: it seems global is v0.1.104 at least [17:10] pquerna: i think it is the objectwrap stuff. [17:10] mjr_: objectwrap is mighty clever, BTW. [17:10] c4milo: who are sharing code between server and client ? [17:10] Throlkim has joined the channel [17:10] c4milo: and using commonjs in the client [17:11] c4milo: ? [17:11] FransWillem: Hmmm, but *why*? Yes, sure, you have to require a few more things, but in the end, that ensures that modules I write for Node.js will still be compatible with other CommonJS runtimes without having to clutter the global namespace (although they'd need Buffer and EventEmitter implementations) [17:12] fliebel: What is objectwrap? [17:13] mjr_: FransWillem: I see your point. Personally, I don't care about commonjs. I don't want to suffer the compromises that committees generally come up with. [17:13] FransWillem: Oh well, I'm just a big fan of leaving the global namespace alone, really [17:13] creationix: FransWillem: I think the idea is to first come up with a good and proven API and then worry about sharing with other runtimes [17:14] creationix: from my point of view, Buffer is at the same level as Array, Number, and RegExp [17:14] FransWillem: creationix: Pretty sure Buffer isn't defined in the ECMAScript docs, and as such has no place in the global namespace. [17:14] mjr_: It is defined in the node docs. :) [17:15] creationix: FransWillem: module, process, require, and others aren't part of ECMA either [17:15] creationix: ECMA was designed for browsers [17:15] creationix: *ECMAScript [17:15] FransWillem: creationix: Don't agree with that either, ECMAScript doesn't mention window, document, or any part of the DOM really :p [17:16] jashkenas has joined the channel [17:16] creationix: well, we know JavaScript was designed specifically for Netscape's browser [17:16] jashkenas has left the channel [17:16] FransWillem: creationix: And as for module/process/require: module and require are defined in CommonJS, and process is a necesary evil (Node needs *some* place to communicate from C++ to JS, right ?) [17:16] creationix: they did attempt a server-side js back then, but it failed [17:17] c4milo: does nodejs support packages ? [17:17] aniero: npm and kiwi are two package managers that you can use [17:17] creationix: c4milo: just securable modules from commonjs [17:17] FransWillem: Guess we're just going to have to agree to disagree then :p [17:17] fliebel has left the channel [17:17] c4milo: and what about versioning ? [17:17] creationix: FransWillem: feel free to speak up, ryah is generally open to ideas, especially when thought through [17:17] c4milo: how can I require a specific module version ? [17:18] mjr_: FransWillem: if you want a faithful ECMAScript implementation, then this is probably not it. [17:18] creationix: c4milo: npm handles that for you, but you can use relative requires [17:18] mjr_: node is pretty much, "whatever the V8 team and ryah want to do". Which is a feature, and probably a bug. [17:18] c4milo: creationix: does it mean that nodejs doesn't support require('packageid', 'moduleid') ? [17:18] FransWillem: mjr_: Node.js can be pretty close to an ECMAScript + CommonJS implementation, it'd just need to have to require(...) stuff instead of adding it to the global namespace :/ [17:19] n3v3le has joined the channel [17:19] sh1mmer has joined the channel [17:19] n3v3le has joined the channel [17:19] saikat has joined the channel [17:19] ryan_gahl has joined the channel [17:20] creationix: c4milo: correct [17:20] n3v3le has left the channel [17:20] c4milo: creationix: thks [17:20] Gruni has joined the channel [17:20] pkrumins: jetienne: got your patch [17:20] pkrumins: jetienne: applying :) [17:20] jetienne: pkrumins: cool :) [17:24] cardona507 has joined the channel [17:24] MikhX has joined the channel [17:24] c4milo: creationix: is there a special reason to not support packages in nodejs ? [17:24] creationix: we want to keep node as lean as possible [17:24] ryah: hey [17:25] creationix: the module code is nasty enough as is [17:25] ryah: javascript people - is there some way to define [index] on a js object [17:25] jakehow has joined the channel [17:25] creationix: c4milo: but npm and other libraries provide it [17:25] creationix: ryah: what do you mean? [17:25] ryah: myobject[10] [17:25] ryah: i was to define getter and setter for all integers [17:25] creationix: myobject[10] = foo [17:25] creationix: ohh, no, not in v8 [17:25] c4milo: creationix: I thought that nodejs was commonjs compliance [17:26] creationix: c4milo: only partially [17:26] ryah: is that possible? [17:26] creationix: ryah: not in v8, but spidermonkey implements it [17:26] creationix: ryah: I think you can do it from c land though [17:26] creationix: someone made a module for it [17:27] creationix: ryah: the feature you're looking for is Object.__noSuchMethod__ [17:27] ryah: oh [17:27] devinus has joined the channel [17:27] ryah: nice [17:27] jetienne: it exists for real ? [17:27] creationix: ryah: if I'm understanding what you want correctly [17:27] ryah: yes that's what i want [17:28] creationix: ryah: http://groups.google.com/group/nodejs/browse_thread/thread/622a22ca9ef66e53 [17:28] creationix: I asked for the feature last December [17:28] ryah: oh, it's not in v8? [17:28] ryah: man. [17:28] ryah: FransWillem: node defines commonjs :) [17:29] ryah: no need to worry about standards [17:30] pkrumins: jetienne: i could not `git apply` it [17:30] pkrumins: jetienne: so i did it by hand [17:30] pkrumins: jetienne: how did you create it? [17:30] Gruni has joined the channel [17:30] creationix: ryah: I'm pretty sure someone implemented it as a node addon, but I'm having trouble finding the link [17:31] isaacs has joined the channel [17:32] jetienne: pkrumins: the nodejs way... git commit -a && git format-patch HEAD^ [17:32] JAAulde has joined the channel [17:32] JAAulde: any word on the buildbot server? [17:32] mscdex: creationix: you mean node-overload? [17:33] daleharvey has left the channel [17:33] mscdex: http://github.com/bmeck/node-overload [17:33] ryah: creationix: addon is no good [17:33] daleharvey has joined the channel [17:33] ryah: i can do it in c++, that's not what im interested in [17:33] JimBastard: http://adi.stav.org.il/sesame-street-explains-tcp/main.htm , awesome [17:33] creationix: mscdex: yep, that's it [17:33] ryah: does es5 not have this feature? [17:33] Astro: I keep wondering why there is no Buffer.index() & .equals() [17:34] pkrumins: jetienne: and how was I supposed to apply it? [17:34] creationix: ryah: nope [17:34] ryah: man. [17:34] jetienne: pkrumins: no clue, ask ryah he is the one advicing this tech :) [17:34] pkrumins: jetienne: `git apply patch` was failing [17:34] wattz: afternoon all! [17:34] pkrumins: ryah: how do you apply a patch created by `git format-patch HEAD^`? [17:34] pkrumins: ryah: any special flags? [17:34] ryah: JAAulde: nodejs.org got moved, i haven't moved the server yet [17:35] ryah: JAAulde: but i will soon [17:35] ryah: in 2 weeks [17:35] JAAulde: ryah: ok, cool--thanks. no hurry on my part, was just wondering [17:35] jetienne: brb phone [17:36] ryah: yeah - we can't do the fast buffer without being able to define []... [17:36] JAAulde: my buildslave is having issues so that gives me time to work them out [17:37] ryah: unless people would be okay with switching API [17:37] ryah: buffer.get(12) [17:37] ryah: buffer.set(12, 0xff) [17:37] creationix: I think an api change is ok, but why not just implement it in C [17:38] creationix: Buffer is already half C as is [17:38] pkrumins: it would be awesome if buffer could swap its internal pointer to another one [17:38] pkrumins: i might hack this in [17:38] pkrumins: to avoid unnecessary copying [17:38] mape: switcharoo [17:40] mscdex: you all saw the proposal for "proxies" instead of __noSuchMethod__ right? [17:40] _announcer: Twitter: "Just discovered Express, a web framework on nodejs: http://expressjs.com/ Interesting!" -- Raphael. http://twitter.com/raphinou/status/21595539004 [17:40] mscdex: someone already has an implementation for node? http://github.com/brickysam26/node-proxy [17:40] mscdex: :S [17:43] mape: Any overhead on that? [17:43] aubergine has joined the channel [17:43] pkrumins: sure there is overhead [17:43] mjr_: ryah: changing the API is fine as long as it delivers more performance. [17:44] mjr_ has left the channel [17:44] mjr_ has joined the channel [17:44] mscdex: depends on how much more performance [17:44] zomgbie has joined the channel [17:44] _announcer: Twitter: "node.js http://t.co/jTzvWzu event-driven I / O framework-engine V8 JavaScript." [ru] -- Leonid Kobyashev. http://twitter.com/artddss/status/21595850703 [17:45] Tobsn has joined the channel [17:45] pkrumins: slide 21 for approximate overhead http://es-lab.googlecode.com/files/harmony_highlights_techtalk.pdf [17:47] mscdex: slide 21? [17:47] ker2x_ has joined the channel [17:47] mscdex: oh nevermind, i was going by pdf page number [17:47] ker2x_: hi again :) [17:47] mscdex: :S [17:47] mape: hehe [17:47] mscdex: ker2x_: hola [17:47] ryah: okay [17:47] ryah: fast buffers are fast [17:47] mape: So quite a lot of overhead [17:48] ryah: [1] ryan@mac1234:.../projects/node/benchmark% time node fast_buffer_creation.js [17:48] ryah: node fast_buffer_creation.js 1.25s user 0.03s system 99% cpu 1.294 total [17:48] ryah: [1] ryan@mac1234:.../projects/node/benchmark% time node buffer_creation.js [17:48] ryah: node buffer_creation.js 33.65s user 3.86s system 99% cpu 37.627 total [17:48] pkrumins: ryah: what are these fast buffers? [17:48] ryah: pkrumins: http://gist.github.com/538464 [17:48] pkrumins: click [17:48] ryah: pquerna: --^ [17:49] mape: Nice [17:49] creationix: ryah: I like throw new Error("oob"); [17:49] ker2x_: can someone help me to understand what's wrong here ? http://pastebin.com/38AQds6x the error message is at the end of the pastebin [17:49] creationix: :) [17:49] icozzo has joined the channel [17:49] pkrumins: i see. [17:50] ryah: mjr_: you down with that? [17:50] creationix: ker2x: listen() doesn't return the http_server instance [17:50] rwaldron has joined the channel [17:50] creationix: you can't chain it like that [17:50] mjr_: I'm good with get() and set() if that's what you mean. [17:50] ryah: ok [17:50] creationix: ryah: I'm cool with it [17:50] ker2x_: all exemple chain in like that, that's why i did it. but i understand what you mean. thank you :) [17:50] ryah: then i think we should move on fast buffers. [17:50] creationix: ker2x: you can call listen right away, but not if you want a reference to the http_server object too [17:51] creationix: ryah: so they just create a lot faster? [17:51] ryah: yeah [17:51] creationix: awesome [17:51] creationix: that will speed up lots of things [17:51] ker2x_: creationix: i'd like to use http_server the same way i used udp_server [17:51] ryah: yeah - i think slice() is pretty expensive [17:51] ryah: net.js does it a lot [17:51] mscdex: if the api is going to change, how about having a single method instead of two? [17:51] ryah: so this should be a win. [17:52] pquerna: ryah: nice [17:52] ryah: that we see in hello world http [17:52] ker2x_: i'd like to avoid too many closures :) [17:52] mjr_: slice is the key to all of this going fast. [17:52] creationix: ker2x_: sure, just do it the same, http_server = http.createServer(); http_server.listen(...) [17:52] ryah: it's obvious how to implement slice form that gist, right? [17:52] FransWillem: ryah: How is slice expensive on Buffers, doesn't it just create a new Buffer object while referencing the same memory block ? [17:52] ryah: it'll need some work in the constructor [17:52] ker2x_: creationix: i try. thx :) [17:52] ryah: but otherwise i think it's okay [17:53] ryah: FransWillem: ObjectWrap object creation is slow, it seems [17:53] pquerna: FransWillem: what we have been seeing is that the memory block/malloc are not that expensive, compared to the actual v8 Buffer Objectwrap/creation. [17:53] mscdex: what about an "at" method that takes 1 parameter for getting the value and 2 for setting the value? [17:53] ryah: currently buffer.slice() creates a new ObjectWrap object [17:54] FransWillem: ryah: Hmm just ObjectWrap, or JS Object creation in general ? [17:54] creationix: mscdex: I think get and set is more clear [17:54] feroz_ has joined the channel [17:54] ryah: FransWillem: v8 is fast - when you start doing extensions things are less fast [17:54] FransWillem: Ah, ok, so mainly the goal is to just try and keep everything in JS, while minimizing the callbacks to the C++ code :) [17:55] FransWillem: Anyway [17:55] FransWillem: really should go [17:55] FransWillem: Thanks for the explanation :) [17:55] mscdex: i dunno... i hate losing the [] operator though, it's so succinct [17:55] ryah: yeah [17:55] ryah: me too [17:55] mjr_: It's interesting to step back and observe that all of this Buffer business is here because of limitations on JS Strings. [17:55] mscdex: having "at" or something similar would be the next simplest mechanism imho [17:56] creationix: ryah: why don't you want to implement it at the c side? can't you do a pool there too? [17:56] sudoer has joined the channel [17:57] matt_c_ has joined the channel [17:57] creationix: not that I'm complaining, I'm all for code being written in js [17:57] ker2x_: creationix: now it works as i expected : http://pastebin.com/nQGSLaYs thank you :) [17:57] creationix: ker2x_: :) [17:58] ryah: creationix: it's done in c currently [17:58] ivar has joined the channel [17:58] ryah: well - not the whole pool stuff [17:58] creationix: yeah, but if you implement fast_buffer in c, then you can pool AND have the nice [] syntax right? [17:58] ryah: but pquerna did a test last night with that [17:58] ryah: and it wasnt faster [17:58] ryah: or just marginally faster [17:58] creationix: crazy [17:58] MikhX: i have a weird bug where in textarea inputs when theres a text indent on the initial focus of the field the cursor doesn't get the text-indent [17:59] MikhX: for webkit [17:59] ryah: it's ObjectWrap creation, it seems that's very slow [17:59] persson has joined the channel [17:59] _announcer: Twitter: "JavaScript / MySQL v Podderžka Node.JS: node-mysql-Habr libmysqlclient http://sy.ly/Ihl # # T # # Russia Novosti news #" [sr] -- Tech News. http://twitter.com/technewsru/status/21596740112 [17:59] creationix: ryah: right, but can't you cache the ObjectWrap results and pool those [17:59] creationix: or does that not gain anything you can't do in js [17:59] ryah: we could have a freelist for the ObjectWrap things.. [17:59] MikhX: oops wrong channels [18:00] ryah: it might not be ObjectWrap - it might be SetIndexedPropertiesToExternalArrayData [18:00] ryah: it's unclear [18:01] hpoydar has joined the channel [18:01] ryah: personally i'd rather implmenet methodMissing in js than figure it out :) [18:01] ryah: s/js/v8/ [18:01] bradleymeck: mscdex yea, that and node-overload have proxies, but the speed is quite bad, then again __noSuchMethod__ has around sime perf hit [18:01] mjr_: surely someone will do this anyway since it is in ES5, right? [18:01] ryah: mjr_: it's not part of es5 [18:01] creationix: ryah: cool, like I said, I prefer JS and I'm fine with changing the API if needed [18:01] mjr_: wha? [18:02] grahamalot has joined the channel [18:02] bradleymeck: Weakmaps, Proxies, Weakreferences, and Collectors oh my [18:02] creationix: bradleymeck: those are all in harmony, not es5 right? [18:02] ryah: [] to get/set is a pretty hard API change.. [18:02] pkrumins: right [18:03] creationix: ryah: why not just have both apis then [18:03] creationix: the current buffers + fast buffers with the built-in pool [18:03] ryah: eh. i donno. [18:03] bradleymeck: creationix, yea [18:04] ryah: but im excited to get that fucking .slice() out of ever 'data' event. [18:04] ryah: that's going to be huge. [18:04] ryah: *every [18:04] creationix: ryah: ok, here's the plan, break the buffer api and remove all the deprecation warnings and release it as v0.3.0 [18:04] creationix: with odd numbers being unstable [18:05] ryah: yeah [18:05] creationix: (since we don't seem to ever make it to 0.2.0 [18:05] ryah: that's good [18:05] ryah: i'll do a 0.2 [18:05] mjr_: I agree that the [] syntax is nice, but performance should trump everything. If get/set is noticeably faster, then I say we use it. [18:05] ryah: then we'll start 0.3 with the new api [18:05] creationix: that works too [18:05] creationix: give people something stable to work on [18:05] bradleymeck: yes, a get/set would be faster for catch alls sadly [18:05] ryah: i think this week can be 0.2 [18:05] ryah: just get it over with.. [18:05] creationix: exciting [18:05] mape: woot [18:06] pkrumins: 0.2! [18:06] creationix: node will never be "done" [18:06] creationix: but it's pretty stable now [18:06] mscdex: make sure there isn't anything significant left for 0.2 [18:06] mscdex: :p [18:06] mscdex: bug-wise [18:06] creationix: and you can always do bugfix releases like v0.2.1 [18:06] creationix: but no api changes in 0.2.x [18:07] jsilver has joined the channel [18:07] bradleymeck: get is a, ref -> call, proxy style is a ref->call->ref->call, if v8 could inline that damn function pointer it could be way faster, but they probably wont have that til native proxies [18:07] ryah: okay let it be known - tomorrow is 0.2 [18:07] ryah: so bug fixes shold be put in now [18:08] mape: sprint? [18:08] creationix: :D [18:08] ryah: well i mean it doens't matter [18:08] ryah: we'll bug fix 0.2 [18:08] ryah: but no api changes [18:09] ryah: 0.3 will come next week [18:09] pkrumins: every even release can be stable, every odd unstable [18:09] ryah: yes [18:09] isaacs: ryah: w00t! [18:09] william has joined the channel [18:09] deepthawtz has joined the channel [18:09] isaacs: ryah: stdi! [18:09] ryah: mape: ping [18:09] isaacs: stdio! [18:09] mape: ryah: pong? [18:09] pkrumins: what's this stdio? [18:09] ryah: mape: just had an idea [18:09] cardona507 has joined the channel [18:10] pkrumins: isaacs? [18:10] ironfroggy: saikat: ping. I am told you are a good person to ask about Socket.IO problems. [18:10] devinus has left the channel [18:10] mape: ryah: spit it [18:10] ryah: mape: setup a finger server which allows you to finger people in the #node.js irc room [18:10] isaacs: pkrumins: the stdio module i wrote [18:10] pkrumins: isaacs: didn't know about it! looking. [18:10] ryah: so "finger ironfroggy@nodejs.org" [18:10] ryah: returns his irc info [18:10] tobiassjosten: Anyone here use mongoose? [18:10] ryah: plus the last few things he said [18:10] tobiassjosten: I can't get Node to find the module... :( [18:10] ryah: maybe some stats [18:10] paul__ has joined the channel [18:10] ryah: histogram of when he's online [18:11] ryah: location [18:11] ryah: etc [18:11] _announcer: Twitter: "Noticed that Ubuntu 10.10 Maverick already has CouchDB 1.0.1 and Node.js 0.1.97, coolness! (Hoping Node will be stable soon.)" -- Kenneth Falck. http://twitter.com/kennu/status/21597476835 [18:11] hober: ryah: any chance my TERM=dumb patch will make it into 0.2? [18:11] ryah: uh, maybe. i need to look at it again. [18:11] mscdex: lol 0.1.97 [18:11] isaacs: pkrumins: http://github.com/isaacs/node/commits/stdio-module [18:11] hober: cool, thanks [18:11] ryah: going to work now. bye [18:11] mape: ryah: so more or less a remote decent whois? [18:12] Viriix_: closures in php suck, they should of took notes from ECMA-262 [18:12] skampler: buffers more like pointers - great [18:12] pkrumins: isaacs: is it gonna be in 0.2? [18:12] isaacs: pkrumins: ask ryah :) [18:13] isaacs: pkrumins: i'd vote yes, since it's an API change. [18:13] saikat: ironfroggy: heh i can try, though raughg, when he's in, is the creator and will probably know more [18:13] saikat: rauchg* [18:13] bradleymeck: tobiassjosten, how did you install the module [18:13] qFox has joined the channel [18:13] pkrumins: isaacs: i am for it too [18:13] ironfroggy: saikat: yeah ive been checking to see if he's around a few times today, but no so far. mind fielding a few questions? [18:13] tobiassjosten: bradleymeck: As a Git submodule, in lib/mongoose. [18:13] saikat: sure [18:14] tobiassjosten: bradleymeck: Relative to my project root, that is. :) [18:14] ironfroggy: saikat: i am trying to get xhr-polling transport to work, and my understanding is that when the xhr request ends, the client should make a new one to keep the connection open, right? [18:14] saikat: yeah [18:14] pkrumins: isaacs: i know why your async module crashes [18:14] saikat: i actually found that XHR polling was broken for me the last time i tried 2 days ago [18:14] isaacs: pkrumins: oh!? [18:15] bradleymeck: and you are using relative path to the mongoose main, ie. require('./lib/mongoose/mongoose')? [18:15] saikat: i haven't looked into it deep enough to see if it was my problem or socket.io [18:15] stepheneb has joined the channel [18:15] pquerna: todays lesson, implement memory pools in pure javascript :| [18:15] saikat: but if you're having the same issue, it's probably something that needs to get fixed - i was going to try to write a patch for it later today [18:15] pkrumins: isaacs: add `obj.cxxflags = ["-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE"]` to the build() function in wscript [18:15] _announcer: Twitter: "todays nodejs lesson, implement memory pools in pure javascript :|" -- Paul Querna. http://twitter.com/pquerna/status/21597745625 [18:15] bradleymeck: ironfroggy, i tend to wait for a 2nd connection to come in before i disconnect the first [18:15] creationix: pquerna: all this is encouraging my idea that performant protocols can be implemented in pure js [18:15] pkrumins: isaacs: libeio doesn't work without large file defines [18:15] stepheneb has joined the channel [18:16] pkrumins: isaacs: try it and tell me if it worked! [18:16] tobiassjosten: bradleymeck: Yup. And I also tried requiring './lib/mongoose' and './lib/mongoose/mongoose' and I tried adding those to the require path as well. No show. [18:16] stepheneb has joined the channel [18:16] tobiassjosten: Error: Cannot find module 'mongodb' [18:16] ironfroggy: saikat: "it needs fixed" is a much better answer for me than anything else. it means its not just me. [18:16] pquerna: creationix: the expensiveness of a c++ object just seems insane, compared to the overhead it has in something im more used to like Lua [18:16] tobiassjosten: Erm... [18:16] isaacs: pkrumins: you are a genius. yes, that fixed it. [18:16] bradleymeck: tobiassjosten, did you git submodule init/update inside of mongoose (it has a submoduel) [18:16] tobiassjosten: bradleymeck: Nevermind. I see now that it's complaining about mongodb, not mongoose. I haven't mongodb module installed. [18:16] isaacs: pkrumins: thanks! [18:16] pkrumins: isaacs: sweet :) [18:17] creationix: I still hold my theory that C++ is no longer ideal for anything except interfacing with existing c++ code [18:17] tobiassjosten: bradleymeck: That's probably my issue. [18:17] pkrumins: isaacs: sure, i had the same problem when making my modules async. [18:17] pquerna: isaacs: btw, i rewrote your rm-rf with more error handling, but more uglyness [18:17] bradleymeck: creationix, you dont like debugging c++? whaaaa [18:17] jelveh has joined the channel [18:17] isaacs: pquerna: cool [18:17] mape: !github http://github.com/mape [18:17] pquerna: isaacs: http://github.com/cloudkick/cast/blob/master/lib/util/fs.js [18:17] creationix: bradleymeck: there are faster AND easier to use languages these days [18:17] isaacs: pquerna: mostly, in npm, if it doesn't work, i just say "meh. remove this." [18:17] sveimac has joined the channel [18:18] bradleymeck: i wish D had hit it off [18:18] jelveh has joined the channel [18:18] creationix: bradleymeck: I feel the same for oCaml [18:18] creationix: but V8 is starting to show that JS is actually pretty good too [18:18] wllm has joined the channel [18:19] bradleymeck: as long as v8 dont get strict mode im cool [18:19] creationix: bradleymeck: why is that [18:19] creationix: the only non ES5 thing I use is __proto__ and I can usually work around that [18:19] creationix: *non-ES5-strict [18:20] bradleymeck: i cant do arguments.caller (recursive constructor came up 2 times since ive used node for odd closure fuddling), and i cant ever use Function/eval [18:20] bradleymeck: plus bosses everywhere will ask why your code isnt 'strict' [18:20] saikat: but related to socket.io, does anyone here have any best practices they use for doing authenticated requests over websockets? for example, if a user sends a message to me over websockets to modify his project, what's the best way to get the user's credentials, since i don't think i get any cookies except for when they set up the websockets connection? [18:20] aniero: saikat: authenticate when they first connect [18:20] javajunky has joined the channel [18:20] aniero: saikat: and keep track of that server-side so you can map connections to credentials [18:21] isaacs: bradleymeck: what do you use arguments.callee.caller for? [18:21] saikat: i see [18:21] maushu has joined the channel [18:21] stepheneb has joined the channel [18:22] saikat: aniero: so i have a bit of a strange case where users are authenticating using my django app, but then do real-time communication with my node app. is it unsafe (where by unsafe i don't mean to be completely fool-proof as my original connection isn't even over SSL) to just have them send the cookie string in the socket message? [18:22] bradleymeck: saikat, authenticate by injecting a js variable over https and a scriptable cookie rsa it back, check cookie as the public key injection as the private key (check the remote address as well). (and yes its a long way of doing things, but damnit i wanted to be sure it was them) [18:24] bmavity has joined the channel [18:24] ironfroggy: saikat: I am doing the same thing (django + node.js) [18:24] chrischris has joined the channel [18:24] stephenlb has joined the channel [18:25] ironfroggy: saikat: is there a good reason you _cant_ get the cookie from the websocket connection itself? or rather, why Socket.IO can't expose those cookies to you? [18:25] bradleymeck: isaacs, i was using it to do some odd stuff where i set up an foo(){if(arguments.caller==foo)return;var p=new foo;this.__prototype__=Object.create(p);} to have hidden prototypes i was messing w/ without messing w/ the foo prototype, like i said, not very common, forget why i needed that though [18:25] saikat: ironfroggy: i think the cookie is only sent on the first connection [18:26] stephenlb has joined the channel [18:26] bradleymeck: ironfroggy, flash fallback wont send cookies, only chromium 5.2+ sends em on websockets [18:26] ironfroggy: flash fallback is a good point! [18:26] FransWillem has joined the channel [18:26] saikat: bradleymeck: chromium 5.2 sends them on each message? [18:26] isaacs: bradleymeck: ok.. that's a bit odd. [18:26] isaacs: bradleymeck: i mean, the proto is sort of exposed anyway, right? [18:26] bradleymeck: no, the only time it sends it is during the http request [18:27] ironfroggy: so you cant get changes in the cookies if they change on the browser since the connection was made. [18:27] zapnap has joined the channel [18:27] bradleymeck: isaacs, yes, but i was morphing constructors around to make them do some lazy loading stuff [18:27] saikat: yeah - my issue is also that i let unauthenticated users set up a socket connection (which i use to send them server notices like 'going down for maintenance' but then they can authenticate. i guess i'd have to break and recreate their connection in that case [18:27] ironfroggy: saikat: does seem like the best bet is to send that session key manually as part of the message structure. [18:28] saikat: which just makes things way too complicated when added to the fact that i do all this crap already to try to keep the connection alive by doing exponential backoff, detecting if the break is during an initialization vs idle time, etc. [18:28] SubStack: saikat: you could always use dnode ^_^ [18:28] bradleymeck: inject the single use private key via https, set a scriptable cookie, rsa em is the way to auth [18:28] _announcer: Twitter: "Anyone need a Node.js Knockout team slot? Sadly, I will not be able to make it so I have an extra team slot." -- Ray Morgan. http://twitter.com/raycmorgan/status/21598523117 [18:29] saikat: bradleymeck: heh right - so when you say "inject a single use private key" - is that the client doing it? and by inject, you mean putting it in the socket message? [18:29] SubStack: authentication in dnode looks like this: http://github.com/substack/dnode/blob/master/examples/auth/server.js [18:29] bradleymeck: no, server sends the cookie injected via some kinda template into a script tag [18:29] aglemann has joined the channel [18:30] mscdex: bradleymeck: what? i've used flash websocket on FF and it sent cookies [18:30] bradleymeck: i didnt get em on my chrome [18:30] bradleymeck: i cant get anything but xhr to send out cookies on chrome [18:30] aglemann has left the channel [18:31] jimmybaker has joined the channel [18:31] devinus has joined the channel [18:31] mscdex: bradleymeck: check your cookie maybe. is it httpOnly? is it being restricted to the port it was set on? [18:31] cferris: is npm supposed to work behind a proxy? [18:31] jochen has joined the channel [18:31] isaacs: cferris: yeah, i'm told that works in the latest master [18:31] bradleymeck: i was using the same port and it should still show up server side as being there even if its httpOnly? [18:31] isaacs: cferris: i don't actually use it that way, though. others have implemented it [18:31] devinus: creationix: i read somewhere that Connect now supports load-balanced proxied requests? [18:31] mscdex: bradleymeck: httpOnly cookies are not sent with websocket requests [18:31] saikat: bradleymeck: when you say "sends the cookie" do you mean the string data that would normally be in a cookie (so no actual cookie here that is being passed)? why does it need to go into a script tag? [18:32] sveimac has joined the channel [18:32] isaacs: cferris: there was a problem with that in the latest release. get the code, do "make dev" and try it out [18:32] cferris: isaacs: the install.sh curls a tarball from master right? [18:32] saikat: SubStack: dnode seems cool [18:32] isaacs: cferris: yeah, so i mean, you'll have to do that bit manually [18:32] saikat: i might try that out [18:32] bradleymeck: mscdex, i consider an easy to get scriptable cookie as my only line of defense a bit scary [18:32] dylang has joined the channel [18:32] creationix: devinus: connect doesn't, but spark does [18:33] cferris: isaacs: make dev did work but i can't do a npm ls [18:33] creationix: hmm, but that's not proxied [18:33] creationix: devinus: maybe I'm thinking of something else [18:33] isaacs: cferris: you have to set the "proxy" config [18:33] isaacs: cferris: npm help config [18:33] mscdex: bradleymeck: well, websockets aren't http, so that would be why. i'm just saying that flash websockets do also support sending cookies [18:33] bradleymeck: websockets send an http request [18:33] mscdex: the same way native websockets do [18:34] mscdex: bradleymeck: it just looks like http, but it's not designed to conform to http [18:34] bradleymeck: thats like saying https isnt http cause it also upgrades [18:34] devinus: creationix: "In node-v0.1.98, the Yahoo!-contributed file descriptor passing and re-use patches landed in core and allowed the emerging set of HTTP frameworks such as Connect and multi-node to serve HTTP requests on multiple cores simultaneously with no change in application code or configuration." ? [18:34] mscdex: bradleymeck: that's according to the spec [18:34] creationix: devinus: yeah, that's part of spark [18:34] creationix: but it's not a proxy [18:34] creationix: it's better [18:34] cferris: isaacs: i'll try that. why not just use the http_proxy env var though? [18:34] devinus: creationix: where is spark? (hard to google :( ) [18:34] isaacs: ACTION shrug [18:35] creationix: devinus: when pgriess wrote that article spark was embedded within connect [18:35] bradleymeck: mscdex, in the spec it says you should be able to send all relevant cookies [18:35] bronson_ has joined the channel [18:35] creationix: devinus: http://github.com/senchalabs/spark [18:35] devinus: ahhh [18:35] isaacs: cferris: i'd kinda prefer it to be a config. it could default to process.env.http_proxy, though, i wouldn't mind. [18:35] devinus: i remember seeing this [18:35] creationix: devinus: http://howtonode.org/deploying-node-with-spark [18:35] devinus: creationix: so there's a Connect connector to spark? [18:35] devinus: ah [18:35] creationix: spark works with any node server [18:35] creationix: you just need to make a file app.js and export the server as module.exports instead of calling listen directly [18:36] ironfroggy: saikat: i just found XHRPolling._get() is failing with a 502 from my proxy. are there known issues through a proxy with xhr polling? [18:36] stepheneb has joined the channel [18:36] stepheneb has joined the channel [18:36] saikat: ironfroggy: what proxy are you using? [18:36] saikat: or do you mean [18:36] creationix: devinus: look at the examples in the spark repo [18:36] devinus: creationix: i see, so just do that with a Connect app and it's deployable through spark [18:36] ironfroggy: saikat: i have node.js sitting behind apache [18:36] saikat: client-side proxy or a reverse proxy on your server (like nginx)? [18:37] saikat: ironfroggy: i'm surprised websockets is working for you [18:37] creationix: devinus: correct [18:37] ironfroggy: saikat: its not [18:37] ironfroggy: ... [18:37] saikat: i read as much as i could about it, and as far as i can tell [18:37] saikat: none of the proxies really handle websockets well [18:37] saikat: or long-lasting connections well [18:37] ironfroggy: i am using xhr-polling because websocket is not working at all. is that why it wasnt working? [18:37] saikat: haproxy gets the closest [18:37] saikat: but a lot of people seem to have trouble with that too [18:37] ironfroggy: :-| [18:37] saikat: so socket.io [18:37] saikat: handles doing cross-domain stuff for you [18:37] saikat: what i ended up doing is [18:38] saikat: getting a second ip for my box [18:38] saikat: and setting up [18:38] ironfroggy: i have been f*$%ing around for days on this, and it was stupid apache? figures. [18:38] saikat: socket.mydomain.com on that ip [18:38] saikat: i haven't actually been using this yet so it may not work but [18:38] creationix: ironfroggy: yeah, I serve my node apps directly [18:38] creationix: no proxy [18:38] saikat: i think it has a better chance of working than behind a proxy [18:38] creationix: I just buy IPs [18:38] creationix: ironfroggy: though nginx is a better proxy than apache [18:38] ironfroggy: i can just take apache out of the picture [18:38] creationix: if you must proxy [18:38] ironfroggy: or anything really. i was using it for static media [18:38] saikat: creationix: with websockets, probably not actually =) [18:38] ironfroggy: but honestly there is almost none anyway. [18:39] saikat: nginx has no long lasting connection support i believ [18:39] ph^ has joined the channel [18:39] creationix: ironfroggy: also connect can serve most static files faster than apache or nginx anyway [18:39] ironfroggy: OR i could expose the node.js port and connect directly [18:39] creationix: it can cache in ways they can't [18:39] _announcer: Twitter: "A *very* simple asynchronous #nodejs C++ addon using eio_custom. http://github.com/isaacs/node-async-simple" -- Ⓘⓢⓐⓐⓒ. http://twitter.com/izs/status/21599151765 [18:39] saikat: ironfroggy: the problem with doing it via a different port is [18:39] saikat: most companies will block you [18:39] saikat: if you aren't on 80 or 443 [18:39] creationix: ironfroggy: my setup http://howtonode.org/deploying-node-with-spark [18:39] saikat: firewalls are liket hat [18:40] creationix: howtonode.org runs on port 80 of a dedicated IP address [18:40] saikat: creationix: i love you sidebar [18:40] ironfroggy: saikat: good point. [18:40] saikat: i have been wanting every blogpost to do that [18:40] saikat: my entire life [18:40] saikat: with the date and version of software being used [18:40] _announcer: Twitter: "I just saved my first #Mongoose model to #MongoDB using #NodeJS! For my particular use, a #MUD server, this is quite awesome." -- Tobias Sjösten. http://twitter.com/tobiassjosten/status/21599222230 [18:40] ironfroggy: I'll just remove apache and serve the static from node. [18:40] creationix: saikat: yeah, ryah requested it [18:40] ironfroggy: im compressing everything into a single file anyway. [18:40] tobiassjosten: _announcer: You're one quick bot. [18:40] creationix: saikat: and since howtonode's database is a git repo, it's easy to get revision info [18:41] saikat: nice [18:41] voxpelli has joined the channel [18:41] aheckmann has joined the channel [18:43] ironfroggy: creationix: that is really cool. building a new blog myself. well.. its kinda dead in the water so far. i might be stealing ideas. [18:43] creationix: ironfroggy: have fun, wheat isn't a framework, but ideas can be taken from it [18:44] tobiassjosten: voxpelli: Howdy. [18:44] _announcer: Twitter: "Thinking of moving over to MT's (ve) and Node.js - Any experiences?" -- Fred Spencer. http://twitter.com/anovice/status/21599452190 [18:44] visnup has joined the channel [18:44] Sembiance: Did you guys see this new node.js redis client using a new method for handling async/transactions? http://mihai.bazon.net/blog/redis-client-library-javascript-node [18:45] TangoIII has joined the channel [18:45] cferris: isaacs: still not working with proxy config set. confired my .npmrc has proxy = http://proxyhost:80 [18:45] mscdex: bradleymeck: anyhow, i'm not sure it's possible for flash websockets to send httpOnly cookies. web-socket-js currently just looks at document.cookie [18:45] isaacs: cferris: what version of npm? are you using the latest code from github? [18:45] zedas: ironfroggy: rusty nails your pants probably would hurt more than me. [18:46] ironfroggy: zedas: oh you know I'm only joking [18:46] ironfroggy: when you're around [18:46] cferris: isaacs: yep just pulled the latest tarball [18:46] matt_c has joined the channel [18:46] blogometer_ has joined the channel [18:46] zedas: ironfroggy: hehe yeah. you also know i'm only a jerk to jerks. [18:47] zedas: ironfroggy: how's things in node land btw? [18:47] ironfroggy: zedas: man... everyone's a jerk [18:47] cferris: isaacs: not a big deal as i can manually pull stuff down and do a npm link or something for now. <3 npm by the way :) [18:47] ironfroggy: zedas: well as with most problems in life, i can blame apache. [18:47] zedas: ironfroggy: on the internet they are. it removes their humanity, much like a car does. [18:48] fictorial: Sembiance: yes, but please hack/fork on my version rather than rewrite :) [18:48] ironfroggy: zedas: yeah you lost me at the last part of that. but i'm sure i agree. [18:48] ivong has joined the channel [18:48] Sembiance: fictorial: I didn't write that, I just found the blog post today and thought it was interesting :) [18:49] _announcer: Twitter: "Nice. #nodejs http://bit.ly/aYHrvi" -- Fred Spencer. http://twitter.com/anovice/status/21599755363 [18:49] fictorial: No I know I mean if you are into it enough to do something with it, please fork -- it could be useful actually [18:49] Sembiance: fictorial: I use your redis client in my project :) [18:49] ivong has joined the channel [18:49] zedas: ironfroggy: hehe, you know how people are asshats when they drive, as if they're the center of the universe? road rage, cutting people off. same thing with the internet. [18:50] zedas: ironfroggy: anyway, off-topic. [18:50] Sembiance: fictorial: well, plus the kick ass awesome 'Step' to make things far less painful http://github.com/creationix/step [18:50] ironfroggy: zedas: i agree even more now that the last part is explained then. but yes, moving on. [18:50] overra has joined the channel [18:50] christophsturm has joined the channel [18:51] jakehow has joined the channel [18:51] creationix: Sembiance: :) [18:51] fictorial: Sembiance: yeah I used "Flow" in NodeRed - it made things easier indeed. [18:52] TommyM has joined the channel [18:52] c4milo has joined the channel [18:53] Sembiance: creationix: without 'step' my code would be an absolute nightmare to read and maintain. [18:54] creationix: Sembiance: I try to write libraries with no dependencies, but lately I've been giving in and making Step a requirement [18:54] nerdEd has joined the channel [18:54] creationix: I'm sure someone can write a better library, but we can all agree that something like step is very useful [18:54] bradleymeck: lol i wrapped step into a generic generator and i use that a lot [18:55] creationix: bradleymeck: generator? please share [18:55] bradleymeck: ACTION digs [18:56] n3v3le has joined the channel [18:56] bmavity has joined the channel [18:56] Sembiance: creationix: I thought I remember you saying something a few months ago that it can't get much more ellegant than step, due to some limitations you mentioned. Or maybe I read that on some blog somewhere... [18:57] creationix: I wasn't able to find anything more elegant, but that doesn't mean it doesn't exist [18:57] creationix: and I've tried, I wrote 5 articles on howtonode and released 4 libraries [18:57] creationix: it's a hard problem [18:58] ivong has joined the channel [18:58] SamuraiJack has joined the channel [18:58] joshbuddy has joined the channel [18:58] Sembiance: creationix: so far your solution is the best I've seen. The blog post I read today (http://mihai.bazon.net/blog/redis-client-library-javascript-node) raised one of my eyebrows though. Have you heard of his technique before? Can you imagine if it would help make anything more elegant? [18:59] bradleymeck: god i write hideous code, any who looking at it, it just caches the parts of a step in a closure, and then lets you do: var generic=Stepper(foo,bar);generic(whenDone); , makes it a bit easier to work w/ boilerplate [18:59] nerdEd_ has joined the channel [18:59] creationix: bradleymeck: oh, sort of like isaacs thing [19:00] bradleymeck: ? [19:00] ivong_ has joined the channel [19:00] isaacs: creationix: hey, i don't write hideous code! [19:00] bradleymeck: oh god, continuation style [19:00] isaacs: :) [19:00] bradleymeck: i do! [19:01] creationix: isaacs: I can't find your code at the moment [19:01] creationix: your function chaining thig [19:01] isaacs: creationix: http://github.com/isaacs/npm/blob/master/lib/utils/chain.js [19:01] creationix: Sembiance: I'm pretty sure throw and catch has horrible performance [19:01] mtodd has joined the channel [19:01] creationix: isaacs: yeah, that's the one [19:02] bradleymeck: continuation style leads to some interesting uses, but i find it to cause people to not separate out logic, and then i see walls of text. then again ppl who always nest kinda end up w/ same problem as that [19:02] isaacs: creationix: a lot of times, though, i just have a named lambda that i call repeatedly until a list is empty, or a counter that calls the cb when it's down to zero [19:02] isaacs: serial is harder to do elegantly than parallel [19:02] jchris has joined the channel [19:03] Sembiance: creationix: ahh, you should comment about that on his blog post! [19:03] creationix: Sembiance: though the idea is very interesting [19:03] creationix: I'b be interested to know if it's really slow [19:03] bradleymeck: its slow cause of the catch not the throw sadly [19:03] eggsby has joined the channel [19:03] jetienne: mape: what is the url for your monitor stuff ? [19:03] ollie has joined the channel [19:03] mape: jetienne: http://node-monitoring.mape.me/ [19:04] saikat: creationix: i thought there was a discussion about it on the nodejs thread a while back where it turned out not to really improve performance much [19:04] eggsby: hey guys, what's the best way for a noob to learn node.js? [19:04] saikat: his method of tail call optimization [19:04] devinus: anybody know of FSEvents bindings for node out there? [19:04] bradleymeck: well it can, but you can do it manually too [19:05] devinus: eggsby: i just read api.markdown myself [19:05] bradleymeck: eggsby, try to make a project [19:05] creationix: eggsby: howtonode.org ;) [19:05] creationix: but yeah, writing code and asking questions is the best [19:06] Sembiance: eggsby: I'd search google for 'node tutorial' :) [19:06] creationix: and I'm writing a node book, but it's a ways out [19:06] eggsby: yeah found a few was just wondering what you guys would suggest [19:07] eggsby: figure i'll make my next toy project with node... you guys suggest express or grasshopper? [19:07] saikat: Sembiance: creationix http://groups.google.com/group/nodejs/browse_thread/thread/64d33364e550c57d/7111b2b716c27a76?lnk=gst&q=redis+continuation#7111b2b716c27a76 [19:07] eggsby: or is it all just whatever personal preference is? [19:07] eggsby: also sembiance I feel like i've seen you in other chans :p [19:07] Sembiance: eggsby: I idle on 9 channels :) [19:08] eggsby: django maybe? hmm [19:08] ivong has joined the channel [19:08] _announcer: Twitter: "version 0.0.7 of #node.js #mysql #native binding is out http://github.com/Sannis/node-mysql-libmysqlclient" -- Kreeti. http://twitter.com/kreetitech/status/21600885118 [19:08] devinus: anyway, anybody know of FSEvents bindings for node? [19:08] eggsby: well thanks guys, i'll use howtonode :D [19:09] creationix: eggsby: I'd recommend connect or express, but of course I'm biased there [19:10] aurynn: jsgi looked interesting to me [19:12] ivong_ has joined the channel [19:14] rauchg_ has joined the channel [19:17] admc has joined the channel [19:18] eggsby has left the channel [19:19] bradleymeck: jsgi vs connect, GO! [19:20] creationix: bradleymeck: meh, not today [19:20] c4milo: devinus: do you need something specific that fs module doesn't provide ? [19:20] twoism has joined the channel [19:21] bradleymeck: fair enough, its been done to the ground [19:21] devinus: c4milo: yeah, unfortunately... [19:21] devinus: i need to monitor a directory [19:21] devinus: for new files [19:21] devinus: file changes [19:21] devinus: etc [19:21] wllm has joined the channel [19:22] bradleymeck: is there a raw file system event for that even? [19:22] creationix: devinus: I think node just polls the directory [19:22] creationix: bradleymeck: yeah FSEvents [19:23] creationix: it would be great is node used FSEvents for it's watchFile implementation [19:23] creationix: I think we already use inotify for linux [19:23] c4milo: creationix: why not kqueue ? [19:24] creationix: I don't think kqueue provides that [19:24] c4milo: in fact FSEvents use kqueue behind [19:24] creationix: really? [19:24] creationix: though node recently added kqueue support for osx [19:24] creationix: so maybe it works better now [19:24] c4milo: if I didnt' read well the last time I guess yes [19:24] nj_dancer has joined the channel [19:27] creationix: devinus: try fs.watchFile, see if it works now [19:27] c4milo: File system events are intended to provide notification of changes with directory-level granularity. For most purposes, this is sufficient. In some cases, however, you may need to receive notifications with finer granularity. For example, you might need to monitor only changes made to a single file. For that purpose, the kernel queue (kqueue) notification system is more appropriate. [19:27] c4milo: If you are monitoring a large hierarchy of content, you should use file system events instead, however, because kernel queues are somewhat more complex than kernel events, and can be more resource intensive because of the additional user-kernel communication involved [19:27] c4milo: http://developer.apple.com/mac/library/documentation/Darwin/Conceptual/FSEvents_ProgGuide/KernelQueues/KernelQueues.html#//apple_ref/doc/uid/TP40005289-CH5-SW2 [19:27] creationix: c4milo: that makes sense [19:27] c4milo: I was wrong [19:27] c4milo: fsevents use another system [19:29] ajpiano has joined the channel [19:30] wattz: sometimes i just code witha serious fury when listening to Frank Sinatra. [19:32] c4milo: devinus: it must be on osx ? you can use http://github.com/c4milo/node-inotify if there is some way to move to linux [19:34] twoism has joined the channel [19:34] loinclot_ has joined the channel [19:35] loinclot_ has joined the channel [19:35] jon_ has joined the channel [19:36] mape: ryah: ping [19:39] teemow has joined the channel [19:40] jsilver has joined the channel [19:46] sveisvei has joined the channel [19:48] programble has joined the channel [19:48] creationix: ryah: I don't understand your FastBuffer code [19:49] creationix: ryah: are you just reusing parts of a large buffer? [19:49] mape: creationix: think he just makes one big since it is expensive to make lots of small ones [19:50] creationix: mape: I want to do some sort of buffer pool, but I need to work with existing node apis [19:50] creationix: and I can't use a FastBuffer as a drop-in replacement since it's api is different [19:50] creationix: maybe I just need a freelist [19:51] creationix: mape: interesting how he doesn't ever reuse buffers, just lets the reference die [19:52] twoism has joined the channel [19:52] mape: Black magic [19:52] mape: Death and creation [19:53] creationix: oh I wish I could use this idea, it's pretty neat [19:53] creationix: but I'm passing my buffers to fs.write and fs.read [19:53] creationix: they need real buffers [19:53] mape: ryah: finger ryah@mape.me should work now, if people do !github http://github.com/mape it is added to their profile [19:54] matt_c: !github http://github.com/mcroydon [19:54] mape: After a little while (the logs are generated) [19:54] dmcquay has joined the channel [19:54] _announcer: Twitter: "#javascript #nodejs in case you missed it, Yammer is looking for Javascript mofos - http://bit.ly/cwkuhf - you definitely want to check it!" -- Steve Davie. http://twitter.com/stevendavie/status/21603559545 [19:54] c4milo: mape: what is that ? [19:55] mattly has joined the channel [19:55] mape: c4milo: allows you to finger people [19:55] creationix: !github http://github.com/creationix [19:55] creationix: mape: like that? [19:55] c4milo: !github http://github.com/c4milo [19:55] mape: Jup [19:55] bmavity has joined the channel [19:56] creationix: something not quite right about "finger" and "mape me" [19:56] mape: It is all in good taste [19:56] creationix: :) [19:56] mape: if you finger me you should see a github repo [19:57] creationix: yep [19:57] dmcquay has joined the channel [19:57] c4milo: !github http://github.com/mape [19:57] mape: sure [19:57] creationix: mape: btw, how does it count "thanks" [19:58] c4milo: !where is mape [19:58] mape: Well you just gave one to me now [19:58] MrTopf has joined the channel [19:58] siculars has joined the channel [19:58] creationix: mape: so when someone just says the word "thanks" and it's directed at them? [19:58] creationix: (have another ;) [19:58] mape: creationix: A string that starts with.*?: and has matching [19:58] mape: yeah [19:58] mape: Exactly [19:58] creationix: neat [19:59] mape: Not sure if I should do the activity graph on the other axis [20:00] jakehow has joined the channel [20:03] devinus: c4milo: indeed, it must be OS X [20:03] devinus: :( [20:03] drudge: !github http://github.com/drudge [20:03] mscdex: invalid command! [20:04] drudge: you are. [20:04] mscdex: NOU [20:04] c4milo: devinus: do you have a github account ? [20:04] wattz: why is jquery.ui so big. [20:04] devinus: c4milo: http://gthib.com/devinus [20:04] devinus: oops [20:04] devinus: github.com/devinus [20:05] c4milo: wattz: you can use ui.core and to write your own widgets [20:05] c4milo: :P [20:05] mape: Hmm no way to finger using another port? [20:05] wattz: i have a ui core here we use [20:05] MattJ has joined the channel [20:05] wattz: don't want to write draggable. [20:05] wattz: pita. [20:05] mape: wattz: build a custom? [20:06] wattz: it's custom ui/js framework we use here at work [20:06] wattz: pretty framework agnostic [20:08] stepheneb has joined the channel [20:11] c4milo: devinus: it's easy for you to write kqueue bindings, go ahead it will take you 3 o 4 days [20:12] _announcer: Twitter: "Want to finger #nodejs users in the IRC channel? Well now you can, example: finger mape@nodejs.se" -- Mathias Pettersson. http://twitter.com/mape/status/21604567281 [20:12] c4milo: finger mape [20:12] c4milo: finger camilo@cloudescape.com [20:12] c4milo: finger mape@nodejs.se [20:13] sh1mmer has joined the channel [20:13] daniellindsley: c4milo: You need to be at a shell. [20:13] c4milo: ahhh [20:13] ryah: mape: great:) [20:13] c4milo: I thought it was a bot [20:13] c4milo: here [20:14] mape: It just gathers data here [20:14] ollie has joined the channel [20:15] devinus: ryah's first message: wow. there are a million people here [20:15] devinus: lol [20:15] mape: ryah: Your old nick is merged so it counts towards the same stats as ryah [20:16] charlesjolley-_ has joined the channel [20:16] Astro: !github http://github.com/astro [20:16] codemariner_ has joined the channel [20:16] devinus: creationix: spark's fucking awesome [20:16] devinus: going to try to wrap it [20:17] creationix: devinus: cool [20:17] devinus: (so i dont have to use the command) [20:17] aheckmann: !github http://github.com/aheckmann [20:18] EyePulp: ACTION fingers himself [20:18] EyePulp: oy [20:18] mape: EyePulp: Only does the top 500 people as of now [20:18] mape: Or sorry, people who have more then 500 lines in chat [20:19] EyePulp: mape: gothca [20:19] EyePulp: ... "gotcha" [20:21] dylang has joined the channel [20:22] JimBastard: im top 500 wooohooo [20:22] JimBastard: !github fuuuuuuuuuuuuuu [20:23] nerdEd has joined the channel [20:24] mattikus has joined the channel [20:24] tpryme has joined the channel [20:24] mattikus has joined the channel [20:31] eazyigz has joined the channel [20:31] _announcer: Twitter: "@ Edgarparada node.js anytime I show you, that you as the cool kids sv" [es] -- Loki Zavala. http://twitter.com/Siedrix/status/21605668481 [20:32] eazyigz: is it a good ideas to use .exec to read/write data to redis with every request [20:32] eazyigz: also, I need to retrieve data from redis and pass it as an argument to my ruby script [20:32] eazyigz: can I execute a new child process every time? [20:32] TooTallNate has joined the channel [20:34] TooTallNate: Don't mean to sound like a pest, but has anyone had a change to look at the HTTP parsing issue I'm experiencing? http://github.com/ry/node/issues#issue/242 [20:35] stepheneb has joined the channel [20:36] _announcer: Twitter: "@LiquidWeb can install node.js on a shared server?" -- Matthew Conover. http://twitter.com/matthewconover/status/21605974441 [20:37] mape: eazyigz: isn't there a redis client for node? [20:39] JimBastard: indexzero is soo mad at the HTTPS support for DELETE, they he is implementing our SSL DELETE method via sys.exec and curl [20:39] JimBastard: fucking shit [20:41] JimBastard: is anyone else doing ssl stuff? [20:41] jsilver has joined the channel [20:41] JimBastard: aside from GET and POST [20:42] eazyigz: mape: I've banged my head with this redis-client, and its mehod calls and syntax are so convoluted that I couldn't figure out shit [20:42] mape: hmm k [20:42] mape: thought it was pretty one to one [20:42] bradleymeck: you are doing curl for ssl? [20:42] eazyigz: it serualizes and deserializes binary data, and then it forces you to use some other methods to extract values from the stored objects [20:43] creationix: buffer pool? http://gist.github.com/538862 [20:43] eazyigz: whereas redis commands by themselves are incredibly short and easy [20:43] JimBastard: bradleymeck: yep [20:43] JimBastard: we got all the methods working over ssl using http.Client except DELETE [20:43] eazyigz: so i'd rather do .exec to call redis directly, instead of using some other client [20:43] JimBastard: its busted [20:43] bradleymeck: odd, can you track down the error msg / stack trace? [20:44] JimBastard: you can message him if you want, im outside the exact loop [20:44] JimBastard: i think he's posted to the mailing list [20:44] daleharvey has joined the channel [20:45] JimBastard: bradleymeck: Charlie: no, you see, it doesn't throw what happens is I get 503 but the request actually goes through it's so hectic I don't even know what's going on [20:45] JimBastard: ACTION summons indexzero [20:46] indexzero has joined the channel [20:46] JimBastard: works everytime [20:46] TooTallNate: haha [20:47] bradleymeck: so a 503... [20:48] bradleymeck: aaaah, old thread resurrection [20:48] JimBastard: im sure indexzero doesnt want to waste too much time on this anymore, but if there is an issue, it should at least get reported [20:48] devinus: creationix: do you have an example of using connect's gzip middleware? [20:48] indexzero: one second on the phone [20:48] creationix: devinus: Connect.gzip() [20:48] devinus: creationix: right, i now that half [20:48] creationix: I usually put it right behind Connect.cache() [20:49] devinus: right behind? [20:49] devinus: where i use it is where im confused [20:49] creationix: yeah, the order matters [20:49] creationix: requests come in the top and go down [20:49] bradleymeck: anyone here using webworkers client side? [20:49] creationix: and then bounce back on the way out for responses [20:49] devinus: creationix: so the 3rd argument to gzip is the callback? [20:49] creationix: devinus: sortof [20:50] creationix: devinus: it's used by connect to know when it's safe to call the next layer [20:50] creationix: devinus: http://howtonode.org/connect-it [20:51] devinus: creationix: http://pastie.org/1102924 ? [20:52] devinus: no that can't be right [20:52] TooTallNate: you add a second parameter that's a function after the connect.gzip() [20:52] devinus: i think i get it now [20:53] TooTallNate: connect.gzip() doesn't need any arguments [20:54] sveimac has joined the channel [20:55] zomgbie has joined the channel [20:56] stepheneb has joined the channel [20:57] tmpvar has joined the channel [20:58] isaacs has joined the channel [21:00] zemanel has joined the channel [21:00] _announcer: Twitter: "Remember... St.Louis Node.js Meetup is tonight at 6pm! :) http://bit.ly/cmQKSy" -- jamescarr. http://twitter.com/jamescarr/status/21607379893 [21:00] creationix: devinus: yeah, what he said [21:04] javajunky has joined the channel [21:04] sudoer has joined the channel [21:05] admc has joined the channel [21:06] aliudalius has joined the channel [21:06] feydr has joined the channel [21:09] isaacs: ryah: node-glob works on Solaris afaict [21:09] tobiassjosten: Anyone using mongoose in an open source project? I want to see how you use its models in your Node.js modules. [21:10] _announcer: Twitter: "@jamescarr I'm looking forward to the St. Louis Node.js Meetup." -- cryptic swarm. http://twitter.com/CrypticSwarm/status/21607988840 [21:11] _announcer: Twitter: "Change(b)log: Benchmarking Node.js - basic performance tests against Apache + PHP: http://bit.ly/crAjoW" -- Maciej Zgadzaj. http://twitter.com/maciejzgadzaj/status/21608038109 [21:11] felixge has joined the channel [21:11] felixge has joined the channel [21:11] Validatorian has joined the channel [21:12] ThePub has joined the channel [21:12] digitalspaghetti: should a connect middleware work out the box for express ? [21:13] c4milo: I think I will use tiki as my module system, I can't share code between server and client with the poor nodejs module system [21:14] JimBastard: good luck with that c4milo [21:14] _announcer: Twitter: "Node.JS of course! @baub: @rauchg learnboost.com is a beauty! What stack are you using?" -- Guillermo Rauch. http://twitter.com/rauchg/status/21608230957 [21:14] c4milo: JimBastard: are you using it ? [21:14] JimBastard: no [21:15] _announcer: Twitter: "i guess i have to develop a twitter -> urlgrabber -> delicious tool by myself. good start for a small #nodejs / #mogodb project" -- Soenke Ruempler. http://twitter.com/s0enke/status/21608295435 [21:15] _announcer: Twitter: "irrespective of the purported expressive felicity of sharing a language on client and server, isn't there a nice social benefit? #nodejs" -- hellomatty. http://twitter.com/hellomatty/status/21608324293 [21:17] JimBastard: c4milo: ive done deep into the dual-sided rabbit hole [21:17] JimBastard: dove* [21:17] JimBastard: just man up and wrap your shit in a closure [21:17] c4milo: hehehe [21:18] JimBastard: http://github.com/Marak/asciimo/blob/master/lib/asciimo.js#L29 [21:19] c4milo: jum interesting approach but I little hacky [21:19] JimBastard: c4milo: and how do you think the library works [21:20] c4milo: what library ? [21:20] JimBastard: tiki [21:21] mscdex: is there a reverse proxy in node that handles both http and https? [21:21] JimBastard: mscdex: does ours not handle https? [21:22] mscdex: i don't know, does it not? [21:22] JimBastard: http://github.com/nodejitsu/node-http-proxy [21:22] JimBastard: i dont think it was explicitly added, but it could be [21:22] JimBastard: i actually have someone im'ing me right now asking a similiar question about keep-alive [21:22] JimBastard: indexzero: ? [21:22] indexzero: jimbastard: still phone [21:23] mr_daniel has joined the channel [21:23] hellp has joined the channel [21:23] twoism has joined the channel [21:25] JimBastard: but yeah, mscdex we are going to need https support 100% [21:25] mscdex: me too, before i can use it [21:25] JimBastard: so ill definitely add it [21:25] JimBastard: mscdex: if you have an immediate need, a patch would be very welcome. i dont think it would be too hard to do [21:26] mscdex: no immediate need [21:26] mu-hannibal_ has joined the channel [21:26] mscdex: but the sooner the better [21:26] herbySk: creationix: http://github.com/herby/nstore/commits/rewrite [21:26] mscdex: of course [21:27] mscdex: i still don't quite understand how node is able to cope with websocket requests/connections and haproxy isn't [21:28] bradleymeck: lack of upgrade support is the only thing i can think of [21:28] creationix: herbySk: neat [21:28] creationix: herbySk: mind if I steal ideas [21:28] creationix: ? [21:29] mscdex: bradleymeck: here was the mailing list thread i was referring to earlier about http breakage: http://www.mail-archive.com/haproxy@formilux.org/msg03067.html [21:29] creationix: herbySk: what's "self.activity ^ 1"? [21:29] herbySk: creationix: It's fork of nstore, I think you can even merge (unless you started your own new version of index, which I call MdStore here) [21:29] herbySk: xor [21:30] creationix: yeah, but what's it doing [21:30] creationix: oh, flipping the bit [21:30] creationix: you only have to items [21:30] creationix: *two [21:30] herbySk: flips last bit, so the is 1 if 0 or 0 if 1 [21:30] bradleymeck: idk, i think the websocket modules that hijack the webservers would have to be built around haproxy :/ might be outta the project scope [21:31] herbySk: creationix: it means "the other side, the one which is not active now" [21:31] herbySk: (the snapshot, in other words) [21:31] creationix: herbySk: yeah, I get it now [21:31] creationix: I still don't understand how you can only have two versions [21:33] herbySk: one is currently active, the other is holding a snapshot in time of call of mdStore.snapshot() and items should be written to disk and each of them should be close()d. [21:33] herbySk: Then, you can call new snapshot() and roles switch. [21:33] creationix: ok, so a flipping queue like we did for arrays [21:33] herbySk: It is designed with "only one snapshot is needed at a time" [21:34] herbySk: exactly [21:35] herbySk: creationix: btw, I think writeQueue is not needed - it should be MdStore's responsibility to enumerate through all dirty snapshotted elements, I think. It has all the knowledge (or can have), no need to queue thing by yourself. [21:35] creationix: possibly, I'd like to get rid of writeQueue [21:35] creationix: and have easy writeCombining [21:36] _announcer: Twitter: "I consider fighting against node.js. Amongst my weaponry are such diverse elements as: Thin, Cramp, EM, em-synchrony, surprise and fear." -- Fronx. http://twitter.com/fronx/status/21609599451 [21:36] herbySk: But it is another stage... for now, it looks like usable thing, but you must be careful enough to close() all elements before new snapshot() or you get pretty mess [21:36] indexzero: ok, off the phone [21:36] creationix: herbySk: looks like you [21:36] creationix: you're putting keys directly on the MDStore object [21:36] wattz: is there anything other than a perl script out there to generate jsdoc? [21:37] creationix: that's going to collide with "length" and "activity" right? [21:37] indexzero: ACTION was making moves for super fast Internet at General Assembly: www.generalassemb.ly [21:37] herbySk: creationix: ??? I don't put things there directly, there's API: newElementAt(key) for creation and elem.value = null for (eventual) deletion by close() [21:38] indexzero: bradleymeck: You around? [21:38] bradleymeck: ya [21:38] indexzero: JimBastard was saying you wanted to hear more about my crazy ssl problem [21:38] bradleymeck: i hear its a 503 on any DELETE? [21:39] indexzero: yeah [21:39] streampunk: indexzero: I was just looking at proxying SSL on my project too so let me know if you guys dig anything up. [21:39] indexzero: I've got the curl working [21:39] indexzero: but when I do the request in node with the exact same headers, etc I get 503 [21:39] indexzero: but the crazy thing is the request still goes through [21:39] indexzero: this is all for my node-cloudservers client [21:39] indexzero: http://github.com/nodejitsu/node-cloudservers [21:40] indexzero: so I request to delete a server, get a 503, but the server still gets deleted [21:40] streampunk: Odd. [21:40] indexzero: I'm literally about to exec the curl call via child_process, lol [21:41] creationix: herbySk: http://github.com/herby/nstore/blob/473526f6ef81122d3a4ec88326ab80fc56602ddc/lib/metadata.js#L36 [21:41] nerdEd has joined the channel [21:41] JimBastard: every http request should be GET, all response codes should be 200. case closed. [21:41] JimBastard: >.< [21:41] creationix: isn't "this" there the same as "self" in the constructor [21:41] astrolin has joined the channel [21:41] indexzero: JimBastard but the whole point of REST is to use additional HTTP verbs no? [21:42] herbySk: creationix: btw I have no problem with refactoring length to return Object.keys().length... it just happened this way, cause it was developed pure TDD [21:42] JimBastard: indexzero: sarcastic sarcasm is unsuccessful ? [21:42] creationix: yeah, I don't use length much anyway, it's not a big deal [21:42] bradleymeck has joined the channel [21:42] indexzero: JimBastard: Yes, very unsuccessful [21:42] indexzero: bradleymeck: You back? [21:43] bradleymeck: ugg just got a kernel panic outta node, ctrl+c on a repl i left open for a couple days [21:43] herbySk: creationix: what's the problem with L36? [21:43] marshall_law has joined the channel [21:44] creationix: herbySk: well, "in" is slower than this.hasOwnProperty(key), but I was talking more about line 38 where you do this[key] = ... [21:44] creationix: this is the MdStore instance itself right? [21:44] creationix: so this["activity"] would collide [21:45] herbySk: creationix: yes, it will... You're right... [21:46] javajunky has joined the channel [21:46] creationix: herbySk: but that's easy to fix, just have a .data or .index property [21:46] _announcer: Twitter: "wow Logic-less templates using mustache..js within node.js - nerdvana" -- rb ocallaghan. http://twitter.com/robocallaghan/status/21610263430 [21:47] herbySk: creationix: or going more closure way... yes, it is. I should add a test for these two indexes... [21:47] indexzero: bradleymeck: Any ideas on this ssl thing? [21:47] bradleymeck: im looking [21:47] eazyigz has joined the channel [21:47] indexzero: cool, thanks man [21:48] herbySk: creationix: (well, data or index property would collide with 'data' or 'index' :-) ) [21:48] herbySk: creatonix: no, sorry, mistake [21:48] creationix: herbySk: My biggest performance bottleneck is serializing and deserialiing data [21:49] creationix: new Buffer(JSON.stringify(obj)) is very expensive [21:49] pquerna: oh more ab benchmarks :x [21:49] creationix: but I don't want all my current values in ram, and certainly not all history of values [21:50] mscdex: heh... love reading the back-and-forth on that websocket thread [21:50] creationix: pquerna: but ab is so easy, and it's "apache" so it's solid ;) [21:51] pquerna: creationix: sure, and probally over localhost too. [21:51] creationix: pquerna: heh, I can make ab + node over localhost serve 12 gigabit/sec [21:52] creationix: ab ends up eating up about as much cpu as node itself [21:52] pquerna: yes. [21:52] _announcer: Twitter: "Going to miss StL NodeJS meetup. Heading home to teach my kids some Ruby instead for #whyday" -- Mario Aquino. http://twitter.com/MarioAquino/status/21610640442 [21:53] pquerna: flood + half dozen remote machines + nice networking gear. [21:53] pquerna: and less hello world apps [21:53] pquerna: but anyways [21:53] bradleymeck: indexzero, nothing stands out, ill try some local testing [21:53] creationix: I would love a proper test lan [21:53] indexzero: yeah, I can give you some sample code privately, it all has my rackspace api keys in it [21:54] herbySk: creationix: well, you can at least hope it will get faster, it's hardcoded in v8, anyway, so it is possibly faster than previous JSON libraries written in js [21:54] brandon_beacher has joined the channel [21:54] creationix: herbySk: I'm trying to figure out a proper pooling/caching technique that will help [21:55] brandon_beacher has left the channel [21:55] mattly has joined the channel [21:56] andrerom has joined the channel [21:56] ryan_gahl has joined the channel [21:56] zemanel has joined the channel [21:57] joshholt_ has joined the channel [21:57] andrerom: Does node.js support keep-alive yet for http server? (did not see any difference with "ab -k", but that is maybe http 1.0?) [21:59] joshholt_: quick question or statement --> It seems that node is unable to parse or at least yield access to HTTPOnly cookies in the 'set-cookie' header when receiving a response from an http.clientResponse [21:59] stride: andrerom: yep [21:59] mscdex: andrerom: yes. the underlying request's net.Stream supports it: http://nodejs.org/api.html#stream-setkeepalive-236 [22:01] joshholt_: the unfortunate thing here is that I ran into this issue when trying to proxy request to a box requiring a .ASPXAUTH token... [22:01] joshholt_: which happens to be and HTTPOnly cookie... [22:01] MikhX has joined the channel [22:02] bradleymeck: joshholt_ from the raw headers? [22:02] joshholt_: it also seems that if the response has multiple 'set-cookie' headers the headers that we have access to will only contain one 'set-cookie' header [22:03] bradleymeck: yup [22:03] joshholt_: bradleymeck: do we have access to the raw headers? [22:03] _announcer: Twitter: "Dear People Writing Libraries for Node.js - WRITE PROPER ERROR HANDLING FOR YOUR MODULES IT REALLY ISN" -- Alan Cohen. http://twitter.com/LibrarySpeak/status/21611295485 [22:03] SubStack: pfft [22:03] SubStack: error handling [22:03] SubStack: I'll get around to that eventually [22:04] digitalspaghetti: with fs, what would be the equivilent of touch? [22:04] digitalspaghetti: i.e. just create an empty file [22:04] _announcer: Twitter: "@sbartholomew not played with clouddb and node,js for a while - its gone stela! And is perfect for a hackathon I'm working on :-)" -- rb ocallaghan. http://twitter.com/robocallaghan/status/21611385199 [22:05] creationix: digitalspaghetti: open and close [22:05] TooTallNate has joined the channel [22:05] maushu: Error handling? Wutz dat. [22:05] stride: something non-klingons do maushu [22:05] maushu: Oh oki. [22:05] stride: weaklings.. :> [22:05] robrighter has joined the channel [22:06] maushu: What about chaos marines? [22:06] bradleymeck: mmm i see the error for set-cookie [22:07] joshholt_: make sense... ? [22:07] bradleymeck: yea, just trying to think of elegant solution since its in node internals :/ [22:08] _announcer: Twitter: "#nodejs is so freakin' cool - but the modules make it super powerful http://bit.ly/a7Ot48" -- Ragi Y. Burhum. http://twitter.com/rburhum/status/21611609771 [22:08] joshholt_: I have a response that comes back like this { 'set-cookie': 'some-data'; 'set-cookie': 'some-more-data' } etc... and we get { 'set-cookie': 'some-more-data' } b/c it's the last value for that key... [22:08] bradleymeck: yes [22:08] joshholt_: so instead of appending it is overwritting [22:09] joshholt_: hmm.. do you think it would be wise to just concat or present the value of the header as an array [22:09] bradleymeck: i know, but trying to figure out the right way to do this, since set-cookies are not meant for duplication within a single string (cant set 2), im wondering that [22:09] sonnym has joined the channel [22:09] _announcer: Twitter: "@paulwpagel Be a good student and do your homework! That or you'll burn in node.js hell!" -- Enrique Comba R.. http://twitter.com/ecomba/status/21611702595 [22:09] joshholt_: ah, that's right... [22:11] joshholt_: makes sense now... that's why I'm missing the token... b/c it's the not the last 'set-cookie' [22:11] bradleymeck: ryah: set-cookie headers that occur multiple times, should we patch it to have the header be an array on the request object, or do some funky string concat? [22:11] Tobsn: how works that tweet stuff again [22:11] Tobsn: is it !tweet? [22:12] _announcer: Twitter: "@maciejzgadzaj nice article. I'd love to see how #nodejs stacks up against Apache + PHP + (opcode caching) - (mod_php) = high perf setup" -- Dionysios Synodinos. http://twitter.com/synodinos/status/21611867459 [22:12] bradleymeck: we dont have a tweet bot up righ tnow [22:12] bradleymeck: but yes [22:12] Tobsn: :/ [22:12] Tobsn: !tweet @LibrarySpeak YES YOU'RE RIGHT, IT REALLY ISN! [22:12] Tobsn: :( [22:12] Tobsn: http://twitter.com/LibrarySpeak/status/21611295485 [22:12] Tobsn: if you missed it. [22:12] Dmitry1 has joined the channel [22:13] eazyigz has joined the channel [22:14] andrerom: mscdex: so how do I set that on the http server / response? [22:14] andrerom: (keep-alive) [22:15] joshholt_: bradleymeck: I guess it's best to submit this as a bug on github ?? [22:15] bradleymeck: yea [22:15] bradleymeck: require('http').IncomingMessage.prototype._addHeaderLine is the perp [22:15] stride: bradleymeck: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 4th paragraph [22:16] tilgovi has joined the channel [22:16] bradleymeck: stride how would that work on a set-cookie though w/ expires [22:16] nerdEd has joined the channel [22:16] bradleymeck: the string uses ,s [22:17] andrerom: stride: anything I need to set in code? [22:19] joshholt_: bradleymeck: ok submitted here http://github.com/ry/node/issues/issue/245 [22:19] ezmobius has joined the channel [22:20] mscdex: andrerom: request.connection.setKeepAlive [22:21] herbySk: creationix: ok, nameclashses solved. [22:21] creationix: herbySk: cool [22:21] mscdex: andrerom: where request is an instance of http.ServerRequest [22:21] bradleymeck: var old=IncomingMessage.prototype._addHeaderLine; IncomingMessage.prototype._addHeaderLine = function (field, value) {if(field=='set-cookie'&&this.headers['set-cookie']){this.headers['set-cookir']+=','+value} else old.apply(this,arguments)} [22:21] creationix: herbySk: I'm working on trying a cache plugin [22:22] stride: bradleymeck: don't know, set-cookie rule format is weird [22:22] bradleymeck: ^should be a temp patch according to the http spec, not sure in practice [22:22] stride: it uses ; which is a comment in rfc822 and stuff [22:22] stephenlb has joined the channel [22:22] bradleymeck: s/set-cookir/set-cookie [22:22] mscdex: andrerom: the actual call should be something like: request.connection.setKeepAlive(true); at the very least [22:22] stride: iirc most systems just send out multiple set-cookie lines [22:23] bradleymeck: i know i implemented the full cookie spec for cookiejar and it never said comma separated [22:23] mscdex: comma separated is not widely supported at all [22:23] mscdex: i think only one browser supports it or something [22:23] joshholt_: ok.. I will give that a try on my end.... as a work around... you can use semicolons [22:23] joshholt_: to seperate [22:24] joshholt_: ah, I see stride said that already [22:24] joshholt_: my bad [22:25] huyhong has joined the channel [22:25] mscdex: safari is the only one that supports multiple comma-separated Set-Cookie pairs [22:25] bradleymeck: the cookie format is a PITA to parse as is, a full date parser!? really!? [22:25] huyhong has left the channel [22:26] stride: ack, real mess there [22:26] mscdex: this page has some nice compatibility information here [22:26] andrerom: mscdex: thanks, at least it works now using request.connection.setKeepAlive( true, 500 ); before request.end(); [22:26] andrerom: mscdex: Still not faster using ab -k though [22:26] stride: andrerom: huh? doesn't http.Server do that automagically when the client indicates to do so? [22:27] mscdex: http://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_cookies [22:27] andrerom: stride: maybe, I just don't see any difference under ab, as opposed to how apache behaves with "-k" [22:28] creationix: andrerom: fwiw, I see a huge difference using the -k flag with connect apps [22:28] creationix: serving static files [22:28] andrerom: creationix: using "net" then or? [22:28] creationix: adamholt: http.Server [22:29] mscdex: heh [22:29] andrerom: mscdex: cookie? [22:29] creationix: andrerom: oops, that was for you [22:29] mscdex: andrerom: that link was for bradleymeck/stride/anyone else interested [22:29] mscdex: :-) [22:29] andrerom: creationix: :) [22:29] andrerom: aha :) [22:29] andrerom: ird #fail :) [22:30] andrerom: or me, same same [22:30] andrerom: ird -> irc [22:30] joshholt_: bradleymeck: that solves the issue [22:30] mscdex: s/ird/irc [22:30] mscdex: :-p [22:30] stride: mscdex: nice read, thanks [22:30] joshholt_: at least for the case that I 'm working on... [22:31] bradleymeck: interesting read, seems all my policies are in order so thats happy, dont quite support the comma separated set-cookie though [22:32] pgriess has joined the channel [22:32] joshholt_: oh, I did change the comma to a semicolon [22:33] stride: bradleymeck: btw, are you sure IncomingMessage.prototype._addHeaderLine would have been the right place? that's for processing the incoming headers from the client as far as I see [22:33] _announcer: Twitter: "@bgrainger Should have used Node.js... Clearly it's better. http://bit.ly/crAjoW // #statscanproveanything" -- Tom Philpot. http://twitter.com/tjphilpot/status/21613207107 [22:33] bradleymeck: stride, hes proxying a request and the incoming discarded all but the last set-cookie [22:34] stride: ah, ok [22:34] daleharvey has joined the channel [22:35] joshholt_: thanks guys [22:35] tmpvar has joined the channel [22:36] micheil has joined the channel [22:36] andrerom: creationix: re: -k flag / static files. I'm just having a simple hello world for this, so code should not be the limit [22:37] creationix: andrerom: not sure [22:37] creationix: ab seems flakey to me [22:38] andrerom: true, thanks anyway [22:38] blogometer has joined the channel [22:39] andrerom: creationix: are you serving it directly from node.js or do you use another server in between? [22:39] creationix: andrerom: yes direct [22:39] derbumi has joined the channel [22:39] andrerom: creationix: ok, thanks. will try a bit ;) [22:40] bradleymeck: wth, theres a cookie2 spec? [22:40] Blackguard has joined the channel [22:41] bradleymeck has left the channel [22:41] stride: huh, strange, yeah, apache seems to implement it [22:41] RobT has joined the channel [22:42] RobT: Hi everyone. I'm doing some web service prototyping based on node and I wonder if anyone can recommend one of the micro frameworks? [22:43] andrerom has left the channel [22:43] Tim_Smart has joined the channel [22:43] stride: RobT: I personally really like connect, don't know if there are frameworks for wsdl & co [22:44] RobT: I'm not going to be using wdsl, so that's not a problem. I'll look at connect [22:44] jMCg has joined the channel [22:50] MikhX_ has joined the channel [22:50] _announcer: Twitter: "Just deployed my first simple #node.js app on #heroku" -- Thomas Bassetto. http://twitter.com/tbassetto/status/21614306949 [22:51] blogometer: 'm using felixge Node MySQL. Does it have mute button? [22:52] blogometer: I'm using felixge Node MySQL. It emits a lot of error messages. Does it have mute button? [22:52] hpoydar has joined the channel [22:57] markwubben has joined the channel [22:58] _announcer: Twitter: "Just found out about nave for #nodejs today. I'm so out of touch :/" -- David Taylor. http://twitter.com/zensatellite/status/21614775827 [23:02] mtodd_ has joined the channel [23:03] isaacs: anyone have a pet blocking C lib that they'd like to see integrated into nodejs? i'm feeling like doing another one. this is fun. [23:03] jb55: doom [23:04] SubStack: hah isaacs has the async magic magic [23:04] mscdex: blogometer: just set a noop function as a listener for the 'error' event? [23:04] blogometer: mscdex: I found some console.log() in the source and commented those out. [23:04] blogometer: Much quieter now. [23:05] mscdex: blogometer: i don't see any console.* statements [23:05] blogometer: I installed from npm, so I think I have an earlier SHA. [23:05] mscdex: ACTION shakes a fist at outdated packages [23:06] isaacs: mscdex: you should check out bradleymeck's npm github service [23:06] mscdex: eh? [23:06] blogometer: mscdex: The price you pay for minute to minute innovation. [23:06] blogometer: isaacs: Wha chu talkin' bout Willis? [23:06] isaacs: mscdex: yeah, you set it up as a service on github, and then it publishes a new version of the package when it sees version-esque tags [23:07] isaacs: (i think that's how it works anyway, i don't use it myself) [23:07] blogometer: mscdex: Are you the node-mysql developer? [23:07] tuxsbro has joined the channel [23:07] mscdex: blogometer: nope, that's felixge [23:07] isaacs: to make it work, you have to set the service user as an owner on your package so that it can publish new versions [23:07] mscdex: blogometer: i was just looking at the latest source at github [23:08] blogometer: What do you do when you can't get your GitHub name in IRC? [23:08] blogometer: Add underbars? [23:08] isaacs: SubStack: i tried to write an addon that would run a JS function on the thread pool, but it makes the world explode. [23:08] AAA_awright: Choose a different nickname? [23:08] _bigeasy: Hello [23:08] mscdex: :S [23:08] mscdex: !seen blogometer [23:09] isaacs: SubStack: i got about an hour into it, and then realized the wisdom behind ryah's "threads are for experts. experts can write C" policy. [23:09] bigsleazy: !seen mscdex [23:09] mscdex: i've only had to use pthreads once as an undergrad [23:10] blogometer: Anyway... [23:10] mscdex: it was for a master-slave replication system [23:10] mscdex: heh [23:11] mscdex: semaphores galore [23:11] blogometer: mscdex: Is there anything analogous to the java.util.concurrent libraries in C++? [23:11] blogometer: That is non-Boost? [23:11] mscdex: i'm not familiar with java.util.concurrent [23:11] mscdex: i do very little java [23:12] creationix: wow, process.nextTick is SLOW [23:12] blogometer: I'd like to turn V8 C++ into a thing. Like create useful libraries that are not template programming nightmares. [23:12] blogometer: mscdex: You are blessed. [23:12] isaacs: creationix: compared to what? [23:12] kodisha has joined the channel [23:12] isaacs: creationix: i mean, it does have to go back to the event loop, and that's not trivial. [23:12] creationix: just slow, I can't use it in any tight loop of over 1000 iterations or it will eat cpu [23:12] creationix: for seconds [23:13] mscdex: creationix: what is this tight loop for specifically? [23:13] creationix: isaacs: well, the biggest cost is the shift it does [23:13] Tim_Smart: creationix: I bet setTimeout(func, 0) isn't any better? [23:13] creationix: if 1000+ nextTicks get queued up they are shifted one at a time [23:13] isaacs: Tim_Smart: no, that's a step down the priority ladder, so it's a bit slower. [23:13] isaacs: creationix: i see. [23:13] creationix: it would be faster if it didn't use shift [23:13] creationix: I'll try setTimeout [23:14] derbumi has joined the channel [23:14] isaacs: creationix: unless something has changed since last time i benched it, setTimeout is quite a bit slower. [23:14] digitalspaghetti: oh good thing i follow the twitter stream, now i have just found out about nave :D [23:15] creationix: isaacs: mape: ok, so my query without any caching at all takes 1500ms, with my cache plugin powered by setTimeout it's 300ms, but the same plugin powered by process.nextTick it's 11641ms [23:16] sideshowcoder has joined the channel [23:16] isaacs: creationix: !? [23:16] isaacs: creationix: ohh... wait. do you care about order? [23:16] joemccann_ has joined the channel [23:16] creationix: we really need to fix process.nextTick to not shift [23:16] creationix: no, I don't care about order [23:16] creationix: I just need my callback to be async [23:16] creationix: or it breaks people expectations [23:17] creationix: I'm pulling results from a ram cache [23:17] isaacs: creationix: so, "slow" is a bit of a relative thing. [23:17] isaacs: creationix: setTimeout might be faster if you have 1000 of them stacking up, but nextTick will win every time if you're not making the queue get big. [23:17] tuxsbro has joined the channel [23:17] creationix: no, 11 seconds with a ram cache is slow when doing the same queries against the HD only takes 1.5 seconds [23:17] joemccann_: isaacs: what's the simplest way to update npm? [23:17] ben_alman has joined the channel [23:17] isaacs: joemccann_: npm update [23:18] isaacs: joemccann_: if you have at least version 0.1.25, that is [23:18] isaacs: joemccann_: in which case, you wouldn't need to updaet, since that's the latest... [23:18] isaacs: joemccann_: so... curl http://npmjs.org/install.sh | sh [23:19] joemccann_: yeah i have 1.22 [23:19] joemccann_: 0.1.22 [23:19] isaacs: joemccann_: so, yeah, do the curl thing, then [23:19] creationix: isaacs: sure, but my queue often gets big [23:19] isaacs: joemccann_: or "npm install npm" might work [23:19] mtodd has joined the channel [23:20] isaacs: creationix: i think what we need is a queue data structure that doens't use arrays. [23:20] lachlanhardy has joined the channel [23:20] joemccann_: isaacs: npm fail Error installing npm@0.1.23 [23:20] joemccann_: ?? [23:20] isaacs: joemccann_: ah, it's trying to install the "stable" instead of "latest" [23:20] isaacs: joemccann_: i think [23:20] isaacs: joemccann_: do the curl thing [23:21] joemccann_: isaacs: that was the curl technique [23:21] isaacs: joemccann_: maybe remove your .npmrc and try again? [23:21] joemccann_: isaacs: yeah give me some weird errrors [23:22] isaacs: joemccann_: you could also do "npm rm npm" and then do the curl instal [23:22] isaacs: joemccann_: or get the latest code, make clean ; make install [23:23] joemccann_: isaacs: npm rm -r npm [23:23] joemccann_: worked [23:24] joemccann_: isaacs: but now getting permission denied on mkdir even as su...wtf? [23:24] isaacs: joemccann_: please gist the whole log, from your command to the error [23:24] joemccann_: isaacs: will do [23:26] _announcer: Twitter: "new project: #clyffe (shortened from #WardenclyffeTower), web server built entirely in #JavaScript and using #nodejs http://clyffe.info" -- Noah Peters. http://twitter.com/noahpeters/status/21616613099 [23:26] mattikus: does node have a built in numeric range function? [23:26] joemccann_: isaacs: http://gist.github.com/539198 [23:27] isaacs: joemccann_: you have to sudo the "sh", not the curl [23:27] isaacs: joemccann_: or better still: sudo chown -R $USER /usr/local/ [23:27] joemccann_: isaacs: facepalm [23:27] joemccann_: thx [23:27] isaacs: joemccann_: http://foohack.com/2010/08/intro-to-npm/#what_no_sudo [23:28] Tim_Smart: isaacs: I prefer setting binroot to $HOME/bin, then putting it in your path [23:28] isaacs: joemccann_: or that ^ [23:28] isaacs: npm config set binroot [23:28] isaacs: npm config set binroot $HOME/bin [23:28] Tim_Smart: And root to $HOME/.node_libraries [23:28] creationix: isaacs: actually I factored out other overheads, just the query part takes 321 ms without process.nextTick, and with it... I gave up at 3 minutes! [23:28] SubStack: isaacs: yeah I have yet to write any c++ node bindings [23:28] SubStack: pkrumins is getting pretty good at it though [23:29] isaacs: SubStack: pkrummins' stuff is very helpful, and i just wrote a super do-nothing hello world (that works now, thanks to his help) [23:29] SubStack: I just smuggle haskell stuff into node libs [23:29] creationix: I have a table with 20,000 rows and an running 16 different queries against it [23:29] joemccann_: isaacs: thx man...works now [23:29] creationix: ryah: ping [23:30] joemccann_: isaacs: ahh so it appears node-couchdb is not pub'd in the registry [23:30] creationix: ACTION goes off to read node source code [23:31] blogometer: mscdex: ping. [23:31] blogometer: If I have a script that simply connects, and does nothing else, node-mysql hangs. [23:31] blogometer: I expect it to exit. [23:31] blogometer: and connect.end() doesn't help. [23:32] icozzo has joined the channel [23:33] tuxsbro_ has joined the channel [23:34] davidwalsh has joined the channel [23:35] ivong has joined the channel [23:36] n3v3le1 has joined the channel [23:37] blogometer: mscdex: Sorry to ping you. I figured it out for myself. [23:37] creationix: ryah: I have a patch for process.nextTick that makes it worlds faster [23:37] c4milo has joined the channel [23:37] Tim_Smart: pquerna: Ping. Did you find out how expensive create external objects with v8 was? [23:38] Tim_Smart: creating* [23:38] creationix: ryah: like made an operation on my database go from over 3 minutes to 300ms [23:39] Tim_Smart: creationix: Did you remove the shift? [23:39] creationix: Tim_Smart: yep, it wasn't needed [23:39] Tim_Smart: True, you just needed to clear the queue after the loop completed [23:40] creationix: Tim_Smart: I think I'm going to go through the node source looking for shift and unshift [23:41] Tim_Smart: :D [23:41] creationix: it shouldn't be used anywhere that has lots of items [23:41] creationix: especially if you're just going to use the entire list at once like this one [23:41] Tim_Smart: We need a decent profiler >.< [23:42] Throlkim has joined the channel [23:42] Tim_Smart: http://github.com/bnoordhuis/node-profiler [23:42] Tim_Smart: ^- I might see how this one goes. [23:42] [[zz]] has joined the channel [23:44] jMCg: Is there a possibility to tell ./configure which SSL to use? [23:44] nerdEd has joined the channel [23:48] creationix: Tim_Smart: do you know what freelist is? [23:48] creationix: it uses shift, but I think pop would work just as well [23:48] creationix: the order shouldn't matter [23:48] Tim_Smart: freelist? [23:48] creationix: I'll take that as a no ;) [23:48] creationix: it's an internal node utility for object pools [23:48] Tim_Smart: Ah right. [23:49] Tim_Smart: Where abouts is it defined? [23:49] Tobsn: hey, can i run multiple domains on one node instance and have the router somehow match on the domain? [23:49] creationix: Tim_Smart: lib/freelist.js [23:49] Tim_Smart: Tobsn: Definitely. [23:49] creationix: Tobsn: yep, connect has a middleware for that built-in [23:49] Tim_Smart: Tobsn: connect can do that. [23:50] creationix: Tim_Smart: here is another suspect http://github.com/ry/node/blob/master/lib/http.js#L302-310 [23:51] creationix: it looks like he's flushing the output queue at once [23:51] Tim_Smart: creationix: `node --prof` is pretty cool. [23:51] creationix: Tim_Smart: how do I use that? [23:51] Tobsn: creationix, Tim_Smart, is there an example somewhere? [23:51] Tim_Smart: It dumps the profile log to ./v8.log [23:52] Tim_Smart: creationix: http://code.google.com/p/v8/wiki/V8Profiler [23:52] creationix: Tobsn: http://github.com/senchalabs/connect/blob/master/examples/vhost/app.js [23:53] hassox has joined the channel [23:54] mscdex: jMCg: what do you mean? [23:54] mscdex: blogometer: what was the solution? [23:54] Tobsn: thanks! [23:55] Tim_Smart: creationix: This is awesome! http://code.google.com/p/v8/wiki/V8Profiler#Example_Output [23:55] creationix: Tim_Smart: how do I get the mac-tick-processor [23:56] Tim_Smart: node/deps/v8/tools/... [23:56] creationix: I see it, but I can't get it to run [23:56] creationix: complains about scons [23:56] jMCg: http://dpaste.com/231399/ -- first off, I can't make it build anyway or the other. Then, I'd like to build it with all them fancy options (c-ares, v8 -- those seem to be ignored by ./configure) -- and then I'd like to build it against my self-rolled OpenSSL (1.0.0a), residing in /opt/bw [23:56] Tim_Smart: Yeah you need scons installed [23:56] Tim_Smart: Unfortunately I'm currently installing eclipse, so I have to wait before install scons. [23:57] Tim_Smart: installing* [23:58] creationix: Tim_Smart: hmm, I got scons, and now it seems to be rebuilding v8 [23:58] aheckmann has joined the channel [23:58] Tim_Smart: Hmm ok. Interesting. [23:58] jMCg: I have scons installed - I couldn't have built v8 without it. (But v8's SConstruct doesn't provide an install target.. That's why I'm pointing oh.. you're talking to creationix [23:59] creationix: Tim_Smart: well, it only builds v8 on the first run [23:59] Tim_Smart: jMCg: I'm pretty sure you can use the --lib directive? [23:59] creationix: yay for more profile output