[00:00] markq has joined the channel [00:00] cmr: barraponto: in the future you might check out nave or nvm [00:00] SubStack: MrBig: just pretend that node doesn't use javascript at all [00:00] cmr: barraponto: but that will get you going [00:00] SubStack: MrBig: and think of it like python or ruby on the backend [00:00] barraponto: cmr: nvm is equivalent of rvm? [00:00] flipen has joined the channel [00:01] cmr: barraponto: yes [00:01] nicholasf has joined the channel [00:01] MrBig: let me give you an example, i used SuperAgent, for some ajax magic, i was sharing it with a friend, but he does not use node js, i was looking at the libraries and it seems like it is too much "tied to" node js [00:01] cmr: barraponto: well, kinda [00:01] ePirat: how do i get a file on the web using node? tried http.get and concating data until receiving 'end' but then i have newlines where before weren't ones... [00:01] cmr: barraponto: nave is closer to rvm, most directly equivalent to python's virtualenv [00:01] jesusabdullah: who wrote nave again? [00:02] jesusabdullah: isaac? [00:02] SubStack: MrBig: I don't know what that is but it's an issue with that library and not node [00:02] cmr: Yeah [00:02] barraponto: i'm used to both rvm and virtualenv [00:02] jesusabdullah: I'm using nvm right now but I want to get nave rollin' instead [00:02] barraponto: didnt get the difference between nave and nvm [00:03] isaacs: jesusabdullah: yes? [00:03] isaacs: jesusabdullah: oh, right, yes. i did. [00:03] isaacs: https://gist.github.com/1613485 [00:03] koo3 has joined the channel [00:03] callen: jesusabdullah: they missed a real opportunity there. [00:03] callen: jesusabdullah: should've named it knave. [00:03] xbayrockx has joined the channel [00:03] xbayrockx: hey [00:04] xbayrockx: So socket.io is a library for node.js? [00:04] jesusabdullah: isaacs: I agree, shit's whack [00:04] jesusabdullah: xbayrockx: Yes [00:04] jesusabdullah: xbayrockx: There's also a client-side library that's part of socket.io [00:04] MrBig: SubStack: yah off, i was just asking, because, well, super agent does the same that jquery does, but its much more clean, it doesn't look like it would need a node js backend, however looking at the libs it seems it requires it, i am messing up somewhere, its at github.com/visionmedia/superagent its by the same guy that made express framework [00:04] jesusabdullah: like, it's two parts [00:05] xbayrockx: Ok I see, I'm looking at Heroku for free web hosting, however it says that Websockets aren't supported. This website was suppose to support node.js, I don't get it? [00:05] MrBig: damn autocompletion lol, messing up all my text [00:05] jesusabdullah: What's not to get? They support node but not websockets [00:05] cmr: isaacs: Does it alert "here"? [00:05] xbayrockx: Hmm [00:05] xbayrockx: If I'm using Socket.IO I'll be using websockets, right ? [00:05] `3rdEden: no [00:06] `3rdEden: heroku is using a proxy infront of node.js [00:06] cmr: xbayrockx: socket.io has multiple transports. [00:06] `3rdEden: which kills te websockets [00:06] jesusabdullah: I think it returns "returning: there" [00:06] `3rdEden: so it will indeed use different transports there like cmr says [00:06] cmr: Ah, yes. [00:06] cmr: jesusabdullah: bad reading on my part [00:06] xbayrockx: Ok, I'm wanting to create a game in javascript, it needs to be realtime [00:06] jesusabdullah: http://wsping.jit.su just sayin' ;) [00:06] xbayrockx: Should I be using websockets? [00:06] ePirat: can anyone help me please? [00:06] `3rdEden: xbayrockx then get a other hosting [00:06] `3rdEden: go with nodejitsu.com [00:06] cmr: xbayrockx: If you want to [00:07] `3rdEden: or something else [00:07] cmr: xbayrockx: It's fine to use socket.io, it will fall back if websockets aren't available. [00:07] xbayrockx: fall back to what? [00:07] xbayrockx: I'm failing to understand the different transports I think [00:07] jesusabdullah: long polling, flash-based sockets, stuff like that [00:07] `3rdEden: http://socket.io will tell you everything [00:07] jesusabdullah: there are four or five of them in order [00:07] cmr: xbayrockx: it's like a polyfill [00:08] xbayrockx: So Websockets are the most desirable ? [00:08] `3rdEden: websockets, flashsocket, htmlfile, xhr-polling, jsonp-polling to be exact ;) [00:08] cmr: For realtime, of course [00:08] jesusabdullah: well, they're the most fastest yeah [00:08] xbayrockx: And that stuff is is behind the scenes? [00:08] cmr: Yes [00:08] xbayrockx: It just chooses, seamlessly, for me? [00:08] cmr: socket.io exports a single interface. [00:08] cmr: Yes [00:08] jesusabdullah: xbayrockx: shit yeah dude [00:08] mehlah has joined the channel [00:08] `3rdEden: abstract all the things [00:08] xbayrockx: I see, what's the difference in performance between Websocket and Adobe Flash Socket ? [00:08] isaacs: cmr: just commented, refresh the gist [00:08] xbayrockx: For realtime games [00:09] `3rdEden: flash sucks [00:09] `3rdEden: thats the difference [00:09] subbyyy has joined the channel [00:09] `3rdEden: + it takes time to initialize the plugin and flash connection [00:09] cmr: xbayrockx: never seen any profiling but I can't imagine more overhead than the network itself. [00:09] `3rdEden: so it's slower than other transports [00:09] cognominal_ has joined the channel [00:09] xbayrockx: Ok [00:09] cmr: (after initialization, of course) [00:09] xbayrockx: Are you talking, initial delay, higher pings, less bandwidth [00:09] xbayrockx: or what [00:09] `3rdEden: after it's initialized, there isn't a big difference anymore [00:09] sdwrage has joined the channel [00:10] xbayrockx: Cool, so initialization takes how long ? [00:10] cmr: Can't imagine it'd take more than a few seconds [00:10] `3rdEden: several seconds [00:10] xbayrockx: I also noticed nodejitsu is private beta, [00:10] `3rdEden: just go to #nodejitsu and ask for activation [00:11] cmr: isaacs: that is very broken. [00:11] cmr: ACTION goes to read the spec after finishing his food [00:11] xbayrockx: So actually, I could just use any webhost provider, because it would just end up using AJAZ long polling ? [00:12] callen: jazz hands? [00:12] callen: ACTION waves hands wildly [00:12] `3rdEden: xbayrockx no... [00:13] `3rdEden: just pick a hosting that doesn't use a proxy infront of their node applications that kills the websocket connections [00:13] `3rdEden: normal and decent web hosting services don't do that [00:13] xbayrockx: I see [00:13] jesusabdullah: xbayrockx: Didn't you see my sweet websocket demo? XD [00:13] sdwrage has joined the channel [00:13] xbayrockx: But the webhosting provider must support node.js, correct? [00:13] xbayrockx: No, please show [00:13] `3rdEden: yes. [00:13] jesusabdullah: http://wsping.jit.su [00:14] xbayrockx: Can I ask the purpose of putting a proxy infront of the node app [00:14] maletor has joined the channel [00:14] jesusabdullah: Well, think of it like this [00:14] jesusabdullah: suppose you have 1000 servers just chillin' on AWS [00:14] adrianmg has joined the channel [00:14] jesusabdullah: with numerical ip addresses [00:14] adrianmg has left the channel [00:14] jesusabdullah: and you want to be able to take a bunch of urls like [00:15] jesusabdullah: mySweetApp.heroku.com [00:15] jesusabdullah: and make it so that when people visit x.heroku.com it forwards to the right server [00:15] xbayrockx: oh i see [00:15] FIQ has joined the channel [00:15] jesusabdullah: hence, you put an http server in front that routes based on headers [00:15] jesusabdullah: at least, this is one way to do it [00:16] jesusabdullah: it's a common one at least [00:16] xbayrockx: I see [00:16] xbayrockx: So that means, without the proxy, what is the downfall ? [00:16] jesusabdullah: no nice url [00:17] xbayrockx: mk [00:17] IrishGringo has joined the channel [00:17] xbayrockx: can you give me an exampole [00:17] xbayrockx: example [00:17] jesusabdullah: well, like, when you go and deploy an app, you get back its url right? But if you don't have any way of connecting that url to the right app, you're kinda hosed right? [00:17] mattgifford has joined the channel [00:18] xbayrockx: Im new [00:18] jesusabdullah: unless all the server IPs are external, but then you're still gonna have to connect to 172.some.annoying.number [00:18] xbayrockx: So you mean [00:18] level09 has joined the channel [00:18] xbayrockx: I host a game, there are many game servers, say 10 [00:18] jesusabdullah: You have one server, but heroku probably has thousands [00:18] xbayrockx: 1.gameserver.webhost.com 2.gameserver.webhost.com [00:18] jesusabdullah: each with someone else's app on it [00:18] xbayrockx: yah ? [00:19] jesusabdullah: What happens is that *.webhost.com is on an external ip [00:19] jesusabdullah: hooked into the dns system [00:19] mattgifford has joined the channel [00:19] jesusabdullah: or maybe a few ip's, you can have multiple balancers [00:19] jesusabdullah: anyways [00:19] xbayrockx: Ok, but that kills the websocket [00:19] jesusabdullah: no [00:19] jesusabdullah: only if your proxy sucks [00:19] xbayrockx: oh [00:19] jesusabdullah: some proxies don't kill websockets [00:19] sdwrage has joined the channel [00:19] jesusabdullah: like the one nodejitsu users [00:19] jesusabdullah: works with websockets [00:20] jesusabdullah: which is why that demo said "websockets" and didn't have 200+ms pingtimes [00:20] jesusabdullah: other proxies just don't support websockets cause they're kinda new [00:20] jesusabdullah: anyways [00:21] xbayrockx: I see [00:21] xbayrockx: Cool [00:21] xbayrockx: Your websocket [00:21] xbayrockx: Has 280ms [00:21] xbayrockx: Is that to me? [00:21] xbayrockx: im from aus so [00:22] jesusabdullah: yeah, that would make sense [00:22] jesusabdullah: if you're farther from the servers [00:22] jesusabdullah: I'm on US west coast so probably pretty close physically [00:22] jesusabdullah: My linode is in Fremont, just a few tens of miles away [00:22] xbayrockx: is there source for your example [00:22] shanebo: jesusabdullah, a friend and I are using the nodejitsu proxy and are wondering what latency, in general, it adds? [00:23] shanebo: jesusabdullah on some occasions we're seeing it quadruple response times. [00:23] disappearedng: Hey I wrote a game that involves multiple users on node. I am done writing the logic part and I am writing the front end code on the front end now (which will be rendered by rails). Aside from having multiple windows to simulate an actual game environment, what other strategies can I do? (Bots? Fake users?) Any advise? [00:23] jesusabdullah: xbayrockx: Not for that particular one, as it's just a proof that websockets work [00:23] hackband has joined the channel [00:23] jesusabdullah: xbayrockx: but I do have a deployable socket.io example kicking around [00:23] xbayrockx: Can I see your source? [00:24] xbayrockx: by the way, how does that prove websockets work [00:24] jesusabdullah: shanebo: I haven't heard of it adding ridiculous latency times. I mean, my impression is that it's pretty fast [00:24] xbayrockx: couldnt it just be using like AJAX long polling ?> [00:24] xbayrockx: that node.js fell back on to ? [00:24] jesusabdullah: xbayrockx: If they didn't work it would say "xhr longpolling" [00:24] jesusabdullah: I actually check the transport [00:24] rurufufuss has joined the channel [00:24] xbayrockx: ok [00:24] jesusabdullah: In the past, I actually disabled the other transports [00:25] jesusabdullah: xbayrockx: https://github.com/nodeapps/boilerplates/tree/master/socket.io [00:28] sotosof has joined the channel [00:29] mightym: hey guys I'm new to node.js, can someone tell me why my jade templates seem to be cached? i have variable which should change, but it doesn't. someone a hint for me? [00:30] mightym: i reload doesn't have any effect, just login out an reaccess the page [00:31] jesusabdullah: mightym: that's express behavior. Look into convincing it to work in "development" mode instead of in "production" mode [00:31] [[zz]] has joined the channel [00:31] jesusabdullah: That's my suggestion [00:31] cmr: xbayrockx: If you make a game server, it means if you are running multiple nodes, you need to connect to an individual node instead of thrwoing a load balancer in front of it. [00:32] cmr: (Which would be your most common use case, I'd think) [00:34] michaelhartau has joined the channel [00:34] mightym: jesusabdullah: you mean it doesn't matter deploying on production oder development? [00:35] flipen has joined the channel [00:35] jesusabdullah: no, what I'm saying is that it *does* matter. Production mode includes a bunch of caching for perf reasons while dev mode doesn't cache so you can see changes right away [00:36] insin has joined the channel [00:36] irclogger_com has joined the channel [00:36] aaronmcadam has joined the channel [00:36] nibblebot has joined the channel [00:37] indexzero has joined the channel [00:37] zemanel has joined the channel [00:37] mightym: jesusabdullah: hmm, ok ill read about it, thx a lot for your help [00:37] jhbot: 'installing node.js on dedicated server' by mcgrailm http://stackoverflow.com/q/8866638 (tags: linux) [00:37] wycats has joined the channel [00:37] Urk has left the channel [00:38] dnyy has joined the channel [00:38] SubStack: mc: I updated the example on the bouncy readme to catch all the error conditions [00:38] jhbot: 'Validating a JWT in node.js' by ConfusedNoob http://stackoverflow.com/q/8866648 (tags: javascript, authentication, base64, jwt) [00:38] mc: SubStack: nice, thanks. i'll take a look right now [00:40] spathi has joined the channel [00:44] nibblebot has joined the channel [00:45] Me1000 has joined the channel [00:46] adrianF has joined the channel [00:46] level09 has joined the channel [00:46] sotosof has left the channel [00:46] infynyxx has joined the channel [00:47] koo3 has joined the channel [00:47] aslant has joined the channel [00:47] sotosof has joined the channel [00:48] myndzi has joined the channel [00:48] larsschenk has joined the channel [00:52] callen: mc: I...have a problem. [00:52] callen: mc: I'm back to where I was with node.js, but on the front-end. [00:52] callen: mc: not even sure how I got here. [00:52] mc: what's the problem? [00:52] callen: doing an array.forEach, with a $.getJSON inside of it. [00:53] callen: non-sequential behavior. [00:54] callen: $.map doesn't change the behavior [00:54] callen: fml [00:54] jesusabdullah: callen: You might like the articles here http://docs.jit.su/articles/getting-started/control-flow/how-to-write-asynchronous-code [00:54] callen: now's not the time. [00:54] callen: we've gone over this. [00:54] ryanrolds: That's doing an XHR isn't? [00:54] callen: yes. [00:54] jesusabdullah: what do you mean, "that's no tthe time" [00:54] callen: jesusabdullah: DEADLINE [00:54] ryanrolds: You can't count on requests coming back in a partiuclar orlder. [00:54] ryanrolds: *order [00:55] callen: I can sort the data when the requests are done coming back [00:55] jesusabdullah: "oh man I need help writing async code" "here's some help writing async code" "that doesn't magically solve my problem at ALL!" [00:55] jesusabdullah: just man up and do your homework dude [00:55] callen: okay. [00:55] callen: this isn't a question of effort [00:55] callen: or doing homework [00:55] niftylettuce: jesusabdullah: lol... [00:55] insin: heh [00:56] niftylettuce: THIS IS MADNESS! [00:56] jesusabdullah: callen: It's like anything else. You do some reading, you ask some questions, you learn how something works and THEN you apply it [00:56] callen: jesusabdullah: deadline. [00:56] insin: I think that's the first time I've ever encountered those words in that order, and I like it :D [00:56] callen: jesusabdullah: how many times do I need to say it? I don't have time. [00:56] jesusabdullah: callen: I understand deadlines but there's no fucking short cuts for this shit [00:56] ryanrolds: jesusabdullah, more like maxojesus. [00:56] callen: jesusabdullah: I have to simply FINISH this in time, and I can review my approach later. [00:56] callen: jesusabdullah: yes there fucking are, this isn't a real project! [00:56] callen: jesusabdullah: it simply needs to be done and be working! [00:56] jesusabdullah: A deadline doesn't mean you can button-mash your way out of things [00:57] callen: it's not a real project, who gives a fuck? [00:57] callen: it accomplishes nothing for no one. [00:57] jesusabdullah: if it's not a real project then why do you give a fuck about the deadline? [00:57] cmr: callen: then use synchronous xhr [00:57] callen: I'm just trying to get this fucking thing out the door. [00:57] callen: cmr: thank god a real answer. I'll investigate accordingly. [00:57] ryanrolds: Oh god, cmr. [00:57] joshfinnie has joined the channel [00:57] bicranial has joined the channel [00:57] markq: that was awesome lol [00:58] cmr: callen: have fun with your massive interface freezes though [00:58] cmr: There's a reason things are async [00:58] ryanrolds: callen: cmr isn't serious, that is an exceptionally bad fix for this problem. [00:59] cmr: s/exceptionally/incredibly/ [00:59] mikl: can anyone help me understand why this gives me "TypeError: object is not a function at ChildProcess.CALL_NON_FUNCTION (native) at (codesample) 5:18: http://dpaste.de/Yv5sc/ [00:59] callen: ryanrolds: OTOH, it does work. [00:59] ryanrolds: It does, but it wrong. [01:00] jesusabdullah: mikl: Somewhere, you're probably reying to do the equivalent of ({})() [01:00] ryanrolds: *but it's wrong [01:00] niftylettuce: use the async sniffer to sniff the sync out of the sink while you drink [01:00] ryanrolds: Do not do it that way. [01:00] callen: wrong is the behavior of the code previously. [01:00] callen: now it works. [01:00] tomlion_ has joined the channel [01:00] mikl: jesusabdullah: as far as I can see, I'm using child_process.spawn exactly as in the docs :/ [01:01] callen: ryanrolds: okay, lets try it your way. [01:01] callen: ryanrolds: http://dpaste.de/CGNoc/ [01:01] jesusabdullah: found it [01:01] callen: ryanrolds: I no longer have the option of using node.js libraries like seq or async. [01:01] jesusabdullah: mikl: var spawn = require('child_process').spawn; [01:01] callen: ryanrolds: how do I make it do what I want? [01:01] jesusabdullah: mikl: You have, var spawn = require('child_process').spawn(); [01:01] jesusabdullah: meaning you already called "spawn" [01:01] cmr: callen: What is your end result? [01:01] jesusabdullah: without any arguments. [01:01] jesusabdullah: (whups!) [01:02] mikl: jesusabdullah: ah, yes [01:02] mikl: jesusabdullah: thank you :) [01:02] callen: cmr: a array of JSON blobs. [01:02] jesusabdullah: no prob [01:02] ryanrolds: Async work in the browser..... [01:02] ryanrolds: *works [01:02] context: http://campl.us/htpr [01:02] callen: cmr: I need to execute code when the map is done. [01:02] jesusabdullah: callen: callback? [01:02] callen: checking [01:02] ryanrolds: But, you can still solve the problem with out. You need to count the requests going out and count them coming in and wait until you get them all back or they timeout. [01:02] callen: the callback is what's executing [01:02] callen: it's not that simple [01:03] callen: I need code to execute after the HTTP requests are all done. [01:03] jesusabdullah: yeah, so another callback [01:03] dilvie has joined the channel [01:03] ryanrolds: *problem without async/seq/step. [01:03] ryanrolds: Yup. [01:03] callen: timing out and counting which ones have completed [01:03] cmr: Of course jQuery doesn't take a "all done now" callback.. [01:03] ryanrolds: This isn't a new problem. This is how it's always been with multiple XHR requests. [01:04] callen: so am I just invoking another function that runs a while loop and checks proposed tweets? [01:04] cmr: callen: No, use setTimeout [01:04] cmr: setInterval, sorry [01:04] cmr: while loop blocks [01:05] ryanrolds: callen: In the individual success/error callbacks for the xhrs de increment a counter and when the counter hits 0 do the big callback. [01:05] callen: okay but [01:05] callen: the gist of what I said is correct, no? [01:07] cmr: http://dpaste.de/Nqu4m/ or similar? [01:07] cmr: callen: (you should use gist, instead) [01:07] cmr: Although dpaste is decent [01:09] sotosof has left the channel [01:10] callen: cmr: that was a lot clearer than what I was headed towards, thank you. [01:10] xbayrockx: JESUS [01:10] xbayrockx: im not familiar with thje github [01:10] xbayrockx: of that site what do i need [01:10] jesusabdullah: for what? [01:11] jesusabdullah: also, github is actually Really Nice [01:11] jesusabdullah: I promise [01:11] cmr: Github is amazing [01:11] ryanrolds: Yeah, it's. [01:11] jesusabdullah: It has its flaws but it gets a lot of shit right [01:11] xbayrockx: whats it for ? [01:11] neurodrone has joined the channel [01:11] callen: cmr: that worked really really really well. [01:11] callen: cmr: thank you. [01:12] cmr: xbayrockx: Hosting your git repository and making using it with multiple people easy. [01:12] jesusabdullah: xbayrockx: here, check this out: http://github.com/jesusabdullah [01:12] jesusabdullah: These are all projects I've worked on [01:12] jesusabdullah: So they host the code so I can share it with people [01:12] jesusabdullah: including version control with git [01:12] jesusabdullah: (which is one of the better vcs's out there) [01:13] jesusabdullah: also has some sweet stuff for collaborative work [01:13] cmr: I don't think there is any better code hosts out there. [01:13] cmr: s/is/are/ [01:14] jesusabdullah: Yeah, I don't think so either [01:14] jesusabdullah: bitbucket looks nice [01:14] insin: ACTION switched to git pretty much just because of GitHub [01:14] cmr: I'd definitely pay money for it if they started charging. [01:14] cmr: ... don't tell them that ; [01:14] cmr: ) [01:14] jesusabdullah: I *do* pay money for a few closed source repos [01:14] jesusabdullah: only a few though [01:14] jesusabdullah: and their limits are way soft so [01:14] callen: cmr: they won't though, they're pretty dedicated to their public/closed charging model. [01:14] jesusabdullah: you can fudge it a bit [01:14] xbayrockx: so jesusabdullah, wheres your source code? [01:15] jesusabdullah: well xbayrockx, click a project [01:15] cmr: xbayrockx: click on any of the project tiles [01:15] napperjabber has joined the channel [01:15] xbayrockx: ah i see [01:15] jesusabdullah: Yeah, neat huh? [01:15] jesusabdullah: the most important thing github did right imo was making it so that the file tree and readme are the first things you see [01:15] xbayrockx: so i guess i need ot make a free web host account that supports node.js [01:15] jesusabdullah: virtually everyone else fucks this up [01:15] xbayrockx: can you recommend one [01:16] xbayrockx: i also need mysql, php [01:16] jesusabdullah: uhhh [01:16] jesusabdullah: you either want a vps from a place like linode, rackspace, whatever [01:16] jesusabdullah: or you want a PaaS or two [01:16] xbayrockx: cant have one already set up ? [01:16] jesusabdullah: and which one of THOSE you pick depends on what you need [01:16] cmr: xbayrockx: Nope. [01:16] cmr: xbayrockx: [01:16] cmr: (sorry) [01:16] xbayrockx: why not [01:17] jesusabdullah: dotcloud and heroku are doing the polyglot thing [01:17] xbayrockx: what is polyglot [01:17] jesusabdullah: >1 language [01:17] xbayrockx: such as? [01:17] jesusabdullah: like, I work for nodejitsu, and we specialize in node [01:17] [[zz]] has joined the channel [01:17] xbayrockx: heroku dont support websockets [01:17] cmr: So? [01:17] jesusabdullah: whereas heroku does rails and node and probably other languages as well [01:17] jesusabdullah: and dotcloud does like a dozen different platforms [01:17] cmr: Most browsers don't support websockets. [01:18] gkatsev: not true. [01:18] gkatsev: stable chrome and firefox support websockets [01:18] xbayrockx: I see, what do they mostly support then? [01:18] cmr: gkatsev: far from most [01:18] gkatsev: safari and opera support it but have it turned off [01:18] jesusabdullah: xbayrockx: not sure, I work for nodejitsu not for heroku [01:18] gkatsev: IE>9 support websockets, probably [01:19] cmr: Just because they are available doesn't mean people use them (though that situation is getting much better) [01:20] gkatsev: you can't use excuse that most browsers dont suppor them. [01:20] gkatsev: I mean, marketshare wise, possibly [01:20] gkatsev: but not browser number [01:20] xbayrockx: so jesusabdullah, what does nodejitsu do ? [01:21] xbayrockx: its web hosting that supports node.js right? what else, ? [01:21] indexzero has joined the channel [01:21] jesusabdullah: that's it! [01:21] jesusabdullah: We specialize in node.js [01:21] xbayrockx: what if you need database [01:21] xbayrockx: like mysql [01:21] jesusabdullah: get one from elsewhere, connect from outside [01:22] xbayrockx: isnt that slow ? [01:22] jesusabdullah: We have a built-in api for requisitioning nosql databases [01:22] jesusabdullah: that makes it way easy [01:22] jesusabdullah: not necessarily slow [01:22] jesusabdullah: depends on what kind of latency you need [01:22] cmr: gkatsev: market shares are the only thing that matter :). If you consider each version number a different browser (which they essentially are, just common codebase and branding) then far more don't support websockets (But that's a technicality) [01:22] jesusabdullah: irl systems use remote DBs all the time [01:22] xbayrockx: for a real time game [01:22] xbayrockx: that would be bas [01:22] xbayrockx: bad [01:22] gkatsev: cmr: firefox and chrome together are about half of the world browser marketshare. [01:22] jesusabdullah: not necessarily xbayrockx [01:23] jesusabdullah: I mean, is the distance between your servers *really* your bottleneck? [01:23] jesusabdullah: or rather, between your servers and your redis? [01:23] cmr: gkatsev: Chrome sure, has something like 20% I think. But firefox, which version? My mother was still using 3.6 until I educated her. [01:23] jesusabdullah: Plus, if you're smart about it you can get them pretty close physically [01:23] jesusabdullah: but yeah, welcome to the cloud [01:23] gkatsev: cmr: chrome and ff have like 25% each. [01:23] Aliv3_ has joined the channel [01:23] gkatsev: let me find the stats [01:24] cmr: xbayrockx: "Free web hosting" as you think of it (Cpanel and all that) really, really sucks. For what you want, you definitely want a VPS. [01:24] Aliv3_: hey so I do fs.syncFileRead(file) how do i convert that into text [01:24] jesusabdullah: What's cpanel? [01:24] cmr: jesusabdullah: crappy frontend to bunches of tools, lets you do configuring of things from a web interface. [01:24] jesusabdullah: I never really wasted any time with the free web hosting after the geocites era [01:24] gsmcwhirter: Aliv3_: fs.syncFileRead(file, "utf8") will give you a utf8 encoded string of the contents [01:25] Aliv3_: thanks [01:25] gsmcwhirter: Aliv3_: and it is fs.readFileSync [01:25] langworthy has joined the channel [01:25] gkatsev: cmr: http://gs.statcounter.com/#browser-ww-monthly-201101-201112 unfortunately, that doesn't specify which firefox [01:25] Aliv3_: yeah sorry i was using right function in my console just not irc, and thanks for extra utf8 param. [01:26] xbayrockx: i see [01:26] xbayrockx: does that mean you can put whatever you want on it ? [01:26] cmr: Of course. [01:26] blueadept has joined the channel [01:26] gsmcwhirter: Aliv3_: np. You can also use 'ascii' and some other values there to specify the encoding. when you don't specify it, you get a buffer [01:26] xbayrockx: is there anything like that freE? [01:26] plutoniix has joined the channel [01:26] cmr: There are pretty good cheap VPS's, or you can try out amazon's AWS (free for a year, some restrictions reply) [01:27] gkatsev: prgmr.com is cheap and so is 2host [01:27] Aliv3_: you know how if i do FileRead i use a function for a second parameter, and it gives error for first and data for second, how do I catch errors with that? try{}catch(ex){} ? [01:27] astropirate has joined the channel [01:27] mc: hostigation is good [01:27] cmr: gkatsev: Hah, "We don't assume you are stupid." is a great tagline [01:27] mc: i've been really happy with buyvm, but waiting for their stock is like waiting for an ice age [01:28] mc: hostigation is $20/year for a 128mb VPS [01:28] mc: buyvm is $15/year [01:28] gkatsev: cmr: heh, yes. [01:28] gsmcwhirter: Aliv3_: yeah. (just tried it to be sure) [01:29] Aliv3_: ok thanks gsmwhirter [01:32] jhbot: 'fs.WriteStream is just buffering' by luxun http://stackoverflow.com/q/8866887 [01:33] scott_gonzalez has joined the channel [01:33] Aliv3_: what http header do i need for raw data? [01:34] cmr: Aliv3_: define "raw". [01:34] Aliv3_: like binary mode [01:34] cmr: lolftp [01:34] SubStack: Aliv3_: usually for that you send data base64 encoded [01:35] SubStack: or just send it the usual way [01:35] Aliv3_: do i use application/octet-stream and base65? [01:35] Aliv3_: 64* thanks [01:35] Aliv3_: ok ill do that [01:35] indexzero has joined the channel [01:35] cmr: You can just use application/octet-stream [01:35] SubStack: well you have to actually send data in base64 if you set that header [01:35] Aliv3_: wait hu, so either application/octet-stream, or text/plain base64 [01:35] themiddleman has joined the channel [01:35] SubStack: yeah just do octet-stream unless it breaks [01:36] Aliv3_: ok [01:36] cmr: Aliv3_: (For the record that is a MIME type and not an HTTP header) [01:37] nodebiscut has joined the channel [01:39] mikeal has joined the channel [01:39] indexzero has joined the channel [01:39] cmr: isaacs: yeah you definitely read the spec right. That is so wrong. [01:39] cmr: That's not even really function, that's more like a goto. [01:39] Aliv3_: Content-Type, but so how do i encode a fs syncFileRead into base64 [01:40] nibblebot has joined the channel [01:41] Aliv3_: do i pass base64 instead of utf8? [01:42] jimt has joined the channel [01:42] brryant_ has joined the channel [01:43] cmr: TIAS [01:43] mattgifford has joined the channel [01:46] satyr has joined the channel [01:48] callen: mc: you're fucking awesome. [01:48] callen: cmr: you too. [01:48] callen: my project is nearly done now. [01:49] callen: I managed to not use any globals as well. [01:49] mc: glad to hear it [01:49] cmr: That's a plus [01:49] callen: cmr: the temptation was there, but once I got the hang of chaining the callbacks, I didn't need 'em. [01:49] mc: sometimes venting a bit and working around your limitations is the way to go [01:49] callen: well, if either of you are in the bay area, you're getting a drink on me. [01:49] cmr: callen: Wrapping your head around async is an important step to writing good code [01:49] callen: in fact, I'm even sure what else to add to this. [01:49] cmr: You should tackle that one sometime ;) [01:50] callen: and I still have time to work on it. [01:50] callen: cmr: just a different async paradigm. I come from the land of scheme continuations, and C libev. [01:50] mc: i'm a few states off unfortunately [01:50] cmr: Ah [01:50] callen: cmr: the way continuations and callbacks are done in Scheme are considerably different. I'm sure you can imagine how alien libevent/libev are in comparison. [01:50] cognominal has joined the channel [01:50] callen: mc: whenever dude. [01:51] carlyle has joined the channel [01:51] tkro has joined the channel [01:51] Aliv3_: yeah i figured it out thanks [01:51] cmr: Yeah, I've used libevent before. [01:52] Wizek-other has joined the channel [01:53] chrisvwebdev has joined the channel [01:53] chrisvwebdev: hello. i have a simple issue that i'm hoping to resolve here. [01:54] aslant has joined the channel [01:55] mikeal has joined the channel [01:55] chrisvwebdev: my http server file listens on port 8181. when i make a change to the http server file and restart node, i get an error. the error says: [01:55] chrisvwebdev: node.js:134 [01:55] chrisvwebdev: throw e; // process.nextTick error, or 'error' event on first tick [01:55] chrisvwebdev: ^ [01:55] chrisvwebdev: Error: EADDRINUSE, Address already in use [01:55] chrisvwebdev: at Server._doListen (net.js:1098:5) [01:55] chrisvwebdev: at net.js:1069:14 [01:55] chrisvwebdev: at Object.lookup (dns.js:153:45) [01:55] chrisvwebdev: at Server.listen (net.js:1063:20) [01:55] chrisvwebdev: at Object.startServer (/var/www/nodestuff/tinyapp/server.js:26:32) [01:55] chrisvwebdev: at Object. (/var/www/nodestuff/tinyapp/index.js:4:8) [01:55] chrisvwebdev: at Module._compile (module.js:404:26) [01:55] chrisvwebdev: at Object..js (module.js:410:10) [01:55] chrisvwebdev: at Module.load (module.js:336:31) [01:55] context: please [01:55] chrisvwebdev: at Function._load (module.js:297:12) [01:55] context: STOP PASTING HERE ! [01:55] callen: cmr: chrisvwebdev dude. [01:55] ryanrolds: Haha [01:55] callen: er [01:55] context: /topic LEARN HOW THE INTERNET WORKS [01:55] callen: chrisvwebdev: dude. what the fuck. [01:55] chrisvwebdev: sorry, : ) psted in the wrong input box [01:55] callen: my terminal is crying. [01:55] chrisvwebdev: my apologies [01:56] callen: CRYING [01:56] chrisvwebdev: i must ask for forgiveness ; ) [01:56] cmr: callen: stop using gnome-terminal, it's the only thing that would slow like that on a flood ;) [01:56] context: callen: better get a cleanex, you dont want those tears getting inside your computer [01:56] callen: cmr: s'not gnome-terminal, and I don't mean slow [01:56] callen: cmr: I just mean, the window was filled with his crap. [01:56] callen: I had to clear the irssi. [01:57] callen: cmr: rxvt-unicode and xfce4-terminal are what I usually use. [01:57] cmr: urxvt++ [01:57] chrisvwebdev: ok, so know that we've established that i kinda suck....any way i can stop this error from happening? [01:57] cmr: chrisvwebdev: How are you stopping node? [01:58] callen: with a rifle named kill -9 [01:58] callen: bang bang [01:58] chrisvwebdev: pkill [01:58] callen: ^^ see? [01:58] tommyvyo has joined the channel [01:59] jakehow has joined the channel [01:59] ryanrolds: fg [01:59] ryanrolds: doh, wrong window. [01:59] chrisvwebdev: so, i'm here trying to find out the proper way to do this without generating the error when i update a js file and restarting node [01:59] boghog: I type important password in IRC sometimes like that [02:00] boghog: focus on mouseover is the devil [02:00] boghog: ..or not using key auth everywhere for ssh is [02:00] lz has joined the channel [02:00] callen: ryanrolds: whatcha foregrounding? :D [02:00] callen: boghog: I like focus on mouseover. [02:00] xbayrockx: are there any free vps sites? [02:01] callen: boghog: it's faster. my mouse being on something should instantly imply focus. [02:01] callen: xbayrockx: TANSTAAFL.com [02:01] xbayrockx: restrictions ? [02:01] callen: xbayrockx: they have great servers. [02:01] callen: xbayrockx: go check it out. [02:01] xbayrockx: homo. [02:01] boghog: I like it too, but everytime I have one of those typing-passwords-on-irc incidents I wonder if I should just turn it off [02:01] callen: xbayrockx: do you know what TANSTAAFL means? [02:01] xbayrockx: no [02:01] callen: xbayrockx: there ain't no such thing as a free lunch. [02:01] Aliv3_: say i have a png how do i send the data of the png without setting the header for it, or even the file knowing its a png, alls i know is that its a binary file [02:02] xbayrockx: Yeah there is [02:02] xbayrockx: There's free web hosting [02:02] xbayrockx: What you call that? [02:02] cmr: "Shit" [02:02] jacobolus has joined the channel [02:04] hotchkiss has joined the channel [02:04] hotchkiss has left the channel [02:05] spathi has joined the channel [02:06] Aliv3_: free hosting as in how far [02:06] ziro` has joined the channel [02:06] Aliv3_: just file storage or domain or what [02:06] Aliv3_: anyways,so how do i transfer web binaries as specified [02:07] eneas has joined the channel [02:08] thalll has joined the channel [02:08] spathi^ has joined the channel [02:08] davv3_: Aliv3_: maybe set up a fileserver through node? [02:09] lisaqistina has joined the channel [02:09] hotchkiss has joined the channel [02:10] patcito has joined the channel [02:10] context: what are 'web binaries' [02:10] davv3_: still binaries i would assume [02:10] RobWC1 has joined the channel [02:10] jkridner has joined the channel [02:12] jhbot: 'Node.js: How to setup different variables for prod and staging' by donald http://stackoverflow.com/q/8867055 (tags: javascript, coffeescript, expressjs) [02:12] galaxywatcher has joined the channel [02:13] seejohnrun has joined the channel [02:14] Aliv3_: davv3_ what headers does an ftp give for files, don't they give proper ones for each extension? [02:15] tomlion has joined the channel [02:16] cmr: Aliv3_: FTP isn't HTTP [02:17] nibblebot has joined the channel [02:17] RobWC1 has joined the channel [02:17] context: aliv3_: ftp doesn't give headers [02:17] context: the client says 'download in ascii mode' or 'download in bin mode' [02:18] prettyrobots has joined the channel [02:18] tomlion_ has joined the channel [02:19] jacobolus has joined the channel [02:26] clarke2 has joined the channel [02:26] eneas has left the channel [02:29] clutchski has joined the channel [02:30] clutchski: hey all, anybody have any experience or favorite mongo client libraries? no ORM needed, just a good solid library. [02:32] willwhite has joined the channel [02:33] RobWC1 has left the channel [02:35] Wizek-other has joined the channel [02:35] zomg: clutchski: There is no such thing as ORM for mongo. Mongo is not a relational DB, thus you don't need object-relational mapping ;) [02:36] zomg: I've used Mongoose myself which has worked pretty well and has convenient features [02:36] shanebo: zomg, you can relate objects in mongo [02:36] cmr: Not to relations though [02:36] cmr: Well, not in the traditional sense at least. [02:37] seejohnrun: object relational, not relation relational, +1 shanebo [02:37] markq: is dbref the only way to "relate" stuff in mongo? [02:37] zomg: I think ODM (object document mapper) is a more suited term for databases like mongo [02:37] zomg: Of course I'm just nitpicking [02:37] zomg: =) [02:37] seejohnrun: object document mapper [02:37] seejohnrun: yes [02:38] seejohnrun: :) [02:38] clutchski: yes, that makes sense. I mean i don't need an object wrapper/mapper/etc. [02:38] seejohnrun: mongo library [02:38] markq: ? [02:39] seejohnrun: http://www.mongodb.org/display/DOCS/Drivers [02:39] seejohnrun: i'd look at their list of drivers [02:40] clutchski: yeah, i saw that, just curious if anyone had good experiences with any, since there's quite a few kicking around. [02:40] seejohnrun: ah nah, never tried mongo in node myself [02:40] seejohnrun: yeah i'm surprised at how long that list is [02:41] seejohnrun: i like how on the redis client list site they list them all but star ones that they like - would be nice if this list had some curation [02:41] spathi has joined the channel [02:41] shanebo: all dbs are painful in node IMO [02:41] shanebo: (shanebo ducks) [02:41] shanebo: it's analogous to juggling a hand grenade [02:41] joshfinnie has joined the channel [02:42] clutchski: no opinion yet. i'll get back to you in a month. [02:42] crickeys has joined the channel [02:43] crickeys: If I have a function that I created in node, when would node consider it to be asynchronous and when would it just return right away? [02:44] cmr: It is only asynchronous if you use setTimeout, setInterval, or any of the built-in async functions (AFAIK) [02:44] cmr: It returns normally when you tell it to [02:45] crickeys: cmr: are you familiar with socket.io? [02:45] cmr: crickeys: On a surface level [02:45] crickeys: so, on socket.io they have a Memory data store where you can do things like this: [02:45] soapyillusions has joined the channel [02:46] crickeys: socket.get("my_variable", function(err, my_variable){ // do whatever }) [02:46] khrome has joined the channel [02:46] cmr: Right. [02:46] crickeys: so, if I call 4 of those one after the other [02:47] crickeys: are they guaranteed to run in sequential order? [02:47] crickeys: because socket.get doesn't RETURN anything, it just executes a callback [02:48] brngardner has joined the channel [02:48] cmr: Looking at socket.io, it's synchronous [02:49] cmr: But don't trust me on that ;) [02:49] cmr: I think they present the async API for thins like the redis store. [02:50] ryanfitz has joined the channel [02:50] cmr: crickeys: Callback doesn't always mean asynchronous you know [02:50] blup has joined the channel [02:50] crickeys: right, I just didn't know how node treated that [02:51] cmr: Node doesn't work magic on functions, they have to work to make themselves async. [02:51] lz has joined the channel [02:51] crickeys: okay, must be a different bug then :) [02:52] cmr: crickeys: Don't rely on them be run sequentially though [02:52] cmr: Because socket.io might change and make them not. [02:52] crickeys: okay [02:52] crickeys: thanks [02:52] seejohnrun has left the channel [02:53] dmesg has joined the channel [02:53] sotosof has joined the channel [02:53] foobazr: Hi there, [02:53] foobazr: Hi there, I'm trying to use socket.io but node is telling me the module is not installed. However npm -ls is telling me something different. What's up with that? [02:54] charlenopires has joined the channel [02:54] cmr: foobazr: how are you requiring? Where is your program file, and where did you run npm? [02:54] foobazr: cmr: npm was run both locally and globally on the machine. Lemme pastebin [02:54] isaacs: cmr++ [02:54] catb0t: cmr now has 1 beer [02:54] isaacs: thanks [02:55] cmr: foobazr: ls -l will help [02:55] foobazr: cmr: Here is the code [02:56] foobazr: cmr: Here is the code http://pastebin.com/DjpbsPWJ [02:56] clutchski: crickeys: i think some promise libraries like Q, will always resolve their deferreds that are actually synchronous (like the memory store API that you're talking about) in a setTimeout(…, 0) so that you can't write code that accidentally works because the callback is synchronous and breaks if you swap in a async API. [02:56] khrome has joined the channel [02:56] clutchski: not 100% sure, but heard that in a presentation last week. [02:56] crickeys: interesting [02:57] clutchski: yeah, it's a neat idea. [02:58] cmr: foobazr: ls -l in the same directory as that file. [02:58] Wizek-other has joined the channel [02:59] jhbot: './configure --dest-cpu=x64 not setting correct target architecture on Mac OS 10.7' by Matt http://stackoverflow.com/q/8867241 (tags: osx, osx-lion) [02:59] foobazr: cmr: http://pastebin.com/me4X1ynF [02:59] yhahn1 has joined the channel [02:59] Karmaon has joined the channel [02:59] yhahn1 has left the channel [03:01] jkridner has joined the channel [03:01] cmr: foobazr: and "node server.js" fails? [03:02] foobazr: cmr: aye [03:03] foobazr: cmr: well that's a lie, it's working now. Thanks! [03:03] cmr: foobazr: :) [03:03] barraponto has joined the channel [03:03] barraponto: holy crap nave and nvm work together. it's like virtualenv + rvm! double rainbows omg! [03:04] halfhalo: double rainbows!!! [03:04] cmr: barraponto: what does rvm do differently than venv, exactly? [03:04] AntelopeSalad has joined the channel [03:04] meso has joined the channel [03:04] mike5w3c has joined the channel [03:05] barraponto: cmr: virtualenv creates environments, with variables, paths, packages [03:05] cmr: Right [03:05] cmr: rvm versions ruby itself? [03:05] barraponto: cmr: rvm creates gemsets (and changes the binary). [03:06] barraponto: rvm is like "let's see if my project works with this alternative set of packages" [03:06] barraponto: while virtualenv is "i'm going to work with project conquertheworld, let's setup the environment properly" [03:07] cmr: Nice [03:07] barraponto: using both (which is only possible with npm + nave) means you can setup your environment, then pick your packages. [03:07] isaacs: nave supports named envs now, too [03:07] barraponto: you can have a 'dev' package that exists only for project X. [03:08] isaacs: nave use someproject [03:08] isaacs: then pick the version of node to use, and it'll set up a separate global env for just that project. [03:08] barraponto: isaacs: do you recommend using npm with nave? or is it just double rainbows? [03:08] isaacs: barraponto: "JUST" double rainbows!?? [03:08] isaacs: what does that even MEAN? [03:08] alyx_ has joined the channel [03:08] barraponto: :D [03:08] isaacs: YES, it's double rainbows!! [03:08] isaacs: it's aMAZing!! [03:08] jesusabdullah: how can they be "JUST" double rainbows when it's "ALL THE WAY?" [03:09] barraponto: i already love working with node. i haven't even installled and its already double rainbows all the way! [03:11] SubStack: barraponto: if you get it, it's super great! [03:11] SubStack: not everybody gets it [03:13] barraponto: thats it [03:13] prettyrobots: join coffeescript [03:13] Me1000 has joined the channel [03:13] prettyrobots: Sorry. [03:14] nibblebot has joined the channel [03:15] Flushot has joined the channel [03:19] mattgifford has joined the channel [03:20] dgathright has joined the channel [03:20] jtsnow has joined the channel [03:21] samizdaaat has joined the channel [03:21] Registered has joined the channel [03:22] Registered: Hi [03:22] samizdaaat: Hi [03:23] jesusabdullah: prettyrobots: You're not my real dad! [03:24] Registered: Anyone try to build Node on Windows x64 ? [03:24] shinuza has joined the channel [03:25] hackband has joined the channel [03:25] cmr: ACTION wonders when x86-64 got demoted [03:26] Registered: demoted ? was it ever first class ? [03:26] jacobolus has joined the channel [03:27] cmr: x64 doesn't exist. [03:27] cmr: Not as an architecture, at least. [03:28] willwhite has joined the channel [03:28] Registered: but generally accepted as shorthand [03:29] Registered: MSVC target platform - x64 ;) [03:30] jerrysv has joined the channel [03:30] cmr: It's a windows version, not an architecture. [03:30] cmr: Either way, doesn't matter :) [03:31] bacon000 has joined the channel [03:31] Registered: :) - agreed. [03:31] shanebo has joined the channel [03:32] Registered: compilations issues are expected ? [03:33] mdel has joined the channel [03:33] dwhittle has joined the channel [03:35] markq: how can I have a default "cannot get" view in express? [03:35] markq: like a 404 [03:35] markq: how can I set one* [03:35] meso_ has joined the channel [03:36] khrome has joined the channel [03:37] Registered: set your last route to * [03:37] Registered: return 404 there [03:38] innociv has joined the channel [03:38] Registered: like this [03:38] Registered: app.get('/*', function(req, res) { throw new NotFound('Page not found.'); }); [03:38] markq: awesome! thanks :D [03:38] markq: let me add the error [03:39] rohitcolinrao has joined the channel [03:39] rohitcolinrao: has anyone used express with mustache? [03:40] ramkamx has joined the channel [03:40] markq: Registered: what does NotFound point to? [03:41] Registered: its an example - you should return your custom 404 in that case [03:41] carlyle has joined the channel [03:41] markq: ah i see [03:42] infynyxx has joined the channel [03:43] fomatin has joined the channel [03:43] innociv_ has joined the channel [03:43] Registered: markq: maybe you would have - res.render('404'); - instead [03:45] wizonesolutions has joined the channel [03:45] dr0id has joined the channel [03:47] innociv__ has joined the channel [03:49] limeblack has joined the channel [03:50] austin has joined the channel [03:50] satyr has joined the channel [03:51] agnat_ has joined the channel [03:54] rohitcolinrao: is it possible to use express to render .html files as views instead of a templating engine file? (jade, etc) [03:55] markq: why would you want that [03:56] rohitcolinrao: i'm trying to get rid of templating on the server side and use backbone and mustache/icanhaz to template on the client side [03:56] Aria has joined the channel [03:56] rohitcolinrao: doing things like adding