--- Log opened Thu Mar 14 00:00:11 2013
00:29 <@isaacs> mbalho: you are so funny
00:30 <@isaacs> mbalho: oh, you're asking because gblock was asking in here first, lol
00:30 < ningu> isaacs: hey, I missed the v0.10 release party, any other events coming up?
00:30 <@isaacs> mbalho: i was just about to say, "OMG gblock was just asking in #libuv!"
00:30 <@isaacs> ningu: always. sf is a nonstop javascript party.
00:30 <@isaacs> ningu: the official release party is nodeconf, of course.
00:30 < ningu> hehe well where should I check for announcements?
00:30 < ningu> I was in germany when I got into node, which was inconvenient for such things
00:31 <@isaacs> ningu: the best option is to follow @izs, @nodeconf, and @mikeal on twitter.
00:31 < ningu> ok cool
00:31 < gblock> all, thanks for the help. @isaacs is helping me out.
00:31 <@isaacs> mbalho: do you have a problem like this as well?
00:31 <@isaacs> mbalho: btw, engineStrict is not a thing
00:32 < ircretary> Can one of the admins verify this patch?
00:32 <@isaacs> ircretary: thanks, you're very funny
00:32 < ircretary> isaacs: I'm not sure what to do with that command. Ask for help in PM.
00:32 <@isaacs> ircretary: thanks
00:32 < ircretary> isaacs: You're welcome :)
00:34 < asdf12> possibility to get an ID from Socket? maybe even the FD?
00:35 <@isaacs> asdf12: socket._handle.fd
00:35 <@isaacs> asdf12: only in unix
00:57 < ningu> I think if JavaScript ever dies it will take me a long time to get closure
00:57 < korilo> isaacs, is there a nodeconf like in eu too?
01:00 < korilo> *Europe
01:18 <@isaacs> korilo: there will be a nodeconf eu this year
01:18 <@isaacs> korilo: in ireland
01:43 < faceleg|work> u guys are dicks
01:43 < faceleg|work> with your conferences
01:44 < faceleg|work> in nz we get sh***
01:44 < faceleg|work> sh**
01:44 < faceleg|work> I mean guys as in plural form of you, not female exclusive
01:44 < faceleg|work> just fyi
01:46 < ningu> faceleg|work: you just need to get the word out that nz is the ideal place for tech startups
01:46 < ningu> figure out what will draw them
01:47 < faceleg|work> ningu: I'm pretty sure they would be able to tell I'm lying
01:47 < faceleg|work> ningu: low wages
01:47 < faceleg|work> ?
01:47 < ningu> bathtubs draining clockwise or whatever
01:47 < faceleg|work> Is taht a draw card
01:47 < faceleg|work> a very high ratio of farm animals:people
01:47 < faceleg|work> Extremely low gun crime
01:47 < ningu> actually, iirc there is/was an australian company looking for node developers and willing to relocate them to australia
01:47 < faceleg|work> Laughably bad public transport
01:47 < faceleg|work> unfortunately I can't leave NZ until ~2016
01:48 < ningu> what do you consider low wages?
01:48 < faceleg|work> < 70K NZD
01:48 < ningu> anyway, cost of living and health care are an important factor
01:48 < faceleg|work> depends on city
01:48 < faceleg|work> in AKL (main center) COL is high
01:49 < faceleg|work> healthcare is free (but I still have health / income insurance to think og
01:49 < faceleg|work> "Free for the masses" but if you want quality or speed, or options, you pay
01:49 < ningu> how much per month for, say, a one bedroom apartment?
01:49 < korilo> isaacs that's amazing was waiting for an eu conf
01:50 < faceleg|work> ningu: I think I'd look at around 450-500 NZD for a 2 bedroom apt, quite high quality though and sort of central
01:50 < ningu> faceleg|work: compared to SF rent that is unbelievably cheap
01:50 < faceleg|work> couldn't move to AKL for ex less than 80K
01:50 < faceleg|work> I believe it
01:50 < faceleg|work> but what do you get paid in SF
01:50 < ningu> in my neighborhood you are looking at 4000 USD/month for a two bedroom
01:50 < faceleg|work> and how much is food, transport
01:51 < ningu> *I* don't get paid much but your normal entry level google employee for example... I dunno, it's still less than 100K/year afaik
01:51 < faceleg|work> so 120K NZD
01:51 < ningu> but I think there are plenty of people in the 100-200K range
01:52 < ningu> and free shuttles to google hq etc.
01:52 < ningu> and various startups too but I don't know what they're hiring for
01:52 < ningu> faceleg|work: so when you pay for health care is that like a supplemental thing or a full plan?
01:53 < ningu> a full individual plan here is going to run you something like $500/month
01:53 < ningu> but with a good job your employer will pay for it, or offer a much cheaper plan
01:53 < ningu> and in the coming years who knows, I hope it will be cheaper but you can't really assume that
01:54 < faceleg|work> 500 amonth ahahaha
01:54 < faceleg|work> no way
01:55 < faceleg|work> all my insurance is like 1000 a year
01:55 < faceleg|work> including 68K home / contents + insurance for house, full income protection 3/4 heath care etc
01:55 < ningu> faceleg|work: you can't get insurance worth getting for that price here
01:55 < faceleg|work> and free healthcare here is *very* good, I mock but it's good
01:55 < ningu> no f'ing way
01:55 < faceleg|work> my mother in law came to visit with father in law for 6 months
01:55 < ningu> faceleg|work: it's a safe assumption that all health care costs in the US are 5-10 times wht they should be
01:55 < faceleg|work> she fell and broke her ankle badly
01:56 < faceleg|work> the govt fixed her up for free
01:56 < faceleg|work> not only that
01:56 < faceleg|work> the dr demanded she extend her stay 3 months to ensure she received adequate after care as they didn't trust the quacks back in Shanghai
01:56 < ningu> even with a good plan, if you go to the doctor or emergency room there will be a copay
01:56 < faceleg|work> all free, she isn't a citizen
01:56 < faceleg|work> yeah I find that difficult to believe
01:56 < faceleg|work> my daughter is free for GP even until 5 yo
01:57 < faceleg|work> hospital here completely free
01:57 < ningu> for example I think with my plan emergency room visit is $100
01:57 < faceleg|work> ambulance costs 80$ per callout, but that is billed weeks after
01:57 < ningu> ambulance is like $500 or $1000
01:57 < ningu> like I said, everything costs way too much
01:57 < faceleg|work> *hospital* is free, but we have emergency clinics (less than 40$ for me for example, free for my daughter after initial visit's nomial $5 charge)
01:57 < faceleg|work> sounds horrible
01:58 < ningu> doctors here *can* be very good, but you also get a lot of people that are overworked and don't pay attention
01:59 < ningu> although in my experience it hasn't been that hard to find someone good, but I know how to look
01:59 < ningu> the real issue is the cost of care
02:05 < faceleg|work> yeah sounds like it
02:05 < faceleg|work> csot is a real barrier to overall health
02:05 < faceleg|work> our medicine is generally very cheap too
02:05 < ningu> faceleg|work: costs are less in pretty much every other country, whether they have universal care or not
02:07 < ningu> there are plenty of good things about the US but politically it's pretty fucked up right now
02:10 < ningu> at least obama saved us from complete destruction
02:21 < faceleg|work> ningu: yeah I like him
02:21 < faceleg|work> see a lot of negative press about him, hard to tell from outside what the actual sentiment
02:21 < faceleg|work> is
02:32 < ningu> faceleg|work: I think there are some legitimate things to criticize, but he was basically handed an impossible situation
02:32 < ningu> and has done reasonably well with it
02:34 < faceleg|work> I can't imagine how difficult it must have been, cleaning the monkey's mess
02:35 < ningu> plus 25-35% of the country is still deadenders with outsized influence
02:35 < faceleg|work> deadenders?
02:35 < Leeol> Is there a delay in how long a package takes to be available via `npm install`, after it has been published to npmjs.org? https://npmjs.org/package/grunt says 0.4.1 but i am unable to install it
02:36 < ningu> faceleg|work: extremists who are opposed to obama no matter what, and any policies for the collective good
02:36 < faceleg|work> ningu: ah right, though you meant poor people, was wondering how they had influence
02:36 <@Nexxy> Leeol, sometimes there is a bit of a delay, es
02:36 <@Nexxy> s/es/yes/
02:37 <@Nexxy> err, you get the idea
02:37 < faceleg|work> yes it's one of those rare times when one thinks it might be nice to have a dictator
02:37 < faceleg|work> just for awhile
02:37 < ningu> nah the solution is to reform some of the structural factors that make certain things possible
02:37 < ningu> which is not easy and may not happen
02:37 < faceleg|work> exactly
02:37 < faceleg|work> so, faceleg for dictator
02:38 < ChrisPartridge> Leeol: are you sure you don't have a specific version specified in your projects package.json ?
02:38 < ningu> "dictator just for a while" never ends up that way
02:38 < faceleg|work> finland had one for awhilke
02:38 < ningu> Leeol: I just installed grunt 0.4.1 a minute ago
02:39 < Leeol> ChrisPartridge: I have "~0.4" in my deps, but if npm gives me the error of `npm ERR! 404 '0.4.1' is not in the npm registry.` because my version requirement is wrong, then npm gives strange errors :s
02:40 < ChrisPartridge> Leeol: try change it to "0.4.x"
02:41 < Leeol> ChrisPartridge: Still no. I also removed it entirely from my package.json
02:42 < Leeol> ChrisPartridge: Not a big deal, i can just install it from git
02:43 < ChrisPartridge> Leeol: just try run npm install grunt@0.4.1
02:43 < Leeol> ChrisPartridge: That worked, odd
02:44 < Leeol> ChrisPartridge: Thoughts?
02:44 * Leeol dies a little inside
02:45 < Leeol> Thoughts are i should go away and stop bugging you nice folks with retarded questions. ChrisPartridge & ningu, my apologies. :)
02:45 < ChrisPartridge> Leeol: probably something in your package.json I'd say :)
02:45 <@Nexxy> Leeol, you shouldn't apologize
02:45 < Leeol> ChrisPartridge: It wasn't downloading 0.4.1 automatically, but i was also using the wrong syntax to download the 0.4.1 manually.
02:47 < ChrisPartridge> Leeol: gist your package.json if you like
02:48 < Leeol> ChrisPartridge: I'm guessing it was ~0.4 ?
02:48 < Leeol> I'm not familiar with the tilde syntax, perhaps i misunderstood it
02:48 < faceleg|work> Leeol: no don't go away, if you do then it'll just be me left asking the dumb questions
02:48 < ChrisPartridge> Leeol: don't use ~ at all, just use 0.4.x or >= 0.4.0
02:48 < Leeol> faceleg|work: lol
02:48 < joelmob> im a beginner with mocha.. here is a test that should pass, i dont understand why it doesnt... https://gist.github.com/joelmo/5158412
02:49 < Leeol> ChrisPartridge: Hmm, i thought tilde was >= 0.4.0 < 0.5.0, any reason not to use it?
02:49 < ChrisPartridge> joelmob: try deepEqual
02:53 < ChrisPartridge> Leeol: pretty sure ~ was dropped in favour of .x syntax
02:53 < Leeol> ChrisPartridge: Ah hah, sounds good. Funny enough, i've been using .x for ages, and recently was going over the semver docs and decided to try ~, go figure :s
02:54 < joelmob> ChrisPartridge: ty it worked with deep.equal
02:56 < ChrisPartridge> yw
03:08 < Thoma____> Anyone here?
03:09 < korilo> sup Thoma____
03:14 * niggler high-fives Thoma____
03:15 * faceleg|work sidesteps niggler's super-dense poo as he walks up to Thoma____
03:15 * niggler picks up poo and rubs it in faceleg|work's face
03:16 * faceleg|work dies
03:16 * niggler dances
03:16 < niggler> lol he left
03:16 < niggler> good job faceleg|work
03:16 < faceleg|work> lol
03:16 * faceleg|work high five
03:16 < faceleg|work> defenders of the node.js room
03:16 < niggler> defenders of #node.js
03:18 <@Nexxy> ...
03:18 * niggler pours libations in honor of queen Nexxy
03:19 <@Nexxy> ah huh
03:20 * faceleg|work prostates himself
03:20 <@Nexxy> uhhhhh
03:20 <@Nexxy> you're missing an r... I hope
03:20 < faceleg|work> no that was on purpose
03:21 <@Nexxy> well I guess health is important
03:21 < faceleg|work> or should I say ... on porpoise
03:22 < faceleg|work> I had a Korean friend in high school who couldn't pronounce 'ph' or 'v' very well. The former was 'p', the latter 'b'
03:22 < faceleg|work> I used to love asking him if we should go and lisen to biolins while watching bideos of dolpins
03:22 < faceleg|work> he threw a good punch though
03:23 <@Nexxy> it's almost as if he didn't find it funny
03:24 < Zak> i think you mean phunny
03:24 < niggler> punny
03:26 * ChrisPartridge regrets reading up
03:26 < arnonate> https://twitter.com/JavaScriptizzle
03:26 < arnonate> Seen this guy?
03:27 < Zak> haha, this is great
03:27 < timeturner> lol
03:27 < ChrisPartridge> arnonate: he's the new crockford of javascript
03:27 < niggler> cockford
03:28 < arnonate> Ya thought he was pretty funny
03:28 < timeturner> HTML6 - tha spec dat brangs our asses freedom.
03:28 < niggler> aww shouldve continued it to github
03:28 < niggler> https://github.com/javascriptizzle
03:28 < ChrisPartridge> I'm going to print this one and put it on the wall.. "Quit touchin tha DOM, mutherfucka."
03:30 < arnonate> haha
03:30 < Zak> there should be something about never extending built-in classes
03:30 < timeturner> crockford in disguise: Put a semicolon all up in tha end of every last muthafuckin simple statement.
03:31 < arnonate> Dopest muthafuckin JavaScript developer in the hizzle.
03:31 < arnonate> Jail
03:31 < ChrisPartridge> haha
03:31 < arnonate> From jail?
03:31 < arnonate> haha
03:36 < Zak> Crockford should update his own site...
03:37 < Zak> at least promote the content that he agrees with now
03:37 < Zak> (and demote or put disclaimers on content he doesn't really agree with anymore)
03:37 < Zak> i saw one disclaimer but it was at the bottom of the page
03:37 < Zak> a disclaimer about something at the top of the page haha
03:40 < ChrisPartridge> Zak: thats just ludicrous
03:40 < niggler> this site feels incredibly dated
03:46 < Zak> thats because Crockford is dated
03:46 * Zak snickers
03:46 < Zak> (that was a joke btw)
04:05 < tana_> hello everybody
04:14 < DeltaHeavy> Hey, I was wondering how I could pass a couple variables to the function created in this line - request({ uri: 'http://www.canadacomputers.com/' }, function(error, response, body) {
04:15 < innociv> Is there a way to make node.js not listen on a port until a certain time?
04:17 < echo> innociv: Just wrap the listen function execution.
04:17 < innociv> That's what I thought but it sounded too simple.
04:17 < ChrisPartridge> DeltaHeavy: curry it
04:18 < DeltaHeavy> ChrisPartridge: What exactly does that mean?
04:18 < goddard> can some one help me with this error
04:18 < goddard> npm ERR! Error: no version
04:20 < ChrisPartridge> DeltaHeavy: gist your code and i'll give you an example in your context
04:22 < DeltaHeavy> ChrisPartridge: https://gist.github.com/anonymous/5158763
04:25 < ahungry> hey guys, wanna see my open source tactics/card game using websockets through node to my game server? http://tactics.ahungry.com/play/
04:25 < ahungry> feel free to critique if you have time and wanna try
04:25 < ahungry> if you want the source, http://github.com/jehiva/ahungry-tactics
04:26 < DeltaHeavy> ChrisPartridge: I need to brb. I'll read your reply in 20mins if you do
04:31 < Guest16308> Anyone know of some dirt cheap hosting for a simple personal/musician website I built?
04:31 < Guest16308> FatCow.com is what hosting is being used for the previous site the client has. But afaik, it's a shared hosting set up. But it's only a couple bucks a month
04:32 < SecretAgentX9> Guest16308: is it a static site?
04:32 < Guest16308> SecretAgentX9: Static in what way?
04:32 < Guest16308> It's a paged based
04:32 < Guest16308> but there's a small CMS I built for managing conent
04:33 < SecretAgentX9> just HTML/CSS/JS
04:33 < SecretAgentX9> ahh n/m then
04:33 < Guest16308> Yeah, it has a little more too it
04:33 < ahungry> host gator is only $20 for a 10G vps
04:33 < ahungry> 250GB transfer/mo
04:33 < Guest16308> It's Node.js, express, jade, stylus, :P
04:33 < SecretAgentX9> an aws micro instance
04:33 < Guest16308> ahungry: I'm looking for something cheaper than digitalocean.com
04:33 < SecretAgentX9> but only if youre free tier :D
04:36 < SecretAgentX9> Heroku gives you one free instance
04:36 < Guest16308> I'll just whiteglove it with the VPS I have now.
05:30 < Gambit-> is there a tutorial for adding a npm module to be compiled into the node.js binary?
05:31 < ningu> is it possible, in express, to have middleware that runs between the router and the view?
05:32 < ningu> for example to finalize locals
05:33 < ChrisPartridge> ningu: you could slot another middleware in under the router, and then set a certain variable on req, and pass it down using next()
05:34 < ningu> ChrisPartridge: the problem is that the relevant things are only set during the router
05:34 < ChrisPartridge> Gambit-: I don't think so
05:34 < ningu> this is for the flash -- errors generated during the current request
05:34 < Gambit-> hm well let's see if i'ts just as simple as including all of the .js as part of the stock modules builds.
05:34 < ningu> I want to pass req.flash() to all views as flash
05:36 < ChrisPartridge> ningu: express 3.0 or > ?
05:36 < ningu> ChrisPartridge: yes
05:36 < ChrisPartridge> just use app.locals
05:36 < ningu> hrm
05:36 < ningu> I don't think that will work but let me try it
05:36 < ChrisPartridge> http://expressjs.com/api.html#app.locals
05:37 < ningu> ChrisPartridge: I don't have access to req for setting app.locals
05:37 < ningu> this is per request and the errors are generated *in the routes*
05:41 < ningu> ChrisPartridge: my current solution is (1) custom middleware setting res.locals.flash = req.flash; (2) jade template for rendering flash which has the following logic:
05:41 < ningu> f = flash()
05:41 < ningu> - var haveFlash = Object.keys(f).length > 0
05:41 < ningu> if haveFlash
05:42 < ningu> but what I want is to not pass in the flash() function, but rather to have a final step just before jade is called to set locals
05:42 < ningu> and I don't want to add that logic to all of my routes
05:42 < ChrisPartridge> ningu: ah i see.. isn't there already a use contrib. module to do that stuff?
05:42 < ChrisPartridge> s/use/user
05:43 < ningu> ChrisPartridge: yes, that's what I'm using
05:43 < ningu> that's what provides the flash() method
05:43 < ningu> but I wish I didn't have to do the ugly Object.keys stuff
05:44 < ChrisPartridge> ningu: ah, ok - perhaps use a partial?
05:45 < ningu> you mean using express-partials?
05:45 < ningu> I don't really see how that would solve the issue
05:46 < JamesMGreene> Can anyone recommend a big tutorial on using Node.js streams/buffers on binary files and/or to detect file encoding when uncertain?
05:46 < JamesMGreene> ^ isaacs, mbalho, Nexxy, ryah
05:47 < JamesMGreene> big = good
05:47 < JamesMGreene> whoops
05:49 < ChrisPartridge> ningu: looks like partials was removed in 3.0, i was asumming including a partial would be easier than inserting the logic in your templates
05:52 < JamesMGreene> Can anyone recommend a good tutorial on using Node.js [v0.8.x compatible] streams/buffers on binary files and/or to detect the correct file encoding when uncertain? Anyone? Anyone? Bueller?
05:53 < ningu> ChrisPartridge: I think the way I'm doing is it about as good as you can do it
05:53 < ningu> JamesMGreene: https://github.com/mooz/node-icu-charset-detector
05:53 < ChrisPartridge> ningu: Yeah.. flash takes me back to the ol MVC days, glad I'm focused on single page apps these days :-)
05:54 < ningu> hehe
05:54 < JamesMGreene> ningu: Thanks but modules with external non-cross-platform dependencies aren't acceptable for me
05:55 < soldair> is anyone else getting epeerinvalid installing anything with flatiron in it somewhere?
05:55 < ningu> JamesMGreene: charset detection is not a simple matter, I doubt you'll do better than ICU
05:56 < JamesMGreene> Understood, yet I cannot rely on something with external non-cross-platform dependencies
05:57 < ningu> then you might look at the code for icu and see how it does it, and port it
05:57 < JamesMGreene> Yeah I seem to be doing a lot of that lately :-|
05:58 < ningu> btw does anyone have suggestions for a good validation library?
05:58 < ningu> s/library/module/
06:00 < defaultro> hey folks, I need some extra hands. Looks like my node.js is incomplete. I cannot get uglify to install
06:02 < defaultro> should I remove all the node-js that I see when I run rpm -qa|grep node-js? Looks like my version I have is very old. 0.6
06:02 < Gambit-> anyone know of a tool to convert all 'require(...)' statements in a bunch of js into inline js?
06:03 < jesusabdullah> oh yeah, don't use the rpm or anything
06:03 < Gambit-> (yes, I know that will be hugely large)
06:03 < jesusabdullah> defaultro: you want to install from sauce, on a fedora system you just need to install gcc and gcc-c++
06:03 < defaultro> i have those
06:03 < jesusabdullah> Gambit-: what are you "actually" trying to do?
06:03 < defaultro> i'm runnign yum remove nodejs now
06:03 * Gambit- looks at his stopwatch, "I'm surprised it took someone that long to ask!"
06:03 < defaultro> then i'll install from source
06:03 < jesusabdullah> defaultro: word then it's just a download, untar, ./configure && make && make install !
06:03 < defaultro> yup
06:03 < defaultro> thanks for the confirmation
06:04 < jesusabdullah> Gambit-: seriously though I might have some legit advice for you
06:04 < jesusabdullah> Gambit-: I'm not looking to hate here
06:04 < Gambit-> totally, let me type.
06:04 < Gambit-> jesusabdullah, I need to package up npm modules and embed them all in the node binary, as when I run it, it won't have access to the filesystem.
06:05 < jesusabdullah> that sounds like a significantly larger problem
06:05 < defaultro> once it's installed, I should be able to execute npm install uglify, correct?
06:05 < Gambit-> so it's easy for one-file things because the built in module support can handle single-file require statements
06:05 < jesusabdullah> defaultro: in theory! but do it with sudo and -g
06:05 < defaultro> k
06:05 < JamesMGreene> Gambit-: Check out browserify? https://github.com/substack/node-browserify
06:05 < Gambit-> but as soon as you get into relative-directory require's, i.e. require('./lib/client'), things get fugly.
06:05 < Gambit-> JamesMGreene, will do.
06:05 < jesusabdullah> Gambit-: I was going to suggest browserify for browser support, I really don't know if it'll do what you need for your use case
06:05 < Gambit-> iiiinteresting
06:05 < jesusabdullah> Gambit-: it's really browser targeted
06:06 < JamesMGreene> Yeah but it's goal is to smash `require`s into 1 file so it still sounds pertinent
06:06 < jesusabdullah> Gambit-: ooc why won't you have fs access? whaty's the end goal of this single-binary derployment?
06:06 < Gambit-> yeah, but that might be just the bullshit batguano insane kinda thing.
06:06 < jesusabdullah> Gambit-: JamesMGreene: Keep in mind browserify 2.0 was refactored to multiple parts for greater hackability
06:06 < Gambit-> jesusabdullah, that is a non-trivial question to answer, suffice to say I am doing weird oddball things to node.js such as embedding it into a larger more established application in a weird environment.
06:07 < Gambit-> what do you mean by that?
06:07 < jesusabdullah> Does sound weird alright Gambit- would love to hear the story and I have time
06:07 < Gambit-> ask me next time you see me on channel and I'll tell you about it
06:07 < substack> Gambit-: npm install -g module-deps browser-pack
06:07 < Gambit-> right now I'm kinda on a time crunch before the missus gets home and my work time disappears.
06:07 < substack> module-deps main.js | browser-pack > bundle.js
06:07 < substack> gets you 80% of what browserify is under the hood
06:08 < defaultro> where do I put the -g, after install or before install
06:08 < JamesMGreene> (so says the creator of browserify)
06:08 < substack> skipping over some of the more browser-specific parts
06:08 < Gambit-> JamesMGreene, he'd probably know :)
06:08 < JamesMGreene> indeed :)
06:08 < jesusabdullah> which is probably what you want to do anyway (skip the browser parts I mean)
06:08 < substack> or you can try using just browserify
06:08 < Gambit-> substack, for my own info, what are the browser-specific things that it'd be avoiding?
06:08 < substack> there's also transforms if you need to inline static assets
06:08 < substack> Gambit-: detection of process.nextTick() and global
06:09 < substack> inserting browser-specific shims for those
06:09 < substack> which you can turn off in browserify proper with --dg=false
06:09 < Gambit-> I don't think I need inline static assets, as the only "fs" access will be through require, I believe.
06:09 < Gambit-> and yeah, I do /not/ want to modify process.nextTick()
06:10 < substack> ok so you can just do browserify main.js --dg=false > bundle.js then
06:10 < substack> see if that does what you need
06:10 < Gambit-> should I not bother with the "module-deps main.js | browser-pack > bundle.js", then?
06:11 * Gambit- wonders why npm keeps hanging on his system...
06:15 < defaultro> npm is failing
06:15 < Gambit-> well I ctrl-c it and restart and it works fine.
06:15 < defaultro> installation was successful.
06:15 < Gambit-> it's always just the first time.
06:16 < defaultro> line 2 of /usr/local/bin/npm starts with a semicolon. Is that ok?
06:17 < Gambit-> oh ffs.
06:17 < Gambit-> " throw new Error('Cannot switch to old mode now.');" when I try to run module-deps
06:17 < Gambit-> ah, no
06:17 < Gambit-> when I try to run browser-pack
06:18 < ChrisPartridge> Gambit-: are you on windows?
06:18 < Gambit-> nope
06:18 < Gambit-> centos EL6
06:18 < Gambit-> or redhat
06:18 < Gambit-> something like that.
06:18 < defaultro> also, I am not sure why my /usr/local/bin/npm is looking for /usr/bin/npg
06:18 < defaultro> also, I am not sure why my /usr/local/bin/npm is looking for /usr/bin/npm
06:19 < Gambit-> *tries browserify*
06:19 < Gambit-> substack, have you tested against 0.9.10?
06:19 < defaultro> or maybe, I am running it incorrectly. How do you install ugilfy using the latest version of Node.js?
06:19 < SomeoneWeird> npm install -g uglifyjs
06:20 < defaultro> npm is failing though
06:20 < substack> Gambit-: I recommend against the 0.9/0.10 stuff until the dust settles
06:20 < defaultro> it's saying, /usr/bin/npm: no such file or directory
06:20 < defaultro> however, I have /usr/local/bin/npm
06:20 < Gambit-> substack, I'm kinda committed to it, I'm afraid.
06:21 < defaultro> when I run which npm, it points me to /usr/local/bin/npm
06:21 < defaultro> it's good now
06:21 < defaultro> I logged out. I knew it was environment
06:23 < defaultro> http://pastie.org/6486145
06:23 < Gambit-> substack, dg=false didn't seem to remove the process replacements.
06:24 < defaultro> it's good
06:24 < defaultro> i added a dash
06:24 < defaultro> it's installed now :)
06:26 < Gambit-> oh, it wasn't supposed to.
06:28 < defaultro> are there warnings fine for the uglified file? http://pastie.org/6486154
06:28 < defaultro> are these warnings fine for the uglified file? http://pastie.org/6486154
06:30 < substack> Gambit-: can you paste exactly the command you're trying?
06:30 < Gambit-> for browserify or browser-pack?
06:32 < Gambit-> "./module-deps volt_test.js | ./browser-pack > bundle.js" and " browserify volt_test.js --dg=false > bundle.js
06:37 < Gambit-> substack, can you explain that first line on what browserify outputs?
06:37 < Gambit-> and how it specifically interacts with 'require', since I need 'require' to still be able to work for normal builtins like 'http'?
06:40 < sshaginyan> DO you guys know of a library that builds json paths instead of me manually doing it? For example I want a path services.structure.category.v3. So the library would do {services:{structure: {category{v3}}}}
06:43 < substack> Gambit-: oh the problem is that you're getting browser-specific versions of http
06:43 < Gambit-> I haven't actually tried using this yet.
06:43 < defaultro> maybe, in order for me to learn node.js is to write an example code that is connected to a mysql db via php. Is that a good exercise?
06:44 < substack> Gambit-: try -i http
06:44 < substack> and whichever other modules you don't want wrapped
06:44 < Gambit-> substack, well I want to use all of the /other/ stock ones.
06:44 < Gambit-> like, net and so forth.
06:44 < substack> those too
06:44 < Gambit-> can I do -i process?
06:44 < substack> Gambit-: --dg=false should turn that off
06:45 < Gambit-> no, the first entry is still the process overloads.
06:45 < sshaginyan> Like is there a library that takes a string with periods in them and makes object based off the periods "hello.bye" makes hello:{bye:{}}
06:46 < Gambit-> sshaginyan, how about json?
06:46 < sshaginyan> what?
06:46 < sshaginyan> Gambit-: HOw about computer?
06:47 < Gambit-> sshaginyan, sorry, not fully reading it. If you use the json parsers, you get back javascript objects that you can [] on.
06:47 < sshaginyan> json parsers?
06:47 < Gambit-> er, yes.
06:48 < Gambit-> http://stackoverflow.com/questions/4935632/how-to-parse-json-in-javascript
06:54 < defaultro> hey folks, how do I run a node.js application? I tried node HelloWorld, it faileed
06:57 < defaultro> I got it working, I had to include the .js extension
07:07 < [jasper]> morning people
07:15 < Gambit-> substack, yeah, the right mix of these technologies would be something that, on an unknown module, uses the default 'require' implementation.
07:17 < Daynab> Hi everyone, I have what is probably a newbie problem - after updating to 0.10.0, I can't use any apps on localhost with the old http.createServer.listen(8080 or whatever port) method, it just tries to load and never does. Yet when I revert to 0.8.22 everything is fine.
07:17 < Daynab> has something changed that I dont know about?
07:20 < timeturner> is anyone working with flexbox atm?
07:20 < timeturner> was thinking about trying it
07:22 < Gambit-> hm, damnit, didn't realize 0.10.0 had come out. That's not going to be a fun upgrade.
07:22 < timeturner> why not
07:22 < timeturner> I'm running on 0.10.0. no issues so far
07:22 < Gambit-> oh, special cases that apply to me, and no one else. Don't worry about it
07:23 < timeturner> cool
07:23 < Gambit-> :)
07:37 < Gambit-> anyone awake I can borrow for a moment?
07:39 < SomeoneWeird> Gambit-, wassup
07:40 < timeturner> lots of people awake
07:42 < Gambit-> SomeoneWeird, can you "npm install module-deps browser-pack" on, by preference, a 0.8 version of node, and then execute this: echo "var t = require('./t1');" > t.js; echo "module.export = {'a':2};" > t1.js; module-deps t.js | browser-pack > tb.js
07:44 < SomeoneWeird> Gambit-, yah, now what?
07:44 < Gambit-> toss tb.js up on a pastebin?
07:45 < SomeoneWeird> http://pastie.org/6486655
07:45 < Gambit-> awesome, thank you so much :)
07:45 < SomeoneWeird> $ node --version
07:45 < SomeoneWeird> v0.8.18
07:45 < SomeoneWeird> np
08:07 < MI6> joyent/libuv: piscisaureus created branch v0.10 - http://git.io/fBKIEA
08:25 < andrew12> web scale
08:34 < ningu> I hope grunt is done changing the format of all of its config files, again
08:34 < [AD]Turbo> hi there
08:42 < faceleg|sleep> h
08:42 < faceleg|sleep> i
08:56 < exoon> hi. Does anyone know a good tutorial for node-inspector. All I find is to old and things have changed to much.
09:01 < exoon> I can start node-inspector and it is using the right source file, as I can see on Local:__filename, but it is not diplaying any source. I cant find any button for "continue" "step" ... or similar.
09:01 <@Nexxy> exoon, are you running anything in debug mode?
09:02 < exoon> Nexxy, node --debug-brk test.js
09:02 < exoon> and node-inspector &
09:03 <@Nexxy> strange indeed
09:03 < exoon> Do I need any special code in the test.js?
09:03 <@Nexxy> no, you shouldn't
09:03 <@Nexxy> are you going to http://127.0.0.1:8080/debug?port=5858 ?
09:03 < exoon> yes
09:04 -!- mode/#Node.js [+o piscisaureus_] by ChanServ
09:04 <@Nexxy> and I assume you've refreshed a few times
09:04 <@Nexxy> oh, also
09:04 < exoon> f5 many times :)
09:04 <@Nexxy> `node-inspector &` before you run the app?
09:04 < exoon> no, after
09:04 <@Nexxy> try it the other way around
09:05 < faceleg> ningu: you there?
09:06 < faceleg> or any other C++ aficionado?
09:06 < ningu> yeah
09:06 < faceleg> you know C++ right
09:06 < ningu> for certain values of know
09:06 < faceleg> in the header one does class name { void someFunc(); }
09:06 < exoon> Nexxy, no difference
09:07 < faceleg> how might I structure the implementation so I don't have to write name::someFunc() { } ?
09:07 < ningu> faceleg: huh? you mean in code that's using the header?
09:07 < faceleg> or is that just how everyone does it despite the ugliness
09:07 < faceleg> I have class.h
09:07 < faceleg> I'll make a hastie
09:08 < ningu> ok
09:10 < faceleg> ningu: http://hastebin.com/xesenopida.py
09:10 < ningu> afaik that's just how you have to do it
09:10 < faceleg> lame
09:11 < ningu> there are namespaces but that won't solve that particular issue
09:11 < faceleg> yeah
09:11 < exoon> Nexxy, I tried with chromium and it works. What is wrong with firefox?
09:11 < faceleg> ningu: thanks for confirming
09:12 < exoon> Requirements: A WebKit based browser: Chrome, Safari, etc.
09:13 < faceleg> firefox is not webkit
09:13 < faceleg> "gecko" I think they call their engine
09:14 < ningu> earthquake is called what we just had
09:14 < exoon> yes, firefox is gecko. Are there non-standard html-tags in webkit?
09:14 < faceleg> exoon: why non standard html tags? not sure what that has to do iwth node-inspector
09:16 < exoon> faceleg, hm, my question was unclear. node-inspector must use something special (I actually don't know what it is) that is not in the html-standard.
09:18 < exoon> ok, I see. WebKit extends the html with own functions. That is new for me.
09:20 < faceleg> exoon: where did you find that, link?
09:25 < alex00888> Hi all! Does anyone know when 0.10 appear in ubuntu repository? (ppa:chris-lea/node.js)
09:26 < exoon> faceleg, in the german wikipedia I found a hint that there are 3d-functions (web-gl) implemented to webkit.
09:26 < exoon> but google show not much information about webkit.
09:28 < faceleg> exoon: yeah I couldn't find much
09:29 < kanyl> What's the fastest way to check if there is any non-zero value in a buffer?
09:31 < exoon> faceleg, I see three js-files (devtools.js - /socket.io/socket.io.js and node/Overrides.js). No-WebKit-Browser must have problems with them.
09:32 < exoon> faceleg, google for devtools.js
09:32 < faceleg> exoon: this? https://sites.google.com/a/chromium.org/dev/devtools
09:34 < exoon> faceleg, yes. I will take a look on it later. But ... I remember, I only want to debug my code.
09:34 < faceleg> lol
09:34 < exoon> always the same - so many interessting things
09:35 < faceleg> exoon: yes
09:37 < exoon> have to run, bye
09:37 < gildean> alex00888: might take up to a week or more, it's not an official repo
09:41 < faceleg> ningu: there?
09:41 * faceleg in a whingey tone
09:42 < ningu> hehe
09:42 < ningu> yeah still here
09:42 < faceleg> I've made a header file functions.h
09:43 < faceleg> and included it fine used it blah
09:43 < ningu> ok
09:43 < faceleg> but when I include it in two different implementation files
09:43 < faceleg> I'm getting duplication errors on compile
09:43 < bitfed> How can I identify which version of express I have installed?
09:43 < faceleg> ningu: duplicate symbol __Z17stringArgToStringN2v85LocalINS_5ValueEEE in:
09:44 < ningu> faceleg: that looks more like a linking error
09:44 < faceleg> then the two classname.o files that have include statements for the functions.h file are listed
09:44 < ningu> hmmm
09:44 < ningu> you might be including it more than once somehow in a file
09:44 < faceleg> mmm
09:44 < ningu> you could try wrapping it in #ifndef FOO_H #define FOO_H #endif
09:44 < faceleg> ugh yeah
09:44 < bitfed> Can someone please tell me how I can identify which version of express I have installed?
09:44 < ningu> if you know that convention
09:45 < faceleg> yep
09:45 < faceleg> I removed a bunch from this codebase
09:45 < faceleg> only similar language I've worked with is Objective C, never run into a similar issue there
09:45 < faceleg> (with xcode)
09:47 < faceleg> #ifndef doesn't solv eit, same error
09:47 < ningu> hmm well I don't know offhand
09:47 < faceleg> ningu: the relevant functions.h http://hastebin.com/tafabixime.vala
09:47 < faceleg> ah well
09:47 < faceleg> thanks :)
09:47 < ningu> will take a look
09:48 < ningu> umm
09:48 < ningu> you only declare functions in headers, you don't define them, silly
09:48 < faceleg> lol
09:48 < ningu> you need foo.h and foo.cc, and just declare it in foo.h
09:49 < ningu> yes, this is tedious
09:49 < faceleg> yeah doing that now
09:49 < faceleg> damn I thought I could be clever and just chuck useful functions in one file
09:50 < ningu> well, the problem is then the two files each declare their own function with the same name and you can't link the whole thing
09:50 < faceleg> yeah I see that now
09:50 < ningu> it isn't smart enough to realize they're the same
09:50 < faceleg> never occurred to me
09:50 < faceleg> well neither was I so fair enough
09:50 < ningu> #include basically is like: paste this file in
09:50 < ningu> so the functions really are duplicated by the time they get to the compiler
09:51 < faceleg> I didn't know that, makes sense now
09:51 < ningu> #include is in the preprocessor
09:51 < ningu> all of the #foo things are
09:51 < ningu> #define A B basically means: search/replace all A's with B
09:51 < ningu> so if you want to be really annoying you can do stuff like #define BEGIN {, #define END }
09:52 < faceleg> I try not to annoy myself too much
09:52 < faceleg> so I think I'll pass
09:52 < faceleg> well that comiled, thansk!
09:53 * faceleg has sausage fingers
09:53 < ningu> hehe
09:53 < ningu> snag fingers?
09:53 < faceleg> snag?
09:53 < ningu> isn't that a kind of sausage?
09:54 < faceleg> no idea
09:54 < faceleg> I'm poor
09:54 < faceleg> beef, pork that's all I know
09:54 < ningu> that's another word an aussie friend taught me
09:54 < faceleg> and then only from looking through shop windows ;)
09:54 < faceleg> ah
09:54 < faceleg> we have different slang
09:54 < faceleg> i.e. ours is good, theirs sucks
09:54 < ningu> probably all rhymes
10:03 < faceleg> thanks for all your help lately ningu, I really do appreciate it
10:05 < ningu> hehe np
10:05 < ningu> you're lucky I'm on at odd hours of the night over here
10:05 < faceleg> yeah
10:05 < faceleg> in about 2.5 hours bnoordhuis will come on
10:05 < faceleg> you work in shifts
10:06 < ningu> where is he?
10:06 < faceleg> no idea
10:06 < ningu> europe probably
10:06 < faceleg> maybe europe, scandanavian country
10:06 < ningu> his name is dutch but that doesn't really help locate where he is
10:19 < faceleg> damn
10:19 < faceleg> I just solved my own problem by talking to muself in the #libgit2 room
10:19 < faceleg> I'm the best at appearing strange
10:23 < ningu> faceleg: have you found a C++ channel too?
10:24 < faceleg> yeah but it's always so full
10:24 < faceleg> and I've never lacked help from this channel
10:24 < faceleg> I'm usually in #v8, #node.js and #libgit2
10:28 < TheLink> hi
10:29 < faceleg> 2hi
10:29 < TheLink> does anyone know if forever ( https://github.com/nodejitsu/forever ) is compatible with node 0.10?
10:31 < faceleg> sorry I don't
10:31 < faceleg> have you tried it?
10:35 < TheLink> yes
10:36 < TheLink> but I can't get "forever list" or "forever stop" to work
10:36 < TheLink> nothing happens
10:36 < faceleg> then I'd say it's not compatible
10:36 < faceleg> open an issue on the forever github page describing your troubel
10:36 < TheLink> starting a node script seems to work though
10:37 < Kakera> https://github.com/nodejitsu/forever/issues/392
10:37 < TheLink> I'm also very new to node.js
10:37 < faceleg> it's not compatible
10:37 < ningu> TheLink: maybe best to stick with 0.8 till everyone updates their packages
10:42 < TheLink> ok, I will
10:42 < TheLink> thanks
10:42 < TheLink> ah
10:43 < TheLink> ok, should have searched there myself
10:43 < TheLink> thanks a lot!
10:43 < TheLink> will just wait
10:44 < TheLink> ninegrid: I just installed it on a new server
10:44 < TheLink> it's just for experimenting
10:44 < TheLink> not production
10:48 < Kakera> what does the standard say about this? http://privatepaste.com/858f0aa15b
10:48 < Kakera> it compiles fine in g++, but not msvc
10:48 < Kakera> the latter complains about an undeclared identifier
10:48 < Kakera> oops wrong channel
10:51 < faceleg> ningu: that's one for you
10:51 < ningu> http://en.wikipedia.org/wiki/Anonymous_function#C.2B.2B
10:52 < ningu> that's some really ugly syntax there
10:52 < faceleg> you mean c++?
10:52 < faceleg> generally?
10:52 < ningu> specifically that lambda syntax
10:53 < ningu> there's a lot of new stuff in C++11 that I don't know about
10:53 < ningu> and it seems like the language just has more stuff in it now than makes it easy to keep track of, as far as the syntax goes
10:53 < ningu> C is a piece of cake in comparison
10:54 < faceleg> I've not touched C++ for 5 years
10:54 < faceleg> I come back it's like a new language
10:54 < faceleg> a new, horribler language
10:54 < ningu> well, I don't know if it's worse, it's good to have lambdas
10:54 < ningu> but...
10:54 < Havvy> That's not actually too ugly of a sytnax.
10:54 < faceleg> I mean to look at
10:54 < Havvy> *syntax.
10:55 < Havvy> In fact, I actually like it.
10:55 < ningu> Havvy: I find the [] to be strange, and -> int to specify the return value is very un-C
10:56 < Havvy> Seeing that there is nowhere else to really through the return value type...
10:56 < ningu> why not int [](int x)?
10:56 < ningu> maybe there are parsing issues
10:57 < Havvy> The [uses] clause is weird, but it saves needing to have another keyword like PHP.
10:57 < ningu> well, I don't know PHP at all
10:57 < Havvy> int [](int x) looks like an int[].
10:57 < ningu> ahh... yes, that's true.
10:58 < ningu> and I guess they couldn't use () because you define function pointers that way
10:58 < Havvy> function name (parameters) uses (closures) { actual function body; }
10:58 < Havvy> For PHP
10:58 < ningu> hmm ok
10:59 < ningu> also, and this isn't a new thing, I find the value-reference-pointer distinctions in C++ to be quite confusing. it can be really un-obvious whether something is by reference or value unless you look back to where it's declared
10:59 < ningu> and reference vs. pointer is basically the same thing with different syntax
11:00 < Havvy> Yeah...I don't see the need for references in C++ either.
11:00 < ningu> I prefer how js and various other languages do it where everything is by reference except for certain primitive types
11:00 < ningu> the use case for complex types by value is thin anyway
11:00 * faceleg agree it's confusing
11:00 < ningu> and you can always define foo.clone() or whatever
11:01 < ningu> Havvy: well, it does save a lot of asterisks and ampersands...
11:01 < ningu> but it causes a lot of potential for confusion
11:02 < Havvy> ningu: It passes those ints and strings by reference...it's just that they are immutable.
11:02 < ningu> which ints?
11:02 < Havvy> JS
11:02 < faceleg> ningu: when you two adults have finished talking I have another noob question
11:02 < ningu> is that really true? a function that takes an integer argument can't change it?
11:02 < Havvy> There's no distinction between passing by reference/value for immutable values.
11:03 < ningu> I mean change it locally obviously
11:03 < Havvy> ningu: It can rewrite the value of the variable, but it can't change the properties of the integer itself.
11:03 < Havvy> faceleg: Just ask.
11:03 < ningu> err... what's the difference?
11:03 < Kakera> a++ is the same as a = a + 1 which means "a now references a new object with the value of a + 1"
11:03 < ningu> I guess there are boxed vs. unboxed types in js which I just learned about
11:04 < Havvy> ningu: The point is that there is no difference. ;)
11:04 < faceleg> I'm wrapping this function: http://libgit2.github.com/libgit2/#HEAD/group/diff/git_diff_foreach, and want to use static methods on my class for the callbacks. is this possible?
11:04 < faceleg> I've declared the first like: http://hastebin.com/rejepiqopo.cpp
11:05 < ningu> faceleg: don't see why not
11:05 < faceleg> but get this error http://hastebin.com/letihexala.coffee
11:05 < faceleg> on compilation
11:05 < faceleg> how do I declare my static methods to be "git_diff_file_cb" functions? https://github.com/libgit2/libgit2/blob/HEAD/include/git2/diff.h#L301-304
11:06 < ningu> your callback needs to return int
11:06 * faceleg facepalm
11:06 < faceleg> honestly, am I an idiot?
11:06 < ningu> oh, umm... yeah, there's a way to do that too
11:06 < faceleg> what is that way?
11:06 < ningu> I can't remember how you declare a function using a type that's been defined
11:07 < ningu> hrm
11:07 < ningu> actually, I think you can't
11:08 < faceleg> no matter, your first suggestion was perfect
11:08 < ningu> you can declare a function pointer to be of that type, so: git_diff_file_cb cb;
11:08 < ningu> but to define the callback itself, you're going to need to name your function parameters
11:08 < ningu> and the type doesn't specify names for the parameters
11:08 < Kakera> or use a lambda and rely on the implicit return type
11:08 < faceleg> Kakera: there are 3 callbacks
11:08 < Kakera> so?
11:08 < faceleg> so I'd rather have them as separate methods
11:09 < faceleg> for tidiness
11:09 < ningu> Kakera: ok, but how would you declare a function with the signature of git_diff_file_cb?
11:09 < ningu> without just writing out the full signature
11:09 < Kakera> you can't omit the signature, just the return type
11:09 < ningu> ah ok
11:09 <@Nexxy> how to name tech talks
11:10 < ningu> but if he's not going to use a lambda then he needs to specify that too I'd think
11:10 < Kakera> yeah
11:11 < leehambley> hi all - can anyone suggest why this worked yesterday, but today throws this error: http://pastie.org/private/72btdhzpg7onltujhgxfpq
11:11 < leehambley> I don't even know which package is failing (not really a node user, I've just got to get this app booting)
11:12 < faceleg> leehambley: looks like hawk 0.10 isn't compatible with your version of node (0.6.5)
11:12 < ningu> faceleg: https://code.google.com/p/tortoisesvn/source/browse/branches/GitTest/ext/libgit2/src/diff_output.c?spec=svn23908&r=23908
11:12 < leehambley> hawk hasn't been updated for days though
11:12 < ningu> there's an example there
11:13 < faceleg> ningu: thanks that looks helpful
11:13 < faceleg> my dreams of finishing this bit tonight are dead
11:14 < leehambley> thanks faceleg; how do I find out which pacakge from my package.json (which I know should have been shrinkwrapped) is pulling in hawk ?
11:14 <@Nexxy> you can do it faceleg
11:14 <@Nexxy> I believe in you
11:14 < faceleg> leehambley: leehambley https://github.com/hueniverse/hawk/blob/master/package.json#L16
11:15 < faceleg> Nexxy: nah I can't, I have to go to bed early (< 1.30AM)
11:15 < ningu> leehambley: I don't know but I have a video of an eagle and a fox in alaska if you want
11:15 < leehambley> right, but when installing via npm, npm.org says that hawk was updated 8 days ago
11:15 < faceleg> leehambley: requires node .8+
11:15 < faceleg> yes but that is irrelevant
11:15 < leehambley> so I'm assuming he hasn't packaged the most recent git code to npm yet
11:15 < faceleg> irrelevant
11:15 < faceleg> it required ndoe .8
11:15 < faceleg> you have node .6
11:15 < faceleg> solution: upgrade your node
11:15 < leehambley> I can't
11:15 < faceleg> what system are you running this on
11:16 < faceleg> well... then you won't be able to use .10 hawk
11:16 < leehambley> ubuntu, but I can't upgrade anything, I need to just lock all versions at "whatever worked yesterday"
11:16 < leehambley> because it was working, npm install, with the same package.json workedyesterday
11:16 < leehambley> so the 8-day old change to hawk at Github probably isn't (directly) related
11:16 < faceleg> well soemthing changed
11:16 < leehambley> I'm looking more at the 14 hour old change to `request`
11:17 < leehambley> (which depends on hawk)
11:17 < faceleg> oh yeah missed that one
11:17 < leehambley> then I suppose the question is how I can pretend that versino doesn't exist, and shrinkwrap my package json
11:18 < faceleg> https://github.com/mikeal/request/commit/62455bca81e8760f25a2bf1dec2b06c8e915de79
11:18 < faceleg> 10 days ago the required hawk version was updated
11:18 < leehambley> but if *that* is 10 days old, how is that affecting things, presumably he's only just released that version of the Git code to npm ?
11:18 < faceleg> define "he"
11:18 < leehambley> mikeal
11:18 < faceleg> it's affecting things because when you npm install
11:19 < faceleg> npm generates a dependency tree based on the package.json files in all projects mentioned in the root package.json
11:19 < faceleg> then it tries to install said dependencies
11:19 < faceleg> request dev updated hawk to .10 ten days ago
11:19 < faceleg> you npm install
11:19 < faceleg> this fails because request now requires hawk .10, which in turn requires node .8
11:20 < leehambley> yeah, but that's the thing, we've a testing VM, and it gets reset back to a blank state, and then we install this app, we've been reinstalling that vm 15 times a day, with the same (node) software for two weeks, no problems until today
11:20 < faceleg> when was the last time you npm installed?>
11:20 < leehambley> ~16 hours ago
11:20 < leehambley> and it worked
11:20 < leehambley> (no shrinkwrap)
11:20 < leehambley> the exact same code, doesn't work this morning
11:20 < faceleg> might be that request didn't push changes to npm until < 16 hours ago
11:20 < ningu> request was updated for compatibility with node v0.10
11:20 < faceleg> push to github != push to npm
11:20 < leehambley> alright, but didn't you just say that the fact things were different at GH and Npm.org were irrelevant ?
11:21 < faceleg> no I meant the date things were changed didn't matter
11:21 < faceleg> I shouljd have said that what matters is *what* was changed
11:21 < faceleg> but I'm tired and generally confusing
11:22 < ningu> leehambley: are you unable to just put a different version of request in your package.json?
11:22 < ningu> because something else is including it?
11:22 < leehambley> I just need to know which the last working version was, basically - but yeah *something* else is pulling request in
11:22 < leehambley> maybe if I also ask for request, and try and lock it at 2.2.0 it'll play nicely
11:23 < ningu> yeah, that's a thought
11:24 < faceleg> mmm
11:25 < leehambley> thanks for the help chaps, that worked
11:25 < faceleg> yy!
11:25 < faceleg> yay*
11:25 < leehambley> would be nice to know what was requiring request = newest
11:26 < leehambley> but at elast the version constraint is lose enough
11:26 < leehambley> I'd say it's bad form on the request maintainer to change version dep that much
11:46 < Siyfion> is anyone else experiencing issues with node-inspector since upgrading to v0.10.0?
11:56 < MI6> joyent/libuv: Ben Noordhuis v0.10 * 9f714a1 : include: bump UV_VERSION_MINOR Fixes #740. - http://git.io/gcEOaA
11:59 < MI6> joyent/node: Adam Malcontenti-Wilson v0.10 * 028c630 : doc: change dgram to socket for properties of dgram.Socket Fixes #4919. - http://git.io/RTOmDw
12:14 < roxlu> hi guys I'm trying to setup npm to use a local directory for development
12:14 < roxlu> When I run: "npm link" in my development modules, it creates a symlink in node_modules/[my_lib]
12:15 < roxlu> but then when I want to use in an application it tries to fetch the module from internet
12:17 < roxlu> isaacbw: are you around?
12:17 < SomeoneWeird> roxlu, ?
12:38 < rickibalboa> Say I was to wrap the entry point for my program in a domain.run() call, would the rest of the code in my program be covered by this domain?
12:41 < syskk> rickibalboa: what are you referring to? I've never heard of domain.run()
12:42 < rickibalboa> syskk: http://nodejs.org/api/domain.html#domain_domain_run_fn
12:42 < syskk> damn, surprised ive never read that :o
12:43 < rickibalboa> It's just a new feature, experimental or something. Neat though well worth checking out.
12:45 < syskk> seems interesting
12:45 < syskk> I guess the answer to your question is yes
12:45 < syskk> apart from modules you load before calling domain.run
12:45 < rickibalboa> I'm thinking that too, although I just wanted a certain answer - I may do some testing.
12:45 < rickibalboa> Yeah
13:02 < asdf12> good morning
13:07 < Sven_vB> hi :)
13:07 < Sven_vB> how do americans call the inequality '' !== 0? is it type-discerning?
13:07 < Havvy> stict equality
13:08 < AAA_awright> Americans?
13:09 < AAA_awright> Sven_vB: It's called strict equality in ECMAScript
13:09 < Sven_vB> wouldn't that be prone to confusion with the mathematical strict? afaik for math, integer 0 is strictly equal to float 0.0
13:10 < Sven_vB> oh, i should have said, the spec i'm writing is not confined to JS folkes
13:10 < Sven_vB> *folks
13:10 < Sven_vB> "Americans" as in speaking american english :)
13:11 < Havvy> >> 0 === 0.0
13:11 < purr> Havvy: (boolean) true
13:14 < Sven_vB> >> 1 === 1.00000000000000001
13:14 < purr> Sven_vB: (boolean) true
13:14 < Sven_vB> oh, seems to run on a 64 bit machine or something :)
13:15 < Sven_vB> >> 1 === 1.000000000000000000000000000000000000001
13:15 < purr> Sven_vB: (boolean) true
13:15 < Sven_vB> scratch that about 64 bit, didn't read right
13:16 < Havvy> >> 1.00000000000000001
13:16 < purr> Havvy: (number) 1
13:16 < Sven_vB> well float precision wasn't the idea anyways... i'll try and find a language that discerns ints and floats and ask there. ;)
13:17 < Havvy> Most of them don't have a difference between == and ===
13:17 < Havvy> Type coercion is a language-level error.
13:18 < Havvy> Since they don't need to make the distinction, they just call it equality.
13:18 < Sven_vB> maybe actually i shouldn't specify number types to be discerned.
13:24 < pellis> hey guys. wanted to share a finding with you - GraphicsMagick using 'gm' is IMMENSELY faster than ImageMagick and 'imagemagick' modules. I just cut 1200ms to 10ms in every call
13:25 < pellis> this may be a bug - but I found that ImageMagick becomes 1,2- 6 SECONDS slow when you are issuing a series of call (100s) through nodejs
13:25 < Dspriggs> What is the best method to define global constants in a node app? Is it ok to use global.xxx?
13:26 < Bergle_2> Dspriggs id use the value type of injectable
13:27 < Bergle_2> angular.module('myModule', []).value('a', 123) then 'a' becomes injectable anywhere injectables are allowed
13:28 < Bergle_2> you could use invidiual identifiers, or a structure like .value('conf', { a: 1, b: 2, etc: 'string' })
13:28 < asdf12> Dspriggs: no it's not ok unless you know what you are doing
13:29 < Dspriggs> Fair enough, thanks guys!
13:31 < asdf12> but yea, depending on what you want to make global you could use a shell env or process argv
13:31 < asdf12> or use DI
13:36 < Sven_vB> maybe it would be better to make a module, and import that everywhere like var C = require('myconstants.js');
13:36 < Sven_vB> then use C.xxx instead of xxx
13:37 < Sven_vB> the day will probably come when you realize the extra characters "C." everywhere were a good investment
13:39 < Sven_vB> Dspriggs, --^
13:39 < marcules> hi there :)
13:39 < Sven_vB> hi :)
13:41 < Sven_vB> pellis, thanks for sharing! could you add a remark about that on https://github.com/joyent/node/wiki/modules ?
13:41 < marcules> I'll ask right away ^^ How do you call an alphabetically ranged grouping, i.e. "a to d", "e to h", "i to l"... - it seems that I cannot find the right search term, to find this in my mongoDb
13:42 < Sven_vB> is it about mongodb search queries or do you need a JS array with the letters in range?
13:43 < marcules> eigther way is fine - I'm not sure how to go on about this in general - I'm trying to write an API for my application where you can access this with /api/students/az/4 - for a letter grouping of a range of four
13:43 < marcules> But the bigger problem is, that I'm not sure how this is correctly called
13:44 < Sven_vB> i'd try letter range, alphabetic range, character range
13:45 < Sven_vB> isn't it confusing to have "az" in the url and also "4"? especially when "az" is a range of 26 in LANG=C alphabet
13:45 < marcules> az would be the direction
13:45 < Sven_vB> oh, ok then
13:45 < marcules> a to z, or z to a
13:45 < Sven_vB> then what role is that "4"?
13:46 < marcules> 3 -> [a, b, c] [d, e, f]; 4 -> [a, b, c, d] [e, f, g, h]
13:49 < Sven_vB> *developing*
13:50 < pachet> when the light goes off and he makes a 'bing' sound, that means he's done
13:51 < Sven_vB> >> (function alphabet_ranges(range_len) {
13:51 < Sven_vB> return 'abcdefghijklmnopqrstuvwxyz'.replace(new RegExp('(.{' + parseInt(range_len, 10) + '})', 'g'), '$1:').split(/:/); }(4));
13:51 < purr> Sven_vB: SyntaxError: Unexpected end of input
13:56 < Sven_vB> >> (function alphabet_ranges(range_len) { return 'abcdefghijklmnopqrstuvwxyz'.replace( new RegExp('(.{' + parseInt(range_len, 10) + '})', 'g'), '$1:' ).split(/:/); }(4))
13:56 < purr> Sven_vB: (object) ['abcd', 'efgh', 'ijkl', 'mnop', 'qrst', 'uvwx', 'yz']
13:56 < pachet> seems like a silly case for regex
13:56 < marcules> Sven_vB, my professor said, maybe I could implement a grouping with modulo
13:57 < Sven_vB> jeah... in languages where array lookups happen by numeric index, i'd use array slicing
13:58 < pachet> is there some additional constraint preventing you just looping over the input string?
13:58 < pachet> i joined late, so i mightve missed it, if so
13:58 < Sven_vB> marcules, i think that would be slower, because of the array lookups JS would do are in fact dict lookups by the string representation of the number. for hard facty, try both and compare.
13:59 < Havvy> Sven_vB: Actually, most implementations are a lot faster than dictionary lookup.
13:59 < shesek> Sven_vB, JS engines today greatly optimize numeric index lookups
13:59 < Havvy> It's only when you add named properties to an array that it reverts to normal object lookup.
13:59 < Sven_vB> oh ok
14:00 < shesek> buy technically speaking, according to the spec, all property keys are strings
14:00 < shesek> but its optimized away when possible
14:02 < Havvy> Also, try using + instead of parseInt
14:02 < Havvy> >> +"4"
14:02 < purr> Havvy: (number) 4
14:02 < Sven_vB> however, i can't think of an implementation with modulo that would sort 'abc', 'def', 'ghi' instead of 'adg', 'beh', 'cfi'
14:03 < Havvy> >> [+"4a", parseInt("4a", 10), +"077"]
14:03 < purr> Havvy: (object) [NaN, 4, 77]
14:04 < marcules> Sven_vB, the data is sorted
14:04 < marcules> I would be grouping a group
14:05 < marcules> So I have groups of "a" "b" "c" "d" and would regroup them
14:05 < marcules> I guess
14:06 < Sven_vB> oh maybe he meant to detect with (counter % group_len) when to begin a new group
14:07 < Sven_vB> however, doing a division in each iteration seems slow to me
14:07 < SomeoneWeird> npm still fucked?
14:07 < Havvy> If the modulo/division is a power of two, it won't be slow.
14:08 * pachet still doesnt understand the context and why you're not just walking the string
14:09 < marcules> pachet, I'm trying to get Users from a DB-Query not only grouped by the first character but a range of first characters
14:09 < pachet> ah
14:09 < gaf> hello there, is there any game made with node and socket.io in production, not only an experiment?
14:10 < Sven_vB> gaf, where's the line where experiment ends and continuous beta begins?
14:11 < gaf> not sure, trying to find out.
14:12 < Sven_vB> last year i helped some guy migrate his game server to nodejs, and he was in quite a hurry because the old servers couldn't handle all his players, and thus he wouldn't earn money again until deploying his nodejs game server ... so i guess that one counts as in production
14:13 < gaf> oh cool
14:13 < Sven_vB> it was for board games, which in his country seemed to be as popular as online poker is here
14:13 < gaf> can i play?
14:14 < Sven_vB> unfortunately, i don't know the website where he hosts it
14:15 < gaf> what is the game name?
14:16 < Sven_vB> that i don't know either. we used a generic example of a general game server for my advice
14:16 < Sven_vB> well, as far as generic can go for games
14:17 < shesek> you didn't wonder what game you're helping to develop?
14:18 < Sven_vB> shesek, usually, no. his problems were rather basic, like how to arrange waiting players into groups of enough players to play the game
14:18 < Sven_vB> well ok s/usually/in that case/
14:18 < gaf> i see.... i would like to see a code base of some game as the one you say
14:19 < gaf> maybe is top secret?
14:20 < [jasper]> hej guys, I made this...but it causes a race condition...because the connection isn't done before the return is done
14:20 < [jasper]> http://hastebin.com/bakifatuka.coffee
14:20 < [jasper]> how can I solve this?
14:20 < [jasper]> and make sure that the return for system is only done when the connection is actually mde?
14:21 < Kakera> [jasper], not possible
14:22 < gaf> Sven_vB, is that top secret?
14:23 < Sven_vB> there was this example game about robots shooting each other in a Google I/O talk... does anyone remember if they used NodejS on the backend?
14:23 < Sven_vB> gaf, some of the early stage examples are not, but will it help you to just have some players grouped into teams?
14:23 < [jasper]> Kakera what do you mean not possible?
14:24 < [jasper]> offcourse it's possible
14:24 < gaf> I'm not sure...i think every lil helps.
14:25 < Kakera> [jasper], the connection is made asynchronously and you're trying to return the db object synchronously
14:25 < Kakera> [jasper], imagine the connection takes 10 seconds to establish
14:25 < [jasper]> so I have to change the way it's setup
14:26 < Kakera> yes
14:26 < Sven_vB> gaf, try if http://youtu.be/Prkyd5n0P7k is of help, i think they might have used NodeJS on the server
14:26 < shesek> some database modules queue up requests until the connection is established
14:26 < shesek> but the connection object itself is usable right away
14:26 < [jasper]> nah this is not good :P
14:26 < gaf> thanks
14:27 < [jasper]> there must be a better solution to only return the values when the connection is mde
14:27 < shesek> if the module allows that, there's no reason to wait until the connection is made
14:27 < Sven_vB> usually the solution is to not return them, but pass them to a callback
14:28 < shesek> but otherwise, if you do need to wait, you must pass in an callback function that'll get the value, rather than using a return value
14:28 < Sven_vB> [jasper], are you used to callback style?
14:28 -!- mode/#Node.js [+o piscisaureus_] by ChanServ
14:31 < Brainenjii> hello world
14:31 < Brainenjii> is it possible to use querystring.parse for get {value: 100} from "value=100"
14:31 < Brainenjii> ?
14:32 < [jasper]> yeah Sven_vB I sort of am I guess
14:32 < [jasper]> but how would I make a callback for this ?
14:33 < [jasper]> since the main files also has returns
14:34 < [jasper]> so if won't work to add a callback and let that return stuff I guess?
14:35 < Littlex> hey, when running npm as nobody user via sudo i am getting the eror Error: EACCES, mkdir '/root/.npm'
14:35 < Littlex> is there a way to prevent this or change the directory?
14:38 < st_luke> Littlex: you don't need to run as sudo, just allow your user account writable access to the directory in which you install modules
14:39 < Littlex> that would be nobody, and i wont allow nobody to access a folder insider roots home directory
14:39 < MI6> joyent/libuv: bnoordhuis created branch improve-uv_guess_handle - http://git.io/rMu5Cw
14:39 < st_luke> Littlex: im saying dont run as sudo, run as a non admin user
14:39 < Sven_vB> [jasper], sounds like too many parts are not written in JS style
14:40 < Littlex> hm
14:40 < Littlex> i dont think that will be possible because our deamon scripts run as root
14:40 < Sven_vB> [jasper], so you have to decide if you want to use JS as the language and adapt your program to JS style, or keep the program synchronius and use a synchronius language
14:41 < [jasper]> Sven_vB ? everytthing is written in js
14:41 < st_luke> Littlex: install the modules as non-root, put the global directory in root's path if it isn't already
14:41 < [jasper]> http://hastebin.com/bakifatuka.coffee I just want that rewritten into something usable
14:42 < SomeoneWeird> coffee != js
14:43 < [jasper]> man it aint coffee scripts
14:43 < [jasper]> it's just the hastebin extension
14:43 < SomeoneWeird> lol
14:43 < [jasper]> did you even look at it ? :P
14:43 < SomeoneWeird> i did
14:43 < SomeoneWeird> what's wrong with it
14:43 < Littlex> st_luke: mh that wont work well with the automated deployment
14:43 < [jasper]> connection is unknown in the return
14:43 < [jasper]> because it hasn't been setup there...I want to return the module.exports only after the connection has been made tiwh the database
14:45 < st_luke> Littlex: you can do `sudo npm config set unsafe-perm` but you shouldn't ever but you can
14:45 < SomeoneWeird> [jasper], you won't be able to do that
14:45 < Littlex> st_luke: wouldnt that say allway run as root? that wont work
14:46 < [jasper]> why not SomeoneWeird ?
14:46 < st_luke> Littlex: sounds like you want to run as root but you dont want to run as root
14:46 < SomeoneWeird> because you can't mix async and sync
14:46 < Littlex> st_luke: our daemon script runs as root and i want it to spawn the npm process as nobody
14:46 < SomeoneWeird> *cough* bad security *cough*
14:48 < Littlex> SomeoneWeird: now its getting interessting, maybe we should call the linux foundation and tell them to rework the etc/init.d concept?
14:48 < SomeoneWeird> Littlex, gl with that
14:49 < Littlex> cpt obvious
14:49 < st_luke> Littlex: create a special user to only handle the daemon process, have root start it up
14:49 < st_luke> like with couch
14:49 < st_luke> couchdb 21936 0.0 0.1 78984 5908 ? Ss Mar01 0:08 /usr/local/bin/couchjs /usr/local/share/couchdb/server/main.js
14:49 < [jasper]> SomeoneWeird why does the following rewrite work then: http://hastebin.com/pimakorehe.coffee
14:49 < [jasper]> look at the code below it
14:50 < Littlex> yeah probably gonna do that, thanks st_luke
14:50 -!- mode/#Node.js [+o piscisaureus_] by ChanServ
14:51 < st_luke> Littlex: it's pretty common to do that with daemons on linux started by scripts in init.d
14:52 < [jasper]> SomeoneWeird ?
14:56 < Sven_vB> [jasper], i didn't say your program is not written in JS ... just not in JS style. it's like dressing a priest for a gardener job ... you can do it but it might be overly complicated if outer form and inner intent don't fit together
14:56 < bradleymeck> anyone have a good example or emulating async.parallel in promises/a+ for some reason brain is farting
14:57 < bradleymeck> SomeoneWeird: the security depends on what the daemon does exactly
14:58 < MI6> joyent/libuv: Ben Noordhuis v0.10 * 7b66ea1 : unix: improve uv_guess_handle() implementation Make it understand FIFOs, - http://git.io/-I3e0g
14:58 < SomeoneWeird> bradleymeck, it's still a security risk if children are being spawned with root privs
14:58 < Littlex> they are not
14:59 < Littlex> alot of process do it that way fyi, the master runs as root the childs as user x or nobody
14:59 < bradleymeck> at some level if you must have privileges to init the next script you will have root somewhere, fork/clone() and immediate setuid/setgid are pretty well tested though
14:59 < Littlex> nginx as example
14:59 < MI6> joyent/node: Ben Noordhuis v0.10 * ca5022b : net: improve arbitrary tcp socket support Consider this example: // f (+1 more commits) - http://git.io/6RKHFw
14:59 < [jasper]> Sven_vB http://hastebin.com/pimakorehe.coffee
14:59 < [jasper]> lower part of the code works
14:59 < bradleymeck> SomeoneWeird: if you don't need privileges (ie you can just use port forwarding / meh use port forwarding)
14:59 < bradleymeck> but not always a true scenario
15:01 < SomeoneWeird> yerp
15:02 < Sven_vB> [jasper], how is the lower part working related to JS style (which means functional async, which means delivering results instead of returning) vs. procedural style (returning reults)?
15:04 < Sven_vB> why would you use JS in the first place, when you have to cripple its best parts to use it?
15:06 < [jasper]> Sven_vB how is my program even gonna work if there is no dtabase connection?
15:06 < [jasper]> I think that would be sort of a requirement
15:06 < [jasper]> independent of async
15:07 < Sven_vB> yes. JS style would be to let the DB module make it's connection and set a trigger ("callback") to do other stuff once the connection is ready
15:08 < [jasper]> yes Sven I realise that
15:08 < MI6> joyent/node: isaacs v0.10 * d62cf59 : http: Don't hot-path end() for large buffers The benefits of the hot-pat - http://git.io/ArSs5w
15:08 < [jasper]> well I could make it that way
15:10 < Sven_vB> :)
15:11 < [jasper]> but then I would have to seperate it into different functions\
15:11 < [jasper]> I guess that's fine also
15:13 < [jasper]> I'll just use the async library then I guess to setup all the connections Sven_vB
15:13 < [jasper]> before I start the program
15:16 < Sven_vB> sounds good
15:23 < seismo> o
15:24 < Littlex> st_luke: created a user with a login shell now, it works
15:25 < st_luke> Littlex: cool!
15:30 < [jasper]> Sven_vB http://hastebin.com/voposelope.coffee
15:30 < [jasper]> better?
15:31 < tubbo> hey guys, trying to write a test with mocha but i'm having trouble requiring my file
15:32 < tubbo> i'm doing `SumatraPlugin = require './../lib/sumatra/plugin'` in test/sumatra_plugin_test.js.coffee
15:32 < tubbo> the file is lib/sumatra/plugin.js.coffee
15:32 < tubbo> what am i doing wrong? :)
15:33 < FellowMD> I think you want /lib/sumatra/plugin.js
15:33 < FellowMD> When you're requiring a local file you need the .js I beleive
15:33 < FellowMD> Otherwise it just checks in node_modules or something like that
15:34 < tubbo> FellowMD: hmm, okay
15:35 < zackiv31> I don't think you ever need the .js
15:35 < zackiv31> your path is weird.. './../' is the same as '../'
15:35 < tubbo> zackiv31: yeah, ./lib didn't work either
15:35 < tubbo> doing SumatraPlugin = require '/lib/sumatra/plugin.js' and SumatraPlugin = require '/lib/sumatra/plugin.js.coffee' failed also
15:36 < zackiv31> those are absolute paths, you need './lib' or '../lib'
15:36 < zackiv31> depending on where your file is relatively
15:36 < FellowMD> failed how?
15:36 < tubbo> zackiv31: still didn't work, hold on i'll post the err
15:36 < tubbo> FellowMD / zackiv31 - https://gist.github.com/tubbo/1b4a201862ea474261e8
15:37 < tubbo> remember, i'm in test/plugin_test.js.coffee
15:38 < zackiv31> I don't use coffeescript.. but if test is next to lib in the hierarchy, require '../lib' is correct
15:38 < tubbo> zackiv31: hmm, ok
15:38 < tubbo> should be the same afaik, it's still commonjs
15:38 < tubbo> yay!
15:39 < tubbo> it ran!
15:39 < tubbo> thanks guys appreciate it
16:01 < Sven_vB> [jasper], looks okay. if more pastes are to come, i'd prefer you use a pastebin that i can see without trusting google - maybe one that works even with JS at all, like http://paste.ohai.su/ .
16:03 < FellowMD> Sven_vB: you mean you don't like loading jQuery from google?
16:03 < jrajav> You want a JS pastebin
16:04 < jrajav> That works without JS
16:04 < Sven_vB> FellowMD, i don't like being confronted with my addon setup's inability to allow just jquery and not everything else from that server.
16:05 < Sven_vB> jrajav, yes. it exists, as the link shows. ;) it's like you want a computer that works without software - at least not the one you would get by clicking random IRC links ;)
16:08 < jrajav> Well it's a little different for Node.js but for other JS pastes the value of allowing JS is pretty damn obvious....
16:11 < Sven_vB> you mean trying it out live? sure. still it would be usefull to at least show the text even before i allow live demo.
16:12 < owen1> how complex it is to build a web-based rss readed in node? is https://github.com/danmactough/node-feedparser a good start?
16:12 < owen1> rss reader
16:13 < tjfontaine> angry at google for dropping reader, are we?
16:13 < owen1> tjfontaine: no
16:13 < owen1> want to host my own
16:13 < jrajav> This is like the baby boomer generation of RSS readers
16:13 < owen1> responsive design + node
16:13 < owen1> i don't care about mobile app. responsive design. node + redis should be enough for me
16:14 < owen1> anyone using any android client for google reader? i want to try a good one. so far i used the mobile website.
16:15 < nuba> just asked on ##javascript, got no reply, trying here, now: hi folks, is there any webapp client + server-side js stack such that code can execute on the client or on the server, depending on the performance at the client and/or the server?
16:16 < willwh> nuba: you read some hackernews post ?
16:16 < willwh> I read something like that yesterday - someone saying "that would be cool"
16:16 < willwh> so I don't think so, yet
16:16 < nuba> willwh: nope, just wondering about that
16:24 < asdf12> arggggggg
16:24 < bradleymeck> pirates?
16:33 < owen1> how do i know if a new post is available on a given rss feed? do i need to keep the recent date of that rss feed in my db?
16:33 < tjfontaine> stat is your responsibility, yes
16:34 < owen1> tjfontaine: what do u mean by 'stat'
16:34 < tjfontaine> *state
16:35 < owen1> tjfontaine: oh. i noticed in one of the examples of node-feedparser, there is a usage of the header - If-Modified-Since
16:35 < owen1> tjfontaine: is it relevant to my question?
16:35 < asdf12> yea
16:35 < tjfontaine> it is, as is any cache info
16:36 < owen1> let's say i read xml file - foo.com/rss.xml. first time i read it i see 100 posts.
16:37 < owen1> second time i read it i see 120 posts. i only want to show 20 posts now. is there a way to do that without reading all the file? it sounds like a waste to read it again.
16:38 < owen1> i guess i need to have a boolean in my db for each post.
16:38 < owen1> to know if i read it already or not
16:38 < owen1> can i use the date of a blogpost as the unique value that indicate that post?
16:40 < asdf12> no? more than one blog post can have the same timestamp
16:40 < raffer__> Hi, It may not be the place to ask a general programming question, but still...I want to chain some unit tests (all http req/res) so that the response of the 1st becomes part of the request of the next. Problem is that the info should not be public (like a registration hash). So, setting the private info in the response of the 1st is ok for testing purposes, but not in our live code. So the whole purpose of the unit test is a bit lost here.
16:40 < raffer__> What would be a good strategy to cope with this? tnx
16:41 < owen1> asdf12: so i need to find something else, maybe title?
16:41 < asdf12> i would go with the uri
16:42 < TheEwok> raffer: Sounds more like integration testing than unit testing
16:42 < owen1> asdf12: http://cyber.law.harvard.edu/rss/examples/rss2sample.xml i don't see url here
16:43 < owen1> i can't rely on 'url' since some sites might not have it
16:43 * bradleymeck wants to kill the distinction of integration and unit since they are argued a ton and fuzzy to describe at best
16:43 < asdf12> they all will have it
16:43 < owen1> asdf12: where is url in the above xml page?
16:43 < TheEwok> bradleymac: Why?
16:44 < owen1> asdf12: maybe ?
16:44 < raffer__> TheEwok: yeah, that's true. But the problem remains
16:44 < asdf12> ablog.com/posts/today-i-went-fishing , the uri would be /posts/today-i-went-fishing
16:44 < asdf12> and it's guaranteed to be unique for a blog post
16:45 < owen1> asdf12: but in http://cyber.law.harvard.edu/rss/examples/rss2sample.xml they use how do i know what tag is the unique id of the post?
16:45 < timeturner> anyone ever try sock.js and what's the difference between that and socket.io?
16:45 < bradleymeck> TheEwok: cause people get upset that something is a unit test or integration test and not a unit test or integration test and argue it should be a unit test or integration test instead. when really they just want it to be a different *test* and none of that matters (had someone complaining that node had NO tests since they were all integration and not unit in their eyes)
16:45 < owen1> asdf12: each site might have it's own tag
16:46 < jorge_> Hi, crypto.pbkdf2 is giving different results from 0.8.22 to 0.10.0 -- no options to set -- any insigights? thanks
16:46 < asdf12> bradleymeck: that was me, i wasn't complaining, i was asking
16:46 < jorge_> *insights
16:46 < asdf12> bradleymeck: first time diving into node src, so i wanted to make sure i understood how tests were done
16:47 < TheEwok> bradleymec:Ahh. Yes. I agree, I was merely referring to the chaining of unit tests. People definitly get into a pissing match over the names.
16:47 < bradleymeck> i disagreed with them all being qualified as integration so i may have misunderstood
16:47 < raffer__> it's a thin line really (cfr. all the hooks mocha provides: beforeAll, before, after etc)
16:56 < owen1> asdf12: what am i missing here?
17:01 < jorge_> anybody using crypto.pbkdf2 with node 0.10.0 ?
17:02 < bnoordhuis> jorge_: yes
17:02 < jorge_> bnoordhuis: are you getting same results from 0.8.22?
17:02 < jorge_> bnoordhuis: I'm getting a different string now (getting invalid passwords...)
17:03 < bnoordhuis> jorge_: https://github.com/joyent/node/issues/5003#issuecomment-14866892
17:04 < jorge_> bnoordhuis: great! thank you -- was actually making the buffer(key) mistake!!
17:04 < bnoordhuis> np
17:06 < Brad__> Can anyone point me in the right direction for setting up multiple node instances on one server?
17:08 < yansanmo> quick question, in console line, why when I try to do http.get() it converts my parsed URL to localhost?
17:12 < merpnderp> Looks like I finally have an excuse to write my own rssreader.
17:13 < merpnderp> The good thing about Google Reader was it solved the problem of rss feeds only returning the last N results where the website might have posted N+M inbetween rss polls.
17:14 < spion> the more I try using the indexeddb api, the more it fills me with rage.
17:14 < spion> ... has anyone actually tried using that before designing it?
17:15 -!- mode/#Node.js [+o piscisaureus_] by ChanServ
17:15 < spion> whoops, wrong chanel
17:15 < merpnderp> spion: are you using it on the browser?
17:16 < merpnderp> ha
17:17 < yansanmo> maybe it's a limitation of the old version...
17:20 < qubit01> anyone using typescript with node ?
17:20 < yansanmo> found the problem, wrong variable
17:22 < ExxKA> Hey Guys. I am looking at the node source code in https and tls, because I want to verify that incomming ssl connections are using certificates signed by my custom CA. Do you if this is possible? I cannot seem to figure out how.
17:25 < bnoordhuis> ExxKA: you can specify a custom ca when you create the server, options = { ca: ... }
17:25 < ExxKA> Aaarh, think I found out. I will try with requestCert and rejectUnauthorized :)
17:25 < bnoordhuis> those too :)
17:25 < ExxKA> bnoordhuis, I had done that, but the two others default to false and I didn't know about them till just know when I looked in the source code
17:25 < ExxKA> Thanks for your tip though :)
17:28 < preyalone> In node-persist, is connection pooling enabled by default? Or does it have to be manually enabled?
17:29 < mboro> hi guys! I'm building a web app using Backbone/HTML5 pushState and node.js. node.js serves the same routes as Backbone. any way to centralize the document.title between the two so that when I visit /about, node.js sets the doc title to "About" and when I visit /about using Backbone navigate, it sets the doc title to "About" as well?
17:30 < mboro> or do I just have to accept the fact, they need the same logic on both sides?
17:51 < sshaginyan> Is there ever such a case that if I add objects '{}' or string to another object it works fine but functions don't work
17:51 < sshaginyan> ?
17:52 < tubbo> sshaginyan: actually it was one of the topics in https://www.destroyallsoftware.com/talks/wat
17:52 < tubbo> {} + ""
17:52 < tubbo> don't think he tried x = function() {}; x + {} or anything though..
17:52 < sshaginyan> {} + "" ?
17:53 < Christian87> any suggestions on this http://stackoverflow.com/questions/15416237/save-socket-connection-in-a-database-instead-an-array
17:55 < sshaginyan> tubbo: For some reasons var x = {}; x.test = function() {} doesn't work the object is empty
17:55 < aMoniker> Does anyone have experience with node-curl? I'm successfully connecting to a github activity url (https), but right before disconnect I get "Forever detected script exited with code: null"
17:55 < aMoniker> and my server restarts
17:56 < sshaginyan> I'm passing the object like so require('./file')(obj); then I try to add a function to obj and it doesn't work but a string does.
17:56 < sshaginyan> ....?
17:56 < tubbo> sshaginyan: mmm, something else is going on there :)
17:56 < tubbo> sshaginyan: i just tried what you said in console and got what i expected
17:56 < aMoniker> I've tried using https.request() as well, but that didn't even seem to make a connection
17:56 < sshaginyan> tubbo: With require?
17:57 < aMoniker> using CURL on the command line with the same url works fine
17:57 < tubbo> sshaginyan: nope, using bare objects.
17:57 < sshaginyan> tubbo: Well try using require
17:57 < tubbo> sshaginyan: like i said, something in your require() is broken, it's not a misunderstanding of language semantics or anything.
17:57 < sshaginyan> so require(….)(obj)
17:58 < tubbo> sshaginyan: well wait, why are you doing it like that?
17:58 < sshaginyan> then module.exports
17:58 < sshaginyan> To avoid a circular require
17:58 < tubbo> require('mylib')(obj)...what is that supposed to do?
17:58 < sshaginyan> I know it's okay
17:58 < sshaginyan> nm it
17:58 < sshaginyan> it's fine
17:58 < tubbo> sshaginyan: i've never seen it before
17:58 < tubbo> so that's why i asked
17:58 < tubbo> sshaginyan: so what...are you expecting from that?
17:59 < tubbo> just an object?
17:59 < tubbo> or are you trying to pass arguments into the function returned by require(..)?
17:59 < sshaginyan> No a function within a object
17:59 < sshaginyan> no
17:59 < sshaginyan> I don't think you can help nm
17:59 < sshaginyan> I think I have a problem somewhere else
18:00 < tubbo> sshaginyan: well given the function is a property of the object returned by require(), you should probably be doing `lib = require('mylib').something`
18:00 < sshaginyan> yes
18:00 < tubbo> sshaginyan: and that would get you that object, right?
18:00 < tubbo> so now lib is a function because something was a function, so now you can call lib(args)..
18:00 < tubbo> does that work/
18:00 < sshaginyan> no everything is a reference it should work
18:01 < tubbo> hmm, ok
18:01 < tubbo> well you seem to think there's an issue in the lib you're requiring but i wouldn't know b/c i can't see that code =D
18:01 < tubbo> just wanted to give you some peace of mind that you're not insane and JS is working as it should lol
18:01 * tubbo needs that from time to time
18:02 < sshaginyan> dude…….. I'm telling you I have a.js and b.js I have an object in a.js that needs to be accessed by b.js the best practice I've read about is doing require('b')(obj) from a.js.
18:02 < sshaginyan> Now after that require from a.js I should see a populated object but I'm not
18:03 < sshaginyan> that's all
18:04 < FellowMD> Is something undefined? You silently end up with something undefined if you've got cyclic requires
18:05 < sshaginyan> Nope
18:05 < sshaginyan> FellowMD: It's not cyclic
18:07 < martini> hey there, anyone know how get around heroku's 30 second request timeout ?
18:09 < sshaginyan> martini: How do you set a timeout. I'm just curious?
18:09 < sshaginyan> I'm using express
18:10 < martini> I'm using express as well, and I want to setup long polling, but heroku times out all requests after 30 seconds
18:11 < martini> apparently you have to send data periodically to keep it open, but express throws an error when you you res.send more that once
18:11 < martini> iprobably not doing it right though...
18:12 < asdf12> use res.write ?
18:12 < martini> asdf12: was about to try that !
18:12 < martini> will let you know if it works
18:12 < martini> thanks
18:13 < asdf12> are you sure heroku times out all requests after 30 seconds?
18:13 < asdf12> that seems really low
18:13 < martini> yeah it's weird https://devcenter.heroku.com/articles/request-timeout
18:15 < asdf12> martini: ideally the client should be the one keeping the connection alive, not the server
18:18 < AAA_awright> How am I supposed to exit the program when the incoming stream ends?
18:18 < andrew12> AAA_awright: it happens automagically
18:19 < andrew12> check dat 'end' event
18:19 < AAA_awright> andrew12: It's never called
18:19 < AAA_awright> end event on which stream?
18:19 < asdf12> the read stream
18:19 < AAA_awright> stdin?
18:20 < asdf12> you need to close the write stream?
18:20 < AAA_awright> Yeah, process.stdin never closes when piping data
18:22 < AAA_awright> I suspect this really shouldn't be that hard
18:23 < AAA_awright> Except process.stdin never emits close, nor end, when getting piped output from another process, that does know how to terminate
18:25 < Gambit--> substack: you around?
18:26 < gkatsev> is it possible to have 'local' npm config option?
18:27 < FellowMD> try 'npm help config'
18:28 < FellowMD> Command Line Flags/Environment Variables/Per-user config file/Global config file are your options
18:34 < Aerpe> G'evening
18:36 < FellowMD> haio
18:54 < Ralt> yay
18:54 < Ralt> another PR for npm
18:55 < Sven_vB> >> Math.random().toString(36).substr(2)
18:55 < purr> Sven_vB: (string) 'ls68ot31g36jemi'
18:56 < Sven_vB> ^-- is there a reliable way to determine in advance how many random digits it will produce?
18:58 < Ralt> Sven_vB: digits or characters?
18:58 < Sven_vB> or better, how many of them could be there aren't in this case only because they happen to actually be zero
18:58 < Sven_vB> Ralt, those characters are digits.
18:58 < Sven_vB> Ralt, i'm using base 36 as specified
18:58 < Ralt> that's sneaky.
18:59 < Sven_vB> ok let's use decimal for not mixing two problems :)
18:59 < Sven_vB> >> Math.random().toString(10).substr(2)
18:59 < purr> Sven_vB: (string) '6733542531728745'
18:59 < Sven_vB> >> Math.random().toString(10).substr(2)
18:59 < purr> Sven_vB: (string) '7215410533826798'
18:59 < Sven_vB> ok i'll save you from retrying until we get trailing zeroes
18:59 < Ralt> and looks like the number is constant...
18:59 < Sven_vB> which would probably be cut off
18:59 < Ralt> hahaha
19:00 < Sven_vB> which number is constant?
19:00 < Ralt> since you know the classic number of digits, just pad with 0 if necessary
19:00 < Sven_vB> actually, that is the problem: how do i determine how many digits _could_ be there if they wouldn't happen to be zeroes (and therefor trimmed)?
19:01 < Ralt> the number of digits is constant. there's always 16 digits (in the examples up there)
19:02 < Ralt> so 18 digits output (you substr(2))
19:02 < Sven_vB> oh, that you meand with constand. yes, "in the examples up there"; but how to check that if my code runs on another platform than purr?
19:02 < Sven_vB> say, a browser
19:02 < Sven_vB> or even an exotic browser
19:02 < Ralt> you could try running it a few times (say, 100) to have an example of how the environment behaves
19:03 < tuhoojabotti> Can I use child_process.fork and detach it like spawned process?
19:03 < Sven_vB> my users' randomness pools will really like that. but ok, your monte carlo approach indeed is a solution, in really most cases.
19:04 < Ralt> if a number of digits comes back more than 80 times, you got your number
19:04 < Sven_vB> are there other solutions that rely even less on luck?
19:04 < Ralt> digging.
19:06 < niggler> Sven_vB what are you rying to do
19:06 < Eigen> once you install mongo from npm
19:06 < Eigen> the mongo shell should work right?
19:06 < daekano> no
19:06 < Eigen> oh
19:06 < Eigen> do I need to install mongod?
19:06 < Eigen> and run it?
19:06 < daekano> mongod is the daemon
19:06 < Eigen> yes
19:06 < daekano> you need to install the mongodb package from 10gen
19:06 < Eigen> ohk
19:07 < daekano> are you on ubuntu?
19:07 < Sven_vB> niggler, generate random salts, in an approach that makes best use of the users' randomness pools
19:07 < niggler> why arent you just directly generating characters Sven_vB
19:08 < Eigen> daekano: yes
19:08 < daekano> Eigen: then just google "how to install mongodb on ubuntu __version__"
19:08 < niggler> >>> String.fromCharCode(Math.floor(Math.random()*256)) @ Sven_vB
19:08 < purr> Sven_vB: (string) '.'
19:08 < daekano> there are endless tutorials online
19:08 < Eigen> yea i did
19:08 < Eigen> o
19:08 < daekano> so really, you didn't.
19:08 < Eigen> is the npm package
19:08 < Ralt> Sven_vB: actually, it's even worse http://jsfiddle.net/Ralt/VSTcV/
19:08 < Eigen> the client?
19:08 < Ralt> it's not constant
19:08 < niggler> Ralt its not expected to be constant
19:09 < daekano> http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
19:09 < Sven_vB> how would i do that? select a random character from an alphabet and then repeating that? ... i see, yes. as far as I see, that approach will use at max 8 bits of randomness and waste all the others that Math.random had created.
19:09 < niggler> if you want something that's constant, multiply and floor and prepend with padding characters
19:09 < Ralt> niggler: the number of digits after 0 could be
19:09 < Sven_vB> also i think my english needs some more randomness.
19:09 < bradleymeck> Sven_vB: require('utile').randomString(length)
19:10 < niggler> Sven_vB you can set up your alphabet and then just randomly sample characters individually
19:10 < niggler> bradleymeck is that avaiable in the browser?
19:10 < korilo> >> 1+1
19:10 < purr> korilo: (number) 2
19:10 < korilo> yeah so we have a bot like #javascript? :D
19:11 * niggler pets korilo
19:11 < korilo> hi niggler
19:11 < bradleymeck> niggler: could probably just copy past it
19:11 < niggler> https://github.com/flatiron/utile/blob/master/lib/index.js#L299-L317
19:11 < korilo> >> let b = 2
19:11 < purr> korilo: SyntaxError: Unexpected identifier
19:12 < niggler> though that looks like base-64
19:12 < korilo> for (var i of [1, 2, 3]) { i;}
19:12 < korilo> >> for (var i of [1, 2, 3]) { i;}
19:12 < purr> korilo: SyntaxError: Unexpected identifier
19:12 < korilo> :/
19:12 < Havvy> >> for (var i of [1, 2, 3]) { console.log(i);}
19:12 < purr> Havvy: SyntaxError: Unexpected identifier
19:12 < niggler> isnt that coffeescript?
19:12 < korilo> :/
19:13 < Havvy> niggler: ES6
19:13 < Sven_vB> niggler, even with using a larger alphabet, i'd only use so many bits of randomness. and how would i know, how many i get? would be a false percepted security if it turns out some characters are always from the lower part because i assumed more random bits than were produced
19:13 < Ralt> looks like purr doesn't support es6
19:13 < korilo> es6
19:13 < korilo> ec6
19:13 < korilo> indeed Ralt
19:13 < niggler> Sven_vB you can sample a random variable and not use the full randomness
19:13 < niggler> so Math.random() gives you 32 bits of randomness
19:13 < Sven_vB> cool idea! thanks
19:13 < Ralt> I wonder if chrome supports of yet
19:13 < korilo> something
19:13 < niggler> and you can choose just to use 6 (base 64) or 12 or 16 or whatever
19:14 < korilo> i tried it in ff only
19:14 < elementz> hi all. i have just installed npm and node to .local/nodejs and .local/npm, so that i can install packages without root privileges. but when trying to install a package, e.g. docco, i get an EACCESS error: https://gist.github.com/jottr/908ff9c90abe4f960919 why is beondy me..
19:14 < Sven_vB> is it in the standard to always be 32 bit? even on 64 bit machines?
19:14 < Ralt> elementz: you need to change your npmrc iirc
19:14 < niggler> elementz who owns /home/jonas/tmp
19:15 < elementz> niggler: well me
19:15 < Havvy> Sven_vB: Probably.
19:16 < niggler> Sven_vB there's no standard, but 32 bits is a safe assumption
19:18 < niggler> >>> for(var i = 0; i != 1000000; ++i) if(Math.random().toString(16).length > 10) throw "badness 10000"
19:18 < purr> niggler: undefined
19:18 < niggler> so i suspect whatever is behind purr is using 32 bits
19:18 < niggler> for(var i = 0; i != 10000000; ++i) if(Math.random().toString(16).length > 10) throw "badness 10000"
19:18 < niggler> >>> for(var i = 0; i != 10000000; ++i) if(Math.random().toString(16).length > 10) throw "badness 10000"
19:18 < purr> niggler: Timeout Error: Execution time exceeded 2 seconds
19:18 < Sven_vB> niggler, ok then. thanks
19:22 < niggler> Sven_vB it appears that firefox does use more than 32 bits of randomness
19:25 < Sven_vB> then maybe i should combine the monte carlo approach with the "knowledge about number formats" approach, and if some of the numbers turn out to be more precise than 32 bit, assume they even have 64 bits (and, 128, and so forth)
19:26 < Sven_vB> that way, wasting randomness because of underestimating it most probably at least won't happen too often
19:28 < niggler> Sven_vB wasting randomness isnt the end of the world
19:28 < niggler> its certainly better than assuming more randomness than specified
19:28 < niggler> but if you are doing MC why not use a low-discrepancy sequence
19:28 < Sven_vB> what is MC?
19:28 < niggler> monte carlo
19:28 < Sven_vB> oh, of course
19:31 < Sven_vB> well i don't really intend to use MC, it's just that i... temporarily forgot that idea about using non-random numbers to test the system's float precision.
19:31 < Sven_vB> which on the other hand does not yet guarantee that the randomness function uses the max. float precision available
19:32 < Sven_vB> and thinking of browsers in the past, it might be there is no better way than MC to test that
19:34 < niggler> is there any mandate on the behavior of math.random in the spec?
19:34 < Havvy> Only that it not be detectable that another script is using math.random
19:35 < niggler> es5 15.8.2.14: "Returns a Number value with positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-dependent algorithm or strategy. This function takes no arguments."
19:35 < Sven_vB> dunno... but even if there is, maybe i should just try less hard. it's probably more likely thar someone will get a hangup in the detection because he compiled his JS with an arbitrary precision math library, than someone really saving randomness pool on a slow embedded device
19:36 < niggler> the best bet Sven_vB is to depend as little as possible on client-side randomness
19:36 < niggler> you can push randomness from server to client and use that
19:39 < Sven_vB> well, if the standard says it's implementation-dependent, that's excuse enough to risk wasting some randomness pool some times. was just that if there was a way to do it better easily, i'd have tried doing it more the right way.
19:56 < inspiron> hello
19:56 < bradleymeck> salud
19:56 < Sven_vB> ohai
19:56 < daekano> hi
19:56 < inspiron> I read on a stackoverflow comment that express.vhost will run only on one core and doesn't scale well. Is this true?
19:57 < Virunga> Hi
19:58 < Virunga> How can i get the absolute path from '~' ?
19:58 < bradleymeck> inspiron: all of node will only run on one process unless you use cluster or something (generally easy as heck to do). core != process
19:58 < inspiron> k
19:58 < bradleymeck> Virunga: process.env.HOME on *nix and process.env.USERPROFILE on windows generally
19:58 < inspiron> what's available for clustering node apps
19:59 < Virunga> oh gosh, thank you bradleymeck
19:59 < Gambit--> substack, re-ping
20:03 < asdf12> man oh man
20:04 < asdf12> whats the deal with ab
20:04 < niggler> asdf12 have you tried siege
20:05 < asdf12> ab -n 1, it does like a gabrillion requests
20:06 < niggler> ab -n 1 should do 1 request
20:07 < niggler> are you sure yu dont have any other f lags?
20:07 < daekano> lol
20:10 < MI6> joyent/node: koichik v0.10 * 1f53cfd : doc: don't mark fs callbacks as optional Refs #5005, #5008 - http://git.io/sAOybA
20:18 -!- mode/#Node.js [+o TooTallNate] by ChanServ
20:21 < over_> hi , anybody can help me about nodejs visual studio setup?
20:22 < niggler> what version
20:22 < over_> 2012 express
20:23 < over_> I can run node scripts and I have some completition, but its not perfect and I can't find proper information
20:24 < niggler> what's not completing?
20:32 < lilieam> hello, I'm new and trying to install my module in a project folder, but every time that i run npm install socket.io from my project folder ,it install the module in my home folder, is that what supposed to happen?
20:33 < bradleymeck> lilieam: it will attempt to find the proper node module you are in (run npm init in your project folder)
20:35 < lilieam> bradleymeck: for with that I'm creating a new module ?
20:35 < FellowMD> or even just make a node_modules directory manually in your project folder
20:35 < bradleymeck> that will properly make a package.json for your project
20:35 < lilieam> yes it did
20:35 < diogogmt> I'm distributing a nodejs app that uses a module that depends on libopenssl-dev header. Is there a way I can check for the existence of openssl header from a bash script?
20:35 < diogogmt> I don't want that during the app installation a crash happens because one of the node_modules could not be built
20:37 < lilieam> bradleymeck: thank you it installed socket.io correctly
20:37 < bradleymeck> diogogmt: generally i would just let it burn naturally as that will be something they could possibly google
20:38 < diogogmt> bradleymeck: but sometimes the npm logs can be a bit cryptic, I wanted to give at leafs a heads up that some key libs are missing from their system before they actually get to the installation stage
20:38 < diogogmt> *least
20:45 < wheeledone> Hello, everyone. I'm building a native binding to a C shared library with node-ffi. I wrote the library, and want to distribute it with the node binding, so that the .so is automatically when the package is installed via npm. Is a .gyp file what I need to trigger the Makefile that builds my .so?
20:45 <@TooTallNate> wheeledone: well you could write a gyp file that build the .so file, gyp generates a Makefile
20:46 <@TooTallNate> wheeledone: what's the library?
20:46 < wheeledone> I was just going to make a shell script and trigger it on the 'install' script in my package.json, but I read that was an anti-pattern
20:46 < wheeledone> TooTallNate: it's a bunch of IRS-related tax math that was written in the 1980s
20:46 <@TooTallNate> wheeledone: i mean that would probably work, but definitely not on Windows and likely some other environments
20:47 < wheeledone> TooTallNate: if this is for internal use, and not open distribution, i should probably just use an install script, then? and avoid .gyp?
20:47 <@TooTallNate> wheeledone: ya probably
20:48 < wheeledone> k, thanks so much!
20:50 < wheeledone> TooTallNate: btw, thanks for FFI! it rocks! saving me tons of work, I love it.
20:50 <@TooTallNate> wheeledone: glad you like it :)
20:53 < MI6> joyent/node: Sami Samhuri master * 5eacdd4 : repl: emit 'reset' event when context is reset Closes #1183. - http://git.io/tUq9Iw
20:56 < othiym23> anyone know how high I need to set my file descriptor limit on OS X to keep node's 'make test' from barfing with an EMFILE?
20:57 < bnoordhuis> othiym23: ulimit -n 1024 should be enough (it is for me)
20:58 < othiym23> bnoordhuis: is it expected for test/simple/test-child-process-customfd-bounded.js to fail on master?
20:59 < othiym23> (just setting a baseline before I make some changes)
20:59 < othiym23> ulimit -n is already at 2560 for me
20:59 < othiym23> doubled kern.maxfiles
21:00 < faceleg|work> bnoordhuis: ! hey hey hey
21:01 < othiym23> bnoordhuis: https://gist.github.com/othiym23/5165200 -- second one seems reasonable, not sure about the first one
21:02 -!- mode/#Node.js [+o piscisaureus_] by ChanServ
21:03 < gaf> if one would make a realtime game with node.js, which modules would you recommend?
21:05 < faceleg|work> gaf: only the best
21:05 < daekano> gaf: socket.io probably
21:05 < faceleg|work> gaf: passport if you want auth
21:06 < daekano> backbone on the front end for deliciousness
21:06 < daekano> mongoose
21:06 < daekano> redis for fast temporary storage
21:06 < daekano> etc
21:06 < faceleg|work> backbone?!
21:06 < faceleg|work> gaf: look @ angular
21:07 < context> i <3 angular
21:07 * faceleg|work thumps chest
21:07 < daekano> eh
21:07 < faceleg|work> context: with that, I forgive your previous sarcasm. <3
21:07 < faceleg|work> \o/
21:07 < faceleg|work> /\
21:07 < faceleg|work> damn missed the body
21:07 < daekano> he looks like he's been severed at the waist and the top half is falling away
21:08 < faceleg|work> daekano: that's how I felt when context attacked me the other night
21:08 < daekano> or perhaps a really bad limbo dancer
21:08 < faceleg|work> \o/
21:08 < faceleg|work> /\
21:08 < faceleg|work> dammit!
21:08 < lilieam> lol
21:08 < faceleg|work> \o/
21:08 < faceleg|work> |
21:08 < faceleg|work> I give up
21:08 < gaf> i'm thinking more of a canvas based engine + node
21:08 < faceleg|work> gaf: still socket.io for communication
21:08 < daekano> neat
21:09 < gaf> socket.io, yes. but it seems a lot going on now, engine.io comming, etc.
21:09 < faceleg|work> engine.io?
21:09 < fusiongrokker> anyone else using passport for auth in express?
21:10 < korilo> me fusiongrokker
21:10 < gaf> yes, engine.io
21:10 < context> gaf: or check out sockjs
21:10 < fusiongrokker> korilo: I was curious how long the user lookup was taking so I added a console.time() for it and noticed it was running 8 times for a single page request... any idea why it would do that?
21:11 < fusiongrokker> I'm creating a blank page with no extra db lookups/etc on it now to test if that has anything to do with it
21:12 < korilo> that's weird dude :/
21:12 < fusiongrokker> it might just be crappy code by yours truly...
21:13 < faceleg|work> fusiongrokker: yeah that's weird, mine looks up ponce
21:13 < korilo> same here
21:14 < faceleg|work> post the fail: hastebin.com
21:18 < lilieam> im confused about where to put the node module folder, should it be in the server folder ? or at the root
21:19 < faceleg|work> if you do npm install it'll happem magically
21:19 < faceleg|work> s/happem/happen
21:20 < lilieam> yep it did but the client browser doesnt see the libs
21:20 < lilieam> i get error on /socket.io/socket.io.js
21:21 < daekano> erm
21:21 < daekano> generally all you need with npm is the following:
21:21 < daekano> npm init
21:21 < daekano> and, npm install ______ --save
21:21 < daekano> sometimes you pass the -g flag for things like mocha
21:21 < lilieam> yes that's what i did
21:22 < korilo> or npm itself
21:22 < daekano> heh
21:22 < daekano> korilo++
21:22 < korilo> :P
21:24 < lilieam> gonna remove everything and start over...
21:25 < diogogmt> between forever and forever-monitor which one do you guys recommend? The options of starting child process within a node app is pretty appealing
21:26 < korilo> does anyone use vanillajs here?
21:26 <@mbalho> i do
21:27 < korilo> it it really that good compared to jqeury and the rest as stated on their website mbalho ?
21:27 < korilo> *is
21:28 < glosoli> Anyone here using AngularJS and E2E tests encountered some problems after update ?
21:28 < glosoli> after Node.js update"
21:29 < korilo> faceleg|work, @ angularjs
21:29 < korilo> he's an advocate for angular!
21:32 < glosoli> korilo: thanks
21:32 < korilo> i did nothing :O but you're welcome!
21:32 < glosoli> korilo: well at least you told me some guys name who might have known something if was online ;d
21:43 < Industrial> Can I node process restart itself?
21:43 < Industrial> s/I/a/
21:43 < pachet> nope
21:44 < pachet> another process has to be playing babysitter
21:44 < pachet> see forever, upstart, et al
21:44 < Industrial> if I make one process babysit 500 node servers, at some point it will fail, correct?
21:45 < korilo> upstart + monit on ubuntu is trivial to setup too Industrial
21:45 < othiym23> isaacs: can you point me at an example of where there's a stability index on a function in the current docs?
21:46 < Industrial> korilo: does that allow me to arbitrarily spawn node processes/not have a config for each? How do you manage all the ports?
21:46 < othiym23> isaacs: is it enough just to copy the stability index block up from the head of the docs and set it to deprecated?
21:46 <@isaacs> othiym23: http://nodejs.org/docs/latest/api/documentation.html#documentation_stability_index
21:47 <@isaacs> othiym23: also: i'd like to see if we can't figure out how to make domains work for you.
21:47 <@isaacs> othiym23: it seems like the issue is that it means that people using your instrumentation are also automatically using domains, which changes program semantics?
21:47 < Industrial> I mean I have only 9 servers now but .. I havent even begun yet :P
21:47 < othiym23> isaacs: yeah, that's the core of the problem
21:48 < Industrial> http://images.gammatester.com/pics/752d7a6049f505d1f28149e38a87d567.png
21:48 < Industrial> Where can I learn more about how to set up your network of servers?
21:48 <@isaacs> othiym23: so, except that it prevents calling process.emit('uncaughtException'), it seems like you could just attach a domain that throws.
21:48 < othiym23> isaacs: I'm also pretty sure that it's going to be really tough to make domains work for both error tracing and transaction tracing without monkeypatching domains (which can cause some truly bizarre errors when things go wrong), which is why I'm suddenly mentioning #3733 so frequently
21:49 < Industrial> Can I have everything in node-land or do I need e.g. an outside proxy?
21:49 <@isaacs> othiym23: like, nrDom = domain.create(); nrDom.enter(); nrDom.on('error', function(er){throw er})
21:49 < lz> substack, do you endorse https://npmjs.org/package/browserify-ftw?
21:49 < lz> I'm thinking about using it on my requireJS project
21:49 < pachet> Industrial: i usually use nginx as a loadbalancer
21:49 < pachet> outside of nodeland, as it were
21:49 < othiym23> isaacs: the problem is that that dodges uncaughtException, so if they're using Airbrake or whatever, their process crashes instead of grabbing the error
21:50 <@isaacs> othiym23: right. well, nrDomain.on('error', function(er) { if (!process.emit('uncaughtException', er)) throw er })
21:50 <@isaacs> of course, that's VERY 0.10 only :)
21:50 <@isaacs> in 0.8, that'll be a rangeerror
21:50 < othiym23> isaacs: I'll give that a try and see what happens
21:51 < othiym23> and I'm pretty much resigned to having to have version-testing within the agent at this point
21:51 < othiym23> was trying to get by with feature testing but there's a number of cases where that doesn't work
21:51 < othiym23> so no bigs I guess
21:51 < Industrial> pachet: does that mean that every time I add an expressjs/website/app/service node I need another config in nginx? How do the nodes in your network find eachother? hardcoded ports?
21:51 < othiym23> isaacs: I just want to get it *working* in 0.10 first ;)
21:52 <@isaacs> othiym23: also, if you don't have a domain error handler, it's the same as not having a domain at all.
21:52 <@isaacs> except, of course, that then you don't emit uncaughtException
21:52 <@isaacs> hrm.
21:52 <@isaacs> also, if the user is using domains themselves, then yeah, that's not going to work for you
21:53 < othiym23> yeah
21:54 < Industrial> pachet: i think it would be much more flexible if the reverse proxy consumers would register themselves so it can just dish out based on a local cache.
21:54 < othiym23> nesting is a major pain in my ass here
21:54 <@isaacs> right
21:54 <@isaacs> well, actually, if they're using domains, and so are you, and you can know who's on "top" of the nesting, then it's workable
21:54 <@isaacs> othiym23: *because* of the nesting.
21:54 < othiym23> it's pretty important that a. I be able to intercept errors so the agent can trace them and b. the agent not interfere with whatever error handling they've defined themselves
21:54 <@isaacs> in 0.8, it's much more convoluted.
21:55 < othiym23> I've been experimenting with explicitly watching the domain stack
21:55 <@isaacs> othiym23: crazy idea: you club process._fatalException
21:55 < othiym23> it's not always clear what the right thing to do is, though
21:55 < othiym23> that is a crazy idea!
21:55 <@isaacs> othiym23: like, aop over it
21:56 < Sembiance> ZOMG!
21:56 <@isaacs> process._fatalException = function(orig) { return function(er) { newRelicize(er); return orig.call(process, er) } }(process._fatalException);
21:56 < Sembiance> I love node.js :)
21:56 < othiym23> ah hm
21:56 < othiym23> yeah, I can look at that as well
21:56 <@isaacs> othiym23: of course, that'd better be sync
21:56 <@isaacs> Sembiance: thanks! :)
21:56 < othiym23> all of the instrumentation is sync
21:56 <@isaacs> othiym23: at that point, you have literally this exact RTC, and then yor'e dead.
21:57 < LowValueTarget> getting an error when installing a local npm package (tar.gz)
21:57 < LowValueTarget> Error: ENOENT, open '/root/tmp/npm-3979/1363297449565-0.835728648584336/package/package.json'
21:57 < LowValueTarget> What am i doing wrong?
21:57 < othiym23> only communication with NR's servers and harvesting is async
21:57 <@isaacs> othiym23: right
21:57 <@isaacs> othiym23: the thing is, do you care about more than errors?
21:57 < bradleymeck> LowValueTarget: full trace pls
21:57 <@isaacs> LowValueTarget: does the tar.gz file have a package.json in it? gist the whole npm-debug.log file
21:58 < othiym23> isaacs: I absolutely care about more than errors, but right now I'm trying to get the 0.10 error tracer correct
21:58 < bradleymeck> anyone know a decent way to get list of open fds on current proc in both windows and in nix
21:58 < bradleymeck> could fstat a bunch but thats… bad
21:59 < othiym23> isaacs: there's a whole other discussion I'd like to have about how to use domains to propagate transactional context across a continuation chain, but it's a lot more complicated than this and I want to get a new beta with a potentially broken transaction tracer (because it's already busted) but a working error tracer for node 0.10 ASAP
22:00 <@isaacs> yeah, totally.
22:00 <@isaacs> othiym23: try AOPing _fatalException
22:00 <@isaacs> othiym23: at least, you'll find out quickly if that'll work. it's only a few lines of code.
22:00 <@isaacs> othiym23: of course, how much data you'll get at that point, i don't know :)
22:00 <@isaacs> othiym23: if you're not using domains, there's really no way to know what req that came in on, etc.
22:01 < Industrial> pachet: ?
22:01 < LowValueTarget> isaacs, bradleymeck: http://pastebin.com/raw.php?i=8gmzKAut
22:01 < othiym23> isaacs: well, one of the things I've been looking at using for a portable transaction tracer (because, unfortunately, I still have to support 0.6 for a while yet) is the hook code that Adam Crabtree and creationix use for trycatch
22:02 < othiym23> isaacs: it causes all kinds of deoptimzation and probably slows down the whole app, but it does allow me to add scope to all requests, whether or not they're using domains
22:02 <@isaacs> right
22:02 < LowValueTarget> isaacs, bradleymeck: there is a properly formatted package.json in the project dir -- it worked locally, just not on this remote server
22:02 < Sembiance> started using node.js in production back in 2010. it's been rock solid all along, even the old version I was running for years. it's helped server over 2 billion hands of solitaire ;)
22:03 < pachet> Industrial: all processes communicate through a redis layer
22:03 < pachet> no need for them to know each other's location or ports
22:03 < pachet> just spin up an instance, hook it to redis, and viola
22:04 < pachet> rest is done via message passing
22:04 < Industrial> Is there any material/reading on how to set up or how to meaningfully divide your platform into different services? How do I measure performance (So I can measure the difference)? I understand that I atleast have a proxy, cache, app and service nodes.
22:04 < LowValueTarget> isaacs, bradleymeck: i also tried clearing npm cache
22:04 < LowValueTarget> no luck
22:05 < Industrial> I might implement something like this at work and I know it will work but I'd like to start with a little confidence on where not to step :-)
22:06 <@isaacs> LowValueTarget: what does this report? ls -laF /root/tmp/npm-3979/1363297449565-0.835728648584336/package/
22:07 < LowValueTarget> has a copy of whats in the tarball isaacs
22:07 < pachet> Industrial : you hit the basics already
22:07 < Industrial> I can find lots of stuff on "yeah we can do it distributed now, cloud whee' but not so much on 'heres how to actually do it *code*'
22:07 <@isaacs> LowValueTarget: i mean, there's a package.json in there? and it's json?
22:07 < LowValueTarget> no package json
22:07 < pachet> i dont have any reading handy, but my general rule of thumb is to let separation of concerns extend to your processes
22:07 < pachet> quarantine processes based on what services they will be consuming
22:08 < LowValueTarget> i think i realized my err --- tarring the actual project dir instead of only its contents isaacs
22:08 <@isaacs> LowValueTarget: well, things should be in a folder inside the tgz
22:08 < LowValueTarget> oh they are
22:08 <@isaacs> LowValueTarget: ie, not a "naked" tarball
22:08 < LowValueTarget> no package.json though
22:08 < Industrial> would you have one service for logging, or log in each server?
22:08 <@isaacs> LowValueTarget: right, so /root/tmp/npm-3979/1363297449565-0.835728648584336/package/package.json
22:08 < LowValueTarget> negative
22:08 <@isaacs> LowValueTarget: what's in that file? that file exists?
22:08 < LowValueTarget> isaacs: no, just /root/tmp/npm-3979/1363297449565-0.835728648584336/package/network-scripts/package.json
22:09 < pachet> Industrial: each server, or process or what have you, pushes to redis for low priority logging
22:09 <@isaacs> LowValueTarget: ohh, ok
22:09 <@isaacs> LowValueTarget: yeah, you've got an extra folder there.
22:09 < pachet> some other service has the responsibility of taking those and making them persist
22:09 <@isaacs> LowValueTarget: the tgz should be: $some_folder/package.json $some_folder/index.js $some_folder/README.md, etc.
22:09 < Industrial> i guess if you use redis then you use redis :P
22:09 < pachet> pushing to file on disk, or disk backed db, what have you
22:09 < pachet> yeah it's kind of like crack
22:09 < LowValueTarget> it is
22:09 < LowValueTarget> oh nm
22:10 < LowValueTarget> 'package' should take the place of 'network-scripts'?
22:10 < Industrial> does it have a nice ORM/ODM?
22:10 < ningu> if "it" is mongodb the answer is yes
22:10 < ningu> if not... questionable :)
22:10 < Industrial> no and I have issues with mongoose :P
22:11 < ningu> Industrial: what db are you using?
22:11 <@isaacs> LowValueTarget: bingo
22:11 < Industrial> I have not yet decided.
22:11 < Industrial> it will be a k/v store for most of the data
22:11 <@isaacs> LowValueTarget: what does this report? tar ztvf ../network-scripts.tar.gz
22:11 < LowValueTarget> so my tar should be cd `cd ./network-scripts && tar czf package.tar.gz *` rather than `tar czf package.tar.gz ./network-scripts`? isaacs
22:11 <@isaacs> LowValueTarget: can you gist that ^
22:11 < ningu> there are good drivers for sql databases in node, but the ORMs are not at the same level
22:11 < Industrial> it'd be nice to have free form structures
22:12 < ningu> Industrial: oh. well then it sounds like you want redis or mongo
22:12 <@isaacs> LowValueTarget: gist the tar ztv
22:12 <@isaacs> LowValueTarget: or pastie or whatever you like
22:12 < pachet> Industrial : eh, https://github.com/maritz/nohm
22:12 < ningu> isaacs: btw mentioning this because I know you work with mikeal, someone was on here last night saying the latest version of request broke compatibility with v0.6. is v0.6 officially not supported in some sense?
22:13 < LowValueTarget> isaacs:
22:13 < LowValueTarget> http://pastebin.com/raw.php?i=S2qQHxUW
22:13 < mikeal> ningu: i can comment on that :)
22:13 <@isaacs> ningu: yes, 0.6 joins 0.4 and 0.2 in the dustbin of node history.
22:13 <@isaacs> ningu: 0.8 is maintenance mode.
22:13 < mikeal> yes, dropping 0.6, request only supports the latest two stable releases
22:13 < LowValueTarget> top is network-scripts
22:13 < ningu> just wondering cause it's still the version you get in ubuntu quantal
22:13 <@isaacs> ningu: 0.10 is stable, 0.11 is unstable
22:13 < othiym23> if only people would stop using 0.6
22:13 < othiym23> but they haven't yet
22:13 < ningu> isaacs: I have no personal issue with not using v0.6, just wondering what the policy is.
22:14 <@isaacs> LowValueTarget: aha. drwxr-xr-x root/root 0 2013-03-14 15:41 ./network/
22:14 < ningu> mikeal: sorry, didn't know you were around :)
22:14 <@isaacs> LowValueTarget: don't put that extra folder in there.
22:14 < LowValueTarget> no thats my fault --- obfuscating
22:14 < mikeal> that's alright :)
22:14 < LowValueTarget> is network-scripts
22:14 <@isaacs> LowValueTarget: it's picking the first folder it sees, and then using that
22:14 < mikeal> request breaks compatibility pretty much intentionally with older versions
22:14 < ningu> mikeal: I think the real issue was a package that depended on the latest version of request, not taking into account whether the user would be on v0.6 or what
22:14 < mikeal> because the ecosystem has to evolve
22:14 <@isaacs> ningu: same goes for 0.4.
22:14 < LowValueTarget> isaacs: my fault --- i was obfuscating my project name --- should be `network-scripts`
22:14 < mikeal> so we need to break stuff
22:14 <@isaacs> LowValueTarget: oh, ok
22:14 < ningu> mikeal: I don't know if it's possible for a v0.6-compatible package to say: use request version X if on v0.6, version Y if on v0.8 or greater
22:15 < ningu> I never used v0.4, I wasn't in node-land :)
22:15 < mikeal> well....
22:15 < ningu> mikeal: but in any case once he reverted request manually it worked
22:15 < mikeal> it can require a lower version of request if it wants to support v0.6
22:15 < ningu> so it was only request that was causing the issue
22:15 < LowValueTarget> isaacs: so like this
22:15 < LowValueTarget> http://pastebin.com/raw.php?i=MTwLXjSK
22:16 < mikeal> right, package maintainers can either adopt request's policy of supporting the latest 2 versions or they can support older versions and lock to a much older version of request
22:16 < mikeal> but…. they'll likely break on 0.10
22:16 < LowValueTarget> isaacs: like i said, it works fine on my osx dev box, but not the ubuntu linux server
22:16 < LowValueTarget> strange
22:17 < ningu> I found very few compatibility issues between .6 and .8 so I'm surprised you could make it work on .8 but not .6
22:17 < ningu> but you said it was intentional :)
22:17 < ningu> anyway... I work on relatively small projects and fixing my code or deps is not an issue. but I can only imagine for people who have huge codebases with lots of edge cases
22:18 < ningu> I guess that's what tests are for
22:18 < mikeal> i can't think of what it was that would have broken it
22:18 < mikeal> but i'm not surprised because we stopped testing on v0.6
22:18 < ningu> ah ok
22:18 < LowValueTarget> fixed it isaacs -- tarball had to look like this
22:18 < LowValueTarget> http://pastebin.com/raw.php?i=9xDT5RfZ
22:19 <@isaacs> LowValueTarget: seems to work for me: https://gist.github.com/5165749
22:19 < LowValueTarget> weird
22:20 < LowValueTarget> using npm 1.2.14
22:20 <@isaacs> same here
22:20 <@isaacs> $ npm -v
22:20 <@isaacs> 1.2.14
22:20 < ningu> mikeal: by the way, in request how do you make sure the callback is only called once? do you have to use a semaphore and always check it, like: var alreadyDone = false; if (!alreadyDone) { alreadyDone = true; cb(); }
22:20 < LowValueTarget> wonder what's causing the behavior
22:20 < Sven_vB> is there also a flood control daemon named "weird"? ;D
22:20 <@isaacs> ningu, mikeal: If you need to do that, use require('once')
22:20 < ningu> I could check the code but really I'm wondering about best practices for things like requests that may trigger several events upon completion
22:21 <@isaacs> ningu: cb = once(cb)
22:21 < ningu> oh, cool
22:21 < mikeal> ningu: yes, and we've had several bugs in that code
22:21 <@isaacs> ningu: subsequent calls are ignored. (it's the same guard approach, but at least you odn't have to do it everywhere)
22:21 < ningu> isaacs: that's in npm, not core, right?
22:21 <@isaacs> ningu: yes, in npm
22:21 <@isaacs> mikeal: use once()
22:21 < mikeal> isaacs: ya! i can get rid of that code and take another dep :)
22:21 <@isaacs> mikeal: \o/
22:21 <@isaacs> three lines oyu'll never have to write again!
22:21 < ningu> isaacs: I think that should be publicized more since those bugs can be pretty hard to debug. good tool.
22:21 < mikeal> does require('once') it break on v0.6, that would be great :)
22:21 < kenperkins> isaacs, ryah, thanks for your hard work (and everyone else too) wouldn't have my new gig if not for you guys
22:22 <@isaacs> mikeal: no, sadly, i think it even works in web browsers.
22:22 <@isaacs> kenperkins: you're welcome. whats' your gig?
22:22 < asdf12> https://gist.github.com/anonymous/5dd315095a9f06dc98a3 why does a while loop block but a recursive function won't ?
22:22 < mikeal> haha
22:22 < kenperkins> isaacs: I'm the new node.js guy at rackspace, writing the packages for openstack and rax apis
22:23 <@isaacs> oh, nice!
22:23 <@isaacs> i think i saw a tweet about that somewhere
22:23 <@isaacs> maybe on twitter.
22:23 < kenperkins> hope to meet you all at nodeconf finally
22:23 < kenperkins> since now I get to go in an official capacity :D
22:23 < asdf12> isaacs: help me out por favor :)
22:23 < ningu> asdf12: not sure what you mean. a recursive function will block too.
22:23 < ningu> unless I am seriously mistaken.
22:24 < ningu> asdf12: you need to trigger a callback instead of while (go) { ... }. call it instead of setting go to false
22:24 <@isaacs> asdf12: your code is clearly wrong.
22:24 <@isaacs> asdf12: you're never yielding to the event loop, so it can never report back to you whether or not the connect() worked.
22:24 <@isaacs> or, even DO it in the fdirst place.
22:24 < asdf12> oh i realized why the recursive function works
22:24 < ningu> or emit an event, or whatever
22:25 <@isaacs> asdf12: because it's not actually recursive ;)
22:25 < asdf12> i had it in a callback
22:25 <@isaacs> bingo :)
22:25 < asdf12> so the stack COULD eventually exit
22:25 <@isaacs> that's not recursion. it's just calling again.
22:26 < asdf12> right, and the example was trying to simulate something i was seeing, but isn't it
22:28 < ningu> isaacs: btw do you know of any tools for debugging callback issues? specifically I've had cases where I unknowingly triggered callbacks too early and my script exited early since there were no more listeners. I always managed to find the bug but it can be hard.
22:28 < ningu> it would be nice if I could somehow trace what listeners there are.
22:29 < mscdex> uh oh, is npm having problems?
22:30 < ningu> I just did npm update -g, no issues
22:30 < ineeman> isaacs: are there any stats anywhere on node version uptake? we're trying to figure out if we can safely remove 0.6.x from our package, but I'd like to have some numbers to back the decision up
22:30 < ChrisPartridge> appears to be working fine for me
22:30 < mscdex> i'm having publish issues
22:31 < ningu> isaacs must be doing actual work
22:31 < othiym23> ineeman: I can tell you that based on what I'm seeing at New Relic, about 20% of my beta testers have one or more apps running on 0.6 still
22:31 < mscdex> there it worked on 3rd try
22:31 < mscdex> \o/
22:31 < othiym23> annoyingly, the higher volume the application, the more likely it is to still be on 0.6
22:31 < asdf12> 0.6 was a classic
22:31 < ineeman> othiym23: that's interesting, and unfortunate :)
22:31 < ningu> the 0.6 to 0.8 transition was totally painless for me
22:31 < othiym23> ineeman: agreed, and agreed
22:31 < ChrisPartridge> mscdex: user error :p
22:32 < mscdex> no
22:32 < mscdex> npm error :-)
22:32 < mscdex> npm ERR! cb() never called!
22:32 < mscdex> npm ERR! not ok code 0
22:32 < ineeman> I remember originally that there were pert issues with 0.8 that prevented some from upgrading, but I thought they'd be fixed by now
22:32 < ineeman> I imagine that nom has pretty solid numbers from the request logs
22:32 < mscdex> :S
22:32 < ineeman> npm, not nom
22:33 < ningu> is there a command to get npm to install dev dependencies?
22:34 < othiym23> ineeman: well, I had a couple testers as recently as 3 months ago who still had sizable apps running on 0.4
22:34 < ineeman> othiym23: I'm going to try not to think about that :)
22:34 < othiym23> ineeman: but I was able to chivvy them into upgrading to 0.6 at least
22:34 < othiym23> ineeman: stuff gets deployed into production and then people move on and don't want to touch the Node code ever ever again
22:35 < ningu> I mean, it sort of makes sense -- it's working, why mess with it?
22:35 < ineeman> othiym23: yeah, that is fair. In our case, we have our node SDK for Splunk, and we're running into an SSL issue with 0.10
22:35 < othiym23> ningu: cuz there's scary busted stuff in the core, that's why
22:35 < ineeman> I can fix it, but I'd rather fix it and drop support for 0.6
22:35 < othiym23> or in other words, it's working until it isn't, and then you're boned, because the APIs have completely changed since the last time you dealt with it
22:36 < ningu> I suppose that's true, but I don't know how likely an app that's been working for that long will stop working
22:36 < ineeman> The laws of production says it will break as soon as you upgrade :)
22:36 < ningu> no, I mean if you *don't* upgrade
22:36 < othiym23> ningu: scaling will cause it -- your app gets more load, and all of a sudden edge cases start popping up
22:36 < ineeman> ah
22:37 < ningu> yes, that's true I suppose
22:37 < ineeman> There are also possible security issues, though core doesn't seem to be hit by those very often
22:37 < othiym23> I dealt with that back when 0.6 was new -- had an app that started doing all kinds of crazy shit under heavy load, but was fine for dev and testing
22:37 < othiym23> Node has not even begun to have its most fun security goat rodeos yet
22:38 < othiym23> we're in that same weird safe zone that Rails was in for a long time where nobody's really paying attention to us
22:38 < mikeal> isaacs: i just realized, we totally forgot about long tracebacks :)
22:38 < mikeal> isn't that something that people needed or something
22:38 < ningu> mikeal: is that to do with my callback question?
22:38 < daekano> lol @ goat rodeo
22:38 <@isaacs> mikeal: so did everyone else.
22:38 < mikeal> no, totally unrelated
22:38 <@isaacs> mikeal: so, no, they didn't need it :)
22:38 < mikeal> yeah, do they actually not matter?
22:38 < mikeal> i remember when we thought that it was a blocker for adoption
22:38 <@isaacs> mikeal: also, it can't really be done efficiently outside of v8 itself.
22:38 < mikeal> i guess we were wrong
22:38 <@isaacs> mikeal: yeah, turns out we were wrong.
22:38 <@isaacs> mikeal: about so many things :)
22:38 < ningu> mikeal: well I still want to know about the callback thing :P
22:38 < othiym23> mikeal: I just use longjohn or trycatch when I need long stacktraces -- totally don't want to pay for having it in core
22:39 < mikeal> ningu: what's the questions exactly?
22:39 < othiym23> that said, my favorite feature of Candor is its lack of exceptions
22:39 < mikeal> othiym23: at some point ryah put them in a branch and they were a 10% hit
22:39 < ningu> isaacs: btw do you know of any tools for debugging callback issues? specifically I've had cases where I unknowingly triggered callbacks too early and my script exited early since there were no more listeners. I always managed to find the bug but it can be hard.
22:39 < mikeal> so then we were saying "maybe you 'turn them on' per domain"
22:40 < mikeal> that would be useful
22:40 < ningu> it would be nice if I could somehow trace what listeners there are.
22:40 < mikeal> isaacs is there a reason we can't do that actually?
22:40 <@isaacs> mikeal: it's slow.
22:40 <@isaacs> mikeal: like, you have no idea.
22:40 < mikeal> every time you bind something to a domain, it grabs the stack
22:40 < othiym23> ningu: the only thing I've found for that is using node --trace_all and then spending about a day sorting through the resulting dump
22:40 < mikeal> oh i know
22:40 < othiym23> ningu: but you've gotta really want it
22:40 < mikeal> it would be optional per domain
22:40 <@isaacs> mikeal: 100x slower.
22:41 <@isaacs> mikeal: completely unreasonably slow.
22:41 < ningu> othiym23: oh well.
22:41 < othiym23> ningu: or you can try DTrace on a SmartMachine if you're up for learning some D script
22:41 < mikeal> again, i'm not saying they are on
22:41 < mikeal> i'm saying, you have some code that you know is problematic
22:41 <@isaacs> mikeal: even if they're not enabled, that code path is so crazy hot. i don't want v8 to think we're going to do anything weird, even.
22:41 < mikeal> and before the part that's bad you do process.domain.bigTrace()
22:41 <@isaacs> mikeal: or even check flags we don't absolutely have to
22:41 < bradleymeck> node --immage-ruin-perf-to-debug-cause-im-already-screwed
22:42 < bradleymeck> s/immage/imma/
22:42 < mikeal> it'd be if (this._big) in the binding code of the domain
22:42 < mikeal> no, there shouldn't be a global option
22:42 < mikeal> or any flags or bullshit like that
22:42 <@isaacs> the problem is that we go *into* C++ from lots of places.
22:42 < othiym23> mikeal: I still think you're better off using something like longjohn or trycatch rather than having it be on domain or whatever
22:42 <@isaacs> we have one place where we come into JS
22:43 <@isaacs> but we'd have to make another hot path, first.
22:43 <@isaacs> and that's kind of a pita
22:43 < mikeal> that path isn't domain.add?
22:43 <@isaacs> mikeal: no.
22:43 <@isaacs> mikeal: so, like, socket.write() goes into the event loop
22:43 < othiym23> speaking as someone who's doing all kinds of incredibly nasty things to performance and monkeypatching a lot of super hot paths to generate performance metrics, I want as little of that stuff built into Node core as possible
22:44 <@isaacs> mikeal: then when we come back out, it calls handle.ondata
22:44 <@isaacs> mikeal: you'd have to grab the stack at handle.write(), and then attach it again at ondata, etc.
22:44 < othiym23> a. it generates business for New Relic (;) <-- ironic smiley) and b. YAGNI 99.5% of the time
22:44 <@isaacs> mikeal: again and again for every write() made to a given connection
22:44 < mikeal> i see
22:44 < mikeal> yeah, it's aweful
22:44 < mikeal> i'm not saying it's not
22:45 <@isaacs> mikeal: it's not just aweful, it's realy hard to do, no one needs it, and any errors it might help you debug, it might also cause/prevent/alter
22:45 <@isaacs> mikeal: no, the answer there is dtrace.
22:45 < mikeal> just wondering if it's possible to get it in without effecting performance when it's not enabled
22:45 < othiym23> mikeal: there's also the hit of calling new Error() and dynamically monkeypatching Error.prepareStackTrace, which isn't cheap
22:45 < mikeal> we don't live in a world where everyone that needs to debug has access to dtrace
22:45 < mikeal> othiym23: that sounds more dangerous
22:45 < othiym23> mikeal: yeah, but longjohn and trycatch are both 100% pure JS
22:46 < mikeal> othiym23: do either of those play well with domains tho?
22:46 < mikeal> because almost all my errors are trapped in domains now and printed
22:46 < othiym23> mikeal: it's not dangerous as soon as you treat the info you get via prepareStackTrace as read-only, but it is slow
22:46 < mikeal> so i can't do much with something that doesn't play with domains
22:47 < othiym23> mikeal: trycatch is more a replacement for domains that also offers long stacktraces
22:47 < Zak> mikeal: take this short moment to say that your request module is FUCKING AWESSSSOME
22:47 < Zak> and thank yuou
22:47 < othiym23> mikeal: longjohn doesn't fuck with domains at all -- it works perfectly well alongside them
22:47 < othiym23> I use it for debugging domain crap all the time, in fact
22:47 < mikeal> cool
22:47 < mikeal> Zak: thanks :)
22:48 < Zak> you're welcome
22:48 < mikeal> ningu: do you mean on an eventemitter or on the even system?
22:48 < othiym23> I think the real solution for all this stuff is DTrace, but using DTrace is like writing code with monads for me -- spend like a day figuring out exactly what it is I want to know, and then like 10 minutes writing D
22:48 < othiym23> I'm no dapsays
22:49 <@Nexxy> omfg, *the* mikeal?!
22:49 < mikeal> haha
22:49 < mikeal> hi emily
22:49 < ningu> mikeal: the issue has come up when an event emitter emits an event I'm not expecting, so I can't listen for it if I don't know it exists :) and afaik you can't do emitter.on('all') or whatever
22:49 < ningu> also, I don't always have access to the relevant event emitter
22:50 < mikeal> ningu: you could just override emit :)
22:50 < ningu> haha, I suppose
22:50 < ningu> that's not a bad idea
22:50 <@Nexxy> hey :)
22:50 < mikeal> not recommended as something permanent but i do it sometimes for debugging
22:50 < ningu> for logging actually that would work well
22:50 < ningu> yeah, it's a good idea for debugging
22:50 < mikeal> everything being mutable has it's advantages :)
22:51 * othiym23 cries
22:51 < mikeal> hahaha
22:51 < mikeal> othiym23 is the guy who has to make your module work when you break things like that and try to run them on a cloud provider :)
22:52 < ningu> I prefer a sunshine provider to a cloud provider anyway
22:52 < eurythmia> Hi folks; I'm running ubuntu 12.10 and I installed both nodejs and nodejs-legacy (legacy provides the node binary, nodejs provides the nodejs binary); I've also installed npm and ran "npm install fs". I jave a "server.js" file provided to me, but it appears to not have (the correct?) fs module. A brief run/explanation is pasted here (http://www.pastebin.ca/2332493); I'd appreciate any help to get me up and running.
22:52 < eurythmia> s/jave/have/
22:52 < ningu> eurythmia: you shouldn't have to install fs
22:53 <@Nexxy> eurythmia, that's probably a paths issue
22:53 < mikeal> that's a version issue
22:53 < eurythmia> ningu: I was under that impression as well. The same code works on my mac, but not under ubuntu.
22:53 < mikeal> .exists moved at one point between path and fs
22:53 < ningu> ahh
22:53 < ningu> that sounds plausible
22:53 < mikeal> eurythmia: node --version
22:53 < othiym23> yeah, if node is newer than 0.6, you need to move fs.exists calls to path.exists
22:54 < eurythmia> 0.6.19
22:54 < othiym23> oops backwards
22:54 < ningu> no, it's fs.exists
22:54 <@Nexxy> or var exists = fs.exists || path.exists
22:54 < othiym23> yeah, flip what I just said
22:54 < mikeal> oh no
22:54 < mikeal> you know what it is
22:54 < ineeman> mikeal: when did the 'strictSSL: false' option get into request such that I can disable SSL vert checking?
22:55 < ningu> mikeal: no, but I'm on the edge of my seat
22:55 < mikeal> eurythmia: rm -rf node_modules/fs
22:55 < ineeman> I'm having a hard time locating it down to a version
22:55 < ChrisPartridge> ineeman: pretty sure it came after 0.8 was released
22:55 < mikeal> isaacs: why is there an "fs" module in npm :)
22:55 < ningu> hehe
22:55 < ineeman> ChrisPartridge: that is useful, I can narrow the search range then
22:55 <@mbalho> the real qusetion is why are there 18 dependent modules on fs
22:56 <@Nexxy> time to break out the falafel
22:56 < eurythmia> mikeal: done; issue persists. I tried the npm install becausee I already had the issue.
22:56 < ChrisPartridge> ineeman: when ever rejectUnauthorized was added to tls afaik (i could be wrong)
22:56 < mikeal> eurythmia: can you put the server.js you are trying to run on gist.github.com
22:57 < eurythmia> mikeal: sure. Standby.
22:58 < mikeal> dammit, what is the url structure for looking at old docs?
22:59 < eurythmia> mikeal: https://gist.github.com/eurythmia/92d3e34033326f0534a2
22:59 < ChrisPartridge> docs/vx.x.x/api
22:59 < mikeal> ChrisPartridge: thanks
23:00 < mikeal> yeah, eurythmia: http://nodejs.org/docs/v0.6.0/api/fs.html
23:00 < mikeal> that was in the path module back then
23:00 < mikeal> you need a newer version
23:00 < mikeal> or you need to move it to path
23:00 < mikeal> http://nodejs.org/docs/v0.6.0/api/path.html#path.exists
23:01 < Mss> hi people
23:01 < context> 0.6.0 ?
23:01 < context> scary
23:01 < mikeal> yeah, it's a much better idea to upgrade to latest stable
23:01 < mikeal> linux distro's are horrible about staying up to date
23:01 < Daynab> Hi everyone, I have an issue where no apps whatsoever work through localhost in node 0.10.0, I dont understand why because the exact same code works in 0.8.22 and even the last beta version before 0.10.0. I'm just using the http.createServer(blabla).listen(8080) that tutorials always show
23:01 < eurythmia> mikeal: darn; I'm using what's in the ubuntu repos. I'll try to find a newer version.
23:02 < eurythmia> Thanks for your assistance though, I really appreciate it.
23:02 < Daynab> it simply times out and says it can't find it after 30 seconds or so
23:02 < othiym23> especially fucking Debian
23:02 < mikeal> yeah, ubuntu is way out of date, so is debian
23:02 < othiym23> I love Debian but the nodejs maintainer is more or less hostile to how Node's release cycle works
23:02 < ineeman> ChrisPartridge: thanks, that is very useful, I will try and find the right version
23:02 < ChrisPartridge> eurythmia: Just compile from source, it's dead easy on debian based systems
23:03 < othiym23> eurythmia: use chrislea's PPA, it doesn't have Debian's dumbass nodejs-legacy split and is more up to date
23:03 < othiym23> eurythmia: maybe not 0.10, but definitely a newish 0.8
23:03 <@Nexxy> othiym23, tell us how you really feel
23:03 < eurythmia> othiym23: perfect, thanks. I was just about to google that :-)
23:03 < othiym23> Nexxy: this is a family channel, so you only get the censored version
23:03 <@Nexxy> oh, right!
23:03 < ningu> othiym23: that's why I use ubuntu, they have fewer personal axes to grind
23:03 <@Nexxy> good call!
23:03 < othiym23> ningu: no, they have corporate axes to grind instead ;)
23:04 < ningu> othiym23: well, in general I find things work better for me
23:04 < ningu> although their node is also out of date as mikeal said
23:04 <@Nexxy> my axe is already perfectly sharp.
23:05 < Mss> where can I find a course of nodejs?
23:05 < Mss> in Brazil
23:05 < ningu> Mss: the nodejs restaurant offers three-course meals
23:05 < ningu> oh
23:05 < ningu> :)
23:05 < Mss> =}
23:05 < ningu> you mean an in-person training course?
23:06 < ningu> there's a guy on here, guidocalvano, who is brazilian I think
23:06 < othiym23> ningu: me too, but I used to work with ex-Ubuntu guys so I know they have no shortage of sausagey politics going on there
23:06 < Mss> yes
23:07 < ningu> othiym23: I'm sure that's true. but I don't really care about that unless it actually affects me.
23:07 < eurythmia> othiym23: unfortunately you're going to run into that pretty much anywhere you work :-/
23:07 < ningu> and so far, it rarely does.
23:07 < Mss> or the best online course
23:07 < eurythmia> ... at least anywhere that makes money.
23:07 < MI6> joyent/node: isaacs master * c0721bc : repl: Use a domain to catch async errors safely Fix #2031 - http://git.io/_7SqYw
23:07 < othiym23> that's why I only run a GNU/Linux distro that I compiled from raw source all by myself
23:07 < ningu> Mss: there are plenty of online tutorials, but I don't really know what the best current one is. other people here might have some suggestions. I just taught myself by trial and error.
23:07 < Mss> there is still a certification for nodejs?
23:08 < othiym23> ha ha no that would be incredibly dumb i just run Ubuntu like a normal person
23:08 < Havvy> Why would there be a certification for Node.js?
23:08 < ningu> othiym23: I write my own tools personally in assembler
23:08 < Gambit--> ningu: slacker; 9v battery and a pair of paperclips.
23:08 <@Nexxy> Why would we answer a question without being a jerk?
23:09 < niggler> is there a way to specify that a dependency should be global?
23:09 < ningu> Gambit--: why do you need two?
23:09 < ningu> niggler: I don't think so. it's definitely not recommended to do so.
23:09 < bradleymeck> othiym23: if you can figure out how to get dtrace to tell me what port 0 ended up listening on id give you any one wish
23:09 < Gambit--> ningu: it's incredibly difficult to wire both pins of the battery into the transistor with a single paperclip.
23:09 < niggler> im trying to figure out what the right approach regarding coffeescript is
23:09 < Mss> because in Brazil a certificate worth more than experience
23:09 < eurythmia> Gambit-: M-c M-x
23:10 < ningu> niggler: dev dependency?
23:10 < ningu> but I see your point
23:10 < ningu> however, I wouldn't want npm install to introduce something into my PATH
23:11 < othiym23> bradleymeck: glarb, lemme think about that
23:11 < bradleymeck> othiym23: ive talked to the dtrace maintainers, its not going to happen
23:11 < davidbanham> niggler: My favourite trick lately has been a wrapper script like this: https://raw.github.com/davidbanham/ntor-cli/master/wrapper.js
23:11 < niggler> i think the mechanism as it stands makes sense ningu but there should be a way to specify that certain modules be installed globally (and just fail otherwise)
23:11 < eurythmia> othiym23: now running 8.2.2, and no more issues about .exists not being a valid attribute :-)
23:11 < ningu> niggler: I would recommend you distribute it pre-compiled anyway, evn if you include the coffeescript source
23:11 < othiym23> bradleymeck: don't you have some kind of Joyent back channel to trick Bryan and Dave into helping you figure that stuff out?
23:11 < freewil> niggler, theres no reason coffee-script needs to be a global dependency, just stick it in devDependencies and make a prepublish script that compiles it
23:11 < bradleymeck> othiym23: its not going to happen after talking to them, but if you had some back hacky way...
23:11 < ningu> niggler: oh, I see. hmm, yeah, that would be a sane behavior but I don't know if you can do it
23:11 < davidbanham> That way you only need coffee-script in the local project. Also makes it easier to rely on a particular version
23:12 < bradleymeck> i cant get the result of a passed in arg ptr, just the return value
23:12 < bradleymeck> since i cant call another thing to get addrinfo for the socket
23:12 < niggler> ooh davidbanham yeah i may end up doing something like that
23:12 < othiym23> bradleymeck: I've wanted to know that myself, and we did something like that before, but it was something really gross and heuristic inside Node
23:13 < othiym23> like, pure JS, but really really painfully bad and wrong JS
23:13 < bradleymeck> othiym23: just copypasta carapace's net plugin
23:13 < ningu> davidbanham: is there a script in bin/ when you install it locally that you can run from your prepublish script?
23:13 < ningu> I guess there must be
23:13 < bradleymeck> it hasn't changed in like a year so its pretty solid
23:13 < othiym23> niggler: predeploy script and / or tactical nuclear weapons
23:14 < othiym23> dangit, prepublish, not predeploy
23:14 < othiym23> I keep mixing those two up
23:14 < ningu> I'm kind of sick of coffee/live/* JS precompilers
23:14 < ningu> it's a lot of fragmentation
23:14 < othiym23> bradleymeck: cool, thanks
23:14 < davidbanham> ningu: I don't use a prepublish script. I just distribute the source coffee script and have users run it with node wrapper.js.
23:14 < ningu> ah, ok
23:15 * Nexxy sheds a tear for the users
23:15 * azylman fights for the users!
23:15 < othiym23> all those wasted CPU cycles
23:15 < context> ningu: how so, its all JS in the end
23:15 < othiym23> that wouldn't have to be expended if only a prepublish script were added to the package
23:16 < davidbanham> I know, I know, the core team will come to my house and kick me in the shins.
23:16 < niggler> all of those langauges suck
23:16 < niggler> frankly, coffeescript is harder to read than JS
23:16 < context> most of those language make writing js easier
23:16 < ningu> context: yes, but i prefer reading the original source, the compiled versions aren't always very readable
23:16 < niggler> most of those languages are WORN (write once, read never)
23:16 < azylman> "frankly, coffeescript is harder to read than JS" for someone who is used to js, yes, that's true
23:16 < context> yeah i wouldnt try reading a compiled version either
23:16 < bradleymeck> i wonder what stats are if you grepped npm's lib field for all modules
23:16 < azylman> In the same way that C++ is going to be heard to read from someone coming from javascript
23:16 < context> ningu: if im writing the original source in coffee, the compiled version is NOT the original version
23:16 < davidbanham> niggler: There's a definite curve with coffeescript, and there are some things that are always harder to read, but I find it's just SO much nicer to write once you're used to it.
23:17 < bradleymeck> also wtb source maps in node's debugger
23:17 < niggler> no its not about a curve davidbanham and its not about being used to js azylman -- stuff like interstitial whitespace sensitivity slows down reading
23:17 < ningu> context: yes. my point is just that I have to learn a bunch of subtle differences in semantics in order to read coffeescript or livescript or whatever
23:17 < niggler> python suffers from this to some extent
23:17 < othiym23> bradleymeck: wtb a version of Node's / V8's debugger that actually works reliably
23:18 < bradleymeck> othiym23: lol that too
23:18 < ningu> even if they are solving genuine problems it ends up being harder for everyone to be on the same page and read each others' code
23:18 < bnoordhuis> are we having a language war?
23:18 < azylman> niggler: That is definitely your personal opinion
23:18 < davidbanham> niggler: I'm saying it's both. I don't think coffescript is ever as readable as well written JS, but once you're used to it it's fairly close. And I think that slight tradeoff is worth the happiness I get from writing it.
23:18 < kenperkins> I'm looking for a nice example of someone mocking http requests for unti tests of an api wrapper
23:18 < ningu> bnoordhuis: apparently, I started one inadvertently
23:18 < niggler> that is definitely something that can be empirically testsed
23:18 < niggler> *tested
23:18 < davidbanham> bnoordhuis: Get the torches.
23:18 < azylman> Then do it
23:18 < azylman> Until you empirically test it, you can't claim it's true across the board
23:18 < othiym23> you can use whatever terrible transpiler you want, I just want stuff published to npm in the form that Node actually runs
23:18 < othiym23> for the children
23:18 < context> ningu: if you cant read my code we arent on the same page
23:18 < azylman> Especially when it contradicts existing studies
23:19 < ningu> kenperkins: I try not to mock http requests, they don't behave well under pressure
23:19 < context> ningu: choosing coffeescript over JS is a group decision. you cant read it cause you dont know it
23:19 < bradleymeck> othiym23: ppl also don't remember that transpilers change...
23:19 < kenperkins> tip your waiter folks, ningu's here all week
23:19 < othiym23> kenperkins: check out node-fakeweb -- it's a port of Ruby's fakeweb that isn't completely terrible
23:19 < ningu> context: that's baically my entire point. not that coffeescript is bad or good.
23:19 < kenperkins> othiym23: ty
23:19 < miu2n> anyone have a good place to start learning with node.js?
23:19 < niggler> is there an existing study that suggests that reading words or code that's sensitive to whitespace is faster or easier than those which arent?
23:19 < context> i cant read haskell, so i dont try to
23:19 < azylman> No, but there are many studies that suggest that whitespace makes bodies of text easier to read
23:19 < kenperkins> mikeal: does request have mocking support built in
23:20 < azylman> So you can easily apply that same principal to code
23:20 < mikeal> nope
23:20 < context> niggler: personally i hate white-space dependant stuff, thats why i stayed away from python, but i do like coffeescript :x
23:20 < mikeal> eran hammer wrote a library for mocking core's client
23:20 < ningu> context: right, I'm just saying there is a public community of js users, and it's a shame that things shouldn't be accessible to them too. it isn't the end of the world.
23:20 < othiym23> niggler: all of those perceptual reading / cognitive load studies turn out to have weird methodological assumptions that make them hard to lend much credence to
23:20 < bradleymeck> transpilers upgrade, compile to ensure consistency over time
23:20 < niggler> there's a difference between prefixed whitespace and interstitial whitespace
23:21 < kenperkins> othiym23: interesting. This intercepts, so you don't have to provide an optional request method to your factory
23:21 < ningu> othiym23: do you have links to any of those studies, flawed or not?
23:21 < niggler> as an example, nums = [1..5].map(i) -> i*2 is not the same as nums = [1..5].map (i) -> i*2
23:21 < Industrial> Does everyone have their own idea on how to set up a network of nodes or is there some straightforward reading I can do (the architecture, not the technology to implement it. Specifically which types of nodes and where and why :)
23:21 < ningu> I always thought the whitespace thing was more or less a personal preference
23:22 < ningu> I didn't mean to start a flamewar about what was better, it was a point about fragmentation only :)
23:22 < MI6> joyent/node: isaacs v0.10 * 3537b57 : test: No need for kicking in streams2 test This was necessary when we we (+1 more commits) - http://git.io/EQ52fQ
23:22 < ningu> Industrial: I suppose if you google nodejs load balancer, you will get some good results
23:22 < niggler> brace versus whitespace indentation is more preference, but whitespace within a line is definitely slower
23:23 < bradleymeck> Industrial: just look at fleet / seaport as a start
23:23 < azylman> Again, you're saying "definitely" as if it's proven
23:23 < azylman> YOU may find it slower
23:23 < azylman> But for blocks of text, increased white space between words and lines makes it clearer to read what's going on
23:23 < ningu> I just like having a large library of code that I can (1) use and (2) easily read
23:23 < Industrial> bnoordhuis: I did, now I'm trying to look beyond that, as a good measure.
23:23 < azylman> My point is that you might not like coffeescript, and that's totally legit
23:23 < azylman> Not everyone does
23:23 < niggler> but when the spacing between words actually matters, then you have a readability problem
23:23 < niggler> you missed my point
23:24 < azylman> But you can't claim that it's empirically worse without any evidence
23:24 < Industrial> bradlrymeck*
23:24 < niggler> the key word is *interstitial*
23:24 < niggler> lets construct an experiment
23:24 < niggler> in fact this is simple
23:24 < ningu> niggler: are people actually doing these experiments? who?
23:24 < ningu> like, psychologists?
23:24 < niggler> apple does similar experiments all the time
23:25 < niggler> for example, regarding the speed of using mice versus keyboard shortcuts
23:25 < gaf> i think coffe users are selfish. why release code in coffe if it will serve js users? just use coffe for yourself, if you like, but don't force that to others
23:25 < miu2n> gaf: I completely agree
23:25 < azylman> They're not forcing it on others.
23:26 < azylman> You're not forced to use whatever they release.
23:26 * ChrisPartridge wishes he had a dollar every time there was a conversation about cs v js
23:26 < niggler> ningu: http://www.asktog.com/TOI/toi06KeyboardVMouse1.html We’ve done a cool $50 million of R & D on the Apple Human Interface. We discovered, among other things, two pertinent facts:
23:26 < niggler> Test subjects consistently report that keyboarding is faster than mousing.
23:26 < niggler> The stopwatch consistently proves mousing is faster than keyboarding.
23:26 < ningu> my point was not to criticize any individual people but just to say that it's desirable for the js community in general to collectively solve some of these issues and come to a consensus. that may be not possible but it would be good.
23:26 < gaf> miu2n, eh, it is common sense
23:26 < niggler> people actually do these studies ningu :)
23:26 < ningu> niggler: cool, will read
23:26 < othiym23> kenperkins: yeah, it was put together at speed (I used to work with the author), but it's clever
23:27 < ningu> I never said they didn't, just didn't know where to look
23:27 < azylman> That doesn't have anything to do with whitespace
23:27 < othiym23> ningu: not at hand, I just spent a lot of time reading about that stuff back when I was thinking about becoming a type designer
23:27 < niggler> azylman ningu asked " niggler: are people actually doing these experiments? who?"
23:27 < ningu> I'm particularly interested in experiments studying the efficiency of reading code
23:28 < ningu> I suspect it would be hard to do because no one reads code with a blank slate
23:28 < azylman> niggler: He asked that after you talked about reading code...
23:28 < ningu> so I don't know how you control for those variables
23:28 < niggler> so i suspect a test would point to very subtle differences
23:28 < niggler> and see if developers can pick up on them
23:28 < niggler> for example, "nums = [1..5].map(i) -> i*2" versus "nums = [1..5].map (i) -> i*2"
23:30 < niggler> and in javascript, im not even sure there's a way to construct a similar subtlety involving a single space
23:30 < Havvy> niggler: With newlines yes. With spaces, no.
23:30 < azylman> Or with parentheses
23:30 < niggler> i agree with newlines Havvy
23:30 < ningu> my perspective on this whole debate is from many years using perl where the motto is, there's more than one way to do it. but I actually rather like the fact that in JS there's often only one way to do it -- the number of cases where I wish there was another way are actually quite few.
23:30 < niggler> azylman the only difference in aforementioned case is a space between the p and the open parens
23:31 < Havvy> >> var f = {a: 'b'};f . a
23:31 < azylman> Yes, I realize that
23:31 < purr> Havvy: (string) 'b'
23:31 < azylman> I was talking abou javascript now
23:31 < ningu> for example I wish JS had an ||= operator
23:31 < azylman> Basically, what I'm saying is that I've used many, many different languages over the years and it's very rare for any one language to be empirically better or worse than another language
23:31 < ningu> and I wish delete foo.bar returned the value of foo.bar
23:32 < azylman> And anyone who says otherwise is usually biased, whether intentionally or not
23:32 < niggler> i never said one was better than the other. I certainly agree that its faster to write coffeescript but I still maintain its faster to read javascript
23:32 <@mbalho> /join jssyntaxdebatefest2013 is the only answer
23:32 < ningu> hehe
23:32 < azylman> lol
23:32 < othiym23> ningu: how do you know if the delete worked, in that case?
23:32 < niggler> you are missing a # mbalho
23:32 < othiym23> or even better, /join ##javascript
23:33 < ningu> othiym23: umm... if the delete didn't work I think you have bigger issues, no?
23:33 < othiym23> where the punishment (being in ##javascript) will inevitably fit the crime (joining ##javascript)
23:33 < ningu> othiym23: or do you mean in case the property was immutable?
23:33 < azylman> niggler: And I'm totally cool with you maintaining that. It probably is faster, but I would guess that that comes from familiarity more than anything else - that was my point
23:33 < gaf> fuck the coffe scripters, nuff said
23:33 < othiym23> ningu: yeah, delete does have a return value right now, and sometimes you need it
23:33 < Havvy> >> var f = {a: 1}; [delete f.a, delete f.a]
23:33 < purr> Havvy: (object) [true, true]
23:33 < ningu> othiym23: I didn't realize that.
23:33 < Havvy> o.0
23:33 < azylman> I definitely read coffeescript faster than javascript
23:33 < azylman> gaf: Cool story bro
23:34 < ningu> othiym23: can you give an example of when you'd need it?
23:34 < asdf12> to make sure something was deleted / deletable
23:34 < asdf12> it returns a boolean
23:34 < ningu> asdf12: ok, but why would something not be deleted? or deletable?
23:34 < ningu> if it's set to be immutable?
23:35 < Havvy> >> var f = Object.freeze({a: 1}); delete f.a
23:35 < context> ningu: you want to remove the value and pass the object somewhere else, and the same time you need to use that value.
23:35 < purr> Havvy: (boolean) false
23:35 < asdf12> ningu: well you can't delete objects for instance
23:35 < asdf12> delete is for properties of an object
23:35 < ningu> I'd think that would just throw then
23:35 < ningu> s/would/should/
23:35 < Havvy> asdf12: You can delete objects just fine.
23:35 < daekano> ?
23:35 < othiym23> ningu: yeah, when you're doing stuff with reflection and might be working with objects that have nonmodifiable or branded properties
23:35 < Havvy> >> var o = {a: {}}; [delete o.a, o]
23:35 < ningu> like if you freeze an object and then do obj.foo = 10, doesn't it throw?
23:36 < purr> Havvy: (object) [true, {}]
23:36 < othiym23> >> delete undefined
23:36 < purr> othiym23: (boolean) false
23:36 < asdf12> Havvy: a is a property
23:36 < othiym23> delete never throws
23:36 < othiym23> which is good
23:36 < ningu> >> var o = Object.freeze{}); o.foo = 10
23:36 < purr> ningu: SyntaxError: Unexpected token {
23:36 < asdf12> >> var o = {}; delete(o);
23:36 < purr> asdf12: (boolean) false
23:36 < ningu> >> var o = Object.freeze({}); o.foo = 10
23:36 < purr> ningu: (number) 10
23:36 < Havvy> >> var o = Object.freeze({}); o.foo = 10; o
23:36 < purr> Havvy: (object) {}
23:36 < ningu> ok so it just fails silently
23:37 < ningu> >> var o = {}; delete o; o
23:37 < purr> ningu: (object) {}
23:37 < asdf12> thats why it returns a boolean
23:37 < asdf12> throwing is overrated
23:38 < ningu> >> delete Object.prototype;
23:38 < purr> ningu: (boolean) false
23:39 < asdf12> and i'm not sure what ||= does in other languages, but can't you just do a = a || b ?
23:39 < asdf12> isn't that the same effect in other languages?
23:39 < ningu> asdf12: sure. I just don't like repeating myself :)
23:39 <@mbalho> a = a || b is like 3 extra characters! what if my hard drive fill sup!?
23:39 < othiym23> o/~ sooooomebody's a Ruby developer o/~
23:40 < samholmes> substack: kudos on the new substack.net. I like the glog concept. :)
23:40 < deoxxa> asdf12: think about *= - a *= 4 -> a = a * 4, a ||= 4 -> a = a || 4
23:40 < superjoe> I'm having a weird glitch where a WebSocket works fine first attempt, but if I restart the server, any new WebSocket that the client creates is read-only - no data makes it to the server
23:40 < ningu> mbalho: more of a maintainability question.
23:40 < othiym23> deoxxa: that should probably be split over multiple lines for the good of humanity
23:40 < ChrisPartridge> mbalho: you buy a SAN ;)
23:40 < deoxxa> othiym23: never!
23:40 < ningu> it's easier to refactor if you don't repeat things in that context.
23:40 < superjoe> so there's some kind of changed state client side - reconnecting WebSockets have some different state - but the bug is *server side*, responding incorrectly to the different state
23:40 < ningu> in that case why have *=, += at all?
23:40 < superjoe> anybody seen this before?
23:41 < superjoe> what's different about a WebSocket the 2nd time you instantiate one?
23:41 < context> ningu: its shorter.
23:41 < ningu> context: that's my point exactly :P
23:41 < ningu> and also clearer, imo.
23:41 < context> ningu: and personally for me WAY easier to read and less likely to mess up a var name
23:41 < ningu> that too
23:42 < ningu> so I don't see why it shouldn't be ok to do ||= if you want
23:42 < asdf12> and i actually think in js theres more than one way to do things like perl's motto
23:42 < substack> samholmes: it needs some work still since the current version fetches all the content when the page loads
23:42 < ningu> asdf12: perhaps, but not nearly to the same extent
23:42 < ningu> asdf12: which in general I think is fine
23:43 < ningu> anyway I'm not criticizing the designers of JS -- it has a complicated history. but specs are also evolving things.
23:44 < samholmes> substack: Will you implement an infinite scroll thing>
23:44 < samholmes> ?
23:44 < substack> eventually
23:44 < ningu> that would be pretty cool
23:44 < ChrisPartridge> superjoe: after a page refresh?
23:44 < substack> samholmes: I need more content first
23:44 < othiym23> ningu: if you spend any time on es-discuss, you will learn to criticize the designers of JS
23:44 < superjoe> ChrisPartridge, if I do a page refresh, the socket connection is fine
23:44 < othiym23> repeatedly
23:44 < substack> so I have something concrete to be optimizing
23:45 < ningu> othiym23: hehe, I can believe it
23:45 < superjoe> ChrisPartridge, with in the same life of the page, if I restart the server during the 1st web socket connection, the 2nd attempt is read-only
23:45 < ningu> othiym23: I just think in general the language is pretty awesome, but I know there are plenty of weird corners
23:46 < ningu> parseInt(foo, 10) is weird for example
23:46 < superjoe> I'm using https://github.com/einaros/ws
23:46 < asdf12> arrayssss
23:46 < ningu> but just kind of eccentric, not actually a problem
23:46 < asdf12> are weird
23:46 < belfare> hi all, I'm kind of new to xml processing… I was wondering if there was a way to search through and xml document for specific tags and parse our the attributes and values
23:46 < superjoe> trying to debug the issue, a good clue would be if I knew what was different about the 2nd WebSocket you create in browerland
23:46 < ningu> belfare: well, sure, there are plenty of xml parsing libraries
23:46 < azylman> belfare: I've used cheerio before for html, but it works for xml too
23:47 < belfare> so you'd recommend cheerio, any others that are good?
23:47 < samholmes> substack: Its interesting that you're using git as a publishing tool. The benefit that comes to mind is the ability for readers to pull blog posts using git. Is this the motivation for glog?
23:48 < samholmes> That is, you goals was to make it very easy for users to fetch/pull the blog posts, vs an RSS feed sort of thing?
23:48 < niggler> glog = google log?
23:48 < ChrisPartridge> superjoe: how are you handling the reconnect? perhaps it still thinks the first connection is still active?
23:48 < samholmes> niggler: git weblog
23:48 < samholmes> niggler: https://github.com/substack/glog
23:49 < samholmes> substack: Dude! You could make a service that allows you to aggregate glogs out there into one feed! ;D
23:49 < ChrisPartridge> gloggler?
23:49 < samholmes> #billionsdollarsideas
23:49 < ningu> hehe
23:49 < samholmes> ChrisPartridge: sure. :P
23:50 < faceleg|work> do I need to close a filestream or is it magic?
23:50 < superjoe> ChrisPartridge, here's a snippet: https://gist.github.com/superjoe30/5166299
23:50 < ningu> faceleg|work: I'm pretty sure it closes itself and emits relevant events once it reaches the end
23:50 < superjoe> pretty straightforward
23:50 < ningu> there are 'close' and 'end' events iirc
23:51 < MI6> joyent/node: isaacs v0.10 * 14947b6 : stream: Return self from readable.wrap Also, set paused=false *before* c - http://git.io/m44mFA
23:51 < faceleg|work> so if I'm piping request data to a fs
23:52 < faceleg|work> I should do my work with the finished file in teh fs.on('close', funct) evnt?
23:52 < asdf12> fs.end()
23:52 < AviMarcus> yes, as asdf12 said -- you want to tell fs to end, not listen for it to end
23:52 < faceleg|work> asdf12: shoujld this be in my request.on('end') func?
23:52 < ningu> asdf12: that's for writable streams
23:53 < AviMarcus> you want to listen for your request to end..
23:53 < asdf12> ningu: i think his fs is his write stream
23:53 < ningu> for readable streams you listen for 'end'
23:53 < ningu> for writable streams you call end()
23:53 < faceleg|work> hastbin coming
23:54 < faceleg|work> ningu: asdf12 AviMarcus http://hastebin.com/wopipojisu.coffee
23:55 < faceleg|work> that 'fs.end' errors, I added that just now and forgot to remove it for the hastebin
23:55 < asdf12> where'd you add it?
23:56 < asdf12> in 'close' ?
23:56 < faceleg|work> line #6
23:56 < asdf12> it should be 'end'
23:56 < substack> samholmes: the motivation for me in using git is mostly in authorship and publishing
23:56 < ningu> you need to save the stream
23:56 < asdf12> 'close' means it already has ended, thats probably the error you're getting?
23:57 < ningu> var ws = fs.createWriteStream(zipFile); .pipe(ws); ws.end();
23:57 < faceleg|work> herp; derp
23:57 < ningu> but I don't know what events request() will emit
23:57 < faceleg|work> hmm
23:57 < ningu> is that mikeal's request?
23:57 < substack> samholmes: and it's very easy to make edits to existing articles and to build up articles saving my entire edit history in case I need to revert changes
23:57 < korilo> substack, how do you manage style,layout in glog?
23:58 < korilo> i mean when you write an article too
23:58 < substack> korilo: it's just markdown
23:58 < substack> glog doesn't do anything with static content
23:59 < samholmes> substack: but what are your thoughts on distribution? It would be convenient for me to have a rss-feed-like thing where I can "git pull" your blog if I want to keep up with it.
23:59 < substack> it just gives you a /glog.git that you can push and pull with and a /blog.json that you can load articles with from http
23:59 < othiym23> substack: do you have plans to fix the wacky scrolling issues when you click on blog posts?
23:59 < substack> othiym23: that's a bug in single-page
23:59 < faceleg|work> ningu: do I need to wait or anything before I can use the file created by ws.createWriteStream()?
23:59 < othiym23> aha
23:59 < faceleg|work> when I try to unzip it
23:59 < faceleg|work> I get "Invalid CEN header (bad signature)"
--- Log closed Fri Mar 15 00:00:09 2013