[00:00] thetony: if you copy and change the setInterval to setInterval("foo()"... then it will actually change to bye cruel world etc [00:00] vpamulap has joined the channel [00:00] jesusabdullah: yessch [00:00] thetony: rlidwka: does node not? [00:00] cipher__: that last line was meant to be; }).Print(); [00:00] vpamulap: I want to replace the jsdom installed on my system via npm with a patched version on github, is there a good guide on how to do this? [00:01] SubStack: vpamulap: just put the github url in your package.json [00:01] crutex has joined the channel [00:01] crutex has joined the channel [00:01] SubStack: instead of the version in the dependencies field put the url [00:01] rlidwka: seems like node does not :) there are no reason to support it because there are no 10-year-old-code for node.js [00:01] SubStack: "jsdom" : "http://github.com/..." [00:01] srk9 has joined the channel [00:01] RobWC has joined the channel [00:02] RobWC has left the channel [00:02] arduix has joined the channel [00:04] zackattack has joined the channel [00:04] cyphase has joined the channel [00:05] vpamulap: SubStack: thanks, so if i replace the jsdom dependecy in the zombie.js package.json, what command do I need to run to update it? [00:05] joshsmith has joined the channel [00:08] cjm has joined the channel [00:09] warz: substack, i remember you saying something about how you disliked the javascript amd loader stuff, like requirejs, for browser-side require, and that browserify is better? did i understand that correctly, in that i can use browserify as a replacement for requirejs? [00:09] seanstickle has joined the channel [00:09] EyePulp has joined the channel [00:10] xtianw has joined the channel [00:10] argami has joined the channel [00:10] mattgifford has joined the channel [00:10] lohkey has joined the channel [00:11] argami has joined the channel [00:11] qbert_: cipher__, see my IM [00:11] mattgifford has joined the channel [00:11] SubStack: warz: well I wrote browserify [00:11] SubStack: vpamulap: just do `npm install` and it'll fetch the latest things from your package.json [00:11] SubStack: or perhaps `npm install .` [00:11] vpamulap: so inside the zombie folder? [00:11] SubStack: warz: browserify lets you do require()s the node.js way in the browser [00:12] Aria has joined the channel [00:12] SubStack: requirejs is some other strange thing that makes you write require()s in a strange way [00:13] warz: yea, thats why im looking at alternatives. ive used requirejs before and id like to avoid it this time around, if possible [00:13] SubStack: warz: plus browserify shims out things like the path, url, vm, stream, and buffer modules so that you can take code written for node and actually run it browser-side [00:13] SubStack: I use some npm modules in my browser code [00:13] cburyta has joined the channel [00:14] vpamulap: SubStack: looks like it worked! thanks for your help [00:14] baudehlo has joined the channel [00:15] SubStack: warz: lately even the request module works browser-side without modification https://github.com/substack/request-browserify-example/blob/master/entry.js [00:16] Joeysomo has joined the channel [00:16] joshthecoder has joined the channel [00:17] Authoritarianism has joined the channel [00:17] warz: very cool [00:17] Authoritarianism has joined the channel [00:17] tilgovi has joined the channel [00:19] zivester has joined the channel [00:22] devongovett has joined the channel [00:22] MT has joined the channel [00:23] warz: do you know why people have created what look like shims for backbone and jquery, with browserify? [00:23] warz: i guess i can find out pretty easily if they're needed, myself. heh [00:24] SubStack: warz: because backbone and jquery attach themselves to the window object or use globals to export their functionality by default [00:24] SubStack: they aren't written to use module.exports [00:24] warz: ah [00:26] CloudGroup has joined the channel [00:27] JSONB has joined the channel [00:27] rdegges has joined the channel [00:27] Beticious has joined the channel [00:28] rdegges: Yo all! I've got a (hopefully) quick question. I'm extremely new to node, but I'm trying to publish a library on npm (code is here: https://github.com/telephonyresearch/node-opencnam). [00:28] rlidwka: requirejs is basically just async require... it doesn't needed on server but in the browser it's the only good way to use modules [00:28] timoxley: rlidwka "the only good way"? [00:28] maxogden: lolz [00:28] SubStack: rlidwka: I disagree. [00:29] rdegges: I made a package.json, ripping off most of the content from other node packages, I also did a ``node publish``. However, when I attempt to install my package (eg: ``npm install opencam``), I get this error: http://pastie.org/private/ssvbm8s1wwvhafxo5euyg [00:29] rdegges: I was wondering if any of you could tell me what I've done wrong? ^^ [00:30] Beticious: Play the free game of sports bet, you can win a PS3 or 50$ paypal tickets for free http://www.beticious.com/es/register?ref=Trece30 [00:30] Clordio has joined the channel [00:30] Clordio: Nodester is down :( [00:30] polardude has joined the channel [00:30] qbert_: rdegges, ENOENT is no file or directory found [00:30] rdegges: qbert_: any idea why I'd be getting it? I'm having a really hard time figuring this out. I'm completely noob here =/ [00:31] timoxley: rdegges post your package.json [00:31] rdegges: I don't even have a cli.js file anywhere, I can't figure out why it wants it. [00:31] rlidwka: well... you can pack 10k or 100k bytes into one javascript file. But when it'll be megabytes of modules async module loading will be really only one way :) Not all apps will reach this though [00:31] rdegges: It's all on my github: https://github.com/telephonyresearch/node-opencnam [00:31] timoxley: rdegges remove that bin entry [00:31] rdegges: timoxley: what should I change it to? :o [00:32] timoxley: rdegges just remvoe lines 22 to 24 [00:32] timoxley: rdegges it's not required [00:32] rdegges: :o [00:32] rdegges: oh whoop [00:32] SubStack: rlidwka: if you have to pull down megabytes of modules then you have to pull down megabytes of modules [00:32] timoxley: rdegges http://blog.nodejitsu.com/package-json-cheat-sheet [00:32] nerdfiles1 has joined the channel [00:32] rdegges: I copied my package.json from that guy's file. [00:32] SubStack: I don't see how async is going to save you [00:32] rdegges: I guess I forgot to remove that part >.> [00:32] SubStack: in fact, if you have lots of modules async is going to be way slower than bundling [00:32] timoxley: rdegges and `npm help json` [00:32] rdegges: I was staring at that for 30 minutes too, damn. [00:32] rdegges: timoxley: thanks a ton! I'll give this a go! [00:33] SubStack: since there's a round-trip for every async module fetch [00:33] SubStack: versus a single round-trip to get all the contents [00:34] polardude: After I register one user through mongoose-auth, I cannot create another user due to this error, "Someone already claimed that login." [00:34] polardude: The login is completely different from the original user registered [00:35] rdegges: timoxley: holy cow! I've just published my first working node package ^^ [00:35] timoxley: SubStack only problem with bundling is inability to do CDN caching [00:35] chadskidmore has joined the channel [00:35] timoxley: rdegges nice [00:35] rdegges: Thank you so much for your help! [00:35] argami_ has joined the channel [00:35] rdegges: This has been a really fun experience :) [00:35] timoxley: rdegges now… where are your tests? [00:35] timoxley: :P [00:35] cm has joined the channel [00:35] SubStack: timoxley: I've been thinking a little about an adaptive bundler using local storage [00:35] rdegges: Hah, I've gotta learn a JS unit testing framework first =p [00:35] polardude: Any ideas? [00:36] rdegges: timoxley: I'm a python/django guy, but I've been learning js / node, so this is my first project ^^ [00:36] rdegges: Haven't done __any__ js unit testing yet ^^ [00:36] SubStack: timoxley: still possible to get CDN-ish behavior with nice require()s [00:36] SubStack: see also http://browserify.nodejitsu.com/ [00:36] timoxley: SubStack what do you mean adaptive bundler? [00:37] SubStack: it could inspect which modules you already have in local storage and serve up a bundle that excludes those [00:37] localhost has joined the channel [00:37] agnat_ has joined the channel [00:38] admc has joined the channel [00:40] timoxley: SubStack ahh, that's a pretty sweet idea. I wonder if the rails guys are working on such a thing for their asset pipeline. Though sameorigin restriction with localstorage removes the CDN benefit for common libs [00:42] argami has joined the channel [00:42] shinuza has joined the channel [00:42] timoxley: This guy doing something similar http://addyosmani.github.com/basket.js/ [00:43] arduix has joined the channel [00:44] SubStack: timoxley: a script on the local domain could just send hashes to a cdn server with cors enabled [00:44] SubStack: over xhr [00:45] timoxley: ahh [00:45] SubStack: then it gets back the bundle of everything it doesn't have all in one go [00:45] timoxley: Funny that this issue didn't get solved years ago when people actually had serious bandwidth issues [00:46] maxogden: javascript is funny in general [00:46] timoxley: It seems pretty obvious [00:46] SubStack: maybe I'll build a browserify cdn on a whim some day [00:46] timoxley: SubStack do it. [00:46] maxogden has joined the channel [00:46] SubStack: but I have other things which are relevant to my present interests [00:47] timoxley: SubStack get an apprentice [00:47] Destos has joined the channel [00:47] qbert_: ... like taking over a small little known east european country [00:47] maxogden: GSoC substack edition [00:47] YoY has joined the channel [00:48] timoxley: +1 to that [00:48] SubStack: qbert_: like growing revenues for my business :p [00:48] Druid_ has joined the channel [00:48] SubStack: and releasing more products which are just crazy combinations of modules [00:48] mikeal has joined the channel [00:50] argami has joined the channel [00:50] qbert_: the cross browser testing business ? [00:50] qbert_: and what are these "products" you speak of :D ? [00:50] SubStack: so many products [00:51] jesusabdullah: speaking of browserify.jit.su: The code is incredistale but I would be more than happy to accept pull requests to update it! [00:51] SubStack: jesusabdullah: noted! [00:52] SubStack: I'm more thinking of exploring a different approach entirely though [00:52] jesusabdullah: sure [00:52] SubStack: but maybe adaptive bundling could work with the existing stack [00:52] jesusabdullah: I'd take it down except it seems like people like it it there [00:55] igl1 has joined the channel [00:55] ted_ has joined the channel [00:56] exchgr has joined the channel [00:58] tylerstalder has joined the channel [00:58] skeptic has joined the channel [00:58] k1ttty has joined the channel [00:59] Destos has joined the channel [01:00] rauchg has joined the channel [01:02] khrome has joined the channel [01:05] sreeix has joined the channel [01:07] cipher__: is gedit the only choice on linux for editing js? [01:09] mehale: cipher__: try vim [01:09] neoesque has joined the channel [01:09] microp11 has joined the channel [01:10] jetienne has joined the channel [01:11] take_cheeze has joined the channel [01:17] enmand has joined the channel [01:19] robhawkes has joined the channel [01:19] cha0s has joined the channel [01:19] exchgr: cipher__, try sublime text 2 [01:20] bradleymeck has joined the channel [01:20] exchgr: it's the best gui editor. [01:20] paulwe has joined the channel [01:21] WarheadsSE: try Komodo.. [01:21] WarheadsSE: :p [01:21] WarheadsSE: (yes its a pay product...ty work) [01:21] erichynds has joined the channel [01:23] cipher__: exchgr, segfault :O [01:23] exchgr: like it? [01:24] exchgr: oh i thought segfault was a user you were pinging lol [01:24] exchgr: what distro? [01:24] JmZ_ has joined the channel [01:24] johnmdonahue: is there any way to declare the listening port on an http(s).get/request? [01:24] postwait has joined the channel [01:25] jrundquist has joined the channel [01:25] willwhite has joined the channel [01:26] DijkstraGroupie has joined the channel [01:26] exchgr: cipher__ what distro are you on? [01:27] jrundquist has left the channel [01:27] scottdware has joined the channel [01:28] yuroyoro has joined the channel [01:30] chadskidmore has joined the channel [01:30] abraxas has joined the channel [01:31] apoc has joined the channel [01:32] pksunkara has joined the channel [01:33] brianseeders has joined the channel [01:37] timoxley: cipher__ +1 vim. gvim good if you're used to a gui. [01:38] timoxley: johnmdonahue server.listen(port) where server is a http(s) server should do it [01:38] bradleymeck has joined the channel [01:38] timoxley: johnmdonahue is that what you're asking? [01:39] johnmdonahue: timoxley: i'm trying to open a port with access through the firewall when needed. so i need to make an https.get request but over a specific port [01:39] johnmdonahue: i'm not sure what port that method uses by default [01:39] timoxley: johnmdonahue http://nodejs.org/docs/latest/api/all.html#all_http_get_options_callback [01:40] jgaui has joined the channel [01:40] orlandovftw has joined the channel [01:40] trepan has joined the channel [01:40] johnmdonahue: yeah I checked that out. I'm not trying to specify the remote port, but the port the request originates from. does that make sense? [01:41] johnmdonahue: i'm assuming it uses 443/80 to make the request? just trying to figure out a way to use a different port. [01:43] dekub has joined the channel [01:43] polardude has joined the channel [01:43] timoxley: johnmdonahue IMO if your firewall is blocking 80/443 you've got bigger problems. [01:44] konobi: normally on the client side a random port is chosen from [01:44] JimRoepcke has joined the channel [01:45] johnmdonahue: timoxley: maybe so, it's an internal app for use in house, but i need a way to hit external api's somehow [01:45] johnmdonahue: w/o exposing 80/443 [01:46] konobi: unless you have an insanely restrictive firewall it will just work [01:46] timoxley: johnmdonahue you could try using a proxy https://github.com/nodejitsu/node-http-proxy [01:46] kickingvegas has left the channel [01:47] adamkittelson has joined the channel [01:48] johnmdonahue: yeah i'm actually using that already as a proxy server to sit in front of several internal apps. I'll see if i can work that out for this as well. it's getting messy. ;) may need to take a step back and reconsider the setup thanks [01:49] konobi: johnmdonahue: just because you "use" a port in a client doesn't mean it's "open" for listening [01:49] johnmdonahue: but it would need to be to receive the API response no? [01:49] konobi: no [01:49] johnmdonahue: oh! [01:50] konobi: by default your browser will use random ports to connect to websites [01:50] konobi: src port does not have to match dest port [01:51] Aria has joined the channel [01:52] johnmdonahue: so the same is true server side? node uses random ports to make requests? [01:52] konobi: yes [01:53] yhpark has joined the channel [01:53] Hebo has joined the channel [01:54] ioscale has joined the channel [01:54] johnmdonahue: and if the server is not publicly accessible except from within the local network is there some way to make requests through w/o opening a port? [01:54] johnmdonahue: sorry iguess i should say it's locked down on the iptables level. I'm no sys admin so this is new to me [01:55] thetony: if your server is listening on a port and that is the only way, then no [01:56] mikeal has joined the channel [01:56] konobi: johnmdonahue: time to brush up on TCP/IP =0) [01:57] johnmdonahue: konobi: i have a lot to learn! thanks [01:57] konobi: (actually the CCNA book is a good starter) [01:57] zdk has joined the channel [01:57] johnmdonahue: nice i'll check it out [01:57] Init--WithStyle- has joined the channel [01:58] timoxley: konobi you mean http://www.amazon.com/CCNA-Cisco-Certified-Network-Associate/dp/0782126472 ? [01:58] Init--WithStyle-: Hey guys, I have an express server test running.. just curious what the "#" in could mean in my chat.ejs file :) [01:59] Init--WithStyle-: Is it referring to the enclosing file or something? [01:59] scottdware: my guess is that it's just a dead link? [01:59] thetony: Init--WithStyle-: it's a document link - that one means don't do anything when you click the a [02:00] k1ttty_ has joined the channel [02:00] eduardostalinho has joined the channel [02:00] Init--WithStyle-: So it's basically just a blank "do-nothing" link? [02:00] johnmdonahue: timoxley konobi thetony Thanks for the help! [02:00] Init--WithStyle-: that doesn't throw an error? [02:00] thetony: yea [02:00] Init--WithStyle-: ok that makes sense since on click a script creates an iFrame anyways [02:00] infynyxx_ has joined the channel [02:00] Init--WithStyle-: thanks thetony [02:01] thetony: np, and no - to your browser it's just an attribute to an html tag [02:01] erujolc has joined the channel [02:01] Karmaon has joined the channel [02:02] infynyxx has joined the channel [02:02] mcluskydodallas has joined the channel [02:02] andrewpthorp has joined the channel [02:03] andrewpthorp: Hi! How do I develop locally with a command line utility? "npm link my-tool" doesn't install the CLI, and I can't do -g with npm link [02:04] sawgij has joined the channel [02:04] mikeal has joined the channel [02:05] HacDan_ has joined the channel [02:05] thetony: andrewpthorp: just create local js files and then do node [02:06] thetony: the more common cli editors are vim and emacs, vim is obviously far superior [02:06] andrewpthorp: ohhh nm [02:06] konobi: timoxley: not sure.. my copy is about 10 years old now [02:06] andrewpthorp: I got you, I can execute the CLI directly from node [02:06] andrewpthorp: Awesome, thanks! [02:06] zanefactory has joined the channel [02:07] timoxley: konobi they were selling used copies for around $4, figured can't hurt to get one [02:07] thetony: timoxley: that be the one [02:07] konobi: mine was an official one that i got during doing the ccna course [02:07] timoxley: ooo [02:07] ctp6360 has joined the channel [02:07] thetony: timoxley: my mistake - that is not the one [02:07] timoxley: thetony dang. can you tell me the one [02:09] thetony: looking, give me a minute [02:10] aconbere has joined the channel [02:11] CIA-19: node: 03Nathan Rajlich 07master * r698e795 10/ (lib/_debugger.js src/node.js): [02:11] CIA-19: node: repl: fix 'terminal' mode autodetection on global repls [02:11] CIA-19: node: Fixes test/simple/test-force-repl.js - http://git.io/SwIEEQ [02:11] thetony: timoxley: http://www.amazon.com/640-802-Official-Library-Updated-Edition/dp/158720438X/ref=sr_1_1?s=books&ie=UTF8&qid=1332814217&sr=1-1 [02:12] timoxley: thetony dang. they;re not selling for $4 [02:12] jetienne has joined the channel [02:13] thetony: timoxley: nah, 32$. it's probably overkill if you just want to use a socket once [02:13] thetony: http://www.faqs.org/rfcs/rfc1180.html [02:13] jgornick has joined the channel [02:14] timoxley: thetony thanks [02:14] johnmdonahue: thetony: oh nice! thanks [02:14] Brandon_R has joined the channel [02:14] EhevuTov has joined the channel [02:16] HacDan_ has joined the channel [02:16] Brandon_R: hi guys [02:16] tlack: hows the node.js consulting market? [02:16] rurufufuss has joined the channel [02:16] Brandon_R: the node.js consulting market? [02:17] Brandon_R: you mean the mailing list :P [02:17] tlack: sorry, what? [02:17] nerdfiles1 has joined the channel [02:17] kejun has joined the channel [02:17] JSONB has joined the channel [02:17] evilnate has joined the channel [02:17] Brandon_R: there are always people around to help [02:18] tlack: i meant to consult for businesses that are interested in using node.js on their websites. :) [02:18] warz has joined the channel [02:18] warz has joined the channel [02:18] Emmanuel` has joined the channel [02:18] tlack has left the channel [02:18] tlack has joined the channel [02:18] jgautier has joined the channel [02:18] jgautier: any riak guys in here? [02:19] evilnate has joined the channel [02:20] aconbere has joined the channel [02:20] wolftankk has joined the channel [02:21] dshaw_ has joined the channel [02:21] Emmanuel` has joined the channel [02:22] eduardostalinho has joined the channel [02:23] konobi: tlack: pretty decent as far as i'm aware... but it seems quite systems orientated atm. [02:23] nicholas_ has joined the channel [02:23] pksunkara: can somebody ping me if tj comes online, please [02:23] pksunkara: thanks [02:24] orlandovftw has joined the channel [02:24] mikeal has joined the channel [02:25] Destos has joined the channel [02:26] Brandon_R: kk [02:26] sammmy has joined the channel [02:28] k1ttty has joined the channel [02:28] RORgasm has joined the channel [02:29] sammmy: If I'm displaying dynamic content (say a number from the database) on every page (in the header partial), do I have to call this information from the database before EVERY res.render I use? Or, is there a way to make this a helper, but one that changes on every request? [02:29] Aria: Either you have to be fetching it from the database periodically, at every request, or being notified when it changes. [02:30] evilnate: yyuuuppp [02:30] iangreenleaf has joined the channel [02:31] zackattack has joined the channel [02:33] mikeal has joined the channel [02:33] philips has joined the channel [02:34] dylang has joined the channel [02:34] bradleymeck has joined the channel [02:35] kejun has joined the channel [02:35] kvda has joined the channel [02:35] Brandon_R: h3y evilnate [02:35] Brandon_R: are you tootallnate? [02:36] TooTallNate: just an imposter ;) [02:38] itayneeman has joined the channel [02:39] dnolen has joined the channel [02:41] paul_ has joined the channel [02:41] itayneeman: Does anyone know why the https module will close a connection even though it should be waiting for a response (requesting using curl works fine) [02:41] sammmy: Aria: I just don't know how I would make a dynamic helper with what I want with Express 2.x [02:41] devongovett has joined the channel [02:42] duncanbeevers has joined the channel [02:43] sammmy: Aria: If I was using Express 3.x (I will once it's released), I could just use app.locals.use() and do an asynchronous call to the database. But, using Express 2.x I don't have this async support. Maybe I could do something similar in 2.x though? [02:44] meso has joined the channel [02:44] ctp6360 has joined the channel [02:45] Aria: You can always make async calls ... just don't write to the response until you have the data you need. [02:45] Brandon_R: i wonder how to read from the command line in c with libuv [02:45] Aria: (Ah, express -- you didn't mention that you were using it) [02:45] Aria: Brandon_R: argc? argv? Why use libuv for that? [02:45] kirbysayshi has joined the channel [02:45] Brandon_R: i just want to learn how the library works :P [02:46] Brandon_R: got it [02:46] Aria: Hehe. [02:46] Brandon_R: https://github.com/joyent/libuv/tree/master/src/win#L159 [02:47] Aria: Mmhm? [02:47] Brandon_R: https://github.com/joyent/libuv/blob/master/src/win/pipe.c#L159 [02:47] Brandon_R: but that's windows [02:47] smackdab has joined the channel [02:48] smackdab has left the channel [02:48] sammmy: Aria: I can make the async calls, which is what I'm doing now, but I have to repeat myself over and over again for everytime I render my templates..a royal pain. [02:48] Aria: What's that got to do with the commandline? [02:48] Aria: sammmy: So abstract it into a function. [02:48] sammmy: Aria: what do you mean? [02:49] Aria: Well, if you're repeating yourself, write a function that does it. Use that. [02:49] ksys has joined the channel [02:49] ksys: ll [02:49] sammmy: Aria: But then I'd have to use that function everytime aswell, which is also what I'm doing. [02:49] Aria: Brandon_R: What's that got to do with the command-line? That's code to read from a named pipe. [02:49] Aria: sammmy: Okay, and? (or configure middleware...) [02:49] sammmy: I'm wanting a way to make my local magically be there and update on every request. [02:49] sammmy: Maybe I could do some middleware then? [02:49] Brandon_R: i want the user to enter something in the command line and have the program read it [02:50] Brandon_R: i don't mean passed in as an argc but actually type something in the command line and press enter [02:50] Brandon_R: like cin >> var; [02:50] sammmy: Can I do app.locals.somelocal = 'whatever'; in a middleware? [02:50] nerdfiles1 has joined the channel [02:51] Aria: Probably. But I might use req.something instead. [02:52] TooTallNate: Brandon_R: take a look at uv.h [02:52] TooTallNate: that's the public stuff [02:52] Brandon_R: got it [02:52] Brandon_R: uv_tty_t [02:52] Brandon_R: libuv is probably one of the best libraries i have ever seen [02:53] Aria: Ah, yeah, you want either tty access, or to just read and write to stdin/stdout [02:53] Aria: Depending on whether you want human or pipe input. [02:53] Brandon_R: got it [02:54] Aria: (the c++ cin/cout are stdin/stdout, not tty) [02:55] itayneeman: Any ideas why a GET request that works fine in curl doesn't work from https.get? [02:56] disappearedng has joined the channel [02:56] Aria: Not without knowing what you mean by 'doesn't work' [02:56] jesusabdullah: short answer: curl is being more clever than https.get [02:56] Aria: Throws an exception? Times out? returns different results? [02:56] itayneeman: returns an empty body [02:56] jesusabdullah: logn answer: not without knowing what you mean by 'doesn't work' [02:56] jesusabdullah: long* [02:57] itayneeman: It's a streaming endpoint [02:57] itayneeman: similar to twitter's streaming endpoint (just it returns CSV) [02:57] itayneeman: I get back the headers from the response [02:57] itayneeman: but then it just seems to close [02:57] itayneeman: the 'end' event is emitted on the response [02:58] itayneeman: I'm more than willing to believe the server is sending something bad, I'm just trying to figure out what it might be [02:58] Aria: I'd suspect that it's just hanging up on you because you didn't incant the right magic to say you wanted a stream. [02:58] ditesh|cassini has joined the channel [02:58] itayneeman: Aria: on the request side or the response side? [02:58] Aria: request, that's my guess [02:59] Aria: try curl -v and see if you can spot headers that might help [02:59] evilnate has joined the channel [02:59] itayneeman: Aria: I did, we send the same headers [02:59] duncanm has joined the channel [02:59] duncanm: hola - can i ask coffeescript questions here? #coffeescript is quiet [03:00] achiu has joined the channel [03:00] Aria: Interesting [03:00] itayneeman: Aria: the only headers that curl sends are Authorization, User-Agent, Host and Accept [03:00] SubStack: duncanm: asking to ask is inefficient [03:00] EyePulp: duncanm: you'll hear angry hissing [03:01] SubStack: especially in a high-latency asynchronous messaging medium [03:01] nerdfiles has joined the channel [03:01] sh1mmer has joined the channel [03:01] Brandon_R: is libuv child process spawning synonymous with spawning a new thread? [03:02] jesusabdullah: duncanm: go for it, though you'll hear multiple people say, "eww coffeescript" ;) [03:02] duncanm: ah [03:02] duncanm: well, either way [03:02] ksys: hi, does anyone know why jsdom fails to fetch the external js scripts? http://pastebin.com/X4jAwJQV [03:02] piscisaureus_ has joined the channel [03:02] duncanm: i come from coding in Scheme - so i was looking for a way to reload a file in the REPL [03:02] ksys: the urls are absolute [03:02] duncanm: a quick way to reload a file [03:03] astropirate has joined the channel [03:03] duncanm: i do something like foo = require './foo', but it doesn't seem to pick up changes [03:03] duncanm: if i change the file and run it again [03:04] SubStack: duncanm: you can delete the entries from require.cache [03:04] louissmit has joined the channel [03:04] SubStack: there are probably some modules on npm that do this already [03:05] rurufufuss has joined the channel [03:05] gf3 has joined the channel [03:05] zodiak has joined the channel [03:07] duncanm: hmm [03:07] SubStack: here I just wrote this [03:07] SubStack: on the repl [03:07] SubStack: function reload (name) { var base = require('path').dirname(require.resolve(name + '/package.json')) + '/'; Object.keys(require.cache).forEach(function (key) { if (key.slice(0, base.length) === base) delete require.cache[key] }); return require(name) } [03:07] duncanm: looks like i can do delete require.cache['foo'] [03:07] SubStack: seems to work [03:08] SubStack: you probably want to pull out all the subdependencies too [03:08] duncanm: SubStack: i find it bizarre that this is not built-in, do most people just restart node on every change? [03:08] SubStack: I do usually [03:09] duncanm: SubStack: in the scheme/lisp world, the usual workflow is to keep the REPL running, and incrementally evaluation different bits of code [03:09] duncanm: evaluate [03:09] itayneeman: jesusabdullah: any ideas? [03:09] jesusabdullah: huh? [03:10] jesusabdullah: If I were you I'd crank up the verbosity of curl to the max [03:10] jesusabdullah: and see what it's "really" doing [03:10] JimRoepcke has joined the channel [03:10] Karmaon has joined the channel [03:12] itayneeman: jesusabdullah: I get the feeling it may be because the server isn't respnoding with Transfer-Encoding: chunked [03:14] duncanm: is there a way to change the way the REPL prints an object? is it not enough to implement toString? [03:15] jesusabdullah: itayneeman: entirely possible [03:15] polardude has joined the channel [03:16] itayneeman: jesusabdullah: is there a way to force http/https module to use chunked encoding even if the header is not sent? [03:16] retornam has joined the channel [03:17] pradeepbv has joined the channel [03:18] hdon-: hi all :) I am using Sequelize. return values are often objects with properties that i can use to register callbacks like .success(successCallback). is there a standard node module it's probably using that i can also use in my code? [03:18] jesusabdullah: itayneeman: no idea. Have you looked at mikeal's request module? [03:18] itayneeman: yes, same behaivor [03:19] itayneeman: I actually started out with it, and moved to http/https directly because I thought it might be something there [03:21] cconstantine_ has joined the channel [03:21] tilgovi has joined the channel [03:22] automata has joined the channel [03:22] crutex has joined the channel [03:22] garthk has joined the channel [03:23] isufy has joined the channel [03:24] githogori has joined the channel [03:24] garthk has joined the channel [03:24] cjm has joined the channel [03:26] garthk has joined the channel [03:26] itayneeman has joined the channel [03:28] garthk has left the channel [03:29] garthk has joined the channel [03:30] k1ttty_ has joined the channel [03:31] jyp has joined the channel [03:32] pizthewiz has joined the channel [03:32] dr0id has joined the channel [03:35] rtgibbons has joined the channel [03:35] joshthecoder has joined the channel [03:36] c4milo: ACTION sigh  [03:37] Spion_ has joined the channel [03:37] kmiyashiro has joined the channel [03:37] denom has joined the channel [03:38] petschm_ has joined the channel [03:38] mikeal has joined the channel [03:38] ctp6360 has joined the channel [03:38] OmidRaha has joined the channel [03:40] wilmoore has joined the channel [03:41] dgathright has joined the channel [03:44] EyePulp has joined the channel [03:45] h4mz1d has joined the channel [03:47] elguapo99 has joined the channel [03:48] thomasloh has joined the channel [03:48] jrundquist has joined the channel [03:49] jeremya has joined the channel [03:49] jeremya: I've come to claim my moon laser [03:51] cconstantine_: I'm trying to get a callback on receipt of a socket.io .emit call. has anyone gotten that to work? [03:53] yaymukund has joined the channel [03:54] ramitos has joined the channel [03:56] jakehow has joined the channel [03:58] meandi15 has joined the channel [03:58] jtsnow has joined the channel [03:58] crescendo has joined the channel [03:59] jdparker has joined the channel [04:00] benvie: oms[ect [04:00] benvie: inspect property [04:00] benvie: controls it [04:00] kirbysay_ has joined the channel [04:00] isaacs has joined the channel [04:01] benvie: this whole file is dedicated to the inspector for the lib https://github.com/Benvie/reified/blob/master/lib/inspect.js [04:01] benvie: you tap into it with an function in the inspect property on an object or its prototype [04:03] andrewpthorp has joined the channel [04:06] domo has joined the channel [04:06] dshaw_ has joined the channel [04:06] domo: (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. [04:06] Aria: Just what it says on the tin. Make sure you want that many. [04:06] domo: I'm seeing this relating to a Socket [04:07] domo: I'm new to node, so I don't know what I can use to debug this. I know it says setMaxListeners, but could someone offer some insight as to how I should do this and understand the process? [04:07] k1ttty has joined the channel [04:07] diogogmt has joined the channel [04:08] timoxley: duncanm you can use console.log(util.inspect(myObj, true, null, true)) to get a more comprehensive object nump [04:08] timoxley: nump? dump. [04:08] duncanm: timoxley: thanks [04:09] mikeal has joined the channel [04:09] timoxley: benvie your ultra-repl no work. [04:10] benvie: did you just upgrade node? [04:10] duncanm: timoxley: what ultra-repl? [04:10] benvie: I'm working on it now [04:10] timoxley: benvie that I did. [04:10] benvie: based on the latrst stuff [04:10] benvie: it's awesome though [04:10] timoxley: duncanm it's apparently a fancy pants repl [04:10] benvie: I got it working with putty [04:10] benvie: in windows [04:11] jeremya has left the channel [04:11] benvie: full keybindings and all [04:11] timoxley: duncanm I was going to suggest it RE prionting objects, and thought I'd see if it was still working [04:11] benvie: unless he has the node literally from an hour ago [04:11] benvie: it should be fine [04:11] timoxley: benvie oh, I'm on 0.6.14 [04:11] benvie: oh hmm [04:11] timoxley: benvie I'll submit bug [04:12] benvie: I'll take a look at it and get it fixed [04:12] benvie: wonder what changed [04:12] domo: benvie hello [04:13] benvie: hey [04:14] nerdfiles has joined the channel [04:14] timoxley: benvie https://github.com/Benvie/Node.js-Ultra-REPL/issues/6 [04:15] indy3 has joined the channel [04:15] jtsnow has joined the channel [04:15] benvie: oh [04:15] benvie: it's building node-ffi [04:15] benvie: hmm odd [04:15] benvie: that's distributed compiled mostly [04:16] benvie: well if you -f the npm install and get node-ffi manually it should be fine, or just don't get it [04:16] benvie: it's for a plugin [04:16] benvie: and I'll get it upgraded to the latest [04:18] DijkstraGroupie has joined the channel [04:21] jaha has joined the channel [04:21] joshsmith has joined the channel [04:22] cipher__ has joined the channel [04:22] cipher__ has joined the channel [04:23] jerkchicken has joined the channel [04:24] jerkchicken: app.get('/', function (req, res) {} what is '/'? [04:24] synesp: jerkchicken: http://www.google.com(/) [04:24] synesp: it's the trailing slash [04:24] synesp: www.google.com/foo it would be /foo [04:24] jerkchicken: what does it mean in that context? [04:25] synesp: its the path [04:25] synesp: you mean what does / mean alone? [04:25] jerkchicken: no i mean: what does it mean in that context... [04:25] synesp: ohhh [04:26] mikeal has joined the channel [04:26] cliffano has joined the channel [04:27] Brandon_R: hey guys [04:27] nerdfiles: Ex: [04:28] kvda has joined the channel [04:29] Brandon_R: what is a good datastructure to store socket connections in? [04:29] jerkchicken: app.get('/', function (req, res) {value : req.session.value}); how do i access value? [04:30] jerkchicken: keeps saying undefined when i alert(value) [04:30] Brandon_R: y r u lerting it? [04:30] jaha: Hey all. Any of you using messaging queue libraries? Which ones? I basically need a transport layer that will be 99.99% successful no matter that stability of the connection. [04:31] jerkchicken: Brandon_R, i just want to see it [04:31] Brandon_R: what about console.log? [04:31] ctp6360 has joined the channel [04:31] Joeysomo has joined the channel [04:32] jerkchicken: would probably give the same response. undefined [04:32] maxogden: lol @ lerting [04:32] yaymukund has joined the channel [04:33] jerkchicken: is value global? [04:36] sammmy: Is there a way to run a function when something in my MySQL database changes? [04:36] dshaw_ has joined the channel [04:38] schredder has joined the channel [04:38] nerdfiles has left the channel [04:41] polardude has joined the channel [04:42] oldsplice has joined the channel [04:42] SubStack: jaha: lots of folks use amqp or zmq for that sort of thing or if you want dnode-style rpc you could use http://github.com/substack/upnode [04:42] oldsplice: Could someone help me with a for loop issue? [04:42] nerdfiles1 has joined the channel [04:44] SubStack: jaha: also check this one out https://github.com/substack/airport [04:44] SubStack: if you like service registries [04:44] synesp: beep boop [04:45] SubStack: you can take down an airport server and bring one up on a completely different server and the connection won't skip a beat [04:46] Brandon_R: does airport have security? [04:46] SubStack: yep, just pass in a 'secret' key [04:46] Brandon_R: or can terrorists hijack it? [04:46] SubStack: or you can roll it yourself by defining an auth methods [04:46] SubStack: s/s$// [04:47] oldsplice: Could someone explain why this function returns the same sha-128 hash in a for loop? => https://gist.github.com/2212606 [04:47] SubStack: Brandon_R: but you can just do air(fn).listen('beep', { secret : 'boop' }) [04:47] SubStack: then you just need to air.connect('beep') and the secret will be pulled down from the service registry metadata [04:48] Brandon_R: kool [04:48] jaha: SubStack: I have played with upnode/dnode a bit and like it however for this application I was looking to stay away from RPC , I have been testing zmq but having problems with how to deal with connection interuptions and TCP timeouts. I would like to stay as high level as possible at the moment so I think some of it is going a bit over my head, i am not looking for ultimate performance… just reliablity. [04:48] jaha: id appreciate any more suggestions [04:49] SubStack: jaha: upnode connections ping the other side continuously and forcibly try to re-establish the connection if the pings don't get back in time [04:49] SubStack: I've been running this stuff in production across spotty network boundaries for a while now [04:50] ivanfi has joined the channel [04:51] ivanfi has left the channel [04:51] jaha: SubStack: how does it handle long interuptions, say over 24 hours? [04:51] SubStack: jaha: it just continuously retries [04:52] SubStack: or with airport you can have multiple services for redundancy [04:52] SubStack: and it will just use whichever services are available [04:53] rlidwka has joined the channel [04:54] njain has joined the channel [04:54] thetony: are you guys creating binaries from node or writing some seriously intricate apps with node? [04:54] munichlinux has joined the channel [04:54] kvda has joined the channel [04:55] ewalker has joined the channel [04:55] jaha: SubStack: I forget, does upnode handle multiple inidividual clients, meaning I could target messages from the server? [04:56] insanoid has joined the channel [04:56] niloy has joined the channel [04:57] SubStack: jaha: yes all the clients are handled individually [04:57] ctp6360 has joined the channel [04:57] nerdfiles1 has joined the channel [04:57] test_ has joined the channel [04:57] SubStack: if you want broadcast behavior you'll need to roll that yourself [04:58] test_: test [04:59] nerdfiles1 has left the channel [04:59] nateps has joined the channel [05:00] mikeal has joined the channel [05:00] nerdfiles1 has joined the channel [05:01] ivanfi1 has joined the channel [05:01] ivanfi1 has left the channel [05:01] jtsnow has joined the channel [05:02] rurufufuss has joined the channel [05:04] infynyxx has joined the channel [05:04] jesusabdullah: redis pubsub [05:04] jesusabdullah: dun done [05:05] kvda has joined the channel [05:05] nerdfiles1 has joined the channel [05:06] Stoobles has joined the channel [05:07] fangel has joined the channel [05:07] patcito_ has joined the channel [05:07] xananax has joined the channel [05:08] patcito has joined the channel [05:09] jaha: SubStack: thanks, I may have to look into upnode again since ZMQ is starting to get on my nerves [05:11] sreeix has joined the channel [05:12] rosalindwills has joined the channel [05:13] polardude has joined the channel [05:14] rosalindwills: 'eyo…does anyone here know any useful tutorials around building a chat server/application in node.js? [05:14] hardikr has joined the channel [05:14] Stoobles: Yeah, [05:15] Stoobles: http://chat.nodejs.org/ [05:15] Stoobles: And its source: https://github.com/ry/node_chat [05:16] rosalindwills: yeah, i ran across that and was going to look it over. was just curious if there are any tuts about that step through the process a bit [05:16] rosalindwills: (i'm new to this framework) [05:16] rosalindwills: but thank ye :) [05:16] Lorentz: I should upload that chat thing I wrote [05:16] Stoobles: Yeah. Best of luck. [05:16] Lorentz: it extended the normal chat thing and gives you rooms to talk in [05:17] rosalindwills: There any tutorials in general that you recommend? [05:18] oldsplice has joined the channel [05:19] Stoobles: Hmm. Maybe that's what the node.js community needs. [05:19] Stoobles: A good tutorial [05:20] oldsplice has joined the channel [05:20] Morkel has joined the channel [05:21] Lorentz: Maybe a solid book on it [05:21] hardikr has left the channel [05:21] oldsplice: Lorentz: can I message you? [05:21] Lorentz: oldsplice: go on [05:22] orlandovftw has joined the channel [05:22] rosalindwills: there's a couple i've found that have been sort of helpful but i feel like sometimes they're assuming prior knowledge so i'm just sort of digging around seeing if there's anything else that's considered a go-to resource [05:24] rosalindwills: (purportedly "for beginners", i mean. obviously some tutorials are going to assume prior knowledge :P ) [05:24] Stoobles: Yeah... [05:24] ksys has joined the channel [05:24] Stoobles: The ones I've come across assume knowledge of programming language construction [05:24] Stoobles: javascript syntax [05:25] Stoobles: javascript functional programming, I guess. [05:25] maxogden: http://eloquentjavascript.net/ ftw [05:26] rosalindwills: it's not so much the syntax that confuses me, i guess. i'm just coming from a PHP server-side background so figuring out how to structure everything is somewhat bewildering [05:26] ryanseddon has joined the channel [05:26] shedinja has joined the channel [05:27] Stoobles: Yeah. Event based-programming? [05:27] rosalindwills: as near as i understand the term, PHP is not so good at that [05:27] rosalindwills: heh [05:28] guidocalvano has joined the channel [05:29] Stoobles: Everything happens only when an event triggers it... [05:29] cipher__ has joined the channel [05:30] kickingvegas has joined the channel [05:30] nateps has joined the channel [05:30] Stoobles: So, there's a continual loop of process, each time somebody, for example, visits a website. Everybody gets placed in line to be processed (Hopefully, if you're running a web server, most people don't have to wait in line long. This is known as the 'blocking' issue Node.js isn't designed to handle) [05:31] Stoobles: If it does aI/O event like database query, then the queue is moved up, and the next process in line gets priority. Basically, PHP and other server paradigms just spawn a new thread every time a website gets a hit. Node.js processes them in a queue. [05:31] cha0s has joined the channel [05:31] cha0s has joined the channel [05:32] Stoobles: It means certain processes are faster, and you don't have to wait for database queries for your thread to be accessible again. [05:32] blueadept has joined the channel [05:32] blueadept has joined the channel [05:32] Trindaz has joined the channel [05:32] Trindaz: hi [05:32] rosalindwills: ::nod:: [05:32] purr: rosalindwills: Paws code executed sucessfully. (no output) [05:32] rosalindwills: hmm [05:33] Stoobles: So... uhh... every line of code you write is processed when an event happens. Usually that event is a webpage visit. [05:34] Stoobles: var http = require('http');http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n');}).listen(1337, '127.0.0.1');All that does is respond "hello world", since the anonymous function on the second line is called every time a the node.js server gets a request. [05:34] Stoobles: huh. No formatting. j/k [05:34] rosalindwills: lol [05:35] syntaxiko has joined the channel [05:35] rosalindwills: no worries; i can read it still [05:35] onar_ has joined the channel [05:36] Stoobles: http.createServer(function (req, res) { <----- That's an anonymous function, on the right hand side. It's not given a name, but the http.createServer still has it saved (in a closure, if you're familiar with the theory) [05:36] rosalindwills: aye, vaguely [05:37] dshaw_ has joined the channel [05:37] ivanfi has joined the channel [05:37] ivanfi has left the channel [05:37] Stoobles: Have you looked into express? [05:38] rosalindwills: not yet [05:38] rosalindwills: ran across the name in a couple of articles i looked at but hadn't poked at it yet [05:38] Stoobles: It's a pretty good intro... not into node specifically, but it's a framework that'll get you serving web pages in ten minutes. [05:38] Stoobles: just started playing around with it [05:38] rosalindwills: i'll definitely check that out then [05:39] rosalindwills: i do like to know how the language is working underneath but it's also nice to have something that you can just start messing around with [05:39] rosalindwills: question, if i may... [05:39] Stoobles: sure [05:40] synesp has left the channel [05:40] MT has joined the channel [05:41] pylemon has joined the channel [05:41] rosalindwills: the initial reason i ended up looking at node was that when I asked people for help/thoughts on the app i'm working on (which has a lot of real-time interaction — chat, etc.) they suggested that node might be a better choice than PHP…however, I'm a bit puzzled why, since it sounds like node and PHP both don't handle "blocking," if i'm understanding you correctly... [05:41] rosalindwills: is it just that it's faster? [05:42] Stoobles: It handles different kind of blocking. [05:42] Stoobles: PHP has a single thread for each connection. It makes a new thread every time there's a new webpage hit. This thread processes all of the data, then returns values, then dies. [05:43] Stoobles: Node.js uses a single thread for *every* connection. [05:43] maxogden: all threads are not created equal [05:44] Stoobles: Which means each request is put into a queue, and then first come first serve. If a thread does something that takes a long while, such as a database query or any other I/O, then the thread is placed in the back of the queue (theoretically, of course) [05:44] Stoobles: Basically [05:45] Steven_ has joined the channel [05:45] Stoobles: PHP is good for processing lots of data server side. If a single request takes 30 seconds, it's not going to hold up the queue. [05:45] Stoobles: Node.js is good for doing very little processing server side. A database query that takes 30 seconds won't hold the line up. [05:45] sammmy: how does nodejitsu compare to nodester? [05:46] Steven_: hello ? anybody here? [05:46] Ricket has joined the channel [05:46] Stoobles: Nope, nobody. [05:46] Steven_: oops :( [05:46] developit has joined the channel [05:46] rosalindwills: that makes sense. i think. :P still getting my head around it but your explanation is helping a lot [05:46] sammmy: Free VPS anywhere what say you? [05:47] developit: Question: Is there an issue with http.Server#listen() that causes hostnames to be overlooked? [05:47] Steven_: Im new here. what should I do ?? I wanna ask something to you guys expert [05:47] rosalindwills: when you say node is using a new thread for *every* request, you mean, like, including AJAX calls and such? [05:47] developit: -.- [05:47] rosalindwills: Steven_, I think you just ask. :) [05:47] Steven_: thank you :) [05:47] developit: rosalindwills: a web server doesn't care how you made your HTTP request [05:48] rosalindwills: ahh [05:48] Stoobles: rosalindwills: Yeah. You can make different logic for ajax vs a front-page of course. But you can give it the same thing for both. [05:48] developit: also, a new thread is not being spawned for every request. it is not that direct of a relationship [05:48] rosalindwills: heh, you can tell i haven't mucked around with this sort of thing very much [05:48] rosalindwills: gotcha [05:49] mikeal has joined the channel [05:49] developit: with node's http module you handle connections via events rather than spawned threads [05:49] Stoobles: I just started a couple days back. Just regurgitating what I've learned. Thanks for listening, makes sure I know what I'm saying. [05:49] OmidRaha has joined the channel [05:49] Steven_: I want to install node.js and I wanna see the 'hello world!' ... I'm using xampp on window7. what should I do as next step to use node.js .. ? [05:49] developit: you don't need XAMPP [05:49] developit: just download and install node [05:49] MerlinDMC has joined the channel [05:49] rosalindwills: Stooble — likewise, thanks for taking the time to answer [05:49] yawNO has joined the channel [05:49] simenbrekken has joined the channel [05:50] developit: anyone had any issues with hostname routing with http.Server??? [05:50] yawNO: hai [05:50] tylerstalder has joined the channel [05:51] rosalindwills: i think i will go mess with express; i've no doubt i'll be back at some point. Thanks all for the help. [05:51] jrostand has joined the channel [05:51] Stoobles: Aight. Good luck [05:51] Chel has joined the channel [05:51] rosalindwills: thanks [05:51] rosalindwills has left the channel [05:52] skm has joined the channel [05:53] pvankouteren has joined the channel [05:54] huggies has joined the channel [05:55] lmorchard has joined the channel [05:55] fivetwentysix has joined the channel [05:55] graeme_f has joined the channel [05:57] ag4ve: did bcrypt change interfaces? it seems there are different methods that got switched or there are different versions? [05:59] ag4ve: ie, bcrypt.genSaltSync vs bcrypt.gen_salt (one being async as well...) [06:03] Steven_: anyone knows.. good webpage to learn.. about installing node with *.msi and.. making 'hello world!' ?? [06:03] Steven_: :(( [06:07] abraxas has joined the channel [06:14] enjalot has joined the channel [06:15] cconstantine_ has joined the channel [06:15] gf3 has joined the channel [06:16] pylemon has left the channel [06:17] RobWC1 has joined the channel [06:19] Stoobles: poor Steven_ [06:19] Qzen: Steven_ , you can try http://blog.mozilla.com/webdev/2011/10/10/installing-node-js-on-windows/ [06:19] Qzen: i dont know if thats what you are looking for [06:19] developit: So I take it nobody here can think of a reason why an http.Server listen() ing for requests to the specified hostname is instead calling my handler for all requests? [06:19] admc has joined the channel [06:20] developit: I am starting to think it's doing a reverse IP lookup and just using the IP... [06:21] Steven_: thanks Qzen and . I can't use node.js without cygwin on windows ? [06:22] tuhoojabotti: No [06:22] Qzen: sure you can [06:22] tuhoojabotti: Node.js runs natively on Windows. [06:22] erujolc has joined the channel [06:22] yawNO has joined the channel [06:22] Aiden has joined the channel [06:22] maxogden: developit: http://nodejs.org/api/http.html#http_server_listen_port_hostname_callback [06:23] Qzen: You can install node on windows without any other program [06:23] developit: That's what I'm using. [06:23] Steven_: I'm reading this page http://code.google.com/p/nodejs-win/ .. but still dont know .. how can I see the 'hello world ' on window.. :S [06:24] developit: the instance/listen setup is basically this: http.createServer(function(){ /*request handler*/ }).listen(8080, 'example.com'); [06:24] developit: but when I issue a request to test.example.com:8080, it still goes through [06:24] developit: calls the request handler, etc. [06:24] developit: I have the app stripped down so its not even using cluster or a config, still happening. [06:24] Qzen: well just make a "hello world" script in .js and then load it in node using "node /path/to/script.js" in cmd [06:25] BombStrike: I do think for windows all you'd need to do is add node to the system PATH and you're set [06:25] slaskis has joined the channel [06:25] developit: also maxogden I'm envious of your location. Missed France the second we left! [06:26] Qzen: Steven_ : just put "console.log("Hello World");" in a .js file then open CMD and type "node c:/path/to/script.js" and you should be set to go [06:27] maxogden: developit: im not in france! [06:27] developit: maxogden: aw :/ [06:27] developit: is ryah Dahl? [06:27] maxogden: nope we're both in the bay area [06:28] developit: ahh, just as good. [06:28] developit: it was mainly for the coffee anyway [06:28] maxogden: developit: im not sure how strict the hostname thing is. does it still route if you use a totally different domain altogether? [06:28] developit: damn I miss peets. [06:28] developit: maxogden: I have only tried subdomains [06:28] developit: my thoery is that it's using the resolved IP for routing [06:28] developit: which would be the same for all domains I've tried, as they are all pointing at this box [06:29] developit: is this a good time for me to finally put NGINX in front of my app? :P [06:29] RORgasm has joined the channel [06:29] developit: I feel weird doing it, given the app itself is a proxy. Proxied proxies scare me. [06:30] maxogden: developit: a simple host checker on top of http.Server https://github.com/mikeal/tako/blob/master/index.js#L729 [06:30] maxogden: developit: basically just check req.headers.host in a handler [06:30] developit: does that prevent other apps from handling that request? [06:30] maxogden: and return a 404 if it doesnt match what you want [06:31] developit: I basically would like to use the same VPS with two hostnames, each being handled by its own request handler. [06:32] fangel has joined the channel [06:33] maxogden: http.createServer(function(req, resp) { vps1.emit('request', req, resp) }) [06:33] maxogden: where vps1 is a http.createServer of it's own [06:34] developit: ah so I need an http.Server in front of the app's own servers [06:34] developit: basically a router [06:34] maxogden: yea pretty much [06:34] developit: hmm. [06:34] developit: sounds like something nginx would do for me. [06:34] maxogden: yes but it depends on whether or not you want to run nginx just to get that little snippet up there [06:35] developit: true. [06:35] developit: any thoughts on whether that might change in the future? :P [06:35] gf3 has joined the channel [06:35] maxogden: the strictness of the hostname in createserver? i dunno [06:35] evilnate has joined the channel [06:35] developit: the Server instance can see those headers and has access to the specific hostname from .listen(), right? I'm wondering how hard it would be to get the hostname itself into the routing rules [06:36] cipher__: would anyone mind explaining how to use callbacks to achieve async flow? [06:36] cipher__: (or a short example :P?) [06:36] developit: cipher__: in what context [06:37] Steven_: oh.. thx alot Qzen , BombStrike [06:38] Qzen: Steven_ , did you get it to work? [06:39] nsolsen has joined the channel [06:39] Steven_: yes. I got the hello world. thx man [06:39] Qzen: I am glad i could help [06:39] cipher__: developit, well if i define a "class": var Test = function(err, callback/*that is the standard args?*/) {this.file = '';}; Test.prototype.load(filename, callback?) {this.file = fs.load.etc(filename);}. How could i for example load and print the output asynchronously? [06:39] groom has joined the channel [06:39] developit: the callback is a function [06:40] cipher__: yeah [06:40] cipher__: so callback(null, loaded_file_string); in the 'load' function then? [06:41] jetienne has joined the channel [06:42] plato: hey all, I want to store a grid of vertices and then retrieve them by a coordinate pair. e.g. v1=Vertex(-1,1); but then getVertex(-1,1) needs to return v1. I can't store the Vertex objects in a 2d array because I can't access negative indices, like verts[-1][1] [06:42] Steven_: Qzen. I made hellowolrd.js and put console.log("Hello World"); .. and node helloworld.js .. I got it on CMD . if I want to see on browser. using http://localhost/helloworld.html using node.. what should I put in the html ? [06:42] developit: cipher__: http://pastebin.com/pieKbHXz [06:43] developit: plato: you can store negative indices in an Array, but you're addressing them as Object properties [06:43] ph^ has joined the channel [06:43] staar2 has joined the channel [06:43] risto_ has joined the channel [06:43] Qzen: Steven_ you can try this http://yinsochen.com/nodejs-hello-world/ [06:43] jrostand has left the channel [06:43] developit: plato: just assign the negative indicies after initializing the array, using square bracket notation as you did for your references [06:43] Qzen: that will allow you to send text to the client by http-socket [06:44] `3rdEden has joined the channel [06:44] developit: plato: only caveat would be that some structured clone algorithms will ignore properties hanging off of Arrays [06:44] plato: shit really? this has been frustrating me for quite a while... tyvm [06:45] cipher__: developit, thanks [06:45] tornad has joined the channel [06:46] dragansah has joined the channel [06:46] ewalker has joined the channel [06:46] fangel has joined the channel [06:46] bartt has joined the channel [06:47] developit: plato: if you use an Object for your storage, you can use Strings for the keys [06:47] DijkstraGroupie has joined the channel [06:47] Steven_: omg.. Im seeing the helloworld! on browser.. finally.. thx Qzen. you are the best teacher, made me got this in 10min [06:47] developit: verts = { '-1':new Vertex(-1,1), '0':new Vertex(2,5) }; [06:47] Qzen: Steven_ , glad i could help... :P [06:48] abraxas_ has joined the channel [06:48] developit: then you just make sure you're casting your keys to strings before you assign or reference values when working with that object. It will serialize properly assuming your Vertext object isn't doing anything funky about storing those values passed to the constructor. [06:48] DijkstraGroupie has joined the channel [06:48] DijkstraGroupie has joined the channel [06:48] simenbrekken has joined the channel [06:49] Guest26027 has joined the channel [06:49] Guest26027 has left the channel [06:49] plato: thanks developit [06:50] developit: np [06:50] mikeal has joined the channel [06:50] Authoritarianism has joined the channel [06:51] Brandon_R: hi [06:51] pgte has joined the channel [06:52] developit: plato: you should add some crazy operator functions to your vector class :) [06:52] developit: http://jsfiddle.net/developit/Nhv2y/ [06:52] erikzaadi has joined the channel [06:53] yawNO has joined the channel [06:53] tvw has joined the channel [06:54] jacobolu_ has joined the channel [06:55] mikeal has joined the channel [06:57] emattias has joined the channel [06:57] ivanfi has joined the channel [06:58] rendar has joined the channel [06:59] DijkstraGroupie has joined the channel [06:59] DijkstraGroupie has joined the channel [06:59] ivanfi has left the channel [07:00] synesp has joined the channel [07:01] meso has joined the channel [07:01] hipsterslapfight has joined the channel [07:02] meso has joined the channel [07:03] plato: developit i'm actually trying to code a hex grid [07:03] savudin has joined the channel [07:03] developit: ah, cool. [07:03] plato: which is an interesting challenge, not least because it's my first javascript project as well as my first node.js project [07:04] synesp: plato: good for you man [07:04] synesp: that's awesome [07:06] ag4ve: is this a mongoose bug or is it just not raising the right error and i'm doing something wrong? http://paste.scsys.co.uk/189173 [07:08] Industrial: Is there anyone here using JugglingDB? [07:08] Industrial: I can't get it to work with MongoDB [07:08] neshaug has joined the channel [07:09] Industrial: schema = new require('jugglingdb').Schema 'mongodb', url: 'mongodb://127.0.0.1:27017/MyDatabase' [07:10] ag4ve: Industrial: if you keep irc open, try looking through your scroll, iirc someone asked that a week or so ago and it might help (i don't use juggling though) [07:10] paulwe has joined the channel [07:11] Industrial: A week or so? my client doesn't keep a history that long [07:11] Industrial: also, it might have been me ;p [07:11] incon has joined the channel [07:12] weepy has joined the channel [07:12] hackband has joined the channel [07:13] weepy: hi Nodesters. [07:13] weepy: Is there any reason why process:exit wouldn't fire ? [07:13] developit: from a child process? [07:13] weepy: I'm doing: process.on('exit', function() { console.log('exiting') }) ---- very simple app, but I see nothing [07:13] weepy: no just main process [07:14] ctp6360 has joined the channel [07:14] ag4ve: hummm, i think i found my issue... maybe: https://github.com/LearnBoost/mongoose/pull/415 [07:14] alm0nd has joined the channel [07:14] Hebo has joined the channel [07:14] developit: weepy: I don't see any reason why it wouldn't fire. Has to be something else in your code. [07:14] ag4ve: ACTION grumbles "this might break backward compatabllity but....." grrrr [07:15] developit: ACTION wonders if ag4ve is a fan of agave nectar [07:16] weepy: developit - yes - it seems to be if there's a server [07:16] weepy: here's a gist [07:16] weepy: https://gist.github.com/2213578 [07:16] developit: weepy: it's not exiting until you destroy your server [07:16] cipher__: is this async? http://pastie.org/private/rlbmla0fzxsalrxtt5uw [07:17] developit: as long as there are instances of EventEmitter available to emit events, your process lives on. [07:17] ksys has joined the channel [07:17] djcoin has joined the channel [07:17] developit: cipher__: yes, but you shouldn't use throw() [07:17] cipher__: okay [07:17] developit: you have "err" in your callback signature [07:18] developit: pass the error text to the callback in that argument. [07:18] weepy: developit - well if I do Ctrl+C the process dies [07:18] bartt has joined the channel [07:18] developit: weepy: yes, that should fire the event [07:18] developit: it doesnt? [07:18] weepy: the process exits [07:18] developit: what about pkill -15 [07:18] weepy: but the on exit doesn't run [07:19] weepy: if there's no server then it runs the exit event [07:19] benjixx has joined the channel [07:19] [AD]Turbo has joined the channel [07:19] [AD]Turbo: hi there [07:20] dmilith_ has joined the channel [07:20] bartt has joined the channel [07:20] weepy: kill -15 kills the process but the exit event isn't run [07:20] benjixx has joined the channel [07:20] developit: weepy: ahh, you need signal events. http://nodejs.org/api/process.html#process_signal_events [07:21] yawNO has joined the channel [07:21] developit: A quick look at the docs makes me think the "exit" event is for graceful only [07:21] cipher__: developit, sorry one more question: everything is on the heap right, local stacks are not accessible explicitly? what does the new operator do then? say if i have var s = new String("hi");? [07:21] bartt has joined the channel [07:21] developit: it instances the class you specified [07:21] developit: local variables are scoped within the function you declare them in [07:22] antz29 has joined the channel [07:22] cipher__: ok [07:22] developit: though the global object (root context) has its properties accessible as locals when you are in global scope. [07:22] weepy: developit - ah i see [07:22] developit: weepy: Today I Learned [07:22] developit: haha [07:23] bartt has joined the channel [07:23] developit: the nodejs IRC makes me wish my web chat client was IRC-backed. [07:24] yawNO: developit: just add irc support [07:24] yawNO: ain that difficult :D [07:25] ag4ve: i'm sure you can get some json or soap irc gateway [07:25] developit: its mostly that I'm lazy. [07:26] ag4ve: heh, can't help ya there :) [07:26] developit: There are actually IRC client libraries for node though. I could just make it a bridge [07:26] developit: (as crappy as that would be) [07:26] ablomen has joined the channel [07:26] developit: still, NickServ is a silly idea I'd be wary of promoting [07:27] misza222 has joined the channel [07:27] ag4ve: run your own server [07:27] yawNO: i saw a irc as a service platform [07:27] yawNO: but i cant remember the name [07:27] yawNO: :( [07:27] rio{ has joined the channel [07:27] developit: ...mibbit? :P [07:27] yawNO: no [07:27] yawNO: literally [07:27] yawNO: a platform [07:27] yawNO: not a client [07:27] Edy has joined the channel [07:28] developit: ah. [07:28] developit: If it was more than a spare time project, I might have found that intriguing :P [07:30] kejun has joined the channel [07:31] synesp: platforms [07:31] synesp: I love platforms [07:31] markwubben has joined the channel [07:33] trivol has joined the channel [07:33] Hebo_ has joined the channel [07:34] hackband has joined the channel [07:35] developit: lol you sound like some people I work with :P [07:36] synesp: developit: I work for an advertising network and we're re-working parts of the *platform* and utilizing node in places [07:36] weepy: developit - thanks that all worked [07:36] rlidwka: developit: there is irc server written in node.js... have you seen it? I think it's possible to make something nice instead of nickserv there [07:37] synesp: are their bindings for any GUI libs in node? [07:37] synesp: there lol! [07:37] synesp: i just wrote their [07:37] synesp: its late. [07:37] AD7six has joined the channel [07:38] pradeepbv has joined the channel [07:38] pradeepbv_ has joined the channel [07:39] maxogden: irccloud and subway [07:39] cipher__: are there any functions for string parsing anyone would mind referring me to? [07:39] PHPFluesterer has joined the channel [07:40] maxogden: string parsing what [07:40] SubStack: .. 'beep'.replace(/e/g, 'o') [07:40] SubStack: where is zee robot [07:41] maxogden: rebet [07:41] whitman has joined the channel [07:41] meandi16 has joined the channel [07:43] pradeepbv has joined the channel [07:44] bEEEviz has joined the channel [07:44] cipher__: maxogden, searching through strings, selecting lines, etc. [07:45] djcoin: SubStack aahahak, let me hear the story of a man that switched from haskell to node.js :) [07:47] sammmy has left the channel [07:47] s0urce has joined the channel [07:47] s0urce: morning [07:47] developit: hi [07:47] djcoin: 'ning [07:48] developit: I have a theory: every time you want to write a startup script (upstart etc), the format has changed. [07:49] dragansah has joined the channel [07:49] michaelhartau has joined the channel [07:50] cipher__: maxogden, using fstream in c++ would could load a file, iterate over each character until finding a match. if (doc[i] == 's') begin = i; ... ? [07:50] sreeix_ has joined the channel [07:50] ioscale has joined the channel [07:50] s0urce: I have a vision and had 2 question on it before i start to realize, i want browser to request only the main index file and load each part of it (like new, votes, etc) async. I already did a prototype with php and ajax, but this isnt the best for it. Here my questions, can i do this more "native" as with socket.io and will search spiders like the google ones get my site rated? ;) [07:51] alm0nd has left the channel [07:51] ksys has joined the channel [07:51] cipher__: ACTION is just trying to find the docs for string functions [07:51] developit: s0urce: you'd be giving up the "google juice" [07:51] djcoin: cipher__: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String [07:51] developit: unless you use html5's history API and create static versions of your pages by rendering them using JSDOM [07:52] cipher__: i swear i couldn't find anything on google. my googlefu has went down hill since they removed a lot of keywords :( [07:52] developit: cipher__: prefix your query with "MDN" [07:52] SamuraiJack has joined the channel [07:52] s0urce: developit: history api? didnt hear about, but how can this get my red by a static file command? [07:52] plato has joined the channel [07:52] plato has joined the channel [07:53] s0urce: i just guess, but google read my page like a static file doenst it? [07:53] developit: cipher__: in Node, you can read a file into a String (specify "utf-8" as your stream encoding) and then iterate over the string as you would normally: for (var i=0; i