[00:00] bradleymeck: aria had something if i recall, but dont think it was public [00:00] Blink7 has joined the channel [00:01] saschagehlich: Aria: ping [00:01] strmpnk_ has joined the channel [00:04] pandark_ has joined the channel [00:05] monokrome: Anyone know what the standard way to throw an error in nodejs is? [00:06] saschagehlich: monokrome: throw(err)? [00:06] yeevgen` has joined the channel [00:06] monokrome: Yea, but what's err? :) [00:06] tj: throw new Error('whatever') [00:06] tj: is how you throw something.. [00:06] tj: but usually callback(err) [00:07] agnat has joined the channel [00:07] monokrome: same as browser :) [00:07] aho: mape, wrote some code to generate 1x1 rgba pngs: http://kaioa.com/k/bugger/bugger.js [00:07] aho: you won't need that silly base64 stuff with node of course :> [00:08] aho: http://kaioa.com/k/bugger/index.html <- ie8 demo [00:08] jashkenas has joined the channel [00:08] aho: (ie7 doesn't support base64) [00:08] chrischris has joined the channel [00:09] Tobsn has joined the channel [00:13] Throlkim has joined the channel [00:14] c4milo has joined the channel [00:15] sveimac has joined the channel [00:18] aconbere has joined the channel [00:19] robmason has joined the channel [00:21] dnolen has joined the channel [00:21] MattDiPasquale has joined the channel [00:22] henrikh has joined the channel [00:26] aubergine has joined the channel [00:28] monokrome: ACTION wonders how to get a reference to the server instance from the request callback [00:29] sveimac has joined the channel [00:30] tekky has joined the channel [00:31] davidc_: tswicegood, well well well. [00:31] davidc_: We meet again. [00:32] saschagehlich: okay, I found out that postfix can pass the incoming mails to a node.js script - now I only have to parse the mail content [00:32] mscdex: v8's setTimeout allows you pass arguments to the timeout function right? e.g. setTimeout(fnFoo, 1000, arg1, arg2); [00:32] saschagehlich: did anyone ever do sth like that? [00:32] prettyrobots has joined the channel [00:33] comster: saschagehlich, I bookmarked https://github.com/aheckmann/node-email but haven't tried it yet. [00:33] aho: mscdex, you can always pass an annonymous function which calls your function with whatever arguments you like [00:33] mscdex: yeah i know, but i was just curious about this method [00:33] mscdex: apparently gecko supports it, but wasn't sure about v8 [00:33] comster: also, https://github.com/andris9/mailparser [00:34] mscdex: i guess i should just try it heh [00:34] inimino: mscdex ⋱ It's non-standard but it does work. [00:34] inimino: in V8 [00:35] mscdex: cool [00:35] WRA has joined the channel [00:37] konobi: saschagehlich: you might want to look at postfixes milter support [00:37] sveimac has joined the channel [00:37] jameshome has joined the channel [00:38] sprout has joined the channel [00:38] omygawshkenas has joined the channel [00:39] omygawshkenas has joined the channel [00:40] saschagehlich: konobi: milter is just a filter for spam etc, right? [00:41] saschagehlich: comster: node-email is just for sending mails, not for receiving / reading them [00:41] jakehow has joined the channel [00:41] comster: ya, see the other link though? [00:41] comster: how about https://github.com/andris9/mailparser? [00:42] saschagehlich: comster: holy shit, this is exactly what I need [00:42] saschagehlich: thanks a lot!! [00:42] konobi: saschagehlich: that what it's generally used for, but it's not exclusive [00:42] comster: ya, like I meant to say re it, I haven't tried it yet, let me know how it goes [00:45] pagameba has joined the channel [00:52] robmason has joined the channel [00:53] saschagehlich: sjot [00:53] saschagehlich: shit [00:53] saschagehlich: just killed 4 hours of work using git clean [00:53] saschagehlich: can I undo it somehow [00:53] saschagehlich: ß [00:54] robmason has joined the channel [00:55] Fenda has joined the channel [00:55] UHMA: yikes [00:56] nooder: who can recommend gzip module? [00:56] Fenda: im trying to forward apache requests to url domain.com/node/foo to node server domain.com:8080/foo using http.conf on apache2 ubuntu 10, stuck with this: http://pastebin.com/EbstCH0t [00:57] robmason has joined the channel [00:58] nooder: ^/ maybe? [00:58] nooder: then check flags [00:58] inimino: Fenda ⋱ #httpd [00:59] Fenda: ty [00:59] ossareh has joined the channel [01:00] erlnoob has joined the channel [01:02] evanmeagher: is there a simpler way to detect arrayness instead of falling back on something like remedial.js? [01:03] monokrome: Aha. "this" references the server! [01:03] erlnoob: evanmeagher: something like var x = [1,2,3]; if (x instanceof Array) { ... } ? [01:04] Aikar: bnoordhuis: so passing fd's is broke and a known bug? [01:05] bnoordhuis: Aikar: i'd phrase it as "a suspected bug" :) [01:05] Aikar: well both code samples i tried threw ECONNREFUSED :( [01:05] evanmeagher: erlnoob: that'll work, but i thought instanceof and typeof were frowned upon though for arrays. [01:06] bnoordhuis: i'm 95% sure the changes from the last two weeks will have broken it [01:06] sh1mmer has joined the channel [01:06] Aikar: damn [01:06] erlnoob: evanmeagher: i didn't know they were frowned upon... [01:06] Throlkim has joined the channel [01:06] nooder: error: ‘class node::Buffer’ has no member named ‘data’ [01:07] evanmeagher: erlnoob: well for one, instanceof returns true for arrays with both Array and Object [01:07] Aikar: id rather work with .3 as i wont be deploying this app for at least a year so might as well keep up with the versions [01:07] bnoordhuis: Aikar: i know ryah is / has been working on sendmsg() support [01:08] Aikar: for child processes? [01:08] bnoordhuis: i think so, yes [01:08] brianmario_ has joined the channel [01:09] rkieffer: evanmeagher: some people may not like it, but I've always found (arr.join && arr.concat) to be pretty bullet-proof array detection. [01:09] bnoordhuis: nooder: what are you trying to do? [01:10] Moominpapa has joined the channel [01:10] bnoordhuis: what's wrong with instanceof anyway? [01:10] Aikar: i guess ima revert my code back to single instance for now and ill implement thatt style later on [01:10] nooder: i need node-compress to build. but its using old buffer api [01:10] nooder: can you give link to repo where you fixed this? [01:11] bnoordhuis: nooder: for node-compress? that isn't mine [01:11] jcstringer has joined the channel [01:11] bnoordhuis: do you mean node-buffertools? [01:11] nooder: for any :) [01:11] nooder: just to know logic [01:12] bnoordhuis: nooder: it's this commit (mostly): https://github.com/bnoordhuis/node-buffertools/commit/f865601c651964d9aacc3ab3497ffcef364f42b8 [01:12] bnoordhuis: buffer->data essentially becomes Buffer::Data(handle) [01:12] bnoordhuis: same for size [01:12] bnoordhuis: v8: [].constructor === Array [01:12] v8bot: bnoordhuis: true [01:12] nooder: thx [01:13] c4milo has left the channel [01:13] nooder: that will be bla.handle_? [01:13] bnoordhuis: nooder: yep [01:14] bnoordhuis: or one of the arguments to your callback [01:15] lakin has joined the channel [01:16] mscdex: evanmeagher: if this is just for v8/node, you can use Array.isArray(obj); [01:16] arpegius has joined the channel [01:16] podman has joined the channel [01:16] evanmeagher: mscdex: oh wow, I didn't know about that. thanks. [01:16] mscdex: evanmeagher: https://github.com/ry/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8 [01:17] evanmeagher: mscdex: I feel remiss for having not seen this before... thank you! [01:17] mscdex: yep, it's a handy list :-) [01:21] nooder: error: request for member ‘handle_’ which is of non-class type ‘node::Buffer*’ [01:25] EyePulp has joined the channel [01:25] bnoordhuis: nooder: bla->handle_ ? [01:25] bnoordhuis: i wager you're trying to access a pointer as a value type [01:26] mscdex: evanmeagher: oh, and there's Buffer.isBuffer(obj) to check for a node Buffer [01:26] nooder: thx! [01:27] evanmeagher: mscdex: good to know. thanks again. [01:27] mscdex: micheil: ping [01:28] cheney has joined the channel [01:28] Tim_Smart has joined the channel [01:29] cheney: i am attempting to run the ./configure command to install node, but I am getting an error: waf-light: error: no such option: -r [01:29] mscdex: cheney: what version of node? [01:30] cheney: probably the latest [01:30] cheney: i just did a pull from git [01:30] mscdex: hmm and python version? [01:31] dnolen has joined the channel [01:31] cheney: I used git clone http://github.com/ry/node.git [01:31] cheney: i would hope that is the python version [01:32] mscdex: cheney: python -V [01:32] cheney: how would I use that [01:32] cheney: i am very sorry, but I am linux stupid [01:33] mscdex: just execute that in your terminal [01:33] cheney: v 2.4.3 [01:34] Tim_Smart: Isn't that an pretty old python? [01:34] mscdex: cheney: you may need python 2.6.x [01:34] cheney: ah ok, thanks [01:36] omygawshkenas has joined the channel [01:37] evanmeagher: isaacs: ping [01:37] isaacs: yo [01:38] skiz has joined the channel [01:38] evanmeagher: would you mind helping me understand how to properly use asyncmap? [01:38] isaacs: sure [01:39] isaacs: so, you pass it a list of things, an asynchronous function to run on all of them, and then a callback. [01:39] admc has joined the channel [01:39] isaacs: the function you pass in shoudl be of the form: function (thing, cb) { ... do something, and eventually call cb() with error, or data, or nothing } [01:39] pagameba has joined the channel [01:40] isaacs: the ultimate cb function gets a list of all the returned data, or the first returned error. [01:40] isaacs: so, for instance: asyncMap([1, 2, 3], function (x, cb) { return cb(null, x + 1) }, function (er, results) { console.error(results) }) <-- prints [2, 3, 4] [01:41] evanmeagher: ah, i think i found my problem [01:41] isaacs: it's a bit like Array#map [01:41] evanmeagher: right [01:41] isaacs: the order is not guaranteed. [01:41] evanmeagher: i was trying to use it in a manner similar to how you to in npm's install.js [01:42] isaacs: oh, also, you can give it more than one operation funciton [01:42] evanmeagher: where i don't care about modifying the original array and instead build up a separate object [01:42] isaacs: right [01:42] jashkenas has joined the channel [01:42] isaacs: tha'ts also a way to do it [01:42] evanmeagher: within each step, i wasn't calling cb(), which i believe was my problem :) [01:42] isaacs: ahhh, yeah [01:43] isaacs: you *must* call cb exactly once in each function [01:43] isaacs: and it must be the cb you receive, not the cb you're giving to asyncMap. it does some closure magic there [01:43] sprout has joined the channel [01:43] evanmeagher: nifty [01:43] evanmeagher: thanks for the help [01:44] isaacs: more snazziness: if those functions push onto the original list, then the new items will get looped over. [01:44] isaacs: also: if those functions call cb() with an *array*, then it'll be flattened out (uses concat() rather than push()) [01:44] isaacs: so: [01:45] rauchg_ has joined the channel [01:46] MattDiPasquale has joined the channel [01:46] isaacs: x = [1,2,3]; asyncMap(x, function (y, cb) { if (y < 10) x.push(y+1) ; cb(null, [y, y * 10]) }, function (er, res) { console.error(res) }) prints([1, 10, 2, 20, 3, 30, 4, 40, 5, 50, 6, 60, 7, 70, 8, 80, 9, 90, 10, 100]) [01:47] isaacs: oh, actually, no, 2 would be there twice, and 3+ would be there 3 times [01:47] isaacs: 1,10,2,20,2,20,3,30,30,3,30,4,40,4,40,4,40,5,50,5,50,5,50,... [01:47] evanmeagher: right [01:47] evanmeagher: that's pretty cool [01:48] isaacs: if you return an empty array (or nothing) then nothing goes in the results. [01:48] evanmeagher: do map functions in other language let you do surgery on the list you're mapping over like that? [01:48] isaacs: nope [01:48] evanmeagher: i've never tried in scheme, ml, etc [01:48] isaacs: but it's handy [01:48] evanmeagher: yeah that's cool [01:48] isaacs: because then, when you're installing stuff, you can say "oh,yeah, i also need to install this dependency or whatever" and it'll just be as if you already knew about it [01:49] evanmeagher: ah, yeah [01:49] rbranson: asyncMap(doubleRainbow); [01:49] isaacs: rbranson: what does that mean? [01:52] Fenda: my folder contains 4 files: server.js chat.html socket.io.js json.js, i add json + socket.io.js to the html head file in script tags. json is loaded OK, socket.io.js is returning a 404.. its definetely in the same directory :/ [01:52] robotarmy has joined the channel [01:53] saml has joined the channel [01:53] saml: hey is nodejs webscale? [01:53] saml: is it fast? [01:53] isaacs: saml: yeah, i think the real problem is that the web isn't nodescale [01:54] dohtem has joined the channel [01:54] dohtem has joined the channel [01:54] twoism has joined the channel [01:54] saml: oh nice it includes v8 :P [01:55] saml: can i execute arbitrary command [01:55] saml: something like subprocess in python [01:56] saml: oh there is Child Processs [01:56] saml: nice [01:57] saml: hoa this is really RAD project [01:58] WRA: Saml xD [01:58] WRA: g'damn do I hate buzz words like web-scale :D [01:58] javruben has joined the channel [01:59] saml: i need to dynamically resize images.. /some/image.resize.30x40.jpg will read /some/image.jpg from filesystem and resize (probably using image magic) and serve. [01:59] saml: do you think nodejs is good for this? or should o go for fastcgi + some server like nginx? [01:59] WRA: depends on what you mean by good [02:00] saml: good as in... better than fastcgi approach? [02:00] WRA: and yes, nginx/nodejs produce similiar performance results for simple tasks [02:01] JimBastard: webscale [02:01] saml: and i don't have to configure nginx :P [02:01] JimBastard: your momma is so fat she broke the webscale [02:01] WRA: well only 50% of the documentation of nginx is in Russian [02:01] WRA: only 50%. [02:02] saml: yah document seems to be poor for nginx [02:02] saml: node.js that is [02:02] twoism has joined the channel [02:03] austincheney: I have installed python 2.7, but the path variable is still pointing to python 2.4. How would I update the path in Red Hat? [02:03] austincheney: sorry wrong channel [02:03] WRA: heh, was going to say. [02:04] mscdex: :> [02:05] kschzt has joined the channel [02:06] kschzt: why oh why did sys become util? [02:06] kschzt: sys -> node i could understand :) [02:07] saml: wtf it has repl too [02:07] saml: with tab completion [02:07] saml: can i give this web scale approval badge? [02:08] saml: wow tab completion even works for strings.. require('ht [02:12] cjm has joined the channel [02:14] kschzt: www.warimals.com, rocket pack's first game is soft launched, very much thanks to all yall [02:15] gf3 has joined the channel [02:15] sivy has joined the channel [02:16] kschzt: would like to take the opportunity to thank Ryan for Node, tj (connect, express/o), Guillermo, Socket.IO, we wouldn't be here.. [02:17] saml: hey, how can I echo request object? [02:17] kschzt: *bow* [02:17] saml: throw new TypeError("first argument must be a string, Array, or Buffer"); [02:19] stepheneb has joined the channel [02:19] comster: kschzt, thanks for distracting me from my work =\ playing as cats... looks good! [02:20] WRA: circular references in javascript [02:20] WRA: Okay, not okay? [02:20] kschzt: comster, I would love it if this channel took it apart :) [02:21] kschzt: the backend is node.js + scala, soon we are going to get rid of scala [02:23] WRA: hmm, actually... does V8 reference count garbage collect? [02:23] WRA: or can it handle circular references? [02:23] kschzt: and the JVM.. to enter the new world of understanding V8 GC.. [02:24] kschzt: any great V8 GC docs? [02:25] WRA: supposedly circular references are fine in V8 [02:26] admc has joined the channel [02:27] kschzt: guess I'll read at http://code.google.com/p/v8/ [02:27] kaichen has joined the channel [02:28] kschzt: if you try the game on iPad, iPhone, Android, you'll notice it's the same world, same code [02:30] kschzt: crack it hard and tell me at jaakko@rocketpack.fi and rewards abound ;) [02:32] kschzt: the server is pretty much connect+express, node-amqp, mongoose. [02:32] sechrist_ has joined the channel [02:33] kschzt: and socket.io of course.. we try to put what we use here .. https://github.com/rocketpack/ [02:33] WRA: back [02:33] WRA: Chromium guys say that V8 will GC circular references [02:34] WRA: meaning you can create those nice hierarchies with parents/children referencing each other [02:34] saml: hey, how do you read configuration file? do you use json and read it? [02:34] WRA: YEah [02:34] saml: thanks [02:34] WRA: json is pretty readble [02:34] inimino: circular references aren't a problem in any remotely recent JavaScript engine [02:34] WRA: IE *cough* [02:34] inimino: ...including IE [02:35] WRA: Have you done any tests with that? [02:35] WRA: IE7 still chokes on them [02:35] inimino: in old IE versions there are problems with some references involving DOM elements [02:35] inimino: plain circular references not involving host objects aren't a problem anywhere [02:37] _mythz has joined the channel [02:38] ooooPssss has joined the channel [02:38] saml: in my module, I change Object.prototype , String.proptotype... etc is t his a good idea? [02:38] saml: for example, I usually do "hello, %s".f("sam") [02:38] saml: to get "hello, sam" [02:39] agnat has joined the channel [02:40] WRA: do you have to instance EventEmitter to use it? [02:41] mscdex: WRA: you mean: sys.inherits(Foo, events.EventEmitter); ? [02:43] WRA: not seeing that in the API [02:43] sgilbert has joined the channel [02:43] WRA: but yeah events.EventEmitter [02:45] mscdex: WRA: once you do that, you can then use EventEmitter's methods on Foo or instances of Foo [02:45] WRA: do I have require events and sys ? [02:46] WRA: and is that good for version 0.2.x [02:46] mscdex: yeah [02:47] saml: how can I quit the script? [02:47] WRA: should I use sys.inherits over prototyping? [02:47] saml: like, if (process.argv.length < 3) { i want to quit [02:47] WRA: or is it on the backend simple going Foo.prototype = new events.EventEmitter? [02:48] saml: process.exit(1) [02:49] breccan has joined the channel [02:49] mscdex: saml: you can just do nothing else, otherwise you have to force using process.exit [02:50] mscdex: saml: in other words, if nothing else is set up to happen on the event loop, the process will end automatically [02:50] WRA: oh shit, it allows you to call superclass methods [02:50] WRA: thats beyond spiffy. [02:50] saml: if I read json, how can I deserialize it? eval(fileContent) ? [02:51] mscdex: saml: JSON.parse [02:51] saml: w00t [02:52] saml: can I call require('http') often? or should I do all my require() at the top of the file? [02:52] mscdex: saml: other useful built-ins here: https://github.com/ry/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8 [02:52] mscdex: saml: it's best to require just once [02:53] mscdex: saml: although, the module is cached by require the first time it's loaded [02:53] saml: oh JSON is not nodejs api :P [02:53] unomi has joined the channel [02:53] mscdex: saml: nope, it's a v8 thing :) [02:53] WRA: mscdex: cache'd and passed by value [02:53] marshall_law has joined the channel [02:54] sechrist has joined the channel [02:54] saml: var Process = process; //do you think it's a good style? I want modules to start with Capital letter [02:55] saml: var Fs = require('fs');///etc [02:55] WRA: generally they're lower case [02:55] WRA: if you look at the API code examples [02:55] saml: yah it's confusing (to me at least) [02:56] InsDel has joined the channel [02:56] mscdex: i think generally uppercase names are used for objects that are to be or return new instances [02:56] mscdex: e.g. "classes" [02:57] cjm has joined the channel [03:04] boaz has joined the channel [03:04] WRA: btw thanks mscdex, you are a great reference [03:06] gf3 has joined the channel [03:06] justin_: it bothers me that we have to put classes in quotes [03:06] justin_: we all write JS, we know they're not traditional classes [03:07] justin_: there isn't a better name for it that's widely used, so we should be able to use it, imo [03:07] mscdex: meh [03:11] sechrist has joined the channel [03:12] agilandfast has joined the channel [03:12] robotarm_ has joined the channel [03:13] erlnoob has joined the channel [03:16] saml: thinking of it.. i dont need json. i can just have settings.js and var settings = require("./settings") [03:16] saml: i'm so stupid [03:17] jpld has joined the channel [03:18] kaichen has joined the channel [03:19] WRA: uh.. [03:19] WRA: thats still json pretty much :D [03:19] WRA: but yeah [03:20] arpegius has joined the channel [03:28] Wyverald1 has joined the channel [03:29] skiz has joined the channel [03:29] admc has joined the channel [03:29] Wyverald1: which mongodb driver would you use? given the three options listed on the mongodb nodejs page [03:30] WRA: I messed around with hummingbird a little and it seemed stable [03:30] WRA: I don't know which one they use. [03:31] sivy has joined the channel [03:32] Wyverald1: seems to be this one https://github.com/christkv/node-mongodb-native [03:32] arpegius has joined the channel [03:32] Wyverald1: I'll give it a try, thanks [03:33] pagameba has left the channel [03:38] arpegius has joined the channel [03:43] blacksunsfo has joined the channel [03:43] blacksunsfo: hey [03:44] rchavik has joined the channel [03:44] muk_mb: hi [03:45] blacksunsfo: is anyone using node.js in a production multi-tenant environment? [03:45] breccan_ has joined the channel [03:45] bartt has joined the channel [03:45] saml: server.listen(..); it keeps process running.. even after server.close(); how can I quit? should I do process.exit(0) ? [03:47] sudoer has joined the channel [03:54] sivy has joined the channel [03:55] chrischris has joined the channel [03:55] mscdex: saml: server.close() only stops accepting new requests, so you'll either have to use process.exit or keep track of your connections and kill them all off one by one first [03:56] saml: mscdex, i only invoke server.listen(port, host) once. and server.close() [03:57] saml: oh i see. connections! [03:57] saml: mscdex, is it ok to process.exit() with connections open? [03:57] mscdex: saml: should be, it should kill them off [03:58] saml: cool! [03:58] mscdex: although, depending on what you're doing, it may be better to keep track of connections and let each connected client know you're shutting down and that the disconnection isn't the result of a crash or something [04:04] saml: Usually users will not want to access this event. [04:04] saml: that's for http.Sever 'connection' event [04:05] sechrist has joined the channel [04:06] WRA: using a CSS like address + payload for RPCs [04:07] JimRoepcke has joined the channel [04:07] WRA: so like, world.users.1 'mail' {body: 'kewl', subject:'hiya'} [04:07] WRA: user 1 would recieve a mail RPC with that payload [04:08] WRA: world.users.[name=Joe Bob] 'mail' {body..etc} [04:08] WRA: any user with the name Joe Bob would recieve that one, and then you can world.users.broadcast for everyone [04:09] WRA: See any obvious flaws? [04:11] deepthawtz has joined the channel [04:11] davidc_ has joined the channel [04:13] elijah-mbp has joined the channel [04:17] jakehow has joined the channel [04:21] jchris has joined the channel [04:23] sivy has joined the channel [04:26] quirkey has joined the channel [04:29] robotarm_ has joined the channel [04:34] EyePulp has joined the channel [04:35] stepheneb has joined the channel [04:39] Aria has joined the channel [04:41] evanmeagher has joined the channel [04:41] davidc_ has joined the channel [04:41] noahcampbell has joined the channel [04:42] _mythz has left the channel [04:42] marshall_law_ has joined the channel [04:49] rbranson: http://pinterest.com/ [04:49] rbranson: best outage page ever [04:50] micheil: hey rbranson [04:50] EyePulp has joined the channel [04:51] ossareh has joined the channel [04:52] chrischris has joined the channel [04:52] ysynopsis has joined the channel [04:53] mscdex: micheil: is Buffer.isBuffer in the new docs? [04:54] rbranson: hey micheil [04:54] mscdex: it still seems to be missing in the 0.3.1 docs [04:55] micheil: mscdex: not sure [04:55] saml: to know if file exists, do I do fs.stat? [04:55] micheil: or path.exists [04:55] micheil has left the channel [04:55] micheil has joined the channel [04:56] FLYBYME: hey should i downgrade from 0.3.1 to 0.2.5? [04:56] rbranson: yes [04:56] micheil: 0.2.5 is considered stable [04:56] saml: oh handly. t hanks micheil [04:56] micheil: 0.3.1 is considered unstable [04:57] marshall_law_ has joined the channel [04:57] micheil: mscdex: looks like it may be undocumented [04:57] rbranson: 0.2.5 is fine [04:57] FLYBYME: can i install both? [04:57] rbranson: and relatively stable [04:58] rbranson: why do you think you need 0.3? [04:58] rcy has joined the channel [04:58] micheil: FLYBYME: it is possible to install both, by changing --prefix at ./configure time [04:58] rbranson: bah don't confuse them [04:59] micheil: eg, ./configure --prefix=/usr/local/ and ... [04:59] rbranson: :D [04:59] FLYBYME: micheil: thanks ill do that [04:59] micheil: but you're likely to hit issues when switching between them, generally it's easier to only install one version [04:59] chrischris has joined the channel [04:59] rbranson: https://github.com/creationix/nvm [05:00] rbranson: :D [05:00] rbranson: does nvm even work? [05:00] micheil: mscdex: are you working on documentation for buffer.isBuffer? [05:00] micheil: because, iirc, it's currently broken [05:00] mscdex: micheil: no, i just was wondering if it was in the pipeline [05:00] micheil: as there's no buffer.isSlowBuffer [05:00] micheil: Buffer.isBuffer = function isBuffer(b) { [05:00] micheil: return b instanceof Buffer; [05:00] micheil: }; [05:01] mscdex: 0.3.1's isBuffer checks both Buffer and SlowBuffer [05:01] micheil: oh [05:01] micheil: ACTION needs to git pull [05:02] steadicat has joined the channel [05:04] tmm1 has joined the channel [05:05] micheil: One thing I'm wanting to do with the docs is standardise the organisation. [05:05] micheil: so it's like: [05:05] admc has joined the channel [05:06] micheil: constructors, events, instance properties, instance methods, etc. [05:06] murz has joined the channel [05:06] saml: is there example of serving a binary file ? [05:07] saml: http://net.tutsplus.com/tutorials/javascript-ajax/learning-serverside-javascript-with-node-js/ foudn it [05:07] micheil: heh heh [05:07] micheil: lmgtfy. :P [05:08] rbranson: announcer is dead? [05:10] rbranson: https://www.path.com/about fucking napster [05:10] rbranson: shawn "justin timberlake" fanning [05:10] micheil: wow. anyone seen @jack's fundraiser at the moment? [05:10] micheil: someone donated 34,000$ to it. [05:11] rbranson: nope [05:11] rbranson: link? [05:11] micheil: http://mycharitywater.org/p/campaign/?campaign_id=9902 [05:11] rbranson: damn [05:12] rbranson: http://en.wikipedia.org/wiki/Gideon_Yu [05:12] micheil: yeah, 64,000$ already, aiming for 68,000$ [05:12] micheil: ah [05:12] micheil: in which case 34,000$ probably isn't that much to them. [05:13] rbranson: still, that's a serious chunk of change [05:13] micheil: it is. [05:15] chrischris has joined the channel [05:23] micheil: json files can have comments, right? [05:23] inimino: micheil ⋱ no [05:23] micheil: damn [05:24] cjm has joined the channel [05:24] rbranson: that sucks [05:24] rbranson: YAML supports comments [05:25] inimino: YAML supports a lot of things JSON doesn't [05:25] rbranson: well yeah [05:25] micheil: hmm, npm should so allow you to mark a package as non-deployable [05:25] rbranson: but comments are pretty important :) [05:25] micheil: or provide a list of places where this package can be pushed to. [05:25] inimino: which I think is most of the reason why we're all using JSON [05:26] rbranson: honestly, YAML is prettier than XML, but the syntax is harder to remember [05:26] rbranson: and isn't intuitive [05:26] rbranson: it works fine if you're just using it in simple ways, but if you use the more complex features, it gets ridiculous [05:26] inimino: agreed [05:27] rbranson: the syntax also breaks in weird ways because of whitespace [05:27] rbranson: which pisses me off [05:27] Fenda: whats the best module to use for accessing mysql db from node? [05:27] Fenda: dbslayer? node-mysql? [05:28] ryah: Tim_Smart: yt? [05:29] ryah: Tim_Smart: i feel that you should unleash your optimizations on lib/net.js [05:29] micheil: felixge's node-mysql [05:29] ryah: now that writev is landed [05:29] Fenda: micheil: thanks [05:29] micheil: ryah: haha, it took me a few days to work out what you meant by "yt?" [05:30] JimRoepcke has joined the channel [05:32] mjr_: Fenda: did you fix your npm hanging issue? I didn't have any time today to look at my machine with the same problem [05:32] Fenda: mjr_: didnt look at it again. i just stayed on the version i checked out yesterday [05:33] mjr_: Something seems amiss with the latest master. I wish I had time to dig into it. [05:33] zk has joined the channel [05:33] Fenda: need isaacs to look at it i suppose [05:34] james_ has joined the channel [05:34] FLYBYME: whats teh best wat to use sys.pump [05:34] james has joined the channel [05:35] micheil: FLYBYME: well, now on 0.3.X it's stream.pump, but anyway [05:35] cjm has joined the channel [05:35] micheil: FLYBYME: I'm not sure of exactly what you're asking. [05:36] mscdex: ok, v8 c++ question: how can i assign a v8::Boolean to a Local variable? [05:36] micheil: eg, you can do stuff like: var server = net.createServer(function(s){ s.pipe(s); }).listen(function(){ console.log("listening on "+server.address())}); [05:36] FLYBYME: is the last param needed? [05:36] micheil: iirc. [05:36] FLYBYME: how do you know how far in it is [05:37] micheil: also, stream.pump was meant to be stream.pipe [05:37] rbranson: mscdex: node-ffi is good for examples of that type of stuff, since it deals with the gamut of types [05:39] mscdex: ok scratch that, i found out how :> [05:40] robotar__ has joined the channel [05:40] ryah: trivia question: node -e "for (var i = 0; i < 10; i++) console.log('hi');" | head -3 [05:40] ryah: why does this work? [05:41] rbranson: is this part of the joyent interview question set? [05:41] ryah: nm - need a better example [05:41] mscdex: :P [05:41] micheil: ryah: add in "hi"+i) and it'll fail. [05:42] micheil: writes hi0 hi1 hi2 stream failed [05:42] erlnoob: v8: [] == false [05:42] v8bot: erlnoob: true [05:42] rbranson: i just know console.log is unreliable as hell :D [05:42] erlnoob: v8: !([]) [05:42] v8bot: erlnoob: false [05:42] HAITI has joined the channel [05:42] HAITI has joined the channel [05:43] ryah: rbranson: :) [05:43] dguttman has joined the channel [05:44] ehaas has joined the channel [05:44] rbranson: i love util.debug... finally, developers admit that they do print debugging and therefore make a timestampped printter + flush combined in one [05:45] mikew3c_ has joined the channel [05:45] micheil: hmm, npm allows JSON with comments.. >_> [05:45] inimino: that's not good [05:46] robotarm_ has joined the channel [05:46] micheil: ACTION thinks it should just regexp remove them first. [05:46] Wyverald has joined the channel [05:47] monokrome: Hmm... Does node.js not support destructed declarations? [05:47] robotar__ has joined the channel [05:47] inimino: monokrome ⋱ V8 does not, and they are non-standard. [05:47] monokrome: Yea, I knew they were non-standard. [05:47] monokrome: Thanks :) [05:48] monokrome: (they are awesome, though!) [05:49] micheil: str.replace(/^\s*(\/\/.*$|\/\*.*\*\/)/gmi, "") [05:50] micheil: json with comments. [05:51] micheil: rather, ^\s*(\/\/.*$|\/\*[^\*/]+\*/) [05:51] monokrome: broken [05:51] monokrome: Oh, second one worked. [05:52] micheil: hmm? [05:53] monokrome: ^\s*(\/\/.*$|\/\*[^\*/]+\*/($\s*)?) [05:53] monokrome: remove those extra newlines ;) [05:53] saml: hey, how can I print out error I caught? sys.log(sys.inspect(err), true, null) isn't so friendly [05:54] saml: I like to output what node outputs when I don't catch the exception [05:54] micheil: monokrome: that fails more so [05:55] micheil: you can't really. [05:55] monokrome: worked for me [05:55] micheil: oh well, being npm falls back to eval() is fine [05:56] monokrome: $ matches end of line, \s* after it was useless though because you had \s* at the beginning :D [05:56] micheil: actually, console.trace() [05:56] ryah: ACTION hates noticing problems. [05:58] sepehr has joined the channel [06:02] indutny has joined the channel [06:04] saml: how should I handle exception? try { throw 'asdf';} catch (e) { console.log('hi'); } [06:04] saml: this does not come to catch block [06:04] mbrochh has joined the channel [06:05] mbrochh: hey folks, i'm having hard times to get node running on cygwin / win 7 64bit [06:05] indutny: hey guys! [06:05] rslifka has joined the channel [06:05] mbrochh: after lots of struggle i managed to install node and npm [06:05] indutny: ryah: hey ryan! [06:05] mbrochh: i can even do npm install connect [06:05] mbrochh: still, if i run node server.js i get cannot find module 'connect' [06:07] saml: is there mkdir -p ? [06:07] saml: fs.mkdir('/foo/bar/c') throws exception if '/foo/bar' is not there [06:07] rslifka: hey guys, working on wrapping my head around process.nextTick() [06:08] vdrab has joined the channel [06:08] ysynopsis has joined the channel [06:08] rslifka: Without wrapping all of my callbacks (all 3 of them, it's a small server that dumps URLs to Mongo), I couldn't get asynchronous behaviour [06:09] rslifka: It's working, I'm just curious as to why :) [06:10] rslifka: Without using it, all of my requests were being processed sequentially (as observed by my connection pool never using more than 1 connection) [06:12] robmason has joined the channel [06:13] SubStack: saml: I wrote an mkdir -p once, digging up [06:13] sudoer has joined the channel [06:15] SubStack: saml: https://gist.github.com/707661 [06:15] saml: SubStack, thanks [06:16] saml: waht's module. ? [06:16] SubStack: module.exports is what you get when you require() [06:16] saml: i thought it's just exports [06:17] saml: module.exports is the same as the exports object. (oh well) [06:18] SubStack: it is but you can't assign directly to exports [06:19] monokrome: ACTION wishes there was a way to make forEach stop incrementing [06:22] ehaas: throw StopIteration [06:23] monokrome: :D [06:23] monokrome: thank you [06:28] ceej has joined the channel [06:30] galaxywatcher has joined the channel [06:30] mbrochh: npm ERR! Error: Failed gzip "--decompress" "--stdout" "/usr/local/lib/node/.npm/ [06:30] mbrochh: .cache/connect-assetmanager/0.0.17/package.tgz" [06:30] isaacs has joined the channel [06:30] mbrochh: getting this on cygwin when trying to install via npm [06:30] ircretary has joined the channel [06:33] ryah: indutny: hey [06:34] Fenda: with nodejs and socket:io can i hold an open connection between page loads or do i need to run the client.js each time and call socket.connect()? [06:34] indutny: ryah: still working on patch :) [06:34] indutny: got switched off yesterday [06:35] rslifka: Is it possible to get ulimit -n from inside of node? [06:36] ryah: rslifka: not really [06:36] mscdex: Fenda: no, unless you use an iframe or something instead to load new content [06:36] ryah: need a binding to setrlimit [06:36] rslifka: I'd like to know what it thinks the max is... want to be sure upstart isn't overriding my OS-wide setting [06:36] isaacs: micheil: ping [06:36] ryah: rslifka: you can shell out to get it [06:36] micheil: isaacs: pong [06:36] isaacs: you had a question? [06:37] micheil: isaacs: yeah, I'm wanting to use npm to handle dependencies for a few projects I'm working on at the moment [06:37] micheil: although, these projects aren't meant to be pushed to a public registery [06:37] isaacs: so, to do this, you replicate the public repo to a private spot, and use that as your repository [06:37] saml: what should I pass for mode for fs.mkdir? fs.mkdir('foo', 755) creates weird permission [06:38] erlnoob: how do you structure an application wrt asyn calls? e.g, I have a User.exists() function, which should return true/false, but inside the function does an async db call [06:38] isaacs: anything you then publish will not be published to the public repo, unless you do --registry http://registry.npmjs.org/ [06:38] isaacs: ACTION should really write this up... [06:38] micheil: okay [06:38] rslifka: ryah: is that a facility of process? [06:38] micheil: can I have npm's registry as default, and mine as a remote [06:38] rchavik has joined the channel [06:39] isaacs: micheil: npm only talks to one registry for the span of a command [06:39] rslifka: (looking through the docs now, not seeing an exec() type of thing) [06:39] saml: oh crap it's 0755 [06:39] micheil: so then I can do: npm install company-app --registry http://register.comapny.com [06:39] isaacs: micheil: with the magic of couch, your local reg can "mirror" the public one [06:39] micheil: okay' [06:39] isaacs: s/install/publish/ yeah [06:39] isaacs: or you can `npm config set registry etc` [06:40] micheil: hmm, okay [06:40] isaacs: if your local reg mirrors the public one, and has continuous replication turned on, then you get the public packages, but publishes are never accidentially public [06:40] micheil: well, really all I need is the ability to read a package.json find the dependencies and install them [06:40] sivy has joined the channel [06:40] micheil: (not so much run a private registry) [06:40] isaacs: micheil: right [06:40] isaacs: micheil: running a registry isn't so hard [06:40] isaacs: i have two on my laptop [06:41] micheil: is there a tool for just installing dependencies? [06:41] isaacs: micheil: well, you can either install the deps ahead of time, or bundle them [06:41] isaacs: in the next release, it won't try to install stuff that's already bundled [06:41] micheil: hmm, I'm not really wanting to bundle [06:42] isaacs: right [06:42] micheil: `npm install .` works quite well, but I don't really need my code installed [06:42] isaacs: um... what *do* you want? [06:42] Tim_Smart: npm link? [06:42] micheil: something that just reads the package.json for a project and installs the dependencies it lists [06:42] isaacs: but doens't install that package itself? [06:43] micheil: yes [06:43] isaacs: why not? [06:43] micheil: because there's no need to install it. [06:43] isaacs: well, sure... but... there's no harm in it, either? [06:43] Tim_Smart: isaacs: Think a project you want to deploy, and want to run in place. [06:43] isaacs: i mean, a package.json could even JUST be a name, version, and list of deps [06:43] micheil: (think deployment to no.de, you don't actually want to install your app, but you want to install say, node-oauth which is depends on) [06:43] isaacs: micheil: yeah, i get it [06:44] micheil: npm install --dependencies package.json [06:44] micheil: or something [06:44] rslifka: ryan: child processes, got it, thanks! :) [06:44] micheil: (it'd actually also make deployments to no.de really easy too.. :D) [06:44] Tim_Smart: npm dep . [06:44] micheil: or that. [06:44] isaacs: micheil: i'm working on npm integration with no.de [06:45] isaacs: but, really, i mean, either bundle or link are what you're looking for. [06:45] micheil: hmm, not really. [06:45] micheil: bundle will download all dependencies and place them within my project [06:45] isaacs: sure [06:45] micheil: link will install the project but as a symlink to the source code [06:46] isaacs: as well as all the deps, globally [06:46] isaacs: if they're not already bundled [06:46] micheil: where as what I'm wanting is just a way to install the dependencies, nothing else. [06:46] micheil: and it shouldn't make my repo dirty. [06:46] Tim_Smart: .npmignore everything? [06:46] Tim_Smart: :p [06:46] micheil: (and without .gitignoring those bundle directories) [06:47] isaacs: micheil: npm install ./my-project ; npm rm my-project [06:47] indutny: isaacs: or npm install . from project folder [06:47] micheil: yeah, but it's a hack, it'd be nicer if npm provided this (and it surely wouldn't be hard to add in, would it? [06:48] isaacs: eh. nothings hard, it's just software. [06:48] isaacs: it's just one more thing, that's al [06:48] Tim_Smart: It is just like apt-get build-dep xxx [06:48] isaacs: indutny: the "." isn't necessary, actually [06:48] indutny: yep [06:48] indutny: but it shows something [06:49] isaacs: yep [06:49] isaacs: you know, when the "." was required, everyone seemed to dislike it. since i made it optional, everyone acts ilke it's required. [06:49] micheil: isaacs: if you want, I could patch & pull request npm. [06:49] aguynamedben has joined the channel [06:49] isaacs: hm... [06:49] Aria: I much prefer the explicit . [06:50] isaacs: micheil: if we're going to do this, it needs to be a net win, beauty-wise [06:50] Aria: (And it makes sense to me; I expect npm install to give me an error.) [06:50] micheil: isaacs: pick a cli and run with it. :P [06:50] isaacs: micheil: i mean, from a code beauty pov [06:50] micheil: oh [06:51] isaacs: it could be a plumbing command, like build [06:51] isaacs: and then link, install, and bundle should all use it [06:51] isaacs: right now, bundle and link use install for that [06:52] Tim_Smart: I would have thought you would have already modularized the dependency code :/ [06:52] isaacs: Tim_Smart: i did :) [06:52] isaacs: Tim_Smart: that's all install does [06:52] Tim_Smart: Oh right. [06:53] isaacs: well, not quite, i guess [06:53] isaacs: it does that, and also manages the list of things [06:53] Aria: A tool to parse package.json and spit out various fields in fully cooked form would solve this neatly too. [06:53] Aria: "npm info --deps ." [06:54] isaacs: Aria: npm cache does that programmatically. npm view will do this soon. [06:54] Aria: npm install `npm info --deps .` [06:54] isaacs: Aria: npm view npm dependencies [06:54] isaacs: Aria: npm view connect repository.type [06:54] isaacs: etc [06:54] isaacs: and you can do some cute stuff like: npm view npm contributors.email <-- lists out everyone's email address [06:54] Aria: Yeah. Just not in a way that you can then say 'npm install' [06:56] Aria: (Also, for me, in 0.2.8, it says it can't find a dependencies package, and gives me a blob of json for the view of npm) [06:56] isaacs: yeah [06:56] isaacs: this is not-yet-released stuff [06:56] SubStack: view! nice [06:56] Aria: ah! [06:56] SubStack: hmmm npm builds relative symlinks [06:56] SubStack: this just bit me since I moved some directories around [06:56] hornairs has joined the channel [06:57] monokrome: Anyone know the formatting for V8's try/catch? [06:57] JimRoepcke has joined the channel [06:57] monokrome: or maybe where this sort of thing is documented for V8? [06:57] isaacs: monokrome: you mean in js or in c++ [06:57] isaacs: ? [06:57] monokrome: JS [06:57] Aria: monokrome: try { stuff } catch(e) { handler } [06:57] Aria: Heh, yeah. moving links around will bite you, whether relative or absolute. [06:57] isaacs: monokrome: it's not "v8's try/catch", it's just the js language [06:57] monokrome: Aria: So, there's nothing like Firefox's: try { stuff } catch (e if e instanceof Blah) etc. [06:58] Aria: No, none of the extensions. [06:58] indutny: oh [06:58] Aria: (Sadly) [06:58] indutny: isaacs: i've got a problem [06:58] monokrome: Alright. Thanks again :) [06:58] micheil: just do: [06:58] isaacs: monokrome: no, v8 is only standard js, not crazy spidermonkey stuff. [06:58] indutny: look [06:58] indutny: we have EventEmitter object [06:58] micheil: try {} catch(e){ if(e instanceof Error){ ... } else { throw e; }} [06:58] isaacs: k [06:58] indutny: with one event listener attached [06:58] monokrome: isaacs: but if the error doesn't match a condition, I can always throw e right? [06:58] indutny: and then we emit it [06:58] Aria: monokrome: you can rethrow if it doesn't match though. catch(e) { if(!e instanceof Blah) throw(e) } [06:58] indutny: so result will be 1 [06:58] isaacs: mono sure, of course [06:58] indutny: even if it's returning false [06:59] indutny: or not [06:59] monokrome: cool [06:59] isaacs: indutny: so? [06:59] indutny: isaacs: how can I know that it has been returned false? [06:59] hornairs: i'm having some string encoding issues. i have a closed source java client which sends an ascii message to my node server, which is supposed to write back a message as ascii, so i set my input stream to the ascii encoding, stream.write with ascii encoding, but the responses show up as japanese characters in the java client's gui and ? marks in the console [06:59] isaacs: indutny: does returning false matter if there is only 1 listener? [06:59] SubStack: isaacs: is there a way to force-remove a package? [06:59] Fenda: im using socket:io + mysql-node, whats the best way monitor a mysql db table and send clients a msg once a new db record is added? [07:00] SubStack: I have some npm link'd stuff with broken symlinks [07:00] micheil: Fenda: I don't believe you can [07:00] Aria: hornairs: Sounds like the java is expecting UTF-16 [07:00] indutny: isaacs: doesn't it looks so complex? [07:00] isaacs: SubStack: rm -rf $(npm config get root)/{.npm/,}$PACKAGE* [07:00] micheil: some mysql guru can prove me wrong though [07:00] isaacs: SubStack: where PACKAGE is the package name [07:00] hornairs: Aria: ill try writing my response back like that [07:00] Fenda: micheil: so i'd need to poll the table i suppose? [07:00] SubStack: ah cool so it's just directories then, nice [07:00] micheil: Fenda: yeah, pretty much [07:00] indutny: isaacs: so the rule will be [07:00] hornairs: Aria: does telnet interpret stuff smartly [07:00] SubStack: no secondary metadata to worry about [07:00] indutny: if we have one listener on upgrade event - socket wouldn't be destroyed [07:00] indutny: if more - one of them should return false [07:00] isaacs: SubStack: it might also be bins or man pages, but mostly, yeah [07:00] indutny: isaacs: is it ok? [07:01] monokrome: Is there a good source of documentation of normal Javascript? Without all of these Mozilla extensions... [07:01] hornairs: when i telnet and send the message it comes back totally readable [07:01] indutny: though, it looks good [07:01] isaacs: indutny: honestly, i don't know much about http ugrade [07:01] Aria: Hm. Perhaps not, then. telnet only passes ~raw data. minimal munging, certainly nothing like character set recoding. [07:01] Aria: (and if you telnet to a random port, it is pretty dumb entirely) [07:02] indutny: ryah: so the rule will be [07:02] isaacs: monokrome: the ECMAScript 5 spec is nice reading. [07:02] indutny: if we have one listener on upgrade event - socket wouldn't be destroyed 13:00 [07:02] indutny: if more - one of them should return false [07:02] indutny: is it ok? [07:02] indutny: ryah: 13-00 is just copy-paste [07:02] monokrome: isaacs: Yea, but doesn't Javascript have it's own extensions above that [07:02] isaacs: monokrome: nope [07:02] monokrome: Oh cool [07:02] Fenda: micheil: what should i be doing to poll a function (in this case, the mysql query) whilst not blocking nodejs? [07:02] isaacs: monokrome: v8 is pretty vanilla [07:02] intacto has joined the channel [07:02] Aria: Only if by "Javascript" you mean "what Spidermonkey does" [07:02] micheil: Fenda: maybe a setInterval() ? [07:02] hornairs: Aria no luck in either stream.write(data, 'ascii') or stream.write(data, 'utf8') [07:03] fangel has joined the channel [07:03] ryah: ACTION hopes macintosh isn't fucking with him [07:03] micheil: Fenda: but for that sort of thing, I think mysql is the wrong database to use [07:03] indutny: ryah: haha [07:03] indutny: ryah: take a look at my message please [07:03] Aria: hornairs: Perhaps dump your response through od -ax, see what it says. [07:03] Fenda: micheil: yea? [07:03] indutny: ryah: I've some problems [07:03] indutny: ryah: if upgrade event was listened by one listener [07:03] micheil: Fenda: I'd be using something like couchdb, redis, or even postgress [07:03] ryah: indutny: yes? [07:03] isaacs: ryah: oh, yeah, you'd asked about this: right after you left i saw that "npm freezes up on writev" dozens of times. [07:03] indutny: ryah: how can I examine, that it had returned false [07:03] micheil: or whatever it's called. [07:04] indutny: ryah: it's about my event propagation patch [07:04] isaacs: indutny: more generally, you want to know if the *last* one returned false. [07:04] mjr_: isaacs: I have the same thing as Fenda on one of my machines, ever since writev landed. [07:04] indutny: isaacs: yes, actually, i need to know if any had return false [07:04] indutny: :) [07:04] indutny: but it's the same [07:05] isaacs: indutny: if the non-last one returns false though, then the count wont' match [07:05] indutny: yep, actually next listener wouldn't be called [07:05] indutny: if current returns false [07:05] CIA-95: node: 03Ryan Dahl 07master * r464ced4 10/ src/node_io_watcher.cc : Actually don't need to limit sendmsg size on unix - seems okay. - http://bit.ly/91XS2g [07:05] isaacs: yeah [07:05] CIA-95: node: 03Ryan Dahl 07master * ra936340 10/ src/node_io_watcher.cc : fd_to_send needs to be cleared if *any* data was sent - http://bit.ly/bnCyd3 [07:05] mjr_: Fenda: I second all of micheil's recommendations on databases. I like couchdb if you want your data to be reliably saved, redis if you want it fast, and postgres if you want SQL. [07:06] micheil: mjr_: not only that, but each of those have a form of pub/sub [07:06] micheil: postgres only recently [07:06] ryah: indutny: i don't know - give it some more hours :) [07:06] derferman has joined the channel [07:06] mjr_: I didn't know that postgres had pub/sub. That's cool. [07:06] mjr_: I pub/sub the shit out of redis these days. [07:06] ryah: indutny: i dont want to think about it at the moment [07:06] indutny: indutny: haha :) [07:06] micheil: http://www.postgresql.org/docs/9.0/static/sql-listen.html [07:06] ryah: indutny: or post to the nodejs-dev list and ask [07:07] isaacs: ryah: seems like it's crapping out when doing some child process stuff. [07:07] indutny: oh, I've some thing to do right now [07:07] indutny: do it later [07:07] Fenda: mjr_: micheil: how is postgres in terms of speed? if possible id like to keep to sql [07:07] micheil: Fenda: no idea. [07:08] ryah: isaacs: hm.. okay [07:08] micheil: I've never used postgres (or any sql's) but I know it has listen/notify after someone showed me it [07:08] isaacs: i'll dig in a bit more [07:08] ryah: isaacs: thx [07:08] mjr_: Fenda: depends on what you compare it to. I hear it is comparable to mysql for many workloads. I haven't used SQL for a year or so now, so I'm sort of out of the loop on that. [07:08] ryah: there is one known bug - with net.Stream.writable being incorrect sometimes [07:09] ryah: (now that i've fixed this macintosh bug) [07:10] indutny has left the channel [07:10] nooder has joined the channel [07:12] Aria: postgresql tends to match mysql, and not make as many dumb choices as mysql in query planning. [07:12] Aria: And so it's more consistent across a range of large queries. [07:12] Aria: That said, mysql with myisam tables can not be all ACID, and so can be REALLY fast for small stuff. [07:13] Aria: You can file it under "It's good." [07:13] mjr_: Yeah, myisam can write like CRAZY. [07:13] mjr_: You often can even get your data back. [07:13] mjr_: Which is GREAT [07:15] pquerna: it can insert like crazy, but it cheats. [07:15] Aria: Alright folks. Good night! [07:15] pquerna: rabble rabble rabble [07:16] Fenda: micheil: so do you think postgres would be suitable for my problem? [07:17] nooder: can someone help with fixing node-compress for new buf system? [07:17] mjr_: Man, the more I use EC2, the more I feel like I'm wasting my money. [07:18] rslifka: is anyone using nodejs via upstart? [07:18] Tim_Smart: prgmr <3 [07:18] Tim_Smart: rslifka: I often do, yeah. [07:18] rslifka: and had to deal with upstart setting nofile to 1024? [07:18] pquerna: mjr_: accurate. [07:18] mjr_: rslifka: sure [07:18] rslifka: crikey, can't figure out why my upstart script setting nofile isn't working (limit nofile 65000 65000) [07:18] pquerna: mjr_: ebs + cassandra makes me so sad. I just want SSDs. somehow. in the cloud. [07:18] pquerna: i'd pay real money for it. [07:19] pquerna: real money ya hear. [07:19] mjr_: pquerna: so I've been doing some tests on softlayer today, and you can get bare metal machines, and they are FAST [07:19] Tim_Smart: Hmm I'm getting addicted to lemon and honey. [07:19] hornairs: Aria: I can't get it to output in anything other than ascii, code is here: http://pastie.org/1312490 [07:19] murz has joined the channel [07:19] rslifka: wrote a little blurb to output nofile after node starts - http://pastie.org/1312491 [07:19] hornairs: i'm running 'echo "B|194|35|00088 Corp" | nc localhost 8124 | od -ax' [07:19] mjr_: So for $210/mo on softlayer, I can get a machine with 4 actual CPU cores, that is almost 3X faster than the EC2 "high CPU" instance which costs $300/mo. [07:20] pquerna: mjr_: yeah, softlayer is on our list of things to look at. data volumes increasing make ebs 'nicer' than some other clouds, but even then it ain't great. [07:20] rslifka: mjr: often price isn't the issue [07:20] mjr_: AWS "should" be the right answer, but the price/performance ratio is way out of line. [07:20] rslifka: when 2 of our softlayer cloud instances became unavailable, we had to rebuild them [07:21] rslifka: even their "top cloud guy" couldn't regain access [07:21] rslifka: so we're done with them, moving to EC2 [07:21] rslifka: it took them half a day to spin up a new cloud instance, and no one could explain why [07:21] rslifka: "it shouldn't take this long, we'll get back to you" [07:21] pquerna: i'm not sure how aws is different in that regards rslifka; if there is an issue in ec2, you build a new node. [07:21] mjr_: rslifka: wow, that sucks [07:21] pquerna: oh [07:21] pquerna: well, can't explain that, but 'bad' instances happen everywhere. [07:21] mjr_: I mean, these computers have actual disk drives in them, so they can just die. [07:22] mjr_: But I plan on having a lot of them, so I don't think I care. Who knows though, maybe I should care. [07:22] rslifka: in less than 15 minutes we can spin up a 4TB, RAID 10 massive DB server on EC2 [07:22] aguynamedben_ has joined the channel [07:22] mjr_: EC2 does seem to be able to spin up new instances much faster than SL. [07:23] rslifka: without having to deal with SoftLayer support being unable to tell us why their automated provisioning isn't working [07:23] rslifka: their support people are great though, love having someone answer the phone on the first ring :) [07:23] pquerna: rslifka: yes, 4tb over ebs with random latency of >1 second. [07:23] rslifka: that's why we make 4 volumes of 1TB each and RAID 10 them :) [07:23] pquerna: that just makes it 4 times more likely [07:23] mjr_: The random latency is what is absolutely killing me right now. It is just all over the place. [07:24] rslifka: yeah it's a big negative [07:24] mjr_: Disk IO lags, CPU lags, network lags. It's crazy. [07:24] pquerna: its one reason we ahve been considering gogrid too, because they will do mixed cloud + hw in the same dc, kinda like softlayer in some ways. [07:25] pquerna: lots of our stuff, doesn't need hw, works just fine on VMs; but few specific parts, like cassandra, need hw really :( [07:26] nooder: how to convert Local to node::buffer? [07:26] rslifka: shoot... i went all off tangent [07:26] mjr_: My app is kind of sensitive to jitter, since I'm doing live voice. [07:26] ryah: nooder: you dont [07:26] rslifka: anyone have a ubuntu 10.04 LTS usptart script for node that sets ulimit? [07:26] ryah: nooder: in 0.2 or 0.3 ? [07:26] ryah: nooder: the api changed [07:26] mjr_: rslifka: yes, one sec [07:27] rslifka: upstart keeps setting ulimit -n to 1024 and it's really irritating since the stanzas as they document them, aren't working :( [07:27] pquerna: nooder: https://github.com/ry/node/blob/master/src/node_io_watcher.cc#L338-349 [07:27] mjr_: rslifka: oh, hmm. It looks like I set it in /etc/security/limits.conf [07:27] nooder: https://github.com/egorich239/node-compress/blob/master/src/zlib.h [07:27] nooder: error is node: /opt/node/include/node/node_object_wrap.h:30: static T* node::ObjectWrap::Unwrap(v8::Handle) [07:27] rslifka: and you're using upstart and not init.d? [07:27] mjr_: rslifka: yes, I'm using upstart [07:28] rslifka: hmm... [07:28] rslifka: http://pastie.org/1312491 [07:28] rslifka: i have that in my node server, just to see what's happening [07:28] mjr_: rslifka: another thing you can do is this: exec sudo -u nodeuser sh -c "ulimit -n 16384 ; node server.js" [07:28] rslifka: ulimit -n is 65000 in the OS for all users, node server prints out 1024 [07:28] hornairs: anyone know why stream.write(data, "ascii"), stream.write(data, "utf8"), and stream.write(data, "base64") would write the exact same hex to the stream? the only encoding that seems to do anything different is the 'binary' one [07:29] pquerna: hornairs: its a characterset encoding, not things like base64 [07:29] hornairs: base64 is listed as a valid encoding and doesnt throw an error [07:29] hornairs: but still wtf? [07:30] micheil: Fenda: I have no idea. [07:30] rslifka: mjr_: ahhh i'll do that right now! brb [07:31] mjr_: rslifka: it looks like ubuntu's root user gets a 1024 file ulimit somehow. If you login as root, you'll find your ulimit is 1024. upstart runs as root, so it inherits that. [07:31] rslifka: even if you override that in limits.conf :( [07:31] mjr_: yeah, I have the same setup, and if I get a root shell, ulimit goes back to 1024. So some shell init file maybe? I dunno. [07:32] micheil: ACTION is off to mixdown [07:32] rslifka: upstart, you salty dog [07:32] admc has joined the channel [07:32] mjr_: It's just bash I think. [07:32] rslifka: really would be nice if the "limit" upstart stanza worked as documented :( [07:32] mjr_: I think it does, but then upstart spawns a new shell as root, and that reads in root's shell init files, which set the ulimit back down. [07:32] mjr_: Or something like that. [07:32] rslifka: oh wow.. ok i could see that [07:32] MikhX has joined the channel [07:33] hornairs: pquerna any other ideas? i'd be very grateful [07:34] mjr_: pquerna: I'd be happy to be a test platform for you guys if you want some SL machines with real workloads on them. [07:37] rtomayko has joined the channel [07:42] dnolen has joined the channel [07:44] ryah: instruments for osx is amazing [07:44] ryah: i've just now seen the thing where you can click on a sample and see the asm dump [07:46] mjr_: It's a pretty great visualization of dtrace magic. [07:47] mjr_: I find it often more useful than the V8 profiler. [07:47] iszak has joined the channel [07:48] sudoer has joined the channel [07:51] hornairs: is there a good way to add event emission to a constructor or object? [07:57] micheil has joined the channel [07:58] micheil: mikeal: ping. [07:58] SubStack: hornairs: I usually do Cons.prototype = new EventEmitter [07:59] hornairs: SubStack gotta inherit eh? ok, thanks! [07:59] SubStack: or else var obj = new EventEmitter and then add elements [07:59] SubStack: there are lots of ways to do it [07:59] SubStack: there's also util.inherits [08:02] Fenda: can i use mysql triggers somehow to notify nodejs when an update to a table is made and trigger a nodejs event? http://dev.mysql.com/doc/refman/5.0/en/triggers.html [08:05] ryah: Fenda: would be awesome [08:05] ryah: Fenda: you should take to felixge about it. [08:06] fangel: Fenda: my guess, without putting a lot of thought into it, is no - triggers is only a "on this action, execute this sql".. to my knowledge triggers can't execute anything but sql.. [08:07] mbrochh has joined the channel [08:07] Fenda: fangel: thats what i was thinking :( [08:07] fangel: I might be wrong - I haven't worked much with triggers.. [08:08] fangel: you might be able to do something "interesting" like creating a storage-engine plugin that sends inserts as events to node, and then have a trigger insert a row into a table with that special storage engine.. :) [08:08] fangel: (where "interesting" is defined as: cool, but ultimately really hacky) [08:09] CIA-95: node: 03Ryan Dahl 07master * r56074d1 10/ (src/node_buffer.cc src/node_buffer.h): Inline Buffer::Length and Buffer::Data - http://bit.ly/bQqqZ9 [08:09] uzyn has joined the channel [08:10] hornbeck has joined the channel [08:12] Fenda: fangel, ryah: uzyn just pointed out in #mysql that a system SQL call could be made in the trigger. going to try it out now [08:13] fangel: okay, look into it.. I dismissed that theory when the docs said that you couldn't use CALL to invoke stored procedures.. but it might be different with system calls :) [08:17] JimRoepcke has joined the channel [08:18] rauchg_ has joined the channel [08:19] vdrab has joined the channel [08:20] adambeynon has joined the channel [08:21] bartt has joined the channel [08:22] SamuraiJack has joined the channel [08:23] agnat has joined the channel [08:25] bartt has joined the channel [08:26] Anti-X has joined the channel [08:27] bartt1 has joined the channel [08:27] steffkes has joined the channel [08:28] bartt has joined the channel [08:30] bartt has joined the channel [08:31] bartt has joined the channel [08:33] bartt has joined the channel [08:34] bartt has joined the channel [08:36] beawesomeinstead has joined the channel [08:36] beawesomeinstead has joined the channel [08:36] bartt has joined the channel [08:37] bartt has joined the channel [08:38] Druid_ has joined the channel [08:38] bartt has joined the channel [08:39] bartt has joined the channel [08:39] bartt has joined the channel [08:41] bartt has joined the channel [08:41] bartt has joined the channel [08:42] bartt has joined the channel [08:44] bartt has joined the channel [08:45] bartt has joined the channel [08:45] bartt has joined the channel [08:46] bartt has joined the channel [08:46] peutetre has joined the channel [08:47] bartt has joined the channel [08:47] bartt1 has joined the channel [08:48] bartt has joined the channel [08:50] guybrush: _announcer is dead? :/ [08:57] AAA_awright: ACTION hugs _announcer [08:58] AAA_awright: ACTION hugs CIA-95 [08:58] CIA-95: ACTION hugs AAA_awright [08:58] AAA_awright: hmm [09:03] jspiros has joined the channel [09:05] d0k has joined the channel [09:06] derren13 has joined the channel [09:07] SubStack: bah I just want a char pointer from these Buffer objects [09:07] SubStack: I hate C. So much [09:10] nooder: can someone recommend working gzip module? [09:16] markwubben has joined the channel [09:16] henrikh has joined the channel [09:18] SubStack: also I HATE HATE HATE that stupid : crap after a subroutine definition [09:18] SubStack: saving several clock cycles is not an acceptable justification for that crap [09:19] Nohryb has joined the channel [09:20] Moominpapa: lol [09:21] Fenda: with socket:io can i send a msg to client if i only know their sessionId? so far i can only figure out client.send() whilst inside the socket.on('connect', function(client) { event [09:21] SubStack: anyways the compiler is smart enough to optimize that away anyhow [09:21] Moominpapa: @Fenda just set up closures within the socket.on [09:21] SubStack: OR, dnode [09:22] SubStack: juggling sessions around for complicated stuff is madness [09:22] SubStack: you quickly end up writing your own message dispatcher [09:25] faust45 has joined the channel [09:26] Moominpapa: ...that's also a good answer ;) [09:27] SvenDowideit_ has joined the channel [09:27] SubStack: of course, I tend not to write 'typical' programs, so your mileage may vary [09:28] Fenda: SubStack: can dnode be used for this case? scenario is client sends message to server which contains sessionId they are targeting, sever relays message to given sessionId [09:28] Fenda: this is relating to socket:io sessionIds btw [09:31] Moominpapa: Hmph, I probably should have realized this before, but I've just noticed that sass.js and less.js were not created even vaguely equal. [09:37] mscdex: ACTION shakes a fist at ncurses [09:38] zomgbie has joined the channel [09:40] SubStack: Fenda: well in both dnode and vanilla socket.io it would look pretty similar [09:40] SubStack: simpler in dnode of course [09:41] SubStack: I think, thinking [09:41] Fenda: SubStack: so it can be done in socket:io? [09:41] SubStack: well yes [09:42] Fenda: SubStack: ive been wrecking my brains for a while now, still cant get my head around the nodejs way of things :D too simple its complicated [09:42] Fenda: any tips on implementing a solution in socket:io? [09:43] SubStack: look at the chat server example [09:43] Fenda: SubStack: this? https://github.com/ry/node_chat/blob/master/server.js [09:44] SubStack: looks like it [09:44] Gruni has joined the channel [09:45] SubStack: just keep a hash clients around and populate it when clients connect, keyed with the session id [09:45] SubStack: then you can clients[id].send(msg) [09:48] ilpoldo has joined the channel [09:49] Fenda: SubStack: thanks, will try :) [09:49] SubStack: Fenda: but here, I'll just whip up something with dnode real quick [09:49] Fenda: SubStack: would be much appriciated [09:56] ewdafa has joined the channel [09:58] Throlkim has joined the channel [10:00] MattJ100 has joined the channel [10:01] fly-away has joined the channel [10:09] mohiam_ has joined the channel [10:12] Wizek has joined the channel [10:14] Wizek has joined the channel [10:15] Wizek: Hi! How to install NPM to Cygwin? [10:15] Wizek: the usual curl command failed [10:16] Wizek: with this error: [10:16] Wizek: http://prntscr.com/176y8 [10:21] stephank has joined the channel [10:26] femtoo has joined the channel [10:34] Tim_Smart has joined the channel [10:34] guybrush: mh Step works only with 2 arguments isn't it? iterrating through some uris and calling `request({uri: currUri}, group());` just wont work, when request passes 3 arguments to the callback [10:35] derren13 has joined the channel [10:35] guybrush: https://github.com/creationix/step/blob/master/lib/step.js#L112 [10:44] Heldroe: is there an example somewhere showing how to use modules to make "classes" ? [10:44] fangel: depends what you mean by "classes" I guess, since JS doesn't really have the notion of classes.. :) [10:45] Heldroe: something I can make objects with [10:45] SubStack: Heldroe: http://nodejs.org/api.html#modules-324 is a good place to start [10:46] Heldroe: SubStack: I already found this but this is a too simple example [10:46] SubStack: Heldroe: browsing github folks is another good way [10:47] SubStack: you can click the git links on a lot of these: http://npm.mape.me/ [10:47] Locke23rus has joined the channel [10:48] SubStack: Fenda: writing code to demonstrate client-to-client messages actually entails a lot of other stuff, incidentally [10:48] SubStack: like making a ui [10:50] pandark_ has joined the channel [10:51] SubStack: bah, .h files are such a bad idea [10:52] SubStack: because now all of the sudden I see fields that aren't parameters and are only mentioned once in the whole .cpp file and have to go hunt them down into another file [10:53] SubStack: why are all these bad ideas that modern languages have discarded still alive and well in c++ grumble grumble [10:53] tprice has joined the channel [10:55] SubStack: well ruby does the same thing with class-scope, but it only shows up when you do class_eval hackery [10:55] SubStack: or you def Class.overridden [10:56] SubStack: but at least static and instance variables have special sigils [10:56] bnoordhuis has joined the channel [10:56] Evet has joined the channel [10:58] Heldroe: SubStack: thanks for the link but these are essentially libs and mostly not using what I'm looking for. So I'm back to the circle example, is it correct to do multiple require on the same file to make multiple objects ? [11:00] SubStack: wait what [11:01] SubStack: yes, they aren't "essentially libs" they are libs [11:01] SubStack: Heldroe: no, node caches requires [11:01] SubStack: just export a function [11:01] ThePub has joined the channel [11:02] henrikh: Where would I ask Express questions? [11:03] xla has joined the channel [11:03] Heldroe: SubStack: what if I want to make multiple circles ? [11:04] ThePub has joined the channel [11:04] SubStack: in circle.js: module.exports = function () { /* ... */ } [11:04] SubStack: var Circle = require('circle'); var c = new Circle [11:05] SubStack: that's how I usually do it [11:05] ThePub has joined the channel [11:06] SubStack: Heldroe: you can learn lots of tricks by browsing those github modules [11:06] SubStack: there are a lot of ways to write javascript [11:09] SubStack: aha ObjectWrap classes have a handle_ [11:10] aliem has joined the channel [11:12] JimBastard: hey SubStack [11:12] JimBastard: wanna see something neat? [11:13] SubStack: sure [11:13] JimBastard: https://github.com/Marak/response [11:14] JimBastard: gotta add lics and publish, but its working [11:14] JimBastard: fucking response.addHeader [11:14] JimBastard: take that middleware glues! [11:14] mAritz has joined the channel [11:14] SubStack: pesky stuff [11:15] zorzar has joined the channel [11:15] SubStack: JimBastard: and while you're there, please add some sugar for content-type [11:15] Tim_Smart has joined the channel [11:15] JimBastard: SubStack: how so? can you create issue? [11:15] SubStack: res.type('text/plain') would be boss [11:15] JimBastard: why cant you just use the key value pair? [11:15] sveimac has joined the channel [11:15] SubStack: does setHeader return res? [11:16] SubStack: JimBastard: because Content-Type is fucking annoying to type [11:16] JimBastard: it doesnt return anything? [11:16] JimBastard: look at the code [11:16] JimBastard: SubStack: not gonna do that, key value is a good convention imo [11:16] SubStack: -_- [11:16] SubStack: .type() would be special sugar [11:16] SubStack: or .content() or some such [11:17] SubStack: common stuff deserves shorter syntax [11:17] SubStack: huffman codings and what-not [11:17] SubStack: also if these res methods return res you could chain them [11:17] JimBastard: why? [11:17] JimBastard: would i need that? [11:17] SubStack: well then you can do: [11:18] SubStack: res.type('text/plain').write('pow!') [11:18] JimBastard: hrmmmmm [11:18] JimBastard: i like that [11:18] SubStack: ^_^ [11:18] JimBastard: how i can haz [11:18] JimBastard: maybe not [11:18] SubStack: just `return this` in your methods [11:18] JimBastard: one step at a time perhaps [11:18] SubStack: should be easy to add [11:20] SubStack: oh here [11:20] ThePub has joined the channel [11:20] rchavik has joined the channel [11:22] SubStack: now testing [11:27] SubStack: hmmm need to pull another trick [11:29] ph^ has joined the channel [11:29] saikat has joined the channel [11:30] sveimac has joined the channel [11:30] robmason has joined the channel [11:32] SubStack: yay [11:32] austincheney: is root level administration required to install node? [11:33] SubStack: austincheney: no [11:33] matjas has joined the channel [11:34] austincheney: when I was installing node it was wanting to access a folder /usr/local/include [11:34] austincheney: but I do not have perimission to write write local to usr [11:34] SubStack: austincheney: ./configure --prefix=$HOME/someplace [11:35] SubStack: JimBastard: https://github.com/substack/response :D [11:36] JimBastard: SubStack: i just dont know if i like "type" [11:36] JimBastard: looks good aside form that [11:36] SubStack: .dataType() maybe [11:37] SubStack: or .mime [11:37] zemanel has joined the channel [11:38] SubStack: JimBastard: oh another thing you could do to avoid ire is take http as an argument to response [11:38] JimBastard: how so? [11:40] SubStack: well, module.exports = function (http) { /* ... */ } is one way [11:40] JimBastard: whats the benefit of that? [11:40] SubStack: well if you copy over http references then you don't break stuff that uses http the 'regular' way [11:41] JimBastard: theres no breakage with response right now [11:41] JimBastard: its only adding on [11:41] SubStack: but that limits you to stuff that won't break http [11:41] SubStack: you might want to break function calls that are stupid [11:42] maqr has joined the channel [11:42] JimBastard: [03:41] but that limits you to stuff that won't break http [11:43] JimBastard: that sounds nice [11:43] saschagehlich has joined the channel [11:43] JimBastard: i should sleep [11:44] ThePub has joined the channel [11:45] mikew3c_ has joined the channel [11:49] mAritz1 has joined the channel [11:49] jacobolus has joined the channel [11:49] henrikh: Why isn't .render always called last in Express? [11:49] Wizek: Hi! How to install NPM to Cygwin? [11:50] Wizek: the usual curl command failed [11:50] Wizek: with this error: [11:50] Wizek: http://prntscr.com/176y8 [11:51] christophsturm has joined the channel [11:56] tanepiper: https://github.com/github/gitignore [11:58] jelveh has joined the channel [11:58] jacobolus has joined the channel [12:00] ThePub has joined the channel [12:01] ThePub has joined the channel [12:04] unomi has joined the channel [12:04] Throlkim has joined the channel [12:14] jelveh has joined the channel [12:14] jstemmer has joined the channel [12:16] cloudhead has joined the channel [12:19] _mythz has joined the channel [12:35] jdrannbauer has joined the channel [12:35] davidc_ has joined the channel [12:36] WaterCooled has joined the channel [12:41] saschagehlich has joined the channel [12:45] felixge has joined the channel [12:45] felixge has joined the channel [12:47] Twelve-60 has joined the channel [12:53] Evet has joined the channel [12:57] mraleph has joined the channel [13:04] nsolsen has joined the channel [13:11] maushu has joined the channel [13:13] mklappstuhl has joined the channel [13:23] _mythz has left the channel [13:27] kriszyp has joined the channel [13:32] WaterCooled has joined the channel [13:38] WaterCooled:  [13:38] matjas has joined the channel [13:43] ben_alman has joined the channel [13:52] pdelgallego has joined the channel [13:59] svnlto has joined the channel [14:00] adambeynon has joined the channel [14:00] bsstoner has joined the channel [14:02] vdrab has joined the channel [14:06] ysynopsis has joined the channel [14:06] ysynopsis has left the channel [14:10] c4milo has joined the channel [14:11] jvolkman_ has joined the channel [14:14] wilmoore has joined the channel [14:16] AAA_awright_ has joined the channel [14:21] mohiam has joined the channel [14:23] Ori_P has joined the channel [14:28] saml has joined the channel [14:28] aubergine has joined the channel [14:28] saml: hey, v8 comiles on 64bit? [14:29] bnoordhuis has joined the channel [14:29] saml: do you have 64bit OS and compile node.js easily? [14:32] saml: what is bbdd61d ? [14:33] fangel has joined the channel [14:40] pagameba1 has joined the channel [14:45] bnoordhuis: saml: looks like a git commit hash [14:45] saml: oh i see [14:45] bnoordhuis: are you running into issues or was that just an off-the-cuff remark? [14:46] saml: off the cut. since i had trouble building v8 on 64bit [14:46] bnoordhuis: what platform? [14:46] saml: but i'm on 32bit.. so i can't be sure now.. so i just asked. [14:46] prat has joined the channel [14:46] saml: 64bit on linux before (archlinux) [14:46] bnoordhuis: shouldn't be a problem [14:46] saml: but that's like a year ago (for v8) [14:46] bnoordhuis: v8 compiles cleanly for me on x86_64 ubuntu [14:47] saml: oh nice [14:47] masahiroh has joined the channel [14:47] saml: their website still says IA-32 and ARM [14:47] bnoordhuis: i don't think mraleph and his fellow googlers update the site often [14:48] ossareh has joined the channel [14:48] bnoordhuis: lots of stuff on there that is outdated [14:48] EliasAmaral has joined the channel [14:48] saml: i see. but i think node.js should earn the WebScale Product of the Year [14:48] saml: it's like.. the best experience i had for the first day. [14:49] saml: i see people wrapping their stuff into process.nextTrick(function() { ... what's the reason ? [14:49] c4milo: saml: they are missing the normal paradigm :P [14:50] saml: setTimer stuff? [14:50] saml: so, if i don't encounter problem, i shouldn't be using process.netxtTick [14:51] c4milo: saml: non event driven programming [14:51] bnoordhuis: saml: it chops up computation into slices, gives node a chance to fire off events, timers, etc. [14:51] c4milo: nextTick is when people want to execute something in the next tick of the node event loop [14:51] saml: so is it recommended? [14:51] bnoordhuis: if you never relinquish control, none of that would happen [14:52] saml: oh i see [14:53] c4milo: saml: it depends , if you need to run something exactly in the next tick, yes. [14:53] saml: so, every function should be: function(....) { process.nextTick(function() { .....}); } [14:53] saml: for long running function [14:53] bnoordhuis: saml: no, only if you have some long-running computation and you don't want to block everything else [14:54] c4milo: you might use event driven programming as much as you can, that's the real power of nodejs [14:54] saml: wait.. but all IO is event driven... i don't think t here will be long runing blocking function [14:54] c4milo: s/might/should/i [14:54] bnoordhuis: saml: say you were calculating pi to 10^12 places, then you would call nextTick() every 10,000 digits or so [14:54] saml: maybe response.write() this could be blocking [14:55] saml: ah i see [14:55] saml: is there a reason why v8 was chosen instead of , say, lua? [14:55] bnoordhuis: response.write() is non-blocking, by the way [14:56] bnoordhuis: and v8 because lots of people know javascript, not that many know lua [14:56] unomi has joined the channel [14:56] c4milo: that's the other key point of nodejs :) you can share code between server and client :) [14:56] saml: oh. then response.write(data1) ; response.write(data2); will screw up? [14:57] bnoordhuis: saml: no, node will buffer them internally [14:57] saml: ah nice [14:57] c4milo: in its event loop [14:57] gf3 has joined the channel [14:57] c4milo: queue [14:57] bnoordhuis: queue... that was the word i was looking for [14:58] Wizek: Is there a mongodb driver for Node.js which can be installed without npm? npm doesn't install on cygwin. [14:58] c4milo: mongoose ? [14:58] c4milo: is the most popular [14:58] c4milo: http://www.learnboost.com/mongoose/ [14:59] maushu has joined the channel [15:00] Wizek: c4milo: let me check [15:00] hornairs has joined the channel [15:00] stagas has joined the channel [15:04] Wizek: c4milo: For the var mongoose = require('mongoose/').Mongoose part, the path to mongoose has to be relative to what? It says it cannot find the plugin, but I copied mongoose stuff into node/mongose [15:04] Dreamer3 has joined the channel [15:04] johan_bouveng: mongoose is nixe [15:04] johan_bouveng: nice [15:06] Wizek: johan_bouveng: Okay, but how to get it working? :) [15:07] mikedeboer has joined the channel [15:07] c4milo: Wizek: the paths by default in which node look for libraries [15:07] c4milo: but also you can specify a relative path [15:07] oal has joined the channel [15:07] Wizek: lob? [15:07] Wizek: *lib? [15:08] jacobolus has joined the channel [15:08] malkomalko has joined the channel [15:09] c4milo: Wizek: I don't know remeber :$ [15:10] Blink7 has joined the channel [15:12] c4milo: Wizek: defaultPaths.push(path.join(process.env.HOME, ".node_modules")); [15:12] c4milo: defaultPaths.push(path.join(process.env.HOME, ".node_libraries")); [15:12] saml: hey, am I doing it right around this: https://github.com/saml/nodejs-resize-image/blob/master/src/main.js#LID73 fs.createReadStream() returns stream... but what if it starts to read stuff before I register .on()? [15:17] cjm has joined the channel [15:18] InsDel has joined the channel [15:18] fangel has joined the channel [15:18] henrikh has joined the channel [15:20] AAA_awright has joined the channel [15:21] rtomayko has joined the channel [15:24] uzyn has joined the channel [15:29] skampler has joined the channel [15:36] felixge has joined the channel [15:36] felixge has joined the channel [15:37] bnoordhuis: saml: it won't (start reading before you get a chance to register event listeners, that is) [15:37] pagameba1: saml: it won't. All the synchronous code runs together before the next event is dispatched which means your serveFile function will run to completion before the 'data' event [15:38] pagameba1: lol [15:38] ooooPssss has joined the channel [15:39] mbrochh has joined the channel [15:40] bnoordhuis: pagameba1: great minds eh? :) [15:41] pagameba1: bnoordhuis: :) [15:41] stepheneb has joined the channel [15:41] saml: bnoordhuis, pagameba1 oh thanks [15:41] saml: i was so worried about my web scale skills [15:44] cognominal has joined the channel [15:44] WRA has joined the channel [15:46] boaz has joined the channel [15:46] marshall_law has joined the channel [15:47] bsstoner has left the channel [15:47] tylerstalder has joined the channel [15:47] herbySk has joined the channel [15:48] tylerstalder has joined the channel [15:50] unomi has joined the channel [15:51] johan_bouveng: Wizek: i just jused npm. [15:51] johan_bouveng: used [15:52] Nohryb has joined the channel [15:52] skiz has joined the channel [15:57] bentruyman has joined the channel [15:58] Wizek: johan_bouveng: With cygwin? [16:06] johan_bouveng: Wizek: no, linux, on a t1.micro at amazon [16:06] Aikar: man [16:07] Aikar: i thought this was my irc channel and iw as like 'whoa someone in my channel is using node' [16:07] pagameba1: lol [16:07] monokrome: lol [16:14] ceej has joined the channel [16:16] masahiroh has joined the channel [16:16] cjm has joined the channel [16:18] dnolen has joined the channel [16:24] Evet has joined the channel [16:26] Evet has joined the channel [16:31] ThePub has joined the channel [16:31] Wizek: What is the fastest way to test wheter mongose is installed and working? [16:31] Wizek: Whyt code? [16:31] Wizek: *what [16:32] jchris has joined the channel [16:33] saikat has joined the channel [16:36] unomi has joined the channel [16:38] markwubben has joined the channel [16:40] intacto has joined the channel [16:43] markwubben has joined the channel [16:44] Wizek: can you give me a sample code with mongoose so that I can play/experiment with it? [16:46] steffkes: hm, how to debug "ECONNRESET, Connection reset by peer" .. this scripted works until two minutes ago, w/o changes -.- [16:46] aho has joined the channel [16:49] pagameba1: steffkes: some context? [16:50] c4milo has left the channel [16:50] saschagehlich has joined the channel [16:51] ThePub has joined the channel [16:51] jetienne has joined the channel [16:51] steffkes: pagameba1, of course .. if you could tell me, what infos would be helpful. just played around with Node-AWS. and until to minutes ago, every request works fine, no unexcepted node-proccess-exit .. and now, node exists with the given error [16:52] steffkes: i've added on 'error' listener on request.socket .. but this only handles the error, still no idea why this comes up :/ [16:52] jpld has joined the channel [16:52] trotter has joined the channel [16:53] pagameba1: steffkes: some code would be help, perhaps a gist or pastebin url? [16:54] steffkes: pagameba1, yeah, but what to paste? complete error-message .. if course, requested url, anything else? [16:55] pagameba1: any relevant code you've written [16:57] dgathright has joined the channel [17:00] MattJ: Anyone know why Node sometimes gets unhappy printing lots of data to stdout? [17:01] aubergine has joined the channel [17:01] MattJ: It looks like "unhappy" == hangs, and then exits [17:01] mjr_: MattJ: I think it's the same unhappy as when node gets a giant outgoing queue to any filedescriptor [17:01] MattJ: I see, not encountered that before [17:01] mjr_: Which is to say, annoying. [17:02] MattJ: Any pointers? [17:02] mjr_: If you know you are going to exit anyway, you can use util.error to make sure it flushes. [17:02] MattJ: ok, thanks [17:03] liar has joined the channel [17:06] steffkes: pagameba1, changing https to http connection helps .. reason, unknown -.- [17:07] skiz has joined the channel [17:08] pagameba1: steffkes: :) [17:10] markwubben has joined the channel [17:11] dgathright_ has joined the channel [17:13] ThePub has joined the channel [17:17] ThePub has joined the channel [17:17] Insanity5902 has joined the channel [17:19] ThePub has joined the channel [17:20] ThePub has joined the channel [17:20] sivy has joined the channel [17:21] tanepiper: grr, i wish JSON.parse would not throw exceptions on already parsed strings [17:21] dgathright has joined the channel [17:22] elijah-mbp has joined the channel [17:24] olivvv_ has joined the channel [17:24] ThePub1 has joined the channel [17:25] ThePub has joined the channel [17:28] ysynopsis has joined the channel [17:28] marshall_law_ has joined the channel [17:28] mape: tanepiper: make a wrapper? :) [17:30] mjr_: I wish JSON.parse would give you reasonable error messages that help you find the actual problem. [17:31] programble has joined the channel [17:31] programble has joined the channel [17:31] altamic has joined the channel [17:35] tanepiper: mape: yea, basically i;ve done a try {} catch around ut [17:35] tanepiper: if it throws, just pass the existing one, otherwise parse the sub-object/array [17:37] tanepiper: but it's annoying, parsing a string should not throw an exception, it should just return the string [17:38] prettyrobots has joined the channel [17:39] mape: aho: Neat with the PNG :) How much of a pita is it to make it 2x2px? I've had some issues with IE instead of repeating the pixel stretching it and causing ugly gradients [17:39] aho: 2x2 would be a bit more complicated [17:40] aho: well, i don't see how stretching it may cause gradients [17:40] mape: I don't either, but I've had the issue multiple times [17:40] mape: On multiple machines (coworkers testing and whatnot) [17:40] aho: with ie7 and ie8? [17:40] muk_mb has joined the channel [17:40] mape: IE8 running in compat mode if I recall correctly [17:41] mape: But I had a 1x1 255,255,255,0.8 png, and it strethed into a gradient from 255,255,255,0.8 to 0,0,0,0 at the bottom right with the middle bleeding black [17:41] aho: and it's fine with 2x2? [17:41] mape: Yeah [17:41] mape: Makes no sense at all.. [17:42] mape: And wasen't just one color, same on different colors, just seemed to be the 1px size [17:42] mape: aho: http://www.rachaelarnold.com/dev/archive/ie-gradient-bug-with-png-24 [17:42] aho: http://stevelove.org/2009/07/10/png-background-repeat-bug-in-internet-explorer-7-and-8/ [17:42] mape: like the bottom circle image [17:42] aho: heh [17:43] aho: ie is f-ing disgusting :) [17:43] mape: hehe yeah.. [17:43] mape: Annoying that you have to patch the pather to fix stuff in IE.. [17:43] aho: :> [17:44] aho: well, i can make a 2x2 version later (the tricky parts were crc32, adler32, and base64) [17:44] aho: but i need some food first [17:44] aho: ;) [17:45] mape: Hehe k, awsome [17:45] mikew3c_ has joined the channel [17:47] hornairs: anyone here using node_redis? [17:47] mape: hornairs: ask mjr_ :) [17:47] mjr_: what's up, hornairs [17:48] hornairs: mjr can you tell me how to do a sort? im doing client.sort(["bIds", "LIMIT #{currentChunk * chunkSize} #{chunkSize}", "GET \"bid_*->price\"", "GET \"bid_*->shares\"", "GET \"bid_*->bidder\""], callback) right now [17:48] hornairs: doesnt seem to work, but the same command with redis_cli does [17:48] hornairs: thanks for your help! [17:48] mjr_: send each element of the command as a separate arg instead of a large string [17:48] hornairs: mjr_ so each limit arg and such? why is that? [17:49] mjr_: sort("bids", "limit", 2, "get", "bid_*->price") etc [17:49] mjr_: redis-cli is splitting these out for you, but in code, you need to split th em yourself. [17:50] mjr_: I think there's an example of sort in there, lemme look [17:51] hornairs: mjr_, works great, thanks [17:51] mjr_: examples here: https://github.com/mranney/node_redis/blob/master/test.js#L897 [17:53] confoocious has joined the channel [17:58] aconbere has joined the channel [18:00] richcollins has joined the channel [18:02] richcollins: My node process is silently exiting after hours of operation. Anyone else experience this? If so, what was the problem? [18:02] marshall_law has joined the channel [18:02] jpld has joined the channel [18:02] jpld has joined the channel [18:05] SamuraiJack_ has joined the channel [18:05] pagameba1: richcollins: haven't seen it, I have some processes that have been running for many days/weeks now without restart [18:05] richcollins: pagameba1: I'm going to hook "exit" and see if the process is exiting normally or if its crashing [18:06] pagameba1: richcollins: sounds like a plan :) [18:11] mscdex: richcollins: do you have a listener set up for the unhandledException event? [18:12] richcollins: mscdex: No, but shouldn't that be written to stderr? [18:12] richcollins: That is what I've seen when there is an unhandledException [18:12] mscdex: ah ok [18:15] AAA_awright_ has joined the channel [18:16] ehaas has joined the channel [18:18] adambeynon has joined the channel [18:31] galaxywatcher has joined the channel [18:34] jacobolus has joined the channel [18:37] Aria has joined the channel [18:38] slaskis has joined the channel [18:39] aconbere has joined the channel [18:39] alek_br has joined the channel [18:40] slaskis: does anyone know it ejs has changed so that 'this' does not exist anymore? i've used it in an old project that doesn't seem to run anymore after updating. but i've tried old versions of it and it still doesn't work... [18:40] googol has joined the channel [18:40] alek_br_ has joined the channel [18:41] alek_br_ has joined the channel [18:43] adambeynon has joined the channel [18:44] richcollins has joined the channel [18:45] jashkenas has joined the channel [18:46] richcollins: Has anyone had any luck getting node to run under launchd? [18:46] richcollins: I get: Inappropriate ioctl for device [18:47] jashkenas has left the channel [18:47] slaskis: actually i just found out why, since express 1.0 rc4 it doesn't pass the app as scope to the views anymore [18:51] femtoo has joined the channel [18:54] henrikh has joined the channel [18:54] googol has joined the channel [18:55] hamsterspider has joined the channel [18:57] herbySk has joined the channel [19:03] matjas has joined the channel [19:04] olivvv_: I m pretty node, trying to load socket.io, but it doesnt work [19:05] olivvv_: ath issue apparently but I ve tried many different thing around var io = require('./olivvv/node/socket.io'); [19:05] olivvv_: error is : [19:05] olivvv_: node.js:63 throw e; [19:06] rhymes has joined the channel [19:06] ehaas: you running that in the console? [19:06] olivvv_: Error: cannot find module './olivvv/node/socket.io' [19:06] olivvv_: yep [19:06] ehaas: what version of node [19:07] ehaas: i think some older versions had a problem with require in the console, but worked if it was in a program you were running [19:07] olivvv_: 2010.10.24, Version 0.2.4 [19:07] olivvv_: so pretty recent [19:08] ehaas: try putting it in a standalone program and running that…see if it throws the error [19:08] xla has joined the channel [19:08] olivvv_: in my node directory there is a socket.io folder so the download from github seems ok [19:09] olivvv_: yep it is really the require [19:10] olivvv_: if I comment / uncomment it it triggers the error [19:12] olivvv_: ok, sry solved [19:12] olivvv_: I just tried a different path [19:12] olivvv_: but is there a function like in php to say where the current file is ? [19:13] matjas has joined the channel [19:14] ehaas: __dirname [19:14] mscdex: olivvv_: yes, __filename for full path to the current script and __dirname for the full path without the script's filename [19:14] olivvv_: thx! [19:16] brianmario has joined the channel [19:16] jashkenas has joined the channel [19:21] jchris has joined the channel [19:21] markwubben has joined the channel [19:24] Anti-X has joined the channel [19:28] admc has joined the channel [19:28] Wizek: what is the problem in this very simple code? http://prntscr.com/178rc I just cannot get started with mongoose. [19:30] dtrasbo has joined the channel [19:35] stagas: Wizek: maybe it's db.noSchema [19:38] dnolen has joined the channel [19:40] mh` has joined the channel [19:41] mh`: hi all, a quick google didn't turn up much.. is there a way to get require-aware code completion going in netbeans or eclipse? (or another IDE, though i'd prefer one of those) [19:43] monokrome: ACTION would like that in Vim [19:44] mh`: really having it in any editor would be nice, but we use eclipse and netbeans for our other server-side stuff so it'd be helpful if I could keep it all in one place :) we've got JIRA integration and stuff [19:44] monokrome: http://pcwalton.blogspot.com/2010/05/introducing-jsctags.html [19:44] monokrome: :D [19:44] skampler has left the channel [19:45] skampler has joined the channel [19:45] mh`: we basically just need a javadoc-type dump from node api [19:45] mh`: to make it work on a basic level [19:45] monokrome: What's wrong with ctags? [19:46] mh`: oh, i didn't see your link, heh.. checking :) [19:46] monokrome: Just found it... A quick Google search. [19:46] mh`: the project is deleted on github.. [19:46] mh`: =\ [19:46] mh`: https://github.com/pcwalton/jsctags/ [19:47] softdrink has joined the channel [19:47] mh`: looks like this guy forked it though - https://github.com/evilpie/jsctags [19:47] monokrome: http://pcwalton.blogspot.com/2010/10/jsctags-is-now-known-as-doctorjs.html [19:47] mh`: ahha [19:47] cjm has joined the channel [19:47] mh`: thanks, ill check this out [19:48] zimbatm has joined the channel [19:49] RevoOf1 has joined the channel [19:51] slaskis has joined the channel [19:52] Wizek: stagas: Same error [19:53] blacksunsfo has joined the channel [19:53] liar has joined the channel [20:02] jpld has joined the channel [20:06] pagameba has joined the channel [20:12] atmos has joined the channel [20:19] prettyrobots has joined the channel [20:21] delapouite has joined the channel [20:26] RevoOf has joined the channel [20:29] Wizek: Could someone save my day and help me out of the Node.js - Mongoose - MongoDB confusion I'm in currently? I cannot make these three to work together, and node gives me unhelpful error msgs only... :< [20:32] mikeal1 has joined the channel [20:33] mAritz: Wizek: without knowing more about your problems, we can't help you [20:34] mikeal1 has joined the channel [20:34] bentomas has joined the channel [20:35] Wizek: mAritz: here is one: http://prntscr.com/178rc [20:35] Wizek: very simple code, but fails [20:37] mAritz: that error isn't too cryptic [20:37] Wizek: Isn't it? [20:37] mAritz: you're trying to acces someObject.noSchema on line 8 of t3-mongoose.js which is not set. [20:38] itissid has joined the channel [20:38] Wizek: But how else am I supposed to get started with mongoose? I copied this code from here: http://www.learnboost.com/mongoose/ [20:39] cjm has joined the channel [20:41] rslifka has joined the channel [20:41] Wizek: mAritz: I mean, I know, that this code is wrong, but how could I fix it? [20:41] itissid: Hey I am running a process in C++ that is contacted by node.js... The process is connected to by net.Stream from node. It writes some data to node.... The O/P data encoding of the process seems fine on my terminal.... How ever it gets screwed in node on newline chars... [20:42] rslifka: hey guys, having a heck of a time getting node to start via upstart and keep a ulimit -n > 1024 [20:42] itissid: Node shows weird boxes on newline... [20:42] itissid:  [20:42] bpadalino: are you using the right encoding for the buffer ? [20:43] rslifka: anyone running node.js as a daemon with nofiles > 1024? [20:43] bpadalino: text is complicated [20:43] itissid: bpadalino: I tried utf8 and ascii [20:43] Insanity5902 has joined the channel [20:43] itissid: The o/p is fine on my node terminal till the new line comes.. [20:44] bpadalino: what is the value of the box? 0xa ? [20:44] Insanity5902 has joined the channel [20:44] itissid: Well that was when i pasted it onto the IRC terminal [20:44] itissid: Dunno if its translated right from terminal=>IRC BOX=> IRC Screen.. [20:45] bentomas has left the channel [20:45] itissid: I just want to debug it.. Is there a general method on ow to handle these ? [20:46] mAritz: Wizek: i suspect the website examples aren't up to date [20:47] mAritz: look at the github repo itself. it should contain up-to-date examples/docs [20:48] itissid: The raw buffer has 06 0a [20:48] MikhX has joined the channel [20:48] itissid: at the end [20:49] jchris has joined the channel [20:49] itissid: What does that tell me? [20:50] aubergine has joined the channel [20:50] bpadalino: 06?? [20:50] bpadalino: there is an ACK in there?! [20:50] itissid: ACK? [20:50] bpadalino: http://www.asciitable.com/ [20:52] trotter has joined the channel [20:53] aubergine_ has joined the channel [20:54] itissid: bpadalino: Looks like I will have to read the handshake in TCP/datagrams... ACK should not be there.. [20:54] hellp has joined the channel [20:55] bpadalino: i haven't really ever seen anyone use ack in an ascii stream before [20:55] bpadalino: comes as a little bit of a surprise [20:56] mikedeboer has joined the channel [20:56] mr_daniel has joined the channel [20:57] evanmeagher has joined the channel [20:58] skiz has joined the channel [20:58] jmmcleod14 has joined the channel [20:59] itissid: bpadalino: Actually i am using libevent in my C++ .. [20:59] itissid: That may be causing some probelms [20:59] bpadalino: okie dokie [21:01] itissid: bpadalino: Thanks [21:01] bpadalino: good luck [21:02] jakehow has joined the channel [21:02] sstreza has joined the channel [21:02] itissid: ryah: Hey do you know where the lib event people hang out? [21:02] itissid: I tried #posix [21:03] itissid: Not libev [21:04] sstreza has joined the channel [21:04] mohiam has joined the channel [21:10] alek_br has joined the channel [21:11] marshall_law has joined the channel [21:12] ryah: itissid: no [21:12] sudoer has joined the channel [21:14] rbranson: one day I will be a "lib event people" [21:14] ryah: :) [21:15] rbranson: we all have our aspirations [21:16] markwubben has joined the channel [21:16] AAA_awright has joined the channel [21:16] ryah: http://buildbot.nodejs.org/waterfall [21:17] ryah: http://build.nodejs.org/ [21:17] ryah: warring CI systems [21:17] rbranson: wtf... ldirectord is written in perl? [21:18] rbranson: nice [21:18] rbranson: http://horms.net/projects/ldirectord/download/ldirectord-latest [21:18] rbranson: this is horrible [21:18] mikedeboer has joined the channel [21:20] markwubben has joined the channel [21:26] ryah: *hacking v8 makes me feel hardcore* [21:26] MikhX has joined the channel [21:27] blacksunsfo has joined the channel [21:27] ryah: (even if my hacking is just scratching the surface) [21:27] rbranson: i guess that's better than driving a v8 making you feel hardcore :D [21:28] richcollins has joined the channel [21:29] rbranson: V8 is kind of a mindfuck for me... I have to keep reminding myself that the v8::string, v8::integer, etc type classes are just wrappers around data in the V8 heap, and not data storage classes themselves [21:32] polotek has joined the channel [21:33] maushu: Dammit, vbox is taking too long to resolve domains. [21:33] siculars has joined the channel [21:34] jmmcleod14 has left the channel [21:35] austincheney: how can I use php to execute node? [21:35] rbranson: why? [21:35] RevoOf: you could just start it as you were doing from the command line: http://php.net/manual/de/function.exec.php [21:36] RevoOf: still why is a good question ... [21:36] maushu: Bad bad bad! [21:36] rbranson: well he might be interested in doing like an RPC [21:36] rbranson: and not actually starting a new node [21:36] RevoOf: node could do that^^ [21:37] blacksunsfo has joined the channel [21:44] indexzero has joined the channel [21:44] indexzero: javascript party in the room [21:46] comster: ACTION dances [21:46] mraleph: not the worst kind of party [21:46] zomgbie has joined the channel [21:46] austincheney: rbranson: RevoOf the reason why is that I would like people to access my tool written in JavaScript via a URI [21:46] prettyrobots has joined the channel [21:47] AAA_awright: BAD idea [21:47] austincheney: why? [21:47] AAA_awright: PHP preforks or is thread limited or something else, you completely obliterate any peformance advantage Nodejs gives you [21:47] austincheney: ah [21:47] rbranson: yeah put the web server inside of node.js [21:47] AAA_awright: Use a Nginx reverse proxy [21:48] rbranson: you can either forward the requests using your web server as a proxy or you can use some PHP code to do it [21:48] indexzero: why nginx? [21:48] indexzero: AAA_wright: why not a pure nodejs reverse proxy? [21:48] AAA_awright: It's evented like Nodejs [21:48] rbranson: eh [21:48] indexzero: http://github.com/nodejitsu/node-http-proxy [21:48] rbranson: he probably just needs something that will fit into his existing architecture [21:49] rbranson: which is probably apache/mod_php [21:49] indexzero: word [21:49] AAA_awright: indexzero: Sure if you want to setup the web server, and determine which URLs must be handled, all in Javascript [21:49] AAA_awright: I mean, it's not my first choice [21:49] indexzero: AAA_awright: Coming soon to node-http-proxy 0.4.0 ;) [21:49] austincheney: my ultimate objective is to have people use my tool via URI and have the request process a capture of code like a web spider, process that code through my tool, and email the results [21:49] RevoOf: austincheney: http://expressjs.com/ [21:50] austincheney: thanks.... looking [21:50] rbranson: node.js needs a passenger :/ even if it's slower, it's not always all about performance [21:51] Aria: I should code that up. [21:51] Aria: It wouldn't be too hard to modify actual passenger to support a third kind of thing to spawn [21:51] rbranson: i looked into hacking one together for node [21:51] indexzero: rbranson: Why? I don't really see the value add [21:51] rbranson: easy deployment? [21:51] Aria: Deployment with a push into existing non-node infrastructure. [21:52] indexzero: Aria: Yeah, I guess we can't all run 100% nodejs :-D [21:52] rbranson: even then [21:52] Aria: Yeah. I can, but not all can. [21:52] indexzero: rbranson: You mean like www.nodejitsu.com ? [21:52] indexzero: yeah, we do at nodejitsu [21:52] rbranson: even if you are all node [21:52] Aria: Yeah, I have no problem running all-node for some things. [21:52] indexzero: but I could see that being an issue with other multi-language environments [21:52] Aria: I run IPv6, so I can bind different apps to different interfaces. [21:52] Aria: IPv4 might need a proxy, but I'm okay with that. [21:52] rbranson: it's faster to run Rails apps outside of Passenger, but few do [21:53] Aria: Which part is passenger? [21:53] Aria: er. [21:53] Aria: Which part is faster? [21:53] rbranson: ? [21:53] rbranson: Heroku uses Thin and GitHub uses Unicorn [21:53] Aria: I find it much faster to deploy WITH passenger ;-) [21:53] rbranson: lots of people still use packs of Thins for deployment [21:53] Aria: Ah, you mean raw service speed. [21:53] rbranson: especially if you're using some EM stuff [21:54] rbranson: yeah [21:54] rbranson: it's like a 5-10% improvement [21:54] ryah: https://gist.github.com/708209 [21:54] rbranson: which is only valuable for people that operate at scale [21:54] Aria: I think the biggest win for passenger is not needing separate infrastructure for monitoring and startup and teardown. [21:54] rbranson: yeah [21:54] rbranson: it's push-button [21:54] Aria: It becomes part of your existing Apache|NGINX [21:54] rbranson: which is fucking hot [21:54] rbranson: one less thing to worry about [21:54] Aria: Yeah. [21:54] blacksunsfo has joined the channel [21:55] rbranson: honestly, a node.js passenger would propel node's already ridiculous hype to stratospheric levels [21:55] Aria: Probably. [21:56] Aria: Then the real question is what interface you'd expect apps to use -- something like http.Server, or something like jsgi. [21:56] rbranson: there is Jack too [21:56] Aria: Passenger was a success in its timing because people were just starting to standardize on Rack. [21:56] rbranson: Connect does too much [21:56] Aria: (Is Jack != jsgi?) [21:56] rbranson: honestly I think Rack became popular because of Passenger [21:56] rbranson: sorry [21:56] rbranson: Jack = JSGI [21:56] bnoordhuis: fastcgi in single process/multiple connection mode? [21:57] Aria: It was starting to be popular before, too. The rackup utility Chris2 wrote is swooft. [21:57] Craig` has joined the channel [21:57] Craig`: hey [21:57] rbranson: yeah, but honestly if someone makes a node passenger and uses jsgi, suddenly everything would be jsgi [21:57] rbranson: or at least be adaptable to jsgi [21:58] Craig`: im wanting to read my Minecraft .dat file using node, how would i do this? [21:58] bnoordhuis: Craig`: fs.open, fs.read, fs.close [21:58] Craig`: thanks, that simple? [21:58] pagameba: quiet in here today :) [21:58] richcollins has joined the channel [21:59] bnoordhuis: Craig`: that simple :) [21:59] ryah: https://gist.github.com/708211 <-- okay. this is good, i think [21:59] bnoordhuis: you can also use fs.createReadStream [21:59] ryah: going to do some tests later pushing strings directly to socket [21:59] rbranson: this is a patch for V8? [22:00] ryah: yeah [22:00] rbranson: ooo :O [22:00] ryah: get pointers inside the v8 heap of strings [22:00] rbranson: does V8 store strings as UTF8? [22:00] rbranson: or UCS2? [22:00] ryah: utf16 and ascii [22:01] rbranson: o :O [22:01] mscdex: node.js runs on android now right? [22:01] ryah: this only works on ascii strings - can't dump utf16 to a socket [22:01] rbranson: I guess UCS2 is the old school thing to call UTF16 [22:01] ryah: yeah - something like that [22:01] ryah: not even sure if there is a utf16 :) [22:02] rbranson: http://en.wikipedia.org/wiki/UTF-16/UCS-2 [22:02] ryah: whatever - some two byte representtion [22:02] rbranson: haha [22:02] rbranson: so wait [22:02] rbranson: UCS2 is always 2-byte [22:02] rbranson: UTF16 is variable [22:02] ryah: oh, then it must be ucs2 [22:03] ryah: (i'm not sure how it represents higher order characters) [22:03] bnoordhuis: surrogates [22:03] ryah: what does that mean? [22:03] rbranson: UTF-16 (which extends UCS-2 to handle code points beyond the scope of UCS-2). [22:04] zomgbie has joined the channel [22:04] bnoordhuis: a surrogate is a double two-byte sequence [22:04] ryah: most string literals in v8, i think, are single-byte [22:04] bnoordhuis: like what utf-8 does with everything > 127 [22:04] ryah: at least that's my hope [22:04] jashkenas: "In most cases the spec tells us to treat strings as UCS-2, including most string operations like charAt and case conversion. This is not optional, handling surrogate pairs would actually be incorrect according to the spec." [22:05] bnoordhuis: jashkenas: is from the ecmascript spec? [22:05] jashkenas: "In a sense V8 is transparent to UTF-16. It's only when you manipulate the string in JS in certain ways that you risk 'corruption'. For example if you use substring to cut a string in the middle of a surrogate pair then the result will no longer be valid UTF-16." [22:05] rbranson: ah [22:06] ryah: :) [22:06] jashkenas: from this V8 thread from 2008: http://www.mail-archive.com/v8-users@googlegroups.com/msg00225.html [22:06] jashkenas: sounds like a bit of a mess. [22:06] inimino: it is a bit of a mess [22:06] jashkenas: to quote a bit more: [22:07] jashkenas: "ECMA-262 4.3.16 doesn't specify an encoding for JavaScript strings. It specifies that strings are arrays of 16-bit integers. It doesn't specify semantics for those integers. It says each of these integers is "usually" UTF-16 (without suggesting a de/composition) but doesn't specify it." [22:07] inimino: the spec doesn't exactly "tells us to treat strings as UCS-2", though [22:07] jashkenas: fun! [22:07] inimino: it defines everything in terms of UTF-16 [22:07] inimino: it's just that things like .length return the number of code units, not the number of characters [22:07] Aria: Man, I wish V8 had a binary string type. [22:07] inimino: all of this mess is inherited from Java [22:08] bnoordhuis: inimino: does that mean that .length returns 2 for a single surrogate string? [22:08] inimino: bnoordhuis ⋱ yes [22:08] bnoordhuis: that's awful [22:08] Aria: Yeah. . . I'd be happy with strings that were byte arrays. I really would. [22:08] rbranson: Ruby's String is awesome in that respect [22:09] inimino: bnoordhuis ⋱ length is the number of code units, just like the length of a C string containing UTF-8 [22:09] rbranson: but I guess that's what happens when your language is designed in a longer timespan than 10 minutes :D [22:09] rbranson: *trolls* [22:09] inimino: the string stuff is all directly from Java, which did the same thing [22:09] rbranson: blame it on Java! [22:10] inimino: and was designed over a much longer period by a much larger committee :) [22:10] inimino: the real problem is that UCS-2 ever existed [22:10] rbranson: agreed [22:10] rbranson: down with 2-byte characteres [22:10] bnoordhuis: doesn't python still use ucs-2 internally? [22:11] Aria: Using bytes makes sense. You can build bigger sets out of that. [22:11] polotek: I'm glad I rarely have to care enough to understand what you guys are talking about [22:11] Aria: Not so much with 2-byte as a basis [22:11] inimino: UCS-2 is "Oh, Unicode is great, let's just support the common part of it and forget about the rest". [22:11] polotek: inimino: that's a common thing though [22:11] jacobolus has joined the channel [22:11] polotek: the only way to get things done is to do 80% until you need the other 20 [22:12] rbranson: yeah but these are more critical decisions than that [22:12] rbranson: it's shit that gets set in stone [22:12] inimino: polotek ⋱ that would be more compelling if the 100% solution hadn't already existed as UTF-8 [22:12] polotek: rbranson: it's not set in stone. [22:12] polotek: you just have build new systems that do better [22:12] polotek: and get people to use them instead [22:12] bnoordhuis: inimino: but didn't gain traction until the late '90s [22:12] rbranson: or they could have just used UTF-8 [22:13] inimino: UCS-2 was popular with Microsoft, and Java adopted it, and then others adopted it. [22:13] polotek: the biggest problem we have is refusing to let go of legacy [22:13] rbranson: the biggest problem we have is IE6 [22:13] bnoordhuis: utf-8 also has the disadvantage that length calculation is relatively expensive [22:13] indexzero: ACTION is now taking bets on when IE6 will die [22:13] polotek: heh, true for the web. I mean software in general [22:13] bnoordhuis: not so much an issue now, but back then it was [22:14] rbranson: bnoordhuis: you can cache that [22:14] indexzero: the definition of die is < 3% market share [22:14] maushu: Bummer. node-msgpack doesn't work with the last version. [22:14] comster: ACTION pretends ie doesn't exist [22:14] bnoordhuis: rbranson: you still need to calculate it first :) [22:14] rbranson: bnoordhius: a strcpy operation coudl yield both a count and a copy simultaneously at the same cost [22:14] rbranson: or very very close to the same cost :) [22:15] bnoordhuis: i'm not disagreeing with you [22:15] bnoordhuis: but back then cpu cycles were expensive [22:15] rbranson: you still had to copy it [22:15] comster has left the channel [22:15] bnoordhuis: well, you'd first have to malloc it [22:15] rbranson: it came from somewhere :) [22:15] cognominal has joined the channel [22:16] bnoordhuis: and to do that, you need to know how long the string is [22:16] rbranson: somewhere outside of the interpreter most likely [22:16] rbranson: eh [22:16] Nohryb has joined the channel [22:16] polotek: bnoordhuis and rbranson you guys should fork v8 and fix it [22:16] rbranson: totes [22:16] trotter has joined the channel [22:16] rbranson: maybe i'll get some corporate sponsorship :D [22:16] polotek: otherwise some folks will be having this exact conversation 3 years from now [22:17] inimino: There's nothing wrong with V8, it implements the language as it exists. [22:17] rbranson: yeah, the spec sez "UCS-2 bros" [22:17] inimino: And it's a decade too late to fix that. [22:17] polotek: only it'll be a huge deal and lots of money involved. But some major company will be standardizing on node [22:17] RevoOf has joined the channel [22:17] polotek: s/But/Because/ [22:17] polotek: inimino: never too late [22:18] inimino: It's too late to change ECMAScript to not be defined in terms of UTF-16, yes [22:18] inimino: much too late [22:18] polotek: it's that kind of attitude that will ensure that it doesn't happen [22:18] polotek: that's what we have versions for [22:19] rbranson: someone apparently hasn't been through a standards process before :D [22:19] bnoordhuis: inimino: gedankenexperiment: what would fundamentally break if the next ecmascript spec specified utf-8 or utf-32? [22:19] inimino: Sure, versions... [22:19] pandark_ has joined the channel [22:19] polotek: is it idealistic? sure. but only because of the atmosphere that has been created [22:20] isaacs has joined the channel [22:20] inimino: bnoordhuis ⋱ Every existing Web page that uses JavaScript that expects a particular .length value on any string outside the ISO 8896 range. [22:20] bnoordhuis: yes, but apart from that? [22:20] rbranson: hehe [22:20] polotek: inimino: the first question is, how many people is that? [22:21] inimino: Apart from a sizeable percentage of the existing Web? [22:21] itissid: bpadalino: There are weird charachters in the Process too so its not a node issue.. [22:21] polotek: if it's not clearly everyone, then I say move forward :) [22:21] rbranson: honestly, I think BigInteger and BigDecimal is way more important than moving to UTF-8 [22:21] inimino: polotek ⋱ The answer is: way too many. [22:21] evanmeagher has joined the channel [22:21] bpadalino: weird [22:21] bnoordhuis: inimino: existing code bases will break, no doubt about that [22:21] polotek: inimino: according to you? I'm not being snarky. I'm saying how do you define too many? [22:21] polotek: What's a common case? [22:22] bnoordhuis: but i'm talking about fundamental changes [22:22] inimino: Another string implementation, or an opt-in version is the only way this would ever have a chance. [22:22] polotek: php breaks existing code bases in minor version releases :) [22:22] rbranson: that's PHP [22:22] rbranson: a server runs a specific version of PHP [22:22] inimino: polotek ⋱ PHP isn't a browser. [22:22] Aria: I think opt-in is possible and still able to interoperate [22:22] rbranson: and you can code to that [22:22] rbranson: you have N number of JavaScript implementations going to a website [22:23] rbranson: and you have to pretend to support all of them [22:23] Aria: (no defined encoding, length throws; with one, it returns UCS codepoints.) [22:23] inimino: polotek ⋱ Generally, if one site breaks, and it's a site that gets a lot of traffic, and evangelism doesn't work to get the site updated, that's enough for browsers to maintain the status quo. [22:24] polotek: inimino: and that will continue to be the case until someone fixes it [22:24] inimino: polotek ⋱ In cases where there's thousands of sites that break, which would absolutely be the case here, just redefining the existing language is a total non-starter. [22:24] slaskis has joined the channel [22:24] rbranson: yeah it will also break in hard-to-predict ways [22:24] polotek: okay so if this is such a huge pain, why even talk about changing it? [22:25] rbranson: you're the one talking about changing it :) [22:25] polotek: oh yeah, you guys are just talking about how that fact that it's wrong is a huge problem and stopping forward progress [22:25] polotek: helpful [22:26] evanmeagher: isaacs: I'm getting some strange behavior from asyncmap [22:26] inimino: It's not stopping anybody's forward progress. [22:26] isaacs: inimino++ [22:26] v8bot: isaacs has given a beer to inimino. inimino now has 1 beers. [22:26] rbranson: it's just not optimal [22:26] polotek: lol [22:26] polotek: that's awesome [22:26] isaacs: utc-2/utf-16 is how ecmascript strings are defined. optimal or not. [22:26] inimino: We're not stuck on UCS-2, we have UTF-16, everything works, it's just less perfect than it could be if it were designed today. [22:27] bnoordhuis: isaacs: this is saturday night brainstorming [22:27] bnoordhuis: or beerstorming in my particular case [22:27] isaacs: hehe [22:27] rbranson: mmm... beer [22:27] evanmeagher: isaacs: the final cb of asyncmap seems to be firing before the last element is fully processed [22:27] evanmeagher: isaacs: so i end up with an incomplete results set [22:27] polotek: maybe that's my problem [22:27] isaacs: evanmeagher: are you calling the supplied cb more than once? [22:27] polotek: I don't drink beer [22:28] isaacs: evanmeagher: gist? [22:28] mape: polotek: I know isaacs spoke about some ascii magic for delimitor use [22:29] polotek: mape? are you talking about my tweet on delimiters earlier? [22:29] mape: polotek: yeah [22:29] evanmeagher: isaacs: https://gist.github.com/6b6d43530f0527d8aef4 [22:29] polotek: not a huge deal. I was just bitching about something. it's less perfect than it would be if it was designed today [22:30] isaacs: evanmeagher: line 5. should be cb(), not cb_() [22:30] sivang has joined the channel [22:30] sivang: evening all [22:30] isaacs: evanmeagher: never ever ever call the top level cb from the actor function. [22:30] isaacs: not allowed [22:31] sivang: I would like to use nodeload for stress testing of my server, but not sure how to create request that use PUTs to store keys and to retrive them. [22:31] sivang: I have a very basic rest api [22:31] sivang: has anyone a lead or input on that? [22:31] sivang: sorry if this is not the right channel for this. [22:31] isaacs: sivang: it's the right channel. [22:31] bnoordhuis: sivang: perhaps curl -X PUT ? [22:32] isaacs: sivang: what's nodeload? [22:32] rbranson: omfg douglas crockford uses github... https://github.com/douglascrockford/JSON-js [22:32] sivang: isaacs: thanks [22:32] sivang: isaacs: nodeload is basically a stress/performance testing that is capable of dynamic request and runs on nodejs [22:33] evanmeagher: isaacs: thanks. the final cb still gets called with results missing a property, though [22:33] sivang: isaacs: https://github.com/benschmaus/nodeload [22:33] isaacs: evanmeagher: yep. because you're not calling cb() for that one, you're calling it ahead of time when there's an error. fix that, then tell me about the results [22:34] sivang: it is a benchmark tool [22:34] isaacs: evanmeagher: it'd be cleaner to not build up a results object there, i think. [22:34] isaacs: just return the results, and tehn do an Array#reduce [22:34] isaacs: cb(null, data) [22:34] evanmeagher: isaacs: i mean it's still missing results even after i made the change. [22:34] evanmeagher: isaacs: i'll play with it. thanks. [22:35] isaacs: evanmeagher: and then in the area of lines 12-17, turn that array into an objecty [22:36] evanmeagher: sweet, thank you [22:38] bnoordhuis: ryah: will you be going to the pull requests soon? don't want my code to rot [22:40] tilgovi has joined the channel [22:42] rtomayko has joined the channel [22:42] AAA_awright_ has joined the channel [22:44] nooder has joined the channel [22:49] c4milo has joined the channel [22:53] isaacs: evanmeagher: just reduced your reduction a bit more. definitely not an issue with asyncMap. https://gist.github.com/708250 [22:53] isaacs: evanmeagher: my guess is that fetchDocsByVersion might be calling its cb twice. [22:53] isaacs: in some case. [22:54] zimbatm has joined the channel [22:54] evanmeagher: isaacs: I figured it wasn't an issue with asyncMap itself. thanks for looking into it. [22:54] isaacs: np [22:54] Craig`: http://pastie.org/1314120 .. the output is ENTER is less keystrokes than ".break" anyway [23:51] inimino: true [23:52] ryah: polotek: is there any way i could convince you to add a test for it? [23:52] ryah: polotek: there is already a test/simple/test-repl.js [23:52] ryah: shouldn't be too hard [23:52] polotek: ACTION is taking a look [23:56] polotek: ACTION is realizing that writing repl tests sucks [23:58] sivang: polotek: repl as in kv stores? :) [23:58] polotek: sivang: ? [23:58] sivang: polotek: never mind [23:58] polotek: as in read-eval-print look [23:58] sivang: oh [23:58] sivang: sorry