apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p327: http://ruby-lang.org (ruby-2.0.0-preview2) || Paste >3 lines of text on http://gist.github.com
<pewter_tao> havenn: so I just put lang = case File.extname(file_name) ?
vd0 has quit [Read error: Operation timed out]
cascalheira has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
<rismoney> blaze816. thats awesome! i thought i could have done it somehow with inject
<pewter_tao> havenn: see what I'm saying?
<yaymukund> rismoney: that's not what inject does ;)
<bricker> JDubs: I'm not sure, I don't understand exactly what it's trying to do
[D]rammer has quit [Quit: Quitte]
matrixise has joined #ruby
ffranz has quit [Quit: Leaving]
love_color_text has joined #ruby
pu22l3r has joined #ruby
mneorr has joined #ruby
<pewter_tao> havenn: you here?
skcin7 has joined #ruby
<havenn> pewter_tao: Yeah. I'll post a gist in a few, busy here.
<pewter_tao> I wanna make sure you get it before I take your time
agarie has joined #ruby
<bricker> JDubs: hmmmm
skcin7 has quit [Client Quit]
zastern has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
cdt has joined #ruby
sailias has joined #ruby
meskyanichi has joined #ruby
agarie has quit [Remote host closed the connection]
CaptainJet has quit []
mercwithamouth has quit [Ping timeout: 276 seconds]
slainer68 has quit [Read error: Connection reset by peer]
slainer6_ has joined #ruby
sailias has quit [Ping timeout: 260 seconds]
Nisstyre has joined #ruby
cj3kim has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
jslowe has quit [Read error: Connection reset by peer]
razibog has quit [Remote host closed the connection]
<bricker> JDubs: okay I got it I think
aajjbb has quit [Remote host closed the connection]
love_color_text has quit [Remote host closed the connection]
CaptainJet has joined #ruby
<pewter_tao> havenn: I'm not sure how to get my file defs into that case selector you made
cdt has quit [Ping timeout: 260 seconds]
art_man1 has quit [Quit: art_man1]
solidresolve has quit [Quit: Konversation terminated!]
nwertman has quit [Ping timeout: 276 seconds]
guns has joined #ruby
pac1 has joined #ruby
<pewter_tao> how do you call one def from another?
luckyruby has quit [Remote host closed the connection]
hotovson has joined #ruby
fyolnish has quit [Remote host closed the connection]
<bricker> oh nevermind I misunderstood the problem ;(
cdt has joined #ruby
<andalf> pewter_tao: call the def or method?
<andalf> pewter_tao: include the helper?
<pewter_tao> http://pastebin.com/cFvJVmBT andalf
<havenn> pewter_tao: See what you think of this (unfinished and untested)
<pewter_tao> That case thing is what I'm trying to do. basically the rest of the thing is going through directories putting every file into file_name... and I need to choose ruby or base based on the type of file
<havenn> pewter_tao: https://gist.github.com/4272959
yshh has joined #ruby
awaage has joined #ruby
jlast has joined #ruby
theRoUS has quit [Ping timeout: 245 seconds]
rellin has quit [Ping timeout: 260 seconds]
becom33 has quit [Ping timeout: 250 seconds]
GoGoGarrett has joined #ruby
<pewter_tao> havenn: lot of new stuff in there
<pewter_tao> got an error, trying to debug
becom33 has joined #ruby
<pewter_tao> readlines': Is a directory - cache (Errno::EISDIR)
testy_mctesterso has joined #ruby
testy_mctesterso has left #ruby [#ruby]
c0rn has quit []
cakehero has joined #ruby
<havenn> pewter_tao: Updated gist to get rid of a few errors.
<pewter_tao> havenn: still get the readlines': Is a directory - cache (Errno::EISDIR)
kil0byte has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
<pewter_tao> havenn: why file.readlines.first?
<kenneth> ruby vs. obj-c, same exact function: https://gist.github.com/f8ebed5c0f9cb92fc2a4
Hanmac1 has quit [Quit: Leaving.]
<JDubs> havenn: I'm getting a weird error now
<havenn> pewter_tao: I've updated it, put your expected Dirs back in.
<havenn> JDubs: What error?
Hanmac has joined #ruby
SCommette has joined #ruby
<JDubs> eueler12.rb:11:in `/': nil can't be coerced into Fixnum (TypeError)
<JDubs> from eueler12.rb:11:in `factor_prime'
<JDubs> from eueler12.rb:24:in `<main>'
<JDubs> havenn: I updated the gist btw
jlast has quit [Ping timeout: 244 seconds]
statarb3 has quit [Quit: Leaving]
<pewter_tao> havenn: same exact error
<pewter_tao> have you run it?
<pewter_tao> there's an issue with doing: line = file.readlines.first
tommyvyo has quit [Quit: http://thomasvendetta.com]
tommyvyo_ is now known as tommyvyo
<havenn> pewter_tao: I wrote it fast without tests or testing it :O prolly an error!
<pewter_tao> havenn: maybe that all has to be after the other tests
<pewter_tao> the next if (where it checks for dir
lolcathost has joined #ruby
<pewter_tao> probably needs to be firstr
<IceDragon> pewter_tao are you trying to read the first line of a file?
chrisja has joined #ruby
<havenn> pewter_tao: line = file.readline
woolite64 has joined #ruby
seanstickle has joined #ruby
theRoUS has joined #ruby
<pewter_tao> havenn: doesn't that need to go after my check if it's binary, a dir, etc?
jtperreault has joined #ruby
<havenn> pewter_tao: Yeah
<mr-rich> any way to get a password in a ruby script w/o installing any gems?
<pewter_tao> ok, so first isn't right you're saying
<yaymukund> mr-rich: "get a password"?
cdt has quit [Ping timeout: 260 seconds]
<mr-rich> yaymukund: get a user'
andalf has quit [Ping timeout: 250 seconds]
<mr-rich> dammit
<havenn> pewter_tao: Cept it is used in one of the checks. So should be after, and last check should be even further after. :OP
<JDubs> Haven: there seems to be a problem with self/factor...any idea why?
<foucist> mr-rich: like gets() but no showing of the password when they type it in?
<havenn> JDubs: Hrmm
<mr-rich> yaymukund: get a user's password and not show it while typing ...
<yaymukund> ahh I see
lolcathost has quit [Client Quit]
<pewter_tao> undefined local variable or method `script' for CheckFiles:Module (NameError), so this is due to !script.language test
slainer6_ has quit [Remote host closed the connection]
<mr-rich> foucist: exactly ...
<yaymukund> not sure, sorry :s
ephemerian has left #ruby [#ruby]
andalf__ has joined #ruby
<foucist> mr-rich: i know there is a method, gotta remember what it was though
<pewter_tao> havenn: that was a mouthful, can you add what you said?
<havenn> pewter_tao: What-ish I mean: https://gist.github.com/4272959
<mr-rich> foucist: thank you ... Not my system ... can't install any gems ...
x82_nicole has quit [Quit: Computer has gone to sleep.]
<havenn> pewter_tao: Oh, btw, instead of if !this do unless this.
<pewter_tao> don't all the next ifs need to be on one line? or else we'll miss files... It's not a loop
wargasm has left #ruby [#ruby]
robotmay has quit [Remote host closed the connection]
<foucist> mr-rich: ahh, i remember, STDIN.noecho(&:gets)
andalf__ is now known as andalf
skcin7 has joined #ruby
<foucist> mr-rich: you might need to require 'io/console' but its standard
tomsthumb has quit [Quit: Leaving.]
<foucist> mr-rich: password = STDIN.noecho(&:gets)
<havenn> pewter_tao: Nope, each next could be on its own line. The first one it hits goes to next file.
fir_ed has quit [Ping timeout: 260 seconds]
postmodern has joined #ruby
banjara has quit [Ping timeout: 250 seconds]
<havenn> pewter_tao: It is in a loop (well a block, an #each block)
<mr-rich> foucist: thanks ...
freeayu has joined #ruby
NiteRain has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<foucist> mr-rich: ruby 1.9.3, need to require 'io/console'
<havenn> pewter_tao: It won't proceed past the first 'next', just go to the next Dir file.
<pewter_tao> havenn: you're still putting file.readline before anything
<pewter_tao> so it'll die on size zero files, dirs, etc etc
<Paradox> wow
<Paradox> i feel so dumb
<havenn> pewter_tao: That is a good point.
<Paradox> i was fighting with a gsub all afternoon
<Paradox> wondering why a reference wasnt being included in the final string
<Paradox> i just realized i used ""
<pewter_tao> havenn: yeah I been at this script a while
<Paradox> instead of ''
<pewter_tao> I get undefined local variable or method `line' for CheckFiles:Module (NameError)
<Paradox> (double vs single, Q vs q)
<havenn> pewter_tao: https://gist.github.com/4272959
<havenn> pewter_tao: CheckFiles's #run method needs extract-method refactoring badly! :)
pu22l3r has quit [Remote host closed the connection]
<pewter_tao> havenn: I'm trying to keep up with your new design, but I'm not sure how it works yet
mercwithamouth has joined #ruby
jrist is now known as jrist-afk
<pewter_tao> havenn: check_language undefined for [long file name]
<havenn> pewter_tao: odd
reppard_ has quit [Ping timeout: 276 seconds]
reppard has quit [Ping timeout: 276 seconds]
<pewter_tao> mine was just about to work completely... But it just didn't have logic to do it per lang_type
<havenn> Gotta grab food. Back later. JDub: I need to look at Euler prob 12! I haven't gone through Euler.
LouisGB has quit [Ping timeout: 252 seconds]
andalf has quit [Remote host closed the connection]
<pewter_tao> I went through huge dirs and all files were processed wtihout error
gyre007 has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
tjbiddle has joined #ruby
fir_ed has joined #ruby
tjbiddle_ has joined #ruby
reppard has joined #ruby
reppard_ has joined #ruby
headius has quit [Quit: headius]
tjbiddle has quit [Ping timeout: 244 seconds]
tjbiddle_ is now known as tjbiddle
jenrzzz has quit [Ping timeout: 264 seconds]
banjara has joined #ruby
<mr-rich> foucist: Worked like a charm ... thanks again ...
apok has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
marco has joined #ruby
tvw has quit [Ping timeout: 246 seconds]
jaygen has joined #ruby
Muz has quit [Ping timeout: 260 seconds]
includex has quit [Quit: Leaving...]
<pewter_tao> any idea what causes this: undefined method `extname' for filename
davidcelis has quit [Quit: K-Lined.]
fyolnish has joined #ruby
DaZ has quit [Ping timeout: 246 seconds]
reset has joined #ruby
ryanjh has quit [Quit: Computer has gone to sleep.]
<pewter_tao> Paradox: ideas?
S3kx has joined #ruby
rodasc has joined #ruby
asdfqwer has joined #ruby
asdfqwer has quit []
infinitiguy2 has joined #ruby
<pewter_tao> no one there...
<pewter_tao> ?
locriani has joined #ruby
<yaymukund> that looks like a syntax error. should be easy to debug. do you have any context? what have you tried?
ohcibi_ has joined #ruby
<yaymukund> er, not a syntax error, but still
<pewter_tao> it's basically from here https://gist.github.com/4272959
DaZ has joined #ruby
<pewter_tao> havenn never tried to run it
cableray has quit [Quit: cableray]
array has joined #ruby
<pewter_tao> yaymukund: there's something wrong with the logic, but I don't see where
faulkner- has joined #ruby
array is now known as Guest2094
<pewter_tao> It basically returns nothing or it finds a file it doesn't like
Drager_ has joined #ruby
nimred_ has joined #ruby
dross_ has joined #ruby
headius has joined #ruby
nick_h_ has joined #ruby
matti_ has joined #ruby
<yaymukund> q;q
rasmusth_ has joined #ruby
Kudos_ has joined #ruby
tommylom1ykins has joined #ruby
<yaymukund> oops, that was meant for vim :p
undyingr1ge has joined #ruby
wmoxam_ has joined #ruby
crodas has quit [Quit: Disconnecting from stoned server.]
Eiam has quit [Read error: Connection reset by peer]
infinitiguy has quit [Ping timeout: 264 seconds]
Kudos has quit [Ping timeout: 264 seconds]
swarley-freenode has quit [Ping timeout: 264 seconds]
bluehavana has quit [Ping timeout: 264 seconds]
percival_ has quit [Ping timeout: 264 seconds]
spanx__ has quit [Ping timeout: 264 seconds]
Drager has quit [Ping timeout: 264 seconds]
nick_h has quit [Ping timeout: 264 seconds]
dross has quit [Ping timeout: 264 seconds]
matti has quit [Ping timeout: 264 seconds]
nimred has quit [Ping timeout: 264 seconds]
wmoxam has quit [Ping timeout: 264 seconds]
rasmusth has quit [Ping timeout: 264 seconds]
Guest79672 has quit [Ping timeout: 264 seconds]
inimino has quit [Ping timeout: 264 seconds]
faulkner has quit [Ping timeout: 264 seconds]
tommylommykins has quit [Ping timeout: 264 seconds]
S2kx has quit [Ping timeout: 264 seconds]
undyingrage has quit [Ping timeout: 264 seconds]
ohcibi has quit [Ping timeout: 264 seconds]
xargoon has quit [Ping timeout: 264 seconds]
Kudos_ is now known as kudos
faulkner- is now known as faulkner
matti_ is now known as matti
kudos has quit [Changing host]
kudos has joined #ruby
<Paradox> heroku's throwing h99 errors for me
<Paradox> but status page doesnt show anything
<Paradox> :(
tommylom1ykins is now known as tommylommykins
Tarso has joined #ruby
<pewter_tao> yaymukund: make sense?
marco has quit [Quit: WeeChat 0.3.8]
inimino has joined #ruby
pu22l3r has joined #ruby
<Tarso> hello... is there any way I can generate a .exe file from a ruby script?
chrisja has quit [Quit: leaving]
<foucist> Tarso: yeah, there's a couple compilers.. also check out https://github.com/shoes/shoes4
<yaymukund> pewter_tao: you have some code, it throws that error somewhere in that gist, you're convinced there's a bug in the logic but don't know where. is that basically it? lol
pu22l3r has quit [Remote host closed the connection]
<Tarso> ty ;)
<foucist> Tarso: shoesrb.com basically lets you make a gui oriented ruby app
<pewter_tao> yaymukund: line 11, it's having issues with files that aren't the right extension
<pewter_tao> it's just supposed to rule them out
emmanuelux has quit [Remote host closed the connection]
<pewter_tao> yaymukund: did you see the error I pasted?
Seich is now known as seich
swarley-freenode has joined #ruby
manizzle has joined #ruby
SCommette has quit [Quit: SCommette]
andalf has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
<pewter_tao> I'm stuck
freakazoid0223 has quit [Quit: Leaving]
<yaymukund> what have you tried?
xargoon has joined #ruby
<yaymukund> I saw the error, what class is filename?
<pewter_tao> what class is filename?
<pewter_tao> what does that mean?
<pewter_tao> there's only one class...
Shamgar has quit [Ping timeout: 248 seconds]
taoru has joined #ruby
<pewter_tao> yaymukund: so?
squidBits has joined #ruby
Muz has joined #ruby
Shamgar has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
lmickh has quit [Remote host closed the connection]
banjara has quit [Quit: Leaving.]
dross_ is now known as dross
fir_ed has quit [Ping timeout: 244 seconds]
x82_nicole has joined #ruby
SCommette has joined #ruby
<pewter_tao> foucist: undefined method for extname when I write "@filename.extname"
jjbohn has joined #ruby
jjbohn has quit [Client Quit]
bradhe has quit [Remote host closed the connection]
rondale_sc has quit [Quit: rondale_sc]
samphippen has quit [Quit: Computer has gone to sleep.]
mneorr has quit [Remote host closed the connection]
mrsolo has quit [Quit: Leaving]
elico has quit [Quit: elico]
geeksir has joined #ruby
skaczor_ has joined #ruby
SCommette has quit [Quit: SCommette]
DaZ has quit [Ping timeout: 252 seconds]
marco has joined #ruby
ner0x has joined #ruby
meskyanichi has quit [Read error: Connection reset by peer]
meskyanichi has joined #ruby
meskyanichi has quit [Client Quit]
tps_ has quit [Quit: tps_]
swarley-freenode has quit [Ping timeout: 240 seconds]
geeksir has left #ruby ["Leaving"]
swarley-freenode has joined #ruby
tps_ has joined #ruby
krz has joined #ruby
joeycarm_ has quit [Remote host closed the connection]
reppard_ has quit [Ping timeout: 256 seconds]
reppard has quit [Ping timeout: 256 seconds]
skcin7 has quit [Ping timeout: 265 seconds]
atal421 has quit [Quit: atal421]
DaZ has joined #ruby
yaymukund has left #ruby [#ruby]
jjbohn has joined #ruby
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
art_man1 has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
rakl has quit [Quit: sleeping]
havenn has joined #ruby
maletor has joined #ruby
Virunga has quit [Remote host closed the connection]
definiv has joined #ruby
definiv has quit [Client Quit]
jsilver has quit [Read error: Connection reset by peer]
jsilver has joined #ruby
reppard has joined #ruby
reppard_ has joined #ruby
<reppard> .
shiin has quit [Quit: Computer has gone to sleep.]
ttt has joined #ruby
X-Jester has quit [Ping timeout: 260 seconds]
vlad_starkov has joined #ruby
<reppard> can anyone tell me how to create a method that can be chained to a class attribute?
<reppard> for example
blazes816 has quit [Quit: blazes816]
<reppard> say i have Year.month = "January", so i would have a setter method but i want to do something like: Year.month.number_of_days
<reppard> how can i set that up in my class?
voodoofish430 has quit [Quit: Leaving.]
johnmilton has quit [Quit: Leaving]
pu22l3r has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
gyre007 has joined #ruby
banjara has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
<reppard> ... like how you could call SomeObject.someAttribute.nil?
<reppard> extend the object class? =)
pewter_tao has quit [Ping timeout: 250 seconds]
squidBits has quit [Quit: squidBits]
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
gyre007 has quit [Ping timeout: 244 seconds]
icole has quit [Remote host closed the connection]
nari has joined #ruby
bel3atar has joined #ruby
bel3atar has left #ruby [#ruby]
iamjarvo has joined #ruby
cdt has joined #ruby
J-_-L has joined #ruby
yxhuvud has quit [Quit: Nettalk6 - www.ntalk.de]
mercwithamouth has quit [Ping timeout: 276 seconds]
yxhuvud has joined #ruby
vd0 has joined #ruby
kenneth has quit [Quit: kenneth]
scruple has joined #ruby
atal421 has joined #ruby
tjbiddle has joined #ruby
awaage has quit [Read error: Connection reset by peer]
dankest has quit [Quit: Leaving...]
tjbiddle_ has joined #ruby
joeycarmello has joined #ruby
tjbiddle has quit [Ping timeout: 260 seconds]
tjbiddle_ is now known as tjbiddle
chord has joined #ruby
<chord> Python > Ruby
jjbohn has quit [Quit: Leaving...]
Bosma has joined #ruby
pac1 has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
rondale_sc has joined #ruby
<reppard> haha come on chord
<reppard> anyone alive?
ryanlecompte has quit [Remote host closed the connection]
<seanstickle> Make the attribute an instance of another class.
<kirotan> ^_^
<seanstickle> Then define the method on the new class.
mercwithamouth has joined #ruby
fred909 has quit [Ping timeout: 252 seconds]
jjbohn has joined #ruby
tomsthumb has joined #ruby
<reppard> good call seanstickle
cdt has quit [Ping timeout: 260 seconds]
jjbohn has quit [Client Quit]
adamnbowen has quit [Quit: Textual IRC Client: www.textualapp.com]
dankest has joined #ruby
<reppard> so something like class Year; attr_accessor :month; def month @month = Month.new(blah)
<reppard> then class Month; def self.number_of_days
nazty has joined #ruby
<seanstickle> Yup.
<reppard> thank you that makes perfect sense
<seanstickle> Happy to help.
Ihavenopants has joined #ruby
chussenot has joined #ruby
joeycarmello has quit [Remote host closed the connection]
Hanmac1 has joined #ruby
brianpWins has joined #ruby
vd0 has quit [Quit: WeeChat 0.3.9.2]
mercwithamouth has quit [Ping timeout: 252 seconds]
Hanmac has quit [Ping timeout: 264 seconds]
seich is now known as Seich
Russell^^ has quit [Quit: Russell^^]
cableray has joined #ruby
vd0 has joined #ruby
kenneth has joined #ruby
es_902a_ has joined #ruby
<Ihavenopants> How do I get started with test/unit? I am looking at code examples with bundles that are already set up and I just want to start writing some of my own tests to play with my own code.
<chord> reppard you mad that Python > Ruby?
mercwithamouth has joined #ruby
<shevy> chord you should learn at least one of these fine languages first
<es_902a_> I have not had much luck so I hope someone can help. I have a file ftp://ftp.sec.gov/edgar/data/1000045/0001193125-12-462945.txt that contains other files embedded in the text file and I'm trying to figure out how to render the images and other files within the text file. Any help apprecaited
hackerdude has quit [Remote host closed the connection]
Ihavenopants has left #ruby ["Leaving"]
<seanstickle> es_902a_: what do you mean "how to render the images" ?
tommyvyo_ has joined #ruby
<reppard> hey seanstickle, i tried that method but i end up getting cant change value of self
<reppard> how do i set the value of the class instance without creating yet another attribute inside the othe class
<seanstickle> reppard: show code
<es_902a_> seanstickle: I'm trying to build them I guess. I need to parse out the files and save them to disk so my HTML page can open them.
<reppard> k, let me whip somethign up real quick, ive been hammering in irb
maletor has joined #ruby
altious has quit [Ping timeout: 260 seconds]
lectrick__ has joined #ruby
lectrick has quit [Ping timeout: 246 seconds]
fcoury has quit [Ping timeout: 246 seconds]
chimkan has joined #ruby
fcoury has joined #ruby
<reppard> so something like that produces wrong number of args obviously
<seanstickle> es_902a_: well, the problem with the images is that they don't have any host name to look for
apok has quit [Quit: apok]
<reppard> but if i leave out the arg in the setter and do something like year = Year.new; then year.month = "Jan" its going to return nil
<seanstickle> Why is number of days a class method?
<seanstickle> You're calling "new". You'll want number of days to be an instance method
<reppard> i want to call year.month.number_of_days
<seanstickle> So?
fir_ed has joined #ruby
havenn has joined #ruby
<reppard> if i do an instance wouldn't it have to be something like year.month.month.number_of_days ?
<seanstickle> Uh… no.
havenn has quit [Read error: Connection reset by peer]
<reppard> alright i think i see my mistake
kiyoura has quit [Quit: Leaving]
havenn has joined #ruby
hotovson has quit [Remote host closed the connection]
<es_902a_> seanstickle: Search for "<FILENAME>" The images are not even files. The are just embedded text in the text document. I need to extract the text within the <FILENAME> tag and create a file with it.
_alejandro has quit [Remote host closed the connection]
undersc0re97 has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
<es_902a_> seanstickle: a host at this point, from what I understand is only after the files are created and saved. Am I missing something?
<seanstickle> es_902a_: That doesn't make a whole lot of sense. Of course the images aren't files… they are links to images.
rondale_sc has quit [Ping timeout: 255 seconds]
<seanstickle> Except the host/domain is missing.
chord has left #ruby [#ruby]
vlad_starkov has joined #ruby
agarie has joined #ruby
chriskk has joined #ruby
<seanstickle> Of course, it only looks like there is one IMG tag in the file.
odin_ has quit [Ping timeout: 252 seconds]
<es_902a_> seanstickle: did you look through the whole document? Please search for "begin 644 g402577g29c33.jpg" and I think you'll understand what I mean.
<seanstickle> I read the whole thing, yes.
<seanstickle> Ah… interesting
<reppard> seanstickle: that worked
<seanstickle> Now I see
<reppard> could i ask you one more question?
<seanstickle> es_902a_: what's the encoding?
rippa has quit [Ping timeout: 265 seconds]
<seanstickle> reppard: probably
<seanstickle> UUencoding, eh?
<seanstickle> Interesting
<es_902a_> seanstickle: I'm not sure, is there a way to find out?
<seanstickle> It's UUencoding
brax4444 has quit [Ping timeout: 255 seconds]
digitalcakestudi has quit [Quit: Leaving.]
<es_902a_> seanstickle: how did you figure it out?
<seanstickle> es_902a_: I'm all sorts of smart.
<seanstickle> Also, old.
<es_902a_> seanstickle : :)
<reppard> so i set year.month = "Jan" and in the Month class i initialize that with @name
<seanstickle> base xxx is the standard opening for a UUencoded file
<reppard> how can i make year.month return the string @name and not the object when its called
maletor has quit [Quit: Computer has gone to sleep.]
<reppard> i promise i googled endlessly on this crap and all i came up with was some metaprogramming jazz
dankest has quit [Quit: Linkinus - http://linkinus.com]
vlad_starkov has quit [Ping timeout: 252 seconds]
chimkan has quit [Quit: chimkan]
<ddd> year.month.to_s doesn't do it?
<es_902a_> seanstickle: so now that we know it's UUencoding, how do we create the flie?
<es_902a_> file
<reppard> ddd nah, still returns the object
<seanstickle> es_902a_: parse the file, take the UUencoded bit, and convert it with Ruby's unpack method
andalf has quit [Remote host closed the connection]
greenarrow has quit [Quit: IRC is just multiplayer notepad]
jsilver has quit [Read error: Connection reset by peer]
<es_902a_> seanstickle: do I need the begin and end parts text in the section to create the file?
<es_902a_> or should I not include it
<seanstickle> ?
spanx__ has joined #ruby
percival_ has joined #ruby
bluehavana has joined #ruby
<es_902a_> seanstickle: in the <text> tage where the bit is, it starts with "begin 644 g402577g29c33.jpg" and ends with "end" I did not know if I need it or should remove it when I try to unpack it
<seanstickle> Remove it
headius has quit [Quit: headius]
<es_902a_> seanstickle: thanks, As a test, would there be a problem copying it and pasting into a ruby stript and unpacking the pasted code?
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<seanstickle> es_902a_: Try it
<es_902a_> seanstickle: fair enough, I am right now :)
hackerdude has joined #ruby
NYRelics has joined #ruby
wallerdev has quit [Quit: wallerdev]
Tarso has quit [Remote host closed the connection]
guns has quit [Ping timeout: 252 seconds]
chimkan has joined #ruby
SeoxyS has joined #ruby
mneorr has joined #ruby
<es_902a_> seanstickle:when I try to set the UUencoded bit to a variable, the command does not finish. I did, UUdata=".." with .. being the UUencoding. However it does not set the command. Do I need to escape anything? I'm thinking the "`" at the end is causing trouble.
kenneth has quit [Ping timeout: 244 seconds]
SeoxyS is now known as kenneth
nyrb has joined #ruby
Loaft has joined #ruby
jlwestsr has quit [Quit: Ex-Chat]
chimkan__ has joined #ruby
Chryson has joined #ruby
DaZ has quit [Ping timeout: 276 seconds]
Rym has joined #ruby
chimkan has quit [Ping timeout: 245 seconds]
chimkan__ is now known as chimkan
rellin has joined #ruby
cantonic_ has joined #ruby
chimkan_ has joined #ruby
cantonic_ is now known as cantonic
alexim has quit [Quit: sleep]
DaZ has joined #ruby
chimkan has quit [Ping timeout: 244 seconds]
chimkan_ is now known as chimkan
chussenot has quit [Quit: chussenot]
Gooder has joined #ruby
theRoUS has quit [Ping timeout: 276 seconds]
rakl has joined #ruby
adeponte has quit [Remote host closed the connection]
guns has joined #ruby
undersc0re97 has quit [Ping timeout: 265 seconds]
browndawg has joined #ruby
<es_902a_> seansickle: So far you've been a great help. However, I keep getting the following error... syntax error, unexpected $undefined, expecting $end M.C0Q``````.@`0`#`````0`!``"@`@`$`````0```#N@`P`$`````0```"T` Any ideas how to prevent it?
<es_902a_> seanstickle: hear is my code, but I'm having trouble. Any recommendation would help, you are very wise! http://pastie.org/5518811
<es_902a_> hear=here
SCommette has joined #ruby
rakl has quit [Quit: sleeping]
Rym has quit [Quit: Rym]
ryanh has joined #ruby
SCommette has quit [Client Quit]
segmond__ has joined #ruby
Gooder has quit [Remote host closed the connection]
SCommette has joined #ruby
Gooder has joined #ruby
jjbohn has joined #ruby
<seanstickle> es_902a_: https://gist.github.com/4273861
uuair has joined #ruby
joeycarmello has joined #ruby
theRoUS has joined #ruby
art_man1 has quit [Quit: art_man1]
regedarek has quit [Remote host closed the connection]
art_man1 has joined #ruby
Juul has joined #ruby
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
alvaro_o has quit [Quit: Ex-Chat]
fir_ed has quit [Ping timeout: 256 seconds]
joeycarmello has quit [Ping timeout: 252 seconds]
axl_ has joined #ruby
segmond__ has quit [Quit: Leaving]
<axl_> hey guys, is there any elegant way i can do that ^
pu22l3r has quit [Remote host closed the connection]
skaczor has quit [Ping timeout: 246 seconds]
<seanstickle> axl_: Hash["x", 1, "y", 2, "z", 3]
skaczor_ has quit [Ping timeout: 255 seconds]
<axl_> seanstickle: thanks for replying
<es_902a_> seanstickle: you are so awesome! Thank You! next step, how does it become a file? i'm sorry, I'm just such a newbie!
<axl_> i actually trying to assign values from an array to a hash
<axl_> so it is not hardcoded
<axl_> (For some weird reason the gist doesn't show up right)
<seanstickle> es_902a_: File.open("foo", "w") {|f| f.print U1_unpacked }
<epwhorl> axl_,
DaZ has quit [Ping timeout: 276 seconds]
<axl_> epwhorl: thanks. so if x, y, and z weren't the keys, say it was random like, length, breadth and height, then i would have to assign each one individually?
<es_902a_> seanstickle: I can't thank you enough! thank you!
<seanstickle> es_902a_: sure thing
doug has joined #ruby
<doug> i've got a bunch of the same type of objects, and i want an array containing the value given by one particular method
<doug> what's the shortest way to write that?
<seanstickle> axl_: a = ["x", "y", "z"]; b = [1, 2, 3]; a.zip(b).reduce({}){|a,x| a[x[0]] = x[1]; a }
<seanstickle> axl_: then you're free to do what you like with the arrays
<banisterfiend> doug: array.map(&:sup)
<es_902a_> seanstickle: i'm going to work on parsing now, can you recommend any place I can read up on it? I'm thinking the best method is Regex. Any input?
<doug> banisterfiend++
<epwhorl> yeah that works
<seanstickle> es_902a_: Nokogiri is what you want
<seanstickle> es_902a_: avoid regexes
<seanstickle> es_902a_: for this
<axl_> seanstickle: wow! ill try looking into that
<doug> banisterfiend++
<doug> also, nice blog
doug has left #ruby [#ruby]
<es_902a_> seanstickle: thank you! I'll do that
brianpWins has quit [Quit: brianpWins]
Slivka has joined #ruby
crueber_ has joined #ruby
browndawg has quit [Quit: Leaving.]
nanothief has joined #ruby
crueber_ has quit [Remote host closed the connection]
SCommette has quit [Quit: SCommette]
DaZ has joined #ruby
<axl_> seanstickle: i think I am going to do a Hash[a.zip(b)]
InFlames has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
Vert has quit [Remote host closed the connection]
jjbohn has quit [Quit: Leaving...]
<seanstickle> axl_: even better
phipes has joined #ruby
theRoUS has quit [Ping timeout: 245 seconds]
IceDragon has quit [Quit: Space~~~]
squidBits has joined #ruby
stkowski has quit [Quit: stkowski]
cyong has joined #ruby
es_902a_ has quit [Quit: Page closed]
cj3kim has joined #ruby
reppard has quit [Ping timeout: 256 seconds]
reppard_ has quit [Ping timeout: 244 seconds]
tommyvyo_ has quit [Quit: http://thomasvendetta.com]
freeayu has quit [Read error: Connection reset by peer]
freeayu has joined #ruby
wargasm1 has joined #ruby
_alejandro has joined #ruby
theRoUS has joined #ruby
rippa has joined #ruby
chussenot has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
hemanth_ has joined #ruby
mneorr has quit [Remote host closed the connection]
Gooder` has joined #ruby
Gooder has quit [Read error: Connection reset by peer]
jjustice_ has joined #ruby
squidBits has quit [Quit: squidBits]
otters has joined #ruby
cakehero has quit [Quit: Leaving...]
epwhorl has quit [Ping timeout: 244 seconds]
wargasm1 has quit [Ping timeout: 248 seconds]
jjustice_ is now known as epwhorl
jjbohn has joined #ruby
baroquebobcat has joined #ruby
jjbohn has quit [Client Quit]
wargasm has joined #ruby
mneorr has joined #ruby
tjbiddle_ has joined #ruby
noric has joined #ruby
tjbiddle has quit [Ping timeout: 260 seconds]
tjbiddle_ is now known as tjbiddle
<noric> Is it possible to use Enumerable#include when the Enumerable is yielding pairs? { :foo => "bar" }.each_pair.include? # ????
DatumDrop has joined #ruby
lwhalen has joined #ruby
<lwhalen> hey all, I'm trying to install the ruby-bdb gem on a RedHat 5.8 box with Ruby Enterprise 1.8.7, and it's giving me very strange compile errors
noric has quit [Quit: Disconnecting]
<lwhalen> I've got RedHat's db4-devel package installed, so I should have all the source libraries needed
noric has joined #ruby
<lwhalen> but I'm still getting: bdb.c:85: error: 'DB_REP_LEASE_EXPIRED' undeclared (first use in this function)
<lwhalen> among other similar messages
<noric> Is it possible to use Enumerable#include when the Enumerable is yielding pairs? { :foo => "bar" }.each_pair.include? #?
mneorr has quit [Remote host closed the connection]
<idzuna> noric: I don't believe you can combine those two directly like that, is it possible that {...}.has_key? or .has_value? would be appropriate for what you want to do?
tjbiddle has quit [Quit: tjbiddle]
<noric> idzuna: I have solved this by substituting each_pair.to_a.include? [:foo,"bar"]
<banisterfiend> noric: what exactly r u trying to do
<noric> ty
<banisterfiend> oh ok
<noric> in rspec2, check if my operation included a pair in a set :)
<idzuna> noric: ah, I see :] glad you sorted it out!
<noric> thanks for responding!
seanstickle has quit [Quit: seanstickle]
SCommette has joined #ruby
beachandbytes has joined #ruby
DatumDrop has quit [Ping timeout: 244 seconds]
SCommette has quit [Client Quit]
devians has left #ruby [#ruby]
ner0x has quit [Quit: Leaving]
sandGorgon has joined #ruby
browndawg has joined #ruby
chussenot has quit [Quit: chussenot]
ejholmes has quit [Quit: ejholmes]
manizzle has quit [Remote host closed the connection]
ejholmes has joined #ruby
elkclone has joined #ruby
MissionCritical has quit [Ping timeout: 260 seconds]
ananthakumaran has joined #ruby
bairui has quit [Ping timeout: 265 seconds]
reset has quit [Quit: Leaving...]
apok has joined #ruby
a_a_g has joined #ruby
browndawg has left #ruby [#ruby]
generalissimo has joined #ruby
Fretta has quit [Quit: Fretta]
DatumDrop has joined #ruby
J-_-L has quit [Quit: Leaving.]
apok has quit [Quit: apok]
DaZ has quit [Ping timeout: 244 seconds]
Mission-Critical has joined #ruby
mahmoudimus has quit [Ping timeout: 265 seconds]
agarie has quit [Remote host closed the connection]
chimkan has quit [Quit: chimkan]
tjbiddle has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
agarie has joined #ruby
sr___ has left #ruby [#ruby]
DaZ has joined #ruby
generalissimo has quit [Read error: Connection reset by peer]
generali_ has joined #ruby
Mission-Critical is now known as MissionCritical
c0rn has joined #ruby
sn0wb1rd has joined #ruby
generali_ is now known as generalissimo
x82_nicole has quit [Quit: Computer has gone to sleep.]
phipes_ has joined #ruby
davidcelis has joined #ruby
[1]SoonerBourne has joined #ruby
a_a_g has quit [Quit: Leaving.]
bairui has joined #ruby
jsilver has joined #ruby
phipes has quit [Ping timeout: 245 seconds]
phipes_ is now known as phipes
SCommette has joined #ruby
SoonerBourne has quit [Ping timeout: 240 seconds]
[1]SoonerBourne is now known as SoonerBourne
InFlames has quit [Remote host closed the connection]
beachandbytes2 has joined #ruby
beachandbytes has quit [Disconnected by services]
adeponte has joined #ruby
beachandbytes2 is now known as beachandbytes
CaptainJet has quit []
art_man1 has quit [Quit: art_man1]
banisterfiend has quit [Ping timeout: 248 seconds]
axl_ has quit [Quit: axl_]
xnm has joined #ruby
mascool has quit [Ping timeout: 265 seconds]
banisterfiend has joined #ruby
ananthakumaran has joined #ruby
apok has joined #ruby
d2dchat has joined #ruby
mikepack has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
marco has quit [Ping timeout: 260 seconds]
agarie has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
ader10 has left #ruby ["Leaving"]
cj3kim has quit [Quit: This computer has gone to sleep]
burgestrand has quit [Quit: Leaving.]
c0rn has quit [Quit: Computer has gone to sleep.]
cj3kim has joined #ruby
samuel02 has joined #ruby
a_a_g has joined #ruby
gbchaosmaster has quit [Ping timeout: 264 seconds]
tjbiddle has quit [Quit: tjbiddle]
rohit has joined #ruby
uuair has quit [Quit: uuair]
samuel02 has quit [Remote host closed the connection]
JohnBat26 has joined #ruby
d2dchat has quit [Remote host closed the connection]
Hanmac has joined #ruby
ryanf has quit [Quit: leaving]
xpen has joined #ruby
rohit has quit [Quit: Leaving]
stkowski has joined #ruby
Yarou has joined #ruby
Yarou has joined #ruby
Yarou has quit [Changing host]
stkowski has quit [Client Quit]
apok has quit [Quit: apok]
elsifaka has joined #ruby
xpen has quit []
Yarou_ has quit [Ping timeout: 260 seconds]
xpen has joined #ruby
nilg has joined #ruby
dawkirst_ has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
squidBits has joined #ruby
squidBits has quit [Client Quit]
squidBits has joined #ruby
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
banjara has quit [Client Quit]
ChampS666 has joined #ruby
banjara has joined #ruby
tagrudev has joined #ruby
banjara has quit [Client Quit]
banjara has joined #ruby
karakedi has joined #ruby
banjara has quit [Quit: Leaving.]
kevinykchan has quit [Quit: Computer has gone to sleep.]
banjara has joined #ruby
hukl has joined #ruby
rohit has joined #ruby
ryanf has joined #ruby
LiquidInsect has quit [Ping timeout: 260 seconds]
mikepack has quit [Remote host closed the connection]
apok has joined #ruby
mercwithamouth has quit [Ping timeout: 260 seconds]
rohit has quit [Quit: Leaving]
Guest26587 has joined #ruby
mahmoudimus has joined #ruby
x82_nicole has joined #ruby
tps_ has quit [Read error: Connection reset by peer]
BoomCow has joined #ruby
apok has quit [Quit: apok]
tps__ has joined #ruby
tps__ has quit [Read error: Connection reset by peer]
tps_ has joined #ruby
burgestrand has joined #ruby
PeterL has joined #ruby
<PeterL> Hi Guys
PeterL is now known as Guest65511
morf has joined #ruby
LiquidInsect has joined #ruby
altious has joined #ruby
tps_ has quit [Read error: Connection reset by peer]
SCommette has quit [Quit: SCommette]
Guest65511 is now known as Peter10000
tps_ has joined #ruby
rippa has quit [Ping timeout: 244 seconds]
<Beoran_> hi Peter10000
<Beoran_> ask away
<Peter10000> ok ^^
<Peter10000> I have a sinatra(Webrick) app running
Guest26587 has left #ruby [#ruby]
<Peter10000> and try to get the client user name i.e. Windows login user.
<Peter10000> So far i tried etc and with ENV[HTTP...] but always get back the the servers user name
huoxito has quit [Quit: Leaving]
<Peter10000> I know it's more complicated and probably have to use LDAP(?) to get it, but i thought someone had a easier solution to this
tagrudev has quit [Remote host closed the connection]
rippa has joined #ruby
tagrudev has joined #ruby
<Peter10000> so before we had a .net app to do this, but we migrated now to a unix env, and search a solution to do this
arturaz_ has joined #ruby
altious has quit [Read error: Connection reset by peer]
altious has joined #ruby
<Peter10000> any idea, Beoran?
<Peter10000> i can post the .net code if you want
ttt has quit [Remote host closed the connection]
charliesome has joined #ruby
iamjarvo has quit [Quit: Leaving.]
atal421 has quit [Quit: atal421]
yacks has quit [Read error: Connection reset by peer]
cyong has quit [Quit: Leaving.]
samuel02 has joined #ruby
osvico has quit [Ping timeout: 250 seconds]
h4mz1d has joined #ruby
ryanf has quit [Quit: leaving]
maesbn has joined #ruby
epwhorl has quit [Quit: tonight I dine on turtle soup]
altious has quit [Read error: Connection reset by peer]
altious has joined #ruby
reset has joined #ruby
reset has quit [Client Quit]
<arturaz_> morning
<arturaz_> don't you just hate winter...
locriani has quit [Ping timeout: 264 seconds]
dmiller_ has joined #ruby
Mon_Ouie has joined #ruby
rippa has quit [Ping timeout: 248 seconds]
locriani has joined #ruby
dmiller has quit [Ping timeout: 246 seconds]
dmiller_ has quit [Remote host closed the connection]
hackerdude has quit [Remote host closed the connection]
kzrl has quit [Ping timeout: 276 seconds]
ttt has joined #ruby
darthdeus has joined #ruby
<Beoran_> Peter10000, hmmm, I think you'l need LDAP
<Beoran_> or SAMBA
<Beoran_> it's not tha thard to use, LDAP
<Beoran_> I di d it before
<Beoran_> the hardest part is setting up the ldap server correctly
kzrl has joined #ruby
<Peter10000> the legacy app is using ldap already but I can't wrap my head around it, but thanks ^^
becom33 has quit [Ping timeout: 260 seconds]
<Peter10000> ok gotta go now, thanks for the advice again. bye
Peter10000 has quit [Quit: Page closed]
hukl has quit [Quit: Linkinus - http://linkinus.com]
squidBits has quit [Ping timeout: 255 seconds]
marknyc has quit []
ryanf has joined #ruby
chrishunt has joined #ruby
BoomCow has quit [Quit: This computer has gone to sleep]
zommi has joined #ruby
teacher_room has joined #ruby
vlad_starkov has joined #ruby
chrishunt has quit [Client Quit]
generalissimo has quit [Remote host closed the connection]
x82_nicole has quit [Quit: Computer has gone to sleep.]
wikiziner has joined #ruby
<sandGorgon> hi guys - new to ruby. Could someone tell me which of rbenv vs rvm to use ? I'm kinda confused on which one to with in the long term.
wikiziner has quit [Remote host closed the connection]
<postmodern> sandGorgon, first ask what you want to use them for?
squidBits has joined #ruby
vlad_starkov has quit [Read error: Operation timed out]
<Beoran_> sandGorgon, you may not even need either
<Hanmac> sandGorgon use an system with has ruby1.9.3 as default or switch the default
<Beoran_> if you don't need jruby nor rubinius, then just go for the latest version of MRI (1.9.3)
<sandGorgon> fair enough - however most debian 6 installations dont come with Ruby 1.9.3 - and the only instructions to set up such a VM is given around RVM or RBenv
<sandGorgon> Beoran_: I *am* planning to use jruby
<postmodern> sandGorgon, Fedora 17 comes with 1.9.3-p327
<Beoran_> debian is conservative
cibs has quit [Quit: leaving]
<postmodern> sandGorgon, also Ubuntu 12 has ruby1.9.1-full, which installs 1.9.2
<Beoran_> if you plan to use jruby then you'll need rbenv or rvm
jbw has quit [Ping timeout: 260 seconds]
<Beoran_> otherwise you'll have to do a lot of manual switching
<sandGorgon> postmodern: we use Debian 6 throughout
rezzack has quit [Quit: Leaving.]
<sandGorgon> Beoran_: that what I thought. any recommendations given that ?
<Beoran_> unless you plan to use *only* jruby
locriani has quit [Read error: Connection reset by peer]
<Beoran_> hmmm... it depends on what you want really
locriani has joined #ruby
<Beoran_> rvm is big and feature rich, rbenv is leaner , and there are other rby environment swotchers out there tha t are even more leightweight
<sandGorgon> Beoran_: ok - what should I be googling for if I want to make a decision ?
<Beoran_> hmmm "rvm versus rbenv"
<Beoran_> on google X versus Y is often good to se arguments agaisn or for something
eldariof has joined #ruby
<Beoran_> of course the results will be biased
<Beoran_> but you now that, so you can deal with that
jbw has joined #ruby
<sandGorgon> Beoran_: is there one which is more production friendly ? I know I'm being pathological, but lets say I have to live with multiple ruby versions on production machine - so what are the best practices around that
Morkel has joined #ruby
arkiver has joined #ruby
<Beoran_> sandGorgon, OK my best practise advice would be: don't do it
<Beoran_> if you need different ruby versions for different apps, it's easier to set up different servers
Juul has quit [Ping timeout: 250 seconds]
<Beoran_> on jruby and one rmri ruby for example
wallerdev has joined #ruby
<Beoran_> I wouln't rely on any of rvm or rbenv , etc for production
<Beoran_> since they are in varying degrees a bit of a hack
Xeago has joined #ruby
<Beoran_> only use them for development ease
reset has joined #ruby
<Beoran_> now if you disregard that ... I think somethin like rbenv wiould probabl ybe better since they say it's less intrusive, but I have no experience with it in production , so I'd strill reccomens ad agains trelying on that. In the end you will have to test the options for yourself.
<sandGorgon> Beoran_: lets say you had money only for one machine - how would you work with multiple ruby versions ?
<Beoran_> sandGorgon, use a thing caled "wvirtualization", it's hot these days
beachandbytes has quit [Ping timeout: 245 seconds]
<Beoran_> run several VM's on one macine
<Beoran_> really
<Beoran_> you should be running virtualized anyway these days
<wildcard0> i run a production system under rvm and we've never had a problem with it
cibs has joined #ruby
lwhalen has quit [Ping timeout: 252 seconds]
<Beoran_> wildcard0, good to hear that
xpen has quit [Ping timeout: 260 seconds]
<Beoran_> I'll let you explain the fine details to sandGorgon . I prefer to be conservative if I am not sure .
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Chryson has quit [Quit: Leaving]
tonini has joined #ruby
<wildcard0> ya, i certainly don't have proof that it won't fail. this is just anecdotal
<sandGorgon> wildcard0: any idea of the best practices around that ? it costs money to go beyond one machine and I do need to plan for multiple ruby versions as contingency
apeiros_ has quit [Remote host closed the connection]
tungd has joined #ruby
<wildcard0> so i run stuff under unicorn
dmiller has joined #ruby
lwhalen has joined #ruby
Xeago has quit [Remote host closed the connection]
<wildcard0> i do rvm 1.9.3@mygems exec unicorn -D -E ${ENV} -c ${APP_ROOT}/config/unicorn_config.rb
geeksir has joined #ruby
reset has quit [Quit: Leaving...]
<sandGorgon> wildcard0: writing this stuff down.... is unicorn serving you well both for dev (reload,etc.) and for production under rvm ?
reset has joined #ruby
<wildcard0> for staging, yes. for dev, we all do what we want on our own boxes
<wildcard0> but it has to work with tests and it has to work on staging before it goes anywhere near prod
Juul has joined #ruby
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby
teacher_room has quit [Ping timeout: 245 seconds]
blaxter has joined #ruby
dmiller has quit [Ping timeout: 244 seconds]
jsilver has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
squidBits has quit [Quit: squidBits]
ChampS666 has quit [Ping timeout: 244 seconds]
mafolz has joined #ruby
banjara has quit [Quit: Leaving.]
JDubs has quit [Ping timeout: 276 seconds]
banjara has joined #ruby
phipes has left #ruby [#ruby]
rhys has quit [Quit: Leaving]
wallerdev has quit [Quit: wallerdev]
lolmaus has joined #ruby
grn has joined #ruby
<sandGorgon> wildcard0: do u create a separate user which runs under rvm ? or is this a unicorn commandline running as a daemon under "root" ?
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
wallerdev has joined #ruby
codecaster has joined #ruby
<wildcard0> sandGorgon: it runs under its own user
<wildcard0> dont run anything as root if you can help it
zigomir has joined #ruby
<sandGorgon> wildcard0: I googled but could not find any info on how one runs a production service under rvm with its own user ? Do you have a pastebin on how to implement the service ?
guns has quit [Quit: guns]
<wildcard0> i'll grab one off a box. sec
<wildcard0> i just need to sanitize it a little
schaerli has joined #ruby
h4mz1d has quit [Ping timeout: 245 seconds]
rakl has joined #ruby
Proshot has joined #ruby
mafolz has quit [Quit: mafolz]
Proshot is now known as statarb3
mafolz has joined #ruby
LouisGB has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
<wildcard0> sandGorgon: http://pastebin.com/HmYi6iL4
<wildcard0> bash snippet
Monie has quit [Read error: Connection reset by peer]
<sandGorgon> wildcard0: thanks!
<wildcard0> sure np
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
zmo_ has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
robotmay has joined #ruby
cezar has joined #ruby
matrixise has quit [Ping timeout: 250 seconds]
DatumDrop has quit [Remote host closed the connection]
samuel02 has quit [Remote host closed the connection]
banisterfiend has joined #ruby
piotr_ has joined #ruby
chriskk has quit [Read error: Connection reset by peer]
yacks has joined #ruby
<codecaster> what's the best lib to create commands?
<codecaster> thor maybe?
<ryanf> codecaster: it depends on how complicated you're planning to get. the built-in optparse library isn't bad
mvangala_ has joined #ruby
<codecaster> so if it has lots of options, etc thor would be better?
aces23up has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
<ryanf> if you are planning on building a significant-sized command-line application, thor might be a good idea
<ryanf> if you are just writing a script that needs to take arguments, it's probably overkill
malte_ has joined #ruby
<ryanf> imo
hakunin has quit [Remote host closed the connection]
lobak_ has joined #ruby
AndChat- has joined #ruby
hakunin has joined #ruby
<codecaster> ty
paolooo has joined #ruby
<codecaster> I will need thor then
apeiros_ has joined #ruby
Juul has quit [Ping timeout: 255 seconds]
mvangala has quit [Read error: Connection reset by peer]
Drewch has quit [Ping timeout: 265 seconds]
aces1up has quit [Read error: Connection reset by peer]
vd0 has quit [Ping timeout: 265 seconds]
JonnieCache has quit [Ping timeout: 265 seconds]
lkba has quit [Ping timeout: 265 seconds]
lobak has quit [Quit: No Ping reply in 180 seconds.]
bier has quit [Ping timeout: 265 seconds]
Drewch_ has joined #ruby
dantesun has quit [Ping timeout: 265 seconds]
mpereira has quit [Ping timeout: 265 seconds]
ozzloy has quit [Ping timeout: 265 seconds]
xnm has quit [Write error: Connection reset by peer]
ozzloy has joined #ruby
dmiller has joined #ruby
xnm has joined #ruby
Bosma has quit [Ping timeout: 276 seconds]
jimeh has joined #ruby
ryanf has quit [Quit: leaving]
timonv has joined #ruby
Bosma has joined #ruby
bier has joined #ruby
altious has quit [Ping timeout: 244 seconds]
sjhuang has quit [Ping timeout: 276 seconds]
dmiller has quit [Ping timeout: 260 seconds]
dantesun has joined #ruby
malte_ has quit [Quit: malte_]
sjhuang has joined #ruby
mpereira has joined #ruby
banisterfiend has quit [Ping timeout: 260 seconds]
pkeni has quit [Ping timeout: 248 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
jmkelly has joined #ruby
nemesit has joined #ruby
blacktulip has joined #ruby
Juul has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
zarubin has joined #ruby
chussenot has joined #ruby
zarubin has quit [Client Quit]
yacks has quit [Ping timeout: 255 seconds]
sepp2k has joined #ruby
Juul has quit [Read error: Connection reset by peer]
banjara has quit [Quit: Leaving.]
DatumDrop has joined #ruby
virtualentity has quit []
banjara has joined #ruby
dr_bob has joined #ruby
zarubin has joined #ruby
zarubin has quit [Client Quit]
sspiff has quit [Remote host closed the connection]
zarubin has joined #ruby
zarubin has quit [Client Quit]
Zai00 has joined #ruby
zarubin has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
ephemerian has joined #ruby
Mon_Ouie has quit [Ping timeout: 245 seconds]
heftig has joined #ruby
nomenkun has joined #ruby
Vainoharhainen has joined #ruby
robustus has joined #ruby
Loaft has quit [Read error: Connection reset by peer]
slainer68 has joined #ruby
rakl has quit [Quit: sleeping]
Iszak has joined #ruby
locriani_ has joined #ruby
fyolnish has quit [Remote host closed the connection]
locriani_ has quit [Client Quit]
locriani_ has joined #ruby
ABK has joined #ruby
locriani_ has quit [Client Quit]
locriani_ has joined #ruby
nari has quit [Ping timeout: 245 seconds]
locriani has quit [Ping timeout: 260 seconds]
locriani_ is now known as locriani
artm has joined #ruby
mneorr has joined #ruby
DatumDrop has quit [Ping timeout: 256 seconds]
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
lolmaus has quit [Read error: Connection reset by peer]
robustus has quit [Ping timeout: 255 seconds]
lolmaus has joined #ruby
banjara has quit [Client Quit]
ExxKA has joined #ruby
Juul has joined #ruby
banjara has joined #ruby
chussenot has quit [Quit: chussenot]
jenrzzz has joined #ruby
Xeago has joined #ruby
banisterfiend has joined #ruby
Juul has quit [Read error: Connection reset by peer]
ananthakumaran has joined #ruby
w|t has quit [Ping timeout: 246 seconds]
ExxKA has quit [Quit: This computer has gone to sleep]
banisterfiend has quit [Ping timeout: 264 seconds]
mneorr has quit [Remote host closed the connection]
timmow has joined #ruby
banisterfiend has joined #ruby
wereHamster has quit [Changing host]
wereHamster has joined #ruby
krz has quit [Quit: krz]
paolooo has quit [Quit: Page closed]
arturaz_ has quit [Remote host closed the connection]
tobinharris has joined #ruby
gyre007 has joined #ruby
xnm has quit []
banister_ has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
geeksir has quit [Quit: Leaving]
Juul has joined #ruby
DaZ has quit [Ping timeout: 255 seconds]
Juul has quit [Client Quit]
cdt has joined #ruby
cdt_ has joined #ruby
Drager_ is now known as Drager
elaptics`away is now known as elaptics
dmiller has joined #ruby
JonnieCache has joined #ruby
DaZ has joined #ruby
robustus has joined #ruby
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
s1n4 has joined #ruby
TIBS01 has quit [Remote host closed the connection]
gyre007 has quit [Remote host closed the connection]
cdt has quit [Ping timeout: 260 seconds]
dmiller has quit [Ping timeout: 246 seconds]
TIBS01 has joined #ruby
Xeago has quit [Ping timeout: 265 seconds]
NYRelics has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
jmkelly has quit [Ping timeout: 256 seconds]
TIBS01 has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
gyre007 has joined #ruby
TIBS01 has joined #ruby
cableray has quit [Quit: cableray]
codecaster has quit [Read error: Connection reset by peer]
codecaster has joined #ruby
JonnieCache has quit [Quit: leaving]
workmad3 has joined #ruby
greenarrow has joined #ruby
dawkirst_ has quit [Ping timeout: 276 seconds]
thone_ has joined #ruby
dawkirst_ has joined #ruby
tPl0ch has joined #ruby
jmkelly has joined #ruby
adambeynon has joined #ruby
thone has quit [Ping timeout: 276 seconds]
chussenot has joined #ruby
TIBS01 has quit [Ping timeout: 265 seconds]
dawkirst_ has quit [Ping timeout: 260 seconds]
banjara has quit [Quit: Leaving.]
lurch_ has joined #ruby
banjara has joined #ruby
DatumDrop has joined #ruby
AndChat- has quit [Ping timeout: 255 seconds]
adeponte has quit [Remote host closed the connection]
chriskk has joined #ruby
dawkirst_ has joined #ruby
TIBS01 has joined #ruby
matrixise has joined #ruby
hotovson_ has joined #ruby
EyesIsMine has quit [Quit: Leaving]
DatumDrop has quit [Ping timeout: 248 seconds]
ohcibi_ has left #ruby [#ruby]
ohcibi has joined #ruby
lwhalen has quit [Quit: Computer has gone to sleep]
beiter has joined #ruby
cdr255 has joined #ruby
VoiDeT has joined #ruby
EyesIsMine has joined #ruby
TIBS01 has quit [Remote host closed the connection]
<VoiDeT> Working with files, using Dir.foreach(dir), how do I get the path to each of the files this function returns?
Gooder` has quit [Read error: Connection reset by peer]
Gooder` has joined #ruby
TIBS01 has joined #ruby
fyolnish has joined #ruby
<nanothief> VoiDeT: Easiest way is to use Pathname, eg Pathname.new(dir).children.map(&:realpath).map(&:to_s)
<Hanmac> VoiDet: File.absolute_path(s)
tonini has quit [Remote host closed the connection]
<nanothief> (the last map isn't really required, since it is nice keeping paths in Pathnames
ExxKA has joined #ruby
<VoiDeT> Great thanks nanothief
ExxKA has quit [Client Quit]
<VoiDeT> Or is there a way for Dir.foreach to return the full path of the file, instead of just a file name, or should I just handle that
TIBS01 has quit [Ping timeout: 250 seconds]
cascalheira has joined #ruby
kil0byte has quit [Remote host closed the connection]
kil0byte has joined #ruby
<Hanmac> VoiDet: Dir["*"].map(&File.method(:absolute_path))
TIBS01 has joined #ruby
<VoiDeT> :D that is cool
codecaster has quit [Quit: Leaving.]
mengu has joined #ruby
kil0byte has quit [Ping timeout: 244 seconds]
banjara has quit [Quit: Leaving.]
yacks has joined #ruby
banjara has joined #ruby
jmkelly has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.2/20121025210744]]
nari has joined #ruby
Averna has joined #ruby
ExxKA has joined #ruby
timonv has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
banjara has quit [Client Quit]
sandGorgon has quit [Read error: Connection reset by peer]
dawkirst_ has quit [Ping timeout: 255 seconds]
banjara has joined #ruby
s1n4 has quit [Quit: leaving]
sandGorgon has joined #ruby
dawkirst_ has joined #ruby
reset has quit [Quit: Leaving...]
dmiller has joined #ruby
altious has joined #ruby
dcope has quit [Ping timeout: 245 seconds]
dcope has joined #ruby
kebomix has joined #ruby
dmiller has quit [Ping timeout: 246 seconds]
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
banjara has quit [Client Quit]
<kebomix> hi, i installed RubyTest Package, i upgraded ruby to 1.9.2 and RubyTest package still uses old (doesn't exist) Ruby 1.8 , here is the error /usr/bin/env: ruby1.8[Finished in 1.6s with exit code 127]: No such file or directory
io_syl has quit [Quit: Computer has gone to sleep.]
schaerli has quit [Remote host closed the connection]
malte_ has joined #ruby
tobinharris has quit [Quit: tobinharris]
cdt_ has quit [Quit: Ex-Chat]
cdt has joined #ruby
TIBS01 has quit [Remote host closed the connection]
TIBS01 has joined #ruby
<Hanmac> then there is an error in your env line ...
sie has quit [Ping timeout: 252 seconds]
shiin has joined #ruby
noric has quit [Read error: Connection reset by peer]
<kebomix> Hanmac: any idea how to fix it ?
<VoiDeT> ran into a weird behaviour. My File.directory?(dir) call thinks a folder named 20/20/2012 (on mac) is a file
grzywacz has joined #ruby
<Hanmac> kebomix use an newer OS and an newer ruby
<kebomix> Hanmac: ruby -v ruby 1.9.3p327 (2012-11-10 revision 37606) [i686-linux] , that is what confuses me :), i have a new Ruby version already installed and 1.8 doesn't exist
<Hanmac> then the rubytest package is shitty
zarubin has quit []
<kebomix> Hanmac: thanks :)
samuel02 has joined #ruby
zarubin has joined #ruby
beiter has quit [Ping timeout: 244 seconds]
TIBS01 has quit [Remote host closed the connection]
TIBS01 has joined #ruby
altious2 has joined #ruby
altious has quit [Ping timeout: 265 seconds]
berserkr has joined #ruby
kebomix has quit [Quit: Page closed]
TIBS01 has quit [Remote host closed the connection]
elkclone has quit [Ping timeout: 245 seconds]
altious2 has quit [Ping timeout: 256 seconds]
Sigma00 has quit [Ping timeout: 252 seconds]
TIBS01 has joined #ruby
rcj_ has quit [Ping timeout: 244 seconds]
telling has quit [Ping timeout: 255 seconds]
ikaros has joined #ruby
telling has joined #ruby
telling has quit [Changing host]
telling has joined #ruby
rcj_ has joined #ruby
schaerli has joined #ruby
dnyy has quit [Remote host closed the connection]
Sigma00 has joined #ruby
TIBS01 has quit [Remote host closed the connection]
Slivka has quit [Read error: Connection reset by peer]
heftig has quit [Ping timeout: 265 seconds]
banjara has joined #ruby
d34th4ck3r has joined #ruby
heftig has joined #ruby
heftig has quit [Client Quit]
TIBS01 has joined #ruby
heftig has joined #ruby
hakunin has quit [Read error: Connection reset by peer]
JDubs has joined #ruby
hakunin has joined #ruby
<JDubs> Hey guys! o/
codecaster has joined #ruby
<d34th4ck3r> JDubs: yo!
<JDubs> You guys should try to tackle euler 12, I couldn't get it without cheating lol
dv_ has quit [Quit: No Ping reply in 180 seconds.]
dv_ has joined #ruby
tobinharris has joined #ruby
TIBS01 has quit [Remote host closed the connection]
dweeb has quit [Quit: Computer has gone to sleep.]
h8R has joined #ruby
<apeiros_> how'd you cheat in euler? o0 other than google for the answer
<JDubs> apeiros_ well, my solution was taking hours to complete (although should eventually get a right answer) so I found someone who did it in ruby...They had to pull in mathn library and use commands from that
TIBS01 has joined #ruby
tvw has joined #ruby
<apeiros_> "should get the right answer"… yeeeeah :)
bigmcq77 has quit [Read error: Connection reset by peer]
bigmcq77_ has joined #ruby
<JDubs> well it got the right answer for everything i tried up to about 250, which was where it starting taking waaaaaaay longer
<apeiros_> when you've worked a year or two, tell me how many times you've heard "but this should work, why does it not?!?"
<JDubs> here i'll share my solution with you
lemonsparrow has joined #ruby
<lemonsparrow> is there a single line command to convert [19, 26, 29, 31] into [["19"], ["26"], ["31"], ["29"]]
<JDubs> I had even tried using the special factoring method, I wrote a .divs method for arrays
<JDubs> lemonsparrow [19,26,29,31].map{|num| num.to_a} I think
<JDubs> lemonsparrow try that
<JDubs> oh wait you want it in string as well?
TIBS01 has quit [Remote host closed the connection]
<JDubs> lemonsparrow [19,26,29,31].map{|num| num.to_s.to_a} I think
<apeiros_> [num.to_s]
TIBS01 has joined #ruby
answer_42 has joined #ruby
banjara has quit [Ping timeout: 264 seconds]
<JDubs> ahh yeah
<apeiros_> JDubs: you can calculate the lower bound immediately by calculating the scm of 1..500
<lemonsparrow> apeiros_: superb
<apeiros_> and you can calculate the nth triangle number directly by using gauss' formula
<JDubs> apeiros_ scm?
<apeiros_> smallest common multiple
<apeiros_> oh, lcm
<apeiros_> least common multiple
<apeiros_> and you can speed up lcm by going from the top down and eliminate factors as you encounter them
<JDubs> hmmm
<JDubs> eliminate them?
<apeiros_> 500 = 2*2*5*5
postmodern has quit [Quit: Leaving]
<apeiros_> urgs
<apeiros_> 500 = 2*2*5*5*5
<apeiros_> so you can eliminate 2,4,10,…,500
archangelpetro has joined #ruby
<apeiros_> as those will automatically also be factors
<archangelpetro> what exactly does ------ height {|x} x* 20} ----- mean?
<archangelpetro> |x|*
<JDubs> x is the height
<JDubs> then it spits out height * 20
<JDubs> I assume it's a map function archangelpetro?
<apeiros_> archangelpetro: { … } is either a hash or a block, in your case (through the |x|) it's a block
<archangelpetro> bah, no idea
<apeiros_> a block is like an anonymous function, which takes the arguments listed between || (so `x` in your case)
<archangelpetro> i see
<archangelpetro> and if i say
<archangelpetro> data [1,2,3,4]
<archangelpetro> is that saying data = [1,2,3,4]?
<apeiros_> no
<apeiros_> it's like data([1,2,3,4])
<apeiros_> parens are in most cases optional in ruby
<archangelpetro> ok, so height 20
<archangelpetro> is also a call :D
<apeiros_> yes
<JDubs> apeiros_ I'm having trouble understanding what you are saying about 1..500 lcm
<apeiros_> and while ruby has methods that can be named `height=`, they don't use it in your case because it'd need `self.height = 20`
<JDubs> i tried (1..500).inject{|result, num| num.lcm(result)} and got a retarded number
<apeiros_> since otherwise, just `height = 20` would never call the method, since local variable assignment takes precedence
<apeiros_> JDubs: hehe
<apeiros_> yeah, lcm over many numbers != lcm of each sequentially
<JDubs> 73239622318952846593863874519042298829761338251289259046349190034596307420803713394327759819891326985268312606648408875713314013313623337094312440663659803352061415560955398316253892220738945585450197206138869521568000
<JDubs> lol ^
<apeiros_> hm
larissa has joined #ruby
<apeiros_> or maybe I made an error when thinking about the problem
<apeiros_> ah, yes… it can have more factors if it uses few primes
dmiller has joined #ruby
<apeiros_> e.g. 28 consists of only 2 primes, but has 5 factors
<apeiros_> (shame that they count 1, though… that's cheating :-p)
zarubin has quit []
<Hanmac> Prime.prime_division(28) + [1,1]
geeksir has joined #ruby
rohit has joined #ruby
rohit has quit [Read error: Connection reset by peer]
zarubin has joined #ruby
<archangelpetro> http://rubyvis.rubyforge.org/examples/1_basic_1a_bar_rbp_api.html <<---- apeiros_ in this code, is 'height' being redefined with the {|d| .... } ? or... D? or what?
<apeiros_> Hanmac: the idea was to calculate a lower bound for project euler, problem 12
zarubin has quit [Client Quit]
<Hanmac> Prime.prime_division(73239622318952846593863874519042298829761338251289259046349190034596307420803713394327759819891326985268312606648408875713314013313623337094312440663659803352061415560955398316253892220738945585450197206138869521568000) this is solved in less than a second :D
zarubin has joined #ruby
dmiller has quit [Ping timeout: 260 seconds]
beiter has joined #ruby
beandip has quit [Ping timeout: 260 seconds]
samphippen has joined #ruby
willob has joined #ruby
tchebb has quit [Ping timeout: 246 seconds]
s1n4 has joined #ruby
<s1n4> why ruby becomes so slow at start? (it's for when I have installed a lot of gems)
altious has joined #ruby
<Hanmac> s1n4 does you use jruby?
reppard_ has joined #ruby
reppard has joined #ruby
<s1n4> maetthew: no, I use MRI
<s1n4> sorry
<s1n4> Hanmac: I use MRI (I use rvm too)
karakedi has quit [Ping timeout: 245 seconds]
Mon_Ouie has joined #ruby
<Hanmac> then you may do something wrong, my mri is fast (what version do you use?)
chussenot has quit [Quit: chussenot]
<s1n4> Hanmac: 1.9.3
<archangelpetro> on this example : http://rubyvis.rubyforge.org/examples/1_basic_1a_bar_rbp_api.html the ' bar do' part.. what exactly is this doing?
banjara has joined #ruby
<s1n4> Hanmac: I said it happens at startup
<Hanmac> archangelpetro look for ruby blocks
tchebb has joined #ruby
<Hanmac> s1n4: jruby, pry for sample are slow at startup
[Neurotic] has quit [Ping timeout: 244 seconds]
stoffus has joined #ruby
<archangelpetro> Hanmac, but there doesn't appear to be an iterator?
altious has quit [Ping timeout: 252 seconds]
<s1n4> Hanmac: rails, sinatra and a few other gems are so slow at startup, and I dont understand why
<JDubs> apeiros: best solution I could come up with: https://gist.github.com/4276024
<JDubs> apeiros_ what do you think
<Hanmac> s1n4 ask in #rubyonrails #sinatra and #other why they are slow ... in 99% it is not rubys fault
<s1n4> Hanmac: the same for bundle, bundle install takes a few minutes
<apeiros_> JDubs: I think my headache is preventing me to think about such a problem, sorry ;-)
<Hanmac> archangelpetro an iterator is not needed, in this case the block is used for instance_eval
<JDubs> apeiros_ ok lol
<Hanmac> s1n4: #bundler
<s1n4> Hanmac: let me say everything is slow at startup
<apeiros_> but looks good
<s1n4> Hanmac: irb is another one
Guest73164 has joined #ruby
<apeiros_> JDubs: (1..Float::INFINITY).find { … }
<apeiros_> :)
<JDubs> apeiros_ I got the solution in 20 seconds now
<Hanmac> oO when irb is slow at startup too than you fuckup your system ... i think rails was the problem :P
<JDubs> apeiros_ what are you wanting me to use find for?
<s1n4> require rubygems caused that?
<Hanmac> no
<apeiros_> instead of the `until answer` loop
<Hanmac> 1.upto(Float::INFINITY).find { … }
<s1n4> :D
beandip has joined #ruby
<s1n4> Hanmac: nevermind, I'll close my eyes when running ruby gems :D
<s1n4> I think thats the best solution
<JDubs> apeiros_ solution in 4.3 seconds now!
<JDubs> ooo wait...solution is wrong now :/
<JDubs> hmmm
<apeiros_> :)
* apeiros_ wonders…
<apeiros_> hm, no, problem 12 is not on this HD
<JDubs> figured it out!
<apeiros_> I wondered how I solved it
w|t has joined #ruby
<Hanmac> by ignoring :P
<JDubs> apeiros_ 4.3 second solution and correct answer xD
<apeiros_> funny, seems I solved problem24 by hand
timonv has quit [Remote host closed the connection]
<apeiros_> at least there's no code, only a .txt file with some notes
<apeiros_> Hanmac: na, up to 50 I got almost all I think
banjara has quit [Ping timeout: 265 seconds]
<apeiros_> yeah, only 6 missing
<JDubs> apeiros_ want to see my code?
<JDubs> xD
<Mon_Ouie> Heh, funny, I was just trying to figure out what login I had used on projecteuler. Too bad one can't just enter the mail address to have a new password sent…
<apeiros_> I want to see my code!
<JDubs> apeiros_ LOL
<apeiros_> don't have it with me as it seems, though :(
Zai00 has quit [Quit: Zai00]
<workmad3> heh
<JDubs> workmad3! o/
<JDubs> heyo
<workmad3> I've managed a whole 16 pe problems
<Xeago> is it Re-indexing or reindexing?
<JDubs> workmad3: my problem 12 solution https://gist.github.com/4276024
<JDubs> Xeago! o/ hiyoooo
shiin has quit [Quit: Computer has gone to sleep.]
TIBS01 has quit [Remote host closed the connection]
<Xeago> morning
lolmaus has quit []
TIBS01 has joined #ruby
<Xeago> been here since 11'ish tho
arusso has quit [Quit: Adios Amigos!]
chriskk has quit [Quit: chriskk]
<apeiros_> Solved 52 out of 405
<apeiros_> back when I was at ~50, that was ~25% :(
nemesit has quit [Quit: Linkinus - http://linkinus.com]
nemesit has joined #ruby
ltsstar has joined #ruby
Husel has joined #ruby
reppard_ has quit [Ping timeout: 252 seconds]
reppard has quit [Ping timeout: 252 seconds]
VoiDeT has quit [Quit: VoiDeT]
<JDubs> apeiros_ guess you better get back to it then :P
<apeiros_> NA
<apeiros_> better things to do
<apeiros_> like writing an rpg :-p
jxriddle has joined #ruby
a_a_g has quit [Quit: Leaving.]
gyre007 has quit [Remote host closed the connection]
Zai00 has joined #ruby
richardjapenga has joined #ruby
jxriddle has quit [Client Quit]
jxriddle has joined #ruby
whowantstolivefo has joined #ruby
segv- has joined #ruby
DaZ has quit [Ping timeout: 255 seconds]
geeksir has quit [Quit: Leaving]
Shrink has quit [Ping timeout: 264 seconds]
gyre007 has joined #ruby
love_color_text has joined #ruby
Jasko has quit [Quit: Leaving]
Goles has joined #ruby
cdr255 has quit [Ping timeout: 260 seconds]
timonv has joined #ruby
skaczor_ has joined #ruby
chussenot has joined #ruby
ABK has quit [Ping timeout: 255 seconds]
DaZ has joined #ruby
ffranz has joined #ruby
lolmaus has joined #ruby
F1skr has joined #ruby
ExxKA has quit [Quit: This computer has gone to sleep]
<Hanmac> apeiros_ i have the right binding for that :-P
TIBS01 has quit [Remote host closed the connection]
TIBS01 has joined #ruby
<JDubs> How do I change this code to give me back a,b,c values for when everything passes? https://gist.github.com/4276157
gyre007 has quit [Remote host closed the connection]
Shrink has joined #ruby
banjara has joined #ruby
ffranz has quit [Ping timeout: 245 seconds]
Hanmac1 has quit [Read error: Connection reset by peer]
Hanmac1 has joined #ruby
<apeiros_> Hanmac: yours is 3d, no?
DaZ has quit [Ping timeout: 255 seconds]
<apeiros_> Hanmac: using gosu for now, might go with allegro
<Hanmac> yeah i have a binding for 3d ... but my support cool features like "oldTV" looking
<apeiros_> :D
<apeiros_> funky
<apeiros_> got a demo of that?
<Hanmac> yes and no ... my github is three months old ... i need to push ...
mengu has quit [Remote host closed the connection]
<apeiros_> oh I meant more like youtube
<apeiros_> can't spend time to install things right now ;-)
schaary has joined #ruby
dmiller has joined #ruby
DaZ has joined #ruby
buibex has joined #ruby
banjara has quit [Ping timeout: 255 seconds]
dmiller has quit [Ping timeout: 246 seconds]
<Hanmac> apeiros_ could you open it?
<apeiros_> yes
<apeiros_> that's the oldTV look?
robbyoconnor has quit [Ping timeout: 264 seconds]
<Hanmac> yeah, i mean the flackering on the cube
jenrzzz has quit [Ping timeout: 255 seconds]
nanothief has quit [Ping timeout: 276 seconds]
s1n4 has quit [Quit: leaving]
sailias has joined #ruby
Husel has quit [Quit: Page closed]
cezar has quit [Remote host closed the connection]
<apeiros_> Hanmac: ah
jenrzzz has joined #ruby
codecaster has quit [Read error: Connection reset by peer]
<apeiros_> only that surface is "oldTV"
tps_ has quit [Quit: tps_]
<Hanmac> it has an invert too that turns an red scene into cyan
buibex has quit []
taoru has quit [Remote host closed the connection]
<Hanmac> the code to add that both is: (vp.compositor_chain << "Invert" << "OldTV").each(&:enable)
codecaster has joined #ruby
altious has joined #ruby
<apeiros_> why strings and not symbols?
<Hanmac> because they are not constants, they are name for the resources (you need them in your materials)
* Hanmac should update the git repo in the newest code there are more light sources and the cube is rotating
ryanh has quit [Quit: Computer has gone to sleep.]
mark_locklear has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
DaZ has quit [Ping timeout: 260 seconds]
mercwithamouth has joined #ruby
nomenkun_ has joined #ruby
enroxorz-work has joined #ruby
<Hanmac> apeiros_ you could use symbols too because they would be converted into strings automaticly
nomenkun has quit [Ping timeout: 248 seconds]
sailias has quit [Ping timeout: 245 seconds]
geekbri has joined #ruby
AndroUser2 has joined #ruby
AndroUser2 has quit [Client Quit]
zigomir has quit [Quit: zigomir]
Virunga has joined #ruby
gyre007 has joined #ruby
slainer68 has quit [Remote host closed the connection]
Pass_Tech has joined #ruby
cascalheira81 has joined #ruby
Godd2 has joined #ruby
DaZ has joined #ruby
ffranz has joined #ruby
<Hanmac> apeiros_ i will make a commit for you today in the noon
<apeiros_> oh no need. I wont' even get to the gosu based code this week :(
theRoUS has quit [Ping timeout: 245 seconds]
nomenkun has joined #ruby
<sandGorgon> hi guys - question about rbenv. I have a centrally installed rbenv at /usr/local/rbenv - I need to install all my rubies to the same central location and have all users be able to use it. How do I do this ?
philips_ has quit [Excess Flood]
theRoUS has joined #ruby
gyre007 has quit [Ping timeout: 245 seconds]
philips_ has joined #ruby
huoxito has joined #ruby
cascalheira81 has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
<maloik> Well it seems my rspec problem has consequences for my last test too... https://gist.github.com/76032261101ab870355d - in the case of the last one, the method should be received once for each ssh key per account, so in this case twice. Any clues why it doesnt work?
malkomalko has joined #ruby
danieldocki has joined #ruby
nomenkun_ has quit [Ping timeout: 245 seconds]
jfl0wers has joined #ruby
<jfl0wers> hello
banjara has joined #ruby
ner0x has joined #ruby
sailias has joined #ruby
nomenkun_ has joined #ruby
<jfl0wers> I am have been developing on 1.9.2 and now I find I need to deploy on 1.8.7
<jfl0wers> is there a difference between these version where require behavior has changed?
<apeiros_> quite a few, yes
<elaptics> jfl0wers: there's various changes so you'll have a really fun time with that
nomenkun has quit [Read error: No route to host]
<apeiros_> some small syntax changes, the bigger ones are wrt handling encoding
<jfl0wers> this works on 1.9.2:
<jfl0wers> require 'Macaddr'
slainer68 has joined #ruby
nomenkun has joined #ruby
<elaptics> jfl0wers: why not just deploy with 1.9.2?
<jfl0wers> but 1.8.7 does not seem to like the case of the gem being required...
<apeiros_> jfl0wers: this is probably more related to your filesystem
<apeiros_> require relates to files
<apeiros_> if your filesystem is case insensitive, then it doesn't matter how you write the require
<apeiros_> if you're however on a case sensitive file system, then casing of your require must match
<jfl0wers> I am developing on a Mac and deploying to CentOS
altious2 has joined #ruby
<apeiros_> and OSX has a case insensitive FS
<apeiros_> whereas most *nix have case sensitive. there you go.
<jfl0wers> I thought Mac's were case sensitive...
<jfl0wers> ahh
<jfl0wers> okay
<apeiros_> make sure your all your file related cases are correct. always the right thing to do, not just for requires.
<jfl0wers> I agree
altious has quit [Ping timeout: 244 seconds]
<apeiros_> convention in ruby is to have requires all lowercase
<jfl0wers> this is an open source vagrant plugin that is failing
<jfl0wers> I have been tweaking it
<jfl0wers> one more thing to do
<jfl0wers> thanks for the quick help
samphippen has quit [Quit: Computer has gone to sleep.]
<apeiros_> yw
tommyvyo has quit [Quit: Computer has gone to sleep.]
<apeiros_> osx filesystem is actually case-preserving (that is: insensitive, but it'll keep the case as you named the file)
kil0byte has joined #ruby
nomenkun_ has quit [Ping timeout: 245 seconds]
<apeiros_> you can optionally switch osx to case sensitive. but lots and lots of software for osx was badly coded and fails on a case sensitive system.
hotovson_ has quit [Ping timeout: 250 seconds]
* apeiros_ looks @ adobe >:(
<Hanmac> "CentOS - software form the last century"
Guest___ has joined #ruby
Shrink has quit [Ping timeout: 265 seconds]
reset has joined #ruby
<Hanmac> Mac and Centos are both software i dont want to develop too
hotovson has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
elico has joined #ruby
<apeiros_> too -> on ?
<apeiros_> -> for ?
Uranio has quit [Quit: WeeChat 0.3.8]
slainer68 has quit [Remote host closed the connection]
banjara has quit [Ping timeout: 260 seconds]
<Hanmac> both
slainer68 has joined #ruby
<Hanmac> i dont want to develop on and not for Mac :P
<maetthew> Is there a way to "reload" classes in Ruby? I'm developing an IRC bot and during development it's tedious to restart the bot every time I make a change
* apeiros_ enjoys developing on mac
dissemble has joined #ruby
slainer68 has quit [Read error: Connection reset by peer]
<apeiros_> maetthew: you can remove constants and load files as often as you want.
slainer68 has joined #ruby
<apeiros_> but careful, any reference to the old class will still use the old class
<Hanmac> metthew, no, use new ruby instances, that are created by the bot
<apeiros_> maetthew: there have been a couple of attempts at plugin systems, you might want to take a look at one of them
osvico has joined #ruby
<Hanmac> if you dont do it Hanmac will crash the bot
<apeiros_> that reminds me that I still haven't put the old butler code on github :-(
<maetthew> Hanmac; apeiros_ : hmm i'm not following. i've been trying to google but i'm new to ruby and I don't know what terms to search
<maetthew> what is this "procedure" called?
ananthakumaran has quit [Quit: Leaving.]
AndChat| has quit [Ping timeout: 260 seconds]
<apeiros_> maetthew: Array is just a constant, like Foo = "x"
<apeiros_> just that Array happens to reference a class
<apeiros_> you can use Module#remove_const to remove the Array constant. but if you had x = [] prior to that in your code, [].class will still be the old Array, no matter how you redefine the constant.
Averna has quit [Quit: Leaving.]
Banistergalaxy has joined #ruby
<apeiros_> and you can use load or eval to load code as often as you want.
samphippen has joined #ruby
<maetthew> apeiros_, yeah but i still can't wrap my head around this. I would like to look at a source to help me "get going"
<Hanmac> but then the bot does eval user input then hanmac will crush the bot like an easteregg :P
<apeiros_> maetthew: yeah, that's where I wanted to link you to butler, but the code is only in svn :(
<maetthew> apeiros_, so push then :)
nkts has joined #ruby
lkba has joined #ruby
<apeiros_> and rubyforge's svn is broken
Shrink has joined #ruby
pu22l3r has joined #ruby
<apeiros_> maetthew: sorry, not really the time
beiter has quit [Ping timeout: 264 seconds]
<maetthew> allright
<Hanmac> svn is so pre-2000
<maetthew> but anyway, is there a term for this "procedure" so I can google my way through it?
tommyvyo has joined #ruby
<apeiros_> Hanmac: you mean pre-2006?
<apeiros_> (and butler probably *is* pre-2006…)
<Hanmac> that too
altious2 has quit [Ping timeout: 265 seconds]
* Hanmac hates central versions control systems ... it feels soo monotheistism
Vert has joined #ruby
altious has joined #ruby
sailias has quit [Quit: Leaving.]
wermel has joined #ruby
nwertman has joined #ruby
yacks has quit [Ping timeout: 276 seconds]
bel3atar has joined #ruby
LouisGB has quit []
Coolhand|laptop has joined #ruby
lkba has quit [Ping timeout: 244 seconds]
krawchyk has joined #ruby
tobinharris has quit [Quit: tobinharris]
tobinharris has joined #ruby
beiter has joined #ruby
mafolz has quit [Read error: Connection reset by peer]
dmiller has joined #ruby
tps_ has joined #ruby
rondale_sc has joined #ruby
iamjarvo has joined #ruby
tk__ has joined #ruby
rook_flood has joined #ruby
slainer68 has quit [Remote host closed the connection]
pu22l3r has quit [Remote host closed the connection]
jtharris has joined #ruby
arkiver has quit [Quit: Leaving]
pu22l3r has joined #ruby
invisime has joined #ruby
dmiller has quit [Ping timeout: 245 seconds]
mafolz has joined #ruby
joshman_ has joined #ruby
lemonsparrow has quit [Ping timeout: 245 seconds]
yacks has joined #ruby
banjara has joined #ruby
answer_42 has quit [Ping timeout: 276 seconds]
<Godd2> Hanmac: But think of all that disk space you're saving!! /s
adamnbowen has joined #ruby
Guest___ is now known as dweeb
<Hanmac> Godd2 i could put 7HDDs in my mini-pc ... i dont care anymore about disk-space :P
<Hanmac> and distributed version control system is better ...
pcarrier has quit []
classix has joined #ruby
<Xeago> what did I miss?
GoGoGarrett has joined #ruby
spleeze has joined #ruby
reppard has joined #ruby
reppard_ has joined #ruby
<Xeago> ah got it
kpshek has joined #ruby
Deadalus has joined #ruby
solidoodlesuppor has joined #ruby
<Godd2> Hanmac: Oh I know, it's just the only two metrics SVN beats out git for is cloning time and disk space (source) http://git-scm.com/about/small-and-fast
DaZ has quit [Ping timeout: 255 seconds]
alanp has joined #ruby
tk__ has quit [Quit: ばいばい]
malkomalko has quit [Remote host closed the connection]
altious has quit [Ping timeout: 244 seconds]
lwhalen has joined #ruby
spleeze has quit [Client Quit]
enroxorz-work has quit [Read error: Connection reset by peer]
Spaceboy has quit [Remote host closed the connection]
tps_ has quit [Quit: tps_]
bel3atar has quit [Ping timeout: 255 seconds]
lwhalen has quit [Client Quit]
spleeze has joined #ruby
joofsh has joined #ruby
banjara has quit [Ping timeout: 265 seconds]
audy has joined #ruby
swex has joined #ruby
jrajav has joined #ruby
swex_ has quit [Ping timeout: 264 seconds]
iamjarvo has quit [Quit: Leaving.]
DaZ has joined #ruby
<audy> What is the fastest way to count things in Ruby? I've been using counter = Hash.new { |h, k| h[k] = 0 }; counter[:thing] += 1 but is there a better way?
yalue has joined #ruby
gyre007 has joined #ruby
<banister_> audy: use #count
<banister_> audy: what? what areyou trying to count there?
<audy> banister_ just dump into an array and Array.count :item ?
thisirs has joined #ruby
<audy> banister_ how often different strings appear in a text file
<Xeago> so you are counting each string?
<Xeago> (word)?
<audy> banister_ I have many lines with: variable, item and I want to keep track of the different items for each variable
robbyoconnor has joined #ruby
robbyoconnor has quit [Client Quit]
<audy> So I'm actually doing Hash.new { |h, k| h[k] = Hash.new { |h, k| h[k] = 0 } }
<audy> and counter[:variable][:item] += 1
<audy> In the end, I build a 2D matrix
sailias has joined #ruby
<audy> I hear that multisets might be a better way to do this
reppard_ has quit [Ping timeout: 264 seconds]
reppard has quit [Ping timeout: 276 seconds]
nari has quit [Ping timeout: 255 seconds]
banister_ has quit [Remote host closed the connection]
rook_flood has quit [Quit: bye~~]
art_man1 has joined #ruby
chimkan has joined #ruby
art_man1 has quit [Client Quit]
rook_flood has joined #ruby
PsciCOde1iXHAt has joined #ruby
<PsciCOde1iXHAt> hello, i'm trying to lern ruby...
<PsciCOde1iXHAt> learn
Deadalus has quit [Changing host]
Deadalus has joined #ruby
Deadalus is now known as deadalus
schaary has quit [Quit: Leaving.]
<PsciCOde1iXHAt> I'm just start, just reading, someone have some good code for example
nga4 has quit [Ping timeout: 248 seconds]
bel3atar has joined #ruby
Ihavenopants has joined #ruby
rook_flood has left #ruby [#ruby]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
vd0 has joined #ruby
<timonv> @audy ["a", "a", "b"].group_by { |x| x }.inject({}) { |acc, (k,v)| acc.merge({k => v.count}) }
<timonv> Although, you can make it a lot faster if you just use one inject
<timonv> *the one
ananthakumaran has joined #ruby
<timonv> # => {"a"=>2, "b"=>1}
Emmanuel_Chanel has quit [Read error: Operation timed out]
jtharris has quit [Quit: WeeChat 0.3.9.2]
schaary has joined #ruby
schaary has left #ruby [#ruby]
NiteRain has joined #ruby
<Hanmac> ["a", "a", "b"].group_by { |x| x }.each_with_object({}) { |(k,v),acc| acc[k]=v.count }
heftig has quit [Quit: leaving]
jeffreybaird has joined #ruby
schaary1 has joined #ruby
schaary1 has left #ruby [#ruby]
ttt has quit [Remote host closed the connection]
<apeiros_> audy: counter = Hash.new { |h, k| h[k] = 0 }; counter[:thing] += 1 --> just counter = Hash.new(0)
Hanmac has quit [Quit: Page closed]
<apeiros_> ["a", "a", "b"].each_with_object(Hash.new(0)) { |value, counter| counter[value] += 1 }
<audy> apeiros_ thanks
<audy> the array is really large, and I'm counting different subsets of things based on the string
<apeiros_> or plain each and the hash outside
<rondale_sc> Hadn't seen each_with_object used in the wild before. Very handy. I always hated having to add `; memo}` to the end of my inject calls.
<apeiros_> rondale_sc: `; memo` means you abused inject :-p
<apeiros_> sadly widespread
yacks has quit [Ping timeout: 244 seconds]
<rondale_sc> apeiros_: howso?
jrist-afk is now known as jrist
joshman_ has quit [Quit: Computer has gone to sleep.]
digitalcakestudi has joined #ruby
banjara has joined #ruby
<audy> apeiros_ using the default value in Hash.new instead of a proc did cut down on Proc#yield thanks
<audy> I don't know why I do stupid things
osvico has quit [Ping timeout: 256 seconds]
dmerrick has joined #ruby
pcarrier has joined #ruby
banister_ has joined #ruby
atal421 has joined #ruby
dnyy has joined #ruby
cpruitt has joined #ruby
ryannielson has joined #ruby
carlyle has joined #ruby
stopbit has joined #ruby
<apeiros_> rondale_sc: sorry, not really in the mood to explain it (still having a headache)
<apeiros_> it goes against the semantics of inject, additionally it is usually both faster and less code to have the same with plain .each and external memo.
kn330 has joined #ruby
yacks has joined #ruby
<apeiros_> of course, if your first and foremost issue is to express everything in oneliners… (but then you've got a different issue altogether)
<rondale_sc> apeiros_: lol, usually inject only gets used in one-offs for me. But yeah I suppose it does go against its semantics. I'll remember that. #each_with_object is more in line with what I want where I'd normally use inject.
Emmanuel_Chanel has joined #ruby
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
jonathanwallace has joined #ruby
bel3atar has quit [Ping timeout: 260 seconds]
sandGorgon has quit [Ping timeout: 260 seconds]
bbttxu has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
cakehero has joined #ruby
vd0 has quit [Ping timeout: 276 seconds]
banjara has quit [Ping timeout: 260 seconds]
stopbit has quit [Ping timeout: 265 seconds]
tungd has quit [Read error: Connection reset by peer]
dmiller has joined #ruby
_alejandro has quit [Remote host closed the connection]
morf has quit [Quit: eof]
C0deMaver1ck has joined #ruby
larissa has quit [Quit: Leaving]
tjbiddle has joined #ruby
tps_ has joined #ruby
zmo_ has quit [Quit: Leaving]
<lurch_> is there a way to override RbConfig::CONFIG['bindir'] by an environment variable or from .gemrc?
rjmt___ has joined #ruby
tjbiddle_ has joined #ruby
chimkan__ has joined #ruby
skaczor_ has quit [Quit: Leaving]
nanothief has joined #ruby
skaczor has joined #ruby
dmiller has quit [Ping timeout: 246 seconds]
lkba has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
nkts has quit [Ping timeout: 245 seconds]
_nitti has joined #ruby
samphippen has joined #ruby
chimkan has quit [Ping timeout: 246 seconds]
chimkan__ is now known as chimkan
beilabs has quit [Ping timeout: 244 seconds]
tjbiddle has quit [Ping timeout: 264 seconds]
tjbiddle_ is now known as tjbiddle
freeayu has quit [Remote host closed the connection]
slainer68 has joined #ruby
beilabs has joined #ruby
bel3atar has joined #ruby
nari has joined #ruby
nanothief has quit [Ping timeout: 276 seconds]
dmerrick has quit [Quit: dmerrick]
vlad_starkov has joined #ruby
x0F has quit [Read error: Connection reset by peer]
dmerrick has joined #ruby
jtharris has joined #ruby
joshman_ has joined #ruby
x0F has joined #ruby
scruple has quit [Read error: Connection reset by peer]
stopbit has joined #ruby
timonv has quit [Ping timeout: 252 seconds]
kevinykchan has joined #ruby
timonv has joined #ruby
wataken44 has quit [Remote host closed the connection]
kn330 has quit [Remote host closed the connection]
bean has joined #ruby
rbennacer has left #ruby ["Leaving"]
pcarrier has quit []
slainer68 has quit [Read error: Connection reset by peer]
slainer68 has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
tomsthumb has quit [Quit: Leaving.]
theRoUS_ has joined #ruby
_alejandro has joined #ruby
banjara has joined #ruby
DatumDrop has joined #ruby
beiter has quit [Quit: beiter]
Animawish has joined #ruby
apeiros_ has quit [Remote host closed the connection]
<Animawish> so index gives the location of the first instance of something, and scan just grabs every instance of something. how do I index every instance of something?
axl_ has joined #ruby
DatumDrop has quit [Ping timeout: 244 seconds]
enroxorz-work has joined #ruby
tagrudev has quit [Remote host closed the connection]
jlast has joined #ruby
wmoxam_ is now known as wmoxam
wmoxam has quit [Changing host]
wmoxam has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
SCommette has joined #ruby
vlad_starkov has joined #ruby
a_a_g has joined #ruby
nemesit|osx has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
iamjarvo has joined #ruby
<havenn> Animawish: I haven't had coffee, so treat this as suspect.. :) but: [1,2,3,4,1,2,3,5,6,7].each_with_index { |n, i| @i ||= []; @i << i if n == 3 }
pcarrier has joined #ruby
nari has quit [Ping timeout: 245 seconds]
zigomir has joined #ruby
<havenn> [3,4,5,2,3].each_with_index.map { |n, i| i if n == 3 }.delete_if &:nil? #=> [0, 4]
banjara has quit [Ping timeout: 255 seconds]
nemesit has quit [Ping timeout: 255 seconds]
dr_bob has quit [Quit: Leaving.]
_nitti has quit [Remote host closed the connection]
haxrbyte has joined #ruby
alex__c2022 has joined #ruby
malkomalko has joined #ruby
timonv has quit [Remote host closed the connection]
nemesit|osx has quit [Quit: Linkinus - http://linkinus.com]
atal421 has quit [Quit: atal421]
nemesit has joined #ruby
<havenn> Animawish: I guess Array.map.with_index makes more sense than Array.each_with_index.map
haxrbyte_ has joined #ruby
timonv has joined #ruby
jjbohn has joined #ruby
chimkan has quit [Quit: chimkan]
BigO_ has joined #ruby
samuel02 has quit [Remote host closed the connection]
samuel02 has joined #ruby
haxrbyte has quit [Ping timeout: 265 seconds]
jjbohn has quit [Client Quit]
aldodelgado has joined #ruby
bean has joined #ruby
froy has quit [Ping timeout: 265 seconds]
<havenn> lurch_: Can't you just assign the value from .gemrc to it?: require 'rbconfig'; RbConfig::CONFIG['bindir'] = '/another/dir'
pothibo has joined #ruby
Gooder` has quit [Read error: Connection reset by peer]
Gooder` has joined #ruby
jjbohn has joined #ruby
digitalcakestudi has quit [Read error: Connection reset by peer]
Coolhand|laptop has quit [Remote host closed the connection]
samuel02 has quit [Ping timeout: 264 seconds]
JDubs_ has joined #ruby
<JDubs_> Hey guys! https://gist.github.com/4276157 <---I need this to put out A and B, and not just A, how can I do that?
froy has joined #ruby
digitalcakestudi has joined #ruby
Coolhand|laptop has joined #ruby
<workmad3> JDubs_: pythagorean triplet one?
<bean> JDubs_: which # is that one?
matchaw has quit [Ping timeout: 264 seconds]
reset has quit [Quit: Leaving...]
eldariof has quit [Ping timeout: 250 seconds]
<JDubs_> bean: 20
chimkan_ has joined #ruby
<JDubs_> errr
<JDubs_> bean: 9 sorry
<bean> lol
<JDubs_> wordmad3 yes
<workmad3> JDubs_: I think you want to re-read the problem statement ;)
<JDubs_> well i need to get back A and B before I can get the product -_-
Drager has quit [Changing host]
Drager has joined #ruby
<workmad3> JDubs_: you're looking for the 3 numbers a, b, c where a + b + c == 1000, and a**2 + b**2 == c**2
<Godd2> Do you need to explicitly include Math?
<workmad3> JDubs_: and then you want a * b * c
Pass_Tech has quit [Quit: Quitte]
elsifaka has quit [Quit: Veloma e!]
<workmad3> JDubs_: which doesn't involve any square-rooting
shtirlic_ has quit [Read error: Connection reset by peer]
samphippen has quit [Quit: Computer has gone to sleep.]
Xeago has quit [Remote host closed the connection]
<workmad3> JDubs_: also, you might find (1..1000).to_a.combinations(3) a useful starting point ;)
<JDubs_> ummm
<JDubs_> wait what...
Xeago has joined #ruby
<JDubs_> hmmm
<Godd2> isnt it Array#Combination ?
<havenn> #combination
Slivka has joined #ruby
<workmad3> yes, combination, sorry
_nitti has joined #ruby
dmiller has joined #ruby
<workmad3> JDubs_: .combination(3) will give you all combinations of 3 items in the array
shtirlic has joined #ruby
<Godd2> JDubs_: Here's a couple examples of #combination: http://www.ruby-doc.org/core-1.9.3/Array.html#method-i-combination
<JDubs_> hmmm
<JDubs_> kk
<JDubs_> ill go read
<bean> oh wow,
<bean> I did that one as 3 nested (0..1000) loops
<bean> i was not thinking
<bean> :p
dr_bob has joined #ruby
<JDubs_> bean: why won't my find method work?
beiter has joined #ruby
<bean> ?
<bean> I dont know
<Godd2> also arr = [*1..1000] will spit back an array with the first 1000 integers
pwelch has joined #ruby
tobinharris has quit [Quit: tobinharris]
<workmad3> Godd2: good point, that's a bit nicer than (1..1000).to_a
<Godd2> arr = [*1..10] => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
timonv has quit [Ping timeout: 244 seconds]
mguy has quit [Quit: leaving]
<dissemble> nicer in what way?
<dissemble> seems less clear
haxrbyte_ has quit [Ping timeout: 260 seconds]
jonahR has joined #ruby
dmiller has quit [Ping timeout: 246 seconds]
<Godd2> It might depend on the person. I can see the argument that (1..10).to_a is better since it's a method call
<JDubs_> So is there no way to get my .find method to work?
<Godd2> I wonder if one is faster than the other...
<workmad3> dissemble: it's perfectly clear to me
richardjapenga has quit [Quit: Leaving]
<workmad3> JDubs_: I'm sure there is... it's just that your current code is looking for completely the wrong thing
d2dchat has joined #ruby
<JDubs_> yeah i fixed that
<workmad3> JDubs_: are you looking for a, b and c now?
Coolhand|laptop has quit [Remote host closed the connection]
<bean> oh wow, the (0..1000).to_a.combinations(3) is WORLDs faster than 3 different loops :p
banjara has joined #ruby
SCommette has quit [Quit: SCommette]
<workmad3> bean: I think it's a lazy enumerator ;)
<bean> I believe you're correct, workmad3
<Godd2> just did (1..1000).each {|i| a = [*1..100000]} vs (1..1000).each {|i| a = (1..100000).to_a} and the second one was faster
<workmad3> JDubs_: 1001.sqrt.ceil <-- why are you stopping there?
<JDubs_> bean: Mine is still calculating with the combinations method...takes forever
<workmad3> JDubs_: you don't need sqrts
<dissemble> clarity to a broad audience > clarity to the author
<bean> its likely the sqrts that are taking forever.
<workmad3> JDubs_: and it's a + b + c that needs to equal 1000, not a**2 + b**2
haxrbyte has joined #ruby
<JDubs_> wormad3: sorry that's a relic from when I thought it was a**2 + b**2 == 1000
codecaster has quit [Read error: Connection reset by peer]
atal421 has joined #ruby
banister_ is now known as banisterfiend
<workmad3> JDubs_: in fact, that code is looking for c == 1000
schaerli has quit [Remote host closed the connection]
JonnieCache has joined #ruby
Coolhand|laptop has joined #ruby
<workmad3> JDubs_: brute force approach for this one is a 120 character 1-liner that does addition, multiplication and exponentiation :)
<bean> JDubs_: https://gist.github.com/be30567f69aa002c4efa is how I did this one
<workmad3> JDubs_: and takes about 2 minutes to run on my machine
codecaster has joined #ruby
<JDubs_> hmmm
<workmad3> here's mine from this morning: https://gist.github.com/4277506
dr_bob has quit [Quit: Leaving.]
vd0 has joined #ruby
SCommette has joined #ruby
<JDubs_> array.combination(3) { |a,b,c| a + b == c && c == 1000 && a**2 + b**2 == c**2 }
<JDubs_> how's that?
<workmad3> wrong
burgestrand has quit [Quit: Leaving.]
pavilionXP__ has quit [Ping timeout: 264 seconds]
<JDubs_> -_-
altious has joined #ruby
<workmad3> a + b + c == 1000
<workmad3> not a + b == c == 1000
<JDubs_> ohhh
<JDubs_> i thought a + b == 1000
<JDubs_> doh
<Godd2> This was mine from a bit ago: https://gist.github.com/4277511
aldodelgado has quit [Quit: aldodelgado]
dr_bob has joined #ruby
<JDubs_> And btw, I'm not worried about the arguments, Im worried about the methods lol
<JDubs_> array.combination(3) { |a,b,c| a + b + c == 1000 && a**2 + b**2 == c**2 }
apeiros_ has joined #ruby
maesbn has quit [Remote host closed the connection]
tomsthumb has joined #ruby
jjbohn has quit [Read error: Connection reset by peer]
<JDubs_> like, is that the proper way to use combinations?
robustus has quit [Quit: ZNC - http://znc.in]
<workmad3> it would be fine, but you want a .find or a .select on it to get an answer out
<workmad3> on it's own like that, you're doing the equivalent of a .each
<JDubs_> hmmm
<JDubs_> i don't understand what it outputs
robustus has joined #ruby
<workmad3> just reduced mine down to 92 characters and a 1m runtime :D
<JDubs_> does it output the array that meets the block I put?
<workmad3> no
<JDubs_> hmm
<workmad3> it just runs that block for every combination
<workmad3> and throws away the return value
<JDubs_> i don't understand...
<workmad3> like .each would
<JDubs_> :/
timonv has joined #ruby
<workmad3> but it's chainable with other enumerable operations, like .select or .find that *will* do what you want
banisterfiend has quit [Remote host closed the connection]
<JDubs_> hmm
<workmad3> so you can do .combinations(3).find {...}
<Godd2> ok JDubs_ youre wondering what combination does specifically?
<workmad3> and then you will get back what you want
<JDubs_> oh
<JDubs_> workmad3 so a block with it is pointless then?
<workmad3> not pointless, but pointless in this circumstance ;)
<JDubs_> what would you use a block with it for?
altious has quit [Ping timeout: 252 seconds]
<workmad3> if what you need to do is run a chunk of code for each combination of items in an array
<workmad3> then you'd just use it with a block
<JDubs_> hmmm
stoffus has quit [Quit: The computer fell asleep]
<workmad3> if what you want is to filter down the array, or find a specific value, then you'd want to chain a filter or a find onto it
kpshek has quit []
theRoUS_ has quit [Changing host]
theRoUS_ has joined #ruby
headius has joined #ruby
theRoUS has quit [Disconnected by services]
<Godd2> JDubs_: the .combination will give something like this [ [], [], [], [] .... [], ]
lurch_ has quit [Quit: lurch_]
theRoUS has joined #ruby
<Godd2> you're wanting to do a find on that
<workmad3> as I said, it's very much like a .each, but passes in combinations of items instead of single items :)
jlwestsr has joined #ruby
<JDubs_> Godd2:Yeah I got the solution now :)
<JDubs_> Godd2: just wanting to understand combinations more
<JDubs_> :)
<havenn> Wouldn't this suffice?: https://gist.github.com/4277569
<workmad3> puts [*1..1000].combination(3).find{|(a,b,c)|a+b+c==1000 && a**2 + b**2 == c**2}.inject(&:*) <-- there's mine
theRoUS is now known as Guest67996
<JDubs_> wordmad3: that's the same as my solution :)
chimkan_ has quit [Quit: chimkan_]
<Godd2> open up irb
banjara has quit [Ping timeout: 264 seconds]
theRoUS_ is now known as theRoUS
<Godd2> and put this in to see the result: [1,2,3,4].combination(3).to_a
<workmad3> takes about 1m to run here, so I'm sure there's a better solution
<workmad3> but it's good enough
kpshek has joined #ruby
beiter has quit [Quit: beiter]
haxrbyte has quit [Ping timeout: 260 seconds]
bean has quit [Quit: Computer has gone to sleep.]
haxrbyte has joined #ruby
<Godd2> workmad3: Mine takes 25% of the time ;)
<workmad3> Godd2: show-off :P
<Godd2> Mine requires more lines though.
six has quit [Ping timeout: 240 seconds]
<Godd2> is there a better way to write mine?
tPl0ch has quit [Quit: Verlassend]
Coolhand|laptop has quit [Remote host closed the connection]
six has joined #ruby
<workmad3> Godd2: dunno, possibly?
Animawish has quit [Quit: Leaving.]
Banistergalaxy has quit [Read error: Connection reset by peer]
nazty has quit [Quit: Leaving]
timonv has quit [Remote host closed the connection]
<workmad3> Godd2: most PE problems are apparently solvable in a minute or less :)
Banistergalaxy has joined #ruby
Coolhand|laptop has joined #ruby
<havenn> Takes less than a second :P: https://gist.github.com/4277569
martinklepsch has joined #ruby
ExxKA has joined #ruby
davidcelis has quit [Quit: K-Lined.]
Shamgar has quit [Read error: Connection reset by peer]
<workmad3> havenn: heh :) but how did you narrow it down to the 200..600 range?
<havenn> workmad3: :P
<workmad3> havenn: because mine takes 0.1s if I do that too ;)
<JDubs_> wordmad3: how can I split a string of digits by # of digits?
<Godd2> JDubs_: can you give a small example?
<havenn> workmad3: Eyeballing that nums must add up to 1000, so 998 is largest one can be. But The a-squared + b-squared means the ratio of numbers can't be that wildly off.
<workmad3> havenn: true
haxrbyte has quit [Ping timeout: 260 seconds]
Shamgar has joined #ruby
bean has joined #ruby
Kruppe has joined #ruby
<JDubs_> Godd2 lets say "222222222222222222222222222222222222222222222" but split it up into groups of 5 digits
haxrbyte has joined #ruby
Kruppe has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
Ihavenopants has quit [Read error: Connection reset by peer]
<workmad3> JDubs_: str.each_char.each_slice(5) would probably do it
<Godd2> JDubs: do you want an array?
Ihavenopants has joined #ruby
thisirs has quit [Remote host closed the connection]
kuzushi has quit [Ping timeout: 248 seconds]
<havenn> workmad3: Though my 200 was... dangerously high. :O
<JDubs_> wordmad3: what would that return?
<JDubs_> Godd2: yes preferably an array
<workmad3> JDubs_: .each_char gives you an enumerator over the characters
<Godd2> JDubs_: do you have irb open?
ckrailo has joined #ruby
<workmad3> JDubs_: .each_slice(5) will give you those characters in groups of 5
<workmad3> JDubs_: so you can then .map(&:join) them again to turn them into strings of length 5
alx- has joined #ruby
carloslopes has joined #ruby
kuzushi has joined #ruby
<workmad3> havenn: could be why it returns so fast :)
<havenn> workmad3: Just maybe. haha
banister_ has joined #ruby
<workmad3> JDubs_: if this is the one with the 100 50 digit numbers btw, if you copy-paste the list into a text editor, they're all newline separated ;)
<Godd2> havenn's is fastest: https://gist.github.com/4277741
DaltonUS has joined #ruby
<JDubs_> Godd2: yes
<Godd2> ok JDubs_ type this into irb
<Godd2> "12345678901234567890".each_char
<Godd2> then type this: "12345678901234567890".each_char.each_slice(5)
samphippen has joined #ruby
tobinharris has joined #ruby
<Godd2> workmad3: Im just getting an enumerator object form that
<Godd2> from*
<JDubs_> Godd2: I added to_a to the end and it puts in array :)
alx- has quit [Client Quit]
<JDubs_> nice solution btw
<workmad3> Godd2: yeah, that's how these things stay chainable ;)
<workmad3> so str.each_char.each_slice(5).map(&:join) will give you what you want ;)
x82_nicole has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<Godd2> ah there we go
johnmilton has joined #ruby
<Godd2> what does &:join mean?
<Godd2> is that the symbol :join ?
answer_42 has joined #ruby
chussenot has quit [Quit: chussenot]
<havenn> Godd2: #to_proc, same as: #map { |x| x.join }
<Godd2> I didnt find the to_proc method on enumerators or arrays...
GoGoGarrett has quit [Ping timeout: 245 seconds]
kevinykchan has quit [Quit: Computer has gone to sleep.]
dstywho has joined #ruby
banister_ has quit [Ping timeout: 248 seconds]
<Godd2> what am I turning into a proc?
<havenn> Symbol.to_proc
<Godd2> so its the same as :join.to_proc ?
kidoz has joined #ruby
Fretta has joined #ruby
<shevy> complexity is the root of all evil
<havenn> Godd2: #to_proc is on Symbol or Class
<havenn> almost always see the Symbol#to_proc usage though, rarely Class#to_proc
levicole has left #ruby ["["Textual IRC Client: www.textualapp.com"]"]
<workmad3> havenn: https://gist.github.com/4277821 <-- there's one that's faster than my original (about 7s) but builds a bit on your idea of limiting the range without requiring a potentially dangerous guess :)
<Godd2> but map doesnt take an argument...
<havenn> workmad3: Nice, I like the idea of honing in.
io_syl has joined #ruby
<workmad3> havenn: it's more widening the search than honing in :)
<workmad3> Godd2: map takes a block argument
<havenn> workmad3: Honing out.
atal421 has quit [Quit: atal421]
<workmad3> Godd2: &:join passes in :join.to_proc as the block argument
<havenn> Godd2: Turns symbol to proc to block.
woolite64 has quit [Read error: Connection reset by peer]
woolite64 has joined #ruby
banjara has joined #ruby
<JDubs_> Wordmad3: having trouble with problem 13...
<Godd2> ok I think I get it
<JDubs_> Wordmad3: calling "inject(:+)[0,10]" on the array of 100 numbers
GoGoGarrett has joined #ruby
<JDubs_> But getting wrong answer somehow
<workmad3> Godd2: symbol#to_proc creates a block of the form '{|target, *args| target.__send__(self, *args)}
chimkan has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
ananthakumaran1 has joined #ruby
<Godd2> [[1,2],[3,4]].map {|sub_array| sub_array.join } => ["12","34"] right?
ananthakumaran has quit [Ping timeout: 265 seconds]
haxrbyte has joined #ruby
<workmad3> Godd2: equivalent to that, yes
dr_bob has quit [Quit: Leaving.]
<workmad3> JDubs_: re-read the probject again
<Godd2> does [[1,2],[3,4]].map(:join.to_proc) => ["12","34"]
<workmad3> Godd2: the & is important
<JDubs_> wordmad3: I've read it about 10 times
<workmad3> Godd2: that passes the argument as the block parameter
axl_ has quit [Quit: axl_]
<JDubs_> workmad3: I don't see what I might have wrong...
<Godd2> ok wait wait Im not that far yet
<JDubs_> wordmad3: I summed all the numbers...then I got the first 10 digits in the sum
<Godd2> not that far in undestanding*
<JDubs_> what am I misunderstanding?
<Godd2> no JDubs_ I was talking about me not understanding something
banisterfiend has joined #ruby
<Godd2> oh nvm, you were, nvm
<workmad3> JDubs_: did you remember to turn the strings into numbers before summing them, and then turn back into a string to get the first 10 digits?
<workmad3> JDubs_: or did you just concat the strings? :D
<Godd2> so is :join.to_proc not the same as &:join ?
pkeni has joined #ruby
zigomir has left #ruby [#ruby]
<JDubs_> workmad: Forgot to turn them into ints
dr_bob has joined #ruby
<JDubs_> what do you mean by "just concat the strings?"
squidBits has joined #ruby
alx- has joined #ruby
bradhe has joined #ruby
<workmad3> JDubs_: "foo" + "bar" == "foobar"
axl_ has joined #ruby
<workmad3> JDubs_: string concatenation ;)
nateberkopec has joined #ruby
Gooder` has quit [Read error: Connection reset by peer]
Gooder` has joined #ruby
<bean> JDubs_: which # are you on now?
baroquebobcat has joined #ruby
haxrbyte has quit [Ping timeout: 245 seconds]
<bean> 13?
Guest29986 is now known as verto|off
banisterfiend has quit [Remote host closed the connection]
banjara has quit [Ping timeout: 244 seconds]
horrror has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
generali_ has joined #ruby
stayarrr has joined #ruby
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
arusso has joined #ruby
huoxito has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 265 seconds]
a_a_g has quit [Quit: Leaving.]
bradhe has quit [Remote host closed the connection]
dmiller has joined #ruby
Dreamer3 has joined #ruby
<Godd2> JDubs_: can we see a gist of P13 so far?
mjolk has joined #ruby
mjolk is now known as mjolk-work
mjolk-work is now known as mjolk
generali_ is now known as generalissimo
ephemerian has quit [Quit: Leaving.]
dmiller has quit [Ping timeout: 250 seconds]
hotovson has quit [Remote host closed the connection]
Vainoharhainen has quit [Read error: Connection reset by peer]
skum has joined #ruby
ltsstar has quit [Quit: ltsstar]
froy has quit [Quit: kablam!]
apok has joined #ruby
pkeni has quit [Remote host closed the connection]
martinklepsch has quit [Quit: Leaving]
davidcelis has joined #ruby
martinklepsch has joined #ruby
Hanmac1 is now known as Hanmac
entrenador has joined #ruby
mneorr has joined #ruby
skum has quit [Read error: Connection reset by peer]
Vainoharhainen has joined #ruby
ejholmes has quit [Quit: ejholmes]
rakl has joined #ruby
nkts has joined #ruby
eldariof has joined #ruby
alex__c2022 has quit [Quit: alex__c2022]
rellin has quit [Ping timeout: 255 seconds]
GoGoGarrett has quit [Ping timeout: 245 seconds]
matrixise has quit [Ping timeout: 246 seconds]
GoGoGarrett has joined #ruby
Iszak has quit [Quit: Textual IRC Client: www.textualapp.com]
GoGoGarr_ has joined #ruby
banjara has joined #ruby
blazes816 has joined #ruby
zommi has quit [Quit: Leaving.]
squidBits has quit [Read error: Connection reset by peer]
adeponte has joined #ruby
<maetthew> How can I define arguments passed with a method as optional?
_alejandro has quit [Remote host closed the connection]
Uranio has joined #ruby
<audy> maetthew def func(args = {}); optional_thing = args[:optional_thing]; end
art_man1 has joined #ruby
<audy> maetthew in other words, before ruby 2.0, you use a hash
<Godd2> maetthew: if your argument has a default value, that will work
kidoz has quit [Quit: Ухожу я от вас]
<maetthew> hmm ok thanks audy and Godd2, will test
alvaro_o has joined #ruby
wallerdev has joined #ruby
internetishard has joined #ruby
squidBits has joined #ruby
GoGoGarrett has quit [Ping timeout: 276 seconds]
<internetishard> havenn: hey dude, can you try running our script from yesterday? There was an error I couldn't resolve
chrisbolton_ has joined #ruby
kpshek has quit []
BoomCow has joined #ruby
<Godd2> maetthew: here's a quick example: https://gist.github.com/4278145
<havenn> internetishard: ya, sure. have a link to it?
<internetishard> it was the bash & ruby parser,
kil0byte has quit [Remote host closed the connection]
<internetishard> rather, syntax checker
kil0byte has joined #ruby
<havenn> internetishard: Ahh, gotcha. What does you current version look like?
<internetishard> the one we left of one
nick_h_ has quit [Ping timeout: 265 seconds]
<internetishard> on* I left when you left basically
<havenn> internetishard: kk, sec
nomenkun has quit [Remote host closed the connection]
nick_h has joined #ruby
<havenn> internetishard: I'm getting: NoMethodError: `extname' for "dnsmasq.conf":String
<internetishard> yep similar for me
squidBits has quit [Ping timeout: 255 seconds]
rjmt___ has quit [Ping timeout: 244 seconds]
<internetishard> line 11, @filename.extname == ...
<internetishard> havenn: I don't get it
<maetthew> Godd2, I am trying to make an !admin command for an IRC bot using Cinch (gem). Using !admin <message here> works. Using !admin without a message does not. Here is my code https://gist.github.com/4278157
maletor has joined #ruby
<bean> maetthew: thats because your regex is looking for admin and then some stuff.
<havenn> internetishard: Oooh, silly error on my part.
<bean> not just !admin
<internetishard> :) what's that?
<maetthew> bean, i tried to "admin (.+)?" as well
<maetthew> to no avail
<maetthew> from my google searches an appended "?" makes the group optional?
<bean> maetthew: so you'll also want "match /admin/, method :cmd_admin_noargs
<havenn> internetishard: https://gist.github.com/4272959
<DanBoy> maybe its the regex
<maetthew> bean, ah ofc
<maetthew> thanks
<geekbri> maybe I'm misunderstanding capture groups. I'm trying to use gsub to replace only the capture group in a regular expression but I am failing. I'm trying my_string.gsub(/myregex.*(\d)/,"replacement_string\1")
<geekbri> Anybody have some useful insight?
<havenn> internetishard: I was a bit loopy last night, looks like I tried calling #extname on the filename rather than the intended File.extname(filename)
kil0byte has quit [Ping timeout: 246 seconds]
<DanBoy> /admin\s+/ something like that maybe?
<Godd2> yea that wont match unless theres a space after admin
icole has joined #ruby
<havenn> internetishard: There are other sloppy errors. Gimme a sec. :P
banjara has quit [Ping timeout: 255 seconds]
<Godd2> geekbri: are you expecting only one digit for (\d) ?
<geekbri> Godd2: That's just a simplified match i put so i wouldn't have to paste and explain a horridly confusing regular expression
nat2610 has joined #ruby
<geekbri> Godd2: basically I have a capture group, and I want to replace that capture group with a new string. It seems to be replacing the entire line though
<maetthew> bean, works just adding another match to the same method. thanks
<maetthew> DanBoy, fwiw, that didn't do the trick :)
<bean> maetthew: npnp
<geekbri> Godd2: It looks like this: line.gsub(/'version'\s*=>\s*'(\S*)'/, "#{version}\1")
mafolz has quit [Quit: mafolz]
<Godd2> "myregexdd5".gsub(/myregex.*(\d)/,"replacement_string"+ $1)
<havenn> internetishard: Okay, fixed it: https://gist.github.com/4272959
<Godd2> => "replacement_string5"
<havenn> internetishard: Now that it works, it needs refactoring!
nwertman has quit [Ping timeout: 265 seconds]
sandGorgon has joined #ruby
rippa has joined #ruby
<Godd2> geekbri: $# (ex. $1) is a global veraible that holds that group of the most recent match
<geekbri> i see, i understand, thank you very much Godd2
<Godd2> other variables of interest are $& and $'
<geekbri> Godd2: I want to replace my capture group, not whats around it
woolite64 has quit []
<geekbri> Godd2: so basically i've got a string like 'version' => '1.0' and i want to replace 1.0 with 2.0. My regex properly detects 1.0 and stores it in a capture group
joeycarmello has joined #ruby
martinklepsch has quit [Remote host closed the connection]
woolite64 has joined #ruby
<DanBoy> havenn, no user is supplying 'filename' right :P
<Godd2> geekbri: do you know how look aheads and lookbehind work?
<geekbri> Godd2: apparently not :)
<havenn> DanBoy: Dir['**/*'].each is supplying it! :P
jonahR_ has joined #ruby
<maetthew> bean, single match works if I just make the regex "/admin(.+)?/" instead :P
<maetthew> DanBoy ^
<maetthew> for you as well
<bean> that works
<Godd2> geekbri: well you can do it without lookaheads and backrefs
<DanBoy> just wondering if a user could make the filenames
heftig has joined #ruby
<internetishard> havenn: thanks... I'm trying to figure out why it says "false" for some ruby files which it also outputs "syntax ok" for....
karakedi has joined #ruby
jonahR is now known as Guest21439
brianpWins has joined #ruby
slainer68 has quit [Remote host closed the connection]
<geekbri> Godd2: I could just use .match, store that capture group in a variable, then scan the same string again for that value and replace it with the new one I guess
<DanBoy> blah n/m :P
<geekbri> Godd2: I just assumed there was a more elegant and better way to do it.
bradhe has joined #ruby
mahmoudimus has joined #ruby
Guest21439 has quit [Ping timeout: 264 seconds]
<havenn> internetishard: system returns true if the command gives zero exit status, false for non zero exit status
Zai00 has quit [Quit: Zai00]
<internetishard> havenn: I think it's running bash files through the ruby checker, and ruby files through the bash checker...
joeycarm_ has joined #ruby
<internetishard> the ruby -c cmd outputs "Syntax OK" - and it does this after checking a bash file, for example
<Godd2> geekbri: "'version' => '1.0'".gsub(/('version' => ')\d(\.0')/, $1 + 2 + $2)
<Godd2> => "'version' => '2.0'"
froy has joined #ruby
jeffreybaird has joined #ruby
jonahR_ has quit [Client Quit]
<Godd2> oops wait
<Godd2> you need to change that 2 to a string
<Godd2> $1 + "2" + $2
<havenn> internetishard: wat?
<internetishard> output:
<internetishard> [filename]: true
<internetishard> Syntax OK
<internetishard> Which means it check the bash file for ruby
<internetishard> (filename was of a bash file)
beachandbytes has joined #ruby
altamic has joined #ruby
_alejandro has joined #ruby
vd0 has quit [Ping timeout: 260 seconds]
<Hanmac> Godd2: '\12\2'
joeycarmello has quit [Ping timeout: 260 seconds]
<shevy> I want my RubyOS now :(
pewter_tao has joined #ruby
tenmilestereo has joined #ruby
<kirotan> RubyOS?
<internetishard> havenn: did I make sense that time?
<shevy> yeah
<Godd2> Hanmac: oh cool I didn't know that :)
<shevy> kirotan, at the least, as much ruby as possible
chimkan has quit [Quit: chimkan]
<Godd2> I just thought you had to refer to the global variable every time
<kirotan> It's possible, you'd probably be still using a *nix kernel though.
<Hanmac> global variables are evil
<shevy> kirotan we can be pragmatic and use components that work, before slowly replacing them :)
<shevy> dunno what to do with GUI stuff though
kenneth has quit [Quit: kenneth]
<Godd2> Hanmac: doesn't '\&' just grab whats inside $& ?
<kirotan> Sounds like it would just be a linux/unix kernel + x server
<shevy> in the initial stage sure
<havenn> internetishard: It is checking Ruby with 'ruby -c filename' and Bash with 'bash -n filename'
<kirotan> And from there, would depend on different frameworks
<Hanmac> Godd2 no that i know ... '\1' works only and only only for gsub & friends
arturaz has quit [Read error: Operation timed out]
<kirotan> I'm partial to shoes
punkrawkR has joined #ruby
<havenn> internetishard: If the process exits with an error status, it prints "false" then the syntax result, if it exits successfully then "true" and syntax result.
<internetishard> havenn: So it's supposed to be able to say [filename]:false \n Syntax OK ?
<havenn> internetishard: Yes, that is how Kernel#system works.
<internetishard> so the false and true are meaningless
TIBS01 has quit [Read error: Connection reset by peer]
Vainoharhainen has quit [Quit: Leaving...]
bwlang has joined #ruby
mrsolo has joined #ruby
<internetishard> why would it exit with an error status/
heftig has quit [Ping timeout: 264 seconds]
<internetishard> havenn: I thought it wouldn't exit with an error status && output syntax OK
<havenn> internetishard: If an error is thrown running the script. Like if wifi isn't available and script tries to make a network call or whatev.
<havenn> internetishard: System returns only true or false.
digitalcakestudi has quit [Remote host closed the connection]
<Godd2> Hanmac: I found out another curiosity
fflush has joined #ruby
<shevy> kirotan to me it seems as if shoes isn't really developed that much anymore, I have had too many negative experiences with projects under new management
heftig has joined #ruby
<shevy> gobolinux was taken over by new folks, they quickly vanished, the project died
<Godd2> Hanmac: if you havent set anything into $2 yet from any previous matching, it will fail to do the + $2 part of what I wrote
<Godd2> but it will work if you have a line just before that says "" =~ /()()/
<internetishard> havenn: when running what script? the one it's syntax checking? I though it wasn't be "run" (that is, ruby -c file.rb doesn't count as it being run). Sounds right?
<Godd2> plus yours is faster
Animawish has joined #ruby
Animawish has left #ruby [#ruby]
<havenn> internetishard: Check this out: https://gist.github.com/4272959
cdt has quit [Ping timeout: 245 seconds]
altamic has quit [Ping timeout: 260 seconds]
<havenn> internetishard: I don't think exit statuses matter for your purpose.
Xeago has quit [Ping timeout: 250 seconds]
hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has joined #ruby
dmiller has joined #ruby
joshman_ has quit [Ping timeout: 246 seconds]
<Godd2> havenn: what if something is named ruby.sh ?
<havenn> Godd2: Then it will be considered a 'bash' file.
<Godd2> won't it match /#!.*ruby/ ?
<havenn> Godd2: Unless it begins its first line with /#!.*ruby/ :P
<havenn> Godd2: If the extension is .sh but the hash bang is ruby, it will believe itself to be a ruby file.
<Banistergalaxy> Pig, where are you? And how do you think? I have a few questions to ask. I bought my ticket. Any suggestions on how to get a chance to win the game. I have a few questions to ask. I bought my ticket.
<havenn> Godd2: checks hash-bang line, if match ignores extension
Nisstyre has quit [Ping timeout: 265 seconds]
banjara has joined #ruby
<Banistergalaxy> She is a good idea to have a guy who is a good idea to have a guy who
joshman_ has joined #ruby
<Banistergalaxy> Lol
<Godd2> ok
dmiller has quit [Ping timeout: 246 seconds]
Guest___ has joined #ruby
<Godd2> also, don't methods which end in ? conventionally return a boolean?
<Banistergalaxy> Today is the best default state) but i understand executing them later.
<Hanmac> heven i would check extension first
tommyvyo has quit [Quit: Computer has gone to sleep.]
<havenn> Hanmac: kk, will switch order :)
<JDubs> Godd2: You wanted to see my solution to 13?
<Godd2> JDubs: oh I thought you were still struggling with it, but sure!
cakehero has quit [Quit: Computer has gone to sleep.]
NobbZ|ZZzz is now known as NobbZ
chimkan_ has joined #ruby
<JDubs> nah I was out, just got back lol
<JDubs> Godd2: this was my solution https://gist.github.com/4278390
<internetishard> thank havenn, gonna go test for a bit, bbiab
<JDubs> Godd2: bout to start 14 now
otters has quit [Ping timeout: 245 seconds]
mneorr has quit [Remote host closed the connection]
<weeb1e> Hello world
<weeb1e> Does anyone here use em-http-request?
DaltonUS has quit [Quit: DaltonUS]
grzywacz has quit [Ping timeout: 265 seconds]
<libryder> if you haven't already seen that
<libryder> derp wrong window
vd0 has joined #ruby
marco_ has joined #ruby
nkts has quit [Ping timeout: 276 seconds]
marco_ is now known as Marco
phelps has quit [Quit: Textual IRC Client: www.textualapp.com]
stayarrr has quit [Quit: Linkinus - http://linkinus.com]
dr_bob has left #ruby [#ruby]
chimkan_ has quit [Quit: chimkan_]
apok has quit [Quit: apok]
chriskk has joined #ruby
kevinykchan has joined #ruby
banjara has quit [Ping timeout: 260 seconds]
lenovodroid has joined #ruby
nwertman has joined #ruby
Nisstyre has joined #ruby
DaltonUS has joined #ruby
bean has quit [Quit: Textual IRC Client: www.textualapp.com]
sn0wb1rd has joined #ruby
JustinAiken has joined #ruby
ltsstar has joined #ruby
kenneth has joined #ruby
banjara has joined #ruby
chimkan has joined #ruby
banjara has quit [Client Quit]
generalissimo has quit [Remote host closed the connection]
<JustinAiken> hi all! i have some code that looks like this: https://gist.github.com/4278448,
<JustinAiken> the @send_error proc is defined in dozens of controllers; i'd like to a way to DRY it up, anyone have a cool metaprogramming trick that will let me put that in ONE place, but still have the return statement return from the individual functions?
reppard has joined #ruby
chrstphrhrt has joined #ruby
<havenn> internetishard: Now use Celluloid::IO for concurrency and you just need to deal with the long-to-build Dir.glob array: https://gist.github.com/4272959
reppard_ has joined #ruby
tobinharris has quit [Quit: tobinharris]
chussenot has joined #ruby
samuel02 has joined #ruby
ebouchut has joined #ruby
nwertman_ has joined #ruby
tobinharris has joined #ruby
<havenn> internetishard: That way use all your cores. :)
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
arkiver has joined #ruby
haxrbyte has joined #ruby
nwertman has quit [Ping timeout: 260 seconds]
codecaster has quit [Quit: Leaving.]
jonahR has joined #ruby
<jonahR> ostia
<jonahR> wtf was that all about?
<jonahR> caller you on the line?
<jonahR> state your name
<jonahR> wrong channel
bbttxu has quit [Quit: bbttxu]
haxrbyte_ has joined #ruby
<davidcelis> ............
alexim has joined #ruby
timonv has joined #ruby
tobinharris has quit [Ping timeout: 246 seconds]
sailias has quit [Ping timeout: 250 seconds]
c0rn has joined #ruby
sailias has joined #ruby
DatumDrop has joined #ruby
tommyvyo has joined #ruby
<Banistergalaxy> Davidcelis curious things are afoot near the circle k
haxrbyte has quit [Ping timeout: 244 seconds]
Rym has joined #ruby
<Godd2> JustinAiken: Have you tried making an ErrorController class that has a class variable that calls that proc?
tvw has quit [Remote host closed the connection]
banjara has joined #ruby
fflush has quit [Ping timeout: 260 seconds]
horrror has quit [Quit: horrror]
<JDubs> Godd2: https://gist.github.com/4278540 <---current solution to problem 14. It's running right now :)
stkowski has joined #ruby
DatumDrop has quit [Ping timeout: 252 seconds]
Marco has quit [Ping timeout: 246 seconds]
<Godd2> JDubs: You may want to overload the Integer class instead of the Fixnum class
squidBits has joined #ruby
_carloslopes has joined #ruby
<JDubs> Godd2: btw, my answer was right :)
banjara has quit [Client Quit]
<JDubs> Godd2: why is that?
banjara has joined #ruby
ExxKA has quit [Quit: This computer has gone to sleep]
<Godd2> The Integer class is a parent to Fixnum AND Bignum
ebouchut has quit [Quit: This computer has gone to sleep]
<Godd2> for Projet Euler problems, it may be helpful to be using possibly very large numbers
<JDubs> ahhh
<JDubs> Good to know :)
<kenneth> hey, bundler question
<JDubs> Godd2: any tips for problem 15? not even quite sure where to start....
<kenneth> can you specify a dependency as a git / github url
maletor has quit [Quit: Computer has gone to sleep.]
lenovodroid has quit [Ping timeout: 250 seconds]
<kenneth> JDubs: what's the problem?
wermel has quit [Remote host closed the connection]
carloslopes has quit [Ping timeout: 276 seconds]
<kenneth> JDubs: brute force it?
<Godd2> I think he's having trouble turning the concepts in the problem into code to begin with
lenovodroid has joined #ruby
<Godd2> much less choose between bruteforcing and some more elegant solution
banjara has quit [Client Quit]
<JDubs> Godd2: yeah...I've never done any kind of pathing in my life,
<JDubs> Godd2 :(
<kenneth> the problem is badly specified though
banjara has joined #ruby
Rym has quit [Quit: Rym]
<kenneth> without backtracking is not specific enough a rule
nat2610 has quit [Quit: Leaving.]
hotovson has joined #ruby
<kenneth> does it mean you can only move right and down, or does it mean you can't go over corners you have already been on
<kenneth> very different solutions
<JDubs> Kenneth: right and down I think
headius has quit [Quit: headius]
<Godd2> JDubs: one thing you could do is have an array of strings like ["DDRR", "DRRD", ..., "RRDD"] which represent all the possible routes
<Godd2> D would be down and R would be right
<kenneth> in that case, it's a simple math formula, i think
maletor has joined #ruby
<davidcelis> you can only go Down or Right!?
<davidcelis> interesting...
ChampS666 has joined #ruby
<davidcelis> oh project euler. nevermind
fred909 has joined #ruby
_nitti has quit [Remote host closed the connection]
<JDubs> My only idea is to create an array of possible moves, and call combinations on it, then push those combinations into a simulator, and return how many got the simulated person to the end?
Jasko has joined #ruby
<Godd2> try that for theyre 2x2 case
<Godd2> and see if you get the same answer
apok has joined #ruby
oddraisin has quit [Read error: Connection reset by peer]
<kenneth> it sounds to me like it's simply (half of grid size) ** 2 + (same thing except accounting for the decreasing corners)
<geekbri> Godd2: thanks. Sorry I was in a meeting
stoic_squirrel has joined #ruby
vd0 has quit [Read error: Operation timed out]
<JDubs> @Godd2: I said idea lol...Doesn't mean I know how to do it :P
<JDubs> @Godd2: well...i might do
<Godd2> geekbri: no prob :) I just like to help where I can.
<kenneth> but it might be easier to solve by simply brute forcing it with a 21x21 matrix
nat2610 has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
vd0 has joined #ruby
nomenkun has joined #ruby
mneorr has joined #ruby
arietis has joined #ruby
huoxito has joined #ruby
jonahR has quit [Remote host closed the connection]
reppard has quit [Ping timeout: 246 seconds]
jonahR has joined #ruby
reppard_ has quit [Ping timeout: 244 seconds]
otters has joined #ruby
havenn has quit [Remote host closed the connection]
alex__c2022 has joined #ruby
timmow has quit [Quit: is having a nap]
<kenneth> oh, so anyone know the answer to my bundler question? whether you can specify a dependency as a github project / url, instead of a gem
thatguycraig has joined #ruby
<davidcelis> kenneth: no
<davidcelis> kenneth: you cannot
<davidcelis> and that's not a bundler question so much as a rubygems question
ejholmes has joined #ruby
prettymuchbryce has joined #ruby
phipes has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
sailias1 has joined #ruby
lolcathost has joined #ruby
nomenkun has quit [Ping timeout: 260 seconds]
<prettymuchbryce> Hello. I am semi-new to Ruby and looking to improve my code and make it more clean, and object oriented. If someone could review my code I would really appreciate it. https://github.com/prettymuchbryce/RubySocketGame/tree/master/server
<kenneth> davidcelis: what would you do then if your gem depends on a unreleased gem project on github. i know the url & commit ids that work
<kenneth> davidcelis: right now i have them as git submodules, and have bundler / gem set to the relative path
<davidcelis> All you can do is make a note in your README that people should also add "gem :blah, :github => 'blah'" to their Gemfile
<kenneth> but i don't think that'll work when i want to release my gem
<davidcelis> but gem dependencies _must_ be packaged gems that are on the server
slash_nick_away has joined #ruby
<kenneth> really? well, shit
agarie has joined #ruby
<kenneth> should i just make the entire source code for my dependencies into my gem, then?
<kenneth> kind of a bummer!
sepp2k has joined #ruby
<davidcelis> no
<davidcelis> honestly i'd just add that to the installation instructions in your README
<davidcelis> that they need to bundle one other thing from a repository
<kenneth> JDubs: by the way, the answer to your problem is pure math :) no need for path-finding
fflush has joined #ruby
sailias has quit [Ping timeout: 250 seconds]
fflush has quit [Changing host]
fflush has joined #ruby
nomenkun has joined #ruby
<Godd2> JDubs: whats the highest level of math you've studied officially?
Monie has joined #ruby
<JDubs> calculus over 10 years ago
<Godd2> do you know what 3 choose 2 means?
havenn has joined #ruby
lolcathost has quit [Ping timeout: 244 seconds]
<JDubs> nope
heftig has quit [Quit: leaving]
<JDubs> sounds familiar
<Godd2> you get a brief overview of choose in algebra 2
jcr has joined #ruby
<kenneth> JDubs: look into factorials
jeffreybaird has quit [Quit: jeffreybaird]
<JDubs> wow i wrote a rb that almost crashed my linux box :/
<JDubs> wtf
<JDubs> computer times out for about 5 minutes
<JDubs> -_-
<kenneth> JDubs: and thank your lucky stars you're not using PHP, because it's probably incapable of providing you the answer without some kind of external bignum math library
<davidcelis> JDubs: smells like infinite loop
<Godd2> JDubs: can we see your attempt so far in gist?
<JDubs> if i can get to my browser
<JDubs> my computer is going retarded
<JDubs> wtf is going on....
<JDubs> i might have to reboot
<JDubs> -_-
mascool has joined #ruby
apok has quit [Remote host closed the connection]
apok has joined #ruby
ExxKA has joined #ruby
generalissimo has joined #ruby
havenn has quit [Ping timeout: 252 seconds]
sandGorgon has quit [Ping timeout: 252 seconds]
<JDubs> ugh
pcarrier has quit []
<JDubs> i cant even get to my restart menu wtf is happening :(
<geekbri> you've probably run out of memory and your computer is swapping like crazy.
squidBits has quit [Quit: squidBits]
BigO_ has quit [Remote host closed the connection]
slash_nick_away is now known as slash_nick
voodoofish430 has joined #ruby
JDubs has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Read error: Connection reset by peer]
JDubs_ has quit [Read error: Connection reset by peer]
danieldocki has quit [Quit: Linkinus - http://linkinus.com]
JDubs has joined #ruby
<JDubs> Wow, I had to cold reboot wtf
Uranio has quit [Quit: WeeChat 0.3.8]
<JDubs> :/
havenn has joined #ruby
<shevy> JDubs your machine is going DOWN DOWN DOWN
<JDubs> shevy :(
AndChat| has joined #ruby
<JDubs> you guys wanna see the code that crashed my computer? lol
<shevy> better not
<DanBoy> is it while 1 fork() :P
<shevy> my computer could go down from the shock
<shevy> disaster is best kept locally
vlad_starkov has joined #ruby
entrenador has quit [Quit: leaving]
robotmay has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
brax4444 has joined #ruby
<Kuifje> JDubs, sleep(100); ?
brax4444 has quit [Client Quit]
AndChat- has joined #ruby
squidBits has joined #ruby
Seich is now known as seich
<JDubs> Kuifje: no it's something really innocent looking
<JDubs> Kuifje: not sure what caused it
danieldocki has joined #ruby
punkrawkR^Home has joined #ruby
punkrawkR has quit [Ping timeout: 276 seconds]
Banistergalaxy has quit [Ping timeout: 255 seconds]
brax4444 has joined #ruby
<JDubs> any idea why this crashed my computer guys?
matrixise has joined #ruby
havenn has joined #ruby
oddraisin has joined #ruby
Kruppe has joined #ruby
Guest___ has quit [Quit: Computer has gone to sleep.]
AndChat| has quit [Ping timeout: 246 seconds]
elkclone has joined #ruby
havenn has quit [Remote host closed the connection]
<davidcelis> JDubs: temp = self.dup
altamic has joined #ruby
jds has joined #ruby
altamic has quit [Client Quit]
<JDubs> davidcelis ???
g_bleezy has joined #ruby
<JDubs> davidcelis: I dont have a dup anywhere
Spaceboy has joined #ruby
<maetthew> JDubs, I think he means you should have dup
<Mon_Ouie> I'm guessing that's his point
<prettymuchbryce> Is there no concept of static variables or singletons in ruby ? Every object interacted with must be passed in as a parameter ?
slash_nick has quit [Ping timeout: 246 seconds]
_nitti has joined #ruby
companion has quit [Read error: Operation timed out]
<Mon_Ouie> There are global states — global variables, class instance variables, class variables, and constants can relatively easily be accessed from anywhere
<JDubs> Anyways, it's not in the defined method, because I never called the method
<JDubs> So it must be something to do with the combination method?
<prettymuchbryce> How do I define a constant or a global variable Mon_Ouie
<JDubs> prettymuchbryce, MON_OUIE <--contsant
<JDubs> $mon_ouie global var
<davidcelis> prettymuchbryce: constants are variables that start with a capital letter
<davidcelis> prettymuchbryce: e.g. class/module names, or SCREAMING_CASE variables
jankly has quit [Read error: Connection reset by peer]
slash_nick has joined #ruby
<prettymuchbryce> Does ruby recognize this and does not allow you to change the variable, or is this just a good habit?
seich is now known as Seich
babonk has joined #ruby
jankly has joined #ruby
<babonk> Hey all. how can I get the class from an instance?
horrror has joined #ruby
horrror has quit [Client Quit]
<davidcelis> prettymuchbryce: you can reassign, but warnings get thrown
elaptics is now known as elaptics`away
<babonk> so i can access a class variable
<davidcelis> babonk: variable.class
<davidcelis> :P
<babonk> thanks
<JDubs> So anyone have any idea why I can't run #combination?
JustinAiken has left #ruby [#ruby]
Slivka has quit [Remote host closed the connection]
banisterfiend has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
Eiam has joined #ruby
<babonk> One other question. When I have a class, I try to access a @@clasvar, but I get NoMethodError: undefined method `classvar' when i do myclass.classvar
<JDubs> babonk: you need to provide an accessor
ChampS666 has quit [Ping timeout: 252 seconds]
<babonk> gotcha.. if i dont have that there's no way to access it?
<JDubs> right
<JDubs> you can either right your own, or use the attr_accessor method to build them for you
<JDubs> eg attr_accessor :classvar
epwhorl has joined #ruby
<banisterfiend> attr_accessor wont build accessors for @@classvar
<JDubs> @banisterfiend? oh really? I've never used a classvar
<JDubs> @banisterfiend sorry for the misinformation -_-
jrist is now known as jrist-afk
<JDubs> lol!
<banisterfiend> JDubs: good :P you shouldn't need to
<Hanmac> @@vars are shitty and should not be uses in new code
<banisterfiend> JDubs: nah, you were right generally, @@vars are just stupid
<JDubs> oh i remember
<JDubs> to access a @@var
<JDubs> you need to access the CLASS not the INSTANCE of the CLASS
<JDubs> so Class.var instead of instance_of_class.var
<JDubs> amirite?
<Hanmac> Jdubs wrong
<JDubs> damnit!
* JDubs bangs head on desk
<JDubs> Do I at least get points for enthusiasm? xD
nat2610 has quit [Quit: Leaving.]
<babonk> lol
<epwhorl> isn't it Class:var?
<babonk> can someone give me a right answer?
<epwhorl> err
<epwhorl> Class::var
<banisterfiend> babonk: the right answer is you're doing it wrong :)
<kenneth> JDubs: you're doing it wrong, your solution is going to going to blow up the memory usage
<banisterfiend> (most likely)
companion has joined #ruby
<babonk> right, i realize that one should generally avoid these
<babonk> but if its in the code, how would you access it?
<babonk> Class @@clasvar end
nat2610 has joined #ruby
<JDubs> kenneth: ?
<banisterfiend> babonk: you can just access it as @@clasvar
<banisterfiend> in either the class, its subclasses, or in instances
<kenneth> JDubs the solution is around a tenth of a trillion possibilities (i can give you the exact number if you'd like, but that'd ruin the fun)
bean has joined #ruby
<babonk> banisterfiend: what if youre in the parent?
<JDubs> kenneth: for 40 numbers combined into 20?
<kenneth> JDubs: an array of those possibilities is NEVER going to fit in memory, it's going to crash
<banisterfiend> babonk: try it in irb/pry
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
<banisterfiend> babonk: you can answer these q yourself with a bit of experimentation
<JDubs> kenneth: that was my only idea :(
<babonk> k thanks
ChampS666 has joined #ruby
<kenneth> JDubs: i was wrong before, you can't brute force this, it'll be way too slow
<kenneth> JDubs: think about the math :)
<bean> JDubs: what question
<bean> JDubs: what #
<bean> :p
<JDubs> bean: 15
<JDubs> kenneth: i dont know anything about path math
<JDubs> kenneth: i dont even know what kind of math it would be
<JDubs> kenneth lol
<kenneth> JDubs: don't think about the paths, it's not pathfinding logic
<bean> psh, my 15 completes quite quickly
<kenneth> JDubs: just think of how each step affects the number of possibilities
<JDubs> kenneth: ??? but it is paths...i dont undderstand
<JDubs> bean: my code for number 15 made me have to cold boot lol
<bean> haha
ThaDick has joined #ruby
<bean> so, there is a formula to determine that, JDubs
<bean> this is more of a math question than anything
schaerli has joined #ruby
schaerli has quit [Remote host closed the connection]
<bean> First, i have an Integer.factorial method
<kenneth> (also for fun: class Integer; def !; (1..self).reduce(&:*); end; end)
<bean> class Integer; def factorial; (2..self).inject(1) { |prod, n| prod * n };end;end
<bean> is mine.
altious has joined #ruby
<bean> same thing basically.
<banisterfiend> kenneth: reduce(:*) works actually
<kenneth> banisterfiend: i tend to stay away from the :symbol argument to map / reduce as a code style thing, but yeah
beachandbytes has quit [Ping timeout: 245 seconds]
niklasb has joined #ruby
<banisterfiend> np
beachandbytes has joined #ruby
<kenneth> the way ruby handles those things is a *little* shady though
punkrawkR^Home has quit [Ping timeout: 256 seconds]
<bean> JDubs: the general formula for finding number of paths is (columns + rows)!/(columns! * rows!)
<kenneth> 40.! / 20.! / 20.!
rh1n0 has joined #ruby
<Godd2> JDubs: the exclamation point is important in bean's formula
<bean> (rows+cols).factorial / (rows.factorial * cols.factorial)
<bean> is another way of saying it
<kenneth> because it doesn't make sense that map / reduce can take either a real function / closure, or a method to execute on the object, and then passing it one less argument than it ordinarily would
<kenneth> or maybe i'm not understanding the way it works
<Hanmac> kenneth, bean, banisterfiend i should tell you guys that inject may need an default value when you do something like that ... overwise an nil could happen
<Godd2> JDubs: but remember, .factorial and .! aren't methods available to you in Ruby, you'l have to write one
<bean> cool story.
squidBits has quit [Ping timeout: 255 seconds]
<Godd2> cool... beans?
headius has joined #ruby
<bean> Hanmac: explain how a nil could happen
<JDubs> Godd2: Yeah I write my own fixnum methods often :)
<JDubs> Where did you guys find a formula for pathing
<Hanmac> bean when you does not use default value and then (2..self).inject(:*) where self = 0
pewter_tao has quit [Ping timeout: 255 seconds]
Adget has joined #ruby
<Godd2> JDubs: it's not about the pathing, its about the number of choices of paths you have
<Godd2> the rules of which path you can take in the problem lead to the formula for choosing. the fact that it's a path is irrelevant
<banisterfiend> Hanmac: have you read any german poetry by holderlein
<Hanmac> no
<kenneth> JDubs: i think you're heading into bignum territory here, no longer fixnum
bluenemo has quit [Read error: Connection reset by peer]
arkiver has quit [Quit: Leaving]
<kenneth> JDubs: the solution won't fit in a 32-bit int, and the intermediate values won't fit into even a 64-bit int
<kenneth> 40.! == somewhere around 8 quadrillions IIRC
<kenneth> er
<kenneth> i mean
phelps has joined #ruby
<Godd2> 40.!.instance_of?(Fixnum) == false
<JDubs> Godd2: lol
<banisterfiend> the fuck
Adget has quit [Client Quit]
Adget has joined #ruby
<kenneth> Quattuordecillion
<kenneth> there it is
<kenneth> stupid big number names
<kenneth> that's 10^45
<Godd2> JDubs: on line 16 of your gist
<kenneth> :p
<Godd2> y-+1 ??
ExxKA has quit [Quit: This computer has gone to sleep]
TylerE has joined #ruby
<fflush> salut
pasties has joined #ruby
jekotia has joined #ruby
stoic_squirrel has quit [Quit: Textual IRC Client: www.textualapp.com]
<TylerE> Is there any standard idiom for "I have a hash of lists, and for I want to append to the list for key 'foo', or create a key 'foo' with a one item list if 'foo' isn't already in the hash"
<kenneth> TylerE: hash[:foo] ||= []; hash[:foo] << obj
<kenneth> you can combine that i think
<kenneth> (hash[:foo] ||= []) << obj
<banisterfiend> Hash.new { |h, k| h[k] ||= [] }
<davidcelis> hash = Hash.new { |
<davidcelis> banisterfiend: fuck you
<banisterfiend> davidcelis: u my girl
ebouchut has joined #ruby
<TylerE> thanks
<davidcelis> the ||= isnt necessary tho, it can just be =
<davidcelis> (in the proc)
<kenneth> or maybe i didn't understand the question :p
<dstywho> ls
havenn has joined #ruby
heftig has joined #ruby
Elhu has joined #ruby
<davidcelis> dstywho: no
<Hanmac> when you use default proc you lose the ability to marshal the hash
<davidcelis> how so
<kenneth> well, when unserializing it, you'd lose the default hash
<kenneth> er proc
<banisterfiend> Hanmac: same with Hash.new(0)
<kenneth> default prods are kinda shady
<kenneth> procs*
<Hanmac> banisterfiend no
<davidcelis> default procs are great
<banisterfiend> Hanmac: really?
<banisterfiend> let me try
s1n4 has joined #ruby
<Hanmac> Marshal.dump(Hash.new { |h, k| h[k] ||= [] }) #> TypeError: can't dump hash with default proc
<Hanmac> Marshal.dump(Hash.new(0)) #=> "\x04\b}\x00i\x00"
<davidcelis> Hash.new { |h, k| h[k] = Hash.new(&h.default_proc)
<kenneth> it's much cleaner to simply provide default values when you write to it, imho
<kenneth> (hash[:foo] ||= []) << :bar # like this :)
bluOxigen has joined #ruby
<banisterfiend> Hanmac: yeah you're right, but what about when you marshal it with YAML ?
<Hanmac> thats an other piece of paper
emaiax has joined #ruby
<davidcelis> works with YAML
<davidcelis> and JSON; but yes, of course you'd lose the default_proc
<JDubs> Hey guys, my solution to euler 17: https://gist.github.com/4279169
vd0 has quit [Quit: WeeChat 0.3.9.2]
<prettymuchbryce> Theres got to be a better way than passing this object around to all my methods. Annoying. https://github.com/prettymuchbryce/RubySocketGame/blob/master/server/game.rb
vd0 has joined #ruby
Seich is now known as Seichleon
Seichleon is now known as Seich
companion has quit [Ping timeout: 246 seconds]
Rydefalk has quit [Remote host closed the connection]
<kenneth> prettymuchbryce: what's with the all caps variables? all caps are supposed to be for constants
<prettymuchbryce> These are "constants", I just don't know what I'm doing. How should I do it?
<kenneth> you're storing them as ivars
<davidcelis> constants should be defined within the class, not an instance
<kenneth> if they're constants, just define them as such
_carloslopes has quit [Remote host closed the connection]
qubit has quit [Ping timeout: 244 seconds]
timonv has quit [Ping timeout: 265 seconds]
ChampS666 has quit []
<prettymuchbryce> So they don't need to be attr_accessor ?
<prettymuchbryce> I just declare them at the top of the class?
<JDubs> apeiros_ you around dude?
<prettymuchbryce> DIRECTION_UP = 0
<davidcelis> prettymuchbryce: pretty much, bryce
qubit has joined #ruby
<prettymuchbryce> :P
<davidcelis> and then you access them like Class::CONSTANT
<prettymuchbryce> Oh okay I see. Well that last part is good to know.
Elhu has quit [Quit: Computer has gone to sleep.]
s1n4 has quit [Quit: leaving]
maletor has quit [Quit: Computer has gone to sleep.]
havenn has quit [Ping timeout: 260 seconds]
ryanlecompte has joined #ruby
reppard has joined #ruby
lenovodroid has quit [Ping timeout: 255 seconds]
freakazoid0223 has joined #ruby
camonz_ has joined #ruby
ltsstar has quit [Ping timeout: 250 seconds]
phipes has quit [Ping timeout: 246 seconds]
blaxter has quit [Quit: foo]
jazzanova has joined #ruby
phelps has quit [Ping timeout: 244 seconds]
<jazzanova> how can I find out where a particular Class defined (which file on disk), at run-time
eldariof has quit []
lenovodroid has joined #ruby
<banisterfiend> jazzanova: there's not always a straight answer to that question cos classes can be reopened and monkeypatched in multiple files
<jazzanova> ok, then a module ?
<banisterfiend> jazzanova: same thing
<jazzanova> can I see a list of all read files ?
fred909 has quit [Ping timeout: 260 seconds]
<banisterfiend> jazzanova: $LOAD_PATH
<banisterfiend> no
<banisterfiend> $LOADED_FEATURES
<banisterfiend> jazzanova: if you have a standard way of naming files, you could grep that list for the snake-cased version of your classes name
<banisterfiend> class's
phipes has joined #ruby
reppard has quit [Ping timeout: 248 seconds]
jeffreybaird has joined #ruby
emmanuelux has joined #ruby
phelps has joined #ruby
phelps has quit [Max SendQ exceeded]
jtharris has quit [Quit: WeeChat 0.3.9.2]
phelps has joined #ruby
atal421 has joined #ruby
companion has joined #ruby
Gooder`` has joined #ruby
iTitou has joined #ruby
iTitou has left #ruby [#ruby]
Gooder` has quit [Read error: Connection reset by peer]
kirun has joined #ruby
iTitou has joined #ruby
iTitou has quit [Quit: leaving]
<jazzanova> thanks
x82_nicole has quit [Quit: Computer has gone to sleep.]
DaZ has quit [Ping timeout: 260 seconds]
mustmodify has joined #ruby
<mustmodify> I convinced a .NET dev to join the dark side or the -- ruby side or whatever. She is having trouble accessing tryruby.org -- anyone know if that site is supposed to be working? If so, how can I help?
Elhu has joined #ruby
<mustmodify> If it's OT for this channel, can anyone suggest a more appropriate one?
timonv has joined #ruby
jrist-afk is now known as jrist-
jrist- is now known as jrist
slainer68 has joined #ruby
<banisterfiend> mustmodify: it works fine for me
noric has joined #ruby
jazzanova has quit [Quit: Page closed]
<Mon_Ouie> Same here
vd0 has quit [Quit: WeeChat 0.3.9.2]
jfl0wers has quit [Quit: jfl0wers]
vd0 has joined #ruby
ryanf has joined #ruby
<banisterfiend> mustmodify: but there's tonnes of sites like tryruby.org try http://rubymonk.com/
<mustmodify> well she says it's up and down.
<banisterfiend> mustmodify: ah ok, tell her to try rubymonk.com instead
<banisterfiend> there's a few other ones too
Gooder`` has quit [Read error: Connection reset by peer]
burgestrand has joined #ruby
Gooder`` has joined #ruby
<GeekOnCoffee> I just got an application error on tryruby.org
GoGoGarr_ has quit [Remote host closed the connection]
<GeekOnCoffee> banisterfiend: http://www.codeschool.com/courses/try-ruby
<mustmodify> GeekOnCoffee: Oh good, I was starting to feel like a troll.
ryannielson has left #ruby [#ruby]
ner0x has quit [Quit: Leaving]
answer_42 has quit [Quit: WeeChat 0.3.9.2]
ner0x has joined #ruby
noric has left #ruby [#ruby]
Adget has quit [Quit: Adget]
<DanBoy> tryruby is down
<DanBoy> i was messing with it last night
rh1n0 has quit [Quit: Linkinus - http://linkinus.com]
Elhu has quit [Quit: Computer has gone to sleep.]
Schmidt has quit [Ping timeout: 260 seconds]
niklasb has quit [Read error: No route to host]
daniel_hinojosa has joined #ruby
stoic_squirrel has joined #ruby
Schmidt has joined #ruby
cdt has joined #ruby
ossareh has quit [Ping timeout: 260 seconds]
shevy has quit [Ping timeout: 248 seconds]
emmanuelux has quit [Remote host closed the connection]
vd0 has quit [Ping timeout: 244 seconds]
himsin has joined #ruby
emmanuelux has joined #ruby
Gooder``` has joined #ruby
mengu has joined #ruby
Morkel has quit [Read error: Connection reset by peer]
Gooder`` has quit [Ping timeout: 246 seconds]
vd0 has joined #ruby
Morkel has joined #ruby
headius has quit [Read error: Connection reset by peer]
headius has joined #ruby
atal421 has quit [Quit: atal421]
Gu_______ has joined #ruby
Elhu has joined #ruby
maletor has joined #ruby
Gu_______ is now known as asteve
asteve has quit [Changing host]
asteve has joined #ruby
itchyouch has joined #ruby
altious2 has joined #ruby
rezzack has joined #ruby
tenmilestereo[aw has joined #ruby
hotovson_ has joined #ruby
mneorr_ has joined #ruby
g_bleezy_ has joined #ruby
apok_ has joined #ruby
phipes has quit [Quit: phipes]
shevy has joined #ruby
chrstphrhrt_ has joined #ruby
chimkan has left #ruby [#ruby]
jeedey_ has joined #ruby
ebouchut has quit [Quit: This computer has gone to sleep]
emaiax_ has joined #ruby
mengu_ has joined #ruby
mengu_ has quit [Changing host]
mengu_ has joined #ruby
johnmilton has quit [Ping timeout: 244 seconds]
chrisbolton__ has joined #ruby
gurps_ has joined #ruby
havenn has joined #ruby
camonz- has joined #ruby
alex__c2022_ has joined #ruby
chrismcgh has joined #ruby
kevinykchan has quit [Ping timeout: 265 seconds]
ehc_ has joined #ruby
pavelz_ has joined #ruby
chiel_ has joined #ruby
wang_ has joined #ruby
irving_ has joined #ruby
d-best has joined #ruby
matchaw has joined #ruby
swex_ has joined #ruby
nat2610 has quit [Quit: Leaving.]
swex has quit [Ping timeout: 265 seconds]
ruzu2 has joined #ruby
kloeri_ has joined #ruby
ruzu has quit [Disconnected by services]
ruzu2 is now known as ruzu
ruzu has quit [Changing host]
ruzu has joined #ruby
davidcel_ has joined #ruby
xAndy| has joined #ruby
nomenkun has quit [Remote host closed the connection]
danieldocki has quit [Quit: Leaving...]
kevinykchan has joined #ruby
phelps has quit [Quit: Textual IRC Client: www.textualapp.com]
idzuna has quit [Read error: Connection reset by peer]
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
altious2 has quit [Ping timeout: 256 seconds]
pothibo has quit [Quit: pothibo]
aetaric_ has joined #ruby
Godd2 has quit [Ping timeout: 245 seconds]
crazed- has joined #ruby
<mustmodify> DanBoy: When you say "messing with it" do you mean trying to use it, or changing the code in a way that broke it? :)
katherinem13_ has joined #ruby
mengu has quit [*.net *.split]
ner0x has quit [*.net *.split]
Schmidt has quit [*.net *.split]
camonz_ has quit [*.net *.split]
freakazoid0223 has quit [*.net *.split]
companion has quit [*.net *.split]
cdt has quit [*.net *.split]
himsin has quit [*.net *.split]
emmanuelux has quit [*.net *.split]
emaiax has quit [*.net *.split]
altious has quit [*.net *.split]
g_bleezy has quit [*.net *.split]
ThaDick has quit [*.net *.split]
elkclone has quit [*.net *.split]
AndChat- has quit [*.net *.split]
apok has quit [*.net *.split]
hotovson has quit [*.net *.split]
sepp2k has quit [*.net *.split]
tenmilestereo has quit [*.net *.split]
alex__c2022 has quit [*.net *.split]
mneorr has quit [*.net *.split]
_alejandro has quit [*.net *.split]
huoxito has quit [*.net *.split]
chrstphrhrt has quit [*.net *.split]
alexim has quit [*.net *.split]
davidcelis has quit [*.net *.split]
karakedi has quit [*.net *.split]
chrisbolton_ has quit [*.net *.split]
gurps has quit [*.net *.split]
kloeri has quit [*.net *.split]
ehc has quit [*.net *.split]
jeedey has quit [*.net *.split]
katherinem13 has quit [*.net *.split]
reactormonk has quit [*.net *.split]
d-snp has quit [*.net *.split]
aetaric has quit [*.net *.split]
nopper has quit [*.net *.split]
crazedpsyc has quit [*.net *.split]
irving has quit [*.net *.split]
willb has quit [*.net *.split]
pavelz has quit [*.net *.split]
chiel has quit [*.net *.split]
xAndy has quit [*.net *.split]
yugui_zzz has quit [*.net *.split]
alejandro_ has joined #ruby
wang has quit [*.net *.split]
zz_chrismcg has quit [*.net *.split]
apok_ is now known as apok
chrstphrhrt_ is now known as chrstphrhrt
alex__c2022_ is now known as alex__c2022
aetaric_ is now known as aetaric
davidcel_ is now known as davidcelis
katherinem13_ is now known as katherinem13
nopper` has joined #ruby
companion has joined #ruby
crazed- is now known as crazedpsyc
maletor has quit [Ping timeout: 276 seconds]
itchyouch has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
hotovson_ has quit [Remote host closed the connection]
juarlex_ has joined #ruby
patronus1 has joined #ruby
_dnyy has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
apok_ has joined #ruby
danieldocki has joined #ruby
robert__ has joined #ruby
mjolk2 has joined #ruby
ephemerian has joined #ruby
danieldocki has quit [Client Quit]
emmanuelux has joined #ruby
babonk_ has joined #ruby
babonk_ has quit [Changing host]
babonk_ has joined #ruby
emaiax_ has quit [Remote host closed the connection]
himsin has joined #ruby
d34th4ck3r_ has joined #ruby
elkclone has joined #ruby
elkclone has quit [Read error: Connection reset by peer]
willb has joined #ruby
frytaz1_ has joined #ruby
huoxito has joined #ruby
ner0x has joined #ruby
freakazoid0223 has joined #ruby
Schmidt has joined #ruby
reactormonk has joined #ruby
babinho_ has joined #ruby
busybox43 has joined #ruby
sepp2k has joined #ruby
kloeri has joined #ruby
kandinsk1 has joined #ruby
jcr has quit [Ping timeout: 255 seconds]
dmerrick_ has joined #ruby
strtok_ has joined #ruby
wang has joined #ruby
cdt has joined #ruby
xAndy| is now known as xAndy
xAndy has quit [Changing host]
xAndy has joined #ruby
xsdg_ has joined #ruby
alexspeller has joined #ruby
yugui_zzz has joined #ruby
ccooke_ has joined #ruby
parus___ has joined #ruby
jbpros_ has joined #ruby
asuka_ has joined #ruby
jds__ has joined #ruby
adamholt_ has joined #ruby
drizz_ has joined #ruby
alexspeller has quit [Remote host closed the connection]
hackeron_ has joined #ruby
epochwolf|2 has joined #ruby
KindOne- has joined #ruby
bean__ has joined #ruby
<DanBoy> hah :P
g_bleezy_ has quit [Remote host closed the connection]
dcope_ has joined #ruby
SJrX has joined #ruby
<DanBoy> mustmodify, just checking if it was up :P
Mch1 has joined #ruby
mneorr has joined #ruby
SCommette_ has joined #ruby
Shamgar_ has joined #ruby
banjara has quit [Quit: Leaving.]
grn_ has joined #ruby
banjara has joined #ruby
robert__ has quit [Ping timeout: 260 seconds]
tenmilestereo[aw has quit [Ping timeout: 260 seconds]
banjara has quit [Client Quit]
arubin has joined #ruby
s4muel_ has joined #ruby
sixtenei1hty has joined #ruby
banjara has joined #ruby
nricciar_ has joined #ruby
kloeri_ has quit [*.net *.split]
mneorr_ has quit [*.net *.split]
apok has quit [*.net *.split]
wang_ has quit [*.net *.split]
bean has quit [*.net *.split]
lenovodroid has quit [*.net *.split]
agarie has quit [*.net *.split]
mjolk has quit [*.net *.split]
Shamgar has quit [*.net *.split]
SCommette has quit [*.net *.split]
babonk has quit [*.net *.split]
audy has quit [*.net *.split]
dnyy has quit [*.net *.split]
dcope has quit [*.net *.split]
skaczor has quit [*.net *.split]
d34th4ck3r has quit [*.net *.split]
dmerrick has quit [*.net *.split]
yshh has quit [*.net *.split]
kudos has quit [*.net *.split]
jaredrhine_ has quit [*.net *.split]
juarlex has quit [*.net *.split]
chaosis has quit [*.net *.split]
robert_ has quit [*.net *.split]
grn has quit [*.net *.split]
busybox42 has quit [*.net *.split]
epochwolf has quit [*.net *.split]
Tarential has quit [*.net *.split]
darkc0met has quit [*.net *.split]
KindTwo has quit [*.net *.split]
SJr has quit [*.net *.split]
jds has quit [*.net *.split]
xsdg has quit [*.net *.split]
babinho has quit [*.net *.split]
drizz has quit [*.net *.split]
perun_ has quit [*.net *.split]
ccooke has quit [*.net *.split]
volte has quit [*.net *.split]
kandinski has quit [*.net *.split]
sixteneighty has quit [*.net *.split]
asuka has quit [*.net *.split]
hackeron has quit [*.net *.split]
strtok has quit [*.net *.split]
elaptics`away has quit [*.net *.split]
anekos has quit [*.net *.split]
patronus_ has quit [*.net *.split]
frytaz1 has quit [*.net *.split]
jbpros has quit [*.net *.split]
cam` has quit [*.net *.split]
adamholt has quit [*.net *.split]
s4muel has quit [*.net *.split]
arubin_ has quit [*.net *.split]
nricciar has quit [*.net *.split]
msch has quit [*.net *.split]
parus has quit [*.net *.split]
Mchl has quit [*.net *.split]
babonk_ is now known as babonk
Sp4rKy has quit [*.net *.split]
jbpros_ is now known as jbpros
bean__ is now known as bean
dmerrick_ is now known as dmerrick
apok_ is now known as apok
SCommette_ is now known as SCommette
epochwolf|2 is now known as epochwolf
oGminor has joined #ruby
anekos has joined #ruby
agarie has joined #ruby
skaczor has joined #ruby
chaosis has joined #ruby
robert_ has joined #ruby
darkc0met has joined #ruby
yshh has joined #ruby
elaptics`away has joined #ruby
<rking> Is there a thing like a = [1]; a += [2] ⇒ [1,2] but works as a method call?
<rking> Oh, a.push *[2]
cdt has quit [Ping timeout: 260 seconds]
bluOxigen has quit [Ping timeout: 260 seconds]
scriabin has joined #ruby
banjara has quit [Client Quit]
Tarential has joined #ruby
cam` has joined #ruby
banjara has joined #ruby
Mon_Ouie has quit [Ping timeout: 260 seconds]
alexim has joined #ruby
<banisterfiend> rking: a << 2
volte has joined #ruby
<ruzu> a << 2
<ruzu> damn!
<rking> Ok ok
<rking> a = [1]; b = [2]; a.push *b # score to beat
Sp4rKy has joined #ruby
<vd0> rking: a.concat [2]
audy has joined #ruby
jaredrhine has joined #ruby
perun_ has joined #ruby
kudos has joined #ruby
himsin has quit [Quit: Leaving]
Sp4rKy has quit [Max SendQ exceeded]
kudos has quit [Changing host]
kudos has joined #ruby
<rking> Aha! That's the ticket
lenovodroid has joined #ruby
fred909 has joined #ruby
Sp4rKy has joined #ruby
<scriabin> I'm working on a project that has some concurrency issues: https://gist.github.com/4279737 is there a way to do this?
robert_ has quit [Ping timeout: 276 seconds]
atal421 has joined #ruby
<banisterfiend> :P
<banisterfiend> rking: << is faster than +=
<banisterfiend> << just appends to current one
<banisterfiend> += creates a new array
<banisterfiend> rking: also, you could use: a.push 2
<banisterfiend> rather than a.push *[2]
jcr has joined #ruby
<havenn> scriabin: You want to run the method asynchronously? Or already are and are having issues?
nomenkun has joined #ruby
<rking> banisterfiend: But I already have an array
<banisterfiend> rking: ah ok, then i've always used a.push *b
bluOxigen has joined #ruby
tjbiddle has joined #ruby
maletor has joined #ruby
wallerdev has quit [Quit: wallerdev]
<rking> Yeah, that's OK, but don't you want to just reach up and pinch 'a.concat b's cheeks?
<heftig> scriabin: what's the problem?
<rking> Which, on the rking "Golf tokens not chars", that scores better.
fflush has quit [Ping timeout: 256 seconds]
<apeiros_> banisterfiend: a.push *b is slower than a.concat b
gbchaosmaster has joined #ruby
dstywho has quit [Quit: WeeChat 0.3.8]
<banisterfiend> i didnt actually know about Array#concat ;)
<banisterfiend> k00
jcr has quit [Ping timeout: 276 seconds]
nat2610 has joined #ruby
tomsthumb has quit [Quit: Leaving.]
tjbiddle_ has joined #ruby
cdt has joined #ruby
<rking> Nobody cares about efficiency at that level.
<rking> If they did they'd use C
sepp2k1 has joined #ruby
tjbiddle__ has joined #ruby
tjbiddle has quit [Read error: Connection reset by peer]
tjbiddle__ is now known as tjbiddle
schaerli has joined #ruby
sepp2k has quit [Ping timeout: 260 seconds]
mustmodify has left #ruby [#ruby]
<apeiros_> rking: not correct
johnmilton has joined #ruby
tjbiddle_ has quit [Ping timeout: 260 seconds]
luckyruby has joined #ruby
dcope_ is now known as dcope
<davidcelis> lol...
<babonk> Question: How to put ruby inline of YAML?
<apeiros_> babonk: you can't.
digifiv5e has quit [Changing host]
digifiv5e has joined #ruby
<apeiros_> you could make an erb template, run it through erb and then read it as yaml
yshh has quit [Read error: Connection reset by peer]
Banistergalaxy has joined #ruby
cdt has quit [Ping timeout: 260 seconds]
jcr has joined #ruby
Guest73164 has quit [Quit: Guest73164]
yshh has joined #ruby
[Neurotic] has joined #ruby
<rking> apeiros_: It's such a meaningless burden to tote around. The hard part of code is figuring out what you want to say, not microefficiency
cascalheira has quit [Quit: Leaving...]
maletor has quit [Quit: Computer has gone to sleep.]
thatguycraig has left #ruby [#ruby]
<apeiros_> rking: that's a generalization, and generally true. but only generally, not universally.
x82_nicole has joined #ruby
cdt has joined #ruby
beachandbytes has quit [Ping timeout: 244 seconds]
gyre007 has quit [Remote host closed the connection]
cantonic_ has joined #ruby
bluOxigen has quit [Ping timeout: 244 seconds]
maletor has joined #ruby
dmiller has joined #ruby
cantonic has quit [Ping timeout: 276 seconds]
cantonic_ is now known as cantonic
<rking> Let me put it this way.
Xeago has joined #ruby
<rking> It's inappropriate on IRC to mention, because it gets n00bs of the mentality that they need to think about junk like that.
<rking> And it will almost never, ever matter.
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
<apeiros_> I disagree.
<apeiros_> it costs almost nothing to know that. It costs almost nothing to properly employ it. If you prefer to stay ignorant, that's your choice to make for you, and only for yourself.
ner0x has quit [Quit: Leaving]
<apeiros_> firmware update, rebooting…
banjara has quit [Quit: Leaving.]
<rking> There is a non-zero amount of thinking-power wasted every time you're writing an algorithm and you think about that.
noric has joined #ruby
apeiros_ has quit [Remote host closed the connection]
Godd2 has joined #ruby
whowantstolivef1 has joined #ruby
banjara has joined #ruby
<Godd2> Is there a method in Java for Arrays like Ruby's Array#uniq ?
<maetthew> Godd2, /j #java
<maetthew> :P
<Godd2> it's private :(
chussenot has quit [Quit: chussenot]
enroxorz-work has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
C0deMaver1ck has quit [Remote host closed the connection]
<blazes816> may not be the best way but idk java so it's the best you'll get from me. somebody else may have something better.[
apeiros_ has joined #ruby
<apeiros_> back
<Godd2> That's okay, I shouldn't have asked here anyhow :P
<Godd2> thank you
Iszak has joined #ruby
yalue has quit [Read error: Connection reset by peer]
<blazes816> np. idk what it is but i'm sure there's a good java chan somewhere
vd0 has quit [Ping timeout: 244 seconds]
chussenot has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9.2]
C0deMaver1ck has joined #ruby
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
reppard has joined #ruby
prettymuchbryce has left #ruby [#ruby]
lenovodroid has quit [Read error: Connection reset by peer]
Morkel has quit [Quit: Morkel]
Mon_Ouie has quit [Read error: Connection reset by peer]
reppard_ has joined #ruby
burgestrand1 has joined #ruby
burgestrand has quit [Ping timeout: 260 seconds]
cdt has quit [Ping timeout: 260 seconds]
TTilus has quit [Ping timeout: 255 seconds]
<Godd2> oh I found it it's double pound
<Godd2> so ##java
<Godd2> meh
artm has quit [Quit: artm]
<maetthew> Godd2, when I join #java i get re-directed to ##java
carlyle has quit [Read error: Connection reset by peer]
<Godd2> I did /j #java....
<Godd2> maybe its htis webchat client
<maetthew> yeah perhaps
carlyle has joined #ruby
Mon_Ouie has joined #ruby
artm has joined #ruby
uris has quit [Ping timeout: 260 seconds]
timonv has quit [Remote host closed the connection]
aquaranto has quit [Remote host closed the connection]
elaptics`away is now known as elaptics
J-_-L has joined #ruby
BigO_ has joined #ruby
Godd2 has quit [Quit: Page closed]
TTilus has joined #ruby
fflush has joined #ruby
swex has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
lenovodroid has joined #ruby
carlyle has joined #ruby
swex_ has quit [Ping timeout: 260 seconds]
<shevy> it's freenode policy, to distinguish between ## and #
<shevy> it's very stupid, galaxynet never had that
alvaro_o has quit [Read error: Connection reset by peer]
<DanBoy> i remember when this place used to be called irc.opensource.net
BSaboia has joined #ruby
<UdontKnow> DanBoy: then you don't really remember
<UdontKnow> DanBoy: openprojects.net :)
<DanBoy> well i was 14
<UdontKnow> I was staff
<asteve> ya, I remember when it switched to freenode it blew my mind
<DanBoy> hanging out in #c
<asteve> but I don't remember what it was called
<shevy> java.util.Set result = new java.util.HashSet(java.util.Arrays.asList(test));
<asteve> UdontKnow: that's where you wrong, I do know
<DanBoy> i thought it was opensource.net but i knew it was 'open' something
<asteve> actually, no, in this case you're right; I wasn't sure what it was called
<shevy> was java really such a huge improvement over C and C++ ?
<asteve> shevy: there are claims that it is faster than C
uris has joined #ruby
<asteve> plus clojure sits ontop of the java stack
<asteve> and stuff
<bean> anything that runs on top of the JVM is going to be pretty fast. imo.
<bean> Scala, etc.
vd0 has joined #ruby
jrajav has quit [Quit: I tend to be neutral about apples]
geekbri has quit [Remote host closed the connection]
<fflush> boa noite
epwhorl has quit [Ping timeout: 264 seconds]
reppard has quit [Ping timeout: 265 seconds]
<havenn> asteve: And JRuby :P
cascalheira has joined #ruby
reppard has joined #ruby
schaerli has quit [Read error: Connection reset by peer]
atal421_ has joined #ruby
atal421 has quit [Read error: Connection reset by peer]
atal421_ is now known as atal421
robotmay has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
haxrbyte_ has quit [Read error: Connection reset by peer]
<headius> the JVM can be as fast or faster than C, but you have to write in a specific way to get that
lamba has left #ruby [#ruby]
<kenneth> woohoo just pushed my second gem
g_bleezy has joined #ruby
mjolk2 is now known as mjolk
sailias1 has quit [Ping timeout: 264 seconds]
mark_locklear has quit [Remote host closed the connection]
<rking> headius: What's the general idea on what that specific way is?
mjolk is now known as Guest8169
<headius> write C-like Java :)
fflush has quit [Changing host]
fflush has joined #ruby
<headius> don't use objects, make it all static methods…it will optimize at least as good as C
My_Hearing has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
<fflush> ...
<headius> for OO stuff, Java can usually be C++ apps of the same complexity, but Java makes it easier to make it way more complex
<headius> be = beat
robustus has quit [Quit: ZNC - http://znc.in]
Markvilla has joined #ruby
reppard has quit [Ping timeout: 250 seconds]
reppard_ has quit [Ping timeout: 264 seconds]
robustus has joined #ruby
Mon_Ouie has quit [Ping timeout: 260 seconds]
maletor has joined #ruby
maletor has quit [Max SendQ exceeded]
tommyvyo has quit [Ping timeout: 265 seconds]
maletor has joined #ruby
epwhorl has joined #ruby
<kenneth> headius: or you could… you know… just use c :)
<rking> headius: Aha. Thanks.
Coolhand|laptop has quit [Ping timeout: 245 seconds]
artm has quit [Quit: artm]
dmiller has quit [Remote host closed the connection]
Iszak has quit []
billy_ran_away has joined #ruby
havenn has quit [Remote host closed the connection]
Kuifje has quit [Ping timeout: 246 seconds]
Ihavenopants has quit [Read error: Connection reset by peer]
Marco has joined #ruby
WanderingGlitch has quit [Ping timeout: 264 seconds]
Ihavenopants has joined #ruby
<billy_ran_away> Anyone really familiar with the Webrick server? I want to verify clients with their SSL certificate, so I want that passed on in my request headers, but I don't want to fail to if they don't have a required cert...
pwelch has quit [Quit: pwelch]
WanderingGlitch has joined #ruby
squidBits has joined #ruby
chussenot has quit [Quit: chussenot]
stoic_squirrel has quit [Quit: Textual IRC Client: www.textualapp.com]
<billy_ran_away> So I got the first half working with setting :SSLVerifyClient => OpenSSL::SSL::VERIFY_PEER, that is passes on the client SSL cert and I can authorize them.
<billy_ran_away> But if the client doesn't present a CA signed cert generated key… they get an ugly error saying failed to neogiate key.
<billy_ran_away> But if I do :SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE the webrick server doesn't pass on the client's ssl cert!
<kenneth> billy_ran_away: it's typical to handle SSL termination on a load balancer before traffic even reaches the ruby web server
tommyvyo has joined #ruby
<headius> kenneth: yeah, I think I'll pass :)
<kenneth> billy_ran_away: also, WEBrick is more of a development server, I like to use Thin in production
<billy_ran_away> kenneth: ….yea I was Apache in production but wanted to develop this feature first.
chussenot has joined #ruby
<billy_ran_away> *using
<billy_ran_away> err *use
chussenot has quit [Client Quit]
<billy_ran_away> Hence setting it up in Webrick first.
<kenneth> why not take the simple solution and ssl terminate on a LB?
<billy_ran_away> LB?
alx- has quit [Quit: alx-]
<kenneth> it's much easier to deal with
<kenneth> load balancer
<billy_ran_away> Oh
<billy_ran_away> Yea
<billy_ran_away> What's the simple solution?
u89 has joined #ruby
<kenneth> typical production setup usually involves a load balancer (nginx) that splits and forwards traffic to your ruby webservers
BoomCow has quit [Quit: Leaving]
<kenneth> have the load balancer take care of the SSL stuff, and just forward regular HTTP request internally
Markvilla has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
emergion has joined #ruby
_Mon_Ouie_ has joined #ruby
<billy_ran_away> kenneth: Right, but that's still no a solution to the authenticate by SSL but not give stupid error in browser.
<kenneth> billy_ran_away: http://failverse.com/load-balancing-with-ssl-termination/ from googling
<kenneth> gtg
<billy_ran_away> kenneth: I mean it's a accept ugly error in browser compromise to SSL auth…
<billy_ran_away> kenneth: Okay I appreciate your time! Thanks!
whowantstolivef1 has quit [Quit: quit]
bel3atar has left #ruby ["Leaving"]
My_Hearing has quit [Ping timeout: 260 seconds]
<bricker> Can I loop through each key,value in a hash, modify them in-place, and then return the same (modified) hash at the end? Without having to build a new hash
jrist is now known as jrist-afk
aapzak has joined #ruby
havenn has joined #ruby
alvaro_o has joined #ruby
blacktulip has quit [Remote host closed the connection]
berserkr has quit [Quit: Leaving.]
<apeiros_> bricker: yes
<epwhorl> !
piotr_ has quit [Ping timeout: 245 seconds]
phipes has joined #ruby
<bricker> Can you point me in the right direction? I'm not finding any obvious way to do that in the docs, but I am probably forgetting something
locriani has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
<epwhorl> how do you want to modify it
bwlang has left #ruby [#ruby]
locriani has joined #ruby
<epwhorl> hash_name.each do |key, value|
beachandbytes has joined #ruby
<epwhorl> there's the first part of the puzzle
xnm has joined #ruby
<apeiros_> bricker: just use each, do your changes and store them back to the hash
<bricker> epwhorl: basically I have a hash like this: { title: { text: "Title" }, link: { text: "www.google.com" }, body: { text: "body"} }
<bricker> And I just want to turn that into not-nested hashes
tommyvyo_ has joined #ruby
<apeiros_> bricker: can you show us what you've tried so far? (gist or pastie please)
axl_ has quit [Quit: axl_]
<bricker> apeiros_: I was just making a new hash but wanted to ask if there was a way to do it without creating a new object. I'll use your suggestion, thanks
emergion has quit [Quit: Computer has gone to sleep.]
<kenneth> hey does anybody have experience analyzing audio in ruby?
tyfighter has joined #ruby
headius has quit [Quit: headius]
<epwhorl> so you have a has of key/hash pairs
<alejandro_> kenneth: what are you trying to do?
<epwhorl> is there any reason you need to call the values "text"?
<kenneth> alejandro_: i want to tap into my computer (mac)'s audio output from a ruby program
<kenneth> alejandro_: to run some analysis on it and control a lighting system from it
<kenneth> wondering how the best way to do that is. i can write an obj-c native extension if that's what it takes
<epwhorl> why not just do { title: "Title", link: "www.google.com", body: "body" }
gyre007 has joined #ruby
<apeiros_> epwhorl: it sounds like what he showed was his input, and what you just pasted is his desired output
s1n4 has joined #ruby
TTilus has quit [Ping timeout: 252 seconds]
Gm4n has quit [Ping timeout: 250 seconds]
nomenkun has quit [Ping timeout: 244 seconds]
havenn has quit [Remote host closed the connection]
TTilus has joined #ruby
squidBits has quit [Read error: Connection reset by peer]
squidBits_ has joined #ruby
ossareh has joined #ruby
<alejandro_> kenneth: have you looked at https://github.com/nagachika/ruby-coreaudio
<kenneth> alejandro_: i have not, thanks for the link
d34th4ck3r_ has quit [Read error: Operation timed out]
gyre007 has quit [Ping timeout: 252 seconds]
carlyle has quit [Read error: Connection reset by peer]
aapzak has quit [Quit: leaving]
joeycarm_ has quit [Remote host closed the connection]
cakehero has joined #ruby
jaygen has quit [Remote host closed the connection]
joeycarmello has joined #ruby
cdt has joined #ruby
lenovodroid has quit [Read error: Connection reset by peer]
lenovodroid has joined #ruby
moshee has quit [Ping timeout: 260 seconds]
moshee has joined #ruby
jaygen has joined #ruby
rondale_sc has left #ruby [#ruby]
combataircraft has joined #ruby
phantasm66 has quit [Quit: *sleeeep….]
<combataircraft> Hi all. I want to create a multiplayer go program but can't find anything on google
nanothief has joined #ruby
carlyle has joined #ruby
<combataircraft> I need a library to validate the moves of players
samuel02 has quit [Remote host closed the connection]
<combataircraft> and prefer to use an existing one instead of creating a new one
x82_nicole has quit [Quit: Computer has gone to sleep.]
<combataircraft> where can I find a way to start this?
<epwhorl> good question
<epwhorl> out of curiousity, what are you using for a UI
joshman_ has quit [Quit: Computer has gone to sleep.]
<combataircraft> I'll use HTML5
<combataircraft> here is a chess game that I built couple of years ago; http://multiplayerchess.com
<epwhorl> ruby?
aapzak has joined #ruby
<combataircraft> I'll use Ruby for IPhone app, with RubyMotion
cableray has joined #ruby
shtirlic_ has joined #ruby
Shadow_S has joined #ruby
kirun has quit [Quit: Client exiting]
Kruppe has quit [Ping timeout: 265 seconds]
squidBits_ has quit [Read error: Connection reset by peer]
<shevy> hmmm
squidBits has joined #ruby
* apeiros_ would be surprised if there was a "validate go moves"-only library
<shevy> foo {}.bla
<shevy> is this valid syntax???
<apeiros_> shevy: yes
carlyle has quit [Remote host closed the connection]
<apeiros_> ary.select { … }.map { … }.join
<_nitti> blocks.
<apeiros_> you can even do it with do/end, but that looks ugly: ary.select do … end.map do … end.join
jxriddle has quit [Quit: jxriddle]
tjbiddle has quit [Quit: tjbiddle]
iamjarvo has quit [Quit: Leaving.]
<apeiros_> (which is one reason why I prefer "{} for return value, do/end for side-effect" over "{} for single-, do/end for multiline")
shtirlic has quit [Ping timeout: 245 seconds]
DaltonUS has quit [Quit: DaltonUS]
gyre007 has joined #ruby
kenneth has quit [Quit: kenneth]
sepp2k1 has quit [Remote host closed the connection]
tvw has joined #ruby
ossareh has quit [Remote host closed the connection]
alex__c2022 has quit [Quit: alex__c2022]
ossareh has joined #ruby
havenn has joined #ruby
apok_ has joined #ruby
<davidcelis> blocks: a thing.
Hanmac has quit [Quit: Leaving.]
vd0 has quit [Ping timeout: 265 seconds]
Hanmac1 has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
<_nitti> yes.
<_nitti> Procs.
<davidcelis> prawks.
<_nitti> haha.
cdt has quit [Ping timeout: 260 seconds]
<_nitti> class Prawk;
<davidcelis> Prawk = Proc
<davidcelis> now your code is fun
nari has joined #ruby
apok has quit [Ping timeout: 260 seconds]
apok_ is now known as apok
noric has left #ruby [#ruby]
<shevy> hehe
<shevy> Prawk.new
<apeiros_> class Proc; alias oi inspect; def inspect; oi.sub('Proc', 'Prawk'); end; end
<shevy> oh I like these methods
_nitti has quit [Remote host closed the connection]
<shevy> oi and oink!
atal421 has quit [Read error: Connection reset by peer]
<apeiros_> proc {} # => #<Prawk:0x007fc8d1c02ed8@(pry):4>
<davidcelis> lol
robustus has quit [Quit: ZNC - http://znc.in]
<apeiros_> actually…
<apeiros_> prawk {} # => #<Prawk:0x007fc8d1c24808@(pry):6>
<shevy> whoa
<apeiros_> ruby… because we can! :D
<jcr> I am writing a python wrapper around octopress, I ask you because the rakefile only initialized if I manually cd into the dir
<jcr> how can I get rvm to hook into the rakefile using either bash or python?
atal421 has joined #ruby
<apeiros_> ¿que?
lurch_ has joined #ruby
asteve has quit [Quit: Computer has gone to sleep.]
<jcr> I promise to rewrite in ruby once the api stablizes
rondale_sc has joined #ruby
shtirlic has joined #ruby
combataircraft has quit [Read error: Connection reset by peer]
_Mon_Ouie_ has quit [Ping timeout: 244 seconds]
combataircraft has joined #ruby
_Mon_Ouie_ has joined #ruby
statarb3 has quit [Quit: Leaving]
alanp_ has joined #ruby
dawkirst_ has quit [Ping timeout: 256 seconds]
alanp has quit [Read error: Connection reset by peer]
alanp_ is now known as alanp
jeffreybaird has joined #ruby
<shevy> hehehe
<shevy> I switched to ruby
shtirlic_ has quit [Ping timeout: 260 seconds]
<shevy> once I have a real and fast replacement for bash, I shall be happy
bean has quit [Quit: Computer has gone to sleep.]
<ddd> a) you're going to double write once the api stabilizes rather than doing it in ruby from the get go? B) rvm doesn't hook into rake files it sets up rubies, not python C) rvm doesn't know anyting about python D) you'rea asking a bunch of rubyists how to make python do stuff
<ddd> huh
combataircraft has quit [Read error: Connection reset by peer]
combataircraft_ has joined #ruby
<shevy> for some reason I found rakefiles not very fun to use
nemesit has quit [Quit: Leaving...]
SCommette has quit [Quit: SCommette]
forced_request has joined #ruby
cdt has joined #ruby
adamnbowen has quit [Quit: Textual IRC Client: www.textualapp.com]
alexspeller has joined #ruby
kil0byte has joined #ruby
csmrfx has quit [Read error: Operation timed out]
willob has quit [Quit: Leaving.]
csmrfx has joined #ruby
theRoUS has quit [Ping timeout: 276 seconds]
Goles has quit [Quit: Computer has gone to sleep.]
jrist-afk is now known as jrist
vd0 has joined #ruby
kevinykchan has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
tommyvyo_ has quit [Quit: Computer has gone to sleep.]
Juul has joined #ruby
solidoodlesuppor has quit [Remote host closed the connection]
ejholmes has quit [Ping timeout: 246 seconds]
pu22l3r_ has joined #ruby
dawkirst_ has joined #ruby
Xeago has quit [Remote host closed the connection]
cdt has quit [Ping timeout: 260 seconds]
jcr has quit [Ping timeout: 252 seconds]
emmanuelux has quit [Remote host closed the connection]
lurch_ has quit [Quit: lurch_]
squidBits_ has joined #ruby
squidBits has quit [Read error: Connection reset by peer]
squidBits_ is now known as squidBits
scriabin has quit [Quit: Page closed]
pu22l3r has quit [Ping timeout: 264 seconds]
cdt has joined #ruby
generalissimo has quit [Remote host closed the connection]
fir_ed has joined #ruby
jxriddle has joined #ruby
jrajav has joined #ruby
mercwithamouth has quit [Ping timeout: 252 seconds]
Xeago has joined #ruby
Shamgar_ has quit [Ping timeout: 250 seconds]
dmiller has joined #ruby
dawkirst_2 has joined #ruby
dawkirst_ has quit [Ping timeout: 250 seconds]
J-_-L has quit [Read error: Connection reset by peer]
chord has joined #ruby
chord has left #ruby [#ruby]
<shevy> hmmm
<shevy> php has phpinfo()
<shevy> that would be nice to have for ruby .cgi pages
jbermudes has quit [Read error: Connection reset by peer]
nkts has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
x82_nicole has joined #ruby
jbermudes has joined #ruby
jbermudes has quit [Changing host]
jbermudes has joined #ruby
ner0x has joined #ruby
alexspeller has quit [Remote host closed the connection]
includex has joined #ruby
dmiller has quit [Ping timeout: 244 seconds]
SCommette has joined #ruby
mercwithamouth has joined #ruby
tekacs has quit [Quit: Disappearing... *poof*]
Elico1 has joined #ruby
noric has joined #ruby
Shamgar has joined #ruby
squidBits has quit [Ping timeout: 255 seconds]
<havenn> shevy: Actually `man ruby` is kinda funny: "If you want a language [and] don't like the Perl ugliness, or you do like the concept of LISP, but don't like too many parentheses, Ruby might be your language of choice."
froy has quit [Quit: kablam!]
tekacs has joined #ruby
<shevy> ruby is very cool, yeah
<shevy> 85% perfect
Raboo has quit [Ping timeout: 255 seconds]
jcr has joined #ruby
camonz- has quit [Quit: Leaving...]
<billy_ran_away> I need a synonym for is_a?
<noric> kind_of?
<shevy> respond_to? perhaps
<billy_ran_away> It's for a role...
<shevy> a role?
banjocat has joined #ruby
<Beoran_> has_role?
<shevy> hehe
<shevy> has_cheese?
<davidcelis> rolls_with?
postmodern has joined #ruby
<shevy> can_make?
<Beoran_> can_haz_a_cheezeburger?
<billy_ran_away> user.is_a? :rapper, :singer, :dancer
<davidcelis> rock_and(role)
dmiller has joined #ruby
dweeb has quit [Quit: Textual IRC Client: www.textualapp.com]
<shevy> user.can_do?
<shevy> user.activities?
<shevy> profession!!!
<Beoran_> user.can? :rap , :sing, :dance
<shevy> :)
<shevy> this is fun
<Beoran_> painting the bikeshed
<shevy> haha
<Beoran_> oh zzz time
<billy_ran_away> shevy: I love the enthusiasm! Wish my peers tried as hard as you are at coming with a good name.
tjbiddle has joined #ruby
Adget has joined #ruby
lenovodroid has quit [Ping timeout: 252 seconds]
C0deMaver1ck has quit [Remote host closed the connection]
pac1 has joined #ruby
camonz_ has joined #ruby
Elico1 has quit [Quit: Elico1]
<atno> the dark knight blu ray trilogy for 28$ on amazon if anyone is interested http://amzn.to/SkI1ni
<billy_ran_away> I'm doing use a? I think....
<billy_ran_away> user.a? :designer, :decorator, :driver
Raboo has joined #ruby
SCommette has quit [Quit: SCommette]
alx- has joined #ruby
Adget has quit [Quit: Adget]
Mon_Ouie has joined #ruby
banjocat has left #ruby ["Leaving"]
love_color_text has quit [Remote host closed the connection]
Gm4n has joined #ruby
nari has quit [Read error: Operation timed out]
love_color_text has joined #ruby
_Mon_Ouie_ has quit [Ping timeout: 244 seconds]
<havenn> user.occupation? :developer, :troll, :designer
axl_ has joined #ruby
<havenn> user.does_this_for_a_living_but_only_9_to_5_on_weekdays?
<havenn> 37-signals style^^
<billy_ran_away> user.'s_day_job?
<billy_ran_away> Can you start a method with a ' in ruby?
epwhorl has quit [Quit: Leaving]
<Mon_Ouie> No (although, technically, you can name a method anything — you just won't be able to call or define it using the regular syntax)
stopbit has quit [Quit: Leaving]
g_bleezy has quit [Remote host closed the connection]
<billy_ran_away> Mon_Ouie: Too bad… : )
<heftig> billy_ran_away: user.'s_day_job? doesn't make any sense anyway
cpruitt has quit [Quit: cpruitt]
<heftig> foo? methods are for predicates (yes-or-no questions), and that's not one
atal421 has quit [Quit: atal421]
<billy_ran_away> *jobs
<heftig> user.has_day_job? or user.has_a_day_job? would be predicates
love_color_text has quit [Ping timeout: 264 seconds]
<Mon_Ouie> That's one, see above — it asks if the user's day job is one of the values passed as an arguments
Banistergalaxy has quit [Ping timeout: 244 seconds]
<billy_ran_away> heftig: I was looking for an alternate to .is_a? with the idea being user.'s_day_job? :designer, :rapper, :baller
kiyoura has joined #ruby
<Mon_Ouie> But IMO the dot already stands for "'s"
<davidcelis> user.should_quit_day_job?
FiveAcres has quit [Ping timeout: 244 seconds]
<davidcelis> => false
<heftig> i'd still use the has_day_job?
hsbt has quit [Read error: Connection reset by peer]
Banistergalaxy has joined #ruby
hsbt has joined #ruby
<billy_ran_away> It's for roles anyway so it doesn't really work anyway, I'm going with a? and then alias an? to a? incase the first role I'm coding in starts with a vowel...
<billy_ran_away> Am I trying to do hard to adhere to DSL with Ruby?
chimkan_ has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
vd0 has quit [Ping timeout: 265 seconds]
<billy_ran_away> Or what you'd call making sentences with code is called...
rondale_sc has quit [Quit: rondale_sc]
beachandbytes has quit [Read error: Connection reset by peer]
beachandbytes has joined #ruby
monkegjinni has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 246 seconds]
generalissimo has joined #ruby
alx- has quit [Remote host closed the connection]
alx- has joined #ruby
generalissimo has quit [Remote host closed the connection]
<billy_ran_away> Wish I could do this… [1,2,3].include? *[3,4,5] #=> true
<notbrent> what?
wallerdev has joined #ruby
<billy_ran_away> Pass multiple arguments to an array's include method and have it check if any of them were in the array....
<notbrent> [1,2,3].any? { |n| [3,4,5].include?(n) }
jcr has quit [Ping timeout: 244 seconds]
reppard has joined #ruby
reppard_ has joined #ruby
<billy_ran_away> notbrent: Yea but when replace [1,2,3] with another array that you built by collect and then [3,4,5] with a map...
<notbrent> is that not good enough?
<notbrent> (first & second).any?
<billy_ran_away> Awww thank you!
<notbrent> what you want is a set intersection, then to see if there are any elements in that intersection
<notbrent> so you can use the & operator
<notbrent> in that intersection set*
squidBits has joined #ruby
<billy_ran_away> (possible_roles.map { |role| role.is_a? Role ? role : Role.find_by_name(role.to_s) } & roles).any?
<billy_ran_away> thanks
seanstickle has joined #ruby
skcin7 has joined #ruby
<notbrent> i'd break it out into two variables then do that
<notbrent> imo it helps make it readable because then it's just one thought on each line
<notbrent> np
jtharris has joined #ruby
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
rellin has joined #ruby
<billy_ran_away> I just hate making temp variables….
manizzle has joined #ruby