[00:00] isaacs: SubStack: then put this in your .bashrc! ls () { $(which ls) "$@" | grep -v node_modules ; } [00:00] Guest94524: How do you find sub schemas with moongoose? For example in the BlogPost, Comments example. How do you filter all BlogPosts by Comments? [00:00] Guest94524: Comment author for instance [00:01] Me1000 has joined the channel [00:02] waw: does there exist a user relationships package for node? [00:02] waw: for creating friends lists [00:02] SubStack: why would that need a package? [00:02] Guest94524: make job easier :D [00:03] perlmonkey2: Guest94524: that's in the mongoose docs [00:03] sivy has joined the channel [00:03] SubStack: user.friends = friends [00:03] Guest94524: perlmonkey2: But mongoose docs is the smallest docs ever! [00:03] SubStack: pow done [00:04] Guest94524: perlmonkey2: can you please link me, as I cant seem to find it [00:04] SubStack: waw: I think your question has some unstated context [00:04] Guest94524: he wants to recreate fb ;) [00:04] perlmonkey2: Guest94524: http://mongoosejs.com/ or you talking about the github docs? Either way I know there is an example of using find on embedded docs. [00:04] blueadept has joined the channel [00:06] Guest94524: perlmonkey2: Thanks [00:06] Guest94524: perlmonkey2: But if u see here: http://mongoosejs.com/docs/embedded-documents.html , they only mention that you can find an embedded document by id [00:06] Guest94524: What if you want to find by title for instance? [00:06] perlmonkey2: find? [00:07] Guest94524: filter [00:07] Guest94524: scroll to the bottom: Finding an embedded document by id [00:07] liar has joined the channel [00:07] perlmonkey2: I don't really know much about mongodb or mongoose but I'm pretty sure find is an object method. [00:08] brapse has joined the channel [00:08] perlmonkey2: like findOne if you only want a single reference returned. [00:09] waw: substack a friend engine is like at least 300 lines of code [00:09] eee_c has joined the channel [00:09] perlmonkey2: MyModel.find({title: "I wish I knew more about Mongoose"}, function( error, returnedDocuments){}); [00:09] tjholowaychuk: waw: thats nothing man :p Stylus is a good 8k or so [00:10] Guest94524: ye, but that finds for title, I want to find Blog->Comments->Title [00:10] Guest94524: I wish I knew more about Mongoose too [00:10] Guest94524: Just started using today! [00:10] perlmonkey2: BlogModel.CommentsModels.find({title:"how else would this work?"}, function(..){}); [00:11] waw: yeah ok [00:11] Guest94524: hmmm ill try that! [00:11] Guest94524: a sec [00:11] waw: i just don't like reinventing the wheel, maybe should try porting a ruby gem [00:13] kriskowal has joined the channel [00:14] Guest94524: pearlmonkey2: This is my db.js file: http://www.pastie.org/1554582 [00:14] Guest94524: Show.Category.find(....) says TypeError: Cannot call method 'find' of undefined [00:16] zzak: waw: which gem? [00:16] SubStack: waw: you must mean in the context of a database then? [00:16] kuya: .9 [00:16] SubStack: that is the implicit context that I'm talking about [00:16] sram_yh: Anyone know why my nodejs webserver is returning truncated JSON? Here is the end of the ouput: ":80},\"specials\":[],\"hereNow\":{\"count\":0}}]}]}}","rss":109117 [00:17] SubStack: I hate it when algorithms are coupled with the storage backend like how rails apps invariably are [00:17] tjholowaychuk: sram_yh: on the "data" event? [00:17] tjholowaychuk: what are you doing [00:17] warz has joined the channel [00:17] sram_yh: var body = JSON.stringify(obj); [00:17] sram_yh: res.writeHead(code, { "Content-Type": "text/json" [00:17] sram_yh: , "Content-Length": body.length [00:17] sram_yh: }); [00:17] sram_yh: res.end(body); [00:18] mscdex: sram_yh: i bet your data event fires multiple times [00:19] tjholowaychuk: sram_yh: you have to frame it [00:19] mscdex: on the server [00:19] tjholowaychuk: or just buffer it all up [00:19] rwhitby has joined the channel [00:19] sram_yh: Hmmm, so I am getting a document from a mongodb, then writing that to my httpResponse object [00:20] sram_yh: How do I buffer it? [00:20] tjholowaychuk: += [00:21] pedrobelo has joined the channel [00:21] sram_yh: Ohhh, that's what you mean. [00:21] sram_yh: Hmm Okay.. [00:21] jpick has left the channel [00:22] alkavan: umm... have lots of permission errors with "forever" ... what blocks it writing to /tmp ? [00:22] sram_yh: I am doing: res.on('data', function(chunk) { [00:22] sram_yh: result += chunk; [00:22] sram_yh: }); [00:23] tjholowaychuk: sram_yh: do res.setEncoding('utf8') [00:23] tjholowaychuk: so each chunk will be a string [00:23] tjholowaychuk: or if you have var result = ''; it should be ok [00:25] Guest94524: :/ [00:25] Guest94524: help [00:26] sram_yh: tjholowaychuk: thanks. Could't get it quite yet, i'll keep trying [00:27] devrim: hey guys how do i res.send all the params received to the browser ? res.send(req.params()) doesnt work [00:27] devrim: puts an empty array [00:28] tjholowaychuk: devrim: req.params [00:28] tjholowaychuk: req.param() [00:28] tjholowaychuk: is the method [00:28] tjholowaychuk: kinda like php's $_REQUEST or whatever it is [00:28] tjholowaychuk: and you have req.{params,body,query} properties [00:28] tjholowaychuk: so the path segments, request body, and querystring [00:28] devrim: sorry i typed it wrong [00:29] devrim: res.send(req.params) is putting an ampty array [00:29] tjholowaychuk: res.send(req.params) [00:29] jimt has joined the channel [00:29] tjholowaychuk: it might not work since its an array [00:29] tjholowaychuk: JSON might not serialize the properties [00:29] tjholowaychuk: not sure [00:29] tjholowaychuk: no it does not [00:29] devrim: http://d.pr/2S8V [00:29] tjholowaychuk: JSON.stringify() does not serialize the props [00:29] tjholowaychuk: on an array [00:30] sram_yh: What is the alternative? [00:30] tjholowaychuk: {} [00:30] Guest94524: k im out, will bbl [00:30] Guest94524: :D [00:31] devrim: thx tjholowaychuk : i'm able to console.log it [00:31] devrim: i thought res.send would do it [00:31] tjholowaychuk: devrim: yeah because console.log() behaves differently [00:31] devrim: i guess not [00:31] aurynn: So, how badly will upgrading to 0.4.0 break my code? :) [00:31] tanepiper: aurynn: have yo been using 0.3 ? [00:31] aurynn: no [00:31] aurynn: tanepiper, I've been on 0.2 [00:32] tanepiper: probably won't break terribly if you've been using documented API stuff, and http is backwards compatible [00:32] jpstrikesback has left the channel [00:32] jpstrikesback has joined the channel [00:32] unomi has joined the channel [00:32] tanepiper: it'll break less than you think, probably [00:33] devrim: tjholowaychuk: one question though, if i res.send(anArrayOfMine) [00:33] devrim: it does show it as json [00:33] devrim: why would that be? [00:33] tanepiper: aurynn: best install something like nave/n [00:33] tjholowaychuk: because its an array [00:33] tjholowaychuk: lol [00:33] devrim: :) [00:33] tanepiper: then do n v0.4.0 [00:33] tjholowaychuk: [1,2,3] is fine [00:33] devrim: req.params is not ? [00:34] tjholowaychuk: [].foo = 'bar' [00:34] tjholowaychuk: is not [00:34] devrim: oh [00:34] aurynn: nave/n ? [00:34] devrim: right [00:34] tanepiper: then if it does break, you can do n v0.2.6 to go back [00:34] tanepiper: https://github.com/visionmedia/n [00:34] aurynn: tanepiper, I maintain postgres-js, so I have to upgrade and fix bugs :) [00:34] zachsmith has joined the channel [00:35] tapwater: running node with sudo causes it to not find modules installed with npm. What could be the problem? [00:35] mikeal has joined the channel [00:35] postwait: So... figured out the problems with crypto in nodev4 [00:35] postwait: it used to be that you had to crypto.createCredentials your stuff before passing it into the various functions [00:35] srid has joined the channel [00:35] postwait: now it appears to do that for you. [00:35] isaacs: tapwater: probably because you'er not using a version of npm that handles sudo properly [00:36] aurynn: npm install npm! [00:36] aurynn: it's so meta [00:36] softdrink has joined the channel [00:36] isaacs: tapwater: or that you've put modules in ~/.node_modules [00:36] isaacs: tapwater: and when you run with sudo, process.env.HOME is /root [00:36] srid: is there a site that "rates" node modules? or, as least, catalogues the most popular/known modules? [00:36] losing has joined the channel [00:36] isaacs: srid: search.npmjs.org [00:36] isaacs: srid: http://search.npmjs.org [00:36] isaacs: srid: voting! coming soon! [00:36] srid: good! [00:37] srid: isaacs: how about 'most installed'? [00:37] SubStack: votes! [00:37] tapwater: isaacs: I removed ~/.node_modules a while ago. I'll try updating npm, thanks [00:37] srid: I assume by 'voting' you mean 'manually visiting the browser and then clicking the up arrow' as opposed to just running 'npm install MOD'? [00:38] sprout has joined the channel [00:38] isaacs: srid: yeah [00:38] isaacs: srid: it'll require a login [00:38] nu- has joined the channel [00:38] mike5w3c has joined the channel [00:38] isaacs: srid: (you can create a user account with npm adduser, the same one you use to publish and stuff) [00:39] tjholowaychuk: you could just have $ npm +express [00:39] tjholowaychuk: or something [00:39] tjholowaychuk: but only one vote per mod [00:39] isaacs: tjholowaychuk: a "vote" command would not be hard [00:39] isaacs: tjholowaychuk: but i don't want to require auth just to install stuff [00:39] isaacs: that's dumb [00:39] tjholowaychuk: nope [00:41] aurynn: woo, postgres-js works. [00:43] nook has joined the channel [00:43] mikedeboer has joined the channel [00:44] jamescarr has joined the channel [00:45] Solsys_ has joined the channel [00:47] postwait: ryah: you around? [00:47] dnyy has joined the channel [00:48] postwait: ryah: food for thought: the https create server API takes "options" that are the output of crypto.createCredentials [00:48] postwait: ryah: the tls.connect function takes options that are _input_ of crypto.createCredentials [00:49] postwait: very very confusing. I'd rather converge on the first behaviour as it is cheaper and similar to v0.2 [00:49] yozgrahame has joined the channel [00:53] isaacs: ugh. node_modules. [00:53] yozgrahame has joined the channel [00:53] isaacs: i mean, "ugh, git submodules" [00:53] isaacs: the node_modules part of that is awesome :) [00:53] EricL has joined the channel [00:54] lukegalea has joined the channel [00:54] inimino: isaacs ⋱ Does all this new stuff affect what we were talking about before about light-weight "plugin" packages? [00:54] isaacs: inimino: yeah, i think that plugin stuff might have to be reevaluated. [00:55] isaacs: either unnecessary, or at least different. [00:55] inimino: yeah [00:55] inimino: I'm just putting everything in one package now, but I think the reworking of directory handling has some bearing. [00:55] altamic has joined the channel [00:55] altamic has joined the channel [00:56] isaacs: inimino: did you read the thing i wrote up documenting the plan for npm's new folder structure? [00:56] inimino: I just saw the changes in 0.4 though, so I don't really know. [00:56] isaacs: inimino: https://github.com/isaacs/npm/blob/master/doc/future-ideas/new-module-system.md [00:56] inimino: isaacs ⋱ I don't think so, where was it? [00:56] isaacs: ^ [00:56] inimino: ah [00:56] tjholowaychuk: isaacs: some people want to use express 2.0.0-pre would you recommend just periodically publishing that? [00:56] tjholowaychuk: would be nice if we had an explicit --pre support [00:56] tjholowaychuk: so people dont accidentally get it [00:56] devrim: if i use app.get("/api/:operation?/:data?") what is the way to get regular query that's following the route above ? [00:56] tjholowaychuk: but people who want to play around can [00:57] isaacs: tjholowaychuk: yeah, like publish-but-don't-auto-tag [00:57] inimino: isaacs ⋱ Ah, yes I think I did see this somewhere. Looks great. [00:57] devrim: so /api/op/data/?foo=bar [00:57] isaacs: tjholowaychuk: can you post an issue? i think it's a good idea. just never got to it [00:57] tjholowaychuk: devrim: req.query [00:57] tjholowaychuk: isaacs: yeah sure [00:57] inimino: isaacs ⋱ I get the idea all the crappy ugly stuff that npm had to do might be going away soonish. [00:57] gf3 has joined the channel [00:57] isaacs: inimino: exactly, yes. [00:57] inimino: that is entirely awesome [00:57] isaacs: :D [00:58] isaacs: npm 0.3.0 will require node 0.4.0. the ugly crap is going to take a bit longer to go away, though [00:58] inimino: yeah [00:58] isaacs: also, it'll *require* sudo now to install stuff, unless you set the `unsafe-perm` flag. [00:58] isaacs: because i'm actually doing all the chown/chmod/setuid stuff [00:59] isaacs: so things run as the "nobody" user (or whatever you set as the npm "--user" config [00:59] inimino: hm [00:59] forzan has joined the channel [01:00] inimino: so it installs things in nobody-owned locations? [01:01] bingomanatee has joined the channel [01:02] inimino: or is that just for running scripts... [01:03] matyr has joined the channel [01:04] inimino: I guess it is for scripts [01:04] sprout has joined the channel [01:04] sivy has joined the channel [01:04] inimino: that sounds better than the status quo [01:09] jakehow has joined the channel [01:12] isaacs: inimino: yeah, i think so [01:12] isaacs: inimino: it's for scripts, and also unpacking tarballs. [01:12] isaacs: so, the actual working package contents are nobody-owned, so that scripts can operate on them. [01:12] lukegalea has joined the channel [01:12] isaacs: you want to be able to have a build script to actually compile a binary addon, after all [01:13] inimino: ah [01:13] isaacs: everything above and outside that folder is root-owned. [01:13] inimino: and then installed by root, ok [01:13] inimino: good [01:13] inimino: yeah, that sounds very good [01:13] isaacs: so, a package script can't, say "rm -rf ../*" [01:13] isaacs: that'll fail [01:13] inimino: yes ^_^ [01:13] inimino: that's good to prevent even if it's not intentional [01:13] isaacs: or even do stupid but well-meaning things [01:14] isaacs: ideally, i'd like to run every package as a different uid, or chown the whole folder to "nobody" and back before and after running scripts... [01:14] isaacs: . [01:14] isaacs: but the issue there is that you have packages that (reasonably, i think) write files during normal operation [01:14] isaacs: also, that's dumb and expensive. [01:14] inimino: hm [01:15] kkaefer: is there a solution for calling blocking functions from a destructor call (in C++) [01:15] kkaefer: ? [01:16] srid has joined the channel [01:17] inimino: isaacs ⋱ I have a package that writes files during operation but it has to be configured first (where to put the files) which I guess it probably rather typical. [01:18] c2uietm has joined the channel [01:18] inimino: I'm not sure what you mean about chown'ing the whole folder though. [01:20] prank has joined the channel [01:20] kkaefer: or rather, how can I execute code when the last reference to an object is lost? [01:22] aguynamedben has joined the channel [01:22] mikedeboer has joined the channel [01:23] isaacs: inimino: well, i mean recursively chowning the folder to "nobody" [01:23] isaacs: inimino: and then, post-install, chowning it back to "root" [01:23] isaacs: inimino: but that's dumb and slow. [01:23] isaacs: and breaks some things [01:24] w0rse has joined the channel [01:24] afriggeri has joined the channel [01:26] ion- has joined the channel [01:27] admc has joined the channel [01:28] jimt_ has joined the channel [01:28] tiemonster has joined the channel [01:31] brentrockwood has joined the channel [01:31] altamic has joined the channel [01:31] altamic has joined the channel [01:32] zzak has joined the channel [01:32] zzak has joined the channel [01:34] scheibo has joined the channel [01:38] kkaefer: can I override WeakCallback in a [01:38] marienz_ has joined the channel [01:38] kkaefer: in a function I subclassed from ObjectWrap? [01:39] lukegalea has joined the channel [01:40] mike5w3c_ has joined the channel [01:44] sholmes has joined the channel [01:45] sholmes: what's the best module for sending email? [01:50] altamic has joined the channel [01:50] altamic has joined the channel [01:51] nejucomo has joined the channel [01:51] streblo has joined the channel [01:53] aheckmann has joined the channel [01:53] streblo: does socket.io have any documentation? [01:53] matyr has joined the channel [01:55] zachsmith: streblo: more than just http://socket.io ? [01:56] streblo: zachsmith: yeah, i'm looking for more than just a hello world level tutorial [01:56] zachsmith: I don't think that there is any... [01:57] zachsmith: you could checkout the nodestream todo example [01:57] zachsmith: or dig through the source on github [01:57] SubStack: there isn't anything more to know [01:58] perlmonkey2: Guest94524: you ever figure out how to query embedded docs? [01:59] Vertice has joined the channel [01:59] srid has joined the channel [02:00] Wizek has joined the channel [02:00] srid has joined the channel [02:01] so_quentin has joined the channel [02:07] altamic has joined the channel [02:09] blaines has joined the channel [02:12] zachsmith has left the channel [02:15] waw: anyone has a tutorial for knox? [02:15] tmpvar has joined the channel [02:15] devrim: hi guys what enc/decryption libs you use for cookie based authentication with nodejs ? [02:16] tmpvar: Aria, hi [02:16] Aria: Heya [02:16] DTrejo has joined the channel [02:16] DTrejo: hi everyone [02:16] tmpvar: jsdom + html5 as the default parser, what are your thoughts? [02:16] Ond has joined the channel [02:17] JustJake has joined the channel [02:17] JustJake: Hello hello. Anyone listening right now? [02:18] josephhitchens has joined the channel [02:18] Aria: I'm in. [02:18] boblail has joined the channel [02:18] tmpvar: Aria, awesome, have you happen to of benchmarked vs node-htmlparser? [02:19] Aria: I've not. It's definitely slower. [02:19] JustJake: I'm just getting into Node. Do y'all recommend any resource, tutorial, or framework even for guidance [02:19] tmpvar: Aria, your's is slower? [02:19] Aria: Yeah. [02:19] tmpvar: :( [02:19] Aria: But it's also sped up with the recent v8 improvements, and it's ... good. I mean, it's a more complex parsing algorithm, and handling way more edge cases. [02:19] tmpvar: but better with crappy markup, right? [02:19] tmpvar: right [02:19] tmpvar: i need the speeeed [02:19] tmpvar: haha [02:19] Aria: Oh, yeah. It parses it all, in theory. I've some failing cases, but they're all bugs. If it throws an exception, it's a bug, full stop. [02:20] Aria: And I've not even fussed with the various DOM levels, and I KNOW that makes a difference. [02:20] jpstrikesback has joined the channel [02:21] srid: coffee-script is pretty cool. are their reasons for /not/ using it? [02:21] tmpvar: have you done an optimization pass? [02:21] Aria: I haven't. At this point, I'm still beating off odd edge cases. [02:21] techwraith has left the channel [02:21] wilmoore has joined the channel [02:22] boblail: question: I just upgraded from node 0.2.6 to 0.4.0 and I think net.createServer changed. My socket returns before I call `stream.end`. Should I be doing something differently in the latest node? [02:22] sholmes: does express.bodyDecoder handle multi-part data? [02:23] tmpvar: Aria, alright, I may hold off then [02:23] broofa has joined the channel [02:23] Aria: Okey. It's always a question of speed vs correct. I certainly can't use node-htmlparser. [02:23] tmpvar: do keep in touch though, I'd like to see where the perf ends up (the functionality seems like it there) [02:24] tmpvar: the html5-jsdom bridge is working for you ok though? [02:24] edude03 has joined the channel [02:24] Aria: Indeed. It's on the burner, and still being worked up. [02:24] sholmes: you know multipart/form-data types of post data? [02:24] BillyBreen has joined the channel [02:24] Aria: Yeah, seems good. A few more tweaks might help, but mostly its the attribute validation stuff that gets it. [02:25] JustJake: Please recommend beginner resources or excellent framework for working with a database [02:25] waw: there is no official database [02:25] JustJake: What's the best way to get going with node.js from a PHP background? [02:25] waw: i think most people uses mongodb [02:25] waw: of course i could be totally wrong [02:26] JustJake: whats the differene between MongoDB and CouchDB [02:26] waw: you should google that, there's too many to count [02:27] waw: mongodb is faster, it uses bson, it's more popular [02:27] JustJake: Ok [02:27] sholmes: Why is sys used in the Express Guide; must be an old guide? [02:27] waw: coucbdb's best feature is couchapps [02:28] waw: which is huge, if you want to use the database to authenticate [02:28] waw: this allows you to skip node.js [02:28] murz has left the channel [02:28] waw: and write your app in client side js [02:28] JustJake: Building auth is always my least favorite thing to do [02:29] tmpvar: Aria, ah yeah, that old one [02:30] perezd has joined the channel [02:31] Yuffster has joined the channel [02:31] eee_c has joined the channel [02:31] sholmes: With util.inherits(obj, superObj), why does the convenience property for obj.super_ end with a "_", and the globals _filename and _dirname begin with a "_"? Doesn't this seem a little inconsistent? [02:31] sholmes: At leasts subtly. [02:34] johnnywengluu: anyone that is using Janrain? [02:34] JustJake: Easiest way to get node apps online? Is there a Heroku-type solution? A cheap (non-vps) host with node.js runtime? [02:35] Aria: no.de [02:36] JustJake: Great, thanks! [02:37] sholmes: How was no.de registered, it would seem like that domain would have been taken before Node.js was even conceived? [02:38] jimt has joined the channel [02:38] Aria: Germany's not as lax as other places. And perhaps it was purchased from another owner. [02:39] johnnywengluu: JustJake: nodejitsu [02:39] sholmes: Aria: I just would have thought that a previous owner would have charged a lot to give it up. [02:40] JustJake: johnnywengluu & Aria: nodejitsu vs no.de ? [02:40] Aria: ACTION shrugs. I have my own server.  [02:40] waw: oh btw there was someone earlier who asked about encryption? [02:40] Aria: no.de is run by the company ryah works for, so that's a point in its favor in my book. [02:40] waw: doesn't node come with crypto? [02:40] devrim: me [02:41] devrim: yes i was just asking for a library specific to cokkie based auth [02:41] devrim: *cookie [02:41] jchris has joined the channel [02:41] devrim: like how there is nodejs->connect->express [02:41] johnnywengluu: JustJake: i dont get no.de [02:42] waw: oh ok [02:42] JustJake: johnnywengluu: what's wrong with it? [02:42] johnnywengluu: nothing .. i just dont get it [02:42] sholmes: How do I include scripts in Node? I know you can require modules, but how do I include a script to actually run it in the same scope as the module that's including it? Say I have a large file and just want to break it up into multiple files. Or, I have a file that contains code to be reused. [02:42] tykelewis has joined the channel [02:42] johnnywengluu: it says i need a cupuon [02:42] johnnywengluu: maybe its beta? [02:42] devrim: so waw: u know any? [02:42] waw: there's also duostack [02:43] Ond: Enter nodester [02:43] waw: devrim, no, sorry [02:43] DTrejo: soooo many node hosting servicesss [02:43] jchris has joined the channel [02:43] jchris has joined the channel [02:44] johnnywengluu: yeah [02:44] johnnywengluu: but no one is ready yet? [02:44] Aria: sholmes: read and eval. But don't -- break things in modules! [02:44] waw: there's not a single one of them that doesn't require an invite though [02:44] JustJake: DTrejo: suggestions? [02:44] waw: does anyone have dotcloud node.js? [02:44] Aria: sholmes: and there's the Script object. [02:44] pandark_ has joined the channel [02:44] sholmes: Aria, Script object? [02:45] zachsmith has joined the channel [02:45] johnnywengluu: waw: in 3 months from now i think its green for sign up.. node is too new =) [02:45] DTrejo: JustJake: just ask for coupons from all of them. if you want something that makes things semi easy that you pay for and get support for, I use webbynode.com, but I might be switching at some point, maybe [02:45] waw: dotcloud overpromised like heck, they invited me but it turns out they only have 5 out of 2 dozen promised langs available [02:45] Aria: Pardon. Named VM, now, sholmes. http://nodejs.org/docs/v0.4.0/api/vm.html [02:45] johnnywengluu: i dont want to manage anything .. just upload it and let them taking care of everything [02:45] JustJake: Nodejs: so young, so full of potential, so immature [02:46] johnnywengluu: also it would be great to have it integrated with Cloud9ide [02:46] johnnywengluu: pressing a button and its up and running [02:46] sholmes: is VM new inf 0.4? [02:46] sholmes: in* [02:48] perezd has joined the channel [02:48] markstory has joined the channel [02:48] boblail: given: net.createServer(function(stream) { stream.on('end', function() { console.log(stream.readyState); }); }) [02:48] boblail: in Node 0.2.6, readState is 'writeOnly' [02:48] boblail: In Node 0.4.0, readyState is 'closed' [02:49] boblail: any ideas? [02:49] dustinwhittle has joined the channel [02:49] marcello3d has joined the channel [02:50] sholmes: Aria: What's the point of VM if running code doesn't have access to local scope? [02:50] jimt has joined the channel [02:50] waw: are people here writing apps purely in node.js? [02:50] waw: or is it usually node.js plus some other language's wrapper [02:50] waw: like ruby or python [02:51] Ond: Purely in javascript, yeah [02:51] konobi: all javascript, all server-side, all the time [02:51] srid: does anyone know which tool provides javascript source annotations like http://jashkenas.github.com/coffee-script/documentation/docs/cake.html ? [02:51] konobi: well... a lot of the time anyways =0) [02:51] SubStack: javascript all the way down [02:51] DTrejo: konobi: we need a 100% js logo [02:51] Country has joined the channel [02:52] DTrejo: konobi: that looks really sexy of course [02:52] konobi: patches welcome [02:52] sholmes: DTrejo, Node.js has a logo. [02:52] marcello3d has joined the channel [02:52] JustJake: I've never used curl to register on a website before [02:53] kkaefer: srid: docco [02:53] srid: kkaefer: thx [02:53] m14t has joined the channel [02:53] waw: @JustJake you didn't hear? that's what all the cool kids do [02:53] waw: ./s [02:53] konobi: ♥ [02:54] konobi: bah! [02:54] sholmes: Why does it seem like the Node community rejects the idea of including script files to be executed in the current scope? [02:55] saikat_ has joined the channel [02:55] JustJake: waw: curl -X POST -d "say=We need IRC via HTTP" http://chat.freenode.net/rooms/node.js [02:55] zachsmith: sholmes: because that's not modular [02:55] kkaefer: sholmes: you could do that very easily with eval [02:55] kkaefer: also, you probably shouldn't do that [02:55] srid: looks like docco is broken in nodejs 0.4 [02:55] kkaefer: srid: might be, it just came out yesterday [02:56] marcello3d: sholmes: what's your usecase? [02:56] kkaefer: srid: you can use 0.2 though; it's just documentation generation after all [02:56] sholmes: zachsmith: somethings aren't modular though. [02:56] chapel: http://wastingyourlife.co/forums/on-topic/digital-design-development-3978-p2.html#post160397 << me trying to tell a friend not to learn php, and to learn js [02:56] boblail has left the channel [02:56] sholmes: marcello3d: what if I wanted to add new properties to the prototype of native objects? [02:56] srid: ACTION is running 'nvm install 0.2.6' [02:57] waw: just curious, has anyone here found a new feature in .3 or .4 that is useful? [02:57] marcello3d: can you use global? [02:57] sholmes: What if I wanted to extend the Object object. [02:57] marcello3d: like global.Object.prototype.foo = blah [02:57] SubStack: don't do that [02:57] JustJake: sholmes: why is require not suitable? [02:57] marcello3d: (I'm super new to node.js, so I'm just guessing that's possible) [02:57] sholmes: marcello3d: you mean use global.something within a module? [02:58] SubStack: don't use global! [02:58] JustJake: OH NOES [02:58] SubStack: no good reason to, and I have a pretty good imagination [02:58] sholmes: JustJake: because AFAIK you can't modify the scope that's requiring. [02:58] sholmes: SubStack: how about extending the Object obj? [02:59] SubStack: I don't think that is very wise either [02:59] marcello3d: yea, extending Object screws up for .. in [02:59] sholmes: SubStack: why not? [02:59] JustJake: what about (and this is rather horrid) Object = require('myObj'); [02:59] SubStack: what specifically are you trying to accomplish? [02:59] konobi: sholmes: why would you set yourself up to be screwed royally in the ass later? [02:59] sholmes: marcello3d: not if your for-in loops use hasOwnProperty [02:59] sholmes: konobi: ^ [02:59] SubStack: sholmes: because your updates will touch every single object ever instead of just the specific objects that you actually care about updating [02:59] marcello3d: yes, but you can't guarantee all the libs you're using use it [02:59] JustJake: SubStack: a obj.clone() function to create deepcopies would be nice [03:00] SubStack: JustJake: require('traverse').clone(obj) [03:00] marcello3d: besides, hasOwnProperty doesn't help with multiple levels of inheritance [03:00] chrischris has joined the channel [03:00] sholmes: See JustJake has an innovative idea for this use. [03:00] konobi: cloner.deepClone(obj) [03:00] marcello3d: that's not a great use for Object.prototype [03:01] marcello3d: the only useful thing I've seen put on Object.prototype is rudimentary things like forEach [03:01] sholmes: putting it in a cloner namespace works, but it's not theObj.clone [03:01] JustJake: SubStack: There are safer way to do it, yes. But it's a good use case I think. [03:01] jimt has joined the channel [03:01] konobi: your point? [03:01] SubStack: forEach on Object also seems like a bad idea [03:01] JustJake: more convinient [03:01] konobi: lol [03:01] SubStack: var Hash = require('hashify'); Hash(obj).forEach() [03:01] sholmes: the difference being syntax sugar [03:01] SubStack: incidentally I wrote those last two libs [03:02] konobi: yeah... until you have an actual code base across a bunch of files and then you find some library you've included is now screwing with your code, and vice-versa [03:02] marcello3d: what does Hash(obj) return? [03:02] Ond: Can I still require('traverse/hash') ? [03:02] SubStack: konobi: yes exactly [03:02] marcello3d: wouldn't hash.forEach(obj, ..) be more efficient? [03:02] SubStack: Ond: yeah that still works but when isaacs updates npm it will stop working [03:02] sholmes: konobi: modules shouldn't be able to modify the global scope. [03:02] sholmes: That's bad. [03:02] Ond: Ok, thanks [03:02] matyr_ has joined the channel [03:02] srid: docco is broken on 0.2.6 as well [03:03] konobi: sholmes: they can't [03:03] sholmes: I'd rather have a include() global function similar to require [03:03] konobi: but neither should you [03:03] konobi: you are a programmer... you are dumb [03:03] konobi: stop slapping yourself in the face [03:03] DTrejo has joined the channel [03:03] sholmes: konobi: then how would your libs be screwing up your scope if you'd be using modules? [03:03] SubStack: sholmes: so you don't like the /name/ of require()? [03:03] srid: docco on node 0.2.6 http://pastie.org/private/odvqc1uefo9uijbbj8bcg [03:04] SubStack: also namespace pollution sucks [03:04] konobi: sholmes: modifying Object.prototype would affect _everything_ inclusing any libraries you require [03:04] SubStack: the way node does it is the optimal way [03:04] JustJake: var include = require; [03:04] sholmes: SubStack: not what I said. I would like a include function that actually runs the file within the same scope. [03:04] aurynn: I do like node's require() [03:04] country_ has joined the channel [03:04] konobi: sholmes: you can run your own vm for that [03:04] sholmes: konobi: I thought modules had their own scope? [03:04] DTrejo: sholmes: var _.sort = require('underscore').sort [03:05] SubStack: sholmes: yeah you can do that but it's messy and hard to reason about [03:05] DTrejo: oops [03:05] konobi: sholmes: there are still _globals_ [03:05] marcello3d: what's _ ? [03:05] marcello3d: the local module scope? [03:05] sholmes: SubStack: hmm, I could build a framework that uses the VM entirely though. [03:05] Ond: Just a character [03:05] JustJake: sholmes: var include = function( path ) { eval( fs.readSync( path ) ) } [03:05] zachsmith: _ is a library [03:06] zachsmith: http://documentcloud.github.com/underscore/ [03:06] marcello3d: ah [03:06] marcello3d: right [03:06] marcello3d: is var _.sort = even legit? [03:06] sholmes: JustJake: yes, I can do that. By my question is why doesn't Node.js have this included in the framework natively? [03:06] SubStack: sholmes: having used a lot of language environments that just dump their members into the global scope, I really do prefer the node way [03:06] jimt_ has joined the channel [03:06] Ond: (he's referring to the underscore library, but the underscore character isn't distinct from any other legal character in a variable name) [03:06] SubStack: qualified imports ftw [03:07] JustJake: sholmes: because it gets ugly fast. You're much more apt to cut off your own legs with a lightsaber than a longsword. [03:07] konobi: sholmes: fail early, fail often [03:07] konobi: (ie: fail to screw yourself over) [03:07] marcello3d: I think you're distorting that quote ;) [03:08] zachsmith: agreed [03:08] sholmes: SubStack: I understand the way Node is trying to keep modularity. But one of the great things about the web environment is that you had the ability to mess with local scope; albiet abused often, but still powerful. [03:08] konobi: this isn't the web... it's the server [03:08] SubStack: great!!! [03:08] sholmes: by web environment I mean browser environment [03:08] marcello3d: sholmes: I think the conclusion is you can do it, but you shouldn't? [03:08] zachsmith: mess with local scope? [03:08] SubStack: I hate how the browser doesn't come with a nice way to separate modules out of the box [03:08] sholmes: marcello3d: yeah, I think your right. [03:09] marcello3d: you could use with (require("foo")) { ... } [03:09] SubStack: also http://github.com/substack/node-browserify [03:09] sholmes: SubStack: yeah browsers should use the CommonJS standard too. [03:09] SubStack: so you can do it the node way on the browser too [03:09] SubStack: fuck commonjs [03:09] DTrejo: we iz so common [03:09] sholmes: O.o [03:09] marcello3d: ok [03:09] marcello3d: this conversation is getting spiteful [03:09] SubStack: ACTION full of hate [03:09] marcello3d: *goes off to code* [03:09] sholmes: commonjs is what node is based on IIRC [03:09] konobi: not really [03:09] zachsmith: SubStack: does that block until the require loads? [03:09] konobi: _kinda_ [03:10] SubStack: ostensibly [03:10] Aria: sholmes: The point is to not use the local scope. The local scope shouldn't be so special. But it lets you pass in objects as the scope. [03:10] sholmes: konobi: commonjs has require in it's standard [03:10] SubStack: zachsmith: browserify bundles everything ahead of time [03:10] konobi: commonjs is kinda restarded, so node broke away [03:10] zachsmith: SubStack: nice [03:10] konobi: commonjs also stated that all require()'s should be async... which is jsut stupid on a server environment [03:11] SubStack: I should make that more clear on the readme [03:11] SubStack: since I hate the other way of doing it [03:11] shaver: everything should be async, always [03:11] JustJake: > require() [03:11] JustJake: > async [03:11] JustJake: wat [03:11] konobi: shaver: heh [03:11] sholmes: konobi: is that fact the only thing that differentiates commonjs from node? [03:11] SubStack: sholmes: nah, I like sync require() [03:11] shaver: or statically resolvable, I guess [03:11] SubStack: *shaver [03:11] shaver: simple-modules has some of that [03:11] sholmes: SubStack: I like it too. O.o [03:11] shaver: I'm going home soon [03:11] konobi: shaver: don't tell me you're a fan of require-js too! [03:11] shaver: I just wanted to throw some shit in here to see what happened [03:12] shaver: I don't know what require-js is [03:12] sholmes: SubStack: Are you okay. I think that's the 2nd time you miss understood me. :\ [03:12] konobi: http://requirejs.org/ [03:12] JustJake: node.js is listed as an implementation of CommonJS on http://commonjs.org/impl/ [03:12] Ond: sholmes, he readdressed what he said to shaver. [03:12] matyr has joined the channel [03:13] konobi: shaver... written by one of your _sort of_ colleagues [03:13] sholmes: Ond: oh. Sorry. Didn't catch that. [03:14] shaver: sort-of colleague? [03:14] shaver: oh [03:14] shaver: momo [03:14] shaver: yeah [03:18] MikhX_ has joined the channel [03:18] SubStack: I find myself wrapping libgmp for node [03:18] SubStack: now how did that happen [03:18] sh1mmer has joined the channel [03:19] konobi: SubStack: glutton for punishment? [03:19] MikhX has joined the channel [03:19] SubStack: could be [03:20] SubStack: but perhaps I can use node-ffi after all [03:22] tykelewis has joined the channel [03:24] kriskowal_ has joined the channel [03:25] deadA1ias has joined the channel [03:30] clarkfischer has joined the channel [03:31] devrim: how do i catch requester's ip address with express ? [03:34] postwait has joined the channel [03:36] ajnasz has joined the channel [03:39] srid: how do I install only the dependencies (but not the package itself) from a package.json file using npm? [03:39] waw: haml.js vs jade? [03:40] waw: oh nvm jade ofc [03:40] AAA_awright: srid: Install the listed packages? [03:41] srid: AAA_awright: manually? [03:41] AAA_awright: srid: Do you have your own install you want to use instead? [03:41] AAA_awright: I think you can override the default version used [03:42] srid: AAA_awright: not sure what you mean. essentially, I want to install the dependencies for my project (but obviously it should not link readability-service to install area) [03:43] AAA_awright: srid: I would say manage it yourself (that's what I do, package managers suck), or install the package and don't use it [03:43] SwiftLayer has joined the channel [03:44] jpstrikesback: devrim: look inside req.body [03:46] yozgrahame has joined the channel [03:46] heavysixer_ has joined the channel [03:46] rgk__ has joined the channel [03:47] devrim: jpstrikesback: req.body comes as undefined, i see it in req.connection but im guessing that express would wrap that nicely somewhere [03:48] jpstrikesback: hmm strange [03:48] devrim: req.connection.remoteAddress [03:48] devrim: has the ip [03:54] jpstrikesback: devrim: aack your totally right, pardon me [03:54] flippyhead has joined the channel [03:55] devrim: np thx for helping out [03:56] jimt has joined the channel [03:58] sprout has joined the channel [03:58] ryan[WTF] has joined the channel [03:59] jpstrikesback: devrim: haha next time I might be of help :) [03:59] sholmes: what's the future replacement in mind for require.paths? [04:00] davidc_ has joined the channel [04:00] dipser_ has joined the channel [04:04] devrim: guys anybody can give me a helping hand or a url on how to encrypt/decrypt cookies for auth? [04:04] devrim: nodejs crypto docs are cryptic [04:06] devrim: basically i want to encrypt "username" with SALT and IP address of the user, then on subsequent requests of him, that cookie will be decrypted with salt & ip if username is found he'll be auth'd [04:07] devrim: any gist/snippet/etc i'm staring at crypto docs for an hour [04:08] johnnywengluu: Does anyone know how this code will be using node HTTPS request: curl -vX POST https://rpxnow.com:443/api/v2/auth_info -d token=11111111111 -d apiKey=222222222 [04:08] johnnywengluu: what does -d mean? [04:09] zorzar has joined the channel [04:09] Jaye has joined the channel [04:10] c4milo has joined the channel [04:11] jimt has joined the channel [04:11] sholmes: what's the layout option for in res.render in express? [04:14] c4milo1 has joined the channel [04:18] jimt has joined the channel [04:19] zomgbie has joined the channel [04:21] andrewfff has joined the channel [04:21] dingomanatee has joined the channel [04:23] amerine has joined the channel [04:27] jpstrikesback: devrim: have you seen this? https://github.com/jed/cookie-node/blob/master/index.js [04:29] pandark_ has joined the channel [04:30] scoates has joined the channel [04:35] richcollins has joined the channel [04:37] devrim: tx jp looking at it now [04:39] devrim: this is exactly what im looking for [04:39] devrim: "Cookies are easily forged by malicious clients. If you need to set cookies to, e.g., save the user ID of the currently logged in user, you need to sign your cookies to prevent forgery." [04:40] kwik101 has joined the channel [04:40] devrim: just curious, how do they forge something that i encrypt, or how signing is any different? [04:40] devrim: or do they call adding a salt to your encryption algorithm "signing" [04:41] johnnywengluu: how do i check the length of a variable? [04:41] johnnywengluu: its a string [04:42] devrim: x.length [04:43] johnnywengluu: thx [04:43] devrim: np [04:45] jpstrikesback: devrim: well in this they sign it with a SHA1 and the secret is the salt right? (this is next on my todo…so I've been looking for existing libs first), I figured this might be adaptable to your strategy by adding the IP as well…maybe, I'm not quite there yet :) [04:46] devrim: i mean i just wrote my class for encrypt/decrypt just now [04:46] devrim: pretty simple, i use salt+yourIP and encrypt your username [04:47] Vertice has joined the channel [04:47] devrim: when u come back, i have the salt, if you ip is the same i have the decryption key, if i get your username back, then i trust its' u [04:47] devrim: *your [04:47] devrim: this code piece u wrote is much more complicated making me think im missing something [04:47] devrim: *u sent [04:48] jpstrikesback: ah, not mine :) [04:48] jpstrikesback: i wish [04:48] jpstrikesback: probably not, does yours work? [04:48] devrim: yep [04:48] devrim: and its 8 lines of code [04:48] nofxx has joined the channel [04:48] jpstrikesback: rock on [04:49] devrim: exactly.. moving on :) [04:49] jpstrikesback: :) [04:51] losing has joined the channel [04:53] jpstrikesback1 has joined the channel [04:57] dguttman has joined the channel [04:59] JustJake_ has joined the channel [05:01] ryanfitz has joined the channel [05:01] admc has joined the channel [05:02] skm has joined the channel [05:08] johnnywengluu: what is the difference between "process.stdout.write" and "console.log"? [05:08] softdrink has joined the channel [05:09] Aria: console.log is synchronous. [05:10] hzin has joined the channel [05:13] kkaefer: why is ObjectWrap::Wrap not defined as virtual? [05:13] kkaefer: Aria: no, it's not [05:14] kkaefer: Aria: console.warn is synchronous because it writes to stderr, which is synchronous-only atm [05:14] Aria: Ah, interesting. I was thinking it was equivalent to the old sys.debug [05:14] Aria: Ah, right. [05:14] hzin has joined the channel [05:14] kkaefer: johnnywengluu: console.log is basically just an alias to process.stdout.write [05:14] kkaefer: johnnywengluu: the only line of code in that function is: process.stdout.write(format.apply(this, arguments) + '\n'); [05:15] jchris has joined the channel [05:15] johnnywengluu: kkaefer: but when i print out a variable console.log shows a lot of unreadable charachters [05:15] johnnywengluu: while process.stdout.write shows an object [05:15] kkaefer: what version of node are you on? [05:15] razvandimescu has joined the channel [05:16] kkaefer: well actually [05:16] kkaefer: console.log does a bit more [05:16] kkaefer: because it also calls the format function [05:16] kkaefer: so it does some inspection of the object [05:16] johnnywengluu: 4.0 [05:16] johnnywengluu: 0.4.0 [05:16] johnnywengluu: kkaefer: okay [05:17] kkaefer: maybe your object's toString function returns those unreadable characters [05:17] johnnywengluu: it inspected too much in this case =) [05:17] johnnywengluu: okay [05:17] kkaefer: it's hard to say without any code [05:19] blaines_ has joined the channel [05:20] rockstar has joined the channel [05:20] rockstar has joined the channel [05:21] rockstar has left the channel [05:22] Jaye has joined the channel [05:26] kylefox has joined the channel [05:27] soquentin has joined the channel [05:27] dnolen has joined the channel [05:28] pkrumins: jsbbq! [05:30] sprout has joined the channel [05:33] gf3` has joined the channel [05:33] gf3` has joined the channel [05:34] SubStack: bbq.js [05:34] Aria: node-bbq [05:34] mikeal has joined the channel [05:34] Aikar: npm install bbq [05:35] SubStack: it's just a short walk away for me! [05:35] findchris has joined the channel [05:35] Aikar: ACTION just bought a new home theatre system. Sony HT-SS370 5.1 1000w speakers :D Finally putting my XFi Titanium in my HTPC to use [05:36] SubStack: fancy [05:36] Aikar: ACTION is now really scared hes gonna piss off neighbors and get kicked out of neighborhood lol ; ; [05:37] SubStack: I have some speakers that came with a 1993 pc sound card from creative labs [05:37] brainproxy has joined the channel [05:37] brainproxy has joined the channel [05:37] SubStack: and some headphones that are made of several headphones soldered together [05:39] JimBastard has joined the channel [05:40] squareawsome has joined the channel [05:40] throughnothing has joined the channel [05:40] blueadept has left the channel [05:41] JimBastard: SubStack: what kind of latency do you see between multiple dnode clients? assuming its all node instances [05:41] tmpvar: SubStack, hello [05:42] SubStack: ahoy [05:42] SubStack: JimBastard: it's pretty much the same as regular network sockets [05:42] SubStack: network i/o slow, cpu fast [05:43] JimBastard: cool [05:43] blueadept has joined the channel [05:43] brainproxy has joined the channel [05:46] SubStack: oh right I was writing bindings for libgmp [05:47] johnnywengluu: JimBastard: long time no c [05:47] johnnywengluu: how is it going with nodejitsu? [05:47] JimBastard: johnnywengluu: slow and steady :-D [05:48] johnnywengluu: read about the couchone integration .. what does it mean technically? [05:48] JimBastard: we'll be blasting out emails to people soon [05:48] SubStack: awesome [05:48] JimBastard: johnnywengluu: you can click click and allocate a couchdb for your app or a marketplace app [05:49] johnnywengluu: cool [05:49] SubStack: having the db baked in seems very nice [05:49] Aria: Neato! [05:49] JimBastard: and then it updates the package.json in [05:49] JimBastard: im working on a music hack for this event this weekend with tmpvar [05:50] johnnywengluu: nodejitsu (node) + couchbase (couchdb+membase) + strobe (sproutcore) is my new stack [05:50] DTrejo has joined the channel [05:50] JimBastard: making https://github.com/marak/JSONloops multi-user [05:50] JimBastard: sup DTrejo [05:50] DTrejo: hi JimBastard [05:50] DTrejo: how are you? [05:50] johnnywengluu: there are a lot of node hosting competitors now i noticed [05:50] johnnywengluu: like 6 at least [05:50] DTrejo: JimBastard: how is music hack time going? [05:51] JimBastard: johnnywengluu: there's only a couple of "real" ones [05:51] JimBastard: im not too worried, our product will be solid [05:51] SubStack: 6? you must be counting all the nodester name changes :p [05:51] Jaye: what others are there besides nodejitsu and no.de? [05:51] Aikar: http://aikar.co/dropbox/htpc/ SubStack my htpc setup :D, night time so pic quality is a lil fuzzy due to ISO shit, had every light on i could >_> [05:52] JimBastard: im only building a node paas so i can deploy apps on it [05:52] JimBastard: building the deployable apps is the fun part [05:52] JimBastard: :-D [05:53] Aikar: irc on the TV ftw >_> [05:53] SubStack: JimBastard: managing the browser-side dependencies and sandboxing in a sane way would be nice too [05:53] Aikar: (irssi) [05:54] JimBastard: DTrejo: we are just planning now for the most part. until we can play low latency audio files out of node we are dead in the water [05:54] DTrejo: ah [05:55] JimBastard: jsonloops uses play.js right now for sound playback, which requires a system exec, which is slow as crap [05:55] JimBastard: so tmpvar is working on the C bindings now [05:55] JimBastard: im working on making jsonloops multi-user, so each browser is a control interface for the looper [05:55] SubStack: hax [05:55] DTrejo: cool [05:56] DTrejo: JimBastard: I'm here at NERD with a bunch of other coders [05:56] DTrejo: working on a project you might like when it gets futher along [05:57] JimBastard: ohh yeah, you guys doing that thing this weekend [05:57] JimBastard: whats the project? [05:58] andrewfff has joined the channel [05:58] derferman has joined the channel [05:58] DTrejo: JimBastard: I'm working on something that monitors you as you code, and tells you when you're being stupid and should just go to sleep. that's the high level version of it [05:59] JimBastard: lol nice [06:01] blueadept has left the channel [06:01] mscdex: Aikar: windows?!?!! [06:01] mscdex: :O [06:03] jakehow has joined the channel [06:03] Yuffster_work has joined the channel [06:04] wilmoore has joined the channel [06:06] Jaye has joined the channel [06:07] srid has joined the channel [06:07] boogyman has joined the channel [06:10] Aikar: mscdex: on HTPC only now :P [06:10] Aikar: well and laptop cause i havent installed ubuntu on it yet [06:10] Aikar: pretty sure my cases LCD panel is going to be dead which includes the remote control if i ditch windows for htpc [06:11] Aikar: case was most expensive part of my htpc lol.. [06:12] JojoBoss has joined the channel [06:13] Aikar: plus i first tried XBMC's minimal "pure" ubuntu based install first, and it was horrible in functionlity, and had alot of bugs. windows version is rock solid. and since this pc's entire purpose is to have XBMC open 24/7... yeah ill stick with windows for it [06:14] mscdex: wind'ohs [06:14] ysynopsis has joined the channel [06:15] Aikar: desktop and work laptop are both ubuntu :P [06:15] JojoTheBoss_ has joined the channel [06:15] Aikar: and soon as i get unlazy my laptop will be too [06:15] Aikar: wiped windows off roommates netbook too [06:17] mscdex: every time someone chooses Windows, an event loop dies [06:17] tmpvar: select()! [06:17] tmpvar: its soooo fast [06:18] Aikar: well that license was free so does that count? :P [06:18] tmpvar: anyone know offhand if there is a destruct method for addons? [06:18] Aikar: only way an addon can be unloaded is process ending [06:18] Aikar: so just do process.on('exit' or w/e it is [06:19] tmpvar: but that can still leak memory. [06:19] Aikar: ? [06:19] mscdex: tmpvar: yeah [06:19] mscdex: the destructor [06:19] mscdex: :p [06:19] Aikar: if a process closes, its memory is freed [06:19] tmpvar: Aikar, negatory julio [06:19] srid: is coffeekup working for anyone on node 0.4? http://pastie.org/private/9ivoqxrqdc9yfiv8fqaow [06:19] tmpvar: mscdex, makes sense [06:20] Aikar: tmpvar: if its not sounds like a bug in the OS >_> [06:20] tmpvar: gc at the os level, i think not [06:20] Aikar: a "memory leak" is when an APPLICATION loses "track" of memory, if an OS is "losing track", then thats a bug in the OS [06:21] andrewfff has joined the channel [06:21] Aikar: otherwise kill -9 would destroy your memory [06:22] mscdex: i just checked a couple of the c++ addons i wrote, you use the destructor for the v8 class [06:22] tmpvar: mscdex, thanks [06:22] tmpvar: Aikar, char *a = malloc(2048); [06:23] tmpvar: program ends, memory remains [06:23] tmpvar: unless I'm insane [06:23] Aikar: know how when you leave firefox open for days with ajax apps running it can get to 1gb+ memory. the OS knows that the app registered that 1gb, and when it closes or you forcefully kill it. its freed by the OS. [06:23] tmpvar: thats because ff cleans up after itself when you close [06:23] Aikar: not when you FORCEFULLY kill it [06:23] dgathright has joined the channel [06:24] Aikar: and if ff knew what to cleanup, then it wouldnt be a leak [06:24] kkaefer: so in the MakeWeak callback, I remove the weakness from the objects [06:24] kkaefer: do some things with it [06:24] kkaefer: and make it weak again [06:24] kkaefer: however, it doesn't seem to gc after that [06:24] kkaefer: is there something else I have to do to make v8 consider the obj for gc? [06:24] Aria: You're insane, tmpvar. The OS keeps a map of all the pages allocated to a process, and returns them to the freelist when the process ends. [06:25] tmpvar: voice of reason, thanks :) [06:25] Aikar: its just how the OS works. if it worked how you said tmpvar that would be a horrible bug in the OS [06:25] inimino: Yes. [06:25] Aria: Or an OS that doesn't do much ;-) [06:25] Aikar: so really, when a process ends, you dont need to worry about memory. [06:25] Aikar: but you should really ensure your code doesnt mem leak anyways [06:25] Aria: Unless you use shared memory segments that aren't POSIX-style file-backed ones. [06:26] tmpvar: my ego, just got stomped on, but that is good to know [06:26] inimino: memory leaks in short-lived programs don't necessarily matter [06:26] tmpvar: its been a while :) [06:26] Aikar: well yeah forgetting to cleanup shm when you know its finished is a diff story :p [06:27] Aikar: prolly best idea to try to let V8 handle all allocations. simply expose an object from C land but 'new Obj' it in JS code, so the V8 GC will ensure no leaks [06:28] tmpvar: sure, i was concerned because there was some setup/teardown involved [06:28] tmpvar: i suppose teardown occurs in the ~constructor [06:29] tmpvar: and f-your-alloc'd memory at that point [06:29] ziro` has joined the channel [06:33] Jxck has joined the channel [06:34] tmpvar: mscdex, yo [06:34] jimt_ has joined the channel [06:35] mscdex: yo [06:35] tmpvar: im digging through some of your addons (im rusty as hell apparently) [06:36] tmpvar: i need to create a class that is referenced by a js object [06:37] flippyhead_ has joined the channel [06:37] mscdex: create? [06:37] tmpvar: ncurses seems pretty complicated, does it compile against node 0.4.0? [06:37] mscdex: i haven't tried yet, that'll be this weekend heh [06:37] tmpvar: :P [06:38] mscdex: i know i'll have to change node-imap because it has ssl capabilities [06:38] mscdex: i can't think of anything in node-ncurses though that would cause it not to work in 0.4.0 off the top of my head [06:39] tmpvar: cool [06:39] tmpvar: ill attempt to use it as a reference then [06:39] tmpvar: previous to now I've avoided linking objects into v8, its been mostly functions (ie: node-ogl_ [06:39] tmpvar: s/_/) [06:42] mscdex: oh jeez, i didn't realize how bad the code formatting was in that binding [06:42] mscdex: never looked at it through github [06:42] mscdex: yikes [06:42] tmpvar: haha, its a madhouse [06:43] mscdex: guess i switched from tabs to spaces since i started it :) [06:44] jetienne has joined the channel [06:46] tmpvar: mscdex, i miss the olden days [06:46] tmpvar: :P [06:46] ncursestest17 has joined the channel [06:47] ncursestest17: look ma! i'm already 0.4.0 compatible! [06:47] Aria: Win! [06:47] samsonjs has joined the channel [06:47] MikhX has joined the channel [06:48] tmpvar: ACTION enters the waf rabbit hole [06:48] tmpvar: ill be here until this works [06:48] tmpvar: doing a basic irrklang integration [06:49] tmpvar: so, mscdex prepare yourself ;) [06:54] andrewfff has joined the channel [06:55] Sebmaster has joined the channel [06:55] mscdex: tmpvar: heh, i'll do my best to answer any questions you have [06:57] ramseyd has joined the channel [06:58] dgathright has joined the channel [06:59] ramseyd: guys? [07:00] ramseyd: I need some help with mongoose for node.js [07:00] ramseyd: Anyone know how to query based on embedded document fields? [07:00] ramseyd: For example: Model.find({'emebedded.fieldName' : 'value'). [07:00] Sebmaster has joined the channel [07:01] void_ has joined the channel [07:02] zzak has joined the channel [07:02] zzak has joined the channel [07:03] sholmes has joined the channel [07:04] tmpvar: why in the fuck is node using waf? [07:04] tmpvar: i feel like ive asked this beforer [07:04] mscdex: it always has [07:05] mscdex: heh [07:05] mscdex: i forget ryah's reasoning [07:05] tmpvar: yeah, but every time i find myself hacking around it [07:05] mscdex: like how? [07:05] tmpvar: https://github.com/tmpvar/node-ogl/blob/master/wscript [07:06] tmpvar: took a good while (days) to get that right [07:06] Sebmaster: i think jonaslund tried to change everything to use scons to get a simplified build process... [07:07] tmpvar: we need a node build process :) [07:07] tmpvar: js based [07:07] dantalizing has joined the channel [07:07] dantalizing has joined the channel [07:07] blaines has joined the channel [07:08] Sebmaster: then we have to rewrite v8 everytime we pull a new version :/ [07:08] tmpvar: { target : "node-module", libs : [ __dirname + "/path/to/dep"], etc... [07:08] tmpvar: Sebmaster, im not sure I understand [07:08] herbySk has joined the channel [07:08] augustl: what does node do on "listen" that makes the proccess not exit, but doesn't block either? [07:08] mscdex: isn't that like a chicken and egg problem? how do you build node/v8 if the build system is in js? [07:09] mscdex: heh [07:09] amerine has joined the channel [07:09] tmpvar: you build node with automake and addons with magic (aka js) [07:09] augustl: browsing through the net C++ code now, hoping to catch it ;) [07:09] tmpvar: i guess v8 uses scons? [07:09] Sebmaster: tmpvar: The build process for v8 is written in scons [07:10] mscdex: augustl: it increases a reference counter on the event loop [07:10] mscdex: more or less [07:10] augustl: mscdex: is this something JavaScript has access to? Or does it require C++? [07:10] mscdex: you can only access the event loop directly in c++ [07:11] augustl: perhaps I can utilize process.nextTick [07:12] aurynn has joined the channel [07:13] mscdex: eh... i thought 0.4.0 was supposed to have some mechanism to allow upgrading of existing non-secure streams? [07:13] mscdex: :S [07:15] augustl: hmpf, function cb() { process.nextTick(cb); }; cb(); consumes 100% CPU [07:16] mscdex: i would think so [07:16] mscdex: it's an infinite loop [07:16] mscdex: heh [07:17] augustl: and function cb() { setTimeout(cb, 10); }; cb(); ftl [07:17] dgathright_ has joined the channel [07:17] mscdex: why are you doing this? :o [07:17] flippyhead_ has joined the channel [07:17] augustl: it's for a test runner that runs asynchronous tests [07:18] augustl: I need to keep the process open until the tests finish running (i.e. a magic function is called) [07:19] mscdex: wouldn't you have a timeout for something like that anyway [07:19] mscdex: ? [07:19] hzin has joined the channel [07:19] mscdex: in case your callbacks don't fire [07:19] augustl: ah :) [07:19] augustl: I didn't know setTimeout kept the process running, that's all I need then. [07:20] kkaefer: how can I make sure that my C++ destructors get called after the event loop finishes? [07:20] dgathright_ has joined the channel [07:20] kkaefer: or rather... [07:20] augustl: mscdex: tnx [07:20] kkaefer: how can I get a callback when the event loop ref drops to 0 so that I can increase it again? [07:21] dgathright__ has joined the channel [07:21] mscdex: kkaefer: process.on('exit', fn) ? [07:22] kkaefer: I need to execute a EIO function [07:22] mscdex: why not just have your addon increase the ref counter? [07:22] mscdex: then decrease when it's done doing whatever [07:22] kkaefer: well, when I increase the ref counter, the loop never exits [07:23] mscdex: you have to Unref() when you're ready [07:23] kkaefer: let me explain it a bit further [07:23] mscdex: :S [07:24] kkaefer: ;) [07:24] kkaefer: I have a database object that stores a handle to the database [07:24] kkaefer: when node ends, how do I run a EIO function that closes the database handle? [07:24] kkaefer: actually, it probably doesn't need to be EIO at this point [07:25] LarsSmit has joined the channel [07:25] kkaefer: I found http://create.tpsitulsa.com/blog/2009/02/20/v8-application-exit-and-destructors/ [07:25] mscdex: kkaefer: why not call it in your destructor? [07:25] kkaefer: it's blocking [07:26] kkaefer: that means that during normal gc (i.e. when node doesn't end, it blocks [07:26] kkaefer: also, when node ends the destructor isn't called [07:26] kkaefer: only when gc kicks in [07:27] kkaefer: but v8/node doesn't gc when the event loop ends [07:28] w0rse has joined the channel [07:28] kkaefer: so for the gc, I overrode ::Wrap [07:28] kkaefer: and call a custom function that starts a eio_custom() in the MakeWeak callback [07:28] mscdex: eh... it should be called when node ends, since there'd no longer be any references to the object [07:29] kkaefer: well, v8 doesn't gc in that case [07:30] bartt has joined the channel [07:30] mikeal has joined the channel [07:31] dgathright_ has joined the channel [07:33] JimBastard: SubStack: you have any rough ideas about socket.io latency when its using its fastest transport? i guess native websocket support? [07:34] kkaefer: is there a way to get a callback when an object goes out of scope immediately? [07:34] kkaefer: probably not [07:34] kkaefer: because that would require solving of the halting problem, I guess [07:35] AAA_awright: Out of scope of what? [07:35] augustl: exception handling in asynchronous code is hard.. [07:36] kkaefer: out of all scopes [07:36] AAA_awright: if(error){callback(error); return;} // at the top of most functions... eh [07:36] AAA_awright: kkaefer: So, when it's liable to be garbage collected? [07:36] kkaefer: AAA_awright: I'm talking about the c++ level [07:37] AAA_awright: kkaefer: Uh, as in immediately after the function returns? [07:38] kkaefer: yeah, but that's probably impossible [07:38] AAA_awright: Calling a callback right when a function returns is impossible? [07:38] AAA_awright: I think I'm missing something [07:38] dgathright has joined the channel [07:39] AAA_awright: kkaefer: In C++ you also have destructors, which are called when the object is destroyed, which includes going out of scope (for objects not created with `new`) [07:39] SubStack: JimBastard: well browserling runs on dnode on socket.io and if you have a fat enough pipe it's nearly indistinguishable from running the browsers natively [07:39] kkaefer: I am aware of the fact that C++ has destructors [07:39] JimBastard: cool [07:39] AAA_awright: What's the difference then? [07:40] kkaefer: AAA_awright: however, these are only called when v8 garbage collects [07:40] kkaefer: and it doesn't do that when it exits [07:40] mike5w3c_ has joined the channel [07:40] AAA_awright: So, is this a Javascript problem or what? [07:40] kkaefer: no [07:40] mscdex: kkaefer: maybe ev_cleanup [07:40] mscdex: kkaefer: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod [07:41] kkaefer: yeah, I've been reading that page for the last hour [07:41] kkaefer: and tried to locate an example [07:41] kkaefer: but failed to do so [07:41] AAA_awright: I have no clue what this is for but my intuition says you probably don't want to circumvent the garbage collection [07:42] kkaefer: AAA_awright: that's not what I'm doing [07:42] skm: is using websocket to communicate messages and send files ok? [07:42] skm: or should i send ile using another method [07:42] kkaefer: mscdex: but I guess that on exit, I can also call blocking function in the destructor [07:42] skm: (between two node processes on diferent computers) [07:49] andrewfff has joined the channel [07:52] dewey_ has joined the channel [07:52] warz has joined the channel [07:53] JimBastard: SubStack: dumb question, can i setup a method on the browser to be executed by the server? the browser examples seem to only be calling server methods [07:53] JimBastard: i want the browser to connect to the server and then have the server call methods on the browser sometime later [07:53] SubStack: yes [07:53] warz: thats just standard js [07:54] SubStack: JimBastard: it's entirely symmetric [07:54] JimBastard: so inside my DNode.connect(function (remote) { i can declare new methods? [07:55] SubStack: the browser-side can do DNode(function (remote, conn) {}).connect() too [07:55] SubStack: or DNode({}).connect()  [07:55] SubStack: check out the chat server example [07:55] tmpvar: SubStack, that sounds awesome [07:56] tmpvar: rpc! [07:56] SubStack: yep! [07:56] tmpvar: its interesting, sort of ties into something i want to work on [07:57] SubStack: dnode's design stems from what I thought was annoying about drb [07:57] SubStack: and which parts were pretty neat [07:57] tmpvar: drb? [07:58] SubStack: a ruby thingfor sharing objects between clients and servers [07:58] flippyhead_ has joined the channel [07:58] mikeal has joined the channel [07:58] tmpvar: ah [07:58] zedas has joined the channel [07:59] peol has joined the channel [08:00] mscdex: kkaefer: this would be my guess: https://gist.github.com/d5901f601747d2c2d11b [08:00] mscdex: kkaefer: something like that anyway [08:00] tmpvar: mikeal, yo [08:00] mikeal: hey [08:00] mikeal: gimme a talk [08:00] mikeal: i've been drinking [08:01] tmpvar: haha [08:01] mikeal: so i might be a little unruly [08:01] tmpvar: ok, what do you want? [08:01] tmpvar: ive been drinking [08:01] chapel: SubStack: eventually everyone will see the genius behind dnode [08:01] chapel: they just have to experience it [08:01] chapel: :) [08:01] mikeal: a talk on jsdom [08:01] tmpvar: you want jsdom? the dom is boring! [08:01] SubStack: chapel: that and I'm rubbish at explaining it [08:01] mikeal: dom is borin [08:01] tmpvar: an hour on the dom is sure to put people to sleep [08:01] mikeal: but stuff that is being done with jsdom is not boring [08:02] tmpvar: true [08:02] mikeal: pfft [08:02] mikeal: hour [08:02] tmpvar: reasoning before [08:02] kkaefer: face -> palm [08:02] mikeal: there are no hour talks [08:02] kkaefer: mscdex: thanks [08:02] tmpvar: berrrrr [08:02] kkaefer: forgot the & sign ;) [08:02] tmpvar: how long is the talk? [08:02] mikeal: nodeconf talks are 30 minutes max [08:02] kkaefer: I guess it's time to go to bed now [08:02] tmpvar: ah, i could pull that off [08:02] mscdex: hehe :) [08:02] mikeal: i'm not down withese long as talks [08:02] mikeal: ass [08:02] tmpvar: lol [08:02] mikeal: seriously [08:02] tmpvar: i know dude [08:03] tmpvar: i started [08:03] mikeal: who wants to hear about anyting technicaly for an hour [08:03] tmpvar: i had a decent concept going [08:03] mscdex: i do! [08:03] peol has joined the channel [08:03] peol has joined the channel [08:03] tmpvar: and then i lost my balls [08:03] mscdex: if it's node-related [08:03] mscdex: :p [08:03] mikeal: i even cap the talks at my bbq to 30 minutes :) [08:03] mscdex: or it's a torvalds talk [08:03] mscdex: ;-) [08:03] SubStack: tehe [08:03] mikeal: jsbbq.org [08:03] tmpvar: fuck torvalds [08:03] mikeal: :) [08:04] tmpvar: that ass fuck [08:04] mscdex: :S [08:04] mikeal: ryan's keynote is capped at 30 minutes too [08:04] tmpvar: mikeal, i'll do it, i just wasnt sure what the concept was [08:04] mikeal: of course ryan prefers to talk for less time [08:04] tmpvar: same here [08:05] mikeal: really cool shit is going on with jsdom [08:05] SubStack: perhaps I'll submit another proposal about all this binary stuff I've been doing [08:05] tmpvar: agreed [08:05] mikeal: i want a good talk about it, and you're the obvious choice [08:05] tmpvar: really coool shit going on with node in general [08:05] SubStack: node-ssh-server should be operational by then >:D [08:05] nornagon has joined the channel [08:05] mikeal: SubStack: go ahead and put in multiple talks [08:05] squarepiu has joined the channel [08:06] mscdex: i could picture SubStack's powerpoint presentation [08:06] mscdex: :p [08:06] nornagon: Is there a way to catch errors thrown in callback code? I'm writing a web service and would rather the whole thing didn't come down whenever an exception was thrown inside a callback [08:06] SubStack: mscdex: all pictures and code, no words! [08:06] tmpvar: now that i know its 30 minutes it should be easier on the nerves to drop on in there [08:06] tmpvar: s/on/one [08:06] mikeal: nornagon: you can run node with a switch that doesn't crash on exception [08:07] chapel: heh [08:07] mikeal: cool [08:07] mikeal: yeah, i'm all about shorter talks [08:07] chapel: would be hilarious for someone to write a node slide app, and a node to text app [08:07] chapel: and have the whole presentation nodeified [08:07] tmpvar: dude mikeal.. i had a short story going.. about some "codesmith" who fights dragons to get his family back.... then i realized the dom is horribly boring. [08:07] nornagon: mikeal: is that a good idea? Are there some exceptions that *should* kill node? [08:07] mikeal: i'm going to try and get the track B speakers to do 15 minutes talks for some stuff [08:08] kkaefer: mscdex: it appears that cleanup is only called when the loop is explicitly destroyed with ev_loop_destroy() [08:08] SubStack: the only hard thing about writing an ssh server is doing the diffie-hellman key exchange and the only hard part about THAT is getting the libs wrapped to do arbitrary-precision modulo arithmetic [08:08] SubStack: this is going to rock so much [08:08] mikeal: tmpvar: write the short story, put it on your blog but send me a talk on jsdom :) [08:09] tmpvar: ok, 30 bullet points coming your way ;) [08:09] tmpvar: ill just give it now [08:09] nornagon: mikeal: and/or is there a way to register a 'global exception handler'? [08:10] mikeal: nornagon: yes and yes [08:10] SubStack: nornagon: process.on('error', fn) is somewhat magical in that respect [08:10] SubStack: no wait, uncaughtException [08:10] tmpvar: the dom sucks. reuse code. these people thing this is awesome. space ships and lazers. [08:10] nornagon: ah :) [08:10] SubStack: that's the ticket [08:10] tmpvar: s/thing/think [08:11] gstrock has joined the channel [08:11] nornagon: cheers :D [08:11] tlrobinson has joined the channel [08:11] devrim: guys if i set a cookie using express routes those cookies show up only under those routes like set something under localhost/x/y/z and you can't reach it from /x/y [08:12] devrim: what am i doing wrong ? [08:13] chapel: whatever url you set the cookie under is only applicable to that url [08:13] chapel: so if you want to set it for the whole site, do domain.com only [08:13] chapel: and not domain.com/url/a/b [08:13] chapel: I dont know the specifics of that with express and sessions [08:13] chapel: just saying [08:13] devrim: it's weird though, usually forward slashes after domain name shouldn't matter [08:14] devrim: or should it [08:14] devrim: hm [08:14] iszak has joined the channel [08:14] iszak has joined the channel [08:14] devrim: maybe im missing an option to set them to / [08:16] chapel: cookies are weird [08:16] SubStack: fact [08:16] dewey_: someone experience with node-scraper? [08:17] MikhX has joined the channel [08:17] dewey_: want to scrape a page but it isn't working, maybe a encoding issue or something [08:17] iszak: dewey_, what version of node.js? [08:17] dewey_: latest [08:17] dewey_: 0.4 [08:18] iszak: that's probably the problem? [08:18] dewey_: well, google.com is working for example [08:18] dewey_: and a lot of other are [08:18] dewey_: but will try an older version of node [08:18] iszak: oh wow node-scraper is kept up to date it seems, nice. [08:19] devrim: lost my past 2 hours on path:"/" [08:22] samsonjs has joined the channel [08:24] janm has joined the channel [08:27] micheil has joined the channel [08:27] srid has joined the channel [08:28] dewey_: iszak: do you know what happends if the on('data') responds with something like: P��wvЄ;�`.��һ��9r��"�7d�3��P����1.��Ug=�5(�1 RY���&P#��S@����RՎ@�߸ [08:28] dewey_: that's encoding right? [08:28] dewey_: res.setEncoding('utf8'); [08:28] iszak: that definitely looks like encoding. [08:28] JimBastard: SubStack: i think i figured it out, just had to use the event emitter [08:28] JimBastard: chat example was a good start [08:29] SubStack: ah it's a little tricky because in the constructor the methods aren't populated yet at the root [08:29] SubStack: because each side is generating the method structure to send to the other side! [08:30] SubStack: BWAHAHAHA [08:30] SubStack: bignum works! [08:30] SubStack: using node-ffi [08:30] augustl: how dull, http.request isn't compatible with URL, it seems. [08:30] SubStack: I only had to write a teeny bit of C [08:30] augustl: oh come to think if it, that makes sense. uri doesn't have request method, for example [08:31] iszak: dewey_, solved it? [08:31] dewey_: no.. [08:31] iszak: didn't you set the encoding on the response? [08:31] dewey_: yeah I did [08:32] iszak: dewey_, apply it before the data event is bound or after? [08:32] dewey_: before [08:32] iszak: OH [08:33] iszak: maybe it's because it's calling jsdom.jQueryify? [08:33] astoon has joined the channel [08:34] fizx has joined the channel [08:37] dewey_: iszak: I'm now testing it out with regual http.request [08:37] iszak: good idea. [08:37] dewey_: iszak: http://pastebin.com/Ctuc0ww0 for the http responses [08:38] tilgovi has joined the channel [08:38] dewey_: but the output is weird output vs good ouput @ google [08:38] flippyhead_ has joined the channel [08:38] shiawuen has joined the channel [08:40] iszak: dewey_, still? [08:40] dewey_: iszak: I've changed the path from '' or '/' to a full .html file [08:40] adambeynon has joined the channel [08:41] dewey_: then it works.. so I will just do that [08:41] Utkarsh has joined the channel [08:42] iszak: dewey_, wow, messed up. [08:44] ROBOd has joined the channel [08:53] Country has joined the channel [08:54] dewey_: iszak: I think I find out what happends, if I add ?" + new Date().getTime(); it works [08:54] dewey_: so it got something to do with caching on that server [08:55] iszak: ah that makes perfect sense. [08:55] iszak: I will have to remember that, thanks dewey_ ! [08:55] Remoun has joined the channel [08:55] dewey_: I still don't understand it to be honest, if it is cached or not. the response must always be a valid html page right [08:56] dewey_: cached is server side, not local [08:56] dewey_: I think? [08:56] iszak: hmm, not sure. [08:58] peol_ has joined the channel [09:01] marcosvm has joined the channel [09:02] qFox has joined the channel [09:04] Country has joined the channel [09:04] LarsSmit has joined the channel [09:05] Ratty_: How do I copy a file? [09:05] Sebmaster has joined the channel [09:06] Ratty_: I tried passing a fs.writeFileSync('foo', fs.readFileSync('bar')) but that raised an exception [09:07] Ond: Just readFile / writeFile [09:07] Ratty_: That raises a type error exception for me [09:08] Ratty_: Sorry, I mean "Bad argument" error [09:08] SubStack: fs.createReadStream('bar.txt').pipe(fs.createWriteStream('baz.txt')) [09:09] SubStack: plus, it's async! [09:09] andrewfff has joined the channel [09:09] SamuraiJack has joined the channel [09:10] Ratty_: Hmm, no such method "pipe" But I'll check the docs. Cheers. [09:10] jimt_ has joined the channel [09:10] SubStack: node 0.3.8 here [09:10] SubStack: it's newish [09:11] Ratty_: Ah, what about for 2.x? [09:12] SubStack: this might work: util.pump(fs.createReadString('bar.txt'), fs.createWriteStream('baz.txt')) [09:12] Ond: fs.readFile('filename', function(err, data) { if (!err) { fs.writeFile('filename', function(err) { if (!err) console.log('Saved'); }); } }); [09:12] SubStack: and var util = require('util') [09:14] Ratty_: SubStack: That worked, cheers. [09:14] Ratty_: Although it's 'sys' in 2.x [09:14] SubStack: depends on which x in 0.2.x you've got [09:16] Ratty_: Really? I though that was just a v0.3/0.4 change [09:16] thermal has joined the channel [09:18] dahankzter has joined the channel [09:19] flippyhead_ has joined the channel [09:24] SamuraiJack_ has joined the channel [09:25] xSmurf has joined the channel [09:28] andrewfff has joined the channel [09:31] rchavik has joined the channel [09:33] rchavik has joined the channel [09:33] m64253 has joined the channel [09:35] rchavik has joined the channel [09:44] jimt has joined the channel [09:45] razvandimescu has joined the channel [09:45] chewbranca has joined the channel [09:46] ilpoldo has joined the channel [09:47] mscdex: the sys->util change happened in 0.3.x [09:50] hij1nx has joined the channel [09:50] xSmurf has joined the channel [09:51] SubStack: but you can require('util') in 0.2.5 and it works at least [09:52] JimBastard has joined the channel [09:55] narayan82 has joined the channel [09:57] devrim: how can i get a traceroute from within a method ? one method is being called twice, i want to catch the requester, any ideas? [09:58] devrim: traceroute - stacktrace [10:00] flippyhead_ has joined the channel [10:02] SubStack: devrim: new Error('moo') is one way [10:02] SubStack: throw new Error('moo') I mean [10:03] LarsSmit has joined the channel [10:03] versicolor has joined the channel [10:03] SubStack: although it's different if the call is async [10:04] pdelgallego has joined the channel [10:04] herbySk has joined the channel [10:05] devrim: thx just tracked the criminal [10:05] devrim: sys.puts new Error().stack [10:08] astoon has joined the channel [10:10] chapel: devrim: you dont need to use sys.puts [10:10] chapel: console.log [10:10] chapel: or console.dir [10:10] sveimac has joined the channel [10:10] devrim: what's the difference actually ? [10:11] chapel: console.log is the same as sys.puts [10:11] chapel: but its built in [10:11] chapel: and you dont have to require anything [10:11] devrim: ah [10:12] JimBastard: SubStack: jsonloops is now rendering in the browser in real-time using dnode [10:12] devrim: and now i'm going to start using mongo with node, i see two modules, do u guys have experience wth them ? is one better than the other ? [10:12] JimBastard: it throws up an html table representing a multitrack sequencer [10:12] JimBastard: and highlights the right column based on the audio playing [10:13] JimBastard: gotta start doing the live loop editing now [10:13] chapel: JimBastard: you finally see what I was saying about dnode? [10:13] chapel: why I said you should use it? [10:13] JimBastard: chapel: ive been wanting to use dnode for something, i just havent had a use yet [10:13] JimBastard: this is a pretty good use case [10:13] devrim: wow there is actually 5 [10:13] tobetchi has joined the channel [10:14] JimBastard: did we lose tmpvar [10:14] JimBastard: i needed him to get https://github.com/tmpvar/node-irrklang working [10:15] SubStack: awesome! [10:15] JimBastard: ive been listening to an off-beat loop for a couple of hours now, im starting to lose it [10:15] JimBastard: really need that real-time audio playback [10:15] chapel: lol [10:16] tanepiper: JimBastard: are you eve going to update hook.io then? [10:16] tanepiper: looks pretty sweet [10:16] JimBastard: tanepiper: yeah for sure [10:16] tanepiper: \o/ [10:16] JimBastard: if you watch the jsconf video, the last thing is say is that for hook.io to work, we need a good way to deploy multiple instances of it lol [10:17] tanepiper: exactly, a web of hooks [10:17] JimBastard: so nodejitsu is a stepping stone for that to happen [10:17] tanepiper: to tear your soul apart [10:17] JimBastard: at least for me [10:18] JimBastard: now that a lot of the node libs have matured, hook.io should be easy to make too [10:18] JimBastard: id be glad to add anyone to the project who wants to work on it [10:20] SubStack: bwahahaha just got bigint parsing exponents exactly with some stupid math tricks [10:20] tanepiper: JimBastard: i'll have a pull at some point, but this week is definetly out [10:20] zomgbie has joined the channel [10:21] tanepiper: i need to look at updating tj's knox lib to 0.4 this week as well [10:26] jkp has joined the channel [10:28] afriggeri has joined the channel [10:31] kwijibo has joined the channel [10:39] Utkarsh has joined the channel [10:40] flippyhead has joined the channel [10:40] nook has joined the channel [10:43] Gruni has joined the channel [10:46] adambeynon has joined the channel [10:46] nivoc has joined the channel [10:47] shiawuen has left the channel [10:53] stagas: JimBastard: got that sequencer code anywhere? [10:53] JimBastard: https://github.com/marak/jsonloops [10:53] JimBastard: will have update for it tomorrow [10:53] JimBastard: with the real-time code [10:53] JimBastard: it works stand-alone now [10:54] mhausenblas has joined the channel [10:54] ph^ has joined the channel [10:56] stagas: how's performance? [10:57] JimBastard_ has joined the channel [10:57] rb_ has joined the channel [10:57] rb_: hi thre [10:57] JimBastard_: stagas: real-time code will be coming in over the weekend [10:58] JimBastard_: but without the low latency audio playback, its not gonna work [10:59] rb_: can anyone help me???? i get the " error : could not configure a cxx compiler " [10:59] JimBastard_: rb_: you on mac os? [10:59] rb_: im on win 7 [11:00] JimBastard_: which guide are you following? [11:00] rb_: http://labs.blitzagency.com/?p=2634 [11:00] rb_: thanx [11:02] FireFly has joined the channel [11:02] Utkarsh_ has joined the channel [11:02] stagas: JimBastard: I had done an attempt at a html5 sequencer but kind of abandoned it https://gist.github.com/e3a021667567f062835d [11:04] stagas: JimBastard: I tried to solve the latency issue by skipping beats if the sequencer was behind in time, see the 'tick' method [11:06] stagas: but nothing really worked well [11:06] stagas: the audio element is crap [11:06] rb_: JimBastard _ [11:07] rb_: do you have any windows guide??? [11:08] svenlito has joined the channel [11:09] JimBastard_: stagas: tmpar is working on a low level binding [11:09] JimBastard_: we are going to play the audio from one node instance for now, and use multiple browsers to control it [11:09] JimBastard_: so the browsers will be mute for now [11:10] JimBastard_: if we can get that working, we are going to try and use dnode to broadcast events between node instances to keep it in sync [11:10] JimBastard_: i dunno though [11:10] JimBastard_: the second part is hard [11:10] JimBastard_: the first part is easy [11:10] SubStack: n'sync [11:10] stagas: one crazy idea I had is to generate and stream mp3/ogg in realtime but that wouldn't work well :P [11:10] |sWORDs| has joined the channel [11:11] SubStack: yeah synchronization is hard [11:11] Utkarsh has joined the channel [11:11] SubStack: it's not too hard if only one side can write [11:11] stagas: but the beats would be in sync, even though there would be a delay from the server [11:12] pl-6 has joined the channel [11:12] |sWORDs|: Does anyone know of any extra explaination of conductor.js? I only found "The Step of the Conductor" on howtonode.org. [11:15] temp01: has anyone tried no.de? [11:15] temp01: I was wondering if it allows irc bots [11:15] Yuffster_work has joined the channel [11:16] jimt has joined the channel [11:17] |sWORDs|: Or does anyone have a better method to reduce nested spaghetti code? [11:18] hij1nx has joined the channel [11:18] SubStack: conductor eh? I haven't heard of that one [11:18] |sWORDs|: http://howtonode.org/step-of-conductor [11:19] |sWORDs|: But I still don't get it completely, then there is promise (https://github.com/kriszyp/node-promise) but I really don't get that one. [11:19] SubStack: looks like dependency analysis [11:20] SubStack: |sWORDs|: you can give mine a try http://github.com/substack/node-seq [11:20] SubStack: but it's super fun to write your own too [11:20] |sWORDs|: SubStack: I'll have a look, tnx. [11:21] |sWORDs|: Yeah, then atleast I'd understand all of it. ;) [11:21] m14t has joined the channel [11:21] flippyhead_ has joined the channel [11:22] |sWORDs|: But I've got so much to write already. Sometimes it easier to learn anothers, but you're right building my own things is best. Then they do what I want in a way that I want. [11:22] JimBastard_: SubStack: with the build me and tmpvar are working on now, we should have to not worry about sync..we'll see [11:22] JimBastard_: the controller devices will be the browser, so if the UI is a little off, it should be okay [11:22] JimBastard_: 100-200ms or so [11:22] SubStack: groovy [11:22] JimBastard_: i just implemented start and stop [11:22] JimBastard_: :-D [11:22] JimBastard_: goo looper! [11:23] SubStack: dnode is super great for hacking stuff up incrementally like that [11:24] SubStack: and when you want to change how it works you can just mix up your object hierarchy instead of having to hack away at some ad-hoc state machine [11:26] JimBastard_: how difficult is it to send a message to dnode without using dnode? [11:26] JimBastard_: can i use it as a json-rpc? [11:27] SubStack: it's not too hard [11:27] SubStack: if you want to do any callbacks or cyclic references it gets tricky [11:27] JimBastard_: are there examples anywhere? [11:27] SubStack: but for simple stuff I was keying stuff in by hand for debugging while writing it [11:28] JimBastard_: i was thinking maybe make webservice.js map to dnode [11:28] SubStack: the bottom of the readme goes over the protocol [11:28] JimBastard_: so you can expose a webservice that talks to dnode backend [11:28] JimBastard_: ok [11:28] JimBastard_: ill read more after i sleep [11:28] hij1nx: JimBastard_: is irrKlang working or still in concept mode? [11:28] JimBastard_: fuck, even registration is in 2 and half hours [11:28] jimt_ has joined the channel [11:28] JimBastard_: hij1nx: i dunno, tmpvar said he'd leave docs if it was working [11:28] JimBastard_: he passed out [11:28] maushu has joined the channel [11:28] hij1nx: word [11:29] JimBastard_: im not gonna dive into it until he wakes up [11:29] JimBastard_: it might build [11:29] garrensmith has joined the channel [11:29] LarsSmit has joined the channel [11:29] garrensmith: morning all [11:29] garrensmith: which library would everyone recommend for passing xml? [11:29] pl-6: good morning - I just woke up too not long ago (east coast USA) [11:29] Fullmoon has joined the channel [11:29] pl-6: I had the strangest dream upon waking - ties into node.js and Crockford in a way I suppose. [11:30] JimBastard_: sexual...? [11:30] hij1nx: lol [11:30] pl-6: I thought I'd share for the sake of it - MIGHT be off what node.js is about or can be about [11:30] pl-6: was watching Crimson Tide before bed- about a nuclear sub - deal was involving 'redundancy' or that if one sub failed to launch nukes, another could... I got to thinking abotu redundnancy and node.js and something Douglas Crockford said. [11:30] briznad has joined the channel [11:31] pl-6: is it possible node.js can map server side everything that's going on client side ? [11:31] hij1nx: JimBastard_: im gonna try to see if i can get irrKlang doing something [11:31] hellp has joined the channel [11:31] pl-6: in a 'workspace' ? if so - this seems it could be useful. [11:31] JimBastard_: hij1nx: if you can get play(pathToWav) working, i will shit my pants [11:31] JimBastard_: thats all i need [11:31] pl-6: to have redundancy - imagine your browser client crashing- and you reconnect to server and EVERYTHING is JUST as you left it. [11:31] JimBastard_: ill update play.js to use klang and JSONloops will be good to go [11:32] hij1nx: JimBastard_: we'll see ;) [11:32] pl-6: crockford implied using node.js to map what's going on in client server side. Oh well- that's all I had to share. [11:32] garrensmith: pl-6: surely any server side can map what is going on client side, its just a matter of keeping state? [11:33] pl-6: I suppose- was thining of literally cloning cliend side JS to server side - maybe it wasn't a dream but a nightmare - heh.. :) [11:34] JimBastard_: pl-6: what does "literally cloning cliend side JS to server side" mean [11:34] hij1nx: JimBastard_: damn, he's already got win32/.NET support in the mix... [11:34] JimBastard_: pl-6: and how is that thining? [11:35] JimBastard_: hij1nx: macos is what i need [11:35] JimBastard_: the library is cross platform if it can build [11:35] mscdex: node.js rules! [11:35] hij1nx: JimBastard_: thats pretty much what i thought [11:36] JimBastard_: morning mscdex [11:36] mscdex: morning [11:38] jbpros has joined the channel [11:38] skm has joined the channel [11:38] JimBastard_: hij1nx: http://www.ambiera.com/irrklang/tutorial-helloworld.html might help [11:39] JimBastard_: mscdex: you are like a master about doing C bindings for node right? [11:39] JimBastard_: you feel like looking at https://github.com/tmpvar/node-irrklang at all? [11:39] derferman has joined the channel [11:39] kwijibo_ has joined the channel [11:40] Yuffster_work has joined the channel [11:41] francescop has joined the channel [11:41] mhausenblas_ has joined the channel [11:42] hij1nx: JimBastard_: im able to build, but im missing some api calls or something?? hmm... [11:42] JimBastard_: hij1nx: maybe he get it building and passed out [11:42] mscdex: heh [11:42] JimBastard_: now you gotta write the v8 bindings? [11:43] hij1nx: JimBastard_: that's what im looking at now [11:43] JimBastard_: im still such a noob at building bindings to node [11:43] tanepiper: JimBastard_: i saw tmpvar created it in my feed this morning, what is it? [11:43] steffkes has joined the channel [11:44] JimBastard_: tanepiper: high level cross platform 3d audio api [11:44] JimBastard_: we are trying to use it for this nyc music hack day entry [11:44] JimBastard_: jsonloops [11:44] tanepiper: fruityJSONloops :D [11:44] tanepiper: {'boom':'tish'} [11:45] JimBastard_: tanepiper: real-time browser based fruitloops, that works off of nested json arrays [11:45] JimBastard_: https://github.com/marak/jsonloops [11:45] mscdex: tanepiper: you want Tish to go boom? [11:45] mscdex: who is she? [11:45] mscdex: :p [11:46] tanepiper: Strong Bad [11:46] mscdex: which 3d audio api is this [11:46] tanepiper: http://www.youtube.com/watch?v=Zx1eDmuYQg8 [11:46] tanepiper: Use Canvas to do lightswitch raves [11:46] JimBastard_: mscdex: [11:47] JimBastard_: https://github.com/tmpvar/node-irrklang [11:47] mscdex: oh, it's irrklang [11:47] mscdex: never heard of it :S [11:47] JimBastard_: http://www.ambiera.com/irrklang/tutorial-helloworld.html [11:47] mhausenblas: quick Q - I'm on 0.2.6 and get "ETIMEOUT, Timeout while contacting DNS servers" whenever I try to GET the content of a remote document via http.createClient [11:47] hij1nx: JimBastard_: yeah, looks like it just needs c++ bindings, hacking that together now [11:47] pedrobelo has joined the channel [11:47] mhausenblas: 1. would moving to 0.4.0 solve this problem? [11:47] mscdex: mhausenblas: are you on cygwin? [11:47] mhausenblas: no, MacOS X [11:48] mhausenblas: 2. I'd like to move to 0.4.0 anyway, I guess - what are the gottchas? anyone experience [11:48] mscdex: mhausenblas: https://github.com/ry/node/wiki/Migrating-from-v0.2-to-v0.3 [11:49] tanepiper: I wonder what nodejs's singing voice will be like ;) [11:49] mhausenblas: the only thing that holds me back ATM is that I'm unsure if I can still use it on no.de (they offer 0.2.6) [11:49] mhausenblas: mscdex: thanks (but that's 'only' to 0.3. right?) [11:49] mscdex: 0.3 became 0.4 [11:49] mhausenblas: is there anything additional to be aware of? [11:49] mhausenblas: oh :) [11:50] mhausenblas: hehe, fair enough (maybe the doc URI should be updated then, to avoid confusion) [11:52] unomi has joined the channel [11:53] |sWORDs|: SubStack: I'm looking at the code and I see something else very interesting in parseseq.js. You use Seq() and only use ; at the end and it seems to do a with like contruction. Is that valid code and does it actually set Seq.seq and Seq.par? That could save me a lot of writing in my code. [11:53] mhausenblas: hmmm, maybe for now I'll stick with 0.2.6 and do the migration after I've completed the task at hand and checked no.de support for 0.4 [11:53] mhausenblas: any workarounds for the timeout issue? https://github.com/ry/node/issues/issue/143 makes me believe it's closed [11:54] mhausenblas: still don't know what to do [11:54] mhausenblas: (and, no I'm not on a wireless network ;) [11:54] mscdex: mhausenblas: is your /etc/resolv.conf filled out? [11:54] mhausenblas: ACTION checking [11:55] mhausenblas: yes, I guess these are our corporate DNS server [11:55] herbySk has joined the channel [11:56] mscdex: not sure then [11:56] mhausenblas: ACTION pasting code and msg ... [11:57] tanepiper: mhausenblas: it's activly being discussed on the nodejs-dev list [11:57] mhausenblas: aha, thanks tanepiper - will try to find it ;) [11:57] mhausenblas: http://pastebin.com/dsk8kuf1 [11:57] mhausenblas: summed up code and output ^^^ [11:58] tanepiper: https://groups.google.com/d/topic/nodejs-dev/DQe41GrD76Q/discussion [11:58] mhausenblas: tx [11:58] tanepiper: although ath timeout is 120s hard coded [11:58] razvandimescu has joined the channel [11:58] tanepiper: so if you are not connecting in 2m i think it's probably somewhere else the issues lies? [11:59] chapel: |sWORDs|: Seq().blah \n .bleh and so on [11:59] chapel: equals Seq().blah.bleh... [11:59] fcarriedo has joined the channel [11:59] mhausenblas: well, I guess if curl works ... [12:00] tanepiper: oh i hate when that happens :D [12:00] garrensmith: anyone know of a good xml to json parser? [12:01] nu- has joined the channel [12:01] SamuraiJack_ has joined the channel [12:02] astoon has joined the channel [12:02] d0k has joined the channel [12:02] flippyhead_ has joined the channel [12:02] mscdex: garrensmith: i've used libxmljs and its push parser for async: https://gist.github.com/416021 [12:02] mhausenblas: ACTION goes with the ' adding google DNS to my /etc/resolv.conf. ' for now - not sure if this is the best idea ... [12:02] tanepiper: garrensmith: http://code.google.com/p/xml2json/ it's python [12:02] |sWORDs|: chapel: So each var get's nested in the previous? [12:03] mscdex: mhausenblas: fwiw: http://groups.google.com/group/nodejs-dev/browse_thread/thread/1ac67854c9437f03 [12:03] chapel: ? [12:03] garrensmith: mscdex: thanks will try it, tanepiper I'm looking for a nodejs one [12:04] mhausenblas: woot!, cool, mscdex, thanks [12:04] tanepiper: garrensmith: yea, i didn't think there was one, but you could child_process a python script and pass it stdin [12:04] tanepiper: but if we have a nodejs one all the better :D [12:04] |sWORDs|: hmm I only knew //var = {}; var.test = 1;// and //var={test:1}// [12:04] garrensmith: this one looks quite nice https://github.com/maqr/node-xml2js [12:05] hij1nx: JimBastard_: here's my fork, i added some binding code, its getting closer... https://github.com/hij1nx/node-irrklang [12:06] JimBastard_: hij1nx: what else needs to be done to actually make the audio playback? [12:07] hij1nx: JimBastard_: im just checking now [12:08] JimBastard_: im about to take a shower, brb [12:09] hij1nx: JimBastard_: yeah i need to get some coffee before i will be able to get this thing to work end to end =) [12:09] svenlito has joined the channel [12:09] Coall has joined the channel [12:10] SubStack: |sWORDs|: see also http://substack.net/posts/92a7f7 [12:10] SubStack: these are sometimes called fluent or monadic interfaces [12:11] mhausenblas: ACTION updated /etc/resolv.conf with the public Google DNS servers 8.8.8.8 and 8.8.4.4 and it works now (under MacOS X 10.5) [12:11] mhausenblas: thanks all for your help [12:12] |sWORDs|: SubStack: Tnx. I see that I've got some reading and testing to do. ;) [12:13] easternbloc has joined the channel [12:14] matyr_ has joined the channel [12:15] jimt has joined the channel [12:16] liar has joined the channel [12:16] tc77 has joined the channel [12:18] charlenopires has joined the channel [12:18] jpstrikesback has joined the channel [12:20] enr^ has joined the channel [12:20] wao has joined the channel [12:21] andrewfff has joined the channel [12:21] tanepiper: i'd love to try get Seq working with coffeescript, but it's been a pain [12:21] tanepiper: would make some of my code much nicer [12:22] tanepiper: wonder if just chainsaw on it's own would be a better solution [12:22] zomgbie has joined the channel [12:22] kwijibo_ has joined the channel [12:24] Astro: guys, I can tell you: the removal of setSecure() from v0.4.0 is breaking my neck [12:24] Astro: https://github.com/astro/node-xmpp/issues/#issue/13 [12:25] tanepiper: lol http://twitpic.com/3r9u7s/full [12:25] tanepiper: NEEDS MORE jQUERY [12:25] sveisvei has joined the channel [12:25] fairwinds has joined the channel [12:26] stagas: lol [12:26] stagas: -1 not enough jQuery :P [12:26] JimBastard_: have you guys tried jQuery? its great [12:26] JimBastard_: :-D [12:27] tanepiper: jQuery.fn.add = function (num1, num2) { return num1 + num2 } [12:27] tanepiper: jQuery.add(2,2) [12:28] tanepiper: whoops, needs more callbacks [12:28] Sami_ZzZ has joined the channel [12:28] tanepiper: at least needs a success and failure callbackl [12:29] stride: dont forget the callback that fires when all basic math is done [12:32] nook has joined the channel [12:32] francescop: anyone knows any good open source project written with Express to look at? Just trying to learn this framework [12:32] easternbloc: yeah [12:33] easternbloc: francescop: well, dailyjs has a nice tutorial series [12:33] easternbloc: and the project is on github [12:34] easternbloc: francescop: https://github.com/alexyoung/nodepad [12:35] raak has joined the channel [12:36] beawesomeinstead has joined the channel [12:36] ngwe has left the channel [12:36] ngwe has joined the channel [12:37] snafuz has joined the channel [12:37] m64253 has joined the channel [12:37] raak has left the channel [12:37] nu- has joined the channel [12:37] hij1nx: JimBastard_: it's pretty close, there are references to something in the makefile that he might not have included in the project, but we'll see him later today at generalassembly... i also dm'd him on twitter. [12:39] beawesomeinstead has joined the channel [12:39] luke`_ has joined the channel [12:40] okuryu has joined the channel [12:41] |sWORDs|: SubStack: So basicly the stuff I need to get hy head around are monads? [12:42] Jxck has joined the channel [12:42] LarsSmit has joined the channel [12:42] flippyhead_ has joined the channel [12:43] LarsSmit1 has joined the channel [12:43] garrensmith has joined the channel [12:44] davidc_ has joined the channel [12:44] mraleph has joined the channel [12:47] gattuso has joined the channel [12:48] adambeynon has joined the channel [12:50] Utkarsh has joined the channel [12:57] mikedeboer has joined the channel [12:59] vineyard has joined the channel [12:59] Bioxyde has joined the channel [12:59] Bioxyde: Is there anyway to update node.js without compiling it from source? [12:59] Bioxyde: I'm on Mac OSX. [13:01] sriley has joined the channel [13:03] Bioxyde has joined the channel [13:03] Bioxyde: I'm sorry, I had to restart the computer. [13:03] Bioxyde: Is there anyway to update node.js without compiling it from source? [13:03] Bioxyde: I tried building it but there was an error at the make install part. [13:09] matyr has joined the channel [13:14] abstractj has joined the channel [13:16] MrTopf has joined the channel [13:16] easternbloc: Bioxyde: not that I know of. To make your life easier you can use tj's "n" [13:19] adambeynon has joined the channel [13:20] easternbloc: but if it's erroring on install then you need to find out why it's doing that [13:20] abstrusenick has joined the channel [13:23] arpegius has joined the channel [13:23] flippyhead_ has joined the channel [13:24] Bioxyde: What hte fuck. [13:24] Bioxyde: The* [13:24] Bioxyde: Even n is not working. [13:24] Bioxyde: n 0.4.0 [13:24] Bioxyde: mkdir: /usr/local/n: Permission denied [13:24] Bioxyde: /usr/local/bin/n: line 138: cd: /usr/local/n: No such file or directory [13:25] Bioxyde: should I use sudo? [13:25] Viper-7 has joined the channel [13:26] stride: why? just fix the permissions on /usr/local/ [13:28] beawesomeinstead has joined the channel [13:29] squarebio has joined the channel [13:30] abstrusenick: i've installed a library using npm [13:30] Bioxyde: How? I'm not the command-line guy >_> [13:30] abstrusenick: but im getting this error Error: Cannot find module 'readability' [13:32] maxpert has joined the channel [13:32] maxpert: hey everyone [13:32] maxpert: :D [13:33] enraged has joined the channel [13:34] Bioxyde: Stride: How do I fix the permissions? [13:34] Bioxyde: In /urs/local/ [13:34] Bioxyde: usr* [13:36] jdub: i have called request.abort() on a long running http request [13:36] jdub: and it's just sitting there in FIN_WAIT2 state [13:36] jpstrikesback has joined the channel [13:37] jdub: request.connection == null [13:37] jdub: request.res.connection isn't [13:42] stride: Bioxyde: don't know about mac os but usually you should be able to use chown / chmod (-R switch for recursive mode) to allow your user to modify content under /usr/local/ [13:42] stride: ACTION just typed node pennotes.py into his console. meh [13:44] CrazyGoogle has joined the channel [13:44] mw_ has joined the channel [13:45] sechrist has joined the channel [13:46] iszak has joined the channel [13:46] iszak has joined the channel [13:49] mike5w3c has joined the channel [13:49] raak has joined the channel [13:50] pdelgallego has joined the channel [13:50] augustl: is there a way to dynamically get the host/port of a HTTP request? [13:51] jdub: augustl: in node 0.4, request.agent will give you lots of goodies, incl host and port [13:51] augustl: jdub: looking it up, thanks [13:51] jdub: augustl: (host might be different from host header) [13:52] unomi has joined the channel [13:52] augustl: I'm on 0.4 and my request (first argument of request event handler) has no agent property. [13:52] augustl: I see there's http.Agent in the docs though, but no request.agent [13:53] FireFly|n900 has joined the channel [13:53] jdub: augustl: so you've set request, set up the response event, and called request.end() ? [13:55] augustl: jdub: I'm listening to the request event, that's all I know. Not sure if that fires before or after the request closes. [13:55] Bioxyde has left the channel [13:55] jdub: you might want to put your code up somewhere (gist) [13:56] jdub: there's no request event [13:57] augustl: jdub: https://gist.github.com/823781 [13:57] tiemonster has joined the channel [13:57] augustl: jdub: the request event I'm talking about is http://nodejs.org/docs/v0.4.0/api/http.html#event_request_ [13:58] jdub: yes, sorry, the default event :) [13:58] augustl: req.agent is undefined [13:58] augustl: which I kind of expected, http://nodejs.org/docs/v0.4.0/api/http.html#http.ServerRequest has no mention of an agent [13:59] jdub: yeah, thought your original question was re: client not server [14:00] nmtmason has joined the channel [14:00] augustl: I see [14:00] hwinkel has joined the channel [14:00] augustl: what I'd like to achieve is to get the full URL of the request. [14:01] augustl: (now that we're on the same page) [14:03] tiemonster: is there a good autodocumentation system for Node? [14:03] tiemonster: or js in general, I guess [14:03] augustl: tiemonster: all the ones I've seen that I liked enforce a class regime.. [14:03] jdub: augustl: sorry, distracted there for abit [14:03] tiemonster: for sanity, we'd probably do that anyways [14:03] augustl: np :) [14:03] flippyhead_ has joined the channel [14:04] jdub: augustl: node's http server is bare metal stuff [14:04] tiemonster: augustl: any particular suggestion? [14:04] augustl: tiemonster: you can have sane JavaScript without classes etc. [14:04] jdub: augustl: usually what you'd do is, a) already know which port you're listening on anyway, [14:04] jdub: augustl: b) get the host header from the request [14:04] jdub: augustl: the client could be requesting *anything* [14:04] augustl: jdub: apache can do it though! =P I'm sure there's a way to do it in node. Perhaps it's available in the innards of sockets. [14:05] augustl: but yeah, getting the port is easy. Hostname not so much. [14:05] jdub: augustl: apache is a complete web server, knows which socket it's listening to (per virtual host), and can pass that environment around [14:05] jdub: augustl: your http server isn't listening to a hostname [14:05] augustl: jdub: apache has per-virtualhost sockets? [14:06] augustl: jdub: is there any difference, technically? Won't both node and apache get the same packets and the same information? [14:06] tiemonster: well technically there's no such thing as a class in js, but yeah [14:06] jdub: augustl: you can set up different virtualhosts on the same socket, and listen on many sockets, yes [14:06] jdub: augustl: yes, but node's http server is very low level [14:06] augustl: tiemonster: personally I prefer Object.create and modularity rather than classes and inheritance [14:06] augustl: (in JavaScript) [14:06] jdub: augustl: apache is doing lots of hard work for you [14:06] tiemonster: I tend to use JSON [14:06] augustl: I don't mind doing hard work :) [14:07] tiemonster: function classes, whatever their real name is [14:08] augustl: doh. HTTP has a a "host" header. [14:08] jdub: augustl: that only tells you what the client is asking for [14:08] augustl: jdub: good enough for me.. I think. [14:08] jdub: augustl: if that's what you want, great [14:09] JimBastard has joined the channel [14:09] JimBastard: okay, reporting in from nyc music hack day [14:09] JimBastard: representing the all javascript stack, as usual [14:11] micxer has joined the channel [14:11] augustl: jdub: I suppose the host header is whatever the client used? So if a client uses its own DNS (i.e. /etc/hosts) and requests with that domain, that's what the host header will contain? [14:11] augustl: JimBastard: JavaScript + music = ??? [14:11] jdub: augustl: yeah, or something completely arbitrary :) [14:12] JimBastard: augustl: im writing a real-time multi-user audio sequencer which uses web-browsers as control devices [14:12] JimBastard: repo @ https://github.com/marak/jsonloops [14:12] JimBastard: right now it only runs locally [14:12] JimBastard: i bet before lunch time it will be real-timing [14:13] mAritz has joined the channel [14:13] augustl: JimBastard: the actual audio stuff is not in a browser? [14:13] ChrisPartridge has joined the channel [14:13] JimBastard: nope, it plays on one node instance...for now [14:13] JimBastard: if we can pull it off tomorrow we go for node to node communication [14:13] JimBastard: the browser audio sucks too hard to stay in sync [14:13] JimBastard: at least from what i've seen in the past [14:17] tc77 has left the channel [14:18] tiemonster: augustl: so what doc system do you use? or did I miss that... [14:20] xandrews has joined the channel [14:23] Jaye has joined the channel [14:24] augustl: tiemonster: I use asciidoc mostly [14:24] tiemonster: augustl: thanks. I'll look into it. [14:25] augustl: it's a general tool though, and does nothing with JavaScript in particular. I.e. comment parsing etc. [14:26] devrim has joined the channel [14:28] liquidproof has joined the channel [14:30] jakehow has joined the channel [14:31] Blackguard has joined the channel [14:32] hoodoos has joined the channel [14:32] WarriorSl has joined the channel [14:33] hoodoos: hello, guys. does any body implemented something like process shared connection pool? for now I have a pool of redis connections per process and it's not very effective, would be great if processes could share one pool. i wonder if it will be efficient to pass redis connections with messages of web-worker API? [14:35] tiemonster: any suggestions for a well-documented static file server? [14:35] hoodoos: you need a node.js implementation? [14:35] tiemonster: it would be nice not to require a nginx reverse-proxy just to serve our three static files... [14:36] unomi has joined the channel [14:36] hoodoos: host them on google code :) [14:37] chapel: hoodoos: check out dnode [14:37] hoodoos: tiemonster, ^^ [14:37] hoodoos: oh, it's for me? ) [14:37] hoodoos: okay [14:37] MrTopf has joined the channel [14:37] aguynamedben has joined the channel [14:37] JimBastard: tiemonster: use connect or node-static [14:38] tiemonster: I'm using express to serve the app. Does it have something built in? [14:39] augustl: tiemonster: express maybe [14:39] JimBastard: tiemonster: the static provider should have it [14:39] JimBastard: its easy, just middleware [14:39] tiemonster: I see [14:39] augustl: it does a lot of stuff, including serving static files. [14:39] tiemonster: thanks [14:40] JimBastard: function(req, res, next) [14:40] svenlito has joined the channel [14:40] jacksonmills has joined the channel [14:44] flippyhead_ has joined the channel [14:44] jpstrikesback has joined the channel [14:44] sveimac has joined the channel [14:44] sveisvei has joined the channel [14:47] mankuthimma has joined the channel [14:55] kal-EL_ has joined the channel [14:58] dnyy has joined the channel [14:58] edude03 has joined the channel [15:01] mAritz: oh god, what have i done? [15:01] mAritz: uhm... https://github.com/ry/node/wiki/Library-compatibility [15:01] LarsSmit has joined the channel [15:02] mAritz: i'm not sure what exactly it is that i did wrong here [15:02] mAritz: but apparently i broke the wiki page [15:02] LarsSmit1 has joined the channel [15:02] jacksonmills has joined the channel [15:03] mAritz: ouh, switched the editing mode [15:03] mAritz: fixed it, sorry for that! [15:04] augustl: there's no way to wrap an asynchronous callback in try/catck, right? [15:04] augustl: try/catch* [15:05] tiemonster: augustl: you'd have to do it inside [15:06] tiemonster: how do I get the user's IP again? I always forget that... [15:07] tiemonster: nm. found it. [15:07] samsonjs has joined the channel [15:07] augustl: perhaps I can add a global exception handler to process or something.. [15:07] sivy has joined the channel [15:08] sriley has joined the channel [15:08] augustl: oh hey, process has a "uncaughtException" event [15:10] JimBastard: SubStack: did you go to sleep yet? i just pushed a new version of the jsonloops which has the RMI stuff working [15:10] JimBastard: "working" [15:10] nonnikcam has joined the channel [15:13] void_ has joined the channel [15:15] JimBastard: tim_smar1: you have a doppleganger here [15:15] perlmonkey2 has joined the channel [15:16] tanepiper: Juicyloops [15:17] Astro: what's a recommendable EventEmitter for the browser side? [15:17] vyvea has joined the channel [15:17] tanepiper: Astro: use substacks Browserify, expose EventEmitter to the browser :D [15:18] JimBastard: chapel: is there a disconnect event on a dnode client? i want to build something that keeps polling the server if the server goes down [15:18] mike5w3c has joined the channel [15:20] tanepiper: JimBastard: You can send a message to clients inside process.on('SIGKILL' or something, hang on lemme get my code [15:20] JimBastard: tanepiper: i dont think thats what i meant [15:21] JimBastard: i want my client to attempt to reconnect until the server is backonline [15:21] JimBastard: the client is the browser [15:21] strmpnk has joined the channel [15:22] tanepiper: it will just do that anyway [15:22] stride: uh, what does fs.mkdir need as a mode? I tried 0777 but it keeps giving me "Bad Argument" out of C++ land [15:22] tanepiper: you'll just get 404's until then, but when it's back up it'll reconnect [15:22] JimBastard: tanepiper: i think i have a solution, maybe you right [15:22] jchris has joined the channel [15:22] tanepiper: thing i did though was this: https://gist.github.com/ef704a3ec4d6deaaea70 [15:22] JimBastard: tanepiper: it doesnt seem automatic [15:23] tanepiper: so when i did a shutdown, i sent a graceful message, maybe you could use something like that to tell the client "Wait 30 seconds, then retry" [15:24] JimBastard: thats not exactly what i want to do [15:24] JimBastard: i want the client to just attempt to reconnect if the server dies, not broadcast any messages while the server is shutting down [15:24] JimBastard: i just need to be able to get the disconnect event locally in the browser [15:24] JimBastard: when socket.io stops [15:24] JimBastard: is it suppose to automatically reconnect? its not [15:25] flippyhead has joined the channel [15:25] tanepiper: i don't think it'll be the same client id but the dnode client will keep pushing out heartbeats [15:26] tanepiper: but when the server comes back up, yea, you might have an issue around that [15:26] JimBastard: tanepiper: i dont want to maintain that [15:27] pauls has joined the channel [15:27] JimBastard: i just want the client to reconnect [15:27] JimBastard: i need the socket.io disconnect event [15:27] JimBastard: the one that says, im the browser and i cant find my server [15:28] ion- has joined the channel [15:29] Gruni has joined the channel [15:30] tanepiper: in dnode, you might have to try access socket directly if it's not exposed then, looks like only clientDisconnect is there [15:30] tanepiper: https://github.com/LearnBoost/Socket.IO/blob/master/lib/socket.js#L154 <-- event in socket.io [15:31] tanepiper: hmm no it is there: [15:31] tanepiper: https://github.com/substack/dnode/blob/master/lib/web/dnode.js#L88 [15:33] JimBastard: tanepiper: any clue how to bind to that? [15:33] jashkenas has joined the channel [15:34] tanepiper: how about this? https://gist.github.com/823824 (untested) [15:34] mankuthimma has joined the channel [15:36] JimBastard: tanepiper: doesnt seem to ever fire [15:36] JimBastard: im just gonna cheat [15:37] chapel: JimBastard: curious how my one app is performing on nodejitsu? [15:38] chapel: I know its not a high demand app, but stats would be nice :) (feature request) [15:38] JimBastard: chapel: performing how? [15:38] chapel: are there plans to have stats, like cpu/memory usage, bw ? [15:38] JimBastard: yeah, using ganglia [15:38] JimBastard: and analytics [15:39] chapel: ganglia? [15:40] tanepiper: The aliens from Dark Skies? [15:43] JimBastard: maybe it did work [15:43] JimBastard: brb [15:45] Vertice has joined the channel [15:46] LarsSmit has joined the channel [15:46] JimBastard: tanepiper: that discon code works, just takes about 12 seconds [15:46] JimBastard: thanks [15:46] dpickett has joined the channel [15:46] stride: Could not load the tool 'compiler_cxx' in [ <- when make'ing 0.4.0 (tarball version), anybody knows how to fix that? [15:47] jpstrikesback has joined the channel [15:47] unomi has joined the channel [15:48] stride: weird. were there changes in the build stuff between 0.3.7 and 0.4.0? that built just fine on the same box [15:49] dpickett: I'm a huge newb and I'm trying to get capybara-zombie up and running - I installed npm and the zombie module but when I invoke a server I get a "Cannot find module 'zombie'" - am I missing a step? [15:50] chapel: JimBastard: http://news.ycombinator.com/item?id=2210215 << I linked to your latest blog post :) [15:50] stride: dpickett: how did you install it? via npm? [15:50] dpickett: yeah npm install zombie [15:50] JimBastard: thanks chapel , you rock! [15:50] chapel: np, was relevant :P [15:52] dingomanatee has joined the channel [15:52] stride: chapel: is your console gist thing online somewhere? [15:52] sriley_ has joined the channel [15:53] chapel: eh, not atm, I haven't updated it to 0.4.0 either yet [15:53] chapel: got into other projects [15:53] stride: ok :) [15:53] chapel: I made a simple script for my irc client that makes gists as well [15:53] chapel: /gist [15:54] stride: I tried one weird ruby thing that didn't work with authentification [15:54] hij1nx has joined the channel [15:54] chapel: yeah, maybe I will play with that, give me a moment [15:54] stride: ah don't worry about it. I have a browser open all the time anyway [15:54] chapel: heh [15:54] chapel: what irc client do you use? [15:55] dguttman has joined the channel [15:55] stride: irssi [15:55] devrim: when you create your model schemas with mongoose, what is the best way to use them with your native classes class user extends model or this.user.model = new userModel() [15:55] chapel: ah [15:55] chapel: I can see where that might come in handy [15:56] chapel: my irc client can do shell commands, its just annoying to go from applescript to shell [15:56] chapel: so I just made it in applescript [15:56] chapel: Linkinus here on osx [15:57] stride: my irssi runs on a different box than my development systems anyway, I really just wanted a command line gist to get from dev to gist without the detour over whatever client I'm currently using [15:57] stride: they call it 'applescript' :D is it magic? :) [15:57] abstractj has joined the channel [15:58] stride: man. is it me or is 0.4 taking forever to build compared to <= 0.3.7 [15:59] chapel: lol [15:59] chapel: applescript is eh, applescript [15:59] stride: hmkay :) [15:59] chapel: Ive made a few scripts for my client [15:59] chapel: irc client [16:00] chapel: there is hope to use node for an update to the scripting engine [16:00] markstory has joined the channel [16:00] tanepiper: chapel: the cli gist maker sounds interesting ;) [16:01] chrischris has joined the channel [16:01] razvandimescu has joined the channel [16:03] chapel: nothing special, was something to hack together [16:04] tanepiper: can you share it? I would love to be able to write something in my text editor then push it right up :) [16:05] chapel: well let me clean it up, last I had it, it could take a file, or clipboard and upload it [16:05] jpstrikesback1 has joined the channel [16:05] flippyhead_ has joined the channel [16:06] tanepiper: this is exactly why i love nodejs, full blown, all-singing-all-dancing websites down to tiny little utility scripts [16:06] mr_daniel has joined the channel [16:06] chapel: yep [16:06] chapel: exactly [16:06] chapel: node really is javascript on the computer [16:06] chapel: more so than ruby on rails that people see it as [16:07] stride: upload-drunk-pictures.facebook.js [16:07] chapel: haha [16:08] tanepiper: well ruby, rails is pretty much just a horrible web framework, where you end up writing pretty much everything in C anyway [16:08] stride: \o/ build finished. weird [16:12] skohorn has joined the channel [16:14] EricL has joined the channel [16:14] maxpert has joined the channel [16:14] maxpert: hi everyone [16:14] maxpert: :d [16:14] maxpert: any good blogs on nodejs? [16:14] JimBastard: maxpert: howtonode.org, blog.nodejitsu.com [16:15] saschagehlich has joined the channel [16:17] softdrink has joined the channel [16:20] jpstrikesback has joined the channel [16:20] mankuthimma has joined the channel [16:23] jakehow has joined the channel [16:23] dpickett_ has joined the channel [16:24] unomi has joined the channel [16:25] tiemonster: has anyone used jsdoc-toolkit with node? [16:26] dpickett has joined the channel [16:27] liar has joined the channel [16:27] luke` has joined the channel [16:28] luke`_ has joined the channel [16:28] bshumate has joined the channel [16:28] bshumate has joined the channel [16:31] xandrews has joined the channel [16:33] alkavan has joined the channel [16:34] nook has joined the channel [16:36] jpstrikesback1 has joined the channel [16:37] cognominal has joined the channel [16:37] swistak has joined the channel [16:37] raz has joined the channel [16:37] raz: so, i'm peeking at node once again [16:38] raz: what do people commonly use for models and form generation/validation? [16:38] raz: (i.e. what's the web framework du jour?) [16:38] Beretta_V has joined the channel [16:39] tanepiper: If you want django, there isn't really anything like it yet (that's anywhere near mature) [16:39] tanepiper: but there is expressjs which is the most common framework for writing aoos [16:39] tanepiper: *apps [16:39] tanepiper: but it's model/view agnostic [16:39] mhausenblas has joined the channel [16:39] raz: yea i saw that [16:39] raz: i also found geddy, which seems to have some model support [16:39] Vekz has joined the channel [16:40] abstractj has left the channel [16:40] skm has joined the channel [16:46] flippyhead has joined the channel [16:48] dingomanatee: has anyone here got a good model of managing a persistent user in express? I'm not too fond of having to injuect the user in each and every locals stack if there is a way to do it centrally [16:48] vandenoever has joined the channel [16:49] altamic has joined the channel [16:51] tanepiper: dingomanatee: like a redis backend for session? [16:51] chrischr1s has joined the channel [16:51] maxpert: make a centeral object to store ur info as KV props [16:52] tanepiper: https://github.com/visionmedia/connect-redis [16:52] alkavan has joined the channel [16:53] dingomanatee: I can handle the DB / IO [16:53] dingomanatee: I just want to be able to include the user record from session in all my controllers (express/mvc) without having to add it over and over and over. [16:54] dingomanatee: Is there any other way to inject a variable value from session into the view's namespace? [16:54] dingomanatee: Mongo FYI [16:55] dingomanatee: tazemonster: http://howtonode.org/ is the "goto" node blog [16:56] hunterloftis has joined the channel [16:56] FireFly|n900 has joined the channel [16:57] tanepiper: dingomanatee: dynamicHelper ? [16:57] dingomanatee: that sounds good [16:57] dingomanatee: where/what? [16:57] tanepiper: also, just attach a user to req.session, then it's available in all req [16:58] tanepiper: http://expressjs.com/guide.html#app-dynamicHelpers-obj- [16:58] benburkert has joined the channel [16:58] dingomanatee: Yeah - that is excatly it. Thanx. [16:59] dingomanatee: So I should be able to decorate render to include my session user. [17:00] isaacs has joined the channel [17:00] tanepiper: yes [17:00] dingomanatee: awesome. thanks a lot. [17:01] sivy has joined the channel [17:01] ossareh has joined the channel [17:01] wdperson has joined the channel [17:02] postwait has joined the channel [17:03] dingomanatee: That is (if it works) so f***kin killer [17:04] FireFly has joined the channel [17:05] heavysixer has joined the channel [17:05] jchris has joined the channel [17:06] zzak has joined the channel [17:06] zzak has joined the channel [17:08] jakehow has joined the channel [17:08] ziro`: anyone involved in email marketing? got a few q's for pm [17:09] wao has joined the channel [17:11] ajnasz has joined the channel [17:15] Yuffster has joined the channel [17:15] alkavan has joined the channel [17:22] razvandimescu1 has joined the channel [17:23] Max-Might has joined the channel [17:24] chrischris has joined the channel [17:25] liar has joined the channel [17:25] beawesomeinstead has joined the channel [17:27] flippyhead_ has joined the channel [17:27] ziro`: aww :/ [17:27] ziro`: i wanna do some cool shit [17:27] nofxx1 has joined the channel [17:28] sivy has joined the channel [17:29] tanepiper: http://178.63.252.42/ <-- stick this on a nodejs powered server :D [17:31] spaceinvader: it doesn't even host anything though [17:31] spaceinvader: other than a bit of text and the .torrent [17:31] spaceinvader: unless you mean you want a nodejs mirror of the actual content [17:31] aguynamedben has joined the channel [17:33] tfe_ has joined the channel [17:33] tfe_ has joined the channel [17:33] MrTopf has joined the channel [17:34] Bioxyde has joined the channel [17:34] tanepiper: yes :) [17:34] strmpnk has joined the channel [17:35] tanepiper: it's pointless other than it would be behind a nodejs server rather than something like ngnix or apache [17:35] eventi has joined the channel [17:37] syntheze has joined the channel [17:39] Bioxyde has joined the channel [17:40] herbySk has joined the channel [17:43] franck34: v8: "blablo;foobar\nblablo;foobar".match(/bla([^;]*)/); [17:43] v8bot: franck34: ["blablo", "blo"] [17:43] wadey has joined the channel [17:44] franck34: how can i fetch my too "blo" with this regexp ? [17:44] franck34: s/too/twso [17:44] franck34: s/too/two [17:44] dthompson has joined the channel [17:44] franck34: ACTION looking for equivalent of php preg_match_all in js [17:44] tanepiper: F*CKING LOVE GITHUB: https://github.com/blog/793-introducing-the-file-finder [17:44] tanepiper: (press t on windows) [17:45] chrischris has joined the channel [17:45] pyrotechnick has joined the channel [17:45] jeromegn: any guide on updating node.js? for instance... I probably have to recompile all my npm packages... [17:45] spaceinvader: franck34: how about this [17:45] isaacs: jeromegn: yep [17:45] isaacs: jeromegn: npm rebuild [17:45] spaceinvader: v8: "blablo;foobar\nblablo;foobar".match(/bla([^;]*)/g); [17:45] v8bot: spaceinvader: ["blablo", "blablo"] [17:45] franck34: it check blablo, i just want blo :) [17:46] jeromegn: isaacs: cool, last time I tried that, it didn't quit work for some reason, had to remove all packages manually and reinstall them... let's see what happens this time :) [17:46] franck34: v8: "id_1;foobar\nid_2;foobar".match(/id\_([^;]*)/g); [17:46] v8bot: franck34: ["id_1", "id_2"] [17:47] franck34: v8bot: i want ["1","2"] ! [17:47] v8bot: franck34: Use v8: to evaluate code or "`v commands" for a list of v8bot commands. [17:48] lukegalea has joined the channel [17:48] isaacs: v8: "id_1;foobar\nid_2;foobar".match(/(:?id\_([^;]*))/g); [17:48] v8bot: isaacs: null [17:51] boaz has joined the channel [17:51] omni5cience has joined the channel [17:51] jeromegn: isaacs: npm rebuild -> bunch of entries in the console -> couldn't remove files, permission denied, run this command to remove them -> sudo rm ... -> npm command not found [17:52] franck34: tanepiper: "t" .. sexy stuff ! :) [17:52] franck34: spaceinvader: have an idea ? [17:52] spaceinvader: does it have a replace function like sed? [17:53] spaceinvader: how about something like s/id_(\n*)/$1/ [17:53] franck34: wow [17:54] Gruni has joined the channel [17:54] mikeal has joined the channel [17:54] franck34: little bit loosed [17:55] franck34: cause my real stuff is more complex than this sample [17:55] franck34: thx spaceinvader [17:55] franck34: ACTION googling [17:56] spaceinvader: $ echo -e "id_1;foobar\nid_2;foobar" | perl -pe 's/.*id_(\d*).*/$1/' [17:56] spaceinvader: 1 [17:56] spaceinvader: 2 [17:56] Bioxyde has joined the channel [17:56] spaceinvader: kinda getting there [17:57] perlmonkey2: Anyone know why this wouldn't work in Mongoose but works in MongoDB? Show.find({"category.title":"cattitle"} [17:57] franck34: spaceinvader: hehehehe ! just wondering if i can make this using a simple js stuff loool [17:58] franck34: got an idea [17:58] perlmonkey2: Querying an embedded array's index works in mongo, but the exact same query in mongoose returns nothing. [17:58] franck34: v8: "id_1;foobar\nid_2;foobar".match(/id\_([^;]*)/g); [17:58] v8bot: franck34: ["id_1", "id_2"] [17:58] jeromegn: isaacs: happened because I didn't sudo npm rebuild, worked when I did. [17:58] franck34: v8: "id_1;foobar\nid_2;foobar".match(/id\_([^;]*)/); [17:58] v8bot: franck34: ["id_1", "1"] [17:58] hwinkel has joined the channel [17:58] isaacs: jeromegn: kewl [18:00] bmavity has joined the channel [18:03] ryanfitz has joined the channel [18:04] chapel: hmm [18:04] chapel: anyone have experience with process.stdin? [18:05] LarsSmit has joined the channel [18:05] franck34: no way to fetch ["1","2"] with a single js line :( [18:05] markwubben has joined the channel [18:06] franck34: spaceinvader: you got the better idea [18:06] jetienne has joined the channel [18:07] franck34: chapel: me, but really little [18:07] chapel: hmm [18:07] chapel: well I just want to know if there is any data sitting on stdin [18:08] chapel: ie if it was piped in [18:08] chapel: but eh [18:08] chapel: just typing that out made me realize something [18:08] franck34: it's often the case ;) [18:09] tanepiper: chapel: i think stdin get .pause() you have to .resume() it or something? don't quote me on it though :) [18:09] chapel: yeah, you have to resume it [18:09] chapel: but too problematic [18:09] chapel: to deal with it the way I was thinking of doing it [18:10] themiddleman has joined the channel [18:10] lukegalea has joined the channel [18:11] syntheze has left the channel [18:13] franck34: mpf! http://nodejs.org/docs/v0.4.0/api/string_decoder.html [18:14] franck34: no doc [18:14] jetienne_ has joined the channel [18:14] Solsys has joined the channel [18:14] tanepiper: franck34: hit up micheil :) [18:14] tanepiper: or just hit him [18:14] tanepiper: either will do [18:14] franck34: ACTION looking for equivalent of php html_entity_decode() if available with node [18:16] maxpert: hey everyone how can i know node version at runtime [18:16] maxpert: ? [18:16] maxpert: I am using http.createClient in https://github.com/maxpert/Reston will that hurt ? [18:17] franck34: micheil: hi, just for memory, http://nodejs.org/docs/v0.4.0/api/string_decoder.html -> empty doc [18:17] maxpert: it works in node 0.4.0 though [18:17] tanepiper: process.(something) [18:17] tlrobinson_ has joined the channel [18:17] tanepiper: http://nodejs.org/docs/v0.4.0/api/process.html#process.version [18:17] chapel: who has linux with newest node on it? [18:17] maxpert: thanks tanepiper [18:17] tanepiper: chapel: me [18:17] chapel: mind checking something for me? [18:18] tanepiper: fire away [18:18] chapel: would like to see what the output of os.type() is for linux [18:18] maxpert: will http.createClient hurt in node future versions? chapel ??? [18:18] Me1000 has joined the channel [18:18] chapel: maxpert: http.createClient is being depreciated [18:18] chapel: use http.request [18:18] unomi has joined the channel [18:18] unomi has joined the channel [18:18] tanepiper: chapel: 'Linux' [18:19] chapel: kk [18:19] chapel: hmm [18:19] chapel: well I am checking for os version to see what type of clipboard command to use [18:19] tanepiper: maxpert: yes, but it's guarenteed backwards compatible in node 0.4 [18:19] Solsys has joined the channel [18:19] tanepiper: it probably will break in >= 0.5 [18:19] maxpert: tanepiper: so i should be putting checks for tis thing [18:20] maxpert: tanepiper: how can I run two parallel versions of node? [18:20] tanepiper: if (http.createClient) should do [18:20] tanepiper: maxpert: you can use `n` [18:20] tanepiper: https://github.com/visionmedia/n [18:20] tanepiper: that way you can swap between versions on a machine [18:20] franck34: can we considere that since node will not have 1.0 version, many things can be broken each releases ? [18:21] maxpert: tanepiper: thanks chum [18:21] tanepiper: np [18:21] maxpert: tanepiper: feedback would be even better [18:21] maxpert: https://github.com/maxpert/Reston [18:22] tanepiper: maxpert: something like this, you definetly want to be supporting 0.4 because [18:22] tanepiper: a) Connection pooling b) https support [18:22] maxpert: yaa i am already looking for some flexibility now since first base is already stable [18:23] maxpert: tanepiper: honestly speaking i wanna brag on some blog about its file multipart support [18:23] tanepiper: one idea is to have a if statement around requires, check if you are using 0.2 or 0.4, then require based on that if you need to seperate out chunky code [18:23] maxpert: but i cant seem to find some apporpriate place [18:23] tanepiper: but honestly, most people will update to 0.4 [18:24] maxpert: tanepiper: true i would like it to be backward though [18:24] tanepiper: maxpert: accept-ranges support? [18:24] maxpert: tanepiper: already fighting on that [18:24] tanepiper: lemme give you some fugly code for that [18:25] tanepiper: https://gist.github.com/80dd2feddfc260005292 [18:25] lukegalea has joined the channel [18:25] maxpert: tanepiper: sure [18:25] tanepiper: this does use the old client stuff [18:25] sholmes has joined the channel [18:25] tanepiper: but should be easy to update to the new stuff [18:25] tanepiper: also, this has no checking on the number of clients, so you can quite happily open 1000 connections D: [18:26] tanepiper: using this I downloaded the Ubuntu ISO in 15 seconds at @ 30mbps [18:26] maxpert: tanepiper: lol [18:27] maxpert: tanepiper: well i had upload multipart support but yes i've to ultimately put download support so ur code would be really useful [18:28] zemanel_ has joined the channel [18:28] maxpert: tanepiper: can u fork and introduce this and gimme a pull request? [18:28] EricL: I am trying to debug a node.js plugin I wrote. In gdb I'm trying to find the value of a Local var using print foo->val_. This isn't proving very fruitful. How can I see what the actual value is and not a memory address (I have compiled with -g). Thoughts? [18:28] otaku_coder has joined the channel [18:28] tanepiper: maxpert: tbh don't really have time, working on two commercial projects just now [18:28] w0rse has joined the channel [18:29] maxpert: lol [18:29] maxpert: tanepiper: no issues :D will do that [18:29] maxpert: :D [18:29] paulrobinson has joined the channel [18:29] cronopio has joined the channel [18:30] chapel: tanepiper: do you have xclip? [18:31] tanepiper: no, i'm in windows but have nodejs running on server vms [18:31] tanepiper: desktop linux doesn't like this laptop [18:32] chapel: hmm [18:32] pdelgallego has joined the channel [18:33] nmtmason has joined the channel [18:33] nofxx has joined the channel [18:36] franck34: maxpert: i'm now following your project. interesting, good job man [18:36] [[zz]] has joined the channel [18:36] maxpert: franck34: thanks man do contribute :D [18:36] perlmonkey2: In Mongoose, anyone know why Blog.find({"comment.title": "a title"},...); would return nothing but the equiv mongo shell find would work? I'm getting a "non_object_property_call" error. [18:37] kriskowal has joined the channel [18:38] franck34: any idea if node is able to decode html stuff ? (ie   -> ' ' etc) [18:38] perlmonkey2: The first of the finds is the failing one http://pastebin.com/c89SJzRu [18:39] franck34: if not i have js code to do that, but i just want to not reinvente the well [18:39] erwe has joined the channel [18:40] erwe: when's express gonna support node 0.4? [18:40] Aria has joined the channel [18:40] cronopio: perlmonkey2: in mongoose find call a function passed as second parameter, its a callback function, when find find something [18:40] cronopio: erwe: ++ [18:41] franck34: 0.4 has been released few days ago, let's wait a little ! [18:41] tanepiper: franck34: http://www.strictly-software.com/htmlencode [18:41] perlmonkey2: cronopio: in my pastebin isn't my second param a function? [18:41] tanepiper: not in nodejs, but can probably be ported easily [18:42] tanepiper: just exports.Encoder = [18:42] franck34: thx a lot [18:42] erwe: franck34: ok ty [18:43] cronopio: perlmonkey2: sorry, i dont see your pastebin. in your example: Blog.find({"comment.title": "a title"}, functin(result){console.log(result)}) [18:43] spaceinvader: express does support node 0.4? [18:43] spaceinvader: at least it works for me [18:43] cronopio: s/functin/function [18:43] francescop: it works for me [18:43] spaceinvader: cloud9 makes my V8 crash though :/ [18:43] lukegalea has joined the channel [18:43] spaceinvader: http://pastie.org/1553894 [18:44] liar has joined the channel [18:44] spaceinvader: which reminds me, what do people like to use to write javascript? [18:44] dnolen has joined the channel [18:44] Aria: I use vi. [18:44] spaceinvader: it'd be cool to have an editor that is aware of jquery, google apis etc [18:44] spaceinvader: so the syntax checking / suggestion is real good [18:45] perlmonkey2: cronopio: that worked for you? The first param of the find callback was an err I thought? When I inspect it, it is an error type. [18:45] erwe: i use vim but i think aptana supports js [18:45] otaku_coder: I'm currently trying to write my own auth lib for node. In PHP I'd just write a class, then instantiate that class and use the functions. what's the equivalent in node? I've created an auth prototype class but incliding it throws errors [18:46] franck34: tanepiper: your htmlencode stuff is working like a charm ! 10sec to use it in node lol [18:46] perlmonkey2: otaku_coder: the nodepad example on github has a pretty good auth implementation. [18:46] erwe: I'm not sure btw [18:46] spaceinvader: aptana is a bit huge [18:46] franck34: Aria: same [18:46] otaku_coder: perlmonkey2: I'll take a look, thanks [18:46] spaceinvader: maybe I should be a total hipster and use Textmate [18:47] jetienne_ has joined the channel [18:47] erwe: spaceinvader: that's why i use vim =P [18:47] erwe: i don't like 300mb ides [18:48] franck34: tanepiper: today i've played with google chrome extension, with a 'background' page connecting to a node server via socket.io. wtf everything is working without headeck [18:48] franck34: ACTION falling in love with node [18:49] clarkfischer has joined the channel [18:49] franck34: i have to start evangelisation of node in france seriousl [18:50] jetienne_: franck34: where do you live [18:51] kuhrt has joined the channel [18:51] jetienne_: erwe: on mac this is like 2gbyte for the ide :) [18:51] sholmes: where can I find the documentation on request.redirect? [18:51] sholmes: it's not here http://nodejs.org/docs/v0.4.0/api/http.html [18:52] erwe: jetienne_: xcode? [18:52] Aria: Which library are you using? node's http directly, or express or connect or something on top of it? [18:52] franck34: jetienne_: montpellier/south of france [18:52] erwe: i wish i had a mac [18:52] erwe: =( [18:52] jetienne_: erwe: yep [18:53] jetienne_: franck34: several js evens in paris. montpellier i udnno [18:53] sholmes: err, response.redirect [18:53] sholmes: Aria: I noticed this was used in express [18:53] franck34: jetienne_: yep i saw a js conf in january. I think it's the first one like that. Just a beginning [18:53] Aria: Then look in express's doc. [18:53] sholmes: Hmm, so it's an express thing. Okie. [18:54] jetienne_: franck34: just did a talk at "paris html5 game jam". the conf was about html5 so js is not far [18:54] maxpert: since which version node supports https? [18:54] Aria: maxpert: A long time, but 0.4 made it work right. [18:55] otaku_coder: can socket.io access session variables? [18:55] spaceinvader: hmm, does xcode have good js support? [18:55] erwe: good, i needed https [18:55] Aria: xcode is weird in general. It syntax highlights js, but ... that's about it. [18:55] franck34: jetienne_: you did it ? cool [18:55] franck34: jetienne_: http://www.systematic-paris-region.org/fr/actualites/javascript-en-entreprise [18:55] maxpert: so if I am to support HTTPS i should make it 0.4 +? [18:55] franck34: jetienne_: first conference which was speaking of node [18:56] franck34: otaku_coder: can you explain more ? [18:56] franck34: maxpert: seem's yes [18:57] jetienne_: http://twitter.com/#!/parisjs http://html5gamejam.org/?page=techtalks [18:57] jetienne_: franck34: ryah cames at paris to present node last fall [18:59] Remoun has joined the channel [19:01] sholmes: In express, what will req.body be if the bodyDecoder middleware is not present? [19:01] otaku_coder: franck34: I'd like to retrieve a users session ID from a socket connection if possible. But I just realised I could capture that on login [19:04] sholmes: Does socket.io use the x-requested-with HTTP header [19:04] sholmes: ? [19:05] tanepiper: sup otaku_coder [19:06] marcosvm has joined the channel [19:08] lukegalea has joined the channel [19:09] tanepiper: otaku_coder: you using express/connect as well? maybe this? https://github.com/bmeck/session-web-sockets [19:09] tanepiper: nto been updated in a while but might get you started [19:09] tanepiper: https://groups.google.com/forum/#!topic/socket_io/fAz_tWIbOmU was the link i got it from, there are other suggestions too [19:13] themiddleman has joined the channel [19:15] jkp has joined the channel [19:15] zylo has joined the channel [19:15] polotek has joined the channel [19:15] marcosvm has joined the channel [19:17] polotek has left the channel [19:18] aklt has joined the channel [19:18] polotek has joined the channel [19:18] benburkert has joined the channel [19:20] zemanel has joined the channel [19:21] lukegalea has joined the channel [19:22] MikeMakesIt has joined the channel [19:24] Sebmaster has joined the channel [19:25] tmpvar has joined the channel [19:26] hwinkel has joined the channel [19:28] sholmes: what's the difference between collection and object in res.partial in express? [19:29] hornairs has joined the channel [19:29] amerine has joined the channel [19:32] MikeMakesIt has joined the channel [19:33] tanepiper: object is an object, collection is an array of objects within the object [19:34] tanepiper: https://github.com/visionmedia/express/tree/master/examples/partials [19:35] sivy has joined the channel [19:36] mjr_ has joined the channel [19:37] fly-away has joined the channel [19:38] srid has joined the channel [19:38] jimt has joined the channel [19:39] jakehow has joined the channel [19:39] lukegalea has joined the channel [19:42] yumike has joined the channel [19:42] benburkert has joined the channel [19:43] franck34: is there a pause() or sleep() function in node? [19:45] franck34: of course not lol [19:47] franck34: so [19:47] franck34: got a noob question [19:47] Aria has joined the channel [19:48] franck34: got a node program, the goal is to fetch data from a webpage every X seconds. Only that. If i setInterval or setTimeout my function, node continue after that, but it's the end of the file so it's exiting .. [19:48] jpstrikesback has joined the channel [19:49] polotek: franck34: gist some code you're using [19:49] polotek: setInterval and setTimeout should prevent node from exiting [19:49] polotek: as long as there's a job on the event queue node should continue [19:50] kkaefer: when a C++ function accepts a callback function, should i call .Dispose() after calling the callback? or just MakeWeak? [19:50] kkaefer: ah never mind [19:50] mynyml has joined the channel [19:50] kkaefer: I have my own Permanent handle of the function anyway [19:51] kkaefer: so I can safely call Dispose [19:51] franck34: polotek: https://gist.github.com/824050 [19:51] tilgovi has joined the channel [19:51] franck34: polotek: don't remember if it's setInterval(delay,fn) or setInterval(fn,delay) [19:52] mynyml: seems stdout isn't getting flushed properly when an error is thrown? or maybe i'd doing it wrong: https://gist.github.com/824049 [19:52] polotek: franck34: function comes first in setTimeout/setInterval [19:52] franck34: ok [19:52] mynyml: seems related to http://groups.google.com/group/nodejs-dev/browse_thread/thread/4e3fc73506efb59b?pli=1, but that thread doesn't mention a workaround [19:53] polotek: also you don't need to use a string, just pass the function name setInterval(checkPrices, 2000) [19:53] franck34: yeah, it's better [19:53] franck34: thx you [19:53] polotek: franck34: don't know about the httpclient module you're using, but this looks okay at first glance [19:54] polotek: are you getting data output from the http responses? [19:54] franck34: it's working [19:54] franck34: yes [19:54] franck34: everything fine now [19:54] polotek: ok [19:54] Solsys has joined the channel [19:55] floby has joined the channel [19:55] floby has left the channel [19:56] polotek: mynyml: I'm not sure, but it makes sense that node exits immediately if an uncaught error bubbles all the way up to the top of the stack [19:56] comster has joined the channel [19:56] Aria has joined the channel [19:56] vandenoever: ACTION is trying to run node in a add_custom_target(), but getting Error: Socket is not writable [19:57] polotek: wait, maybe i'm not understanding your issue. [19:57] mynyml: polotek: you think so? without flushing stdout? ... either way it might, but then i don't see the error message [19:57] polotek: vandenoever: not sure what that means. what are you doing? [19:58] vandenoever: polotek: i want to run unit tests in node and use CMake as build system [19:58] vandenoever: so CMake should run "node mytest.js" [19:58] franck34: mynyml: btw i notice something it's the shell output which is wrong. Happend sometime if the message displayed don't end with \n [19:58] polotek: vandenoever: not familiar with the cmake build system [19:58] pHcF has joined the channel [19:59] franck34: mynyml: you can test by adding another console.log('bla'); [19:59] mynyml: francescop: right, if i add any console.log('') call before the raise, the error message does get printed [19:59] mynyml: franck34: ^ [19:59] franck34: :) [20:00] mynyml: not quite the right fix though [20:00] tmpvar: does anyone know of a node addon that hooks up with a dynamic lib? [20:01] mynyml: wish i could understand the behaviour better [20:01] franck34: what's a dynamic lib ? [20:01] perlmonkey2: Any mongoose ninjas out there than can show a quick example of using find on an embedded docs index? [20:01] abraham has joined the channel [20:01] torvalamo has joined the channel [20:01] mynyml: i tried adding process.stdout.flush() as an exit cb, but that didn't help [20:01] perlmonkey2: or will I just have to use the underlying mongodb driver for such queries? [20:01] franck34: mynyml: flush don't add \n [20:02] polotek: tmpvar: if you find one let me know [20:02] ashiso has joined the channel [20:03] polotek: mynyml: I'm getting all output [20:03] polotek: with or without the console.logs the error prints [20:04] polotek: I'm running latest master of node updated this morning [20:04] mynyml: mine version's a bit older. that might explain it [20:04] tmpvar: polotek, word. im either going to find one or write one [20:04] polotek: tmpvar: I've been meaning to get up to speed on the addon system [20:05] polotek: but got stuck getting up to speed on C building and linking [20:05] polotek: :) [20:05] polotek: writing node addons is pretty simple code-wise [20:05] polotek: but understanding how it actually gets loaded and run in node is a bit esoteric [20:06] kriskowal has joined the channel [20:06] mynyml: polotek: i'm running v0.3.1 =/ [20:06] polotek: tmpvar: my guess is you could load the dynamic lib in your addon code using the usual methods [20:06] polotek: and the only wrinkle might be where node would look for the .so file [20:06] brian_irish has joined the channel [20:06] tmpvar: right, or dylib in my case [20:07] polotek: oh right :/ that might be another wrinkle [20:07] strmpnk has joined the channel [20:07] tmpvar: yeah.. [20:11] polotek: I submitted a proposal for nodeconf to talk about addons [20:11] polotek: if it gets accepted I'm going to dig into this subject in depth [20:12] ossareh has joined the channel [20:12] vandenoever: the problem is in writing with console.log(), that gives a problem when node is running from cmake [20:12] yhahn has joined the channel [20:12] vandenoever: throw new Error('Socket is not writable'); [20:13] vandenoever: which is strange, because normal error messages (e.g. wrong syntax) do get through [20:14] cloudhead has joined the channel [20:14] vandenoever: writing to stderr is fine, but to stdout is not, it works fine with commands other than node, though [20:15] zzak: polotek++ [20:15] v8bot: zzak has given a beer to polotek. polotek now has 4 beers. [20:17] Ond has joined the channel [20:17] MattJ has joined the channel [20:18] Dee has joined the channel [20:18] Tim_Smart has joined the channel [20:18] nofxx has joined the channel [20:21] tilgovi: anyone know of a nice priority queue implementation? [20:21] tilgovi: maybe a nice minheap in js [20:22] jimt_ has joined the channel [20:22] spaceinvader: is v8bot a node.js irc client? [20:23] tanepiper: `v [20:23] tilgovi: has no one made a good collections lib for js yet? [20:23] tanepiper: spaceinvader: it's a nodejs powered bot, source is on github [20:23] polotek: tilgovi: sounds like a nice project for you :) [20:23] tilgovi: polotek: agreed [20:23] Ond: You mean like underscore? [20:23] aurynn has joined the channel [20:23] tanepiper: underscore + backbone [20:24] tmpvar: polotek, ok.. so its pretty easy if you have a library that supports your architecture ;) [20:25] vineyard has joined the channel [20:25] tmpvar: https://gist.github.com/824083 [20:25] tilgovi: tanepiper: Ond: no... that gets us a lot of useful methods for working with lists but it doesn't get us efficient datastructures for things like priority queues [20:25] otaku_coder: tanepiper: hi. session-web-sockets will do the job, thanks [20:25] dgathright has joined the channel [20:26] polotek: tmpvar: cool. so then you probably just need some standard macros for deciding if it's a dylib or so [20:26] polotek: ACTION is so bad at C/C++ [20:26] kuhrt has joined the channel [20:26] otaku_coder: perlmonkey2: that nodepad example is good, but all of the auth code is in the main app.js file. I'd like to write it as a module that I can then share/include in other projects. What's the best way to do that? [20:27] tilgovi: how's v8 store and index objects that you treat like a map (string -> X) [20:27] tilgovi: I remember hearing that it tries to guess how you're going to use an object and does different things [20:27] polotek: tmpvar: actually if we get a handle on this I think it would be good to integrate it into node core [20:28] polotek: have a service for loading dynamic libs in addons [20:28] tanepiper: wasn't there already something like that? [20:28] polotek: tanepiper: ? [20:28] tilgovi: polotek: node-ffi [20:29] tilgovi: ? [20:29] tanepiper: a library that let you bind to arbatery c++ libs [20:29] tilgovi: node-ffi [20:29] polotek: that's not what I mean [20:29] paulrobinson has joined the channel [20:29] Ond: arbitrary, tanepiper [20:29] polotek: I mean if you're building your own addon and you need to load a binary as a dynamic lib [20:29] tanepiper: Ond: it's nearly 9pm, i've been up since 8am and i've not had my dinner yet :p [20:29] tilgovi: polotek: still sounds like node-ffi to me... [20:30] brianmario has joined the channel [20:30] Ond: You don't have to make excuses for yourself. [20:30] polotek: node-ffi is for surfacing C services in js [20:30] kuhrt: is there a way for node on the command line to execute coffeescript files? i have a simple test server in a coffee file which i h ave to import into a .js file as a module right now in order to run > node server.js, it would be nicer if I could just run the cs file directly like > node server.coffee, is this possible? [20:30] polotek: that's not what I'm talking about at all [20:30] tilgovi: oh [20:30] polotek: if node-ffi also includes the functionality I'm talking about, that would be sweet [20:30] Aria: You want a wrapper around dlopen or the current platform's equivalent, then? [20:31] mynyml: Kudos: > coffee server.coffee [20:31] tilgovi: polotek: I thought so.... ffi.Library(symbols to load) [20:31] Aria: ldopen, ldobj, whatever the OS calls it? [20:31] mynyml: kuhrt: ^ [20:31] polotek: Aria: yeah [20:32] tilgovi: polotek: node-ffi will load a dynamic library at runtime and make a best effort to wrap any symbols you give it. you just have to provide some type information. [20:32] tanepiper: kuhrt: you can also use --nodejs switch to pass stuff to nodejs, like debug but node itself won't run coffeescript from the command line [20:32] tanepiper: you can write a .js file that loads coffeescripts [20:32] polotek: tilgovi: thanks, I'll check it out [20:32] polotek: it's still not exactly the same [20:32] polotek: because maybe you don't need to actually expose the lib as js [20:33] tc77 has joined the channel [20:33] tilgovi: polotek: what do you mean? [20:33] polotek: it sounds like tmpvar wants to use it internal to his C addon and then expose custom functions [20:33] marcello3d has joined the channel [20:33] kuhrt: tanepiper: ok thanks for clearing that up, so no matter what at the end of the day from the cc i must offer $ node [...] a .js file [20:33] polotek: tilgovi: for example, libxmljs wraps libxml2 [20:33] marcello3d: does anyone here use node-canvas? [20:33] polotek: it's statically built [20:33] tilgovi: ahh [20:34] polotek: but if I had a dynamic lib and wanted to load that [20:34] polotek: I could use it in my addon, and then surface my own api in js [20:34] tanepiper: kuhrt: yes, nodejs can only run javascript, coffeescript is build on top of nodejs [20:34] polotek: but node-ffi would try to wrap all of the functions in libxml2 [20:34] polotek: which is... a lot [20:34] tilgovi: polotek: so node addons that are not statically compiled? [20:34] tilgovi: polotek: no it won't [20:34] kuhrt: tanepiper: yup, ok thanks a lot! cheers [20:34] tilgovi: just the ones you ask for [20:34] tilgovi: and provide type information for [20:35] tilgovi: it lets you make a binding library without writing any c, basically [20:35] polotek: hmmm, node-ffi looks very interesting [20:35] tilgovi: also, I just read the README for it about 15 minutes ago. I hadn't seen it before. [20:36] polotek: It's been on my list to check out for a while [20:36] polotek: I'll have to dig in a bit [20:36] polotek: honestly I want to re-architect libxmljs around something like this [20:37] polotek: so it can be more js and less C/C++ [20:37] tilgovi: it's significantly slower, though [20:37] polotek: tilgovi: yeah that was going to be my next comment [20:37] polotek: I ran libxmljs through valgrind heavy memory leak checks [20:37] polotek: I don't know much about it, but it basically crapped all over the place [20:38] tilgovi: scary. [20:38] tilgovi: that should be investigated [20:38] polotek: there is a lot of going back and forth between js and C land [20:38] polotek: I thought it only needed dlopen once to load the lib, but maybe there's something I'm missing [20:38] polotek: because it seemed to call it a lot [20:38] tilgovi: it's *possible* libxml2 does strange things with allocations that are safe and not leaky but just confusing to valgrind. Though a modern valgrind should be pretty smart and the libxml2 authors should use valgrind and keep it quiet :) [20:39] wadey has joined the channel [20:39] tilgovi: though I'm betting the rpoblem is the wrapper, not libxml2 [20:39] polotek: no the leaks weren't in libxml2, they were in the node code that was loading the dynamic addon [20:39] polotek: yes [20:44] JimBastard has joined the channel [20:44] marcello3d: geezus. there are so many. https://github.com/ry/node/wiki/modules [20:44] JimBastard: has anyone used https://github.com/bmeck/node-sfml ? [20:45] polotek: marcello3d: yeah but we need a better scheme for tracking them [20:45] polotek: many of those are abandoned or broken on recent versions [20:45] jetienne_: in doxm where is the jsdoc parser ? [20:45] marcello3d: and rating/comparing them, a lot are doing the same thing [20:46] darvvin has joined the channel [20:46] marcello3d: I'm trying to figure out how to take an image in gridfs, resize it, and send down to the client [20:47] eee_c has joined the channel [20:47] marcello3d: but module documentation is pretty bad, I'm mostly looking source-code (which is fine until I realized some modules are defining methods in c++) [20:48] gf3 has joined the channel [20:48] polotek: marcello3d: the node ecosystem is fun [20:48] mynyml: polotek: btw, i get the same bug in v0.4 [20:49] mynyml: on linux [20:49] polotek: mynyml: think it's related to cmake? maybe you should submit a ticket [20:50] mynyml: related to cmake? i was refering to the Error not printing to stdout issue [20:50] lukegalea has joined the channel [20:50] Yuffster has joined the channel [20:50] marcello3d: coming from java/scala land, the abundance of native code is a little frightening ;-) ... with respect to stability and security [20:51] skm has joined the channel [20:52] polotek: mynyml: sorry, got you mixed with the other guy talking about cmake [20:52] mynyml: i figured =) [20:53] jetienne_: --pending || sys.print(foot, ''); mouaouaou :) [20:55] JimBastard_ has joined the channel [20:57] JimBastard_: if we cant get node to play an audio file in the next hour or so im gonna have to start offering rewarding [20:57] JimBastard_: rewards [20:57] JimBastard_: cash ones [20:58] jetienne_: JimBastard_: isnt that you who played with "say" ? [20:58] JimBastard_: jetienne_: yes [20:58] JimBastard_: we are doing a hack event now [20:58] JimBastard_: we need low latency audio playback [20:58] JimBastard_: or else our project wont work [20:58] marcello3d: chuck :D [20:58] marcello3d: http://chuck.cs.princeton.edu/ [20:59] JimBastard_: marcello3d: something with node bindings [20:59] JimBastard_: that will playback a wav file [20:59] marcello3d: picky [21:00] marcello3d: I think it supports sockets [21:00] marcello3d: you could talk to it from node [21:00] marcello3d: but I could just be making that up [21:02] JimBastard_: irrKlang should work, but it doesnt work on 64bit [21:02] polotek has left the channel [21:02] JimBastard_: we are trying 32bit node now, but having issues getting irrKlang to compile still [21:04] marcello3d: async sure makes for weird stacktraces [21:05] Aikar: http://aikar.co/dropbox/IMAG0232.jpg new decal ftw [21:05] jimt has joined the channel [21:05] pdelgallego has joined the channel [21:05] mlins has joined the channel [21:06] Aikar: http://www.amazon.com/Android-pissing-apple-funny-sticker/dp/B003KXEYQU if you want it [21:06] marcello3d: that's so clever and hilarious. [21:07] razvandimescu has joined the channel [21:08] lukegalea has joined the channel [21:09] heavysixer has joined the channel [21:14] ryanfitz has joined the channel [21:17] davidc_ has joined the channel [21:17] davidc_ has joined the channel [21:19] jetheredge has left the channel [21:19] adulteratedjedi has joined the channel [21:22] lukegalea has joined the channel [21:24] Sofox has joined the channel [21:25] Sofox: Hey, I'm thinking of starting a project, I've got a few questions about node.js. [21:25] markus__ has joined the channel [21:25] stride: Sofox: not much going on in here right now, just ask and stay around :) [21:26] Sofox: It's a long polling server right? It will allow communication between sever and client in real time rather than requiring constant poling with ajax? [21:26] Sofox: Thanks Stride! [21:26] Sofox: I'm thinking of having an online bord game using with a chat window on the side. [21:26] Sofox: I'd prefer to keep it as real time as possible. [21:27] Sofox: And my research indicates that this requires something called Comet, AKA long polling. [21:27] Sofox: Apparently this requires a server (Apache for example is inadequate), and node.js is one of these servers. [21:27] Sofox: Am I on the right track here? [21:28] JimBastard_: Sofox: use socket.io [21:28] stride: a bit of technology mixing but yeah, the direction is right :) [21:28] JimBastard_: you'll be fine [21:28] jeromegn: Sofox: Hmm, kind of. You should look into socket.io [21:28] Sofox: I've been looking at this list for guidance: http://cometdaily.com/maturity.html [21:28] Sofox: Socket.io you say? [21:28] yhahn has left the channel [21:29] jeromegn: Sofox: http://socket.io/ [21:29] Sofox: Alright, so that's what'll give me my game server and real time communication with the web sever via javascript? Thanks! [21:29] stride: Sofox: you have the http server which reacts on messages from your clients, different transport mechanisms (long polling is one of them) and a client side for those transports. socket.io combines a bunch of transports that are supported by older browsers as well as the newer websockets transport [21:29] Steven_ has joined the channel [21:29] softdrink has joined the channel [21:30] Sofox: Stride: Will it include the server to respond to the socket.io requests? [21:31] Sofox: Oh, I get it, socket.io works with node.js. [21:31] benburkert has joined the channel [21:32] Sofox: Or no, it works with Socket.IO-node. [21:33] lukegalea has joined the channel [21:36] mikedeboer has joined the channel [21:36] devrim: i want to hire someone for a few hours on a generous hourly rate to get us going with mongoose, pm me if interested.. [21:37] niklasfi has joined the channel [21:37] niklasfi: is require(...) ok with circular dependencies? [21:38] MikhX has joined the channel [21:38] Sebmaster has joined the channel [21:38] adulteratedjedi has joined the channel [21:38] eml-mobile has joined the channel [21:39] themiddleman has joined the channel [21:44] derferman has joined the channel [21:44] JimBastard: holy crap, i think we got audio playback working out of node [21:44] halfhalo: \o/ [21:45] Aria: Sweet! I keep meaning to do that. [21:45] lukegalea has joined the channel [21:45] uho has joined the channel [21:46] eventi has joined the channel [21:47] warz has joined the channel [21:48] eventi: having an expresso problem with assert.response - not passing the data in a POST or PUT - can anyone help? [21:50] aho has joined the channel [21:51] uho: I'm trying to use sessions with express but "req.session" is undefined. Here's my code http://pastie.org/1557268 [21:52] jetienne_ has joined the channel [21:52] eventi: Here's mine: http://pastebin.com/TN7FDgWR [21:54] perlmonkey2 has joined the channel [21:55] softdrink has joined the channel [21:56] raak has joined the channel [22:00] lukegalea has joined the channel [22:06] adulteratedjedi has joined the channel [22:06] webr3 has joined the channel [22:06] webr3: anybody done, or working on, an indexeddb implementation for node? [22:07] devongovett has joined the channel [22:07] darvvion has joined the channel [22:08] jkp has joined the channel [22:12] EricL has joined the channel [22:13] davidc_ has joined the channel [22:13] jakehow has joined the channel [22:15] mscdex: webr3: any particular reason you're looking for indexeddb? [22:15] webr3: so I can code to the same api on client and server side [22:16] EricL: I am trying to debug a node.js plugin I wrote. In gdb I'm trying to find the value of a Local var using print foo->val_. This isn't proving very fruitful. How can I see what the actual value is and not a memory address (I have compiled with -g). Thoughts? [22:16] yozgrahame has joined the channel [22:16] janm has joined the channel [22:17] mscdex: what browsers support indexeddb? [22:19] webr3: firefox 4 and chrome (for now) [22:19] robotarmy has joined the channel [22:19] jetienne_: indexeddb == sql ? [22:20] adulteratedjedi has joined the channel [22:20] eee_c has joined the channel [22:21] nmtmason has joined the channel [22:21] Aria: Nope. K/V with indexes. [22:22] jetienne_: ok im super tired but wasnt this localstore ? [22:23] jamescarr has joined the channel [22:23] jetienne_: ok i will sleep [22:24] arpegius has joined the channel [22:25] visnup has joined the channel [22:27] malkomalko has joined the channel [22:29] arpegius has joined the channel [22:29] eventi: is there a channel for express? [22:29] yozgrahame has joined the channel [22:29] eventi: two of us have express questions (well, mine's expresso [22:30] versicolor has joined the channel [22:32] Ond: A lot of people here are acquainted with express, eventi [22:32] Ond: Not sure if there's a dedicated channel. What's your question anyway [22:33] apoc: hmm I've downloaded a website, now I want to remove certain elements by Xpath/css selectors, what xml parser can do this? [22:34] uho: Ond: I'm having trouble using sessions. http://pastie.org/1557268 [22:34] eventi: http://pastebin.com/TN7FDgWR - I'm trying to POST or PUT but the body of the req is empty when it gets to express [22:34] Ond: Are you using express.bodyDecoder() ? [22:34] eventi: yes [22:35] eventi: works fine with curl -XPUT -d'mydata=foo' [22:35] eventi: I'm sure the problem's with expresso [22:35] Ond: When does it not work [22:35] Ond: Yeah probably [22:35] eventi: Lemme make a tiny complete app - [22:35] perlmonkey2: Anyone writing their own DAL for MySQL? [22:36] aurynn: DAL? [22:36] uho: database access layer? [22:37] sechrist: that's called SQL queries [22:37] perlmonkey2: models that can read and write themselves to the db. [22:37] perlmonkey2: hah [22:37] jmwinn21 has joined the channel [22:38] perlmonkey2: Realized that unless I need "web scale" then nosql was probably a bad idea. But there doesn't seem to be a MySQL ORM ready for prime time. [22:40] charlenopires has joined the channel [22:40] Ond: Not sure, uho. Works fine for me (without all the non-session stuff) [22:40] aurynn: I write SQL [22:40] aurynn: and I still wonder what "Web scale" actually means [22:41] muk_mb has joined the channel [22:41] Aria: It means that you got bigger than fully atomic updates can handle. [22:41] Aria: That the partition or availability problem actually hit you. [22:43] perlmonkey2: aurynn: it means " webrequest | /dev/null" and then you can handle inf traffic. [22:43] eee_c has joined the channel [22:44] jimt_ has joined the channel [22:45] Coal has joined the channel [22:45] eventi: Ond - http://pastie.org/1557445 [22:45] eventi: here's the expresso and express in one file [22:45] eventi: proof of concept - hopefully it's my install [22:46] perlmonkey2: besides having trouble with mongoose designing a schema where Foo's have many Bar's and then say doing a query where Foo.x > 5 and Bar.y < 5 becomes a problem. Do it with embedded docs and mongoose doesn't seem to support. Plus if its embedded then queries just on Bar become an issue. Do it with referenced id's and you get to run N*N queries. [22:47] Aria: Do you really need separate documents? [22:47] Aria: Not just Foo.x > 8 and Foo.bars.y < 5 ? [22:47] Aria: sort of thing? [22:47] perlmonkey2: If I embed every document in a 1:N relationship I'll wind up with monster objects. [22:48] perlmonkey2: Plus I can't get queries on Foo.bars.y. < 5 to work in Mongoose without dropping to the mongdb driver. [22:50] Ond: And this doesn't work for you, eventi? [22:50] eventi: no - it works for you? [22:51] eventi: hopefully it's a version problem [22:51] Ond: http://slexy.org/raw/s20waNNjRI [22:51] technoweenie has joined the channel [22:51] Ond: This works for me [22:52] Ond: When I curl -X PUT http://localhost:3000/user -d 'email=adsfdfd' [22:52] blueadept has joined the channel [22:53] eventi: Sorry - it works fine with curl - it's the expresso bit at the end... try expresso and you'll see that it's not posting the data [22:53] eventi: or PUTTING for that matter [22:53] Ond: Ah [22:53] eventi: Yeah - I wanna stop manual testing with curl :) [22:53] bartt has joined the channel [22:54] pifantastic_ has joined the channel [23:00] edude03 has joined the channel [23:00] tg has joined the channel [23:01] beta_ has joined the channel [23:01] Solsys has joined the channel [23:03] devongovett: hey chatroom! what's the best way to get node to autoreload modules? [23:05] SubStack: devongovett: there's restartr which restarts your process when a file changes [23:05] lukegalea has joined the channel [23:06] rjack has joined the channel [23:06] aurynn: web scale: You ran out of money before you could make ACID really scale. [23:08] pietern has joined the channel [23:09] Jxck has joined the channel [23:09] ximo has joined the channel [23:09] Bloudermilk has joined the channel [23:11] abraham has joined the channel [23:13] Bloudermilk: Hey all. Do V8/Node contain any similar language features like Ruby's Fibers? Or anything else that makes async programming look like sync programming? [23:14] aurynn: There's some libraries you can get to help with that [23:14] bingomanatee has joined the channel [23:14] Bloudermilk: aurynn: Any you can recommend? [23:15] ceej: is RDS the only cloud mysql hosting? [23:15] aurynn: No, I just learned async [23:15] Aria: The problem with such things being that you accumulate state in a much less explicit way, Bloudermilk, and that loses some of the advantages of async programming. [23:16] Bloudermilk: Aria: I'm not sure I get what you mean [23:17] Aria: When you "make it look like sync", you have to keep all kinds of state around to continue where you left off in a general way. [23:17] Aria: If you write in an async style, you SEE what you keep for later, and can keep that small. [23:17] lukegalea has joined the channel [23:18] Bloudermilk: I see [23:20] Aria: (And it doesn't have to be painful -- if you're nesting callbacks at all deeply, you're not splitting things up enough) [23:20] Aria: (Emitting your own event names can help, and splitting things up among different EventEmitters can be nice.) [23:21] Bloudermilk: Aria: As of now I'm still just doing research on node.js, but I'll take that into consideration if/when I get started :) [23:21] Aria: Hehe. Okey! [23:21] Aria: Yeah. My advice is "drink the koolaid" as far as async goes. It's different, not hard. [23:21] eee_c has joined the channel [23:22] jotaru has joined the channel [23:23] Bloudermilk: Haha, you got it [23:23] jotaru: Hello~ [23:23] mscdex: yo [23:24] jotaru: Anyone here use some of the mongodb modules out there? [23:26] aklt has joined the channel [23:27] mAritz has joined the channel [23:27] jimt has joined the channel [23:29] robotarmy has joined the channel [23:30] nofxx has joined the channel [23:33] devrim: hey jotaru [23:33] jotaru: Hallo~ [23:33] devrim: im willing to pay someone who will get me going with mongoose - but cant find anyone :( [23:33] jimt_ has joined the channel [23:33] devrim: it's throwing stupid errors although copying/pasting from their website [23:34] jotaru: I'm not sure if it's that I'm new to node or what but all these options for mongo seem like bloatware. [23:34] jotaru: I've only read a small bit of Mongoose and tried it some but apparently the noSchema() function doesn't exist anymore. [23:35] marcello3d: I'm just using node-mongodb-native [23:35] marcello3d: though it seems a little buggy, not sure how keen I am on the API [23:35] jotaru: I was looking at that one as well.. [23:35] robotarmy has joined the channel [23:36] jotaru: I think that one had some potential.. but I was looking for something more lightweight if there is such a thing. [23:36] marcello3d: what development stacks are people using? ides? node auto-reloading utilities? npm shared repo vs ? [23:36] marcello3d: more lightweight in api, or? [23:36] jotaru: I don't use any package managers personally. [23:36] jotaru: talking to mongo. [23:37] jotaru: I wanted to write my own (did one for memcached) but for some reason it's a bit more complex to send data and I'm still newbish on the whole thing ^^; [23:37] srid has joined the channel [23:37] marcello3d: is it missing functionality? running too slowly? [23:38] jimt has joined the channel [23:38] jotaru: Maybe lightweight wasn't the right word.. [23:39] tfe_ has joined the channel [23:39] tfe_ has joined the channel [23:39] jotaru: I haven't had extensive use with either Mongoose and -native [23:39] devrim: mongoose looks great but its documentation is horrible [23:39] jotaru: I agree.. [23:39] marcello3d: bad documentation seems the norm with node modules... [23:39] devrim: literally spent 10 hours so far still couldn't get through [23:40] devrim: at least provide one code that works right [23:40] marcello3d: isn't there like jsdoc for javascript? does anyone use such? [23:40] devrim: chunks of code everywhere one working example nowhere to be seen [23:40] jotaru: I'm gonna give -native another try. [23:40] jotaru: It's just a personal feeling of mine I think marcello3d.. [23:41] jotaru: It just seems extensive [23:41] jotaru: The amount of files to talk to the database. [23:41] marcello3d: well, perhaps it's worth looking at, for example, the java driver [23:42] marcello3d: https://github.com/mongodb/mongo-java-driver/tree/master/src/main [23:42] jotaru: THen again, I'm comparing experienced (i think) js coders to me, writing one memcache file that queried what you wanted and spat it out. end of discussion lol. [23:42] marcello3d: well, mongo is a lot more complex than memcache :) [23:43] marcello3d: considering it deals with structured data, not simple key-value [23:43] jotaru: That is indeed a main issue to consider haha. [23:43] marcello3d: but that java driver is written by the mongo guys [23:43] matyr has joined the channel [23:43] jotaru: mm I see. [23:43] marcello3d: and (for java) is pretty straight forward to use, imo [23:43] marcello3d: it has a lot more files than the js one [23:44] jotaru: It does look pretty clean. [23:44] SubStack: bbq! [23:44] marcello3d: my problem with the node driver is it doesn't seem to work right :) [23:44] kriskowal has joined the channel [23:44] marcello3d: trying to use the gridfs stuff [23:45] marcello3d: and it's crapping out [23:45] jotaru: I'm just too used to PHP (already built in operability) [23:45] jotaru: Damn =\ [23:46] jotaru: I'm still all very new to this all. So I think I'm stop bitching and start playing around with -native. [23:49] geoffeg: How can I load a buch of .js files in a directory at runtime? I find each file via readdirSync and then I'm trying to fs.readFileSync and Script.runInNewContext but it would appear that some require()s get messed up when i do it that way. [23:51] mscdex: geoffeg: shouldn't you just require() the filenames instead? [23:51] mscdex: :) [23:51] geoffeg: mscdex: i tries that too, but got the same result. [23:51] SubStack: o_O [23:51] mscdex: geoffeg: mind gisting your code? [23:51] sholmes has joined the channel [23:52] geoffeg: yea, no problem.. JAS [23:52] marcello3d: is node single threaded? [23:52] marcello3d: ie if you do fs.readFileSync, it won't server any other http requests in the meantime? [23:52] jakeskik: marcello3d: it will [23:53] jakeskik: about all the apis are async [23:53] marcello3d: right, but fs.readFileSync [23:53] zylo_ has joined the channel [23:53] marcello3d: or, for example, I was looking at node-canvas, and supposedly it doesn't implement async yet [23:54] aurynn: I was sorta writing node-sdl [23:54] aurynn: but that got sidetracked [23:54] jakeskik: marcello3d: ok, then it'll block. so yes, in that sense node is single threaded [23:54] mscdex: marcello3d: all the fs.*Sync methods are blocking [23:55] mscdex: and node is single threaded [23:55] geoffeg: mscdex: https://gist.github.com/bcf52a299562964da2cc [23:55] marcello3d: so do people just run multiple node instances? [23:55] marcello3d: to handle simultaneous requests on a multi-core system? [23:55] SubStack: oh goodness do I ever [23:56] mscdex: marcello3d: multiple processes to scale to multiple cpus/cores [23:57] Bloudermilk has joined the channel [23:57] SubStack: marcello3d: browserling is running across 9 processes right now [23:57] spaceinvader: how do they communicate? [23:57] SubStack: dnode [23:57] SubStack: on 5 servers at the moment [23:57] marcello3d: 9 processes on each? [23:57] marcello3d: or total? [23:57] AAA_awright_ has joined the channel [23:57] lukegalea has joined the channel [23:58] SubStack: nexus is running 5 processes and each of the encoders runs an encoder process [23:58] marcello3d: (no idea what browserling or nexus are) [23:58] SubStack: http://browserling.com/ [23:58] SubStack: my node.js powered startup [23:58] marcello3d: wow [23:58] marcello3d: I think I killed my networking [23:58] marcello3d: I can't load any websites :) [23:59] marcello3d: after some broken node code [23:59] cidd has joined the channel [23:59] marcello3d: just chrome I guess [23:59] cidd: hey, is there a jsonp example for express? I saw it was added in [23:59] sholmes has joined the channel