<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
<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?
<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
<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
<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]
<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]
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
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 .
<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 ?
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?!?"
<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?)
<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 :(
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 ?
<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
<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]
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 ;)
<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]
<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
<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")
<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
<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]
<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?
<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.]
<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?
<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
<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]
<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
<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
<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"
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]
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 ?
<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...
<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
<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]
<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
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."
<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....