[10:06] frigg: VERSION [10:06] nodelog has joined the channel [10:06] chapel: is the new podcast up micheil? [10:06] micheil: not yet [10:06] chapel: :( [10:06] micheil: I'm still to do the mix down on it. [10:07] chapel: ah [10:07] chapel: that can be annoying (I do it for my podcast) [10:07] micheil: I had some problems the other day sync'ing the two channels, and I've been busy since the weekend so haven't gotten a chance to do it. [10:08] siebertm: micheil: thanks for your help. [10:08] micheil: siebertm: no worries :) [10:09] siebertm: anything i could do to improve sll/tls without knowing too much c++ when i have a boring weekend? [10:10] micheil: probably not. ask pquerna if he's about. [10:10] micheil: I think a large bulk of work was done in the last few days [10:10] micheil: now it's a matter of migrating things across and making sure it all works [10:11] micheil: it's also a matter of making sure 0.3.X is becoming stable. [10:13] Utkarsh has joined the channel [10:18] micheil: siebertm: probably the best thing to do is make sure you can upgrade your application to 0.3.X [10:21] Tim_Smart: pquerna: Ah nice. Server is start to take better form. [10:21] micheil: Tim_Smart: there's been changes? [10:21] siebertm: so in 0.3 it'll work? [10:22] micheil: siebertm: that's when we're working towards [10:23] micheil: and the work on SSL is currently happening in the 0.3.X (master) branch [10:23] siebertm: great [10:23] bentomas: hey, can anyone give me advice on the best way to write to stderr? [10:23] micheil: which, iirc, is slated for release coming into the new year. [10:24] DoNaLd` has joined the channel [10:24] DozyPieman has joined the channel [10:26] freeall has joined the channel [10:26] micheil: siebertm: I would recommend upgrading your application to 0.3.0, there are some breaking changes, but that's where 0.3.X is at. [10:27] micheil: we're removing a lot of old things that have been deprecated, cleaning up API's, and fixing a lot of bugs, and making things faster. [10:27] dtrasbo has joined the channel [10:28] siebertm: does 0.3.0 contain some of the new ssl stuff yet? dont think i got everything you said :) [10:30] StanAngeloff has joined the channel [10:30] micheil: siebertm: okay, well, 0.3.0 doesn't have the ssl work that's just been done. [10:30] micheil: it was released on the 23 or 24th [10:31] siebertm: ok, just wanted to make sure :) didnt sleep well tonight [10:32] micheil: so, in the 0.3.0 release, there's a bunch of API's that have changed [10:32] micheil: like the sys module being renamed to util [10:32] micheil: so while it doesn't have the new ssl work, it does have the new api's that you will need to migrate to. [10:32] siebertm: yeah, i guess every lib i use will break on that [10:33] micheil: that's why I'm saying, if you're wanting to quickly upgrade to 0.3.X when ssl works, then you should start trying your application out on 0.3.0, see what breaks, make the neccessary changes, and push them upstream [10:34] siebertm: yessir! [10:34] micheil: like, to support both 0.3.0 and 0.2.4, you can do something like: [10:34] zemanel has joined the channel [10:34] micheil: try { var util = require("util"); } catch (e) { var util = require("sys") } [10:34] micheil: which should work [10:35] micheil: although, you may want to check what error is being thrown [10:35] siebertm: sure [10:35] micheil: although, the main thing you will notice using 0.3.0 is that you'll get one warning about sys being deprecated, but things shouldn't break there [10:35] micheil: sys will be likely to be fully removed in 0.4.0 iirc. [10:36] micheil: ryah_: care to confirm if you're about? [10:36] siebertm: ah, its just deprecated? didnt see that from the release notes. [10:36] micheil: actually, it's 3am PDT, not likely for a confirmation. [10:37] micheil: http://github.com/pquerna/node/blob/http-streams/ChangeLog#L51 [10:37] micheil: (I'm the person you'll find in the git blame for the changes.) [10:38] siebertm: not neccessary to confirm that, i think i can figure that out by myself pretty easily: try it and see if it explodes or not! [10:38] aubergine has joined the channel [10:38] jansc has joined the channel [10:38] jansc has left the channel [10:38] bentomas has left the channel [10:41] rubyphunk_ has joined the channel [10:44] Utkarsh has joined the channel [10:44] micheil: ffffuuu. We have missing logs :( [10:44] stride: hm? [10:44] Tim_Smart: Poor pquerna http://github.com/Tim-Smart/node/commit/a7d961751de7f6a048d5c028daf554b24dfade75 [10:45] MikhX has joined the channel [10:45] mbrochh has joined the channel [10:45] micheil: anyone have plaintext logs for the last 24hours? [10:45] Tim_Smart: Hopefully he doesn't mind ^^ [10:45] Tim_Smart: Yeah [10:45] Tim_Smart: Well maybe not 24 [10:46] micheil: well, really the last 6hours? [10:46] micheil: colloquy has crappy logging. [10:46] Tim_Smart: Oh, wait, I put my laptop to sleep. So no. [10:46] micheil: hmm.. [10:47] Tim_Smart: Let me look.. [10:47] chapel: umm maybe not [10:47] micheil: I only have an xml log which is 20,000 lines long from the 26-10-10 to now [10:47] chapel: I think Im only logging one network, and not this one [10:47] stride: I have the irssi logfile but it's not ordered by date, you'd have to cut it out micheil [10:48] micheil: that's probably massive. [10:48] siebertm_ has joined the channel [10:48] stride: 29mb, 400k lines [10:48] Tim_Smart: Haha. [10:48] micheil: stride: I'm looking for something within the last 6 hours where I said something about a second appendix [10:48] micheil: for documentation [10:49] stride: micheil: wait a sec, I'll try to get today out of there [10:49] micheil: many thanks [10:49] micheil: actually [10:49] micheil: never mind, I've remembered what it was for. [10:49] micheil: deprecations. [10:50] micheil: how's this look for the ToC for the new documentation? http://gist.github.com/648752 [10:50] stride: ok :) [10:50] Tim_Smart: Hmm I'm tempted to start a node.js ncurse IRC client. [10:50] micheil: Tim_Smart: do it in gtk, :P [10:50] Tim_Smart: *ncurses [10:50] Tim_Smart: No thanks. [10:50] micheil: haha [10:51] Tim_Smart: Not for IRC. [10:51] micheil: ACTION was just having a dig. [10:51] Tim_Smart: :p [10:51] Tim_Smart: Plus, I need to sort out how I'm going to introspect glib signals. [10:52] Tim_Smart: I think I might have to somehow mess with GDKEvent and friends. [10:53] micheil: Tim_Smart: hey, could you do a quick review of that new ToC? [10:54] micheil: http://gist.github.com/648752 [10:54] Tim_Smart: Looks fine, but I'm not sure on the naming. [10:55] micheil: any changes? [10:55] chapel: hmm actually [10:55] Tim_Smart: Or if it is complete. [10:55] micheil: I'm looking for suggestions. [10:55] micheil: I think it covers everything. [10:55] micheil: (that doesn't include sub toc's for each section, just the main sections) [10:56] micheil: chapel: ? [10:56] Tim_Smart: OK. Maybe have 3 or 4 sections. Sypnopsis, API, Appendix. [10:56] chapel: bah, I should have logs for this channel [10:56] Tim_Smart: You get the idea. [10:56] chapel: but its not showing [10:56] micheil: Tim_Smart: well, the reason why it's like that, is because the api is being split: [10:57] micheil: http://d.pr/DHxV [10:57] aubergine has joined the channel [10:57] micheil: it will now be multiple pages (even when in html) [10:58] murphy has joined the channel [10:58] ctp has joined the channel [10:59] micheil: so, that order there isn't exactly solid, I'm just wanting to make sure I'm covering everything [11:01] fermion has joined the channel [11:01] skohorn has joined the channel [11:02] fbits has joined the channel [11:02] micheil: Tim_Smart: does that make sense as to why it's so long? [11:02] hzin has joined the channel [11:03] alexb_ has joined the channel [11:03] mbrochh has joined the channel [11:04] apage43 has left the channel [11:05] micheil: Tim_Smart: I'm basing it off the style of: http://www.gnu.org/software/libc/manual/html_node/ [11:05] micheil: (which I think has to be some of the best multi-page documentation out there.) [11:05] path[l] has joined the channel [11:10] Tim_Smart: Sounds good. [11:10] micheil: k [11:10] hzin_ has joined the channel [11:11] eee_c has joined the channel [11:13] MikhX has joined the channel [11:14] zorzar has joined the channel [11:16] zomgbie has joined the channel [11:17] micheil: Tim_Smart: is it right to call Securepair Secure Streams? [11:18] Tim_Smart: Ah, what have you called 'stream'? [11:19] Tim_Smart: Because SecurePair is a bunch of streams glued together. [11:19] micheil: Stream is on the interfaces of a stream, and stream.Stream#pipe [11:19] tpryme has joined the channel [11:20] Tim_Smart: I think putting it under crypto would be best. [11:20] micheil: hmm.. [11:20] Tim_Smart: crypto.createPair is the API after all. [11:20] micheil: is it? [11:20] Tim_Smart: Ya. [11:21] micheil: I see securepair.createPair [11:21] micheil: ah, yeah, it's in both places. [11:22] tpryme: Is there any way possible to return a function from a constructor and have the function's prototype chain start with constructor.prototype? [11:22] tpryme: e.g., function A () { return function () {}; } [11:23] tpryme: A.prototype.do = function () { [11:23] tpryme: } [11:23] Tim_Smart: tpryme: Example usage? [11:23] Tim_Smart: Not sure what you are trying to achieve. [11:23] tpryme: (new A()).do() [11:23] micheil: Tim_Smart: something like this? http://gist.github.com/648752 [11:23] tpryme: There's a good use case for it [11:24] micheil: tpryme: give it then. [11:24] tpryme: Ok ... [11:24] Tim_Smart: tpryme: Why not just: var A = function () {}; A.prototype.do = function () {...}; new A().do();? [11:25] tpryme: Tim_Smart: Because I also want to be able to call (new A())(param1, param2) [11:25] tpryme: It's to make an api syntactic sugarish [11:25] Tim_Smart: tpryme: Then: var A = function (arg, arg2) { ... }; A.prototype.do = function () {...}; new A().do();? [11:26] V1 has joined the channel [11:26] tpryme: Let me think how best to explain the use case [11:26] micheil: function A() { return new B; }; function B(){}; B.prototype.do = function(){}; [11:26] Tim_Smart: var a = new A(1, 2) [11:26] Max-Might has joined the channel [11:26] micheil: but really, this is kinda meta. [11:27] tpryme: so like I have a user object [11:27] itissid has joined the channel [11:27] tpryme: and if I have an association that must be retrieved from the db [11:27] tpryme: like [11:27] tpryme: user.friends [11:27] itissid: node.js Latex to SVG convertor http://itissid.com/ [11:27] tpryme: friends is like a promise/array hybrid object [11:27] DoNaLd`: people .. i try to find a solution as it is possible to detect in nodejs if couchdb database runs or is stopped .. has anyone any ideas how to resolve it simply ? [11:27] tpryme: so that I can do things like [11:28] tpryme: user.friends.forEach(...) [11:28] tpryme: But I'd like to do a syntax too for pagination where [11:28] itissid: Works Just on chrome [11:28] micheil: tpryme: perhaps make use of callbacks? [11:28] tpryme: user.friends(page, offset).forEach [11:28] micheil: user.getFriends(function(friends){ friends.forEach()}); [11:29] tpryme: The benefit of using Promises vs direct callbacks [11:29] tpryme: is that I can do [11:29] micheil: ACTION hates promises... [11:29] tpryme: user.friends.forEach(...).map(...).all(...) [11:29] micheil: but the dojo ones are kinda good. [11:29] itissid: Just goes to show how incomplete all browsers are when compared to chrome... [11:29] micheil: (not that I use them, but I did contribute a little to them ) [11:29] tpryme: It makes it easier to work with from a purely syntactical pov [11:31] tpryme: micheil: Tim_Smart: So I guess this is not possible? [11:31] tpryme: :P [11:31] micheil: tpryme: not without a lot of work [11:31] Tim_Smart: tpryme: I'm a advocate of the callback approach, but I still quite like chaining http://github.com/biggie/biggie-orm/blob/master/lib/model.js#L289-292 [11:31] micheil: and it'd probably end up being confusing [11:31] Tim_Smart: And http://github.com/biggie/biggie-orm/blob/master/lib/finder.js [11:31] tpryme: Ok, user.friends.page().forEach() it is [11:32] Tim_Smart: Basically you just have a method that returns a instance of your Query / Promise prototype. [11:32] Tim_Smart: E.g. find() [11:33] tpryme: I did it a bit differently, so it works similarly to prumkins' node-lazy [11:33] Tim_Smart: so: function A () {}; A.prototype.find = function () { return new Promise(this); }; function Promise (model) { ... }; Promise.prototype.forEach... [11:33] tpryme: Right, already implemented that [11:34] bentruyman has joined the channel [11:34] tpryme: Tim_Smart: Was hoping I could return a function. Would look nicer syntactically [11:34] Tim_Smart: Then what are you after now? [11:35] micheil: okay.. so I've got my documentation split. Now to write a tool to compile and build it. [11:35] tpryme: user.friends(page, offset).forEach(...).map(...).all(...) [11:35] Tim_Smart: tpryme: So the resulting syntax would be? [11:35] tpryme: and [11:35] tpryme: user.friends.forEach(...).map(...).all(...) [11:35] tpryme: being able to call either of those [11:35] tpryme: I want that flexibility [11:35] tpryme: (1) user.friends(page, offset).forEach(...).map(...).all(...) [11:35] Tim_Smart: tpryme: Just make sure your methods return 'this', so they can chain. [11:36] tpryme: (2) user.friends.forEach(...).map(...).all(...) [11:36] tpryme: Yeah, I already have a version working [11:36] tpryme: like 2 [11:36] tpryme: like (2) [11:36] tpryme: But I also want to modify it now so it supports both (2) and (1) [11:36] Tim_Smart: Right. Why not friends().forEach(...) [11:37] micheil: user.get("friends").limit(count, offset).forEach().map().all() ? [11:37] tpryme: All in the name of syntax. lol, sorry [11:37] micheil: (that's what I'd do for an ORM in JavaScript.. :D) [11:38] aliem has joined the channel [11:38] micheil: reason? It's very abstract, and means that I can make things however. [11:38] Tim_Smart: tpryme: Right. Well you can make friends a function, and just attach properties to it. [11:38] tpryme: Tim_Smart: Because you can get away without the parens [11:38] SvenDowideit has joined the channel [11:38] tpryme: The trip to the db is made when you call a function on friends [11:39] tpryme: so any time forEach or map is called on friends for the first time [11:39] micheil: tpryme: in which case calling user.friends() returns a new promise [11:39] tpryme: I'm trying to make it as lazy as possible [11:39] hzin has joined the channel [11:39] micheil: when you do anything with that, it automatically runs the promise, waits for the data then continues [11:39] Tim_Smart: tpryme: Ya. Well for my ORM I did this for associations. user.getFriends() user.findFriends()... [11:39] tpryme: micheil: Right but I'm trying to avoid parens [11:39] micheil: why? parens are awesome. [11:40] micheil: (although, I can't get into (fab)) [11:40] Tim_Smart: So: user.findFriends(query).all().limit() etc. [11:40] SubStack: lisper! [11:40] micheil: SubStack: nevar! [11:40] tpryme: lol [11:40] micheil: ACTION is a javascript developer from the get-go. [11:41] micheil: I learnt javascript, then found a few other languages hard because they weren't like javascript. [11:41] tpryme: K, I just opted for the 3rd option [11:41] tpryme: (3) user.friends.page(page, offset).forEach(...).map(...).all(...) [11:42] Tim_Smart: I start with PHP, then python, some C on the way and Javascript. [11:42] tpryme: SubStack: How's your framework on top of dnode going? [11:43] Tim_Smart: tpryme: It is possible, and not too hard, but slow compared to working with prototypes. [11:43] micheil: hmm.. before writing this documentation compiler, I should probably fill out these university documents.. and stuff [11:43] gf3 has joined the channel [11:43] tpryme: Tim_Smart: What in particular? [11:43] SubStack: tpryme: still thinking about it [11:44] SubStack: lately I've been building dmesh for managing groups of processes based on roles [11:44] Tim_Smart: tpryme: Actually, it should be too bad. [11:44] Tim_Smart: *shouldn't [11:44] tpryme: Tim_Smart: What in particular were you referring to? [11:44] tahu has joined the channel [11:45] Tim_Smart: Well I'm usually always concerned about GC and object creation speed. [11:45] tpryme: Ah gotcha [11:45] tpryme: ok [11:46] tpryme: Tim_Smart: How are you profiling GC btw? [11:46] micheil: tpryme: tim is our super optimiser guy.. I'm sure. [11:46] Lorentz has joined the channel [11:47] SubStack: ACTION usually sacrifices performance for the sake of nicer interfaces [11:55] margle has joined the channel [11:56] kawaz_air has joined the channel [11:56] Tim_Smart has joined the channel [11:57] Tim_Smar1 has joined the channel [11:58] Tim_Smar1 has left the channel [11:58] Br|ce has joined the channel [12:00] Tim_Smart has joined the channel [12:01] kawaz_air has joined the channel [12:03] dtrasbo: I'm starting to like javascript [12:03] dtrasbo: it's scarry [12:04] dtrasbo: scary, even [12:05] bentruyman has joined the channel [12:05] dquestions has joined the channel [12:06] Tim_Smart: tpryme: https://gist.github.com/8554c4b75d8b0f9338d7 [12:07] tpryme: Tim_Smart: Nice, but what's the penalty for using closures for e.g., assocForEach, as opposed to leveraging prototype [12:08] tpryme: Tim_Smart: But yeah, that will work [12:08] tpryme: Tim_Smart: thanks [12:09] Tim_Smart: That should be pretty good, as it only generates the property once. [12:10] Tim_Smart: It seems a little hacky, there might be a better way of doing it. [12:10] Tim_Smart: But meh. [12:11] rubyphunk_ has joined the channel [12:11] c4milo has joined the channel [12:11] Tim_Smart: Remember to store everything on this._model inside the assoc*() functions, otherwise you won't be able to do per-instance querying. [12:12] TomsB has joined the channel [12:14] tpryme: Tim_Smart: In case you're interested in seeing what I was doing with all this -- http://github.com/bnoguchi/mongoose/tree/indexingSupport [12:14] tpryme: Tim_Smart: micheil: Thanks for the advice. Gonna take a nap. l8r. [12:14] Tim_Smart: Oh you are the guy that made redis-node right, tpryme? [12:14] tpryme: Tim_Smart: yep [12:15] Tim_Smart: tpryme: You might find this interesting: https://gist.github.com/b76fb590a7642e8fd387 [12:15] stagas has joined the channel [12:15] dnolen has joined the channel [12:16] tpryme: Tim_Smart: Hmmm. Seems I have some work to do then to speed things up. Thanks. [12:16] stagas: has anyone been messing with keep-alive requests? [12:16] Tim_Smart: tpryme: Haha well, feel free to steal ideas from my client. [12:16] tpryme: Tim_Smart: Which is yours? [12:17] Tim_Smart: "node-redis" [12:17] Tim_Smart: Not to be confused with node_redis [12:17] Tim_Smart: :p [12:17] stagas: have you noticed early responses from the server? like node sends the body in two chunks confusing the server to respond to a partial content [12:17] tpryme: Ah, I see [12:17] stagas: on massive requests [12:17] tpryme: Tim_Smart: Will take a look. An order of magnitude greater is pretty impressive. [12:18] tpryme: Tim_Smart: What's the key strategy? [12:19] Tim_Smart: tpryme: Write aggregation, and a fast parser. [12:19] Tim_Smart: tpryme: Also my client is completely binary safe, I think I ran into some problems with saving images with yours. [12:19] tpryme: Tim_Smart: You mean pipelining? [12:19] Tim_Smart: Well I called it pipelining in the commit log, but write aggregation is the correct term. [12:20] Tim_Smart: tpryme: Well hit me up if you ever want some tips. But I better get some sleep soon. [12:20] tpryme: Tim_Smart: Yeah, same here. [12:20] maushu: Tim_Smart: Stop giving weird names to stuff, it makes me confused. [12:21] tpryme: Tim_Smart: Alright, l8r man [12:21] Tim_Smart: maushu: How about I call it node_redis? [12:21] Tim_Smart: :p [12:21] Tim_Smart: mjr_ will love me for that. [12:22] maushu: Hmm. [12:22] micheil: Tim_Smart: why don't you two merge projects? [12:22] Tim_Smart: micheil: That is the plan I think. [12:22] micheil: k' [12:23] micheil: so.. now to make this documentation awesome & compilable. [12:23] Tim_Smart: I think I prefer my implementation of MULTI more though... [12:23] Tim_Smart: But meh. [12:23] EyePulp has joined the channel [12:24] micheil: hmm.. who was it who did that watch directory stuff? [12:27] Tim_Smart: git blame :p [12:28] micheil: uhh, no, it was mikeal, third party. [12:28] jimt has joined the channel [12:30] Anti-X has joined the channel [12:33] kriszyp has joined the channel [12:33] CrabDude has joined the channel [12:36] micheil: ohnoes... tim's gone. [12:38] Anti-X: like the wind [12:39] rubyphunk_ has joined the channel [12:39] micheil: wtf. fs.watchFile is weird. [12:40] stride: why? [12:40] micheil: I dunno, just the syntax and code looks weird. [12:41] micheil: I'm wondering if there's a case for a general purpose linked list implementation to be had within node.. [12:43] stride: within the core? only if that implementation offers speed advantages over doing it on your own imho [12:44] micheil: stride: well, there's a few places in core where one is used or I could see one being of benifit. [12:44] micheil: just like the FreeList module [12:44] stride: don't know what that does, I'm stuck on 0.2.x atm [12:44] micheil: it's there [12:45] micheil: it's been there since 0.1.96 [12:45] micheil: iirc [12:45] stride: huh, ok.. [12:45] micheil: try it. require("freelist") [12:45] stride: oh, right. never seen it in the docs [12:45] micheil: http://github.com/ry/node/blob/v0.2.0/lib/freelist.js [12:45] micheil: it's not documented. [12:46] micheil: I've got it done as requiring documentation. [12:46] micheil: s/done/down [12:47] stride: I don't get it, what's that good for exactly? looks just like a wrapper for an array [12:47] micheil: mother. futon. [12:47] micheil: I just closed my safari session by total accident. [12:47] micheil: arghh... [12:47] stride: uh :) [12:48] micheil: oooh.. there's a reopen last window.. never saw that before. [12:48] rubyphunk_ has joined the channel [12:54] ooooPsss has joined the channel [12:55] fermion has joined the channel [12:56] fermion has joined the channel [12:57] ysynopsis has joined the channel [12:58] micheil: hmm.. bbiab. [13:00] Tobias|: That's a shame [13:00] Tobias|: ApacheBench dies before it properly lets me test the limits of my node.js script's concurrency [13:01] ceej has joined the channel [13:02] gf3 has joined the channel [13:02] nerdEd has joined the channel [13:03] rubyphunk_ has joined the channel [13:04] mbrochh has joined the channel [13:08] dquestions has joined the channel [13:09] rubyphunk_ has joined the channel [13:10] matt_c has joined the channel [13:11] davidsklar has joined the channel [13:14] rpflo has joined the channel [13:14] ryan[WIN] has joined the channel [13:14] ryan[WIN]: i'm home [13:14] ryan[WIN]: woooo [13:14] ntelford has joined the channel [13:15] Tobias|: ACTION wonders if he should be excited [13:16] Anti-X: excitedness is overrated [13:16] Anti-X: it's never permanent [13:17] Tobias|: Unless you have a permanent source of energy [13:17] Tobias|: Or zero energy loss [13:17] Tobias|: ACTION nods [13:24] V1: Tobias|: create a small botnet on Google App engine, that does a shit load of http requests :) [13:24] Tobias|: hahaha :P [13:24] Tobias|: Too difficult [13:24] sveisvei has joined the channel [13:24] Tobias|: ACTION wonders if node.js can be run on Google's App Engine [13:24] Tobias|: Suppose not [13:24] V1: Write once, deploy everywhere ;) [13:24] Tobias|: Which is kind of ironic, given they make v8 [13:24] micheil: hm... [13:25] Tobias|: I wonder how much faster JS will be in future [13:25] kixxauth has joined the channel [13:25] V1: I'm still waiting to someone to build a SPDY protocol for node :( [13:25] Tobias|: Mozilla's nearly caught up with V8 in regards to v8bench [13:25] Tobias|: SPDY looks really cool [13:25] Tobias|: Do want to get into that :P [13:26] micheil: V1: feel free to write it yourself [13:26] V1: Probably needs to be intergrated in ryah_ 's HTTP parser [13:26] V1: But i'm a C noob [13:26] micheil: just look at how the various other server/client modules are, and go from there [13:26] jtsnow has joined the channel [13:26] micheil: yeah... ryah_'s http parser is hardcore stuff [13:26] micheil: you could probably do it all in js land. [13:27] V1: micheil: Iknow, there is already a python based SPDY parser. But for node a c implementation would probably suite it better [13:28] V1: maybe I should just spend a week on writing something up in js.. should be to hard [13:28] okuryu has joined the channel [13:29] V1: First I got finish my article for script junky, thank install monit, update socket.io on my server and spend time with the kiddos :p [13:29] V1: I wish there where more hours in a day -_-" [13:30] Tobias|: were* [13:30] V1: touche [13:30] Tobias|: :P [13:30] Tobias|: You'd spend the same proportions doing what you do [13:30] Tobias|: The difference should be your allocation [13:30] allengeorge has joined the channel [13:30] Tobias|: Change how you allocate your time and you'll get more done [13:30] Tobias|: Or just sleep less [13:30] Tobias|: One of the two n_n [13:31] V1: Or i can just quit my day job ;) [13:31] Tobias|: ACTION works casual hours [13:31] micheil: ACTION is a freelancer. [13:31] Tobias|: ew [13:31] micheil: well, mainly because of full time education for the last three years. [13:31] Tobias|: ACTION puts micheil in a box, duct-tapes it shut and mails it to Zimbabwe [13:31] ben_alman has joined the channel [13:32] Tobias|: That's no excuse :P [13:32] micheil: Tobias|: hmm, for an 18 year old, I think it's a good think. [13:32] micheil: s/think/thing [13:32] Tobias|: buahaha [13:32] Ari-Ugwu has joined the channel [13:32] V1: I freelanced for 3 years, it was long enough. [13:33] danoyoung has joined the channel [13:33] unomi has joined the channel [13:33] Tobias|: Casual in australia is really good [13:33] Tobias|: Not sure if other countries have it [13:34] micheil: Tobias|: you're from australia? [13:34] Tobias|: Means you work way more variable/flexible hours at the cost of job security [13:34] Tobias|: /whois Tobias| [13:34] Tobias|: I suppose so [13:34] Tobias|: :p [13:34] danielrmz has joined the channel [13:34] micheil: hmm, okay [13:34] micheil: Tobias|: hmm, high school dropout or doing the HSC? [13:34] Tobias|: HSC? [13:34] Tobias|: What's that? [13:35] micheil: well, equivilant. [13:35] V1: I also have flexible hours, but that still means I got to work 40 hours~ a week [13:36] kawaz_air has joined the channel [13:37] margle has joined the channel [13:38] willwhite has joined the channel [13:40] ooooPsss has joined the channel [13:40] figital has joined the channel [13:41] johngbrooks has joined the channel [13:42] ryanfitz has joined the channel [13:46] javruben2 has joined the channel [13:46] sschuermann has joined the channel [13:50] oal has joined the channel [13:51] ooooPsss_ has joined the channel [13:53] yviktorov has joined the channel [13:53] aheckmann has joined the channel [13:54] ooooPsss_ has joined the channel [13:55] dysinger has joined the channel [13:57] V1: Oh, SPDY is already working on draft 3 o_o [13:58] crohr has joined the channel [14:01] elijah-mbp has joined the channel [14:01] masahiroh has joined the channel [14:03] kawaz_air has joined the channel [14:04] c4milo: isaacs ? [14:04] trotter has joined the channel [14:07] mikew3c has joined the channel [14:07] nsm: hi could someone tell me what the process.binding('') function is for? [14:08] nsm: afaik it seems to just load one of the builtin libraries (lib/*.js) [14:08] nsm: but then in lib/fs.js there is a process.binding('fs'), why would a library load itself? [14:09] Anti-X: require() loads the lib/* [14:10] rpflo has joined the channel [14:10] micheil: process.binding loads the C bindings in node [14:10] femtoo has joined the channel [14:10] Anti-X: was gonna say c++ but yeah [14:10] micheil: for instance, process.binding("constants") loads the C/C++ constants from src/node_constants.cc [14:11] dtrasbo: what are whose literal notation is {} called in javascript? [14:11] dtrasbo: (not json) [14:11] nsm: ok, but I don't understand what you mean by load? is it similar to loading a normal binary node addon? [14:11] micheil: objects? [14:11] micheil: nsm: sort of. [14:11] Me1000 has joined the channel [14:11] dtrasbo: micheil: really? that's... simple [14:11] micheil: although, process.binding iirc, only works for node standard bindings. [14:12] nsm: so process.binding('fs').write would call the write() associated with the object in C++ (target->SetProperty etc.) and not the one in lib/fs.js? [14:12] micheil: there's no process.binding("fs") [14:12] micheil: and I wouldn't recommend by passing lib/fs.js unless there's a good reason [14:13] sschuermann has joined the channel [14:13] micheil: also, the only things that you can access are those that are exported from the C/C++ files [14:14] nsm: micheil: but it is there in lib/fs.js, right at the beginning, binding = process.binding('fs'), anyway I got the idea, thanks a lot [14:14] dtrasbo: how can insert non-literals in an object with the {} notation? [14:14] dtrasbo: aka, I want to execute code within the {}'s [14:14] micheil: dtrasbo: what do you mean? [14:14] nsm: dtrasbo: you could try something like var x = 5; { key: x } [14:14] micheil: you can only have strings, numbers, booleans, arrays and objects within JSON [14:15] jimt_ has joined the channel [14:15] nsm: dtrasbo: you mean JSON or an object literal in JS [14:15] linkwright has joined the channel [14:15] dtrasbo: nsm: object literal [14:15] yhahn has joined the channel [14:15] micheil: man.. what's with calling things literal? [14:15] nerdEd has joined the channel [14:15] nsm: dtrasbo: and what do you mean you want to execute code? [14:15] dtrasbo: micheil: what else should I call it? [14:15] micheil: just call it an object [14:16] dtrasbo: socket.send(JSON.stringify({ 'action' : 'set_name', 'name' : $('#input#player-name').val() })); [14:16] dtrasbo: I sort of assumed it would work [14:16] micheil: that would work. [14:16] dtrasbo: micheil: trouble is it doesn't [14:16] dtrasbo: no errors [14:16] micheil: check your jquery selector [14:16] dtrasbo: but the name key just doesn't get included [14:17] dtrasbo: it works [14:17] micheil: if the value is null or undefined, then it is obmitted. [14:17] gf3 has joined the channel [14:17] nsm: dtrasbo: it seems your are looking for a tag [14:17] nsm: in which case it would be $('input#player-name'), no # prefix [14:17] dtrasbo: just caught that [14:17] micheil: socket.send(JSON.stringify({action: 'set_name', name: $('irc://irc.freenode.net/#input%23player-name').val() || "" })); [14:17] dtrasbo: must have inserted the # by accident [14:17] micheil: :) [14:18] dtrasbo: doh [14:18] micheil: oh. man, did colloquy just mangle that? [14:19] dtrasbo: micheil: perhaps [14:19] dtrasbo: I use colloguy too though [14:19] dtrasbo: didn't happen for me [14:19] dtrasbo: it works now [14:19] dtrasbo: I just love typos [14:19] dtrasbo: thanks! [14:19] kawaz_air has joined the channel [14:20] muk_mb has joined the channel [14:20] micheil: dtrasbo: also, if socket is a socket.io socket, you can obmit JSON.stringify() [14:20] micheil: socket.io should automatically do that for you. [14:20] dtrasbo: micheil: oh [14:20] dtrasbo: that's clever [14:21] dshaw has joined the channel [14:23] ceej has joined the channel [14:25] dtrasbo: and it even goes both ways! [14:25] dtrasbo: that's what I call neat [14:26] EyePulp has joined the channel [14:26] micheil: it is quite neat. [14:26] omarkj has joined the channel [14:29] stepheneb has joined the channel [14:31] mAritz: anyone else here work with redis and thinks a driver should convert string results to strings? it's quite tedious to loop over replies and apply .toString() for every query myself. :/ [14:32] dtrasbo: mAritz: what are they by default? [14:32] mAritz: buffers [14:32] dtrasbo: oh great [14:32] mAritz: numbers too apparently :( [14:33] dtrasbo: why are they buffers? for streaming? [14:33] robinduckett has joined the channel [14:33] robinduckett: sup [14:33] sschuermann: hell [14:33] sschuermann: o [14:33] sschuermann: ;) [14:33] micheil: mAritz: .toString is slow. [14:33] micheil: buffer's are far faster. [14:34] sschuermann: anyone can tell me if i should use nodes event mechanism or the one from node-evented ? [14:34] micheil: node-evented? [14:34] micheil: what's that? [14:34] mAritz: micheil: i can't display buffers to the user though :/ [14:34] micheil: mAritz: true, in which case, isn't the a setEncoding option? [14:34] micheil: if not, ask the author to add it / give a patch. [14:34] ajpiano has joined the channel [14:36] rwaldron has joined the channel [14:36] bradleymeck has joined the channel [14:36] Br|ce has joined the channel [14:37] bmizerany has joined the channel [14:37] sschuermann: http://github.com/donnerjack13589/node-evented [14:37] sschuermann: vs EventEmitter in node.js [14:37] sschuermann: seems pretty much the same [14:39] masahiroh has joined the channel [14:40] mAritz: i think i'm having a fundamental misunderstanding. https://github.com/mranney/node_redis/blob/master/examples/simple.js this works and displays reply as intended. but in my code i always get buffers for bulk replies. (and console.dir says ) [14:41] micheil: sschuermann: that's because it pretty much is node's eventemitters. [14:41] micheil: I'd recommend you use node's build in events module [14:41] gerad has joined the channel [14:41] micheil: var eventemitter = require("events").EventEmitter [14:41] micheil: it's highly optimised and very stable. [14:41] sschuermann: okay, very fine [14:41] sschuermann: ;) [14:42] gerad has joined the channel [14:42] sschuermann: i was suspecting something like this [14:42] sschuermann: ;) [14:42] sschuermann: i anyway needed the api's [14:42] sschuermann: you guys should propagate this one much more [14:42] sschuermann: this is how someone hould write his code [14:42] sschuermann: in node ;) [14:43] micheil: uhh.. it's used all throughout node [14:43] sschuermann: yeah [14:43] BHSPitCSP: indeed [14:44] micheil: see: http://nodejs.org/api.html#eventemitter-13 [14:44] sschuermann: but as soon as you want to implement smth you add callbacks to your standard way of coding stuff n'sync [14:44] sschuermann: which is very wrong [14:44] sschuermann: in time you stumble upon event emitters [14:46] micheil: sschuermann: I'll make a note to make it more prominent in the documentation rework. [14:48] sschuermann: thanks ;) [14:48] sschuermann: great ;) [14:48] JImBastard has joined the channel [14:49] sschuermann: Hello Jim [14:50] nerdEd has joined the channel [14:50] bradleymeck: yello [14:50] maushu: ANNOUNCER! CLEAN THE TUBES! [14:51] maushu: Why announcer... why? ;_; [14:51] sschuermann: worked like a charm [14:51] maushu: ACTION sinks like the titanic. [14:51] micheil: _announcer: clean the tubes. [14:51] _announcer: Cleaning the tubes for great justice! [14:51] micheil: >_> [14:51] maushu: Doesn't make sense, I made a pretty liberal regex. [14:52] nerdEd has joined the channel [14:52] bradleymeck: anouncer, tubes clean yes? [14:52] hellp has joined the channel [14:52] JImBastard: internet [14:52] JImBastard: this UI is looking pretty nice [14:53] ajpiano has joined the channel [14:54] boaz has joined the channel [14:54] Me1000 has joined the channel [14:56] gwoo has joined the channel [14:57] ehaas has joined the channel [14:58] benburkert has joined the channel [15:00] robinduckett: marak: what UI? [15:00] charlenopires has joined the channel [15:02] JImBastard: robinduckett: nodejitsu! [15:02] robinduckett: sneakpreviewplz? :D [15:02] JImBastard: no ways [15:02] JImBastard: ! [15:02] JImBastard: nov 1 [15:03] JImBastard: ima let in all the node peeps [15:03] robinduckett: not even for your old pal robinduckett? :P [15:03] Yuffster has joined the channel [15:03] JImBastard: i wonder when the new nodejs.org site gets launched [15:03] nerdEd has joined the channel [15:03] robinduckett: I got some heavy negative karma for posting your comments on HN :P [15:03] gkatsev: it's nodejutsu [15:03] V1 has left the channel [15:03] robinduckett: gkatsev: eh? [15:04] jacobolu_ has joined the channel [15:04] mbrochh has joined the channel [15:04] robinduckett: gkatsev: http://nodejitsu.com/ [15:04] tj has joined the channel [15:04] mbrochh has joined the channel [15:04] gkatsev: oh, lol [15:04] JImBastard: i cant wait to get dressed up like ninjs [15:04] JImBastard: ninjas [15:04] ajpiano has joined the channel [15:04] margle has left the channel [15:05] davidwalsh has joined the channel [15:06] robinduckett: ah well [15:06] robinduckett: i don't ahve time for nodejs anymore [15:06] robinduckett: not since I got Minecraft [15:06] robinduckett: DEVIL GAME. [15:06] Tobias|: o_o [15:06] Tobias|: ACTION scratches it off of his to-buy list [15:06] robinduckett: Started that shit up at 9pm last night [15:06] robinduckett: 5.30am this morning [15:06] robinduckett: "... shit." [15:07] robinduckett: got up for work at 6.30am [15:07] gkatsev: robinduckett: did you make a 16bit ALU? or a giant train track leading to infinity? [15:07] robinduckett: gkatsev: nah I made a bitchin' house though [15:07] gkatsev: lol, ok [15:07] margle has joined the channel [15:07] robinduckett: pretty much a replica of my childhood home [15:07] gkatsev: my uni has a server for it, lol [15:07] robinduckett: Promoting creativity eh? ;P [15:08] gkatsev: i think it is student run. [15:08] rubyphunk has joined the channel [15:08] Tobias|: Cool :) [15:08] gkatsev: we have a bunch of linux boxes we can use as servers and stuff [15:08] JImBastard: robinduckett: i juse use the INVedit , it takes up way less time [15:08] gkatsev: at least, in the CS dept. [15:08] JImBastard: SSSSSsssssssSSSSSSsssssss [15:08] robinduckett: JImBastard: I only bought it last night and I was having too much fun without cheating :P [15:08] JImBastard: ahaha [15:09] JImBastard: i get banned from the reddit server for blowing up stuff [15:09] robinduckett: fucking died in my first world though [15:09] robinduckett: griefers suck :P [15:09] JImBastard: some mod left one tnt in a random chest and i duped it like crazy [15:09] JImBastard: they didnt catch me for a while [15:09] gkatsev: zombies, damn zombies. [15:09] robinduckett: yeah [15:09] robinduckett: like it just got dark all of a sudden and my shelter wasn't even like half done [15:10] robinduckett: so i tried digging myself a house into the side of a cliff and I couldn't dig quick enough because I didn't know how to craft [15:10] gkatsev: ACTION has never played minecraft [15:10] robinduckett: so i was getting munched by skeletons [15:10] robinduckett: they chase you [15:10] robinduckett: scared the crap out of me [15:10] robinduckett: IT WAS AN ADVENTURE OKAY I DON'T DO MUCH WITH MY LIFE :( [15:11] ooooPsss has joined the channel [15:11] Raevel: JImBastard: you scared me [15:11] JImBastard: Raevel: sorry [15:11] flippyhead has joined the channel [15:12] robinduckett: ? [15:12] sonnym has joined the channel [15:13] nsm: is there a known problem with generating the API documentation with ronn on the latest node? [15:13] nsm: i think i have a situation where an event loop refuses to exit [15:14] nsm: and a reproduceable test case, on x86 Linux, will mail nodejs-dev [15:17] daniellindsley has joined the channel [15:17] jakehow has joined the channel [15:19] jpld has joined the channel [15:19] jpld has joined the channel [15:19] omarkj has joined the channel [15:21] johngbrooks has joined the channel [15:21] quirkey has joined the channel [15:24] sivy has joined the channel [15:26] bartt has joined the channel [15:27] micheil: nsm: hmm.. well, we probably won't be using ronn for much longer. [15:27] linkwright has joined the channel [15:27] micheil: ACTION is reworking all the documentation. [15:27] jamund has joined the channel [15:27] creationix has joined the channel [15:28] matt_c_ has joined the channel [15:29] nsm: micheil: no its not a ronn issue, its a node issue, i've got a one line test case reproducing it after v0,3.0, i'm searching for the problem commit right now [15:29] micheil: nsm: could you provide the example? [15:29] Tobias|: Why is it recommended that node.js is run behind a conventional HTTP server such as lighty? [15:30] micheil: Tobias|: because, node is still new and there may be security exploits. [15:30] nsm: have a test.js with contents "var util = require('util'); util.puts("Hi there")" [15:30] Tobias|: I see [15:30] nsm: micheil: and then run it with node, output on stdout, not problems [15:30] micheil: also, you may want to use ssl, which isn't currently supported well in node [15:30] nsm: no* [15:30] micheil: Tobias|: up late? [15:30] Tobias|: And how will a conventional webserver going to help that? [15:30] nsm: micheil: but redirect stdout to a file, and the process never exits [15:30] micheil: nsm: interesting. [15:31] Tobias|: micheil, been up very late the last several nights [15:31] dnolen has joined the channel [15:31] micheil: Tobias|: well, something like nginx should be battle tested. [15:31] robinduckett: nginx is awesome. [15:31] micheil: so, it reduces attack vectors [15:31] EyePulp has joined the channel [15:31] robinduckett: i'm SO bored. [15:31] Tobias|: I see [15:31] micheil: that said, those running on http://no.de are running node.js on port 80 with nothing in front. [15:32] Tobias|: Write something fun, robinduckett? [15:32] micheil: iirc. [15:32] nsm: micheil: can you reproduce? [15:32] robinduckett: Tobias|: like? [15:32] Tobias|: I don't know [15:32] Tobias|: An IRC bouncer? [15:32] micheil: nsm: not at the moment, I'm kinda busy [15:32] rwaldron has joined the channel [15:33] robinduckett: I wanted to make a web interface to my scriptable-node-irc-bot but lost all enthusiasm half way through battling with connect [15:33] Tobias|: o_o [15:33] Tobias|: Twitter proxy? [15:33] robinduckett: been done [15:33] nsm: micheil: ok [15:33] halfhalo: Heh,... i tried making a web interface to my irc class.... then gave up because I can't design an interface worth crap [15:33] micheil: robinduckett: how about a load balancing event emitter [15:33] micheil: or cross-process event emitter [15:33] Tobias|: O_o [15:34] robinduckett: i saw a load balancing event emitter thing the other day [15:34] micheil: Tobias|: what? EventEmitters are awesome + fun + and fairly easy to implement the basics of [15:34] robinduckett: on someone's github [15:34] Tobias|: Alternative minecraft server? [15:34] micheil: robinduckett: yeah, but you could try and do it better. [15:34] Tobias|: Might take a while to write, though :P [15:35] robinduckett: I miss just being able to hack at things without getting bored or tired of it [15:35] robinduckett: see, back when I was a shop keeper, getting me to not code was difficult at best [15:35] robinduckett: now I'm a full time developer it's a chore [15:35] robinduckett: unless it's really fun [15:35] robinduckett: writing my irc bot was fun [15:36] robinduckett: but other than writing new modules for it, it's pretty much feature complete [15:36] halfhalo: ACTION knows the feeling [15:36] halfhalo: although I never did finish the new plugin support for my irc bot... [15:36] halfhalo: eh [15:36] sth: net.Stream.setNoDelay(true) is meant to stop buffering correct? [15:37] micheil: umm.. [15:37] micheil: I think that disables nagel. [15:38] micheil: see: http://nodejs.org/api.html#stream-setnodelay-248 [15:39] muhqu has joined the channel [15:40] ivanfi has left the channel [15:40] muhqu has joined the channel [15:40] sth: Sure, but the overall idea is, setting that to true and then writing something should make it write to the client straight away? [15:41] langworthy has joined the channel [15:42] creationix: robinduckett: sorry connect was a beast [15:42] creationix: robinduckett: remember you can always use as little of as much of it as you want [15:42] creationix: writing your own layers to drop in and replace mine is great [15:43] springmeyer has joined the channel [15:43] kkaefer: when starting tls negotiation, has anyone encountered this error message: [15:43] kkaefer: Assertion failed: (ok), function verify_callback, file src/node_crypto.cc, line 34. [15:43] kkaefer: Abort trap [15:44] Athox has joined the channel [15:44] devinus has joined the channel [15:45] robinduckett: creationix: yeah I know, I'm just not comfortable with it yet [15:45] eee_c has joined the channel [15:45] micheil: kkaefer: tls is currently buggy / unstable within node [15:45] kkaefer: understood [15:45] kkaefer: would it help to submit a testcase? [15:45] micheil: kkaefer: yes. [15:45] creationix: robinduckett: just let me know if you need any help, or you can do what Tim_Smart did and make his own framework that's [15:46] creationix: with connect modules. [15:46] kkaefer: ok, I'll try to reduce it [15:46] micheil: kkaefer: email it to nodejs-dev@googlegroups.com [15:46] yhahn has joined the channel [15:47] robinduckett: creationix: cool, thanks :) [15:49] daglees has joined the channel [15:49] creationix: ACTION wonders if we're going to have political parties within the node community (with semicolons and without) [15:49] halfhalo: ACTION votes for no semicolons [15:50] Tobias|: ACTION votes for semicolons [15:50] mAritz has joined the channel [15:50] siculars has joined the channel [15:50] creationix: I'll run independent [15:50] creationix: ;) [15:50] ooooPsss has joined the channel [15:50] creationix: ACTION hopes node.js will never have political parties [15:51] aurynn: I vote cuddled elses. [15:51] technoweenie has joined the channel [15:51] robinduckett: cuddled elses = } else { right? [15:52] aurynn: yep [15:52] Athox: cuddled elses [15:52] Athox: i like it [15:53] robinduckett: I like my braces on the same line [15:53] robinduckett: if (what) { [15:53] Anti-X: i do } else if (...) { too [15:53] aurynn: I do if .. { [15:53] rbranson: cuddle else = cuddling hitler [15:53] aurynn: } [15:53] aurynn: else { [15:53] jchris has joined the channel [15:54] JImBastard: creationix: i only vote republican [15:54] isaacs has joined the channel [15:54] zomgbie has joined the channel [15:54] matt_c has joined the channel [15:54] Anti-X: semicolons are stupid when they're not needed [15:55] Anti-X: and on the server they're not needed. [15:55] rbranson: i write all my JS in browser style :P [15:55] creationix: Anti-X: do you really think it matters more than personal taste? [15:55] rbranson: so i don't confuse myself [15:55] Anti-X: creationix, my opinion is always more important. don't you know that?!? [15:55] rbranson: I guess JS could be like Python and have it's style dictated by the interpreter :D [15:55] aurynn: semicolons matter to the language lexer. So they're important. [15:56] tjholowaychuk: lol [15:56] tjholowaychuk: no they dont [15:56] isaacs: aurynn: omg, is this conversation still happening? [15:56] Anti-X: lex yourself [15:56] aurynn: isaacs, apparently I fell for the trollbait. [15:56] isaacs: aurynn: the lexer cares about statement ending. semicolons are one way to end statements. [15:56] Anti-X: rbranson, python can take semicolons too, if you want to put several things on the same line.. doesn't mean you should [15:57] aurynn: isaacs, i was noting that the JS implementation expects a semicolon as the statement terminator [15:57] creationix: isaacs: sorry, I blame Ryah Gahl [15:57] isaacs: unless your reason for using semicolons is "I like the way it looks better this way", you're wrong. And if that's your reason, then there's really nothing to debate. [15:57] creationix: isaacs++ [15:57] v8bot: creationix has given a beer to isaacs. isaacs now has 5 beers. [15:57] rbranson: isaacs++ [15:57] v8bot: isaacs is getting too many beers. Don't let isaacs get drunk! [15:57] Anti-X: isaacs [15:57] Anti-X: isaacs++ [15:57] v8bot: isaacs is getting too many beers. Don't let isaacs get drunk! [15:57] Anti-X: why not?! [15:57] rbranson: isaacs has alcohol poisoning [15:57] Anti-X: let the man get drunk [15:57] isaacs: ACTION thump [15:58] aurynn: unless v8 does \n too, in which case, w/e [15:58] isaacs: it's not even 9am yet [15:58] stride: semicolons are necessary for enterprise grade JS! http://enterprise-js.com/4 [15:58] Anti-X: who's v8bot to decide who gets to get drunk [15:58] stride: .oO( :> ) [15:58] rbranson: haha [15:58] rbranson: <3 enterprise-js [15:58] creationix: for the record, I get drunk of the vapors of strong drinks alone [15:58] Anti-X: sniff the cork? [15:58] isaacs: javascripters party the hardest. [15:58] isaacs: it's a known fact. [15:59] creationix: isaacs: but sober programmers dance the best ;) [15:59] Anti-X: programmers don't dance [15:59] Anti-X: unless you compare them to other programmers [15:59] creationix: Anti-X: obviously you weren't at jsconf.eu [15:59] Anti-X: no [15:59] Anti-X: planning on being there next year i hope [15:59] Anti-X: but i'm not gonna dance [16:00] Anti-X: and mikeal getting drunk before a presentation [16:00] Anti-X: that's just not pro [16:01] Anti-X: :p [16:01] cardona507 has joined the channel [16:01] stride: AssertionError: false === true [16:01] stride: did I mention that.. I hate tests? :> [16:02] tjholowaychuk: stride: add a message so it makes sense :p we still need to fix assertion errors so they show both tho [16:02] Anti-X: ACTION notes [16:02] tjholowaychuk: because that is really lame [16:02] jetienne has joined the channel [16:02] Blink7 has joined the channel [16:02] Raevel: stride: haha yeah i hate that error message [16:02] Raevel: "*duh*" [16:02] creationix: really, I thought that false === true was sometimes true [16:03] stride: tjholowaychuk: nah that was just a random one in node-mysql, nothing about the timeout list there [16:03] creationix: ACTION goes back to his notes from graduate school [16:03] tjholowaychuk: stride: no I just mean that when you assert.equal(foo, bar, 'with a message') it should still display the foo == bar [16:03] tjholowaychuk: so you dont have to manually add it to your message [16:04] stride: heh, test suite is still running okay. can't believe it after what cruel & ugly things I've done to the code :> [16:04] stride: tjholowaychuk: oh, ok :) [16:05] creationix: tjholowaychuk: is it possible to know the names of the variables passed in? [16:05] tjholowaychuk: creationix: no but it should display the original assertion message derived from the input [16:06] rbranson: soooo.... on the topic of holy wars, single-quotes, or double-quotes? [16:08] dmcquay has joined the channel [16:08] creationix: rbranson: I prefer single quotes, but that's a holdover from too many years of PHP where they actually perform better [16:08] creationix: generally it doesn't matter [16:08] creationix: JSON requires double [16:08] davidascher has joined the channel [16:08] rbranson: I'm a C programmer, so I use double [16:09] jetienne: google advices for single as html needs double. so escaping is easier [16:09] Tobias|: Me too, and for the same reason, creationix :p [16:09] unomi: ditto :p [16:10] creationix: yeah, if my string has double or single in the data, then I use whatever requires less escaping [16:10] rbranson: I'm glad I was never really that much of a PHP programmer [16:10] stephank has joined the channel [16:10] stride: I prefer single, although double are easier to type on german keyboard layouts + I'm lazy.. so I often catch myself mixing them.. [16:10] creationix: rbranson: less brain damage that way [16:10] rbranson: although I did have years of Perl, so I took my abuse :P [16:10] Anti-X: i'm glad i was much of a php programmer... taught me to appreciate the good things in life [16:11] rbranson: I was using MVC in Perl too... :O [16:12] rbranson: there is this huge chunk of shit code I wrote in Perl when I was 18 for managing and deploying software amongst a very complex testing environment at a very large shipping company which is still in use [16:12] rbranson: forget MVC though [16:12] rbranson: print <3 [16:12] rbranson: it was like most ignorant kind of PHP style programming in Perl [16:13] rbranson: I'm sure some shmuck has inherited it and is probably cursing me to this day [16:16] aurynn: Or refactoring it to use templates. [16:16] rbranson: doubt it [16:16] rbranson: nobody there would be motivated enough to do it, they are all clock punchers [16:17] eee_c has joined the channel [16:17] rbranson: they probably point to it and use it as an example of why to follow the "enterprise" standards [16:18] pablort has joined the channel [16:19] micheil: use both. it doesn't matter really. [16:19] danoyoung has left the channel [16:20] evanpro has joined the channel [16:21] sschuermann has joined the channel [16:24] murphy has joined the channel [16:26] banjiewen has joined the channel [16:27] macomber has joined the channel [16:29] huyhong has joined the channel [16:30] huyhong has joined the channel [16:30] nerdEd has joined the channel [16:32] softdrink has joined the channel [16:32] Duncan has joined the channel [16:32] gerred has joined the channel [16:32] aurynn: if you use print statements to generate html, I will come and hurt you. [16:34] c4milo has left the channel [16:34] pablort has joined the channel [16:34] huyhong has left the channel [16:34] itissid has joined the channel [16:35] yviktorov has joined the channel [16:37] creationix has joined the channel [16:39] tmpvar has joined the channel [16:40] Ori_P has joined the channel [16:40] sprout has joined the channel [16:41] margle has joined the channel [16:42] eee_c has joined the channel [16:42] qFox has joined the channel [16:43] jacobolus has joined the channel [16:44] shout-test has joined the channel [16:48] bpot has joined the channel [16:48] TheEmpath has joined the channel [16:50] antris has joined the channel [16:51] klaytonix has joined the channel [16:51] macomber has left the channel [16:52] nerdEd has joined the channel [16:52] Throlkim has joined the channel [16:53] norviller has joined the channel [16:56] noahcampbell has joined the channel [16:56] amerine has joined the channel [16:57] MikhX has joined the channel [16:59] Duncan has joined the channel [16:59] Aria has joined the channel [17:00] dgathright has joined the channel [17:01] trotter has joined the channel [17:01] Me1000 has joined the channel [17:02] hzin has joined the channel [17:03] micheil: y'know what'd be hot? [17:03] micheil: streamable markdown conversion. [17:04] modular has joined the channel [17:04] mbrochh has joined the channel [17:04] pharkmillups has joined the channel [17:04] micheil: so, like, fs.createWriteStream(path).pipe(mdconvert.pipe(fs.createReadStream(...))) [17:04] micheil: or something. [17:05] Aria: Oo. [17:05] Aria: Good idea. [17:05] micheil: it'd probably have a far better api then that. but just the idea of being able to stream markdown through it and get the html back would be hot. [17:05] Aria: Totally doable, too. [17:05] Twelve-60 has joined the channel [17:05] micheil: yeah [17:06] micheil: Aria: would be good for the new doc-tool: http://gist.github.com/649470 [17:07] Aria: Oh fun! [17:08] xla has joined the channel [17:08] ncursestest has joined the channel [17:08] micheil: so, hopefully that'll be in a patch soo. [17:08] micheil: all the documentation split out into files in /doc/api/*.markdown [17:09] micheil: builds to: build/doc/api/*.html [17:09] micheil: anyway, it's 4am, so bed for me. [17:10] dtrasbo: O_o [17:11] dtrasbo: how can a human being talk sense at 4am [17:11] vastak has joined the channel [17:12] BryanWB has joined the channel [17:13] langworthy has joined the channel [17:14] ollie has joined the channel [17:15] blackbrrr has joined the channel [17:15] tpryme has left the channel [17:18] micheil: dtrasbo: the same way I've contributed some core modules to node at 6am in the morning. [17:19] micheil: (that's without sleeping through) [17:19] micheil: anyways, chow. [17:19] dtrasbo: micheil: at that time I would be in doubt if I was a human [17:20] agnat has joined the channel [17:21] jchris has joined the channel [17:22] vandenoever has joined the channel [17:22] vandenoever: how can i detect if i'm running code in node.js as opposed to in the browser [17:22] vandenoever: if (window) { } throws an exception [17:22] robinduckett: man i found out one of my high school friends works for redhat now [17:23] vandenoever: i guess i could catch that ... [17:23] muk_mb has joined the channel [17:23] unomi: try replacing that with if(typeof(window) === "undefined"){} [17:23] ph^ has joined the channel [17:24] robinduckett: or if (undefined == window) [17:24] vandenoever: robinduckett: thanks! [17:24] robinduckett: and unomi [17:25] vandenoever: unomi? [17:25] robinduckett: 18:24 < unomi> try replacing that with if(typeof(window) === "undefined"){} [17:25] vandenoever: eh yes [17:25] vandenoever: sorry :-) [17:25] vandenoever: unomi: thank you! [17:25] vandenoever: but robinduckett's works :-) [17:26] unomi: err well, the reason that undefined == window in that situation is probably the same reason that foo == window is likely to be true :p [17:26] robinduckett: sssh :P [17:26] vandenoever: ReferenceError: window is not defined [17:26] blackbrrr has left the channel [17:26] robinduckett: v8: typeof(window) == "undefined" [17:26] v8bot: robinduckett: true [17:26] robinduckett: v8: undefined == window [17:26] v8bot: robinduckett: ReferenceError: window is not defined [17:27] robinduckett: v8: typeof window [17:27] v8bot: robinduckett: "undefined" [17:27] robinduckett: v8: typeof window == undefined [17:27] v8bot: robinduckett: false [17:27] robinduckett: v8: typeof window == "undefined" [17:27] v8bot: robinduckett: true [17:27] MikhX has joined the channel [17:27] robinduckett: it's gross how typeof is a language construct as well as a function [17:27] robinduckett: instanceof "undefined" [17:27] robinduckett: v8: instanceof "undefined" [17:27] v8bot: robinduckett: SyntaxError: Unexpected token instanceof [17:27] Duncan has joined the channel [17:28] robinduckett: hum [17:28] c4milo has joined the channel [17:29] robinduckett: v8: setTimeout [17:29] v8bot: robinduckett: ReferenceError: setTimeout is not defined [17:29] unomi: vandenoever: which one didn't work? mine? [17:29] robinduckett: unomi: mine didn't work [17:29] robinduckett: v8: typeof(window) == "undefined" [17:29] v8bot: robinduckett: true [17:29] unomi: v8bot: typeof(window) === "undefined" [17:29] v8bot: unomi: Use v8: to evaluate code or "`v commands" for a list of v8bot commands. [17:29] unomi: heh [17:29] robinduckett: v8: undefined == window [17:29] v8bot: robinduckett: ReferenceError: window is not defined [17:30] robinduckett: see [17:30] robinduckett: `v commands [17:30] v8bot: robinduckett: Commands: Type `v . Optionally, type `v @ to send to a specific user. `v Commands are: about, beers, commands, git, google, help, macro. Other commands: v8, `re, `pcre, `ref. Type `v help for more information. [17:30] unomi: v8: typeof(window) === "undefined" [17:30] v8bot: unomi: true [17:30] rauchg_ has joined the channel [17:31] robinduckett: v8: while(true) {var dir = true} [17:31] robinduckett: yeah [17:31] v8bot: robinduckett: Error: Timeout [17:31] robinduckett: suck on that. [17:31] robinduckett: awh wtf [17:31] robinduckett: v8 throw "DEATH" [17:31] v8bot: robinduckett: v8 is no longer supported (except in PM). Try v8: or v8> [17:31] robinduckett: v8: throw "DEATH" [17:31] v8bot: robinduckett: undefined: undefined [17:31] unomi: use === or douglas crockford will send chuck norris to kick your ass [17:33] mrjjwright has joined the channel [17:33] vnguyen has joined the channel [17:34] V1 has joined the channel [17:34] V1: Omg, 400 users in the channel o_o [17:35] V1: What happened ^_^ [17:35] davidascher has joined the channel [17:35] dahankzter has joined the channel [17:36] isaacs: `v beers [17:36] v8bot: isaacs: has 0 beers. [17:36] isaacs: `v git [17:36] v8bot: isaacs: Weekend codes - http://stockrt.github.com/ [17:36] isaacs: `v git [17:36] v8bot: isaacs: Weekend codes - http://stockrt.github.com/ [17:36] vandenoever: unomi: dont worry, using jslint in my vim [17:36] gkatsev: `v beers crockford [17:36] v8bot: gkatsev: crockford has 0 beers. [17:36] davidascher has joined the channel [17:37] Gruni has joined the channel [17:38] tjholowaychuk: tmpvar: ping [17:39] bt has joined the channel [17:39] bt has left the channel [17:39] vandenoever: i am using 'new' though even though crockford discourages it [17:40] vandenoever: because it allows me to define interfaces and implement them and have Closure Compiler check it [17:40] sprout has joined the channel [17:40] tmpvar: tjholowaychuk, yo [17:40] bradleymeck has joined the channel [17:40] tjholowaychuk: tmpvar: just started working on node-canvas again a bit, was there anything you wanted to tackle? [17:41] bradleymeck: shaders! [17:41] vandenoever: lol [17:41] V1: gl! [17:41] tmpvar: tjholowaychuk, im not sure atm [17:41] gkatsev: classes-in-js-- [17:41] v8bot: gkatsev has taken a beer from classes-in-js. classes-in-js now has -1 beers. [17:42] tmpvar: tjholowaychuk, i figured I'd start filling in gaps.. honestly I've been busy as hell these past couple weeks [17:42] tjholowaychuk: tmpvar: aight, sounds good. if you want maybe just tag some of the issues [17:42] bartt has joined the channel [17:42] tjholowaychuk: no worries me too [17:42] tmpvar: tjholowaychuk, yeah, that was the plan [17:44] d0k has joined the channel [17:47] sebastiandeutsch has joined the channel [17:47] springmeyer has joined the channel [17:48] markt has joined the channel [17:49] amerine has joined the channel [17:50] amerine has joined the channel [17:50] aconran____ has joined the channel [17:50] nerdEd has joined the channel [17:50] sebastiandeutsch: Any mongoose wisdom around? I created a mongoose model, now I do a query. Now I get a collection - but instead of having a cool object inside the array. I'll get an object where all properties are nested inside a "_doc" document. Also getters nor methods don't work. But funny thing there is a safe method. [17:52] Br|ce has joined the channel [17:52] mrjjwright_ has joined the channel [17:54] dtrasbo: say I need to somehow retrieve all attributes of an object (name and value) - is that possible? [17:54] dtrasbo: object seems to have a very limited set of methods [17:54] dtrasbo: oh wait [17:54] dtrasbo: I guess I can use for (...) {} [17:54] delapouite has joined the channel [17:54] Anti-X: Object.keys(obj) [17:54] Anti-X: returns an array of names [17:55] yviktorov has joined the channel [17:56] dtrasbo: Anti-X: thanks! [17:56] richcollins has joined the channel [17:57] davidascher has joined the channel [17:58] rubydiamond: Guys, I am trying to understand node.js [17:58] rubydiamond: see this http://pastie.org/1253326 [17:58] rubydiamond: how is node.js different from other functions... though it supports callbacks.. [17:58] rubydiamond: halp [17:59] JohnDav: rauchg_: seems quite stable now [18:00] tjholowaychuk: rubydiamond: node's IO is async, so you callback(data) not return data [18:00] aconran_____ has joined the channel [18:00] rubydiamond: tjholowaychuk: hmm.. I callback(data) [18:00] rubydiamond: ? [18:00] rubydiamond: I never done that.. [18:01] rubydiamond: I have always return with node.js [18:01] tjholowaychuk: you have never used a callback? [18:01] rubydiamond: does that mean.. I have done wrong code which is non async [18:01] daglees has joined the channel [18:01] bradleymeck: some methods return event emitters that can handle data when it comes in, but at some point its a handler/callback [18:01] tjholowaychuk: if you use *Sync variants you can return [18:01] muhqu has joined the channel [18:01] bradleymeck: but those are considered bad juju to use [18:02] rubydiamond: tjholowaychuk: not very much [18:02] aconran______ has joined the channel [18:02] rubydiamond: btw how callback works ? [18:02] bmizerany has joined the channel [18:02] rubydiamond: how is it different than 'return something' [18:02] tjholowaychuk: its just a function that you are passing to another function as an argument [18:02] bradleymeck: it wont block code when it returns, the code keeps executing past that, the callback is only fired when data is ready [18:03] rubydiamond: tjholowaychuk: do you mean 'response' object ? [18:03] bradleymeck: aaaaaarg ajaxian why do you bring up fibers for js [18:03] tjholowaychuk: haha [18:04] rubydiamond: tjholowaychuk: do you mean callback(data) is a function ? [18:04] rubydiamond: I am confused.. [18:04] bradleymeck: fs.readFile(function(err,data){/*i am a callback*/}) [18:05] bradleymeck: yes the arguments are functions used as callbacks [18:06] bradleymeck: take note though, not all functions use callbacks for returns, if they do not use any async operations or events (basically they just churn numbers) they might just return a value [18:06] rubydiamond: bradleymeck: so everything inside { } is a callback.. [18:06] bradleymeck: no [18:06] rubydiamond: hmm [18:06] bradleymeck: that function is used as a callback [18:07] bradleymeck: a callback is just a way of using a function [18:07] rubydiamond: bradleymeck: which function to be specific [18:07] bradleymeck: you are "calling back" to the function to handle things [18:07] bradleymeck: the one passed as an argument [18:07] rubydiamond: bradleymeck: there are only two arguments .. one is request and second is response [18:07] hober: fs.readFile(foo) // foo is a (named) callback [18:08] hober: it just happens that in bradleymeck's example the callback is anonymous [18:08] bradleymeck: there is no request or response in the example [18:08] bradleymeck: are you talking about the server callbacks that use the (req,res,next?) arguments? [18:09] digitalspaghetti: OHGOD trolls invading the mailing list D: [18:09] bradleymeck: ACTION runs off to light fires under trolls [18:09] markt has joined the channel [18:10] rubydiamond: btw I see fs.readFile(req, resp) not there .. but fs.readFile(function(err, data) { } ) there [18:10] rubydiamond: bradleymeck: yes [18:11] bradleymeck: those are functions being used as callbacks, the only callback given to them is the next iterator if given [18:12] rubydiamond: so bradleymeck, you mean resp is not a callback.. [18:12] bradleymeck: fs.readFile(filename, [encoding], [callback]) is the function signature for fs.readFile idk where you see req,resp [18:12] bartt: isaacs: Any plans to add support to npm to install modules directly from github? [18:12] isaacs: bartt: npm install http://github.com/user/project/tarball/master [18:12] isaacs: like that? [18:12] rubydiamond: bradleymeck: so is it true that every function in node.js is a callback.. [18:12] isaacs: cuz that was like the first feature ever in npm :) [18:12] bradleymeck: rubydiamond in server callbacks, nope they are just object [18:12] bartt: Yeah [18:12] bradleymeck: rubydiamond, no [18:12] rubydiamond: okay.. [18:13] bradleymeck: functions are functions, if a function is going to handle an async operation it is called a callback [18:13] unomi: isaacs: just wondering, does npm handle dependencies? [18:13] isaacs: unomi: yes. [18:13] rubydiamond: bradleymeck: for function like this fs.readFile(filename, [encoding], [callback]) ... when callback gets called [18:13] bradleymeck: it helps distinguish how a function is being used, aka if the stack is still valid or only the scope and if it blocks [18:13] unomi: I had the pleasure of installing a nodules app, I guess that builds on npm? [18:14] isaacs: unomi: nope. nodules and npm are unrelated except that they both use the package.json file [18:14] rubydiamond: bradleymeck: you say " if a function is going to handle an async operation it is called a callback" ... do you mean function itself gets called as callback OR it support callbacks [18:14] bradleymeck: rubydiamond it gets called when the operation is done, which since it is async will be after the current code is done executing [18:14] seangrove has joined the channel [18:14] bradleymeck: the function itself [18:14] unomi: alright [18:14] stride: is nodules still maintained? [18:14] bartt: Indeed isaacs. Thanks for pointing to a github feature I wasn't aware of. [18:14] pablort has joined the channel [18:15] bradleymeck: rubydiamond, callback is a pattern not anything different code/data structure wise [18:15] bradleymeck: callbacks are* [18:15] unomi: I would imagine so, atleast it worked fine for 2.3 + the persevere demo [18:15] unomi: re nodules [18:15] Anti-X: i read perverse [18:16] Twelve-60 has joined the channel [18:16] bradleymeck: so for example, i could reuse a function for both sync purposes and as a callback, it wouldnt change it in any way [18:16] dgathright has joined the channel [18:16] indexzero has joined the channel [18:16] indexzero: sup [18:16] bradleymeck: the sky [18:16] pablort: The 'sys' module is now called 'util'. It should have a similar interface [18:16] pablort: can I disable that message ? [18:17] isaacs: pablort: yeah, do require("util") instead of require("sys") [18:17] rcy has joined the channel [18:17] rubydiamond: bradleymeck: fs.readFile(something) .. where is callback in it ? [18:17] pablort: isaacs: I do, but the modules I depend on probably don't [18:17] bradleymeck: rubydiamond what is something? [18:18] rubydiamond: bradleymeck: it's a argument passed can be data. [18:18] rubydiamond: like filename [18:18] stride: hm, the list is really a bit trollish today :) [18:18] rubydiamond: I see no callbacks there in fs.readFile(something) [18:18] bradleymeck: ok... in javascript types what is it [18:18] stride: also +1 for a david-hasselhoff module :> [18:18] rubydiamond: bradleymeck: say string.. [18:19] bradleymeck: you cant *see* callbacks, you can see functions a passed as arguments though [18:19] bradleymeck: then there is none [18:19] rubydiamond: hmm okay.. [18:19] c4milo has left the channel [18:19] jacobolu_ has joined the channel [18:19] rubydiamond: so if I write fs.readFile(function(req, resp) { //do awesome } ) . [18:19] bradleymeck: you would just open up the file named by the string something contains, never have a callback handle it [18:19] unomi: who is trolling? [18:20] rubydiamond: function is anonymous callback there.. [18:20] bradleymeck: yes, but dont forget the file name (i forgot to add it in my first example) [18:21] rubydiamond: bradleymeck: do you mean like this fs.readFile("abc.txt", function(req, resp) { //do awesome } ) [18:21] rubydiamond: where abc.txt is filename [18:21] yumike has joined the channel [18:21] bradleymeck: yes [18:21] vandenoever has left the channel [18:21] stride: unomi: nobody, just weird threads. naming conventions, semicolons and unicorns [18:21] bradleymeck: but even then the req,resp isnt exactly what is being returned [18:21] rubydiamond: one file is read .. it's output is passed as 'req' to other function. [18:21] bradleymeck: there is no request/response [18:21] rubydiamond: bradleymeck: what is resp then ? [18:22] bradleymeck: the first argument to the callback is the error if it occured, the second is the data to the file [18:22] rubydiamond: bradleymeck: consider them as function(a, b) [18:22] bradleymeck: those are documented in the api [18:22] rubydiamond: what are a and b then ? [18:22] rubydiamond: so b is data there.. [18:22] rubydiamond: suppose I write puts b for //do awesome above.. [18:22] bradleymeck: yes, but callbacks can have different signatures, be sure to check the api references [18:22] rubydiamond: it would just print b data right ? [18:23] rubydiamond: bradleymeck: oh I thought callback signature is always the same [18:23] bradleymeck: yes. as long as no error occured [18:23] bradleymeck: nope [18:23] bradleymeck: there is convention that the first argument is if an error occured [18:24] rubydiamond: bradleymeck: but that is not there in plain javascript.. [18:24] bradleymeck: yes it is [18:24] rubydiamond: that's why confusion gets increased :) [18:24] rubydiamond: hmm [18:24] bradleymeck: the convention is not [18:24] bradleymeck: but javascript is very loose [18:25] ngw has joined the channel [18:26] cagdas has joined the channel [18:26] rubydiamond: let me write the sample code for above mentioned example [18:26] bradleymeck: its in the nodejs.org/api.html [18:26] stride: for readFile? there's full code in the api and on http://howtonode.org/control-flow-part-ii [18:27] rubydiamond: bradleymeck: okay [18:27] BBBB has joined the channel [18:27] rubydiamond: stride: will check that out too .. thx [18:29] bartt: isaacs: how do I specify a github tarball in package.json? [18:29] isaacs: bartt: ahh, you want to *depend* on a tarball. [18:29] isaacs: that's a whole different story. [18:29] isaacs: and not yet resolved. [18:30] stagas: for anyone interested nettuts is giving away a free ebook: getting good with git http://marketplace.tutsplus.com/item/getting-good-with-git/128738 [18:30] bartt: IC. Yeah that would be hot [18:30] davidascher has joined the channel [18:30] bartt: There are some modules that have not yet released a new version to npm's registry. [18:30] bartt: E.g. connect-redis. [18:31] bartt: Correction, connect-auth [18:31] isaacs: bartt: you can depend on them even if they're not in the registry [18:31] benburkert has joined the channel [18:31] isaacs: er, you can depend on the new version [18:31] rubydiamond: bradleymeck: I still don't get this code http://pastie.org/1253420 [18:31] stride: god. graceful termination and prepared statements is a bitch.. [18:31] bartt: which is at version 0.2.0 on github, but the last version in the registry is 0.1.2 [18:31] rubydiamond: bradleymeck: that code will wait .. till /etc/passwd gets read [18:31] rubydiamond: and only print when data is fully read by the system [18:31] stride: and this being the wrong irssi as well.. [18:31] rubydiamond: so how is it async [18:32] bradleymeck: put a puts right after the readFile [18:32] rubydiamond: okay trying.. [18:33] bartt: I'm working on connect middleware to accept a reverse proxy and set the client's remote address to the x-real-ip or x-forwarded-for header. [18:34] bartt: I'd also would like to set req.client.secure (= req.connection.secure = res.connection.secure) when the reverse proxy has received a HTTPS request. [18:34] bartt: The logic for this is simple. But it appears that changing req.client.secure in middleware leads to the following error: [18:34] rubydiamond: bradleymeck: yeah.. puts prints first and then data gets printed.. [18:34] rubydiamond: but that's normal control flow [18:34] bartt: net:991 [18:34] bartt: this.secureStream.close(); [18:34] bartt: ^ [18:34] bartt: TypeError: Cannot call method 'close' of undefined [18:35] rubydiamond: as we have added puts first [18:35] rubydiamond: and then printed data [18:35] zomgbie has joined the channel [18:35] bartt: What am I doing wrong? [18:35] stride: bartt: that SSL stuff is currently broken iirc [18:35] rubydiamond: bradleymeck: if I put 'puts' after console.data it prints it after data [18:36] matjas has joined the channel [18:36] rubydiamond: bradleymeck: see this http://pastie.org/1253420 [18:36] stride: rubydiamond: console.log("start"; require('fs').readFile(function(err, data) { console.log("all data read"); console.log('end'); [18:37] stride: meh.. console.log("start"); of course [18:37] rubydiamond: stride: what is wrong in my code http://pastie.org/1253420 [18:37] stride: rubydiamond: that your sys.puts is within the callback (that is invoked when all data is read). just put it in line 8 [18:38] stride: (after every other code) [18:39] rubydiamond: yea updated [18:39] rubydiamond: http://pastie.org/1253420 [18:39] rubydiamond: btw what is callback and what is not in my pastie [18:39] rubydiamond: bradleymeck: there? [18:39] Anti-X: function(.. is the callback [18:40] rubydiamond: Anti-X: okay.. [18:40] Anti-X: it gets saved and then called when the fs.readFile is ready with the data [18:40] bradleymeck: mmm [18:40] rubydiamond: now I have a question.. how to make function(.. a non callback.. [18:40] bradleymeck: dont use it like one [18:40] stride: you just don't [18:40] Anti-X: passing a function to a function always makes it a callback [18:40] stride: there's a readFileSync if you really want that [18:40] Anti-X: by definition [18:40] cloudhead has joined the channel [18:41] bradleymeck: but sync operations are going to end up blocking the rest of the program til it is done [18:41] stride: Anti-X: technically it could just add something to the function or whatever, which wouldn't make it a callback :) [18:41] Anti-X: even if that callback doesn't necessarily have anything to do with the continued program flow.. it could be a mapping callback.. applied to each element of an array [18:41] Anti-X: but still a callback [18:42] Anti-X: it's a callback because you define in your current context how that other context should react in a certain situation [18:42] stride: ACTION is tempted to write a david-hasselhoff module that randomly outputs "Unicorn!" to every open stream [18:43] rubydiamond: Now a interesting question here .. see this http://pastie.org/1253420 [18:43] bradleymeck: what about it [18:43] rubydiamond: now suppose browser makes a request for an html page.. [18:44] rubydiamond: and it takes time to read an html page.. but it's able to read image before it reads index.html [18:44] jfd1 has joined the channel [18:44] Anti-X: http://pastie.org/1253460 [18:44] rubydiamond: will browser print image first [18:45] bradleymeck: if you are just spewing both down the same stream, yes [18:45] Anti-X: why don't you try it [18:45] bradleymeck: generally images and html will be in separate requests though [18:45] Anti-X: and see how it works [18:45] Anti-X: it's easier to understand then [18:46] rubydiamond: bradleymeck: yeah.. but in this case browser will stream image [18:46] rubydiamond: and then it will return the html page.. [18:46] lechuga has joined the channel [18:46] rubydiamond: and that would be whole interesting viewing experience.. :D [18:46] Anti-X: no [18:46] Anti-X: you would just get binary data along with text [18:46] Anti-X: or a fecked up image depending on the type [18:46] rsms has joined the channel [18:46] mikeal1 has joined the channel [18:47] ollie has joined the channel [18:47] Anti-X: with jpeg, png and gif you'd get a red X on the image (in IE), because it wasn't recognized [18:47] nerdEd has joined the channel [18:47] bradleymeck: indeed the browser wouldnt know what to do since it would only request the page or the image, sending both would confuse [18:47] eazyigz has joined the channel [18:47] deepthawtz has joined the channel [18:48] bartt: stride: that's why I'm offloading SSL connections to nginx. I'd like this to be transparent to node. [18:48] lechuga: its possible to resize an image with nodejs? [18:48] eazyigz: if I want to return an html document from node, what kind of content-type should my response write? Is it text/html? [18:49] sprout has joined the channel [18:49] bartt: To node to see a proxied SSL request as secure, but not change the scheme. [18:49] Anti-X: text/html yes [18:49] MikhX has joined the channel [18:49] sprout1 has joined the channel [18:49] rubydiamond: bradleymeck, Anti-X .. see this pastie http://pastie.org/1253470 [18:49] rubydiamond: where A is dependent on B.. [18:49] Anti-X: can't do that [18:50] Anti-X: put the last two lines inside the callback [18:50] sprout has joined the channel [18:50] rubydiamond: but as B needs more time to get evaluated as it might involve a heavy IO.. [18:50] Anti-X: so? [18:50] rubydiamond: how can A gets printed.. [18:50] rubydiamond: looks like this is invalid code.. [18:50] aconbere has joined the channel [18:50] rubydiamond: Anti-X: right ? [18:50] rubydiamond: bradleymeck: thoughts? [18:51] mwilliams_ has joined the channel [18:51] Anti-X: well if do_process is async, then sys.puts(A) should be in a callback to that [18:51] bradleymeck: put it in the callback [18:51] Anti-X: also, you really need to google stuff [18:51] Anti-X: this is getting rediculous [18:52] Anti-X: ;) [18:52] rubydiamond: :) [18:52] stephank: What to use for config files in node.js? I wanted to use YAML, but have yet to find a good implementation. (js-yaml fails at simple things.) JSON doesn't support comments. Any ideas/experiences? [18:52] rubydiamond: thanks guys.. [18:52] rubydiamond: it was a fruitful discussion for me [18:52] Anti-X: stephank: ini [18:53] rsms: stephank: javascript? [18:53] Anti-X: or that [18:53] rubydiamond: bradleymeck: thanks very much [18:53] Anti-X: you could just eval the json [18:53] rubydiamond: Anti-X: thanks you too [18:53] Anti-X: since you write it [18:53] rsms: config = require('/etc/myapp/myapp.js') [18:53] tjholowaychuk: stephank: sommmme day I will rewrite that :) [18:53] rsms: stephank: ^ [18:53] tjholowaychuk: well, finish that [18:54] stephank: tjholowaychuk: It'd be very useful, I think. [18:54] stephank: Anti-X: is there an ini-parser? [18:54] faust45 has joined the channel [18:54] Anti-X: yup [18:54] tjholowaychuk: stephank: i like yaml, but i havent even remotely needed it yet, json is the obvious choice for most [18:55] stephank: rsms: Well, I find JS rather unfriendly for any non-developer. That's my target audience here. [18:55] margle has joined the channel [18:55] stephank: Anti-X: oh, found it [18:56] Throlkim has joined the channel [18:56] Anti-X: i'm currently writing an ini parser that also supports name.sub.sub2...=value so you can have nested data.. but that's really rare, so just use shockie's parser [18:56] Anti-X: and mine will also support a load of other weird ini things [18:57] Anti-X: but it's on hold until i can be arsed touching it again [18:57] pablort: tjholowaychuk: is there any open source project using express ? I was looking for more examples than the ones in examples directory. :) [18:57] rubydiamond: hmm "Node originally had promises instead of callbacks." [18:57] stephank: I'm very tempted at the moment to just figure out if I can quickly port a yaml parser. [18:57] rubydiamond: that is interesting.. promises ... [18:57] cce: stephank: it'd be hard [18:57] stephank: ini, json, they're a bit icky IMHO :) [18:57] rcy has joined the channel [18:58] cce: stephank: (a few other node.js people have come over to #yaml to discuss about a month ago. [18:58] tjholowaychuk: pablort: there are some older ones like the hummingbird stats thing, im sure there are others I know mostly of nodeko/startup apps tho [18:58] pablort: tjholowaychuk: thanks! :) [18:58] stephank: cce: oh :S [18:59] unomi: pablort: Jim Bastard / marak was requesting some recently on the ML, looks like he is collecting a few for a showcase [18:59] unomi: pablort: might want to ask him in that thread what he found so far [18:59] pablort: unomi: thanks for the tip! :D [18:59] eddanger has joined the channel [19:00] cce: stephank: it's just pretty difficult, I think if a port of pyyaml were done, it wouldn't be horrible. But, it's a good 2-3 week project for a high-level developer. [19:01] tjholowaychuk: 2-3 weeks for a yaml implementation? [19:01] eddanger has joined the channel [19:01] tjholowaychuk: 2-3 days [19:01] MikhX has joined the channel [19:02] tjholowaychuk: in js at least [19:02] unomi: stephank: json is unfriendly? [19:02] pquerna: 2-3 minutes [19:02] pquerna: json is kinda unfriendly. [19:02] pquerna: the error messages on failure to parse suck [19:02] rsms: stephank: tjholowaychuk: threw together a few samples: http://gist.github.com/649715 [19:02] unomi: well, if you are thinking about yaml, you might as well think about skulptr running pyaml in node :p [19:02] ezmobius has joined the channel [19:03] tjholowaychuk: rsms: not gonna lie, I like the ini [19:03] tjholowaychuk: and the yaml the most i think [19:03] tjholowaychuk: plain js is handy though for config I find [19:03] tjholowaychuk: i just use a module [19:03] unomi: http://www.skulpt.org/ [19:04] eddanger has joined the channel [19:04] BryanWB has joined the channel [19:05] stagas has joined the channel [19:05] unomi: and for the conf.json you don't really need to do "key": value [19:05] unomi: because it isn't parsed as a string if you require it [19:06] hoodow has joined the channel [19:06] sonnym: pquerna: it's a PITA, but when I get JSON parse errors, I try them at http://www.jsonlint.com/ [19:06] rsms: tjholowaychuk: me too. but i'm using .js in my projects because it's dead simple and the machinery is already there. I added this example, where one can use the Script API with a dedicated context in node, eliminating the need for exports: http://gist.github.com/649715#file_conf_nodescriptctx.js [19:06] sonnym: pquerna: much better at giving useful parse errors imo [19:06] tjholowaychuk: rsms: ah nice :) [19:07] svnlto has joined the channel [19:07] tjholowaychuk: the ini highlighting on github is really messed [19:07] unomi: the conf.json could look like the conf.js except instead of exports. exports. you do exports.config={\n database:{\n port:1234 .. etc [19:07] unomi: which would make it cleaner [19:08] stride: heh? an ini with ":" as the delimiter [19:08] stride: that's not the one microsoft way(tm)! :) [19:08] rsms: unomi: no. json is a very strict format (which is a good thing, because it's a language spoken by computers). [19:10] unomi: rsms: what you are thinking about is the format you need to be able to hydrate it from a 'string' [19:10] unomi: it is unlikely that you would choose to read it in as a string when you could just hydrate it directly. [19:10] stagas has joined the channel [19:11] pquerna: sonnym: yes, same, but thats one reason using json for config files sucks [19:11] jchris has joined the channel [19:11] easternbloc has joined the channel [19:11] unomi: rsms: if you merge the conf.js with the conf.json without the "key": value part you get a fairly clean construct [19:11] jakehow has joined the channel [19:12] eazyigz: I am trying to send an html document to an iframe using nodejs. The response is valid html (on console), but does not get displayed in a webpage. however, if I just send back a string, then it gets displayed. what gives? [19:13] unomi: rsms: http://pastebin.ca/1974929 [19:14] pengwynn has joined the channel [19:16] isaacs: bartt: yeah, i'd put a dependency on 0.2.0 in your package.json, and then bug the author to publish it [19:16] bartt: Will do isaacs [19:16] unomi: rsms: does that look right? [19:17] isaacs: bartt: as long as you've already installed the tarball (or have it in the same install command), it'll work [19:17] jacoblyles has joined the channel [19:17] technoweenie has joined the channel [19:17] isaacs: oh, wait, no, cyclic installs won't work that way because i didn't yet do that thing i'm thinking about doing... [19:17] isaacs: cyclic deps will fail :( [19:17] isaacs: but, that's rare anyway [19:19] ph^ has joined the channel [19:19] MikhX has joined the channel [19:19] jacoblyles has joined the channel [19:20] aho has joined the channel [19:20] eddanger: Hi, I'm new to Node.js. So far it is great. I am playing around with Express and Mongoose (MongoDB library) and Socket.IO. I have my project split into several files. It is correct to include this line in each file I need access to my db model: var Secret = require('./models/secret'); Or is there a way I can include it in the main server.js file? [19:22] EyePulp has joined the channel [19:25] eazyigz: has anybody displayed html documents in an iframe, using node? [19:26] benburkert has joined the channel [19:26] masahiroh has joined the channel [19:27] perturbedpanda has joined the channel [19:27] technoweenie has joined the channel [19:28] jamund has joined the channel [19:28] bradleymeck: eazyigz, how is that different than serving normal stuff? [19:29] perturbedpanda has left the channel [19:30] sebastiandeutsch has left the channel [19:31] rsms: unomi: it's not json, it's javascript. Have a look at json.org and try node -e "JSON.parse('{key: 123}')" --> SyntaxError: Unexpected token ILLEGAL [19:32] rsms: unomi: (I'm away, bbl) [19:32] masahiroh has joined the channel [19:32] indexzero: hey, has anyone worked with SSL and .setSecure()? [19:32] indexzero: I've been following the dev list but unfortunately I'm going to have to take a pass at it with the current implementation [19:33] indexzero: ACTION found this but I'm not sure if it will work http://www.silassewell.com/blog/2010/06/03/node-js-https-ssl-server-example/ [19:33] unomi: rsms: I realize it is not a json string :) [19:33] eazyigz: bradleymeck: all I know is that my iframe is not displaying my html doc, but does display regular text [19:33] unomi: thats why it doesn't start with config ='.. [19:33] Kami_: indexzero, yes, ssl support is currently in pretty bad shape, but ppl in working on making it better [19:34] indexzero: Kami_: yeah, I've been following those discussions. I'm trying to see what I can do with the current implemenation [19:34] indexzero: have a big release coming up that needs SSL [19:34] isaacs: pquerna: what's the status of ssl? i see that you've been doing a bunch of stuff. [19:35] indexzero: Kami_: won't be able to wait for 0.3.x SSL fixes to land, any thoughts? [19:35] isaacs: pquerna: i take it we're gonna have some kind of party or something? (/cc ryah_) [19:35] isaacs: ryah_: ^^ re ssl [19:36] pquerna: isaacs: in master, securepair is mostly there. There are some things to cleanup on end state / error propogation, but its not stalling. [19:36] isaacs: pquerna: <3 [19:36] indexzero: pquerna: you are my hero [19:36] jacoblyles has joined the channel [19:36] pquerna: isaacs: there is an http-client and server revamp that me+tim_smart have been hacking down, to make http use streams [19:36] pquerna: (it has a few fixes to securepair in it) [19:36] isaacs: kewl [19:36] pquerna: that isn't quite ready to land [19:36] isaacs: does the api change much? it's already pretty streamy. [19:36] isaacs: or is it just internals? [19:36] pquerna: no [19:36] pquerna: internals only [19:36] isaacs: awesome. awesome to the max. [19:37] pquerna: i'd guess maybe ready to land / review on friday [19:37] pquerna: (not doing node today, company fedex day thing) [19:38] indexzero: pquerna: Friday? You just made my day [19:38] pquerna: http://github.com/pquerna/node/compare/http-streams [19:38] pquerna: is the current branch [19:38] isaacs: pquerna: i'm afraid to get too excited. [19:38] indexzero: ditto [19:38] paulr has joined the channel [19:38] isaacs: because i might get TOO excited. [19:38] isaacs: and like, make a mess or something. [19:38] indexzero: I'm so used to using curl for SSL, lol [19:38] pquerna: i am not excited about node anymore, only the giants. [19:39] SamuraiJack_ has joined the channel [19:39] indexzero: pquerna: They're all I have left to root for, yanks got f*kt as did the phil's [19:39] isaacs: pquerna: oh, are those the giants that are clogging up my barts with their sportsball? [19:39] pquerna: hah [19:40] isaacs: there are giant orange-clad people carrying children EVERYWHERE. i'm wfh today just to make sure i'm not late to oakjs [19:40] isaacs: they have sticks! and flags!! [19:40] isaacs: and they smell like beer! [19:40] isaacs: indexzero: oh, just saw that you'd pinged me before, was it for some npm thing? [19:40] pquerna: oh yeah, oakjs. during the world series. [19:40] indexzero: isaacs: yeah, tiny commit to ls [19:40] pquerna: sorry :P [19:41] indexzero: isaacs: http://github.com/indexzero/npm/commit/95f756a362ae39ecf773920c80aa247b6995a87b [19:41] isaacs: pquerna: it wasn't conflicting with the world series when it was scheduled. [19:41] isaacs: pquerna: baseball is fickle and hard to predict. [19:41] pquerna: heh [19:41] indexzero: I don't know if the fix to line 24 is correct, but programmatically I was seeing the callback called twice [19:41] isaacs: they don't tell you until the very END of the game who won. [19:41] indexzero: I couldn't find good documentation on .flush() [19:41] isaacs: so you can't plan on where the sportsball is gonna wreck your plans. [19:42] isaacs: indexzero: L16 is right. i'm not sure about 24. [19:43] indexzero: isaacs: me either, but I was seeing my callback called twice in my tests using npm programmatically [19:45] saschagehlich has joined the channel [19:46] Fullmoon has joined the channel [19:46] isaacs: hm, i'm definitely not seeing that.. [19:46] saschagehlich: hey, is there a good slugify utility / module for node? [19:47] programble has joined the channel [19:47] JohnDav: rauchg_: got the assertion again [19:48] rauchg_: JohnDav: geez [19:48] rauchg_: with [19:48] rauchg_: latest master ? [19:48] JohnDav: yep [19:48] JohnDav: rauchg_: the latest changes setTimeout(100000... [19:48] JohnDav: in websocket.js [19:48] rauchg_: i see [19:49] isaacs: indexzero: i can't seem to get it to *not* return true on the flush ::) [19:49] rauchg_: ok will continue to debug [19:49] rauchg_: i didn't get it anymore [19:49] rauchg_: in my test [19:49] rauchg_: s [19:49] JohnDav: worked pretty stable for the last 6 - 7 hours with high traffic [19:49] indexzero: isaacs: How many packages are you listing? because it only writes installed [19:49] tmpvar: isaacs, it appears as though npm link requires ssl, why is this? [19:49] allengeorge has joined the channel [19:49] muhqu_ has joined the channel [19:50] JohnDav: im not sure if this helps [19:50] JohnDav: but it may have something to do with process ticks [19:50] isaacs: tmpvar: because it needs to use the crypto lib to generate a sha of the folder being linked [19:50] JohnDav: sometimes it crashes with that error just in a few minutes... sometimes it keeps working for hours [19:50] indexzero: ACTION will brb [19:50] isaacs: tmpvar: and i cba to include a sha lib in npm ;) [19:50] margle has joined the channel [19:51] isaacs: ah, piping it to /dev/null works.. [19:51] tmpvar: isaacs, got ya [19:52] rubyphunk has joined the channel [19:52] jacoblyles_ has joined the channel [19:53] jacoblyles_ has joined the channel [19:54] isaacs: ircretary: tell indexzero http://gist.github.com/649821 [19:54] ircretary: isaacs: I'll be sure to tell indexzero [19:54] saschagehlich: v8> String.implement({}); [19:54] v8bot: saschagehlich: TypeError: Object function String() { [native code] } has no method 'implement' [19:54] saschagehlich: :( [19:55] isaacs: js> String.implement({}); [19:55] gbot2: isaacs: Error: TypeError: String.implement is not a function [19:55] saschagehlich: trying to do this here in node: http://github.com/stipsan/String.Slugify.js/blob/master/Source/String.Slugify.js [19:56] saschagehlich: looks like it needs jquery? [19:56] alxc11 has joined the channel [19:56] isaacs: saschagehlich: ah, looks like they're doing some kind of traits type mixin thing [19:56] delapouite has joined the channel [19:56] Utkarsh has joined the channel [19:57] saschagehlich: isaacs: any other way to do something like "my string".slugify()? [19:57] saschagehlich: well this is more a js question than a node question, right? [19:57] isaacs: saschagehlich: well, instead of doing String.implement, just put the function on String.prototype [19:57] isaacs: saschagehlich: it's ok, i answer js questions, too :) [19:57] isaacs: String.prototype.slugify = function () { do magic. the string object is `this` } [19:58] Br|ce has joined the channel [19:59] saschagehlich: okay, i'll try it... one second ;) [19:59] benburkert has joined the channel [19:59] tjholowaychuk: saschagehlich: Object.defineProperty(String.prototype, 'slug', { get: function(){ return 'whatever'; } }) [19:59] tjholowaychuk: 'asdfasdfasdfafaf3 sdfaf klasdf safd'.slug [20:00] indexzero has joined the channel [20:00] aubergine has joined the channel [20:00] saschagehlich: where is the difference between these two solutions? [20:01] tjholowaychuk: saschagehlich: one you would 'asdf'.slugify() and the other you 'asdf'.slug [20:01] tjholowaychuk: one is a getter [20:01] saschagehlich: tjholowaychuk: ah i see, thank you [20:03] unomi has joined the channel [20:03] ctp has joined the channel [20:06] c4milo has joined the channel [20:06] masahiroh has joined the channel [20:06] tjholowaychuk: wow. node 0.2.4 completely fails for me when PUTing a gzipped file to s3 [20:06] tjholowaychuk: I reverted to 0.2.3 and its fine [20:06] devinus_ has joined the channel [20:06] sprout has joined the channel [20:07] terite has joined the channel [20:07] devinus has joined the channel [20:07] devinus_: make bench stalls for me after 15000 requests on snow leopard :( [20:07] ossareh has joined the channel [20:08] terite: Any ideas on how I would go about generating a RSA key in node.js? Nothing jumps out at me in the Crypto api [20:08] devinus has joined the channel [20:09] gorakhargosh has joined the channel [20:11] EyePulp: terite: I think you'd generate the key via openssl [20:12] EyePulp: and then point to the key file from crypto [20:12] terite: EyePulp: as in call openssl through shell or something [20:13] EyePulp: terite - maybe I'm misunderstanding - what are you trying to do? [20:14] terite: I need to generate a key, send the modulus and public exponent to a client, and decrypt the messages they send back to me [20:14] tjholowaychuk: ryah_: for --eval, would you be fine with "node --eval 'str'" wrapped with console.log() and "node --eval 'str' mod.js" without? [20:14] jesusabdullah: isaacs: HP & the Methods of Rationality is my favorite Harry Potter novel so far XD This is amazing! [20:14] tjholowaychuk: I can see how its kinda handy to wrap with log for the first case [20:14] isaacs: jesusabdullah: it's great, right!? [20:15] isaacs: jesusabdullah: i caught up with it, though. so very sad. now i have to wait for eliezer to write more [20:15] jesusabdullah: Oh, still a work in progress? Bummer [20:15] jesusabdullah: But yeah, it's fantastic [20:15] ysynopsis1 has joined the channel [20:15] EyePulp: terite: I see - I'm afraid my knowledge is only how to get SSL wrapping the traffic [20:15] isaacs: jesusabdullah: just wait, you have no idea. [20:15] isaacs: jesusabdullah: how far into it are you? [20:15] jesusabdullah: I just got to Gringotts [20:16] isaacs: oh, nice [20:16] jesusabdullah: where he comes up with the arbitrage scheme [20:16] isaacs: yep [20:16] terite: EyePulp: No big deal. I'm in the process of porting some non node javascript I've found. I was just wondering if there was a better way [20:16] isaacs: there's another good scene, either there or later, something to the effect of "wait, you just keep all your money in piles of gold underground? you don't invest or diversify AT ALL? ... how do i start a bank?" [20:16] Anti-X: url [20:18] mikeal1 has joined the channel [20:18] dysinger has joined the channel [20:19] benburkert has joined the channel [20:21] meatmanek_ has joined the channel [20:21] davidascher has joined the channel [20:22] meatmanek__ has joined the channel [20:23] Gruni has joined the channel [20:26] breccan has joined the channel [20:26] sschuermann has joined the channel [20:26] stagas: how do you join two buffers in one? [20:26] TheEmpath: "Disclaimer: J. K. Rowling owns Harry Potter, and no one owns the methods of rationality." bwahaha [20:27] cloudhead has joined the channel [20:27] Tobias|: I love how much irrelevant chitchat goes on in this channel [20:27] Tobias|: It's nice [20:27] Tobias|: :p [20:27] jesusabdullah: ahahaha, "Harry glumly considered the Dartmouth Conference on Artificial Intelligence in 1956." [20:28] sschuermann: re [20:28] sschuermann: ;) [20:29] eazyigz: I wish to return a string as a file using node-static. Is that possible? [20:29] creationix has joined the channel [20:30] creationix: isaacs: actually writing a chunky module for npm sounds like a fun little project [20:30] isaacs: creationix: that's awesome :) [20:30] isaacs: i <3 how saying "no" to putting stuff into node is actually saying "yes" to all kinds of other development [20:30] creationix: is jorge in here? [20:31] cardona507_ has joined the channel [20:31] ooooPsss has joined the channel [20:33] vandenoever has joined the channel [20:33] vandenoever: ACTION comes again with a silly question [20:33] faust45: any one know how make rounded corners with http://github.com/aheckmann/gm [20:33] faust45: ? [20:33] jfd1 has joined the channel [20:33] vandenoever: how can i determine if a variable who's name is store in e.g. varname has been defined? [20:34] creationix: vandenoever: typof var === 'undefined' [20:34] creationix: oh, it's a string [20:34] creationix: hmm [20:34] vandenoever: eval("(typeof " + varname + " === 'undefined')"); ? [20:35] creationix: vandenoever: eval + typeof [20:35] creationix: yeah [20:35] creationix: how would you access the variable if it did exist? [20:35] vandenoever: not pretty, but i guess it works [20:35] creationix: however you would access it is the same way to check if it exists [20:35] vandenoever: creationix: it's for module loading [20:35] vandenoever: suppose i have code in a file that defines class mypackage.Class [20:36] sudoer has joined the channel [20:36] vandenoever: i need to define the packages before i can load the code [20:36] vandenoever: var mypackage = {}; [20:37] tjholowaychuk: if you need eval() chances are you are going about it the wrong way [20:37] creationix: vandenoever: if we're talking about properties on an object and not free-variables [20:37] creationix: then it's much easier [20:37] creationix: mypackage.hasOwnProperty('foo') [20:37] creationix: or typeof mypackage['foo'] [20:38] creationix: (that includes properties of global/window) [20:38] vandenoever: right, it's just the top level package that needs this [20:38] tjholowaychuk: global.topLevel [20:38] tjholowaychuk: global.topLevelPackageOfAmazingness [20:38] vandenoever: global is accessible like that? [20:38] vandenoever: wow [20:39] tjholowaychuk: in node yeah [20:39] creationix: yes and no [20:39] creationix: global in node is like window in the browser [20:39] creationix: a global variable is part of the spec [20:39] MattJ100 has joined the channel [20:39] creationix: but "var foo" in the top level doesn't create a "foo" property on global [20:39] isaacs: indexzero: ah, figured out your twice cb thing from ls [20:39] vandenoever: so any js interpreter has it? nice! [20:39] creationix: it creates a local variable "foo" in the outermost scope [20:40] indexzero: isaacs: Must've been a hiccup, can't repro it now [20:40] indexzero: it was ~3am when I was doing this [20:40] creationix: I think if you skip the var then variables get put on global/window [20:40] isaacs: indexzero: http://github.com/isaacs/npm/commit/2c463dca40dc10d0a7d78059f50d923659cbaff4 [20:40] vandenoever: so browser detection is done by e.g. if ('window' in global) { [20:41] indexzero: isaacs: Sweet [20:41] isaacs: indexzero: stdout might drain many times [20:41] isaacs: indexzero: i'd do stdout.once("drain", cb) but i don't know exactly which version that showed up in [20:41] indexzero: isaacs: So is there no way to surpress that call to stdout via an npm config? [20:41] tjholowaychuk: vandenoever: (function(){ return this; })() will return the global (in most cases...) [20:41] isaacs: indexzero: i'm adding the ability to have a logfd and outfd [20:41] indexzero: isaacs: ok [20:41] isaacs: indexzero: maybe i should just call them stdout and stderr configs... [20:42] tjholowaychuk: vandenoever: when there is no receiver, "this" in the function is the global for that context [20:42] isaacs: indexzero: anyway, that'll let you direct the output and errors wherever [20:42] vandenoever: receiver? [20:42] indexzero: isaacs: sweet, that's what I need [20:42] isaacs: npm.load({stderr:1, stdout:null}, ...) [20:42] isaacs: or pipe them to any random socket. [20:42] tjholowaychuk: vandenoever im_the_receiver.receiversMethod() [20:42] indexzero: I found a little work around for now, just reference var readInstalled = require('npm/utils/read-installed') [20:42] vandenoever: tjholowaychuk: ah, right [20:43] indexzero: isaacs: that looks good [20:43] isaacs: indexzero: yeah, if you just want to know what's installed, not what's available on the reg, then that's the best way [20:43] isaacs: indexzero: you should still npm.load() to get configs, tho [20:43] indexzero: isaacs: yeah it's wrapped in a load() callback [20:44] isaacs: does it make sense to call it "logfd"? [20:44] isaacs: and then just default to stderrFD? [20:44] Nohryb has joined the channel [20:45] indexzero: hmmm... maybe, I think you'd want either 'logfd' + 'outfd' or 'stderr' + 'stdout' [20:45] davidascher has joined the channel [20:45] indexzero: having both is confusing [20:45] indexzero: logfd would default to process.stderr [20:45] ossareh has joined the channel [20:45] isaacs: yeah [20:45] isaacs: ok [20:45] isaacs: logfd and outfd [20:45] isaacs: out is "normal" output [20:45] indexzero: that sounds good to me [20:45] indexzero: right [20:45] isaacs: which is actually quite rare [20:46] vandenoever: for (var f in global) { console.log(f); } is kind of empty [20:46] isaacs: only a few commands actually write to stdout [20:46] indexzero: isaacs: one of which happens to be ls :-D [20:46] isaacs: indexzero: exactly :) [20:46] isaacs: so... any way to know if a thing is a file or a socket? [20:46] isaacs: or does it matter? [20:47] isaacs: i'd prefer to use net.Stream for sockets, and fs.createWriteStream for files [20:47] indexzero: hmmm.... I don't know actually [20:47] vandenoever: so there is no way to get the list of local vars? [20:47] indexzero: vandenoever: sys.inspect(global)? [20:48] vandenoever: indexzero: i meant cross-interpretere [20:48] indexzero: vandenover: Ahhh ... yeah, that's tricky. Have you seen commons? http://github.com/deanlandolt/commons [20:49] V1: vandenoever: http://gist.github.com/486093 see my node global detection script [20:49] vandenoever: no, i've seen commonjs though [20:49] indexzero: vandenover: Does it offer the kind of cross-platform features you're looking for? [20:49] vandenoever: indexzero: no browsers, which is my main platform [20:49] naturalethic has joined the channel [20:50] danielrmz has joined the channel [20:50] indexzero: vandenoever: It got released the other day, maybe you can add the browser support :) [20:51] isaacs: vandenoever: there is no way in javascript to get a list of the "free vars", no [20:51] creationix: vandenoever: for some reason the properties in global are not enumerable [20:51] creationix: so for..in won't work [20:51] isaacs: vandenoever: you can list global members, but not private ones [20:51] creationix: or sys.inspect with the default settings [20:51] creationix: Object.getOwnPropertyNames will find them [20:51] vandenoever: ok, well, i'll try some eval magic then [20:51] isaacs: vandenoever: what is your use case? [20:52] vandenoever: if i get some cross-interpreter module loading to happen, i'll report [20:52] creationix: but there is no way to enumerate over local variables, no matter how "global" their scope [20:52] creationix: javascript doesn't expose the scope objects [20:52] sh1mmer has joined the channel [20:52] vandenoever: isaacs: have modules that run in browser and in cmdline and that can be loaded from other modules [20:52] nathanhammond has joined the channel [20:52] isaacs: vandenoever: ok [20:52] isaacs: so? [20:53] isaacs: what do you actually need to test for? [20:53] vandenoever: i'm now createing a 'class' Runtime that should do this [20:53] isaacs: typeof exports === "undefined"? [20:53] vandenoever: it should also work with closure compiler [20:54] vandenoever: so include dynamically but only if nothing was loaded yet [20:54] vandenoever: and each module defines one 'class' [20:54] tjholowaychuk: vandenoever: i think you are approaching the issue wrong man [20:55] tjholowaychuk: be it how the modules are defined, or how they are loaded [20:55] tjholowaychuk: you shouldnt need eval [20:55] gsmcwhirter has joined the channel [20:55] vandenoever: tjholowaychuk: well, is there a way to do node.js, rhino, browser and closure compiler ? [20:56] tjholowaychuk: well its all js... you can use any aspect of js you want to achieve modules [20:56] tjholowaychuk: some idioms are just not suited well for certain environments [20:56] gerred_ has joined the channel [20:56] vandenoever: i want modules that i can use in all these environments [20:56] Br|ce has joined the channel [20:56] nathanhammond: has anybody else hit a connection limit of 247 for websockets on top of node? [20:57] tjholowaychuk: I could even hack the typical require() to work in the browser, but I wouldnt need eval [20:57] easternbloc has joined the channel [20:57] vandenoever: tjholowaychuk: