apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
emmanuelux has joined #ruby
ramblex has quit [Quit: ramblex]
jimeh has quit [Ping timeout: 250 seconds]
rasbonics has quit [Quit: rasbonics]
iocor has quit [Quit: Computer has gone to sleep.]
b1rkh0ff has quit [Ping timeout: 245 seconds]
asuka_ has quit [Read error: Operation timed out]
Asher1 has joined #ruby
voodoofish4301 has joined #ruby
andrew__ has quit [Remote host closed the connection]
Asher has quit [Ping timeout: 250 seconds]
asuka_ has joined #ruby
tomzx has joined #ruby
voodoofish430 has quit [Ping timeout: 240 seconds]
libertyprime has quit [Quit: Lost terminal]
libertyprime has joined #ruby
gtuckerkellogg has joined #ruby
gtuckerkellogg has quit [Client Quit]
thecreators has joined #ruby
cableray has joined #ruby
thecreators has quit [Remote host closed the connection]
khakimov has joined #ruby
libertyprime has quit [Quit: Lost terminal]
amalvagomes has joined #ruby
libertyprime has joined #ruby
berserkr has quit [Quit: Leaving.]
kenichi has quit [Remote host closed the connection]
fmcgeough has joined #ruby
jgrevich has quit [Quit: jgrevich]
adfdfgsdh has joined #ruby
<adfdfgsdh> what is the meaning of it all?
libertyprime has quit [Client Quit]
<seanstickle> No meaning at all.
<adfdfgsdh> getting up ridiculously early in the morning, working at an unfulfilling job, coming home and having to go to sleep early to be able to run the course the next day. Why?
tayy_ has joined #ruby
libertyprime has joined #ruby
stkowski has quit [Quit: stkowski]
<seanstickle> No reason.
thecreators has joined #ruby
Kabaka has quit [Ping timeout: 276 seconds]
<adfdfgsdh> I cannot take another day of this pain.
icy` has quit [Remote host closed the connection]
<adfdfgsdh> I broke my leg recently in a car accident. I was drinking one too many, and I strayed over to the left lane. I had a head on collision with some woman, she died.
libertyprime has quit [Client Quit]
tayy has quit [Ping timeout: 248 seconds]
libertyprime has joined #ruby
* Muz fails to see how any of this is interesting, or relevant to this channel.
<seanstickle> Yeah...
<adfdfgsdh> me being in pain isn't uninteresting
<adfdfgsdh> I just want to know how do I make it stop? how do I stop this pain?
shevy has quit [Ping timeout: 248 seconds]
tomb_ has joined #ruby
AzizLight has quit [Ping timeout: 260 seconds]
brianpWins has quit [Quit: brianpWins]
vitor-br has joined #ruby
ilyam_ has joined #ruby
noganex has quit [Ping timeout: 245 seconds]
vitor-br has quit [Remote host closed the connection]
cableray has quit [Quit: cableray]
vitor-br has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
noganex has joined #ruby
pk1001100011 has quit [Ping timeout: 244 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
ilyam has quit [Ping timeout: 245 seconds]
ilyam_ is now known as ilyam
kenperkins has quit [Ping timeout: 245 seconds]
davidpk has quit [Quit: Computer has gone to sleep.]
TaTonka has quit [Ping timeout: 260 seconds]
billiamii has quit [Read error: Connection reset by peer]
<alegacyreborn> Ruby is the best language of all time!
<davidcelis> alegacyreborn: it could be better
<alegacyreborn> Well yea
<davidcelis> alegacyreborn: example: https://gist.github.com/2831543
<alegacyreborn> there is always improvement
<alegacyreborn> room for*
<davidcelis> include that in EVERY PROJECT. trust me. i'm from the internet.
<alegacyreborn> lol
<alegacyreborn> I wish I understood that code but I am just beginning to learn Ruby
tayy_ has quit [Remote host closed the connection]
Guest92523 has quit [Quit: /quit]
<davidcelis> it basically instantiates an object to pass the inverse of a message to the original object
alindeman has joined #ruby
<davidcelis> so you can do `1.not == 2` instead of `1 != 2`
<davidcelis> because i fucking hate bangs
nobitanobi has quit [Quit: Leaving.]
nobitanobi has joined #ruby
shevy2 has joined #ruby
BrokenCog has joined #ruby
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
<davidcelis> so 1.not creates a NotClass, which then sends the negation of any passed message (in this case =ツ to the base object (in this case the 1 Fixnum)
<adfdfgsdh> can anyone tell me how i can make the pain stop?
<davidcelis> adfdfgsdh: vicodin
adamkittelson has quit [Remote host closed the connection]
<adfdfgsdh> can't, my doctor won't prescribe them to me.
adfdfgsdh has left #ruby ["Leaving"]
TaTonka has joined #ruby
keppy has quit [Read error: Operation timed out]
ilyam has quit [Quit: ilyam]
looopy has joined #ruby
wilmoore has quit [Remote host closed the connection]
digitalcakestudi has quit [Quit: Leaving.]
g0bl1n has joined #ruby
g0bl1n has quit [Changing host]
g0bl1n has joined #ruby
davidcelis has quit [Quit: K-Lined]
nej has quit [Quit: Leaving...]
flip_digits has joined #ruby
dbgster has quit [Quit: dbgster]
chson has joined #ruby
nobitanobi has quit [Quit: Leaving.]
liluo has quit [Remote host closed the connection]
davidpk has joined #ruby
xaq has quit [Remote host closed the connection]
nej has joined #ruby
tomb_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
cryptfu has quit [Quit: Leaving]
<krz> is there a better way of writing this: http://pastie.org/3992326
robdodson has quit [Quit: robdodson]
<seanstickle> Almost certainly
<krz> I'm referring to the ternary operator
<seanstickle> That's mad nutty crapballs
billiamii has joined #ruby
Kabaka has joined #ruby
jrist is now known as jrist-afk
<shadoi> I thought that was a bit harsh, then I looked at it.
<krz> hm i guess i can assign it to a var
jrist-afk is now known as jrist
<seanstickle> shadoi: ha
<shadoi> krz: there's no award for keeping everything on one line.
<shadoi> break it up, make it readable.
jrist is now known as jrist-afk
Hanmac has quit [Ping timeout: 252 seconds]
Hanmac has joined #ruby
headius has quit [Quit: headius]
td123 has quit [Quit: WeeChat 0.3.7]
aantix has quit [Quit: aantix]
niklasb has quit [Read error: Operation timed out]
dv310p3r has joined #ruby
dnyy has quit [Remote host closed the connection]
billiamii has quit [Read error: Connection reset by peer]
<krz> bnagy: you in? what we spoke about yesterday. given i have the following data: https://gist.github.com/2822101 is it possible to remove any "visits" with minute > 209?
jonathanwallace has joined #ruby
davidcelis has joined #ruby
<krz> or anyone?
libertyprime has quit [Quit: Lost terminal]
libertyprime has joined #ruby
Urth|Away is now known as Urthwhyte
dnyy has joined #ruby
RudyValencia has quit [Read error: Connection reset by peer]
jcromartie_ has joined #ruby
RudyValencia- has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
<krz> so far. I've got this: @activity_feeds.each {|k| k['visits'].delete_if {|x| x['minute'] >= 209 } } doesn't seem like its doing it. but at the same time i get no error
hakunin has quit [Read error: Connection reset by peer]
adeponte has quit [Remote host closed the connection]
jcromartie has quit [Ping timeout: 252 seconds]
jcromartie_ is now known as jcromartie
<GeekOnCoffee> krz: is it coming from ActiveRecord?
<krz> GeekOnCoffee: no mongodb
<krz> well yea AR
<krz> i mean mongoid
albemuth has joined #ruby
libertyprime has quit [Quit: Lost terminal]
libertyprime has joined #ruby
liluo has joined #ruby
hakunin has joined #ruby
jenrzzz-mac has joined #ruby
alexim has quit [Ping timeout: 240 seconds]
jenrzzz-mac has quit [Read error: Connection reset by peer]
jenrzzz-mac has joined #ruby
flip_digits has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
savage- has quit [Ping timeout: 260 seconds]
jenrzzz-mac_ has joined #ruby
yankov has quit [Quit: yankov]
nfluxx_ has joined #ruby
<krz> ok @activity_feeds.entries.each { |k| puts k['visits'].each { |k2| k['visits'].delete_if { |x| x['minute'] >= 209 } } } works. but its going through two each loops. any way i can write this better?
nfluxx has quit [Read error: Operation timed out]
g0bl1n has quit [Ping timeout: 252 seconds]
jenrzzz-mac has quit [Ping timeout: 260 seconds]
jenrzzz-mac_ has quit [Ping timeout: 240 seconds]
tfitts has quit [Ping timeout: 246 seconds]
c0rn has joined #ruby
nfluxx_ has quit [Ping timeout: 252 seconds]
tewecske has quit [Quit: Leaving.]
<krz> is sort and sort_by the same?
straind has joined #ruby
seanstickle has quit [Quit: Nihil sub sole novum]
<krz> dammit. ruby is just elfin amazing
<krz> effin*
<krz> i love one liners
tfitts has joined #ruby
cantonic has quit [Remote host closed the connection]
<shadoi> lulz
dbgster has joined #ruby
xnm has quit [Quit: WeeChat 0.3.7]
albemuth has quit [Quit: Computer has gone to sleep.]
kevinbond has quit [Quit: kevinbond]
libertyprime has quit [Quit: Lost terminal]
libertyprime has joined #ruby
test34- has quit [Ping timeout: 252 seconds]
nej has quit [Quit: Leaving...]
<alegacyreborn> Cya everybody
alegacyreborn has quit [Quit: Leaving]
wilmoore has joined #ruby
yankov has joined #ruby
kah_ has joined #ruby
choffstein has quit [Remote host closed the connection]
albemuth has joined #ruby
_blackbird is now known as radmacd
bricker88 has quit [Quit: Leaving.]
albemuth has quit [Client Quit]
test34 has joined #ruby
test34 has quit [Changing host]
test34 has joined #ruby
Araxia_ has quit [Quit: Araxia_]
test34- has joined #ruby
test34- has quit [Changing host]
test34- has joined #ruby
test34 has quit [Ping timeout: 248 seconds]
jonathanwallace has quit [Read error: Connection reset by peer]
thecreators has quit [Quit: thecreators]
jonathanwallace has joined #ruby
wvdschel has joined #ruby
cantonic has joined #ruby
benyarb has quit [Ping timeout: 244 seconds]
busybox42 has quit [Ping timeout: 245 seconds]
G has quit [Remote host closed the connection]
sspiff has quit [Ping timeout: 252 seconds]
dv310p3r has quit [Ping timeout: 246 seconds]
jodell has quit [Remote host closed the connection]
benatwork has joined #ruby
cryptfu has joined #ruby
benyarb has joined #ruby
billiamii has joined #ruby
sbanwart has quit [Ping timeout: 260 seconds]
c0rn has quit [Quit: Computer has gone to sleep.]
jchauncey has joined #ruby
jchauncey has quit [Client Quit]
digitalcakestudi has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
benatwork has quit [Ping timeout: 246 seconds]
kah1 has joined #ruby
x0F_ is now known as x0F
kah1 has quit [Remote host closed the connection]
jamesaxl has quit [Ping timeout: 252 seconds]
AlbireoX`Laptop has joined #ruby
kenneth has quit [Quit: kenneth]
mikepack has quit [Read error: Connection reset by peer]
dv310p3r has joined #ruby
theRoUS_ has joined #ruby
cbuxton1 has joined #ruby
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
ghosTM55 has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ has joined #ruby
dhaskew has joined #ruby
dhaskew_ has quit [Read error: Connection reset by peer]
cbuxton has quit [Ping timeout: 245 seconds]
ten00 has joined #ruby
counterbeing has quit [Quit: Computer has gone to sleep.]
busybox42 has joined #ruby
apok has quit [Quit: apok]
ten00 has quit [Client Quit]
kenneth has joined #ruby
kenperkins has joined #ruby
Karmaon is now known as doesUbuntuHateAw
Asher1 has quit [Quit: Leaving.]
doesUbuntuHateAw is now known as AwayNickAwayNick
Asher has joined #ruby
AwayNickAwayNick is now known as Karmaon
bambanx has joined #ruby
kenperkins has quit [Client Quit]
<bambanx> hey guys
freeayu__ has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
<freeayu__> what's the symbol if line =~ /m./
<freeayu__> if line =~ /m./
<freeayu__> if line =~ /m./
<freeayu__> if line =~ /m./
<freeayu__> what's the symbol "~" in the "if line = ~ /m./"
freeayu__ has quit [Killed (idoru (Spam is off topic on freenode.))]
cousine has quit [Remote host closed the connection]
dv310p3r has quit [Ping timeout: 246 seconds]
libertyprime has quit [Quit: Lost terminal]
libertyprime has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
seanstickle has joined #ruby
kevinbond has joined #ruby
voodoofish4301 has quit [Quit: Leaving.]
ghosTM55 has quit [Quit: leaving]
ghosTM55 has joined #ruby
mikepack has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
mdhopkins has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
bambanx_ has joined #ruby
<bambanx_> hi
Urthwhyte is now known as Urth|Away
bambanx_ has quit [Client Quit]
Gavilan has joined #ruby
ghosTM55 has quit [Quit: leaving]
peregrine81 has joined #ruby
ipoval has joined #ruby
bambanx has quit [Ping timeout: 250 seconds]
mikepack has joined #ruby
krusty_ar has quit [Remote host closed the connection]
diegok has quit [Remote host closed the connection]
uris has joined #ruby
ryanf has joined #ruby
xaq has joined #ruby
fivetwentysix has joined #ruby
crodas has quit [Read error: Operation timed out]
williamcotton has quit [Quit: williamcotton]
libertyprime has quit [Quit: Lost terminal]
libertyprime has joined #ruby
choffstein has joined #ruby
bambanx has joined #ruby
<bambanx> hey guys
<bambanx> bnagy,
<bambanx> what plugins u use in your vim for ruby?
andrew_ has joined #ruby
hamfz_ has joined #ruby
kenperkins has joined #ruby
<bnagy> greetings, humans
<bnagy> bleah, coffee
test34- has quit [Ping timeout: 248 seconds]
horseman has quit [Read error: Connection reset by peer]
Urth|Away is now known as Urthwhyte
savage- has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
kah_ has quit [Ping timeout: 246 seconds]
horseman has joined #ruby
sepp2k has joined #ruby
<horseman> sepp2k: sup seppdogg
seanstickle has quit [Quit: Nihil sub sole novum]
xaq has quit [Remote host closed the connection]
fgwaegeawgfwa has joined #ruby
mohits has quit [Ping timeout: 248 seconds]
Gavilan has quit [Ping timeout: 252 seconds]
one8zero has joined #ruby
fivetwentysix has quit [Quit: fivetwentysix]
a_a_g has joined #ruby
cha1tanya has joined #ruby
derick_skibotn has joined #ruby
jenrzzz-mac has joined #ruby
derick_skibotn has left #ruby [#ruby]
one8zero has quit [Client Quit]
zenith6 has joined #ruby
kenperkins has quit [Quit: Computer has gone to sleep.]
fgwaegeawgfwa has quit [Ping timeout: 265 seconds]
jenrzzz-mac has quit [Client Quit]
fivetwentysix has joined #ruby
wallerdev has joined #ruby
keanehsiao_ has quit [Read error: Connection reset by peer]
keanehsiao has joined #ruby
dbgster has quit [Quit: dbgster]
Gavilan has joined #ruby
keanehsiao has quit [Read error: Connection reset by peer]
keanehsiao has joined #ruby
kevinbond has quit [Quit: kevinbond]
Progster has quit [Ping timeout: 240 seconds]
davidpk has quit [Quit: Computer has gone to sleep.]
kenperkins has joined #ruby
azm has quit [Ping timeout: 256 seconds]
vitor-br has quit [Ping timeout: 246 seconds]
jcromartie has quit [Read error: Connection reset by peer]
igotnolegs has joined #ruby
larissa has left #ruby ["Saindo"]
amalvagomes has quit [Quit: amalvagomes]
A124 has joined #ruby
amacgregor_osx_ has quit [Remote host closed the connection]
A124 has left #ruby [#ruby]
mdhopkins has quit [Quit: mdhopkins]
ericcoleman has quit [Remote host closed the connection]
benatwork has joined #ruby
hamfz_ has quit [Ping timeout: 260 seconds]
ananthakumaran has joined #ruby
benatwork has quit [Ping timeout: 246 seconds]
kylemcgill is now known as tibbers_
<krz> https://gist.github.com/2833684 how do i make the second result return with the iso_two_letter_country_code ?
<krz> bnagy: whip out your magic
philcrissman has quit [Remote host closed the connection]
uris has quit [Quit: leaving]
eggie5 has joined #ruby
tibbers_ is now known as kylemcgill
trebaum has quit [Remote host closed the connection]
a_a_g has quit [Quit: Leaving.]
milram has joined #ruby
dhaskew has quit [Quit: dhaskew]
rippa has joined #ruby
interopc1p has joined #ruby
kylemcgill is now known as tibbers_
<interopc1p> what's the preferred method for installing ruby on centos?
nilg has joined #ruby
crodas has joined #ruby
<dekz> Anyone here know exactly why Rest-Client took the design decision of raising an exception for all 40x responses?
<interopc1p> I'm familiar with rvm for ruby for local users, but I need s system-wide ruby
crodas has quit [Remote host closed the connection]
milram has left #ruby [#ruby]
radmacd has quit [Quit: where's the beef!?]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
emmanuelux has quit [Remote host closed the connection]
<bnagy> interopc1p: sudo bash and do rvm stuff
<bnagy> but, fair warning, I have never had it work properly
crodas has joined #ruby
<bnagy> then again, if you're using centos you're probably used to stuff not working properly
igaiga has joined #ruby
<interopc1p> bnagy: I see the system-wide install as well for rvm. I just need a ruby for passenger to use. so do this system-wide rvm install?
ank has quit [Quit: ank]
crodas has quit [Remote host closed the connection]
crodas has joined #ruby
<krz> bnagy: any idea? :-)
<bnagy> krz: uhwat? What do you want the output to look like? Also, split that stuff up a little, intermediate variables don't cost money
<interopc1p> bnagy: 'never had it work properly' ok so compile ruby from source then>
<interopc1p> ?
<bnagy> interopc1p: I would use rbenv
<bnagy> which basically involves compiling from source, yeah
raul782 has joined #ruby
<bnagy> if you don't need to switch then just compile from source naked
igaiga_ has joined #ruby
tibbers_ is now known as kylemcgill
<bnagy> do not use yum
<bnagy> ever, ideally, but especially for thias
ank has joined #ruby
<krz> bnagy: output should look like this: http://pastie.org/3993086
<interopc1p> yeah no switching, but maybe upgrading
<interopc1p> so rbenv instead of rvm? ok I'll try that then
<bnagy> dekz: what's the issue with that?
<bnagy> 400s are errors, no?
ank has quit [Client Quit]
<bnagy> interopc1p: rbenv is fairly simple to understand
<bnagy> it makes a dir with shim binaries. As long as that's in the user paths then all is well
ananthakumaran has quit [Quit: Leaving.]
<bnagy> if you want the users to be able to switch, though, I'm not sure without looking at the scripts
<interopc1p> ew my users are using rvm already
<bnagy> if you're happy to do all the stuff as root and then alter the system path then it will be easy
<bnagy> if they are using rvm already then ow
<bnagy> I _think_ yuo're still ok
<bnagy> rbenv and rvm don't play together as a user
<bnagy> but if you do all the rbenv stuff just to have a working system install, the users who have rvm will have their .rvm first in their paths
igaiga has quit [Ping timeout: 250 seconds]
<bnagy> they won't be able to run the rbenv scripts though
looopy has quit [Remote host closed the connection]
<dekz> bnagy: I think you're half right. They're error codes, properly formed responses. I just don't think they are 'exception' worthy.
<bnagy> but they represent an exceptional condition
<dekz> bnagy: Exceptions should be left for conn refused, timeout, not proper responses
<bnagy> and so they should be handled in rescue code, not normal code
<bnagy> those are all 400s, no?
<bnagy> oh you mean server timeouts, lik e500s
<dekz> Those are different, they are server responses
<bnagy> ok yeah imho you're just mad
<dekz> I mean unreachable, no response.
<dekz> bnagy: I think you're right about that
Alantas has joined #ruby
choffstein has quit [Remote host closed the connection]
<krz> bnagy: should iso_two_letter_country_code be in the group_by method?
<bnagy> krz: maybe?
<dekz> bnagy: just wanted a different view point to hopefully enlighten me
<bnagy> do it step by step, use intermediate variables
<bnagy> then show me :)
<bnagy> dekz: well, if it's a REST API, then any 400 or 500 means your API call didn't work
d_roge has quit [Quit: ZNC - http://znc.in]
<bnagy> so imho that's an exception
ilyam has joined #ruby
ilyam has quit [Client Quit]
<dekz> bnagy: It's an error, I wouldn't classify that as an exception though. Especially when there is a very simple way to determine the error (response.status)
mikepack has quit [Remote host closed the connection]
<bnagy> which you should definitely do once you've rescued it
<bnagy> so you can decide what to do :)
mikepack has joined #ruby
<bnagy> I honestly can't even see your point of view on this
<dekz> bnagy: tbh I think it should be left up to the user of the library to deal with what happens on 400s. I know you'll probably say 'ryo' or monkey patch.
<bnagy> you try an API call. It fails. Why would you _not_ raise?
<bnagy> the point of raising an exception is exactly what you say - to let the user decide what to do
<bnagy> just rescue it :)
<krz> bnagy: starting at line 69 :-P
<bnagy> krz: and what's the problem?
<krz> bnagy: i need the output to include the iso two letter country code. ilke: http://pastie.org/3993086
ghanima has quit [Quit: Leaving.]
davidpk has joined #ruby
mikepack has quit [Ping timeout: 244 seconds]
iamjarvo has quit [Quit: Leaving.]
<dekz> bnagy: I can see your point. It is an error but I'm coming from the code that probably exists everywhere now just because of this one implementation decision. https://gist.github.com/6e2c0b55416c9abe0b36 Can you see where I am coming from?
<bnagy> krz: ok well you have two options
<bnagy> krz: combine the country name and the iso code in the key, or include the code in the value where you have the count
<dekz> bnagy: I just think exceptions should be saved for exceptional circumstances. 40x I wouldn't consider as exceptional as connection refused
<bnagy> dekz: don't rescue Exception, that's awful
<bnagy> surely they subclass their exceptions
<dekz> bnagy: I know, but in RestClient documentation they do :)
<krz> bnagy: if the former. how would it look like?
albemuth has joined #ruby
<bnagy> krz: the reason you don't know is because you're not taking things in steps
brianpWins has joined #ruby
<bnagy> dekz: you're right, I hallucinated rescue Exception => e cause I see it too much :)
<krz> i get it up to the group_by. each.with_object is slightly confusing
<bnagy> dekz: they even have a block form on that page that does exactly what you want
pzol has quit [Quit: ZNC - http://znc.in]
<dekz> bnagy: honestly. This all stemmed from me trying to show an example in an IRB session and getting an exception at 400 instead of a response. It's not what I expected nor wanted
<Alantas> dekz: And so you threw us an exception. :P
<bnagy> krz: try messing with the group_by in irb
zenith6 has quit [Quit: Leaving]
Vert has quit [Read error: Connection reset by peer]
<bnagy> krz: fundamentally, group_by determines what the grouping keys will be in the grouped hash - they can be anything, it's just a question of what that block returns
univers has quit [Remote host closed the connection]
<krz> bnagy: it groups fine. the problem. is how do i include the iso two letter code?
<krz> include it in the output
<bnagy> krz: try messing with the group_by in irb
G has joined #ruby
<krz> so the issue is in the grouop_by statement
<krz> for a minute i thought it was in the each.with_object
<bnagy> dekz: I think you should patch Exception to create ActualException KindOfAnException and NotAsExceptionalAsThose
<bnagy> we need fuzzy exception handling
<bnagy> this worked / didn't work stff is too limiting
<dekz> bnagy: that's already happening, it's just everything is an exception. Next patch will probably have response.status == 200 raise SuccessException
<dekz> IAmATeapotException
SegFaultAX has joined #ruby
<bnagy> 418!
Chryson has quit [Quit: Leaving]
<bnagy> in your long code, btw, you could have just done do_request rescue raise 'Err'
<bnagy> unless you wanted to check for exactly status 400
<bnagy> but anyway. Bored with that now.
Solnse has joined #ruby
one8zero has joined #ruby
<Alantas> raise TheRule
DanBoy has joined #ruby
zizzyx has joined #ruby
<zizzyx> i'm having a little bit of trouble figuring out how to import data into my irb session. i have an array of hashes with some data and i'm mucking about in irb to figure out the expressions needed to transform it into what i want
<zizzyx> should i make the data a top level variable in the file and require it in irb?
<Alantas> If you're just mucking around, sure.
<zizzyx> i've tried that without success but may have done it wrong
<zizzyx> how do i access that var?
mikeycgto has quit [Remote host closed the connection]
yxhuvud has joined #ruby
pzol has joined #ruby
<Alantas> By name as usual. If it's defined in the toplevel, it'll be available there.
ruby has joined #ruby
hemanth has joined #ruby
<zizzyx> hm
<Alantas> Should be, anyway.
nricciar has quit [Ping timeout: 252 seconds]
<zizzyx> i get a nameerror trying to access it
<krz> bnagy: me is riddled
ruby has quit [Client Quit]
ruby has joined #ruby
lkba has quit [Ping timeout: 248 seconds]
<Alantas> zizzyx: Hmm, so do I, now that I try it.
<Alantas> You can assign it to a constant and that works. Herp = "derp"
<zizzyx> local_variables only returns :_
<zizzyx> oh ok thanks
<Azure> question: I have relative filepaths (from the script's directory) that I want to pass into open(). Would I HAVE to use File.dirname(__FILE__) + the relative file path in order to have it open relatively?
<bnagy> Alantas: is it the same with load?
<bnagy> probably, but curious
nricciar has joined #ruby
<Alantas> bnagy: I dunno; I don't use it.
ruby has quit [Client Quit]
<Alantas> Azure: If you're on 1.9, there's require_relative. Otherwise, yeah, that seems to be the conventional trick.
<bnagy> Azure: that won't work in all cases though
<Azure> I don't mean require_relative
<Azure> I mean actually opening a file.
tchebb1 has joined #ruby
<Alantas> Azure: Oh, for just general files, not "require". Yeah, the dirname thing should do the trick.
<bnagy> Azure: File.dirname(caller[0]) is better
ruby has joined #ruby
<Mon_Ouie> No it's not. caller[0] doesn't even return a filename.
* Azure has 7 instances of that in a bootstrap script.
<Alantas> What's caller[0]? The script that was originally invoked? And if different scripts require the script file in question?
<bnagy> Mon_Ouie: ok, well it works better for me in this universe
<bnagy> Mon_Ouie: and it's hose require_relative is written
<bnagy> *how
<Azure> for instance: File.dirname(__FILE__) + '/config/twitter_oauth.yaml'
tchebb has quit [Ping timeout: 246 seconds]
<bnagy> Alantas: basically you'll get an absolute path out of dirname(caller[0]) so it will always work
<Alantas> Azure: That should be fine. That'll give you the filename.
<bnagy> __FILE__ breaks when you access the script with a relative path
twinturbo has joined #ruby
<Alantas> bnagy: And __FILE__ will give you a path that's relative to the same directory that File.new/.open works from.
<Alantas> (The pwd.)
freakazoid0223 has joined #ruby
<Mon_Ouie> You can use File.expand_path if needed
jenrzzz-mac has joined #ruby
<bnagy> if you're in the script dir, OR you use an absolute path or one that expands to a full path (~/foo/...) __FILE__ works
djdb has joined #ruby
<Mon_Ouie> And require_relative doesn't work by trying to parse caller
<bnagy> but in my (recent) experience you can replace all use of __FILE__ with require_relative or caller[0] and it is >=
<Azure> I don't think that you read what I said.
<Azure> I'm not requiring other scripts.
<Azure> I'm opening files relative to my main script's path.
<bnagy> that's old, it's caller[0] now afaik
<Azure> files meaning txt, yaml, etc.
<Mon_Ouie> hat's how he implemented it, not how it's implemented in YARV
<Azure> (and ftr I'm running 1.9.3p0)
<bnagy> Mon_Ouie: seems you're right for the C source, I found 2-3 ruby versions though and they all parse caller
<bnagy> but everything else I said is still right :)
albemuth has quit [Quit: Computer has gone to sleep.]
ghosTM55 has joined #ruby
<Mon_Ouie> Oh, and now that I think about it, caller[0] is the file (+ method/block and line) that *called* the current method
<Mon_Ouie> Not the current one
one8zero has quit [Quit: one8zero]
<Alantas> I made test directories "a" and "b", and made a file a/includeme.rb and a file b/test.rb that invokes File.dirname(__FILE__) + '/..a/whatever'. And it works fine from any directory I've tried it in.
<Alantas> Both for 'require' and for opening files (IO.foreach to be exact).
<bnagy> Alantas: try with a relative path, go up one level and do ruby foo/myscript.rb
williamcotton has joined #ruby
graspee has joined #ruby
<krz> bnagy: almost got it with: https://gist.github.com/2833895 but i don't understand why this approach adds another level into the array
<Alantas> I've run it from "b", from "a" (ruby ../b/test.rb), from /usr/local/fucking/bin with an absolute path. All of them work.
<Mon_Ouie> Alantas: It works as long as you didn't change the CWD from Ruby
<Mon_Ouie> Try using Dir.chdir
* Alantas tosses Dir.chdir('..') before the __FILE__ line. Still works.
<Mon_Ouie> File.expand_path(path, __FILE__) works though
<bnagy> Alantas: yeah but none of those are relative paths :)
kylemcgill has quit [Remote host closed the connection]
<bnagy> .. expands
SegFaultAX has quit [Quit: leaving]
<bnagy> krz: cause you made the grouping key an array
SegFaultAX has joined #ruby
balazs_ has quit [Read error: Operation timed out]
heftig has quit [Quit: leaving]
<Alantas> I think the only pitfall would be if you did a chdir between getting the filename (with __FILE__) and trying to open it.
<krz> bnagy: i tried with @top_hits.map(&:visits).flatten.group_by {|h| h['country_name'], h['iso_two_letter_country_code']}.each.with_object({}) {|(k,v),new| new[k]=v.size}.to_a.sort{ |x,y| y[1] <=> x[1] } returns an error
<krz> how else could i have done it?
<bnagy> Alantas: try what I said before
twinturbo has quit [Quit: twinturbo]
dhruvasagar has quit [Ping timeout: 245 seconds]
ruby has quit [Remote host closed the connection]
<bnagy> from your test.rb, cd .. and ruby b/test.rb
<krz> group_by {|h| h['country_name', 'iso_two_letter_country_code']} also return an error
<Alantas> bnagy: 05/29 10:11:40 pm Alantas: I've run it from "b", from "a" (ruby ../b/test.rb), from /usr/local/fucking/bin with an absolute path. All of them work.
benatkin has joined #ruby
<bnagy> krz: I'm just saying, the extra level is there because your key is an array
balazs has quit [Ping timeout: 245 seconds]
<bnagy> if you don't want it to be an array, make it something else, like a string
<bnagy> Alantas: I read it. Now do exactly what I said
<Alantas> Hell, I just changed it to read the filename with __FILE__, then Dir.chdir to the middle of nowhere (/etc), then IO.foreach. *Still* works, and I actually didn't expect it to that time.
yannis has quit [Quit: yannis]
<Alantas> Huh, it does fail with 'ruby b/test.rb', since apparently it's not picking up on '..' (which on *nix systems is a hardlink to the parent anyway).
<bnagy> . o O ( fiinally )
<krz> bnagy: so its not possible to get it into this output: http://pastie.org/3993086 ?
<Alantas> ...Until I remove the Dir.chdir('/etc') between the __FILE__ line and the IO.foreach line. Then it works.
<bnagy> now change it from __FILE__ to caller[0]
<bnagy> krz: of course it's possible
savage- has quit [Remote host closed the connection]
<zizzyx> am i misunderstanding hash key lookup? i have a key called parent_id in a hash, but when i pass in a hash to a function and call hash.parent_id.nil? i get an error saying there is no method by that name
<bnagy> zizzyx: hashes don't create accessor methods for you
<krz> bnagy: still with group_by? or should i alter the with_object block?
<bnagy> hsh['parent_id'] or whatever
<dekz> zizzyx: try hash[:parent_id].nil? or 'parent_id' as the key
<bnagy> and you probably don't need to explicitly check against nil
<zizzyx> well it's a positive check, if it is nil i put it at the root of a tree i'm making
<bnagy> ok, but undefined keys will also return nil
<dekz> zizzyx: which bit in particular in that link you supplied?
<zizzyx> the accessor method
<zizzyx> hash.[key]
<bnagy> hsh.[key] is not the same as hsh.key
<zizzyx> bnagy this is for a job where i'm being asked to learn ruby, so the data supplied has parent_id as nil in the case of it being a root node. would you like the data i've been supplied with?
<zizzyx> bnagy when i explicitly put those brackets i get a syntax error
mdw has joined #ruby
<bnagy> zizzyx: I'm just saying you can just check against if hsh['parent_id']
<bnagy> you don't need if hsh['parent_id'].nil?
<Alantas> hsh.key? 'parent_id'
<bnagy> sorry unless hsh['parent_id'] my bad
<zizzyx> ok so if the key exists but the value is nil then it returns false Alantas ?
werdnativ has quit [Read error: Connection reset by peer]
<zizzyx> ok i get it now, didn't know i needed the single quotes
<bnagy> well the quotes only work if the key is a string
<Alantas> hsh.key? returns true if the key exists, false if it does not, regardless of the value stored there.
<dekz> zizzyx: try this, a.send :[], 0 have a think about what that does. It asks the a object to perform the method identified as :[]
<Alantas> (No idea if it's applicable here. Just throwing it out there.)
robbyoconnor has quit [Read error: Connection reset by peer]
<bnagy> Alantas: I think it always has a parent_id key, but the root node has it point to nil
<zizzyx> this is my data
<Alantas> And yeah, hsh.key?("parent_id") and hsh.key?(:parent_id) refer to different keys.
<bnagy> to build a trie etc
savage- has joined #ruby
<zizzyx> i need to build a tree and print it out heirarchically
<zizzyx> trying to learn the ruby way to do it
robbyoconnor has joined #ruby
<bnagy> zizzyx: so it's hsh[:parent_id], those are symbol keys
<zizzyx> ok ty muchly
<Alantas> Well, you'd start with some parent node n, and then look for everything where [:parent_id] == n
<bnagy> actually tbh this is a bit of a chalkmark against 1.9 hash syntax
<zizzyx> does ruby tree have a lookup method
<zizzyx> or do i need to implement it myself
<bnagy> cause unless you know about it, it's hard to see why parent_id: should be referred to as :parent_id
<zizzyx> yeah but i'm ok with that
<Alantas> Ruby doesn't have trees built-in.
<zizzyx> every language has gotchas
<bnagy> zizzyx: select probably works for what you want
<zizzyx> oh ok i figured you guys would be familiar with whatever is most popular implementation of tree
TrevorBramble has quit [Quit: "Exit...Stage Left"]
c0rn has joined #ruby
<bnagy> there are a zillion trees used in algorithms :)
raul782 has quit [Remote host closed the connection]
<zizzyx> heh
daniel_hinojosa has quit [Ping timeout: 245 seconds]
<dekz> bnagy: that's valid 1.9 hash syntax?
<bnagy> dekz: {foo: 3} yeah
<zizzyx> so the prompt is to print a heirarchical listing of the nodes. i'm pretty junior so i want to make sure my understanding of the solution is correct
<dekz> bnagy: eww
<zizzyx> i need to set up the tree properly and then do a depth-first traversal and print out each node correct?
<bnagy> zizzyx: wow. There are a million ways to do this
<bnagy> zizzyx: personally I would create classes for Tree and Node
<zizzyx> yeah the number of possible methods has me a bit locked up
<bnagy> since it's a learning exercise, but you can do everything just from the array of hashes
<Alantas> def print_tree( tree, current=0, level=0 ); puts( (' ' * level) + ': ' + tree[current][:title] ); tree.each{ |node| print_tree(tree,node[:id],level+1) if node[:parent_id] == current }; end
balazs has joined #ruby
<bnagy> yeah that, standard recursion
balazs_ has joined #ruby
<bnagy> although tbh that's a bad approach with ruby
<Alantas> Er, s/': ' + //;
<bnagy> because of the tiny stack
<dekz> zizzyx: in future try and use ruby-doc for looking at how hashes and other classes work. This way you can be sure that not only is it correct, but that it's correct for the version you're using. http://www.ruby-doc.org/core-1.9.3/Hash.html
<bnagy> but for this tree it will work :D
<zizzyx> ok thanks dekz
<zizzyx> my future boss said my implementation should work for infinitely deep trees, what kind of implementation specifics does that imply?
<Alantas> Nothing will work for infinite trees.
<zizzyx> btw i'm really sorry for the dumbass questions but my education is as far as basic data structures class which was in (barely any) python
<dekz> zizzyx: that implies an infinite stack if you want to use recursion
<bnagy> ahhh, then you can't recurse
<bnagy> well, not that way
<Alantas> "Arbitrarily-deep" trees is probably what was meant. :P
<zizzyx> he also mentioned using recursion so maybe i should post the email
<bnagy> you can use an explicit stack
c0rn_ has quit [Ping timeout: 250 seconds]
c0rn_ has joined #ruby
<dekz> you'll never get a return if it's infinite
<bnagy> instead of using the ruby stack, you need to use an Array as your stack
<zizzyx> my first thought was to do trees= Array.new and use that to hold each root node
<zizzyx> yeah it looks like he meant "arbitrary" and not "infinite"
<dekz> did you say breadth first or depth?
<zizzyx> depth first because breadth would print out each root node first, then each first child
<zizzyx> right?
<dekz> good!
TheHunter_1039 has quit [Quit: TheHunter_1039]
<Alantas> Arr_of_hashes = [ {id: 0, parent_id: 0, title: "Problem, infinity?" } ]
balazs_ has quit [Client Quit]
<bnagy> hsh.select {|node| node[:parent].nil? #root nodes}.each {|root| recursive_print root }
balazs has quit [Client Quit]
<dekz> so zizzyx you want to parse that tree and build it, then traverse it
<bnagy> now write recursive_print and you're done ;)
<zizzyx> ok thanks for all the help guys
choffstein has joined #ruby
<zizzyx> i'm pretty excited to learn the language and get started, the people i'm joining said they have been working tons of hours because of their contract backlog
ananthakumaran has joined #ruby
kil0byte has quit []
<bnagy> zizzyx: word of warning - the example above _will_ fail on deep trees, make sure you test with them
<zizzyx> i'm looking at ruby-lang.org's list of tutorials, which is the best reference for basic syntax elements, such as your #root nodes above
choffstein has quit [Ping timeout: 246 seconds]
<bnagy> have you programmed much before?
<zizzyx> i just haven't come across the #identifier notation hyet
<zizzyx> i'm more familiar with python
<bnagy> oh that, it's just a comment :)
<zizzyx> so in your code example how far does the comment extend?
<zizzyx> did you mean #root or possibly $root or @root
<bnagy> zizzyx: I'm not even convinced it's syntax in a oneliner
<bnagy> it was just explanatory. :) If you broke the code up onto multiple lines it would be a comment until eol
<zizzyx> oh right my brain parsed that poorly
Solnse has quit []
<zizzyx> wasn't expecting a comment in a one-liner lol
<dekz> bnagy: you should use do…end on multiple lines!
<bnagy> dekz: no, you're not my mom.
<dekz> or aren't I
<bnagy> I use do end for loops and threads and {} for each etc
<dekz> zizzyx: do you understand that the code does that bnagy wrote?
<dekz> what*
<dekz> you have a few things to look at there, select, each, and blocks in general
TheFuzzball has quit [Quit: Leaving...]
<zizzyx> yeah i see what it does but i'm not sure if it matches the data i have
<zizzyx> is my data considered an array of hashes
jenrzzz-mac has quit [Quit: jenrzzz-mac]
<dekz> zizzyx: it won't, you need to transform it to a tree first
<zizzyx> so would it be array.select { |value| value[:parent_id].nil? }.each...
<dekz> or some structure representing a tree
vectorshelve has joined #ruby
<zizzyx> seems like that line pulls out the root nodes from the array of nodes i have
<vectorshelve> hemanth: hai dude
<hemanth> vectorshelve, hey
<zizzyx> or is it just assuming i have a big hash of nodes with a parent attribute and it pulls all the nodes from that hash with no parents, then prints their children?
L-----D has joined #ruby
<dekz> attempting to use that structure without transforming your array of hashes will cause complexity that you may want to avoid. I suggest taking your data, then turning it into a tree
<dekz> zizzyx: I think the exercise is calling for you to create a tree structure
<zizzyx> i'm trying to figure out if the code bnagy is posting is transforming the data i pasted or manipulating the tree i'm supposed to make from it
<zizzyx> i'm planning on making a tree
<Alantas> http://pastie.org/3993405 ← No idea if this'll work. But it's easier to sketch out code like that in a text editor and not in a single-line IRC text entry~!
<dekz> zizzyx: technically it could do both
<dekz> zizzyx: it depends on how you implement recursive_print
<bnagy> actually I think as stated it would be recursive_print( hsh, root )
<dekz> zizzyx: implement the tree and it will be easier, cleaner and more 'correct'
<bnagy> cause you need visibility for all the possible nodes
<bnagy> but even if you build the tree you still have to be careful with your recursion depth
<dekz> ^
cha1tanya has quit [Read error: Operation timed out]
<bnagy> tbf, it's still pretty clean just using that has
<bnagy> like each level is hsh.select {|node| node[:parent_id]=this_level_parent}
krz has quit [Quit: krz]
<bnagy> which is fairly readable
peregrine81 has quit [Quit: Computer sleeping.]
c0rn has quit []
<bnagy> == not =
<zizzyx> would i be incurring a big runtime penalty if i pull nil parented nodes from the hash with that select, and then use recursive_print to select nodes from the hash with parent_id matching the id of the argument root
cha1tanya has joined #ruby
<zizzyx> oh that's breadth first
<bnagy> for huge trees - yes
<zizzyx> if i did it that way i'd also have to run another select to ensure that the node has no further children before finally printing it
<zizzyx> so that could get hefty
<bnagy> class Node; attr_accessor :parent, :children; end
* Alantas points at my paste again. No recursion, just a stack Array, each of which also notes where it should resume its search (for additional children) from.
<dekz> it's a question of how many times you want to 'walk' that hash
<zizzyx> employer wants recursion demonstrated
liluo_ has joined #ruby
liluo has quit [Read error: Connection reset by peer]
<Alantas> No function-call recursion, I mean. It should still walk the tree successfully, to arbitrary depth.
<dekz> Alantas: paste again
<bnagy> Alantas: yeah that looks right-ish
* Alantas hasn't run it; just a code sketch.
ryanf has quit [Quit: leaving]
stewart_ has quit [Quit: Leaving.]
Solnse has joined #ruby
jenrzzz-mac has joined #ruby
<bnagy> that's working code, but for a different structure, it's out of a grammar parser I use
<bnagy> same principle
<Alantas> There's a reverse_each, I think.
<bnagy> yeah it does reverse.each, afair
twqla has quit [Ping timeout: 244 seconds]
<Alantas> Also, counterpoint to shevy's remark that he's never seen Ruby code that didn't use 2-space indentation. (I *thought* it looked a little odd~!) Hehe.
<bnagy> I use 4 spaces. Screw 2, can't read it properly
<Hanmac> i used tabs and let my browser show them as 2 spaces
<bnagy> tabs! get the tar and feathers!
looopy has joined #ruby
jenrzzz-mac has quit [Client Quit]
<Alantas> Cry "Havoc!" and let loose the dogs of war!
seivan has joined #ruby
benatwork has joined #ruby
<bambanx> bnagy, you run ruby into vim?
<dekz> Alantas: can you avoid the throwing of exceptions for flow control?
Igoru has joined #ruby
CheeToS has joined #ruby
<dekz> bnagy: maybe it's a ruby thing using exceptions for flow control everywhere!
<bnagy> bambanx: no, I just edit in it
<Alantas> dekz: catch/throw aren't exceptions in Ruby, they're actually meant to be used for flow control. Exceptions are raise/rescue.
<bambanx> bnagy, ok
<Igoru> i think i've found an encoding problem inside a file from Rack, but i have no idea of where to report/fix the problem... could anyone help me?
<dekz> Alantas: fair enough, I'm also new to ruby in general here :)
<Alantas> If I could have done something like "next whatever" to get it to jump to the next iteration of the "until stack.empty?" loop, I would have just done that.
<Igoru> i'm using ruby 1.9.2 and my code complains of invalid byte sequence in utf-8 in rack-1.4.1/lib/rack/utils.rb:98. the code is: "name =~ %r(\A[\[\]]*([^\[\]]+)\]*)" and the file declares its encoding as "binary"
<graspee> get 1.9.3
<graspee> why are you using ruby that's over 2 years old?
<Igoru> because i'm noob? lol
<Alantas> Igoru: Maybe 'name' is coming from a source marked as UTF-8?
<Igoru> Alantas: maybe. all my code is utf8, and the files are declared as utf8 too.
<Igoru> graspee any idea on why upgrading ruby would solve that?
<graspee> no idea. but why run that risk?
araujo has quit [Ping timeout: 250 seconds]
benatwork has quit [Ping timeout: 245 seconds]
<Igoru> graspee: because i dont wanna upgrade ruby version on this part of the project... lol
<graspee> the first thing you should do whenever you have problems with something is check your version
seivan has quit [Read error: Connection reset by peer]
<graspee> and then ugrade to the latest stable one
<Igoru> don't want to compile ruby, reinstall gems, re-test the system, etc.
<Igoru> that's what i did with...... rack. the origin of the problem, at least for me heheh
seivan has joined #ruby
lobak has quit [Remote host closed the connection]
lobak has joined #ruby
<Igoru> in fact, i think i'm using 1.9.2 because heroku tells me to do so.
digitalcakestudi has quit [Ping timeout: 246 seconds]
<Igoru> just a couple of weeks ago they released the ability to change the production ruby version
mdw has quit [Remote host closed the connection]
<Igoru> yes, confirmed. heroku runs primarily on 1.9.2. i cannot risk changing ruby version because a "small" bug like that... at least if there's no obvious reason, just a "guess"
<Alantas> Hell, I still use 1.8.7. Never had encoding problems, and irb works: more than I can say for 1.9.3 when I took it for a spin the other day.
<graspee> irb works fine with 1.9.3
<graspee> you must have some config problem
<Alantas> Anyhow, if you're reading data from an external source, you might have to force_encoding it, or whatever. I had to do that with a 1.8.7 script I rigged to work in 1.9.3.
<Igoru> Alantas me too. i have to change to 1.8.* when i want to use some tools here. problems with readline.
<graspee> but why would you run irb rather than pry anyway?
<Igoru> because we don't know those strange names, maybe?
<Hanmac> Alantas: and you may bet problems in the next debian versions? because i heard that they planed to drop 1.8 some as it dies
<Hanmac> get
<horseman> graspee: are you a pry groupie
<Alantas> graspee: I tried pry. gem install it, no problem. Running it, it spews "redefining constants" warnings, then dies on some library it didn't find.
<graspee> it would seem so
<Igoru> why don't you try to help instead of saying "why dont u do that?" lol
<Alantas> $ irb => "irb> "
<horseman> Alantas: because you dont hvae Readline installed
<graspee> i am trying to help
senny has joined #ruby
nai has joined #ruby
<Igoru> horseman and how to install readline? lol
JohnBat26 has joined #ruby
<Alantas> Doesn't Ruby itself come with a script-accessible Readline library?
<graspee> but if people are too afraid to change their ruby version and think "pry" is some mysterious witchcraft and don't know how to install readline then i can't help
<Igoru> i've already tried to follow rvm guide but it didnt help
<Alantas> It'd be like saying it failed because there's no bignum support.
<horseman> Igoru: i always start out by believing in myself, if i believe in myself i can do anything.
<horseman> Alantas: Nah it doesn't u have to build it b4 u install ruby
<Hanmac> pry is not so bad, but i hate its creator ... and it should use an newer slop version
<Igoru> well... gotta try that another day. i'm sure i've already spent many neurons on this task some time before
<horseman> Alantas: also without readline even your irb experience would be a bit impoverished
nirakara has joined #ruby
<Alantas> My irb works fine. I can even tab-complete filenames.
<Igoru> horseman yes, irb without readline is crappy. because of that when i wanna use irb i change to 1.8.7
<Alantas> The 1.9.3 one would emit control characters or something when I tried to tab... or backspace!
<horseman> Alantas: can you up-arrow to history?
nai has quit [Remote host closed the connection]
<Igoru> yes, that's the lack of readline
<horseman> Alantas: can you gist the error u get when u try to use pry?
<Igoru> gotta try to upgrade ruby now. geez
<horseman> Alantas: whenever u get the chance
gregorg has joined #ruby
gregorg has quit [Changing host]
gregorg has joined #ruby
<Igoru> no "easier" idea about the encoding problem?
<Alantas> horseman: I would, but then I'd have to reinstall rbenv, and 1.9.3 (rebuilding it too!), and pry.
<graspee> what's so bad about rebuilding it
<graspee> you make it sound like it takes 5 years or something
nirakara has quit [Client Quit]
nfluxx has joined #ruby
<Alantas> Anyhow: require "readline". Tada!
harukomoto has quit [Ping timeout: 240 seconds]
MissionCritical has quit [Ping timeout: 244 seconds]
nirakara has joined #ruby
<Igoru> in fact, if you are in the middle of a task, 'rebuilding everything' takes longer than you would expect.
<Alantas> graspee: The number of hoops to jump through is not infinite, but still more than I'm willing to do for this, so it might as well be.
<Igoru> just what i meant XD
maesbn has joined #ruby
ryanf has joined #ruby
<Igoru> i've stumbled in a simple encoding problem and now i'm recompiling ruby to see if it "magically" solves the problem? lol
<Alantas> Windows? Reboot! Linux? Recompile!
<Igoru> hahahahahaha
araujo has joined #ruby
<graspee> i just can't see why anyone would use a previous ruby version unless they had to use some library which didn't work with 1.9
ABK has joined #ruby
<Igoru> and mac? buy a new one?
nilg` has joined #ruby
buschhardt has joined #ruby
<Igoru> graspee as i said before, heroku was only supporting 1.9.2 until, like, last week.
<Igoru> i'm not obligated to upgrade to 1.9.3 as soon as heroku did.
<Igoru> in fact i'm not sure if they are already supporting 1.9.3. what i know is that it's now possible to change the ruby version you use via Gemfile.
<dekz> graspee: has a point though, many issues seem to be resolved from having the latest runtime installed.
<Alantas> I have no particular reason to stay in 1.8.7 (aside from the fact it's confirmed to work for me), but no particular reason to switch to 1.9.3 either. So, I'm fine where I am.
<dekz> but there is a difference between installing an older version instead of a newer version, and only using what may be available at the time
<Alantas> Bird in the hand.
<horseman> Alantas: Bird in the bush.
noodletraveler has joined #ruby
<dekz> This is more to do with my experiences and 1.8 and 1.9 jruby ruby spec
igaiga has joined #ruby
<dekz> it would relate less so with 1.9.2 and 1.9.3
<graspee> how about 1.9.3 is faster than 1.8.7
<Igoru> reinstalling aaaaall the gems again.
<dekz> lol
Morkel has joined #ruby
igaiga_ has quit [Ping timeout: 244 seconds]
Solnse has quit [Quit: Leaving.]
buschhardt has left #ruby [#ruby]
araujo has quit [Ping timeout: 256 seconds]
horseman has quit [Remote host closed the connection]
mneorr has joined #ruby
<Igoru> ok, now i'm needing to install a pre-release version of bundler. how funny it is.
SegFaultAX|work2 has quit [Read error: No route to host]
workmad3 has joined #ruby
SegFaultAX|work2 has joined #ruby
<Igoru> guess what? now the encoding error changed of file.
maesbn has quit [Read error: Connection reset by peer]
schovi has joined #ruby
maesbn has joined #ruby
<graspee> "changed of file"?
<Igoru> to my first question: where could i get help from rack team?
maesbn has quit [Read error: Connection reset by peer]
<Igoru> yes... the error is more meaningful, at least.
mneorr_ has joined #ruby
maesbn has joined #ruby
<Igoru> but it didnt vanished, just changed of name lol
<graspee> i don't know what "changed of file" means
<Alantas> That doesn't grammar.
<Igoru> it was being thrown in a file and now is in other
mneorr has quit [Ping timeout: 260 seconds]
mnaser has quit [Quit: Computer has gone to sleep.]
<Igoru> sorry, i'm not native speaker .-.
<Igoru> the error changed from a file to another (?)
<graspee> ok
<Igoru> to 'decode_www_form_component'... i'm trying to upload a picture
<graspee> at least now you are on firm ground though, so people can help you
<Igoru> and it's complaining exactly about the content of the binary file uploaded
gilead has joined #ruby
Eldariof59-ru has joined #ruby
tchebb1 is now known as tchebb
<Igoru> the funiest part is that the upload works on opera. lol
alup has quit [Read error: Connection reset by peer]
mdw has joined #ruby
solidus-river has joined #ruby
<solidus-river> whats the difference between an instance function vs a class function in ruby
<solidus-river> sytactically
<solidus-river> *syntactically for definition
<Hanmac> class functions are singleton functions at the class object
workmad3 has quit [Read error: Operation timed out]
<solidus-river> so how would i definte an instance function?
<Alantas> herp = Classname.new ← class method
<Hanmac> class A def abc; p "instance"; end; def self.abc; p "class"; end; end;
<Alantas> herp.derp() ← instance method
ph^ has joined #ruby
petercs has joined #ruby
<solidus-river> ah, so instance methods just can only be called on instances of the class then? where as class methods can be called either from an instance or the whole class
<Alantas> No, class methods can only be called on the whole class, not on instances.
mdw has quit [Remote host closed the connection]
<Hanmac> nearly every instance can have singleton methods too ... expept fixnum, and symbols
<CombatWombat> Interestingly enough though, instance methods don't actually belong to objects, they belong to the class of the object. Be it the class, superclass, somewherein the hierarchy, or the eigenclass.
Banistergalaxy has joined #ruby
dhruvasagar has joined #ruby
becom33 has joined #ruby
maesbn has quit [Remote host closed the connection]
Igoru has left #ruby [#ruby]
<Alantas> To explain: singleton method = a method defined on a specific object, rather than all objects of a class (instance method) or the class itself (class method).
<Alantas> s/object/instance/g;
<becom33> whats up fellas
<Alantas> The opposite of down.
<Banistergalaxy> Class methods are singleton methods too, alantas
araujo has joined #ruby
twqla has joined #ruby
<solidus-river> include loads once where require loads every time, right?
<solidus-river> or did i get that backwords
<Alantas> Banistergalaxy: Ah, that's true. The class itself is represented by an object, itself an instance of the "Class" class, and identified by the constant of the same name as the class. Class methods are singletons of that instance.
<Alantas> (Something like that.)
<Hanmac> solidus-river: otherwise, require loads only once
<Alantas> solidus-river: "include" is for mixins, which is a different thing than "require". Maybe you're thinking of "load"?
<solidus-river> yes
<solidus-river> sorry, thinking of require vs load
lopin has joined #ruby
ghosTM55 has quit [Quit: Lost terminal]
<solidus-river> got it load loads every time
<solidus-river> easy to remember
gregorg_taf has joined #ruby
gregorg has quit [Read error: Connection reset by peer]
seoaqua has joined #ruby
ecigman has joined #ruby
tomzx has quit [Ping timeout: 252 seconds]
<ecigman> hi i have a quick n00bie syntax question: what does it mean when a function definition is followed by ? like def function(a,b,c)?
<bnagy> syntax error?
<ecigman> err def function?(a,b,c)
<bnagy> def foo?( *args ) is a convention that suggests that you can treat the result as a truthy value
<bnagy> for use in if foo? 3 ... etc
<CombatWombat> Oh splat-args. :(
<ecigman> like guarantees it returns true false
<bnagy> if File.exists? 'blah.txt' etc
Eldariof59-ru has quit []
<bnagy> ecigman: no, not that at all
<bnagy> it guarantees it will return something truthy (not nil or false) for the positive case and something falsey for the negative case
maesbn has joined #ruby
<bnagy> but it might return a string or whatever for the positive case
<ecigman> falsey would be not nil or false
<ecigman> ?
<ecigman> *nil
hoelzro|away is now known as hoelzro
<ecigman> or false
<bnagy> falsey is nil or false, pretty much
<ecigman> lol
<bnagy> truth is not that
<ecigman> k
<ecigman> understand
<bnagy> *truthy
<ecigman> thank you bnagy
<bnagy> so 2 is truthy, as is true and "rabbits"
<ecigman> right
<ecigman> not nil and not false
<ecigman> cool concept
<solidus-river> so pass simply frees up its space in the process sceduling for a thread
<solidus-river> but doen't necissarily keep the thread in a sleep state
<bnagy> solidus-river: it's a 'hint' to the scheduler
<bnagy> like 'if you got anybody waiting, I'm done for a bit'
<solidus-river> ah, kk, so it would be good to put maybe in a really intensive loop or something
<bnagy> well best example I have had recently is say you have two threads, one is reading from a socket and one is processing
<Hanmac> information: functions like map! will return nil if nothing has changed
JC_SoCal_ has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
<bnagy> they're both in a loop, in the reader you do get_a_chunk; Thread.pass, to hint that the processor has a chunk to work on now
<solidus-river> ah, kk
zommi has joined #ruby
<solidus-river> that makes sense
<bnagy> it's pretty rare that you would need it imho
robin850 has joined #ruby
bluOxigen has joined #ruby
JC_SoCal_ is now known as MoMo_
MoMo_ is now known as MoMo
<solidus-river> you can name vars via a hash tag correct?
<bnagy> not really
cordoval has joined #ruby
<bnagy> you can pass a has as arguments with lots of different sugar so it looks that way
cordoval has left #ruby [#ruby]
a_a_g has joined #ruby
`gregorg` has joined #ruby
gregorg_taf has quit [Read error: Connection reset by peer]
<bnagy> set_polarity( -1, nacelle: :starboard )
takus has joined #ruby
`gregorg` has quit [Changing host]
`gregorg` has joined #ruby
`gregorg` is now known as gregorg
<Alantas> Which is syntactic sugar for: set_polarity( -1, {:nacelle => :starboard}) (Passing a numeric literal and a Hash literal to the function.)
Helius has joined #ruby
<bnagy> anyone happen to know zmq?
<bnagy> http://zguide.zeromq.org/rb:lpclient I think this is Just Wrong
Urthwhyte is now known as Urth|Away
igotnolegs has quit [Quit: Computer has gone to sleep.]
<bnagy> but it's the ruby example for this pattern on the guide
bambanx has quit [Quit: Saliendo]
andrew_ has quit [Remote host closed the connection]
khakimov has quit [Quit: Computer has gone to sleep.]
dekroning has joined #ruby
atmosx has quit [Ping timeout: 252 seconds]
<hoelzro> is there a way to view the parse tree that Ruby gets from a chunk of code?
atmosx has joined #ruby
<ryanf> hoelzro: in 1.9, you can use ripper
<ryanf> it's in the stdlib
<hoelzro> I'd like to see how a certain expression is parsed
<hoelzro> ryanf: thanks
<epitron> in 1.8 you can use http://parsetree.rubyforge.org/ :)
takus has left #ruby ["Leaving..."]
nilg` has quit [Remote host closed the connection]
simao has joined #ruby
heftig has joined #ruby
ipoval has quit [Quit: ipoval]
<becom33> https://gist.github.com/74840aae2b3a52865850 how can search trough both of the arrays . plus I need sorted results
nirakara has quit [Quit: This computer has gone to sleep]
cha1tanya has quit [Ping timeout: 240 seconds]
<Alantas> I think a better approach would be to group them by program, not by field. @progs = [["photoshop", "this is for photo editing by adobe"], ["dreamweaver", "a tool used for web design"], ...]
<hoelzro> becom33: why not use a hash to store name by key and description by value?
<Alantas> Or, uh, that.
<hoelzro> Alantas' solution is pretty good too
<kenneth> def use a hash
<kenneth> or an array of hashes
<becom33> kenneth, wait
<Alantas> The Hash approach is probably better. You can always have the values be a compound type if you need more info.
<bnagy> then you would have noticed that your name and desc arrays are different sizes :)
davidpk has quit [Quit: Computer has gone to sleep.]
<kenneth> [{name: 'photoshop', desc:'does something'}, {name: 'photoshop', desc:'does something'}, …]
<Alantas> No they're not; "a tool used for web design , develeoped by adobe" is one string.
<epitron> becom33: you're on the right track there... but @name shouldn't be all the names :)
<bnagy> ahhh, yeah I"m blind
<epitron> i think what you want is a structure to store these apps
ipoval has joined #ruby
red-panda has joined #ruby
<kenneth> as for search, you can use .select{|e| e=~ /someregex/}
<pradeepto> Is calling kernel.load not advisable from a method that is called inside a thread? (ruby 1.9)
<Alantas> class Storage; App = Struct.new(:name, :description, :price, :address_space_layout, :etc)
<epitron> you probably don't need "class Storage" either
<Alantas> @progs = {"photoshop" => App.new("photoshop", "for shooping", "nonzero", 0x7F800000), "dreamweaver" => etc
<red-panda> Alantas: PONG
<epitron> i'd just put them in an array
MissionCritical has joined #ruby
<bnagy> depends if you want / need duplicate keys
ipoval has quit [Client Quit]
<epitron> yeah, we have no idea what this is going to be used for :)
<Alantas> epitron: You make a subclass of a struct?
<epitron> that's always helpful
solidus-river has left #ruby [#ruby]
<epitron> Alantas: yeah, it lets me add methods to it
<epitron> like..
<epitron> include Comparable
<epitron> :)
<Alantas> Program.extend Comparable
<epitron> ._.
<epitron> how do you define the spaceship operator then?
<hoelzro> def <=> a, b ... end
<CombatWombat> def <=>
<CombatWombat> Just needs to return 1,0,-1
<epitron> that would make it a global :)
<CombatWombat> One of those three.
<epitron> Alantas wants to do it without subclassing struct
* hoelzro thinks it's silly that custom impls of <=> must return -1, 0, or 1
<becom33> so I want to write a little search method
<Alantas> Well, what you're doing is making a struct class, then subclassing the result. Which seems a little wasteful.
<hoelzro> becom33: you probably should use symbols for the keys, I think
<epitron> becom33: @info.select { |k,v| k =~ query }
<epitron> or: k =~ query or v =~ query
<epitron> :)
jimeh has joined #ruby
<hoelzro> becom33: are you searching, or looking up an exact match?
<becom33> it only gets a one string . for a exmaple . "photo" so I want to sort it and get the result . plus I want to search in a key first then value if one of it has the search word it shoud appear
<hoelzro> if the latter, stick with the hash; if the former, I'd say go with an array of hashes/objects
<epitron> it would be easier if he told us the entire purpose of this program
<becom33> hoelzro, not exact match
<epitron> instead of having us slowly assemble an understanding of the program by asking random questions about specific aspects
<CombatWombat> Bitch, where are your tests?!
* Alantas is looking to see if there's syntax akin to: Foo = Struct.new(:herp, :derp) do; include Comparable; def <=>(that); return 5+3i; end; end
<epitron> Alantas: hahaha... i just read your thing about how subclassing an anonymous class is wasteful :)
<epitron> why not write it in assembler!
<epitron> using ruby is a huuuuuuuuuuuuge waste :)
trebaum has joined #ruby
trebaum has quit [Changing host]
trebaum has joined #ruby
nirakara has joined #ruby
ramblex has joined #ruby
prtksxna has joined #ruby
<Alantas> So one isn't allowed to keep such things in mind when using Ruby?
<shevy2> hmm
<shevy2> if ruby could easily produce assembler code, we could write a RubyOS
<graspee> atlantas you don't need semicolons after do and end i don't think
<shevy2> he just wanted to have it on one line for here
<hoelzro> shevy2: you *really* like that idea, don't you?
<hoelzro> =)
red-panda has quit [Remote host closed the connection]
<epitron> Alantas: it's completely premature optimization
cha1tanya has joined #ruby
<shevy2> hoelzro it must happen. we cant let the rails guy destroy ruby :(
<Alantas> graspee: Well, I use them in place of hitting Enter when writing up one-liners on IRC.
sirdeiu has quit [Read error: Operation timed out]
<graspee> i mean in one line even
<shevy2> everything including your pants will become used "for the web" with rails
eggie5 has quit [Quit: eggie5]
yonggu_ has joined #ruby
<shevy2> I am going to call it the phpification of ruby
<graspee> (1..10).each do |f| print f end
<graspee> works fine
<epitron> becom33: that works, but this isn't a very useful way of implementing search. a better way is to have search return the actual matches. then you can print them, or do other operations on them! :)
<Tasser> graspee, puts (1..10).join("\n") is faster
<graspee> that wasn't the point i was making
<becom33> epitron, that doesnt work
kenneth has quit [Quit: kswizz.com]
<shevy2> graspee but he used 3 instructions, you use only one
<bnagy> becom33: your search method is really just a limited subset of Hash#select
<epitron> becom33: becom33: @info.select { |k,v| k =~ query or v =~ query } ?
<becom33> wait
roams has quit [Ping timeout: 250 seconds]
<shevy2> epitron, double becom33 ? :)
<bnagy> or just take a block in your search and select with it on @info
yonggu has quit [Ping timeout: 246 seconds]
<graspee> ok it seems you're right sorry
<Alantas> def search(lis); puts( @info[lis] || "why u no name existing program t('_'t)" ); end
<shevy2> becom33, why do you have "33" in your nick?
<graspee> i assumed because there was no ; needed after do and end in my situation that there wouldn't be in yours
<graspee> but i blame ruby's vague syntax rather than anything else
roams has joined #ruby
mneorr_ has quit [Remote host closed the connection]
sirdeiu has joined #ruby
<Alantas> graspee: Well, I'd normally use { this } for one-liners anyway. I assumed one would use do...end for class defs and the like.
shevy2 is now known as shevy
<Alantas> So I don't have experience using do...end in oneliners. So I play it safe and use ; where there'd be end-of-line in a real script.
<shevy> I tend to prefer the {} most of the time
nfluxx has quit [Quit: nfluxx]
<bnagy> becom33: def search &blk; @info.select &blk; end
<shevy> it helps my bad eyes visually
celm has joined #ruby
<Alantas> Using { these } for multi-line blocks bugs me, like using \ to continue lines or something. Heh.
<graspee> i prefer to type do and end rather than {} because i hate press shift
<CombatWombat> I just build large SoC and exec those.
Banistergalaxy has quit [Ping timeout: 246 seconds]
ukwiz has joined #ruby
<Alantas> Speaking of weird-looking Ruby code, someone pasted something earlier that used 4-space indentation. Utterly blasphemous.
<graspee> bear in mind that often the various paste sites have ideas of their own
<graspee> it doesn't necessarily mean the person formatted their code like that
jamesphig has joined #ruby
<CombatWombat> Alantas: I sure hope you bludgeoned him with a heavy stick.
<Alantas> I did let loose the dogs of war, as I recall. That'll have to do for now.
francisfish has joined #ruby
<bnagy> becom33: although frankly, as you have it thw ehole thing may as well be a subclass or DelegateClass to Hash
<graspee> it's getting the dogs of war back in the kennel that's always the problem
<bnagy> Alantas: misquotes will not stop me using 4 space indents
abionic has joined #ruby
alup has joined #ruby
nirakara has quit [Quit: This computer has gone to sleep]
<epitron> bnagy: hahah.. Storage is essentially a Hash, with less methods :)
<epitron> oh sorry, you just said that
<graspee> *cough*fewer
AlbireoX`Laptop has joined #ruby
<epitron> thank you grammar nazi!
<epitron> heil!
<graspee> i can never understand why not every programmer has top notch grammar skills
<graspee> i mean programming is all about syntax and grammar rules
<graspee> if you get them wrong in code, stuff breaks
<epitron> you mean, you can never understand why every programmer does not have top notch skills
<epitron> english is a flexible language
<epitron> C is not
<epitron> we can take liberties in english
<CombatWombat> Gherkin!
Drakx has quit [Ping timeout: 248 seconds]
<graspee> it's not taking liberties though, it's just wrong
<CombatWombat> Perl executable poems.
<Tasser> epitron, C is kinda flexible too, you can do one thing in different ways
heftig has quit [Ping timeout: 260 seconds]
<bnagy> english also has many more rules
fr0gprince_ has quit [Remote host closed the connection]
ABK has quit [Ping timeout: 245 seconds]
<bnagy> graspee: I've yet to see .. or I'm yet to see .. ... or both?
<Alantas> Don't underestimate the power of pointer casting.
<CombatWombat> "Where you be at?" is an entirely valid question in English, by the way.
<graspee> i've yet to see
<bnagy> do they mean exactly the same thing?
<rippa> where da hood at
<epitron> graspee: language's rules are in the minds of the speakers... and "with less <x>" is commonly understood to mean "with less <x> than <previous subject>"
<Alantas> "I'm yet to see" implies that, without the "yet", you'd "be to see".
<bnagy> CombatWombat: yeah no, it's not
<bnagy> nice try with the subjunctive though
fr0gprince_ has joined #ruby
<graspee> epitron the whole "speakers define language" thing is a cop-out
heftig has joined #ruby
<epitron> graspee: some people decided to formalize something at some point, and "fewer" was seen to be better... but whatever!
<epitron> it's not a cop-out!
<graspee> it is
<epitron> speakers do define language
<CombatWombat> bnagy: No, it totally is. But then again, that depends on whose particular rules you use in validating. Oxford man?
<Alantas> Speakers define the language, but it *is*, in fact, thereby defined.
<graspee> so i can say shred devil cup cup mug sand? and expect you to understand me?
<bnagy> Alantas, graspee, you might want to consult the internet if you think it's black and white :)
<epitron> where do you think they get grammar rules from?
<epitron> sigh
<CombatWombat> graspee: Sure, but I'm not giving you that reach around you asked for.
<Tasser> epitron, history
<epitron> nevermind
<graspee> ugh
<epitron> this is a stupid argument
<epitron> even if i win, i lose
<graspee> don't even go there
<CombatWombat> What's the difference between a duck?
<Alantas> Speakers set the conventions that help convey information. Straying from the conventions makes it harder to convey information.
clockwize has joined #ruby
<bnagy> CombatWombat: If you use the archaic subjunctive of to be it would be 'Where be you?'
<Tasser> Alantas, and when the conventions become regularities, grammar emerges ;-)
<bnagy> although if it were that old you there would be plural :)
igaiga has quit [Remote host closed the connection]
<Alantas> So all the English people speak is like in a little cloud, each particle in a different place, but still gravitating around a point: standard language.
<Alantas> Tasser: Right.
<graspee> but when people misuse language with the effect of removing distinctions and making the language less precise, i kick off
<CombatWombat> bnagy: I see the value in your proposition, but haven't seen much that definitively proves mine as incorrect English.
<bnagy> CombatWombat: that's because of logic and proving negatives
<bnagy> you should try some, it's good stuff for programming
ryanf has quit [Quit: leaving]
<epitron> becom33: did you try using structs? http://pastie.org/3993757
<CombatWombat> bnagy: Probably actually because there's no particular mandate that canonically proclaims that the format was incorrect, but you know, we can always pretend you're correct. I'd assume you'd be rather tickled by that, and I imagine you have a wonderful smile.
jrist-afk has quit [Ping timeout: 252 seconds]
<graspee> it's funny that when there's an argument about language people tend to step up their vocabulary
<epitron> preposterous!
<shevy> what language
<bnagy> CombatWombat: well the trailing 'at' is a fairly universally incorrect use of a prepostion
<epitron> shevy: english
<CombatWombat> Purportedly, it's a game of one-upsmanship.
d3vic3 has quit [Quit: leaving]
<bnagy> like.. there's a reason they put 'pre' in that word
Banistergalaxy has joined #ruby
<shevy> epitron, ohhhh... I thought a programming language :(
<graspee> it is a programming language, man
benatwork has joined #ruby
<graspee> they try to program you, man
<Alantas> If people often say "X is incorrect", then it probably is. After all, consensus (not centralized control) is what matters; and look, there seems to be consensus!
<graspee> get your tin foil, man
<epitron> cultural operating system is the proper term
<Alantas> Or does a consensus only count if it's convenient?
<shevy> graspee I could write a englishOS?
<graspee> it's out there alreayd
<graspee> already*
<graspee> society is the operating system, man!
<bnagy> Alantas: yes. That's the kind of thing linguists talk about for HOURS
<Alantas> shevy: BASIC?
<epitron> sapir-whorf is realllll
<shevy> graspee, nah, I exist outside of society
<Hanmac> shevy no choice Latin :P
<CombatWombat> bnagy: That's a common myth to suppose that a preposition only belongs before the subjective noun.
<graspee> so far outside of society that you're on irc
<CombatWombat> Again, just a philosophy, a dialect, a mere idea.
<Tasser> wtf @ rails making method
<Alantas> Someone once wrote a Perl thing that lets you write it in Latin. (Google it.)
heftig has quit [Quit: leaving]
<shevy> graspee noone around me uses IRC :(
yankov has quit [Quit: yankov]
<Tasser> ehh method! an ambiguity
<epitron> Perlicus!
<CombatWombat> "What did you step on?"
d3vic3 has joined #ruby
<graspee> "on what did you step"
<shevy> "step what on you did"
<shevy> ^^^ yoda
<epitron> haha
<Alantas> graspee: I'd have to disagree, there. That's the kind of nonsense up with which I will not put!
<CombatWombat> My word, what have you happened to step upon?
<epitron> Alantas: ahahaha
<bnagy> CombatWombat: yeah I mainly meant with regards to at
<shevy> you guys really should argue over programming languages instead
<graspee> ok. rails is bad
<Hanmac> CombatWombat: "you did step on what?"
<graspee> i hate rails. kill rails
<shevy> lol
<rails> but
<Alantas> "What did you step on?" is akin to "return nil unless herp?(derp)"
<rails> :<
<shevy> graspee, rails is big though
<bnagy> I'm prepared to accept that ending a sentence with some prepostitions is established enough to be legal
<CombatWombat> bnagy: But you can't hold a dangling preposition over me as if it's some universal law, when it has no such rule.
<shevy> it's like a growing cancer
igaiga has joined #ruby
<graspee> rails is business
<Alantas> vs "On what did you step?" / "if not herp?(derp) then return nil end"
<Tasser> Alantas, derp.herp? :-)
<graspee> and i hate business
<shevy> I hate herp and derp
<bnagy> I didn't, only trailing 'at', especially with where, it's redundant, and, frankly wrong
<Hanmac> Wombat ... could it be that you are a "drop bear"? :P
<shevy> they are still at it!!!
<becom33> hay shevy
<epitron> Alantas gets it
<shevy> becom33 why is the 33 in your nick
<CombatWombat> It's mostly just a nerve-tickler to have it left on there when it's unnecessary. It certainly isn't 'wrong' though.
<becom33> shevy, and shevy2 both are the same person rit ?
mdw has joined #ruby
benatwork has quit [Ping timeout: 245 seconds]
<graspee> maybe shevy2 is more advanced
<shevy> becom33, yeah, its my nick when I get disconnected
<epitron> shevy2: shevy harder
bashdy has joined #ruby
<CombatWombat> It really must come down to which particular flavor of the English language you subscribe to.
<shevy> about a minute before I get disconnected, I cant read anything new on IRC :(
<graspee> flavour*
<becom33> it actally means become:3
<graspee> muha!
<shevy> lol graspee
<CombatWombat> Ho ho, clever.
<graspee> uk4ever down with the colonies
<shevy> becom33, huh? becom33 means become:3 ?
<bnagy> CombatWombat: basically it's a sentence you invented to show off you know a rarely used and arguably incorrect subjunctive, but it's wrong in other ways as well
<Hanmac> CombatWombat are you a "drop bear" ?
addi has joined #ruby
<shevy> graspee the UK empire kinda morphed into the global US empire, but they still drive the wrong way :(
<addi> Stefunel, you there?
<bnagy> and the claim that it's 'entirely' valid is just ridiculous
<becom33> shevy, yea . first 3 refers to 'e' and last 3 refers a goffy face
<graspee> there was never a uk emprie
<graspee> it was the british empire
<shevy> becom33 oh I see
<CombatWombat> bnagy: It's mostly one of those great thought-pieces of the English language. A short sentence riddled with fun little arguable points.
<CombatWombat> bnagy: But I agree, for the modern English speaker, it's 'wrong'.
<epitron> commonwealth \o/
<shevy> graspee the root of the evil was the UK, the rest were just colonies
<zizzyx> i'm still working on that prompt of transforming a flat list into a tree, and i'm wondering about a minor implementation detail - how should i go about getting a hold of already created nodes when i want to assign a child to them? or assign an already created node as a parent to a new node. here is my code: http://pastie.org/3993879
<becom33> btw I just made that up . I have no idea why I choose this name . its a random word I got into mind when I was registering in to IRC
maasha has joined #ruby
<graspee> england is the real project. america is the uppity project fork
<zizzyx> basically i think i need to implement a 'lookup by id' method somewhere since all the nodes will have an id parameter
<shevy> and "commonwealth"... that would imply prosperity among its members. I refuse to use positive terms for slave-nations
igaiga_ has joined #ruby
<epitron> hmm
<bnagy> zizzyx: I'm not sure we should help you much more if this is for a job interview style question
<becom33> amma gahai bat eken :/ katha seen eka do
<epitron> shevy: i really like the ability to travel and work freely amongst commonwealth nations
<bnagy> if you can't do it from the help we gave you before (which is more or less a complete solution) then maybe you need to study some more :)
<shevy> epitron always use the whip with sweet candy!
<zizzyx> i recognize that before you gave me complete solutions but that's not really what i wnat
<zizzyx> is that the form that help usually takes in here
igaiga has quit [Ping timeout: 244 seconds]
heftig has joined #ruby
<CombatWombat> We don't do your homework for you. :D
<zizzyx> i'm kinda trying to uh
<zizzyx> learn
<shevy> zizzyx only if you equal bnagy == everyone else here
<zizzyx> so helping me break conceptual boundaries would be aces
<maasha> Hey, I don't understand this: "Martin_23".match(/([A-Z])+.+(\d+)/) => #<MatchData "Martin_23" 1:"M" 2:"3"> - why is the second match "3" - I would have expected 23?
<shevy> zizzyx but usually questions are easy like... how to iterate over an array
freeayu1 has joined #ruby
<epitron> shevy: i guess europe has something similar, right?
<maasha> ah, greedy behaviour
<epitron> the EU?
<shevy> epitron, well the EU has
wvdschel has quit [Remote host closed the connection]
<bnagy> zizzyx: I can comment on the style though = just take the whole hash as the parameter to initialize
<zizzyx> thank you
<epitron> shevy: can you work in other countries without (many) restrictions?
<bnagy> zizzyx: and your to_s can just be @title
<epitron> (in the EU)
<shevy> epitron yeah
<epitron> so it's like the commonwealth, but emerging from a desire to unify, than an empire
jrist-afk has joined #ruby
<epitron> s/than/instead of/
<shevy> somewhat, yeah
<shevy> no unifying language though
<maasha> no, something here is different to perl.
<epitron> that's good, i think :)
<CombatWombat> We should all just write executable poems.
<epitron> it's good when people standardize voluntarily :)
pk1001100011 has joined #ruby
<graspee> who can guess what directory my gems are stored in?
jamesphig has quit [Ping timeout: 260 seconds]
<epitron> i suppose if everything is a mess, involuntary standardization can be a decent temporary solution
<maasha> I better find a book and read.
hakunin has quit [Remote host closed the connection]
<epitron> that goes rotten quickly tho
<CombatWombat> graspee: ~/PHP/Wordpress/ ?
<graspee> nup
<shevy> graspee /usr/lib/ruby/gems/1.8/
<bnagy> maasha: it should be the same. your middle .+ is eating a \d
<graspee> 1.8?!!?
<graspee> i'll give you a clue
<Hanmac> shevy: gem "name" contents
<graspee> i laugh at 1.8 and despise its sandwiches
<Muz> echo $GEM_HOME
<shevy> 1.8 forever!!!
<epitron> whoa 1.8 is out?
* epitron upgrades from 1.4
<graspee> eesh
<bnagy> "Martin_23".match(/([A-Z])+.+?(\d+)/) => #<MatchData "Martin_23" 1:"M" 2:"23">
<shevy> bnagy is the master of regexes
<graspee> i don't think anyone has earlier than 1.8 here. or i would hope not
<bnagy> actually I hate them
<shevy> graspee, yeah I think ruby 1.8.4 was the lowest I saw here on #ruby the last ~2 years
<Hanmac> graspee: gem environment
<shevy> graspee are you using debian?
<epitron> ([A-Z])+ would make a lot of groups if your name was all caps :)
Divinite has joined #ruby
fserb has joined #ruby
<Muz> Hanmac: that's slow and inefficient though! You have to wait for Ruby to actually fire up and do something, which is /dire/ with jRuby!!
<Muz> :p
parse_ has quit [Quit: Lost terminal]
<CombatWombat> Muz: You pervy! :D
<Hanmac> Muz: what do you mean??
<graspee> i'm using ubuntu so kind of
<CombatWombat> Meh, not really all that bad if your environment isn't rails-heavy.
<CombatWombat> I can fire up a jvm in about 0.7 seconds
<Muz> Hanmac: well, you could just echo $GEM_HOME from your terminal. `gem environment` actually starts a ruby interpreter that runs `gem`
<CombatWombat> With jruby
<graspee> and i tried to install rvm ages ago, it went wrong, i installed the ruby stuff from the ubuntu repos then i got miffed off and downloaded the latest source and compiled and installed it
<CombatWombat> graspee: You didn't even use checkinstall, did you?
<graspee> no
<Muz> It's not normally an issue, unless you're using jRuby, which can be (comparatively) slow to start up.
<CombatWombat> FEARLESS WARRIOR
<shevy> graspee, then your gem path is in /var/ something
<graspee> hmm
<Muz> Only if you do a systemwide install
<graspee> thanks i'll take a look
charliesome has joined #ruby
<CombatWombat> Jruby isn't fun for running lots of shortlived processes, for sure.
<CombatWombat> But I fucking love that thing.
<epitron> does jruby have a daemon?
<shevy> RVM will only modify in $HOME right?
<epitron> for forking off jruby faster?
<Hanmac> Muz no you cant
Vainoharhainen has joined #ruby
<Muz> shevy: by default.
<CombatWombat> epitron: Yeah it has nailgun.
<graspee> yeah but i got rid of jvm
<graspee> rvm*
<Muz> Hanmac: /I/ can.
<shevy> hehe
<Hanmac> i dont have $GEM_HOME so it fails
<bnagy> epitron: jruby doesn't implement fork
fbits has joined #ruby
<Muz> GEM_HOME is exported by rvm
<CombatWombat> epitron: But it has analogues.
<epitron> haha
<shevy> I dont like the J in JRuby
<bnagy> well it has native threads, so win
<Muz> shevy: who does? ¬_¬
<Hanmac> Muz: and let me guess if you build gems you only want it to work with rvm right?
<shevy> :)
<Muz> Hanmac: nope. How does that come into it?
<CombatWombat> My dick is my best friend, it's the only one who stands up for me. :(
<shevy> CombatWombat wait 60 more years
<CombatWombat> epitron: It's in jruby itself.
L-----D has quit [Quit: Leaving]
<Hanmac> graspee: you could try this too: ruby -r "rubygems" -e "p Gem.path"
<epitron> CombatWombat: jruby includes nailgun?
horseman has joined #ruby
<CombatWombat> shevy: Naw, I'm actually pretty good at running a number of jvm instances without fucking up. Must be shit people who don't know how to be orsum.
<graspee> oho thansk
tvw has joined #ruby
<CombatWombat> epitron: Yes.
<shevy> and monofilament whip
adambeynon has joined #ruby
<graspee> usr local lib ruby gems 1.9.1
<shevy> graspee whoa that is a fucked up path
<graspee> and home graspeh .gem ruby 1.9.1
<epitron> CombatWombat: soooooo... specific java apps have to be instrumented if you want nailgun to be able to nail them?
<graspee> it has slashes too
<shevy> it even is in violation of the FHS, if your ruby is at /usr/bin/ruby
<CombatWombat> epitron: I've only used the nailgun stuff with ruby.
<CombatWombat> But otherwise, no.
<graspee> well the ruby i just installed from src stuck itself in usr local bin ruby i think
<epitron> ok
<shevy> aaah ok
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<shevy> that it explains it then
<shevy> graspee, by default GNU configure will assume the prefix to /usr/local if not instructed otherwise
<graspee> i just downloaded the src tarball and did configure make make install
<graspee> yeah that's why loads of stuff i make from src ends up not in my path haha
<CombatWombat> I'm pretty much set up with rvm.
kenperkins has quit [Quit: Computer has gone to sleep.]
<graspee> angband.... angband.... RUN ANGBAND DAMNIT oh /usr/local/games/angband
red-panda has joined #ruby
williamcotton has quit [Quit: williamcotton]
<graspee> i just felt i had to give the channel an insight into my noobiness because they might have started to believe i was god-like in my powers and i need you to have a realistic idea of me :P
<shevy> see, a path like /usr/local/games
<shevy> that makes no sense really
<shevy> there is no structure like ... /usr/local/{editor,ide,browser,terminal,whatever}
<shevy> I think the FHS even recommends the use of a games/ directory :)
beneggett has joined #ruby
<shevy> lol "there used to be 4 or even more in some cases: /usr/games, /usr/X11, /usr/bin and /usr/sbin."
roolo has joined #ruby
Divinite has quit [Ping timeout: 248 seconds]
<shevy> "instead i'd love to see a real category system because with 3000 files in /usr/bin that directory has become quite useless to find anything"
maesbn has quit [Ping timeout: 246 seconds]
wallerdev has quit [Quit: wallerdev]
mneorr has joined #ruby
fbits has quit [Quit: fbits]
<graspee> i must admit i tend to install things in subdirectories of my home directory and run them vio menu shortcuts i set up in whatever wm
<seoaqua> is there a better way of string.sub('a','1').sub('b','7').sub('xzy','6).sub('...','....')?
<shevy> that's how gobolinux got started too
<horseman> shevy: hey shev
jwbuurlage has joined #ruby
<shevy> graspee, http://www.gobolinux.org/?page=doc/articles/clueless
tatsuya_o has joined #ruby
<Hanmac> seoaqua: do you realy mean sub and not gsub?
sspiff has joined #ruby
<shevy> graspee, if you dont wanna read it all, jump to the "I work in an university environment, and I have for many years."
ramblex has quit [Quit: ramblex]
<graspee> ah thanks
<seoaqua> Hanmac, i mean to replace an array of stuff into another array of stuff by mapping
<red-panda> seoaqua: PONG
thomas is now known as DragonWarrior
<shevy> seoaqua hmm seems quite short already
<shevy> or at least straightforward
octobrainz has joined #ruby
fbits has joined #ruby
kaiwren has joined #ruby
DragonWarrior is now known as thomas
ping-pong has quit [Ping timeout: 252 seconds]
<seoaqua> shevy, what if the mapping is a very long list?
<red-panda> seoaqua: PONG
noganex has quit [Ping timeout: 260 seconds]
maesbn has joined #ruby
<seoaqua> red-panda, PING
<red-panda> seoaqua: PONG
<Hanmac> seoaqua: hash.each{|k,v| string.gsub!(k,v)}
cephalopod has quit [Ping timeout: 256 seconds]
noganex has joined #ruby
fbits has quit [Client Quit]
Solnse has joined #ruby
maasha has quit [Quit: Page closed]
benatkin has quit [Quit: Computer has gone to sleep.]
<seoaqua> Hanmac, clever ,thanks
becom33 has quit [Ping timeout: 252 seconds]
becom33 has joined #ruby
berserkr has joined #ruby
d3vic3 has quit [Ping timeout: 245 seconds]
maesbn_ has joined #ruby
jamesaxl has joined #ruby
<epitron> shevy: omg... i had no idea there was an entire mailing list about naming directories
d3vic3 has joined #ruby
maesbn has quit [Ping timeout: 246 seconds]
<shevy> epitron hehe
<shevy> seoaqua then perhaps just pass it through a method
keppy has joined #ruby
workmad3 has joined #ruby
<horseman> epitron: http://www.hcide.com/
<Hanmac> maybe this could work too and maybe better ... string.gsub!(/[#{hash.keys.join('|')}]/,hash) ...
<Hanmac> the bad is that the keys maybe not have the same size
octobrainz has quit [Quit: Never look down on someone unless you're helping them up.]
octobrainz has joined #ruby
<bnagy> shevy: when I was at uni, /usr/local was on an NFS mount and everyone used terminals, so they had games in /usr/local/games so they could set group perms on the whole dir
<bnagy> so it makes perfect sense if you're from the right era :S
jhchabran has quit [Remote host closed the connection]
octobrainz is now known as cephalopod
krz has joined #ruby
<graspee> and in a multi-user environment
<kalleth> horseman: lol
<kalleth> if i could embed vim-like editing
krz has quit [Client Quit]
<Alantas> /usr/"local" as an NFS mount point.
peterhil has quit [Ping timeout: 265 seconds]
krz has joined #ruby
<Tasser> Alantas, it's not the local you think of ;-)
<epitron> horseman: i really like their presentation-thing
Morkel has quit [Quit: Morkel]
<horseman> epitron: but it just seems like a normal editor really, just with "cool graphics" lulz
<shevy> isn't that a violation of the FHS? I thought every mount point would be required to be under /mnt :D
<epitron> horseman: yep
<epitron> but the interactive demo is super sexy :D
<epitron> with the webgl zooming
<shevy> kalleth, I'd like to do editor-baking
<graspee> shevy you could point usr local at mnt something though
<shevy> I pick up the best components from 100 different editors, and then make my own!
<Hanmac> shevy NO ... /home and /boot are on extra partions
<Hanmac> on my system
<horseman> kalleth: in what situations do you use kvo vs using notifications
<shevy> Hanmac, ah yes, forgot that
<epitron> NEVAR FORGET
Morkel has joined #ruby
<graspee> i've got a dodgy external drive that mounts in windows but not in linux
yonggu_ has quit [Remote host closed the connection]
<kalleth> horseman: kvo?
yonggu has joined #ruby
<horseman> kalleth: key value observing
<horseman> kalleth: the cocoa thing
Morkel has quit [Client Quit]
<kalleth> i don't
<horseman> kalleth: related to cocoa bindings
<kalleth> ever
<horseman> why?
<kalleth> because i have no idea what you're talking about
<horseman> kalleth: wait, you're the objc programmer i spoke to yesterday right? or did i mix you up with someone else?
<kalleth> the latter
<kalleth> :p
<horseman> hehe ok sorry
<kalleth> hence my confuzzledness
davidw has joined #ruby
Morkel has joined #ruby
davidw is now known as Guest50470
<shevy> lol
Ammar01 has joined #ruby
<bnagy> wtf... this has been working til now, I swear it just broke
fserb has quit [Quit: ttyl]
<bnagy> to write something out to a decent filename, I use Tempfile.new, save t.path, t.close! andf then File.open(t) and write to it
<bnagy> which used to work... now it appears the file is being deleted on process exit
<bnagy> even though it shuldn't be a tempfile anymore :|
<matled> bnagy: you should not close! (unlink) the file and then just reopen it with File.open! that's racy
<bnagy> matled: how does it race?
<hoelzro> bashdy: because Tempfile doesn't care
<matled> someone could take the filename in between
<bnagy> and what should I do instead?
<hoelzro> Tempfile's destructor will still delete it
<matled> I don't know, the Tempfile class seems unsuitable if it cannot keep the file
<hoelzro> bnagy: can you access the file description?
<hoelzro> matled: that's by design, I think
<hoelzro> s/description/descriptor/
<bnagy> yeah it delegates to File, so
<matled> hoelzro: imho it should have an option to teek the file
<matled> *keep
<hoelzro> it should, I agree
<bnagy> yeah, that's what I want :(
<hoelzro> but I don't know if it does
<shevy> hehehe
<shevy> welcome to Tempfile!!!
<matled> the normal mkstemp(3) function should do what you want
<Hanmac> imo tmpfile is not designed to keep the file ...
<matled> I think Tempfile just reimplements it
<matled> and did it in a bad way for a long time (I think they fixed it now)
<bnagy> ok, but I prefer to have windows compatible code (bleah)
<bnagy> I am just wondering why the finalizer is still in place even after you unlink
<bnagy> maybe it installs an at_exit
tewecske has joined #ruby
<bnagy> you'd think it would just unlink it and let the OS sort out the rest
<matled> bnagy: you could just generate random filenames and File.open them with O_CREAT|O_EXCL (at least on posix, dunno about windows)
test34 has joined #ruby
test34 has quit [Changing host]
test34 has joined #ruby
<bnagy> matled: yeah, but what I wanted was the filename generation code from Tempfile
<bnagy> cause it seemed silly doing it myself
<bnagy> but I guess I'll have to, and just use Dir.tmpdir
<matled> you could send a bug report / patch and wait 2 years :)
<matled> s/bug report/feature request/
roolo has quit [Quit: Linkinus - http://linkinus.com]
<bnagy> if it really is the Tempfile::Remover then it's definitely a bug imho
<bnagy> once the tempfile object is closed and unlinked then its job is done
<matled> mh, quite often I use Tempfile to create a file and then move it over to another place.. it's not that nice of Tempfile to unlink still after I moved the file either, some other process could have taken that filename in between
<bnagy> ok.
[Neurotic] has quit [Quit: Leaving]
roolo has joined #ruby
test34 has quit [Ping timeout: 260 seconds]
<bnagy> output_path=File.join( Dir.tmpdir, "distiller-#{Time.now.to_s}.#{rand(2**32)}.#{CONFIG[:extension]}" )
<bnagy> :(
binaryplease has joined #ruby
marwan_ has joined #ruby
<marwan_> hi
<marwan_> could you help me?
jhchabran has joined #ruby
<Koshian_____> hi
<marwan_> hi koshian______
jwbuurlage has quit [Quit: jwbuurlage]
Criztian has joined #ruby
jbw has quit [Ping timeout: 246 seconds]
vandemar has quit [Quit: leaving]
jenrzzz-mac has joined #ruby
Guest50470 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
iocor has joined #ruby
<msch> anyone know how i can make a class_attribute that's not inheritable? i'm using activesupport
ephemerian has joined #ruby
JeanMertz has joined #ruby
<robin850> msch, I recomand you to check out the #rails channel if you want an answer on activesupport
<marwan_> rubyist
<msch> robin850: i'm not using rails otherwise but thanks :)
<marwan_> i want help
<keppy> i'
<bnagy> Marwan_: you're going to need to ask a question then...
moosya has left #ruby [#ruby]
<lrfurtado> can I have some help with perl ?
lrfurtado has left #ruby ["Leaving"]
<robin850> msch, Yes but even if you don't use Rails, rails users can help you better (sorry for bad english)
lrfurtado has joined #ruby
<lrfurtado> oops parted by mistake
<bnagy> lrfurtado: ... why would you even think that? This is #ruby
lrfurtado is now known as fflush
<robin850> lrfurtado, There isn't a perl channel on freenode (or an other server) ?
fflush has quit [Changing host]
fflush has joined #ruby
dhruvasagar has quit [Ping timeout: 246 seconds]
<marwan_> i want to run this project - http://goo.gl/KsnDv
<fflush> because this is such a friendly channel
moosya has joined #ruby
<fflush> ppl love to help here
<marwan_> i installed the gems
<fflush> right ?
<msch> robin850: np, thanks!
imami|afk is now known as banseljaj
<marwan_> and gone to the project dir then ruby app.rb
<marwan_> i got this
<bnagy> Marwan_: don't use url shorteners, please, old IRC people get paranoid
igaiga_ has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
<marwan_> ok
<marwan_> this is the project
<marwan_> when i run with ruby app.rb -e :production
<marwan_> i got
<marwan_> Internal Server Error
<fflush> do we have some docs for ppl from the wonderfull world of perl to ruby?
<Tasser> fflush, not that I know of explicitly
<Tasser> fflush, just don't use $var :-)
<bnagy> Marwan_: I don't know... but that doesn't look like a good argument to -e
<hoelzro> fflush: I'm a Perl guy myself, and I'm reading "The Ruby Programming Language"
<hoelzro> it's quite good
prtksxna has quit [Remote host closed the connection]
<marwan_> ok, what should i use?
jbw has joined #ruby
fr0gprince_ has quit [Ping timeout: 245 seconds]
igaiga has joined #ruby
<fflush> Tasser and hoelzro
<fflush> thanks
<marwan_> bngy: i got this argument from blog i don't know what it really is?
<marwan_> bnagy: if you have a resource about them told me about it please
<bnagy> Marwan_: haven't the foggiest what you _should_ use but -e usually wants a string
igaiga has quit [Remote host closed the connection]
<bnagy> if it's a sinatra app then maybe read up on how sinatra works. I don't have a clue :)
codebeaker has joined #ruby
<bnagy> ruby app.rb by itself doesn't work, I guess?
<marwan_> ok, thanks man - i appreciate your help
vandemar has joined #ruby
eurek has joined #ruby
<keppy> I need help with passing values from a block into a nested array
<keppy> The gist is here : https://gist.github.com/2835207
b1rkh0ff has joined #ruby
<bnagy> keppy: oic
ramblex has joined #ruby
<bnagy> something like card_stack.sample(cards) at some point
huamm has joined #ruby
<heftig> keppy: the card stack is divided into hands evenly, without leftovers?
<heftig> also, in random order?
<bnagy> keppy: bleah you can't use sample, you need to use cards.times do hand << deck.pop end or something
<TTilus> damn it, Process.kill(0, pid) to detect if a process with pid exists does not work within my app (it works on irb), in the app it always returns 1 as sign of ability to send signall, no matter what the pid is
<bnagy> deck is a better name than card_stack :)
<TTilus> this is old rails app
<bnagy> TTilus: that's creepy
<TTilus> does rails fsck up Process.kill?
<TTilus> bnagy: tell me about it
<heftig> keppy: (1..52).each_slice(7).to_a
<heftig> gets you 7 7-card hands, and three leftovers
becom33 has quit [Ping timeout: 265 seconds]
becom33 has joined #ruby
<bnagy> another skeleton is (1..hands).map {|hand| (1..cards).map {|card| deck.pop}}
<heftig> num_hands = card_stack.each_slice(card_stack.size / hands).to_a
<heftig> (bit confusing, as hands is the number of hands, and num_hands are the actual arrays)
<bnagy> heftig: it's not supposed to deal them all out
<bnagy> only 2 hands of 5 cards, in this example
<heftig> 2.times { num_hands << card_stack.take(5) }
<heftig> er
<heftig> not take, unshift
<heftig> argh!
<heftig> shift
krz has quit [Quit: krz]
<bnagy> yeah or pop
<heftig> well, yes
<heftig> doesn't really matter which end of the stack you take the cards from
linusoleander has joined #ruby
a_a_g has quit [Quit: Leaving.]
<bnagy> heftig: try saying that in Vegas
marwan_ has left #ruby [#ruby]
AlbireoX`Laptop has quit [Remote host closed the connection]
fr0gprince_ has joined #ruby
<keppy> I was looking at the enumerable documentation and forgetting the array documentation... thx
celm has quit [Quit: Leaving]
amacgregor_osx has joined #ruby
<bnagy> keppy: as heftig said, your num_hands and hands variables are backasswards
<bnagy> and I would suggest deck instead of card stack, makes you sound less like a woodduck
addi is now known as g7man
musl has quit [Quit: WeeChat 0.3.8-rc2]
g7man is now known as Guest30510
gmci has quit [Ping timeout: 265 seconds]
Guest30510 is now known as addi
musl has joined #ruby
CheeToS has quit [Ping timeout: 256 seconds]
linusoleander has quit [Quit: linusoleander]
<keppy> bangy: thanks I'll do away with card_stacks :)
<bnagy> I just have this vision of someone sitting in on a game and saying "ok is it my turn to shuffle the card stack?"
freeayu1 has quit [Ping timeout: 250 seconds]
fr0gprince_ has quit [Ping timeout: 245 seconds]
<bnagy> heftig: that's nice.
gmci has joined #ruby
<heftig> probably also rename card_stack to @deck, since i'm pretty sure you'll need it later
<TTilus> ARGH!
<TTilus> it is the old jruby :(
<TTilus> Process.kill 0, pid always says you can signal
benatwork has joined #ruby
rushed has joined #ruby
dhruvasagar has quit [Ping timeout: 256 seconds]
bashdy has quit [Ping timeout: 246 seconds]
serroba has quit [Quit: This computer has gone to sleep]
<keppy> heftig: but I DO admire your legacy usage of card_stack...
dhruvasagar has joined #ruby
ramblex has quit [Quit: ramblex]
luckyruby has quit [Remote host closed the connection]
<bnagy> "I got 4 women! Is that a good hand?"
freeayu1 has joined #ruby
<bnagy> "check it out, fellas... alllll red!"
<kalleth> bnagy: oceans joke
<kalleth> :high5:
benatwork has quit [Ping timeout: 245 seconds]
<bnagy> damn, now I want to go to vegas again :?
red-panda has quit [Remote host closed the connection]
kylemcgill has joined #ruby
seoaqua has quit [Quit: Leaving]
<keppy> I've been trying to do that all day and heftig fixed it in 30 seconds. I'm such a noob.
dnyy has quit [Remote host closed the connection]
fermion has joined #ruby
gmci has quit [Ping timeout: 260 seconds]
red-panda has joined #ruby
BiHi has joined #ruby
adelcampo has joined #ruby
red-panda has quit [Remote host closed the connection]
jlebrech has joined #ruby
gmci has joined #ruby
fr0gprince_ has joined #ruby
red-panda has joined #ruby
Bish_ is now known as Bish
<jlebrech> if i have an array of hashes like so [:a=>100, :b=>200] how do I get "a" from arr[0]?
<Mon_Ouie> You can access that hash like any regular hash
<Mon_Ouie> So Hash#[]
Progster has joined #ruby
dhruvasagar has quit [Ping timeout: 265 seconds]
tvw has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby
adelcampo has quit [Quit: adelcampo]
Progster has quit [Ping timeout: 260 seconds]
<jlebrech> how do i get "a" from {:a=>1}?
AzizLight has joined #ruby
Solnse has quit [Read error: Connection reset by peer]
<hoelzro> jlebrech: what do you intend to do with it?
<Hanmac> jlebrech you mean?: arr = [:a=>100, :b=>200]; arr[0][:a]
<jlebrech> i'm building a hash from a string, i don't know what's the keys are called.
<hoelzro> ok
<hoelzro> you can use .keys to access the keys
<jlebrech> ah yes
<jlebrech> in my case ill only have the one key
<jlebrech> makes sense
<Gonzih> jlebrech: or you can use Hash#invert
mxweas has quit [Quit: Leaving...]
mxweas has joined #ruby
dekroning has quit [Ping timeout: 245 seconds]
<Mon_Ouie> If you have only one pair, there's no reason to use a Hash in the first place
niklasb has joined #ruby
BiHi has quit [Quit: Computer has gone to sleep]
keppy has quit [Ping timeout: 244 seconds]
<huamm> can i mix cygwin with rubyinstaller?
cantonic has quit [Remote host closed the connection]
cha1tanya has quit [Ping timeout: 244 seconds]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
igaiga has joined #ruby
nirakara has joined #ruby
pdelgallego has joined #ruby
ramblex has joined #ruby
ChloeD_ is now known as ChloeD
jackiechan0 has joined #ruby
tvw has joined #ruby
simoneke has joined #ruby
<simoneke> Hoi :)
<simoneke> I got like a gross issue when installing some application on my webserver. does someone want to have a look? :)
wvms has quit [Quit: wvms]
a_a_g has joined #ruby
tomb_ has joined #ruby
davidcelis has quit [Read error: Connection reset by peer]
wvms has joined #ruby
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
rohit has joined #ruby
<_br_> simoneke: gross? Do you have a pasie?
cha1tanya has joined #ruby
davidcelis has joined #ruby
mohits has quit [Ping timeout: 260 seconds]
<simoneke> _br_: a what? ^^
<huamm> installing cygwin on windows , how to install ruby 1.9+ on cygwin?
jackiechan0 has quit [Ping timeout: 248 seconds]
jackiechan0 has joined #ruby
yoyoma has joined #ruby
<_br_> huamm: go get yourself rvm then do a rvm install 1.9 ?
<yoyoma> hi, can I have a parameter to method with question mark in name ? like def create_request(post?)
Axsuul has quit [Ping timeout: 265 seconds]
pdelgallego has quit [Ping timeout: 246 seconds]
pdelgallego has joined #ruby
<_br_> yoyoma: variable with question marks are not allowed
dhaskew has joined #ruby
<yoyoma> _br_: only method names ?
<_br_> yoyoma: only methods have the syntactic sugar of ! and ?
<yoyoma> cool, thank you
<_br_> no sweat
G has quit [Quit: leaving]
G has joined #ruby
<_br_> simoneke: gist.github.com
looopy has quit [Read error: Connection reset by peer]
looopy has joined #ruby
noodletraveler has quit [Quit: leaving]
akem has quit [Ping timeout: 250 seconds]
becom33 has quit [Ping timeout: 256 seconds]
pdelgallego has quit [Read error: Connection reset by peer]
hakunin has joined #ruby
kylemcgill has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
eregon_ is now known as eregon
fermion has quit [Ping timeout: 240 seconds]
tomb_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
seivan has quit [Remote host closed the connection]
rohit has quit [Read error: Connection reset by peer]
akem has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
sbanwart has joined #ruby
jonathanwallace has joined #ruby
ciastek has left #ruby [#ruby]
nanderoo has joined #ruby
becom33 has joined #ruby
saispo has joined #ruby
<graspee> wow. do you need voice to talk in ruby-lang?
<shevy> graspee, yup since a few months
<shevy> graspee is one reason why I am less often there now. the other reason is that #ruby has much more folks
<graspee> how am i supposed to speak ... if i have no mouth?
m_3 has quit [Quit: leaving]
<shevy> I think if you register the nick you can talk
<graspee> oh
<graspee> i had a problem with that
<shevy> their reasoning is "you can still listen and learn, but not talk, unless you have registered"
<Hanmac> shevy: maybe its because of horseman?
<shevy> I am usually too lazy to auto register and I think it sucks, especially on channels like #ruby-lang which are already moderated
<graspee> well i won't boost their figures any more then
<Tasser> lots of channels need registering nowadays
<shevy> Hanmac, nah, horseman was banned on #ruby-lang anyway
<shevy> half the guys here are banned on #ruby-lang ;)
<Hanmac> you too? :P
<shevy> nope
<shevy> the biggest abuse are all those who were banned for disagreeing with zenspider
<graspee> disagreeing about what?
<shevy> tsume/wolfe is still my favourite example of that
<shevy> graspee about anything, especially with what zenspider says
serroba has joined #ruby
<shevy> it follows a certain aggro-pattern. zenspider gets more and more aggressive, if you respond in an aggressive way and hype it up, he ends the discussion by banning them.
<graspee> i just wondered what issues there would be that people could disagree on
<shevy> graspee you would get banned if you dont stop this!
Richmond has joined #ruby
<graspee> that's not disagreeing though
* shevy takes op on #ruby.
<shevy> alright, I have enough ...
ken_barber has joined #ruby
* shevy bans graspee
amalvagomes has joined #ruby
<shevy> or let's just require voice here :>
BiHi has joined #ruby
<shevy> often though, those that got banned, are unbanned at a later time
<shevy> usually by someone else than the one who banned them
<Hanmac> and is 21.12.2012 the day where houseman gets unbanned?
<graspee> i don't think christians have aligned their apocalypse to the end of the mayan long count
<graspee> and of course neither did the mayans
berkes has joined #ruby
teolicy has joined #ruby
<shevy> Hanmac no idea
<shevy> I wanna have mRuby today
<teolicy> Hi. I'm trying to port something from Ruby, and ran into the line "exec foo, bar".
<shevy> teolicy, is probably Kernel.exec
<shevy> teolicy, official docu should be http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-exec
<shevy> "Replaces the current process by running the given external command. command? is one of following forms."
<teolicy> I believe bar to be a string, and http://www.ruby-doc.org/core-1.9.3/Process.html#method-c-exec says in this style of invocation, exec will consider bar to be "command name and one or more arguments (no shell)".
<teolicy> (shevy, already reading the docs :)
<shevy> yeah
<shevy> I usually use system() rather than exec()
<teolicy> The question is: who breaks up the string into arguments (i.e., who splits it by spaces, does anyone consider escapes in this case, etc).
huamm has left #ruby [#ruby]
<shevy> perhaps exec is doing so internally?
diegok has joined #ruby
<teolicy> This is what I thought, I need to know the exact semantics of this work.
Alantas has quit [Quit: The sum of the universe is zero.]
<shevy> it really should not be a big problem anyway. system 'mplayer -fs /foo.avi' <-- these things work just fine usually
<teolicy> (a pointer to the place where exec is implemented in Ruby's source would be handy)
<teolicy> shevy: Yes, I didn't write the Ruby code, I'm just trying to read it accurately.
<hoelzro> teolicy: with more than one argument, those are the literal arguments to the program, it seems
dbgster has joined #ruby
<teolicy> hoelzro: But I'm almost certain (my Ruby ain't perfect) that the second argument is a string.
<hoelzro> great
<shevy> teolicy, there is a "click to toggle source" link in the docu there
<hoelzro> is foo a hash?
<teolicy> The system call execve() doesn't accept a string, someone MUST be breaking these up.
<shevy> if you click that link, a "popup" will slide in at the bottom of that method
<teolicy> hoelzro: I'm not sure what's foo :(
<shevy> it reads: rb_f_exec(int argc, VALUE *argv)
<hoelzro> teolicy: if you only provide a single string, and no environment, the string is passed to the shell
<teolicy> shevy: Wow, that link is very useful :)
<shevy> and a grep -r says:
<shevy> include/ruby/intern.h:VALUE rb_f_exec(int,VALUE*);
<shevy> process.c:rb_f_exec(int argc, VALUE *argv)
<hoelzro> otherwise, each string is passed to exec, and no shell invocation (or splitting) occurs
<shevy> so I think it is written in process.c
<shevy> and the header definition is in intern.h
<teolicy> Hmm… I reckon I must work harder on understanding what's the "foo" in this case.
eurek has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<hoelzro> teolicy: I don't think any splitting occurs there
<teolicy> Yes, I came here thinking splitting occurs there, but now I don't think so either.
dhaskew has quit [Quit: dhaskew]
geekbri has joined #ruby
Squarepy has joined #ruby
<shevy> exec Foreman.runner, "-d", basedir, command
<shevy> it just uses whatever Foreman.runner returns
<shevy> the two arguments to the method here are somewhat processed, then turned to exec as arguments
<shevy> def fork_with_io(command, basedir)
<shevy> I am glad that I dont have to maintain this, code without any documentation scares me :)
<teolicy> Ah, wait, I got it, I got it. He's "cheating". Foreman.runner references bin/foreman-runner, which is a tiny shell script precisely so he won't have to deal with shell escaping.
<teolicy> Never mind, thanks.
amar_key has joined #ruby
Progster has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
liluo_ has quit [Remote host closed the connection]
dbgster has quit [Quit: dbgster]
teolicy has left #ruby [#ruby]
replore has joined #ruby
ph^_ has joined #ruby
cha1tanya has quit [Ping timeout: 252 seconds]
ph^ has quit [Ping timeout: 240 seconds]
`brendan has joined #ruby
irrationalfab has joined #ruby
amalvagomes has quit [Quit: amalvagomes]
nirakara has quit [Quit: This computer has gone to sleep]
jackiechan0 has quit [Ping timeout: 245 seconds]
benatwork has joined #ruby
wilmoore has quit [Remote host closed the connection]
fivetwentysix has quit [Quit: fivetwentysix]
cha1tanya has joined #ruby
cdempsey has joined #ruby
benatwork has quit [Ping timeout: 245 seconds]
mengu has joined #ruby
WikiPack has joined #ruby
nilg` has joined #ruby
iamjarvo has joined #ruby
D4T has joined #ruby
alem0lars has joined #ruby
akhkharu has quit [Ping timeout: 252 seconds]
abionic has quit [Ping timeout: 245 seconds]
tsou has left #ruby [#ruby]
lorandi has joined #ruby
theRoUS_ has quit [Ping timeout: 244 seconds]
Shamgar has quit [Ping timeout: 240 seconds]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
amalvagomes has joined #ruby
manizzle has joined #ruby
<jlebrech> i'm trying to do this exercise but i'm can't find what the nil class is https://gist.github.com/f63f5c801a8c00a7d0bf
nirakara has joined #ruby
yoyoma has quit []
fighella_ has joined #ruby
alem0lars has quit [Quit: quit]
alem0lars has joined #ruby
fbernier has joined #ruby
jcromartie has joined #ruby
<pk1001100011> Noob question. When comes to bignums, every digit takes the same amount of memory? I wonder how big numbers I can use.
fighella_ has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
wangr has joined #ruby
fivetwentysix has joined #ruby
fivetwentysix has quit [Client Quit]
g0bl1n has joined #ruby
test34 has joined #ruby
test34 has quit [Changing host]
test34 has joined #ruby
bigfatfrock has joined #ruby
Codif has joined #ruby
TheHunter_1039 has joined #ruby
hamfz_ has joined #ruby
Codif has quit [Remote host closed the connection]
cdempsey has quit [Quit: Quitting!]
cdempsey has joined #ruby
<Hanmac> pk1001100011: maybe this is a valid bignum ((256**100_000)**10 ... but this is inf ((256**100_000)**11
kaiwren has quit [Quit: kaiwren]
itnomad has joined #ruby
xaxisx has joined #ruby
<matled> Hanmac: uh, ruby emits only a warning there
<matled> "warning: in a**b, b may be too big"
<matled> I'd expect to get an exception if Bignum fails to compute a value
<Hanmac> yeah and it returns a Float::Infinity and no bignum
<graspee> i always see Bignum as a grizzled trucker
ph^_ has quit [Remote host closed the connection]
<shevy> if chuck norris can count to Infinity twice, then ruby should be able to count to Infinity at least once
<graspee> "oh man, here comes Big Num! He'll sort y'all out with a rig"
kaiwren has joined #ruby
<shevy> hehe
WikiPack has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
thecreators has joined #ruby
<shevy> somehow making gems is not fun
mucker has joined #ruby
ben_alman has quit [Excess Flood]
nlc has joined #ruby
wvms has quit [Remote host closed the connection]
<shevy> cool
<shevy> there is a project called "gemify"
axl_ has quit [Quit: axl_]
cha1tanya has quit [Ping timeout: 246 seconds]
lorandi has quit [Quit: Leaving]
peregrine81 has joined #ruby
thecreators has quit [Quit: thecreators]
Jackneill has joined #ruby
<hoelzro> shevy: what's it do?
* hoelzro wishes for a Dist::Zilla for Ruby
bbttxu has joined #ruby
Gavilan has left #ruby [#ruby]
ph^ has joined #ruby
<shevy> hoelzro it kinda creates a .gemspec file and checks for proper file permissions and so on
ben_alman has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
<shevy> it also generates a *_version.rb file though, unasked. that annoyed me... I dont want those things to create any other file for me, except for a .gemspec file
kuranai|off is now known as kuranai
dekroning has joined #ruby
itnomad has quit [Ping timeout: 265 seconds]
bglusman has joined #ruby
Squarepy has quit [Ping timeout: 256 seconds]
tomzx has joined #ruby
manizzle has quit [Ping timeout: 246 seconds]
apeiros_ has joined #ruby
vectorshelve has quit [Quit: Page closed]
A124 has joined #ruby
red-panda has quit [Remote host closed the connection]
<pk1001100011> Hanmac: Thank you. :o I will never need so big numbers. :D Or I suck…
looopy has quit [Remote host closed the connection]
looopy has joined #ruby
teh4 has joined #ruby
digitalcakestudi has joined #ruby
tk___ has joined #ruby
hynkle has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
<bigfatfrock> what's the purpose of defining class methods with a leading "self"?
<bigfatfrock> I guess that's a good google question :)
chson has quit [Remote host closed the connection]
uris has joined #ruby
ph^ has quit [Remote host closed the connection]
teh4 has quit [Quit: Leaving]
paradoja has joined #ruby
theRoUS_ has joined #ruby
theRoUS has quit [Disconnected by services]
theRoUS has joined #ruby
theRoUS has quit [Disconnected by services]
capibara has joined #ruby
<matled> bigfatfrock: you mean def self.foo?
theRoUS has joined #ruby
ElitestFX has quit [Ping timeout: 245 seconds]
<matled> bigfatfrock: this defines a singleton method on the class. i.e. you call it as SomeClass.foo, and not on an instance of the class
theRoUS_ has quit [Changing host]
theRoUS_ has joined #ruby
theRoUS has quit [Disconnected by services]
theRoUS_ is now known as theRoUS
<keanehsiao> anybody in Taiwan looking for a job? :p
theRoUS_ has joined #ruby
ph^_ has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
<keanehsiao> We are hiring
jrist-afk is now known as jrist
v0n has quit [Quit: Quitte]
<bigfatfrock> matled: thanks a lot, I understand that!
<bigfatfrock> and that's what I meant, yep :)
a_a_g has left #ruby [#ruby]
irrationalfab has quit [Remote host closed the connection]
jonathanwallace has quit [Remote host closed the connection]
twock has joined #ruby
wink has joined #ruby
axl_ has joined #ruby
lorandi has joined #ruby
rippa has quit [Quit: derp herp]
<wink> hello there, anyone got an idea how to get this working: http://pastie.org/3995107
<matled> bigfatfrock: note that this can be done on any object, even though this is seldomly used (for good reasons, imo)
carloslopes has joined #ruby
manizzle has joined #ruby
uris has quit [Read error: Connection reset by peer]
uris_ has joined #ruby
Croms has joined #ruby
<bigfatfrock> it's weird to me that a method is a singleton and not the class itself
<bigfatfrock> I think of a singleton as allowing only one instance of a class to be instantiated
<bigfatfrock> but I probably need to pull out my design patterns book
iocor has joined #ruby
Asher has quit [Quit: Leaving.]
<matled> bigfatfrock: well, actually you define that method on the "eigenclass" (or whatever it is called nowadays) of the object. i.e. a class between the real class that exists only for this specific object
<bigfatfrock> oh ok! I did find a great article that explains it in more detail: http://www.devalot.com/articles/2008/09/ruby-singleton
iocor has quit [Client Quit]
A124 has left #ruby [#ruby]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
irrationalfab has joined #ruby
dv310p3r has joined #ruby
adac has joined #ruby
<adac> I have stupid question: why in gods name does this if not work: "if @feedback_channel.analogue_to != "None" and to_test == true".
<adac> @feedback_channel.analogue_to in my case is != None and to_test = true
<adac> but still it won't enter
thecreators has joined #ruby
ronniy has joined #ruby
saltnvinegar has joined #ruby
<carloslopes> adac: hmmm try 'if @feedback_channel.analogue_to != "None" && to_test == true'
tomzx has quit [Read error: Operation timed out]
<carloslopes> adac: and to_test == true is doesn't necessary.. only to_test works :)
<carloslopes> adac: 'if @feedback_channel.analogue_to != "None" && to_test'
<adac> carloslopes, no luck. bit this seems to work: 'if @feedback_channel.analogue_to != "None" and to_test'
<adac> carloslopes, yes :)
<adac> carloslopes, and hwo to test if "to_test" is false?
crankycoder has joined #ruby
<carloslopes> adac: !to_test
i8igmac has quit [Quit: Leaving]
<carloslopes> adac: i think.. let me try here
<adac> carloslopes, kk
bashdy has joined #ruby
<Hanmac> bigfatfrock & matled maybe its important for you, but if you use only extend, no eigenclass is generated, and it can be still marshal'ed
<carloslopes> adac: yes.. !to_test :)
<adac> carloslopes, it enters 'if @feedback_channel.analogue_to != "None" and to_test' EVEN IF to_test is false
<adac> lol this is freaking me out
<adac> something is fishy here
<pwned> adac: perhaps to_test is not boolean
<carloslopes> adac: pwned yes, i think that what pwned say it's true
<pwned> to_test= "42" then to_test== true would be false
<pwned> but to_test would be true
<carloslopes> adac: because to_test = true; if to_test == true should work
iocor has joined #ruby
red-panda has joined #ruby
<pwned> any ruby bots here:
<carloslopes> adac: check if your variable is instantiated correctly
<adac> pwned, carloslopes looks like that but this is very strange. When I output it it shows me either "true" or "false" value for "to_test"
<pwned> adac: "true" == true is false
<carloslopes> adac: "true" is not true
ABK has joined #ruby
<carloslopes> adac: "true" is a string and true is a boolean
<carloslopes> adac: they are different things
<workmad3> "true" is merely truthy
<pwned> I think "true" should have been equal to true
<workmad3> but "false" is also truthy :)
<adac> lol
<adac> well its true without "" that outputs me
<workmad3> pwned: go to PHP :P
<pwned> "true"== true.to_s #though
<pwned> workmad3: please no insults
<workmad3> pwned: you're the one that's suggesting "true" should equal true
<workmad3> pwned: which it does in PHP ;)
<adac> but it looks like that both re indeed srings i have to test
<carloslopes> pwned: hmm think not.. because in this case we will need to use strict equals operator to check if boolean is really a boolean
<pwned> workmad3: just because I like dates doesn't mean I want to live in saudi arabia
<adac> its not bool, my "true" and "false" are strings for some reason
<adac> Is there a way to output the datatype?
<carloslopes> adac: "true".class
<carloslopes> adac: true.class
<workmad3> pwned: you can do 'if "true" ' and it will be truthy and go into the branch
sspiff has quit [Remote host closed the connection]
<adac> carloslopes, lets check this :)
<matled> Hanmac: interesting, this seems to be true for string but not for classes. i.e. class Foo; def self.foo; end; end; Marshal.dump(Foo) still works fine
<pwned> carloslopes: because "false" will be true ? yeah I guess
<pwned> you're right
awarner has joined #ruby
<carloslopes> pwned: yes.. if 'true' == true, it will be similar to javascript.. that we have == and === operators
<pwned> what if I just want "true" to be true and not "false" to be false :D
<carloslopes> pwned: and i don't like this :)
<carloslopes> pwned: (my opinion) :p
celm has joined #ruby
maurosr has joined #ruby
<adac> carloslopes, pwned, workmad: its a string indeed accoring to .class
maurosr has left #ruby ["WeeChat 0.3.7"]
chomp has joined #ruby
<adac> *according
<carloslopes> adac: good.. so you will need to put to_test == 'true' in your if statement
<workmad3> pwned: but an equality comparison of 'true == "true" '... well, the boolean true is definitely not the string "true"
C0deMaver1ck has joined #ruby
philcrissman has joined #ruby
Progster has quit [Ping timeout: 244 seconds]
<adac> carloslopes, jepp (: thank you guys for helping me out!
<carloslopes> adac: yw ;)
<pwned> yeah he's welcome
iocor has quit [Quit: Computer has gone to sleep.]
LBRapid has joined #ruby
seivan has joined #ruby
kevinbond has joined #ruby
<pwned> workmad3: saudi arabia is a nice place by the way. I just won't be persuaded to live there.
<pwned> they have lots of great engineers from india and middle east
<pwned> salaries are great
liluo has joined #ruby
<workmad3> :)
lxsameer has joined #ruby
iocor has joined #ruby
irrationalfab has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
<graspee> saudi arabia is a great place to live if you aren't a religious or political minority, homosexual, apostate or woman
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
ananthakumaran has quit [Quit: Leaving.]
internet_user has joined #ruby
<pwned> graspee: Those may be true unless you are an engineer. In which case they just let you do your job.
jonathanwallace has quit [Remote host closed the connection]
audy has left #ruby ["["Textual IRC Client: www.textualapp.com"]"]
<graspee> i wouldn't touch saudia arabia with a barge pole myself but i don't want to derail the discussion into a venemous rant
jonathanwallace has joined #ruby
mucker has quit [Quit: Lost terminal]
<Hanmac> does computer work in this sandy country?
<kalleth> yes
<kalleth> so does ak47
mdhopkins has joined #ruby
<Hanmac> or does they melt the silicum chips directly on the street?
<graspee> silicum!
<graspee> power your porn
<workmad3> graspee: or is silicum really clown porn?
<graspee> maybe it's fake cum
<graspee> like silly putty
<Hanmac> graspee: yeah sorry you know that i mean ...
peregrine81 has quit [Quit: Computer sleeping.]
<workmad3> silly putty is real putty, just not useful putty
red-panda has quit [Remote host closed the connection]
krusty_ar has joined #ruby
<graspee> i'm stopping while i'm behind!
<workmad3> :)
xaq has joined #ruby
* Hanmac knows how he can enable goto in ruby ... beat that!
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
zemanel has joined #ruby
theRoUS has quit [Quit: Leaving]
blacktulip has quit [Remote host closed the connection]
<workmad3> Hanmac: yeah, that was in RubyWeekly months ago :P
theRoUS has joined #ruby
benatwork has joined #ruby
<pwned> how successful do you guys think jruby is ?
robin850 has quit [Quit: Quitte]
ph^_ has quit [Ping timeout: 252 seconds]
yannis has joined #ruby
<pwned> for example implementation completeness, MRI compatibility
<pwned> speed of execution on common platforms
<Hanmac> pwned: i only do c++ gems ... so jruby does not work for me
bbttxu has quit [Quit: bbttxu]
<pwned> Hanmac: yeah it is a let down for me, too
<pwned> I've been using it for about half a year. There are things you can do and can't do with it.
<pwned> for one it will never fork(); # :D
bashdy has quit [Read error: Operation timed out]
<workmad3> pwned: but you can use forkjoin
igaiga has quit [Remote host closed the connection]
benatwork has quit [Ping timeout: 245 seconds]
__root__0 has quit [K-Lined]
* Hanmac is waiting for the guy who says that jruby can all what mri can ...
paradoja has quit [Quit: rcirc on GNU Emacs 24.1.50.3]
<workmad3> Hanmac: within the confines of ruby, it can
shabba has joined #ruby
<workmad3> Hanmac: however, once you start writing native extensions, then obviously it can't because native extensions are interpreter specific
shabba has left #ruby [#ruby]
<Hanmac> maybe rubinius can work with my gems ... (but not currently)
joshman_ has joined #ruby
<workmad3> I doubt it
<workmad3> different native interfaces, I believe
iamjarvo has quit [Ping timeout: 244 seconds]
<Hanmac> not so ... rubinius and mri has mostly the same interface
<workmad3> which makes sense, considering it has a pretty different architecture and very different implementation
<workmad3> mostly the same != the same
wink has left #ruby ["http://quassel-irc.org - Chat comfortably. Anywhere."]
<Hanmac> only one marco is missing at the moment
Nowaker has quit [Quit: ru]
tomb__ has joined #ruby
avtobiff has left #ruby [#ruby]
tatsuya_o has joined #ruby
kenperkins has joined #ruby
<pwned> what I love about jruby is how you can write better java with it
seivan has quit [Remote host closed the connection]
fr0gprince_mac has joined #ruby
<pwned> what you do with interfaces and anonymous classes in java you can do with a simple block
seivan has joined #ruby
kenperkins has quit [Client Quit]
<pwned> it is nerdgasm
benatwork has joined #ruby
<workmad3> pwned: fun :)
jtrudeau has joined #ruby
jtrudeau has quit [Read error: Connection reset by peer]
<graspee> i love three languages. one is for writing fast code, one is for writing code fast and one is to make me feel clever
<pwned> English is the one that makes you feel clever?
<graspee> three computer* languages
<pwned> oh ok
<hoelzro> graspee: which are they?
<C0deMaver1ck> and they are?
<workmad3> graspee: C++, ruby and erlang?
<pwned> ooh guess game
<graspee> close
<C0deMaver1ck> s/erlang/haskell?
<workmad3> s/erlang/scala
<graspee> the first is very close but wrong
replore has quit [Remote host closed the connection]
<graspee> the second was right
<workmad3> s/C++/C
<graspee> the third was not that close
<hoelzro> C, Ruby, Haskell
<graspee> workmad has 2 of 4
<graspee> of 3
<workmad3> C, ruby, lisp?
<Hanmac> i combine C,C++ and ruby ..., C++ for the fast, C for the macros, and ruby for the dynamic
<graspee> ding
<graspee> workman wins!
<workmad3> :D
<workmad3> what do I win?
<C0deMaver1ck> lisp?!
<C0deMaver1ck> ()()()()
<workmad3> C0deMaver1ck: that looks like an ill-formed lisp program to me
twqla has quit [Ping timeout: 246 seconds]
<C0deMaver1ck> ((is_this)better?)
<workmad3> (+ 2 (- 4 3))
seivan has quit [Ping timeout: 240 seconds]
<pwned> (is-this-better)
<workmad3> C0deMaver1ck: (is_this (better)) would be better
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
sec_ has joined #ruby
<workmad3> (operation list) is the general structure of lisp, iirc
<sec_> how make irb tab?
<workmad3> and of course, that's also the structure of a list, so it's a recursive definition :)
<sec_> same as a = [...]
<C0deMaver1ck> sec_: CMD + T
<sec_> a. tab tab will show the method
<C0deMaver1ck> ~$ irb
<C0deMaver1ck> lol
<sec_> C0deMaver1ck: ?
<C0deMaver1ck> was joking as in terminal shell window tab
<sec_> C0deMaver1ck: can't?
<graspee> one day my languages will combine, into clispuby!
simoneke has quit [Read error: No route to host]
<graspee> or rulisc!
<C0deMaver1ck> graspee: o/
<workmad3> graspee: languages I know - C, C++, python, java, lisp, ruby, prolog, php, scala. languages I know well - C++, java, ruby :)
<graspee> but how many do you LOVE
<graspee> i listed only those
<sec_> workmad3: any tool same ipython?
simoneke has joined #ruby
<sec_> for ruby
<workmad3> graspee: ah, that I love... C++ and ruby, and I quite like scala but I don't know it very well yet :)
<C0deMaver1ck> workmad3: how about which ones are you fluent in?
<workmad3> C0deMaver1ck: pretty much only ruby nowadays
supergiantrobot_ has joined #ruby
clockwize has quit [Quit: clockwize]
<sec_> how do sort on object?
<workmad3> C0deMaver1ck: it's been too long since I did any C++, not really fluent with it anymore
Vainoharhainen has quit [Quit: Linkinus - http://linkinus.com]
<graspee> my c++ was always very like c with bits on
<C0deMaver1ck> I'm actually getting back into C++
<graspee> so i stopped saying i loved c++
<C0deMaver1ck> I'm starting to contribute to the kernel
<hoelzro> C0deMaver1ck: which kernel?
<C0deMaver1ck> linux
<hoelzro> but...C++...
<workmad3> graspee: I love me some C++, before I switched to ruby I was even starting to get the hang of template metaprogramming :)
<workmad3> C0deMaver1ck: isn't the linux kernel C, not C++? I thought torvalds hated C++
<bigfatfrock> workmad3: indeed, C
<hoelzro> he does. very much.
<C0deMaver1ck> I haven't gotten into his kernel, I'm working on a mobile device
theRoUS has quit [Ping timeout: 260 seconds]
CheeToS has joined #ruby
<pwned> C0deMaver1ck: android?
bbttxu has joined #ruby
<C0deMaver1ck> but you're right most of it is C
<graspee> i used c++ properly for only one project
<C0deMaver1ck> which is more like portable assembly
perryh is now known as perryh_away
<graspee> which was back when i was a good programmer hehe
Vainoharhainen has joined #ruby
<pwned> C++ was good with all the boost stuff
<pwned> now they standardized some of it
<workmad3> standardise reference-counted smart-pointer templates ftw!!!
<workmad3> *standardised
heftig has quit [Quit: leaving]
<pwned> I miss the times you had to link at least five libraries to make a simple game
<pwned> now you just link four
<workmad3> heh :)
<shevy> oh god
<shevy> I hate boost
tcopp has joined #ruby
<shevy> they should really stop proliferating non-integrated extensions to C++, and either drop them, or put up a new C++ that has all the shit that is needed
<sec_> how do sort on object?
<sec_> how do sort on object?
<pwned> shevy: they do, once every five years
<pwned> well this time it was 9 years
<workmad3> pwned: 5 years? you've got to be kidding
<shevy> sec_ object.sort or .sort_by
brainer has joined #ruby
<shevy> pwned I kinda have the feeling that they will still require boost ...
<pwned> or perhaps it is logarithmic progression
<workmad3> pwned: last official C++ standard was 1998, new one was 2011, and there was a technical update in the middle
<sec_> shevy: thanks
<pwned> 98-03-12- what's next?
<pwned> 25?
<shevy> sec_, here is the link to the official docu about it -> http://ruby-doc.org/core-1.9.3/Enumerable.html#method-i-sort
<sec_> 'cab'.sort
<sec_> NoMethodError: undefined method `sort' for "cab":String
<workmad3> pwned: there might be a technical update in the next decade, but probably looking at 2 decades for the next complete standard :P
fjfish has joined #ruby
<graspee> i don't see why they don't leave c++ alone and make a new language, like "the third c" or something
<graspee> the syntax is getting silly now with c++
francisfish has quit [Read error: Connection reset by peer]
chson has joined #ruby
<pwned> I think C++ is an experiment on efficiency
<hoelzro> graspee: have you seen D, or Go?
<graspee> no
<sec_> shevy: how sort a string?
<pwned> how much can a static typed templated compiled language look like a scripting language
<pwned> without being one
<graspee> string.sort!
<graspee> i'm guessing
<graspee> i shouldn't guess
<shevy> sec_ that makes no sense. you need to provide more information
one8zero has joined #ruby
trebaum has quit [Quit: leaving]
<sec_> 'cab'.sort => 'abc'
<sec_> how do that?
trebaum has joined #ruby
trebaum has joined #ruby
<hoelzro> graspee: D is another C-like language with some very nice features, and Go is a language from Google that no one cares about
<hoelzro> to be fair, not many care about D either =P
<shevy> sec_, 'cab'.split(//).sort.join # => "abc"
trebaum has quit [Client Quit]
<sec_> shevy: // mean for 3 chars?
<pwned> D's whole existence is based on a verse in ISO 14882:98 that says that an implementation doesn't have to provide the standard library
<graspee> ah
<pwned> not a very strong basis
<shevy> hoelzro, google puts money into shit... see Dart, the language that will DESTROY javascript
<shevy> sec_, it is a regex. // splits on each-character
<graspee> i've heard of D and go but never knew what they were really. i knew D was related to C vagually
freeayu1 has quit [Quit: 离开]
<shevy> sec_, you can not sort a string alone. you need to treat it as array of characters, if you want to use .sort. or you come up with your own sorting algorithm... but it will still split on char or bytes, I assume
trebaum has joined #ruby
trebaum has quit [Changing host]
trebaum has joined #ruby
<shevy> yeah I was surprised that noone uses D
<sec_> shevy: ok
<shevy> you always read how superior D is but then it fails to dominate
<hoelzro> shevy: it's better than C++, mo
<hoelzro> as a language, that is
<shevy> yup. I keep on reading the same. it just does not seem to deliver in May 2012 :)
hamfz_ has quit [Ping timeout: 244 seconds]
<shevy> I hope (Visual) Basic dies soon
<graspee> why?
<apeiros_> shevy: ruby is the best language too, yet it's not the most used language…
<shevy> graspee who needs it?
<graspee> i used to use vb6
<shevy> apeiros_, well ruby wont be able to replace the segment of the C-family
tomb__ has quit [Quit: Computer has gone to sleep.]
<shevy> imagine the linux kernel in ruby!
brainer has left #ruby [#ruby]
<apeiros_> shevy: who said replace. just dominate.
<graspee> i know vb6 is a shitty language really but damn i got really, really good at it
<graspee> i used it professionally for 2 years for an enormous project
univers has joined #ruby
<shevy> what happened to that project?
iamjarvo has joined #ruby
<graspee> the company went bust
<dominikh> "best language" *shiver*
<dominikh> there's no such thing
<graspee> but afaik companies are still using the product
<shevy> graspee, but why? debts?
<hoelzro> dominikh++
<apeiros_> dominikh: don't deny it! ruby is the most bestest language therecanbe!!!
<graspee> it was a victim of the general bubble collapse in about 2001
<shevy> ah ok 2001
<graspee> it was case handling software for evil solicitors
<graspee> vb6, vba, ms office
<graspee> sql server
c0rn has joined #ruby
<graspee> i kept trying to get the company to use linux for some stuff
<graspee> or to use different languages
<graspee> but they weren't interested
<graspee> i sneaked some python in somewhere i think
<graspee> but i can't remember what for. just some small utility program for something
hoelzro is now known as hoelzro|away
<graspee> i was really into python at the time
<horseman> shevy: what od u think of this: https://github.com/rails/rails/pull/6549
<apeiros_> dominikh: you at euruko?
<dominikh> apeiros_: most certainly not
<apeiros_> =(
tatsuya_o has quit [Remote host closed the connection]
<dominikh> where is it this time, anyway
<apeiros_> amsterdam
<dominikh> ah
<shevy> horseman I am too afraid to click on that
tatsuya_o has joined #ruby
<horseman> shevy: haha, it's just a github pull request
dhruvasagar has quit [Ping timeout: 260 seconds]
<shevy> graspee can you click on it and tell me what you see there?
emmanuelux has joined #ruby
capibara has quit [Ping timeout: 252 seconds]
albemuth has joined #ruby
capibara has joined #ruby
theRoUS has joined #ruby
<graspee> it says make pry default rails console
<graspee> it's a discussion on rails
krusty_ar is now known as kyhei____
one8zero has quit [Quit: one8zero]
fr0gprince_ma has joined #ruby
<graspee> it says what should we do if user doesn't have pry? and suggests defaulting to crappy irb and warning the user that pry is not found
fr0gprince_ has quit [Ping timeout: 246 seconds]
Squarepy has joined #ruby
fr0gprince_mac has quit [Ping timeout: 246 seconds]
kyhei____ is now known as kyheo_____
headius has joined #ruby
saltnvinegar_ has joined #ruby
cousine has joined #ruby
mohits has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
kyheo_____ is now known as krusty_ar
horseman has quit [Read error: Connection reset by peer]
and0 has joined #ruby
saltnvinegar has quit [Ping timeout: 240 seconds]
saltnvinegar_ is now known as saltnvinegar
gilead has quit [Quit: Leaving]
<shevy> k
<shevy> thanks
<shevy> I can click on it
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<shevy> Banistergalaxy \o/
d3vic3 has quit [Ping timeout: 245 seconds]
C0deMaver1ck has quit [Remote host closed the connection]
pabloh has joined #ruby
fr0gprince_ has joined #ruby
horseman has joined #ruby
C0deMaver1ck has joined #ruby
<shevy> hmmmm
ananthakumaran has joined #ruby
ph^ has joined #ruby
<shevy> that still reminds me, I need to use pry as replacement for irb within a running ruby program
TheFuzzball has joined #ruby
ItalSpliff has joined #ruby
d3vic3 has joined #ruby
Ammar01 has quit [Quit: Leaving]
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
LBRapid has quit [Quit: Farewell...]
<ItalSpliff> http://debbydasilvianygren.blogspot.se/ My blog, you Sexy girl!!!
<ItalSpliff> http://debbydasilvianygren.blogspot.se/ My blog, you Sexy girl!!!
<and0> gee thanks italspliff!
ItalSpliff was kicked from #ruby by apeiros_ [ItalSpliff]
<graspee> i distrust anything pasted twice in a row
red-panda has joined #ruby
capibara has quit [Ping timeout: 244 seconds]
capibara has joined #ruby
<workmad3> dontclick.com is available?
* workmad3 goes to buy
<graspee> and a new rotton.com is born
<shevy> ewww
<workmad3> bah, according to my normal domain purchasing place, it's taken
<graspee> think of the endless subdomains
<shevy> that was the sick website wasn't it?
C0deMaver1ck has quit [Remote host closed the connection]
<graspee> twochickensonebeaker.dontclick.com
<workmad3> dontclick.xxx is available apparently
<shevy> man
<shevy> dont click on that
<graspee> it would work on the principle of "don't press this button"
<workmad3> just a shame that they cost £80
C0deMaver1ck has joined #ruby
<shevy> reverse psychology never works
<graspee> 80?
<graspee> wow that's a lot dearer than it used to be
d3vic3 has quit [Ping timeout: 244 seconds]
<workmad3> .xxx are quite new
<graspee> i used to own nehelenia.com and used it as a sailor moon fansite haha
<graspee> happy days
<shevy> ewww sailor moon
<workmad3> and they're still charging through the roof for the .xxx tld
d3vic3 has joined #ruby
<shevy> the days of cheap pr0n are over
<workmad3> nah, cheap pr0n just goes on a .com
<workmad3> .xxx is for the classy stuff :P
tomb__ has joined #ruby
<workmad3> of course, the one you really want is dontclick.me
<workmad3> or maybe dontcli.ck
<graspee> goatse.cx
<graspee> classic
bbttxu has quit [Quit: bbttxu]
khakimov has joined #ruby
<sec_> how i change array after sort each item of it?
AzizLight has quit [Quit: leaving]
<shevy> sec_ try .sort!
cousine has quit [Remote host closed the connection]
<shevy> sec_, a = %w( ghi jki abc ); a.sort!; a # => ["abc", "ghi", "jki"]
davidcelis has quit [Quit: K-Lined]
<shevy> though I am confused why you want to sort _after_ ...
<sec_> shevy: i am doing homework
<shevy> that is nice, the question is still why you want to change the array _after_ the sorting
<sec_> shevy: i have an arry ['cars', 'for', 'potatoes', 'racs', 'four','scar', 'creams', 'scream']
<shevy> yep. array.sort! will have changed that array then
<sec_> shevy: i need find items that created by same chars
<sec_> shevy: then group by small array
andrew_ has joined #ruby
<sec_> shevy: => output [["cars", "racs", "scar"], ["four"], ["for"], ["potatoes"],
<sec_> ["creams", "scream"]]
<shevy> well just write a method that changes the character position of your string
jnoob22 has joined #ruby
pdtpatrick has joined #ruby
tk___ has quit [Quit: ばいばい]
<sec_> shevy: yeah same a[0].split(//).sort.join put again a[0]
<ramblex> sec_: take a look at group_by
JohnBat26 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
fr0gprince_ma is now known as fr0gprince_mac
zommi has quit [Read error: Connection reset by peer]
lkba has joined #ruby
zz_chrismcg is now known as chrismcg
wilmoore has joined #ruby
yankov has joined #ruby
tomb__ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<sec_> ramblex: nice, group by length
graspee has quit [Quit: leaving]
<ramblex> i suspect you want to group by chars.sort
mucker has joined #ruby
jodell has joined #ruby
sbanwart has quit [Read error: Operation timed out]
brown has joined #ruby
brown has left #ruby [#ruby]
headius has quit [Quit: headius]
kaiwren has quit [Quit: kaiwren]
tayy has joined #ruby
ABK has quit [Ping timeout: 244 seconds]
CannedCorn has joined #ruby
<CannedCorn> hey guys
counterbeing has joined #ruby
<CannedCorn> im having trouble bundle installing gperftools in windows
joukokar has quit [Ping timeout: 248 seconds]
<sec_> a.group_by{ |i| i.split(//).sort.join}=> {"acemrs"=>["creams", "scream"], "aeoopstt"=>["potatoes"], "foru"=>["four"], "acrs"=>["cars", "racs", "scar"], "for"=>["for"]}
<sec_> ramblex: looks nice
<CannedCorn> it says could not create makefile due to some reason, probably lack of necessary libraries or headers
<ramblex> sec_: yes, then you can use .values to get what you want i think
<CannedCorn> took a look in the mkmf file and it looks as though there are problems during extraction
mikepack has joined #ruby
kenperkins has joined #ruby
robdodson has joined #ruby
<sec_> wow
<sec_> very cool ramblex
hakunin has quit [Remote host closed the connection]
<sec_> thanks
<ramblex> np
saltnvinegar has quit [Quit: saltnvinegar]
elux has joined #ruby
<elux> hey guys
<elux> does anyone here use Rack::Cache?
<Hanmac> sec_ a.group_by{ |i| i.chars.sort.join}
savage- has quit [Remote host closed the connection]
<elux> i noticed its not thread-safe.. i was trying to use it with the Puma rack server, and it started doing some weird shit, then i realized whats going on ..
<elux> perhaps there is a synchronized data store tho ..?
<ramblex> Hanmac: you don't even need the join i don't think
<Hanmac> ramblex depend on the output he wants
* sec_ start feel like ruby
dekroning has quit [Ping timeout: 244 seconds]
blacktulip has joined #ruby
jrajav has joined #ruby
looopy has quit [Read error: Connection reset by peer]
looopy has joined #ruby
niku4i has joined #ruby
ElitestFX has joined #ruby
billiamii|work has joined #ruby
test34 has quit [Ping timeout: 244 seconds]
test34 has joined #ruby
bglusman has quit [Remote host closed the connection]
<CannedCorn> anyone familiar with ruby in windows at all
kenperkins has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<sec_> Hanmac: how sort non case sensitive?
yellow5 has quit [Ping timeout: 248 seconds]
<Mon_Ouie> sort_by and use String#casecmp
tayy has quit [Remote host closed the connection]
test34- has joined #ruby
<sec_> Mon_Ouie: a.group_by{ |i| i.chars.sort }.values how add to this?
test34 has quit [Ping timeout: 244 seconds]
ABK has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
C0deMaver1ck has quit [Remote host closed the connection]
fudanchii has joined #ruby
C0deMaver1ck has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
kenperkins has joined #ruby
codebeaker has quit [Quit: codebeaker]
andrew_ has quit [Remote host closed the connection]
andrew_ has joined #ruby
<ramblex> sec_: do you want 'creams' and 'ScREam' to end up in the same array for example?
kevinbond has quit [Quit: kevinbond]
davidcelis has joined #ruby
maletor has joined #ruby
Banistergalaxy has quit [Ping timeout: 248 seconds]
bglusman has joined #ruby
chrisja has joined #ruby
<sec_> ramblex: yes
bglusman has quit [Remote host closed the connection]
<ramblex> a.group_by { |x| x.chars.map(&:downcase).sort }.values
<ramblex> actually, that's not quite right
headius has joined #ruby
<ramblex> or is it
v0n has joined #ruby
robdodson has quit [Quit: robdodson]
jrist is now known as jrist-afk
fr0gprince_mac has quit [Quit: Leaving...]
robdodson has joined #ruby
mdhopkins has quit [Quit: mdhopkins]
davidw has quit [Ping timeout: 248 seconds]
baroquebobcat has joined #ruby
baroquebobcat has quit [Client Quit]
mdw has quit [Remote host closed the connection]
saltnvinegar has joined #ruby
baroquebobcat has joined #ruby
dev_ has joined #ruby
<dev_> got a silly question, started ruby like today ..
Morkel has quit [Quit: Morkel]
theRoUS has quit [Ping timeout: 260 seconds]
red-panda has quit [Remote host closed the connection]
<ccooke> dev_: go ahead
carlyle has joined #ruby
<dev_> i'm trying to print numbers from 1 to 4 and their squares
<dev_> 1.upto(4) {|x| puts x**2, x }
patsplat has quit []
<dev_> but the numbers don't show on the same line
<ramblex> dev_: use print
adac has quit [Ping timeout: 265 seconds]
mdhopkins has joined #ruby
thone has joined #ruby
<ccooke> dev_: puts automatically adds a newline. print does not
celm has quit [Quit: Leaving]
thone_ has quit [Read error: Operation timed out]
<dev_> 1.upto(4) {|x| print "#{x**2} #{x}"}
<dev_> this isn't giving the desired output either
<ramblex> what is the desired output?
<dev_> 1 1
<dev_> 2 4
<dev_> 4 16
Squarepy has quit [Quit: Leaving]
<dev_> in essence print a number followed by its square from 1 to 4
<ramblex> 1.upto(4) { |x| puts "#{x} #{x**2}" }
CannedCo_ has joined #ruby
williamcotton has joined #ruby
senny has quit [Remote host closed the connection]
<dev_> brilliant.. okay it makes sence
jnoob22 has quit [Ping timeout: 244 seconds]
<dev_> but why didn't the print work, what was it trying to do
looopy has quit [Remote host closed the connection]
<ramblex> print won't add any newlines at all
CannedCorn has quit [Ping timeout: 260 seconds]
<dev_> oh It now I see, the space at the end was missing
<dev_> 1.upto(4) {|x| print "#{x**2} #{x}"} Output: 1 14 29 316 4
savage- has joined #ruby
<dev_> made me think it was printing 14 but its printing 1 1 4 2 9 3 1 6 4 without the new line
maesbn_ has quit [Remote host closed the connection]
<ramblex> indeed
wallerdev has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
looopy has joined #ruby
<dev_> I am assuming the \n sequence will do the work
axl_ has joined #ruby
<shevy> :)
thecreators has quit [Read error: Connection reset by peer]
<dev_> thx guys this thing is fun
thecreators has joined #ruby
chienpo has joined #ruby
red-panda has joined #ruby
MasterIdler has joined #ruby
rdamen has joined #ruby
<dev_> one last question
<dev_> in eclipse i'm trying to analyze a code
DrShoggoth has joined #ruby
<shevy> ewww
<davidcelis> ew
<shevy> eclipse!
<ramblex> heh
<dev_> wait what you guys use?
<ramblex> vi
<dev_> i'm on ubuntu
<shevy> I use bluefish 1.0.7
manizzle has quit [Ping timeout: 246 seconds]
<Hanmac> dev_ i use gedit for single files and eclipse for projects
fjfish has quit [Remote host closed the connection]
jackiechan0 has joined #ruby
<shevy> ruby code should be simple, if someone needs an IDE for ruby code then it seems too complicated for 99% of the usage cases for ruby
aantix has joined #ruby
<dev_> okay, coming from java, when you type a variable and dot, it displays options of what you can do, tha'ts why I chose eclipse but my question is, I don't even get that functionality
aantix has quit [Read error: Connection reset by peer]
<sec_> ramblex: 100% correct
<sec_> ramblex: thanks
<Hanmac> shevy: i write an binding, so sometimes i need more then 100 files to look over ...
<davidcelis> dev_: gedit is fine for projects
iocor has joined #ruby
<davidcelis> esp. with gmate
aantix has joined #ruby
<sec_> gmate is on macosx?
<shevy> Hanmac and you use ... eclipse?
<davidcelis> gmate is a gedit plugin to make it more textmate like
<Hanmac> yeah and it works file
<davidcelis> you can get it from the package manager
<Hanmac> fine
<davidcelis> i can't stand IDEs in general
niku4i has quit [Remote host closed the connection]
<davidcelis> unless you're one of the people that consider vim an IDE
<Hanmac> dev_ do you install the ruby plugins for eclipse? and if that not work i think this smart function lookup cant work on ruby because ruby is to dynamic
aantix has quit [Read error: Connection reset by peer]
<dev_> I installed the aptana plugin
<dev_> here's what I'm trying to accomplish.. i have this code I need to analyze
<dev_> it uses a lot of require, and that sounds like import from java
<dev_> i need to know what lines of codes uses a specific library
<dev_> for example instance.memory
<dev_> in java, clicking on instance will tell me the type of object
<dev_> that sort of thing.
keppy has joined #ruby
<davidcelis> java is statically typed
<davidcelis> in ruby, a variable can have anything
krusty_ar has quit [Ping timeout: 246 seconds]
<davidcelis> to highlight a variable in ruby and know what object it stores would require a step-through of, potentially, a LOT of code
khakimov has quit [Quit: Computer has gone to sleep.]
ipoval has joined #ruby
brianpWins has quit [Quit: brianpWins]
berkes has quit [Ping timeout: 246 seconds]
rushed has quit [Quit: rushed]
<dev_> david what it stores is far fetched but at least what class it belongs to originally
<dev_> or at that point in the code
itnomad has joined #ruby
ABK has quit [Ping timeout: 252 seconds]
mikepack has quit [Remote host closed the connection]
jnoob22 has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
rushed has joined #ruby
apeiros_ has joined #ruby
fudanchii has quit [Quit: WeeChat 0.3.8-rc2]
xaq has quit [Remote host closed the connection]
<elux> is there a way to do something like Dir[some_path+"*"] .. and have it return the filename, but also the stats of a file.. specifically, the length or last time it was modified..
fudanchii has joined #ruby
<apeiros_> elux: Enumerable#map and File.stat
<elux> yea.. for sure..
<elux> was hoping i could do it with a single call
<apeiros_> add a method, there, one call…
<elux> lol.. i meant IO request
<elux> s
<elux> but fair enough.. that should work. thanks!
v0n has quit [Quit: Quitte]
<apeiros_> I don't think there's a low-level API to stat a whole dir
<apeiros_> but I ain't a C programmer
robdodson has quit [Quit: robdodson]
<dev_> for example this code i'm looking at has, require "fileutils", now I can search if file that and see if it is a library of ruby, but can't really tell for sure where in the code it is being called, vice versa. if I had a line of code calling a method, I would like to know at least what class' method it is calling.
<Hanmac> elux: Dir[some_path+"*"].each_with_object({}) {|s,h| h[s] = File.stat(s)}
BiHi has quit [Quit: Computer has gone to sleep]
<davidcelis> dev_: You can't really do that, dude; you can't even tell what class the variable points at just by highlighting it. Ruby is dynamically typed, it can have any object in it depending on how the code has run thus far with various inputs
adeponte has joined #ruby
<davidcelis> dev_: Best you can do is use a debugger or stick in a `puts variable.class` statement
<dev_> okay thanks
<dev_> that was very helpful, again first day in ruby.. lol know so little
<davidcelis> sure thing
<davidcelis> most people i know don't bother with ruby-debug
<davidcelis> they just throw in puts statements
<dev_> yeah i know what you mean
twqla has joined #ruby
bier has quit [Ping timeout: 245 seconds]
bricker88 has joined #ruby
CheeToS has quit [Ping timeout: 240 seconds]
bluOxigen has quit [Ping timeout: 245 seconds]
alem0lars has quit [Quit: quit]
itnomad has quit [Quit: Leaving]
<pwned> I throw in tests
<pwned> it is less painful when you're drunk
<dev_> lol
<dev_> now I understand why people using vim and all these text editors
sepp2k has quit [Remote host closed the connection]
<shevy> davidcelis I used advanced debugging
<shevy> davidcelis I use pp rather than puts for it... :>
<davidcelis> pp is nice
<davidcelis> i use pry
<bnagy> I used pry today for debugging, for the first time
<bnagy> was completely useless, went back to 'p'
<bnagy> :)
<horseman> bnagy: what was useless about it naggy!
<pwned> I use vodka and plums for debugging
<horseman> bnagy: did you use 'pry' or 'binding.pry' ?
<bnagy> horseman: it just didn't tell me anything I didn't know before
<bnagy> binding.pry
andrew_ has quit [Remote host closed the connection]
<bnagy> turns out I typo'd initialize and went blind
<horseman> bnagy: well...all it ever claimed to do is give you an interactive session at the point you call it, if that's not useful then i guess you have a kind of bug that isn't amenable to that sort of exploration
<shevy> hah!
<shevy> I hate mistyping initialize
<shevy> "def intialize"
<shevy> took me way too long to find that error
<bnagy> inorite??
<sec_> can you tell me basic usage about OOP in ruby?
chrismcg is now known as zz_chrismcg
heftig has joined #ruby
yankov has quit [Remote host closed the connection]
<C0deMaver1ck> sec_: everything in Ruby is OOP
<bnagy> you can't help but use OOP, everything is an object
<bnagy> except some things
ipoval has quit [Quit: ipoval]
a_a_g has joined #ruby
Morkel has joined #ruby
jimeh has quit [Ping timeout: 246 seconds]
<bnagy> sec_: think in terms of actual objects, and what that object should be able to DO (methods) and what ATTRIBUTES the object should have that support those actions (@ivars)
bglusman has joined #ruby
<bnagy> and then the interactions build fairly naturally
jgrevich has joined #ruby
<Hanmac> and everything which is an object is an instance too
booginga has joined #ruby
<horseman> sec_: basic usage would be to define a class: class Hello; def blergh; end; end
<bnagy> eventually you'll start to recognise patterns
<horseman> sec_: and instantiate the class like so: hello = Hello.new
<sec_> (a) Create a class Dessert with getters and setters for name and calories. Define instance
<sec_> methods healthy?, which returns true if a dessert has less than 200 calories, and delicious?,
bier has joined #ruby
<sec_> which returns true for all desserts.
<bnagy> an then you'll start yelling at people for doing it wrong
<horseman> sec_: sounds like homework
<horseman> :)
<sec_> horseman: take this examle
<bnagy> and then you'll start preaching agile development and XP
<sec_> horseman: yeah,
<horseman> sec_: do your own homework :)
<bnagy> and then someone will (hopefully) shoot you
medik has quit [Quit: ...]
<sec_> horseman: i am doing
<horseman> sec_: if you cant do it, then clearly you weren't paying attention in class
<sec_> horseman: so i am here
<sec_> horseman: :)
medik has joined #ruby
<pwned> I'm surprised you have ruby class
<sec_> pwned: yeah,
<pwned> "ruby".class == "String" ?
lopin has quit []
<bnagy> class Dessert;attr_accessor :name, :calories;def healthy?;@calories<200;end;def delicious?;true;end;end
<pwned> Dessert.new.tap do |dessert| dessert.@calories= 3000; puts dessert.healthy? end
piotr_ has joined #ruby
<pwned> why tap? why not?
g0bl1n has quit [Ping timeout: 240 seconds]
apok has joined #ruby
<heftig> dessert = Dessert.new; dessert.@calories = 3000; puts dessert.healthy?
ephemerian has quit [Quit: Leaving.]
<heftig> the only difference is the scope of "dessert"
<apeiros_> desert.@caloeries?
<Hanmac> "dessert.@calories" is wrong
<heftig> that is true.
Morkel has quit [Quit: Morkel]
<bnagy> sec_: the awesome thing is that if I do your homework for you I get to ruin your future, because you learn nothing
<pwned> I fuked up
<sec_> bnagy: i am learning from your writing
<heftig> IMO tap is really only a debugging tool, for temporarily inserting a "p" or similar into a method chain
<bnagy> which is totally worth the 3 seconds thought on my part
<pwned> I tap everything
<bnagy> sec_: no, you're not, you're leeching
<sec_> bnagy: i don't copy /paste..
<horseman> heftig: i like tap here: array.tap(&:pop)
tayy has joined #ruby
<sec_> bnagy: i don't know do it.. really.
<heftig> horseman: what is the purpose of that?
jenrzzz-mac has joined #ruby
<horseman> heftig: pop otherwise returns the element popped, but i prefer the array itself
<bnagy> horseman: whoaaa
<sec_> bnagy: search by example then do .. i found example is hardly to read, for example about OOP http://heim.ifi.uio.no/~hpl/INF5660/ruby/Frequently_encountered_tasks_in_ruby.html
dr_bob has joined #ruby
bglusman has quit [Remote host closed the connection]
beneggett has joined #ruby
<pwned> you can chain tap this map that each theother
<pwned> it's clean and modular
<pwned> it is also the k-combinator
Helius has quit [Ping timeout: 248 seconds]
<pwned> who doesn't love k-combinators?
<horseman> heftig: i have a few applications similar to that
<horseman> it's nice
<horseman> and i think quite readable if you're used to it :)
<bnagy> horseman: I have been looking, not very seriously, for a solution to that for years :)
philcrissman_ has quit [Remote host closed the connection]
<bnagy> 1,2,3].tap {|a| a.delete_at(2)}
<bnagy> => [1, 2]
<sec_> horseman: yeah, i only use ruby 1-2days
<bnagy> never thought of tap
<horseman> cool
counterbeing has quit [Ping timeout: 244 seconds]
<bnagy> it's gross and I dunno if I would use it in real code, but it's cooool
GuidovanPossum has joined #ruby
jrist-afk is now known as jrist
bigfatfrock has left #ruby [#ruby]
<sec_> bnagy: has no 'return thing' in code?
robbyoconnor has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
medik has quit [Ping timeout: 265 seconds]
Vainoharhainen has quit [Quit: Leaving...]
ericcoleman has joined #ruby
dEPy has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
lennyks has quit [Ping timeout: 245 seconds]
<bnagy> you don't usually need explicit return in ruby, methods will return the last evaluation result
kenichi has joined #ruby
havenn has joined #ruby
Poapfel has quit [Ping timeout: 244 seconds]
Poapfel has joined #ruby
kaiwren has joined #ruby
skyjumper has left #ruby [#ruby]
<sec_> bnagy: attr_accessor is same as constructor def initialize() ?
headius has quit [Quit: headius]
<bnagy> sec_: no
schovi has quit [Remote host closed the connection]
bglusman has joined #ruby
ericcoleman has quit [Remote host closed the connection]
Araxia_ has joined #ruby
mrsolo has joined #ruby
<bnagy> ok bedtime
AlbireoX has quit [Read error: Connection reset by peer]
medik has joined #ruby
brianpWins has joined #ruby
jnoob22 has quit [Ping timeout: 260 seconds]
workmad3 has quit [Ping timeout: 245 seconds]
xaq has joined #ruby
carinishead has joined #ruby
dtang_ has quit [Quit: dtang_]
banseljaj is now known as imami|afk
<carinishead> i know there are several ways to do dynamic method calls in ruby, but is there a way to pass an object (without a to_string method) as an argument to a dynamic call?
dtang has joined #ruby
klaas has quit [Quit: ZNC - http://znc.sourceforge.net]
<carinishead> eval method<< argument works but only in the case that argument is a string
<carinishead> or can be converted into one
<horseman> carinishead: i odnt know what u mean, provide more info
x0F_ has joined #ruby
x0F_ has joined #ruby
x0F_ has quit [Changing host]
x0F has quit [Disconnected by services]
x0F_ is now known as x0F
flak has joined #ruby
rippa has quit [Ping timeout: 246 seconds]
cha1tanya has quit [Quit: Leaving]
flak is now known as Guest48874
<apeiros_> carinishead: huh? you probably want obj.send :method_name, arg1, arg2, …
<carinishead> i'm trying to iterate through an array of methods to be called, they're obviously strings… you can call methods dynamically using Object.send(:method_name), or by eval method_name
chico_chicote has joined #ruby
<carinishead> yeah
<apeiros_> you usually do not want to use eval.
robdodson has joined #ruby
<carinishead> apeiros: i originally had used veal because i read that the performance was best with this method, but realized i can't do that now
<dEPy> when shoul one use static classes and when static methods?
<apeiros_> carinishead: I seriously doubt that eval is the fastest for that.
<apeiros_> dEPy: what's a static class? in ruby I mean…
danielvdotcom has joined #ruby
saltnvinegar has quit [Quit: saltnvinegar]
robdodson has quit [Client Quit]
adamkittelson has joined #ruby
<dEPy> class << self ? or I undestood it wrong?
medik has quit [Quit: ...]
<apeiros_> I think you did
medik has joined #ruby
liluo has quit [Remote host closed the connection]
<dEPy> ah.. k
<dEPy> then just about static methods :D
<apeiros_> class << self does not create a new class. it opens an existing class, which every object has
horseman has quit [Read error: Connection reset by peer]
GhettoCode has joined #ruby
<dEPy> oh, ok..
<Hanmac> apeiros_ not for every objects
<apeiros_> dEPy: well, with classes, the common use-case is for specific constructors. see e.g. Date.civil(y,m,d), Date.ordinal(year, day_of_year), Date.commercial(year, week, day_of_week)
<apeiros_> Hanmac: yes, I know. but I don't see a point in confusing dEPy at this point.
luxurymode has joined #ruby
ramblex has quit [Ping timeout: 246 seconds]
<apeiros_> Hanmac: I also know that they're technically only coming into existence when needed
<carinishead> apeiros: that worked… i originally hadn't used it because i was trying to call non instance methods, but i totally spaced i could just say self.send(:method, arg)
<carinishead> thanks
<apeiros_> carinishead: you can also just use `send(:method, arg)`
<apeiros_> i.e., leave away the `self.`
<carinishead> ahh
<carinishead> did not know that
<carinishead> thanks!
<dEPy> but, def self.something ... end is static method then right?
<apeiros_> dEPy: we don't call it static method
<apeiros_> but yes, it's a class method
<dEPy> class method? :)
<shevy> :)
horseman has joined #ruby
carinishead has left #ruby [#ruby]
<Hanmac> a= Object.new; def a.something ... end works too :P
<dEPy> oh, so you can add methods on objects like in javascript
<shevy> apeiros_ is teaching swiss ruby. it's the strict ruby, in the left hand he has a stick (with thorns), but in the right hand he has Schokli (chocolate)
jnoob22 has joined #ruby
<apeiros_> oh, carinishead left… eval is *lots* slower than send. about 60x here.
<dEPy> Hanmac but if you do it that way is it still class method or instance method?
<shevy> dEPy it is specific to the object that is "a"
hynkle has quit [Read error: Connection reset by peer]
<apeiros_> dEPy: technically, all methods are instance methods
<dEPy> am, wait.. so..
<apeiros_> there really isn't such a thing as a class method. calling a method that is just "convenience"
<Hanmac> its called singleton method ... an method defined in the eigenclass of a
hadees has quit [Quit: hadees]
neersighted is now known as neersighted|AFK
<shevy> only a has that
<dEPy> so it's like prototype in javascript?
<shevy> garfield = Cat.new; def garfield.fat?; true; end # <-- only garfield is a fat cat!
<jrajav> ww/graves all day
<jrajav> <3
<jrajav> Whoops wrong channel sorry :P
<dEPy> oh. so it's not like prototype :)
<shevy> not sure what prototype does in js?
<shevy> does it add to all classes in javascript?
<dEPy> after creation you can only add methods to that instance?
<shevy> does js even have classes... hmmmm
<dEPy> yes, it adds to all classes with the same prototype
neersighted|AFK is now known as neersighted
<dEPy> shevy not really, it's prototype based (like io)
<apeiros_> dEPy: it's just that every object has a "secret" class sitting in front of the objects .class. that is the .singleton_class
<shevy> ok, not sure I understood it, but it does not sound to be the same at all
jackiechan0 has quit [Quit: Sto andando via]
<shevy> io is cool
<apeiros_> dEPy: and in the method lookup chain, that class is considered first
roolo has quit [Quit: Linkinus - http://linkinus.com]
<shevy> I hate that they use := for assignment though
<dEPy> shevy :D pascal style
medik has quit [Quit: ...]
<shevy> pascal committed that atrocity? :(
medik has joined #ruby
<Hanmac> shevy i hate it too, it looks like vampire teeth
schovi has joined #ruby
<shevy> lol
<dEPy> apeiros and this class is eigenclas?
<shevy> yeah and = means "update Slot"
<apeiros_> dEPy: ruby 1.9 settled on the term singleton_class
<apeiros_> but yes, it was/is also called eigenclass
<dEPy> ok, good to know :)
ruby has joined #ruby
davidpk has joined #ruby
<dEPy> so.. class << self
<jrajav> := is more correct mathematically speaking :P
luckyruby has joined #ruby
<dEPy> is probably for metaprogrammin then?
zinjacoder has quit [Quit: Peace!]
<apeiros_> meh, it's for programming
tomb__ has joined #ruby
<dEPy> nvm then
<dEPy> must read more :)
<apeiros_> class Foo; class << self; $x = self; end; end; $x == Foo.singleton_class # => true
<apeiros_> `class << self`, or rather, `class << obj` just opens the singleton_class of obj
iocor has quit [Quit: Computer has gone to sleep.]
<apeiros_> all you need to be aware of is that `class Foo; $x = self; end; $x == Foo`
ElitestFX has quit [Ping timeout: 245 seconds]
<apeiros_> i.e., within the class body, self references the class
<Hanmac> depy sample: you want ABC.xyz as attr methods on the class, but attr_accessor only works on the instances, but you could do class << ABC; attr_accessor :xyz; end
krz has joined #ruby
<dEPy> I see, so you can "patch" that class
ruby has quit [Client Quit]
nfluxx has joined #ruby
Joeysface has joined #ruby
hynkle has joined #ruby
<Hanmac> in ruby you could patch mosty everything
o_proxeneta has joined #ruby
noganex has quit [Ping timeout: 244 seconds]
o_proxeneta has quit [Remote host closed the connection]
o_proxeneta has joined #ruby
chomp has quit [Quit: Leaving]
<dEPy> I bet people use this for evil things :)
adeponte has quit [Ping timeout: 244 seconds]
<Hanmac> ruby does not have something like final in C++ :P
v0n has joined #ruby
neersighted is now known as neersighted|AFK
hadees has joined #ruby
neersighted|AFK is now known as neersighted
medik has quit [Quit: ...]
nfluxx has quit [Remote host closed the connection]
medik has joined #ruby
nfluxx has joined #ruby
diegok has quit [Remote host closed the connection]
noganex has joined #ruby
<apeiros_> Hanmac: but there's freeze
<apeiros_> applicable to classes…
RubyPanther has quit [Ping timeout: 240 seconds]
<davidcelis> apeiros_.freeze
adeponte has joined #ruby
<apeiros_> NoMethodError: undefined method `freeze' for apeiros_
<davidcelis> stop undefing yourself
RubyPanther has joined #ruby
<Hanmac> BaseObject.instance_method(:freeze).bind(apeiros_).call
<o_proxeneta> iow
Eldariof59-ru has joined #ruby
<davidcelis> lol
<o_proxeneta> anyone?
<apeiros_> NameError: uninitialized constant BaseObject
<davidcelis> NameError: uninitialized constant BaseObject
<davidcelis> damnit
AlRazi has joined #ruby
_adeponte has joined #ruby
<apeiros_> o_proxeneta: anyone what?
<Hanmac> osorry: BasicObject.instance_method(:freeze).bind(apeiros_).call
<apeiros_> NameError: undefined method `freeze' for class `BasicObject'
* apeiros_ snickers
<Hanmac> :P
medik has quit [Ping timeout: 265 seconds]
mdhopkins has quit [Quit: mdhopkins]
<AlRazi> I have a general question if you people don't mind
<davidcelis> yeah freeze is on Object, not BasicObject
<davidcelis> AlRazi: most of us don't
<shevy> AlRazi the answer is yes
<AlRazi> other than rails, why should one invest in ruby ?
<davidcelis> lol
<AlRazi> excuse my utter ignorance
<apeiros_> AlRazi: same answer as to any other programming language
<shevy> AlRazi as replacement for all those ugly shell scripts. as replacement for perl. as replacement for ... hmm... GUIs insofar when you use ruby-gtk
<davidcelis> "why not"
Joeysface has quit [Ping timeout: 248 seconds]
<apeiros_> either because you can use it to pay your bills, or because you can use it to enjoy yourself
<shevy> AlRazi ruby will fit precisely where perl python and php fit
<davidcelis> shevy: we do not speak of php in these parts
adeponte has quit [Ping timeout: 244 seconds]
<shevy> AlRazi ruby won't fit as replacement for C or assembler though :(
<AlRazi> i do enjoy it a lot
<AlRazi> but my coworkers keep telling me that demand on php is much higher
<davidcelis> AlRazi: that is the main reason to use it
<apeiros_> shevy: depends. there's lots of places that use C where they really shouldn't.
<davidcelis> AlRazi: use what you enjoy
lxsameer has quit [Quit: Leaving]
<shevy> AlRazi, a friend is coding PHP for a living. but, there is no real reason I can tell why ruby would be unable to do what php does
jlebrech has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<shevy> apeiros_ yeah ... but I mean all the Unix tradition too... it kinda is a C cult. if they would have had a language like ruby! with the speed of C ...
<shevy> matz should have created ruby before he was born
<shevy> hmm I should file a bug called that
<apeiros_> then it'd have shared the fate of languages like smalltalk and lisp
<shevy> hehe
<shevy> yeah, good point
ukwiz has quit [Quit: Leaving]
<shevy> the surrounding culture, ecosystem and available hardware influenced people heavily
<shevy> ruby would not have been ruby before perl came along
<shevy> or lisp!
<shevy> wait
<shevy> or (lisp(!
<shevy> better
sdferfx has joined #ruby
<apeiros_> Hanmac: seems you've given up on trying to freeze me :-p
<shevy> hmmm
<shevy> Yusuke Endoh confuses me
<Hanmac> apeiros_ if you remove the method from Kernel there is no way to freeze you .P
Ankhers has joined #ruby
and0 has left #ruby [#ruby]
<davidcelis> freeze is on Object
<apeiros_> Kernel < apeiros
<shevy> lol
<apeiros_> also that :)
<shevy> are you guys doing snowball fight again ...
rushed has quit [Quit: rushed]
<davidcelis> just noticed the channel topic was updated to suggest Gist
<davidcelis> most excellent....
<dEPy> again some questions
<sdferfx> Hello. I am looking at this whenever gem to help manage crons with capistrano. One of the examples shows this: "set :whenever_environment, defer { stage }". I was trying to lookup the meaning of the block with the defer in front of it. I can't seem to find that. Can someone here explain it to me? Thanks.
<Mon_Ouie> Wasn't it changed when pastie.org had been DDoS'd?
<dEPy> a = Something.new ; def a.smile ... end; <- adds smile method to instance and if I create b = Something.new , b won't have smile method right?
<shevy> sdferfx, defer seems to be a method. and the block is passed to the method defer. so the first task would be to find out what the method defer does. especially with blocks in general
<dEPy> but If i open up Something with class << Something and define smile method here , every new instance will have smile method?
<shevy> the gem that uses that should have documented it though
<shevy> dEPy, yes, only a will have the method, b wont have it
<shevy> dEPy, if you modify any class, all classes will gain that behaviour
Aaton_off is now known as Aaton
<sdferfx> ok, yeah, I suspected it would be a method and not a language keyword, but I didn't see a definition in the code (though admittedly I just skimmed, didn't ack it) and I found some reference to "deferrable blocks" as a language suggestion
<sdferfx> thanks for your help.
red-panda has quit [Remote host closed the connection]
<shevy> sdferfx, just grep -r until you find it :)
<shevy> also, the value of stage
<sdferfx> Nope, it doesn't exist in the whenever gem. I guess it's a capistrano method?
ConstantineXVI has joined #ruby
<shevy> dEPy, try class Foo; def test1; puts 'hi from test1'; end; end; foo = Foo.new; foo.test1; def foo.test2; puts 'hi from test2'; end; foo.test2
<shevy> and then a new object again, it should not have the test2 method
klaas has joined #ruby
<shevy> lib/capistrano/configuration.rb: alias defer lambda
red-panda has joined #ruby
<shevy> sdferfx, seems as if capistrano is being an idiot perhaps
<shevy> because in that case, it would be the same as lambda {}
<shevy> and who knows why they found it better to alias defer to lambda.
<shevy> nice comment though:
<shevy> "# make the DSL easier to read when using lazy evaluation via lambdas"
Solnse has joined #ruby
jcromartie_ has joined #ruby
flip_digits has joined #ruby
kaiwren has quit [Quit: kaiwren]
jenrzzz-mac has joined #ruby
AlbireoX has joined #ruby
jcromartie has quit [Ping timeout: 256 seconds]
jcromartie_ is now known as jcromartie
AlbireoX`Laptop has joined #ruby
b3nt_pin has joined #ruby
v0n has quit [Remote host closed the connection]
jonathanwallace has quit [Remote host closed the connection]
o_proxeneta has quit [Quit: o_proxeneta]
benatwork has quit [Remote host closed the connection]
jenrzzz-mac has quit [Ping timeout: 252 seconds]
nopper has quit [Quit: ZNC - http://znc.sourceforge.net]
Industrial has joined #ruby
nopper has joined #ruby
benatwork has joined #ruby
<dEPy> so, specifying methods inside a class inside class << self .... end is the same as defining methods inside a class using def self.method ... end?
jenrzzz-mac has joined #ruby
AlbireoX_ has joined #ruby
AlbireoX has quit [Read error: Connection reset by peer]
jackiechan0 has joined #ruby
<Industrial> Is there a "nicer" way then while? :p
td123 has joined #ruby
horseman has quit [Read error: Connection reset by peer]
<davidcelis> for ___ in ____ isn't really idiomatic ruby, btw
<bricker88> I always wondered why they put that in, or left it in rather
Tomasso has quit [Ping timeout: 248 seconds]
<davidcelis> Industrial: Anyway, why can't you use .each? You're apparently doing a shuffle to each element in that array
Urth|Away is now known as Urthwhyte
antillas21 has joined #ruby
<Industrial> because the rand i decreases, not using already sorted elements
<Industrial> s/sorted/shuffled/
jamesaxl has quit [Ping timeout: 244 seconds]
azm has joined #ruby
krusty_ar has joined #ruby
horseman has joined #ruby
jamesaxl has joined #ruby
<davidcelis> 0..(@list.length - 1).each do |i|
bruder has left #ruby ["Textual IRC Client: http://www.textualapp.com/"]
<davidcelis> which is better is debatable and subjective
stephenjudkins has joined #ruby
<davidcelis> some folks avoid for/while loops like the plague, i think while loops are fine
<davidcelis> i think your way is okay
<davidcelis> except for your `for ___ in ___` stuff
jrajav has quit [Quit: jrajav]
Guest48874 has quit [Quit: Changing server...]
<Hanmac> Industrial: array has it own shuffle method ... (on newer ruby)
rippa has joined #ruby
choffstein has joined #ruby
<davidcelis> Fisher-Yates Shuffle is a specific kind of shuffle
<Industrial> Hanmac: I know, and rand uses a mersenne-twister or so I read here or there
<davidcelis> ruby 1.8 has Array#shuffle too, by the way
<Industrial> Hanmac: but the excercise was to build the algo myself. it works but I was just wondering about loop syntaxes in ruby
marwan_ has joined #ruby
<davidcelis> Industrial: while loops are fine in Ruby. for each, less so
<davidcelis> for in*
<marwan_> help rubyist
<davidcelis> Marwan_: help computer
<davidcelis> Industrial: Also, if a method doesn't take arguments when you call it, omit the parens
Alantas has joined #ruby
<marwan_> i was trying to run this project https://github.com/antirez/lamernews , i got this http://jsfiddle.net/ZNwt9/
<Industrial> davidcelis: Nice, coming from javascript/coffeescript where ()'s are mandatory for function calls without arguments
<davidcelis> Industrial: welcome to a better world :)
macmartine has joined #ruby
<Industrial> ;)
EvanR has joined #ruby
icooba has quit [Quit: icooba]
<EvanR> if i do raise 'foo', what kind of exception should i catch later?
<Industrial> I kinda like the NodeJS evented world now though. Is Celluloid any good ;o?
wmoxam has joined #ruby
<davidcelis> Industrial: One more suggestion; you might want to name the method `shuffle!` instead of shuffle, since it seems to be mutating the object instead of returning a new Shuffler with a shuffled list
kirun has joined #ruby
<EvanR> Industrial: nodejs 'evented' world is really annoying to write synchronous code in (most IO code)
<davidcelis> EvanR: RuntimeExceptino
<EvanR> ok
workmad3 has joined #ruby
<davidcelis> sorry, RuntimeError
<marwan_> i was trying to run this project https://github.com/antirez/lamernews , i got this http://jsfiddle.net/ZNwt9/ any help
<davidcelis> Ruby should be more consistent with Error vs. Exception
IPGlider has joined #ruby
<EvanR> its just a name
<Alantas> It is. It pretty much always uses "Error".
<Industrial> EvanR: next version of javascript will include a yield keyword which will fix a lot of asynchronous code syntax
<EvanR> Industrial: i think it would still be missing the point
<EvanR> but my schedule is filled for today so i cant bitch about it here or now
v0n has joined #ruby
<marwan_> i was trying to run this project https://github.com/antirez/lamernews , i got this http://jsfiddle.net/ZNwt9/ any help
<davidcelis> Marwan_: We saw your links the first time; please do not spam
rmascarenhas has joined #ruby
yellow5 has joined #ruby
jonathanwallace has joined #ruby
<marwan_> sorry, i just search alot about soultion and i can't find anything - so i got crazy sorry
xaq has quit [Read error: Connection reset by peer]
td123 has quit [Quit: WeeChat 0.3.7]
Poapfel has quit [Quit: NoMethodError: undefined method `1700 NG' for Irc:Module]
xaq has joined #ruby
<wmoxam> Marwan_: do you understand what the error is?
tatsuya_o has quit [Remote host closed the connection]
<marwan_> no
<wmoxam> The error message is quite clear
<wmoxam> #<Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:10000 (ECONNREFUSED)>
tatsuya_o has joined #ruby
v0n has quit [Remote host closed the connection]
saltnvinegar has joined #ruby
<marwan_> wmoxam: i installed redis
<marwan_> wmoxam: but didn't make any move after that
v0n has joined #ruby
Dr_Memory has joined #ruby
<marwan_> wmoxam: should i link it with something
Axsuul has joined #ruby
<wmoxam> Marwan_: do you know what redis is?
Dr_Memory has left #ruby [#ruby]
hero has joined #ruby
hydrozen has joined #ruby
a_a_g has quit [Ping timeout: 245 seconds]
<marwan_> yeah - some kind of key-value store
Poapfel has joined #ruby
bigoldrock has joined #ruby
<wmoxam> Marwan_: right, and it's a server
azm has quit [Ping timeout: 240 seconds]
<wmoxam> Marwan_: and your app needs to connect to it
ibash has joined #ruby
<wmoxam> so it needs to be running ....
<marwan_> ok, how
voodoofish430 has joined #ruby
GuidovanPossum has left #ruby [#ruby]
tatsuya_o has quit [Ping timeout: 246 seconds]
a_a_g has joined #ruby
<marwan_> wmoxam: man, he didn't talk about linking redis with applications
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
<marwan_> wmoxam: note, the app i trying to run, written in ruby
<wmoxam> There is no 'linking'
b3nt_pin has quit [Quit: Leaving]
<wmoxam> it just needs a local redis server, nothing custom or fancy at all
b3nt_pin has joined #ruby
<wmoxam> you said you installed it, so you must have known that it was a dependancy
cableray has joined #ruby
Poapfel has quit [Quit: quit]
<marwan_> ok, i will check the article again
<marwan_> and i think i will find more here
<marwan_> thanks very much man
ramblex has joined #ruby
tomb__ has quit [Quit: Computer has gone to sleep.]
o_proxeneta has joined #ruby
zemanel_ has joined #ruby
v0n has quit [Remote host closed the connection]
klaas has quit [Quit: ZNC - http://znc.sourceforge.net]
Richmond has quit [Quit: Leaving]
v0n has joined #ruby
zemanel has quit [Ping timeout: 252 seconds]
zemanel_ is now known as zemanel
kenneth has joined #ruby
g0bl1n has joined #ruby
danielvdotcom has quit [Quit: i sleep.]
klaas has joined #ruby
davidcelis has quit [Remote host closed the connection]
blacktulip has quit [Remote host closed the connection]
davidcelis has joined #ruby
o_proxeneta has quit [Remote host closed the connection]
hoelzro|away is now known as hoelzro
<_br_> wmoxam: Did you ever use dm-redis-adapter with redis? Just asking because I have some weird behavior with it. Tought that you might have some opinion on this?
jfarmer has joined #ruby
kenneth has quit [Read error: Connection reset by peer]
kenneth has joined #ruby
Cpudan80 has joined #ruby
<jfarmer> Anyone know of a Ruby SQL parser? Perhaps a Treetop grammar?
<Cpudan80> Hello folks
<dev_> someone mentioned pp recently
jjjj has joined #ruby
<dev_> is that like pry?
jackiechan0 has quit [Ping timeout: 245 seconds]
<Mon_Ouie> No, pp is just to pretty print objects
<Mon_Ouie> It's in stdlib
jackiechan00 has joined #ruby
<Cpudan80> I'm pretty new to ruby so sorry if this is a newb question, I've got a ruby script that needs to do some JSON, the json.rb file requires iconv
<Sou|cutter> awesome_print is cooler
<dev_> yeah Mon that's what I thought..
<horseman> Mon_Ouie wrote something even cooler than awesome_print but i forget what it's called, what was it monny?
<Cpudan80> I have libiconv2.dll sitting alongside json.rb, so "include 'iconv'" should work I think -- but for some reason I get a file not found error when the script runs
<Cpudan80> Saying that iconv can't be found
<apeiros_> jfarmer: found one?
<jfarmer> apeiros_: Did you?
<Cpudan80> Do I need to do something to register that iconv2.dll ?
o_proxeneta has joined #ruby
kenneth has quit [Client Quit]
<apeiros_> jfarmer: no, but I'm interested in having one for a side-project of mine
<jfarmer> apeiros_: There are…half baked ones out there.
<jfarmer> apeiros_: That cover maybe 10% of the SQL92 grammar
<apeiros_> hrm
<Mon_Ouie> colorful_inspect
<apeiros_> problem with half-baked is, that I'm usually faster doing it on my own…
<horseman> there we go :)
<apeiros_> but isn't SQL a non-free standard?
<wmoxam> _br_: nope
<Mon_Ouie> (It just overrides #pretty_print method of some classes to add colors there; so it will benefit from the #pretty_print method if some library defines it)
harukomoto has joined #ruby
<jfarmer> apeiros_: Dunno. It's an ISO standard.
<apeiros_> jfarmer: I mean as in: have to pay to read the standard
<jfarmer> apeiros_: No, not at all
genivf has joined #ruby
Ankhers has quit [Remote host closed the connection]
o_proxeneta has quit [Remote host closed the connection]
replore has joined #ruby
test34 has joined #ruby
a_a_g has left #ruby [#ruby]
test34 has quit [Changing host]
test34 has joined #ruby
<apeiros_> eh, >600 pages - no wonder solutions are half-baked :D
test34- has quit [Ping timeout: 240 seconds]
mdhopkins has joined #ruby
zemanel has quit [Quit: Remote hottie closed the connection]
zx has joined #ruby
azm has quit [Ping timeout: 265 seconds]
zx has quit [Client Quit]
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
elux has quit [Quit: Bye!]
tomb__ has joined #ruby
tomb__ has quit [Client Quit]
<CannedCo_> does anyone have much experience getting the devkit working in windowscp
<CannedCo_> windowsxp
<CannedCo_> i can't seem to get anything to work
marwan_ has quit [Quit: Page closed]
Criztian has quit [Ping timeout: 246 seconds]
fr0gprince_mac has joined #ruby
<jjjj> ewww - just get ubuntu on a vm
mengu has quit [Remote host closed the connection]
<jjjj> ruby on windows is a half baked thing nobody seems to care much about… sadly
jjjj has left #ruby [#ruby]
jmontross has joined #ruby
kenichi has quit [Remote host closed the connection]
<Mon_Ouie> I had no problem installing it on Windows 7
<Mon_Ouie> Although you should just explain your problem, "it doesn't work" being pretty much useless
Criztian has joined #ruby
dv310p3r has quit [Ping timeout: 245 seconds]
mneorr_ has joined #ruby
dv310p3r has joined #ruby
<CannedCo_> basically im installing the dev kit
<CannedCo_> and it works when installing gems
<CannedCo_> but in xp, when i try to run my rake task to compile gem extensions it fails saying the dev kit isn't installed
mneorr has quit [Ping timeout: 260 seconds]
<Mon_Ouie> That's because the hook to change the PATH is in Rubygems
kaiwren has joined #ruby
<Mon_Ouie> You can change your path manually or require some file from the devkit (not sure what it's called anymore)
kaiwren has quit [Client Quit]
<Mon_Ouie> require 'devkit'
emperorcezar has joined #ruby
<emperorcezar> How do I pass arguments and a block to a function?
<horseman> Mon_Ouie: since when have you been running a windows system? i didnt think windows held any interest for you at all
<CannedCo_> hrm
<horseman> Mon_Ouie: or are you playing diablo3?:P
<CannedCo_> that might work
<apeiros_> emperorcezar: foo(arg1, arg2) { …block… } # what do you have problems with?
Huis has joined #ruby
<Mon_Ouie> When I ported Ray to Windows
<horseman> Mon_Ouie: oh nice, do u have precompiled binaries there?
<Mon_Ouie> No, I just vendored the dependencies
hamfz_ has joined #ruby
<horseman> oh ok
<emperorcezar> apeiros_: I'm trying to get this to work http://dpaste.com/753472/
dtolj has quit [Quit: Page closed]
<horseman> Mon_Ouie: do you think you'll add network layer for writing multiplayer games?
xnm has joined #ruby
<horseman> Mon_Ouie: that would be a pretty big selling point for ray over gosu
<apeiros_> emperorcezar: is that your complete problem description?
<emperorcezar> apeiros_: The problem giving me trouble is the only_if call
ken_barber1 has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
cbuxton1 has quit [Quit: Leaving.]
jackiechan00 is now known as jackiechan0
cbuxton has joined #ruby
<emperorcezar> apeiros_: I'm trying to pass the block, but also the :user-> "postgres" to it
<Mon_Ouie> No. I don't see much of a reason to enforce anything, since just sockets are convenient already
<apeiros_> emperorcezar: the syntax in both calls is correct
<CannedCo_> Mon_Ouie that totally worked!
<CannedCo_> thank you!
fserb has joined #ruby
<emperorcezar> apeiros_: interesting. I'm getting ArgumentError: Invalid only_if/not_if command: {:user=>"postgres"} (Hash)
<emperorcezar> apeiros_: Must be how the function is implimented then
dhruvasagar has joined #ruby
<apeiros_> emperorcezar: sounds like it doesn't like the argument you pass it
<apeiros_> you should consult the docs on it
looopy has quit [Remote host closed the connection]
<horseman> Mon_Ouie: something more async that uses the game loop like the EM eventloop would be nice
<emperorcezar> apeiros_: Thanks. I got that option from the docs, hmmm
ken_barber has quit [Ping timeout: 252 seconds]
cbuxton has quit [Read error: Connection reset by peer]
test34 has quit [Ping timeout: 240 seconds]
cbuxton has joined #ruby
fserb has quit [Client Quit]
test34 has joined #ruby
Eldariof59-ru has quit []
replore has quit [Remote host closed the connection]
ghanima has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
workmad3_ has joined #ruby
<theRoUS> which would be faster/lower impact: 'unless (Kernel.method(:debugger))' or 'unless (Kernel.methods.include?("debugger"))' ?
<horseman> theRoUS: Kerne.method_defined?(:debugger)
beneggett has quit [Ping timeout: 245 seconds]
<horseman> Kernel*
Codif has joined #ruby
medik has joined #ruby
<theRoUS> mmm! thanks
bambanx has joined #ruby
<bambanx> hi
<horseman> theRoUS: also, your first approach would raise an exception if debugger is not defined
emperorcezar has left #ruby [#ruby]
<horseman> so it wasn't really viable without a rescue nil
<horseman> which is stupid & evil
macmartine has quit [Quit: macmartine]
peterhil has joined #ruby
fayimora has joined #ruby
Morkel has joined #ruby
<bambanx> evil , damn
<Alantas> I thought the usual way was: Kernel.respond_to? :debugger
keppy has quit [Ping timeout: 246 seconds]
<Alantas> (Checking for the quack, not the duck.)
<horseman> Alantas: nah, respond_to? is for bound methods, method_defined? is for unbound (instance) methods
t0mmyvyo has joined #ruby
<Hanmac> Alantas: not direcly ... normaly its Kernel.method_defined?(:debugger) ... or without Kernel.
workmad3 has quit [Ping timeout: 246 seconds]
<Alantas> Hmm. Would 'debugger' be called as "debugger()" or "Kernel.debugger()"?
<horseman> Alantas: debugger()
<Alantas> respond_to? would check the latter, but if that's not what needs to be checked...
<theRoUS> Alantas: that would search up through the inheritance.. come to think of it, so do the others. i think. not sure about #method_defined? of course, Kernel doesn't inherit from anything else..
workmad3_ has quit [Ping timeout: 252 seconds]
dhruvasagar has quit [Quit: Lost terminal]
<horseman> Alantas: though both would work, actually
gfuggiano has joined #ruby
<horseman> Alantas: since wait, no it wont
<Hanmac> Kernel itself is an Module, with is an Object, with includes Kernel
test34- has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<horseman> ah good point
<horseman> it would work
* apeiros_ smacks theRoUS for using .methods.include? instead of respond_to?
test34 has quit [Ping timeout: 250 seconds]
<horseman> Yeah in this case respond_to? and method_defined? could both be used
<Tasser> horseman, method_defined? got different semantics
<horseman> but IMO method_defined? is nicer
<Tasser> it's just as evil as .methods.include?
Codif has quit [Remote host closed the connection]
<horseman> Tasser: has is that
<horseman> how*
<Tasser> horseman, because people using method_missing for metaprogramming include respond_to? but not method_defined?
<apeiros_> method_defined? is for instance methods. respond_to? is for its own methods
JohnBat26 has joined #ruby
<Tasser> oh, nice
<horseman> Tasser: noob
<horseman> :P
<apeiros_> since method_missing is handled at object level, it's fine & correct if Foo.method_defined?(:bar) == false && Foo.new.respond_to?(:bar) == true
<Hanmac> Tasser: do you heard about Kernel#respond_to_missing?
<apeiros_> Hanmac: that won't help method_defined?
<bambanx> hi Hanmac
Asher has joined #ruby
<Hanmac> no, but respond_to_missing is the little sister of method_missing
AlRazi has quit [Remote host closed the connection]
test34 has joined #ruby
mucker has quit [Quit: leaving]
harukomoto has quit [Ping timeout: 256 seconds]
red-panda has quit [Remote host closed the connection]
test34- has quit [Ping timeout: 244 seconds]
Solnse has quit []
cj3kim has joined #ruby
alindeman has quit [Ping timeout: 240 seconds]
chomp has joined #ruby
jfarmer has quit [Quit: jfarmer]
cbuxton has quit [Quit: Leaving.]
looopy has joined #ruby
stephenjudkins has joined #ruby
fayimora has quit [Ping timeout: 264 seconds]
jrajav has joined #ruby
krusty_ar has quit [Read error: No route to host]
Huis has quit [Read error: Connection reset by peer]
* theRoUS smarts appreciatively from apeiros_'s smack
Huis has joined #ruby
albemuth has quit [Ping timeout: 265 seconds]
<theRoUS> apeiros_: okey, you'vr confused me
<apeiros_> why'd you use class_eval for that? o0
adac has joined #ruby
<_br_> wmoxam: Thanks anyway
<Alantas> With a string, no less.
cableray has quit [Quit: See you 'round like a donut.]
<Tasser> horseman, I'd use respond_to? no matter what ;-)
<dEPy> what should I raise when constructor parameters and not valid (too short names, number ranger not ok)
<theRoUS> Alantas: because some of the things in the definition are lexically-scoped, and others aren't
<apeiros_> dEPy: ArgumentError, TypeError or your own class, derived from one of these
zx has joined #ruby
azm has quit [Ping timeout: 245 seconds]
<dEPy> should I always define my exceptions by deriving from existing ones? what's the downside of: raise "Something" ?
<theRoUS> apeiros_: class_eval from looking at other code. please explain best practice?
<dEPy> well for one you can't do exception translation easily
albemuth has joined #ruby
<apeiros_> dEPy: raise "something" is short for raise RuntimeError, "something"
<Alantas> theRoUS: Have Kernel#debugger accept an Exception argument.
<Alantas> Then you can interpolate #{e.class.name} etc at runtime.
<apeiros_> dEPy: also, since you only can raise classes inheriting from Exception, you're bound to inherit from an existing exception class ;-)
<dEPy> will raising something else break/stop the running program?
<dEPy> should I inherit from specific ones like in Java from RuntimeException?
<apeiros_> theRoUS: two versions, a) store the exception to use it in the message or b) use module_eval with a block
<theRoUS> Alantas: you're missing the point. the exception is why the normal #debugger method isn't available. it isn't an argument that varies throughout the app
<apeiros_> (module_eval == class_eval)
azm has joined #ruby
<dEPy> or does ruby not have checked exception?
<dEPy> exceptions*
axl_ has quit [Read error: Connection reset by peer]
<apeiros_> dEPy: an exception that is not rescued will stop your application, yes
Jackneill has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
<apeiros_> dEPy: unless you're having the exception in a thread other than Thread.main and haven't Thread.abort_on_exception = true (which you should, really, if you have multi-threaded code, that is)
<theRoUS> dEPy: i think inheriting from RuntimeError is discouraged. if there isn't a better choice, i think best practice is to inherit from StandardError
<dEPy> oh, so Errors won't break/stop my app then?
<apeiros_> RuntimeError is fine, but rarely a good fit. inheriting from Exception directly is bad.
<apeiros_> StandardError is the default choice.
<Alantas> If it's an error you can handle, and you do so, then it won't break or stop your program.
zx has quit [Ping timeout: 244 seconds]
<dEPy> ok, got it
<dEPy> tnx
petercs has quit [Ping timeout: 245 seconds]
<theRoUS> apeiros_: are you having the same confusion Alantas apparently was? that the exception is variant at runtime? it isn't. it's the exception from trying to load ruby-debug.
nanderoo has quit [Quit: Leaving.]
<apeiros_> theRoUS: no, I don't :) I'll paste
<theRoUS> apeiros_: i doubted you would..
ctwiz has joined #ruby
<horseman> Tasser: respond_to? and method_defined? aren't equivalent, for example to use respond_to? you have to first have an instance
zx has joined #ruby
<horseman> Tasser: and creating an instance *just* to check for a method is stupid
jackiechan0 has quit [Ping timeout: 245 seconds]
<Alantas> theRoUS: If it's a one-time thing, why are you incorporating it into your newly-defined #debugger rather than raising an exception (or printing a message) on the spot?
maletor has joined #ruby
<Tasser> horseman, indeed, it's not that easy to extract stuff from your mental muscle memory ;-)
<Alantas> With many languages that have it, and especially with Ruby, evaling a string typically means you don't know what you're doing.
azm has quit [Ping timeout: 244 seconds]
<apeiros_> theRoUS: http://pastie.org/3997280 -- not guaranteed to work ;-)
<Alantas> If nothing else, set a class/module constant that your non-string-eval'ed #debugger can refer to. Then you don't have to string-eval.
jenrzzz-mac has quit [Quit: jenrzzz-mac]
jnoob22 has quit [Quit: Leaving]
berkes has joined #ruby
jonathan_ has joined #ruby
<apeiros_> theRoUS: http://pastie.org/3997280 - updated, added the closure variant
<Tasser> apeiros_, see rails sources ;-)
<apeiros_> Tasser: wrt?
beneggett has joined #ruby
<Tasser> ehh # Alantas
CannedCo_ has quit [Quit: Computer has gone to sleep.]
<Alantas> apeiros_'s last paste looks like it does the last thing I suggested, using a class constant. (Also, missing comma at end of line 16 and vestigial EOC on 25?)
jonathanwallace has quit [Ping timeout: 244 seconds]
<apeiros_> right & right @ Alantas
<apeiros_> but, but, but… it aligned!
<Hanmac> apeiros_ ... didnt const_set may "raise" an warning?
<Alantas> So it is.
<apeiros_> Hanmac: no, should not
petercs has joined #ruby
<apeiros_> updated http://pastie.org/3997280 - fixed the bugs Alantas found
becom33 has quit [Ping timeout: 260 seconds]
blacktulip has joined #ruby
becom33 has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
<Hanmac> Object.const_set(:DebugError,123);Object.const_set(:DebugError,456)
<Hanmac> warning: already initialized constant DebugError
bluOxigen has joined #ruby
<apeiros_> Hanmac: of course. but why'd the constant already be set?
<apeiros_> it's no different than SomeConst = "foo" in that regard
<Alantas> Probably a class by that name already.
Norrin_ has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
<theRoUS> apeiros_: have you tested the closure version? i'm having trouble seeing the value of 'e' inside the block
* theRoUS doesn't recall ever encountering 'module_function' before
<Alantas> Hmm, yeah, it's probably running into the "def" and being shut out.
maletor has quit [Quit: Computer has gone to sleep.]
<pk1001100011> Well, bignum in Ruby can have at least 2408241 digits
jenrzzz-mac has joined #ruby
<apeiros_> theRoUS: argh, yeah, did it wrong
<apeiros_> theRoUS: needs define_method too
<theRoUS> i am strongly opposed to polluting the namespace with special-purpose constants
<apeiros_> otherwise I change scope anyway
dv310p3r has quit [Ping timeout: 246 seconds]
strnx has joined #ruby
<Alantas> pk1001100011: It can probably have an arbitrary amount, limited only by memory (and patience).
<Tasser> theRoUS, use global vars then :-)
gfuggiano has quit [Ping timeout: 245 seconds]
jrallison has joined #ruby
<pk1001100011> atmosx: Hm… I didn't get out of memory error.
sspiff has quit [Ping timeout: 246 seconds]
<Alantas> 2.4 million digits should be enough for anybody, though. (Unless you have 640 KB memory...)
<apeiros_> theRoUS: http://pastie.org/3997280
<theRoUS> Alantas: no-one needs more than 640K
banghouse is now known as banghouseAFK
Norrin has quit [Ping timeout: 252 seconds]
<Veejay> Bill Gates ®
<Tasser> pk1001100011, 100**1000000 works, go figure
<Hanmac> global Variables??? i never used ot
workmad3 has joined #ruby
<Hanmac> it
<pk1001100011> Tasser: Someone here told me about (256**100000)**10 and it has 2408241 digits
<apeiros_> you did, if you ever used require :-p
<apeiros_> ($LOAD_PATH)
g0bl1n has quit [Ping timeout: 240 seconds]
<Alantas> Heh, I typed 10**1000000 in irb and it used a few MB of memory and seems to be stuck on something.
<theRoUS> apeiros_, Alantas: https://gist.github.com/2838483
<Tasser> Alantas, I suppose the #to_s
dnyy has joined #ruby
shikamaru has joined #ruby
<Alantas> Yeah. I'll kill it and try something that won't print it.
trend has joined #ruby
<horseman> Alantas: you can just do: x= 10**1000000; nil
* theRoUS wrote an article a couple of decades ago about the correct way to copy code onto the stack and then execute it -- on VAX
<Alantas> Yeah, that's what I'm doing now.
* apeiros_ donates a couple of ()-parens to theRoUS :-p
<Alantas> And it finished. Heh.
<Tasser> horseman, or 100**1000000; in pry ;-)
<theRoUS> apeiros_: ?
<pk1001100011> I just made: ruby -e 'puts 256**1000000' > bignum & and waited some time. ^^
<apeiros_> theRoUS: so you don't run out of them. you seem to use them pretty judicious ;-)
<workmad3> just trying to get ruby to print some big numbers?
<Alantas> That should print 1000000*log(256)/log(10) digits, I think.
<pk1001100011> Trying to know how much digits they can have. :P
<workmad3> I wonder what Gregors Number would look like in ruby
<Alantas> Which is 2408239.965. ceil() that, I guess.
<horseman> workmad3: haha
<horseman> workmad3: that's the number from combinatorics right?
petercs has quit [Ping timeout: 248 seconds]
<apeiros_> Alantas: iirc floor+1
<theRoUS> apeiros_: if you're poking fun at my practice of parenthesising expressions and method calls, go right ahead. i do the same thing in perl; i vastly prefer to be able to see what atoms are arguments, boolean expressions, LHS, and RHS
<pk1001100011> Alantas: Yeah, seems to be like my result. :P
* theRoUS muses on Mersenne primes
<Alantas> floor(4) should be 4, ceil(4) should be 4, so one()±1 won't turn it into the other.
<pk1001100011> When someone is weak in math then he needs to use stupid solutions, like me. -.-
<workmad3> oh sorry, I meant Graham's number
<horseman> workmad3: oh Yeah
<shevy> require('ruby-debugg')
<Alantas> log(a^b) = log(a)*b
<apeiros_> odd…
<theRoUS> meh. testing.
<workmad3> we need a library to do up-arrow notation sensibly in ruby :)
<Alantas> log_a(b) = log(b)/log(a), and log_a(b^c) = c*log(b)/log(a)
<apeiros_> Alantas: ah, right, floor(4)+1 == 5, ceil(4) == 4
capibara has quit [Quit: Saliendo]
<Hanmac> apeiros_ but i not define globals by myself
<apeiros_> Alantas: log(100)/log(10) # => 2.0 - but it has 3 digits
<Alantas> log10(256^1000000) has a=10, b=256, c=1000000, hence 1000000*log(256)/log(10) ≈ 2400000
nilg` has quit [Remote host closed the connection]
<Alantas> apeiros_: 100 = 10^2
<apeiros_> Alantas: so floor+1 is correct, ceil isn't
<apeiros_> Alantas: yes, you're after the number of digits.
<theRoUS> Alantas: modulo the value of ⎕CT
C0deMaver1ck has quit [Ping timeout: 246 seconds]
<Alantas> 00, 01, 02, ..., 97, 98, 99 -- every 2-digit combo, and there's 100 of them there.
<theRoUS> shevy: thanks
<apeiros_> Alantas: (log(10..99)/log(10)).ceil # => 2, which is correct
hakunin has joined #ruby
<Alantas> "log(10..99)"?
<apeiros_> but (log(100)/log(10)).ceil # => 2 - which is not correct, 100 has 3 digits
<theRoUS> lol
<apeiros_> read as "for all values between 10 and 99" ;-)
sspiff has joined #ruby
<apeiros_> actually, 10 would give you 1
<apeiros_> for the same reason
<Hanmac> workmad3 up-arrow notation are for xor
imami|afk is now known as banseljaj
<workmad3> apeiros_: depends what base the log is in
nikhil_ has joined #ruby
<Alantas> For number of printed digits, okay. But there's no integer n for which 256^n is a power of 10 anyway, so, moot point in this case. Heh.
<apeiros_> workmad3: errrrm, if you want to have the number of digits in base 10, then it *must* be log(10)
cableray has joined #ruby
<apeiros_> the rule is the same for other bases, though
C0deMaver1ck has joined #ruby
<apeiros_> it's floor+1 for the number of digits, no matter the base.
<horseman> workmad3: use a unicode method name :P
<horseman> workmad3: for uparrow notation
<workmad3> ok, I'm confused now
<theRoUS> Alantas: modulo the value of ⎕CT
<Alantas> log(100)/log(10) == 2, regardless of the base of the logarithm.
<theRoUS> bork bork bork
<workmad3> oh that, yeah
<Alantas> log2(100)/log2(10) == log10(100)/log10(10) == ln(100)/ln(10) == 2
<theRoUS> Alantas, apeiros_: thanks for your critique and help
<horseman> workmad3: unicode + method_missing and you can do some really nice stuff: 10.^^^^3 (where ^ would be replaced by a nice unicode arrow symbol)
<apeiros_> theRoUS: yw
<theRoUS> apeiros_++
<Alantas> 10.↑3
<Alantas> 10.³
<apeiros_> krezytalk
<apeiros_> :)
<Alantas> √(2)
<workmad3> we need more unicode method aliases :)
<apeiros_> union/intersection?
jrajav has quit [Read error: Connection reset by peer]
nirakara has quit [Ping timeout: 252 seconds]
<workmad3> well, for starters, we rewrite all methods that have _ to use a non-breaking space instead :)
fserb has joined #ruby
<Alantas> Heh, I could totally rock that with my keyboard layout.
dross_ is now known as dross
<shevy> workmad3 you wanna steal my _
<Alantas> Be hard to see, though.
cbuxton has joined #ruby
<shevy> _ is the king among the characters
<Alantas> puts "Unicode up in here" if log₂(10) ≈ 3.321928
<horseman> workmad3: i found this pretty fascinating when i was in highschool http://en.wikipedia.org/wiki/Ackermann_function
<workmad3> shevy: but with a nbsp, you can have method calls like "my variable.this totally rocks!" :)
<theRoUS> i noticed something on the greaseboards of big bang theory.. something like " q = i² + √1 "
<horseman> workmad3: the idea of operators both above power-of and below addition, i wonder if it's possible to extend the 3rd argument to non-natural naturals, like fractional or negative
<horseman> natural numbers*
jrajav has joined #ruby
cdempsey has quit [Quit: Quitting!]
<horseman> "Ackermann's three-argument function, is defined such that for p = 0, 1, 2, it reproduces the basic operations of addition, multiplication, and exponentiation"
JohnBat26 has quit [Ping timeout: 246 seconds]
fserb has quit [Client Quit]
<horseman> workmad3: are you familiar with the gamma function
<workmad3> horseman: well, I'm sure you could, it's just whether you can do so in a way that keeps it consistent :)
francisfish has joined #ruby
sspiff has quit [Ping timeout: 252 seconds]
<horseman> workmad3: Yeah, i was just going to say the gamma function is an extension of the factorial to complex numbers
<horseman> so you can do stuff like: 0.5! (0.5 factorial) or even i! (factorial of imaginary number)
<horseman> so i'm sure it's possible to do something analogous for ackerman
<workmad3> the hardest thing with that sort of extension is finding a method that makes sense, from my knowledge
fayimora has joined #ruby
elake is now known as etank
jchauncey has joined #ruby
<workmad3> things like complex logarithms, or real (and complex) exponents... figuring out a way for such things to make sense is half the battle :)
<Alantas> Ruby has a Complex class in its library somewhere.
<Alantas> I've never found a use for them, myself, so I haven't really bothered to learn about them.
<workmad3> they have uses if you're doing maths or physics simulation stuff
<workmad3> same with things like Matrix and Vector classes
* Alantas nods.
jgarvey has joined #ruby
digitalcakestudi has quit [Ping timeout: 240 seconds]
francisfish has quit [Remote host closed the connection]
test34- has joined #ruby
ronniy has quit [Remote host closed the connection]
Urthwhyte is now known as Urth|Away
tomb__ has joined #ruby
geekbri has quit [Remote host closed the connection]
vjt has quit [Ping timeout: 272 seconds]
<Cpudan80> Hello folks
test34 has quit [Ping timeout: 249 seconds]
<Cpudan80> So I fixed my problem from earlier, but now I'm noticing that sometimes the JSON that is produced is not valid
<Tasser> workmad3, with ruby? depends on how much you want to simulate...
<Cpudan80> like its got an extra " or something, does anyone know if this is ehh ... common?
<Tasser> Cpudan80, use puts due to \" escaping...
<Tasser> to inspect the string
<Cpudan80> well right that's what I did
vjt has joined #ruby
<Cpudan80> puts $jsonVar
<Cpudan80> Notice the extra " on line 17
davidw has joined #ruby
test34 has joined #ruby
kenichi has joined #ruby
<Cpudan80> not 100% sure how that's getting there...
<apeiros_> and how did you generate that output?
davidw is now known as Guest94169
<Cpudan80> params = attribDict.to_hash.to_json
<Cpudan80> puts params
Solnse has joined #ruby
test34- has quit [Ping timeout: 240 seconds]
<Cpudan80> I suppose it's possible that the person who's making the dict is doing it wrong
Urth|Away is now known as Urthwhyte
test34- has joined #ruby
<Cpudan80> seems somewhat unlikely given how trivial that data is... but... I'll check
jackiechan0 has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
LtHummus has quit [Quit: leaving]
mneorr_ has quit [Remote host closed the connection]
test34 has quit [Ping timeout: 244 seconds]
bbttxu has joined #ruby
mneorr has joined #ruby
dv310p3r has joined #ruby
<apeiros_> Cpudan80: the to_json comes from the stdlib 'json' lib? if so, a possibility to make it work incorrectly would be to override the to_json on any of those elements
<Cpudan80> yeah, nobody overrides to_json
ctwiz has quit [Quit: ctwiz]
tewecske has quit [Read error: Connection timed out]
daniel_hinojosa has joined #ruby
tatsuya_o has joined #ruby
<davidcelis> sure they do
<davidcelis> i've overridden to_json
<davidcelis> quite presumptuous of you, sir
fserb has joined #ruby
tuxaddicted has joined #ruby
mneorr has quit [Ping timeout: 260 seconds]
tuxaddicted has quit [Client Quit]
bambanx_ has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
bambanx_ has quit [Client Quit]
iocor has joined #ruby
krusty_ar has joined #ruby
<zizzyx> bnagy: http://pastie.org/3997585 is this what recursive_print should look like
S1kx has quit [Ping timeout: 250 seconds]
hoelzro is now known as hoelzro|away
bambanx has quit [Ping timeout: 250 seconds]
banghouseAFK is now known as banghouse
rdamen has quit [Quit: Page closed]
hakunin has quit [Read error: Connection reset by peer]
S1kx has joined #ruby
S1kx has joined #ruby
S1kx has quit [Changing host]
beneggett has joined #ruby
hakunin has joined #ruby
trend_ has joined #ruby
trend has quit [Read error: Connection reset by peer]
trend_ is now known as trend
hydrozen has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
rmascarenhas has quit [Quit: leaving]
horseman is now known as banisterfiend_
banisterfiend_ is now known as banisterfiend
jeebster has joined #ruby
<jeebster> I'm having some issues using the Random class in irb
<banisterfiend> Tasser, Hanmac: finally unbanned from #ruby-lang !!
<jeebster> do I need to declare it as a requirement somehow?
<apeiros_> jeebster: no
yxhuvud has quit [Ping timeout: 244 seconds]
<apeiros_> jeebster: how about you tell us what issue you actually experience?
g0bl1n has joined #ruby
<jeebster> >> a = Random.new(1234)
<jeebster> NameError: uninitialized constant Random
<apeiros_> what is your RUBY_VERSION ?
<jeebster> shit, I might be on system
<jeebster> yeah
ben_alman has quit [Excess Flood]
<apeiros_> schpott-on?
krz has quit [Read error: Connection reset by peer]
krz has joined #ruby
<banisterfiend> apeiros_: is schpott the german spelling for spot
<apeiros_> no
<apeiros_> it's a nonsensical spelling
<banisterfiend> looks german
<banisterfiend> dont u agree
<apeiros_> it should :)
<apeiros_> it's still nonsensical
booginga has quit [Ping timeout: 240 seconds]
digitalcakestudi has joined #ruby
<jeebster> so how can I tell the Random class to generate a value with a certain quantity of numbers?
booginga has joined #ruby
jrajav has quit [Quit: burgermouth]
<apeiros_> jeebster: not following
<shevy> lol
<jeebster> let's say I want to generate a random string of 4 characters (integers)
<jeebster> it looks like rand takes a limit range, but not a return value length
Urthwhyte is now known as Urth|Away
t0mmyvyo has quit [Quit: http://twitter.com/tommyvyo]
<dEPy> is there a way in plain ruby to validate attributes of a class?
xaxisx has quit [Quit: xaxisx]
ph^ has quit [Remote host closed the connection]
<shevy> ALPHABET = ('a'..'z').to_a; x = ''; 4.times {x << ALPHABET.rand }
<shevy> or whatever else you use for rand
<shevy> dEPy what do you mean with attributes
<jeebster> so it has to be an array?
<dEPy> if I have User class
<dEPy> which has first and last name
<jeebster> err, I guess a string is an array
<shevy> dEPy you mean @first and @last ? instance variables?
<dEPy> is there any best practice how to validate they are long enough, short enought, ...
<dEPy> instance variables yes
<heftig> ('a'..'z').to_a.sample(4).join
<dEPy> like rails has validates_lenght.of ...
<shevy> yeah, the word attribute was strange. if you use the word instance variables,
ben_alman has joined #ruby
<shevy> well, rails is using methods to ensure the validity of that
hamfz_ has quit [Ping timeout: 252 seconds]
<shevy> there is really nothing rails does that you cant do in ruby on your own
<dEPy> so i just write my own then
amalvagomes has quit [Quit: amalvagomes]
<shevy> and btw length and not lenght eh? :D
<dEPy> I just thought some of those were core functionality maybe :)
<shevy> hmm dont think so
sayem has joined #ruby
<dEPy> k :) tnx
<shevy> they would have to be general-purpose enough to warrant to be in core
jgrevich has quit [Read error: Connection reset by peer]
ciopte7 has joined #ruby
jgrevich has joined #ruby
carloslopes has quit [Quit: Leaving]
tvw has quit [Remote host closed the connection]
hakunin has quit [Read error: Connection reset by peer]
kevinbond has joined #ruby
MasterIdler_ has joined #ruby
andrewjf has quit [Ping timeout: 252 seconds]
davidpk has joined #ruby
banseljaj is now known as imami|afk
andrewjf has joined #ruby
MasterIdler_ has quit [Client Quit]
mneorr has joined #ruby
Araxia_ has quit [Read error: No route to host]
Araxia_ has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
zx has quit [Ping timeout: 246 seconds]
MasterIdler has quit [Ping timeout: 260 seconds]
zodiak has quit [Remote host closed the connection]
kevinbond has quit [Client Quit]
bambanx has joined #ruby
Gavilan has joined #ruby
krusty_ar has quit [Read error: Connection reset by peer]
theRoUS has quit [Quit: Leaving]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
ramblex has quit [Quit: ramblex]
gfuggiano has joined #ruby
Urth|Away is now known as Urthwhyte
kevinbond has joined #ruby
Urthwhyte is now known as Urth|Away
theRoUS has quit [Client Quit]
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
Huis has quit [Quit: Huis]
antillas21 has quit [Remote host closed the connection]
fbernier has quit [Ping timeout: 246 seconds]
Aaton is now known as Aaton_off
<bambanx> what is the best kick ass awesome ruby debugger?
Progster has joined #ruby
dev_ has quit [Ping timeout: 246 seconds]
dv310p3r has quit [Ping timeout: 246 seconds]
libertyprime has quit [Quit: Lost terminal]
internet_user has quit [Remote host closed the connection]
rasbonics has joined #ruby
Norrin has joined #ruby
hynkle has quit [Quit: hynkle]
gfuggiano has quit [Quit: Sto andando via]
dv310p3r has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
dr_bob has quit [Read error: Connection reset by peer]
<zaargy> pp, puts etc
tcopp has left #ruby [#ruby]
Norrin_ has quit [Ping timeout: 244 seconds]
<bambanx> how is that zaargy ? using pry?
kevinbond has quit [Quit: kevinbond]
davidpk has quit [Ping timeout: 246 seconds]
libertyprime has joined #ruby
Guest94169 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
Aristata has joined #ruby
baroquebobcat has joined #ruby
libertyprime has quit [Client Quit]
<Aristata> If I have an array that looks like this [generate_new_array_method] where generate new arrray returns an array, is there something I can call INSIDE: like [generate_new_array_method.expand] that will insert it into the array? I can't use flatten
libertyprime has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
<burgestrand> Aristata: you could splat it, [*generate_new_array_method]
Asher has quit [Read error: Connection reset by peer]
<Aristata> ahh good call
<Aristata> thank you
mneorr has quit [Remote host closed the connection]
Asher has joined #ruby
<burgestrand> Aristata: would probably be better to just concatenate it if possible
<CombatWombat> bambanx: Chinese sweat shop labor.
trend has left #ruby [#ruby]
<burgestrand> [].concat(generate_new_array_method)
<bambanx> CombatWombat, ua?
nikhil_ has quit [Ping timeout: 244 seconds]
<CombatWombat> Debug ruby with sweatshop labor.
<wmoxam> pffft, debugging
<wmoxam> what a waste of time
<wmoxam> if you wrote it right the first time you wouldn't need to debug
dku has joined #ruby
chomp has quit [Quit: Leaving]
<CombatWombat> If you stopped making mistakes, I think that you could afford to be more confident.
chico_chicote has quit [Quit: Page closed]
Morkel has quit [Quit: Morkel]
hamfz_ has joined #ruby
o_proxeneta has joined #ruby
dhaskew has joined #ruby
MasterIdler has joined #ruby
Schweby has joined #ruby
o_proxeneta has quit [Client Quit]
simoneke has quit [Quit: Ik ga weg]
<shevy> hmm
<shevy> when you guys write up something, that you also wanna display for the www
<shevy> in what format do you store it? and how do you then decide to "style" it, if at all?
v0n has quit [Quit: Quitte]
<TTilus> it depends
ctwiz has joined #ruby
lorandi has quit [Quit: Leaving]
<TTilus> with no other requirements, i usually end up with html
<TTilus> or a proper subset of it
bglusman has quit [Remote host closed the connection]
macmartine has joined #ruby
bglusman has joined #ruby
joukokar has joined #ruby
o_proxeneta has joined #ruby
atmosx has quit [Ping timeout: 245 seconds]
jchauncey has quit [Quit: jchauncey]
o_proxeneta has left #ruby [#ruby]
bambanx has quit [Quit: Saliendo]
<shevy> ok plain .html
<shevy> what about CSS TTilus ?
<shevy> <h2 class="super_header">Welcome to Ruby</h2>
<TTilus> it depends
<shevy> It's kinda verbose :(
<TTilus> sgml/xml brings in the verbosity/bloat not css
atmosx has joined #ruby
<TTilus> shevy: my advice is bound to be pretty useless, because i dont know shit about your case/requirements ;)
tatsuya_o has quit [Remote host closed the connection]
jgarvey has quit [Quit: Leaving]
bglusman has quit [Ping timeout: 246 seconds]
<shevy> TTilus well
<shevy> so far pretty much almost all my local knowledgebase is stored in .cgi files
stephenjudkins has quit [Quit: stephenjudkins]
kylemcgill has joined #ruby
<shevy> it's ok when viewed on the www
<shevy> it gets annoying to keep having to care about a proper format though
<shevy> I would like to find something that is easier to read and use, any time I want to store something locally
g0bl1n has quit [Quit: Ex-Chat]
zemanel has joined #ruby
beneggett has joined #ruby
b1rkh0ff has quit [Ping timeout: 260 seconds]
<shevy> something like markdown perhaps
<shevy> with optional CSS styling
digitalcakestudi has quit [Ping timeout: 248 seconds]
Criztian has quit [Ping timeout: 246 seconds]
workmad3 has joined #ruby
trend_ has joined #ruby
<dEPy> when comparing objects which assert should I use? can't use assert_equals because of object id right?
trend_ has quit [Client Quit]
kevinbond has joined #ruby
Shamgar has joined #ruby
tomb__ has quit [Read error: Connection reset by peer]
<Mon_Ouie> Why do you think that? assert_equals assert objects are equal, not that they are the same object
tomb__ has joined #ruby
wvms has joined #ruby
Solnse has quit []
dku has quit [Quit: Byebye]
ukwiz has joined #ruby
williamcotton has quit [Read error: Connection reset by peer]
williamcotton has joined #ruby
univers has quit [Remote host closed the connection]
mdhopkins has quit [Quit: mdhopkins]
chson has quit [Remote host closed the connection]
wmoxam has quit [Quit: leaving]
Criztian has joined #ruby
b1rkh0ff has joined #ruby
Schweby has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
dhaskew has quit [Remote host closed the connection]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
schovi has quit [Remote host closed the connection]
jenrzzz-mac has joined #ruby
<davidcelis> i didn't know banisterfiend created Pry
Cpudan80 has quit [Read error: Connection reset by peer]
hamfz_ has quit [Ping timeout: 244 seconds]
wvms has quit [Ping timeout: 244 seconds]
alegacyreborn has joined #ruby
yoklov has joined #ruby
saltnvinegar has quit [Quit: saltnvinegar]
<alegacyreborn> Sup everyone!
<davidcelis> alegacyreborn: hi
<alegacyreborn> oh you again :)
theRoUS has quit [Ping timeout: 260 seconds]
<davidcelis> hmmmm, not sure if that's a good "you again" or a bad "you again"...
wvms has joined #ruby
atmosx has quit [Ping timeout: 244 seconds]
o_proxeneta has joined #ruby
<TTilus> shevy: textile? youd get the styling too
<alegacyreborn> it's a good one :)
<alegacyreborn> that's why I added the ":)"
nlc has quit [Quit: Leaving]
<davidcelis> sometimes smilies are sarcastic
o_proxeneta has quit [Remote host closed the connection]
<davidcelis> you can never tell on the inter nets
atmosx has joined #ruby
Araxia_ has quit [Read error: Connection reset by peer]
wangr has quit [Ping timeout: 246 seconds]
bluOxigen has quit [Ping timeout: 250 seconds]
joshman_ has quit [Ping timeout: 252 seconds]
iamjarvo has quit [Ping timeout: 265 seconds]
carlyle has quit [Remote host closed the connection]
Araxia_ has joined #ruby
libertyprime has quit [Quit: Lost terminal]
<alegacyreborn> Lies
libertyprime has joined #ruby
<alegacyreborn> The Interwebz has the ability to tell you exactly what someone means
dv310p3r has quit [Ping timeout: 252 seconds]
<dEPy> how can I raise my own errors with custom messages?
<alegacyreborn> Gestures, Inflection, etc. are easily identifiable through the internet.
aim-On has joined #ruby
<davidcelis> dEPy: class MyError < Exception ; end
aim-On is now known as blazed
<davidcelis> dEPy: raise MyError, "Some awesome message"
<davidcelis> or extend a more proper subclass of Exception if you want
<dEPy> oh, tnx
<dEPy> forgot the ,
<TTilus> davidcelis: nooo! dont inherit from exception
<davidcelis> TTilus: YOU CANT TELL ME WHAT TO DO
* davidcelis rescues nil
<TTilus> use StandardError
jackiechan0 has quit [Quit: Sto andando via]
<TTilus> listen to daddy
<TTilus> eat your vegetables
keithcelt has joined #ruby
stephenjudkins has joined #ruby
<alegacyreborn> There are no such things as errors
<davidcelis> only zuul
<alegacyreborn> Like bugs, errors are just "Special features"
kuranai is now known as kuranai|off
tomb__ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
_root_ has joined #ruby
libertyprime has quit [Quit: Lost terminal]
tyfighter has joined #ruby
libertyprime has joined #ruby
fubada has joined #ruby
<fubada> anyone use supervisord + resque? or any rake task?
<dEPy> alegacyreborn then 99% of developers do feature driven development i guess :D
davidw has quit [Read error: Operation timed out]
<shevy> TTilus ok will check out textile
<alegacyreborn> lol
<alegacyreborn> So true
g0bl1n has joined #ruby
g0bl1n has quit [Changing host]
g0bl1n has joined #ruby
zemanel has quit [Quit: Remote hottie closed the connection]
zemanel has joined #ruby
zeromodulus has joined #ruby
jrallison has quit [Quit: Computer has gone to sleep.]
jrallison has joined #ruby
ciopte7 has quit [Read error: Connection reset by peer]
ciopte7_ has joined #ruby
<alegacyreborn> So many people join but few ever talk
<alegacyreborn> ?o.O they are spying on us
ctwiz has quit [Quit: ctwiz]
hadees has quit [Quit: hadees]
fualo has quit [Quit: Lost terminal]
<alegacyreborn> Oh snap they are leaving because I found our their dirty little secret
blacktulip has quit [Remote host closed the connection]
<davidcelis> wut
baba_bubba has joined #ruby
raul782 has joined #ruby
raul782 has quit [Remote host closed the connection]
amalvagomes has joined #ruby
celm has joined #ruby
celm has quit [Client Quit]
CombatWombat is now known as Spaceghostc2c
<alegacyreborn> You know I'm right
Axsuul has quit [Ping timeout: 252 seconds]
<alegacyreborn> Does anyone else use AptanaStudio as their IDE?
<shevy> alegacyreborn they idle to power here
GhettoCode has quit [Ping timeout: 244 seconds]
<shevy> I think I tried aptana studio once
<shevy> not sure why I stopped it, there was something I hated
<alegacyreborn> I am trying to find the right one but I don't mind using just text editors
<davidcelis> vim
<alegacyreborn> Is that only for Rails?
<shevy> vim is a general purpose text editor, it tends to be usually used in consoles only though
<alegacyreborn> Ah
<shevy> you use ruby only because of rails? :(
MasterIdler_ has joined #ruby
MasterIdler_ has quit [Client Quit]
<alegacyreborn> I use TextMate on my Mac and Notepad ++ on my Windows comp
<alegacyreborn> no
<shevy> textmate seems nice
<alegacyreborn> I was making sure it wasn't only for rails
<havenn> I like TextMate 2, Sublime Text 2, and Chocolate.
<havenn> Or MacVim =P
<alegacyreborn> I am actually learning Ruby and then I will work on RoR but I just want to focus on Ruby for now
<alegacyreborn> Some people suggested that I learn Rails first but that just doesn't make sense
<shevy> hehe
<bricker88> Can someone explain to me how "initialize" is different from "new"? I get that when you call "new", "initialize" actually gets run… is "new" just a wrapper for "initialize" that makes the initialized object return itself?
MasterIdler has quit [Read error: Operation timed out]
fayimora_ has joined #ruby
Axsuul has joined #ruby
<shevy> bricker88 I think new not only invokes initialize... but also allocate or something
atmosx has quit [Ping timeout: 240 seconds]
Chryson has joined #ruby
<bricker88> shevy: Yes, that is something I hadn't thought about, obviously something needs to place the object into memory.
<bricker88> shevy: Thank you
<shevy> "Allocates space for a new object of *class's class and does not call initialize on the new instance."
<shevy> I never had to use allocate myself though
libertyprime has quit [Quit: Lost terminal]
<alegacyreborn> puts "I hate it when ideas go over my head"
libertyprime has joined #ruby
atmosx has joined #ruby
<shevy> http://collectiveidea.com/blog/archives/2011/10/05/what-s-new-in-ruby/ and another blog post about allocate vs. new
<shevy> argh, I ran into some metal lamp today and hurt my right hand
<shevy> typing with it is not good and strains it.. I am going to bed. night
fayimora has quit [Ping timeout: 264 seconds]
fayimora_ is now known as fayimora
mrc has joined #ruby
apeiros_ has quit [Remote host closed the connection]
<alegacyreborn> cya and lol about your hand
apeiros_ has joined #ruby
g0bl1n has quit [Quit: Ex-Chat]
sayem has quit [Remote host closed the connection]
NodoLomas has joined #ruby
SegFaultAX|work2 has quit [Read error: No route to host]
ciopte7_ has quit [Quit: ciopte7_]
mrc has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
SegFaultAX|work2 has joined #ruby
mrck has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
<havenn> bricker88: ThisClass.new is a new instance of the class ThisClass, so if you defined #new to initialize it would be ThisClass.new.new, which seems unseemly.
mrck has quit [Remote host closed the connection]
mrck has joined #ruby
apeiros_ has quit [Ping timeout: 256 seconds]
NodoLomas has left #ruby [#ruby]
C0deMaver1ck has quit [Remote host closed the connection]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
<bricker88> havenn: I see
fudanchii has quit [Quit: WeeChat 0.3.8-rc2]
tomb__ has joined #ruby
booginga has quit [Quit: Leaving]
<bricker88> While I'm here… When you see something like ::Base64.strict_encode… is the "missing" class at the beginning assumed to be the current class?
<workmad3> bricker88, no
<bricker88> I figured that was way off
<heftig> no, it's the top namespace
<workmad3> bricker88, it's the opposite... it refers to the global scope for constant lookup
<bricker88> I see - So it really is just "nothing"
<heftig> it's like starting a path with /
<bricker88> right
pen has joined #ruby
<bricker88> thank you
<workmad3> bricker88, 'root' is better
<bricker88> yes
niklasb has quit [Ping timeout: 252 seconds]
pen has quit [Remote host closed the connection]
<bricker88> okay one last noob question:If a class inherits from another, but the child class has no "initialize" method, will it uses its parent class's?
<heftig> yes.
<bricker88> rad
<heftig> it's inherited like any other method
<bricker88> I figured that was the case. Thank you.
billiamii|work has quit []
carlyle has joined #ruby
ciopte7 has joined #ruby
WikiPack has joined #ruby
tomb__ has quit [Quit: Computer has gone to sleep.]
xaq has quit [Remote host closed the connection]
dnyy has quit [Remote host closed the connection]
mrsolo has left #ruby ["Leaving"]
test34 has joined #ruby
uris_ has quit [Quit: leaving]
test34 has quit [Changing host]
test34 has joined #ruby
dnyy has joined #ruby
keppy has joined #ruby
test34- has quit [Ping timeout: 250 seconds]
kenichi has quit [Remote host closed the connection]
cableray has quit [Quit: cableray]
jenrzzz-mac has joined #ruby
mrck has quit [Remote host closed the connection]
dEPy has quit []
heftig has quit [Ping timeout: 260 seconds]
piotr_ has quit [Ping timeout: 260 seconds]
chrisja has quit [Quit: leaving]
dv310p3r has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
jenrzzz-mac has joined #ruby
tomb__ has joined #ruby
hadees has joined #ruby
jenrzzz-mac has quit [Client Quit]
IPGlider has quit []
heftig has joined #ruby
luckyruby has quit [Ping timeout: 265 seconds]
macmartine has quit [Quit: macmartine]
heftig_ has joined #ruby
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
kirun has quit [Quit: Client exiting]
heftig_ has quit [Client Quit]
Vert has joined #ruby
dv310p3r has quit [Ping timeout: 246 seconds]
dv310p3r has joined #ruby
igaiga has joined #ruby
berkes has quit [Ping timeout: 245 seconds]
jcromartie has quit [Quit: jcromartie]
Foxandxss has joined #ruby
tomzx has joined #ruby
Axsuul has quit [Ping timeout: 248 seconds]
awarner has quit [Remote host closed the connection]
keithcelt has quit [Remote host closed the connection]
cableray has joined #ruby
mdhopkins has joined #ruby
xnm has quit [Disconnected by services]
C0deMaver1ck has joined #ruby
plasticover has joined #ruby
rmascarenhas has joined #ruby
rasbonics has quit [Quit: rasbonics]
workmad3 has quit [Ping timeout: 246 seconds]
Axsuul has joined #ruby
dv310p3r has quit [Ping timeout: 246 seconds]
nlc has joined #ruby
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
td123 has joined #ruby
mvangala_mac has joined #ruby
dv310p3r has joined #ruby
jenrzzz-mac has joined #ruby
jrallison has quit [Quit: Computer has gone to sleep.]
jenrzzz-mac has quit [Client Quit]
jimeh has joined #ruby
blazed has quit []
ken_barber1 has quit [Remote host closed the connection]
binaryplease has quit [Ping timeout: 245 seconds]
hero has quit [Quit: leaving]
akem has quit [Read error: Connection reset by peer]
pdtpatrick has quit [Quit: pdtpatrick]
binaryplease has joined #ruby
<dekz> Within pry, in the screen cast when showing doc or rendering some information it looks like it is shown in something similar to 'less'. Whereas when I run it I get something more primitive where you can only press enter to continue and q<enter> to break. How do I get the other display?
luckyruby has joined #ruby
mikepack has joined #ruby
akem has joined #ruby
silky__ has quit [Ping timeout: 246 seconds]
tyfighter has quit [Quit: tyfighter]
S2kx has joined #ruby