apeiros_ changed the topic of #ruby-lang to: Ruby 2.2.0; 2.1.5; 2.0.0-p598; 1.9.3-p551: http://ruby-lang.org || Paste code on http://gist.github.com
chadwtaylor has quit [Remote host closed the connection]
KINGSABRI has quit [Ping timeout: 245 seconds]
cmisenas has joined #ruby-lang
jo_ has quit [Quit: Connection closed for inactivity]
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
Bwild has quit [Ping timeout: 246 seconds]
Bwild has joined #ruby-lang
fujimura has quit [Remote host closed the connection]
<Senjai> yorickpeterse: cool stuff
<Senjai> Can I not google, and instead ask you what an LL table it
<Senjai> is*
vipaca has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
houhoulis has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
auzty has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 246 seconds]
lea has quit [Changing host]
lea has joined #ruby-lang
cmisenas has quit [Quit: cmisenas]
TTilus has joined #ruby-lang
lytol has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 256 seconds]
brownbathrobe has quit [Remote host closed the connection]
ap4y has joined #ruby-lang
chacmool has joined #ruby-lang
brownbathrobe has joined #ruby-lang
tenderlove has quit [Quit: Leaving...]
fujimura has joined #ruby-lang
mkosaki has joined #ruby-lang
jo_ has joined #ruby-lang
PhaseCode has quit []
deol has joined #ruby-lang
nathanstitt has joined #ruby-lang
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fujimura has quit [Remote host closed the connection]
rbowlby has quit [Remote host closed the connection]
stardiviner has joined #ruby-lang
tcopeland1 has joined #ruby-lang
brownbathrobe has quit [Remote host closed the connection]
tcopeland has quit [Ping timeout: 265 seconds]
ClassyCritic has joined #ruby-lang
<ClassyCritic> Hey gusy can someone help me with a small program? It's my first epxerience with ruby
RobertBirnie has quit [Ping timeout: 256 seconds]
<ClassyCritic> How can I add a gets.chomp into a hash?
Lewix has joined #ruby-lang
Lewix has quit [Changing host]
Lewix has joined #ruby-lang
<womble> ClassyCritic: hash[key] = gets.chomp
<ClassyCritic> womble: So would hash[movies] = gets.chomp work?
<ClassyCritic> And could I pair a rating with my movie hash?
houhoulis has quit [Remote host closed the connection]
Musashi007 has joined #ruby-lang
<womble> ClassyCritic: Sure.
setanta__ has quit [Quit: Leaving]
<ClassyCritic> womble: I get undefined local variable or method
<womble> You probably need to define the local variable or method.
<ClassyCritic> womble: How?
<womble> Define a local variable by assigning to it; define a method with the 'def' keyword.
<ClassyCritic> womble: So how would I define the has from earlier?
<ClassyCritic> I have puts"Stuff" then movies = Hash.new then hash[movies] = gets.chomp
<ClassyCritic> Is that wrong?
seank_ has quit [Remote host closed the connection]
auzty has quit [Quit: Leaving]
amsi has quit [Quit: Leaving]
auzty has joined #ruby-lang
ClassyCritic has quit [Quit: Lost terminal]
mikecmpbll has quit [Quit: ciao.]
|jemc| has quit [Ping timeout: 246 seconds]
Musashi007 has quit [Quit: Musashi007]
cmisenas has joined #ruby-lang
marr has quit [Ping timeout: 264 seconds]
jhass has quit [Quit: Bye]
jhass has joined #ruby-lang
amclain has joined #ruby-lang
RobertBirnie has joined #ruby-lang
micmus has quit [Ping timeout: 240 seconds]
deol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sivsushruth has joined #ruby-lang
nofxx has quit [Ping timeout: 264 seconds]
nofxx has joined #ruby-lang
symm- has quit [Ping timeout: 252 seconds]
<jdecuirm> good night
<jdecuirm> womble! are you there???
dzejrou has quit [Quit: Leaving]
lytol has quit [Remote host closed the connection]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has quit [Remote host closed the connection]
vipaca has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
<womble> jdecuirm: Sure.
<jdecuirm> please check this womble! it's a description of my problem in lexicon.rb
TTilus has quit [Ping timeout: 250 seconds]
TTilus has joined #ruby-lang
Mr0rris0 has joined #ruby-lang
wallerdev has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
Mr0rris0 has joined #ruby-lang
<jdecuirm> i also tried with require_relative but with no luck
Mr0rris0 has quit [Excess Flood]
Mr0rris0 has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
wallerdev has quit [Client Quit]
<bnagy> good that you've made 0 progress since yesterday
Mr0rris0 has joined #ruby-lang
<bnagy> you must be working really hard instead of waiting for IRC to write your code for you
<jdecuirm> sorry bnagy
<jdecuirm> i don't want to be rude
Mr0rris0 has quit [Excess Flood]
<jdecuirm> i tried many ways to solve this problem
<jdecuirm> but if you are not here to help, then don't be a pain either
Mr0rris0 has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
Mr0rris0 has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
<bnagy> it's not a "write my homework for me" service
<bnagy> everyone here is also doing their own work
<jdecuirm> you may be a wonderful programmer, but a lot of people are learning, as i am, and i'm not afraid to accept my mistakes
Mr0rris0 has joined #ruby-lang
<jdecuirm> and i also tell you a hundred times
Mr0rris0 has quit [Excess Flood]
<jdecuirm> if you are so busy
<jdecuirm> then go to work
Mr0rris0 has joined #ruby-lang
<jdecuirm> not here to offend
<bnagy> when you ask questions that are imprecise and when you come back with exactly the same code after a day then it makes people think you're not actually trying to learn
Mr0rris0 has quit [Excess Flood]
<jdecuirm> i expressed the problem in my gist
<bnagy> you were given the answer yesterday
<jdecuirm> i don't know what more to say
Mr0rris0 has joined #ruby-lang
<bnagy> you just haven't implemented it
Mr0rris0 has quit [Excess Flood]
tunaCanBruh has joined #ruby-lang
<jdecuirm> what was the answer, sorry if i lost that
Mr0rris0 has joined #ruby-lang
<bnagy> like, I find it difficult to believe that you made it through 47 exercises of hardway without learning how require works
Mr0rris0 has quit [Excess Flood]
<jdecuirm> like
<bnagy> if you did then maybe you didn't do the additional work it suggests
Mr0rris0 has joined #ruby-lang
<jdecuirm> about 47 exercises just worked directly in one folder
Mr0rris0 has quit [Excess Flood]
<jdecuirm> then in 46 began to use a project skeleton
Mr0rris0 has joined #ruby-lang
<bnagy> just write a dummy skeleton and a nop test and learn how to require
Mr0rris0 has quit [Excess Flood]
roamingdog has quit [Remote host closed the connection]
Mr0rris0 has joined #ruby-lang
<jdecuirm> so, i used require_relative in my main .rb i just required one file
Mr0rris0 has quit [Excess Flood]
<jdecuirm> i don't get then, why test does not see that file
<bnagy> if in doubt minimise your fault
Mr0rris0 has joined #ruby-lang
<jdecuirm> absolute path you said yesterday?
Mr0rris0 has quit [Excess Flood]
Mr0rris0 has joined #ruby-lang
<bnagy> absolute or anchored. Anchored is better.
Mr0rris0 has quit [Excess Flood]
<bnagy> I seem to recall hardway starts getting you making gems very, very early
<bnagy> which covers all this
Mr0rris0 has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
Mr0rris0 has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
<jdecuirm> yes i did my first gem in fact, but, zed works with a path that really does not seem to work when requiring
<jdecuirm> is why i'm looking the problem
Mr0rris0 has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 246 seconds]
Mr0rris0 has quit [Excess Flood]
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Mr0rris0 has joined #ruby-lang
<jdecuirm> at test file he uses 'ex48/lexicon.rb' and that's all
Mr0rris0 has quit [Excess Flood]
<jdecuirm> that does not seem to work with my files
Mr0rris0 has joined #ruby-lang
<bnagy> so use require_relative
<bnagy> with a minimal example until you figure out how it works
<jdecuirm> ok
duderonomy has joined #ruby-lang
<jdecuirm> this worked now
<jdecuirm> suddenly all works
<jdecuirm> damn
<bnagy> -___-
<jdecuirm> i hate tests
<jdecuirm> thanks bnagy, and sorry to be such an idiot, i really want to learn ruby
<bnagy> you're going to hate hipster ruby then :<
<jdecuirm> and i had my bad days
<bnagy> to be clear, I am not impatient because of your level
<jdecuirm> lol, so is it a good thing to code with my chai tea in front of the PC?
<bnagy> I'm impatient because of your behaviour, which is independent of level
duderonomy has quit [Client Quit]
<jdecuirm> Sorry, i maybe my language is the one that does not help
<bnagy> asking good questions, minimising problems, saying what you already tried are super important at all levels
<jdecuirm> i speak spanish
<jdecuirm> and sometimes is difficult to create the correct questions
<bnagy> your english is fine
<jdecuirm> sometimes i spend more time creating the correct questions than finding answers lol, but thanks for your patience!
daBee has joined #ruby-lang
<womble> Answers are almost always easy once you work out the right question...
wallerdev has joined #ruby-lang
daBee_ has joined #ruby-lang
<bnagy> jdecuirm: there is a whole school of debugging called teddy-bear debugging which is based on this
<bnagy> turns out that once you ask your question _properly_ you answer it yourself > half the time
centrx has quit [Quit: Shutting down, Please wait...]
wallerdev has quit [Client Quit]
<jdecuirm> thanks bnagy for the advice i will try to be more concise with my questions!
wallerdev has joined #ruby-lang
daBee has left #ruby-lang [#ruby-lang]
<pipework> Other people call it rubber-duck debugging.
daBee_ has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
<bnagy> wrong people. Or young people. Or both.
shinnya has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby-lang
<pipework> Or Rotary club members
roamingdog has joined #ruby-lang
daBee_ has joined #ruby-lang
cmisenas has quit [Quit: cmisenas]
wallerdev has quit [Quit: wallerdev]
cmisenas has joined #ruby-lang
rkowalick has joined #ruby-lang
lupine has quit [Ping timeout: 272 seconds]
ledestin has joined #ruby-lang
daBee_ has quit [Remote host closed the connection]
lytol has joined #ruby-lang
roamingdog has quit [Remote host closed the connection]
daBee_ has joined #ruby-lang
daBee_ has left #ruby-lang [#ruby-lang]
beerich has joined #ruby-lang
roamingdog has joined #ruby-lang
lytol has quit [Ping timeout: 245 seconds]
cornerma1 has joined #ruby-lang
lupine has joined #ruby-lang
pd has joined #ruby-lang
roamingdog has quit [Ping timeout: 255 seconds]
rkowalick has quit [Quit: Changing server]
cornerman has quit [Ping timeout: 244 seconds]
cornerma1 is now known as cornerman
roamingdog has joined #ruby-lang
chacmool has quit [Remote host closed the connection]
riotjones has joined #ruby-lang
stardiviner has quit [Ping timeout: 244 seconds]
roamingdog has quit [Remote host closed the connection]
riotjones has quit [Ping timeout: 252 seconds]
<jdecuirm> bnagy, can i ask you something curious?
roamingdog has joined #ruby-lang
<jdecuirm> it's about a different way to solve the problem of the word catalog, but something funny happens
chacmool has joined #ruby-lang
beerich has quit []
stardiviner has joined #ruby-lang
nofxx has quit [Read error: Connection reset by peer]
cmisenas has quit [Ping timeout: 246 seconds]
cmisenas has joined #ruby-lang
Bwild has quit [Ping timeout: 252 seconds]
Bwild has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
Miphix has joined #ruby-lang
Bwild has quit [Ping timeout: 252 seconds]
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
Bwild has joined #ruby-lang
slawrence00 has joined #ruby-lang
bzalasky has joined #ruby-lang
duderonomy has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
ap4y has quit [Read error: Connection reset by peer]
Mr0rris0 has quit [Ping timeout: 252 seconds]
RobertBirnie has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
arooni-mobile has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 250 seconds]
mkosaki has quit [Ping timeout: 244 seconds]
cmisenas has quit [Ping timeout: 244 seconds]
lytol has joined #ruby-lang
cmisenas has joined #ruby-lang
dik_dak has quit [Quit: Textual IRC Client: www.textualapp.com]
lytol has quit [Ping timeout: 245 seconds]
kyb3r_ has joined #ruby-lang
jo_ has quit [Quit: Connection closed for inactivity]
lytol has joined #ruby-lang
cmisenas has quit [Ping timeout: 245 seconds]
davispuh has quit [Remote host closed the connection]
madzhuga has joined #ruby-lang
banister has quit [Ping timeout: 240 seconds]
madzhuga has quit [Client Quit]
nathanstitt has quit [Quit: I growing sleepy]
rbowlby has joined #ruby-lang
stardiviner has quit [Ping timeout: 250 seconds]
ur5us has quit [Remote host closed the connection]
lupine has quit [Quit: ZNC - http://znc.in]
gix has quit [Ping timeout: 240 seconds]
lupine has joined #ruby-lang
<jdecuirm> is there any method to ignore case of strings? case insensitive or something like that?
gix has joined #ruby-lang
<jdecuirm> i want to be able to handle things like Hello hello hElLo etc.
<jdecuirm> i was trying to implement regular expressions but with no luck
<jdecuirm> i did something like
<jdecuirm> if @directions.include?(word) || (@directions.include?(word) && Regexp.new(Regexp.escape(word), Regexp::IGNORECASE))
havenwood has joined #ruby-lang
simi has joined #ruby-lang
<pabs> jdecuirm: str =~ /hello/i # (match on "hello", ignoring case)
<jdecuirm> thanks pabs!
<pabs> sure
stardiviner has joined #ruby-lang
<womble> jdecuirm: Alternately you can call .downcase on your string and then compare against the lowercase form
arooni-mobile has quit [Ping timeout: 256 seconds]
<jdecuirm> womble, in fact i tried to do that, but if i have a set of tests that waits for something like AAADDD
<jdecuirm> then it won't work
<jdecuirm> because was expecting AAADDD not aaaddd
<jdecuirm> i tried that lol
<jdecuirm> but with @array.include?(word) does not let me handle every word of the array so it's getting a little tricky
tunaCanBruh has joined #ruby-lang
<jdecuirm> ok i got you...
<jdecuirm> thanks womble!
tunaCanBruh has quit [Ping timeout: 244 seconds]
riotjones has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AKASkip has joined #ruby-lang
riotjones has quit [Ping timeout: 264 seconds]
lytol has quit [Remote host closed the connection]
mahmoudmahfouz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
stardiviner has quit [Ping timeout: 265 seconds]
chacmool has quit [Remote host closed the connection]
ruby-lang232 has joined #ruby-lang
ruby-lang232 has quit [Client Quit]
bb010g has joined #ruby-lang
sunre has joined #ruby-lang
stardiviner has joined #ruby-lang
mahlon has quit [Read error: Connection reset by peer]
ged has quit [Read error: Connection reset by peer]
stonith has quit [Quit: No Ping reply in 180 seconds.]
tdy has quit [Ping timeout: 264 seconds]
ocdmw has quit []
stonith has joined #ruby-lang
stonith has joined #ruby-lang
roamingdog has quit [Remote host closed the connection]
stardiviner has quit [Ping timeout: 246 seconds]
AKASkip has quit [Ping timeout: 265 seconds]
tdy has joined #ruby-lang
czj627 has joined #ruby-lang
czj627 has left #ruby-lang [#ruby-lang]
czj627 has joined #ruby-lang
czj627 has left #ruby-lang [#ruby-lang]
czj627 has joined #ruby-lang
czj627 has left #ruby-lang [#ruby-lang]
stardiviner has joined #ruby-lang
lytol has joined #ruby-lang
djellemah_ has quit [Quit: Leaving]
djellemah has joined #ruby-lang
|jemc| has joined #ruby-lang
Czj has joined #ruby-lang
Czj has left #ruby-lang [#ruby-lang]
ged has joined #ruby-lang
nofxx has quit [Ping timeout: 245 seconds]
riotjones has joined #ruby-lang
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mahlon has joined #ruby-lang
ged has quit [Read error: Connection reset by peer]
Musashi007 has joined #ruby-lang
riotjones has quit [Ping timeout: 245 seconds]
enkristoffer has quit [Ping timeout: 264 seconds]
simi has quit [Ping timeout: 244 seconds]
AKASkip has joined #ruby-lang
ged has joined #ruby-lang
stardiviner has quit [Ping timeout: 255 seconds]
tunaCanBruh has joined #ruby-lang
enkristoffer has joined #ruby-lang
roamingdog has joined #ruby-lang
riotjones has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 240 seconds]
rbowlby has quit [Remote host closed the connection]
roamingdog has quit [Ping timeout: 245 seconds]
stardiviner has joined #ruby-lang
apeiros__ has joined #ruby-lang
apeiros_ has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: zzz]
Newbie0086 has joined #ruby-lang
amclain has quit [Quit: Leaving]
sunre has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Musashi007 has quit [Quit: Musashi007]
charliesome has joined #ruby-lang
chinmay_dd has joined #ruby-lang
bastilian has joined #ruby-lang
apeiros__ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
stardiviner has quit [Ping timeout: 244 seconds]
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
apeiros_ has quit [Ping timeout: 246 seconds]
|jemc| has quit [Ping timeout: 246 seconds]
AKASkip has quit [Ping timeout: 245 seconds]
stardiviner has joined #ruby-lang
rbowlby has joined #ruby-lang
stardiviner has quit [Ping timeout: 264 seconds]
sunre has joined #ruby-lang
stamina has joined #ruby-lang
skade has joined #ruby-lang
thebastl has joined #ruby-lang
ironhide_604 has joined #ruby-lang
stardiviner has joined #ruby-lang
sunre has quit [Ping timeout: 264 seconds]
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
lytol has quit [Remote host closed the connection]
roamingdog has joined #ruby-lang
lytol has joined #ruby-lang
stardiviner has quit [Ping timeout: 245 seconds]
symm- has joined #ruby-lang
AKASkip has joined #ruby-lang
<wnd> also, if you only need to know whether the word exists, you may want to use Hash#key? (or Set#include?) instead of Array#include?
lytol has quit [Ping timeout: 252 seconds]
elia has joined #ruby-lang
roamingdog has quit [Ping timeout: 265 seconds]
Integralist has joined #ruby-lang
hahuang62 has quit [Ping timeout: 250 seconds]
havenwood has quit [Remote host closed the connection]
hahuang62 has joined #ruby-lang
strixd has joined #ruby-lang
mkaesz has joined #ruby-lang
ironhide_604 has quit [Ping timeout: 244 seconds]
Evanescence has joined #ruby-lang
tkuchiki has quit [Ping timeout: 246 seconds]
kyb3r_ has quit [Read error: Connection reset by peer]
Evanescence has quit [Ping timeout: 250 seconds]
charliesome has quit [Quit: zzz]
bb010g has quit [Quit: Connection closed for inactivity]
ironhide_604 has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
skade has quit [Remote host closed the connection]
tunaCanBruh has joined #ruby-lang
elabs-developer has joined #ruby-lang
hahuang65 has quit [Read error: Connection reset by peer]
tunaCanBruh has quit [Ping timeout: 264 seconds]
Evanescence has joined #ruby-lang
skade has joined #ruby-lang
charliesome has joined #ruby-lang
charliesome has quit [Client Quit]
marr has joined #ruby-lang
elabs-developer has quit [Quit: elabs-developer]
skade has quit [Remote host closed the connection]
<ljarvis> use casecmp, not =~ //i
charliesome has joined #ruby-lang
charliesome has quit [Client Quit]
Evanescence has quit [Ping timeout: 264 seconds]
skade has joined #ruby-lang
lytol has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
Evanescence has joined #ruby-lang
lytol has quit [Ping timeout: 252 seconds]
banister has joined #ruby-lang
Evanescence has quit [Ping timeout: 246 seconds]
mkaesz has quit [Remote host closed the connection]
mkaesz has joined #ruby-lang
mkaesz has quit [Ping timeout: 246 seconds]
Newbie0086 has quit [Ping timeout: 245 seconds]
yfeldblum has quit [Remote host closed the connection]
Evanescence has joined #ruby-lang
roamingdog has joined #ruby-lang
ghostpl has joined #ruby-lang
tkuchiki has joined #ruby-lang
benlovell has joined #ruby-lang
roamingdog has quit [Ping timeout: 245 seconds]
arBmind has joined #ruby-lang
workmad3 has joined #ruby-lang
elia has joined #ruby-lang
mikecmpbll has joined #ruby-lang
charliesome has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
stamina has quit [Quit: WeeChat 1.1.1]
mkaesz has joined #ruby-lang
intinig has joined #ruby-lang
micmus has joined #ruby-lang
Integralist has quit [Quit: leaving]
ledestin has quit [Quit: ledestin]
Integralist has joined #ruby-lang
<[spoiler]> Hullo folk
AKASkip1 has joined #ruby-lang
AKASkip has quit [Ping timeout: 246 seconds]
apeiros_ has joined #ruby-lang
rbowlby has quit [Remote host closed the connection]
elia has quit [Read error: Connection reset by peer]
ghostpl has quit [Remote host closed the connection]
tunaCanBruh has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
<maloik> I have a module (concern) which adds a class method to enable logging, is there a way to call the class method without options upon including the concern, if it's not being called manually (i.e. with options) ? https://gist.github.com/hannesfostie/199977e748b7c3126666
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby-lang
ghostpl has joined #ruby-lang
<apeiros_> maloik: I'd ask in #rubyonrails, concerns are a rails mechanic.
<ljarvis> maloik: how can you tell if it's not gonna be called manually when you include it
<maloik> ljarvis: that's basically the question :D
<ljarvis> right, you can't
<maloik> figured as much
<ljarvis> :)
<maloik> too bad, was feeling lazy
<maloik> now I actually have to type shit :(
<ljarvis> :(
tunaCanBruh has quit [Ping timeout: 240 seconds]
chinmay_dd has quit [Quit: Connection closed for inactivity]
<ljarvis> what you could do though, is called log_changes when it's included, and define a class attribute/method on the original class that contains the options
<ljarvis> which defaults to {}
<ljarvis> we do something similar
<ljarvis> so your remote_logger_options is pulled from the original class, not the other way around
oleo has joined #ruby-lang
<yorickpeterse> morning kids
<ljarvis> morning uncle
<maloik> ljarvis: nice, I like that]
vipaca has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
diegoviola has joined #ruby-lang
oleo__ has quit [Ping timeout: 244 seconds]
ldnunes has joined #ruby-lang
skade has quit [Ping timeout: 246 seconds]
arBmind has joined #ruby-lang
Evanescence has quit [Ping timeout: 252 seconds]
ghostpl has quit [Remote host closed the connection]
<yorickpeterse> you kids behaving?
<yorickpeterse> not doing any drugs?
ghostpl has joined #ruby-lang
tkuchiki has quit [Ping timeout: 244 seconds]
Evanescence has joined #ruby-lang
mkosaki has joined #ruby-lang
lytol has joined #ruby-lang
charliesome has quit [Quit: zzz]
mskaesz has joined #ruby-lang
Evanescence has quit [Ping timeout: 240 seconds]
mkaesz has quit [Ping timeout: 250 seconds]
lytol has quit [Ping timeout: 252 seconds]
qba73 has joined #ruby-lang
Evanescence has joined #ruby-lang
jo_ has joined #ruby-lang
elia has joined #ruby-lang
Iskarlar has joined #ruby-lang
skade has joined #ruby-lang
skade has quit [Read error: Connection reset by peer]
ottlikg has joined #ruby-lang
<[spoiler]> Everyonce in a while I make the mistake of thinking I understand git, and fuck up, then I spend the next hour trying to fix the shitty clusterbrainfuck mess I created for myself
roamingdog has joined #ruby-lang
yfeldblum has joined #ruby-lang
simi has joined #ruby-lang
roamingdog has quit [Ping timeout: 252 seconds]
<apeiros_> s/git/computers/
yfeldblu_ has joined #ruby-lang
mkosaki has quit [Ping timeout: 265 seconds]
benlovell has quit [Ping timeout: 245 seconds]
<[spoiler]> apeiros_: I suppose that's also true. :P
auzty has quit [Ping timeout: 244 seconds]
yfeldblum has quit [Ping timeout: 265 seconds]
<apeiros_> computers - how do they fucking work?
<apeiros_> magical beings
<[spoiler]> I read that as "mechanical beans" at first. GTFO mild dyslexia
benlovell has joined #ruby-lang
<apeiros_> T-15000 until holidays
auzty has joined #ruby-lang
* apeiros_ 63% in party mood
<maloik> 1500 minutes?
<apeiros_> seconds
<apeiros_> SI units, please
mahmoudmahfouz has joined #ruby-lang
<maloik> the other day you were counting down in minutes
<maloik> consistence, please
auzty has quit [Client Quit]
<maloik> ;D
<apeiros_> damn, got me :D
<apeiros_> but only because somebody else *cough* used minutes first!
<apeiros_> I got misled!
sivsushruth has quit [Ping timeout: 256 seconds]
<maloik> going skiing?
<apeiros_> nope
<apeiros_> working my ass off. that's what holidays are for, no?
<maloik> neuwp
<apeiros_> I'm not even kidding. I want to work on my framework and some othre things.
<maloik> not in my book
<apeiros_> *other
intinig has quit [Remote host closed the connection]
shazaum has joined #ruby-lang
<maloik> which framework?
intinig has joined #ruby-lang
riotjones has quit [Remote host closed the connection]
<apeiros_> jacob. it's as of yet unreleased. and will probably stay so for another ~10 months.
<[spoiler]> Aw jacob's a cute name for a framework
<maloik> hmm, it's a private repo?
<apeiros_> yes
<maloik> found a tweet of yours with a link
centrx has joined #ruby-lang
<maloik> (that didnt work anymore)
<apeiros_> I tweeted a link to the repo?
<apeiros_> oy…
<maloik> looks like it
<maloik> something about javascript i18n
<apeiros_> yeah, that's part of it
<apeiros_> since most things happen client side, I need quite a couple of things existing on both, server and client.
<[spoiler]> Let's make a Bella plugin for Jacob! Although, Jacob should be the one plugging into Bella, but we do not live in an ideal world. ~
* apeiros_ wonders in which movie Jacob and Bella appear
* [spoiler] is embarrassed of his twatlight reference; but couldn't help himself
<apeiros_> lol, that explains why I didn't know :-p
<[spoiler]> It's from sparkling vampire thing
<maloik> I didn't get it either
<maloik> seen the movie though
<apeiros_> thankfully my wife isn't into that stuff
<[spoiler]> I spend a lot of time on Tumblr; I know all the (bad) jokes about twilight
<apeiros_> btw., I don't care if anybody watches it. I mean, if you like it - so what? :) I wouldn't want my tastes weighted against me…
<[spoiler]> I did read the first book, though. It was the dullest read; you can't fathom how dull it was
<apeiros_> oooh, read a book
<apeiros_> yes, that's totally something I'll do during holidays too
<[spoiler]> Oh I haven't seen the film (apart from some clips on youtube and gifs)
tcopeland1 has quit [Quit: Leaving.]
arBmind1 has joined #ruby-lang
<maloik> not exactly great
<[spoiler]> Bella chick in the books has an IQ lower than south pole's temperature. She's like your generic female character, and the the book is all about a generic romance
intinig has quit [Ping timeout: 245 seconds]
<[spoiler]> It's basically a written soap opera
<[spoiler]> There's not even the classical aspects of literature you'd expect to see in it
arBmind has quit [Ping timeout: 256 seconds]
<[spoiler]> Although, we went *way* off topic, a topic I ain't even bovvered about.
mikecmpb_ has joined #ruby-lang
<[spoiler]> s/Although/Also
<tobiasvl> what about that one twilight fanfic
<tobiasvl> 50 shades of grey
My_Hearing has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 246 seconds]
mikecmp__ has joined #ruby-lang
<[spoiler]> Lmao it's funny because it *was* posted on fanfiction.net (I read Harry Potter and Inheritance fanfiction), and people took the piss out of it, but then it got taken off of ff.net published and all the sex-deprived ladies are into it now
mikecmpbll has quit [Ping timeout: 250 seconds]
<[spoiler]> kinky ladies*
<[spoiler]> Also, if you want to read *the worst* (but also kinda hilarious in a sad way) fanfiction, check out My Immortal
mikecmpb_ has quit [Ping timeout: 256 seconds]
<tobiasvl> hmm it won't load
<[spoiler]> tobiasvl: might be that webs.com is blocked
<centrx> the webs is blocked!?
<[spoiler]> centrx: yeah, apparently it's not that uncommon
<centrx> but they are supposed to be interwebs, can't stop 'em
_Mon_Ouie_ has joined #ruby-lang
<[spoiler]> Oh my god I am reading a bit of MI and I started laughing like crazy; I don't recommend reading this at work
My_Hearing has quit [Ping timeout: 245 seconds]
<tobiasvl> lol
<[spoiler]> *cringes*
<[spoiler]> Ooh
<[spoiler]> The wikia has the full text rofl
<[spoiler]> Awesome!
<workmad3> [spoiler]: is it really that awesome that there's a replica of the text on a different server?
ghostpl has quit [Remote host closed the connection]
<[spoiler]> workmad3: it was deleted from fanfiction.net
<workmad3> [spoiler]: from the sounds of it, that was probably a blessing :P
<[spoiler]> so people mirrored it
<[spoiler]> hahaha yeah
<workmad3> it's nice to know that fanfiction.net has *some* standards after all
<[spoiler]> workmad3: the community has pretty high standards of what it considers good fanfiction, though
<workmad3> :)
<workmad3> just read the first 'chapter' of MI...
mskaesz has quit [Ping timeout: 240 seconds]
<workmad3> I think I've already started bleeding from the ears
<[spoiler]> workmad3: people post all kinda crap on FF, true. But it's mostly un-moderated so bleh
<[spoiler]> although there are like sites dedicated to good fanfiction (which just link to livejournal or ff)
yfeldblu_ has quit [Ping timeout: 245 seconds]
<workmad3> [spoiler]: heh :) it would help if I actually read stuff on FF, rather than taking pot-shots based off guesses as to its content ;)
<[spoiler]> I love the Author's Notes, oh God
<[spoiler]> I am snorting and people at work are staring at me, I need to stop and get back to work.
<workmad3> ok... read ch2... I'm now bleeding from the ears and the eyes
yfeldblum has joined #ruby-lang
<[spoiler]> LOL
<workmad3> I should probably stop before I need a lobotomy just to remove it from my head
piotrj has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
<[spoiler]> workmad3: the first time I read I couldn't stop
yfeldblu_ has joined #ruby-lang
<[spoiler]> I actually couldn't wait for the next chapter
<workmad3> ok, closed the tab
<[spoiler]> while it was being posted on FF
<[spoiler]> I read it every time I need a laugh
benlovell has quit [Ping timeout: 246 seconds]
<workmad3> [spoiler]: if I need a laugh, I just imagine people having to deal with timezones
<[spoiler]> workmad3: Hahahahaha
<maloik> well this is pretty neat http://codepen.io/kowlor/full/MYOKRd/
<maloik> daft punk keyboard thingy, I suppose people mightve seen it before
<workmad3> [spoiler]: this gave me a good laugh on the tram this morning too: https://www.youtube.com/watch?v=GsyhGHUEt-k
yfeldblum has quit [Ping timeout: 244 seconds]
stamina has joined #ruby-lang
mkaesz has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 265 seconds]
stamina has quit [Client Quit]
intinig has joined #ruby-lang
<[spoiler]> workmad3: Rofl! I love that
<[spoiler]> I didn't know Unicode 7 would bring in new emojis
<[spoiler]> lol @ racial modifier in utf8
<[spoiler]> erm unicode 8
<[spoiler]> fun slip
<workmad3> heh
mikecmpbll has joined #ruby-lang
frzng has joined #ruby-lang
mkosaki has joined #ruby-lang
mikecmp__ has quit [Ping timeout: 255 seconds]
strixd has quit [Quit: 500]
seank_ has joined #ruby-lang
strixd has joined #ruby-lang
n7000v has joined #ruby-lang
<n7000v> тут кто нибудь есть?
<yorickpeterse> n7000v: English
<n7000v> ok
<yorickpeterse> Or Wingdings if you can speak it
ItSANgo has quit [Read error: Connection reset by peer]
<n7000v> hello
ItSANgo_ has joined #ruby-lang
mithraiders has joined #ruby-lang
ItSANgo_ has quit [Read error: Connection reset by peer]
<n7000v> There Rubyists with Ukraine?
lytol has joined #ruby-lang
ItSANgo_ has joined #ruby-lang
<maloik> I wouldn't know as everyone here always speaks english
<n7000v> Who is from where?
riotjones has joined #ruby-lang
postmodern has quit [Quit: Leaving]
<centrx> You think Ukraine is weak!?
<centrx> Ukraine is game to you!?
lytol has quit [Ping timeout: 246 seconds]
<n7000v> ??
<yorickpeterse> centrx: wat
<n7000v> I want to find friends on Ruby from Ukraine
<maloik> you could try meetup.com to find user groups
<maloik> there's also a conference in Kiev (which got canceled last year for obvious reasons) but I forgot the name
<yorickpeterse> Euruko
<yorickpeterse> or wait
<yorickpeterse> the other one was RubyC or something
<maloik> euruko, exactly
riotjones has quit [Ping timeout: 250 seconds]
wael has joined #ruby-lang
<wael> hey guys, anyone care to answer a quick Exception question?
<[spoiler]> I'm from Europe!
<[spoiler]> Rofl, just kidding (although I *am* from Europe)
<[spoiler]> >> Exception.new('What's the problem, wael? :P')
<eval-in__> [spoiler] => /tmp/execpad-ce4c19ada9cd/source-ce4c19ada9cd:2: syntax error, unexpected tIDENTIFIER, expecting ')' ... (https://eval.in/284880)
<[spoiler]> oh damn forgot to escape the '
<wael> haha
<mithraiders> anyone here can recommend a site that teaches how to create a web framework?
* [spoiler] got owned by... himself.
<wael> Question is: How would I check if an exception was passed a message?
<n7000v> djellemah - thank you
<yorickpeterse> >> error = StandardError.new('hello'); error.message
<eval-in__> yorickpeterse => "hello" (https://eval.in/284881)
<yorickpeterse> >> begin; raise 'kaboom'; rescue => error; p error.message; end
<eval-in__> yorickpeterse => "kaboom" ... (https://eval.in/284882)
<yorickpeterse> So you can simply check if "message" returns anything
<wael> but message returns the name also
<wael> in case no message was passed
<wael> so i can check if name equals msg
<wael> but not all exceptions have a name method
<yorickpeterse> hm
<yorickpeterse> Why do you need to specifically check if it has a message?
<[spoiler]> wael: you could use responf_to? to see if it has a name method on it
<[spoiler]> respond, not responf
<wael> but that does not really solve the problem
Lewix has joined #ruby-lang
Lewix has joined #ruby-lang
_Mon_Ouie_ has quit [Ping timeout: 244 seconds]
<wael> My use case is an API that could raise RecordNotFound, and I am using Sinatra’s error block
<wael> which takes the exception object
<wael> i want my API to say “model not found”
<wael> so when I do raise RecordNotFound, mymodel
<wael> I will need to grab that msg
<wael> makes sense?
<wael> One more thing: I don’t want to pass that message all the time, so in case there was no message passed, my return json would be “not found”
<wael> hence the need to differentiate between no message and with message
mithraiders has left #ruby-lang ["Leaving"]
n7000v has quit [Ping timeout: 246 seconds]
<[spoiler]> wael: just do something like https://eval.in/284888
<[spoiler]> maybe it's not the most elegant solution, though
<[spoiler]> "msg" can be any object, obviously
<[spoiler]> and you can serialise it however you want
thebastl has quit [Read error: Connection reset by peer]
<[spoiler]> when printing the error
thebastl has joined #ruby-lang
ghostpl has joined #ruby-lang
benlovell has joined #ruby-lang
slawrence00 has joined #ruby-lang
roamingdog has joined #ruby-lang
n7000v has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
n7000v has quit [Remote host closed the connection]
ghostpl has quit [Ping timeout: 256 seconds]
roamingdog has quit [Ping timeout: 245 seconds]
<wael> Well actually that would mean I need to do raise MyException.new(msg) right?
<wael> in this case sinatra’s error block will swallow it
<maloik> better than previous solution
<maloik> but still kinda ugly :(
<[spoiler]> weaksauce: you can use raise YourException, 'message'
<[spoiler]> oops
<[spoiler]> wael: wrong mention
<[spoiler]> lol
JohnBat26 has joined #ruby-lang
Bwild has quit [Ping timeout: 246 seconds]
<wael> Yep, I did that. But the thing is, sometimes I want to do that, sometimes I wait to do raise YourException
<wael> without the message
<[spoiler]> this does exactly that
<wael> in my handling of this exception raising, I want to display the message only if it was passed
<[spoiler]> wael: you can do that, hold on I'll try to make the example a bit better.
Bwild has joined #ruby-lang
skade has joined #ruby-lang
mahmoudmahfouz has quit [Quit: Textual IRC Client: www.textualapp.com]
tcopeland has joined #ruby-lang
wael has quit [Quit: wael]
wael has joined #ruby-lang
skade has quit [Ping timeout: 264 seconds]
stamina has joined #ruby-lang
guillaume-rb has joined #ruby-lang
<[spoiler]> https://eval.in/284916 wael ^
<[spoiler]> :-) *
<[spoiler]> you can try `raise NoRecordError, "funge"` and `raise NoRecordError`
wael has quit [Quit: wael]
skade has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
elia has joined #ruby-lang
Mr0rris0 has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
wprice has joined #ruby-lang
Mr0rris0 has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
Mr0rris0 has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
Mr0rris0 has joined #ruby-lang
Mr0rris0 has quit [Excess Flood]
Mr0rris0 has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 252 seconds]
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #ruby-lang
sankaber has joined #ruby-lang
piotrj_ has joined #ruby-lang
shinnya has joined #ruby-lang
piotrj has quit [Ping timeout: 240 seconds]
ottlikg has left #ruby-lang [#ruby-lang]
roamingdog has joined #ruby-lang
jo_ has quit [Quit: Connection closed for inactivity]
saurabh_math_ has joined #ruby-lang
AKASkip1 has quit [Ping timeout: 250 seconds]
ghostpl has joined #ruby-lang
strixd has quit [Quit: 500]
strixd has joined #ruby-lang
ghostpl has quit [Remote host closed the connection]
Bwild has quit [Quit: leaving]
ghostpl has joined #ruby-lang
wael has joined #ruby-lang
diegoviola has quit [Remote host closed the connection]
piotrj_ has quit [Ping timeout: 240 seconds]
piotrj has joined #ruby-lang
havenwood has joined #ruby-lang
the_real_intinig has joined #ruby-lang
intinig has quit [Read error: Connection reset by peer]
diegoviola has joined #ruby-lang
fusillicode has joined #ruby-lang
fusillicode1 has quit [Ping timeout: 245 seconds]
piotrj_ has joined #ruby-lang
piotrj has quit [Ping timeout: 245 seconds]
stamina has quit [Ping timeout: 265 seconds]
ghostpl has quit [Remote host closed the connection]
wolves_cs has joined #ruby-lang
unsymbol has quit [Ping timeout: 245 seconds]
wolves_cs has quit [Client Quit]
wolves_cs has joined #ruby-lang
piotrj_ has quit [Read error: Connection reset by peer]
enebo has joined #ruby-lang
arBmind1 has quit [Quit: Leaving.]
whippythellama has joined #ruby-lang
unsymbol has joined #ruby-lang
fusillicode1 has joined #ruby-lang
fusillicode has quit [Ping timeout: 264 seconds]
heftig has joined #ruby-lang
symm- has quit [Ping timeout: 245 seconds]
thebastl has quit [Quit: Leaving...]
chinmay_dd has joined #ruby-lang
ghostpl has joined #ruby-lang
lytol has joined #ruby-lang
arooni-mobile has joined #ruby-lang
ghostpl has quit [Remote host closed the connection]
lytol has quit [Ping timeout: 250 seconds]
FastJack has quit [Ping timeout: 250 seconds]
hahuang62 has quit [Ping timeout: 252 seconds]
b_hoffman has joined #ruby-lang
KINGSABRI has joined #ruby-lang
ghostpl has joined #ruby-lang
<KINGSABRI> Hello!
<KINGSABRI> How to generate all hex bytes from \x01 to \xff ?
ghostpl has quit [Ping timeout: 250 seconds]
|jemc| has joined #ruby-lang
gwendall has joined #ruby-lang
rippa has joined #ruby-lang
jgpawletko has joined #ruby-lang
<KINGSABRI> I think there is a smarter than this
<KINGSABRI> (0..255).to_a.map {|b| ("%x" % b).rjust(4, '\x0')}
qba73 has quit []
<havenwood> >> 256.times.map &:chr
<eval-in__> havenwood => ["\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\a", "\b", "\t", "\n", "\v", "\f", "\r", "\x0E", "\x0F", "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1A" ... (https://eval.in/284969)
gwendall_ has joined #ruby-lang
jefus is now known as jefus_afk
_Mon_Ouie_ has joined #ruby-lang
gwendall has quit [Ping timeout: 252 seconds]
momomomomo has joined #ruby-lang
cornerma1 has joined #ruby-lang
ghostpl has joined #ruby-lang
cornerman has quit [Ping timeout: 255 seconds]
cornerma1 is now known as cornerman
ghostpl has quit [Remote host closed the connection]
roamingdog has quit [Remote host closed the connection]
nathanstitt has joined #ruby-lang
strixd has quit [Remote host closed the connection]
simi has quit [Ping timeout: 252 seconds]
momomomomo has quit [Quit: momomomomo]
roamingdog has joined #ruby-lang
strixd has joined #ruby-lang
|jemc| has quit [Ping timeout: 245 seconds]
bastilian has quit [Remote host closed the connection]
wael has quit [Quit: wael]
bastilian has joined #ruby-lang
ghostpl has joined #ruby-lang
dzejrou has joined #ruby-lang
strixd has quit [Client Quit]
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
ghostpl has quit [Remote host closed the connection]
strixd has joined #ruby-lang
araujo has joined #ruby-lang
araujo has quit [Changing host]
araujo has joined #ruby-lang
ghostpl has joined #ruby-lang
apeiros_ has quit [Ping timeout: 244 seconds]
tunaCanBruh has joined #ruby-lang
stamina has joined #ruby-lang
saurabh_math_ has quit [Ping timeout: 246 seconds]
saurabh_math has joined #ruby-lang
malconis has joined #ruby-lang
arBmind has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 252 seconds]
chadwtaylor has joined #ruby-lang
gwendall_ has quit [Remote host closed the connection]
wael has joined #ruby-lang
b_hoffman has quit [Quit: b_hoffman]
mkaesz has quit [Remote host closed the connection]
arooni-mobile has quit [Ping timeout: 255 seconds]
mkaesz has joined #ruby-lang
tenderlove has joined #ruby-lang
mkaesz has quit [Ping timeout: 246 seconds]
bastilian has quit [Remote host closed the connection]
b_hoffman has joined #ruby-lang
bastilian has joined #ruby-lang
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
Lewix_ has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
dzejrou has quit [Ping timeout: 250 seconds]
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
Lewix has quit [Ping timeout: 244 seconds]
lytol has joined #ruby-lang
momomomomo has quit [Ping timeout: 246 seconds]
_dabradley has joined #ruby-lang
bb010g has joined #ruby-lang
amystephen has quit [Quit: amystephen]
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
amystephen has joined #ruby-lang
|jemc| has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
dabradley has quit [Ping timeout: 240 seconds]
dabradley has joined #ruby-lang
stamina has quit [Quit: WeeChat 1.1.1]
lytol has quit [Ping timeout: 264 seconds]
ghostpl has quit [Remote host closed the connection]
_dabradley has quit [Ping timeout: 246 seconds]
the_real_intinig is now known as intinig
setanta_ has joined #ruby-lang
skade has quit [Read error: Connection reset by peer]
skade has joined #ruby-lang
b_hoffman has quit [Quit: b_hoffman]
bastilian has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
momomomomo has joined #ruby-lang
dorei has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
bantic has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
JohnBat26 has quit [Ping timeout: 256 seconds]
bastilian has quit [Remote host closed the connection]
bastilian has joined #ruby-lang
b_hoffman has joined #ruby-lang
_Mon_Ouie_ is now known as Mon_Ouie
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby-lang
seank_ has quit [Read error: Connection reset by peer]
melter has joined #ruby-lang
seank_ has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
Evanescence has quit [Ping timeout: 252 seconds]
jefus_afk is now known as jefus
<KINGSABRI> thanks havenwood
ghostpl has joined #ruby-lang
benlovell has quit [Ping timeout: 255 seconds]
ghostpl has quit [Remote host closed the connection]
<j2p2> let's say i have a string value that is in the format of a hash
<j2p2> is there a safer way to turn it into a hash than eval?
<yorickpeterse> j2p2: No, you have to parse it
<j2p2> womp womp. thanks :)
b_hoffman has quit [Quit: b_hoffman]
<|jemc|> j2p2: if you can control the serializer - try JSON or YAML (depending on what you're doing)
<j2p2> cool, I'll check it out
<j2p2> thanks
toretore has joined #ruby-lang
<|jemc|> good luck
<j2p2> :)
<|jemc|> for things serialized over a socket or other streaming IO, I'd recommend JSON
<|jemc|> for user-editable config files, I'd recommend YAML
<|jemc|> err s/user/human/
micmus has quit [Ping timeout: 244 seconds]
<j2p2> JSON.parse worked like a charm (after gsubbing the => to :)
<j2p2> thanks a bunch :)
<|jemc|> j2p2: heh, you might want to make sure the string is generated with JSON.generate - your gsub hack will only go so far
Evanescence has joined #ruby-lang
yfeldblu_ has quit [Ping timeout: 244 seconds]
<j2p2> well i'm parsing a response from one of our onsite sandboxes, so i *think* it should be pretty reliable
<j2p2> I just didn't want to straight up eval it, just in case
<|jemc|> I just mean it will only work for certain kinds of input - you're making a pretty big assumption here about the way your input string is formatted and what the keys are
momomomomo has quit [Quit: momomomomo]
<j2p2> definitely true
<|jemc|> an assumption you could remove by making sure the other end is using a proper JSON serializer
<|jemc|> just something you want to consider if you don't want future maintainers of this system to be cursing your name
japaniel has joined #ruby-lang
wael has quit [Quit: wael]
<j2p2> right on, I'll check into that
<j2p2> thanks for all the help
<|jemc|> no problem
saurabh_math has quit [Quit: Page closed]
saurabh_math has joined #ruby-lang
japaniel has quit [Remote host closed the connection]
japaniel has joined #ruby-lang
mikecmpbll has quit [Quit: i've nodded off.]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skade has quit [Quit: Computer has gone to sleep.]
strixd has quit [Quit: 500]
amsi has joined #ruby-lang
symm- has joined #ruby-lang
Integralist has quit [Quit: leaving]
Integralist has joined #ruby-lang
bastilian has quit [Remote host closed the connection]
tunaCanBruh has quit [Ping timeout: 246 seconds]
caseypatrickdris has joined #ruby-lang
caseypatrickdris is now known as caseydriscoll
b_hoffman has joined #ruby-lang
mikecmpbll has joined #ruby-lang
RobertBirnie has joined #ruby-lang
jo_ has joined #ruby-lang
AKASkip has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
intinig has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
b_hoffman has quit [Quit: b_hoffman]
tunaCanBruh has joined #ruby-lang
Lewix_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
yfeldblum has joined #ruby-lang
Miphix has quit [Quit: Leaving]
lytol has joined #ruby-lang
yfeldblum has quit [Ping timeout: 250 seconds]
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
toretore has quit [Quit: Leaving]
japaniel has quit [Remote host closed the connection]
gwendall has joined #ruby-lang
bantic has quit [Quit: bantic]
wallerdev has joined #ruby-lang
diegoviola has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 252 seconds]
Iskarlar has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 264 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
simi has joined #ruby-lang
bantic has joined #ruby-lang
saurabh_math has quit [Quit: Page closed]
rbowlby has joined #ruby-lang
gregf__ has quit [Quit: leaving]
|jemc| has quit [Ping timeout: 245 seconds]
sarkyniin has joined #ruby-lang
havenwood has quit []
rbowlby has quit [Client Quit]
rbowlby has joined #ruby-lang
FastJack has joined #ruby-lang
Iskarlar_ has joined #ruby-lang
Integralist has quit [Ping timeout: 265 seconds]
Iskarlar has quit [Ping timeout: 250 seconds]
melter has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
chinmay_dd has quit [Quit: Connection closed for inactivity]
yfeldblum has quit [Ping timeout: 256 seconds]
stamina has joined #ruby-lang
bastilian has joined #ruby-lang
__butch__ has joined #ruby-lang
AlxAlt has joined #ruby-lang
amsi has quit [Quit: Leaving]
AlxAltea has quit [Ping timeout: 256 seconds]
<Xzyx987X> is there a faster way to do this?: i = [i.unpack("Q>")[0] + 1].pack("Q>")
centrx has quit [Quit: Shutting down, Please wait...]
<Xzyx987X> I tested it, and it is roughly 20 times slower that incrementing an integer in ruby normally, which is sort of a problem for me...
Iskarlar_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
frzng has quit [Quit: frzng]
centrx has joined #ruby-lang
<wallerdev> you just need to add one and put it back in a string?
<Xzyx987X> basically
enebo has quit [Quit: enebo]
<wallerdev> maybe unpack multiple values from one string, not sure what format your input is
<wallerdev> so you only call unpack once
<Xzyx987X> I could manaually hack up a solution, but I was wondering if ruby provides any mechanism to do math on binary data
tunaCanBruh has joined #ruby-lang
<Xzyx987X> in this particular case that wouldn't work, since I can only really use one value at a time, and the access to those values would be semi-random
<Xzyx987X> or if a library exists that could help me
<lianj_> Xzyx987X: no, you could try openssl::bn but that also puts into into a bignum first
roamingdog has quit [Remote host closed the connection]
<apeiros> Xzyx987X: a tiny C ext could help
<apeiros> should not be too difficult
<Xzyx987X> I was thinking I'd just code a simple method to add to the string class that does a binary increment, and hopefully that will be fast enough
yfeldblum has joined #ruby-lang
<Xzyx987X> I'd rather not mess around with C extensions until the design for what I'm programming is more finalized
<Xzyx987X> then I may end up porting the whole thing to a C extension
<pipework> You mean you don't prototype in assembly?
<apeiros> uh, why are you asking about performance then?
<Xzyx987X> well, I want the ruby version to still be usable fast, if for some reason someone couldn't use the C extension version
nathanstitt has quit [Quit: I growing sleepy]
<pipework> Benchmark benchmark benchmark!
<apeiros> Xzyx987X: and a single pack/unpack is your bottleneck?
<apeiros> are you sure about that?
<Xzyx987X> one of them at least
<Xzyx987X> it adds like two seconds to the runtime of what I'm doing
<apeiros> and it is not just slow, but indeed *too* slow?
tunaCanBruh has quit [Ping timeout: 264 seconds]
<Xzyx987X> and my target is the whole thing should run in under one second
<lianj_> Xzyx987X: can you show a an example where the two seconds come from?
<Xzyx987X> the code I posted was the example...
__butch__ has quit [Quit: Leaving.]
<Xzyx987X> I would need to post my whole code to give any kind of context...
lytol has quit [Remote host closed the connection]
<lianj_> that doesn't show us how you get to i, maybe that can be done better
<apeiros> for the isolated problem "increment an integer stored as binary data in a string by 1", I don't think you'll get a faster solution than what you just pasted
<lianj_> ^-
<apeiros> so you either need to reframe the problem, or you'll probably be stuck
<Xzyx987X> okay, well I need to store data in a string so that in all cases except for an overflow "string < string.increment" and string must be a fixed length
<Xzyx987X> that is the most generalized desciption of the problem I could give
<apeiros> and if we should help with reframing, then I second what lianj_ said - show more of your actual problem
<apeiros> otherwise we're stuck with xy
<Xzyx987X> the problem is I'm trying to generate a unique id for a piece of data that will sort in the correct order and be incrementable without being too slow
<pipework> Yeah, let's jump to Z
<Xzyx987X> I can't think of any other way to do it
<apeiros> Xzyx987X: where comes incrementing into place?
<apeiros> your sequence?
<Xzyx987X> to generate the next id in the sequence
<apeiros> if so: why do you store your sequence in binary and don't keep it in ruby and only pack. never unpack.
<Xzyx987X> okay, so how do I get the next id?
<apeiros> you increment your sequence by one.
<apeiros> your sequence doesn't need to be in binary - or why would it?
dik_dak has joined #ruby-lang
<Xzyx987X> except I don't know what the last id was without unpacking the data right?
<Xzyx987X> how else would I know
<apeiros> why?
<Xzyx987X> because I can't cache it once it's strored
<apeiros> Xzyx987X: you know that you're still leaving us guessing about *tons* of your system, right?
<apeiros> why?
<apeiros> why can't you cache it once it's stored?
<Xzyx987X> right, which is why I just asked the simple version of the question in the first place...
<apeiros> yes, which makes it an xy problem.
roamingdog has joined #ruby-lang
<apeiros> and I fear the answer to your suggested solution is: no, there's no faster way (as I said previously)
<Xzyx987X> because all I really wanted to know is if there was a better way to do what I specifically wanted to do than write it myself
<Xzyx987X> if not, that's fine, but it would be difficult to explain why I choose to do things the way I did without showing you my whole project, so...
<apeiros> that's your decision
<apeiros> that may come off wrong. rephrased: ok :)
<lianj_> so to add two seconds for unpack/pack yu have to do a lot of them. and there must be a way where you can more efficiently unpack i or keep it cached so you only have to pack again
<apeiros> ^ +1
stamina has quit [Ping timeout: 245 seconds]
<apeiros> but they don't want to explain details, so…
setanta_ has quit [Quit: Leaving]
<Xzyx987X> I actually think there would be some merit though, in writing a libary that alows you to do math on data held in a string by specifying the format
<Xzyx987X> there are a lot of use cases you could really speed up
<Xzyx987X> or just a more efficient version of unpack even, that only works on single values
<apeiros> you rejected a C extension
<lianj_> and how would it do that. convert it into ints and convert it back
<apeiros> improvements to pack/unpack would probably be academic.
<Xzyx987X> only for my current project in it's current state, not to solve the problem in the general case
<apeiros> method call overhead is probably already larger than any overhead pack itself adds.
roamingdog has quit [Ping timeout: 252 seconds]
apt-get_ has joined #ruby-lang
<Xzyx987X> well, actually, I also compared the speed to to_s/to_i incrementing
<Xzyx987X> and it is also much slower than that
<Xzyx987X> just not by as much
<Xzyx987X> so there is significant room for optimization there
<apeiros> without having seen those tests, I rather doubt that claim
<apeiros> but hey
<Xzyx987X> one sec...
<apeiros> fork, optimize, PR
<apeiros> all the better if you can improve ruby
<pipework> So start by doing the dumb thing and then provide configurable options for optimizations one way or another, but guide it by benchmarking and profiling.
<pipework> If you can speed up the whole thing entirely, put that in the baes.
<Xzyx987X> here, see for yourself: http://pastie.org/9945238
bastilian has quit [Remote host closed the connection]
<lianj_> Xzyx987X: didn't you have to convert it to hex or bits first for to_i to work
bastilian has joined #ruby-lang
<Xzyx987X> I wasn't taking that into account in the test
<Xzyx987X> but in practice you would, yes
matp_ has quit [Remote host closed the connection]
<apeiros> Xzyx987X: use benchmark. you're measuring real time, not cpu time.
sarkyniin has quit [Ping timeout: 245 seconds]
<apeiros> and which one was now slower than which one?
<apeiros> also you compared Fixnum vs. Bignum
<apeiros> you should probably compare same with same
matp has joined #ruby-lang
<Xzyx987X> the pack/unpack speed was the slowest by far
<apeiros> yes, as said, comparing apples and oranges
<Xzyx987X> but anyway, no offense, but I really don't want to debate whether the problem needs to be solved
Iskarlar has joined #ruby-lang
<apeiros> I'm not offended
<apeiros> and I'm not sure what gave you that impression
<Xzyx987X> I'm just going to write a binary string increment method and hopefully that will be fast enough
saltsa has quit [Ping timeout: 264 seconds]
* lianj_ doubts it
<apeiros> I doubt it too that you'll be able to do something faster than unpack/pack in pure ruby which is also correct
<apeiros> but as said before: go ahead. I'm curious.
Iskarlar has quit [Ping timeout: 246 seconds]
Musashi007 has joined #ruby-lang
saltsa has joined #ruby-lang
amsi has joined #ruby-lang
Fooster has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
nathanstitt has joined #ruby-lang
<Xzyx987X> here, not as fast as I'd like, but about 4 times as fast as pack/unpack: http://pastie.org/9945263
<Xzyx987X> at least for this particular case
|jemc| has joined #ruby-lang
<Xzyx987X> oh wait, I didn't check for overflow correctly...
<apeiros> I also suggest you test different cases than optimal case (no carry)
<apeiros> but kudos for actually implementing it
nic77 has joined #ruby-lang
nic77 has quit [Excess Flood]
nic77 has joined #ruby-lang
<Xzyx987X> also, it should be >255 instead of == 0 on the carry check
nic77 has quit [Excess Flood]
<Xzyx987X> but that has a negligible impact on speed anyway
nic77 has joined #ruby-lang
Mr0rris0 has quit [Ping timeout: 256 seconds]
diegoviola has joined #ruby-lang
stamina has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
<apeiros> Xzyx987X: can you gist the updated version? even after replacing ==0 with >255, your method seems to be broken (wanted to bench it)
roamingdog has joined #ruby-lang
centrx has quit [Quit: Shutting down, Please wait...]
<apeiros> with the broken method, yours is 2x faster in the optimal case, about equal in the worst case. but given that the optimal case is 255x more likely than the worst case, that's quite a good result
Lewix has joined #ruby-lang
<Xzyx987X> I thought so...
shazaum has quit [Quit: This computer has gone to sleep]
<apeiros> yupp, that one seems more correct. so congrats, 2x performance improvement there.
<Xzyx987X> yay, though it's still much slower than C would be
<apeiros> of course :)
<apeiros> there it'd just be a cast
<Xzyx987X> but my plan is to just release what I am doing and see if it generates interest
<apeiros> and to a native sized int in all likeliness too
<Xzyx987X> and if it does, optimise it with a full port to C
<Xzyx987X> it's already "fast enough" for many purposes
ldnunes has quit [Quit: Leaving]
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
b_hoffman has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
rbpd5015 has joined #ruby-lang
<rbpd5015> hey guys
isale-eko has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
timanema has joined #ruby-lang
lytol has joined #ruby-lang
guillaume-rb has quit [Quit: guillaume-rb]
diegoviola has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
bastilian has quit [Ping timeout: 245 seconds]
tunaCanBruh has quit [Ping timeout: 246 seconds]
tunaCanBruh has joined #ruby-lang
Musashi007 has quit [Quit: Musashi007]
Goodbeard has joined #ruby-lang
<Goodbeard> Hello all!
skade has joined #ruby-lang
micmus has joined #ruby-lang
yfeldblum has joined #ruby-lang
araujo has quit [Quit: Leaving]
kyb3r_ has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
riotjones has joined #ruby-lang
b_hoffman has quit [Quit: b_hoffman]
SumoBoy has joined #ruby-lang
bantic has quit [Quit: bantic]
riotjones has quit [Ping timeout: 264 seconds]
rbpd5015 has quit [Ping timeout: 246 seconds]
Goodbeard has quit [Quit: Leaving]
jgpawletko has quit [Quit: jgpawletko]
Integralist has joined #ruby-lang
Integralist has quit [Ping timeout: 246 seconds]
bantic has joined #ruby-lang
japaniel has joined #ruby-lang
wallerdev has joined #ruby-lang
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Antivan has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
tcopeland has quit [Ping timeout: 240 seconds]
SumoBoy has quit [Quit: Leaving]
Musashi007 has joined #ruby-lang
mustmodify has joined #ruby-lang
jds has quit [Quit: Connection closed for inactivity]
charliesome has joined #ruby-lang
stamina has quit [Quit: WeeChat 1.1.1]
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
duderonomy has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
tunaCanBruh has quit [Ping timeout: 245 seconds]
donovan has joined #ruby-lang
donovan has left #ruby-lang [#ruby-lang]
donovan has joined #ruby-lang
Musashi007 has quit [Quit: Musashi007]
AKASkip has quit [Ping timeout: 245 seconds]
ironhide_604 has quit [Ping timeout: 244 seconds]
tunaCanBruh has joined #ruby-lang
lytol has quit [Remote host closed the connection]
elia has joined #ruby-lang
Musashi007 has joined #ruby-lang
lytol_ has joined #ruby-lang
Integralist has joined #ruby-lang
oleo is now known as Guest6438
oleo__ has joined #ruby-lang
Guest6438 has quit [Ping timeout: 256 seconds]
Integralist has quit [Ping timeout: 255 seconds]
duderonomy has quit [Ping timeout: 264 seconds]
roamingdog has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
fusillicode1 has quit [Quit: Leaving.]
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
havenwood has joined #ruby-lang
Fooster has quit [Remote host closed the connection]
riotjones has joined #ruby-lang
raggedjack has joined #ruby-lang
raggedjack has quit [Client Quit]
lytol_ has quit [Remote host closed the connection]
mustmodify has left #ruby-lang [#ruby-lang]
riotjones has quit [Ping timeout: 256 seconds]
whippythellama has quit [Quit: whippythellama]
nofxx has quit [Ping timeout: 245 seconds]
tcopeland has joined #ruby-lang
ur5us has joined #ruby-lang
kyb3r_ has quit [Quit: Leaving]
apt-get_ has quit [Remote host closed the connection]
tunaCanBruh has quit [Ping timeout: 240 seconds]
mkaesz has joined #ruby-lang
donovan has quit [Quit: MOM! HANG UP THE PHON^*&$%*!@#... NO CARRIER]
DarkBushido has quit [Ping timeout: 245 seconds]
roamingdog has joined #ruby-lang
DarkBushido has joined #ruby-lang
AlxAlt has quit [Read error: Connection reset by peer]
AlxAlt has joined #ruby-lang
brooks has joined #ruby-lang
guillaume-rb has joined #ruby-lang
guillaume-rb has quit [Client Quit]
Lewix has joined #ruby-lang
Musashi007 has quit [Quit: Musashi007]
Musashi007 has joined #ruby-lang
guillaume-rb has joined #ruby-lang
gwendall has quit [Remote host closed the connection]
guillaume-rb has quit [Client Quit]
roamingdog has quit [Remote host closed the connection]
mkaesz has quit [Remote host closed the connection]
japaniel has quit [Remote host closed the connection]
postmodern has joined #ruby-lang
roamingdog has joined #ruby-lang
terpo has joined #ruby-lang