imperator changed the topic of #ruby-lang to: Ruby 1.9.3-p362: http://ruby-lang.org (ruby-2.0.0-preview2) || Paste >3 lines of text on http://gist.github.com
mercwithamouth has quit [Ping timeout: 255 seconds]
matip has quit [Quit: Leaving]
srbaker has joined #ruby-lang
Guest22294 has left #ruby-lang [#ruby-lang]
Aria has joined #ruby-lang
nertzy has joined #ruby-lang
mistym has quit [Remote host closed the connection]
jtoy has joined #ruby-lang
robbyoconnor has joined #ruby-lang
<wmoxam> anyone know of something like this for Ruby? http://search.cpan.org/~dankogai/Regexp-Optimizer-0.15/lib/Regexp/Optimizer.pm
emocakes has quit [Quit: emocakes]
mercwithamouth has joined #ruby-lang
stonerfish has quit [Quit: Leaving.]
sepp2k1 has quit [Remote host closed the connection]
Nisstyre-laptop has quit [Quit: Leaving]
ttilley has quit [Read error: Connection reset by peer]
kogent has joined #ruby-lang
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
jarib has joined #ruby-lang
SexFerguson has joined #ruby-lang
jtoy has quit [Quit: jtoy]
outoftime has joined #ruby-lang
wmoxam has quit [Quit: leaving]
wmoxam has joined #ruby-lang
toretore has quit [Quit: Leaving]
jbsan has quit [Ping timeout: 245 seconds]
jbsan has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
Rarrikins_x has joined #ruby-lang
Rarrikins has quit [Ping timeout: 252 seconds]
SexFerguson has quit []
ttilley has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
jhn has joined #ruby-lang
leopard_me has joined #ruby-lang
sustainableweb has quit [Remote host closed the connection]
Aria has quit [Remote host closed the connection]
davidbalbert is now known as davidbalber|away
meatballhat has joined #ruby-lang
leopard_me has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
havenn has quit [Ping timeout: 245 seconds]
outoftime has quit [Ping timeout: 245 seconds]
havenn has joined #ruby-lang
ivanoats has quit [Remote host closed the connection]
Rarrikins_x has quit [Read error: Connection reset by peer]
Rarrikins has joined #ruby-lang
jhn has quit [Ping timeout: 245 seconds]
drbrain has quit [Remote host closed the connection]
ryanf has quit [Ping timeout: 260 seconds]
drbrain has joined #ruby-lang
mpan has joined #ruby-lang
drbrain has quit [Ping timeout: 276 seconds]
stonerfish has joined #ruby-lang
mistym has quit [Remote host closed the connection]
ryanf has joined #ruby-lang
Aredridel has joined #ruby-lang
Aredridel is now known as Aria
setmeaway2 has quit [Read error: Connection reset by peer]
drbrain has joined #ruby-lang
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
rebelcan has joined #ruby-lang
thufir_ has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 276 seconds]
havenn has quit [Ping timeout: 255 seconds]
drbrain has quit [Ping timeout: 255 seconds]
banisterfiend is now known as banister`sleep
slyphon has joined #ruby-lang
jtoy has joined #ruby-lang
spuk has quit [Ping timeout: 265 seconds]
madish has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
breakingthings has joined #ruby-lang
rebelcan has quit [Ping timeout: 276 seconds]
ivanoats has joined #ruby-lang
setmeaway has joined #ruby-lang
ivanoats has quit [Ping timeout: 245 seconds]
spuk has joined #ruby-lang
drbrain has joined #ruby-lang
sulo has joined #ruby-lang
jtoy has quit [Quit: jtoy]
vlad_starkov has joined #ruby-lang
sulo has quit [Ping timeout: 244 seconds]
charliesome has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 244 seconds]
drbrain has quit [Ping timeout: 252 seconds]
mercwithamouth has joined #ruby-lang
gix- has quit [Ping timeout: 244 seconds]
gix has joined #ruby-lang
<charliesome> ruby trivia
<charliesome> what's the difference between eval(str) and eval(str, binding)
drbrain has joined #ruby-lang
<lsegal> ", binding"
<charliesome> there's more than that
drbrain has quit [Ping timeout: 244 seconds]
jbsan has quit [Quit: jbsan]
wyhaines has quit [Remote host closed the connection]
<heftig> charliesome: ri Binding
vlad_starkov has joined #ruby-lang
<ryanf> heftig: I feel like you are missing the point
<heftig> ah, binding is the method?
<ryanf> I have no idea what the answer is though. something about lexical scope?
<ryanf> like nesting?
drbrain has joined #ruby-lang
<ryanf> nope, nesting is the same
mercwithamouth has quit [Ping timeout: 255 seconds]
<ryanf> ah
vlad_starkov has quit [Ping timeout: 240 seconds]
<ryanf> charliesome: eval "__LINE__"?
<ryanf> at least, that is one case where they're different
<charliesome> yeah
<charliesome> the location info is difference
<charliesome> different*
<ryanf> because if you specify a binding, it doesn't infer __LINE__ and __FILE__?
<ryanf> the funny thing is, I feel like I've seen this exact issue before
<charliesome> ruby also does some other strange crap if you don't pass a binding to eval
My_Hearing has joined #ruby-lang
mercwithamouth has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 244 seconds]
<Aria> Ruby's evals are weird in general.
<Aria> I think every single one has some quirk.
drbrain has quit [Ping timeout: 276 seconds]
meatballhat has quit [Ping timeout: 255 seconds]
mercwithamouth has quit [Ping timeout: 264 seconds]
solars has quit [Ping timeout: 265 seconds]
drbrain has joined #ruby-lang
thufir_ has quit [Read error: Connection reset by peer]
tlvince has joined #ruby-lang
tlvince has quit [Client Quit]
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
drbrain has quit [Ping timeout: 245 seconds]
karasawa has quit [Quit: leaving]
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
mercwithamouth has joined #ruby-lang
xalei has joined #ruby-lang
drbrain has joined #ruby-lang
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
<Paradox> anyone played with messagepack?
<Paradox> interesting alternative to json
karasawa has joined #ruby-lang
karasawa has quit [Remote host closed the connection]
<lianj> Paradox: not really a json alternative
<Paradox> they bill themselves as such
karasawa has joined #ruby-lang
<lianj> its binary and not ascii
<lianj> also, look at bson
<Paradox> i've seen bson
Aria has quit [Remote host closed the connection]
drbrain has quit [Ping timeout: 255 seconds]
karasawa has quit [Quit: leaving]
krz has joined #ruby-lang
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
Axsuul has quit [Ping timeout: 245 seconds]
srbaker has joined #ruby-lang
srbaker has quit [Client Quit]
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
drbrain has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 252 seconds]
breakingthings has quit []
drbrain has quit [Ping timeout: 255 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
dous has quit [Remote host closed the connection]
pkrnj has joined #ruby-lang
karasawa has quit [Ping timeout: 276 seconds]
karasawa has joined #ruby-lang
buzz_ has quit [Quit: buzz_]
karasawa has quit [Remote host closed the connection]
dous has joined #ruby-lang
karasawa has joined #ruby-lang
drbrain has joined #ruby-lang
drbrain has quit [Read error: Connection reset by peer]
drbrain has joined #ruby-lang
drbrain has quit [Remote host closed the connection]
Rarrikins has quit [Read error: Connection reset by peer]
Rarrikins has joined #ruby-lang
solars has joined #ruby-lang
larrylv has joined #ruby-lang
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
ttilley has quit [Ping timeout: 244 seconds]
dous has quit [Remote host closed the connection]
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
karasawa has quit [Ping timeout: 276 seconds]
drbrain has joined #ruby-lang
drbrain has quit [Remote host closed the connection]
jbsan has joined #ruby-lang
mpan has quit [Ping timeout: 244 seconds]
jonahR has joined #ruby-lang
drbrain has joined #ruby-lang
anannie has quit [Remote host closed the connection]
havenn has joined #ruby-lang
sn0wb1rd has quit [Quit: sn0wb1rd]
sn0wb1rd has joined #ruby-lang
havenn has quit [Ping timeout: 260 seconds]
drbrain has quit [Remote host closed the connection]
drbrain has joined #ruby-lang
facest has joined #ruby-lang
gsav has quit [Quit: Lost terminal]
gsav has joined #ruby-lang
faces has quit [Ping timeout: 245 seconds]
drbrain has quit [Ping timeout: 255 seconds]
karasawa has joined #ruby-lang
larrylv has quit [Remote host closed the connection]
stardiviner has joined #ruby-lang
stardiviner has quit [Client Quit]
postmodern has quit [Quit: Leaving]
superbot is now known as nerd
nerd is now known as superbot
drbrain has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
drbrain has quit [Ping timeout: 260 seconds]
stardiviner has joined #ruby-lang
jxie has quit [Quit: leaving]
goshakkk has joined #ruby-lang
karasawa has quit [Quit: Lost terminal]
karasawa has joined #ruby-lang
drbrain has joined #ruby-lang
sush24 has joined #ruby-lang
emocakes has joined #ruby-lang
krz has quit [Quit: krz]
karasawa has quit [Quit: Lost terminal]
jonahR has quit [Quit: jonahR]
blacktulip has joined #ruby-lang
drbrain has quit [Ping timeout: 260 seconds]
karasawa has joined #ruby-lang
karasawa has joined #ruby-lang
anannie has joined #ruby-lang
xalei has quit [Read error: Connection reset by peer]
neocoin has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
gaveen has quit [Remote host closed the connection]
havenn has joined #ruby-lang
io_syl has quit [Client Quit]
neocoin has joined #ruby-lang
havenn has quit [Ping timeout: 244 seconds]
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
marr has joined #ruby-lang
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
drbrain has joined #ruby-lang
drbrain has quit [Ping timeout: 244 seconds]
intellitech has quit [Read error: Connection reset by peer]
tbuehlmann has joined #ruby-lang
intellitech has joined #ruby-lang
gsav has quit [Ping timeout: 265 seconds]
ivanoats has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
stonerfish has quit [Quit: Leaving.]
ivanoats has quit [Ping timeout: 260 seconds]
banister`sleep has quit [Ping timeout: 265 seconds]
gsav has joined #ruby-lang
cirwin has joined #ruby-lang
superbot has quit [Ping timeout: 265 seconds]
gsav has quit [Read error: Connection reset by peer]
neocoin_ has joined #ruby-lang
neocoin has quit [Ping timeout: 245 seconds]
io_syl has joined #ruby-lang
ivanoats has joined #ruby-lang
karasawa has quit [Quit: leaving]
karasawa has joined #ruby-lang
drbrain has joined #ruby-lang
ivanoats has quit [Remote host closed the connection]
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
drbrain has quit [Ping timeout: 255 seconds]
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
Rarrikins has quit [Remote host closed the connection]
Rarrikins has joined #ruby-lang
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
karasawa has quit [Quit: leaving]
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
madish has joined #ruby-lang
tbuehlmann has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
superbot has joined #ruby-lang
havenn has joined #ruby-lang
leopard_me has joined #ruby-lang
marr has quit [Ping timeout: 252 seconds]
havenn has quit [Ping timeout: 245 seconds]
tbuehlmann has joined #ruby-lang
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<yorickpeterse> It only took me like 3 weeks but I think I can safely say this refactor that I'm currently doing is well worth the effort
<yorickpeterse> especially since I'm now writing code that in the end does the same but in far less LOC and code that's easier to grasp
charliesome has joined #ruby-lang
solars has quit [Ping timeout: 245 seconds]
charliesome has quit [Client Quit]
io_syl has quit [Quit: Computer has gone to sleep.]
drbrain has joined #ruby-lang
karasawa has quit [Quit: leaving]
karasawa has joined #ruby-lang
<yorickpeterse> Oh great, I think I found a bug in MRI
<yorickpeterse> Unless I'm being dumb
karasawa has quit [Client Quit]
karasawa has joined #ruby-lang
karasawa has joined #ruby-lang
drbrain has quit [Ping timeout: 240 seconds]
leopard_me has quit [Quit: Computer has gone to sleep.]
<emocakes> gg yorickpeterse
gaveen has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby-lang
<yorickpeterse> http://pastie.org/5606301 Can anybody run this and confirm that the ORIGINAL hash is being modified?
<yorickpeterse> Because unless I'm not understanding #select! I seriously doubt that's expected behaviour
<yorickpeterse> Issue still present on 2.0.0-preview2 as well
meatballhat has joined #ruby-lang
meatballhat has joined #ruby-lang
meatballhat has quit [Changing host]
Rarrikins has quit [Read error: Connection reset by peer]
Rarrikins has joined #ruby-lang
karasawa has quit [Ping timeout: 245 seconds]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
karasawa has joined #ruby-lang
adambeynon has joined #ruby-lang
gaveen has joined #ruby-lang
Weems has quit [Ping timeout: 255 seconds]
<yorickpeterse> Turns out it's because Hash#merge creates a shallow copy
gnufied1 has joined #ruby-lang
goshakkk has quit [Quit: Computer has gone to sleep.]
ebouchut has joined #ruby-lang
karasawa has quit [Quit: Lost terminal]
karasawa has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
goshakkk has joined #ruby-lang
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
quatauta has joined #ruby-lang
drbrain has joined #ruby-lang
drbrain has quit [Ping timeout: 245 seconds]
krz has joined #ruby-lang
quatauta has quit [Quit: Verlassend]
My_Hearing is now known as Mon_Ouie
larrylv has joined #ruby-lang
larrylv has quit [Remote host closed the connection]
havenn has joined #ruby-lang
larrylv has joined #ruby-lang
larrylv has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 245 seconds]
Asher has joined #ruby-lang
ebouchut has quit [Quit: This computer has gone to sleep]
Asher has quit [Client Quit]
solars has joined #ruby-lang
Jake232 has joined #ruby-lang
<manveru> nothing in ruby makes deep copies... i think
<manveru> only way is to marshal/unmarshal if you need that
sush24 has joined #ruby-lang
gnufied1 has quit [Quit: Leaving.]
drbrain has joined #ruby-lang
ebouchut has joined #ruby-lang
ttilley has joined #ruby-lang
leopard_me has joined #ruby-lang
drbrain has quit [Ping timeout: 276 seconds]
tbuehlmann has quit [Remote host closed the connection]
meatballhat has quit [Ping timeout: 255 seconds]
karasawa has quit [Ping timeout: 276 seconds]
karasawa has joined #ruby-lang
Guest9041 has quit [Remote host closed the connection]
Guest9041 has joined #ruby-lang
meatballhat has joined #ruby-lang
ebouchut has quit [Quit: This computer has gone to sleep]
<anannie> Hi can someone please help me to make this code more idiomatic? https://www.dropbox.com/s/lrxxpnv5qszci8k/pe5.rb
<kalleth> its new years day and i'm hungover and that code breaks my brain
<kalleth> so i'd love to help but its more complicated than I can understand right now :p
<kalleth> any reason why factor_count = {} has to be inside the .each block rather than witht he rest of the definitions?
<kalleth> i'd probably move those out to constants outside the method bodies
thone_ has joined #ruby-lang
<kalleth> sec
<kalleth> let me see what my brain can do
thone has quit [Read error: No route to host]
<anannie> kalleth: factor_count is over written each time a new number comes by
serhart has joined #ruby-lang
<kalleth> ok
<anannie> I think this could be solved elegantly with some recursion
<anannie> but I'm not sure that would be idiomatic
<kalleth> yeah, i'm first trying to simplify a bit whilst keeping the output the same so i can understand the problem better
<anannie> It's the solution to Project Euler's problem #5
slyphon has quit [Ping timeout: 245 seconds]
<kalleth> meh, i'm refactoring it a little bit and getting the same output but not sure if i'm handling all cases
<kalleth> there's probably a reasony ou're using a while() rather than an each_with_index, right?
<anannie> Yes there is as I'm checking the condition each time
<kalleth> mmm, i get the same output without that check, but its probably just that its not getting triggered by the input data you've supplied
<kalleth> https://gist.github.com/0ff10d9b5d5c97a7ed42 thats how far i got before i decided i need to read up on the project description and go in the shower to wake up, sorry I can't actually _help_ :(
<anannie> That's okay kalleth
Peg-Leg has joined #ruby-lang
<kalleth> you could also replace your factor_count = declaration with
holgerno has joined #ruby-lang
<kalleth> factor_count = TOTAL_FACTOR_COUNT.dup
<kalleth> rather than using the same details twice
<anannie> Wouldn't that point to the same memory location?
<kalleth> nope, as .dup creates a copy
<kalleth> so factor_count = a new object that starts out as a duplicate of TOTAL_FACTOR_COUNT
<anannie> Ah I see
nignaztic has quit [Quit: plz die k thx]
nazty has quit [Remote host closed the connection]
<kalleth> ^ anannie
<anannie> thank you for teaching me this kalleth
<kalleth> not sure my refactor of the while into an each_with_index is right, but i'm pretty sure the rest is :)
<anannie> well it's right
krz has quit [Quit: krz]
drbrain has joined #ruby-lang
JohnBat26 has joined #ruby-lang
ebouchut has joined #ruby-lang
drbrain has quit [Ping timeout: 255 seconds]
briantrust has joined #ruby-lang
setmeaway has quit [Quit: Leaving]
JohnBat26 has quit [Read error: Connection reset by peer]
rsl has joined #ruby-lang
ruby-lang512 has joined #ruby-lang
setmeaway has joined #ruby-lang
setmeaway has quit [Read error: Connection reset by peer]
ruby-lang512 has quit [Ping timeout: 245 seconds]
AndChat| has joined #ruby-lang
toretore has joined #ruby-lang
nazty has joined #ruby-lang
Banistergalaxy has quit [Ping timeout: 245 seconds]
setmeaway has joined #ruby-lang
havenn has joined #ruby-lang
setmeaway has quit [Client Quit]
setmeaway has joined #ruby-lang
jmeeuwen has quit [Quit: Disconnecting from stoned server.]
jmeeuwen has joined #ruby-lang
havenn has quit [Ping timeout: 260 seconds]
JohnBat26 has joined #ruby-lang
JohnBat26 has quit [Client Quit]
hexreel has joined #ruby-lang
josh0x0 has joined #ruby-lang
holgerno has quit [Quit: Leaving...]
banisterfiend has joined #ruby-lang
<banisterfiend> .
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby-lang
goshakkk has quit [Ping timeout: 252 seconds]
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
<emocakes> <3 banisterfiend
<banisterfiend> y?
meatballhat has quit [Ping timeout: 260 seconds]
<rking> y not?
JohnBat26 has joined #ruby-lang
superbot has quit [Quit: WeeChat 0.3.9.2]
megharsh has joined #ruby-lang
drbrain has joined #ruby-lang
cultureulterior has joined #ruby-lang
stonerfish has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
drbrain has quit [Ping timeout: 245 seconds]
cultureulterior has quit [Quit: cultureulterior]
goshakkk has quit [Quit: Computer has gone to sleep.]
meatballhat has joined #ruby-lang
meatballhat has joined #ruby-lang
meatballhat has quit [Changing host]
cultureulterior has joined #ruby-lang
cultureulterior has quit [Client Quit]
zmack has joined #ruby-lang
banisterfiend has quit [Ping timeout: 252 seconds]
karasawa has quit [Ping timeout: 255 seconds]
karasawa has joined #ruby-lang
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
bfreeman has joined #ruby-lang
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
ebouchut_ has joined #ruby-lang
<zzak> yorickpeterse: ping
b3nt_pin_ has quit [Remote host closed the connection]
ebouchut has quit [Ping timeout: 264 seconds]
Swimming_Bird has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
jxie has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
JohnBat26 has joined #ruby-lang
neocoin_ has quit [Remote host closed the connection]
josh0x0 has quit [Quit: josh0x0]
srbaker has joined #ruby-lang
meatballhat has quit [Ping timeout: 245 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
zmack has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
drbrain has joined #ruby-lang
bubonicpestilenc has joined #ruby-lang
<bubonicpestilenc> hey all
<bubonicpestilenc> is there a way to compress 2 lines:
<bubonicpestilenc> a, b = data; a = a.to_i
<bubonicpestilenc> ?
<cirwin> bubonicpestilenc: not realy
<cirwin> I take it you can't refactor so that data has the first element already as a number?
<andrewvos> a,b = data.to_i, data
drbrain has quit [Ping timeout: 255 seconds]
<andrewvos> ohhh
<andrewvos> shit didn't realise data is an Array
slyphon has joined #ruby-lang
<andrewvos> Just make it two lines.
<andrewvos> a = data.first
<andrewvos> b = ata.first
<rking> Everybody wants that .= operator. =\
<andrewvos> Sorry, a = data.first.to_i
<bubonicpestilenc> generally
<bubonicpestilenc> data is like:
<bubonicpestilenc> ["1238712983", "1", "bubonic", false, "m32e278"]
* bubonicpestilenc looking for something like php's is_numeric
<bubonicpestilenc> i'll re-write parser to scan for "numbers only" and auto-covert to Fixnums )
<cirwin> bubonicpestilenc: you'll regret that :)
glebm has joined #ruby-lang
<bubonicpestilenc> why?
<andrewvos> bubonicpestilenc: Check for ^\d+$
<bubonicpestilenc> regex will be slower
<andrewvos> bubonicpestilenc: Do you care?
<cirwin> bubonicpestilenc: a general pattern I've noticed with dynamic languages is that you always want the return type of a function to be determinable from the input type of a function
<cirwin> if your parser takes a string and returns an array of strings, but sometimes an array of ints
<bubonicpestilenc> i'm thinking about something like: d = d.to_i if d.to_i.to_s == d
<cirwin> it's easy to introduce bugs
<bubonicpestilenc> generally
<andrewvos> generally
<cirwin> yeah :)
<cirwin> that said, rails gets away with it
<bubonicpestilenc> my "parse" method takes 1 line of string with different # of field, separated by |
<cirwin> so you can too :)
<andrewvos> bubonicpestilenc: Use a csv parser?
* cirwin crashes all your rails apps by putting ?id[]=1&id[]=2 in the url
<bubonicpestilenc> ok, i'll explain deeply
<bubonicpestilenc> we have...
<bubonicpestilenc> packet from network with serialized "character" object
<bubonicpestilenc> 123|bubonic|23|1
holgerno has joined #ruby-lang
<bubonicpestilenc> id|name|level|type
<andrewvos> csv
holgerno has quit [Client Quit]
<cirwin> def parse; id, text, foo, bar = line.split("|"); [id.to_i, text, foo.to_i, bar.to_i]; end
<bubonicpestilenc> currently: data.split("|") == ["123", "bubonic", "23", "1"]
mistym has quit [Remote host closed the connection]
<bubonicpestilenc> member:cirwin why not: id, name, level, type = data.split("|").map { |e| next e.to_i if e.to_i.to_s == e; e }
<bubonicpestilenc> ?
<cirwin> bubonicpestilenc: because if someone puts a number in field 2
<cirwin> it'll be a Number not a String
<cirwin> and so if you try and do anything to it, you'll crash
<bubonicpestilenc> oh, you're right
<bubonicpestilenc> got it
<bubonicpestilenc> if name == "123" then fail :)
<cirwin> yeah
<andrewvos> In more ways than one.
emocakes has quit [Quit: emocakes]
<bubonicpestilenc> thanks guys :)
<andrewvos> pleasure brohan
<andrewvos> Whoa did not realise I can just use a normal wireless apple keyboard with the ipad!
srbaker has joined #ruby-lang
JoelMcCracken has joined #ruby-lang
richardburton has joined #ruby-lang
<andrewvos> Sweet!
<andrewvos> This is so much better than typing on that stupid screen!
havenn has joined #ruby-lang
davidbalber|away is now known as davidbalbert
Swimming_Bird has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
havenn has quit [Ping timeout: 255 seconds]
levifig has quit [Ping timeout: 260 seconds]
sailias has quit [Quit: Leaving.]
levifig has joined #ruby-lang
kurko_ has joined #ruby-lang
wallerdev has joined #ruby-lang
Rarrikins has quit [Ping timeout: 245 seconds]
Rarrikins has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
<cirwin> andrewvos: besides, you can then see the entire scren while typing
gaveen has quit [Ping timeout: 245 seconds]
meatballhat has joined #ruby-lang
meatballhat has joined #ruby-lang
meatballhat has quit [Changing host]
dvanduzer has joined #ruby-lang
richardburton has left #ruby-lang [#ruby-lang]
richardburton has joined #ruby-lang
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
drbrain has joined #ruby-lang
<andrewvos> cirwin: CMD+TAB is a fail though.
drbrain has quit [Ping timeout: 255 seconds]
wallerdev has quit [Quit: wallerdev]
kith_ has joined #ruby-lang
kith has quit [Read error: Connection reset by peer]
kith_ is now known as kith
wallerdev has joined #ruby-lang
sepp2k has quit [Ping timeout: 260 seconds]
ebouchut_ has quit [Quit: This computer has gone to sleep]
ebouchut has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
srbaker has joined #ruby-lang
<dvanduzer> I'm running two reasonably similar CentOS 6 VMs with rvm-installed ruby-1.9.3-p327. One calls futex / clock_gettime every few seconds, the other 10,000+ times a second: https://gist.github.com/45f592f979d4341bd5c5
<dvanduzer> It's the resque component of a gitlab installation. The most likely culprit I've found is a leap second insertion issue, but my VM provider for the problematic host tells me they've reset the clock as per: https://lkml.org/lkml/2012/7/1/19
banisterfiend has joined #ruby-lang
<dvanduzer> I found this discussion http://www.ruby-forum.com/topic/192255 which points out that this is expected behavior, and since I do see a futex timeout in both cases, it's clearly not just the timeout causing the problem. The futex timeout is clearly expected, just not 10k times a second. Other than clock / leap seconds, does anyone have any suggestions on how to proceed?
sepp2k has joined #ruby-lang
goshakkk has quit [Quit: Computer has gone to sleep.]
tbuehlmann has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
srbaker has joined #ruby-lang
Rarrikins_h has joined #ruby-lang
srbaker has quit [Client Quit]
Rarrikins has quit [Ping timeout: 244 seconds]
srbaker has joined #ruby-lang
wallerdev has joined #ruby-lang
ebouchut has quit [Quit: This computer has gone to sleep]
Rarrikins_h has quit [Ping timeout: 240 seconds]
Rarrikins has joined #ruby-lang
karasawa has quit [Ping timeout: 265 seconds]
karasawa has joined #ruby-lang
anannie has quit [Changing host]
anannie has joined #ruby-lang
havenn has joined #ruby-lang
stonerfish has quit [Quit: Leaving.]
<yorickpeterse> rking: pong
* rking pong-redirects to zzak
<rking> Bankshot!
* zzak swish
<rking> LOL
<yorickpeterse> oh derp
<yorickpeterse> zzak: so yeah, pong
<zzak> i fubar'd your patch this morning
<zzak> but thanks for that
<yorickpeterse> I noticed it :)
goshakkk has joined #ruby-lang
<zzak> there were a few style changes, but otherwise it was good to me
<yorickpeterse> Thinking about it it's not just Hash#merge's docs that need to be fixed
<zzak> style is less important
<zzak> how so?
drbrain has joined #ruby-lang
<yorickpeterse> I'm fairly certain there are more of these cases where the docs don't mention everything as clear
<yorickpeterse> I however don't have the time at the moment to go through all that, might take a look at that this weekend
leopard_me has quit [Quit: Computer has gone to sleep.]
<zzak> well, i agree with eregon, my first thought was "user doesnt care"
<zzak> but i think more detail couldn't hurt and so i applied it not fully reviewing the implementation
<zzak> it's my fault for not reading into it more, i guess i trusted you were right ;)
<yorickpeterse> Well, the user does care since it leads to unexpected behaviour
<zzak> its out of scope though
<yorickpeterse> How so?
<zzak> documentation is really geared towards the class
<zzak> i tried to find an example of your behavior with another hash method, but i wasnt able to
drbrain has quit [Ping timeout: 245 seconds]
<zzak> gotcha's and behaviour elements should go into a separate guide imo
<zzak> maybe syntax
<yorickpeterse> that makes zero sense
<yorickpeterse> It only makes it harder for people to find those gotcha's
<yorickpeterse> Even the line "This method creates a shallow copy" would be a lot better than not mentioning it at all
<yorickpeterse> A veteran might understand it, and I do now as well, but newcomers most likely will have zero clue about it
<yorickpeterse> Not to mention they probably can't be fucked finding "gotchas.md" or whatever file you'd put it in
<zzak> why would a new person know what a shallow copy is? or even what it implies?
<yorickpeterse> The term "shallow copy" might not be the clearest but I'm sure you understand what I'm getting at
<yorickpeterse> At least, I hope
<yorickpeterse> brb, idnner
<yorickpeterse> * dinner
<zzak> i understand your point, but my concern is adding all of this implementation specific doc to one method sort of takes it out of context where it is applied
cirwin1 has joined #ruby-lang
<zzak> in most cases all the user needs to know is, "when i give it A, B, or C then i should get X, Y, or Z"
<zzak> your example was including a method from an entirely separate class that had a side effect on the original argument
cirwin has quit [Ping timeout: 245 seconds]
<dvanduzer> Any particular #ruby-lang specific question reposting etiquette? Wondering if anyone has any not-leap-second related suggestions for my 13,000 futex() calls per second problem.
meatballhat has quit [Ping timeout: 244 seconds]
<zzak> yorickpeterse: at any rate, core docs, especially hash, string and array are tough and i think your on the right track. so please ignore my rambling and continue to submit patches :D
<lupine> don't worry it's *fast* ^^
emocakes has joined #ruby-lang
mpan has joined #ruby-lang
<zzak> oh, and copies vs. references: array uses +self+ all over the place and suffers from the same lack of context
<zzak> like how many people will understand right away that +self+ means the original array argument
<zzak> it's sort of confusing
karasawa has quit [Ping timeout: 255 seconds]
richardburton has quit [Quit: Leaving.]
richardburton has joined #ruby-lang
<yorickpeterse> zzak: I wasn't planning on documenting the inner workings such as what algorithm Array#sort uses by default. I was more thinking of something short like "When you use method X you should keep Y in mind" or something along those lines
<yorickpeterse> But I first have to spend some more time investigating the C code before I figure out a nice way of doing that
<zzak> yorickpeterse: np, i love that you are helping
<zzak> i am learning with you :)
richardburton has quit [Quit: Leaving.]
meatballhat has joined #ruby-lang
meatballhat has quit [Changing host]
meatballhat has joined #ruby-lang
<zzak> yorickpeterse: like you can pass a block to merge
<zzak> but there isn't any example for how it really works
<zzak> and i think the description of the block is confusing
richardburton has joined #ruby-lang
meatballhat has quit [Ping timeout: 245 seconds]
tbuehlmann has quit [Ping timeout: 244 seconds]
cirwin1 is now known as cirwin
cirwin has quit [Changing host]
cirwin has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
srbaker has joined #ruby-lang
karasawa has joined #ruby-lang
swav has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
drbrain has joined #ruby-lang
<bubonicpestilenc> hm...
<bubonicpestilenc> guys
<bubonicpestilenc> is there such trick in ruby as in vb:
<bubonicpestilenc> with obj.params do; strength = 1; agility = 2; endwith;
<bubonicpestilenc> similiar to obj.params.strength = 1; obj.params.agility = 2;
<tpope> bubonicpestilenc: obj.params.tap do |p|; p.strength = 1; end
<bubonicpestilenc> thanks )
dvanduzer has left #ruby-lang [#ruby-lang]
<banisterfiend> you could also use instance_eval if the methods weren't of the strength= form
mytrile has joined #ruby-lang
<bubonicpestilenc> they're attr_access :)
<bubonicpestilenc> 'ed
drbrain has quit [Ping timeout: 245 seconds]
karasawa has quit [Ping timeout: 245 seconds]
meatballhat has joined #ruby-lang
meatballhat has quit [Changing host]
meatballhat has joined #ruby-lang
karasawa has joined #ruby-lang
wyhaines has joined #ruby-lang
arooni-mobile has joined #ruby-lang
<yorickpeterse> I have a confession to make
<yorickpeterse> I like recursion way way way too too much
<yorickpeterse> (haha get it?)
<yorickpeterse> I'll be on my way
linc01n has quit [Ping timeout: 260 seconds]
levifig has quit [Ping timeout: 245 seconds]
linc01n has joined #ruby-lang
kalleth has quit [Read error: Connection reset by peer]
kalleth has joined #ruby-lang
havenn has quit [Remote host closed the connection]
goshakkk has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby-lang
havenn has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
Jake232 has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
levifig has joined #ruby-lang
havenn has quit [Read error: No route to host]
havenn has joined #ruby-lang
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
Rarrikins has quit [Remote host closed the connection]
goshakkk has joined #ruby-lang
s0ber has quit [Read error: Connection reset by peer]
havenn has quit [Ping timeout: 264 seconds]
Rarrikins has joined #ruby-lang
s0ber has joined #ruby-lang
mercwithamouth has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 276 seconds]
arooni-mobile has quit [Remote host closed the connection]
kurko_ has quit [Ping timeout: 244 seconds]
mpan has quit [Ping timeout: 244 seconds]
voker57 has quit [Read error: Connection reset by peer]
lsegal has joined #ruby-lang
drbrain has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
drbrain has quit [Ping timeout: 245 seconds]
swarles is now known as xXswarleyXxX
xXswarleyXxX is now known as broken
broken is now known as belittledSwarley
belittledSwarley is now known as swarley
arooni-mobile has joined #ruby-lang
tshine has joined #ruby-lang
countdigi has joined #ruby-lang
s1n4 has joined #ruby-lang
s1n4 is now known as Guest54564
mercwithamouth has quit [Ping timeout: 255 seconds]
Rarrikins_o has joined #ruby-lang
Rarrikins has quit [Ping timeout: 264 seconds]
richardburton has quit [Quit: Leaving.]
workmad3 has joined #ruby-lang
richardburton has joined #ruby-lang
mjio has joined #ruby-lang
goshakkk has quit [Quit: Computer has gone to sleep.]
jtoy has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
srbaker has quit [Quit: Computer has gone to sleep.]
mpan has joined #ruby-lang
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
Peg-Leg has quit []
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
goshakkk has quit [Excess Flood]
goshakkk has joined #ruby-lang
mercwithamouth has joined #ruby-lang
rsl has quit [Quit: Computer has gone to sleep.]
marr has joined #ruby-lang
drbrain has joined #ruby-lang
drbrain has quit [Ping timeout: 265 seconds]
Rarrikins_o has quit [Remote host closed the connection]
jtoy has quit [Quit: jtoy]
karasawa has quit [Ping timeout: 265 seconds]
karasawa has joined #ruby-lang
goshakkk has quit [Quit: Computer has gone to sleep.]
robbyoconnor has joined #ruby-lang
countdigi has quit [Quit: Lost terminal]
sush24 has quit [Quit: This computer has gone to sleep]
havenn has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
Rarrikins has joined #ruby-lang
wyhaines has joined #ruby-lang
Guest54564 has quit [Quit: leaving]
Asher has joined #ruby-lang
mistym has quit [Remote host closed the connection]
workmad3 has quit [Read error: Operation timed out]
ivanoats has joined #ruby-lang
mjio has quit []
mjio has joined #ruby-lang
m3nd3s has joined #ruby-lang
Rarrikins has quit [Remote host closed the connection]
Rarrikins has joined #ruby-lang
jonahR has joined #ruby-lang
davpoind has joined #ruby-lang
richardburton has quit [Quit: Leaving.]
robbyoconnor has quit [Ping timeout: 252 seconds]
gaveen has quit [Quit: Leaving]
glebm has quit [Quit: Computer has gone to sleep.]
bubonicpestilenc has quit [Quit: My blog @ http://bubonicpestilence.ru/]
robbyoconnor has joined #ruby-lang
meatballhat has quit [Ping timeout: 252 seconds]
meatballhat has joined #ruby-lang
meatballhat has joined #ruby-lang
meatballhat has quit [Changing host]
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
leopard_me has joined #ruby-lang
meatballhat has quit [Ping timeout: 255 seconds]
wyhaines has quit [Remote host closed the connection]
rsl has joined #ruby-lang
glebm has joined #ruby-lang
kurko_ has joined #ruby-lang
drbrain has joined #ruby-lang
anannie has quit [Remote host closed the connection]
davpoind2 has joined #ruby-lang
davpoind has quit [Ping timeout: 244 seconds]
emocakes has quit [Quit: emocakes]
mpan has quit [Quit: Leaving]
drbrain has quit [Ping timeout: 255 seconds]
sush24 has joined #ruby-lang
Jake232 has joined #ruby-lang
wyhaines has joined #ruby-lang
megharsh has quit [Ping timeout: 265 seconds]
meatballhat has joined #ruby-lang
charliesome has quit [Ping timeout: 252 seconds]
jonahR has quit [Quit: jonahR]
sush24 has quit [Quit: This computer has gone to sleep]