[00:00] Stephen: ah: http://groups.google.com/group/node-mongodb-native/browse_thread/thread/b52c566416854269# [00:01] quackslike: thats the one [00:02] tahu has joined the channel [00:03] Stephen: So, my answer is that I should be tossing the update result into a throwaway object and querying the object a second time anyway. [00:03] Stephen: That's too bad. [00:03] marcello3d: *cough* github.com/marcello3d/node-mongolian *cough* [00:04] uclinux has left the channel [00:04] sechrist has joined the channel [00:04] pizthewiz has joined the channel [00:04] Stephen: "Mongolian DeadBeef and its documentation is super under construction! Go check out examples/mongolian_trainer.js and the rest of the source!" [00:05] Stephen: marcello3d, can you give me some expected time tables? [00:05] quackslike: Stephen: yeah i thought the same.. shame really to have to do the second query. [00:05] Stephen: I only ask because I'm completely overhauling my PHP/MySQL system to NodeJS/MongoDB, and I need something that's going to remain stable. [00:06] marcello3d: Stephen: then don't use it :) I don't want to make any promises just yet [00:06] Stephen: I went through framework regret with Recess!, being very cautious this time [00:06] marcello3d: the api is fairly stable, since it's based on the mongo shell api [00:06] marcello3d: I am changing the connection creation slightly in the next release for replicaset support [00:07] Stephen: marcello3d: Believe it or not I think i have installed this before [00:07] Stephen: You're doing some decent work there [00:07] marcello3d: but I totally sympathize with the framework regret thing [00:07] [[zz]] has joined the channel [00:07] marcello3d: so that's why I only coughed the link instead of suggesting you use it ;D [00:08] Stephen: :-) [00:09] Stephen: Well, I'll give it this much: It will be a great tool for training the new guys on javascript. 1 more link so they don't have to jump between mongo shell and node repl. [00:09] quackslike: Stephen: agreed marcello3d's stuff looks nice. [00:09] Stephen: While still /mostly/ maintaining syntax [00:10] Stephen: Training old programmers to think inside the runtime is a bit like trying to teach a really smart 5th grader high level physics [00:11] marcello3d: lol [00:11] Stephen: "Yeah, I'm really great at math, I know this", "Hold on, this goes way beyond math" [00:12] Stephen: I will say that installing a local version of cloud9ide worked out nicely [00:12] Stephen: The gitui extension (likely the only extension I'll find publicly available) has saved me aeons on training git. [00:12] Stephen: Eh, anyway [00:13] astropirate has joined the channel [00:15] marcello3d: I'm out [00:15] marcello3d: have a good one, all! [00:15] quackslike: marcello3d: ciao [00:16] Stephen: Wow... what is the purpose of findAndModify anymore... [00:16] darshanshankar has joined the channel [00:16] boaz has joined the channel [00:20] xeodox: When one person keeps hitting refresh, it drives my CPU up to 100% when I view "top". Is this normal? [00:21] galaxywatcher_ has joined the channel [00:21] ryah has joined the channel [00:23] mdaisuke has joined the channel [00:23] quackslike: xeodox: depends on what you're doing i suppose.. [00:24] xeodox: quackslike: I'm just rendering a dashboard. (Hit 10 queries before the page loads) [00:24] squeeks: and absolutely no caching? [00:25] xeodox: I do _id lookups from mongodb [00:25] xeodox: so I assume theres no need to cache. [00:25] xeodox: Plus, I'm building a real time dashboard, so every second counts. [00:26] quackslike: mongo on the same machine i take it? [00:26] squeeks: Then your problem is "normal", and if it's unacceptable to have millisecond stale data and a CPU getting pinned down in an alley way and raped, it's time to throw more hardware at it. [00:27] mfernest has joined the channel [00:27] xeodox: well..But ONE user keeps hitting refresh and can kill it haha. [00:27] xeodox: Literally I kept hitting refresh on my Chrome browser and saw my CPU spike to 100% [00:28] squeeks: on your development? [00:28] Ratty_: 100% seems normal, it's a problem if it stays at 100% for a long time after the request is sent [00:28] rmustacc: xeodox: What is using that CPU? [00:28] xeodox: yup [00:28] squeeks: so what's it like on production or stage? [00:29] xeodox: same set up [00:29] xeodox: except prod = port 80. [00:29] xeodox: dev = 8000 [00:29] squeeks: You run desktop apps on your servers? [00:30] kriszyp has joined the channel [00:30] meatmanek: @squeeks you run real applications on node? [00:30] squeeks: This is not twitter. Go away. [00:30] beawesomeinstead has joined the channel [00:30] xeodox: what do you mean desktop apps? [00:31] xeodox: It's node.js webpage. I hit it with my server with my macbook at home. [00:31] xeodox: I hit my server with my macbook at home* and it spikes up to 100% if i keep hitting refresh on chrome [00:32] squeeks: Then you have two choices. Profile, or throw more hardware at it. [00:32] meatmanek: @squeeks you're a bitter person, and I'm going to keep using the @ syntax just to annoy you. [00:32] squeeks: /mode +i meatmanek [00:33] squeeks: oops. [00:33] beawesomeinstead has joined the channel [00:33] rmustacc: xeodox: Do you know what is taking up the CPU? Is it 100% node, is it other things running on that server, etc.? [00:33] meatmanek: I'm just trying to make the point that not everyone bothers to have "real" servers for weekend node projects. [00:34] meatmanek: and that there's nothing wrong with that. [00:34] xeodox: 100% node [00:34] Stephen: hah [00:34] Stephen: I feel I've made an accomplishment: [00:35] jdalton has left the channel [00:35] Stephen: From node-mongodb-driver: [00:35] Stephen: ""Error: can't apply mod in place - shouldn't have gotten here" [00:35] xeodox: I'm running 1 "tiny" instance on EC2. Node.js + mongodb only. When Person keeps hitting refresh, node.js goes up to 100%. Mongo CPU doesn't change much. [00:35] xeodox: On Production, I have mongo and node on 2 diff. servers. [00:36] xeodox: rmustacc: This is how I designed the controller. http://pastebin.com/NcU5MMRL [00:36] Stephen: xeodox: How are you handing the initial connect in Node? [00:36] xeodox: Stephen: What do you mean initial connect? [00:36] xeodox: I just use Express. app.get('/dashoard'). And app.listen(8000). On prod I listen to 80. [00:37] jacter has joined the channel [00:37] rmustacc: Well, I don't know much about the power behind an EC2 tiny instance. [00:37] rmustacc: You could easily be running into expected behavior. [00:37] saschagehlich has joined the channel [00:37] xeodox: Do you think the way I desinged it is correct? Calling function after function until the end . then spit out the template. [00:38] rmustacc: I have no idea about the design, sorry. That's not an area I have much experience in. [00:38] xeodox: i mean programming pattern lol [00:39] rmustacc: The trick here is to understand /why/ you're CPU bound. As squeeks mentioned you may want to profile it or see what happens on larger hardare. [00:39] rmustacc: *hardare [00:39] benw_ has joined the channel [00:39] xeodox: whats "profile" it mean? [00:40] rmustacc: Understand what percent of time your code is spending doing what. [00:40] rmustacc: Basically you always have something that wants to run on CPU. The question you're trying to answer is what am I trying to do on that CPU? [00:40] xeodox: I see. [00:41] rmustacc: But you may also be hitting the limits of the EC2 instance. [00:41] ngs has joined the channel [00:42] xeodox: btw, when I keep hitting refresh constantly pounding it, things start going wacky. Variables inside the functions start messing up and don't get set sometimes. [00:42] quackslike: FWIW the tiny instance is, well, tiny. it took quite a while to build node on it for me yesterday.. far longer than on my mac laptop, circa 2008. [00:42] xeodox: That happens + my 100% CPu haha [00:42] bad_at_math has joined the channel [00:42] kriszyp has joined the channel [00:45] benw_: Should npm parse a package.json inside node_packages/foo where foo is listed in bundleDependencies? [00:45] benw_: I'm getting barfage with npm 1.0.6 where I didn't with npm 1.0.1 [00:46] benw_: because foo/package.json contains "version": "@VERSION". [00:47] tonymilne has joined the channel [00:47] davemo has joined the channel [00:47] xeodox: One more interesting finding: Just displaying a blank template (no queries, no nothing. Just res.render)....makes the CPU go up to 10% on a EC2 Small instance if I keep holding refresh down. [00:47] piscisaureus has joined the channel [00:48] vDubG has joined the channel [00:49] quackslike: some douche devops turd went and changed the path to the perl interpreter on 20 perl files on one of the production servers, instead of creating a SINGLE symlink. *headdesk* Needless to say it makes patching the files less than fun. [00:49] wavded has joined the channel [00:51] wavded has left the channel [00:52] squeeks: wtf is wrong with using #!/usr/bin/env perl? [00:52] p_nitsch_ has joined the channel [00:53] quackslike: i have no idea.. [00:53] zoowee: xeodox: i do a bunch of stuff on my ec2 instances i dont think i have this issue right now i am running http-proxy with several apps behind it [00:53] quackslike: it was /usr/bin/perl or something on all files on all servers and someone changed one server to something like /usr/local/bin/perl - or something like that.. *sigh* [00:53] tswicegood has joined the channel [00:53] wavded has joined the channel [00:53] zoowee: xeodox: ec2 micro instance* [00:53] xeodox: zoowee: really? [00:54] xeodox: zoowee: Right now when I just do res.render('privacy') ...just a simple template. If I keep hitting refresh, my CPU goes up to 10%. You don't get this problem? [00:54] quackslike: these files have been around since 2000.. i just cant believe it. it scares me a little [00:54] xeodox: And this is in small EC2 [00:54] squeeks: quackslike: err, these 5.6 or 5.8+ scripts? [00:54] Stephen: quackslike: Got anotherone for you [00:55] Ond has joined the channel [00:55] quackslike: squeeks: i think it predates 5 [00:55] squeeks: chances are they did it because they wanted to keep the system perl inline with deps, but couldn't from having ancient code. [00:55] Stephen: If i'm doing a findOne, can I have the query return results which only have x number of elements in a child array? [00:55] quackslike: i really dont know.. i dont have to change them often.. [00:56] quackslike: Stephen: i do not know [00:56] Mrfloyd has joined the channel [00:56] Stephen: Thanks [00:56] squeeks: well a new version of perl comes out every year. [00:56] mike_miller: Does anyone know where express stores its session cookie, and how I can clear it when a user logs out? [00:56] quackslike: squeeks: yeah like i said, majority of the code was written in 2000-03 [00:58] Stephen: HEh, found a solution [00:58] squeeks: might be an idea to err, update them. [00:58] Stephen: db.Pages.findOne({"_id":1,"parts" : { "$ne" : [] } }) [00:59] tonymilne: mike_miller: try controller.request.session [00:59] tonymilne: er... [00:59] tonymilne: req.session [00:59] mike_miller: tonymilne: But that would be on the server side. [00:59] mike_miller: I mean on the client. [00:59] mike_miller: A user clicks "Sign out," and I want to clear the cookie on the client, with no server interaction. [01:00] tonymilne: Do you need to do that? Wouldnt it be better done on the server? [01:00] neoesque has joined the channel [01:00] gtramont1na has joined the channel [01:00] mike_miller: hmmm, possibly. so what would I do? req.session = null; ? [01:02] beriberikix has joined the channel [01:02] uclinux has joined the channel [01:03] tonymilne: Yeah, with my usage, i have a req.session.user variable [01:03] tonymilne: and I destroy that, [01:03] mike_miller: ah, gotcha. [01:03] tonymilne: So, my assumption has been that the client comes back next time, and it realises that no server session exists, so it makes them a new one. [01:03] matyr_ has joined the channel [01:03] mike_miller: yeah, makes sense. thanks! [01:05] dmojoryder has joined the channel [01:05] beriberikix: Can you call a function on the sever from the client in NowJS? [01:05] mscdex: you can with dnode! [01:08] darshanshankar: beriberikix: you can with NowJS, yes [01:09] beriberikix: mscdex: looks cool [01:09] beriberikix: darshanshankar: looking for a good example, do you have 1? [01:09] darshanshankar: sure [01:09] jacter has joined the channel [01:10] darshanshankar: beriberikix: https://github.com/Flotype/now/tree/master/examples/helloworld_example [01:10] samsonjs has joined the channel [01:10] darshanshankar: you can see how you define functions server-side like everyone.now.distributeMessage [01:10] raf has joined the channel [01:10] darshanshankar: and you can see how it gets called client-side with a simple now.distributeMessage() call [01:10] towns has joined the channel [01:11] beriberikix: darshanshankar: all you need to do is attached everything to everyone.now? [01:11] raf: Any suggestions on auto testing node.js (expresso) tests, without using Ruby (Watchr etc.)? [01:12] darshanshankar: beriberikix: if you want a group of clients or every client to be able to call a function defined on server-side, add it to the now namespace [01:12] darshanshankar: example groupFoo.now.functionOnlyForGroupFoo = function() {} [01:12] darshanshankar: or everyone.now.functionForEveryone = function() {} [01:13] beriberikix: ah, makes sense [01:13] jesusabdullah: raf: What do you mean? [01:13] darshanshankar: beriberikix: might want to join our irc as well #nowjs on here :P [01:13] MehdiRuby has joined the channel [01:14] raf: I would like to have node.js process monitor modified js files and run the command "expresso test/*.test.js", when it detects file changes [01:14] azeroth__ has joined the channel [01:16] galaxywatcher has joined the channel [01:16] ditesh|cassini has joined the channel [01:16] kmwallio has joined the channel [01:16] beriberikix: mscdex: checking out dnode, seeing if its a better fit for what I'm trying to do [01:17] xeodox: How does socket.io work across multiple web servers? anyone know? [01:17] Emmanuel__ has joined the channel [01:17] SubStack: xeodox: the learnboost folks built cluster to handle that case [01:17] k1ttty has joined the channel [01:18] ditesh has joined the channel [01:18] SubStack: xeodox: https://github.com/LearnBoost/cluster [01:21] xeodox: substack: that isn't for multiple servers though [01:21] xeodox: that's still for 1 macine [01:22] brianloveswords has joined the channel [01:23] xeodox: substack: that only lets you handle multiple cores. But how do I sync socket.io across multiple servers? [01:25] Stephen: SubStack, how goes it? [01:27] tbranyen: xeodox: pubsub with redis maybe? [01:28] guybrush: xeodox: the problem is not syncing socket.io, it is just about syncing the "backend" of your app [01:29] mike_miller has joined the channel [01:31] avalanche123 has joined the channel [01:31] bene has joined the channel [01:32] Ratty_: redis scares me [01:32] tonymilne: Anyone know how to create optional parameters in an Express route? [01:33] tonymilne: I'm looking through the Express router/route.js source code, and can't work out what it's doing :S [01:35] zentoooo has joined the channel [01:35] tonymilne: I want to be able to have an optional route extension, [01:36] tonymilne: E.g. .json -> returns json, .xml -> returns xml [01:36] Ratty_: So, what do most folks use to deploy an express project? Capistrano? Or is there something more node oriented? [01:36] sarkis has joined the channel [01:38] azeroth__ has joined the channel [01:38] oshark has joined the channel [01:39] oshark: is it possible when using node-waf to set the destination architecture? i'm on OSX and need to compile a module to ia32 instead of x86_64... [01:40] sion has joined the channel [01:42] sion2k has joined the channel [01:42] tonymilne: stylus: Are you TJ in disguise? [01:42] Spion has joined the channel [01:42] rchavik has joined the channel [01:43] niftylettuce has joined the channel [01:43] ditesh has joined the channel [01:45] JohnnyL has joined the channel [01:46] JohnnyL: wow, this place is packed. [01:46] xeodox: yep. [01:46] JohnnyL: what have you guys been eating? :) [01:46] ditesh|cassini has joined the channel [01:46] xeodox: javascript. [01:46] tbranyen: cannolis [01:46] JohnnyL: Will there ever be Widnows support for node.js? [01:46] JohnnyL: Windows [01:46] boaz has joined the channel [01:46] tbranyen: JohnnyL: there already is... [01:46] mattstevens has joined the channel [01:46] tbranyen: native support is coming soon according to nodeconf [01:47] MehdiRuby: can we integrate Node.js with Rails [01:47] MehdiRuby: I would like to build part of my application using Backbone/Node.js and other less interactive parts [01:47] MehdiRuby: using Rails [01:48] vicapow has joined the channel [01:48] xeodox: What's the best way to load balance node.js [01:49] tonymilne: xeodox: Some people use Nginx or HAProxy. [01:49] xeodox: Nginx runs o [01:50] xeodox: "node app.js" still runs, right? but nginx just points to it [01:50] tonymilne: correct [01:51] boaz has joined the channel [01:51] tonymilne: You can set nginx up to serve certain files, e.g. images, css, etc. [01:51] tonymilne: and proxy the rest through to the nodejs server that you've created. [01:51] xeodox: thats tuff is in S3 [01:51] xeodox: Has anyone tried PerlBal? [01:53] galaxywatcher has joined the channel [01:54] mohit has joined the channel [01:54] SubStack: Stephen: oh hello [01:56] fr0stbyte: when you init your C++ module, is there any way to setup a poll callback? ie. so as to not block the thread [01:56] viewsrc has joined the channel [01:56] p_nitsch_ has joined the channel [01:56] pootietang has joined the channel [01:57] seivan has joined the channel [01:58] mscdex: fr0stbyte: a poll callback for what? [01:58] tonymilne: fr0stbyte: Can you emit something when it's ready? [01:58] fr0stbyte: mscdex: SDL UI [01:58] fr0stbyte: tonymilne: yes [02:01] fr0stbyte: is there nothing in low-level node to callback? or would I have to have for instance a setTimeout calling back to my renderer inside JS? [02:02] mohit has joined the channel [02:08] avalanche123 has joined the channel [02:10] sarkis has joined the channel [02:10] jtsnow has joined the channel [02:12] temp01 has joined the channel [02:12] jdp has joined the channel [02:15] sh1mmer has joined the channel [02:16] sh1m has joined the channel [02:17] Wa has joined the channel [02:18] dmojoryder has joined the channel [02:18] copongcopong has joined the channel [02:18] sarkis has joined the channel [02:20] pifantastic_ has joined the channel [02:23] p_nitsch_ has joined the channel [02:27] mengxy has joined the channel [02:27] random123 has joined the channel [02:32] ajoslin103 has joined the channel [02:36] fr0stbyte: nice [02:36] zentoooo has joined the channel [02:37] kylejginavan has joined the channel [02:37] gazumps has joined the channel [02:37] kylejginavan has joined the channel [02:37] tim_smart has joined the channel [02:38] baudehlo1 has joined the channel [02:38] davemo has joined the channel [02:38] dyer has joined the channel [02:40] MehdiRuby has joined the channel [02:40] ajoslin103: I'm having trouble building a module, I'm porting some code from a flash program which was bundled into a class which I'm trying to implement as an object. I am looking for sample code to understand how to build and export an object with member variables and functions. help! [02:40] darshanshankar has joined the channel [02:41] braddunbar has joined the channel [02:42] kylejginavan has left the channel [02:42] braddunbar: when running ab -n 100 -c 10 http://localhost:8000/ on my express site, node crashes completely, no stack trace, no output - how can I debug this? [02:42] Stephen: tail -f /var/log/messages [02:43] Stephen: Otherwise, throw in some console.log() lines in the code and see what you can find [02:44] braddunbar: hmm...tail -f /var/log/messages gets me nothing [02:44] braddunbar: also, it completes some of the requests - usually half or so [02:44] braddunbar: Stephen: console.log it is [02:46] xeodox: Has anyone used node-profile before? It's not working for me. All it does is says: Running: node --prof --log-snapshot-positions --logfile=profile-13049091383087996.log app.js [02:46] xeodox: the server works but nothing prints out [02:47] Stephen: xeodox: all the info is being logged in profile-13049091383087996.log app.js [02:47] aaronblohowiak: !seen creationix [02:47] Stephen: you need to go open that file [02:47] xeodox: can't "locate" that file. [02:47] Stephen: basically, start the profiler, then go start your app. It will generate the messages [02:47] Stephen: and as for the file, do this: [02:47] Stephen: cd / [02:47] Stephen: updatedb [02:47] Stephen: locate profile-13049091383087996.log app.js [02:48] Stephen: If it exists, that will find it [02:48] Stephen: Best to do that as root [02:48] xeodox: sudo locate profile-13049091383087996.log ...nothing found. I'm in "/ [02:48] xeodox: (also did sudo updatedb) [02:49] mscdex: ircretary: when did you last see creationix? [02:49] ircretary: mscdex: creationix was last seen at 2011-05-07T04:18:05.649Z, quit: left #Node.js [02:49] Stephen: cool, then the file likely never got generated [02:49] mscdex: aaronblohowiak: ^ [02:49] samsonjs has joined the channel [02:49] aaronblohowiak: mscdex: ty you rock [02:50] xeodox: Stephen: I even did -o/home/myuser/profile.txt ...but no log file found [02:50] Stephen: xeodox: Are you starting your app once the profiler is running? [02:50] xeodox: I followed instructions here. https://github.com/mape/node-profile "nodeprofile app.js" [02:50] xeodox: The app runs fine. I can go to the website [02:52] Stephen: xeodox: It looks like you haven't been running it long enough [02:52] muk_mb has joined the channel [02:52] Stephen: profilers have to collect data [02:52] Stephen: traffic and what not [02:52] xeodox: really [02:52] xeodox: oh [02:52] Stephen: just running it isn't going to do much [02:53] p_nitsch_ has joined the channel [02:55] Qbix2 has joined the channel [02:55] khj has joined the channel [02:56] aaronblohowiak: ircretary: where is your source? [02:56] ircretary: aaronblohowiak: I'm not sure I follow your meaning... [02:56] xeodox: Stephen: I'm hitting my website over and over. It stil hasn't printed anything yet [02:56] jaket_ has joined the channel [02:56] aaronblohowiak: ircretary: commands [02:56] ircretary: aaronblohowiak: I'm not sure what to do with that command. Ask for help in PM. [02:57] sarkis has joined the channel [02:58] mike_miller: Is there any way to do .clone() with CoreQuery? [02:59] blueadept has joined the channel [03:03] andrewfff has joined the channel [03:03] towns has joined the channel [03:04] marcosvm has joined the channel [03:05] rauchg has joined the channel [03:06] mfernest has joined the channel [03:10] zivester has joined the channel [03:11] mfernest has left the channel [03:13] bene has joined the channel [03:15] jamescarr_ has joined the channel [03:17] ron_frown has joined the channel [03:20] gazumps has joined the channel [03:21] xeodox: I'm using connect-redis for session store (https://github.com/visionmedia/connect-redis). However, by default this module connects to localhost. How do I change it to point to another server? [03:22] xeodox: nvm i got it [03:23] p_nitsch_ has joined the channel [03:25] indutny has joined the channel [03:28] newy_ has joined the channel [03:30] aaronblohowiak: Wow. var'd functions are *so* much slower to call than named functions. [03:30] aaronblohowiak: weird [03:33] uclinux has joined the channel [03:33] uclinux: node-http-proxy is so awesome [03:34] ron_frown has joined the channel [03:34] mengxy: xeodox: new RedisStore({host: 'hostname'}) [03:34] xeodox: yep , thanks :) [03:35] martin__ has joined the channel [03:35] saschagehlich_ has joined the channel [03:35] darshanshankar has joined the channel [03:36] JohnnyL has left the channel [03:36] martin__: So how does this work? [03:37] vikstrous has joined the channel [03:37] Ratty_: What [03:37] Aria has joined the channel [03:38] martin__: I have recently started playing with node and have an issue with an object returning from the constructor before the internal initialization has completed.....real noob and need some help. [03:38] Aria: What are you doing inside the constructor? [03:38] ChrisPartridge: martin__: Most likely not doing things asynchronously [03:39] Aria: often you want to create a construction function, and keep the constructor simple. [03:39] martin__: I am using the node-get module to grab some data from 3 different urls. [03:39] Aria: function createFoo(cb) { do_thing_async(function() { cb(new Foo()) }) } [03:40] Aria: So that your object is created when the stuff it depends on exists. [03:40] zackattack has joined the channel [03:41] martin__: OK, and then return the object once the data has been retrieved instead of doing it all in the constructor? [03:41] Aria: Yeah. [03:41] Aria: Well, not return. [03:41] Aria: Callback it out. [03:42] martin__: Sure [03:42] Aria: Your construction function is then async, to. [03:42] Aria: er, too. [03:42] martin__: I am having some trouble wrapping my head around the whole thing but I am making ground little by little. [03:43] martin__: It doesn't help that my js is pretty weak as well :( [03:44] martin__: So an unwritten rule is 'keep the constructor as simple as possible' in most instances? [03:44] tbranyen: yeah always [03:45] tbranyen: as simple as it needs to be [03:45] tbranyen: if you can break stuff out [03:45] tbranyen: def for the best [03:45] tbranyen: also if your async thing can emit events that might be the way to go [03:46] tbranyen: var something = new something(); something.on('whatever', function(sheeeeit) { }); [03:47] martin__: Am I best focusing on events or callbacks? I was trying to work mostly with callbacks as it looked simpler but I could easily be going up the wrong path. [03:48] chjj: martin__: different tools for different things [03:49] martin__: and when I say simpler I mean mindnumbing.....first foray into async [03:49] Lorentz has joined the channel [03:49] martin__: chjj: care to expand that a little so I have a better idea of when to use each technique? [03:50] Aria: Yeah, definitely a time to use each. If something fires multiple times, or there's different things that get fired on a single object, events. [03:50] Aria: And when you're going to perhaps want multiple listeners, events. [03:50] Aria: "data" "data" "data" "end" -- perfect use of events. [03:50] Aria: When you want a single notice when something finishes, so you can continue, callbacks. [03:50] chjj: yeah, 'data' events and streaming is a good example [03:50] chjj: for something that isnt terrible OO though, callbacks are good [03:51] rchavik has joined the channel [03:51] Aria: Yeah, don't go too deep into traditional OO in javascript. It'll break your head. [03:51] chjj: like fs.readdir(dir, function(){}); imagine how inconvenient this would be if it were var read = fs.readdir(dir); read.on('data', function() {}).on('end', function(){}); [03:52] martin__: Thank you very much guys (and girls?). [03:52] Aria: (Indeed!) [03:52] martin__: OK, I see. I am starting to see the light......more testing required. [03:54] tbranyen: Aria: its weird because the typical each method uses callback functions instead of events [03:54] p_nitsch has joined the channel [03:54] Aria: That makes sense. None of those are hard and fast rules, and really, it's only the multiple-times suggestion that impacts each. [03:55] Aria: You're not going to want multiple listeners, you're not going to want an 'end' event. It's a single type of callback. [03:56] fljitovak has joined the channel [03:56] martin__: Any resources the guys and girls here would recommend for a node noob? [03:57] chjj: martin__, i would recommend browsing some of the code on github, get a good feel for node code [03:58] tonymilne: How does a router (like in Express) work? I'm imagining it holds a collection of RegExp and has to evalutate the request url against each of them (up until it finds a match)? Is there much more to it than this? [03:58] chjj: reading the node.js source (all the modules) is a good way of learning as well [03:58] chjj: tonymilne: it usually takes your route, if its a string it will compile it into a regex [03:58] tonymilne: martin__: Do you have a task in mind you're trying to accomplish? Working on a project is the best way to learn imo. [03:58] pizthewiz has joined the channel [03:59] martin__: chjj, I will do that, thank you. [03:59] chjj: it will organize routes according to http method, when a request is made [03:59] tonymilne: Ok, well let me explain my goal and see what peeps think. [03:59] chjj: it will iterate through all the routes in that method and test the regex [03:59] tonymilne: I've created all my routes (controller actions) in express. [03:59] chjj: creating a collection of all the possible handlers [03:59] gazumps856 has joined the channel [04:00] tonymilne: I want to wrap a socket.io layer around it, such that i pass a request structure as the socket.io message payload [04:00] sub_pop has joined the channel [04:00] tonymilne: and want my server to kinda run the controller action, and then return the response via a socket.io message. [04:00] martin__: tonymilne: I have a stock report perl script that I am trying to rewrite in node using mongodb....first task isto retrieve the tickersymbols from nasdaq.com [04:00] chjj: its easy to write a simple router, the express router is a bit more complex because of how it handles errors and passing to the next handler i think [04:01] jacter has joined the channel [04:01] sub_pop has joined the channel [04:03] tonymilne: martin___: Are you displaying it in a web site too, or what do you do with the output? [04:04] martin__: tonymilne: ultimately it will end up on a website but it's the batch processing i.e. collecting the data and aggregation that I need to produce first. [04:05] martin__: tonymilne: I am going to try and reproduce the functionality of the Perl CPAN modules TickerSymbols and Finance::Quote. [04:06] samsonjs has joined the channel [04:06] tonymilne: martin___: Well, I'd start with installing npm. Then use npm to install mongodb. Then I'd look at the node http module, and use that to do your requests. Along the way you will want to get your head around asynch calls and the function(err, callback) convention. [04:07] edude03 has joined the channel [04:07] tonymilne: martin___: Then you could later look at Express and maybe Socket.io to create a webpage (with realtime updates). [04:08] path[l] has joined the channel [04:08] martin__: tonymilne: I have npm and have installed mongodb. Aria and chjj have been kind enough to point me in the right direction concerning events and callbacks etc. and as you say...still need to get my head around them. [04:10] martin__: Thank you all. Off to test some more scripts and scraps. [04:10] martin__ has left the channel [04:12] Jamool has joined the channel [04:13] Jamool_ has joined the channel [04:18] jacter1 has joined the channel [04:19] seivan has joined the channel [04:20] indutny has joined the channel [04:21] tedsuo has joined the channel [04:23] jamescarr has joined the channel [04:24] p_nitsch_ has joined the channel [04:25] Emmanuel__: anybody ever used jsdom ? (or other DOM manipulation tool with node) [04:26] towns has joined the channel [04:27] SvenDowideit has joined the channel [04:28] tbranyen: Emmanuel__: yea jsdom is pretty bitching [04:28] brianloveswords has joined the channel [04:29] chjj: ive never had jsdom bitch at me [04:29] chjj: i must be doing something wrong [04:29] tbranyen: chjj: keep scripts enabled when pulling in various complicated sites and you'll find it bitch at you soon enough :) [04:30] chjj: ! [04:30] tbranyen: whenever i screenscrape i disable JS [04:31] SvenDowideit has joined the channel [04:32] hassox has joined the channel [04:34] zeade has joined the channel [04:35] superjudge has joined the channel [04:36] Emmanuel__: tbranyen: just found out what I was looking for. Took me a while to figure out that I could get the rendered HTML in window.document.outerHTML [04:37] Emmanuel__: I will advice the developper to put that in the documentation :) [04:37] tbranyen: Emmanuel__: innerHTML is fairly standard [04:38] tbranyen: outerHTML is nonstandard, but apparently implemented [04:38] chjj: outerHTML is different from innerHTML in that its read-only though [04:38] chjj: in every implementation ive seen at least [04:39] Emmanuel__: oh [04:39] Emmanuel__: (I'm trying to make a proxy that change the page on the fly before delivering to the client) [04:40] Emmanuel__: simple task, turned out to be a pain the ass to have jsdom do some simple stuff [04:40] raidfive has joined the channel [04:40] Emmanuel__: (but I must confess I'm far from being an expert in JS, DOM or node for what it takes) [04:40] chjj: probably because DOM is a headache to begin with [04:40] chjj: especially the CSSOM [04:40] chjj: - worst part of DOM [04:40] aaronblohowiak: haml.js now has whitespace, executable js (if/else, switch, etc), and comment support. npm install haml-edge or wait for the official 0.3.0 release! [04:40] chjj: theyre working on fixing it now though [04:43] ctran has joined the channel [04:45] tfe__ has joined the channel [04:47] tfe_ has joined the channel [04:48] DTrejo has joined the channel [04:48] vikstrous has joined the channel [04:48] vikstrous: hey guys, am I crazy or would it be cool to have a desktop UI for node? so you can use it to make desktop applications too..? [04:48] DTrejo: vikstrous: topcube is kinda that effort [04:49] DTrejo: vikstrous: https://github.com/creationix/topcube [04:49] tfe__ has joined the channel [04:49] vikstrous: DTrejo: Thanks. I knew I wouldn't be the first person to think of it :P [04:49] DTrejo: vikstrous: you should contribute :) [04:49] vikstrous: DTrejo: I'd love to :P [04:50] DTrejo: DREAM DEBUGGER: annotates my code with types at runtime! to avoid stupid errors like the ones i very occasionally make [04:50] vikstrous: DTrejo: I think it would be sweet to be able to make a desktop app with a GUI that runs on the client and talks to the server over socket.io [04:50] vikstrous: and both sides would be in node :D [04:51] DTrejo: so that I can then run the debugger and realize I'm being dumb. basically, I want the debugger to show me the underlying types that chrome's jit computes, or whatever magic it does to infer types [04:51] aaronblohowiak: DTrejo: I attached a debugger to my process, but it isnt working. my code still has bugs. [04:51] halfhalo: call terminex [04:52] fallsemo has joined the channel [04:52] halfhalo: :d [04:52] aaronblohowiak: halfhalo++ [04:52] v8bot: aaronblohowiak has given a beer to halfhalo. halfhalo now has 2 beers. [04:52] DTrejo: aaronblohowiak: :) [04:52] tfe_ has joined the channel [04:52] pifantastic has joined the channel [04:52] aaronblohowiak: i spent the whole afternoon recycling all the cardboard in my garage because my neighbors have some silverfish =( boooo, bugs [04:52] DTrejo: aaronblohowiak: wouldn't that be a nice feature? [04:53] aaronblohowiak: heck, yea! [04:53] DTrejo: hmm, I wonder who I should bother to implement that for mee..... [04:53] aaronblohowiak: I am thinking about writing a macro system for javascript using uglify-js. i can't figure out a way to have hygenic macros, though =( [04:53] DTrejo: it's ok to get nasty sometimes! [04:54] p_nitsch_ has joined the channel [04:55] aaronblohowiak: i noticed the irc-twitter bridge is gone [04:55] aaronblohowiak: http://twitter.com/#!/aaronblohowiak/status/67452367196536832 [04:56] bad_at_math has joined the channel [04:57] jhford has joined the channel [04:59] seivan has joined the channel [05:01] SvenDowideit has joined the channel [05:01] vikstrous: can someone explain to be briefly how bindings work and how one writes bindings? [05:01] vikstrous: to me* [05:02] towski has joined the channel [05:04] DTrejo: aaronblohowiak: I think it went away cause there were too many tweets? but I don't remember anyone discussing the decision to get rid of it [05:04] DTrejo: I kinda liked it [05:04] aaronblohowiak: DTrejo: wow, victim of its own success [05:04] DTrejo: I may be wrong though [05:05] DTrejo: not sure who made that bot either [05:05] aaronblohowiak: node.js on freenode doesn't scale! [05:05] DTrejo: I'd kinda like it back for a bit, maybe [05:05] aaronblohowiak: ;) [05:05] yozgrahame has joined the channel [05:05] monokrome: vikstrous: https://www.cloudkick.com/blog/2010/aug/23/writing-nodejs-native-extensions/ [05:05] aaronblohowiak: DTrejo: I am thinking about making an npm->irc bot [05:06] DTrejo: ooh! [05:06] DTrejo: yeah [05:06] DTrejo: I like [05:06] monokrome: npm->irc bot? [05:06] DTrejo: when something is published [05:06] fangel has joined the channel [05:06] DTrejo: or updated [05:06] towns has joined the channel [05:06] aaronblohowiak: DTrejo++ [05:06] v8bot: aaronblohowiak has given a beer to DTrejo. DTrejo now has 1 beers. [05:06] monokrome: ACTION is wrigin an IRC "client/daemon" [05:06] DTrejo: aaronblohowiak++ and another when you do it :) [05:07] DTrejo: aaronblohowiak++ [05:07] v8bot: DTrejo has given a beer to aaronblohowiak. aaronblohowiak now has 2 beers. [05:07] monokrome: which is a daemon that acts as a client :D [05:07] aaronblohowiak: yay (^.^) [05:07] aaronblohowiak: monokrome: aren't all bots daemons that act like clients? [05:08] monokrome: Kind of [05:08] darshanshankar: darshanshankar++ [05:08] v8bot: darshanshankar: Don't cheat! You can't give a beer to yourself. [05:08] monokrome: This is a client that connects to the server, logs everything, and publishes messages to a client that I run on my computer [05:08] darshanshankar: damn. i could really use a beer right now :P [05:08] aaronblohowiak: DTrejo: is npm -> irc bot or macro system using uglify-js better? [05:09] aaronblohowiak: v8bot: valueof(this) [05:09] v8bot: aaronblohowiak: Use v8: to evaluate code or "`v commands" for a list of v8bot commands. [05:09] aaronblohowiak: v8: valueof(this) [05:09] v8bot: aaronblohowiak: ReferenceError: valueof is not defined [05:09] typn has joined the channel [05:09] aaronblohowiak: v8: valueOf(this) [05:09] v8bot: aaronblohowiak: {console:{log:function (x){console.out.push(pp…,out:[]},print:function print(x){console.log(x)…,pp:function pp(o,depth){return pp_r…,pp_r:function pp_r(o,d){var a=[],p if…} [05:09] monokrome: So, I can run a client on any computer at any time that has access to full logs but my connection still stays open on the server when I shut my machine down [05:09] aaronblohowiak: monokrome: oh, cool [05:10] aaronblohowiak: monokrome: like a cacheing proxy [05:10] monokrome: and so that logs are sync'd between multiple clients [05:10] monokrome: but clients could also be bots, because they can be any program that responses to events received from the client-daemon [05:10] monokrome: or any mix of those configurations [05:10] monokrome: kind of weird [05:11] monokrome: It doesn't proxy because it defines it's own protocol using zeromq/google protobuf [05:11] vikstrous has joined the channel [05:11] monokrome: and converts it into IRC protocol in the daemon itself... [05:11] amerine has joined the channel [05:12] mAritz has joined the channel [05:13] hassox has joined the channel [05:13] aaronblohowiak: oh wow [05:13] aaronblohowiak: sounds complex =) [05:14] ctran has left the channel [05:14] edude03 has joined the channel [05:15] gavin_huang has joined the channel [05:15] aaronblohowiak: anyone use this: https://github.com/martynsmith/node-irc ? [05:15] monokrome: yep [05:16] monokrome: That's what my client-daemon is using [05:17] MrTopf has joined the channel [05:19] minh has joined the channel [05:19] monokrome: why? [05:20] afei has joined the channel [05:21] afei: ? [05:21] aaronblohowiak: is it working well for you? [05:21] afei: 这个有点屌哦 [05:21] aaronblohowiak: i am trying to pick a good irc library [05:21] monokrome: I've had issues with a local server [05:21] monokrome: but it seems to work pretty well on freenode [05:22] darshanshankar has joined the channel [05:22] aaronblohowiak: cool [05:23] mtduv has joined the channel [05:24] MikhX has joined the channel [05:24] ExsysTech has joined the channel [05:24] indexzero has joined the channel [05:25] p_nitsch_ has joined the channel [05:28] fr0stbyte_ has joined the channel [05:28] truedat101 has joined the channel [05:29] bastilian has joined the channel [05:30] afei has left the channel [05:32] stonebranch has joined the channel [05:33] samsonjs has joined the channel [05:34] indutny has joined the channel [05:34] Viriix has joined the channel [05:38] galaxywatcher has joined the channel [05:38] jdp has joined the channel [05:43] k1ttty has joined the channel [05:44] jetienne has joined the channel [05:46] kal_ has joined the channel [05:47] jtmkrueger has joined the channel [05:47] jtmkrueger: could I ask someone a few questions about updating my version of node? [05:48] jtmkrueger: i'm still on version 0.1.31 [05:48] jtmkrueger: and am having some trouble updating [05:48] sarkis has joined the channel [05:48] sarkis: hey guys, with express, the controllers are all in app.js right? [05:49] monokrome: jtmkrueger: What trouble are you having? [05:49] jtmkrueger: I have the package in /usr/local/src [05:49] jtmkrueger: and need some help with the commnads to update [05:49] bastilian has joined the channel [05:50] fr0stbyte_ has left the channel [05:50] jtmkrueger: should I do a wget to download the latest tar [05:50] jtmkrueger: ? [05:51] jtmkrueger: then just make [05:51] jtmkrueger: and make install? [05:52] mtduv: Hi i have a general javascript question - how do i retain the information i have in a callback function? [05:53] mtduv: im using node-walk in npm to traverse a file directory and in the 'end' callback i use function(results) { fs.writeFile("blah",results); } but results is always nil [05:53] mtduv: i can however console.log(results) just fine [05:55] p_nitsch has joined the channel [05:57] tee has joined the channel [05:58] Guest35326 has left the channel [05:58] neoesque has joined the channel [05:59] chjj: mtduv: what do you mean? are you calling console.log at the same time? [05:59] mtduv: chjj: writing to the file is always blank and when i console.log i see the data, at the same time or separately [06:00] chjj: i also imagine "results" is an array, you cant just write an array to a file [06:00] moshe has joined the channel [06:00] chjj: fs.writeFile('blah', JSON.stringify(results)); [06:00] chjj: try that [06:00] Xano has joined the channel [06:01] mtduv: wow thanks a lot - that worked [06:01] chjj: no problem [06:01] mtduv: i feel like a noob, why does that work and not an array? [06:01] chjj: because an array is an abstract data structure, its not a scalar value like a number or string or something [06:01] chjj: theres no real way to represent it "on paper" so to speak [06:02] chjj: JSON is a data interchange format based on JS array/object/string/number literals [06:02] chjj: so it can convert an array in javascript to a string representing an array with the same structure [06:02] moshe has left the channel [06:02] mtduv: oh that is cool, wow [06:03] mtduv: thanks a lot again :-) been banging my head on my desk for a while now [06:03] chjj: if you want to load the data again, you can do fs.readFile('...', 'utf-8', function(err, data) { data = JSON.parse(data); }); [06:04] maru_cc has joined the channel [06:05] temp01 has joined the channel [06:06] sarkis: what would you guys recommend for a blog's db? mongodb or redis? [06:06] coreb has joined the channel [06:06] jesusabdullah: flat files ;) [06:06] chjj: redis doesnt seem like it would be right for a blog, its an in-memory key-value store [06:07] chjj: but yes, flat files ;) [06:07] chjj: for the win [06:07] jhurliman: whatever you are most comfortable working with [06:07] sarkis: mongodb is flat files no/ [06:07] sarkis: ?* [06:07] chjj: no [06:08] matyr has joined the channel [06:08] chjj: by flat files we mean, no db at all, just the local filesystem [06:08] sarkis: i see [06:08] chjj: most people dont go that route though [06:09] chjj: mongodb or couchdb would be more appropriate for a blog type site [06:09] chjj: than redis [06:09] dmojoryder: mongodb is a document orientated db. It actually stores json documents (technically in binary json aka bson). Its a good fit for blogs imo [06:09] tonymilne: mongodb, but you could use mysql too. [06:10] chjj: if i were going to use a db for a blog i would probably use sqlite, just cause its a tough little bastard [06:10] AAA_awright: Stay away from SQLite if you can help it [06:10] zeunix has joined the channel [06:11] chjj: not as convenient as a document store [06:11] AAA_awright: Storing strings in integer fields and not throwing an error is just evil [06:11] chjj: why? [06:11] AAA_awright: Plus indexing falls apart once your tables grow beyond 3GB [06:11] chjj: how many blogs really go beyond 3gb of text? [06:12] zeunix: Anyone care to explain the filename parameter in all of the vm module methods? No matter how I use it, nothing changes for me. [06:12] zeunix: the documentation says "as if it were loaded from filename" but I can't figure out what that means? [06:13] zeunix: I assumed that meant as if I had done a require() but I can't understand how it affects things as none of the methods allow local scope? [06:14] chjj: i think it makes it act as though it were loaded as a module, not sure [06:14] chjj: never used that parameter myself [06:15] zeunix: That's what I took from it as well, but what's the difference haha. Every test I run about accessing variables in various scopes returns the same result with or without the filename parameter. [06:15] zeunix: strange. [06:16] chjj: maybe it wraps it and passes in __dirname and __filename like it does with a module? [06:16] zeunix: ah ha! now that would make sense. [06:18] mraleph has joined the channel [06:19] sarkis: hmm looking at couchdb and mongodb.. couchdb looks interesting :) just want to play around with one of these and express.js for a little blog app [06:19] sarkis: i wanna do it to mainly learn node.js and pick up one of these up and coming nosql db's along the way too [06:19] sarkis: why not... [06:20] chjj: i like couchdb because its trivial to write a couchdb driver [06:20] chjj: with the client http requests available in node [06:20] chjj: mongo is a bit more heavyweight in that regard [06:21] ryah has joined the channel [06:23] pyrotechnick1 has joined the channel [06:23] mjr_: CouchDB is fun for smaller things. I recommend it. [06:24] bastilian has joined the channel [06:25] sreeix has joined the channel [06:25] p_nitsch_ has joined the channel [06:27] ivanfi has joined the channel [06:27] stanni has joined the channel [06:28] wao: and isn't great for big projects? [06:28] DTrejo: I like cradle [06:28] DTrejo: :) [06:28] mjr_: It all depends on what you mean by "big' [06:29] mjr_: A single CouchDB can do quite a lot of traffic, but performance is not its primary focus. [06:29] mjr_: Excellent replication and data durability are where it really shines. [06:29] DTrejo: hey mjr_ , looking forward to your nodeconf video, I wish there were more people talking about their more sophisticated node setups [06:30] mjr_: DTrejo: yeah, it seems to have been well received. [06:32] fangel has joined the channel [06:39] Viriix has left the channel [06:40] abraxas has joined the channel [06:41] rauchg has joined the channel [06:42] matjas has joined the channel [06:42] `3rdEden has joined the channel [06:42] jdp has joined the channel [06:43] FireFly has joined the channel [06:43] RusAlex has joined the channel [06:44] marcosvm has joined the channel [06:45] javaanse_jongens has joined the channel [06:45] emattias has joined the channel [06:46] JianMeng has joined the channel [06:47] seivan has joined the channel [06:47] ditesh|cassini has joined the channel [06:49] christkv_ has joined the channel [06:49] gavin_huang has joined the channel [06:49] sarkis: hmm ok, so i think i will go with couchdb for now :) [06:49] TomY_ has joined the channel [06:50] ph^ has joined the channel [06:53] link has joined the channel [06:54] hassox has joined the channel [06:56] SamuraiJack has joined the channel [06:57] kryptom has joined the channel [06:57] sarkis: are there any major benefits in using socket.io over the net node module? [06:57] `3rdEden: socket.io is for realtime communication between server and browser... [06:57] djcoin has joined the channel [06:57] sarkis: ah i see... i am getting it mixed up with TCP socket :) [06:57] `3rdEden: :) [06:57] sarkis: i think.. [06:58] jacobolus has joined the channel [07:03] DTrejo: gnight everyone! [07:04] matyr_ has joined the channel [07:05] FireFoxIXI has left the channel [07:05] jhurliman: is there any way to coax more info out of jade when a template fails to compile? [07:05] astropirate_ has joined the channel [07:05] jhurliman: i get a message like "SyntaxError: Unexpected token )" but no line number from the template file [07:05] jamescarr: hmmm.. what replaced npm bundle!? [07:05] groom has joined the channel [07:05] DennisRas has joined the channel [07:06] ph^ has joined the channel [07:08] mtduv has joined the channel [07:08] jhurliman: i found a mention that the jade tokenizer does track line numbers, but i can't find any reference to a line number in the Error object that jade is throwing [07:09] eee_mk has joined the channel [07:10] hybsch has joined the channel [07:11] jhurliman: although i guess maybe the exception is being thrown during tokenization so it doesn't actually have line number data yet. oh well [07:15] tobiassjosten has joined the channel [07:15] stonebranch has joined the channel [07:16] jbpros has joined the channel [07:19] FireFly|n900 has joined the channel [07:21] Druide_ has joined the channel [07:25] awenkhh has joined the channel [07:25] SvenDowideit has joined the channel [07:25] eldios has joined the channel [07:26] MrTopf has joined the channel [07:27] tobiassjosten has joined the channel [07:27] robhawkes has joined the channel [07:30] jacter has joined the channel [07:30] Frippe has joined the channel [07:30] hassox has joined the channel [07:31] boghog has joined the channel [07:32] Shrink has joined the channel [07:32] Shrink has joined the channel [07:32] dgathright has joined the channel [07:33] azeroth___ has joined the channel [07:36] galaxywatcher has joined the channel [07:36] ewdafa has joined the channel [07:37] ryah has joined the channel [07:37] towski has joined the channel [07:37] [AD]Turbo has joined the channel [07:41] bergie has joined the channel [07:41] jacter1 has joined the channel [07:46] hassox has joined the channel [07:46] bergie has joined the channel [07:47] msucan has joined the channel [07:48] [AD]Turbo: hola a todos [07:49] qFox has joined the channel [07:50] Bj_o_rn has joined the channel [07:50] javaanse_jongens has joined the channel [07:51] hwinkel has joined the channel [07:51] monokrome: Anyone know how to get the UNIX hostname for a running process? [07:51] monokrome: It's not in process.ENV... Not that I'm saying that it should be [07:52] jesusabdullah: You mean, what computer it's running off? [07:52] monokrome: The hostname. [07:52] zed0: http://nodejs.org/docs/v0.4.7/api/os.html#os.hostname [07:52] jesusabdullah: cat /etc/hostname ? [07:52] monokrome: ACTION cries for jesusabdullah  [07:52] monokrome: zed0: Ah, thank you. I was looking around in sys. [07:52] jesusabdullah: heh [07:52] uchuff has joined the channel [07:52] markwubben has joined the channel [07:53] troessner has joined the channel [07:53] jesusabdullah: SAME THING [07:53] jesusabdullah: XD [07:53] jesusabdullah: But still, cool [07:54] monokrome: Too bad we can't get a full domain, somehow! :) [07:54] jesusabdullah: whatismyip.com ;) [07:54] monokrome: jesusabdullah: The reason that it's not the same thing is regarding cross-platform support. [07:55] monokrome: jesusabdullah: That is an IP, not the local domain setting. [07:55] monokrome: The domain is usually the first name mapped to 127.0.0.1 in /etc/hosts [07:57] tahu has joined the channel [07:57] zed0: monokrome: nslookup? [07:57] matyr has joined the channel [07:57] monokrome: zed0: http://nodejs.org/docs/v0.4.0/api/dns.html [07:57] monokrome: Not the same thing [07:57] monokrome: Well, I mean it'd be the same thing [07:57] TurboAWAY has joined the channel [07:57] monokrome: but it's blocking - so wont fit this use [07:58] monokrome: but hostname suffices :) [07:58] monokrome: thanks for your help [07:58] jspiros has joined the channel [07:58] zed0: Does dns.reverse from that page not do what you want? [07:58] Ratty_: Is it possible to modify string objects in place? i.e. ones created with new String(); [07:59] Ratty_: I want it to update all variables with a reference to that string [07:59] monokrome: zed0: Yes, but it's blocking. :) [07:59] monokrome: non-blocking* [07:59] xeodox: Has anyone used socket.io here? [07:59] `3rdEden: ACTION raises hand [07:59] zed0: monokrome: What's the problem then? :P [07:59] ExsysHost has joined the channel [08:00] xeodox: `3rdEden: Usually I do this: [08:00] xeodox: But would this work? src="http://subdomain.mydomain.com/socket.io/socket.io.js">? [08:00] mhausenblas has joined the channel [08:00] `3rdEden: yes that would work .. (absolute paths are better) [08:00] `3rdEden: but that would as well.. if you have socket.io hosted on yhour subdomain [08:00] monokrome: zed0: Like I said, I would like the local domain name instead of hostname. However, hostname will work because any decent IRC server will use an ident server here anyway... :) [08:00] xeodox: what I mean is...the page people will be viewing is mydomain.com [08:01] `3rdEden: or ... if you host the socket.io.js your self than that would work as well xeodox [08:01] xeodox: but socket.io will be hosted on subdomain.mydomain.com [08:01] `3rdEden: that is no problem xeodox [08:01] xeodox: Have you used now.js? [08:01] `3rdEden: no [08:01] zed0: monokrome: Can't you just supply 127.0.0.1 as the ip address for dns.reverse? [08:02] stanni has joined the channel [08:02] monokrome: zed0: No, because that gets ['euphoria', 'localhost'] [08:02] monokrome: which is a confusing result [08:02] xeodox: `3rdEden: But wouldn't it cause cross domain problems for AJAX? [08:02] q_no has joined the channel [08:02] `3rdEden: socket.io provides a few transports that are capable of doing cross domain requests, but some are not :P [08:02] [AD]Turbo has joined the channel [08:02] monokrome: I would have expected: ['localhost.localdomain', 'euphoria', 'localhost'] [08:02] `3rdEden: websockets flashsocket jsonpolling xhrmultipart would all work cross domain xeodox [08:02] xeodox: yes, but IE8 doesn't have those [08:03] zed0: :S Well, as long as you have something which will work then I wouldn't worry about it. [08:03] `3rdEden: xeodox: flash? jsonppolling? [08:03] xeodox: hmm [08:03] `3rdEden: it's not ideal, but it does work :) [08:03] dies_el has joined the channel [08:03] hybsch has left the channel [08:04] xeodox: I'm using now.js (built on top of socket.io), and including it with subdomain doesn't work in IE8 :(. It works in Chrome and is fine, but IE8 it says, "no transport available" [08:05] `3rdEden: xeodox: sounds like nowjs issue to me [08:05] xeodox: I see. thanks [08:06] `3rdEden: but you can try to disable rememberTransports [08:06] `3rdEden: and see if that works [08:06] xeodox: how do I do taht? [08:06] `3rdEden: because by default flash sets a cookie in the browser with the last successfull transport [08:06] xeodox: what if I specify transports? (specify flash only hhehee) [08:06] MrTopf has joined the channel [08:07] `3rdEden: xeodox: hacking nowjs. :) they don't provide an interface for it [08:07] xeodox: huh? [08:07] xeodox: yea haha they dont [08:07] darshanshankar: xeodox: just email us at team@nowjs.com [08:07] darshanshankar: it'll be easier to help off channel [08:08] xeodox: oh hey darshan [08:08] darshanshankar: it'll also be easier if you actually show us code like we asked earlier haha :) [08:09] zpao has joined the channel [08:10] emattias_ has joined the channel [08:10] jzmudzinski has joined the channel [08:13] sendark has joined the channel [08:19] springify has joined the channel [08:21] jonathantaylor has joined the channel [08:22] Esteb has joined the channel [08:22] swaj has joined the channel [08:22] chjj: https://gist.github.com/962230 [08:23] chjj: my beloved arguments.callee [08:25] mischief has joined the channel [08:26] mischief has joined the channel [08:26] seivan has joined the channel [08:27] mischief has joined the channel [08:27] mischief has joined the channel [08:27] jesusabdullah: monokrome: CLOSE ENOUGH [08:27] jesusabdullah: ;) [08:28] jesusabdullah: ugh there is still a smudge in the bottom :( [08:28] jesusabdullah: Oh wellolol [08:28] jesusabdullah: Cleaning something <_< [08:31] djcoin has joined the channel [08:35] JoeYang has joined the channel [08:36] kawaz_air has joined the channel [08:36] hassox has joined the channel [08:37] viz has joined the channel [08:42] sreeix has joined the channel [08:43] azeroth___ has joined the channel [08:45] markwubben has joined the channel [08:47] matyr_ has joined the channel [08:48] jaket_ has joined the channel [08:48] beawesomeinstead has joined the channel [08:51] ntelford has joined the channel [08:54] icebox has joined the channel [08:56] beseku has joined the channel [08:57] zackattack has joined the channel [08:57] matyr has joined the channel [09:01] viz: I'm having some trouble wrapping my head around express routers vs backbone controller routers... seems like you have more control with express, but i really enjoy the backbone system. any help on the subject? are they both mutually compatible? [09:03] Ezku\: viz: backbone is for your frontend, express is a server side framework [09:03] `3rdEden: backbone routers cant handle get / post / put etc so it's pointless [09:04] jonathantaylor has joined the channel [09:04] `3rdEden: so you can't even use it on the server [09:05] prettyrobots has joined the channel [09:06] littke_ has joined the channel [09:08] prettyrobots_ has joined the channel [09:10] herbySk has joined the channel [09:11] jbpros has joined the channel [09:12] bzinger has joined the channel [09:14] beawesomeinstead has joined the channel [09:14] beawesomeinstead has joined the channel [09:16] thalll has joined the channel [09:16] matyr_ has joined the channel [09:17] k1ttty has joined the channel [09:18] viz: I've seen some efforts with socket.io to sync the two. Is this still pointless? Should i just stick to using express for all my MVC logic? [09:19] `3rdEden: viz: it only syncs the model and the collections, you cant sync routers :) [09:19] mike_miller has joined the channel [09:19] mike5w3c has joined the channel [09:20] viz: `3rdEden: I also saw this approach to sync the two... https://github.com/datapimp/backbone-express-mongoose-socketio/blob/master/lib/routes.js [09:20] Ratty_ has left the channel [09:21] viz: sorry if i'm being obstinate - i'm new to this and I really appreciate the work behind backbone. [09:21] yozgrahame has joined the channel [09:22] `3rdEden: viz that still doesn't allow you to sync the clientside routers with the serverside routers [09:22] `3rdEden: https://github.com/datapimp/backbone-express-mongoose-socketio/blob/master/test/app.test.js [09:22] `3rdEden: it's still a different syntax [09:23] `3rdEden: whoops wrong url ;o [09:23] `3rdEden: https://github.com/datapimp/backbone-express-mongoose-socketio/blob/master/lib/routes.js <-- the only url that works there is '/' [09:24] `3rdEden: or am i reading it wrong [09:24] skohorn has joined the channel [09:25] viz: no, i think you're right (its still in heavy dev). but i was looking particularly at how he retrieves the controller and then does if(url && action_handler){ [09:25] viz: app[method](url,action_handler); [09:26] viz: thus delegating backbone's controller logic to express... i think [09:26] eldios: sorry but.. wth is html5boilerplate ? [09:28] eee_mk has joined the channel [09:28] path[l] has joined the channel [09:32] emattias has joined the channel [09:33] markwubben has joined the channel [09:33] ph^ has joined the channel [09:36] viz: `3rdEden: so what do you recommend i do? just stick to using express for my MVC logic? [09:38] anoop has joined the channel [09:38] jbpros has joined the channel [09:39] `3rdEden: Either stick with express or write your own abstraction, it's not that hard to write a simple router that would be compatible with backbone viz [09:41] andy_dawson has joined the channel [09:41] rbranson has joined the channel [09:42] viz: `3rdEden: thanks. just new to this :) [09:43] xsyn has joined the channel [09:44] skohorn has joined the channel [09:52] matyr has joined the channel [09:53] skohorn has joined the channel [09:53] FireFly|n900 has joined the channel [09:54] Esteb has joined the channel [09:56] matyr_ has joined the channel [09:59] sled has joined the channel [10:00] MattJ has joined the channel [10:01] Esteb has joined the channel [10:02] seivan has joined the channel [10:05] jonaslund has joined the channel [10:05] philhawksworth has joined the channel [10:07] fyskij has joined the channel [10:08] skohorn has joined the channel [10:10] Sami_ZzZ____ has joined the channel [10:10] bergie has joined the channel [10:10] zackattack has joined the channel [10:13] Tony___ has joined the channel [10:13] irPhunky has joined the channel [10:13] Tony___: just got here from felix's guide, good morning [10:14] stanni has joined the channel [10:14] saschagehlich has joined the channel [10:14] pt_tr has joined the channel [10:14] whyme has joined the channel [10:15] Tony___: well this party's alive and kicking [10:15] Bogh has joined the channel [10:16] pandark_: I did the equivalent of a single-line command "curl --cookie somesite >somefile" and it only took me 60 lines :oD [10:18] scoates has joined the channel [10:18] andy_dawson has joined the channel [10:21] Tony___: anyone active in here? [10:21] squeeks: no. [10:24] `3rdEden: we are all idle [10:27] naughty_david has joined the channel [10:27] naughty_david: hey guys... [10:27] naughty_david: how is it going there? [10:28] naughty_david: have a small doubt about node's basic .. [10:28] nexxy has joined the channel [10:28] naughty_david: i tried testing a node app that i had made using apache benchmark.. [10:29] naughty_david: but it seems that the server was processing the requests serially .. so the more requests i send the more time it takes to process the complete request. [10:29] monokrome: Has anyone here got msgpack to install via npm? [10:30] edude03 has joined the channel [10:31] jonaslund: naughty_david: yes node is single threaded [10:31] jonaslund: naughty_david: You are not supposed to lock up processing to do stuff that can be done asynchronously (like reading/writing from/to network,disk, database,etc) [10:32] chjj: naughty_david: the point of node is that its single-threaded, but that shouldnt matter as long as youre not doing any blocking IO [10:32] naughty_david: jonaslund: hey .. thnx for replaying.. [10:32] naughty_david: i am not sure.. [10:32] jonaslund: (it's an interesting analogy) [10:32] chjj: cpu's are fast, very fast [10:32] naughty_david: cos wad my node server does is.. it takes a url and reads it, parse the content and send some selected data back [10:33] jonaslund: the Erlang runtime used to be single-threaded [10:33] chjj: its IO that is slow [10:33] jonaslund: and the approach to utilize more cores was to start several instances (like with node today) [10:33] jonaslund: My brother who is a die-hard erlanger (he's been working with Erlang since it was an internal Ericsson project) was like "no need to thread the runtime, just start more instances" [10:34] jonaslund: after they implemented multithreading support in the runtime he is saying how great it was that erlang supports utilizing your processor out of the box :D [10:34] naughty_david: :( [10:34] naughty_david: i mean :D [10:34] naughty_david: ok .. so reading a remote file will block the IO.. and thats whats slowing things down!! [10:34] eldios has joined the channel [10:35] chjj: no [10:35] naughty_david: cos i am using request() to read the remote file and parsing it using jquery.. it was too easy :P [10:35] chjj: naughty_david: youre making http requests using node's http api right? [10:35] jonaslund: Anyhow.. with regards to node and multithreading it's important to be aware of the fact that JS is not a threading friendly language, what is needed is some kind of properly designed layer for it all [10:35] naughty_david: no [10:35] Tony___: I'm wanting to bench mark a nodejs websocket app, anyone able to recommend tools? [10:35] chjj: what are you doing? [10:35] philhawksworth has joined the channel [10:36] naughty_david: i had tried it using http api .. but didnt work the way i wanted .. so i used request api [10:36] chjj: naughty_david: none of node's IO blocks by default [10:36] naughty_david: ok [10:36] chjj: whats "request api"? [10:36] jonaslund: chjj: depends on what functions you use [10:36] chjj: jonaslund: which is why i said by default [10:37] philhawksworth has left the channel [10:37] jonaslund: hmm, ok you mean it that way [10:37] anon1 has joined the channel [10:37] ditesh|cassini has joined the channel [10:38] anon1: The installation instructions say "export JOBS=2 # optional, sets number of parallel commands." Can someone explain to me what is meant by parallel commands? [10:38] chjj: naughty_david: what you are doing is probably non-blocking, node come with any blocking "over the wire" IO out of the box [10:38] chjj: node doesnt come with* [10:38] naughty_david: request({uri : target_url }, function (error, response, body) {}); [10:39] naughty_david: ok this is wad iv done... [10:39] chjj: ok, whatever youre using is probably non-blocking [10:39] naughty_david: ok [10:39] nerdfunk has joined the channel [10:39] nerdfunk: hi! [10:39] naughty_david: so why is it slowing things down when there are many requests ? [10:39] eguest309 has joined the channel [10:39] naughty_david: if i send 1 request it takes 1 sec.. [10:39] chjj: it depends on a lot of things, it depends on what youre doing to respond to the requests [10:40] chjj: 1 second? [10:40] naughty_david: but if i send 2 concurrent requests .. each will take 2 seconds [10:40] chjj: thats terrible [10:40] naughty_david: thats like 4 seconds total [10:40] chjj: youre probably doing something blocking in your request handlers [10:40] chjj: 1 second for 1 request is ridiculously slow [10:40] naughty_david: no no [10:41] naughty_david: its taking a second cos im reading a remote page and processing the data and then sending it to the client [10:41] chjj: are you doing this in your request handlers: var i = 10000000000; while (i--) {} [10:41] naughty_david: no [10:41] naughty_david: flow is something like this.. [10:41] nerdfunk: I'm interested in using node to analyze twitter's gardenhose... not sure what to use to connect though.. http.createClient ? [10:41] naughty_david: 1. user sends a req with a url [10:41] chjj: ok, but it shouldnt be 2 seconds for 2 requests [10:42] chjj: how are you processing the data? [10:42] naughty_david: 2. server opens the url , reads the data and parse it [10:42] naughty_david: 3. send the processed data back to user [10:42] chjj: that may be taking the bulk of the time for some reason [10:42] chjj: and it may be blocking [10:42] naughty_david: its jquery ,, [10:42] naughty_david: im parsing the contents of the page using jquery [10:42] eguest309: hi guys wanted to install mulit-node and was wondering how to do that [10:42] nerdfunk: does the server need to do the parsing? [10:42] chjj: you mean jsdom + jquery? you cant really just parse html with jquery alone [10:43] dsirijus has joined the channel [10:43] nerdfunk: perhaps, that may be passed over to the client [10:43] chjj: nerdfunk: try serving the raw data to the client without jsdom parsing it [10:43] chjj: see if things improve [10:43] Xano has joined the channel [10:44] chjj: if they do, jsdom is taking a long time to parse the data [10:44] nerdfunk: yes, thats what i meant but for naughty_david ;) [10:44] chjj: oh right [10:44] chjj: meant to say naughty_david: [10:44] nerdfunk: hehe [10:44] chjj: ;p [10:44] naughty_david: :) ok [10:45] nerdfunk: sorry, bit of a newb.. what's the recommended way to have a server connect to streaming apis ? [10:45] mape: eguest309: what are you using it with? [10:45] chjj: does jsdom have a streaming html parser? technically it should if it wants to mimic real dom [10:46] thalll has joined the channel [10:47] nerdfunk has joined the channel [10:47] darrylb123 has joined the channel [10:47] eguest309: i have an http server and another socket server that i wrote up which i forsee will be handling a lot of requests .so wanted to use multinode to enable more to have access to the other cores on my cpu. [10:47] nerdfunk has joined the channel [10:47] nerdfunk: oops [10:48] FireFly|n900 has joined the channel [10:48] nerdfunk: shaky connection [10:48] chjj: nerdfunk: what were you saying? [10:48] nerdfunk: ah, sorry. [10:48] nerdfunk: i'd like to parse something like the twitter garden hose using node.. a constantly updated api [10:48] naughty_david: chjj : im not using jsdom [10:48] sion2k has joined the channel [10:48] mape: eguest309: can't you install it through npm? [10:49] naughty_david: im using the jquery pluing ($ = require('jquery')) [10:49] chjj: naughty_david: what are you using to parse the pages then? [10:49] mape: and if it isn't in npm just fetch the code and put it into your project [10:49] chjj: im pretty sure jquery cant parse html into dom by itself [10:49] nerdfunk: which module is a good fit ? [10:49] naughty_david: hmm.. [10:50] naughty_david: opps yea.. there is jsdom .. sorry.. [10:50] naughty_david: let me try without it !! [10:50] naughty_david: sorry :P [10:50] chjj: well jquery wont work without it [10:50] chjj: so try without jsdom or jquery [10:50] chjj: just serve the raw data [10:50] eguest309: oh okay.li says multi-node is not in the registry [10:50] eguest309: when i try installing it through npm [10:51] mape: eguest309: yeah then just fetch down the code, put it into your projects folder and link it from there [10:51] tahu has joined the channel [10:51] fairwinds has joined the channel [10:52] naughty_david: chjj: this is even more weird [10:52] naughty_david: 1 request 1.5 secs [10:52] naughty_david: 2 request 6 secs :( [10:52] eguest309: okay.will try that and see how it goes. [10:52] toddmoore has joined the channel [10:52] naughty_david: 3 request 4 secs :( [10:54] nerdfunk: API <-What goes in here?-> server -> data callback -> client (long polling / socket io) :) [10:55] sendark: I'm getting an error Object # has no method 'getOAuthAccessToken' trying to authenticate with oAuth. i'm using the node-oauth example, and inspecting the session object, i can see that the oa object has no methods. is this correct? [10:56] chjj: naughty_david: something is very broken then [10:56] chjj: its hard to say [10:56] Bogh has left the channel [10:56] mtsl has joined the channel [10:56] eguest309: how far does multi node require me to make changes to my application logic? [10:57] naughty_david: chjj: :( [10:57] naughty_david: thanks any ways :) [10:57] chjj: naughty_david: i would keep trying to rule things out [10:58] naughty_david: :) [10:58] naughty_david: yea..im doing that [11:00] pandark_: node doc recommends html5 for parsing html… [11:00] pandark_: http://nodejs.org/docs/v0.4.7/api/appendix_1.html [11:02] toddy_ has joined the channel [11:04] cleanah has joined the channel [11:04] eguest309: does it work silently in the background or u need to hack up and change some of your application logic [11:08] anon1 has joined the channel [11:08] okuryu has joined the channel [11:11] mape: eguest309: none [11:13] eguest309: wow.interesting.plug and play :) [11:14] eguest309: how does it do queing and how does it determine when and how to scale to the other cpus [11:14] mape: eguest309: the kernel does [11:14] matyr has joined the channel [11:14] mape: " Each of these processes in turn inserts the received file descriptor into its event loop and accepts incoming connections as they become available. The OS kernel itself is responsible for load balancing connections across processes." [11:15] mape: "It's important to note that each this is effectively an L4 load balancer with no affinity; each request by any given client may be served by any of the workers. Any application state that needs to be available to a request cannot simply be kept in-process in a single NodeJS instance." [11:15] mape: eguest309: good read, http://developer.yahoo.com/blogs/ydn/posts/2010/07/multicore_http_server_with_nodejs/ [11:15] eee_c has joined the channel [11:16] eguest309: alrit thanks !!. [11:16] path[l] has joined the channel [11:16] justinTNT has joined the channel [11:17] bastilian has joined the channel [11:17] justinTNT: lo. [11:18] anon1 has left the channel [11:20] nerdfunk: hrm. [11:20] eldios: require('./public').set(app, blog); <-- what does this do? [11:23] eldios: oh.. oh.. maybe I got it.. it requires public.js in cwd [11:23] eldios: okok nvm [11:25] test1 has joined the channel [11:29] q_no has joined the channel [11:31] awenkhh has joined the channel [11:34] BenC[UK] has joined the channel [11:34] fyskij has joined the channel [11:38] daglees has joined the channel [11:38] daglees has joined the channel [11:38] neoesque has joined the channel [11:39] BenC[UK]: hey guys [11:39] Country has joined the channel [11:39] BenC[UK]: Im confued... http://pastebin.ca/2055698 - I have this code, but im getting a ReferenceError: sys is not defined when I try and run it [11:40] nerdfunk: var sys = require("sys"); [11:41] ruquay has joined the channel [11:41] colinvandyke has joined the channel [11:41] galaxywatcher has joined the channel [11:42] BenC[UK]: grr, what a !@£$! [11:42] BenC[UK]: thanks :) [11:42] nerdfunk: haha [11:42] nerdfunk: no probs. [11:42] bshumate has joined the channel [11:42] bshumate has joined the channel [11:43] braddunbar has joined the channel [11:43] BenC[UK]: I was thinking the mysql-native module was throwing something out [11:45] unomi has joined the channel [11:45] mAritz has joined the channel [11:47] cvandyke has left the channel [11:47] nerdfunk: is anyone using the node-twitter "stream" successfully ? [11:48] nerdfunk: I'm trying to do this in the REPL .. . http://pastebin.com/5bwQrXXU [11:48] chjj: BenC[UK]: the "sys" module is deprecated [11:49] boaz has joined the channel [11:49] chjj: some stuff that was there was moved to "util" [11:49] cvandyke has joined the channel [11:51] jetienne has joined the channel [11:54] `3rdEden: chjj: that doesn't matter as the 'sys' module isn't even used in the code [11:57] andrewfff has joined the channel [11:57] chjj: oh i see [11:59] `3rdEden: also sys just proxys everything to util at this point :P [11:59] jbpros has joined the channel [11:59] jtrudeau has joined the channel [12:00] chjj: `3rdEden: yeah, hopefully thats removed at some point though [12:02] micheil has joined the channel [12:02] irPhunky has joined the channel [12:04] awenkhh has joined the channel [12:07] viz: I'm looking for a rather complete open source node.js implementation (something more than hello world, and a bit less than cloud9) to learn from.. any recommendations? [12:08] monokrome: viz: Implementation of what? [12:09] `3rdEden: monokrome: he wants a demo app [12:09] viz: yes please :) [12:10] viz: rather a working app (demo apps seem to stop at hello world) - i'd like a larger view of a complete structure [12:11] `3rdEden: I have a WIP demo app here: might or might not be usefull: https://github.com/3rd-Eden/Outside [12:13] viz: `3rdEden: thanks, i'll take a look [12:14] ph^ has joined the channel [12:15] `3rdEden: also: https://github.com/alexyoung/nodepad [12:18] viz: `3rdEden: :) [12:18] monokrome: `3rdEden: A demo app?! [12:19] viz: `3rdEden: btw, i'll be taking a look later at your socket.io work [12:19] chjj: viz: when i first started using node i was in a similar position, it takes a while to figure out a way of structuring node apps that youre comfortable with [12:19] `3rdEden: monokrome: everybody <3 demos [12:19] chjj: just mess around a bit, itll come to you :) [12:22] viz: chjj: what's are your personal preferences? [12:23] ntelford has joined the channel [12:23] broofa: Anyone here know what "npm bin" is supposed to do? docs say it prints where npm installs executables, but it seems to depend on what directory I'm running it from. Almost as though it's setting, not printing, the directory [12:24] viz: chjj: i'm coming from Drupal (CMS), although i was craving for more of a framework for a long time, but yeah, it's a bit overwhelming. [12:24] mape: `3rdEden: I can't seem to connect to your demo on http://localhost:8908 .. :P [12:24] `3rdEden: mape: you got all dependencies installed? [12:24] `3rdEden: (see package.json) [12:24] mape: (bad joke about linking a local address) [12:25] `3rdEden: troll [12:25] `3rdEden: :9 [12:25] mape: ! [12:27] mc_greeny has joined the channel [12:28] fumanchu182 has joined the channel [12:28] JacobSingh has joined the channel [12:29] JacobSingh: I made some change (can't figure out what it was), and now the partials in my jade templates are rendering 5 times each... any ideas why? [12:29] deedubs has joined the channel [12:30] clip has joined the channel [12:30] quackslike: JacobSingh: you use version control though right? [12:31] JacobSingh: quackslike: yes, but I just made some very unrelated changes. [12:31] JacobSingh: I Think I just figured it out [12:31] JacobSingh: I switched to mongoose [12:32] JacobSingh: and findById returns a 5 element hash... even though it is only one doc... passing that into a partial causes it to loop [12:32] JacobSingh: Not sure how to fix it though [12:32] quackslike: ah wide sweeping changes are a bit of a bugger sometimes.. [12:32] gmonnerat has joined the channel [12:33] bergie has joined the channel [12:33] gmonnerat has left the channel [12:34] eyesUnclouded has joined the channel [12:34] JacobSingh: quackslike: If you declare it is {myvar: myvar} in the partial() instead of just myvar [12:34] JacobSingh: it works again [12:34] JacobSingh: I'm sure I'm not the only person to have hit that;) [12:35] quackslike: :) [12:35] quackslike: i've been using jqtpl or somethign.. [12:35] k1ttty has joined the channel [12:36] quackslike: seems ok, the sytax seems easier for me to get my head around [12:36] kawaz_air has joined the channel [12:36] Casperin has joined the channel [12:37] dyer has joined the channel [12:39] clip: hi there! anyone got a good example for using flashsockets with socket.io? just can't figure out how to get a connection or where the problem is [12:40] `3rdEden: `is your server on` :D? [12:40] quackslike: lol [12:40] `3rdEden: or.. do you have a error :$? [12:41] eee_mk has joined the channel [12:43] catshirt has joined the channel [12:43] kriszyp has joined the channel [12:44] davidwalsh has joined the channel [12:47] quackslike: heh i thought my downloader wasnt working.. it seemed too fast.. [12:48] Casperin has joined the channel [12:49] Esteb has joined the channel [12:49] Muon has joined the channel [12:49] Muon has joined the channel [12:50] tiemonster has joined the channel [12:50] DedSirijus has joined the channel [12:52] nexxy has joined the channel [12:52] nexxy has joined the channel [12:52] eyesUnclouded has joined the channel [12:53] ron_frown has joined the channel [12:53] ph^_ has joined the channel [12:54] cbibler_ has joined the channel [12:56] eee_c has joined the channel [12:56] marcello3d has joined the channel [12:58] marcello3d has joined the channel [13:00] FireFly|n900 has joined the channel [13:00] galaxywatcher has joined the channel [13:02] arianrock has joined the channel [13:03] arianrock: hi [13:03] FireFly has joined the channel [13:03] Spion has joined the channel [13:06] jlecker has joined the channel [13:06] jlecker has left the channel [13:08] xeodox has joined the channel [13:08] sambao21 has joined the channel [13:09] baudehlo has joined the channel [13:09] GasbaKid has joined the channel [13:11] xsyn has joined the channel [13:11] test1: hey all - can anyone tell me the purpose of index.js files? [13:11] [algo] has joined the channel [13:12] [algo]: I have a variable "persistence" in main.js [13:12] [algo]: how can I use it in module? [13:13] [algo]: if I rerequire it in the module - will the object be same? [13:13] Poetro has joined the channel [13:13] [algo]: I mean: require('persistence') in different files returns same object right? [13:13] chjj: algo: modules are cached [13:14] chjj: so youll get a reference to the same object in every file thats executed [13:14] [algo]: I should extract the code which defined persistence into submodule? [13:14] piscisaureus has joined the channel [13:14] chjj: what? [13:14] [algo]: I have a code which creates variable 'var persistence = ... ' [13:14] chjj: ok [13:14] [algo]: I want to use it in the module [13:15] test1: can anyone tell me the purpose of index.js files? [13:15] chjj: what is "the module"? [13:15] [algo]: main.js requires 'module.js' [13:15] [algo]: main.js has 'var persistence = ' [13:15] chjj: you can expose it to another module with exports.persistence = persistence [13:15] Wizek has joined the channel [13:15] [algo]: module.js needs persistence [13:15] chjj: and then var persistence = require('./mymodule').persistence; [13:16] fallsemo has joined the channel [13:16] mdaisuke has joined the channel [13:16] [algo]: you mean, move 'var persistence = ' from main.js into separate module? [13:16] [algo]: introduce one more module? [13:16] chjj: test1: when node traverses the directory structure to search for modules, if it finds and index.js or package.json in a directory with the name of the module requested, it uses those [13:17] chjj: index.js or package.json, package.json is higher priority [13:17] chjj: algo: you have a variable in one file and you want it in another right? [13:17] [algo]: same thing with application settings [13:17] [algo]: they are per-app [13:17] test1: :chjj - ahh okay thanks. So does that mean you just have to say require(directory name) [13:17] [algo]: yes, chjj [13:18] chjj: you can expose objects from module to module with the module.exports property [13:18] [algo]: so I can pass a variable to module by assigning it's exports ? [13:18] xeodox has joined the channel [13:18] chjj: so you can do, "module.exports = myvariable;" in file1, and do "var myvariable = require('./file1');" in file2 [13:18] [algo]: like 1) var m = require('mymodule') 2) m.bla = 5 3) now m has variable 'bla' ? [13:19] quackslike: [algo] yeah you just set it [13:19] dotcomstu has joined the channel [13:19] [algo]: the problem is that the module uses persistence in initialization [13:19] [algo]: when required, [13:19] [algo]: var Picture = exports = persistence.define('Task', { ... } [13:20] chjj: thats wrong [13:20] chjj: exports = whatever will just override the reference to the module.exports object [13:20] chjj: you need to do module.exports = obj [13:20] dmojoryder has joined the channel [13:21] chjj: test1: if you do require('mymodule'); node will check NODE_PATH and also traverse up the directory structure looking in "node_modules" directories for the module of that name [13:21] quackslike: [algo] just create a function to init your module. [13:21] matwill has joined the channel [13:21] chjj: require('./mymodule') will look for a module in the current directory [13:21] chjj: if theres any kind of actual path [13:22] SeyZ has joined the channel [13:22] [algo]: by the way, I have node_modules for NPM installs [13:22] [algo]: should I put my own modules there also ? [13:22] [algo]: into same dir [13:23] mdaisuke has joined the channel [13:23] test1: :chjj - so whats the benefit of index.js files then? [13:23] [algo]: I'd like to move them into other folder, so they don't mess with 3rd party [13:23] eyesUnclouded has joined the channel [13:23] chjj: if you think they will be useful for other projects @algo [13:23] [algo]: but if I do, I have to include them like './modules/my' [13:23] [algo]: is there a good way to use require('my'), but keep the module separate from NPM stuff [13:24] chjj: test1: index.js files are what node will require by default if it finds a directory with the requested module name, so you dont have to do: require('./mymodule/mymodule') [13:24] GasbaKid has joined the channel [13:24] fermion has joined the channel [13:24] chjj: you can also use a package.json file [13:24] mikegerwitz: http://nodejs.org/docs/v0.4.7/api/modules.html [13:24] eb4890 has joined the channel [13:24] [algo]: mikegerwitz: reading [13:25] c4milo has joined the channel [13:25] chjj: [algo]: you can have a node_modules directory in any location in the ancestral directory structure [13:25] chjj: or in the directory of your project [13:25] Bj_o_rn has joined the channel [13:25] ezl has joined the channel [13:26] chjj: node_modules is just for your modules if you want to put them there, say if you think you might reuse your modules for several projects, you could put your modules in ~/node_modules [13:26] boaz has joined the channel [13:26] chjj: if a module is specific to a certain project though, theres not much of a point [13:26] saschagehlich_ has joined the channel [13:27] [algo]: fine I've read it [13:27] avalanche123 has joined the channel [13:27] gleicon has joined the channel [13:27] dnolen has joined the channel [13:27] tiemonster: Is it possible to mount connect's static file server at a different uri than / ? [13:28] Fuu` has joined the channel [13:28] stagas: tiemonster: in express it's app.use('/mountpath/', express.static(..)) [13:28] [algo]: I believe node_modules should be in project dir, for third-party NPM [13:28] tiemonster: ah. cool. let me give it a shot. [13:29] xeodox has joined the channel [13:29] [algo]: but my own modules also should be there then, to require('them simply') [13:29] [algo]: so I have to make a mess? [13:29] saschagehlich has joined the channel [13:30] [algo]: put my and 3rd party both into single node_modules [13:30] [algo]: hmmm I'll move 3rd party node_modules 1 level higher [13:30] [algo]: may save me [13:31] thomblake has joined the channel [13:32] bak1an has joined the channel [13:32] hwinkel has joined the channel [13:32] test1: :chjj okay thanks [13:33] rfay has joined the channel [13:33] bbttxu has joined the channel [13:34] fallsemo has joined the channel [13:34] gtramont1na has joined the channel [13:34] chjj has joined the channel [13:34] postwait has joined the channel [13:35] hybsch has joined the channel [13:35] timmywil has joined the channel [13:36] saschagehlich has joined the channel [13:37] margle has joined the channel [13:39] dnolen has joined the channel [13:42] amacleod has joined the channel [13:42] qbert has joined the channel [13:45] temas has joined the channel [13:46] JacobSingh has joined the channel [13:47] okuryu has joined the channel [13:47] GasbaKid has joined the channel [13:49] [algo]: if the file /var/site/project/app/node_modules/persistence.js has require('module') [13:49] [algo]: will it search in /var/site/project/node_modules ? [13:50] Schmallon has joined the channel [13:50] aconbere has joined the channel [13:51] liar has joined the channel [13:51] [algo]: nevermind [13:52] [algo]: found the exception [13:52] tahu has joined the channel [13:53] tmedema has joined the channel [13:53] tmedema: Can anyone explain why this object is not getting deleted? https://gist.github.com/962552 [13:54] stagas: tmedema: you can't delete stuff declared with var [13:54] tmedema: stagas: really? I guess I should really dig into javascript more.. [13:54] tmedema: I figured they both reference to the same object, thus it shouldn't matter [13:54] mikegerwitz: tmedema: An object is GC'd until *all* references to it have gone out of scope. There's still a reference in that array [13:54] stagas: tmedema: only properties, if it was clients.old you could delete clients.old [13:54] mikegerwitz: or object [13:55] tmedema: mikegerwitz: I thought delete keyword forces GC of that object [13:55] timmywil has joined the channel [13:55] mikegerwitz: tmedema: nope [13:55] tmedema: so what does delete do? I could just do = null and it'd have the same effect? [13:55] timmywil has joined the channel [13:55] mikegerwitz: tmedema: nope :) that will set the variable to null. Same for undefined. It becomes apparent in prototypes [13:56] stagas: tmedema: deletes a property lol [13:56] mikegerwitz: tmedema: since a value will mask a value further down the prototype chain, using delete will make the value further down the chain visible, wheres assigining it null/undefined will mask it with null/undefined [13:56] tmedema: right, so I should delete unavailClients[this.now.name] AND do oldClient = null; ? [13:57] mikegerwitz: tmedema: As long as unavialClients is the only object holding a reference to that object [13:57] clip: i'm trying to connect to my nodejs server with socketio. in flash i use the flash.net.Socket, but somehow cant establish a connection, not even getting an error. the nodeserver doesn't announce an incoming client eather?! [13:58] tmedema: mikegerwitz, well I am simply trying to remove the property [13:58] tmedema: not the object [13:58] tmedema: ah, so all I have to do is delete unavailClients[this.now.name] [13:58] tmedema: thanks a lot [13:58] jdp has joined the channel [13:59] mikegerwitz: tmedema: ah, misinterpreted :) [13:59] colinclark has joined the channel [14:01] Know1edge has joined the channel [14:01] pootmoot has joined the channel [14:02] xeodox has joined the channel [14:02] pootmoot: I'm not sure what the "node" way to do this is .. [14:03] pootmoot: If I have a local process I want to broadcast to people connected at a regular interval.. is it OK to let the server have a setInterval running to send messages to socket.io ? [14:04] Know1edge1 has joined the channel [14:04] bzinger has joined the channel [14:04] `3rdEden: pootmoot: i see no reason why not [14:04] Muon has left the channel [14:04] pootmoot: Nice. [14:04] JacobSingh has joined the channel [14:05] Know1edge1 has left the channel [14:05] pootmoot: Have it set a function going with a callback that triggers the broadcast ? [14:05] pootmoot: so it doesnt tie up the process [14:05] nibblebot has joined the channel [14:08] kawaz_home has joined the channel [14:08] tmedema: pootmoot: a timer never blocks [14:08] pootmoot: but what it calls may block. [14:08] `3rdEden: than wrap it in a process.nextTick [14:08] pootmoot: sorry - im worried about the function which will be creating what is sent out taking some time [14:09] Swimming_bird has joined the channel [14:09] mikegerwitz: pootmoot: You have the same problem here as you would in any other function. Putting it in a timer doesn't change the rules any. [14:09] tmedema: ^ [14:09] BillyBreen has joined the channel [14:10] pootmoot: thank you. I will keep it in mind. [14:10] jtsnow has joined the channel [14:11] catshirt has joined the channel [14:11] jmar777 has joined the channel [14:12] boghog: any people here use vim? i'm curious about what kind of indenting you use (plugin, cindent or smartindent or whatever), I always run into an issue where vim gets confused about what the right level of indentation is, and it tries to correct it which drives me mad :/ [14:13] mikegerwitz: boghog: Under what situation does vim get confused? [14:13] mikegerwitz: boghog: I just use autoindent [14:13] d0k has joined the channel [14:14] mikegerwitz: boghog: (set ai) [14:15] azeroth___ has joined the channel [14:15] boghog: I haven't actually been able to reliably reproduce it, but ususally somewhere after giving an anonymous function as a function parameter it can get confused, and it will start correcting to give one indentation level too many, and I have to keep bacspacing it [14:15] baoist has joined the channel [14:15] boghog: it seems a bit random because when I re-open the file it usually works correctly again [14:15] tmedema: How does one write a null byte to a socket? Apparently Flash interprets such null byte as a "done" or "success" flag. [14:15] boghog: I also have ai on btw, but I think cindent overrides it [14:16] Nican has joined the channel [14:16] ruquay: tmedema: have you tried socket.write(new Buffer([0])) ? [14:16] baudehlo: tmedema: var b = new Buffer(1); b[0] = 0; - and write that to the socket. [14:16] mikegerwitz: boghog: hmm I'm not sure then. I'd try disabling your plugin. I've never experienced any indentation issues. [14:16] caike has joined the channel [14:17] tmedema: ruquay, baudehlo: thanks both of you [14:17] sirkitree has joined the channel [14:18] trotter has joined the channel [14:19] softdrink has joined the channel [14:20] dcampano has joined the channel [14:22] Metapony has joined the channel [14:22] jtmkrueger has joined the channel [14:22] m64253 has joined the channel [14:23] Treffynnon has joined the channel [14:24] pifantastic has joined the channel [14:26] lukegalea has joined the channel [14:29] Venom_X has joined the channel [14:29] ExsysTech has joined the channel [14:29] xsyn has joined the channel [14:31] jtsnow has joined the channel [14:31] skyler_brungardt has joined the channel [14:33] unomi has joined the channel [14:34] demastrie has joined the channel [14:35] willwhite has joined the channel [14:35] sivy has joined the channel [14:35] ditesh|cassini has joined the channel [14:36] vipaca has joined the channel [14:36] vipaca has joined the channel [14:37] jtmkrueger has joined the channel [14:37] demastrie has left the channel [14:37] criswell has joined the channel [14:37] jtmkrueger: anyone got a second to help me out with my install? [14:38] jtmkrueger: I followed the instructions at https://github.com/joyent/node/wiki/Installation [14:38] jtmkrueger: but for some reason, it still tells me I have version 0.1.31 [14:39] strmpnk has joined the channel [14:39] jtmkrueger: and i know I just installed 0.4.7 [14:39] jtmkrueger: I think My path is set wrong... [14:39] mikegerwitz: jtmkrueger: git checkout v0.4.7 && make dist_clean && make && make install [14:39] jtmkrueger: where should I run that command from? [14:39] mikegerwitz: actually, run ./configure too [14:39] galaxywatcher has joined the channel [14:40] mikegerwitz: jtmkrueger: In the cloned git dir [14:40] mikegerwitz: jtmkrueger: Did you clone it recently, or is this an old clone? [14:40] jtmkrueger: i already cloned the repo [14:41] pandark_: (…and you can replace "make install" by "checkinstall" if you have it) [14:41] mikegerwitz: jtmkrueger: So it's an old clone back from version 0.1.31? [14:41] jtmkrueger: I have a folder called node in my root directory [14:41] tmedema: Anyone has experience with handling Flash clients such as uploaders? Looks like Flash disconnects on in a number of undocumented cases.. personally I get an ECONRESET when a file has finished uploading [14:41] jtmkrueger: no, cloned it in the last few days [14:42] jlecker has joined the channel [14:42] mikegerwitz: jtmkrueger: Oh. Then it's odd you have such an old version of node. Is this a fresh install, or did you have node installed previously? [14:42] binarypie has joined the channel [14:42] jtmkrueger: I think I installed it a while ago [14:42] mikegerwitz: jtmkrueger: $ which node [14:43] mikegerwitz: jtmkrueger: Does that match your --prefix you gave to configure? [14:43] jtmkrueger: usr/local/bin/node [14:43] HerrTopf has joined the channel [14:43] jtmkrueger: ./configure --prefix=$HOME/local/node [14:44] jtmkrueger: that's what I did [14:44] jtmkrueger: so I see what your saying [14:44] mikegerwitz: jtmkrueger: It's picking up the wrong one, then :) So you're right, it's a path issue [14:44] jtmkrueger: so this is where I expose my noob status... [14:44] dguttman has joined the channel [14:44] jtmkrueger: how do I change the path to be right? [14:45] k1ttty has joined the channel [14:45] cpettit42 has joined the channel [14:45] mikegerwitz: jtmkrueger: You have a few options. You can either let node install to the default path (/usr/local/bin) by removing --prefix from configure, which will overwrite that one. Otherwise, you have to add ~/local/node to $PATH [14:46] mikegerwitz: jtmkrueger: export PATH="$HOME/local/node:$PATH" will likely give you the new executable [14:46] Qbix2 has joined the channel [14:46] demastrie1 has joined the channel [14:46] jtmkrueger: hmm... [14:46] jtmkrueger: copied and pasted your export [14:47] ezl has joined the channel [14:47] jtmkrueger: still saying 0.1.31 when I run node -v [14:47] jtmkrueger: in a new terminal window [14:47] mikegerwitz: jtmkrueger: oops. $HOME/local/node/bin I think is the proper dir [14:48] mikegerwitz: jtmkrueger: What does this give you: ~/local/node/bin/node -v [14:48] jtmkrueger: 0.4.7! [14:48] jtmkrueger: nice [14:48] mikegerwitz: Okay, then the command you want is: export PATH="$HOME/local/node/bin:$PATH" [14:49] mikegerwitz: jtmkrueger: You'l want to put that in your ~/.bashrc [14:49] mikegerwitz: jtmkrueger: (or whatever shell you use, if not BASH) [14:49] jtmkrueger: cool, let me try that real quick [14:49] almay has joined the channel [14:50] mikegerwitz: jtmkrueger: Then if you restart your shell, `node -v` should give you the proper executable. You'll probably want to clean up and remove the old node executable and files as well. [14:51] aheckmann has joined the channel [14:52] ejardim has joined the channel [14:54] guybrush: you can do `. ~/.bashrc` without restarting the shell [14:54] micheil has joined the channel [14:54] mikegerwitz: guybrush: Yep, we had already done the export in that session, so I had meant that after he closes the window it should be persistent [14:55] brianc has joined the channel [14:56] jtmkrueger: mikegerwitz: you sir are a champion [14:56] jtmkrueger: thanks, it's working great now! [14:56] jtmkrueger: that stuff is always a bit confusing for me [14:56] jtmkrueger: now I can enjoy node! [14:57] jtmkrueger: problem was, I was sticking it in the .bashrc, but it really needed to go in my .profile [14:57] jtmkrueger: now it's chirpin like a bird! [14:59] mikegerwitz: jtmkrueger: Should work fine in .bashrc...though I suppose I can't state that for certain on a non-gnu/linux system, if you're not on one. Glad I could help :) [14:59] jtmkrueger: I'm running a mac, but have some weird path stuff going on with ruby/rvm [14:59] wankdanker has joined the channel [15:00] telemachus: osx by default loads shells as login shells [15:00] telemachus: so .profile or .bash_profile [15:00] mikegerwitz: telemachus: Ahh alright. [15:00] telemachus: whereas most linux distros load new shells as non-login shells [15:01] telemachus: what I usually do is create a dummy .profile that points to .bashrc and then put everything in .bashrc (on osx) [15:02] CoinOpeBoy has joined the channel [15:02] thalll has joined the channel [15:03] sub_pop has joined the channel [15:03] alcuadrado has joined the channel [15:04] ioneyed has joined the channel [15:04] alcuadrado: how can I get a http.ServerRequest's ip? [15:04] Spion has joined the channel [15:05] alcuadrado: request.connection.remoteAddress? is it in ipv4 format only? [15:05] p_nitsch has joined the channel [15:05] [algo]: anyone uses Persistence.JS ? [15:05] sonnym has joined the channel [15:05] eee_c has joined the channel [15:06] joshthecoder has joined the channel [15:06] mikegerwitz: alcuadrado: request.connection.remoteAddress [15:06] gwoo has joined the channel [15:06] gwoo has joined the channel [15:06] MattJ has joined the channel [15:06] mikegerwitz: alcuadrado: In case of a proxy, I do: request.headers['x-forwarded-for'] || request.connection.remoteAddress [15:06] softdrink: i hate that i like coffeescript. [15:07] telemachus: why fight it if you like it? [15:07] softdrink: not fighting it… i just feel so wonderfully dirty using it hehe [15:07] mike5w3c_ has joined the channel [15:08] mikegerwitz: alcuadrado: Ooops, didn't see your other question. http://nodejs.org/docs/v0.4.7/api/net.html#socket.remoteAddress [15:08] telemachus: ah, k [15:08] softdrink: at least its output is nearly identical to how i generally write js to begin with :D [15:08] mikegerwitz: alcuadrado: It can be IPv4 or IPv6 [15:08] jarek has joined the channel [15:08] jarek has joined the channel [15:10] pizthewiz has joined the channel [15:12] sub_pop has joined the channel [15:12] Jamool has joined the channel [15:12] Jamool_ has joined the channel [15:13] briznad has joined the channel [15:14] alcuadrado: great, thanks mikegerwitz ! :) [15:15] unomi has joined the channel [15:16] tjholowaychuk has joined the channel [15:17] eresair has joined the channel [15:17] truedat101 has joined the channel [15:20] pyrony has joined the channel [15:24] bradleymeck has joined the channel [15:24] niftylettuce has joined the channel [15:24] mike5w3c has joined the channel [15:25] DennisRasmussen has joined the channel [15:27] bbttxu has joined the channel [15:28] brianm_ has joined the channel [15:29] brianm has joined the channel [15:30] bartt has joined the channel [15:31] multipass|2 has joined the channel [15:33] hellp has joined the channel [15:34] dambalah has joined the channel [15:35] p_nitsch_ has joined the channel [15:36] alcuadrado: If I instantiate an object with a reference to a net.ServerRequest, but don't keep a reference to it, is it garbage collected? [15:37] mikegerwitz: alcuadrado: Is the object GC'd or is net.ServerRequest GC'd? [15:37] alcuadrado: the object [15:37] alcuadrado: with an onpen request in it [15:37] c4milo: gong [15:37] mikegerwitz: alcuadrado: Yes. once it falls out of scope and there are no longer any references, it'll be GC'd [15:37] jzacsh has joined the channel [15:38] jzacsh has joined the channel [15:38] c4milo: wrong windows [15:38] c4milo: window [15:38] mikegerwitz: alcuadrado: references to it* [15:38] mikegerwitz: alcuadrado: It doesn't matter if it contains references to other objects [15:38] alcuadrado: I see, it makes sense [15:38] alcuadrado: so I'll keep a reference, thanks [15:39] mikegerwitz: alcuadrado: well, scheduled for GC, rather. But that detail's irrelevant for this case. [15:39] alcuadrado: yeah [15:40] alcuadrado: and If the object has attached a callback? does it matter? [15:40] alcuadrado: a callback to an event of one of it's members [15:40] sivy has joined the channel [15:41] mikegerwitz: alcuadrado: That depends. If it passes itself to the callback and that callback can be reached in some other manner (e.g. a timer), then it'll remain until that callback goes out of cope [15:41] mikegerwitz: scope* [15:41] mikegerwitz: alcuadrado: Otherwise, no, it doesn't matter. [15:41] scoates has joined the channel [15:42] alcuadrado: yeah, the callback would be bound to the object [15:42] PhilK has joined the channel [15:42] sarkis has joined the channel [15:42] luke` has joined the channel [15:42] mikegerwitz: alcuadrado: If you can give an example to clairfy, I may be able to give you a better answer [15:42] bzinger_ has joined the channel [15:42] almay has joined the channel [15:43] mikegerwitz: alcuadrado: obj.foo = myCallback; // once obj goes out of scope, it'll be gc'd. It doesn't matter that it holds a reference to a function [15:45] ji0n has joined the channel [15:46] Kingdutch has joined the channel [15:46] JulioBarros has joined the channel [15:47] aberry has joined the channel [15:48] alcuadrado: here it is mikegerwitz: http://pastie.org/1881632 [15:48] gazumps has joined the channel [15:51] mikegerwitz: alcuadrado: Ahh, I see. In that case, since you are binding to this, you are probably right. Unless EventEmitter does some magic with v8 (I haven't looked at the C++ implementation), then it will store a reference to the object. You'll have to remove the listtener. [15:51] alcuadrado: yep, that was I was thinking about [15:51] alcuadrado: thanks [15:52] mikegerwitz: alcuadrado: Of course, once httpServer is GC'd, your RequestManager would be too [15:52] amerine has joined the channel [15:53] alcuadrado: yeah, sure [15:55] mikegerwitz: alcuadrado: You could try request.once( 'end' )... [15:56] mikegerwitz: alcuadrado: That should free the callback after the first call [15:56] __tosh has joined the channel [15:56] alcuadrado: great! I have forgotten that ) [15:57] mikegerwitz: alcuadrado: Let me know if that doens't work (if you can tell from profiling or anything). I am curious. Otherwise I'll test it myself when I have the time. [15:58] rgabo has joined the channel [15:59] mike5w3c has joined the channel [16:00] beldur has joined the channel [16:00] ditesh|cassini has joined the channel [16:00] vikstrous has joined the channel [16:01] michaellehmkuhl has joined the channel [16:02] test1 has joined the channel [16:03] tilgovi has joined the channel [16:03] eyesUnclouded has joined the channel [16:03] alcuadrado: is there a profiler for node? [16:04] wink_: alcuadrado: check out node --v8-options | grep prof [16:04] fairwinds has joined the channel [16:05] alcuadrado: --prof_browser_mode nice [16:05] baudehlo: alcuadrado: yeah there's the built-in v8 stuff, but it's not very good. [16:05] p_nitsch_ has joined the channel [16:05] mikegerwitz: alcuadrado: node-inspector supports profiling as well [16:06] eee_c has joined the channel [16:06] dies_el has joined the channel [16:08] norviller has joined the channel [16:09] towski_ has joined the channel [16:10] saschagehlich_ has joined the channel [16:11] dguttman has joined the channel [16:11] victor_ has joined the channel [16:11] matjas has joined the channel [16:12] baudehlo: that might be a better option since it uses debug hooks rather than sampling. [16:12] dmcquay has joined the channel [16:12] baudehlo: (I assume) [16:13] markwubben has joined the channel [16:13] victor_: I have gcc and cpp but no g++ or c++. Running configure gives me error: Checking for program g++ or c++ : not found [16:13] victor_: Any advice? [16:13] softdrink: anyone handy with python? [16:13] mikegerwitz: victor_: OS? [16:13] bwinton: softdrink: Some people are, yeah. [16:13] Yuffster_work has joined the channel [16:13] wink_: victor_: what platform? [16:14] softdrink: can anyone recommend a sexy way to port this bit to python? https://github.com/jocafa/Nonsense/blob/master/Nonsense.js#L177 [16:14] victor_: x86_64 Ubuntu server [16:14] wink_: how do you have ubuntu and ended up without g++? :p [16:14] stephank has joined the channel [16:14] wink_: did you install it by hand? [16:14] mikegerwitz: victor_: sudo apt-get install build-essential [16:15] softdrink: i don't think build-essential is installed by default on a fresh system [16:15] victor_: Amazn EC2 Ubuntu server instance. [16:15] mikegerwitz: softdrink: yep, it's not [16:15] Corren has joined the channel [16:16] slloyd has joined the channel [16:16] eldios has joined the channel [16:16] bwinton: softdrink: re.sub can take a function as the replacement, so it should be a fairly straightforward port. [16:16] ruquay has left the channel [16:17] tfe_ has joined the channel [16:19] planetic has joined the channel [16:20] planetic: how can I share state (e.g. db connection) between different modules? [16:21] mikegerwitz: planetic: I would pass it into the module via a function. e.g. mod.setDb( foo ); [16:21] gregpascale has joined the channel [16:22] chjj: planetic, i like to have one file, "data.js" that manages all the data (or db logic/models/what have you), and in that file you can connect to your db, and then set module.exports = db; [16:22] mikegerwitz: planetic: Or use a ctor and pass it into an instance of the module. Just avoid using globals. [16:22] chjj: and then in any other module i can just do "require('./data.js');" [16:24] mikegerwitz: chjj: Just beware that by doing so you're greatly limiting module re-use outside of your project. Which may or may not be an issue for you. [16:24] creationix has joined the channel [16:25] creationix has left the channel [16:25] chjj: ...how? [16:25] wink_: chjj: in your example you're not sharing state, you're instantiating new state for every module [16:25] mikegerwitz: chjj: your module now is very tightly coupled with data.js. Anywhere the module is used, data.js must exist. Which means you cannot plug it into another project that uses a different configuration mechanism [16:26] wink_: you've not solved planetic's problem, you stepped around it ;> [16:26] chjj: my projects arent overly loosely coupled garbage [16:26] chjj: yes, data.js is going to be very specific to one project, as are the modules its used in [16:27] chjj: wink_: how do you figure that? [16:27] test1: is there a way to use interfaces in node.js? [16:27] mikegerwitz: chjj: So long as you understand [16:27] chjj: ... [16:27] wink_: chjj: his question was trying to find a canonical way of creating a single db connection and sharing it amongst modules [16:27] wink_: that isnt what you've done with your example [16:28] wink_: thats all, its not broken or anything [16:28] ryanfitz has joined the channel [16:28] wink_: it just isn't quite what he was asking for [16:28] Samot has joined the channel [16:28] chjj: when i say module, im referring to module in the commonjs sense [16:28] joshthecoder has joined the channel [16:28] chjj: thats what module means [16:28] pt_tr has joined the channel [16:28] Samot: using http client and sending to github https I get "The plain HTTP request was sent to HTTPS port" [16:28] Samot: anyone got this before? [16:28] Prism has joined the channel [16:28] chjj: i mean modules within a single app [16:29] wink_: me too, you're instantiating a new 'data' module in every module that needs db connectivity, not sharing a single instance of it [16:29] alcuadrado: http.ServerResponse.close() is no longer present, right? How should I manage that now? [16:29] mikegerwitz: wink_: require() will return the same object for each call [16:29] chjj: modules are cached [16:29] chjj: it will return the same object [16:29] chjj: every time [16:29] chjj: and execute the code once [16:29] wink_: so i suppose as long as you're not instantiating anything new you're g2g [16:30] bingomanatee has joined the channel [16:30] wink_: i stand corrected :> [16:30] chjj: well its not, thats not how modules work [16:31] planetic: Thanks to everyone I will store the conf in redis and reinstantiate it in every module. [16:31] chjj: i dont see how any method could be more useful than abstracting data logic away and putting all into a single module, and being able to require that module from anywhere within your app [16:31] aroop has joined the channel [16:32] springmeyer has joined the channel [16:32] kryptom has joined the channel [16:33] norviller_ has joined the channel [16:33] mikegerwitz: chjj: You are introducing a global state in your example. Abstracting the logic isn't the issue. The better method would be to do something like this: var cfg = require( './data.js' ); var mod = require( './module' )( cfg.db ); // or mod.setConnection( db ); [16:33] Aria has joined the channel [16:33] aconbere has joined the channel [16:34] mikegerwitz: chjj: Then, if you had another project that needed the module but used an entirely different configuration system, it wouldn't be a problem [16:34] chjj: im not talking about reusable modules, once again, im using the term module in the commonjs sense [16:34] DennisRas has joined the channel [16:34] perezd has joined the channel [16:35] chjj: a module within your app, specific to your app [16:35] chjj: for example, you may have one module for a certain set of routes [16:35] eee_c has joined the channel [16:37] chjj: making sure these kinds of modules werent tightly coupled would be so worthless [16:37] steph021 has joined the channel [16:37] steph021 has joined the channel [16:37] kawaz_air has joined the channel [16:37] planetic: I wrote function that takes name of configuration environment as an argument and returns db connection. Under the hood it reads conf from fs (from redis in my case). [16:37] luke`_ has joined the channel [16:38] bingomanatee has joined the channel [16:38] test117523 has joined the channel [16:38] sirkitree has joined the channel [16:39] pyrony has joined the channel [16:40] mikegerwitz: chjj: As long as you understand your implementation, that's fine. My main reason for pointing it out was so that planetic would be aware of the consequences of such. If such an implementation will work for him/her, that's fine :) [16:41] tbassetto has joined the channel [16:41] robot_jesus: how in the world ?? http://pastebin.com/y12fae9Q , both the ' if' and 'else' clause is getting exexcuted\ [16:42] ryah has joined the channel [16:42] tjholowaychuk: robot_jesus: favicon? [16:42] tjholowaychuk: i dunno [16:42] tjholowaychuk: nvm [16:44] mikegerwitz: robot_jesus: Are you suggesting that node/v8 is doing something wrong? [16:44] mikegerwitz: robot_jesus: put a console.log( isComplex) above the if statement [16:44] robot_jesus: I am, it reports true :S [16:45] robot_jesus: going to try a simpler example [16:45] tjholowaychuk: highly doubt that [16:45] mikegerwitz: robot_jesus: and how many lines of output do you get? [16:45] robot_jesus: ahh, twice, nm [16:45] mikegerwitz: robot_jesus: It's more likely that the function is being called multiple times, once with a value that evaluates to true and once false [16:46] robot_jesus: yeah :S [16:46] dies_el has joined the channel [16:46] tjholowaychuk: i blame the favicon [16:46] robot_jesus: oh dohg [16:47] chjj: i wonder if many people were confused as to why favicon.ico was the most viewed wikipedia article last year [16:47] chjj: :) [16:47] robot_jesus: callback getting called twice, I really don't like handling it this way, its just a boolean value, but the asynch makes it require a callback, anyone have a prettier way of dealing with this ? [16:47] igl has joined the channel [16:47] mikegerwitz: heh [16:47] dmcquay_ has joined the channel [16:48] dominictarr has joined the channel [16:49] kylefox has joined the channel [16:49] mikegerwitz: robot_jesus: You're limited to what little structure the callback provides unless you can find a library that will permit you to provide separate callbacks based on a given argument. Which I cannot speak for. You can alternatively call separate functions within that callback depending on the value. [16:49] flippyhead has joined the channel [16:50] luke` has joined the channel [16:50] liar has joined the channel [16:50] mikegerwitz: robot_jesus: Essentially, yell at the author :/ heh [16:50] igl: hi [16:50] kevwil has joined the channel [16:51] mikegerwitz: igl: heya [16:51] steffkes has joined the channel [16:52] nadirvardar has joined the channel [16:54] ejardim has joined the channel [16:54] ntelford_ has joined the channel [16:54] pmolleda has joined the channel [16:54] dominictarr: hey, is anyone using browser module loaders? [16:54] towski has joined the channel [16:55] igl: dojo.require() \o/ [16:56] sh1mmer has joined the channel [16:57] eee_c has joined the channel [16:58] daekano has joined the channel [16:59] azeroth___ has joined the channel [17:00] chjj: xml-rpc is the worst thing ever invented [17:01] azeroth____ has joined the channel [17:01] SubStack: chjj: it's true! [17:02] MrTopf has joined the channel [17:02] SubStack: dominictarr: I am! [17:02] tim_smart has joined the channel [17:02] donaldpcook has joined the channel [17:02] Aikar: no, you mean soap is the worst thing ever invented, otherwise your argueing that XML is the worst thing ever invented, which while its flawed, how it was used in soap outweighs the 'worst invented' :P [17:02] boaz_ has joined the channel [17:03] chjj: xml is one of the most misused things ever invented [17:03] chjj: xml used for rpc is xml being misused and its the worst thing ever invented as well [17:03] Aikar: no [17:03] chjj: yes [17:04] rauchg has joined the channel [17:04] Aikar: rpc is best done with some form of data capsulation, XML is one, just as is JSON. to say XML is bad for RPC is to say JSON is bad for RPC, and your opening a huge can of worms if you say that [17:04] matjas_ has joined the channel [17:04] chjj: actually ill take that back a bit, xml could work for rpc, but the xml-rpc spec is absolutely terrible in every respect [17:04] SubStack: json is very unambiguous [17:04] SubStack: xml not so much [17:04] Aikar: oh your talking about a specific spec [17:05] zcopley has joined the channel [17:05] chjj: im talking about the xml-rpc spec [17:05] chjj: theres only one [17:05] chjj: ... [17:05] Aikar: no theres not [17:05] chjj: yeah there is [17:05] aaronlevy has joined the channel [17:05] Aikar: i can make a random rpc server that uses xml that doesnt follow that spec [17:05] Aikar: and name it my own spec [17:05] chjj: ok, so what [17:05] _1marc has joined the channel [17:05] chjj: thats not following the xml-rpc spec, fine [17:05] chjj: im talking about the xml-rpc spec [17:06] FireFly: MathML is the worst thing ever invented [17:06] chjj: show me another xml-rpc spec [17:06] chjj: besides "xml-rpc" [17:06] chjj: thats also named "xml-rpc" [17:07] azeroth____ has joined the channel [17:07] ilya has joined the channel [17:07] bene has joined the channel [17:08] Aikar: xml rpc is a pretty generic term, it describes implementing an rpc server/client and using XML as the data encapsulation. just because 1 standards body releases a spec doesnt mean its the only one. if you come up with your own implementation, thats its own spec, even if you dont publitize it as so [17:08] Aikar: and i assure you someone writes their own implementation every day [17:09] ejardim has joined the channel [17:09] chjj: aikar: http://www.xmlrpc.com/spec [17:09] Aikar: ok? i didnt say that didnt exists [17:09] chjj: like i said, show me another xmlrpc spec, you said theres not just one [17:09] Aikar: ok [17:09] q_no has joined the channel [17:09] ilya: updated npm, now can't use nodeunit (installed globally). Node can't find the module unless I specify the full path like '/usr/local/lib/node_modules/nodeunit/lib/nodeunit'. Other modules work. [17:10] Aikar: foobar [17:10] Aikar: i call this spec AikarXML v 1.0 [17:10] chjj: and? where is the spec [17:11] Aikar: are you really that dull >_> [17:11] igl: xml fight! [17:11] chjj: ... [17:11] ilya: lolz [17:11] alcuadrado: mikegerwitz, it worked =) I profiled it with 0 and 5k requests, and the heap has the same size =) [17:11] chjj: you said there was more than one spec [17:11] jetienne has joined the channel [17:12] mikegerwitz: alcuadrado: Excellent, thank you :) [17:12] azeroth______ has joined the channel [17:12] sirkitree has joined the channel [17:12] alcuadrado: thank you too [17:12] mikegerwitz: alcuadrado: Did you happen to profile it with on() instead of once()? [17:12] igl: i stumbled over tons of terribly implemented xml while working at this big firm [17:12] chjj: aikar: you said spec, not some amorphous collection of people doing different things with xml [17:12] alcuadrado: no, but gimme a second and I'll do it [17:12] chjj: amorphous collection of things* [17:12] mikegerwitz: alcuadrado: great, thanks [17:13] caolanm has joined the channel [17:13] chjj: aikar: if you had said instead, "it can be used differently", i would agree with you, it can and it could be used a lot better than the xmlrpc spec, in fact i mentioned that earlier [17:14] Aria has joined the channel [17:14] chjj: but when you get cornered and proven wrong, you call me dull [17:14] chjj: =/ [17:15] beawesomeinstead has joined the channel [17:15] chjj: anyway, like i was saying, xmlrpc is terrible [17:16] yozgrahame has joined the channel [17:16] tedsuo has joined the channel [17:17] Aikar: < chjj> im talking about the xml-rpc spec [17:17] Aikar: < chjj> theres only one [17:17] Aikar: you should of said the spec listed on xmlrpc.com [17:17] Aikar: because "xml rpc spec" is a generic description [17:17] chjj: i said "the" xml-rpc spec [17:17] m64253 has joined the channel [17:18] Aikar: thats an opinion [17:18] chjj: theres only one xml-rpc spec called xml-rpc, thats referenced by other specs [17:18] chjj: that spec has also been around more than a decade, its very well-known, i thought i was being rather clear [17:18] ilya: tjholowaychuk: after npm update, I can't run nodeunit on my tests when cluster is used there. Without cluster i works. With cluster, nodeunit tried to load test files from /usr/local/bin (that's where nodeunit's bin is). [17:19] newy_ has joined the channel [17:19] bengl has joined the channel [17:22] alcuadrado: mikegerwitz, it worked too :) and I added a 50k member to the class in order to make the differences bigger, but the heap doesn't get bigger [17:23] onar has joined the channel [17:23] mikegerwitz: alcuadrado: huh. Interesting [17:23] samsonjs has joined the channel [17:23] azeroth_______ has joined the channel [17:23] flippyhead_ has joined the channel [17:24] mikegerwitz: alcuadrado: Alright I'll have to dig into that more some time, then. Thanks :) [17:24] alcuadrado: yep, i think it's a nice way to handle the this without having tons of lambdas attached everywhere [17:24] alcuadrado: thanks you too [17:24] eee_c has joined the channel [17:24] bartt has joined the channel [17:25] JojoTheBoss has joined the channel [17:26] aguynamedben has joined the channel [17:27] rfay has joined the channel [17:27] retadedgeek has joined the channel [17:27] retadedgeek: :) [17:27] brianc has joined the channel [17:29] CIA-72: node: 03Trevor Burnham 07v0.4 * r31ed87b 10/ doc/api/modules.markdown : Documenting `require.main`, fixing #997 - http://bit.ly/kq9Dbf [17:30] context: is there an eta for when npm works again? [17:32] Samot: could someone please login with the demo account for me, http://app.protosal.com [17:32] liar has joined the channel [17:33] awenkhh has joined the channel [17:34] newy_ has joined the channel [17:34] context: samot: works here [17:34] CrypticSwarm has joined the channel [17:35] pcardune has joined the channel [17:35] brianc: Samot: works here & looks nice [17:35] Samot: thanks, i am trying to track you with getclicky lol [17:35] markwubben has joined the channel [17:35] techwraith has joined the channel [17:35] context: im playing around [17:35] Samot: thanks [17:35] context: pretty nice actually [17:35] context: all jquery-ui ? [17:35] Samot: yeah [17:36] Samot: backbone.js jquery ui [17:36] Samot: node.js [17:36] Samot: and couchdb [17:36] context: ahh nice [17:36] mscdex: go ninja go ninja go! [17:36] brianc: haha [17:36] brianc: tmnt2 awesomeness [17:36] context: and no anchovies ! [17:36] context: 122 and an 8th [17:36] context: my ringtone on my phone is tnmt [17:36] context: err tmnt [17:38] jacobolus has joined the channel [17:39] coreb has joined the channel [17:40] ryanj has joined the channel [17:40] chrislorenz has joined the channel [17:40] zeade has joined the channel [17:41] ph^ has joined the channel [17:42] lmatos: what's your favorite / maybe the leading templating engine for node? [17:42] Aikar: nova! [17:42] ravinggenius has joined the channel [17:43] jonasen has joined the channel [17:44] bentruyman has joined the channel [17:44] rfay has joined the channel [17:44] ravinggenius: hello all. may i ask a question? [17:44] Aikar: you just did [17:44] brianc: lmatos: the leading tpl engine is probably 'jade' [17:44] Aikar: your only allowed 1 question a day [17:44] Aikar: so come back tomorrow [17:44] ravinggenius: oh okay [17:44] brianc: ravinggenius: Aikar is just messing with you... [17:45] ravinggenius: i know [17:45] |sWORDs|: I'm trying to send images with JSONRPC (only supports utf8). What whould be the best way? base64 seems a bit heavy. [17:45] ravinggenius: so should i be wrapping each file in a server in an anonymous function? [17:45] thalll has joined the channel [17:46] Corren has joined the channel [17:46] Aikar: |sWORDs|: is it over an http server? may wanna roll a custom implementation and pass the image as a standard file upload [17:46] arpegius has joined the channel [17:47] eee_c has joined the channel [17:48] |sWORDs|: aikar, no. It's tcp/ip. I can't use http chunked, and it send a lot of small pieces. Using regular http with socket disconnect is to slow. [17:48] aho has joined the channel [17:48] mnbvasd: talking of JSON RPC, does the performance just degrade with object size, complexity or both?? [17:48] mattly has joined the channel [17:49] |sWORDs|: mnbvasd, there are many cases where JSON is actually faster [17:49] mnbvasd: |sWORDs|: than what? [17:49] Aikar: |sWORDs|: he meant, that as objects get bigger, json gets slower. and hes asking for specifics on conditions on rate of decay [17:49] mnbvasd: I have a sittuation where I have a router that has packets that are between 256 bytes and ~4k. [17:50] robot_jesus: than pigeons [17:50] |sWORDs|: Then anything else available. It's really nice for low speed clients (I use 200 MHz remotes) [17:50] lmatos: brianc: thanks! [17:50] CIA-72: node: 03Ryan Dahl 07v0.4 * r11beac7 10/ doc/api/net.markdown : Docs: server.pause() server.address() socket.address() - http://bit.ly/lM82Ya [17:50] |sWORDs|: But yes, JSON is slower with big object then JSON with small objects [17:51] mnbvasd: I'm routing traffic between many xmpp s2s, c2s and other routing instances.. there's a to/from header and a broke down and raw xml packet that goes along with it. [17:51] Corren: can I use the npm install script to install a specific version? [17:51] brianc: lmatos: if jade doesn't cut it for some reason, I've used jqtpl-node and I'm a fan. [17:52] mnbvasd: so it's all node-node often on the same box. [17:52] |sWORDs|: As far as I've seen JSON is always faster then XML. [17:53] mkrecny has joined the channel [17:53] p_nitsch has joined the channel [17:53] |sWORDs|: But XML add's binary. Which is my current problem with JSON. [17:53] mkrecny: anyone recommend a good hashlib? [17:53] mnbvasd: I'm wondering whether to split a packet between |\l or \n .... [17:54] binarypie has joined the channel [17:54] |sWORDs|: mnbvasd: That's over my head. I only use JSON for small chuncks at the moment. [17:55] harth has joined the channel [17:55] mnbvasd: |sWORDs|: also doesn't binary data in xml *have* to be base64 encoded? [17:58] colinclark has joined the channel [17:59] prudhvi has left the channel [17:59] aslakhellesoy has joined the channel [18:00] svenlito has joined the channel [18:00] JulioBarros has joined the channel [18:02] rpflo has joined the channel [18:02] patcito has joined the channel [18:06] isaacs has joined the channel [18:07] chjj: mndvasd: yes, raw binary in xml would break a normal/browser xml parser pretty quick, however, the xmlrpc spec does say that you can use binary strings if you want [18:07] chjj: although base64 is recommended [18:07] mjr_ has joined the channel [18:08] caolanm has joined the channel [18:08] ravinggenius: is there value in wrapping every module in a server with an anonymous function? [18:08] chjj: no [18:08] chjj: none that i can think of at least [18:09] mikegerwitz: ravinggenius: node already does that for you [18:09] ravinggenius: mikegerwitz, how? [18:09] chjj: yeah, technically a module is wrapped in a self-executing function [18:09] ravinggenius: i didn't know that [18:09] chjj: and things like __dirname, __filename, exports, etc [18:09] chjj: are all passed in [18:09] chjj: as arguments [18:09] chjj: you just dont get to see the function :) [18:10] ravinggenius: well that's awesome [18:10] mikegerwitz: ravinggenius: If you use a tool to look at what node's actually running, it sends in something like this: function( module, exports, __dirname, __filename ) { /*your code*/ } [18:10] lmatos: brianc: can you elaborate on cases where jade "might not cut it" :? It look's pretty solid from what I can see. Potential downfalls? [18:10] mikegerwitz: ravinggenius: That's how it gives modules their own scope [18:10] chjj: yeah, i think if your look at src/node.js, you can actually see how its "eval'd" [18:10] mikegerwitz: ( function() { } )();, rather [18:11] ravinggenius: where can i find more about this? [18:11] chjj: or it might be in lib/module.js, not sure...its in there somewhere [18:11] brianc: lmatos: doesn't work client side in IE [18:12] brianc: lmatos: so if you really want 100% template reusability on client and server, jqtpl a bit better for that [18:12] chjj: ravinggenius: find more on what? node internals? [18:12] dominictarr: SubStack: hey, can browserify generate a single static file like a traditional.js? [18:12] ravinggenius: well online documentation that would cover things like that [18:13] CIA-72: node: 03Ryan Dahl 07master * r55bff5b 10/ lib/tls.js : TLS: simplify logic - http://bit.ly/kj2QMH [18:13] CIA-72: node: 03Ryan Dahl 07master * r110f065 10/ lib/http.js : [18:13] CIA-72: node: Agent socket errors bubble up to req only if req exists [18:13] CIA-72: node: Fixes #836. - http://bit.ly/ikck52 [18:13] mikegerwitz: ravinggenius: https://github.com/joyent/node/blob/master/lib/module.js#L412 [18:13] CIA-72: node: 03isaacs 07master * r205b9be 10/ (33 files in 9 dirs): (log message trimmed) [18:13] CIA-72: node: Merge branch 'v0.4' [18:13] CIA-72: node: Conflicts: [18:13] CIA-72: node: lib/tls.js [18:13] CIA-72: node: lib/url.js [18:13] CIA-72: node: src/node_version.h [18:13] CIA-72: node: test/simple/test-buffer.js [18:13] CIA-72: node: 03Ryan Dahl 07master * r5ab3ea3 10/ doc/index.html : [18:13] CIA-72: node: Point changelog to correct branch [18:13] CIA-72: node: Fixes #1002. Thanks cjavapro. - http://bit.ly/ixVGwe [18:13] CIA-72: node: 03Marcel Laverdet 07master * rc2b5ea2 10/ (lib/_debugger.js src/node.cc): [18:13] chjj: i actually dont think that little fun fact is mentioned in any documentation [18:13] CIA-72: node: Attempt to connect to debug process more than once [18:13] CIA-72: node: The debugger would give up after only 100ms but on my system this [18:13] CIA-72: node: timeout isn't enough. The startup process is now modified to try 6 [18:13] CIA-72: node: times every 50ms instead. [18:13] CIA-72: node: Fixes #1010. - http://bit.ly/jykJ4x [18:13] peol has joined the channel [18:13] chjj: @ravinggenius* [18:13] mikegerwitz: The sky is falling! [18:13] jwcooper has joined the channel [18:13] isaacs: my biggest commit to node evar. [18:14] halfhalo: orly [18:14] isaacs: (of course, it's a merge commit, so none of it is really mine, just a collection of a bunch of stuff) [18:14] ravinggenius: mikegerwitz, chjj, thank you so much [18:14] Aria: Woo! [18:14] chrislorenz has joined the channel [18:14] chjj: ravinggenius: no problem [18:16] Marak has joined the channel [18:16] Marak: ITS JAVASCRIPT TIME [18:16] Aikar: I'ts ScriptJavaCookie time [18:16] deedubs: any thoughts on a chef alternative using node? My thoughts include less memory intensive, easy ability to do realtime updates, damage control [18:17] bbttxu has joined the channel [18:17] Aria: I want that. I keep thinking I should write it. [18:17] Kami_: deedubs: not any that I am ware of. there is puppet which is also written in ruby [18:18] Kami_: deedubs: but imo chef > puppet [18:18] deedubs: agreed [18:18] deedubs: Kami_: I love chef and build 2-3 app clusters using it [18:19] Kami_: deedubs: yep, same here, I also use chef-solo with vagrant and I love it [18:19] tbranyen: man node has gotten some really retarded issues filed recently [18:19] deedubs: Kami_: but the daemonized client weighing in at like 50-80mb kills me [18:19] tbranyen: "node doesn't work on my laptop, it works on everyone elses" [18:19] Aikar: PEBKAC [18:19] Aikar: prolly running windows [18:20] Kami_: deedubs: yeah, if someone would write a nice configuration manager in node with nice api would be cool [18:20] Kami_: deedubs: re: memory issue, yeah, but puppet is even worse :D [18:20] deedubs: Kami_: That's my intention. [18:20] Kami_: deedubs: :) [18:21] Kami_: deedubs: there is also cefengine, but dunno, pretty old school [18:21] jano has joined the channel [18:21] deedubs: Kami_: yeah i've heard of that and just always ran screaming [18:21] dies_el has joined the channel [18:21] JacobSingh_ has joined the channel [18:21] Kami_: deedubs: heh [18:21] Aikar: like a schoolgirl? [18:21] deedubs: yes [18:22] deedubs: exactly like a schoolgirl minus the plaid [18:22] towns has joined the channel [18:23] harth has joined the channel [18:24] tim_smart has joined the channel [18:24] pandark_: I have a huge rdf on a remote server. For now, I download it and write it to a local file without problems (exept it's slow). I'd like to parse it and store the result in a database instead (most likely mongodb). How would you do that? append the data from the readStream to a buffer, then parse the buffer on end signal, and finally make a request? Does that looks good? [18:24] tilgovi has joined the channel [18:25] tmedema has joined the channel [18:26] tmedema: Anyone has experience with flash uploaders causing a ECONNRESET after uploading has finished? [18:26] edude03 has joined the channel [18:27] deedubs: Kami_: could I bounce idea's off you when I have them fleshed out a bit? [18:28] duncanbeevers has joined the channel [18:28] bene has joined the channel [18:28] Kami_: deedubs: sure. we will eventually need something like this for our deployment platform (cast - https://github.com/cloudkick/cast) as well [18:29] jarek has joined the channel [18:29] jarek has joined the channel [18:29] themiddleman_itv has joined the channel [18:30] chjj: pandark_: say again, what are you doing? [18:30] __tosh has joined the channel [18:31] chjj: making a request, parsing a file, and inserting the result into a db? [18:31] deedubs: Kami_: Interesting... Interesting... [18:31] tedsuo has joined the channel [18:31] lerchmo_ has joined the channel [18:32] gonsfx has joined the channel [18:32] gonsfx has left the channel [18:32] gonsfx has joined the channel [18:32] |sWORDs|: Does anyone know a sample how to read a binary encoded file (image) into a buffer? I'm not really understanding the buffer principle. [18:33] chjj: fs.readFile('./image.png', function(err, data) { }); [18:33] chjj: "data" is a buffer object [18:33] pandark_: chjj: I mean, I have to wait until each step is over (via a callback) before starting the next one, right? [18:33] jtrudeau has joined the channel [18:33] chjj: essentially a byte array [18:33] SubStack: |sWORDs|: or you can fs.createReadStream if you want chunks [18:34] chjj: pandark_: you could in theory have a streaming parser [18:34] chjj: which would be very ideal [18:34] |sWORDs|: chjj and SubStack: Tnx. I'm just trying to send an image over tcp/ip and use it on the client [18:34] chjj: yeah, |sWORDs|, unless your going to be manipulating the data directly, you probably just want to pipe it somewhere [18:35] SubStack: fs.createReadStream('image.png').pipe(otherStream) [18:35] chjj: fs.createReadStream('./image.png').pipe(socket); [18:35] SubStack: hah [18:35] chjj: lol [18:35] wadey has joined the channel [18:35] openpercept has joined the channel [18:35] chjj: i like mine better! [18:35] chjj: ;p [18:35] SubStack: pandark_: if you want to make a streaming parser I wrote https://github.com/substack/node-binary [18:36] SubStack: to make that sort of thing easy [18:36] |sWORDs|: Thanks guys! That should get me there. (And it's re asuring when two guys type the same thing) ;) [18:36] chjj: hehe, no problem [18:36] SubStack: pandark_: based on the ideas in this article although bufferlist is deprecated now http://substack.net/posts/cb328d [18:36] |sWORDs|: And SubStack: Chunks would be needed only when using http chuncked? [18:37] dve has joined the channel [18:37] alcuadrado: can anyone help me with http.ServerRequest 'data' event's encoding? I think i'm not getting it [18:37] pandark_: thanks chjj and SubStack. I'll try to see what this is about :) [18:38] SubStack: |sWORDs|: chunked responses are the default in node [18:38] Todd_ has joined the channel [18:38] briznad has joined the channel [18:38] chjj: alcuadro, do you mean "IncomingMessage"? i dont think there is a "ServerRequest" object technically [18:39] adambeynon has joined the channel [18:39] sechrist_ has joined the channel [18:39] bradleymeck: Marak for the audio thing, does it have to *guarantee* 16 channels? I mean I would have to have a software mixer fallback... which could burn cpu [18:39] rmustacc: SubStack: Interesting way to go about doing the parsing on streams. [18:39] alcuadrado: chjj, it's in the docs: http://nodejs.org/docs/v0.4.7/api/http.html#http.ServerRequest [18:40] ryah has joined the channel [18:40] Marak: hi bradleymeck [18:40] |sWORDs|: SubStack: Would http chunked mean that the connection would stay open for other request? Or only until the last chunck of a request? [18:40] gkmngrgn has joined the channel [18:40] superjudge has joined the channel [18:40] chjj: oh, weird, its called IncomingMessage in the actual code [18:40] Marak: bradleymeck: pretend i was really dumb and i just wanted to use play.js [18:40] Marak: bradleymeck: and i want my audio to play fast [18:40] alcuadrado: isn't 4.7 the actual node? [18:40] ejardim has joined the channel [18:40] SubStack: |sWORDs|: chunked means that the pieces come in piece by piece until you res.end() [18:41] bradleymeck: ok no software mixer it is [18:41] Marak: bradleymeck: thats pretty much it :p whats the issue? the hardware might not have 16 channels up? [18:41] Marak: morning SubStack [18:41] chjj: alcuadrado, i said the actual "code", hehe [18:41] alcuadrado: ohh, lol, I read it badly :p [18:41] SubStack: hoy Marak [18:41] SubStack: ACTION got lots of sleep [18:41] bradleymeck: marak, yea on my coreaudio im reading 8 channels from the vm's driver which was interesting [18:41] chjj: yeah, alcuadrado, you can do req.setEncoding('utf-8') to get text for data events [18:42] chjj: or just do, buffer.toString('utf-8') [18:42] alcuadrado: great, that's was I was needing [18:42] alcuadrado: thanks :) [18:42] |sWORDs|: SubStack: So If I would use chunked and persistent for http, the only downside to tcp would be the http overhead? [18:42] chjj: no problem sir [18:42] Marak: bradleymeck: 8 channels isnt the end of the world, but when making music, the jump from 8 tracks to 16 is actually pretty important [18:42] alcuadrado: so the data in the buffer is already (always) in utf8, right? [18:42] Marak: bradleymeck: the jump from 16 to 32 is not that much important [18:43] Marak: bradleymeck: but to make somewhat complex beats, you really need 8+ tracks [18:43] bradleymeck: meh, if someone finishes before me ill see if i can release a competent software mixer ontop of it [18:43] bmorriso has joined the channel [18:43] chjj: alcuadrado, the data in the buffer is just the raw binary, the encoding used depends on how the text was encoded when you received it, you have no control over that [18:44] alcuadrado: so I should check the headers, right? [18:44] chjj: so if you know it was encoded as utf-8, you can do toString('utf-8'), and you get a javascript string out of it [18:44] tim_smart: Marak: For drums you usually use around 10-12 channels / tracks. [18:44] Marak: tim_smart: aye [18:44] tim_smart: Well with live drums anyway [18:45] Marak: yeah, 8 is limiting, its just not enough [18:45] Marak: its close, which is annonying [18:45] chjj: alcuadrado: yeah, checking the headers would be smart, but realistically everyone should be using utf-8, its the only way to go for the web =/ [18:45] |sWORDs|: Does node.js support persistent http connections? [18:45] SubStack: |sWORDs|: by default [18:45] sikker has joined the channel [18:45] SubStack: |sWORDs|: there's also socket.io for websockety stuff [18:46] alcuadrado: well, if it's not weird to impose utf8 to the user, I'll do that :) [18:46] |sWORDs|: Hmm... Interesting, I'll check if all my clients support chuncked and persistent connections. [18:47] sikker: I'm writing a commandline application. For getting configuration variables from a JSON file, would I require() the JSON-file, open it with fs.readFile and parse it through JSON.parse or something entirely different? [18:47] chjj: unless youre expecting some other encoding, utf-8 is what you should be using - the vast majority of browsers/user agents will be sending utf-8/ascii by default [18:47] chjj: @alacuadrado [18:47] |sWORDs|: sikker: correct [18:47] aconbere has joined the channel [18:48] mw has joined the channel [18:48] sikker: is that to say any of the scenarios are equally good? [18:48] alcuadrado: great to know that, thanks chjj :) [18:48] mikegerwitz: sikker: don't use require() for configuration files. JSON.parse is fine. Otherwise you open up the potential for running malicious code :) [18:48] |sWORDs|: sikker: What you write is what I do aswell. I would do a try catch on the json.parse to make sure the file is valid json [18:48] sh1mmer has joined the channel [18:49] |sWORDs|: mikegerwitz is right, I overlooked that require [18:49] mikegerwitz: sikker: (if this isn't being distributed, it ultimately doesn't matter I suppose) [18:49] |sWORDs|: sikker: I can post mine if you like [18:49] bmorriso has left the channel [18:49] tilgovi_ has joined the channel [18:49] bradleymeck: ACTION adds .json file extension handler for require when particularly lazy [18:50] sikker: |sWORDs|, I'd like to see yours. I'm having a bit of trouble with what I expect is me not fully understanding the evented/callback based architecture of node, so if I have a model to look at it would be great :0) [18:50] sikker: also, thanks mikegerwitz, I didn't think require() was the correct solution either, but coming from a PHP background I felt I had to ask [18:50] hosh_work has joined the channel [18:50] djcoin has joined the channel [18:50] ezl has joined the channel [18:51] sikker: ACTION is not making this easy for himself, learning coffeescript and node simultaneously, but I like the challenge :P [18:51] mikegerwitz: sikker: with bradleymeck's solution it may be acceptable, but is more of a convenience to do the same thing [18:51] test has joined the channel [18:51] chjj: sikker: node first, coffeescript later ;) [18:52] deepthawtz has joined the channel [18:52] sikker: chjj, I basically write a snippet in regular JS, see if it works, then try and do the same thing in coffee [18:52] ita has joined the channel [18:52] |sWORDs|: sikker: mine is using sync readfile at the moment because it's just a small prototype, you should use async: http://pastebin.com/D8QnXuPY [18:53] chjj: eh, i would still hold off on the coffeescript [18:54] chjj: the way i learned coffeescript was by taking something written in coffee script, and porting it to JS by hand, (ive never used coffeescript though, dont ever plan to) [18:54] sikker: |sWORDs|, readFileSync would be returning the output of the file, while readFile would pass the output of the file to a callback? [18:55] tfe_ has joined the channel [18:55] tfe_ has joined the channel [18:55] sikker: I think sync is what I need for this particular thing. The application pretty much has to stall until it's got the configuration, or it can't do anything [18:56] chjj: sync filesystem calls are acceptable at times, depending on what youre doing [18:56] |sWORDs|: then use sync, if it's a one time on load it's fine [18:56] truedat101 has joined the channel [18:56] mscdex: any nodeconf videos up yet? :D [18:56] Charuru has joined the channel [18:56] techwraith: Just make sure that you use async if you call it more than once :) [18:57] svenlito has joined the channel [18:57] zcopley has joined the channel [18:57] |sWORDs|: mscdex: Everytime I see you name it makes me think about all that crappy .sys cdrom drivers (oakcdrom.sys) etc :P [18:57] mscdex: :O [18:58] |sWORDs|: I remember spending days to get the right version for some exotic drives :P I do love your name, it always makes me smile. [18:58] framlin: bad old times ;) [18:58] aslakhellesoy has left the channel [18:59] |sWORDs|: all the linux guys are now thinking: What the hell are they talking about :P [18:59] eee_c has joined the channel [18:59] wink_: nah, im a linux guy, but i remember the nightmare of dos cdrom drivers all too well [18:59] wink_: ACTION shudders [19:00] sikker: thanks guys, this helped me a lot :) [19:00] |sWORDs|: sikker: np, nice to be able to help some one instead of only asking dumb questions [19:01] maushu has joined the channel [19:01] brianc has joined the channel [19:01] alcuadrado: when receiving a POST, how do you parse the data if it's in multipart? [19:01] eb4890 has joined the channel [19:01] chjj: you write a really good multipart parser [19:01] chjj: :) [19:02] guybrush: like formidable [19:02] chjj: or use formidable [19:03] chjj: you could use my terrible multipart parser, its the dirtiest multipart parser known to man: https://github.com/chjj/evilpart --- thats if you just want it for small text files [19:03] ewdafa: isaacs: ah there you are [19:03] JacobSingh has joined the channel [19:03] sikker: is there a convention on how to format node libraries ("function nodeLibrary(){ ... }" vs. "nodeLibrary = { ... }")? [19:03] guybrush: sikker: no [19:04] guybrush: the convention is the package.json nothing else [19:04] mscdex: alcuadrado: http://github.com/felixge/node-formidable [19:04] chjj: yeah, thats a lot better ^ [19:04] sikker: thanks guybrush [19:04] jano has joined the channel [19:05] sourcode has joined the channel [19:05] montylounge has joined the channel [19:06] alcuadrado: yeah, I found it in google, thanks mscdex [19:06] rfay has joined the channel [19:06] tilgovi_ has joined the channel [19:09] maushu has joined the channel [19:11] blueadept has joined the channel [19:13] sikker: quick question: how do I terminate the node program? [19:13] baudehlo: process.exit() [19:14] sikker: gotcha [19:14] sourcode_ has joined the channel [19:14] onar has joined the channel [19:14] mscdex: sikker: you shouldn't need to do that though [19:15] sikker: I want to terminate the program with a custom error message if the configuration file isn't found [19:17] Aria: throw("Configuration not found") ? [19:17] tjholowaychuk: grr dont throw strings [19:18] tjholowaychuk: that is annoying [19:18] SubStack: indeed [19:19] Aria: Yeaaaah. True. [19:19] tjholowaychuk: :D [19:19] MrCorry has joined the channel [19:19] guybrush: throwing stones is more effective! [19:19] Aria: I'd care more if V8 could catch exceptions by inheritance. [19:19] trotter has joined the channel [19:20] nibot has joined the channel [19:20] mikegerwitz: Aria: catch ( e ) { if ( e instanceof Foo ) ... } [19:21] mikegerwitz: Aria: not as clean as other implementations, unfortunately [19:21] Aria: Yeah. That's what I meant. [19:22] shinmei has joined the channel [19:23] tmedema: node-formidable is great although a bit outdated [19:23] criswell has joined the channel [19:24] kkaefer: what's the best way to get good randomness in node? [19:24] tiemonster: If I do app.use(function(req, res, next) { }); then this should run on every route, correct? [19:24] kkaefer: tiemonster: yes, but https://github.com/visionmedia/express/issues/652 [19:24] tjholowaychuk: tiemonster: not every route every request yeah [19:25] kkaefer: tjholowaychuk: do you have a irc alert on "express" or something? [19:25] tjholowaychuk: sure d [19:25] tjholowaychuk: o [19:25] kkaefer: heh [19:25] stisti has joined the channel [19:28] Aria has joined the channel [19:29] JacobSingh: tjholowaychuk: hah, if you want to be bugged: I ran into a peculiarity with jade / partials and mongoose this morning. findById('xyz', fn(err, doc) { res.render('whatever', {foo: doc})}); Then if you have !- partial('part', foo) in your template, it will load the partial 5 times. Once for each element in the doc hash. [19:29] JacobSingh: If you do partial('part', {foo:foo}); it's fine [19:29] pifantastic_ has joined the channel [19:29] JacobSingh: I figured it out, but it was pretty confusing when I switched to a model and all of the sudden I had 5 of everything :) [19:29] LowValueTarget has joined the channel [19:30] tjholowaychuk: JacobSingh: ah probably because it has a .length so it thinks it's a collection [19:30] tjholowaychuk: since that first arg can be options, the object itself, or a collection [19:31] tiemonster: I'm trying to force express to use the tld instead of www. etc. [19:31] mikegerwitz: kkaefer: I read from /dev/{,u}random [19:31] tiemonster: I got my middleware to work. Now I just need to know what to look for. [19:31] tjholowaychuk: ? .com is a tld [19:31] tiemonster: right. without the www. [19:31] almay has joined the channel [19:32] tiemonster: anywho - how do I check the host? [19:32] dve: tjholowaychuk: im using jade in a project and I want to also use the client side micro-templating provided by underscore. I have a js block with type='text/template' but am getting an error from express when rendering... should jade be ok with this? [19:32] tjholowaychuk: req.headers.host [19:32] tjholowaychuk: dve: should be fine i've done it [19:32] tjholowaychuk: not with underscore [19:33] tjholowaychuk: but with others [19:33] JacobSingh: tjholowaychuk: yah, I get why... I wonder if there is someway we could make that more obvious... I suppose you want partials to loop automagically, damn JS overloading! [19:33] JacobSingh: Anyway, tjholowaychuk thank you for all your contribs, I'm having fun learning node [19:33] JacobSingh: I notice you are a recovering Drupaler too :D [19:33] tjholowaychuk: JacobSingh: haha yeah it's not always the result you want, definitely a gotcha but I like the collection support [19:33] tjholowaychuk: without doing { collection: foo } [19:33] tjholowaychuk: haha eyah [19:33] dve: tjholowaychuk: I as doing - script(type:'text/template', id:'info-template') and then just raw html indented underneath, this correct? [19:33] tjholowaychuk: WAY back in the day [19:34] kkaefer: mikegerwitz: hm, but I assume there's a quick one line sync code [19:34] JacobSingh: I'm still in the thick of it tho, work for Acquia. But would love to do some more node work [19:34] tjholowaychuk: JacobSingh: haha nice nice [19:34] tilgovi has joined the channel [19:34] mikegerwitz: kkaefer: fs.readFileSync( '/dev/urandom' ) ;) heh. urandom is sufficiently non-blocking [19:35] shanez has joined the channel [19:35] kkaefer: oh, true [19:35] mikegerwitz: kkaefer: doesn't read from disk [19:35] sirganya: I'm noticing that if you disable radio buttons they still are selectable even thought they're grayed out.. anyone come across this? [19:35] alcuadrado: anyone with experience in formidable? I can't find any info about which kind of errors can I have in the parse's callback [19:38] Rixius has joined the channel [19:38] Rixius has joined the channel [19:40] ita has left the channel [19:41] deedubs: Kami_: What in your opinion is the better way to communicate between the cluster manager and an instance? I'm tossing between Redis pub/sub or TCP sockets [19:43] [algo] has joined the channel [19:43] baoist has joined the channel [19:43] techwraith: deedubs: For what it's worth, we use redis pub sub :) [19:44] deedubs: techwraith: for what kind of setup? [19:44] deedubs: techwraith: do you retry if no clients receive the message? [19:44] techwraith: We've got three ec2s in the cluster, behind a load balancer [19:45] sendark has joined the channel [19:45] techwraith: Not exactly your setup [19:45] techwraith: And no, we don't retry currently [19:45] misconosciuto has joined the channel [19:45] djazz has joined the channel [19:46] deedubs: techwraith: Interesting. Thanks! [19:46] Rob- has joined the channel [19:46] nphase has joined the channel [19:47] techwraith: each of the ec2 instances have four child processes on them (one for each core). [19:47] techwraith: Those talk to the master process over the fd [19:47] stonebranch has joined the channel [19:48] taf2: i did something similar for an analytics app; https://github.com/taf2/fork.node [19:48] chjj: now that is web scale [19:48] chjj: ! [19:49] techwraith: It's actually set up very similar to how tjholowaychuk's cluster works [19:49] f^ has joined the channel [19:49] chjj: ACTION needs more web scale. [19:49] chjj: :) [19:49] techwraith: :) [19:49] techwraith: It's been fun [19:49] nphase: where would the proper place be to ask javascript questions born out of trying to write node apps? [19:49] techwraith: nphase: Here works :) [19:50] jmoyers has joined the channel [19:50] nphase: techwraith: cool. http://pastie.org/1882465 <- how do i do this the right way? [19:51] tjholowaychuk: nphase: try not to think of them as classes [19:52] techwraith: tjholowaychuk++ [19:52] v8bot: techwraith has given a beer to tjholowaychuk. tjholowaychuk now has 27 beers. [19:52] jmoyers: i. . . hate colloquy [19:52] tjholowaychuk: javascript is just a funky hybrid of wannabe classes [19:52] tjholowaychuk: and prototypes [19:52] jmoyers: is there a better irc client for macos that isn't terminal bsaed? [19:52] nphase: colloquy is definitely the worst [19:52] Aria: Textual. [19:52] techwraith: Linkinus (but you have to pay for it) [19:52] tjholowaychuk: until brendan makes it more confusing to people and adds the class syntax haa [19:52] nphase: tjholowaychuk: that's fine, but should i not use continuations? [19:52] Aria: But you have to compile it yourself or buy it. [19:52] ctide: what's wrong with terminal based [19:53] ctide: irssi is perfectly fine imo! [19:53] tiemonster: How would you set the status code on a res.render() in express? [19:53] jmoyers: textual eh -- i'll check it out [19:53] tjholowaychuk: tiemonster: { status: n } or res.statusCode = n [19:54] jmoyers: ooo, this looks sexy [19:54] tiemonster: cool. thanks! [19:54] kersny has joined the channel [19:54] tjholowaychuk: tiemonster: which exposes "status" as a local as well which is nice if you have a template rendering say 404, 500 etc [19:54] tiemonster: hmm [19:55] dmcquay has joined the channel [19:55] dmcquay has left the channel [19:55] Aria: Hehe, that's what I said, jmoyers. [19:56] techwraith: nphase: instead of doing self.class1.some_func(), do this.some_func() [19:57] nphase: techwraith: didnt actually work, sadly [19:57] nphase: i tried that too [19:57] techwraith: hmmm [19:57] nphase: techwraith: im wondering if the this.class1 = new Class1() doesnt actually occur until after the anon func is run [19:57] nphase: nvm, that doesnt matter if using this. [19:58] techwraith: Oh, Class1.prototype.some_func = function(){}; [19:58] techwraith: Not sure if the way you have it in there actually works [19:58] nphase: but yeah, i get TypeError: Object # has no method 'some_func' [19:58] techwraith: (it might) [19:58] tiemonster: tjholowaychuk: nice protip! thanks. [19:58] nphase: techwraith: how should i? should i avoid the prototype stuff altogether? [19:59] techwraith: no, take a look at line 6 in there [19:59] tjholowaychuk: js does prototypes in a crappy way [19:59] techwraith: I don't think you're actually defining some_func [19:59] tjholowaychuk: i think that's the only reason it confuses ppl [19:59] tjholowaychuk: lua ftw [19:59] nphase: techwraith: erm sorry, i meant to do Class1.prototype.some_func = function() [19:59] ezmobius has joined the channel [19:59] techwraith: ah [19:59] techwraith: k [20:00] TomY has joined the channel [20:01] techwraith: Why do you need that callback in there? [20:01] eldios: tj are you the guy actually portraited in your twitter avatar? [20:01] nphase: techwraith: is that not the style? [20:01] tjholowaychuk: eldios yeah? [20:01] eldios: geez you're very young =) [20:01] tjholowaychuk: 23 [20:01] techwraith: nphase: only for IO :) [20:01] tjholowaychuk: not tooooo young [20:01] eldios: you definitely look younger [20:01] nphase: techwraith: cool [20:01] towns has joined the channel [20:01] tjholowaychuk: we have a few 18-ish people in here [20:01] nphase: tjholowaychuk: dont feel bad, im 22 [20:01] techwraith: I'm only 23 too :) [20:01] Samot: 21 [20:01] stagas_ has joined the channel [20:01] chrislor_ has joined the channel [20:01] nphase: eldios: ITS THE FUTURE [20:01] tjholowaychuk: there you go [20:01] tjholowaychuk: haha [20:01] chjj: wow all in the 20-23 range [20:01] eldios: lol [20:01] chjj: 22 here [20:01] eldios: nope 28 here [20:02] tjholowaychuk: I've only actually been programming for a few years [20:02] eldios: we should defenitely make an age poll somewhere [20:02] tjholowaychuk: late in the game [20:02] djazz: 17.. :( [20:02] kersny: hmm... 18 [20:02] tjholowaychuk: wow tons of young people [20:02] tjholowaychuk: cool [20:02] tjholowaychuk: glad you guys are not stuck on php [20:02] tjholowaychuk: haha [20:02] kersny: ewww, php [20:02] nphase: where you guys located? [20:02] eldios: lol [20:02] Samot: australia [20:03] eldios: nphase, there's a nodejs user wiki page somewhere [20:03] nphase: wondering if there's any chicago dudes hanging out here [20:03] nphase: or if its mostly valley folks [20:03] nphase: or whatnot [20:03] eldios: https://github.com/joyent/node/wiki/Node-Users [20:03] cbibler_: i'm from chicago [20:04] nphase: cbibler_: nice, where do you work? [20:04] BinaryMuse has joined the channel [20:04] cbibler_: in a west suburb [20:04] harth has joined the channel [20:04] cbibler_: nphase: you? [20:05] tilgovi has joined the channel [20:05] nphase: cbibler_: downtown [20:05] nphase: cbibler_: PM? [20:05] cbibler_: sure [20:06] Nican has joined the channel [20:06] c4milo: tjholowaychuk: I am not sure what this mean Can't use mutable header APIs after sent. [20:07] tjholowaychuk: hahha [20:07] tjholowaychuk: yeah [20:07] lmorchard has joined the channel [20:07] tjholowaychuk: node needs to get rid of that [20:07] edude03 has joined the channel [20:07] vikstrous has joined the channel [20:11] Qbix2 has joined the channel [20:11] aguynamedben has joined the channel [20:12] chjj: v8: '!!!!'.blink() [20:12] v8bot: chjj: "!!!!" [20:12] chjj: v8: 'the only templating engine worth using'.small() [20:12] v8bot: chjj: "the only templating engine worth using" [20:13] context: v8bot have jquery on it as well ? [20:13] chjj: no, its just runinnewcontext [20:13] context: where does blink() come from [20:14] chjj: those methods are on the string prototype [20:14] chjj: theyre part of javascript [20:14] chjj: lol [20:14] context: wow ! [20:14] pifantastic has joined the channel [20:14] chjj: theyre long deprecated, but theyre there [20:14] tjholowaychuk: hahaha [20:14] mikegerwitz: Yeah idk who in their right mind would add blink().. [20:14] tjholowaychuk: funny hey [20:14] techwraith: Are there any others? [20:14] tjholowaychuk: out of all the things js does not have [20:14] chjj: v8: 'blink is amazing'.blink() [20:14] mikegerwitz: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String [20:14] v8bot: chjj: "blink is amazing" [20:14] techwraith: v8: 'test'.H1() [20:14] v8bot: techwraith: TypeError: Object test has no method 'H1' [20:14] context: v8: var os = require('os'); os.type() [20:14] v8bot: context: ReferenceError: require is not defined [20:14] techwraith: :( [20:15] context: :( [20:15] chjj: its only inline text semantics [20:15] scoates has joined the channel [20:15] chjj: v8: 'like this'.sup().fixed().big() [20:15] v8bot: chjj: "like this" [20:15] context: sup ? [20:15] binarypie has joined the channel [20:15] chjj: superscript [20:16] chjj: [20:16] therp has left the channel [20:16] pengwynn has joined the channel [20:17] techwraith: v8: 'test'.link('http://google.com'); [20:17] v8bot: techwraith: "test" [20:17] techwraith: sweet [20:17] chjj: v8: 'theres also.anchor('name'); [20:17] v8bot: chjj: SyntaxError: Unexpected identifier [20:17] zackattack has joined the channel [20:17] chjj: oops [20:17] chjj: v8: 'theres also'.anchor('name'); [20:17] v8bot: chjj: "theres also" [20:17] mkrecny has left the channel [20:18] mikegerwitz: Now nobody has any excuse not to make everything blink [20:18] chjj: exactly [20:18] techwraith: hmmm, it would be cool if they had those for all html5 tags [20:18] chjj: who needs a templating engine when you have... [20:18] chjj: v8: 'this'.blink() [20:18] v8bot: chjj: "this" [20:18] hellp has joined the channel [20:19] svenlito has joined the channel [20:19] mikegerwitz: The blink tag is the greatest contribution to humanity in the past century [20:19] chjj: this ^ [20:20] chjj: so are animating gifs + geocities [20:20] chjj: and pretty much everything that was on the web in the 90s [20:20] mikegerwitz: haha, yes [20:22] gonsfx has joined the channel [20:22] ryangomba has joined the channel [20:22] lmatos: re: animated gifs if you haven't seen this: http://www.mymodernmet.com/profiles/blogs/astounding-animated-gifs check it out now :) [20:23] lmatos: caution: your browser will laggggg [20:24] jmar777 has joined the channel [20:24] edude03_ has joined the channel [20:24] jwl: if i want to run a node.js file from another file .. should I just require() it or do child_process.exec() ? [20:25] misconosciuto has left the channel [20:25] ryah: jwl: child_process.spawn [20:25] robhawkes has joined the channel [20:25] jwl: ryah: yeah i know .. but is it better with require('file').run()? [20:26] jwl: put the logic in a file and run it instead [20:26] sikker: I suppose it depends on whethr jwl wants to run it on it's own terms or use the contents of it as a library [20:26] jwl: rather than having to run it as a spawn process [20:26] jmoyers: bah, textual requires xcode 4 [20:26] jmoyers: i guess i might have to attempt side by side installation :: sigh :: [20:26] jwl: put the logic in a function i mean [20:27] aconbere has joined the channel [20:27] context: whats the point of installing packages globally with npm [20:27] stephank: context: commandline utilities (the 'bin' section in package.json) [20:27] sikker: context, the same as installing programs for all users instead of only for one user [20:28] towns has joined the channel [20:28] sirkitree has joined the channel [20:28] sikker: jwl, is it your own file? does it make sense to run it as it's own process(as in, does it do anything on it's own that doesn't require the rest of your application) or is it just logic you need to run during the course of your main app? [20:28] context: stephank: ahh gotcha [20:28] jwl: its my own file [20:29] context: makes sense for cli tools [20:29] context: thats it :/ [20:29] jwl: my main app need its function logi [20:29] jwl: so i guess require() then =) [20:29] jwl: thanks [20:29] jwl: node.js rocks! [20:29] jwl: ryah: thanks for making it nice to code js on the server .. nothing beats node.js [20:29] context: i like node. npm 1.0 kinda disappoints me [20:29] eyesUnclouded has joined the channel [20:29] sikker: jwl, it sounds like a library, yes, so module.exports = yourObject in the file and be merry [20:29] isaacs: context: really? howcome? [20:30] chjj: uhoh [20:30] context: isaacs: i dont like how it handle dependencies. theorectically i can have something installed 5 times and still not be able to use it [20:30] isaacs: ACTION gets too much praise, criticism is more useful and appreciated. [20:30] context: and that globally installed stuff cant... be used [20:30] chjj: hehe [20:30] isaacs: context: use `npm link` to include it locally [20:30] isaacs: context: just do `npm link express` instead of `npm install express` [20:31] context: ahh kk :x [20:31] ryangomba_ has joined the channel [20:31] sikker: yes, I do find it a bit odd that it's not standard behaviour to be able to require() globally installed stuff [20:31] isaacs: that'll install it globally (or not, if it's already there), and then symlink it to ./node_modules [20:31] context: isaacs: i love the new 'install locally'. dont get me wrong [20:31] |sWORDs|: SubStack and chjj: fs.createReadStream('./image.jpg').pipe(Socket) is no solution, because stream also does not support binary only base64, ascii and utf8. [20:31] stephank: I actually have $prefix/node_modules in my NODE_PATH. But that seems non-standard. [20:31] context: isaacs: i dont like how the dependencies are handled [20:31] Spion_ has joined the channel [20:31] isaacs: context: it's a trade-off. you can't say "isolate everything" and also say "use the one that's installed over there" [20:32] isaacs: context: but... 'install locally' IS how dependencies are handled... [20:32] isaacs: context: if you depend on something, put it in your package.json's "dependencies" [20:32] context: isaacs: it'd kind of make more sense if packages were kind of more strict on which version of deps they are requiring [20:32] context: most packages i see though just say 'i need this package' [20:32] isaacs: context: sure. [20:32] chjj: |sWORDs|: it will be piping it to the socket as binary by default [20:32] isaacs: context: that's not really npm's problem. it's just obeying orders [20:32] stephank: Wow, I actually run into specific version requirement scenario's quite a bit. [20:32] isaacs: if the author doesn't know what they need, then i can't fix that. [20:32] context: isaacs: understood [20:32] sikker: isaacs, this is just me being a newbie, and I'm pulling this out my rear end, but I think it would be intuitive to assume global and override with local. if you catch my drift. [20:33] context: well locally i meant the './node_modules' idea. but :x [20:33] isaacs: sikker: no, we need to move away from that. [20:33] context: isaacs: is there anyway to easily handle package.json info. kind of like rubys 'bundle check' or such [20:33] isaacs: sikker: global installation is just for things that are used by the system as a whole. node programs shold bundle their dependencies, or symlink them in. [20:33] isaacs: context: not sure what "bundle check" does, exactly [20:33] isaacs: context: but `npm ls` shows you most of what you need to know [20:34] context: isaacs: for ruby you have a Gemfile with dependencies. and it keeps track of what you have/whats missing [20:34] context: or here: [20:34] isaacs: context: yeah, we use the package.json for that [20:34] Rob- has joined the channel [20:34] context: isaacs: is there a simple npm command to read the package.json and install packages [20:34] isaacs: context: yes. `npm install` [20:34] isaacs: context: it'll install whatever's missing [20:34] sikker: isaacs, I can easily see the benefit, but the great thing about global dependency resolution in say apt for Debian is that a security fix will make it into everything that uses the library, for instance [20:34] context: :x haha [20:34] context: just tried that [20:34] context: isaacs: kk. [20:35] context: isaacs: thnx. i dont dislike the new npm so much anymore [20:35] japj has joined the channel [20:35] isaacs: context: so, there are cases where, forinstance, A -> B -> C, and previously, A used to be able to do require("C") and it'd work by accident. [20:35] context: isaacs: now is it possible to have npm (or does it do this already) install packages from my globally installed packages [20:35] context: say i dont have internet [20:35] isaacs: context: in the new system, it's more isolated. if you depend on C, you have to actually say so [20:35] isaacs: context: npm link thing-i-installed-globally [20:35] context: isaacs: yeah that makes sense [20:35] tiemonster: How do you catch 404 errors in Express? I was told to app.get('*'... but that overrides everything... [20:35] ryangomba has joined the channel [20:36] isaacs: context: i'd like to add some kind of `npm install --link-if-its-global-already` thing [20:36] context: isaacs: yeah i can link. will install check globally and pull it from there though? (like copy it) [20:36] stephank: sikker: Have you seen: http://blog.nodejs.org/2011/05/01/npm-1-0-released/ [20:36] isaacs: context: no, not yet, but that's an idea i'm sorta chewing on ^ [20:36] context: ahh gotcha ;) [20:36] isaacs: context: or even, `npm install --link-all-deps` or something [20:36] isaacs: context: of course, these flag names are terrible. [20:36] stephank: sikker: specifically, it's mentioned NPM tries to be a development tool, and that kind of thing would still be handled by apt and packages in deb format. I guess we're not really there yet, though. [20:36] isaacs: but you get the idea [20:37] isaacs: sikker: if you want that behavior, just install things globally, and use npm link. [20:37] context: isaacs: ;) [20:37] isaacs: sikker: that's what the link command is for. [20:37] |sWORDs|: chjj: If I don't set Socket.Encoding I don't get an error but it close the socket. [20:37] chjj: ? youre talking about the socket's encoding? [20:37] kawaz_air has joined the channel [20:38] chjj: ive never had to set a sockets encoding [20:38] chjj: and gotten an error [20:38] dve: Any london based node.js developers live in here? [20:38] jwl: hmm [20:39] chjj: oh |sWORDs|: try doing fs.createReadStream('image.png').pipe(socket, { end: false }); [20:39] |sWORDs|: If I do fs.createReadStream(image[0]).pipe(Socket); it closes the socket. (image[0] = "test.jpg") [20:39] jwl: im using async and child_process .. child_process.exec's callback can't take a callback from async [20:39] chjj: the stream is probably calling end on the socket [20:39] chjj: pass in the options object: { end: false } [20:39] jwl: the callback signature looks like function (error, stdout, stderr) {}) [20:39] jwl: i need that callback to use async's callback when its ready .. but that seems to be impossible [20:40] kryptom has joined the channel [20:40] |sWORDs|: chjj: Still closes the socket [20:41] chjj: hmmm, shouldnt be happening, im not sure [20:42] |sWORDs|: chjj: No, it works, the socket closed because node crashed you had socket with a lowercase s. [20:42] jwl: should i use exec or spawn when running other files? [20:42] chjj: ah, sorry, hehe [20:42] jwl: or linux commands [20:43] chjj: good to know it works [20:43] |sWORDs|: chjj: Yeah, now I can get further again. Tnx! [20:43] sikker: isaacs, don't get me wrong, from a development standpoint I can easily see why this approach is better. It's just that it, at least to me, appears that npm aims to be a node application publishing platform as well as a development tool, and in that case I think the link vs. statically include scenario should be in reverse. that the user can, by default, assume that his most recent checkout of a crucial lib is the one being used :) [20:43] chjj: yep [20:44] dmcquay has joined the channel [20:44] ryangomba has joined the channel [20:44] puffpio has joined the channel [20:45] stonebranch has joined the channel [20:46] djazz has left the channel [20:47] kersny has joined the channel [20:51] TomY has joined the channel [20:51] bradleymeck has joined the channel [20:52] softdrink: is anyone using a cakefile to spawn a stylus process with --watch? [20:52] mtsl has joined the channel [20:53] tjholowaychuk: softdrink: why not just use stylus(1) ? [20:53] tjholowaychuk: or make [20:53] tjholowaychuk: lol [20:53] eldios: dve are you hiring? if so.. are you hiring remotes? :) [20:53] softdrink: because i want to do: "cake watch" and have it watch for coffeescript and stylus changes [20:54] tjholowaychuk: ugh [20:54] halfhalo: I just want cake now... [20:54] tjholowaychuk: make has no replacement [20:54] tjholowaychuk: :D [20:54] softdrink: hehe [20:54] sirkitre_ has joined the channel [20:54] Skola has joined the channel [20:55] gf3: ACTION replaces tjholowaychuk with a Makefile [20:55] Mrfloyd has joined the channel [20:55] softdrink: tjholomakechuk [20:55] tjholowaychuk: ahahha [20:56] softdrink: stylus **/*.styl —watch works from the command line but not from child_process.spawn :T [20:56] [algo]: tjholowaychuk: what is express-expose for? [20:57] [algo]: do you recommend to use it? [20:57] xeodox has joined the channel [20:57] [algo]: good evening =) [20:57] tjholowaychuk: [algo]: exposes modules and js objects to the client-side [20:57] tjholowaychuk: into different local variables you can chuck in your template [20:58] [algo]: currently I have scripts [20:58] [algo]: I'm using layout to add default scripts into variable [20:58] [algo]: is it correct ? [20:58] [algo]: or I'd better use expose [20:59] ryangomba_ has joined the channel [20:59] tjholowaychuk: whatever works for you [20:59] softdrink: i guess that glob just doesn't work well [20:59] f^ has joined the channel [20:59] aroop has joined the channel [21:01] japj: chapel: hi, how is the work on node-pa progressing? [21:01] V1 has joined the channel [21:01] [algo]: recently I saw a nice library for async calls ordered [21:01] [algo]: something like node-async [21:01] [algo]: or... [21:01] [algo]: forgot how it was ;( [21:01] [algo]: spelled [21:01] chapel: not too bad, trying to figure out how it works in relation to nodes async stuff [21:01] techwraith: [algo]: https://github.com/caolan/async [21:02] [algo]: ah yes [21:02] [algo]: thank you [21:02] path[l] has joined the channel [21:02] techwraith: np [21:02] chapel: japj: I had an idea to make it a little slicker, instead of just playing any random file, you could register a file, and then call it to play [21:03] japj: chapel: yeah the current 'play' api requires reloading of the file every time you want to play something [21:04] japj: chapel: it would probably make sense to be able to cache a loaded file and just tell it to play instead [21:05] japj: chapel: apparently my ubuntu has portaudio1.8 installed by default and there are some changes in the 1.9 api that fails compilation for me [21:05] truedat101 has joined the channel [21:05] chapel: hmm what is the error? [21:06] japj: chapel: it starts with /nodepa.cc:123:32: error: ‘PaStreamCallbackTimeInfo’ does not name a type [21:06] Apeiron` has joined the channel [21:07] japj: chapel: and then some other things aswell. I'm not familiar with portaudio and I don't know if I can side by side install both 1.8 and 1.9 portaudio development files [21:08] chapel: yeah Im not sure there [21:08] chapel: I think 1.9 would overwrite maybe [21:09] softdrink: tjholowaychuk: can stylus smash together all of its output? [21:09] wdperson_ has joined the channel [21:09] tjholowaychuk: softdrink: nope [21:09] tjholowaychuk: most people use the middleware [21:09] softdrink: dang. [21:09] tjholowaychuk: but nope neither aggregate [21:10] chapel: japj: so the callback issue, I was having it too, what did you use to fix it? [21:11] ezl has joined the channel [21:12] test117522 has joined the channel [21:12] [algo]: I have an object. I need to apply an async function to all items of the object in sequence [21:12] [algo]: how should I do it with async ? [21:12] japj: chapel: I don't know if we had the same issue, but basically the callback is an optional and for me it segfaulted if I did not specify a callback function in javascript [21:13] chapel: oh, maybe that was my issue, in my example, I had a callback, and it worked, and then one without a callback [21:13] [algo]: actually as I see, I have to prepare an array and call async.series with it [21:13] [algo]: 2-steps [21:13] [algo]: anything simpler? [21:13] japj: chapel: I didnt know how to do it 'properly' but I added a 'is the callback parameter a function' variable in the event data and then before calling the callback check if it actually needs to do something [21:13] chapel: I had to comment out all the callback code to get it working without a segfault [21:14] flobblebobble has joined the channel [21:14] japj: chapel: https://github.com/japj/node-sdlmixer/blob/master/node-sdlmixer.cc#L68 doCallback is the variable that tracks if it needs to call [21:14] f^ has joined the channel [21:15] japj: chapel: and I use pi->doCallback = args[1]->IsFunction(); to fill it [21:15] zackattack has joined the channel [21:15] japj: chapel: but there must be a better way to do it, but I havent found it yet [21:15] japj: chapel: atleast it works enough to not segfault ;) [21:16] Nietecht has joined the channel [21:16] chapel: yeah [21:16] pifantastic has joined the channel [21:18] japj: chapel: I must say, considering this is (I guess) both our first attempt at a nodejs addon it isnt too bad. I learned more about nodejs that I would've expected [21:18] azeroth__ has joined the channel [21:18] sadie has joined the channel [21:19] chapel: yeah exactly [21:19] chapel: I don't care if I get money from this at this point [21:19] chapel: it was a fun learning process [21:19] japj: exactly [21:19] Flobblebobble has joined the channel [21:19] chapel: and I have learned a lot more about node, than I would have otherwise [21:20] f^ has joined the channel [21:20] [algo]: does async.series return a promise ? [21:20] [algo]: can I add an action after series? [21:21] [algo]: (but not put it as callback) [21:21] ericnakagawa has joined the channel [21:23] viz has joined the channel [21:23] japj: chapel: it seems when I try to install portaudio19-dev in ubuntu, it wants to remove some other applications so I'm not going to do that [21:23] chapel: using apt get? [21:25] Me1000 has joined the channel [21:25] heavysixer has joined the channel [21:25] softdrink: hrm… ok then… in zappa, how can i get down to connect and make it compile coffeescript for me? [21:25] japj: chapel: yes, apparently it eventually conflicts with ardour, jackd, jackd2 and some other stuff [21:26] chapel: hmm, that is odd [21:26] nibblebot has joined the channel [21:26] chapel: or maybe they use it? [21:26] japj: chapel: is there a document describing the changes between portaudio 1.8 and 1.9? (i.e. maybe have 2 implementations, one for 1.8 and one for 1.9 depending on what's available) [21:28] dies_el has joined the channel [21:28] pyrony has joined the channel [21:29] japj: chapel: but not sure if we want to spend the effort on that [21:29] CiRlE has joined the channel [21:29] japj: chapel: it would be nice if I could contribute something back to your project though [21:29] chapel: for development, if someone was using v18, then they would know not to install a newer version, otherwise people wouldn't care [21:30] chapel: Im curious as to why it wouldn't compile on ubuntu, maybe I should load up a vm and try [21:31] pyrotechnick1 has joined the channel [21:31] pyrotechnick1: http://www.flickr.com/photos/matthewbergman/5694367419/in/set-72157626538953685/ [21:31] pyrotechnick1: man we're a good looking bunch [21:31] awenkhh has joined the channel [21:32] Aria: I so want to make it next year. [21:32] towns has joined the channel [21:32] chapel: same here [21:33] pyrotechnick1: me too [21:33] pyrotechnick1: was it in SF? [21:33] Aria: PDX [21:33] pyrotechnick1: wheres that [21:33] pyrotechnick1: itll be a long way from amsterdam but ill try to make it [21:34] zackattack has joined the channel [21:34] pyrotechnick: isnt that close to you chapel? [21:34] chapel: portland [21:34] V1: (we should just host the next nodecamp in amsterdam) [21:34] jamesarosen has joined the channel [21:34] chapel: and yeah, really close [21:35] pyrotechnick: where is there a place called vancouver there [21:35] jaket has joined the channel [21:35] chapel: there are two vancouvers [21:35] chapel: vancouver washington [21:35] pyrotechnick: thats dumb [21:35] V1: portland is waay to far for us european guys :9 [21:35] chapel: and vancouver bc [21:35] pyrotechnick: its way too far for us australian guys :p [21:35] pyrotechnick: america is weird [21:35] Aria: Yeah, but everything's too far from .au [21:36] voodootikigod: we had 8 aussies [21:36] voodootikigod: so its not way too far [21:36] Aria: At least from .eu there's a chance of coinciding cheap flights. [21:36] svenlito has joined the channel [21:36] mjr_: NodeConf was really great. Probably the best conference I've ever attended. [21:36] V1: voodootikigod: they must have had deep pockets :D [21:36] mjr_: The content of the talks was consistently excellent, which is rare. [21:36] Aria: Nice! [21:37] voodootikigod: possibly or bought flights early [21:37] pyrotechnick: you had aussies? [21:37] pyrotechnick: is there a listing of them somewhere? [21:37] voodootikigod: FOR LUNCH [21:37] mjr_: Usually conferences are good just because you get like-minded people in the same place. [21:37] pyrotechnick: trying to get together a meetup here in brisbane [21:37] voodootikigod: lachlan hardy [21:37] wdperson has joined the channel [21:37] voodootikigod: mjr_: thanks! [21:37] rfay has joined the channel [21:38] SubStack: pyrotechnick: the vancouver in canada incorporated after the one in washington [21:38] SubStack: so blame canada! [21:38] mjr_: And, we drunkenly ordered a bus to drive around Portland late at night and search for chicken. [21:38] pyrotechnick: freaking canada [21:38] voodootikigod: CHICKEN!!! [21:38] pyrotechnick: haha [21:38] mjr_: So that was good too. [21:38] voodootikigod: NEED MOAR CHICKEN [21:38] Qbix2 has joined the channel [21:38] voodootikigod: mjr_: and kuvos vomitted up the back of the bus [21:38] pyrotechnick: damn that guys from sydney voodootikigod [21:38] mjr_: Oh nice [21:38] criswell has joined the channel [21:38] voodootikigod: its not a party unless someone has too much [21:38] voodootikigod: and the rest of us can laugh [21:38] mjr_: Party Status: confirmed [21:39] pyrotechnick: THERE WAS A GIRL THERE??? [21:39] voodootikigod: there was [21:39] mape: mjr_: Any reason people can't send voice feedback to voxer? :) [21:39] pyrotechnick: does not compute [21:39] mdoan has left the channel [21:39] mjr_: mape: only because we use ZenDesk [21:40] mape: mjr_: ah k [21:40] mjr_: mape: our next version is going to have a feedback user that's backed by actual people. [21:40] pyrotechnick: i say we have an e-conference [21:40] pyrotechnick: lets start writing some scalable conferencing software [21:40] chapel: second life!!! [21:40] mjr_: Which was a fun thing to write, because now we can more easily have gateways into all sorts of other things. [21:40] chapel: lol [21:41] mape: mjr_: Really like the app though, got 5-6 of my friends to use it. Only think that could need some polish is theUI :) [21:41] pyrotechnick: yeah second life [21:41] pyrotechnick: second life in webgl/node [21:41] pyrotechnick: GO! [21:41] chapel: fuck second life, lets use toe [21:41] chapel: :P [21:41] pyrotechnick: yep [21:41] pyrotechnick: quickly now [21:41] pyrotechnick: get your code on [21:41] chapel: that could be an initial mvp [21:41] mjr_: mape: ugh. The UI. We are working on it, I assure you. Also the occasional slowness. [21:41] pyrotechnick: e-nodeconf [21:41] pyrotechnick: .map [21:41] mape: mjr_: Neat [21:41] dies_el has joined the channel [21:41] chapel: just a simple virtual world, nothing more [21:41] pyrotechnick: with a projector [21:41] pyrotechnick: and some seats [21:41] nphase has joined the channel [21:41] pyrotechnick: and some sandwiches [21:41] mjr_: mape: a lot of that UI cruft is because we were trying to make the same UI on iOS as on Android. [21:41] aconbere has joined the channel [21:41] nphase has joined the channel [21:41] mjr_: cross-platform stuff almost never works out. [21:42] aguynamedben_ has joined the channel [21:42] mjr_: pyrotechnick: you can have conference groups on voxer of an unlimited size. [21:42] mape: mjr_: oh yeah, that might not be the best of ideas [21:42] pyrotechnick: reaaaaally [21:42] mjr_: mape: yeah, it isn't. Lesson learned. [21:42] pyrotechnick: but still toe would be better chapel [21:43] [algo]: anyone here using async ? [21:43] V1: ._. duh [21:43] mape: mjr_: Really love the responsiveness though, beats other apps hands down [21:43] pyrotechnick: haha [21:43] pyrotechnick: [algo]: you trolling? [21:43] pyrotechnick: oh you mean the library? [21:43] mjr_: pyrotechnick: we have some people doing 85-way conversations already. I expect we'll see larger ones once we allow you to add/remove people. [21:43] [algo]: pyrotechnick: the library. [21:43] pyrotechnick: thats cool [21:43] clip has joined the channel [21:43] |sWORDs|: Does node or v8 have anything builtin for encoding/decoding base64? [21:44] pyrotechnick: yeah it does now [21:44] pyrotechnick: i keep forgetting it though give me a sec [21:44] [algo]: ACTION trolls pyrotechnick with async [21:44] mjr_: mape: I'm still pushing for even more responsiveness. I won't rest until we have crisp, instant response all the time. [21:44] chapel: mjr_: can you restrict talkers [21:44] pyrotechnick: |sWORDs|: sec [21:44] chapel: like one person can talk and others listen? [21:44] mjr_: chapel: that's the other problem. :) [21:44] mjr_: Soon though. [21:44] chapel: :) [21:44] chapel: if you had that, you could have adhoc radio [21:44] mape: mjr_: any plans at all on live audio? rather then the walkie talkie? kinda though that was meant when I saw the "go live" button [21:44] pyrotechnick: new Buffer(STRING).toString 'base64' [21:45] insin has joined the channel [21:45] pyrotechnick: there you go |sWORDs| [21:45] |sWORDs|: pyrotechnick: If I get it right that would put a string in a buffer and convert it to base64? [21:45] pyrotechnick: yeah its not terribly elegant but it works [21:46] pyrotechnick: theres probably a better way but that will get you out of trouble for now [21:46] pyrotechnick: if you're taking in binary data you must specify that [21:46] pyrotechnick: new Buffer(BINARY, 'binary').toString 'base64' [21:46] pyrotechnick: otherwise it will fuck with it [21:46] davidcoallier has joined the channel [21:47] |sWORDs|: pyrotechnick: And how would I go from base64 to binary? [21:47] chjj: |sWORDs|: you can decode base64 by doing new Buffer(str, 'base64') [21:47] chjj: and then do toString('binary') or 'utf-8' or whatever [21:47] pyrotechnick: new Buffer(str, 'base64').toString() [21:47] pyrotechnick: yeah [21:48] mjr_: mape: it already does live right now. If you both press the talk button at the same time, it's full-duplex. [21:48] pyrotechnick: defaults to utf [21:48] truedat101 has joined the channel [21:48] chjj: binary strings are deprecated though [21:48] mape: mjr_: oh, k [21:48] tilgovi has joined the channel [21:48] |sWORDs|: You guys rock! I'll have a go with it. [21:48] niftylettuce has joined the channel [21:48] pyrotechnick: is this stuff docced? [21:48] nphase has joined the channel [21:48] bradleymeck has joined the channel [21:48] chjj: buffers? [21:49] pyrotechnick: well [21:49] pyrotechnick: theres no like [21:49] clip: hi, still having this issue with socket.io and flashsockets. when i dont have the nodejs server running i get an IOError in Flash. But when it runs flash connects to the socket and disconnects immediatly again, the node server doesn't even mention an incoming connection, anyone got an idea on this issue? [21:49] pyrotechnick: instructions on how to convert to from base64 it just says its an option [21:49] pyrotechnick: could be better [21:49] nphase_ has joined the channel [21:49] pyrotechnick: this is all it says [21:49] pyrotechnick: 'base64' - Base64 string encoding. [21:50] chjj: yeah i guess theres no intructions on how to do simple tasks that people would commonly want to do [21:50] V1: clip: "when i dont have the nodejs server running" ... "the node server doesn't even mention an incoming connection" .. so what is it? Do you have a server running or not [21:50] pyrotechnick: i dont necessarily think the best place is the docs [21:50] |sWORDs|: I've read that part, I thought it was only to mark the buffer as base64 aswell, not that it could convert [21:50] tim_smart: pyrotechnick: Why not just use the native buffer encoding methods [21:50] pyrotechnick: but we need to sort this stuff out ASAP [21:50] chjj: but thats not really what docs are for anyway [21:50] tim_smart: new Buffer(string).toString('base64') [21:50] pyrotechnick: there needs to be an officially sanctioned place for it all [21:50] pyrotechnick: tim_smart: ? [21:50] chjj: maybe [21:51] pyrotechnick: tim_smart: ^^ read mate [21:51] chapel: tim_smart: that is what he said :) [21:51] pyrotechnick: we sorted it out, we're just bitching about the docs [21:51] chjj: a really well-matured wiki would be good [21:51] siculars has joined the channel [21:51] pyrotechnick: chapel: looks like we need nodehub sooner than we thought [21:51] chapel: I know pyrotechnick [21:51] tim_smart: pyrotechnick: I thought you were talking about a package :) [21:51] pyrotechnick: maybe i will hack something up today [21:51] chjj: im not bitching, i have no problem with the docs :) [21:52] pyrotechnick: tim_smart: nah sorry to confuse you [21:52] pyrotechnick: well i was [21:52] |sWORDs|: chjj: Yeah I could have use crypto.js or some other .js file, but I don't want to add anything if it's already in. [21:52] |sWORDs|: (not the node.js crypto.js) [21:52] pyrotechnick: well most of the crypto have taken it out [21:52] pyrotechnick: because it's now supported natively [21:52] chjj: i think the docs are fine, but it would be good to have a little wiki with common practical knowledge too [21:52] clip: V1: sure the server is running ,but it doesn't mention any connection from flash. in flash i get a trace for the connecting to the socket, but the disconnent comes immediatly [21:53] pyrotechnick: nodehub.com ;) [21:53] V1: clip: connecting to the correct port? [21:53] chjj: |sWORDs|: sorry, what? [21:53] V1: are you connection cross domain chip? [21:53] MikeMakesIt has joined the channel [21:53] |sWORDs|: -> yeah i guess theres no intructions on how to do simple tasks that people would commonly want to do [21:53] clip: clip: yes port and ip, everything is alright, when i connect to the server through a webpage everything is fine [21:54] V1: chip: if you are connecting cross domain you should us a different .swf file, the WebSocketInsecure.swf, that one allows cross domain flash sockets. [21:54] pyrotechnick: hey guys [21:54] pyrotechnick: chapel has a very special question for all of you [21:54] pyrotechnick: if you wouldnt mind giving him your opinion [21:54] chapel: haha [21:54] nphase: aconbere: anders? [21:54] chapel: ACTION thinks of a dirty question to ask [21:54] pyrotechnick: its not so much dirty as it is taboo [21:54] |sWORDs|: so shoot [21:55] pyrotechnick: or just generally socially unacceptable and thus frowned upon [21:55] V1: I give up, i'm going to bed, nite [21:55] pyrotechnick: RAGEQUIT [21:55] chapel: In all seriousness, what would be a better tld for a site that compiles examples and help docs for node.js? .net or .org? [21:55] nphase: .org! [21:55] pyrotechnick: its between nodehub.org and nodehub.net [21:55] pyrotechnick: we have em both [21:55] nphase: oh, then host them both? [21:55] chjj: tough choice [21:55] pyrotechnick: yeah but [21:55] pyrotechnick: what should be the sanctioned one [21:55] chapel: well, need one to be the main [21:55] |sWORDs|: did you ask if it would alright to use the node name? [21:55] qFxo has joined the channel [21:55] nphase: ACTION votes .org [21:56] Marak has joined the channel [21:56] Marak: does anyone have sample code for using process.stdin for building pipe interfaces to CLI? having some troubles here [21:56] pyrotechnick: its not nodejs but yeah well ask [21:56] chapel: |sWORDs|: already talked to ryah, he said joyent would be cool (will email them when its appropriate) [21:56] pyrotechnick: i see they made nodeconf shirts anyway [21:56] chjj: |sWORDs|: as long as theyre not selling a service involving node, i dont think it matters [21:56] pyrotechnick: theyre already raping their trademark [21:56] hij1nx has joined the channel [21:56] pyrotechnick: i seriously dont think they even care, i think its a stunt [21:56] p_nitsch has joined the channel [21:56] chapel: Marak: hmm, pipe in [21:57] |sWORDs|: I know, but I read something about joyent not liking it, so I just wanted to give a heads up [21:57] pyrotechnick: its just to cover their asses but the fact they allow nodeconf shirts tells me theyre not serious [21:57] japj: are there any videos up yet from the jsconf 2011 talks? [21:57] pyrotechnick: so it looks like .org? [21:57] chjj: i dunno, .net looks more aesthetically pleasing to my eye [21:57] |sWORDs|: I think .net make me think about a certain framework to much ;) [21:57] chjj: but .org sounds more educational maybe [21:57] chapel: Marak: haven't used the code, but might help https://github.com/Tim-Smart/gista/blob/master/src/gista.coffee#L124 [21:58] |sWORDs|: chjj: Yes, I thought that aswell [21:58] f^ has joined the channel [21:58] chapel: lol [21:58] pyrotechnick: cool, thankyou gentlemen [21:58] chjj: ;) [21:58] chapel: thanks [21:58] chapel: also, joyent wants to support node, so having sites that support node and use node in the name are accepted [21:58] chapel: its only if they are selling stuff [21:59] qFox has joined the channel [21:59] chjj: yeah, as long as theyre not selling some kind of service its alright i think [21:59] chjj: as long as theres no money involved [21:59] |sWORDs|: Don't shoot the messenger, it was just to check if you've read it aswell and thought about it. [21:59] mikey_p: the most clear trademark policy i've ever seen is still: http://drupal.com/trademark [21:59] tjholowaychuk: chjj: what about publishers? lol [22:00] tjholowaychuk: i dont get any of that crap, seems stupid to me [22:00] chapel: |sWORDs|: I asked ryah in here directly about it :P [22:00] tjholowaychuk: if people want to make/sell ebooks or screencasts about node [22:00] mikey_p: but I probably shouldn't mention that word around here [22:00] tjholowaychuk: they should be able to [22:00] pyrotechnick: is there a wikipedia based on a proper VCS like git or something? [22:01] qfockmyrouter has joined the channel [22:01] |sWORDs|: chapel: Will nodehub run on node? :) [22:01] chapel: Marak: that help? [22:01] chapel: |sWORDs|: of course [22:01] chapel: open source [22:01] mikey_p: pyrotechnick: I know of https://github.com/patrikf/ewiki [22:01] chjj: tj: i think its services specifically, like node hosting services, they dont want node hosts trying to look official or as though they were endorsed by joyent/node [22:01] pyrotechnick: i mean an installation [22:01] deepthawtz has joined the channel [22:01] tjholowaychuk: chjj: gotcha [22:01] tilgovi_ has joined the channel [22:01] tjholowaychuk: that would make more sense [22:01] mikey_p has left the channel [22:02] mikey_p has joined the channel [22:02] |sWORDs|: ACTION -> bed [22:05] qFox has joined the channel [22:05] lnemo has joined the channel [22:06] fugoki has joined the channel [22:06] havenn has joined the channel [22:06] miloshadzic has joined the channel [22:06] mikeal has joined the channel [22:07] aconbere has joined the channel [22:07] Marak: chapel: i think so, i sent to paolo [22:08] chapel: :) [22:08] chapel: btw, Im not done with node-pa [22:08] chapel: I still think portaudio is where its at [22:08] chapel: it supports input/output [22:08] chapel: can record to files [22:08] chapel: can synthesize sounds [22:08] chapel: so its just a matter of getting it all to work well with node [22:10] zined_ has joined the channel [22:10] mikey_p_ has joined the channel [22:11] marcab_ has joined the channel [22:11] Pilate has joined the channel [22:12] SebastianFlyte has joined the channel [22:13] tilgovi has joined the channel [22:13] newy_ has joined the channel [22:14] Dreamer3 has joined the channel [22:14] webben has joined the channel [22:14] tilgovi_ has joined the channel [22:15] towns has joined the channel [22:16] Opaque has joined the channel [22:16] McMAGIC--Copy has joined the channel [22:19] brainproxy_ has joined the channel [22:21] kryptom has joined the channel [22:22] p_nitsch_ has joined the channel [22:22] mikeal has joined the channel [22:24] eldios: as you know is it possible to put a listener on a variable to detect changes on it? [22:24] ^rcaskey has joined the channel [22:24] baoist has joined the channel [22:24] boogyman has joined the channel [22:24] LowValueTarget has joined the channel [22:24] obliviony has joined the channel [22:25] Ian___ has joined the channel [22:25] niftylettuce has joined the channel [22:25] micro`_ has joined the channel [22:26] hoax__ has joined the channel [22:26] havenn has left the channel [22:27] tilgovi_ has joined the channel [22:27] tilgovi_ has joined the channel [22:27] jpiche has joined the channel [22:28] alek_br_ has joined the channel [22:28] Druide_ has joined the channel [22:28] blueadept has joined the channel [22:30] MattJ has joined the channel [22:30] Opaque: I started building out my project with mongoDB. One of the things I use mongo is for real-time storage. Should I switch to redis for that part or just launch.. ? [22:30] kevliu has joined the channel [22:30] demastrie has joined the channel [22:30] demastrie has left the channel [22:31] mjr_: What are you worried about with mongo? [22:31] unomi: Opaque, depends ;) [22:32] unomi: latency, probably [22:32] Opaque: I'm worried that with the amount of data I'm writing/reading per second per user, it might overwhelm it. [22:32] unomi: Opaque, is it 'throwaway' data? [22:33] dnolen has joined the channel [22:33] Opaque: yes. if I lost the data, it would not be the end of the world. But I am reading it, not just logging. [22:33] Opaque: It's a balance between pre-optimization and plain setting myself up for failure if too many people connect ( especially since I'm starting with a free mongohq db :P ) [22:34] unomi: Opaque, redis, if local to the node instance will be faster, but to know if it is really an issue, throw together a stress test [22:34] ezl has joined the channel [22:35] unomi: if either one is going to be on a server 'far away' then the network overhead might well render the difference irrelevant [22:35] kevliu: anyone ever make an outbound https request from node? i'm trying to interact with the FB graph api. [22:35] saschagehlich has joined the channel [22:35] almay has joined the channel [22:37] Opaque: Redis would probably be closer. I'm going to use Dotcloud so I guess they might use instances in the same server zone. [22:38] Opaque: and I don't think I can really stress test it with my mbp. it's cpu intensive for video rendering. [22:39] unomi: cpu intensive on the server? [22:39] Opaque: Sorry. I'm sure you meant simulate queries and not actual http requests. Any directions for doing such a test? [22:40] hybsch has left the channel [22:40] unomi: actually, I did mean http requests, with logging on the read / write calls [22:40] unomi: its hard to *know* where your bottlenecks lie without starting there [22:41] Opaque: Hmm. yeah. I feel a bit ridiculous worrying about optimization. I'll check it out. Thanks unomi. [22:41] unomi: Hope I helped in some way [22:42] Ratty_ has joined the channel [22:42] mscdex: node.js rules! [22:42] unomi: all the way! [22:42] Ratty_: Can npm install directly from a git repo? [22:43] pyrotechnick has joined the channel [22:43] Opaque: hey while I'm here, any reason csrf protection is not directly included in expressJs? seems like a key feature. [22:44] tjholowaychuk: https://github.com/hanssonlarsson/express-csrf [22:44] tjholowaychuk: (havent used that one) [22:44] tjholowaychuk: we have our own [22:45] xeodox: Anybody used Mongoose here before? Need help with somehting simple :) [22:45] tjholowaychuk: Opaque: nvm dont use that yet it has a bug [22:45] tjholowaychuk: haha [22:45] tjholowaychuk: looking at the code [22:46] Opaque: tjholowaychuk: you said you had your own? [22:46] xeodox: Let's say I have a object called "house". house.rooms.push({size:3, name: "bedroom"}); house.save(); ....how do I get the ObjectId of the new room I just pushed into house? (room is an embedded document) [22:46] tjholowaychuk: yeah it's not OSS though just in our app [22:46] tjholowaychuk: not hard to implement [22:47] tjholowaychuk: if anything this is better off as a connect middleware [22:47] tjholowaychuk: optional like the rest [22:48] bbttxu has joined the channel [22:48] p_nitsch has joined the channel [22:50] stagas has joined the channel [22:50] marcello3d has joined the channel [22:51] ericnakagawa has joined the channel [22:51] kmiyashiro has joined the channel [22:53] xeodox: Nevermind, I got it. [22:53] demastrie has joined the channel [22:54] tilgovi_ has joined the channel [22:54] tilgovi_ has joined the channel [22:54] aconbere has joined the channel [22:55] muk_mb has joined the channel [22:57] caolanm has joined the channel [22:57] kollektiv has joined the channel [22:57] dambalah has left the channel [22:57] mikeal has joined the channel [22:58] kollektiv` has joined the channel [22:59] tim_smart: Hmm how do I use node-fake with the process object (within node-microtest) [22:59] tim_smart: I guess Felix is sleeping :) [23:03] niftylettuce has joined the channel [23:03] mraleph has joined the channel [23:03] zackattack has joined the channel [23:06] edude03 has joined the channel [23:07] justinTNT has joined the channel [23:08] zackattack has joined the channel [23:12] justinTNT: lo [23:12] kollektiv has joined the channel [23:12] kollektiv has joined the channel [23:14] bwinton has joined the channel [23:14] tilgovi has joined the channel [23:14] tilgovi has joined the channel [23:17] ChrisPartridge has joined the channel [23:18] pifantastic has joined the channel [23:18] systemfault has joined the channel [23:18] systemfault has joined the channel [23:19] p_nitsch_ has joined the channel [23:19] Jamool has joined the channel [23:20] azeroth_ has joined the channel [23:20] lightcap has joined the channel [23:23] newy_ has joined the channel [23:26] IndividualRich has joined the channel [23:26] siculars has joined the channel [23:29] maushu_ has joined the channel [23:29] timmywil has joined the channel [23:30] hink has joined the channel [23:30] gsmcwhirter has joined the channel [23:32] gsmcwhirter: hey all. I've scanned the node modules list, but can't seem to find one, so is anyone aware of a good data validation module? [23:33] sechrist has joined the channel [23:33] Corren has joined the channel [23:35] ericnakagawa has joined the channel [23:37] thomblake has left the channel [23:37] muk_mb has joined the channel [23:37] LowValueTarget has joined the channel [23:39] cloudhead has joined the channel [23:43] vikstrous has joined the channel [23:44] gtramont1na has joined the channel [23:44] Rhys has joined the channel [23:46] bene has joined the channel [23:48] hink has joined the channel [23:48] fljitovak has joined the channel [23:48] MikhX has joined the channel [23:50] kmiyashiro: anyone know how to implement connect.basicAuth in Express? [23:50] tjholowaychuk: it takes a few different forms [23:50] tjholowaychuk: user/pass [23:50] tjholowaychuk: callback [23:50] tjholowaychuk: or callback with a callback [23:50] tjholowaychuk: haha [23:51] tjholowaychuk: kmiyashiro: http://senchalabs.github.com/connect/middleware-basicAuth.html [23:51] kmiyashiro: yeah I'm looking at that [23:51] kmiyashiro: don't really get it [23:51] tjholowaychuk: what's not to get [23:52] chapel: tjholowaychuk: how would you route all urls to /? [23:52] kmiyashiro: are those three different ways? [23:52] chapel: use a redirect? [23:52] tjholowaychuk: chapel: yeah [23:52] chapel: k [23:52] tjholowaychuk: kmiyashiro: yeah [23:52] kmiyashiro: what's the difference between them? [23:52] mikeal has joined the channel [23:52] kmiyashiro: do they go in a route? [23:52] tjholowaychuk: one is 100% static, one is sync, one is async [23:54] tilgovi has joined the channel [23:54] tilgovi has joined the channel [23:54] ezmobius has joined the channel [23:54] vikstrous has joined the channel [23:54] deepthawtz has joined the channel [23:55] kmiyashiro: like this? function httpAuth(req, res, next) { [23:55] kmiyashiro: app.basicAuth('username', 'secret'); [23:55] kmiyashiro: } [23:55] kmiyashiro: if app is express [23:55] tjholowaychuk: well no it's middleware like anything else [23:56] tjholowaychuk: app.use(express.basicAuth(...)) [23:56] eguest309 has joined the channel [23:57] sahn has joined the channel [23:57] samsonjs_ has joined the channel [23:57] kmiyashiro: oh I see [23:57] kmiyashiro: so you can't set it per route [23:57] tjholowaychuk: you could, not sure why you would be you could do [23:58] tjholowaychuk: express.basicAuth(callback)(req, res, next) within the route [23:58] tjholowaychuk: but that doesn't really make much sense [23:58] tjholowaychuk: for some middleware it does [23:59] [[zz]] has joined the channel [23:59] tilgovi has joined the channel [23:59] kmiyashiro: how does that work? [23:59] tilgovi has joined the channel [23:59] dcampano has joined the channel [23:59] kmiyashiro: blah()() [23:59] tjholowaychuk: function returning a function