[00:00] unomi has joined the channel [00:03] perdix has joined the channel [00:05] creationix: I think I'll write a howtonode.org article on closure [00:07] jashkenas: creationix: that would be a service to the world. [00:08] x_or: mjr_: This is what I was trying to explain: http://gist.github.com/458024 [00:08] creationix: x_or: subscribe to the rss feed on howtonode.org and you'll get the article when I finish it [00:08] x_or: Yes, I would love that creationix. [00:08] _announcer: Twitter: "A little #dubstep for the late afternoon node.js hacking. Joker - "Tron" http://bit.ly/bsQecr #grime" -- Cheston Lee. http://twitter.com/Cheston/status/17372791084 [00:08] creationix: x_or: yes that works, but closures are easier [00:09] x_or: OK, so that is not a closure, OK, good to know. I still don't get it. I am about to purchase the Good Parts ebook. [00:09] mjr_: That's a closure [00:09] mjr_: The second one makes an anonymous function that closes over var a from line 16 [00:09] mjr_: It happens to pass that as an argument to handleResponse, where it is also called a, so it's a bit misleading. [00:10] creationix: x_or: https://gist.github.com/f53a139ddbe8de29673b [00:10] mjr_: So those a's aren't the same, which is the big win with closures. [00:10] creationix: a isn't in the inner function or even passed to it in my example, but it gets a from the closure around it [00:11] x_or: Ok, I understand that. And, I did not intend to name them the same a, so I should have used perhaps b in the second handleResponse signature. [00:12] mjr_: The way creationix has it is how most people use callbacks with closure to access the calling environment. [00:12] x_or: My reason for asking this is that I want to define the function later in my source file, because I find it hard to read an anonymous function completely inlined. [00:12] creationix: yeah, closures have to be inline [00:12] mjr_: The anonymous function is what makes the closure. [00:12] jashkenas: x_or .. but you can define a small function inline which then relays the variable to the larger function ... like you had in your first example. [00:12] x_or: OK. So, closures only work in anonymous functions. So I need to wrap an anonymous function around my regularly defined functions. [00:13] jashkenas: x_or: nope. every function in javascript is a closure. [00:13] x_or: Yes, perfect, that makes a lot of ssense. [00:13] x_or: I think I get it, may not have communicated what I meant. [00:14] x_or: In your example creationix, can you really use "function handleResponse( data )" rather than "function( data ) { …" I've never seen that before, is that calling the original handleResponse somehow in the chain? [00:14] creationix: no, it's just naming the inline function [00:14] creationix: I just do that so that stack traces look better [00:15] x_or: Ah, great, that is a good trick. Right, debugging is another thing I found challenging with these inlined anonymous functions, so that definitely would help. [00:15] x_or: This has been very helpful you guys. Appreciate you taking a newbie through the ropes. [00:15] x_or: Now, off to bed, late here in Lisbon. [00:18] steadicat has joined the channel [00:19] _announcer: Twitter: "with 'organizations,' GitHub has most things you'd want right now for open source. now if only they just had some node.js-related repos!" -- Ted Nyman. http://twitter.com/tnm8/status/17373434234 [00:19] pgriess has joined the channel [00:20] paul|work has joined the channel [00:21] paul|work: can someone help me with an issue compiling on freebsd? [00:21] paul|work: configure works fine but when i run make it starts vomiting errors starting with "/usr/local/include/jstypes.h:248:6: error: #error "Must define one of XP_BEOS, XP_OS2, XP_WIN or XP_UNIX"" [00:23] stepheneb has joined the channel [00:24] pquerna: any clues on how to go about debugging a V8_Fatal being invoked when I was Emit'ing from within another function in c++? .. specifically, in node_events.cc line 43... http://pastebin.com/FhbUYM5V [00:26] ryah: pquerna, likely missing some handlescope [00:26] ryah: or not scope.Close()-ing a return value [00:26] pquerna: hmm [00:26] pquerna: k [00:26] ryah: hard to catch... [00:26] rictic has joined the channel [00:28] _announcer: Twitter: "More cool node.js stuff from @JasonWyatt and @scott_gonzalez tonight - ASCII art, chat, shared drawing" -- Triangle JavaScript. http://twitter.com/trianglejs/status/17373984749 [00:35] onar has joined the channel [00:40] pquerna: ryah: http://github.com/pquerna/node-archive/commit/db8f5b2cef20ec6520c201f3f9ac88e2d7b1fd3f [00:41] pquerna: 'fixes' it [00:50] ban_evade has joined the channel [00:53] bmizerany: ryah: any thoughts on swapping 'encoding' and 'offset''s positions for Buffer.prototype.write? I feel the encoding is less likely to differ from that which I specified in the constructor, and offset more likely to be given on each write. Or is changing the API on something that commonly used a no-go? [00:56] satori has joined the channel [00:59] bmizerany: or am I annoying everyone with my stupid question? :/ [01:00] jashkenas: bmizerany: options hash? just sayin' Node should totally have one last great hurrah of API bikeshedding before 0.2.0... [01:02] bmizerany: jashkenas: yeah. that's why I brought it up. otherwise I would have just dealt with it. [01:02] stepheneb has joined the channel [01:03] bmizerany: it's API like buffer.write that are hard to please everyone. encoding is only passed to the constructor when the first arg is a string. therefore the other 2 options of construction would most likely need an encoding passed to each write. [01:03] sh1mmer has joined the channel [01:04] ryah: bmizerany: seems reasonable [01:04] bmizerany: the first arg to write is str, which is mandatory, otherwise you have no "write". :) but the other 2 vary in weight of importance depending on what the user is doing. [01:05] bmizerany: ryah: I'll fire up perl pie and get you a patch to chew on then ;) [01:05] ryah: perl pie? :) [01:06] ryah: bmizerany: need you to agree to this http://nodejs.org/cla.html before you do your patch [01:06] ryah: bmizerany: i think you can do it so that the old api is still accepted by testing if the arguments are a string or not [01:06] sh1mmer: can someone explain to me why I'm stupid [01:06] bmizerany: ryah: true [01:06] ryah: bmizerany: doing that and changing the api.markdown would be the route of least pain [01:06] sh1mmer: assert.equal(filters.validateAlpha("abc"), filters.validateAlpha("abc"), "Alpha passes abc"); [01:06] Alon has joined the channel [01:07] sh1mmer: that throws [01:07] Alon: Hi [01:07] sh1mmer: and I can't think of a good reason [01:07] Sembiance: :) [01:07] kersny has joined the channel [01:07] Alon: In my application, I allow users to write plugins using JavaScript. I embed V8 for that purpose. The problem is that developers can't use things like HTTP, Sockets, Streams, Timers, Threading, Crypotography, Unit tests, et cetra. [01:07] Alon: The problem with node.js is that you can actually create HTTP servers, and start processes and more things that I do not want to allow. In addition, node.js has its own environment (./node script.js) and you can't embed it. And it doesn't support Windows - I need it to be fully cross platform. If those problems can be solved, it will be awesome :) But I'm open to other frameworks too. [01:07] Sembiance: Alon: I hope you trust your users :) [01:07] ryah: sh1mmer: assert.deepEquals ? [01:07] bmizerany: sh1mmer: the objects returned are not the same [01:07] jashkenas: Alon: what application? [01:07] bmizerany: sh1mmer: what ryah said [01:07] Alon: It's a MetaMod Plugin actually [01:07] Sembiance: ACTION is using node.js for his latest project. [01:08] Sembiance: ACTION has embedded V8 (and spidermonkey) in custom C applications in the past. [01:08] sh1mmer: ryah: deepEquals for objects? [01:08] jashkenas: {} !== {} [01:08] sh1mmer: ryah: compares the object structure rather than the pointers? [01:08] Alon: Anyway - Is node.js good for plugins? [01:08] ryah: Alon: there is a way to create a new context to execute code [01:08] Tim_Smart: Alon: Sure. Just make a new context to sandbox the code. [01:08] bmizerany: ryah: how should I get the blood sample to you? [01:08] ryah: Alon: you can expose to it what you want [01:09] khug has joined the channel [01:09] Alon: Can I expose the http module, but not the HTTP.server module? [01:09] Tim_Smart: Alon: You can expose whatever you want [01:09] Alon: Nice :) [01:09] Alon: But I thought that node.js has its own environment (./node script.js) [01:09] Alon: Is there anyway to EMBED it? [01:10] Alon: To some C++ application [01:10] sh1mmer: Alon: what is your use case? [01:10] Alon: I want to allow users create plugin for my application. I embed V8 [01:11] Alon: But I also need some general purpose framework [01:11] Alon: like node.js. [01:11] ryah: Alon: no [01:11] Alon: :( [01:11] ryah: Alon: there could be if you hacked it [01:12] ryah: we've been talking about it today even. pquerna wants to do something along those lines. [01:12] ryah: it's not increadably difficult. [01:12] Alon: JavaScript NEEDS an embedable general purpose framework. Not just server side one [01:13] Alon: And 100% cross platform either. The problem is node.js is that it does not support Windows without some Unix-Like Environment [01:13] Alon: with node.js* [01:14] Tim_Smart: Alon: The problem with windows.... [01:14] ryah: Alon: patches welcome (with a signed CLA) [01:15] Alon has left the channel [01:17] dmshann0n has joined the channel [01:17] _announcer: Twitter: "[del] [from euler] Run Node.js as a Service on Ubuntu Karmic: Our servers run Ubuntu&#039;s latest: Karmic http://url4.eu/59VYR" -- sldfjd ldajds. http://twitter.com/sldfjd/status/17376986019 [01:20] creationix has joined the channel [01:23] _announcer: Twitter: "[del] [from euler] Binary Stream Parsing in Node.js :: The Universe of Discord: Borrowing some ideas from http://url4.eu/59VYT" -- sldfjd ldajds. http://twitter.com/sldfjd/status/17377309947 [01:23] satori has joined the channel [01:23] webbot has joined the channel [01:27] gerad has joined the channel [01:28] itistoday has joined the channel [01:28] itistoday has left the channel [01:30] unomi has joined the channel [01:32] rictic has joined the channel [01:33] BlessYAHU has joined the channel [01:36] BlessYAHU has left the channel [01:36] BlessYAHU has joined the channel [01:37] gerad1 has joined the channel [01:40] BlessYAHU: Greetings. Why am I getting a 'has no method split' when trying to querystring.parse a body? [01:40] creationix: BlessYAHU: because it's not a string I'm guessing [01:40] creationix: try calling toString() first [01:41] creationix: most of node now returns buffers by default [01:41] BlessYAHU: Ok. [01:43] BlessYAHU: cannot call method of toString on undefined. Which is strange because I can pass the output the body object without parsing it. [01:43] pkrumins: hey guys, node-video (http://github.com/pkrumins/node-video) just got cooler - you can now create frames out of fragmented rectangles (by "stacking" them). [01:44] pkrumins: gonna announce node-video release tomorrow as i finally integrate it in stackvm. [01:46] Sembiance: pkrumins: I'm sure that's pretty cool if I was doing anything with video :) [01:46] pkrumins: thank you! [01:48] Sembiance: pkrumins: I'm super happy for you. I can see your excited about it, and being excited about a coding project is the BEST DAMN THING IN THE WORLD [01:48] Sembiance: so congo rats :) [01:48] pkrumins: that is definitely the best damn thing in the world! [01:49] JimBastard: mikeal: yes i has couch [01:49] mikeal: i might ask to crash on it for a few days :) [01:50] JimBastard: damn i gotta put up an afk message or something when i go to work on this machine [01:50] JimBastard: mikeal: i might force you to write javascript :-D [01:50] mikeal: haha [01:50] mscdex: node-slave [01:50] JimBastard: just ask creationix. we chained him down and made him write node code [01:50] JimBastard: actually we just threw a party for him and served nachos [01:50] JimBastard: but its all the same [01:51] creationix: hmm, nachos [01:51] mikeal: hehe [01:51] mikeal: after you left the BBQ we made nachos :) [01:51] mikeal: we put tin foil on the grill and made em [01:51] creationix: mikeal: have the next bbq on a non sunday and I can stay longer [01:51] Tim_Smart: NZ needs a better JS community :( [01:51] mikeal: you could start it Tim :) [01:52] BlessYAHU: VA needs a better one too. [01:52] mikeal: where in NZ are you? [01:52] JimBastard: Tim_Smart: you got you and that other guy mark [01:52] JimBastard: isnt that like half the population of NZ? [01:52] halorgium: JimBastard: HEY SHUDDUP! [01:52] JimBastard: :-D [01:52] Tim_Smart: Yeah, minus a few million. [01:52] JimBastard: halorgium: you tooo? [01:52] halorgium: i might have abandoned NZ, but i am closer to you ;) [01:52] aurynn has joined the channel [01:52] mikeal: Tim_Smart: are you in Auchland or Wellington? [01:52] JimBastard: kiwis [01:53] pkrumins: CHUDDUP [01:53] Tim_Smart: mikeal: Feilding, Manawatu. 2 hours out of Wellington. [01:53] pkrumins: tiftfy [01:53] JimBastard: GO BACK TO NZ BITCH [01:53] JimBastard: CHUDDUP [01:53] pkrumins: haha [01:53] JimBastard: :-D [01:53] halorgium: Tim_Smart: hahah, my parents are in palmy [01:53] mikeal: when you don't live in a city you don't get to say "there just aren't any js developers here" [01:53] JimBastard: ACTION says, you just got Darko'd [01:53] pkrumins: she loved Darko. [01:53] mikeal: there aren't any f'ing people here! [01:53] Tim_Smart: halorgium: Ah! I go to Palmerston quite a bit. [01:54] pkrumins: JimBastard: exactly what I was thinking of. [01:54] JimBastard: :-D [01:54] JimBastard: im a pop culture reference machine [01:54] JimBastard: it usually results in people thinking im crazy [01:54] mikeal: me too [01:54] mikeal: Tiger Woods! [01:54] JimBastard: since i randomly say shit that makes no sense [01:54] pkrumins: JimBastard: same here. [01:54] Tim_Smart: mikeal: Feilding isn't a city. [01:54] mikeal: J-LO! [01:54] mikeal: Michael Jackson! [01:54] JimBastard: lol stfu mikeal [01:54] Tim_Smart: :p [01:54] mscdex: J-LOL [01:54] JimBastard: GOOD NEWS EVERYONE mikeal doesn't get the joke [01:54] JimBastard: :p [01:55] Tim_Smart: Bad news everyone, Node.js is getting trolled and going off-topic. [01:55] halorgium: JimBastard: please note, futurama is back! [01:55] JimBastard: http://99edhproblems.files.wordpress.com/2010/03/good-news.jpg [01:55] pkrumins: CHADDAP [01:55] JimBastard: hey halorgium , what do you feed that thing? well, what goes in one end comes out the other.....also indian food [01:55] mikeal: mmmm…. indian food [01:56] JimBastard: errr what comes out one end goes in the other [01:56] JimBastard: so my soundcard is borked and i cant get alerts [01:56] mscdex: sys.pump! [01:56] JimBastard: im going to get some food, smoke an L, and dive headfirst into dual-sided library craziness [01:56] JimBastard: ill be back [01:56] Tim_Smart: sys.pump is win. [01:57] mikeal: yup [01:57] mikeal: just don't use the callback param with http [01:58] Tim_Smart: mikeal: I generally use my own pump for http. [01:58] Tim_Smart: And end() the response outside the pump [01:59] mikeal: Tim_Smart: did you see my stream utils? [01:59] Tim_Smart: Yes, I think I did at one stage. [01:59] Tim_Smart: multi-pump and friends, right? [01:59] mikeal: http://github.com/mikeal/node-utils/blob/master/streams/lib/main.js#L4 [01:59] mikeal: multiPump isn't tested [01:59] mikeal: but the regular pump should be fine [01:59] unomi has joined the channel [02:00] mikeal: and you get an event emitter that you can use to even modify the data events [02:00] Tim_Smart: You should. It would be awesome streaming to file + http at the same time. [02:00] mikeal: yup, it *should* work [02:00] mikeal: testing it is just hard :) [02:00] mikeal: cause I've gotta simulate all the pause/drain stuff [02:00] Tim_Smart: hehe http://www.allproducts.com/manufacture100/mudpump/product4.jpg [02:01] webbot has joined the channel [02:01] isaacs has joined the channel [02:02] _announcer: Twitter: "http://bit.ly/bQjR4e ! line breaks A HTTP Proxy Server in 20 Lines of node.js" -- Rolf Trondhjem. http://twitter.com/aboutecigarette/status/17379747174 [02:02] _announcer: Twitter: "Had a good time @trianglejs this evening. The nodejs was very strong with this group. Also they liked my wifi. http://yfrog.com/59zwbcj" -- Xiaoxin. http://twitter.com/hyperlink/status/17379764348 [02:03] mikeal: someone seriously needs to update the "20 line proxy" to a "10 line proxy" using sys.pump [02:03] Tim_Smart: mikeal: http://gist.github.com/456595 [02:03] Tim_Smart: (The second gist) [02:04] Tim_Smart: I'm sure you can shrink it by fixing the variables etc. [02:04] pkrumins: mikeal: so what's the sys.pump? [02:04] pkrumins: tell me and i'll update that proxy :) [02:04] mikeal: ah, a tcp server [02:05] mikeal: it takes a readable stream and pumps it to a writable stream [02:05] pkrumins: sweet, exactly what a proxy needs [02:05] pkrumins: is pump documented? [02:05] mikeal: handles data, close, and the whole pause/drain thing for slow clients [02:05] pkrumins: that is awesome. [02:05] mikeal: should be, i had docs in the patch i wrote :) [02:05] mikeal: i might still only be in trunk tho [02:05] pkrumins: good job! [02:05] mape has joined the channel [02:06] pkrumins: so it's going to be released in node 0.1.100! [02:06] Tim_Smart: mikeal: 10 lines :) http://gist.github.com/458121 [02:06] mape_ has joined the channel [02:06] mikeal: it's here [02:06] mikeal: http://github.com/ry/node/blob/master/doc/api.markdown [02:07] pkrumins: click! [02:07] mikeal: Tim_Smart: that's TCP tho, and there is some http stuff you need to change [02:07] Tim_Smart: Oh right. This will just mirror everything :) [02:07] pkrumins: mikeal: when it's out, i am going to write an article about that :) [02:07] pkrumins: mikeal: world's smallest http proxy [02:08] mikeal: hehe [02:08] _announcer: Twitter: "@thinkvitamin Good start on the Node.js videos, can't wait to see the rest." -- Matthew Callier. http://twitter.com/mattle/status/17380125684 [02:08] pkrumins: seems it will be around 10, yeah. [02:08] pkrumins: good stuff. [02:08] kersny has joined the channel [02:08] tmpvar has joined the channel [02:08] mikeal: pkrumins: this was the first thing i wrote in node.js [02:08] mikeal: http://github.com/mikeal/node.proxy.js [02:08] mikeal: i stil have the code around as an example, but it really needs to be updated [02:09] pkrumins: mikeal: yeah i wrote the same :D [02:09] BlessYAHU: creationix: cannot call method of toString on undefined. Which is strange because I can pass the output the body object without parsing it. [02:09] pkrumins: mikeal: as the first thing. [02:09] Tim_Smart: mikeal: If you don't need to modify headers or anything, TCP proxy on port 80 will work just fine... [02:10] khug has joined the channel [02:10] mikeal: if it's not an rproxy, you need to modify the host and path [02:10] Sembiance: oooo. A promising new JavaScript IDE for Mac/Windows/Linux: http://net.tutsplus.com/tutorials/tools-and-tips/quick-tip-my-favorite-new-ide-web-storm/ [02:10] pkrumins: i later added some blacklists and whitelists: http://github.com/pkrumins/nodejs-proxy [02:10] Tim_Smart: OK right. [02:10] creationix has joined the channel [02:11] mikeal: but, there is a faster way to a proxy in node than http [02:11] mikeal: you use a tcp server and send the initial packets to the node http parser [02:11] webbot has joined the channel [02:11] mikeal: until you get a request event, then you modify the data and send the rest back and forth over a TCP client [02:11] pkrumins: mikeal: can node http parser be used standalone? [02:11] mikeal: that's what all the really fast erlang proxies do [02:12] pkrumins: mikeal: cool idea. [02:12] mikeal: pkrumins: yup, check out node-pcap to see how it's done [02:12] pkrumins: mikeal: looking [02:12] Tim_Smart: pkrumins: Also take a look in nodes lib/http.js. It should use the parser. [02:12] mikeal: i didn't know that until node-pcap did it, I actually wrote a working parser in tcp for faster load test performance :) [02:13] pkrumins: did any benchmarks? [02:13] pkrumins: Tim_Smart: thanks, going to look into that as well [02:13] mikeal: well, my parser isn't as fast as ryan's [02:13] mikeal: and i got like half the CPU and memory usage [02:13] mikeal: which is the difference between 800 and 1600 concurrent load test clients [02:14] webbot has joined the channel [02:14] pkrumins: aha [02:14] Tim_Smart: mikeal: Was that yours or ryan's that used less resources? [02:15] mikeal: my partial parser used half, because I wasn't doing nearly as much parsing [02:15] Tim_Smart: Ah right. [02:15] mikeal: if i used ryan's parser for the partial, i'm sure it would be faster [02:15] webbot has joined the channel [02:16] ryah: http parser? [02:16] mikeal: yeah [02:16] Tim_Smart: yeah. [02:17] pkrumins: pcap is crazy cool stuff [02:17] mikeal: it really is [02:17] mikeal: i'm going to do something for node-knockout with pcap [02:17] _announcer: Twitter: "md5 crypto under node.js / fab.js: http://bit.ly/bluhXp #mychain" -- Chris Strom. http://twitter.com/eee_c/status/17380743438 [02:18] ryah: have you guys downloaded http-parser itself and ran the tests? [02:18] webbot has joined the channel [02:18] ryah: it has a nice little output :) [02:18] ryah: well, i guess you can just do "cd deps/http-parser; make" [02:19] mikeal: i love that Chris Strom dude [02:19] mikeal: he basically blogs his bash history [02:19] Tim_Smart: Heh http://demo.hummingbirdstats.com/ is pretty darn cool. [02:19] pkrumins: mikeal: URL? [02:19] pkrumins: too many chrises. [02:20] mikeal: Tim_Smart: I want an HTTPScoop replacement [02:20] mikeal: http://japhr.blogspot.com/2010/06/md5-in-nodejs-and-fabjs.html [02:20] Tim_Smart: mikeal: You registered for knockout? [02:20] mikeal: not yet [02:20] Tim_Smart: Right, here and now, anyone else want to join [02:20] Tim_Smart: :p [02:20] mikeal: i need to confirm the rest of my team still [02:21] mde: Dude, what are we even building? :) [02:21] mape: mikeal: you can add them later on [02:21] Tim_Smart: mde: Something to do with pcap [02:21] mikeal: mde: we should write Chandler in 48 hours [02:21] mikeal: :P [02:21] Tim_Smart: You in? [02:21] mape: unless you will not do it at all if they arent joining [02:21] mde: Haha [02:21] mde: Tim_Smart: That could make some really nice visualizations. [02:21] mikeal: mde: I want a web replacement for HTTPscoop that is more awesome and uses node-pcap [02:21] mikeal: but we don't have to do that [02:21] Tim_Smart: mde: Email address? [02:21] Tim_Smart: haha [02:22] mde: mikeal: Like we said, sadly, we would make more progress in a few hours than we did in years at OSAF. [02:22] Tim_Smart: I got a awesome team name I want to use [02:22] mikeal: but it would be a good chance to add a push abstraction for websockets, longpoll, etc to geddy [02:22] mde: Tim_Smart: mde@fleegix.org [02:22] mde: That would be great, yeah. [02:22] Tim_Smart: OK thats 2 members. Anymore takers? [02:22] mikeal: i want to do something realtime [02:22] unomi has joined the channel [02:22] mjr_: mikeal: I'm going to have something that like soon [02:22] mde: +1 something realitime. [02:22] mikeal: Tim_Smart: no! he's on my team! [02:22] Tim_Smart: mikeal: Sure, whats your email haha [02:23] mjr_: mikeal: pcap is in npm as of last night, and it installs and http_trace executable [02:23] mikeal: mjr_: you're doing it for nockout [02:23] mikeal: if you're doing that i'll drop it [02:23] webbot has joined the channel [02:23] mjr_: mikeal: nope, I'm on the judges list though. [02:23] mape: ACTION reccons 80% of the knockout projects will be real time. And 60% of those will use twitter [02:23] mikeal: so something using your library is a big ++ :) [02:23] Tim_Smart: I got 2 more spaces, flick me your email if you are keen. [02:23] mjr_: heh [02:24] mikeal: i'm just gonna add twitter randomly to our app [02:24] mikeal: it doesn't even belong there, it'll be like an easter egg :P [02:24] mjr_: just sprinkle twitter and websockets on it. [02:24] Tim_Smart: mikeal: You joining me and mde, or not? [02:24] mikeal: you dick [02:24] mjr_: oh, then call it a framework when you are done. [02:24] mape: this is a recipe site, where you can watch people tweet about sausage! [02:25] Tim_Smart: :( [02:25] mikeal: hehe [02:25] mikeal: me and mde and admc are going to be in person at the joyent offices [02:25] Tim_Smart: Right, I can be the 4th person working remote [02:26] mape: the outcast [02:26] mape: be sure to bring your funny hat [02:26] Tim_Smart: I'll add admc's email as well if you like. [02:26] mikeal: we're looking for a fourth, but we want someone local [02:26] mikeal: and most of the locals are judges apparently :) [02:26] mikeal: how many teams can you be on? [02:26] mikeal: i want to be on like 4 [02:26] mikeal: can I do that? [02:27] mape: why not [02:27] mikeal: dammit, i gotta run to dinner [02:27] mape: as long as in the end cool projects are founded I say it is all good [02:27] Tim_Smart: OK I'm adding mikeal and admc [02:29] CIA-76: node: 03Ryan Dahl 07master * r6b430a9 10/ src/node.js : console.log: if not string, coerce into one - http://bit.ly/d9l3L7 [02:29] CIA-76: node: 03Dmitry Baranovskiy 07master * rd3f0493 10/ lib/sys.js : [02:29] CIA-76: node: sys.inherts to shadow constructor property from enumerability [02:29] CIA-76: node: thanks to ES5 features in V8 it is quite easily possible. - http://bit.ly/cAykM6 [02:29] CIA-76: node: 03Dmitry Baranovskiy 07master * r8ec1233 10/ lib/querystring.js : Refactored isA, isBool, etc functions to use some of ES5 goodness. - http://bit.ly/cXNMM4 [02:29] CIA-76: node: 03Ryan Dahl 07master * r0172cb3 10/ doc/api.markdown : Fix incorrect output on docs - http://bit.ly/9aRiit [02:31] Tim_Smart has joined the channel [02:31] joshbuddy has joined the channel [02:31] joshbuddy has joined the channel [02:31] gwoo has joined the channel [02:31] Tim_Smart: mde: Team Crockford ftw. [02:31] mde: Haha [02:31] mscdex: The Crockford Files! [02:32] mde: How about "Crockford Norris"? [02:32] mjr_: Crockford Files. [02:32] mjr_: awesome [02:32] mde: Team Teh Crockeh [02:32] mscdex: starring James Garner as Douglas Crockford [02:32] mde: James Garner isn't nearly cranky enough. [02:33] mape: Tim_Smart: you just screwed yourself [02:33] mape: If you are team Crockford you can't use any html5 in your project :P [02:34] mjr_: I think it's fine as long as it passes jslint. [02:34] Tim_Smart: mape: Heh. Crockford can make make div elements play video. [02:35] mape: gifs are not video! [02:35] Tim_Smart: http://www.crockford.com/pwl/ :/ [02:36] mape: hah [02:40] bmizerany: ryah: http://github.com/bmizerany/node/commit/200e486c31bb904ac1df4d6e7950fdccfaff4381 [02:40] bmizerany: not sure if I like the implementation, but it works. all tests pass [02:43] bmizerany: it seems heavy to do that much for write(). of course, one could always use writeAscii/Utf8/etc if they want to trade the sugar for speed [02:43] Tim_Smart: bmizerany: A for loop for comparing arguments :/ [02:43] CIA-76: node: 03Ryan Dahl 07master * r5e86d01 10/ (4 files in 4 dirs): [02:43] CIA-76: node: Revert "Buffer.copy should copy through sourceEnd, as specified." [02:43] CIA-76: node: This reverts commit a2f70da4c9bf14a6e0c4a17cac11a5ab555ce90f. [02:43] CIA-76: node: Keep tests modifies a few edge checks on Copy() - http://bit.ly/cKm0F4 [02:44] bmizerany: Tim_Smart: dude. all the other ways are just as bad. I mean: http://github.com/bmizerany/node/blob/re-buffer.write/lib/buffer.js#L21-23 .. is gross too [02:44] Tim_Smart: ryah: ^--- I noticed a slowdown in buffers after that commit [02:44] mjr_: ryah: what about overlapping buffers? [02:44] Tim_Smart: You have reversed it now though. [02:44] mjr_: er, overlapping buffer.copy [02:45] Tim_Smart: bmizerany: Its better than a loop, though. [02:45] ryah: Tim_Smart: ? [02:45] mjr_: Tim_Smart: did you figure out why it was slower? It only changed the last parameter of buffer.copy [02:45] bmizerany: Tim_Smart: in my commit? or ryah's? [02:46] bmizerany: oh. ryah's. got it [02:46] bmizerany: I'm sure my slows down write(). [02:46] bmizerany: *mine [02:46] Tim_Smart: The commit ryah reversed. It better now. [02:46] Tim_Smart: *Its [02:47] mjr_: Tim_Smart: how did that make it better? [02:47] stepheneb has joined the channel [02:47] mjr_: or worse, before? [02:47] bmizerany: Tim_Smart: the problem my commit was to solve, is that encoding can be sensibly defaulted to utf8, so putting it last in the argument list makes a nicer API for write(); but, the patch is also trying to be backward compatible. [02:47] Tim_Smart: mjr_: Good question. It was only very minute. Like 5ms per 100000 iterations [02:48] sechrist_: 5ms is [02:48] mjr_: did it use buffer.copy? [02:48] sechrist_: an eternity [02:48] Tim_Smart: mjr_: Yes. [02:48] Tim_Smart: The main bottle neck is creating the buffer. [02:48] bmizerany: Tim_Smart: if we can come up with a "better" API and stick with it, then we can add deprecation warnings to the old, and force (str, offset, encoding) in the new, and remove the loop [02:49] bmizerany: or whatever the new API maybe [02:49] bmizerany: maybe a hash. I love and that in ruby at the same time. [02:49] benburkert has joined the channel [02:50] bmizerany: *I love and hate.. [02:50] bmizerany: once you have more than, say, 2 optional args you're passing it, it gets nasty in Ruby. I guess it's not as bad in JS [02:53] jherdman has joined the channel [02:53] bmizerany: Tim_Smart: gotta run. I'll be back on in a bit if you want to chat on this more. I'm def interested in more eyes and options. [02:56] TS1 has joined the channel [02:56] _announcer: Twitter: "Nodejs MBP to install the V8, and fell again in the New World. Actually the next fellow, but the inspiration seems not to warn. A private business to raise the priority in the queue? Makes her so much distress." [ko] -- Rhio.kim. http://twitter.com/Rhiokim/status/17383166300 [02:56] CIA-76: node: 03Blake Mizerany 07master * r898afba 10/ (doc/api.markdown lib/buffer.js): Buffer.prototype.write: Indifferent order preference of encoding and offset - http://bit.ly/d22U3M [02:57] mjr_: Tim_Smart: does your buffer copy test every copy back into the same buffer? [02:57] ryah: mjr_: did i drop something else from your commit? [02:57] ryah: overlapping buffers.. [02:57] Tim_Smart: mjr_: Create new buffer -> copy 2 buffers into buffer [02:58] mjr_: Yeah, you dropped the source and dest are the same buffer check, but I wonder if that's what made Tim_Smart's test slow down. [02:58] Tim_Smart: Well not slow, but slower. [02:59] SamuraiJack has joined the channel [02:59] ryah: let's fine out. adding it back. [02:59] jxson has joined the channel [02:59] sechrist_: Tim_Smart: do you have the code you used to test it with, still? [02:59] mjr_: ryah: I think we are stuck with that check though, or perhaps a fast one exists. We need to find out if the regions might overlap and use memmove, otherwise who knows what memcpy will do. [02:59] Tim_Smart: Heh I put it in /tmp, so no. But I can write it up again. [03:00] ryah: mjr_: might beable to compare with ->data() [03:00] mjr_: We could always use memmove, but on some platforms I think it is slower. [03:00] ryah: mjr_: and not drop to js equiv [03:00] ryah: mjr_: probably better anyway [03:00] mjr_: Hmm, the real issue is to check if the regions might overlap. I guess that current check isn't quite right anyway. [03:01] mjr_: Because one buffer might be a slice of another. [03:01] mjr_: And thus could still overlap. [03:03] kersny has joined the channel [03:04] webbot has joined the channel [03:04] mjr_: ryah: do buffers keep track of the start of the original heap allocation, even if they are a slice of another buffer? [03:05] webbot has joined the channel [03:05] mjr_: If so, we can just compare those pointers and use memmove then. That should be pretty fast. [03:05] mjr_: Otherwise it is very ugly. [03:06] brianmario has joined the channel [03:09] ryah: mjr_: yes [03:09] ryah: mjr_: patch incoming [03:09] Tim_Smart: mjr_: http://gist.github.com/458183 [03:10] ryah: mjr_: http://gist.github.com/458184 [03:10] ryah: ^--- i would really like a test for this [03:12] Aria has joined the channel [03:13] mjr_: Oh, you did it the full hard way. [03:14] mjr_: Can the compiler optimize away the multiple calls to data() and length()? [03:14] Tim_Smart: mjr_: Is there a faster way of concat-ing buffers? [03:14] sh1mmer has joined the channel [03:15] mjr_: Tim_Smart: your test doesn't do overlapping. I'm not sure why it would be slower, but I guess it must have been the JS-based comparison of source and dest. [03:15] Tim_Smart: (Without pre-allocating ahead of yourself) [03:15] mjr_: The way you have it should be super fast. [03:16] Tim_Smart: mjr_: Its still a lot slower than converting to a string then concatting [03:16] mjr_: that's interesting. [03:16] webbot has joined the channel [03:16] mjr_: Have you tried isolating the cost of the new Buffer() from the copying? [03:17] Tim_Smart: yeah, it is the most expensive part [03:17] mjr_: I suspect that new Buffer() gets kind of expensive because I think it calls regular malloc. [03:18] mjr_: And I'll bet that V8 has a superiorly optimized memory allocator. [03:18] bpot has joined the channel [03:18] Tim_Smart: The times with copy are around: 4ms, 165ms and 520ms. Remove the copy()'ing and it shaves of 100ms off. [03:19] Tim_Smart: *off 100ms in the third case [03:20] mjr_: wow, calling toString on two buffers and concating them into a third string is 4 times faster than allocating a new buffer? [03:20] _announcer: Twitter: "@ Outsider__ sokahseon things would not have a lower version,. Js library, it's not really a mature state. Cpp solid side may be 1.0 because it instantly. I asked for NodeJS maleunahniguyo, oekukaedeul version numbering is not a meaningful" [ko] -- A.J. http://twitter.com/andrwj/status/17384659667 [03:20] Egbert9e9 has joined the channel [03:20] Tim_Smart: mjr_: Yeah. Which is not what I thought. [03:20] Tim_Smart: And I swear it was faster at one stage. [03:21] Pilate has joined the channel [03:21] frodenius has joined the channel [03:21] frodenius has joined the channel [03:23] malkomalko has joined the channel [03:25] mjr_: Tim_Smart: could you try the latest head and see if it gets slightly faster? [03:25] mjr_: ryah just reverted what I suspect may be an expensive compare operation in buffer copy [03:25] mjr_: But it's not going to help the malloc cost. [03:27] _announcer: Twitter: "@ Outsider__ developers take on the Magic's acting once a week, shake my hand before =__=)``. Js files rather than. Cpp put more weight in side and criteria may vary :-). Js files rather than the API 'NodeJS Style 'it's more important to find" [ko] -- A.J. http://twitter.com/andrwj/status/17385119030 [03:27] Tim_Smart: mjr_: OK I'll give it a shot [03:29] Tim_Smart: mjr_: That shaved off 20ms on 100000 iterations [03:30] Tim_Smart: So of the current 500ms times, 60ms is the actual copying [03:31] _announcer: Twitter: "Checking out mustache.js now that I have a basic chat working on http://mat-presentation-node-js.heroku.com/" -- Mat Schaffer. http://twitter.com/matschaffer/status/17385388668 [03:31] mjr_: yeah, malloc is a bitch [03:32] Tim_Smart: If only we could leverage v8 to pass the reference to the memory [03:32] mklappst1hl has joined the channel [03:43] mape: So using buffers is good for read heavy apps but bad for write? [03:44] JimBastard has joined the channel [03:52] liucougar has joined the channel [03:55] mjr_: The allocation is the expensive part, apparently. [03:56] mjr_: If you can pre-allocate and reuse, I think you win. [03:57] Tim_Smart: Yup. Interestingly though, if you increase the string sizes, the copy() bench overtakes the toString() version [03:58] mjr_: oh, so small allocations I guess. [03:58] mjr_: V8 has an optimized allocator that for, one would assume. [03:58] Tim_Smart1 has joined the channel [03:59] ryah: mjr_: what's the easy way? [03:59] ryah: i want to make buffer allocation cheaper [03:59] mjr_: ryah: At some point you malloc some chunk of memory. I figured that you could just compare the starting pointer and see if it was the same block. [04:00] ryah: (by doing a pool allocator) [04:00] mjr_: Which works as long as a slice still remembers the beginning of the allocation. [04:00] Egbert9e9 has left the channel [04:00] ryah: oh right, yea i don't have an interface to get a pointer to the original memory beginning i think [04:01] ryah: oh - scratch that [04:01] ryah: i can access the "Blob" [04:02] mjr_: there you go [04:02] sh1mmer: yays [04:02] sh1mmer: ACTION just wrote a small test harness for node [04:02] bmizerany has joined the channel [04:02] sh1mmer: with terminal colours :) [04:04] kersny has left the channel [04:04] rcb_ has joined the channel [04:04] ryah: sh1mmer: :) [04:05] mjr_: I've been ANSI-fying my terminal stuff today also. [04:05] rcb_: hi, how can I auto-export all the symbols from my module? [04:06] CIA-76: node: 03Matt Ranney 07master * r02ed0ec 10/ src/node_buffer.cc : On overlapping buffers use memmove - http://bit.ly/davH4Y [04:06] Tim_Smart: I made a competitor against _announcer today :p Can add track keywords (and untrack) on-the-fly. [04:07] ryah: Tim_Smart: excellent [04:07] mjr_: ryah: nice [04:07] bradleymeck2 has joined the channel [04:07] ryah: Tim_Smart: let's see whose is faster [04:07] mjr_: That ought to be afast. [04:07] Tim_Smart: ryah: Heh. They both are limited by Google Translate [04:08] Tim_Smart: Let me chuck it on my prgmr instance... [04:08] ryah: can't beat an integer compare [04:09] bradleymeck2: sure i can w/ bool cmp (neq goodness by 1 cycle) [04:10] Tim_Smart: Source to bot: http://dl.dropbox.com/u/396394/nodejs-bot.tar.gz [04:12] ryah: my libc is going to have a static c analysis frontend [04:12] ryah: and only going to link in functions which are needed by the program [04:13] ryah: (they'll be one object file per libc function) [04:14] ryah: (i'm indending my libc to usually be statically linked in) [04:15] findyourownpath has joined the channel [04:16] bradleymeck2: mmm more irc bot fun? [04:20] ryah: man. git is so smart. [04:21] joshbuddy has joined the channel [04:22] mjr_: ryah: after your suggestion, I finally went and learned about rebase. Conclusion: Holy shit. [04:22] Tim_Smart: rebase is kinda helpful [04:25] _announcer_twin has joined the channel [04:25] Tim_Smart: !track nodejs [04:25] _announcer_twin: Tim_Smart: Started tracking: nodejs [04:26] Tim_Smart: !untrack nodejs [04:26] _announcer_twin: Tim_Smart: Stopped tracking: nodejs [04:26] ryah: i just reverted a commit from a long time ago [04:26] ryah: files had been moved [04:26] ryah: it figured it out. [04:27] bradleymeck2: seems imma have to work on _utility if i want to stay in the game for irc bots mmm [04:28] _announcer_twin has joined the channel [04:28] Tim_Smart: !track node js [04:28] _announcer_twin: Tim_Smart: Started tracking: node js [04:28] Tim_Smart: !track nodejs [04:28] _announcer_twin: Tim_Smart: Started tracking: nodejs [04:28] bradleymeck2: !track bradleymeck [04:28] Tim_Smart: Lets see who is faster >.< [04:28] Tim_Smart: bradleymeck: It only listens to me atm [04:29] Tim_Smart: !track @bradleymeck [04:29] _announcer_twin: Tim_Smart: Started tracking: @bradleymeck [04:29] bradleymeck2: lol fail i never use twitter except to test things [04:29] Tim_Smart: !untrack @bradleymeck [04:29] _announcer_twin: Tim_Smart: Stopped tracking: @bradleymeck [04:30] bradleymeck2: does tweetstreaming support patterns? [04:30] _announcer_twin: TWITTER: "testing the #nodejs bots" -- Ryan Dahl http://twitter.com/ryah/status/17389042271 [04:30] _announcer_twin: TWITTER: "testing the #nodejs bots" -- Ryan Dahl http://twitter.com/ryah/status/17389042271 [04:30] Tim_Smart: Err what. [04:30] Tim_Smart: It repeated it self >.> [04:30] bradleymeck2: msg and channel? [04:31] Tim_Smart: It didn't do that when I tested... [04:31] bradleymeck2: if you want a testing channel i registered #node.js.bots [04:31] Tim_Smart: ok [04:34] cloudhead has joined the channel [04:35] _announcer: Twitter: "Just testing my #nodejs twitter IRC bot :)" -- Tim Smart. http://twitter.com/Tim_Smart/status/17389335837 [04:40] _announcer: Twitter: "Released Task-Joose-NodeJS-0.02 http://tinyurl.com/32tpw7a #jsan" -- SamuraiJack8. http://twitter.com/SamuraiJack8/status/17389608461 [04:40] _announcer_twin has joined the channel [04:40] Tim_Smart: !track nodejs [04:40] _announcer_twin: Tim_Smart: Started tracking: nodejs [04:40] Tim_Smart: !track node js [04:40] _announcer_twin: Tim_Smart: Started tracking: node js [04:41] _announcer_twin: TWITTER: "Node #j #javascript nodejs Node.js IRC bot run test. : D" [de] -- Tim Smart http://twitter.com/Tim_Smart/status/17389638699 [04:41] _announcer_twin: TWITTER: "Node #j #javascript nodejs Node.js IRC bot run test. : D" [de] -- Tim Smart http://twitter.com/Tim_Smart/status/17389638699 [04:41] _announcer: Twitter: "# # Nodejs node js javascript Node.js IRC bot run test. : D" [de] -- Tim Smart. http://twitter.com/Tim_Smart/status/17389638699 [04:42] ryah: :/ [04:42] ryah: can you do that in a different channel? :) [04:43] ryah: ACTION likes having competing bots but not testing spam [04:43] Tim_Smart: ryah: Yeah sure. Thing is, this is the only channel where the bug appears >.> [04:43] ryah: ah well, no one is talking now anyway [04:44] bradleymeck2: ryah we made #node.js.bots for that purpose lol [04:44] mattly has joined the channel [04:45] JimBastard: spambot is spamtastic [04:45] Tim_Smart: ryah: I'll just comment out the bit that sends messages to the channel [04:45] bradleymeck2: ryah whats the best way to get a truly unique id for a JS obj in C++ land? [04:45] _announcer_twin has joined the channel [04:45] ryah: Tim_Smart: do you have to pull down the bot each time you change it? [04:45] bradleymeck2: f, did _utility die again, that mother f* [04:46] ryah: bradleymeck2: unique id? [04:46] JimBastard: yo ryah is there a reason there is no LINT on any of these http://github.com/ry/node/blob/master/lib/http.js ? [04:46] Tim_Smart: ryah: I could setup a watch process, but can't be bothered right now :p [04:46] ryah: JimBastard: ? [04:47] ryah: JimBastard: i take lint fixes [04:47] _announcer: Twitter: "#nodejs is pretty damn cool. So are IRC bots that do what you tell them." -- Tim Smart. http://twitter.com/Tim_Smart/status/17389978431 [04:47] JimBastard: if i linted the lib folder you'd accept patch? [04:47] ryah: JimBastard: yes but it needs to follow my style [04:47] JimBastard: any specific rules you want? [04:47] bradleymeck2: {} != {} , so they must have some underlying id (pointer w/e), would like to use it as a dictionary key, so should be unique [04:48] JimBastard: ryah: its gonna hate the multiple var statements [04:48] Tim_Smart: !track nodejs [04:48] _announcer_twin: Tim_Smart: Started tracking: nodejs [04:48] ryah: JimBastard: i'd like to get an official jslint config for lib/ [04:48] Tim_Smart: +1 for jslint config [04:48] JimBastard: im on it one sec [04:48] ryah: single var statements are so ugly though [04:48] ryah: var <- what i hate most about js [04:49] Tim_Smart: Yeah, I like saying var once, then use comma for a while... [04:49] JimBastard: something like this? http://gist.github.com/458249 [04:49] bradleymeck2: well, seems my linux box just blew up, no _utility for a while :( [04:50] Tim_Smart: JimBastard: Run it over something in lib/, and gist the result [04:50] Tim_Smart: (After fixes) [04:50] JimBastard: it will stop hammer time on the vars [04:50] JimBastard: ill look into it perhaps [04:50] JimBastard: i gotta read all this code anyway now [04:50] JimBastard: so i might as well try to lint it [04:52] _announcer_twin has joined the channel [04:53] Tim_Smart: Found the problem... [04:53] _announcer: Twitter: "My next project (or probably even the current one) will be implemented on http://nodejs.org/ #youology #ar #thefuture" -- pauldatta. http://twitter.com/pauldatta/status/17390331021 [04:54] _announcer_twin has joined the channel [04:54] bmizerany: Tim_Smart: any more thoughts on http://github.com/bmizerany/node/commit/200e486c31bb904ac1df4d6e7950fdccfaff4381 ? [04:55] bmizerany: ryah: hrm. I find multi-line single var statements worse than single-line single-var [04:56] bmizerany: and the `,` in the front instead or the end, oof. you guys are killing me. heh [04:56] bradleymeck2: how is that killing you? [04:56] Tim_Smart: I guess this sums up my internal style guidelines: http://gist.github.com/458183 [04:58] bradleymeck2: the beginning of lines having ',' shows it carries on in the same pattern as the line above it. at the end of a line its hard to make the ,s match up or tell if you accidentally left out a , as well as , at the front means you can easily see those 2 previous problems resolved [04:59] ryah: bmizerany: i hate the , in front for var [04:59] bmizerany: bradleymeck2: I find it very ugly. In writing, you never start a line with punctuation. [04:59] mape: I'm using the Allman style, guess that might be a source of whine when I will release the node knockout code [04:59] ryah: i don't know why people attribute that to me [04:59] bradleymeck2: it isnt english [04:59] bmizerany: ryah: haha. it's in your code base :) [04:59] aubergine_ has joined the channel [04:59] ryah: i think it's isaacs fault [04:59] cloudhead: -1 for , at the ^ [04:59] ryah: i like it for json though [05:00] cloudhead: yea, I'd attribute it to isaacs hehe [05:00] ryah: but i might even back off on that just for less friction [05:00] mape: Are there any guidelines on code style for knockout submissions? Or should one assume to use the node.js code style? [05:00] technoweenie: depends on the goals of the competition [05:00] technoweenie: pretty source code or useful app [05:00] Tim_Smart: ryah: General convection also chucks 'punctuation' on the end of the line [05:01] bradleymeck2: i dont use () [] && spattered throughout adjectives and how they apply to nouns, i personally find both to have appeal , at the end is classical and resembles written language , at the front makes more sense semantically however [05:02] Tim_Smart: bradleymeck2: I find code easier to read, when the commas are suffixed (When the code is vertically aligned well) [05:03] bradleymeck2: vertically aligned well? [05:03] bmizerany: ryah: what are the next steps to get my patch in? Tim_Smart, did you want to take a stab at refactoring my refactoring? [05:04] Tim_Smart: bmizerany: OK sure. I'll quickly gist something in a minute, [05:04] bmizerany: Tim_Smart: cool. [05:04] _announcer_twin has joined the channel [05:05] _announcer: Twitter: "# Nodejs testing testing sdjl jfdsklj flksdj fdsf" [hr] -- Tim Smart. http://twitter.com/Tim_Smart/status/17390955880 [05:05] mscdex: hr? [05:05] Tim_Smart: Oh crap. [05:06] bmizerany: ryah: any reason Buffer doesn't hold onto the 'encoding' passed to the constructor when argv[0] is a String? Do you think it would make sense to keep that as the default for write()? [05:07] bmizerany: anyone else? [05:07] _announcer_twin has joined the channel [05:08] ryah: bmizerany: eh.. *shrug* [05:09] mscdex: i dunno, i just program here [05:09] ryah: bmizerany: your patch went in [05:09] bmizerany: omfg. I'm sick of Comcast's internet service. so shitty. I'm dropping packets like it's going out of style. [05:10] bmizerany: ryah: awesome. thx. I'm sure Tim_Smart will spruce it up all JS like and stuff soon too. [05:10] ryah: http://github.com/ry/node/commit/898afbaf348a3f7188cfd759914528704350a448 [05:14] _announcer_twin has joined the channel [05:16] malkomalko has joined the channel [05:16] CIA-76: node: 03Ryan Dahl 07master * r0a8bd34 10/ (lib/dns.js src/node_net.cc): (log message trimmed) [05:16] CIA-76: node: Resolve .local domains with getaddrinfo() [05:16] CIA-76: node: C-Ares doesn't go through the Name Service Switch (NSS) and thus can't [05:16] CIA-76: node: resolve certain classes of names. Generally this doesn't matter and the [05:16] CIA-76: node: whole idea of NSS is rather annoying. Nevertheless until C-Ares gets better [05:16] CIA-76: node: support, adding this hack to go through getaddrinfo() for .local domain look [05:16] _announcer_twin has joined the channel [05:16] CIA-76: node: up. [05:16] Tim_Smart: !track nodejs [05:16] _announcer_twin: Tim_Smart: Started tracking: nodejs [05:16] Tim_Smart: OK. Hold your breath folks. [05:17] ryah: ACTION holds his breath [05:17] _announcer_twin: TWITTER: "#nodejs Is a great platform for IRC bots. +1 for node." -- Tim Smart http://twitter.com/Tim_Smart/status/17391593813 [05:17] _announcer: Twitter: "#nodejs Is a great platform for IRC bots. +1 for node." -- Tim Smart. http://twitter.com/Tim_Smart/status/17391593813 [05:17] ryah: i saw _twin come in before [05:17] Tim_Smart: !untrack nodejs [05:17] _announcer_twin: Tim_Smart: Stopped tracking: nodejs [05:18] Tim_Smart: ryah: _announcer was doing what it should, and ignoring repeat tweets, so I could silently test :) [05:19] mscdex: there's an extra space after the closing quotes :O [05:19] bmizerany has joined the channel [05:19] mscdex: !so-next [05:19] mscdex: aw [05:20] mscdex: !so-last [05:20] mscdex: :-( [05:20] Tim_Smart: It got removed. [05:24] _announcer: Twitter: "OH: "Node.js is eating my brain."" -- Matthew Eernisse. http://twitter.com/mde/status/17391952990 [05:24] aubergine has joined the channel [05:29] temp01: why isn't this channel registered? [05:31] derferman has joined the channel [05:33] everton has joined the channel [05:33] _announcer: Twitter: "My intro talk to serverside #js with #node.js got accepted for @javazone. Looks like there will be som e #js talks this year. :)" -- Bjarte S. Karlsen. http://twitter.com/bjartek/status/17392401946 [05:34] Tim_Smart: javazone? JS talks? Silly people mixing ecmascript and java are foolish. [05:34] ryah: temp01: because stupid freenode people won't do it [05:35] ryah: been trying [05:35] temp01: get #nodejs or #node-js or something? [05:35] temp01: or tell everybody to /part :) [05:35] ryah: whatever - i mean - this works. [05:37] mjr_: I think the single var thing wouldn't be so bad if the initializers were super simple. [05:37] bmizerany has joined the channel [05:37] Tim_Smart: bmizerany: I think this is how I would do it - not that big a deal though http://gist.github.com/458271 [05:37] mjr_: And with the hoisting, I do think it makes sense to have all the vars at the top of a function. [05:38] mjr_: But ugly, yes. [05:38] mjr_: Oh, how I should be sleeping. [05:38] bmizerany: Tim_Smart: makes sense. [05:44] Tim_Smart: ryah: Oh nice! ( https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html ) via twitter [05:45] ryah: yes [05:45] Tim_Smart: That will replace Buffer right? [05:45] ryah: we'll see [05:45] ryah: the need to add some stuff [05:45] ryah: need string encoding and decoding [05:45] Tim_Smart: Well, Buffer could wrap it until it was fully bulked out. [05:46] ryah: well we'd need to implement it :) [05:47] Tim_Smart: Heh. When its implemented in V8, then we can worry about it. [05:47] Tim_Smart: Wait, this is DOM thing, or a Javascript thing? [05:49] nsm has joined the channel [05:49] ryah: dom [05:50] Tim_Smart: Gah. [05:51] Tim_Smart: We should push ecma to spec out a better way of handling binary data, in large amounts. [05:55] tyfighter has joined the channel [05:56] tyfighter has joined the channel [05:59] aubergine has joined the channel [06:02] nofxx has joined the channel [06:05] Dmitry has joined the channel [06:06] ajpiano has joined the channel [06:06] Dmitry: ryan, I will make a new commit in a minute with tests for dot notations [06:07] bmizerany has joined the channel [06:08] bmizerany: ryah: how do you keep track of benchmark results? is the a txt somewhere where you store them? [06:09] Dmitry: ryah, I will make a new commit in a minute with tests for dot notations [06:15] ajpiano has joined the channel [06:16] bmizerany: ryah: superficial patch: http://github.com/bmizerany/node/commit/68881f4f44f3e1d1a60e4176b9c0f28e3d3e4cb5 [06:19] isaacs has joined the channel [06:20] benburkert has joined the channel [06:23] aubergine has joined the channel [06:29] BBB has joined the channel [06:31] javajunky has joined the channel [06:41] nofxx has joined the channel [06:44] MattJ has joined the channel [06:47] b_erb has joined the channel [06:50] lolzepahm has joined the channel [06:51] pandark_ has joined the channel [06:57] CIA-76: node: 03Dmitry Baranovskiy 07master * rf8ca6b3 10/ (lib/querystring.js test/simple/test-querystring.js): [06:57] CIA-76: node: Rewrote QueryString.parse to make it smaller and more effective. [06:57] CIA-76: node: Also added ability to parse foo.bar=4 equal to foo[bar]=4 [06:57] CIA-76: node: Added tests for this as well - http://bit.ly/buSSbT [07:00] ryah: Dmitry: thanks---^ [07:00] CIA-76: node: 03Blake Mizerany 07master * r8c85340 10/ (38 files in 8 dirs): fix whitespace errors - http://bit.ly/akIAOo [07:00] ryah: bmizerany: thanks---^ [07:01] bmizerany: ryah: haha. ;) np [07:01] javajunky has joined the channel [07:01] bmizerany: always glad to remove those nasty things [07:01] mape: bmizerany: nice! [07:01] mikeal has joined the channel [07:02] bmizerany: ryah: I didn't touch tools/ or deps/ though. well. I did try deps/http_parser but that was fine :) [07:02] mape: Why do people keep using " instead of ' ? [07:03] bmizerany: mape: ugh. good question. I've been following whatever convention is used on a per-file-basis [07:03] bmizerany: I'd love to clean house on that. [07:03] isaacs: mape: because " means string, and ' means character [07:03] bmizerany: mape: could probably do a perl pie + ack on that. [07:03] isaacs: mape: and in js, there are only strings. [07:04] mape: isaacs: character as in? [07:05] isaacs: mape: in C, 'C' is a single char. "C" is a string of length 1 [07:05] isaacs: "C" is like {'C'} [07:05] mape: Oh, but that has nothing to do with javascript? [07:05] isaacs: right, well, js has no char type [07:05] isaacs: only strings [07:05] isaacs: so it makes sense to use " all the time always [07:05] mape: So no reason to use " over ' ? [07:06] isaacs: If you have a project that's a mix of C and JS, why not use the one that means "string" in both places? [07:06] virtuo has joined the channel [07:06] isaacs: it's not like it's php, and you're actually wasting resources parsing them or anything. in js, they're the same. [07:06] mape: For node it might make sence, but for modules? [07:06] bmizerany: isaacs: I think that it's commonly used as: ' means don't escape and " is escape is ok. [07:06] bmizerany: if you need to escape, use " [07:06] bmizerany: that's how I roll in Ruby at least. [07:06] mape: I just find that I am more prone to use '"' then "'" [07:06] isaacs: bmizerany: but, in js, that's not how it is [07:07] isaacs: bmizerany: in js, " doesn't auto-escape like in php [07:07] isaacs: ie, '\n'=== "\n" [07:07] isaacs: er, autoescape isn't the right word... [07:07] mape: So rather stick to '"? [07:08] isaacs: html4 strict is SO last decade. [07:08] isaacs: ;P{ [07:08] mape: isaacs: Bah [07:08] isaacs: ;P [07:08] mape: ACTION feeds isaacs dirt [07:08] isaacs: haha [07:08] isaacs: it'd be nice if JS had better block strings. [07:09] isaacs: like bash/perl/php's <<< or python's """ [07:09] mde: I would kill for heredocs, yeah. [07:09] isaacs: SO nice [07:09] Tim_Smart: coffeescript ftw right there [07:09] isaacs: it's probably the one really nice thing you can do with e4x [07:09] mape: coffeescript :/ [07:09] Tim_Smart: http://jashkenas.github.com/coffee-script/#strings [07:10] technoweenie: thats where i like ruby's strings... %(This is a string of stuff "with quotes" and 'single quotes'.innerText [07:10] isaacs: but yeah, it's a silly religious view i picked up a long time ago, but it's served me well. ' is for chars, " is for strings [07:10] felixge has joined the channel [07:10] felixge has joined the channel [07:11] isaacs: since js doesn't have chars, never ever use ' [07:11] mape: Just find ' cleaner.. But I guess that one is hard to use as an argument [07:12] mape: Same with indenting using allman [07:12] isaacs: allman? [07:12] mde: ' is for when I have a string with a lot of " in it, an vice-versa. [07:12] isaacs: mde: +1 [07:12] isaacs: mde: in practice, i try to escape as little as possible. \ is hard to read through [07:12] mape: isaacs: http://en.wikipedia.org/wiki/Indent_style#Allman_style_.28bsd_in_Emacs.29 [07:13] mape: Guess most people find that bloated though, I find it easier to read and follow the flow of the code [07:13] isaacs: mape: ah [07:13] mde: isaacs: Exactly. [07:13] isaacs: yeah, it causes problems in a few cases in js [07:13] isaacs: object literals, in particular. [07:14] isaacs: they cannot start the line. [07:14] mape: Always keep { on the same line if it is an object [07:14] mape: for returns and whatnot [07:14] isaacs: mape: yeah, so, you have rules that are not consistent with respect to braces. [07:14] mape: but for functions/if/switch/while and so [07:14] isaacs: why not just have all braces be that way? [07:14] bmizerany: isaacs: what is your take on ;'s? I hate them, there is no need when followed by a \n. can we all agree on that? :/ [07:14] mape: No good reason, other then that I prefer it [07:15] _announcer: Twitter: "Well, NodeJS just got a whole lot nicer now that I have npm. Now, I need is a Bundler equiv to deal w/ fluxy apis." -- xnoɹǝʃ uɐıɹq. http://twitter.com/brianleroux/status/17397051510 [07:15] isaacs: bmizerany: http://github.com/isaacs/npm/blob/master/doc/coding-style.md#readme [07:16] mape: I just find k&r cluttred [07:16] bmizerany: isaacs: thank god. ok. how about we rip though node and take them all out? :) [07:16] isaacs: hahah [07:16] isaacs: bmizerany: well, you need them in a few casese. [07:16] bmizerany: isaacs: right. I mean the unneeded ones :) [07:16] bmizerany: of course. [07:17] isaacs: bmizerany: inimino wrote up a good explanation of ASI on his blog some time ago [07:17] mape: a node fork without ; ? [07:17] isaacs: bmizerany: http://inimino.org/~inimino/blog/javascript_semicolons [07:17] isaacs: bmizerany: i think ryah likes to have the ;s so that node is less funny looking. [07:18] isaacs: bmizerany: personally, i kinda dig npm looking a little unique. it's easier to look at, and you knwo what? if semicolons usage would scare you off, maybe you shoudln't be mucking around with dependency management. [07:18] mape: And with the spaces :( [07:18] mde: There is something to be said for good, idiomatic JS. [07:18] isaacs: mde: my js is nothing if not highly idiomatic ;) [07:18] mde: Especially if you're trying to evangelize and teach. [07:18] bmizerany: isaacs: :) [07:19] mde: isaacs: I don't mean inventing your own idiom. :) [07:19] mikeal has joined the channel [07:19] isaacs: mde: i haven't [07:20] isaacs: mde: actually, this style predates me by some time. [07:20] mde: Ot [07:20] isaacs: mde: i've sort of come to it organically, but it's just Plain Old JavaScript [07:20] mde: It's not anything like the common idiom. [07:20] nofxx has joined the channel [07:21] isaacs: mde: the current "common idiom" is only common because Java programmers who didn't grok ASI came to js and started setting standards. [07:21] mde: No, it's impossible to argue that anything leaving out semis is plain JS. [07:21] isaacs: mde: it's the standard that's been around for ages. it's supported by *every* javascript interpreter. [07:21] mape: is there a jsbeautifier where you can define the rules? [07:21] isaacs: i don't know what's less plain about it? [07:21] isaacs: mape: not that i'm aware of, at least, not a good one. [07:21] isaacs: mape: inimino wrote something like that, and i played with it a little, but didn't very far. [07:21] mikeal: oh man [07:21] mikeal: please stop [07:22] mikeal: everyone, let's just stop [07:22] isaacs: lolz [07:22] mde: It leaves out semicolons. Every common description of the language syntax says "lines end in semicolons." [07:22] mikeal: no more syntax discussion [07:22] mikeal: i'm tired [07:22] isaacs: mde: no, just broken descriptions of the language. [07:22] isaacs: mde: that's not a description of the language, it's a broken how-to written by someone who doesn't kno whow the language works. [07:22] mape: isaacs: Hmm k, would be neat to have it as a post commit hook [07:22] isaacs: mape: INORITE!? [07:22] mape: FO SHO [07:23] mape: perhaps something for node knockout [07:23] mape: #idea [07:23] isaacs: mde: semicolons make statement endings explicit. [07:23] mape: I've been thinking about that, how much of the knockout projects need to be very node specific or just cool js stuff you can use with node [07:23] mde: I know you know how the parser works. :) [07:23] isaacs: mde: that's why i require them in front of ( or [ at the start of the line [07:24] mde: I know you're smart, and know exactly how the parser works. [07:24] bjartek: Tim_Smart: tsk tsk tsk :D [07:24] charlesjolley- has joined the channel [07:24] bjartek: that was regarding the java/ecmascript comment you had above tim :) [07:25] isaacs: mde: thanks, but flattering me won't convince me that semicolons are good to scatter about everywhere :) [07:25] mde: But every common, legitimate description of the language -- every document about "how to write JavaScript" -- describes the language as ending each line with a semicolon. [07:25] isaacs: if an idea is wrong, even if it's common, is bad. [07:25] isaacs: it's better to spread truth than lies. [07:25] mde: It's not scattering. [07:25] isaacs: why not indent with semicolons? [07:25] isaacs: why not put 3 at teh end of every line? [07:25] isaacs: it's no less absurd. [07:25] isaacs: (ok, it's 1/3 as absurd) [07:26] mde: If you don't have the kind of complete understanding of how the parser works that you have, your code will break. [07:26] isaacs: mde: actually, starting statements with ( or [ is pretty rare. [07:26] mape: 3/1 as absurd? [07:26] isaacs: mape: oh, yeah, i guess i did that fraction wrong :) [07:26] mde: So, if your goal is educating people about JavaScript, telling people "most of the time, you don't need semicolons" is totally unhelpful. [07:26] mape: totally absurd [07:26] isaacs: mde: my goal is to have beautiful code that is easy to read. [07:26] mde: Because a lot of the time, they'll fuck it up. [07:27] isaacs: mde: there's only one case where they can fuck it up. look at the "semicolon usage" section of npm's coding style guideline. [07:27] mape: isaacs: Doesn't doing "rare" code making it less easy to read? [07:27] isaacs: it's very very short, and super easy to understand. [07:27] mde: It depends on your goal -- my goal is to have as many people being productive with JS as posible. [07:28] isaacs: mde: sure, and one tool to accomplish that goal, long term, is to style the JS in such a way that the human brain can parse it as easily as possible. [07:28] mde: If they put a semicolon at the end of every line, as is described in *every single major documentation site,* they will never, never fuck it up. [07:28] isaacs: mde: is your goal to get these 100 people doing something great by the end of the day, and to hell with long-term learning or productivity? [07:28] mde: JS isn't the prettiest language. It doesn't have to be. [07:28] isaacs: mde: i disagree. they will find other ways to fuck lots of other things up. [07:29] isaacs: mde: making the language look cleaner makes it easier to master. [07:29] isaacs: mde: the rule is still pretty damn simple. [07:29] mde: My goal is, as I've always said, to have people writing simple plain *idiomatic* JS. [07:29] isaacs: compared with grokking closures or callbacks, in fact, semicolons are childs' play [07:29] mde: I think you think it's simple because you're smart. :) [07:29] isaacs: i'm really not as smart as i seem. [07:29] mde: Just write JS the way it's described everywhere. [07:29] isaacs: i think it's simple because it's pretty simple. [07:30] isaacs: mde: but then it's ugly, and harder to find bugs. [07:30] isaacs: mde: i'm not smart enough to maintain code like that. [07:30] mde: Just put a fucking semicolon at the end of lines. :) [07:30] isaacs: mde: but that's the "just do it cuz i said so and thats how you do it so there" argument. [07:30] isaacs: mde: that's bs [07:30] mape: isaacs: So you are as consistant with ; as I am with the { ? :P [07:30] mde: It's not some huge, onerous burden. :) [07:30] isaacs: mde: you only think that because you've never spent any considerable time in my side of teh fence. [07:31] mape: Where the grass is greener? [07:31] mde: I respect your logic, but I disagree with it vehemently. :) [07:31] isaacs: mde: taking a several KLOC javascript project, and stripping the ; from it, it's like a breath of fresh air. [07:31] isaacs: i can hardly explain how liberating it was. [07:31] mde: I have no interest in departing from the commonly accepted standard. [07:31] TomY has joined the channel [07:31] isaacs: mde: but then you're just saying that you'll agree with me if i convince a few thousand people. [07:31] mde: Because I think the value you get from that is very, very low. [07:31] isaacs: mde: again, i don't think you understand, because you haven't seen it [07:32] bulters has joined the channel [07:32] isaacs: read through the npm codebase. really look through it, understand what it's doing. make it familiar. then go look at some generic jquery code with semicolons everywhere. [07:32] mde: isaacs: I have looked at a bunch of source code written that way. [07:32] isaacs: mde: have you written any? i mean, actually maintained and managed a "non-idiomatic" project? [07:33] isaacs: it can be a very enlightening experience. [07:33] isaacs: there's a reason that people don't go BACK to using semicolons everywhere. [07:33] mde: I have literally zero interest in writing a bunch of non-standard code, for the philosophical reasons I described. [07:33] mde: It's not a quesiton of "lack of understanding." [07:33] isaacs: but your philosophy is just the rule of the herd. [07:33] mde: It's just a plain difference of opinoion. [07:33] isaacs: i can't get behind that. [07:34] isaacs: aren't you even curious if maybe there's *something* to what i'm saying? [07:34] mde: I understand your argumment, totally. [07:34] isaacs: maybe, that hurdle, that momentary "ew, that looks funny" is enough to scare off most people, and maybe they're scared off from something that's really great. [07:34] mde: I used to use Ruby on the server. It's a beautiful, clean syntax. [07:34] mde: My problem is that you're in a position of leadership in the community. [07:35] isaacs: oh, no, i'm so not. [07:35] isaacs: javascript has no leaders. [07:35] isaacs: this is the most anarchic language community since c [07:35] mde: And you're writing a large body of code that's in a style that makes it easy for people new to JS to fuck stuff up. [07:35] mde: No. [07:35] isaacs: mde: again, i disagree. [07:35] mde: You're a leader, like it or not. :) [07:35] isaacs: i think this style makes it HARDER to fuck up. [07:36] mde: It's easier, because you have to understand what the parser is doing. [07:36] isaacs: it's better to know when semicolons are required. by adopting this style, they're always used when they matter, and never when they don't. [07:36] mde: If you *always* end with a semi, nothing ever fucks up. [07:36] isaacs: mde: nothing ever fucks up? [07:36] mde: I think you may be overestimating how educatable people really are. :) [07:36] isaacs: there are a million ways to fuck up anything. [07:36] mde: Right, but the line-ending stuff doesn't fuck up. [07:37] isaacs: mde: i think that the common style is actually more error prone in this case. [07:37] mde: Dude, we need to do this over beer sometime. :) [07:37] isaacs: humans are good at seeing what's lined up at the start of things. [07:37] isaacs: and notoriously bad at seeing what's jagged at the ends of things. [07:37] mde: Haha [07:37] mape: isaacs: have any good case where ; screw up the code? [07:37] isaacs: relying on semicolons being at the end of every statement is dangerous. [07:37] isaacs: it's easy to forget one. [07:37] zomgbie has joined the channel [07:38] isaacs: if you forget one in the one place where the next line starts with [ or (, then you're boned. [07:38] mde: And the ASM rule are specifically to make it less likely your code will break if you *do* for get. [07:38] isaacs: mde: if you MUST use semicolons abusively, please use them at the left-edge [07:38] mde: It's not abusively; it's the fundamental syntax of the language. :) [07:38] isaacs: starting lines with semicolons is more useful, because it is more noticeable when they are lacking. [07:38] isaacs: mde: it's not, though. [07:39] isaacs: mde: ASI is fundamental syntax of the language. [07:39] isaacs: ; is sugar [07:39] derferman: may I see an example of the code you two are talking about? [07:39] mde: Not in any of the major sites that document how to write it. [07:39] isaacs: derferman: http://github.com/isaacs/npm [07:39] isaacs: mde: there are wrong things on the internet. [07:39] isaacs: (+1 about over beers, btw, don't wanna let that comment slip by [07:39] isaacs: ) [07:40] mde: Dude, it's the fucking JS docs on the Mozilla site, not some random out on the 'Net. [07:40] bmizerany: is this closed source for now? http://mongrel2.org/home [07:40] isaacs: mde: There are wrong things about JS on the Mozilla site. [07:40] mde: But the overall thrust is not wrong. :0 [07:40] derferman: anyone know when and where the meetup is happening tomorrow? [07:40] mde: That's totally grasping at straws. [07:40] derferman: I heard sencha [07:40] isaacs: derferman: at "sencha", formerly extjs [07:40] isaacs: ok, it's late. i need some sleep. [07:40] derferman: isaacs: time? [07:41] mde: Seriously, I majorly respect what you're doing. That's why I'm giving you shit about this. [07:41] isaacs: mde: i'm flattered that you think i'm a leader. really, i am. i think that you overestimate the leadability of the js community [07:41] mde: People are looking to you to lead. [07:41] isaacs: even saying "js community" is a bit wonky to me. [07:41] mde: But there is one. :) [07:41] isaacs: i mean, ther'es a NODE community, and a jquery community, and a yui community... [07:41] isaacs: but a JAVASCRIPT community? meh. [07:41] mde: And I'm majorly, majory stoked to see it happening. [07:41] isaacs: buncha ruffians [07:41] mde: Haha [07:42] isaacs: derferman: 7, i believe [07:42] mde: Loose affilations, but it's there. :) [07:42] isaacs: sure sure [07:42] isaacs: ok, gnite noders. [07:42] mde: 'Night, dude. [07:42] mape: nn [07:47] ewdafa has joined the channel [07:49] everton has joined the channel [07:52] ph^ has joined the channel [07:54] CIA-76: node: 03Ryan Dahl 07master * rd49d53f 10/ src/node_http_parser.cc : Expose new HTTP methods - http://bit.ly/btXpNP [07:57] bmizerany has joined the channel [07:59] zomgbie has joined the channel [08:03] admc has joined the channel [08:03] admc_ has joined the channel [08:14] jetienne has joined the channel [08:17] xla has joined the channel [08:20] keeto has joined the channel [08:23] BBBB has joined the channel [08:24] jetienne_ has joined the channel [08:25] aubergine has joined the channel [08:25] teemow has joined the channel [08:32] weepy has joined the channel [08:33] weepy: Hi - does anyone know of a good way to send emails from node ? [08:34] weepy_ has joined the channel [08:34] weepy_ has joined the channel [08:35] weepy: any one herE ?! [08:37] sdgvf: http://github.com/kennethkalmer/node-smtp [08:40] nofxx has joined the channel [08:48] paul|work has joined the channel [08:51] _announcer: Twitter: "Oh ー only. But Win7Cygwin moved node.js" [ja] -- 天沢(痛風). http://twitter.com/amasawa/status/17401010714 [08:58] weepy: Hi - does anyone know of a good way to send emails from node ? [08:58] mape: weepy: How about you read instead of writing? [09:05] everton_ has joined the channel [09:10] nofxx has joined the channel [09:14] bmizerany has joined the channel [09:17] nofxx has joined the channel [09:20] jetienne: what is the current status of npm ? working ? [09:20] jetienne: [10:37] http://github.com/kennethkalmer/node-smtp <- weepy [09:21] aho has joined the channel [09:21] benoitc: is there a way from a fs.ReadStream to get the name of file ? and path [09:22] benoitc: or only path anyway [09:23] jetienne: benoitc: i think you will have to look at the source ot get that [09:24] benoitc: mmm ok thx [09:27] mape: jetienne: it works yeah [09:28] paul|work has joined the channel [09:30] kodisha has joined the channel [09:33] jetienne: curl -L http://github.com/isaacs/npm/tarball/master | tar xz --strip 1 <- this tech of install fails tho [09:33] jetienne: issacs should let a logger here [09:33] _announcer: Twitter: "started playing with #nodejs at #shdh on Sat; today built something to rival @progrium's wonderful squares demo. Demo at work in 9 hours! :D" -- Julian. http://twitter.com/jjs/status/17402660403 [09:39] jetienne: npm should really allow authentication with github or something [09:39] jetienne: how to i reset the password in npm publish ? [09:43] jetienne: npm fail Failed PUT response 500 [09:43] jetienne: okok i give up :) [09:45] hellp has joined the channel [09:46] nofxx has joined the channel [09:47] benoitc: mmm is there a way to now that somevar is a fs.ReadStream object [09:47] benoitc: typeof will tell me it's an object [09:47] mklappstuhl has joined the channel [09:48] benoitc: node> r.constructor == fs.ReadStream [09:48] benoitc: true [09:49] benoitc: ok. [09:51] aconran__ has joined the channel [09:54] _announcer: Twitter: "Na node.js the MinGW + MSYS to compile. pthreads-win32 at pthread_afork not been implemented or the problem will not be avoided." [ja] -- Toshihiro Shimizu. http://twitter.com/meso/status/17403473761 [09:56] lianj_ has joined the channel [09:59] nofxx has joined the channel [10:00] fermion has joined the channel [10:04] brainproxy has joined the channel [10:05] mAritz has joined the channel [10:27] _announcer: Twitter: "@xeolabs Did you consider Node.js as well? As I know the V8 is way faster than Rhino." -- Michael Aufreiter. http://twitter.com/_mql/status/17404825273 [10:28] markwubben has joined the channel [10:51] PyroPete1 has joined the channel [11:01] _announcer: Twitter: "Why haXe-nodejs? http://twurl.nl/mobrjk" -- tong. http://twitter.com/disktree/status/17406262124 [11:02] chandru_in has joined the channel [11:02] maushu has joined the channel [11:03] chandru_in: I have this C++ code http://pastebin.com/dr5cDMJe and am trying to access the name property with this JS code http://pastebin.com/2AigUuRY. It works in the first call but segfaults during the second. Could some one help me debug it? [11:10] brainproxy has joined the channel [11:17] fly-away has joined the channel [11:17] fly-away: hi2all [11:17] fly-away: is there other nodejs-based opensource projects except chat? [11:22] kodisha has joined the channel [11:24] jetienne: fly-away: many on github [11:24] fly-away: how can i find it? [11:24] jetienne: fly-away: not sure they mostly start with "node-*" [11:25] jetienne: fly-away: searching on twitter would be efficient too [11:25] jetienne: fly-away: i remember a massive game recently [11:26] femto has joined the channel [11:26] jetienne: fly-away: i dont remember the names [11:27] jetienne: http://github.com/search?type=Repositories&language=&q=node-&repo=&langOverride=&x=23&y=24&start_value=1 [11:27] viktors has joined the channel [11:32] chandru_in: Any help with my module code? [11:32] mape: Sorry, never worked with the C part of node [11:36] brainproxy has joined the channel [11:40] cloudhead has joined the channel [11:50] mAritz: fly-away: there's a module and "node users" section in the github wiki of node that contain a lot of opensource projects :) [11:51] mAritz: uhm... the main wiki site would be the one you're looking for though. :D [11:53] teemow has joined the channel [11:59] keeto has joined the channel [12:00] _announcer: Twitter: "@_mql However, after trying out Node.js just now...I think I may have jumped the gun..lets see how fast DOM parse is.." -- Lindsay Stanley Kay. http://twitter.com/xeolabs/status/17408921183 [12:01] khug has joined the channel [12:06] manveru: is there some way to do currying in js? [12:10] jetienne: http://flesler.blogspot.com/2008/11/haskell-functions-for-javascript.html [12:10] jetienne: no idea if it is good or not, just googed it [12:12] _announcer: Twitter: "@srcnix have you installed hummingbird yet? Just heard about node.js this weekend. Sound interesting." -- Bill Nobes. http://twitter.com/billnobes/status/17409554069 [12:12] manveru: jetienne: thanks [12:16] keyvan has joined the channel [12:19] _announcer: Twitter: "In Windows in wsh + jscript http://bit.ly/bhnf7f gjs http://bit.ly/aPI12P server in GNOME too andoemyeon nodejs http://bit.ly/3yYiqS yidojeo rhino http://bit.ly/ k6aF2" [ko] -- Dongsu Jang. http://twitter.com/iolothebard/status/17409932164 [12:20] _announcer: Twitter: "Hummindbird, an app built on top of Node.js to view website visitor info realtime, looks awesome. http://bit.ly/aXkmFP" -- Scott Radcliff. http://twitter.com/scottradcliff/status/17409981352 [12:24] keyvan has joined the channel [12:35] Tim_Smart: bjartek: Was that the comment bout ECMAScript and binary data? [12:36] hellp has joined the channel [12:42] blackdog_ has joined the channel [12:43] stepheneb has joined the channel [12:43] kriszyp_afk has joined the channel [12:44] mtodd_ has joined the channel [12:45] steadicat has joined the channel [12:46] phiggins has joined the channel [12:48] mw has joined the channel [12:57] Tim_Smart: https://mail.mozilla.org/pipermail/es-discuss/2009-November/010132.html :) [12:58] pkrumins: click. [12:59] pkrumins: binary needs to be added to ecmascript. i am currently base64'ing all the binary data otherwise. [12:59] persson has joined the channel [13:00] Tim_Smart: pkrumins: base64 doesn't help at all much, large strings are just as bad :/ [13:01] Tim_Smart: It's just that the current Buffer implementation (which works reasonably well for most things) is a little expensive at allocating memory. [13:04] mtodd has joined the channel [13:06] wilmoore has joined the channel [13:08] _announcer: Twitter: "Web server based on Javascript, interesting http://nodejs.org/" [de] -- Maggo. http://twitter.com/MaggoLive/status/17412716677 [13:14] jherdman has joined the channel [13:15] davidsklar has joined the channel [13:16] kersny has joined the channel [13:16] sudoer has joined the channel [13:22] _announcer: Twitter: "Great introduction to Node.js and event-driven JavaScript programming: http://bit.ly/cUugSo #tv" -- Ryan Carson. http://twitter.com/ryancarson/status/17413564383 [13:27] _announcer: Twitter: "Video introduction to node.js and event driven programming. http://bit.ly/cKYymn" -- Jan Järfalk. http://twitter.com/janjarfalk/status/17413877634 [13:30] benoitc: mmm trying to read an fs.ReadStream, but I can't get data, where I'm wrong here : http://www.friendpaste.com/4dQ6ojxOhVbjMwO17Z1zMZ [13:30] benoitc: ? [13:30] perdiy has joined the channel [13:30] _announcer: Twitter: "Anyone using/have used Joyent's Smart Platform? #nodejs" -- Joe McCann. http://twitter.com/joemccann/status/17414091765 [13:32] _announcer: Twitter: "Great introduction to Node.js and event-driven JavaScript programming: http://bit.ly/cUugSo #tv: Great introductio... http://bit.ly/9TBZqR" -- gorocube. http://twitter.com/gorocube/status/17414177919 [13:32] _announcer: Twitter: "Great introduction to Node.js and event-driven JavaScript programming: http://bit.ly/cUugSo #tv http://bit.ly/9TBZqR (no affil)" -- Mike Rose. http://twitter.com/MikeRosePRO/status/17414179335 [13:33] Sembiance: :) [13:36] _announcer: Twitter: "@_mql Good performance experimenting with Node.js+jsdom - thanks for the tip - http://bit.ly/cONO3e" -- Lindsay Stanley Kay. http://twitter.com/xeolabs/status/17414420335 [13:37] saikat has joined the channel [13:37] sanderjd has joined the channel [13:37] sanderjd has left the channel [13:39] benoitc: does anyone have a working example of fs.ReadStream ? [13:39] kersny has joined the channel [13:44] bradleymeck2 has joined the channel [13:45] zomgbie has joined the channel [13:48] robrighter has joined the channel [13:52] cloudhead has joined the channel [13:58] mertimor has joined the channel [13:59] mertimor has joined the channel [14:00] mertimor has joined the channel [14:01] mertimor has joined the channel [14:03] mertimor has joined the channel [14:03] _announcer: Twitter: "Well node.js chirpstream and play with. I stopped again to stop Flash Builder." [ja] -- KUROKI Ippei. http://twitter.com/pantherhead/status/17416225035 [14:03] _announcer: Twitter: "Well @ epoch__ node.js chirpstream and play with. Another Flash Buil http://801658r.itter.ch/" [ja] -- みにえぽっく. http://twitter.com/miniepoch__/status/17416225311 [14:04] mertimor has joined the channel [14:06] davidwalsh has joined the channel [14:13] behmann has joined the channel [14:13] pandark_ has joined the channel [14:17] saikat has joined the channel [14:18] jstewart has joined the channel [14:19] ryan_gahl has joined the channel [14:21] nsm has joined the channel [14:25] creationix has joined the channel [14:25] ceej has joined the channel [14:25] Aikar has joined the channel [14:27] ditesh|cassini has joined the channel [14:28] derferman has joined the channel [14:30] bradleymeck2: pquerna saw the logs on partially compiled v8 scripts, and here is the low down, OS Dependant, v8 Version Dependant, Source code to use the compiler hints must match code hints were compiled with (will blow up otherwise and start leaking sometimes), did some research into this but cant get c++ to save the file right :/. [14:38] zomgbie has joined the channel [14:42] pgriess has joined the channel [14:44] joshbuddy has joined the channel [14:44] joshbuddy has joined the channel [14:44] Yuffster has joined the channel [14:46] ajpiano has joined the channel [14:46] _announcer: Twitter: "Seems "cross-platform" nowadays means that code runs both in browser and NodeJS :) #javascript #nodejs" -- SamuraiJack8. http://twitter.com/SamuraiJack8/status/17419138966 [14:47] aconbere has joined the channel [14:48] stepheneb has joined the channel [14:50] _announcer: Twitter: "Current cravings - 1) Taco bell and nodejs. 2) potato chips and django." -- Dustan Kasten. http://twitter.com/iamdustan/status/17419376169 [14:52] steez has joined the channel [14:54] kodisha: i think that working in node made me a better php programmer :) [14:54] softdrink has joined the channel [14:54] bradleymeck: prolly helps understand the client side a bit better as well [14:55] kodisha: well, client side is ok, i have solid knowledge of that... but every time i create some models/database calls/stuff like that i remember how cool it would be if it could be done in async [14:56] everton has joined the channel [14:59] steadicat has joined the channel [14:59] steez: sorry, what's the syntax for creating a tcp connection (as a client) [15:00] bradleymeck: net.createConnection(port, host='127.0.0.1') [15:01] khug has joined the channel [15:02] steez: ah okay, i'ts not s = new net.Stream(); s.connect() ? [15:02] steez: that feature would fail, even wrapped in a try catch, so i've been playing with python instead for a while.. [15:03] bradleymeck: createConnection failed? [15:03] tlrobinson has joined the channel [15:03] steez: but i say a talk _ry gave about changing the way he interacts with like files through v8 [15:03] steez: like try { var s = new net.Stream(); s.connect(9000,'localhost'); } catch(e) {sys.log(e)} would still throw an error [15:03] steez: a few months ago.. [15:03] mjr_: Probably Buffers. [15:04] mjr_: A hotly debated subject in node. [15:04] tmpvar has joined the channel [15:05] mjr_: creationix: are you part of this "webinar" thing? [15:05] rasputnik has joined the channel [15:05] creationix: mjr_: no, but I should probably head to work so I can listen in [15:06] mjr_: I'm listening using the power of the internets. [15:06] mscdex: steez: if it does, you could always catch it with s.addListener('error', function (err) {}); [15:06] creationix: hmm, already started, oh well [15:06] rasputnik: hi all, I need to tail a logfile and alert when certain strings appear. Does this sound like a good fit for node? [15:06] mscdex: a node webinar? :S [15:07] steez: fancy [15:07] creationix: mscdex: no, a sencha touch html5 webinar [15:07] mscdex: oh [15:08] steez: oh coool, i'll try that mscdex :) [15:08] ceej: hell ye http://github.com/blog/674-introducing-organizations [15:09] steez: awesome. that totally worked mscdex :D [15:10] mscdex: np [15:10] robrighter has joined the channel [15:16] rasputnik: nvm, found something close enough to get me started. [15:18] peburrows has joined the channel [15:19] malkomalko has joined the channel [15:19] _announcer: Twitter: "From the looks of it, Node.js looks interesting!" -- Yassir Yahya. http://twitter.com/yassiryahya/status/17421380510 [15:19] pkrumins: "from the looks" [15:19] pkrumins: useless tweet [15:20] mjr_: We should really get a "useful tweet" filter on the bot. [15:20] mAritz: isn't "useless tweet" redundant? [15:20] mAritz: mjr_: /ignore should do just that :P [15:20] pkrumins: hmm, you're right, it is. [15:23] robrighter has joined the channel [15:24] steez: ..is there a shell exec command? [15:24] khug has joined the channel [15:24] mjr_: http://nodejs.org/api.html#child_process-exec-90 [15:25] sanderjd has joined the channel [15:25] steez: thanks:) [15:25] sanderjd has left the channel [15:26] mjr_: Hey bot developers, how about an API lookup bot? [15:27] tav has joined the channel [15:28] _announcer: Twitter: "basic auth middleware for #nodejs Connect http://github.com/sr/connect-basic-auth" -- sr. http://twitter.com/srt/status/17421977859 [15:29] k3yvn has joined the channel [15:29] creationix: sr: cool stuff [15:34] rektide: wow forgot the suck that is EST time zone [15:35] mjr_: I didn't know that timezones had inherent suck levels. [15:36] rektide: the suck of being too early for most people [15:36] mscdex: i thought about an API lookup bot once [15:36] JimBastard has joined the channel [15:36] JimBastard: all hail king neptune and his water breathers [15:36] tmpvar has joined the channel [15:36] jashkenas has joined the channel [15:36] mscdex: but there was something with parsing the docs that wasn't uniform or something [15:37] jashkenas: 'morning folks: Is it possible to set the process name of the node process somehow? For use with pkill and pgrep? [15:37] creationix has joined the channel [15:38] mscdex: jashkenas: maybe [15:38] jashkenas: a binding to setproctitle() is I guess what I'm looking for. [15:38] JimBastard: jashkenas: dunno, we use pid [15:38] mscdex: jashkenas: did ryah add this already to node i think? [15:38] jashkenas: JimBastard: alright -- that'll work. thanks. [15:38] mjr_: I've seen some gists flying around to fix this lately, but I'm not sure what the API is. [15:38] mjr_: Or if it is in yet. [15:39] sr: creationix, heh yeah now i can deploy my app [15:39] aglemann has joined the channel [15:39] khug has joined the channel [15:39] aglemann has left the channel [15:39] mscdex: mjr_: like marking up the parameters and description and stuff individually? [15:40] gerad has joined the channel [15:41] afters has joined the channel [15:41] mjr_: mscdex: I was talking about the proc title stuff. I know ryah has been working on it, but I'm not sure what the status is. [15:41] mscdex: oh, ok i meant the api docs yet hehe [15:42] mjr_: But what's wrong with the doc format that you can't parse it? mape's viewer app parses it on the client side. [15:42] mscdex: well most of it is parseable [15:42] aubergine has joined the channel [15:42] ryah: jashkenas: http://gist.github.com/458813 [15:43] jashkenas: ryah: nice. holy crap that's a lot of code just to set a field. [15:44] ryah: jashkenas: it's a lot worse than you think originally [15:44] mostlygeek has joined the channel [15:44] mscdex: mjr_: i mean like for callbacks and stuff, there's no way to know what the parameters for those should be without manually specifying them by hand [15:44] ryah: jashkenas: it probably needs this code too: http://gist.github.com/456271 [15:44] mjr_: mscdex: oh yeah, that's a bummer. I wish we had a better way to represent that stuff in the doc format, but ronn is pretty restrictive. [15:46] mscdex: ACTION shakes a fist at ronn [15:46] JimBastard: ACTION shakes his fist at this damn kids on the lawn [15:46] _announcer: Twitter: "I want a NodeJS t-shirt! /cc @ryah @creationix" -- dominiek. http://twitter.com/dominiek/status/17423283143 [15:46] JimBastard: s/this/these/fail [15:47] benoitc: hrm anyone know a good mimetypes module to get mimetypes from file extension [15:47] benoitc: ? [15:47] JimBastard: benoitc: theres a bunch of them everywhere [15:47] JimBastard: just look through the modules page [15:47] mscdex: maybe i'll just insert the missing/unparseable stuff by hand.... [15:48] jashkenas has left the channel [15:48] JimBastard: benoitc: http://github.com/Marak/hook.io/blob/master/hookio/lib/mime.js [15:48] benoitc: modules page N [15:48] benoitc: ? [15:48] benoitc: thx [15:48] mscdex: i'm on it! [15:48] JimBastard: benoitc: the modules page on the node wiki [15:48] JimBastard: its full of win [15:48] benoitc: cool thx [15:48] mscdex: wiki wiki wiki! [15:52] mjr_: mscdex: just being able to refer to the items in the left pane of the api viewer would be good, especially if you could search the description to find the link. [15:53] _announcer: Twitter: "node.js of ML has been made in the v2 API Specification Draft for an interesting debate" [ja] -- Toshihiro Shimizu. http://twitter.com/meso/status/17423717223 [15:53] steez has joined the channel [15:55] mjr_: ryah: did you know that the uncaughtException example in api.markown doesn't work? It looks like uncaughtException isn't working. [15:57] _announcer: Twitter: "Started middleware contrib wiki page for Connect http://wiki.github.com/extjs/Connect/ # nodejs" [pt] -- TJ Holowaychuk. http://twitter.com/tjholowaychuk/status/17423966226 [15:57] aubergine has joined the channel [15:58] chakrit has joined the channel [15:58] blackdog_ has joined the channel [15:59] ryah: mjr_: no [16:05] polo has joined the channel [16:14] mjr_: ryah: want me to file an issue for that? [16:16] kersny has joined the channel [16:22] aconbere has joined the channel [16:22] bpot has joined the channel [16:23] derferman_ has joined the channel [16:24] tjholowaychuk has joined the channel [16:24] chrischris has joined the channel [16:24] saikat has joined the channel [16:28] _announcer: Twitter: "Nodejs on Ubuntu server checklist: - installing Node, ok; - opening port 80 in iptables, ok; - helloworldserver.js, ok; and then???" -- Louis-Rémi Babé. http://twitter.com/lrbabe/status/17426065476 [16:29] aglemann has joined the channel [16:30] cactuss has joined the channel [16:31] cactuss: this code to set up a node unix domain socket server doesn't seem to be working.. can someone take a quick look? http://pastie.org/1025256 [16:32] aglemann has left the channel [16:35] jakehow has joined the channel [16:35] tyfighter has joined the channel [16:36] tyfighter has joined the channel [16:37] indiefan has joined the channel [16:37] DozyPieman has joined the channel [16:38] rauchg_ has joined the channel [16:38] creationix has joined the channel [16:41] dondani has joined the channel [16:41] ryah: mjr_: huh.. wtf [16:41] ryah: what changed? :/ [16:42] dondani: how can I remove a file without resorting to 'rm'? I want this script to be platform-independent [16:42] mjr_: dondani: in node? unlink [16:42] mjr_: ryah: I think it broke a version or two ago [16:42] dondani: mjr_: thanks [16:44] bradleymeck: mape, ya here? how do you make a node-irc client change nicks? [16:44] kodisha_ has joined the channel [16:46] _announcer: Twitter: "Anyone tried to install #node.js on windows 7 Subsystem for UNIX-based Applications?" -- A'braham Barakhyahu. http://twitter.com/BlessYahu/status/17427212990 [16:46] [[zzz]] has joined the channel [16:46] dondani: in the same line, is there a simple way to copy a file? or do I have to use readFile and writeFile? [16:47] ryah: dondani: ReadStream and WriteStream and sys.pup [16:47] ryah: pump [16:48] ryah: is the recommended, but possibly not working, way [16:48] dondani: hehe [16:48] mjr_: and also not so well documented way [16:48] ryah: yeah [16:48] mjr_: It'd be like living in the future if you did it that way. [16:49] dondani: sys.pump doesn't even appear in the api docs... [16:49] dondani: think i'm too much of a noob for that [16:49] mjr_: The future! [16:51] bradleymeck: JSON.parse makes me sad, it likes to blow up a lot [16:51] nofxx: Is there some way to don't cache the code, ie.: dont need to restart server on dev? [16:51] nofxx: I wrote a simple watchr script, works, but now I realized I'm not the only person on the world [16:52] aubergine has joined the channel [16:54] Validatorian has joined the channel [16:56] kodisha has joined the channel [16:57] ryah: git bisecting [16:57] liucougar has joined the channel [16:59] markwubben has joined the channel [17:00] keyvan has joined the channel [17:00] marshall_law has joined the channel [17:01] _announcer: Twitter: "I am writing NodeJS, Ruby, and ObjC in a coffeeshop, feeling stereotypical." -- ndnichols. http://twitter.com/ndnichols/status/17428181417 [17:02] visnup has joined the channel [17:02] derferman has joined the channel [17:03] _utility has joined the channel [17:03] ryah: wow.. that uncaughtExceptin has been broken for a while [17:04] aconbere_ has joined the channel [17:04] ryah: just tested 98 [17:04] _utility has joined the channel [17:05] mscdex: 50% done with the nodejs doc bot [17:05] mscdex: :-D [17:06] _frankie has joined the channel [17:09] dgathright has joined the channel [17:10] _announcer: Twitter: "ok, just released noddycouch 0.1 , my minimal #couchdb library for #nodejs : http://bit.ly/cFVfkI , full couchdb api is supported" -- benoît chesneau. http://twitter.com/benoitc/status/17428717686 [17:10] _announcer: Twitter: "now working on my couchapp engine using nodejs." -- benoît chesneau. http://twitter.com/benoitc/status/17428753559 [17:11] _announcer: Twitter: "now working on my #nodejs couchapp enging using noddycouch, also adding some doc." -- benoît chesneau. http://twitter.com/benoitc/status/17428791192 [17:11] stevendavie has joined the channel [17:11] ryah: mscdex: what's that? [17:12] teemow has joined the channel [17:12] mscdex: irc bot that lets you do nodejs api lookups [17:12] kodisha has joined the channel [17:12] marshall_law: gerad: you around? [17:13] visnup: marshall_law: he threw his back out [17:13] marshall_law: ouch [17:13] marshall_law: that sucks :( [17:13] visnup: he's drugged up and taking the morning off [17:13] marshall_law: cool.. hopefully he feels better [17:13] marshall_law: visnup: are you on KO as well? [17:14] visnup: marshall_law: yup [17:15] jlilly has joined the channel [17:20] WALoeIII has joined the channel [17:21] jashkenas has joined the channel [17:24] markjenkins: [13:26] Hey Guys! I'm working on this awesome new library for doing all sorts of cool JavaScript stuff. I'm calling it mQuery. It's kinda like jQuery but it's way more awesome! Does anyone here want to help contribute to my project? I'm a little stuf on the AJAX part, I'm sure how to create the requests. Does anyone know how to do this? [17:24] markjenkins: LOL [17:24] _announcer: Twitter: ""Node.js Knockout" Hackathon, win an iPad! http://bit.ly/bI8h7G" -- Web Developer Links. http://twitter.com/webdevlinks/status/17429609692 [17:25] visnup: weird how ipads made it into the title [17:27] visnup: oh, open question: we have some cash from knockout sponsors and were brainstorming ideas for prizes. any suggestions? [17:27] caolanm has joined the channel [17:27] mscdex: maybe node hosting? [17:27] mscdex: i dunno [17:27] mscdex: or cash lol [17:27] visnup: heroku and joyent will probably be throwing in hosting/credits for winners [17:28] qFox has joined the channel [17:28] markjenkins: visnup: cash [17:28] bradleymeck: shirts [17:28] markjenkins: :p [17:28] visnup: cash signed by ryah? [17:28] mscdex: ryah bucks! [17:29] mscdex: :-P [17:29] mscdex: node bucks [17:29] k3yvn has joined the channel [17:29] mscdex: redeemable for feature requests [17:29] caolanm: does anyone here use something like authbind with socket.io? [17:29] caolanm: I don't want to run a web app as root! [17:29] [[zz]] has joined the channel [17:29] mscdex: caolanm: remove the flash websocket from the list of available transports on the server end [17:30] caolanm: but then it broke in firefox :\ [17:30] mscdex: huh? [17:30] caolanm: yeah, not sure why [17:30] mscdex: is it trying to use flash websocket in ff? [17:30] visnup: firefox will try flash first, then xhr-longpolling I think [17:31] caolanm: even if flash is disabled on the server? [17:31] JimBastard__: i just trolled jQuery soo hard [17:31] JimBastard__: works everytime [17:31] JimBastard__: ahaha [17:31] mscdex: well, move the flash websocket transport to the end of the list on the client side or remove it completely [17:31] mscdex: ff should be selecting multipart if it multipart has a higher priority than longpoll [17:31] caolanm: didn't know I could customise the transport list on the client too [17:31] mscdex: s/it// [17:32] mscdex: caolanm: yup [17:34] _utility has joined the channel [17:34] _frankie has joined the channel [17:40] caolanm: mscdex: just can't seem to get FF working with socket.IO unless it uses flash :( [17:40] caolanm: do you have an example? [17:40] mscdex: what version of ff is this? [17:40] marshall_law has joined the channel [17:41] caolanm: FF 3.6.6 [17:41] javajunky has joined the channel [17:41] mscdex: well, ff should definitely work with multipart and longpoll [17:41] mscdex: multipart is ff-only too [17:41] mscdex: iirc [17:41] mscdex: i always use the chat example [17:41] kodisha_ has joined the channel [17:41] cloudhead has joined the channel [17:42] mscdex: but i haven't used the learnboost master branch in quite some time [17:44] jxson has joined the channel [17:45] admc_ has joined the channel [17:45] admc has joined the channel [17:47] mscdex: oh man, the node.js html api docs need semantic markup badly :-( [17:48] kersny has joined the channel [17:49] _announcer: Twitter: "A simple chat server done in Node.JS (Slightly improved version of http://dhotson.tumblr.com/post/271733389/a-simpl… http://bit.ly/aYmcHi" -- Kenneth McCall. http://twitter.com/ellisgl/status/17431125634 [17:51] [[zz]] has joined the channel [17:55] _announcer: Twitter: "@bkocik #Django or #Node.js imo" -- Nick Campbell. http://twitter.com/ncb000gt/status/17431475662 [17:56] derferman has joined the channel [17:59] brianmario has joined the channel [17:59] isaacs has joined the channel [18:03] stevendavie1 has joined the channel [18:05] markwubben_ has joined the channel [18:06] x_or has joined the channel [18:08] caolanm: is it possible to put socket.io behind nginx? doesn't seem to be working for me... [18:09] saikat: caolanm: i've heard that nginx doesn't play well with websocket [18:09] isaacs: caolanm: don't use nginx as a proxy. [18:10] isaacs: caolanm: nginx is for serving files, not for serving servers. [18:11] saikat: isaacs: it's still nice to have a proxy - as far as i know, to have my site support websocket connections in addition to the normal stuff, i need to run node with socket.io on a separate port and make requests to that server separately [18:11] saikat: or is that incorrect? [18:11] mscdex: cactuss: fwiw i use haproxy [18:11] isaacs: saikat: check out haproxy or varnish [18:11] mscdex: er [18:11] saikat: oh ok, thanks [18:11] isaacs: ACTION set up nginx as a proxy, and has been regretting it ever since. [18:11] mscdex: caolanm: fwiw i use haproxy [18:11] mscdex: tab fail :-( [18:11] saikat: what else has it been bad for isaacs? [18:11] technoweenie has joined the channel [18:11] saikat: i've been using it pretty well, but i have a simple setup (static files + django so far) [18:12] caolanm: ok I'll look into haproxy [18:12] saikat: er, django running behind fastcgi [18:12] isaacs: saikat: for serving files, it's AWESOME [18:12] isaacs: saikat: the ideal system is to have nginx just serve all your static files, and be one of the things behind haproxy or varnish [18:12] saikat: i see [18:12] isaacs: so nginx isn't the gatekeeper, it's the file server. [18:12] saikat: right [18:13] isaacs: and then have haproxy direct everything from static.example.com to nginx's port [18:13] isaacs: and always use that for your images and css and whatnot [18:13] technoweenie: node.js hasnt been a great file server for me [18:13] technoweenie: it consumes a ton of memory [18:14] isaacs: yeah, exactly [18:14] technoweenie: its better on node master, but i still use nginx [18:14] isaacs: nginx is optimized for exactly that use case. [18:14] technoweenie: though i'm personally talking about larger files too. if all you're serving is html/css and shit, node is fine [18:14] isaacs: node is great for other stuff, though [18:14] isaacs: like, complex logic stuff. that's where it shines [18:15] technoweenie: this is day 2 of node handling all of the github download stuff, i'm really happy with it [18:15] fermion has joined the channel [18:16] technoweenie: even w/ the high memory usage, i'll be able to spin down enough ruby stuff to convert that server from an archive server to a node server :) [18:16] sh1mmer has joined the channel [18:16] mikeal has joined the channel [18:16] isaacs: technoweenie: that's right, you work for github, yes? [18:17] technoweenie: yea [18:17] cactuss: ah tab fail [18:18] mikeal: technoweenie: you should add CLA features to github so that ry doesn't have to do all this crap by hand :) [18:18] mikeal: also [18:18] isaacs: yeah, seems like it'd dovetail nicely with the new organizations stuff. [18:18] mikeal: for Apache projects, we could try to start moving some of them to GitHub and taking contributions there [18:18] isaacs: it'd make yui's life easier, too [18:19] isaacs: maybe even make it a part of the pull req flow [18:19] technoweenie: so few projects use CLA, and it goes against the github philosophy [18:19] mikeal: on CouchDB, we do all the real work on GitHub but any non-committer contributions have to be patches in Jira because of the CLA [18:19] isaacs: technoweenie: really? [18:19] technoweenie: and with oauth, anyone could write their own CLA tracker on top of github [18:19] javajunky has joined the channel [18:19] isaacs: technoweenie: but github's in a position to make it easy and consistent. [18:19] mikeal: it needs to be better integrated than that [18:20] mikeal: like, if I care, i need to see when a user doesn't have a certain CLA [18:20] isaacs: ACTION will hopefully have to get a CLA in place for npm eventually [18:20] mikeal: especially in the fork queue and for pull requests [18:20] BBBB has joined the channel [18:20] mikeal: you don't *want* a CLA :) [18:20] mikeal: sometimes you just have no choice [18:21] aubergine has joined the channel [18:21] isaacs: mikeal: what i'm saying is, hopefully i'll be in a position to have no choice, because it'll mean that someone with money cares about npm [18:21] isaacs: s/someone/some business/ [18:21] sh1mmer: ryah: if you don't feel like being in the office a bunch of us are hanging out in sugar lump on 24th and byrant [18:21] sh1mmer: isaacs: I'll give you a $1 [18:21] sh1mmer: CLAs are boring but it's a good idea to protect yourself [18:21] sh1mmer: or your project, just in case [18:22] isaacs: sh1mmer: for the moment, npm is pretty much 100% my own work. the next biggest contributor is mikeal, and he's even more religious about FOSS than i am. [18:22] mAritz: i'm assuming, you're not talking about Conjugated linoleic acid, right? [18:22] technoweenie: what do you need to be protected from? companies claiming oss work done by their employees are copyrighted? [18:23] isaacs: technoweenie: contributors claiming that their work is copyrighted, whether it's a company/employee or just some dude who says "you can't use this any more" [18:23] sh1mmer: isaacs: but what happens if jchris decides all of mikael's work is his and that he owns swaiths of npm? [18:23] sh1mmer: not that he would, but it's feasible. [18:23] isaacs: sh1mmer: if mikeal didn't do it at work, or on a work machine, then jchris would have a hard time enforcing that assertion. [18:24] isaacs: sh1mmer: also, it'd be tricky if i decide that i want to relicense it to someone under a different license that is not compatible with MIT [18:24] sh1mmer: isaacs: unless it is related to couch.io's business... [18:24] isaacs: sh1mmer: and then mikeal says "oh, you can't have the config stuff, then, because i don't agree" [18:24] sh1mmer: isaacs: I'm just saying CLAs are helpful for a few reasons, even if they are annoying [18:24] isaacs: yeah [18:25] isaacs: if i had more contributors, especially contributors whose houses i hadn't been to, it'd be a bigger deal. [18:25] isaacs: i totally get why yui and node and apache have them [18:25] technoweenie: the node cla was the first one i've even considered signing [18:25] isaacs: technoweenie: why the opposition? [18:25] devhost has joined the channel [18:25] sh1mmer: isaacs: I'd like someone to make a template CLA and provide an independent digital signing service [18:26] sh1mmer: isaacs: that would be an awesome thing for Github to do [18:26] technoweenie: i dont personally have any opposition, it just seems like extra hassle [18:26] technoweenie: rails is a big oss project, it seems odd there's never been pressure to add a rails CLA [18:26] isaacs: sh1mmer: if only you knew someone at some big company that does a lot of open source stuff and has an army of engineers and lawyers to throw at this problem... [18:26] benoitc: noddycouch start to work well http://www.friendpaste.com/5IJlYRxfaPAMIAPVntyAtW tthe consumer object [18:26] sh1mmer: isaacs: haha [18:26] sh1mmer: isaacs: you know full well I don't work at Google [18:26] benoitc: i've one question about the http client , does it manage a pool of connections with keepalive ? [18:26] benoitc: or do we have to build one ? [18:27] isaacs: technoweenie: it usually only becomes an issue if a single company has a strong interest in a particular project. [18:27] isaacs: technoweenie: as joyent/node, yahoo/yui, etc. [18:27] technoweenie: yahoo wrote yui [18:27] isaacs[away]: technoweenie: yahoo employees and outside contributors wrote yui [18:28] creationix: sh1mmer: where are you at? [18:28] sh1mmer: creationix: sugar lump [18:28] kersny has left the channel [18:29] sh1mmer: 24th and bryant [18:29] sh1mmer: creationix: not going to make the valley [18:29] creationix: sh1mmer: you busy tonight? [18:30] sh1mmer: creationix: I can't make it tonight, promised my wife we'd watch a movie [18:30] bmizerany has joined the channel [18:30] creationix: sh1mmer: I guess I'll let you off the hook [18:31] sh1mmer: heh [18:31] sh1mmer: creationix: in general south bay isn't good for me because of a complete lack of a driving license [18:31] creationix: sh1mmer: yeah, and ryah doesn't have a car [18:32] creationix: I was thinking of having the meetup in the city every other time [18:32] creationix: I got a scooter, I'm mobile [18:32] creationix: speaking of the meetup in Palo Alto tonight, who is coming and when can we expect you? [18:32] creationix: marshall_law, isaacs[away] mikeal ^ [18:33] pedrobelo has joined the channel [18:33] mikeal: that's tonight? [18:33] mikeal: i can't make it [18:33] marshall_law: i can make it [18:33] marshall_law: ;) [18:33] mikeal: i'm having people over to watch the Sounders play the Timbers :) [18:33] marshall_law: it's a ~15 miniute train ride for me, so i can be there probably 6:30-7ish? [18:33] isaacs[away]: i'll be there. 7 at sencha [18:34] marshall_law: minute too [18:34] isaacs[away]: creationix: you should set up a google calendar for sencha node meedups [18:34] isaacs[away]: *meetups [18:35] creationix: the reason I ask is because we got lots of new people and I need to know when to start clearing space [18:36] steadicat has joined the channel [18:37] keyvan has joined the channel [18:40] devhost` has joined the channel [18:43] aubergine has joined the channel [18:44] maushu has joined the channel [18:46] khug has joined the channel [18:46] _announcer: Twitter: "I had not tested for a while but now compiles on FreeBSD node.js \ o / http://nodejs.org/" [fr] -- Jérôme M.. http://twitter.com/phollow/status/17434267167 [18:49] javajunky has joined the channel [18:50] mscdex: oh neat, my area actually has a web developers meetup [18:51] mau has joined the channel [18:51] bmizerany: are there any good, standard math libraries for JS (not Math) for doing stats or that contain basic stat operations like sum/stdev/max/min/ect. ? [18:52] isaacs[working]: bmizerany: a bc addon would be pretty badass [18:52] bmizerany: isaacs[working]: I already started a basic one, but wanted to be sure I'm not re-inventing the wheel before going further [18:52] isaacs[working]: bmizerany: but yeah, the standard math library is the Math object. [18:52] isaacs[working]: bmizerany: i've also seen programs that extend Math with stddev, etc. [18:53] mscdex: i think someone started a math module for node? [18:53] bmizerany: isaacs[working]: yeah. but it only operates on numbers, not collections of numbers [18:53] mscdex: ACTION looks [18:53] isaacs[working]: bmizerany: Math.sum/max/min take a variable list of numbers, i believe [18:53] bmizerany: isaacs[working]: I didn't see sum/max/min.. hrm [18:53] isaacs[working]: js> Math.min(2, 3, 4, 0, 5) [18:53] gbot2: isaacs[working]: 0 [18:53] isaacs[working]: js> Math.max(2, 3, 4, 0, 5) [18:53] gbot2: isaacs[working]: 5 [18:54] isaacs[working]: js> Math.sum(2, 3, 4, 0, 5) [18:54] gbot2: isaacs[working]: Error: TypeError: Math.sum is not a function [18:54] isaacs[working]: js> Object.getOwnPropertyNames(Math) [18:54] gbot2: isaacs[working]: Error: TypeError: Object.getOwnPropertyNames is not a function [18:54] bmizerany: on shit. it does exist. nice. I didn't see that in Ecma262 [18:54] isaacs[working]: ok, so gbot2 doesn't know about getOwnPropertyNAmes [18:54] peburrows has left the channel [18:54] isaacs[working]: bmizerany: but run that in the node repl, and you'll see what it has [18:55] isaacs[working]: bmizerany: you should be able to add what you need to the Math object without too much trouble. [18:55] isaacs[working]: it's not arbitrary precision like bc, though [18:55] bmizerany: V8 version 2.2.8 [18:55] bmizerany: > Math.min(1,2,3) [18:55] bmizerany: 1 [18:55] bmizerany: > [18:55] bmizerany: boom [18:55] bmizerany: isaacs[working]: I'm dealing with ints like my boy Damato tell me too :) http://twitter.com/joedamato/status/17380600156 [18:57] creationix: isaacs[working]: I should finish my article about closure, object construction, and modules so I can link Tom to it [18:59] malkomal_ has joined the channel [19:01] jashkenas: bmizerany: if you want to use 'em on lists, just apply: Math.min.apply(Math, array) [19:02] TheEnd2012 has joined the channel [19:03] bmizerany: noe sum [19:06] bmizerany: *no sum [19:12] gf3 has joined the channel [19:12] khug has joined the channel [19:13] mjr_: mscdex: are you parsing the html or api.markdown? Presumably it would be easier to parse api.markdown. [19:13] mscdex: i started with the html, but i'm using the markdown now [19:16] malkomalko has joined the channel [19:17] ryah: mscdex: using markdown-js? [19:19] devhost`` has joined the channel [19:19] mscdex: ryah: no, parsing it manually. i looked earlier for a markdown reader, but only found modules to go from markdown->html. it's almost finished anyway [19:19] mscdex: the parsing part anyway [19:20] mjr_: isaacs[working]: npm seems to install things in ~/.node_libraries for me, even under sudo [19:20] bradleymeck: ya? [19:22] khug has joined the channel [19:23] creationix: http://howtonode.org/why-use-closure [19:23] creationix: new article, hopefully there aren't too many typos [19:24] ryah: you seem to be missing some indefinite articles in front of 'closure' [19:24] ryah: s/indefinite// [19:25] creationix: indefinite? [19:25] ryah: also: use console.log() instead of sys.puts [19:25] ryah: i guess that isn't released yet though [19:25] creationix: ryah: I would, but it doesn't work in node v0.1.99 [19:25] creationix: of course, technically I'm overidding it in my sandbox [19:26] ryah: ok [19:26] steez: ..is there a sync exec ? [19:27] ryah: so uncaughtException broke in ab068db9b12a9fb8619f6a94299a8d7a35d4695b [19:27] khug1 has joined the channel [19:27] ryah: steez: no [19:27] bradleymeck: not to my knowledge, use one of the callback libs like 'step'? [19:27] mjr_: which version is that commit in? [19:27] _announcer: Twitter: "Writing a mortgage calculation web service for work. Trying to choose between using Ruby, Node.js or Erlang." -- Jon Gretar. http://twitter.com/JonGretar/status/17436447038 [19:28] zomgbie has joined the channel [19:28] ryah: mjr_: 94 [19:28] bradleymeck: woah woah woah, someone is using erlang for a web service, why have i not seen this before? [19:28] ryah: mjr_: 94 works, 95 broke [19:28] creationix: ryah: so you're saying I should say "a closure" instead of "closure" when referring to the idea? [19:28] mjr_: oh man, .95 was forever ago [19:28] mindeavor has joined the channel [19:28] ryah: creationix: yes [19:28] jashkenas: creationix: please don't encourage folks to create their JS instances in the "Object factories using closures" style... [19:28] creationix: jashkenas: why not? [19:29] jashkenas: Because it's slow and it eats memory like a pig. [19:29] ryah: mjr_: yeah - it's really bad [19:29] blowery: pigs love memory. especially heritage memory pigs. [19:29] ryah: mjr_: i'm adding that example as a test [19:29] jashkenas: You have 10,000 closures of the identical function, and you only need one. [19:29] maushu has joined the channel [19:29] peburrows has joined the channel [19:29] jashkenas: creationix: I'll benchmark it for you... [19:30] creationix: jashkenas: maybe I should put a note saying it's not good for when there are large numbers of instances [19:30] jashkenas: sure -- that would help. [19:30] rauchg_ has joined the channel [19:31] ryan_gahl: creationix: good general explanation of what a closure is/does, but yes, bad pattern for obect creation vs. prototypes/shared methods [19:31] creationix: jashkenas: "One word of caution though. While this method is quite easy to use, it doesn't perform well when you're creating large numbers of instances. Each instance will create it's own version of every function in the object." [19:31] creationix: how's that? [19:31] jashkenas: that's great. [19:32] creationix: the point of the article is to teach some uses of closure, not to promote one style over another [19:32] mde|ZzZ: creationix: "its own" -- no apostrophe. :) [19:32] creationix: mde: thanks [19:32] ryan_gahl: good to put the disclaimer then, because the way i read it sounded like you _were_ promoting this style over prototypes [19:33] creationix: ryan_gahl: I personally prefer the style, but this article isn't the place for that debate [19:33] creationix: I think the simplicity of the code it worth the performance tradeoff, but people need to be at least aware of the tradeoff [19:33] creationix: and some people like the other method better regardless of performance [19:34] ryan_gahl: the perf tradeoff is massive though [19:34] phiggins has joined the channel [19:34] ryan_gahl: with any sizeable app [19:34] ryan_gahl: any significant #s of instances [19:35] jashkenas: creationix: here's a benchmark, for a very tiny class with two methods. [19:35] jashkenas: creationix: the benchmarked function simply creates a single instance, and calls a single method. [19:35] jashkenas: http://tinyurl.com/2csgzez [19:35] ryan_gahl: massive [19:36] mjr_: jashkenas: can you share the code? [19:36] jashkenas: that was webkit ... here's firefox: http://tinyurl.com/29wd2ms [19:36] Kiba has joined the channel [19:36] Kiba: hello [19:36] jashkenas: and the memory leaking is a far worse problem than the speed -- especially if you have a lot of stuff in scope at the time. [19:36] jashkenas: mjr_ sure can: [19:37] Kiba: my server is sending unneccesary messages [19:37] Kiba: hmm [19:37] jashkenas: mjr_: here's the test: http://gist.github.com/459112 [19:37] Kiba: but it takes a while for the client to get back to server and say it got the replies [19:38] Kiba: by then, it sent more additional messages for stuff that it receive from the server but didn't get the reply for yet [19:39] Kiba: and the server will react to that by deleting stuff in the queue [19:39] Kiba: which is defintely not what I want. [19:39] creationix: jashkenas: yes, but if you're doing primarily event programming, you end up creating local closures for all those methods to be able to use them as callbacks [19:40] creationix: otherwise the methods can't be used for callbacks [19:40] mjr_: jashkenas: wow, that's really interesting. I had no idea the costs would be so high for that. [19:40] benburkert has joined the channel [19:40] creationix: yeah, I knew it was that expensive [19:40] Kiba: so... [19:41] mjr_: Kiba: can you post some code that simply demonstrates this? I don't understand what you are trying to do. [19:41] creationix: jashkenas: is the cost overhead of this pattern not well known? [19:41] jashkenas: creationix: sure, use closures when you need to. But if you build all of your classes out of this pattern, you'll regret it down the line. [19:41] Kiba: sure cna [19:41] jashkenas: creationix: your howtonode blog is a great resource for folks that are new to JS and Node. [19:41] mjr_: creationix: I certainly didn't know it was so costly. I use that pattern all the time, because I find it so much more readable. [19:42] jashkenas: mjr_: let's do a test with the chrome memory profiler too... [19:42] ryan_gahl: it's not the closures themselves that are expensive, it's returning new objects (containing new functions) each call [19:42] creationix: I use it all the time too, and I've never had performance issues in a real app [19:42] jashkenas: ryan_gahl: right. new functions mean new closures. function creation in JS ain't cheap, compared to other things. [19:42] creationix: i am careful about not embedding any functions inside the closure that doesn't need any variables from the closure [19:43] creationix: and the pattern is great for singleton objects! [19:43] jashkenas: creationix: hey ... it's a much better pattern than some. [19:44] Kiba: http://gist.github.com/459120 [19:44] jashkenas: creationix: Prototype.js calls toString() on every method you define in a class, and passes a regex over it, looking for "$super" as an argument. [19:44] Kiba: http://gist.github.com/459121 [19:44] creationix: jashkenas: that's insane [19:44] Kiba: the second pastie send the actual messages created by the first pastie [19:45] Kiba: http://gist.github.com/459122 [19:45] jashkenas: creationix: http://github.com/sstephenson/prototype/blob/master/src/lang/function.js#L38 [19:45] Kiba: the third pastie is how the client deal with gameplay messages [19:45] jakehow has joined the channel [19:45] creationix: jashkenas: thanks for bugging me about the disclaimer though, people do need to know it's quite expensive in some cases [19:45] Kiba: I probably wrote the code the wrong way. [19:46] mjr_: Kiba: hmm, that's a lot of code to try and understand while I'm sitting on this conference call. [19:46] Kiba: in the second pastie, the setInterval stuff contain the function where it send the game message [19:47] Kiba: No problem. It helps when I explain my problem to someone else. It may simply resolve itself [19:47] Kiba: by me simply explainig [19:48] mjr_: I'd throw a ton of print statements everywhere until the problem jumps out. [19:48] Kiba: I know what the problem is. I am just trying to think of a solution. [19:48] ryan_gahl: jashkenas: that's only being run at define-time though, not really a big deal [19:48] Kiba: I did as you said, mjr_ [19:49] ryan_gahl: as in, not for each instance [19:49] jashkenas: ryan_gahl: yes, that's true. [19:49] bradleymeck: who was it w/ the ephemeron table stuff? cant find a revised API for it, the one in the ES Harmony Wiki is horror [19:51] bradleymeck: do closures really create instances still? i would think you can just bind it to a persistant scope? [19:54] bradleymeck: ironically i think what i posted on the news groups could be a pattern to reduce closure abuse (but really need to change it to not use pre/post hooking w/ a closure...), may be wrong about that though, would have to go over it a in a bit finer detail... [19:54] jashkenas: creationix: mjr_: just ran a memory test in Chrome/V8. Using that tiny class with two one-line functions .... [19:55] jashkenas: Creating a million instances takes 32.4 megabytes in the prototypal style, and it takes 78.2 megs in the closure style. [19:55] creationix: jashkenas: It must be optimizing something [19:55] creationix: I would expect the factory version to be a lot worse [19:55] creationix: or there is just a high fixed cost overhead [19:55] mjr_: That's not nearly as bit of a factor compared to the CPU cost. [19:56] jashkenas: I'll add more methods instead of just two, and see how that affects it. [19:56] jashkenas: say, 20. [19:56] jacoblyles has joined the channel [19:57] jacoblyles: hello, I am trying to make a post request using node and I cannot figure out how to set the post variables. I am trying to make a function that replaces a web form. [19:57] mjr_: jashkenas: Surely the size of the outer function's scope factors into this, right? There's nothing in createObject's scope. [19:57] blowery: if you can make close to a million instances a second with the slow method, i think you're chasing the wrong goose :) [19:58] creationix: blowery: yeah, but the memory usage is the main thing [19:58] jashkenas: mjr_: yep, it certainly should. [19:58] blowery: ya [19:58] sechrist has joined the channel [19:58] jacoblyles: could someone point me in the right direction on how to set POST variables in a request? [19:58] blowery: that's much more worrisome [19:58] jashkenas: let's put something large into lexical scope. [19:58] creationix: jacoblyles: are you using a framework [19:58] jashkenas: new Array(10000), say. [19:58] creationix: ? [19:59] jacoblyles: creationix: nope. [19:59] jacoblyles: creationix: just node.js. Want to test a web API I wrote by making POST and GET requests from the command line [19:59] creationix: jacoblyles: you have to encode your data and send it as the request body [19:59] creationix: and set the "Content-Type" header [20:00] creationix: and for GET, encode your data and append it to the url [20:00] creationix: jacoblyles: querystring.stringify will do the encoding [20:00] jashkenas: ha, with 20 functions and the array in scope, prototypal is identical ... 32 MBs, and fast (for a million objects). closure-style crashes the chrome tab with a sad face. [20:01] creationix: jashkenas: now we're talking [20:01] felixge has joined the channel [20:01] felixge has joined the channel [20:01] femto has joined the channel [20:02] jashkenas: by the way, the 32 megabytes is a fixed cost.... I'll have the full numbers in a sec. [20:02] sh1mmer has joined the channel [20:02] sh1mmer: ugh. vpn fail. [20:02] sh1mmer: Does anyone know if there is a way to get //.test() to operate on the whole string rather than just finding if any match exists? [20:02] bradleymeck: im still rather interested in the need to have a full new function to have scope retained rather than it just being a field on a function [20:03] jacoblyles: creationix: Thanks, that looks like a good start [20:03] creationix: jacoblyles: basically GET and POST from PHP land is an abstraction that node doesn't do for you [20:04] creationix: which I consider a good thing, I like to send my posts as JSON instead of form encoded [20:05] bradleymeck: however a good note is that things on .prototype are easily overriden :/ [20:06] bradleymeck: and you lose private variables [20:06] _announcer: Twitter: "is wishing he could work on #nodejs apps all day every day." -- aaron heckmann. http://twitter.com/aaronheckmann/status/17438452269 [20:06] jacoblyles: creationix: So there is no standard encoding for a POST body? [20:07] jashkenas: Here's the test's source: http://gist.github.com/459145 [20:07] creationix: jacoblyles: browser forms use two different encodings [20:07] sh1mmer: jacoblyles: the most common one is x-form-encoding [20:07] creationix: depending if there are file attachments or now [20:07] creationix: *not [20:07] sh1mmer: well that as well [20:07] sh1mmer: jacoblyles: typically POST is just key/pair url-encoded strings [20:07] creationix: jacoblyles: yeah, and the built-in querystring library in node fdoes x-form-encoding [20:08] creationix: or it's real easy to by hand too using escape and join [20:08] sechrist has joined the channel [20:09] jashkenas: creationix: mjr_: here's the results: http://gist.github.com/459152 [20:09] tilgovi has joined the channel [20:09] jashkenas: 32 megs versus 368 megs. [20:10] creationix: jashkenas: so what is this large object in scope? [20:10] creationix: outside the factory? [20:10] jashkenas: it's in the test gist above. [20:10] jashkenas: yep. [20:10] creationix: ok [20:10] creationix: wow, that sucks [20:10] jashkenas: I don't know if that makes a difference. I'll try taking it out. -- then we'll know how much is the closure versus the function body. [20:11] creationix: I remember in ruby land avoiding closures because of stuff in the outer scopes made it really bad [20:11] rictic has joined the channel [20:11] creationix: I thought js was smarter abou tit [20:13] creationix: hopefully it's not the inScope object [20:13] jashkenas: we'll find out in a sec ... it's crunching on the heap. [20:14] jashkenas: creationix: it's not the inScope object. the closure style still uses 368.1 MB. [20:14] jashkenas: I don't know if that's better or worse ;) [20:14] ryan_gahl: creationix: best of both worlds? http://gist.github.com/459158 [20:16] bradleymeck: yub ryan, testing out 'interface' to see how its performing now... [20:16] creationix: ryan_gahl: not quite [20:17] ryan_gahl: but i guess in my example, no need to bother with a factory :) [20:17] pkrumins: ryan_gahl: are you ry? [20:17] bradleymeck: nope [20:17] ryan_gahl: no, i'm rye [20:17] pkrumins: ah, alright. [20:17] tmpvar has joined the channel [20:18] creationix: ryan_gahl: though, I think wrapping constructors in a factory is good from an external perspective [20:18] pkrumins: has anyone written any C++ modules? I am getting some weird behavior with raising an exception from my C++ code. I do ThrowException(Exception::Error(String::New(msg))); and it won't throw this exception UNLESS I return from the function right after throwing the exception, which doesn't make much sense. [20:18] creationix: then you can switch between versions without changing API [20:19] creationix: jashkenas: that's more what I expected, so better from a sanity point of view [20:19] tmpvar: jashkenas, do you have a second to chat about some of your documentcloud work? [20:20] pquerna: pkrumins: hmm [20:20] pquerna: return ThrowException(Exception::Error( [20:20] pquerna: String::New("First argument needs to be a buffer"))); [20:20] pkrumins: yeah. [20:20] pkrumins: oh [20:20] pkrumins: return!!! [20:20] pkrumins: all my code is broken :) [20:20] pquerna: pkrumins: is the style i use everywhere... ThrowException doesn't do any magic [20:20] caolanm: anyone know how I can set my username and password in npm on a new machine? [20:21] pkrumins: all my 5 modules. [20:21] pquerna: its just a nother v8::Value [20:21] pkrumins: i thought it threw an exception just like regular C++ code. [20:21] pkrumins: didn't know it was just a v8::Value [20:21] pquerna: the only one that does jump out IIRC is FatalException [20:21] mscdex: now i need to plug in the irc parts [20:21] mscdex: :-D [20:22] charlesjolley- has joined the channel [20:22] isaacs[working]: caolanm: it's a little bit of a pita. [20:22] mscdex: what's the irc module du jour? [20:22] bradleymeck: gogo mscdex [20:22] bradleymeck: i use node-irc, can always bug the heck outta mape about it [20:22] isaacs[working]: caolanm: npm config set username ; npm config set email ; npm config set auth $(echo -n username:password | base64) [20:22] mscdex: heh [20:22] isaacs[working]: caolanm: assuming you know your username and pw, and have base64 installed [20:23] admc has joined the channel [20:23] admc_ has joined the channel [20:23] mape: bradleymeck: ? [20:24] mscdex: so i should be using mape's fork? :o [20:24] mscdex: heh [20:24] mape: nah use Ned_s [20:24] mape: Mine was just a small fix [20:25] isaacs[working]: mscdex: npm install irc [20:25] bradleymeck: need that npm module to be updated... [20:25] mscdex: which one is ned? [20:25] mscdex: :S [20:25] mscdex: martynsmith? [20:25] isaacs[working]: mscdex: yes [20:25] mscdex: oh [20:25] isaacs[working]: goes by Ned_ in irc [20:25] mape: The irc one isn't the latest isn't on npm I believe [20:25] pkrumins: pquerna: it's pretty troublesome, I had factored my code out in separate classes so that it did not depend on any V8 constructs (except the ThrowException) [20:25] isaacs[working]: ACTION wishes everyone would use their real name. refers to Marak as "Jim" all the time... [20:26] pkrumins: pquerna: like my functions also return int, void, char *, etc, not just v8::Handle<...> [20:26] mape: Or at least have the same name om irc/twitter/github [20:26] jkyle has joined the channel [20:26] pkrumins: pquerna: now i don't know how to throw those exceptions from the code that doesn't return V8::Handle [20:26] pkrumins: pquerna: any ideas about that? [20:26] caolanm: isaacs[working]: thanks, that seems to work [20:26] pkrumins: pquerna: gonna try to find your github and browse your code to see how do you it [20:26] pquerna: pkrumins: hmm. well, I've only written one node module -- and I wrote it yesterday [20:27] pkrumins: oh alright. [20:27] isaacs[working]: caolanm: i should fix that soon. [20:27] pkrumins: i been writing them for 2 months now. [20:27] pquerna: phiggins: but, to do that [20:27] pkrumins: but hadn't caught this trickery [20:27] pquerna: phiggins: i just stick an rvalue and error string in my baton structure [20:27] pkrumins: actually i picked all the code writing by looking how others wrote code [20:27] jxson has joined the channel [20:27] pquerna: and then once i'm back in the JS thread [20:27] phiggins: totally [20:27] pkrumins: i have literally 0 understanding about v8 [20:27] pquerna: i return it [20:27] pkrumins: since it's so undocumented. [20:27] mscdex: btw i noticed that github's http redirection for tarball downloads is now almost instant [20:28] mscdex: maybe node.js magic? [20:28] mscdex: :-) [20:28] pquerna: pkrumins: http://github.com/pquerna/node-archive/blob/master/src/archive_bindings.cc#L277 [20:28] pkrumins: pquerna: looking [20:28] Validatorian: Anyone hear from Aria lately? [20:28] sechrist_ has joined the channel [20:28] pkrumins: pquerna: wowsies, interesting. what is TryCatch a few lines below, a v8 construct of some kind? [20:29] pkrumins: pquerna: also what does `argv[0] = Exception::Error(String::New(baton->errstr.c_str()));` do? [20:29] pkrumins: somehow also raises an exception? [20:29] pkrumins: by assignment [20:29] pkrumins: something pretty magical [20:29] pquerna: well, argv[0] is an array of values [20:29] pkrumins: right, i have used it [20:29] pquerna: i'm passing in it to a callback [20:29] pquerna: because in an async defered thread call [20:29] pquerna: you can't return to the original context right [20:30] pkrumins: ah [20:30] jkyle_ has joined the channel [20:30] pkrumins: your code is pretty advanced, given that you only wrote it yesterday [20:30] jkyle_ has joined the channel [20:31] blowery: code grows up so fast [20:31] paul____ has joined the channel [20:31] steez: gonna have to buy it college pretty soon [20:31] bradleymeck: my 401k will be gone if i have to pay for my repo's college [20:32] charlesjolley- has joined the channel [20:34] creationix: If code was like kids I'd be the guy with 18 kids all on welfare [20:36] Aria has joined the channel [20:36] isaacs[working]: creationix: or if you had 16 more kids... [20:36] creationix: isaacs[working]: I do plan on having a few more, but NOT on welfare [20:36] isaacs[working]: creationix: ;) [20:37] nofxx: creationix: feel the same, and btw, one can tell by your gh account heh, I was browsing it all day ;) [20:38] creationix: :) [20:42] JimBastard__: tmpvar: you feel like haxing tonight? [20:46] kersny has joined the channel [20:49] sudoer has joined the channel [20:51] markwubben has joined the channel [20:52] Aikar has joined the channel [20:53] hellp has joined the channel [20:56] jkyle_ has joined the channel [20:56] nofxx has joined the channel [20:56] tmpvar: JimBastard__, possibly [20:57] softdrink: tmpvar: more opengl hacking, less irc! ;) [20:58] gerad has left the channel [21:07] bradleymeck: haha [21:09] sechrist has joined the channel [21:09] tmpvar: softdrink: feel free to help [21:09] tmpvar: :P [21:10] softdrink: wish i could :T [21:11] _announcer: Twitter: "playing around with ideas for a http response API: http://github.com/caolan/quip #nodejs" -- Caolan. http://twitter.com/caolan/status/17441853842 [21:13] davidsklar has joined the channel [21:13] saikat has joined the channel [21:18] Sembiance: Anyone here have experience with node-redis? :) [21:19] mAritz: node-redis-client? yep, a little [21:20] bmizerany: so I added a new .js file for node/lib/ but it's not getting picked up in tests [21:20] bmizerany: any ideas? [21:20] saikat has joined the channel [21:21] mAritz: Sembiance: any problems? [21:22] Sembiance: mArtiz: well, I guess not. I was going to ask if I should have multiple redis clients, like a pool. Then I remembered that my javascript is single threaded, so that doesn't seem necessary. [21:22] Sembiance: Although it is async too... [21:23] bradleymeck: bmizerany exactly how did you add it / require it [21:23] Sembiance: If I do client.get() and that takes a while fopr the callback to be called, if I do client.get() again I wonder how redis-client handles that [21:24] bmizerany: bradleymeck: It's in /mycode/node/lib/amath.js .. I have a bench in /mycode/node/benchmark/run.js which has a `var amath = require('amath')` [21:24] bmizerany: and is run like [21:24] mAritz: since it's async, it's not a problem [21:24] bmizerany: cd /mycode/node; ./node benchmark/run.js [21:25] bradleymeck: and you rebuilt node? [21:25] mAritz: Sembiance: it'll call the callbacks in the order they are answered by the redis server [21:26] ryah: okay this fucking ReThrow error is very annoying [21:26] ryah: need to make a test case for v8 [21:26] markwubben_ has joined the channel [21:28] maushu has joined the channel [21:29] sechrist_ has joined the channel [21:29] bradleymeck: hate prototype chains [21:32] MattJ: Love prototype chains [21:33] mAritz: don't even know prototype chains [21:33] mAritz: (you're talking about the prototype lib right? :D [21:33] mAritz: ) [21:33] bradleymeck: nope [21:33] MattJ: Well it's true Javascript doesn't have the best implementation of them [21:34] Dmitry has joined the channel [21:34] bradleymeck: thats my problem [21:34] bradleymeck: i cant add something to it w/o havoc if the object was already created [21:34] MattJ: But look at it this way - it could be worse, you could be coding in C++ [21:34] aubergine has joined the channel [21:34] bradleymeck: true [21:35] bradleymeck: namespace based stuff *shudder* [21:35] MattJ: bradleymeck: have you seen http://javascript.crockford.com/prototypal.html ? [21:35] MattJ: It helped me in a sticky situation I'd painted myself into (assuming Javascript would make it easy) [21:37] tmpvar has joined the channel [21:38] bradleymeck: i need something a bit diff. Given var a = {}; function Foo(); function Bar(); Foo.prototype.me = 'Foo';Bar.prototype.me='Bar'; I want the following to be true a instanceof Foo && a instanceof Bar && a.me = 'Bar' (from prototype non-copy) [21:40] bradleymeck: i can get all of those except that cant figure out right way to change a.me to 'Bar' (can only get a after Bar is applied and the Foo constructor...) [21:41] tilgovi has joined the channel [21:42] bradleymeck: in other words, how to get a={}.__proto__ and function b(){}.prototype to be added to an object c... (might just be rambling now) [21:42] kodisha has joined the channel [21:43] teemow has joined the channel [21:46] _announcer: Twitter: "Created a new node.js module in C++ for recording Theora/Ogg videos called "node-video" http://bit.ly/c811ZH . #node #nodejs #node.js" -- Peteris Krumins. http://twitter.com/pkrumins/status/17443724612 [21:46] pkrumins: tehe. [21:47] mtodd has joined the channel [21:47] bradleymeck: ooo [21:47] MattJ: pkrumins: Was about to poke you and say you might find that useful :P [21:47] pkrumins: MattJ, I am using it for recording screencasts of VM :) [21:47] MattJ: :) [21:47] pkrumins: making good progress with my startup, MattJ! [21:47] MattJ: Excellent :) [21:48] rictic has joined the channel [21:48] pkrumins: in a few months we'll demo [21:48] pkrumins: meanwhile i'll announce it on my popular website with a screencast [21:48] pkrumins: to get people interested [21:48] pkrumins: in a week or two [21:50] malkomalko has joined the channel [21:51] Tim_Smart has joined the channel [21:52] _announcer: Twitter: "Any node.js wizards out there that can tell me if something is possible or not?" -- David King. http://twitter.com/ketralnis/status/17444022353 [21:52] _frankie has joined the channel [21:52] mAritz: something is possible [21:52] mAritz: there [21:53] bradleymeck: !tweet @ketralnis come into irc.freenode.net#node.js for help [21:53] aglemann has joined the channel [21:53] phiggins has joined the channel [21:53] bradleymeck: failwhale twitter is failwhale [21:54] Tim_Smart: Brendan Eich thinks "Node is cool" [21:54] bradleymeck: !tweet @ketralnis come into irc.freenode.net#node.js for help [21:55] creationix: isaacs[working]: I like that article [21:56] isaacs[working]: creationix: inorite? [21:56] creationix: http://radar.oreilly.com/2010/06/clue-is-a-renewable-resource.html [21:56] _announcer: Twitter: "Node.js, an introduction: http://soderlind.no/994" -- PerS. http://twitter.com/soderlind/status/17444254822 [21:56] isaacs[working]: pretty much every employer i've ever had has really not gotten that right. [21:57] hober: indeed [21:57] creationix: Sencha tries pretty hard [21:57] bradleymeck: article? [21:58] javajunky has joined the channel [21:58] creationix: the only problem I have with my current job is a constant fear that it's too good to be true [21:58] malkomalko: when's the new ext designer coming out? :) [21:58] malkomalko: I was told last week ... [21:58] siculars has joined the channel [21:58] creationix: malkomalko: not sure, I'm on a different team [21:59] MattJ: "The longer you ignore the human inside your coder, the less happy they'll be." [22:00] creationix: I think the article explains why tech jobs have such a high turnover and open source projects like node are so popular [22:00] ryah: d [22:01] brainproxy has joined the channel [22:01] jlilly has joined the channel [22:01] _announcer: Twitter: "@jncoward @cjkihlbom @keavy And managing Node.js libraries using the Kiwi package manager." -- Peter Hellberg. http://twitter.com/peterhellberg/status/17444526419 [22:01] sh1mmer has joined the channel [22:02] creationix: fs.write always comes back eventially, right? error or otherwise [22:02] ryah: yes [22:02] ryan_gahl has joined the channel [22:04] bjartek: Tim_Smart: yes :) [22:04] bjartek: Tim_Smart: this is a really async conversation, send me a callback when you respond :P [22:04] creationix: ryah: thanks, just trying to debug where it my code the callback chain gets broken [22:05] bradleymeck: there has got to be a way to add something to the prototype chain of an object after instanciation using .__proto__ [22:05] creationix: ACTION hates it when the browser just spins till a timeout, seems to happen quite easily with node apps [22:05] Tim_Smart: bjartek: 'data' event: Ah right. Yeah Java and ECMAScript need some space. [22:05] ryah: creationix: because people don't end() the response? [22:06] creationix: ryah: yeah, but end doesn't get called because something in the code that was waiting on a callback never get's fired [22:06] creationix: if anything in the chain of events doesn't call the next step, it never makes it to end [22:07] jakehow has joined the channel [22:07] bjartek: Tim_Smart: hehe :D [22:07] jashkenas has joined the channel [22:08] jlilly has joined the channel [22:08] _frankie has joined the channel [22:08] tilgovi has joined the channel [22:08] robrighter has joined the channel [22:08] stepheneb has joined the channel [22:08] dahankzter has joined the channel [22:08] kloeri has joined the channel [22:08] ivan has joined the channel [22:08] DRMacIver has joined the channel [22:08] bjartek: Tim_Smart: it is late here in Norway so I have to hit the sack, we can talk about it some other time perhaps [22:09] Dmitry: Instead of using __proto__ I would recommend to use Object.getPrototypeOf() [22:09] Tim_Smart: Haha it was more a witty comment than anything. [22:09] bjartek: Tim_Smart: ok :) [22:09] bradleymeck: have to set the prototype and __proto__ is the way to go for that [22:09] creationix: WOHOO, found the bug [22:10] dmshann0n has joined the channel [22:10] dahankzter has joined the channel [22:10] mostlygeek_ has joined the channel [22:10] creationix: some day when I really learn how to write evented code, I'm going to look back at this crap and wonder how I ever survived [22:10] Tim_Smart: ryah: I brought up binary data on the ecmascript discuss mailing list. Seems like they are working to get something in the spec [22:11] ryah: Tim_Smart: we're discussing it on the webgl list too [22:11] Tim_Smart: Brilliant. [22:11] bmizerany: ryah: http://github.com/bmizerany/node/compare/better-benches [22:11] bmizerany: thoughts? [22:11] Tim_Smart: ryah: Brendan Eich was like "Node is cool" [22:12] bmizerany: I went on that yak shaving because I wanted to bench Buffer.proto.write then, now, and what I'm trying [22:13] bmizerany: I'm not sure how to fix this http://github.com/bmizerany/node/compare/better-benches#L8R4 [22:13] bmizerany: I guess I could inline that in run.js if we don't want it to become part of nodes libs [22:14] ryah: bmizerany: great [22:14] ryah: bmizerany: that's an area that really needs help [22:15] ryah: i'd like to get some good repeatable microbenchmarks in there [22:15] bmizerany: ryah: it's a start. I could get better. [22:15] ryah: what's there currently is just noise [22:15] Tim_Smart: I like benches. I might help out there. [22:15] ryah: we need output that is machine parsable [22:15] bmizerany: ryah: how do you feel about amath.js? (name is not something I proud of) [22:16] bmizerany: ryah: any format you prefer? CSV? [22:16] ryah: (for integration into http://buildbot.nodejs.org:8010/perf/dashboard/overview.html) [22:16] bmizerany: ryah: heh. I was going to offer Heroku sponsorship of running CI benches [22:17] bmizerany: we can fire up a ton of Ec2 instances with diff OS's and run benches once a day or so. dunno. [22:17] ryah: bmizerany: i'd rather stick with I/O stuff [22:17] ryah: re amath.js [22:17] bmizerany: ryah: ah. ok. cool. [22:17] ryah: V8 benchs the shit out of their code [22:18] admc_ has joined the channel [22:18] admc has joined the channel [22:18] ryah: would really like a script that ran ab with "hello world" http server [22:18] ryah: and maybe did it in a loop and took the average [22:18] ryah: (because ab results are really noisy) [22:18] bmizerany: ryah: yeah. as I pasted that compare link, I realized v8 already has benches. I'm haven't looked to see what they use to gen reports. [22:19] ryah: also - use semicolons [22:19] ryah: will be inforcing jslint soon [22:19] ryah: enforcing? [22:19] bmizerany: ryah: ah is false most of the time. we can look into http://www.xenoclast.org/autobench/ [22:20] bmizerany: ryah: ah. reeeeeaaallllly? [22:20] bmizerany: gah [22:20] mikeal: jslint is a little too agressive [22:20] creationix: ryah: with 2-space indents? [22:20] ryah: 2 space indents, yes [22:20] mikeal: ryah: have you looked at http://aurochs.fr/jsure.html [22:20] Tim_Smart: jslint ftw. [22:21] bmizerany: ryah: is there an option on jslint to ignore the ;'s? :) [22:21] ryah: mikeal: nope? [22:21] bmizerany: *ignore the missing [22:21] mikeal: it's a little less annoying [22:21] ryah: Jsure is written in Ocaml. You need Ocaml 3.10 or later. [22:21] ryah: -_- [22:21] ryah: yeah right. [22:21] ryah: no, we'll use jslint [22:21] mikeal: and does more inspection, like it'll find variables you're using that arent' define [22:21] bmizerany: oh well. I'm not _that_ anti-;. I just think it's pretty ugly. [22:22] ryah: JS is ugly. [22:22] mikeal: word [22:22] mikeal: jslint hates comma first tho :( [22:22] bmizerany: ryah: not if you learn to leave things out, like `with` and `;'. [22:22] mde: I still need to hack it to ignore comma-first. [22:22] bmizerany: mikeal: ok. I'll trade ending ';' for no ','-first. :) [22:23] Tim_Smart: comma first - I'm not a fan. [22:23] cloudhead: `;` balances out the `{}` [22:23] mjr_: What's the downside to using jslint? [22:23] mde: It doesn't like throwaway constructors either. [22:23] ryah: JS is the old dirty bastard of programming languages. We should revel in it. [22:23] mde: ryah: +1 [22:23] mikeal: hahaha [22:23] mikeal: js aint nuttin ta fuck wit [22:23] Dmitry: Oh, common. JS is beautiful. [22:24] mjr_: If only I knew more about music so I could drop an awesome reference. [22:24] mde: mikeal: http://github.com/mde/mdedotfiles/blob/master/fulljslint.js [22:24] mde: Easy enough to hack it to ignore stuff like repeated "var i" declarations, etc. [22:25] mikeal: yeah, could we include the version of jslint we're using for node in node so that we can patch the things that aren't actually issues [22:25] maushu: JS is not that ugly. [22:25] mikeal: yeah, sometimes those are necessary [22:26] maushu: JSLint makes you cry. [22:26] mscdex: java makes me cry [22:26] mjr_: mikeal: what things would you disable in jslint? [22:26] mikeal: and it's easier to patch it then write a wiki page that says "You must pass jslint except for these 10 warnings in these special cases" [22:26] mde: It's a nice tool, but it's a little too B&D about some stuff. :) [22:26] mscdex: geddddddyyyyyyyyyy [22:26] maushu: mjr_, 95% of everything. [22:26] mjr_: being in skype meetings for 5 hours today makes me cry, but luckily I hit the mute button. [22:26] maushu: If you want to finish something, that is. [22:26] mde: mscdex: Dude, our great computers fill the hallowed halls. [22:26] mikeal: mjr_: not much, but not trip on comma-first and not care about multiple var x; declarations [22:27] mscdex: wasshu talkin' 'bout willis? [22:27] ryan_gahl: yeehaaa semicolons and fuck comma-first :) [22:27] mikeal: because in some cases they are necesary [22:27] mikeal: i think we should require semicolons [22:27] mscdex: nothing wrong with having a clean semicolon [22:27] mjr_: I think the strict whitespace is a feature. As long as it is always the same everywhere. [22:27] mscdex: huhu [22:27] ryan_gahl: pretty damn easy to put the ring finger down at end of line on that ; key [22:27] mde: I'm okay with comma-first -- anything that makes it harder to fuck up is a good thing in my book. [22:27] mikeal: because it's easier to just require semicolons than have a mix of people using them and not using them [22:28] mikeal: how strict is the whitespace? [22:28] mde: mikeal: That's exactly my argument. [22:28] mscdex: and for the record, i dislike comma first except when displaying json [22:28] creationix: the only way that tjholowaychuk and I were ever able to work on the same code base was to force jslint upon us [22:28] mikeal: like does it not like me lining up my operators? [22:28] mjr_: My favorite bit about jslint is not that it is my preferred coding style, but rather that it is at least an easily enforceable one. [22:28] mscdex: or sys.inspect [22:28] bradleymeck: time to go bother and upset ##javascript [22:28] indiefan_ has joined the channel [22:28] creationix: it might not be ideal, but it works and we can move on and make things like Connect [22:28] bmizerany: ok. I'm sorry for that commit. I didn't intend to start a channel flood of comma, semi-colon, syntax debating. I'm glad *something* will be enforced, and those that are anit-it, don't have to follow it in their own libs. :) [22:29] mikeal: mjr_: also, jslint doesn't like some newer javascript features [22:29] mjr_: mikeal: you can use textmate to line up your equals signs. [22:29] mde: creationix: That's a very good point. Nice to have on arbitrary third-party validator. [22:29] freshtonic has joined the channel [22:29] mikeal: textmate should display my file exactly, not try to make it prettier and save something else, that's crazy [22:29] mjr_: oh, but I'll bet whitespace in expressions it doesn't like. [22:29] bmizerany: ryah: I'll add the semicolons back; np. What output would work best with your buildbot setup? [22:29] mjr_: jslint doens't care about lining up equals signs. [22:29] mikeal: cool [22:29] isaacs[working]: oh my goodness, are we still on this? [22:30] isaacs[working]: (or, "on this again", i guess) [22:30] bmizerany: isaacs[working]: apparently. :{ [22:30] mjr_: isaacs[working]: npm installs things into ~/.node_libraries for me even under sudo. [22:30] pquerna: so, does anyone have any exerperience with modern bit torrent client libraries? [22:30] mjr_: isaacs[working]: is that expected? [22:30] mikeal: i'm +1 on having a jslint that ships in node core and is used before you send a patch [22:30] isaacs[working]: mjr_: yeah, so, once your "root" config is set, it sticks with that. [22:30] isaacs[working]: mjr_: so that you don't "lose" stuff [22:31] mikeal: but i do think we'll want to patch some stuff, i guarantee ryah that there is some stuff that it will complain about that you won't want to fix :) [22:31] skampler: can npm run without root privilegies? [22:31] creationix: mikeal: +10, and ryah can specify which options to enable [22:31] isaacs[working]: mjr_: but if you install npm initially with sudo, it'll use the global space. i dunno. i don't love that config stuff. [22:31] mikeal: right [22:31] bmizerany: isaacs[working]: ryah will enforce semi-colons with jslint in the node codebase. that's it. end of story. I'm cool with it. that is the summary of the last 3 pages of scroll. [22:31] mde: mikeal: Have a look at my hacked one, it fixes several of those annoyances. [22:31] isaacs[working]: skampler: yes. i use it in usermode. [22:31] mikeal: we can have this argument forever [22:31] mjr_: mikeal: I like including the official version of jslint also. That's the whole win with having a tool like this is that everybody uses the same one. [22:31] mikeal: but at the end of the day ryah will enforce it, and he can put his policy in the jslint that is in node core [22:31] isaacs[working]: bmizerany: i am a strong proponent of project owners enforcing the rules they like. [22:31] mikeal: instead of perpetuating arguments like this one :_) [22:31] bmizerany: isaacs[working]: same here. [22:31] isaacs[working]: that's what a bdfl is FOR [22:31] mikeal: mjr_: start with the official one and tweak it [22:32] mde: isaacs[working]: +1, well said. [22:32] mjr_: mikeal: yeah, I like that. As long as there's one official way to validate it. [22:32] mikeal: i think everyone i know that uses jslint keeps a fork of it :) [22:32] mde: Heheh [22:32] mikeal: we just need to standardize on ryah's fork [22:32] isaacs[working]: ACTION keeps his fork of jslint in his brain... [22:32] ryan_gahl: lol [22:33] mjr_: isaacs[working]: so if I do "sudo make install" the very first time, that'll change the config to use /usr/local? [22:33] isaacs[working]: mjr_: yeah [22:33] isaacs[working]: mjr_: like i said, i'm not in love with that solution [22:33] bradleymeck: style guidelines for me are more like... suggestions... [22:33] Dmitry: jslint has a hell of options you can tweak. No need to fork it. [22:33] isaacs[working]: Dmitry: it has no options for comma-first [22:33] solidsnack has joined the channel [22:33] isaacs[working]: Dmitry: or no-semicolons-except-when-relevant [22:33] pvh has joined the channel [22:33] mjr_: isaacs[working]: yeah, that's kind of a bummer. Because if you install it for yourself, and then later do "sudo npm install pcap", it'll put the pcap libs in your private dir, but the bins in /usr/local, and then nobody else can run them. [22:33] mde: Dmitry: No, chokes on some stuff that's valid syntax. [22:34] isaacs[working]: mjr_: i'd totally love a better solution, just haven't sat down and had a long hard think on the subject. [22:34] mjr_: isaacs[working]: at least there's a workaround. [22:34] isaacs[working]: mjr_: if you can spec out something that works well, i'd totally do it. [22:34] bmizerany: ryah: just add this to the docs about coding standards. :) http://skitch.com/bmizerany/dkui2/jslint-the-javascript-code-quality-tool [22:35] Dmitry: Ok, ok. None I know uses comma-first or no-semicolon thing [22:35] isaacs[working]: mjr_: i might even just say that npm *always* uses {prefix}/lib/node [22:35] mjr_: isaacs[working]: I'd like to use npm to deploy and update tools on a lot of machines. [22:35] isaacs[working]: mjr_: and unless you configure it otherwise, you always install libs for everyone [22:35] Dmitry: I eventually change my style to pass jslint. And now I see: it was bad style. [22:35] isaacs[working]: Dmitry: i did the opposite, with the same revelation. [22:35] mostlygeek_ has joined the channel [22:36] isaacs[working]: Dmitry: i once had a style that passed jslint, and changed to violate it. and now I see: it was bad style. [22:36] mjr_: isaacs[working]: I like that default personally. It's what I'd expect a package manager to do. [22:36] x_or has joined the channel [22:36] isaacs[working]: mjr_: yeah. i just need to comb through the cases [22:36] Dmitry: :D [22:36] mjr_: What valid JS syntax does jslint not tolerate? [22:37] mjr_: getters / setters? [22:37] mde: mjr_: anonymous constructors. [22:37] mde: var foo = new function () {}(); [22:37] _announcer: Twitter: "might have just found a pretty nasty #nodejs bug... give me a sec!" -- TJ Holowaychuk. http://twitter.com/tjholowaychuk/status/17446484972 [22:37] rictic has joined the channel [22:37] Dmitry: I think that having a tool that will point to mistake is better than having custom style which kind of preventing you from this mistake. [22:37] Dmitry: Custom style is dangerous thing in large teams of developers [22:38] isaacs[working]: Dmitry: depends on the custom style :) [22:38] mjr_: mde: does it pass if you do: var foo = new function f() {}();? [22:38] bradleymeck: mde, dont use new on a lowercase function and then execute it [22:38] mAritz: that tweet was really important! xD [22:38] mjr_: er, yeah, I meant to capitalize the F. [22:38] isaacs[working]: mjr_: it also complains about not having semicolons, or about putting commas at the front of lines. [22:38] mde: mjr_: I haven't tried that; I don't know. [22:39] mde: bradleymeck: Yes, that's what JSLlint thinks, but it's valid syntax. [22:39] bradleymeck: its invoking twice, its a silent error on some engines [22:39] mde: Self-executing functions are totally normal, and there's no reason not to use it as a constructor. [22:39] isaacs[working]: mde: +1 [22:40] Dmitry: mde: it is confusing syntax [22:40] bradleymeck: var foo = (function f(){})() [22:40] mde: Dmitry: function literals are everywhere in JS. [22:40] Dmitry: some brackets will make it easier to read [22:40] Dmitry: mde: Thank you, I am aware of JS features :) [22:40] mde: bradleymeck: Yeah, I see a lot of that in JQuery-land. [22:41] bradleymeck: because of the evil new function(){} errors that can hide as silent errors (/shudder) [22:42] mde: Dmitry: you seemed to think using a literal as a constructor is confusing, so I wasn't sure how much you know. [22:42] mjr_: jslint was written by the man who wrote JavaScript: the Good Parts, whose thesis is that you shouldn't use all of the features of JavaScript. [22:42] dgathright has joined the channel [22:43] mde: mjr_: Sure, you can just take JSLint at its word, you'll end up with good JavaScript, for the most port. [22:43] mde: But you could also make the argument for just using "JSLint: The Good Parts." :) [22:43] Tim_Smart: As long as the exceptions are well justified, I'm cool with it [22:43] creationix: who wrote the Url library for node [22:43] creationix: I have a question about it [22:44] bradleymeck: you talking about the multiple parsing errors? [22:45] mape: Ok so if anyone is using OSX and for some reason websockets aren't working in any browser.. It is most likely because you are using a proxy for http traffic that doesn't support websockets (that took days to figure out) [22:45] Dmitry: Using a literal as a constructor is not confusing pre se, but you can use it in confusing way. [22:45] creationix: bradleymeck: was that question for me? [22:45] dgathright_ has joined the channel [22:45] bradleymeck: yub creationix [22:45] creationix: it's inconsistent [22:46] mde: Dmitry: I can agree with you on that. [22:46] _announcer: Twitter: "I first transplant from an AHK. Writing used to go do it. After that WSH, node.js transplantation from bench" [ja] -- 天沢(痛風). http://twitter.com/amasawa/status/17446964746 [22:46] bradleymeck: slightly yes [22:47] mjr_: mape: that sucks that it took so long to figure out. [22:47] mjr_: debugging network stuff is really tricky, partly because the tools we have are so bad. [22:47] isaacs[working]: mjr_: i actualy agree that not using all the features of js is a good idea. [22:47] creationix: bradleymeck: why is pathname undefined for "", but "/" for "/" [22:47] _announcer: Twitter: "@digininja I wonder if using something like nodejs would be a smart choice to implement a bruteforcer in?" -- Chris Oliver. http://twitter.com/excid3/status/17447063883 [22:48] mape: mjr_: had me going crazy since it worked on my laptop, and there were no errors logged [22:48] creationix: shouldn't there always be a pathname? [22:48] bradleymeck: does museum need a pathname *checks* [22:48] Dmitry: re: style I was told recently that it is confusing to write something like this a && a.run(); [22:48] isaacs[working]: creationix: dirname("") should be "." [22:48] isaacs[working]: Dmitry: i like that style a lot, personally. [22:48] creationix: so maybe Url.parse("") should be "/" ? [22:49] isaacs[working]: creationix: oh, for url.parse [22:49] isaacs[working]: creationix: hm. i dunno. i think that's undefined because "" isn't a valid url. [22:49] isaacs[working]: creationix: it's a valid RELATIVE url [22:49] mjr_: creationix: I think it's not valid to send an empty URL, right? [22:49] Dmitry: isaacs[working]: me too, but now I am not using it in production. [22:49] mjr_: wow, colloquy did some crazy escaping there [22:49] bmizerany: hrm. jslint doesn't like `require()` because it's "global". I wonder how to get around that. [22:49] ryah: mjr_: blinking for me [22:50] mjr_: doesn't even show up for me. [22:50] ryah:  <-- beep? [22:50] bmizerany: as with `process` [22:50] mde: Dmitry: Right, JSLint hates that too. [22:50] ryah: control characters - yes! [22:50] jashkenas: bmizerany: you gotta tune your jslint settings ... the textmate js bundle settings are pretty good for starters. [22:50] isaacs[working]: bmizerany: you can tell JSLint about globals [22:50] Dmitry: mde: no, jslint ok with that [22:50] mjr_: bmizerany: put this at the beginnign of your file: /* global require */ [22:51] mde: Hm, maybe a different version. I had to make changes to fulljslint.js to shut it up about that. [22:51] mjr_: bmizerany: this is what I put at the beginning of all of my JS programs: http://github.com/mranney/node_pcap/blob/master/pcap.js#L2 [22:51] bmizerany: isaacs[working]: didn't work. [22:51] Dmitry: mde: You can tune it to complain about it. [22:51] bmizerany: mde: I'm using http://github.com/hallettj/jslint.vim [22:51] _announcer: Twitter: "@digininja nodejs performance is great, and everything being asynchronous might prove pretty beneficial. might be worth a shot." -- Chris Oliver. http://twitter.com/excid3/status/17447280933 [22:52] isaacs[working]: ACTION doens't use jslint, or agree with its opinions. [22:52] mde: Dmitry: Ah, I should look closer at the setting before hacking it. :) [22:52] khug has joined the channel [22:52] creationix: isaacs[working]: now we see the true reason you left Yahoo ;) [22:52] jashkenas: bmizerany for the record, here it is: http://gist.github.com/459324 [22:52] isaacs[working]: creationix: haha [22:53] mde: bmizerany: I've been doing it this way: http://fleegix.org/articles/2008-09-06-jslint-in-vim-through-lynx [22:53] rtl has joined the channel [22:53] bmizerany: jashkenas: that's JavaScriptLint. ryah said he wanted to use jslint [22:54] jashkenas: ah. didn't realize they were different. [22:55] bmizerany: hrm. the /* global ... */ thing isn't working. :/ [22:55] bradleymeck: ACTION wants multiple inheritence [22:56] jashkenas: here's a post comparing the two: http://blog.outofhanwell.com/2006/06/05/jslint-considered-harmful/ [22:56] technowe_ has joined the channel [22:58] bmizerany: oh! it's `/*global` not `/* global` [22:58] liucougar_ has joined the channel [22:58] isaacs[working]: you know, the thing about this is that the value of a linter is relative to the experience level of contributors, the number of contributors, and the inherent bugginess of the style chosen. [22:58] _announcer: Twitter: "I'm rocking node.js @ HotPotato HQ. It's nestastic! http://htp.to/aL2NdF" -- Linc. http://twitter.com/11nc/status/17447651776 [22:58] sechrist has joined the channel [22:59] isaacs[working]: with npm, i've chosen a style that is very easy to visually scan, where common errors "pop" easily, and the contributor set is effectively one person who mostly knows what the hell he's doing. [22:59] mjr_: bmizerany: oh yeah, I forgot about that significant whitespace thing. Sorry. [22:59] bmizerany: heh. np [22:59] Dmitry: isaacs[working]: I have the same strategy with my project [22:59] isaacs[working]: with NodeJS, that's not as true. the style chosen is based on common-ness rather than visual scannability, there are a lot of contributors, and I know that ryah wants to have a low barrier to contribution. [23:00] Dmitry: But node is not “one man project” [23:00] isaacs[working]: npm isn't either, really. [23:00] isaacs[working]: but it is also not a C project. [23:00] mscdex: nodelint! [23:00] Dmitry: isaacs[working]: “the contributor set is effectively one person” [23:01] isaacs[working]: Dmitry: i mean, it's not *intentionally* a one man project. [23:01] unomi has joined the channel [23:01] isaacs[working]: Dmitry: but external contributions are pretty limited, and the style i've chosen is very easy to enforce. [23:01] Dmitry: The same about my project: I don’t want to block other people, I just don’t care much. :) [23:01] isaacs[working]: even without a linter. [23:01] robrighter_ has joined the channel [23:04] derRichard has joined the channel [23:05] isaacs[working]: Dmitry: what's your project? [23:05] derRichard: who wants to have elliptics support in node? vote: http://www.ioremap.net/node/433 [23:05] Dmitry: isaacs[working]: It is not node related: http://github.com/DmitryBaranovskiy/raphael [23:06] isaacs[working]: oh, hey, you're the raphael guy? [23:07] mjr_: Oh cool. Raphael is really neat. [23:07] creationix: :) yes, we like Dmitry [23:08] technoweenie has joined the channel [23:08] Dmitry: Gee, I shouldn’t reveal my project… [23:08] mjr_: How is the iPhone SVG performance with raphael? [23:11] Dmitry: mjr_: Hey, this is node channel! :) As good as iPhone performance in general. I am thinking of creating separate Raphaël version for iPhone, without VML rubbish. [23:13] creationix: mjr_: I used it for my connect demo and it worked pretty well on the ipad [23:13] tmpvar has joined the channel [23:15] saikat has joined the channel [23:16] sh1mmer has joined the channel [23:17] jakehow has joined the channel [23:18] _announcer: Twitter: "released clutch v0.1.0 @ http://github.com/clement/clutch -- yet another URL router for #nodejs" -- Clément Nodet. http://twitter.com/clementnodet/status/17448803071 [23:20] mjr_: that guy has node in his name [23:20] bmizerany: isaacs[working], Tim_Smart, mde: http://github.com/bmizerany/node/commit/9bfda6597374470b1517f4febfbf8bd3d9074289 - suggestions? -- (this is not intended to start more debating, all) [23:20] isaacs[working]: bmizerany: add "module" to that list [23:20] bmizerany: isaacs[working]: the global list? [23:20] isaacs[working]: bmizerany: yeah [23:20] isaacs[working]: bmizerany: "module" is a free var [23:21] isaacs[working]: bmizerany: and __dirname [23:21] bmizerany: isaacs[working]: ah. I'm not using it here. I guess it doesn't matter. [23:21] bmizerany: adding [23:21] Tim_Smart: Are we using jslint, or javascriptlint? [23:21] Tim_Smart: javascriptlint looks better for node [23:21] isaacs[working]: bmizerany: http://github.com/bmizerany/node/blob/master/lib/module.js#L375 [23:22] mjr_: I 'm pretty sure ryah wants to jslint. [23:22] bmizerany: added [23:22] Tim_Smart: javascriptlint is practically jslint with more config options. [23:23] _announcer: Twitter: "maybe not so much of a bug, in #nodejs dont use require('./index') use require('.') if need, the former will shit on your code" -- TJ Holowaychuk. http://twitter.com/tjholowaychuk/status/17449048564 [23:23] bmizerany: ryah: any thoughts on that output format? [23:23] bmizerany: ryah: for the benchmarks? [23:23] [[zz]] has joined the channel [23:24] jashkenas: Tim_Smart ++. I much prefer JavaScriptLint as well. [23:25] rtl has joined the channel [23:33] saikat: so i learned earlier today that if i do var utils = require("./utils"), it doesn't work. but i renamed my utils.js file to helpers.js and did var helpers = require("./helpers") and things worked fine. is this expected behavior? I notice there is a utils library in node core [23:34] saikat: (i also didn't get this error if i did it in the node repl, only in my server.js file) [23:34] saikat: and by doesn't work i mean utils would just be an empty object [23:35] creationix: saikat: sounds like a bug to me [23:35] saikat: i haven't pulled in a few weeks though, maybe i should try that first [23:35] saikat: ok i'll make a reproducible case and file it then [23:35] saikat: i wasn't sure if i was just missing some fundamental concept somewhere [23:37] creationix: I wonder what tjholowaychuk used for this benchmark http://dl.dropbox.com/u/6396913/connect-0.0.1.static.png [23:37] creationix: it shows connect faster than node [23:37] Tim_Smart: lolwut, connect is on top of node... [23:37] mape: creationix: connect using the buffer cache and node didn't perhaps? [23:38] creationix: probably [23:38] creationix: makes for an interesting benchmark though [23:38] creationix: better to compare to nginx [23:39] _announcer: Twitter: "Mastery is not propesh: Storage wrote exchange of data on C + + for Node.js. But here I am C + + does not know:) And so - works." [ru] -- Egor Egorov. http://twitter.com/egorFiNE/status/17449982132 [23:44] isaacs[working]: creationix: how is connect faster than node? [23:44] creationix: isaacs[working]: I think his node code was just ineffecient [23:45] creationix: connect has some pretty nice buffer caches built in [23:45] mape: isaacs[working]: using buffers as cache for the responce [23:45] creationix: and a pure hello world node app wouldn't have [23:45] isaacs[working]: creationix: yeah [23:45] isaacs[working]: creationix: i mean, the fact that connect does some clever things that make it faster than the very very basic hello world node app, that's pretty rad. [23:45] creationix: agreed [23:45] isaacs[working]: creationix: but it makes it seem like connect is somehow not a node app [23:46] creationix: yeah, he should label them as "hello world on node" and "connect on node" [23:46] isaacs[working]: i mean, you *should* in theory alwyas be able to write a node app that is faster than connect, if at the expense of not supporting middleware or other fanciness [23:48] _announcer: Twitter: "Does Arch Linux not have a node.js package? #sadface" -- Steve Losh. http://twitter.com/stevelosh/status/17450516311 [23:49] bmizeran_ has joined the channel [23:50] pvh_ has joined the channel [23:50] liucougar_ has joined the channel [23:51] Dmitry: creationix: should connect findings be contributed back to node itself? Like buffer caching, etc [23:51] creationix: Dmitry: no, node is lower level, node had that stuff, it's just not put together [23:52] creationix: node's http api is super simple, all caching has to be done manually [23:52] jakehow has joined the channel [23:53] Dmitry: creationix: righto