Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
lkba [lkba!~AndChat@afsr254.neoplus.adsl.tpnet.pl] has joined #ruby
ccooke [ccooke!~ccooke@spirit.gkhs.net] has joined #ruby
ryanf [ryanf!~revfitz@adsl-69-111-192-194.dsl.snfc21.sbcglobal.net] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@46-64-51-175.zone15.bethere.co.uk] has joined #ruby
CircleDot [CircleDot!~CircleDot@206-169-94-86.static.twtelecom.net] has joined #ruby
quest88 [quest88!~quest88@c-98-207-205-137.hsd1.ca.comcast.net] has joined #ruby
kvyn [kvyn!~kvyn@w0109-49-133-112-146.uqwimax.jp] has joined #ruby
Araxia_ [Araxia_!~Araxia@c-24-22-63-1.hsd1.or.comcast.net] has joined #ruby
davidpk [davidpk!~r00t@5e0a02e9.bb.sky.com] has joined #ruby
shevy [shevy!~shevy@178-190-69-12.adsl.highway.telekom.at] has joined #ruby
cooper [cooper!~mitchell@unaffiliated/furryfishy] has joined #ruby
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
Tinuk [Tinuk!~fox@178-26-92-180-dynip.superkabel.de] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
bier [bier!~bier@p579990C6.dip.t-dialin.net] has joined #ruby
Gekz [Gekz!~gekz@159.253.5.25] has joined #ruby
Gekz [Gekz!~gekz@unaffiliated/gekz] has joined #ruby
Code_Ble1 [Code_Ble1!~Code_Bleu@64-191-149-154.service.qx.net] has joined #ruby
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby
cyri__ [cyri__!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby
Code_Ble1 [Code_Ble1!~Code_Bleu@64-191-149-154.service.qx.net] has quit [#ruby]
senthil_ [senthil_!~senthil@99-51-1-6.lightspeed.snjsca.sbcglobal.net] has joined #ruby
tbrock [tbrock!~tbrock@cpe-66-65-101-248.nyc.res.rr.com] has joined #ruby
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby
d-snp [d-snp!~d-snp@smurfer.student.utwente.nl] has joined #ruby
<newbold> canton7: someone told me I should be using ERB instead of a template and a bunch of gsubs, so I looked into it and it looks awesome
<canton7> newbold, it's a valid point :P
<waxjar> look into haml as well :3
<newbold> ah
* newbold looks
<canton7> and sass/scss
<newbold> oh man
<newbold> too many options
<musl> ahh, the rails defaults. :)
<canton7> (sass and scss are css alternatives)
<newbold> why are my =begin comments ignored within a function? is that just a syntax highlighting glitch in my editor, or is that really not allowed?
<newbold> by ignored I mean not registered as comments :)
<WanderingGlitch> what editor are you using ?
<newbold> Coda
<wallerdev> it is your editor
<WanderingGlitch> yeah
<newbold> ok, good to know
<wallerdev> unless ruby is giving you a syntax error or something
<newbold> is =begin the only way to comment large chunks of code?
<ryanf> newbold: don't they have to be at the beginning of the line?
<ryanf> are you doing that?
stephenjudkins [stephenjudkins!~stephen@c-76-115-1-70.hsd1.or.comcast.net] has joined #ruby
<newbold> ryanf: ah, that's my problem. I'm starting it after a tab
<wallerdev> i think most people use #, usually most editors let you select a chunk of code and click comment or press a shortcut and it puts # before all lines
<ryanf> and yes, but I think people usually just insert # in front of every line
<ryanf> yeah
<ryanf> if you need to just make some code not happen temporarily, you could wrap it in a heredoc
<newbold> I'm ok with =begin now that I know the rules :)
S2kx [S2kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
<newbold> haml looks nice, but there's an example in the ERB docs that is pretty much exactly what I'm trying to do
<newbold> so I'm going to give ERB a whirl
<canton7> most decent editors have a way of easily commenting out multiple lines with #'s
<newbold> canton7: ah, you know, I just found it in Coda
<newbold> it's Cmd-/
<canton7> cool!
<newbold> and it seems to do a context-aware block comment
<newbold> in an html file it does <!-- --> and in a ruby doc it did # before each line
<newbold> sweet, I had no idea that was there :)
<canton7> I love it when editors are clever
<canton7> well, as long as they're not too clever
<newbold> heh
<newbold> canton7: I know what you mean. I get this all the time now: http://cl.ly/0E2d1C2M2P1I0j2Y3t38
<shevy> wow
<newbold> it interferes with sinatra stuff; I type "do" and press enter and I get domain
<shevy> that editor is that?
<newbold> shevy: Coda
<newbold> I can probably turn those training wheels off, or maybe even modify the list, but I'm too busy learning Ruby to mess with the settings :P
<shevy> hehe
<shevy> ruby code should always be so simple that notepad can be used
<shevy> though I couldn't deal with any editor without syntax highlighting
<waxjar> i can't even keep track of irc conversation without nickname colors
<waxjar> *conversations
mkscrg [mkscrg!~mkscrg@pool-108-41-134-165.nycmny.fios.verizon.net] has joined #ruby
rickmasta [rickmasta!~rickmasta@pool-71-183-247-164.nycmny.fios.verizon.net] has joined #ruby
twock [twock!~twock@rrcs-24-227-222-61.sw.biz.rr.com] has joined #ruby
hadees_ [hadees_!~hadees@72-48-91-73.dyn.grandenetworks.net] has joined #ruby
fritzthecat_ [fritzthecat_!~fritzthec@HSI-KBW-109-193-249-164.hsi7.kabel-badenwuerttemberg.de] has joined #ruby
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby
tbrock [tbrock!~tbrock@cpe-66-65-101-248.nyc.res.rr.com] has joined #ruby
taipres [taipres!~taipres@2001:5c0:1400:a::387] has joined #ruby
<taipres> did anyone ever win that 10k contest?
<taipres> last I read only a few even bothered to enter for some reason
<wallerdev> what contest?
<taipres> was on ruby's site
<taipres> some coding contest
nowthatsamatt [nowthatsamatt!~nowthatsa@rrcs-71-43-23-18.se.biz.rr.com] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@rrcs-71-43-23-18.se.biz.rr.com] has quit [#ruby]
<wallerdev> interesting
<wallerdev> i never heard about it
<wallerdev> but i haven't been keeping up on ruby the past few months until january
<taipres> oh :)
<shevy> no idea what happened to that taipres
<wallerdev> maybe people were intimidated by presenting ruby code to matz
<wallerdev> i would be haha
<shevy> "Fukuoka Competition - Grand Prize - 1 Million Yen! (March 2012 in Fukuoka, Japan), Entry Deadline: November 15, 2011"
<shevy> guess we'll know in 2 months
<shevy> wallerdev well your english should be better than his ;P
<wallerdev> yeah but not my ruby haha
<taipres> should show up wearing a php tv shirt
<taipres> :p
<shevy> I would be too ashamed to do that
<shevy> the shirt thing, not the presenting thing
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has joined #ruby
<shevy> but my ruby code tends to be very boring
<wallerdev> I've been very impressed with ruby the paste few days
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby
<wallerdev> i wrote a scraping script with mechanize and it's been running for 4 days now nonstop
<shevy> only the past few days?
<wallerdev> haha usually ruby just feels so easy that i forget to be impressed :P
<shevy> hmm
<shevy> I want to impress myself by using ruby for a larger project
<shevy> like, you know, one that I can work on for years
p0y [p0y!~p0y@121.97.55.207] has joined #ruby
<wallerdev> cool
<wallerdev> shevy: have you heard of ruby on rails?
<wallerdev> :D
ghosTM55 [ghosTM55!~user@li279-245.members.linode.com] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
<shevy> wallerdev well
<shevy> I'd never touch that code
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
<shevy> my ruby code tends to be boring, so when I see exciting code like in ruby on rails, I know I won't touch and modify it ever
<shevy> so it's a bit like dead weight
vajrapani666 [vajrapani666!~vajrapani@c-69-181-26-39.hsd1.ca.comcast.net] has joined #ruby
bonhoffer [bonhoffer!~bonhoffer@pool-74-96-52-11.washdc.east.verizon.net] has joined #ruby
<bonhoffer> any ideas on how to go through a whole directory and remove malicous text in each file
<bonhoffer> or should i just use awk
<wallerdev> clbuttic
mickn [mickn!~mickn@unaffiliated/mickn] has joined #ruby
<shevy> bonhoffer ok you want to remove text from each file
<shevy> break it into components
<bonhoffer> shevy, break what into components
<shevy> (1) get all files first (2) iterate through them and read the content into an array like with File.readlines
<shevy> your task
<bonhoffer> got it
<shevy> (3) once you have it in the array, perform the replacement
<bonhoffer> so glob, then readin, replace and save the file
<shevy> (4) save it into a new file (perhaps with the option to allow a backup, so you can keep the original source somewhere)
<shevy> yeah I think that would be one way to solve this
<bonhoffer> agreed -- this hack really sucks -- i know how to do it in ruby, just wondering if it is the wrong tool for the job
<shevy> I am trying to convert this: "tr -cs A-Za-z '\n'" into ruby code right now ;P
<bonhoffer> some say awk might be much better or zsh or bash . . .
<shevy> awk is probably faster
<shevy> shell scripts, I doubt they are worth it
<bonhoffer> i'll try with awk
<shevy> but you can use both awk then compare it with ruby
<shevy> yeah
<bonhoffer> any good links . . . for the awk -- i really just need to remove: eval(base64_decode.*);
<bonhoffer> from all files . . .
<bonhoffer> i figure this is pretty bread and butter for a good sysadmin
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby
<bonhoffer> maybe grep -v ?
<shevy> no idea about awk
<shevy> I myself would use ruby, not awk. :>
dtrejo [dtrejo!~dtrejo@c-67-180-29-185.hsd1.ca.comcast.net] has joined #ruby
<bonhoffer> yeah -- i'm used to ruby, but not file IO recently
dtrejo [dtrejo!~dtrejo@c-67-180-29-185.hsd1.ca.comcast.net] has quit [#ruby]
<Muz> bonhoffer: use sed.
<bonhoffer> find . -name '*.php' -exec sh -c 'grep -v base64_decode "$1" > "$1.fixed" && mv "$1.fixed" "$1"' _ {} \;
<bonhoffer> but not sure . . . i'll look into sed
pen [pen!~pen@223-143-216-125.dynamic.hinet.net] has joined #ruby
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
<Muz> sed -i".bak" '/eval\(base64_decode.*\);/d' * # Depending on your shell that may need some extra backslash escaping for the brackets.
<bonhoffer> wow -- that is short -- i'm on bash
techhelp [techhelp!~Dan@ip70-162-129-93.ph.ph.cox.net] has joined #ruby
<bonhoffer> i can google but this is going to create a bunch of .bak files, right?
<bonhoffer> and recurse the whole directory?
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
QaDeS_ [QaDeS_!~mklaus@frbg-5d84e2ac.pool.mediaWays.net] has joined #ruby
<shevy> make a test directory
<shevy> and copy the files there
<shevy> then test :) but most likely yes, .bak is usually used to denote a backup
<shevy> ewww an eval
<bonhoffer> i'm playing in a test dir now
<shevy> hmm
<shevy> I want to mape ...
<shevy> tr "\n" " " to remove_newlines
<shevy> *map
<shevy> but there are so many options to tr
<bonhoffer> now, i'll admit i'm going cargo cult with sed
<shevy> what does that mean bonhoffer
<canton7> say I've got a string of the form 'my #{var}' (from a config file)... How would I replace #{var} with the value of that variable in the current scope, without gsub?
<bonhoffer> it means i'm coding without understanding what i'm doing
<shevy> not sure what you mean canton7 ... "my #{var}" does not replace it?
<bonhoffer> and getting sed: no input files
<shevy> "inclusion of code or program structures that serve no real purpose."
<shevy> but sed serves a purpose!
<canton7> shevy, the string comes from a config file, so var is never evaluated
<shevy> hmm I see
<shevy> you could use eval() but that is ugly
<ryanf> why no gsub?
<bonhoffer> yeah -- my definition is writing code i don't understand and expect good things to happen
<shevy> haha
<bonhoffer> so, any idea why i'm getting "no input files"
<shevy> load-and-pray coding :D
<shevy> dunno. if you just would have used ruby instead man!!!
<canton7> shevy, that doesn't really work, as the string "my #{var}" isn't a valid ruby expression
<shevy> looks a bit like perl
<bonhoffer> shevy, totally -- i should stick with stuff i understand
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby
<ryanf> canton7: the string '"my #{var}"' is though
<canton7> that's true
TheNatd [TheNatd!~natd@CBL217-132-139-195.bb.netvision.net.il] has joined #ruby
<canton7> ugly as heck though -- it's YAML, and I'd need to quote the string twice, as yaml strips the first set of quotes
<ryanf> haha
TheNatd [TheNatd!~natd@CBL217-132-139-195.bb.netvision.net.il] has quit [#ruby]
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
<ryanf> I guess you could gsub #{[^{}]} for <%= \1 %> and then use erb
<canton7> yeah, I think gsub's the way to go
centipedefarmer [centipedefarmer!~centipede@74-84-107-90.client.mchsi.com] has joined #ruby
Guest56450 [Guest56450!~KenCoar@dsl093-240-159.ral1.dsl.speakeasy.net] has joined #ruby
RoUS [RoUS!~KenCoar@apache/committer/coar] has joined #ruby
techhelp [techhelp!~Dan@ip70-162-129-93.ph.ph.cox.net] has joined #ruby
pdtpatrick_ [pdtpatrick_!~pdtpatric@ip72-211-207-15.oc.oc.cox.net] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
notjohn [notjohn!~john@cpe-174-103-133-37.cinci.res.rr.com] has joined #ruby
fayimora [fayimora!~fayimora@95.175.159.58] has joined #ruby
strife25 [strife25!~strife25@cpe-098-026-018-050.nc.res.rr.com] has joined #ruby
zulax [zulax!~radarwork@99-120-232-161.lightspeed.iplsin.sbcglobal.net] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
strife25 [strife25!~strife25@cpe-098-026-018-050.nc.res.rr.com] has joined #ruby
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby
huhu_ [huhu_!~huhu@unaffiliated/huhu-/x-6122598] has joined #ruby
<huhu_> Does ruby provide s-expr?
<huhu_> Given that it's "lisp-like", does it have symbolic expressions?
c0rn [c0rn!~c0rn@cpe-66-91-253-48.san.res.rr.com] has joined #ruby
techhelp [techhelp!~Dan@ip70-162-129-93.ph.ph.cox.net] has joined #ruby
moshee [moshee!~moshee@c-50-135-229-127.hsd1.wa.comcast.net] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
bonhoffer_ [bonhoffer_!~bonhoffer@pool-74-96-52-11.washdc.east.verizon.net] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
senthil [senthil!~senthil@99-51-1-6.lightspeed.snjsca.sbcglobal.net] has joined #ruby
senthil [senthil!~senthil@99-51-1-6.lightspeed.snjsca.sbcglobal.net] has quit [#ruby]
senthil [senthil!~senthil@99-51-1-6.lightspeed.snjsca.sbcglobal.net] has joined #ruby
senthil [senthil!~senthil@99-51-1-6.lightspeed.snjsca.sbcglobal.net] has quit [#ruby]
senthil [senthil!~senthil@99-51-1-6.lightspeed.snjsca.sbcglobal.net] has joined #ruby
zulax [zulax!~radarwork@99-120-232-161.lightspeed.iplsin.sbcglobal.net] has joined #ruby
pac1 [pac1!~pac1@pool-96-233-75-235.bstnma.fios.verizon.net] has joined #ruby
cook1es [cook1es!~chatzilla@c83-248-93-185.bredband.comhem.se] has joined #ruby
havenn [havenn!~skipper@pool-71-189-127-105.lsanca.fios.verizon.net] has joined #ruby
azureye [azureye!~azureye@wrls-249-27-252.wrls-client.fas.harvard.edu] has joined #ruby
Kelvin [Kelvin!~Kelvin@pool-108-35-91-79.nwrknj.fios.verizon.net] has quit [#ruby]
phantomfake [phantomfake!~whats_in_@pool-71-190-229-236.nycmny.fios.verizon.net] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.166.64] has joined #ruby
ryanf_ [ryanf_!~ryanf@56.sub-174-253-233.myvzw.com] has joined #ruby
ryanf_ [ryanf_!~ryanf@56.sub-174-253-233.myvzw.com] has quit [#ruby]
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
Hanmac1 [Hanmac1!~hanmac@p50844BA8.dip0.t-ipconnect.de] has joined #ruby
Kelvin [Kelvin!~Kelvin@pool-108-35-91-79.nwrknj.fios.verizon.net] has joined #ruby
d2dchat [d2dchat!~d2dchat@c-98-209-18-197.hsd1.mi.comcast.net] has joined #ruby
<Kelvin> Hi, I'm really new to ruby, and i'm having trouble with associations. anyone who could help me out a bit with that?
<Kelvin> I have cookies and coupons for best friends
adamjleonard [adamjleonard!~adamjleon@pool-108-9-169-222.tampfl.fios.verizon.net] has joined #ruby
hadees [hadees!~hadees@72-48-91-73.dyn.grandenetworks.net] has joined #ruby
dotnull [dotnull!~dot_null@173-31-158-182.client.mchsi.com] has joined #ruby
<Kelvin> ok :(
kerframil [kerframil!~kerframil@cpc2-enfi16-2-0-cust659.hari.cable.virginmedia.com] has joined #ruby
<otherj> i'll take it!
<Kelvin> gotta earn the cookies!
<Kelvin> coupons are free, but work first :D
<otherj> ;o(
<Kelvin> c'mon.. how about i show you my users.rb and my microposts.rb and you can try to guess at why it doesn't work how it should
Jared__ [Jared__!~Jared@75-129-110-5.dhcp.aldl.mi.charter.com] has joined #ruby
zulax [zulax!~radarwork@99-120-232-161.lightspeed.iplsin.sbcglobal.net] has joined #ruby
bier [bier!~bier@p579990C6.dip.t-dialin.net] has joined #ruby
Evixion [Evixion!Evixion@tn-67-236-5-224.dhcp.embarqhsd.net] has joined #ruby
Ttech [Ttech!ttech@botters/staff/ttech] has quit [#ruby]
CodeZombie [CodeZombie!~CodeZombi@65.19.245.153] has joined #ruby
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has joined #ruby
p0y [p0y!~p0y@121.97.55.207] has joined #ruby
<shevy> that's the problem with rails
<Kelvin> anyone still awake who might help me out with a beginner question?
<shevy> people use it without understanding it
<shevy> the only hope for them is #rubyonrails
<Guest22269> Kelvin, typo?
<Guest22269> on line 10
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
<Kelvin> lol… that'd probably do it, being an idiot can do that I guess
<moshee> happens to everyone :P
<Kelvin> i've been trying all sorts of things, thanks for the second set of eyes
Kelvin [Kelvin!~Kelvin@pool-108-35-91-79.nwrknj.fios.verizon.net] has quit [#ruby]
Kelvin [Kelvin!~Kelvin@pool-108-35-91-79.nwrknj.fios.verizon.net] has joined #ruby
dnyy [dnyy!~dnyy@c-98-237-138-38.hsd1.wa.comcast.net] has joined #ruby
Kelvin [Kelvin!~Kelvin@pool-108-35-91-79.nwrknj.fios.verizon.net] has quit [#ruby]
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
banister`sleep [banister`sleep!~baniseter@118.82.185.158] has joined #ruby
bnewton [bnewton!~bnewton@cpe-66-68-94-56.austin.res.rr.com] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has quit ["Leaving"]
zenergi_ [zenergi_!~zenergi@pdpc/supporter/student/zenergi] has joined #ruby
SegFaultAX [SegFaultAX!~SegFaultA@c-98-248-241-85.hsd1.ca.comcast.net] has joined #ruby
zenergi_ [zenergi_!~zenergi@pdpc/supporter/student/zenergi] has joined #ruby
d2dchat [d2dchat!~d2dchat@c-98-209-18-197.hsd1.mi.comcast.net] has joined #ruby
taipres [taipres!~taipres@2001:5c0:1400:a::29f] has joined #ruby
inteq [inteq!~justin.si@adsl-98-88-29-211.asm.bellsouth.net] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
Zorg [Zorg!~Adium@MSP5135.rh.psu.edu] has quit [#ruby]
p1d [p1d!~p1d@dslb-088-067-018-101.pools.arcor-ip.net] has joined #ruby
sdwrage [sdwrage!~sdwrage@cpe-184-57-83-165.columbus.res.rr.com] has joined #ruby
jbhewitt [jbhewitt!~jbhewitt@131.245.146.140] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
randym [randym!~randym@EM114-48-75-140.pool.e-mobile.ne.jp] has joined #ruby
p0y [p0y!~p0y@121.97.55.207] has joined #ruby
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby
acadavid [acadavid!~acadavid@190.71.122.249] has joined #ruby
ershad [ershad!~ershad@117.204.100.171] has joined #ruby
<ershad> Hi, I'm new to ruby. Could you please tell me the difference between "word".size and 'word".length? Both returns 4
<shevy> ershad one is an alias to the other
<shevy> so obviously they return the same ;)
<ershad> shevy, I see. Why is it like that? we do we need such an alias?
<ershad> *why do we need..
Seisatsu [Seisatsu!~seisatsu@adsl-99-35-225-92.dsl.pltn13.sbcglobal.net] has joined #ruby
<shevy> ershad aliases are never needed
<shevy> they simplify life however
<shevy> you can extend any ruby class at runtime with aliases
<shevy> also, there is the trick to alias to an old method, remove or change it, yet still be able to call the old reference. via aliases
<shevy> ershad, simply pick one over the other and stick to it
<shevy> I picked .size as it is shorter
<ershad> Great, I will do the same. Thank you, shevy. Nice day to you :)
symb0l [symb0l!~symb0l@c-50-131-187-183.hsd1.ca.comcast.net] has joined #ruby
<shevy> likewise
pdtpatrick_ [pdtpatrick_!~pdtpatric@ip72-211-207-15.oc.oc.cox.net] has joined #ruby
pdtpatrick_ [pdtpatrick_!~pdtpatric@ip72-211-207-15.oc.oc.cox.net] has quit [#ruby]
wmoxam [wmoxam!~wmoxam@184.175.15.252] has joined #ruby
IrishGringo [IrishGringo!~chatzilla@c-71-229-99-200.hsd1.fl.comcast.net] has joined #ruby
taipres [taipres!~taipres@2001:5c0:1400:a::29f] has joined #ruby
wedtm [wedtm!~wedtm@173-12-163-78-oregon.hfc.comcastbusiness.net] has joined #ruby
fayimora [fayimora!~fayimora@95.175.159.58] has joined #ruby
acadavid [acadavid!~acadavid@190.71.122.249] has joined #ruby
macmartine [macmartine!~macmartin@c-24-21-112-60.hsd1.or.comcast.net] has joined #ruby
examancer [examancer!~carl@carlzulauf.xen.prgmr.com] has joined #ruby
fourcolors [fourcolors!~fourcolor@c-67-177-35-41.hsd1.ut.comcast.net] has joined #ruby
<fourcolors> Hi im trying to find the "name" of a file given their mime type and I have this 2-D array to work with http://pastie.org/3228769
<fourcolors> basically I can't figure out how to iterate through and find a matching name if that makes sense
<fourcolors> oh dang.. just thought of something. Hate it when that happens
brmouzone [brmouzone!~brmouzone@108-90-18-133.lightspeed.cicril.sbcglobal.net] has joined #ruby
<fourcolors> ok nm still stuck
<fourcolors> so I have an array of arrays and I need to match a word in the arrays
<fourcolors> if that makes sense
<examancer> it makes sense. can you pastebin or gist what the array structure looks like and what you want to tease out or compare inside of it?
<examancer> fourcolors: I would do LANGUAGES.index_by{|e| e[0]}.key?("some string you are looking for")
<examancer> (missed your pastebin from earlier)
a_a_g [a_a_g!~aag@121.246.33.172] has joined #ruby
<examancer> fourcolors: Hash[LANGUAGES].key? "Rust" is even faster
<examancer> err... shorter
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby
<fourcolors> Oh thats interesting
<fourcolors> makes in a hash first
<examancer> if you return an array that contains arrays of exactly 2 elements then Hash[] will turn it into a Hash
<examancer> s/if you return/if you pass/
<fourcolors> so when I do something like Hash[Sample::LANGUAGES].key("Rust") it returns nil
<fourcolors> which is interesting because I have "Rust" in the hash
<fourcolors> oh sorry the LANGUAGES is coming from the Sample class
<fourcolors> oh duh, it's the the key
<fourcolors> im looking for the other one
<examancer> huh? are you trying to search by application/xml
<fourcolors> examancer: yes
<fourcolors> so im looking for the value not the key
<fourcolors> i believe
<fourcolors> or something
<fourcolors> so I can do Hash[Sample::LANGUAGES].values_at("Ruby")
<examancer> you could do it with a hash too using Hash[Sample::LANGUAGES].has_value?("text/less")
<fourcolors> ok got it working
<fourcolors> sorry I confuse myself some times which doesn't help anyone
<examancer> the hash way saves 7 characters :-)
<fourcolors> ya I really like it
<fourcolors> so i ended up doing something like this Hash[Sample::LANGUAGES].key( mime_type )
<fourcolors> which works perfect
<fourcolors> thanks
<examancer> sure
adamjleonard [adamjleonard!~adamjleon@pool-108-9-169-222.tampfl.fios.verizon.net] has joined #ruby
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
blueadept [blueadept!~blueadept@72.21.137.199] has joined #ruby
blueadept [blueadept!~blueadept@unaffiliated/blueadept] has joined #ruby
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
justfielding [justfielding!~justfield@ip70-178-131-208.ks.ks.cox.net] has joined #ruby
h4mz1d [h4mz1d!~hamfz@99-0-57-199.lightspeed.tsclal.sbcglobal.net] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-170-217.ard.bellsouth.net] has joined #ruby
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
ksinkar [ksinkar!~ksinkar@117.195.100.16] has joined #ruby
musee [musee!~musee@unaffiliated/musee] has joined #ruby
musee [musee!~musee@unaffiliated/musee] has joined #ruby
Locke23rus [Locke23rus!~quassel@128-70-95-104.broadband.corbina.ru] has joined #ruby
nate_h [nate_h!~husimon@c73-208.rim.net] has joined #ruby
thone [thone!~thone@g226049204.adsl.alicedsl.de] has joined #ruby
n8ji [n8ji!~n8ji@c-76-105-192-7.hsd1.or.comcast.net] has joined #ruby
stringoO [stringoO!~JLstring@bas1-toronto42-1279598654.dsl.bell.ca] has joined #ruby
two- [two-!~textual@c-67-171-131-23.hsd1.wa.comcast.net] has joined #ruby
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
nate_h [nate_h!~husimon@c73-208.rim.net] has joined #ruby
Seisatsu [Seisatsu!~seisatsu@adsl-99-35-225-92.dsl.pltn13.sbcglobal.net] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
dnyy [dnyy!~dnyy@c-98-237-138-38.hsd1.wa.comcast.net] has joined #ruby
wenbert [wenbert!~wenbert@222.127.160.66] has joined #ruby
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
Karmaon [Karmaon!~john@gateway/tor-sasl/karmaon] has joined #ruby
alx- [alx-!~Alex@108.162.180.72] has joined #ruby
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
enherit [enherit!~enherit@66-214-13-183.dhcp.lnbh.ca.charter.com] has joined #ruby
Karmaon [Karmaon!~john@gateway/tor-sasl/karmaon] has joined #ruby
robyurkowski [robyurkowski!~robyurkow@205.233.80.139] has joined #ruby
stayarrr [stayarrr!~olivererx@dslb-178-009-059-241.pools.arcor-ip.net] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@180.241.166.64] has joined #ruby
eldariof [eldariof!~CLD@81.200.24.188] has joined #ruby
yxhuvud [yxhuvud!mongo@h-5-47.a212.priv.bahnhof.se] has joined #ruby
vraa [vraa!~vraa@99-20-202-44.lightspeed.hstntx.sbcglobal.net] has joined #ruby
Asher [Asher!~asher@98.158.127.150] has joined #ruby
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
eighty4 [eighty4!~eighty4@unaffiliated/eighty4] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
epitron [epitron!~epitron@bito.ponzo.net] has joined #ruby
epitron [epitron!~epitron@unaffiliated/epitron] has joined #ruby
adamjleonard [adamjleonard!~adamjleon@pool-108-9-169-222.tampfl.fios.verizon.net] has joined #ruby
shevy [shevy!~shevy@178-191-185-60.adsl.highway.telekom.at] has joined #ruby
kvyn [kvyn!~kvyn@w0109-49-133-96-223.uqwimax.jp] has joined #ruby
examancer [examancer!~carl@ip68-107-232-165.om.om.cox.net] has joined #ruby
beakerman [beakerman!~beakerman@c-76-118-172-173.hsd1.nh.comcast.net] has joined #ruby
jrob [jrob!~jrob@c-98-207-229-151.hsd1.ca.comcast.net] has joined #ruby
n8ji [n8ji!~n8ji@c-76-105-192-7.hsd1.or.comcast.net] has joined #ruby
jbpros [jbpros!~jbpros@82-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
nd____ [nd____!~nd@mnhm-5f74ea44.pool.mediaWays.net] has joined #ruby
Faris [Faris!~amnay@41.140.183.63] has joined #ruby
ChampS666 [ChampS666!~ChampS@p54B4AEBD.dip.t-dialin.net] has joined #ruby
x0F__ [x0F__!~x0F@unaffiliated/x0f] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
z2fyza [z2fyza!~gard@cm-84.215.22.0.getinternet.no] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
ph^ [ph^!~ph^@cm-84.212.225.74.getinternet.no] has joined #ruby
faber [faber!~faber@ppp-104-4.26-151.libero.it] has joined #ruby
p0y [p0y!~p0y@121.97.59.160] has joined #ruby
Spockz [Spockz!~Spockz@21pc198.sshunet.nl] has joined #ruby
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
pantsman- [pantsman-!~pantsman@2.25.187.234] has joined #ruby
pantsman- [pantsman-!~pantsman@2.25.187.234] has joined #ruby
Fraeon [Fraeon!~kzer-za@virgo.dreamhost.com] has joined #ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
a_a_g [a_a_g!~aag@121.246.33.172] has joined #ruby
jbpros [jbpros!~jbpros@39-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
azbarcea__ [azbarcea__!~quassel@86.125.232.44] has joined #ruby
LMolr [LMolr!~quassel@87.19.33.245] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
marvin_ [marvin_!~shikhai@pD9F4C64C.dip0.t-ipconnect.de] has joined #ruby
<marvin_> hi
<canton7> hey
<marvin_> i got a while true loop within a thread. when I ran the app (its a sinatra app) the cpu goes up to 100%.
<marvin_> when I comment out the while loop its not happening so the issue must be there
<marvin_> is there any recommendation why this is?
shadoi [shadoi!~Adium@c-71-202-122-8.hsd1.ca.comcast.net] has joined #ruby
<canton7> infinite loop?
c0rn [c0rn!~c0rn@cpe-66-91-253-48.san.res.rr.com] has joined #ruby
<marvin_> there is an IO::SEEK_END file and a DB create query in it
<marvin_> it watches a file for new lines and drops it into a mongodb
<canton7> put a print statement, or something similar, in your loop, and see how quickly it's executing
<canton7> my bet is *very* quickly
<marvin_> well yes because it depends on how many new logfile lines come in
<marvin_> you wanna see the class?
<canton7> sure
<marvin_> ah i maybe got an idea
TomJ [TomJ!~TomJ@host-78-147-97-126.as13285.net] has joined #ruby
TomJ [TomJ!~TomJ@unaffiliated/tomj] has joined #ruby
<marvin_> you see the line != nil line? i had an issue before with this loop cause
<marvin_> when i start it drops lots of new lines to the DB but they were empty so I thought i get around it by checking if its not null and then write to the DB
<marvin_> but i didnt know where those empty lines where coming from
<marvin_> if thats from the IO::SEEK_END
<marvin_> maybe this whole class isnt optimal at all ^^
arvindravi [arvindravi!~arvind@115.242.171.223] has joined #ruby
<arvindravi> hello all,how do i add variables say from a to n,where i know the value of a,while n keeps changing everytime?
<canton7> marcin_, yeah you're telling the loop to go as quickly as it can, checking for changed lines on each iteration, and only do something with the line if it's new
<marvin_> canton7, dropping a sleep in maybe?
<marvin_> but going as fast as it can is good because otherwise new lines might be missed
<canton7> marcin_, that would work
<canton7> marvin_, new lines will be picked up on the next iteration
<canton7> you can't avoid race conditions just by going faster :)
<marvin_> sure
<canton7> if you're on windows, win32-changenotify exists... I'm trying to find something for linux
Nss [Nss!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
<marvin_> thanks canton7
<marvin_> sleep is propably not an option because while sleeping the lopp wont react on anything etc
<canton7> same with blocking
<canton7> do you need your loop to react to anything else?
<marvin_> well its thought that way
<marvin_> the class is ran for each log file so each log gets its on thread
<canton7> in your gist, the loop wasn't reacting to anything else
Nss [Nss!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
<marvin_> and then in its thread it seeks the logfile passed and if a new line at the end comes in it create the logentry in the mongodb
<marvin_> thats about it :)
<canton7> sounds good. Doesn't explain why you can't block the thread when waiting for file modifications, though
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby
automagic [automagic!~karol@213-238-68-166.adsl.inetia.pl] has joined #ruby
<marvin_> because ... when it runs it gets the last line when more then 1 new lines drop in while a sleep it will miss some
<marvin_> what i could do is a rewrite it that way
<canton7> that isn't a problem which can be fixed by polling more frequently
<marvin_> i use rb-inotify to watch es file for changes .. if something changes seek the file and then do the create record
<canton7> instead of seeking to the end of the file, just look at new entries
<marvin_> but how does it now which lines have been seen on the previews request
<marvin_> -now+know
Tinuk [Tinuk!~fox@178-26-92-180-dynip.superkabel.de] has joined #ruby
<canton7> marvin_, in your example, I replaced f.read with f.readlines, and it reads all lines which have been added to the file
<marvin_> :)
<marvin_> so readlines will know which lines have been seen previously?
<canton7> looks a lot like it
<marvin_> actually i am using f.seek and f.get not read
<canton7> read from the current location up to the end
<canton7> you're using f.seek to seek to the end of the file. You're using f.read to read the line
<canton7> ahem, f.gets
<marvin_> so seek stays where it is and just replace gets with readlines
<marvin_> cool
<canton7> yup
<marvin_> and then i just loop trough it
<marvin_> cool
<marvin_> but
<marvin_> sleep 1 already dropped the cpu too and i didnt miss any lines yet
<marvin_> dropped in about 80-90 lines within 3 seconds
<canton7> yeah, no matter how long you sleep, you'll never miss lines
<canton7> (provided that lines aren't removed)
<marvin_> nope
<canton7> it'll just be a bit longer until you pick up on them
<marvin_> thats no issue they dont need to be real time
<canton7> cool
<marvin_> but sleep 1 already solved the issue its just not elegant
<marvin_> and evil! :)
<marvin_> thx for your help canton7
<canton7> you can save even more cycles using a proper notifier -- it'll block until the OS notifies it that the file has changed :)
<canton7> no worries
<marvin_> yeah i will test rb-inotify
<marvin_> and then start the rest for reading lines and creating records
<marvin_> because there should be no time wasted and the app should be as small as it can and lightweight
BrianE [BrianE!~brian@87.112.149.96] has joined #ruby
<canton7> arvindravi, I'm afraid I didn't understand the question
<banister`sleep> canton7: why does thatmake u afraid though
<canton7> It's an English thing -- we get scared a lot
<savage-> also EM#watch_file if you are using eventmachine: http://eventmachine.rubyforge.org/EventMachine.html#M000494
<banister`sleep> savage-: wow you're up late
<marvin_> well eventmachine is cool but than its another requirement and i want to keep requirements as low as possible
<savage-> yeah gotta go to bed now
<savage-> good night! hahaha
<banister`sleep> savage-: sleep well!
<savage-> thanks! :)
<marvin_> but thanks savage-
<arvindravi> canton7: i'm sorry about that,what i'm trying to do is add a list of numbers say from a to n(where a is the first number and n is the last number)
<marvin_> canton7, i didnt get the question either and my english isnt perfect at all
<canton7> and the numbers are sequential? eg if a = 1 and n = 5, the numbers are 1, 2, 3, 4, 5?
ChampS666 [ChampS666!~ChampS@p579C5947.dip.t-dialin.net] has joined #ruby
<marvin_> arvindravi, build a loop that starts from a and ends at n
<burgestrand> a..n
<burgestrand> D:
<marvin_> :)
<arvindravi> is there a ruby method like [a..n].sum ?
<burgestrand> arvindravi: (1..5).reduce(:+)
<arvindravi> thanks!
<marvin_> :)
krz [krz!~foobar@unaffiliated/krz] has joined #ruby
<canton7> arvindravi, don't forget the mathematical way -- (n-a+1)/2.0 * (a+n)
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
vladyn [vladyn!~vlado@78.83.241.70] has joined #ruby
<arvindravi> canton7: ah yes,i won't!
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
ikaros [ikaros!~ikaros@dslb-188-107-220-229.pools.arcor-ip.net] has joined #ruby
niklasb [niklasb!~codeslay0@p5B311333.dip0.t-ipconnect.de] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
fayimora [fayimora!~fayimora@95.175.159.58] has joined #ruby
automagic [automagic!~karol@77-253-102-251.adsl.inetia.pl] has joined #ruby
kirun [kirun!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
fayimora [fayimora!~fayimora@host86-151-111-74.range86-151.btcentralplus.com] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
sterNiX [sterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
gianlucadv [gianlucadv!~user@host78-84-dynamic.44-79-r.retail.telecomitalia.it] has joined #ruby
ksinkar [ksinkar!~ksinkar@115.240.41.241] has joined #ruby
dtaprl [dtaprl!~dtaprl@client-86-31-191-183.oxfd.adsl.virginmedia.com] has joined #ruby
idarkside [idarkside!~YourNick@5e0e912d.bb.sky.com] has joined #ruby
senny [senny!~senny@84-72-61-96.dclient.hispeed.ch] has joined #ruby
thecreators [thecreators!~rskagy@cpe-65-27-201-150.cinci.res.rr.com] has joined #ruby
p0y [p0y!~p0y@112.210.59.96] has joined #ruby
p0y [p0y!~p0y@112.210.59.96] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@125.162.60.202] has joined #ruby
iamjarvo [iamjarvo!~Adium@c-71-230-13-201.hsd1.nj.comcast.net] has joined #ruby
geaif [geaif!~geaif@xdsl-188-155-129-176.adslplus.ch] has joined #ruby
p0y [p0y!~p0y@112.210.59.96] has joined #ruby
Proshot [Proshot!~CoreD@217.68.49.75] has joined #ruby
eldariof [eldariof!~CLD@host-81.200.0.181.su29.ru] has joined #ruby
stringoO [stringoO!~JLstring@bas1-toronto42-1279598654.dsl.bell.ca] has joined #ruby
QKO [QKO!~reaVer@unaffiliated/reaver] has joined #ruby
cobragoat [cobragoat!~cobragoat@50-0-128-82.dsl.dynamic.sonic.net] has joined #ruby
ikaros [ikaros!~ikaros@studpool-wlan-75-234.fs.fbi.h-da.de] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@nas18-39.york.ac.uk] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
p0y [p0y!~p0y@112.210.59.96] has joined #ruby
rowanu [rowanu!~rowanu@modemcable005.175-83-70.mc.videotron.ca] has joined #ruby
dominikh [dominikh!~dominikh@cinch/developer/dominikh] has joined #ruby
RichGuk [RichGuk!~RichGuk@carina.27smiles.com] has joined #ruby
kartouch [kartouch!~kartouch@kartouch.ic-clear.eu] has quit ["Quitte"]
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
rowanu [rowanu!~rowanu@modemcable005.175-83-70.mc.videotron.ca] has joined #ruby
LMolr_ [LMolr_!~quassel@87.19.33.245] has joined #ruby
davidpk [davidpk!~r00t@5e0a02e9.bb.sky.com] has joined #ruby
dekroning [dekroning!~dekroning@541B931D.cm-5-4c.dynamic.ziggo.nl] has joined #ruby
wenbert [wenbert!~wenbert@120.28.231.65] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
bluOxigen [bluOxigen!ssf@unaffiliated/bluOxigen] has joined #ruby
p0y [p0y!~p0y@112.210.59.96] has joined #ruby
acadavid [acadavid!~acadavid@190.71.122.249] has joined #ruby
shaman42 [shaman42!shaman42@kapsi.fi] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
ePirat [ePirat!~ePirat@p57A971C8.dip.t-dialin.net] has joined #ruby
ePirat [ePirat!~ePirat@unaffiliated/epirat] has joined #ruby
rowanu [rowanu!~rowanu@modemcable005.175-83-70.mc.videotron.ca] has joined #ruby
bassplayerdoug [bassplayerdoug!~bassplaye@97-85-153-116.static.stls.mo.charter.com] has joined #ruby
moshee [moshee!~moshee@c-50-135-229-127.hsd1.wa.comcast.net] has joined #ruby
chessguy [chessguy!~chessguy@pool-74-96-83-16.washdc.fios.verizon.net] has joined #ruby
pantsman [pantsman!~pantsman@2.25.187.234] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
alx- [alx-!~Alex@108.162.180.72] has joined #ruby
strife25 [strife25!~strife25@cpe-098-026-018-050.nc.res.rr.com] has joined #ruby
josemota [josemota!~josemota@bl6-60-139.dsl.telepac.pt] has joined #ruby
happosade [happosade!happosade@lakka.kapsi.fi] has joined #ruby
rowanu [rowanu!~rowanu@modemcable005.175-83-70.mc.videotron.ca] has joined #ruby
geaif [geaif!~geaif@xdsl-188-155-129-176.adslplus.ch] has joined #ruby
rowanu [rowanu!~rowanu@modemcable005.175-83-70.mc.videotron.ca] has joined #ruby
cobragoat [cobragoat!~cobragoat@207.239.114.206] has joined #ruby
Nss [Nss!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
regedarek [regedarek!rege@gateway/shell/bshellz.net/x-vntlkoxycmpqnfhm] has quit [#ruby]
Targen [Targen!~iguana@190.39.181.108] has joined #ruby
Jay_S [Jay_S!~tommy@cpc1-pmth10-2-0-cust344.6-1.cable.virginmedia.com] has joined #ruby
<josemota> hey guys, I'm trying to symlink some dotfiles of mine but my Rakefile in http://pastie.org/3231161 isn't copying the last file, I'm not sure why, though.
<burgestrand> josemota: you sure you want to use exec there and not sh?
<josemota> burgestrand: what's the difference? (first rake script ever.)
dhs227 [dhs227!~dhs227@180.154.10.40] has joined #ruby
<dhs227>
<burgestrand> josemota: sh is a method supplied to you by rake that executes a command, while exec is a method in ruby: http://www.ruby-doc.org/core-1.9.2/Kernel.html#method-i-exec
vandemar [vandemar!syndicate@2001:470:1f10:56b::4] has joined #ruby
<josemota> that's great, thanks for the tip. however, I believe the last script is being left behind in that loop
michael_mbp_ [michael_mbp_!~Marin@46.186.175.5] has joined #ruby
cinch [cinch!~cinch@78.46.138.149] has quit ["Leaving"]
centipedefarmer_ [centipedefarmer_!~centipede@71-34-163-250.desm.qwest.net] has joined #ruby
emocakes [emocakes!~om@201-14-40-67.mganm703.dsl.brasiltelecom.net.br] has joined #ruby
<josemota> ping burgestrand
<burgestrand> josemota: ?
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
<josemota> burgestrand: i'm sorry, I'm still not sure why the last script is being left in the loop. I'll try and test a little more.
<josemota> thank you either way.
<burgestrand> josemota: what’s the output?
<josemota> I'll paste it
<josemota> Symlinking: gitconfig, vimrc¬ | 2 task :default do¬
<josemota> 2 /Users/josemota/.gitconfig -> /Users/josemota/Code/dotfiles/gitconfig
senny [senny!~senny@84-72-61-96.dclient.hispeed.ch] has joined #ruby
<burgestrand> josemota: pastebin
<josemota> Symlinking: gitconfig, vimrc¬ | 2 task :default do¬
<josemota> crap, I'm sorry.
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
<burgestrand> josemota: how are you running it?
<josemota> i'm just running rake.
<burgestrand> josemota: because that output is not consistent with the rakefile
<josemota> hold on, updating the Rakefile pastie.
Proshot [Proshot!~CoreD@217.68.49.75] has joined #ruby
<burgestrand> josemota: that’s not the file you’re running
<burgestrand> if it is should be using sh and not exec…
<josemota> I apologize, my pastie plugin for vim is going nuts.
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
<josemota> one more time.
<josemota> you're right, I was running `exec` and fixed another thing. updating
<josemota> that's the Rakefile
<josemota> not for the output
<josemota> that's the output
Chaazd [Chaazd!~tdervan@cpc19-nmal17-2-0-cust305.croy.cable.virginmedia.com] has joined #ruby
<linduxed> is there an equivalent of << for arrays, but that puts stuff at the beginning?
<josemota> linduxed: unshift?
rickmasta [rickmasta!~rickmasta@pool-71-183-247-164.nycmny.fios.verizon.net] has joined #ruby
<linduxed> hmmm
<linduxed> maybe
<linduxed> damn, i don't even know if it's the solution
<Chaazd> I would like to make the result add on to the file, as opposed to replacing the current text. http://pastebin.com/qiph65np
dekroning [dekroning!~dekroning@541B931D.cm-5-4c.dynamic.ziggo.nl] has joined #ruby
<josemota> burgestrand: you now what... it's working, just because of that `sh` swap. weird...
<josemota> thank you for being patient, I appreciate it.
<burgestrand> josemota: ;)
<burgestrand> josemota: it’s because when you use exec you replace the process, it can only ever run one symlink operation that way
<josemota> burgestrand: so if I had a dozen files to symlink, it would only do one.
<burgestrand> josemota: yep
<josemota> thank you.
<josemota> have a good one
dv310p3r [dv310p3r!~dv310p3r@216.199.155.226.nw.nuvox.net] has joined #ruby
<Chaazd> Anyone?
fermion [fermion!~fermion@mobile-198-228-192-071.mycingular.net] has joined #ruby
<josemota> Chaazd: looking at it, one sec
<Chaazd> Thanks
<josemota> the mode you have is "w", which writes over the file. Try using "a"
<dhs227> What's the difference between ` and "?
<Chaazd> Thanks
<josemota> yw
<josemota> dhs227: " allows you to encapsulate variables in it.
<josemota> concerning strings, ofc
p0y_ [p0y_!~p0y@121.97.55.141] has joined #ruby
<canton7> var = 'bob'; puts "hello #{var}" prints "hello bob". puts 'hello #{var}' prints "hello #{var}"
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
regedarek [regedarek!rege@gateway/shell/bshellz.net/x-vntlkoxycmpqnfhm] has joined #ruby
fermion [fermion!~fermion@mobile-198-228-192-071.mycingular.net] has joined #ruby
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby
eighty4 [eighty4!~eighty4@unaffiliated/eighty4] has joined #ruby
<burgestrand> dhs227: ` or '?
rippa [rippa!~rippa@109-161-127-12.pppoe.yaroslavl.ru] has joined #ruby
enikar [enikar!~gil@2a01:240:fe00:8b::2] has joined #ruby
Luka-Krieg [Luka-Krieg!Luka-Krieg@pool-173-77-216-106.nycmny.fios.verizon.net] has joined #ruby
Luka-Krieg [Luka-Krieg!Luka-Krieg@pool-173-77-216-106.nycmny.fios.verizon.net] has quit [#ruby]
jamw [jamw!~j@cpc11-orpi3-2-0-cust53.2-3.cable.virginmedia.com] has joined #ruby
fermion [fermion!~fermion@mobile-198-228-192-071.mycingular.net] has joined #ruby
johnnus_ [johnnus_!~johnnus_@c80-217-133-221.bredband.comhem.se] has joined #ruby
Azure|netbook [Azure|netbook!~azt@unaffiliated/azure] has joined #ruby
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby
a_a_g [a_a_g!~aag@121.246.33.172] has joined #ruby
Jay_S [Jay_S!~tommy@cpc1-pmth10-2-0-cust344.6-1.cable.virginmedia.com] has joined #ruby
mztriz [mztriz!~mztriz@74-136-75-114.dhcp.insightbb.com] has joined #ruby
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
<countskm> output = `ls`
<countskm> would run the command ls and put the output in #{output}
<dhs227> oh, countskm, right! that's really what I got, and I am confused
<dhs227> ` ` looks mystery to me
<countskm> the idea is that you dont want to do something in ruby (leverage existing program)
<countskm> it is slower because its an exec call but if the program gets just what u need its powerful technique
<dhs227> yup. exactly. now, suppose I have a string variable, how I can run that directly?
<countskm> %x{ cmd }
<countskm> thats the "cleaner" way to write it
<countskm> output = %x{ cmd }
<dhs227> cmd_string = "blahblah"
<dhs227> output = %x{ cmd }
<dhs227> that 2 lines will do, right?
rowanu [rowanu!~rowanu@modemcable005.175-83-70.mc.videotron.ca] has joined #ruby
<dhs227> output = %x{ cmd_string }
<countskm> cmd_string="foo"
<Mon_Ouie> You'd need string interpolation then
<countskm> output = %x{ #{cmd_string} }
<countskm> you could use [] to make it standout if u prefer too: output = %x[ #{cmd_string} ]
wyhaines_ [wyhaines_!~wyhaines@65.39.118.15] has joined #ruby
d2dchat [d2dchat!~d2dchat@c-98-209-18-197.hsd1.mi.comcast.net] has joined #ruby
<regedarek> hi, i have simple ruby script https://gist.github.com/1653215 i would like to run this sript evry hour, how to do this??
<canton7> cron? Simplest solution
<regedarek> where i can deply this??
<regedarek> deploy*
alx- [alx-!~Alex@108.162.180.72] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
<Chaazd> regedarek If you kept the script running, you could use Time to execute the class periodically
<Chaazd> Like if Time.now == start_time + 100
<regedarek> Chaazd: the biggest problem for me is how to deploy tis script on heroku or other free server
openpercept [openpercept!~openperce@fedora/openpercept] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-218-131.hsd1.mi.comcast.net] has joined #ruby
quest88 [quest88!~quest88@c-98-207-205-137.hsd1.ca.comcast.net] has quit [#ruby]
n3m [n3m!~bla@93-82-121-36.adsl.highway.telekom.at] has joined #ruby
tonini [tonini!~zastav@78-8.61-188.cust.bluewin.ch] has joined #ruby
hadees [hadees!~hadees@72-48-91-73.dyn.grandenetworks.net] has joined #ruby
Chaazd [Chaazd!~tdervan@cpc19-nmal17-2-0-cust305.croy.cable.virginmedia.com] has quit [#ruby]
p0y [p0y!~p0y@121.97.55.141] has joined #ruby
philcrissman [philcrissman!~philcriss@206.57.45.116] has joined #ruby
blueadept [blueadept!~blueadept@unaffiliated/blueadept] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-170-217.ard.bellsouth.net] has joined #ruby
eldariof [eldariof!~CLD@81.200.24.187] has joined #ruby
ksinkar [ksinkar!~ksinkar@115.242.40.10] has joined #ruby
davidpk [davidpk!~r00t@5e0a02e9.bb.sky.com] has joined #ruby
_srp [_srp!~quassel@115.99.249.21] has joined #ruby
tomzx [tomzx!~tomzx@dsl-156-157.aei.ca] has joined #ruby
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
Nss_ [Nss_!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
d2dchat [d2dchat!~d2dchat@c-98-209-18-197.hsd1.mi.comcast.net] has joined #ruby
tbrock [tbrock!~tbrock@cpe-66-65-101-248.nyc.res.rr.com] has joined #ruby
x77686d [x77686d!~whm@h-67-101-188-178.phndaz91.static.covad.net] has joined #ruby
waxjar [waxjar!~waxjar@546B5B52.cm-12-4b.dynamic.ziggo.nl] has joined #ruby
jmorton_ [jmorton_!~jmorton@pool-108-15-39-246.bltmmd.fios.verizon.net] has joined #ruby
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby
mk03 [mk03!~mk03@61.245.119.34.er.eaccess.ne.jp] has joined #ruby
pjs [pjs!~pjs@pscom.netlandish.com] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
<pjs> trying to start the thin webserver (for redmine, I'm upgrading my redmine version) and now I'm getting an error about missing rails gem, but it's installed. http://dpaste.com/691859/
<pjs> any ideas guys? Sorry, I'm not really a Ruby guy so I'm sort of at a loss
<canton7> pjs, does the project rely on bundler? Is there a Gemfile in the root of the project?
* newbold learned about Gemfiles the hard way yesterday
<pjs> canton7 no Gemfile
<newbold> that's probably your issue
acadavid [acadavid!~acadavid@190.71.122.249] has joined #ruby
<newbold> pjs: check this https://gist.github.com/1422731
<newbold> you'll want one that lists the gems that your app uses
<pjs> hrmm, well in the docs for Redmine there is nothing referencing a Gemfile
<canton7> hmm, I wouldn't have thought. If there was a Gemfile, the yes. But there isn't, so it should be using the native rails gem
<pjs> and I had my previous version working fine
* newbold notes that he's very likely wrong then :P
<pjs> just the newer version has a requirement for an updated rails version, so I updated the gem to the required version, and now I get the error in the paste above.. so weird
<countskm> talks about the Gemfile in that doc
<canton7> that documents how to create one, though. Which is great if he wants one, but doesn't explain the problem methinks
adamjleonard [adamjleonard!~adamjleon@pool-108-9-169-222.tampfl.fios.verizon.net] has joined #ruby
* canton7 dislikes bundler and Gemfiles
<pjs> hrmm
<pjs> Yea, that creates one
<regedarek> how to run script file in scheduler.rake
<pjs> how can I "import" the rails gem and see the version I return? ie, in Python I'd do something like 'import rails; rails.__version__'
<canton7> pjs, so confirm, you're running the server locally?
<pjs> canton7, no one a freebsd VPS remotely
<canton7> well, "locally" relative to wherever you're ssh'd into -- as in it isn't on heroku or something
bier [bier!~bier@p54A59E12.dip.t-dialin.net] has joined #ruby
ChampS666 [ChampS666!~ChampS@p5795398A.dip.t-dialin.net] has joined #ruby
<pjs> canton7, yea.. I'm ssh'd in
Nss [Nss!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
dv_ [dv_!~quassel@chello080108009040.14.11.vie.surfer.at] has joined #ruby
<canton7> pjs, other people with the same problem appeared to think it's a path issue... Did you install the rails gem as root or your user?
<pjs> root
<pjs> but the thin sever runs as www
<pjs> maybe thats the issue?
<canton7> nah, should be fine. if you install a gem as non-root, it can go into ~/.gems, which another user won't be able to access
<canton7> ooh, someone's had trouble from multiple rack versions installed (which is your case)
<pjs> ahhh
<pjs> should I uninstall rack and rails, reinstall rails?
<pjs> I assume it depends on rack?
<pjs> (sorry, I really dont know the ruby tools)
<canton7> yeah, give that a shot. I've no idea what version of rack that particular version of rails depends on :P
<canton7> This is mostly rails territory, which we're all a bit knowledge-less on
automagic [automagic!~karol@213-238-75-126.adsl.inetia.pl] has joined #ruby
<pjs> gotcha.. the redmine docs says it requires version 1.1.x.. so I'm gonna uninstall the other 2
<pjs> one second
<canton7> to be fair, this is the sort of gem dependency hell that Bundler (with its Gemfiles) is *supposed* to solve. Pity it doesn't really work cross-platform...
centipedefarmer_ [centipedefarmer_!~centipede@71-34-163-250.desm.qwest.net] has joined #ruby
<pjs> canton7, I hear ya.. in Python I'd use virtualenv and pip requirements file
<canton7> I do like how centralised the whole gem thing is (which was contratry to python last time I used python eggs, but that was a long time ago and things have probably changed)
h4mz1d [h4mz1d!~hamfz@c-68-62-113-11.hsd1.al.comcast.net] has joined #ruby
_kinderman [_kinderman!~kinderman@c-98-223-146-252.hsd1.in.comcast.net] has joined #ruby
<pjs> canton7, you'd probably want to look at pip utility.. its the gem equiv
<canton7> pjs, cheers for the heads-up
canton7_ [canton7_!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
beakerman [beakerman!~beakerman@c-76-118-172-173.hsd1.nh.comcast.net] has joined #ruby
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
pxjorge [pxjorge!~pxjorge@a89-152-235-119.cpe.netcabo.pt] has joined #ruby
_srp [_srp!~quassel@115.99.249.21] has joined #ruby
canton7 [canton7!~smuxi@87-194-161-58.bethere.co.uk] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
<pjs> canton7, no problem.. thx for your help. BTW, the rack versions was the issue.. though I've run into another one now lol. I'll figure it out though.
<canton7> pjs, cool! One step at a time haha
maasha [maasha!535c4c84@gateway/web/freenode/ip.83.92.76.132] has joined #ruby
Harzilein [Harzilein!~harzi@harzilein.eu.org] has quit [#ruby]
_kinderman_ [_kinderman_!~kinderman@c-98-223-146-252.hsd1.in.comcast.net] has joined #ruby
<maasha> hey.
diago [diago!~heath@pool-108-17-141-187.nrflva.fios.verizon.net] has joined #ruby
<pjs> canton7, any way to uninstall all gems and start over?
<diago> Hello, I'm looking for an image library to be able to rise images on the fly. Does anyone use a library of such?
<maasha> I have one of these cases of code that fails in a way I cannot exemplify in a simple manner. The issues happens with Open3.popen3 and Threads. popen3 hangs.
milkpost [milkpost!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
<Tasser> diago, rmagick?
_kinderman_ [_kinderman_!~kinderman@c-98-223-146-252.hsd1.in.comcast.net] has joined #ruby
<milkpost> is there anyone that can add ";;; ruby-mode.el ends here" to ruby-mode.el OR ask someone to do it?
<diago> Tasser: I looked at that one and a few others. I'm trying to see what is still in active development
<milkpost> or where is the best place to submit bugs like this?
<maasha> I have no idea what to do next ... :o/
KDiddy [KDiddy!~kdiddy@p4FEE8423.dip0.t-ipconnect.de] has joined #ruby
_kinderman [_kinderman!~kinderman@c-98-223-146-252.hsd1.in.comcast.net] has joined #ruby
<diago> mimi magic looks good
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
<maasha> what may this indicate? SIGPIPE (signal 13)
SegFaultAX [SegFaultAX!~SegFaultA@c-98-248-241-85.hsd1.ca.comcast.net] has joined #ruby
dv310p3r [dv310p3r!~dv310p3r@host-208-68-238-122.biznesshosting.net] has joined #ruby
zenergi [zenergi!~zenergi@pdpc/supporter/student/zenergi] has joined #ruby
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
tentimes [tentimes!~tentimes@host86-179-25-212.range86-179.btcentralplus.com] has joined #ruby
<maasha> hm, a slight modification to use popen2 instead of popen3 and it works. nasty.
* maasha grinds teeth
centipedefarmer_ [centipedefarmer_!~centipede@71-34-163-250.desm.qwest.net] has joined #ruby
<tentimes> Hi
pjs [pjs!~pjs@pscom.netlandish.com] has quit [#ruby]
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
pdtpatrick_ [pdtpatrick_!~pdtpatric@ip72-211-207-15.oc.oc.cox.net] has joined #ruby
<pdtpatrick_> Question -- is there something like ipython for ruby ?
enherit [enherit!~enherit@66-214-13-183.dhcp.lnbh.ca.charter.com] has joined #ruby
<Tasser> pdtpatrick_, pry
<pdtpatrick_> :) thanks
<burgestrand> pdtpatrick_: irb, comes with ruby
<pdtpatrick_> right - seen that
Jake232 [Jake232!~textual@5e0e4df5.bb.sky.com] has joined #ruby
senny [senny!~senny@84-72-61-96.dclient.hispeed.ch] has joined #ruby
<Tasser> burgestrand, ipython doesn't come with python ;-)
ukd1_b [ukd1_b!~ukd1@ganderapp.com] has joined #ruby
zastaph [zastaph!zastaph@unaffiliated/zastaph] has joined #ruby
i8degrees [i8degrees!~i8degrees@ip70-178-131-208.ks.ks.cox.net] has joined #ruby
ikaros [ikaros!~ikaros@dslb-188-107-220-229.pools.arcor-ip.net] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@46-64-51-175.zone15.bethere.co.uk] has joined #ruby
Karmaon [Karmaon!~john@gateway/tor-sasl/karmaon] has joined #ruby
moshee [moshee!~moshee@c-50-135-229-127.hsd1.wa.comcast.net] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
n3m [n3m!~bla@188-23-153-119.adsl.highway.telekom.at] has joined #ruby
vraa [vraa!~vraa@99-20-202-44.lightspeed.hstntx.sbcglobal.net] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@46-64-51-175.zone15.bethere.co.uk] has joined #ruby
<regedarek> how to in rakefile import class from other file in the same dir
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<Tasser> regedarek, require_relative
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
stephans [stephans!~stephans@76-217-209-24.lightspeed.sntcca.sbcglobal.net] has joined #ruby
palcu [palcu!~alex@89.122.187.223] has joined #ruby
banister`sleep [banister`sleep!~baniseter@118.82.185.158] has joined #ruby
<regedarek> Tasser: thx
i8igmac [i8igmac!~bigmac@c-67-185-190-112.hsd1.wa.comcast.net] has joined #ruby
roblak [roblak!~roblak@c-67-160-217-70.hsd1.ca.comcast.net] has joined #ruby
robyurkowski [robyurkowski!~robyurkow@205.233.81.153] has joined #ruby
jbw [jbw!~jbw@dsl-044-084.cust.imagine.ie] has joined #ruby
faber [faber!~faber@adsl-ull-69-202.50-151.net24.it] has joined #ruby
shadoi [shadoi!~Adium@c-71-202-122-8.hsd1.ca.comcast.net] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@c-71-205-218-131.hsd1.mi.comcast.net] has joined #ruby
musee [musee!~musee@unaffiliated/musee] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-170-217.ard.bellsouth.net] has joined #ruby
<fred> does rspec have a built-in expectation for 'not false or nil' ?
<fred> oh, yeah, 'be', though the doc at the top says it's not-nil only
sizz [sizz!~customIRC@70-138-242-181.lightspeed.hstntx.sbcglobal.net] has joined #ruby
cheesedanish [cheesedanish!~somebody@CPE001c1057f507-CM001868521c78.cpe.net.cable.rogers.com] has joined #ruby
_srp [_srp!~quassel@115.99.249.21] has joined #ruby
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby
Codif [Codif!~codif@84.120.204.160.dyn.user.ono.com] has joined #ruby
v0n [v0n!~v4n@modemcable144.68-81-70.mc.videotron.ca] has joined #ruby
Codif [Codif!~codif@84.120.204.160.dyn.user.ono.com] has joined #ruby
ChampS666 [ChampS666!~ChampS@p54B4A342.dip.t-dialin.net] has joined #ruby
<i8igmac> is there a quick way to set ten threads at max
shaman42 [shaman42!shaman42@kapsi.fi] has joined #ruby
<gigamonkey> Just out of curiosity is there a way to combine these two lines into one: h = Hash.new 0;
<gigamonkey> dice.each { |d| h[d] += 1 } ? I tried inject with the hash as the initial value but that's not quite right because h[d] += 1 doesn't evaluate to the hash.
<gigamonkey>
<gigamonkey> Er, sorry.
brian- [brian-!brian@xdcc.org] has joined #ruby
BrianE [BrianE!~brian@87.112.149.96] has joined #ruby
<rippa> dice.each_with_object(Hash.new 0) {|d, h| h[d] += 1}
<gigamonkey> rippa, cool, thanks.
azureye [azureye!~azureye@wrls-249-27-81.wrls-client.fas.harvard.edu] has joined #ruby
<gigamonkey> So why is there an each_with_object method when it seems one could just write each.with_object ?
<newbold> what would I have to do to avoid using global variables in this example? http://pastie.org/3232599
<shevy> newbold not so easy with that
<shevy> you could write a mini class and use @ instead
<newbold> shevy: ah, thanks
jbpros [jbpros!~jbpros@39-186-112-217.dyn.adsl.belcenter.be] has joined #ruby
<shevy> hmm
<shevy> where does get '/' do come from?
<shevy> I guess "def get" ?
<shevy> I am writing stranger and stranger code
<shevy> _ = Foo.new(_)
<shevy> if _._
<shevy> # do something here
igel [igel!~igel@77-56-64-52.dclient.hispeed.ch] has joined #ruby
<newbold> shevy: http://sinatrarb.com
<shevy> yeah it confused me for a moment
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
<shevy> hmm going to try something with it quickly
<shevy> newbold hmm confuses me right now
<shevy> perhaps it is not so easy to wrap this into a class
<shevy> http://pastie.org/3232634 here does not seem to work
z2fyza [z2fyza!~gard@cm-84.215.22.0.getinternet.no] has joined #ruby
<newbold> shevy: I'm confused about almost everything too, but holy crap is sinatra pure awesomeness for anyone who does anything for the web
<burgestrand> newbold: declare the variable before line #5
<burgestrand> newbold: out = nil
<newbold> burgestrand: oh, I didn't realize you could do that
chessguy [chessguy!~chessguy@pool-74-96-83-16.washdc.fios.verizon.net] has joined #ruby
<shevy> hmm perhaps I have to use sinatra from now on just so I know why people like it
colint_ [colint_!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
<newbold> shevy: definitely
<newbold> I'm a total Ruby noob but I still managed to do that yesterday (thanks in large part to help from people in this room, of course)
<newbold> shevy: you can see it running here: http://newbold.herokuapp.com
<burgestrand> newbold: http://www.sinatrarb.com/intro.html#Views%20/%20Templates
<newbold> thanks to Sinatra, the entire process is reduced to three things, and one of those is just a redirect
<newbold> burgestrand: yeah, I was reading about erb the other day
<burgestrand> :)
<newbold> and realize that I could make the code even more awesome by using it :)
<Hanmac> newbold: start has a return value, so this work as one-liner: out = Net::HTTP.start("www.iana.org") { |http| http.get("/domains/example/index.html").body }
[[thufir]] [[[thufir]]!~thufir@184.65.42.92] has joined #ruby
<chessguy> anybody care to offer an opinion on whether this class has too many responsibilities? i feel like it does, but not sure how to simplify it. https://github.com/arwagner/terry/blob/master/lib/terry/knowledge_base.rb
<newbold> Hanmac: oh, sweet
<newbold> Hanmac: works perfectly!
<newbold> now to figure out the XML stuf
<newbold> stuff*
seb_ [seb_!~seb@lns-bzn-25-82-254-131-181.adsl.proxad.net] has joined #ruby
<newbold> is http://nokogiri.org overkill over rexml?
<shevy> both suck :)
<newbold> shevy: what do you recommend for parsing xml then?
<shevy> nah
<Hanmac> WHAT??? dont thay anything against nokogiri .... nokogiri ROCKS!
<shevy> when you use xml you are bound to use suckage anyway, and since nokogiri is newer, I would recommend nokogiri
<newbold> nokogiri it is then :)
<shevy> Hanmac when mechanize switched to nokogiri, it no longer worked for me
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
<newbold> hmmm, is there an easy way to do the equivalent of a curl head request in Ruby?
Targen [Targen!~iguana@159.90.11.250] has joined #ruby
apeiros_ [apeiros_!~apeiros@77-58-113-31.dclient.hispeed.ch] has joined #ruby
<burgestrand> newbold: I don’t use net/http often myself though, but that’s where I’d start unless you want to pull in another library for doing the http calls
<newbold> burgestrand: I literally just discovered open-uri
<newbold> which seems a little simpler
<burgestrand> newbold: yeah, it only does GET afaik
<newbold> that's fine by me at the moment
<newbold> (though that's good to know)
<burgestrand> newbold: but you said you wanted a HEAD request :p
<newbold> ah that was for troubleshooting
<newbold> my troubles have been shot :P
colint_ [colint_!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
Chaazd [Chaazd!~tdervan@cpc19-nmal17-2-0-cust305.croy.cable.virginmedia.com] has joined #ruby
dnyy [dnyy!~dnyy@c-98-237-138-38.hsd1.wa.comcast.net] has joined #ruby
iamjarvo [iamjarvo!~Adium@c-71-230-13-201.hsd1.nj.comcast.net] has joined #ruby
canton7 [canton7!~canton7@87-194-161-58.bethere.co.uk] has joined #ruby
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
Chaazd [Chaazd!~tdervan@cpc19-nmal17-2-0-cust305.croy.cable.virginmedia.com] has quit [#ruby]
<i8igmac> how can i remove any array that includes wild charicters... i just need plain text array
<i8igmac> ["name","josh","tim","jo_bob"]
<rippa> what
<i8igmac> im trying to remove all names like jo_bob
<burgestrand> i8degrees: Array#reject
<i8igmac> ty
<i8igmac> i have always used strings and blocked loop to remove witch is the hard way i think
<newbold> burgestrand: with open, how can I just stick the fetched data into a single string? do I have to do crazy stuff with .each_line and all that?
<burgestrand> newbold: open(uri).read
<newbold> oh
<newbold> that's simple enough :)
wookiehangover [wookiehangover!~wookiehan@c-67-161-138-118.hsd1.co.comcast.net] has joined #ruby
michael_mbp [michael_mbp!~Marin@46.186.175.5] has joined #ruby
acadavid [acadavid!~acadavid@190.71.122.249] has joined #ruby
<i8igmac> im not getting this
<i8igmac> result=names.reject {|x| x.unclude?('.,;[-_\*&^%$#@!')}
<i8igmac> if names only include (a..z) or (A..Z)
<i8igmac> i have seen it done but cont remember how
<Hanmac> result = names.reject {|x| x.match(/\W+/) }
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
<i8igmac> that will remove all names right?
<i8igmac> wait, all my names already incluide \n so i think it removed them all
<canton7> x.chomp.match(/\W+/)
<i8igmac> thank you
<i8igmac> ,-)
<apeiros_> i8igmac: String#include? means it includes the full substring
<canton7> bear in mind that \W is [6a-\A-Z0-9_], which might allow more that you want
TomJ [TomJ!~TomJ@unaffiliated/tomj] has joined #ruby
<i8igmac> numbers work
<apeiros_> that is, somewhere in x is the full substring '.,;[-_\*&^%$#@!' included
<canton7> * [^a-\A-Z0-9_]
<canton7> you can guess what I mean :P
<apeiros_> docs for the win, when stuff doesn't work the way you expect…
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
<canton7> the docs on that particular one are pretty clear imo
<i8igmac> im always using scan, index, include, with loops to do most of my work
<i8igmac> my function always includes counters... it would take me ten lines to reproduce this ---> result = names.reject {|x| x.match(/\W+/) }
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
<i8igmac> names.length-> 11500 ; result = names.reject {|x| x.match(/\W+/) } -> 10674
<nfxgosu> def initialize(base)
<nfxgosu> @base = base
<nfxgosu> end
<nfxgosu> if i want to initialize height also, do I do it in another def or can I (base, height) in the same one
<canton7> you can do base, height = @base, @height
<canton7> ahem, other way around
* canton7 needs more coffee
bafilius [bafilius!~lee@ip68-6-93-133.sb.sd.cox.net] has joined #ruby
<rippa> >other way around
<rippa> thgieh@ ,esab@ = thgieh ,esab
<nfxgosu> LOL
<nfxgosu> how do you make those colored msg's
<nfxgosu> needs more cof
<bafilius> hi all, what's a simple way to remove all NON duplicates from an array?
<rippa> navy blue
<canton7> "thgieh@ ,esab@ = thgieh ,esab".split.map{ |w| w.reverse }.join(' ') ;)
maletor [maletor!~maletor@c-69-181-24-86.hsd1.ca.comcast.net] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
<canton7> "thgieh@ ,esab@ = thgieh ,esab".split.map(:reverse).join(' '), even
<canton7> with an added ampersand
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
i8degrees1 [i8degrees1!~i8degrees@ip70-178-131-208.ks.ks.cox.net] has joined #ruby
dhodgkin [dhodgkin!~dhodgkin@cpe-76-178-249-57.maine.res.rr.com] has joined #ruby
yakko [yakko!~quassel@177.17.219.167] has joined #ruby
blueadept [blueadept!~blueadept@pool-96-251-83-184.lsanca.dsl-w.verizon.net] has joined #ruby
blueadept [blueadept!~blueadept@unaffiliated/blueadept] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-243-170-217.ard.bellsouth.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
stkowski [stkowski!~stkowski@99-189-114-57.lightspeed.sntcca.sbcglobal.net] has joined #ruby
<cdabba> is there an equivalent of elsif when using unless?
<Hanmac> nope
<rippa> there's not even else
<rippa> use if instead
<canton7> unless...else exists. It's considered bad practice to use it, though
i8degrees [i8degrees!~i8degrees@ip70-178-131-208.ks.ks.cox.net] has joined #ruby
thomasdebenning [thomasdebenning!~thomasdeb@c-69-181-139-137.hsd1.ca.comcast.net] has joined #ruby
<cdabba> gotcha
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
c0rn [c0rn!~c0rn@cpe-66-91-253-48.san.res.rr.com] has joined #ruby
gregorg [gregorg!~Greg@unaffiliated/gregorg] has joined #ruby
notjohn [notjohn!~john@cpe-174-103-133-37.cinci.res.rr.com] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
banister`sleep [banister`sleep!~baniseter@118.82.185.158] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
<[[thufir]]> for http://rubular.com/r/iUtffmzeb8 I want the string of numbers but seem to be getting PostingID=2809923350 when I only want 2809923350 returned. actual code: http://pastebin.mozilla.org/1458944
vmatiyko [vmatiyko!~vmatiyko@178.120.74.150] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
<canton7> [[thufir]], .match returns a MatchData object. When you call to_s on it, you get the original string which was matched
ziggles [ziggles!~ziggles@c-24-6-247-92.hsd1.ca.comcast.net] has joined #ruby
<canton7> try id = /postingID\=(\d+)/.match(hrefs[0])[1]
<[[thufir]]> canton7: ahhh. will try. thanks.
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
vmatiyko [vmatiyko!~vmatiyko@178.120.74.150] has quit [#ruby]
KremYura [KremYura!~KremYura@178.151.196.85] has joined #ruby
samer [samer!~samer@99-46-136-203.lightspeed.sntcca.sbcglobal.net] has joined #ruby
skrewler [skrewler!~skrewler@70-36-139-140.dsl.dynamic.sonic.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
<[[thufir]]> canton7: that fixes it. thanks.
<[[thufir]]> what does the last [1] for id = /postingID\=(\d+)/.match(hrefs[0])[1] mean or do?
adeponte [adeponte!~adeponte@pool-173-51-131-197.lsanca.fios.verizon.net] has joined #ruby
tomzx [tomzx!~tomzx@dsl-156-157.aei.ca] has joined #ruby
tomzx [tomzx!~tomzx@dsl-156-157.aei.ca] has joined #ruby
<[[thufir]]> oh, I see. the match returns an array. this makes sure that id is the value of the index 1 (not the zero index). yes?
<marvin_> hi canton7
tomzx [tomzx!~tomzx@dsl-156-157.aei.ca] has joined #ruby
headius [headius!~headius@71-37-230-236.mpls.qwest.net] has joined #ruby
tomzx [tomzx!~tomzx@dsl-156-157.aei.ca] has joined #ruby
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
alanp_ [alanp_!~quassel@206-248-152-52.dsl.teksavvy.com] has joined #ruby
<Hanmac> [[thufir]] no, it returns an matchData object, wich is similar to an array, [0] means the matched string, [1] means first group "(\d+)"
<canton7> hey
<canton7> marvin_ ^^
<[[thufir]]> Hanmac: ok, thanks.
gregorg [gregorg!~Greg@unaffiliated/gregorg] has joined #ruby
<marvin_> rewrote my class with rb-inotify and readlines works like a pretty
<canton7> ah, sweet! It's nice when someone has a satisfactory solution :)
<chessguy> is there some preferable way to avoid the dynamic define_method here? Forwardable doesn't seem to be able to do it. https://github.com/arwagner/terry/blob/master/lib/terry/knowledge_base.rb
<marvin_> well sleep 1 wasnt satisfacting for me at all cause i think within a loop its evil :)
<[[thufir]]> how do I change hrefs.each {|x| puts x} to something like hrefs.each |x| do .... end ?
davidpk [davidpk!~r00t@5e0a02e9.bb.sky.com] has joined #ruby
<marvin_> and its running even if doesnt need to run maybe because the files havent changed
<chessguy> [[thufir]]: those two are equivalent
<chessguy> [[thufir]]: except it's "do |x|", not "|x| do"
<marvin_> the first one is shorter
dross [dross!~dross@unaffiliated/dross] has joined #ruby
<dross> hmm
<[[thufir]]> chessguy: I think that's why it won't run.
andyjeffries [andyjeffries!~andyjeffr@cpc3-stev6-2-0-cust224.9-2.cable.virginmedia.com] has joined #ruby
<marvin_> a good editor would have told you that hrefs.each |x| do is written wrong :)
<marvin_> eclipse would
<chessguy> there should be some equivalent to &:foo that calls it on self instead of the iterated item
linusoleander [linusoleander!~linus@banan.olf.sgsnet.se] has joined #ruby
linusoleander [linusoleander!~linus@banan.olf.sgsnet.se] has quit [#ruby]
<marvin_> canton7, but with rb-inotify it works perfect and it only need to be FreeBSD compatible
<Mon_Ouie> { |arg| foo(arg) } is too long?
<chessguy> as in hrelfs.each %:puts
<marvin_> dont care about linux or windows
<chessguy> Mon_Ouie: well, if you want to argue that, then &: shouldn't exist either
<Mon_Ouie> It doesn't
<Mon_Ouie> I's &(:symbol)
<chessguy> yes...
<[[thufir]]> marvin_: not enough ram for eclipse etc :(
<Mon_Ouie> And it's not that it's bad that you can use it, it's just that it isn't needed
<chessguy> it's still a shortcut for {|arg| arg.foo }
<shevy> hmm isn't it different because it is slower
<Hanmac> chessguy: it exist: each(&object.method("meth"))
<Mon_Ouie> And &object is required whenever you want to pass a block to a method without passing a block literal
dmn001 [dmn001!~a@ec2-107-21-186-30.compute-1.amazonaws.com] has quit [#ruby]
<marvin_> [[thufir]], but there is good addons for vim too
<newbold> heh, just made this --- my 2nd ruby thing ever: http://warm-sunset-8543.herokuapp.com/London
<marvin_> including auto-complete etc
techhelp [techhelp!~Dan@ip70-162-10-229.ph.ph.cox.net] has joined #ruby
<Mon_Ouie> shevy: It's like def to_sym; sym = self; { |recv, *args| recv.public_send sym, *args }; end
<Mon_Ouie> proc { … }*
<Mon_Ouie> Not sure if the block is passed over too
<banister`sleep> Mon_Ouie: type show-method Symbol#proc
<Mon_Ouie> return proc_new(rb_cProc, FALSE);
<marvin_> newbold, you should have a check that if citiy == state dont display both :)
<banister`sleep> Mon_Ouie: very useful ;)
<Mon_Ouie> to_proc*, actually
<marvin_> try Dresden it shows saxony as state bu try berlin cause then it shows Berlin, Berlin.
<banister`sleep> Mon_Ouie: good point
<newbold> marvin_: I'm leaving the logic up to the google weather API :P
<marvin_> ^^
<newbold> marvin_: interestingly, google recognizes some common abbreviations for places, e.g. http://warm-sunset-8543.herokuapp.com/sf
jergason [jergason!~jergason@c-67-182-209-164.hsd1.ut.comcast.net] has joined #ruby
Hounth [Hounth!~hounth@212-198-237-31.rev.numericable.fr] has joined #ruby
<marvin_> yes its called internationalisation
<marvin_> ^^
gregorg [gregorg!~Greg@unaffiliated/gregorg] has joined #ruby
<banister`sleep> Mon_Ouie: are you interested in the tablet computing revolution
<Mon_Ouie> First time I read "tablet computing revolution"
<Mon_Ouie> Guess I'm not :p
<banister`sleep> hehe
<banister`sleep> Mon_Ouie: so u are not interested in owning an ipad (or an android equivalent) ?
igel [igel!~igel@77-56-64-52.dclient.hispeed.ch] has quit [#ruby]
<dross> ^_^ oh I can't wait to push my code out and watch the Java devs go "wtf does this code do?"
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
<dross> I dislike computer science people so much, too academic, no understanding of keeping resource usage low like engineers.
mahlon [mahlon!mahlon@martini.nu] has joined #ruby
<[[thufir]]> dross: do you consider your time a resource as well?
<dross> [[thufir]]: exceptionally, yes
stringoO [stringoO!~JLstring@bas1-toronto42-1279598654.dsl.bell.ca] has joined #ruby
<dross> there is no correlation between being fast at programming and hogging resources. One can do such as they program, and people need to stop bloating up projects which shit code.
<[[thufir]]> ah, well, shit code, that's another topic then.
<dross> or using java to write a XML submission service
<dross> which takes 300 megs in java
<dross> when resources are not so unlimited, that's a lot
<[[thufir]]> I see
<jergason> dross: sweeping generalizations about CS vs engineering make me :(
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
<dross> jergason: companies who hire EEs over CSs for programming jobs make me :)
<jergason> depends on the person, not the degree
<jergason> degrees emphasize different things
<jergason> but people have different skills too
<dross> focus on degree generalizes the mindset
<jensn> If you hire people because of the degree instead of the person, you're probably doing stuff wrong.
<jergason> agreed
<jergason> that is what i am saying
<jergason> if you say "No CS people"
<dross> you can usually tell what a person is going to be like though from the degree
<jergason> nope nope nope
<jergason> Yehuda Katz
<dross> jergason: I know companies who rarely look at CS people
<jergason> graphic designer
<jergason> or something
<jergason> in college
<dross> though, what am I saying, I don't have any degree or certs and make most than almost everyone in EE/CS >..
<jergason> dross: I mean, if they are doing actual electrical engineering stuff, sure you want an ee major or someone with equivalent experience
<jergason> but for programming
<jergason> you are shutting out good candidates
<dross> not really
<dross> CS people coming out of college, they want to think too academic
<dross> I'm more less talking about companies hiring new grads
<jensn> People coming out of college tend to not have programming experience.
<dross> though I've seen stupid season programmers too, but usually people learn
<Hanmac> dross your code cant be ugler then my code ... or then swig's cxx files
<dross> :) Don't start with me on swig
<jergason> dross: let me make sure I understand what you are saying
<jergason> so CS people are, in general, not good practical programmers
<Hanmac> it feels very good if you can rip of swig
<jergason> while EE people are
<jergason> is that correct?
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
<dross> new grad CS people are not
<jergason> so new CS < new EE?
<jergason> just want to understand your position
<dross> correct
<jergason> hrrm
<pantsman> everyone is different, it's not like there are only 2 sides to the coin
<jergason> i think i still disagree
<dross> EEs tend to work on projects with real world applications
<jergason> too much generalization
<jergason> in that statement
<dross> CS people's projects tend to be stupid shit for their BS like.. a dumb ass shopping cart
<jergason> but
<banister`sleep> dross: what about SE majors?
<jergason> we can all agree
<jergason> that ruby is a great language
<pantsman> I've seen a CS grad who was shit-hot at writing algorithms, could probably optimise resource usage far better than me, but failed to factor code well and work well in a team
<dross> while EE people tend to be more along the lines of gadgetry (aviation devices, multi-task hardware using platforms like the beagle bone)
<dross> pantsman: I think that's a whole another issue
<dross> I get the "you're just a sys admin" from the others on the team
<yxhuvud> dross: not all CS educations are the same. We did some pretty cute real world stuff in projects where I went.
<dross> That's funny, since I'm paid WAY more than they are
<jergason> ughh
<Hanmac> jergason: yeah you are right ... but rails-only users are bit like apple users
andrewhl [andrewhl!~andrew@24-246-14-26.cable.teksavvy.com] has joined #ruby
<dross> I'm a sys admin who can code circles around them :3
<dross> Hanmac: been there too
<banister`sleep> dross: i dont see what pay has to do with this, i know plenty of sysadmins who are paid heaps but they're embeciles
<jergason> yeah, it is kind of snobby to keep bringing up the "i make so much money" card
<dross> Hanmac: been on projects which were slow because they don't understand persistent database frameworks like Hibernate
<jergason> doesn't really lend weight to your argument
<dross> people really piss me off when they can't pick up a book
<banister`sleep> dross: it's just a matter of having a stupid boss who doesnt understand the complexity of various jobs and how much people should be financially compensated
<dross> banister`sleep: xD
* dross is a hard ass consultant
<dross> the others on the team tremble when I walk in and take my recommendations to heart now
<banister`sleep> dross: you sound like a dick
<dross> especially on security :) because I started pwning their app code
<dross> banister`sleep: I am a dick at times, yes
<pantsman> sounds like you picked a soft target with corporate Java devs :)
<jergason> dross: has that ever hurt you professionally?
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
<Hanmac> PS: "you're just a sys admin" i know admins, if you say that sentence you will pay for it for the rest of your life
<dross> especially if someone gives me a cup of coffee, it doesn't have the same effect on me
<dross> jergason: hope
<dross> nope
<dross> I'm highly recommended for getitng shit done, fast
<dross> bout to implement complete network monitoring over 500 servers over the US
<banister`sleep> is this #ruby or #dross_talks_about_how_awesome_he_is
<dross> :P
<pantsman> the dick rate in #ruby seems high lately
* dross is just a hard ass ^_^
<pantsman> maybe it got a DPS buff (dicks per second)
<banister`sleep> srsly, it's boring
vicatcu [vicatcu!~vic@cpe-67-255-11-197.twcny.res.rr.com] has joined #ruby
<dross> if it puts things in perspective, working on part time law enforcement
<jergason> well we know those guys are all dicks
<jergason> so it fits
doug_ [doug_!~bassplaye@97-85-153-116.static.stls.mo.charter.com] has joined #ruby
<jergason> :)
<dross> bingo
<jergason> anyways
<pantsman> dicks fuck pussies, but they also fuck assholes...
<Hanmac> i have seen my evil c++ and my more evil ruby code, i think it counts
<jergason> anyone have experience with evented stuff in ruby?
<jergason> not using eventmachine?
<jergason> I guess am asking
<jergason> are there any other event frameworks
<jergason> besides eventmachine
<dross> I've not used anything other than eventmachine
<dross> what are you trying to accomplish?
<jergason> furtherance of my knowledge
<dross> ah
<jergason> curiosity mostly
<dross> eventmachine is closest to twistedframework
<dross> if you feel anything is lacking in eventmachine, send patches please :)
<vicatcu> i have a very n00bish ruby question. I have an object a with a member property b, is there a way for me to access a.b in a way that's similar to a[:b]? i want to pass a and :b to a function and determine within that function if a.b is null
<dross> patches are very much welcome
<vicatcu> does that make sense?
<[[thufir]]> what does a[:b] mean or do? I'm a noob
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
<jergason> :b is a symbol
<jergason> used as a key into the hash
<vicatcu> i think that's like a hash access syntax
<dross> :b is also a face
<dross> :b is the face I make when I win
<vicatcu> ha ha ha
<jergason> stuff preceded by a colon is the syntax for a symbol in ruby, and you can use them as hash keys
<jergason> also stuff preceded by a colon is a stomach
<vicatcu> a[:b] is an error though
<jergason> and small intestines
<vicatcu> when a is an object
<jergason> vicatcu: what is the error?
<banister`sleep> vicatcu: you want a.send(:b)
<vicatcu> hm ok let me try that
<jergason> vicatcu: oh didn't read your question all the way
<jergason> banister`sleep is a wise man
<vicatcu> that's perfect, thanks banister!
<Hanmac> banister know what do you need, before you know what you want
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
<gigamonkey> I asked this a couple hours ago; maybe someone here now knows: why is there a each_with_object when you could just write (it seems) each.with_object ?
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
<banister`sleep> gigamonkey: same is true for each.with_index vs each_with_index
<banister`sleep> gigamonkey: do a benchmark, my guess is each_with_object is a bit faster and is also the common case
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
<Hanmac> and its better for a send(
redgetan [redgetan!~redgetan@CPE0023bee17c0e-CM0023bee17c0b.cpe.net.cable.rogers.com] has joined #ruby
cooper [cooper!~mitchell@unaffiliated/furryfishy] has joined #ruby
<gigamonkey> banister`sleep: hmmm, I wondered about that.
uofiguy [uofiguy!4086a8e8@gateway/web/freenode/ip.64.134.168.232] has joined #ruby
niklasb [niklasb!~codeslay0@p5B311333.dip0.t-ipconnect.de] has joined #ruby
<uofiguy> hello
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
Mohan [Mohan!~nixh0st@unaffiliated/mohan] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
zastaph [zastaph!zastaph@unaffiliated/zastaph] has joined #ruby
emocakes [emocakes!~om@201-14-40-67.mganm703.dsl.brasiltelecom.net.br] has joined #ruby
<[[thufir]]> line 21 of http://pastebin.mozilla.org/1458983 has emails.put(email) where emails should be an array of email strings. it's not accessible outside the iteration. should it be a local variable, with an @ in front of it perhaps? http://pastebin.mozilla.org/1458983 how should or could it be declared properly?
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
<apeiros_> [[thufir]]: a variable with an @ in front is by definition *not* a local variable
bastilian [bastilian!~bastilian@chello062178156107.9.14.vie.surfer.at] has joined #ruby
<[[thufir]]> ok, have that backwards. I want to increase (?) the scope of emails to outside the loops, though.
<apeiros_> assign something to it before the loop
<apeiros_> the code you pasted looks broken…
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
<apeiros_> line 21: emails.put(email) <-- you never defined `emails` - maybe you meant `emails` instead of `email` in line 18?
<[[thufir]]> emails.push(email) is what I meant.
<[[thufir]]> but, I need some logic. unstuck now, thanks :)
<[[thufir]]> emails to be an array of email
<apeiros_> [[thufir]]: use map, not each.
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
<apeiros_> or flat_map
<apeiros_> depending on what you really want
<apeiros_> emails = hrefs.map { …
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
<[[thufir]]> thanks, thinking on that. that might be best approach. just iterating through looking for emails. no order, no mapping to hrefs. but, map might be best.
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
centipedefarmer_ [centipedefarmer_!~centipede@71-34-163-250.desm.qwest.net] has joined #ruby
<newbold> if I'm doing "blah #{something} blah" is there any way for me to convert #{something} to uppercase from in there?
<newbold> this is specifically for a regex pattern match, i.e. #{$1}
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
colint_ [colint_!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
statarb3 [statarb3!~CoreD@unaffiliated/statarb3] has joined #ruby
spyvsspy2 [spyvsspy2!~whistler@66.165.126.130] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@nas18-39.york.ac.uk] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
alienvenom [alienvenom!alienvenom@50-76-43-138-ip-static.hfc.comcastbusiness.net] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
radmacd_ [radmacd_!~radmacd@modemcable055.68-82-70.mc.videotron.ca] has joined #ruby
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
trivol [trivol!~aurelien@ip-178.net-89-2-84.rev.numericable.fr] has joined #ruby
matse [matse!~matse@fsf/member/matse] has joined #ruby
<matse> hello, I have done a system update which updated ruby-net-http-persistent from 1.8 to 2.3.3 - when I run a ruby script now I get the error "/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find net-http-persistent (~> 1.8)"
<matse> can anybody help me with that`
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
Seisatsu [Seisatsu!~seisatsu@adsl-99-35-225-92.dsl.pltn13.sbcglobal.net] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
fenix45 [fenix45!~fenix45@CPE0023bee17c0e-CM0023bee17c0b.cpe.net.cable.rogers.com] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
fenix45 [fenix45!~fenix45@CPE0023bee17c0e-CM0023bee17c0b.cpe.net.cable.rogers.com] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
krainboltgreene1 [krainboltgreene1!~krainbolt@ip72-204-189-169.no.no.cox.net] has joined #ruby
n3m [n3m!~bla@188-23-153-119.adsl.highway.telekom.at] has joined #ruby
<gigamonkey> Did adding a method_missing method use to make respond_to? return true for all method names? I'm doing the Ruby Koans and the test_catching_messages_makes_respond_to_lie test seems to imply it should but in 1.9.3 it does not. Or I'm confused.
charlenopires [charlenopires!~quassel@186.194.13.186] has joined #ruby
Shamgar [Shamgar!~mbainter@adsl-76-233-105-136.dsl.rcsntx.sbcglobal.net] has joined #ruby
tomzx_ [tomzx_!~tomzx@dsl-136-35.aei.ca] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
<burgestrand> gigamonkey: no
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
lkba [lkba!~AndChat@bpc198.neoplus.adsl.tpnet.pl] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
newton10471 [newton10471!~newton104@ool-18e46276.dyn.optonline.net] has joined #ruby
newton10471 [newton10471!~newton104@ool-18e46276.dyn.optonline.net] has joined #ruby
<notbrent> does anyone remember the iterator method for doing a staggered each? for example, yield the first and second element, then second and third, third and fourth, etc..
<krainboltgreene1> Probably on the Enumerator class?
<apeiros_> notbrent: each_cons?
<notbrent> apeiros_: yeah that's the one! thanks
<[[thufir]]> line 51 is: <div id="userbody"> and line 71 is: <br><br><ul class="blurbs"> for http://pastebin.mozilla.org/1459111 . using nokogiri, how would I grab lines 52 to 70? How to approach that?
<matse> would you recommend me to use ruby gem or packages from my distribution?
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
centipedefarmer_ [centipedefarmer_!~centipede@71-34-163-250.desm.qwest.net] has joined #ruby
<marvin_> ruby gem
<marvin_> mostly more up-to-date
<matse> marvin_: ok, so will there be no huddle with pacman?
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
<marvin_> arch linux?
<matse> marvin_: oh yes, sorry mixed up the channel ;)
<marvin_> ??
<matse> marvin_: i have a package (mechanize) that requires installation of lots of AUR ruby packages, and so i don't know whether it might be better to use gem...
<matse> because of more recent packages, but where does gem install the packages, if i install them system wide as root?
<marvin_> i use freebsd and arch linux and ubuntu
<marvin_> and i use rubygems on all of them
<matse> ok and would you recommend me using gem as normal user or as root?
<marvin_> check your gem env
<marvin_> for clean projects i use rvm
<matse> marvin_: how can i check my gem env? (sorry don't use ruby that often, i need it just for one script...)
<matse> installing as local user failed nevertheless "You don't have write permissions into the /usr/lib/ruby/gems/1.9.1 directory" - so i guess installing as root is the only way?
<marvin_> or use rvm :)
<matse> marvin_: never head of that... just reading a howto... has it any advantages?
<canton7> if your'e just doing a one-off, it might be more effort than it's worth
adamjleonard [adamjleonard!~adamjleon@pool-108-9-169-222.tampfl.fios.verizon.net] has joined #ruby
<marvin_> yes you can have multiple ruby setups within one system and just switch btw those
<marvin_> canton7, but knowing rvm and how to use can be very benefitial
charlenopires [charlenopires!~quassel@186.194.13.186] has joined #ruby
<canton7> sure
<matse> hmm sound nice but really i need ruby just for one script and even this is just for a few month
<marvin_> then just intsall the gems as root
<matse> can i uninstall all my installed packages also via gem?
<marvin_> yes
<matse> and are they installed in one central location?
CircleDot [CircleDot!~CircleDot@206-169-94-86.static.twtelecom.net] has joined #ruby
* dross yawns
<marvin_> run "gem env"
<dross> x.x
<marvin_> there is your installation directory shown
<matse> marvin_: great! that is the information i needded :) looks pretty straightforward
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
maletor [maletor!~maletor@c-69-181-24-86.hsd1.ca.comcast.net] has joined #ruby
<marvin_> :)
<matse> great, it installed mechanize with all dependencies and my script runs just fine, i guess i like gem :)
<matse> marvin_: thanks for your time and help!
<marvin_> no worries
hadees [hadees!~hadees@72-48-91-73.dyn.grandenetworks.net] has joined #ruby
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
<countskm> after many years of perl modules gem truly is a gem :-)
<newbold> <3 gem
QKO_ [QKO_!~reaVer@banzai.speedxs.nl] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
josefig [josefig!~josef@unaffiliated/josefig] has joined #ruby
MrKeuner [MrKeuner!~MrKeuner@unaffiliated/mrkeuner] has joined #ruby
<josefig> what is the default socket which rails is looking for in order to connect by ruby gem ?
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
bgupta [bgupta!~bgupta@68.164.142.90] has joined #ruby
<[[thufir]]> how do I grab the text (? or something else?) of http://pastebin.mozilla.org/1459130? see line 26 http://pastebin.mozilla.org/1459129 , trying to use section from nokogiri
<newbold> has anyone ever used http://geokit.rubyforge.org/index.html before?
nfxgosu [nfxgosu!~nekid@117.193.228.210] has joined #ruby
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
powbow [powbow!~powbow@CPE0023bee17c0e-CM0023bee17c0b.cpe.net.cable.rogers.com] has joined #ruby
ryanf [ryanf!~revfitz@adsl-67-122-210-195.dsl.snfc21.pacbell.net] has joined #ruby
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
gentz [gentz!ilab@ancient.webfoundation.net] has joined #ruby
wookiehangover [wookiehangover!~wookiehan@c-67-161-138-118.hsd1.co.comcast.net] has joined #ruby
t0mmyvyo [t0mmyvyo!~tommyvyo@c-68-83-3-164.hsd1.nj.comcast.net] has joined #ruby
Nisstyre [Nisstyre!~yours@c-208-90-102-250.netflash.net] has joined #ruby
powbow [powbow!~powbow@CPE0023bee17c0e-CM0023bee17c0b.cpe.net.cable.rogers.com] has joined #ruby
Nss [Nss!~nss@host127-217-dynamic.55-79-r.retail.telecomitalia.it] has joined #ruby
CodeZombie [CodeZombie!~CodeZombi@65.19.245.153] has joined #ruby
pow [pow!~pow@CPE0023bee17c0e-CM0023bee17c0b.cpe.net.cable.rogers.com] has joined #ruby
roadze [roadze!~roadze@119.224.137.97] has joined #ruby
searcher [searcher!~bonhoffer@pool-74-96-52-11.washdc.east.verizon.net] has joined #ruby
colint_ [colint_!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
rowanu [rowanu!~rowanu@modemcable005.175-83-70.mc.videotron.ca] has joined #ruby
jmcphers [jmcphers!~jmcphers@61.14.141.35] has joined #ruby
jergason [jergason!~jergason@c-67-182-209-164.hsd1.ut.comcast.net] has joined #ruby
pabloh [pabloh!~pablo@186.22.82.39] has joined #ruby
goodieboy [goodieboy!~goodieboy@c-68-57-35-79.hsd1.va.comcast.net] has joined #ruby
strife25 [strife25!~strife25@cpe-098-026-018-050.nc.res.rr.com] has joined #ruby