Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
_whitelogger [_whitelogger!~whitelogg@kaunan.whitequark.org] has joined #ruby-lang
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
rippa [rippa!~rippa@93-181-234-108.adsl.yaroslavl.ru] has joined #ruby-lang
_whitelogger [_whitelogger!~whitelogg@kaunan.whitequark.org] has joined #ruby-lang
kith [kith!~kith@unaffiliated/kith] has joined #ruby-lang
brianpWins [brianpWins!~brianpWin@S0106c0c1c00191c1.vc.shawcable.net] has joined #ruby-lang
Defusal_ [Defusal_!Defusal@dsl-241-16-206.telkomadsl.co.za] has joined #ruby-lang
Defusal_ [Defusal_!Defusal@unaffiliated/ecnerifed] has joined #ruby-lang
hahuang65 [hahuang65!~hahuang65@204.11.231.186.static.etheric.net] has joined #ruby-lang
qpingu [qpingu!~Adium@67.218.117.238] has joined #ruby-lang
chimkan [chimkan!~chimkan@173.243.33.72] has joined #ruby-lang
hecspc [hecspc!~hec@81.184.161.198.dyn.user.ono.com] has joined #ruby-lang
Skif_home [Skif_home!~Skif@72.1.92.57] has joined #ruby-lang
eschwartz [eschwartz!~Skif@74.115.253.42] has joined #ruby-lang
Jay_Levitt [Jay_Levitt!~Jay_Levit@c-24-63-250-125.hsd1.ma.comcast.net] has joined #ruby-lang
harlanhorbach [harlanhorbach!~harlanhor@174-127-47-2.static-ip.telepacific.net] has joined #ruby-lang
hagabaka [hagabaka!~quassel@cblmdm24-53-178-92.buckeyecom.net] has joined #ruby-lang
hagabaka [hagabaka!~quassel@unaffiliated/hagabaka] has joined #ruby-lang
lele [lele!~lele@fangorn.windmill.it] has joined #ruby-lang
Stereokitsune [Stereokitsune!~mayoi@nessa.yuuzukiyo.net] has joined #ruby-lang
chimkan_ [chimkan_!~chimkan@173.243.33.72] has joined #ruby-lang
malev_ [malev_!~malev@190.210.138.237] has joined #ruby-lang
<jorgenpt> I'm getting a '.rvm/gems/ruby-1.9.2-p290@global/gems/i18n-0.6.0/lib/i18n/config.rb:17:in `backend': no such file to load -- i18n/backend (LoadError)' when using actionview, but if I print $LOAD_PATH right before the line that generates the error, it includes .rvm/gems/ruby-1.9.2-p290@global/gems/i18n-0.6.0/lib
<jorgenpt> And .rvm/gems/ruby-1.9.2-p290@global/gems/i18n-0.6.0/lib/i18n/backend.rb exists
qpingu [qpingu!~Adium@67.218.117.238] has quit [#ruby-lang]
hagebake [hagebake!~quassel@cblmdm24-53-178-92.buckeyecom.net] has joined #ruby-lang
hagebake [hagebake!~quassel@unaffiliated/hagabaka] has joined #ruby-lang
malev_ [malev_!~malev@190.210.138.237] has joined #ruby-lang
harlanhorbach [harlanhorbach!~harlanhor@99-47-150-117.lightspeed.irvnca.sbcglobal.net] has joined #ruby-lang
mrb_bk [mrb_bk!u2099@gateway/web/irccloud.com/x-fetyqtvotkkkrmmv] has quit [#ruby-lang]
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
stderr [stderr!~stderr@truedat.org] has joined #ruby-lang
zgr [zgr!~zgrge@79.165.25.46] has joined #ruby-lang
plusk [plusk!~plusk@201-34-216-120.gnace703.dsl.brasiltelecom.net.br] has joined #ruby-lang
Skif [Skif!~Skif@72.1.92.57] has joined #ruby-lang
zgr [zgr!~zgrge@79.165.25.46] has quit [#ruby-lang]
ruskie [ruskie!ruskie@sourcemage/mage/ruskie] has joined #ruby-lang
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
sideshownz [sideshownz!~sideshown@121.98.77.84] has joined #ruby-lang
NARKOZ [NARKOZ!~NARKOZ@93.184.225.56] has joined #ruby-lang
jesly [jesly!~jesly@49.137.147.232] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
naz [naz!~n@70.44.235.1.res-cmts.bus.ptd.net] has joined #ruby-lang
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
curtism [curtism!~curtis@bas11-montreal02-1128531121.dsl.bell.ca] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0D749.dip0.t-ipconnect.de] has joined #ruby-lang
Aeneas [Aeneas!~tomo@iskon7105.duo.carnet.hr] has joined #ruby-lang
Aeneas [Aeneas!~tomo@iskon7105.duo.carnet.hr] has quit [#ruby-lang]
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
jstemmer [jstemmer!~cheetah@mrpwn.stemmertech.com] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
at5l [at5l!~at5l@unaffiliated/at5l] has joined #ruby-lang
Aeneas [Aeneas!~tomo@iskon7105.duo.carnet.hr] has joined #ruby-lang
Aeneas [Aeneas!~tomo@iskon7105.duo.carnet.hr] has quit [#ruby-lang]
Aeneas [Aeneas!~tomo@iskon7105.duo.carnet.hr] has joined #ruby-lang
tychobrailleur [tychobrailleur!~sebastien@176.61.72.130] has joined #ruby-lang
tychobrailleur [tychobrailleur!~sebastien@176.61.72.130] has quit [#ruby-lang]
oilpastels [oilpastels!~rafael@177.40.238.9] has joined #ruby-lang
<oilpastels> hello guys. what do i need to do something like this http://ruletheweb.co.uk/b3ta/bus/ with ruby?
<oilpastels> to clarify, i want to be able to write to an image dinamically
<robbrit> oilpastels: imagemagick
<robbrit> er, more specifically rmagick
<oilpastels> robbrit: thx, taking a look
<robbrit> although it's possible to do this kind of thing with javascript
<robbrit> no need for server side
<andkerosine> Also, chunky_png.
<andkerosine> Simple, but often effective.
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-218-237.ssp.dialog.net.pl] has joined #ruby-lang
<andkerosine> robbrit: I imagine it'd be nice to be able to send the generated image around the web, no?
<robbrit> andkerosine: yeah true
Natch| [Natch|!~natch@178.73.217.91] has joined #ruby-lang
lordofthedance [lordofthedance!~daddycool@wnpgmb0909w-ad01-154-68.dynamic.mtsallstream.net] has joined #ruby-lang
<Phrogz> But you can generate it on the client in a Canvas, and then post the base64-encoded data back to the server to write as a file.
twittard_ [twittard_!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
<andkerosine> Strikes me as roundabout.
robbrit [robbrit!~rob@38.108.76.250] has quit [#ruby-lang]
slimfit [slimfit!~slimfit@50-76-131-66-static.hfc.comcastbusiness.net] has joined #ruby-lang
<Phrogz> To generate client-side the code that will be displayed on the client (with a side option for sending it to the server if desired)?
<andkerosine> Nobody would use this tool without the desire to share it around.
<andkerosine> Generating a transferable image URL /has/ to be the end result.
<andkerosine> Write to canvas -> read from canvas -> send base-64 data to server -> generate image -> save -> return URL.
<andkerosine> Or...
<andkerosine> Submit form fields -> generate image -> return URL.
<Phrogz> I see your point of view. I did not consider generation as required.
Pupeno [Pupeno!~pupeno@pdpc/supporter/active/pupeno] has joined #ruby-lang
<andkerosine> Ah, whoops. I suppose it wouldn't be... : X
srbartlett [srbartlett!~srbartlet@202.146.7.239] has joined #ruby-lang
<andkerosine> Heh, I must concede your way is better.
<andkerosine> With the canvas-based approach, the user could be given the option of resizing, moving, and so forth.
<andkerosine> Then just send the base-64 data, write it to a file, and return the URL.
MistyM [MistyM!MistyM@conference/code4lib/x-cxuueorcrgvvtkwa] has joined #ruby-lang
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby-lang
m3nd3s [m3nd3s!~m3nd3s@201.79.222.181] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
lordofthedance [lordofthedance!~daddycool@wnpgmb0909w-ad01-154-68.dynamic.mtsallstream.net] has joined #ruby-lang
Pupeno [Pupeno!~pupeno@pdpc/supporter/active/pupeno] has joined #ruby-lang
MistyM_ [MistyM_!MistyM@conference/code4lib/x-imsjjsxunqtnndrd] has joined #ruby-lang
freedrull [freedrull!~freedrull@freedrull.xen.prgmr.com] has joined #ruby-lang
gregf [gregf!~gregf@207.5.168.94] has joined #ruby-lang
chimkan_ [chimkan_!~chimkan@76-10-173-74.dsl.teksavvy.com] has joined #ruby-lang
virunga [virunga!~virunga@151.64.13.74] has joined #ruby-lang
chimkan_ [chimkan_!~chimkan@76-10-173-74.dsl.teksavvy.com] has joined #ruby-lang
djcercone [djcercone!~djcercone@cpe-184-57-48-50.columbus.res.rr.com] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@202.146.7.239] has joined #ruby-lang
Defusal [Defusal!Defusal@dsl-241-15-174.telkomadsl.co.za] has joined #ruby-lang
Defusal [Defusal!Defusal@unaffiliated/ecnerifed] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
Minimalist [Minimalist!~minimalis@41.140.65.166] has joined #ruby-lang
virunga [virunga!~virunga@151.64.54.144] has joined #ruby-lang
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
kain_ [kain_!~kain@151.64.232.240] has joined #ruby-lang
slimfit [slimfit!~slimfit@50-76-131-66-static.hfc.comcastbusiness.net] has joined #ruby-lang
Austin__ [Austin__!~austin@96.45.197.22] has joined #ruby-lang
h4y4shi [h4y4shi!~chatzilla@rrcs-67-79-54-130.sw.biz.rr.com] has joined #ruby-lang
<h4y4shi> Im looking to buy a Ruby programming book. Any recomendations?
<h4y4shi> My library has no books about ruby for some reason...
tbuehlmann [tbuehlmann!~tobias@unaffiliated/tovias] has joined #ruby-lang
<rue> Eloquent Ruby, maybe
<rue> corundum: books?
<corundum> books is "The Ruby Programming Language", "Eloquent Ruby", "Programming Ruby 1.9” (‘Pickaxe’) or see http://ruby-doc.org/bookstore/
<brownies> there's a free one online
<brownies> Programming Ruby, maybe?
<petercooper> steal mine if it helps: http://no.gd/begruby2.pdf
<h4y4shi> Thanks guys
<h4y4shi> The free one looks great
<brownies> btw, how is Metaprogramming Ruby? good book?
<petercooper> Yeah
<brownies> oh, heh, thanks petercooper.
<petercooper> Good book, just be careful of using "too much clever" in your own code :)
<petercooper> Temptation with a book like that is to Must Use All The Things!
<petercooper> Since it is jam packed with clever things.
<brownies> heh
<brownies> we're headed into fancy data processing stuff, so it seems like we should use a *few* clever things
<brownies> the other thought i had was to drop into a totally different language
<petercooper> And while I'm droning on, Eloquent Ruby is the best Ruby book ever IMHO
<h4y4shi> How do I know when I have mastered a programming Language?
<petercooper> Not even sure many actual masters would own up to that one.
<petercooper> In a curious twist, the more you learn, the more you realize you don't know.
<rue> The pithy answer would be “when you no longer think you have mastered it”
<petercooper> Haha
<h4y4shi> So if someone can read and understand source code pretty easily would he have mastered the language?
<petercooper> And even people I would consider masters.. they still get lots of dissent and BS from other people questioning their decisions :-)
<h4y4shi> Or what would that be called because that is my goal.
<brownies> "when you realize how incredibly small you are compared to the depth of the universe"
<rue> But that's a bit trite, and inaccurate. Mastery doesn't imply omniscience
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
<brownies> ah, there's also a ceremony, and you get a sweet belt.
<rue> h4y4shi: That'd make you functional in the language
<rue> brownies: A very, very small belt.
<h4y4shi> Oh yeah... okay so how long would it take to be functional?
<rue> With 0 previous programming experience? Maybe 3 months?
twittard [twittard!~twittard@66.180.192.214] has joined #ruby-lang
<andkerosine> Have you programmed before?
<brownies> rue: 3 months? wow.
MistyM [MistyM!MistyM@conference/code4lib/x-kmfkrzvkkoiugduq] has joined #ruby-lang
<h4y4shi> Yeah 0 previous programming experience
<brownies> rue: so, i have this book, it told me i can do it in 21 days... =P
<drbrain> 3 months
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby-lang
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby-lang
<h4y4shi> Well I am just a HEB employee trying to get a better job so I want to learn to program.. lol
<brownies> drbrain: oh. yes. thanks. heh.
<brownies> drbrain: also, http://abstrusegoose.com/249 =P
<drbrain> 3 months is enough time to learn the syntax and write a few significant programs and learn from your mistakes
<h4y4shi> Hey guys, I remember looking at the source code of some programs and they seperate the source code into multiple files. My program that I am writing right now has a lot of clutter that I would like to store in a different file. Is there a way to write ruby code in more than one .rb file?
<andkerosine> You have load and require.
<drbrain> use require, load is for doing fancy things you will learn in the future
ascarter_ [ascarter_!~ascarter@209.119.253.66] has joined #ruby-lang
<rue> Ruby's definitely much easier to start with than C++ was
<erikh> why<do<you<say>>> this;
<Boohbah> rue: agreed
<rue> But if it takes more (or less) than the 3 months, it's not really cause for concern…
MistyM_ [MistyM_!MistyM@conference/code4lib/x-ckevcijabnkbcyrv] has joined #ruby-lang
<rue> erikh: Heh, the syntax wasn't that bad, but you had to worry about the development environment more
<rue> irb is sliiiightly easier than recompiling an a.out :)
<erikh> heh
<rue> I vividly remember the joy when I got an array of Cats to meow, though.
<erikh> ARGV[0].times { system("say meow") }
<erikh> ... I think I'm still burning this coffee off
<erikh> and the meow sounds like snagglepuss
<andkerosine> cats.each { |c| c.meow }
<andkerosine> Know what'd be fun/cruel?
<drbrain> erikh: you're missing an Integer()
<andkerosine> gzip a 10GB file that's just spaces.
<erikh> drbrain: yeah
<erikh> I used .to_i but close enough
<erikh> andkerosine: actually a lot of mail exploits for virus scanners work that way
<erikh> take something that's really compressible and ship it in an email
<erikh> virus scanner goes to extract the .rar or w/e to scan it and BOOM out of disk space
<erikh> mail system therefore soils itself
<andkerosine> It's brilliant.
<lianj> system "say", "meow "*ARGV[0].to_i
workmad3 [workmad3!~workmad3@86.30.110.82] has joined #ruby-lang
<andkerosine> while 1; print "\a"; sleep rand * 3; end
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<drbrain> andkerosine: dd if=/dev/zero bs=1048576 count=10240 | gzip > nulls.gz generates a 10420385 byte file
<andkerosine> That doesn't make any sense.
<erikh> what does -9 do?
<andkerosine> Oh, whoops.
<andkerosine> 10GB down to 10MB, nice.
<erikh> or is -9 the default these days?
<andkerosine> -9 is maximum compression.
<drbrain> no idea
<andkerosine> Which is generally what you're going for.
<erikh> yes, I'm aware of that bit :O
<erikh> unless you're on a significantly taxed mysql server and you need space asap
<drbrain> default compression level is -6
savage-_ [savage-_!~savage_@208.90.214.38] has joined #ruby-lang
<drbrain> you could probably get better compression by munging the deflate stream, too
<drbrain> I'm not sure if you can embed a custom dictionary inside gzip
<Phrogz> (For a general comparison of various gzip levels on HTML files.)
<Phrogz> And based on one observation, it looked to me like the default gzip level might be 6.
<drbrain> with -9, 10420385 bytes output
<erikh> ha
<drbrain> exactly the same
<erikh> yeah
<drbrain> which is likely since it's heterogenous data
<injekt> hm
<drbrain> I think the -9 only increases the memory space in which to look for patterns
FiXato [FiXato!~FiXato@fixato.net] has joined #ruby-lang
<Phrogz> More random tests (showing that 6 is the default): http://pastie.org/3330770
bglusman [bglusman!~bglusman@c-71-224-192-35.hsd1.pa.comcast.net] has joined #ruby-lang
<drbrain> Phrogz: you could have read the man page like I did
<Phrogz> drbrain: But it's more fun to write a Ruby script with `gzip -#{n} -c foo ` :)
<Phrogz> Plus…who trusts the man pages :)
<rue> Phrogz is a Man of Science
<Y_Ichiro> does anyone know of a rspec equivalent in C++
<Y_Ichiro> or do system programmers don't do BDD at all :/
<rue> Y_Ichiro: There are a couple unit testing libraries, some even kinda speccy.
<Phrogz> Interesting; on that particular tar, -1 is 82.0% of the original, while -6 through -9 all gets to only 81.0%. Makes one wonder if the extra CPU time is really worth it.
<Phrogz> (Not that it's not already ridiculously fast on today's computers. ;)
andkerosine [andkerosine!~andkerosi@adsl-067-034-186-046.sip.mco.bellsouth.net] has joined #ruby-lang
Defusal_ [Defusal_!Defusal@dsl-241-4-123.telkomadsl.co.za] has joined #ruby-lang
Defusal_ [Defusal_!Defusal@unaffiliated/ecnerifed] has joined #ruby-lang
<andkerosine> Sounds almost silly to ask, but anybody familiar with reddit?
<injekt> sure
<injekt> probably a lot of people here
<andkerosine> Mm-hmm.
<andkerosine> Well, my current pet project is a Ruby wrapper around the API, but I'm having trouble with the semantics.
<andkerosine> The current syntax is along these lines: client.select('subreddit', 'programming', 'hot').get('comments')
<injekt> alright, if you have questions feel free to ask
<injekt> hmm
<andkerosine> Strikes me as too verbose, but I /do/ want to include that functionality.
<injekt> why not
<andkerosine> I mean, I like it because you can just as easily do: client.select('user', 'some_guy').get('comments', 'controversial')
<andkerosine> It just "feels" long-winded.
<injekt> client.r(:programming, :hot) which would return something like Subreddit of type programming
<injekt> then you have #comments
<injekt> I dont like .get('comments') comments should be a method
<Phrogz> +1 to that
<andkerosine> That's how the Python wrapper does it...
<injekt> fuck the python wrapper, you're writing a better wrapper
<andkerosine> Naturally. : )
<andkerosine> Love the name, too.
<andkerosine> How do you feel about Snooby?
Heimidal [Heimidal!~heimidal@factory-smtp.factorylabs.com] has joined #ruby-lang
<andkerosine> The... alien's name?
<andkerosine> Plus... Ruby? No?
<injekt> The Aliens name?
<andkerosine> Is Snoo.
<injekt> Oh okay
<injekt> I didn't know that
<injekt> seems to fit well, then
<andkerosine> Thanks, I thought so.
<andkerosine> Still undecided, but it just "fits".
<injekt> I like that you registered the gem already
<andkerosine> Figured it'd be best before discussing it... just in case. : )
<injekt> :)
<andkerosine> Don't install that. I accidentally didn't even check the only class in.
<injekt> heh
<injekt> Snooby::Subreddit; Snooby::Comment; Snooby::User etc
<injekt> it works
<andkerosine> But then there's the issue of authentication.
<injekt> I've never checked out their API
<injekt> what's the issue?
<andkerosine> You have to be authorized to do most things, so I figured just authenticate once with Snooby::Client, and then pass all the methods there.
<andkerosine> Otherwise, it would be: Snooby::Comment(parent, text, @auth)
savage- [savage-!~savage_@istep.static.monkeybrains.net] has joined #ruby-lang
<andkerosine> I'd prefer Snooby::Client.comment(parent, text)
<injekt> well yeah, you want a single class to handle connection info
<andkerosine> How's it look?
<andkerosine> Snooby.p is debug, which can of course be disabled.
<injekt> it looks like Reddit.post doesn't have any fallbacks
<injekt> but again I haven't used their API
<injekt> oh you're just storing cookies for auth?
<andkerosine> It's all that's necessary.
<andkerosine> /api/login/user returns a JSON object containing a cookie and a modhash.
<injekt> what's the Reddit constant from?
<andkerosine> That's a NET:HTTP#new object.
<andkerosine> Not #start, because I'm going for persistence.
<andkerosine> It sucks, I really wanted to use Net::HTTP::Persistent, because it makes so much sense to...
<injekt> I would probably use mechanize tbh
<injekt> or that
<andkerosine> But their header functionality uses add_field, which is normally just fine, except that the "Ruby" User-Agent is banned on reddit.
<andkerosine> Likely because a lot of new programmers use it and write malfunctioning bots.
<injekt> Yeah, iirc open-uri uses something different as does mechanize
<Phrogz> andkerosine: Wow, how interesting.
<andkerosine> ...?
<Phrogz> The banning of Ruby UA
<andkerosine> Ah.
<drbrain> andkerosine: I can fix it in net-http-persistent
<andkerosine> drbrain: That would be much appreciated.
<drbrain> andkerosine: file me a ticket with a script to reproduce and I'll have a release out by week's end
<drbrain> andkerosine: or you can use mechanize
<andkerosine> Any drawbacks to mechanize?
<injekt> no
<injekt> mechanize is awesome
<andkerosine> Well, yes, but it seems like overkill for this project.
<injekt> and drbrain now maintains that so you can shout at him when things go wrong
<drbrain> andkerosine: mechanize uses net-http-persistent under the covers
<andkerosine> I don't need to parse forms and anything.
<injekt> maybe it'll be overkill then, I don't know
<drbrain> I would use mechanize if you need to do HTML stuff or need to download large responses
<andkerosine> Mm-hmm.
<andkerosine> Not the case.
<drbrain> … or need to deal with broken servers
<andkerosine> I'm certainly familiar with the library, it just doesn't strike me as fitting.
<andkerosine> I could just as well use cURL, but Persistent > Net::HTTP > cURL, when it comes to speed.
postmodern [postmodern!~postmoder@c-76-105-237-23.hsd1.or.comcast.net] has joined #ruby-lang
<injekt> also when it comes to API too
WillMarshall [WillMarshall!~willmarsh@203.48.101.90] has joined #ruby-lang
<injekt> cURL API makes me vomit
<andkerosine> It's pretty nasty.
<drbrain> andkerosine: modern cURL should be using persistent connections again
<drbrain> when I extracted net-http-persistent from mechanize I found curl was broken and that lots of requests could exhaust your fd table
<drbrain> well, sockets
<drbrain> but that was two years ago, I think
<drbrain> … the ruby wrapper of curl, the command-line tool uses persistent connections IIRC
<injekt> drbrain: the 'SYNOPSIS' example in the README, the last line is wrong?
<injekt> drbrain: for net-http-persistent
twittard [twittard!~twittard@vpn.lax.truecarcorp.com] has joined #ruby-lang
<drbrain> it's missing an =
<injekt> ya
<andkerosine> Imagine doing away with the assignment operator.
<injekt> :|
<andkerosine> Could a dynamic language do that?
<drbrain> injekt: ok, fixed!
<injekt> it would need *something* I'd imagine, otherwise it could just be referring to a variable (if the language request parens for methods calls)
<injekt> drbrain: great, I was going to make an embarrassing pull req
<drbrain> injekt: I gave you credit
<drbrain> oddly, my commit isn't showing up
<injekt> drbrain: <3
<andkerosine> Yes, I think I very much prefer Persistent. : )
<andkerosine> If cURL /is/ keeping the connection open, it sucks at it.
<drbrain> andkerosine: I thought you were using the ruby wrapper of libcurl, not shelling out
<andkerosine> Ah, no. Either way, it's not preferable.
<injekt> me too
<andkerosine> Or... do you happen to know that libcurl is faster than Persistent? : P
<injekt> anyway the libcurl still sucks
<injekt> api^
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
MistyM [MistyM!MistyM@conference/code4lib/x-oyouvuciiwdkdinl] has joined #ruby-lang
<injekt> then again I'm not a fan of net/http API either, so maybe I'm just fussy
<drbrain> andkerosine: the API should be slightly faster since it doesn't have ruby method dispatch overhead
Defusal [Defusal!Defusal@dsl-240-234-207.telkomadsl.co.za] has joined #ruby-lang
Defusal [Defusal!Defusal@unaffiliated/ecnerifed] has joined #ruby-lang
<andkerosine> Hm.
<andkerosine> Speed is ideal, I think.
<andkerosine> A pleasant Ruby interface will be given to the user, regardless.
<drbrain> andkerosine: I doubt you're going to see much difference if the HTTP layer is 2.5X faster (about what it was when I last measured)
<injekt> I would use net/http if I were you
<injekt> well, I might use excon, but net/http isn't bad and it's nice that it's in stdlib
<andkerosine> "build status: failing, dependency status: out-of-date"
<drbrain> andkerosine: since you're going across the Real Internet the speed increase won't make much of a difference
<injekt> ^
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
<andkerosine> What does that mean, exactly?
<injekt> API speeds are kinda useless in comparison when you have to travel through a http request anyway
<drbrain> andkerosine: round-trip time of your packets will dominate your losses at the HTTP API level (libcurl vs net/http)
<drbrain> and bandwidth
<injekt> why is net-http-persistent so much faster in that example?
<andkerosine> Less negotiation?
<drbrain> andkerosine: TCP/IP
<drbrain> injekt: in andkerosine's example? TCP connection round-trips and TCP slow-start
<andkerosine> I suppose the fact that you're advised to only make one request per two seconds just about nullifies all of this.
<andkerosine> Yes, I have a fairly shit connection.
<injekt> I'm on 56k here :)
<drbrain> re-running this benchmark on ruby 2.0.0pre with net-http-persistent 2.4.1 shows curb at 1.8x faster
<injekt> wow
<drbrain> andkerosine: if you don't have to reconnect that's ~137ms per request you're saving with net-http-persistent
<drbrain> and that's across a loopback connection
<drbrain> so it's hard to beat C network code over loopback
<andkerosine> Persistent it is, then?
<drbrain> with for 100,000 2k response-size requests, net-http-persistent was 65.1s real, curb was 36.4s real
<andkerosine> "Curl::PostField.content" is a touch unpleasant.
<drbrain> excon doesn't use persistent connections? ☹
takaokouji [takaokouji!~takaokouj@2001:268:306:1:225:bcff:fedc:e1fe] has joined #ruby-lang
Defusal [Defusal!Defusal@dsl-241-4-123.telkomadsl.co.za] has joined #ruby-lang
Defusal [Defusal!Defusal@unaffiliated/ecnerifed] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby-lang
<injekt> drbrain: I doubt it
<injekt> oh yes it does
ascarter_ [ascarter_!~ascarter@209.119.253.66] has joined #ruby-lang