apeiros changed the topic of #ruby to: Ruby 2.1.5; 2.0.0-p598; 1.9.3-p551: http://ruby-lang.org || Paste >3 lines of text on http://gist.github.com || this channel is logged at http://irclog.whitequark.org, other public logging is prohibited
<jhass> if you know that then you shouldn't have a problem
ohaibbq has quit [Ping timeout: 256 seconds]
<jhass> >> puts "q3"
<eval-in__> jhass => q3 ... (https://eval.in/236051)
Smujo_ has quit [Ping timeout: 256 seconds]
<jhass> "q3" is the representation of the string containing the character q followed by the character 3
mwlang has quit [Quit: mwlang]
_gautam_ has joined #ruby
<lampd1> puts just echoes to console though... right
<jhass> .inspect returns that presentation as a string, it's used by various places to show you the string
<lampd1> how does that help me pass it to an argument
JokerDoom has quit [Ping timeout: 264 seconds]
valeriansaliou has quit [Quit: Be back later ...]
<jhass> def foo(s) puts s; end; foo("q3")
<jhass> >> def foo(s) puts s; end; foo("q3")
<eval-in__> jhass => q3 ... (https://eval.in/236056)
dts|pokeball has joined #ruby
<jhass> >> puts "q3".inspect
<eval-in__> jhass => "q3" ... (https://eval.in/236057)
<jhass> >> "q3".inspect
<eval-in__> jhass => "\"q3\"" (https://eval.in/236058)
chipotle has joined #ruby
davedev24_ has joined #ruby
<jhass> >> "q3".inspect == '"q3"'
<eval-in__> jhass => true (https://eval.in/236060)
<jhass> you maybe should start your ruby tutorial at the beginning again if that already confuses you ;)
<lampd1> it doesn't
<lampd1> i just expected the string class to be able to easily handle it
<lampd1> because it's freaking huge
valeriansaliou has joined #ruby
<jhass> your completely misinterpreting your problem there
<jhass> *you're
davedev24_ has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
<lampd1> heh
<lampd1> not really
<jhass> the quotes aren't part of the string, they are part of its representation
davedev24_ has joined #ruby
<jhass> >> def foo(s); s.size; end; foo("q3")
<eval-in__> jhass => 2 (https://eval.in/236062)
<jhass> not 4
reinaldob has joined #ruby
robustus has quit [Ping timeout: 255 seconds]
Beoran_ has joined #ruby
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
duncannz has joined #ruby
studiotate has quit [Quit: Computer has gone to sleep.]
robustus|Off has joined #ruby
robustus|Off is now known as robustus
valeriansaliou has quit [Ping timeout: 272 seconds]
Beoran__ has quit [Ping timeout: 250 seconds]
adriancb has quit [Remote host closed the connection]
renderful has quit [Remote host closed the connection]
adriancb has joined #ruby
djdarkbeat has quit [Quit: djdarkbeat]
<rubyonrailed> How do I compare two hashes that have the same keys but different valuse. I wan't to return a hash that just has keys and values that are different than the original?
agjacome has quit [Ping timeout: 264 seconds]
tootsieroll has joined #ruby
jaffachief has quit [Ping timeout: 245 seconds]
DrCode has quit [Ping timeout: 250 seconds]
lostcat has quit [Ping timeout: 272 seconds]
<jhass> other.select {|key, value| original[key] != value }
tekacs has quit [Ping timeout: 264 seconds]
Fusl has quit [Ping timeout: 245 seconds]
pygospa has quit [Ping timeout: 245 seconds]
adriancb has quit [Ping timeout: 265 seconds]
qz has quit [Ping timeout: 240 seconds]
qz has joined #ruby
qz has quit [Changing host]
qz has joined #ruby
fearoffish has quit [Ping timeout: 245 seconds]
reinaldob has quit [Remote host closed the connection]
<lampd1> jhass i don't think i'm misinterpreting i think that i'm just running into a cornucopia of problems ;)
Rydekull has quit [Ping timeout: 240 seconds]
jbw has quit [Ping timeout: 245 seconds]
Rydekull has joined #ruby
DrCode has joined #ruby
pygospa has joined #ruby
jbw has joined #ruby
Menorah has joined #ruby
Snowstormer has joined #ruby
Fusl has joined #ruby
tootsieroll is now known as cooldude13233__
<jhass> lampd1: If your expectation is that if you write foo = "q3"; bar(foo); there's a way to strip "the quotes while passing foo as argument", you are
<rubyonrailed> jhass: THanks
tekacs has joined #ruby
tekacs is now known as Guest19180
jaffachief has joined #ruby
cooldude13233__ has quit [Client Quit]
<lampd1> okay - another question jhass
<jhass> rubyonrailed: might need to be wrapped into a Hash[], depending on your Ruby version
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<rubyonrailed> jhass: Your solution worked great
<lampd1> how can i string together an argument with a variable that is a symbol?
fearoffish has joined #ruby
<jhass> sounds like you're using symbols wrongly, but there are many ways to do that since Symbol#to_s does pretty much what you expect
<jhass> "foo #{:bar}" works since #{} calls to_s
<jhass> [:foo, :bar].join works since join calls to_s
<jhass> "foo" << :bar.to_s works
<jhass> "foo" + :bar.to_s works
<lampd1> i made sure to preface with "noob question" ;)
chrisja has quit [Quit: leaving]
<jhass> note that if you want good answers it often helps to describe your actual problem, not the solutions you think you need
Sawbones has quit []
sailias has quit [Quit: Leaving.]
Cache_Money has quit [Quit: Cache_Money]
sailias has joined #ruby
sailias has quit [Client Quit]
cesarstafe has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
sevvie has quit [Read error: Connection reset by peer]
bmichelsen has joined #ruby
boombadaroomba has quit []
dseitz has joined #ruby
LouisRoR has quit [Ping timeout: 258 seconds]
<lampd1> yeah, i think right now jhass i'm just more interested in limitations than getting it working ;)
<lampd1> going to step back and try something else
bmichelsen has quit [Client Quit]
lucyinthesky has joined #ruby
lucyinthesky has left #ruby ["Mensagem"]
rudisimo has quit [Remote host closed the connection]
<zenspider> lampd1: way to shit on free help.
freerobby has joined #ruby
sevvie has joined #ruby
rudisimo has joined #ruby
<lampd1> zenspider: i fail to see how i shat on free help
mengu has quit [Ping timeout: 255 seconds]
<zenspider> I bet
<lampd1> maybe you could step down from your high horse and enlighten me
thumpba has quit [Ping timeout: 272 seconds]
baroquebobcat has joined #ruby
<zenspider> funny
rshetty has joined #ruby
pengin has quit [Remote host closed the connection]
gccostabr has joined #ruby
gccostabr has quit [Client Quit]
sambao21 has quit [Quit: Computer has gone to sleep.]
pengin has joined #ruby
rudisimo has quit [Ping timeout: 264 seconds]
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jeff-ooh has quit [Remote host closed the connection]
ItSANgo has quit [Quit: Leaving...]
it0a has joined #ruby
shuber_ has quit [Remote host closed the connection]
rshetty has quit [Ping timeout: 264 seconds]
pengin has quit [Ping timeout: 264 seconds]
chu has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
oo_ has joined #ruby
<wasamasa> is this still about strings supposedly having quotes in them just because that's the way their literals are specified and printed out by p?
<wasamasa> >> s="hax"; "value => #{s}"
<eval-in__> wasamasa => "value => hax" (https://eval.in/236072)
<jhass> sort of
<jhass> though it moved on the metalevel now I guess
jerius has joined #ruby
<wasamasa> as you can see, that's just a representation that's convenient for ruby to be read in
<wasamasa> and not part of the string, embedding it into another one for instance works as expcted
jerius has quit [Client Quit]
chrishough has joined #ruby
dseitz has joined #ruby
<jhass> lampd1: if people think you misbehaved and especially if they seem to easily think that, and you want to find out why they think so, the trick is to apologize even if you don't understand what for, again especially if they're rude, you need to hide your own hurt feelings and play nice, in case you want to find out
divi has joined #ruby
<lampd1> jhass: if you had given me cause to think i had misbehaved i would have apologized
<lampd1> someone chiming in simply to say i'm shitting on free help isn't getting anything in the way of a nice response :)
<jhass> my guess why zenspider thinks you did is because you don't seem to value the time invested into you by abandoning the thing you don't understand
Channel6 has quit [Quit: Leaving]
karmatr0n has quit [Remote host closed the connection]
<lampd1> im not abandoning it, i'm trying to understand it at more of a base level
<jhass> lampd1: my point is that if you do want to find out why they react that why you do need to hide your own hurt feelings, responding the same way will only escalate
rubie has joined #ruby
<jhass> *that way
<lampd1> hence why I haven't responded to him again :)
<jhass> yeah, the first response counts anyway
Aova has joined #ruby
Aova has quit [Changing host]
<lampd1> either way, thanks for the help jhass - i think i just need to work on grokking ruby data types and basic constraints :)
<jhass> ;)
<jhass> especially the thing stuff is not at all limited to ruby btw
<jhass> basically all languages handle literals and data representation the same way
<lampd1> well, right now i'm looking at YAML as being more of an issue what what I want to do
<jhass> gah
<jhass> *string stuff
<wasamasa> lampd1: do you even read what other people write?
<rubie> hi all: im trying to make a checkers game, each checker is an instance of the Checker class. When a checker is initialized its position on the board is set. However I can't find a way to update the update the objects state if the player decides to move it...any suggestions? Here's what I have so far https://gist.github.com/gabrie30/dd7810e17bd02d0775bc
<waxjar> lampd1: show us some code, what you expect as a result and what you actually get as a result :)
<waxjar> frankly, I have no idea what your question is
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
n80 has joined #ruby
<lampd1> how about we just keep it that way and forget I ever asked a question
<lampd1> and yes wasamasa I do
ponga has joined #ruby
maestrojed has quit [Quit: Computer has gone to sleep.]
<zenspider> rubie: attr_accessor makes position and position= methods
<wasamasa> lampd1: then why do you waste time arguing over being butthurt instead of discussing your actual issue?
<lampd1> uhh, I'm not?
<waxjar> lampd1: don't be like that, we can help
baroquebobcat_ has joined #ruby
divi has quit [Ping timeout: 265 seconds]
baroquebobcat has quit [Read error: Connection reset by peer]
baroquebobcat_ is now known as baroquebobcat
<waxjar> you're question is just a bit vague right now
<waxjar> *your
<lampd1> perhaps I'll put it into a replicable format tomorrow, but am over it right now :)
<jhass> rubie: and while you're approaching the OOP way, try to replace your global variable with a Board class
<lampd1> thanks though waxjar
divi has joined #ruby
<rubie> zenspider: yes but I can't figure a way to turn the users input something that will say "hey this checker object is on this square, and its going to that square, so let me update its state"
davedev2_ has joined #ruby
CrazyM4n has quit [Quit: restarting]
davedev24_ has quit [Ping timeout: 258 seconds]
<jhass> rubie: right now you're duplicating your data basically, you save the position in Checkers instances as well as in $piece_position
ponga has quit [Ping timeout: 256 seconds]
<jhass> rubie: if you try to think of a design that doesn't include that duplication, that question should resolve quite naturally
dredozub- is now known as dredozubov
<rubie> ya your right. but thats because i use the hash to populate the board
<rubie> is there a way to take the data from an object and get it on the board?
<zenspider> rubie: ... what jhass said... he was faster. :)
MrIlyas has quit [Read error: Connection reset by peer]
ghostmoth has joined #ruby
<godd2> rubie you can always pass a hash to a method
sea_local has quit [Remote host closed the connection]
sailias has joined #ruby
<jhass> rubie: keep in mind arrays and hashes can contain arbitrary objects, your own too
giuseppesolinas has quit [Quit: This computer has gone to sleep]
CrazyM4n has joined #ruby
<rubie> so store the objects in an array?
<jhass> for example, depends on how exactly you want to model your board
<rubie> or a hash would be better
<jhass> one or two dimensional arrays to model a square of fields is not uncommon
cesarstafe has quit [Ping timeout: 240 seconds]
ChoiKyuSang has quit [Quit: Going offline, see ya! (www.adiirc.com]
davedev2_ has quit [Read error: Connection reset by peer]
davedev24_ has joined #ruby
Neomex_ has quit [Read error: Connection reset by peer]
<rubie> two dimentional array is a good idea
MartynKeigher has joined #ruby
<rubie> i'll play around with that
meatchicken has quit [Quit: Page closed]
russt has quit [Quit: russt]
triple_b has joined #ruby
procat has joined #ruby
bmichelsen has joined #ruby
s00pcan has quit [Ping timeout: 256 seconds]
olivier_bK has quit [Ping timeout: 272 seconds]
tokik has joined #ruby
giuseppesolinas has joined #ruby
pietr0 has quit [Quit: pietr0]
divi has quit [Ping timeout: 245 seconds]
s00pcan has joined #ruby
econerd4ever has quit [Remote host closed the connection]
procat has quit [Ping timeout: 255 seconds]
n80 has quit [Quit: n80]
econerd4ever has joined #ruby
jtdoncas has joined #ruby
enebo has quit [Quit: enebo]
econerd4ever has quit [Ping timeout: 258 seconds]
benweint has quit [Quit: Computer has gone to sleep.]
n80 has joined #ruby
econerd4ever has joined #ruby
sailias has quit [Quit: Leaving.]
sailias has joined #ruby
reinaldob has joined #ruby
kalz has quit [Quit: exit]
tenderlove has quit [Remote host closed the connection]
baroquebobcat has quit [Read error: Connection reset by peer]
baroquebobcat has joined #ruby
kevinxu has joined #ruby
testcore has joined #ruby
kevinxu is now known as Guest98205
josephndenton has joined #ruby
reinaldob has quit [Ping timeout: 264 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
gregf has quit [Ping timeout: 250 seconds]
mjmac has quit [Ping timeout: 258 seconds]
pu22l3r has joined #ruby
dc_ has quit []
tkuchiki has joined #ruby
rockdon has quit [Ping timeout: 258 seconds]
kenneth has joined #ruby
josephndenton has quit [Ping timeout: 258 seconds]
josephndenton has joined #ruby
dc_ has joined #ruby
rubie has quit [Ping timeout: 246 seconds]
fabrice31 has joined #ruby
sevvie has quit [Quit: leaving]
mgberlin has joined #ruby
lampd1 has quit []
giuseppesolinas has joined #ruby
josephndenton has quit [Ping timeout: 265 seconds]
marr has quit [Ping timeout: 258 seconds]
fabrice31 has quit [Ping timeout: 245 seconds]
sailias has quit [Quit: Leaving.]
baroquebobcat has quit [Quit: baroquebobcat]
kenneth has quit [Ping timeout: 245 seconds]
_reset has joined #ruby
pu22l3r has quit [Remote host closed the connection]
kalz has joined #ruby
ghostmoth has quit [Quit: ghostmoth]
kenneth has joined #ruby
reset has quit [Ping timeout: 245 seconds]
rockdon has joined #ruby
mjmac has joined #ruby
_reset has quit [Ping timeout: 245 seconds]
ChoiKyuSang has joined #ruby
devoldmx has quit [Remote host closed the connection]
fmcgeough has quit [Quit: fmcgeough]
duncannz has quit [Quit: Leaving]
uptownhr has quit [Quit: Page closed]
Avon has joined #ruby
momomomomo has quit [Quit: momomomomo]
konsolebox has joined #ruby
ItSANgo has joined #ruby
robustus has quit [Ping timeout: 250 seconds]
yfeldblum has joined #ruby
Musashi007 has joined #ruby
robustus has joined #ruby
yfeldblu_ has joined #ruby
rshetty has joined #ruby
eka has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wjimenez5271 has quit [Remote host closed the connection]
narph has quit [Quit: Connection closed for inactivity]
wjimenez5271 has joined #ruby
oo_ has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 258 seconds]
arescorpio has joined #ruby
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
valeriansaliou has joined #ruby
ponga has joined #ruby
yfeldblu_ has quit [Ping timeout: 255 seconds]
Menorah has quit [Quit: This computer has gone to sleep]
mroach has joined #ruby
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wjimenez5271 has quit [Ping timeout: 245 seconds]
baroquebobcat has joined #ruby
baroquebobcat has quit [Client Quit]
gsd_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rshetty has quit [Remote host closed the connection]
ponga has quit [Ping timeout: 264 seconds]
Menorah has joined #ruby
valeriansaliou has quit [Ping timeout: 265 seconds]
roolo has joined #ruby
eka has joined #ruby
oo_ has joined #ruby
roolo has quit [Ping timeout: 264 seconds]
TgMts has quit [Ping timeout: 258 seconds]
krz has joined #ruby
koderok has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
entrenador has joined #ruby
n80 has quit [Quit: n80]
giuseppesolinas has joined #ruby
vanderh0ff has quit [Remote host closed the connection]
conniemj has quit [Quit: (null)]
renderful has joined #ruby
yfeldblum has joined #ruby
rshetty has joined #ruby
davedev2_ has joined #ruby
davedev24_ has quit [Ping timeout: 244 seconds]
joshbamboo2 has quit [Quit: Leaving]
claptor has joined #ruby
triple_b has joined #ruby
renderful has quit [Ping timeout: 244 seconds]
Troy^ has quit [Read error: Connection reset by peer]
Menorah has quit [Quit: This computer has gone to sleep]
koderok has quit [Quit: koderok]
jenrzzz has quit [Ping timeout: 256 seconds]
rubyonrailed has quit [Remote host closed the connection]
amclain has joined #ruby
tyfighter has quit [Quit: tyfighter]
BTRE has quit [Quit: Leaving]
Menorah has joined #ruby
Menorah has quit [Max SendQ exceeded]
Menorah has joined #ruby
hamakn has joined #ruby
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Takle has quit [Remote host closed the connection]
AndroUser466 has joined #ruby
dkphenom has joined #ruby
djbkd has quit [Quit: My people need me...]
Avon has left #ruby ["(null)"]
bricker`work has quit [Ping timeout: 245 seconds]
n_blownapart has joined #ruby
Techguy305|2 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
studiotate has joined #ruby
havenwood has joined #ruby
jhass has quit [Read error: Connection reset by peer]
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
n80 has joined #ruby
mloveless has quit [Remote host closed the connection]
MrSamuel has quit [Remote host closed the connection]
jhass has joined #ruby
mordof has joined #ruby
gsd has joined #ruby
karmatr0n has joined #ruby
melik has quit [Quit: (null)]
<n_blownapart> hi could someone please tell me why the accumulator on line 28 returns nil? I should be getting 1050. I hope my end statements are correct. this is a koan I've been working on for ages. thanks : http://pastie.org/9787401
jenrzzz has joined #ruby
dideler has joined #ruby
sizzzle has joined #ruby
entrenador has quit [Quit: Textual IRC Client: www.textualapp.com]
sizzzle has quit [Excess Flood]
n80 has quit [Quit: n80]
mordof has quit [Quit: WeeChat 0.4.2]
Guest19180 is now known as tekacs
<fernandolopez> n_blownapart is it safe to modify a hash while you iterate it with each?
<fernandolopez> try maybe to modify it before with map
tekacs is now known as Guest73815
<fernandolopez> and then iterate with each and do the rest
<n_blownapart> y
<jhass> n_blownapart: your indentation surely is off
<n_blownapart> thanks fernandolopez could you elaborate on the exact line you are referring to?
<jhass> start by fixing your indentation
<fernandolopez> n_blownapart line 8
<n_blownapart> jhass the end statement on 27 is for the beginning of the block, correct?
rshetty has quit [Remote host closed the connection]
<jhass> fix your indentation and then it gets obvious. Also you do h[k] = v.size then you do and then if h[k] == 1 and inside if v.size >= 3, the last condition will never be true
<jhass> if h[k] == 5 is inside if h[k] == 1, so can't get true either
<jhass> if v.size >= 1 is inside if h[k] == 5, so if the later could get true the former will always be true
<n_blownapart> jhass thanks very much . I am processing that. thanks fernandolopez
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<n_blownapart> I need some pointers as to why the if/else/end statements are not indented properly. jhass
<jhass> they just aren't
<jhass> the whole code isn't
gsd has joined #ruby
<jhass> starts on line 8
<jhass> suddenly indented
<jhass> for no reason
<jhass> actually starts on line 2, with missing indentation
sarmiena_ has quit [Quit: sarmiena_]
<n_blownapart> ok so I'm pulling everything back starting at line 8 and indented line 2.
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rylev has joined #ruby
gsd has quit [Client Quit]
lizhaoxian has joined #ruby
procat has joined #ruby
ponga has joined #ruby
patrick99e99 has quit [Ping timeout: 240 seconds]
patrick99e99 has joined #ruby
<jhass> so that code shouldn't even compile
axilla has quit [Ping timeout: 264 seconds]
<jhass> there's an end too much
<jhass> did you extract that from some larger stuff, like a class?
razieliyo has quit [Ping timeout: 265 seconds]
<jhass> your issue is that your indentation is so messed up, you don't even notice anymore what's part of your method, what's part of your if and what's not
mloveless has joined #ruby
sea_local has joined #ruby
<jhass> go to github now, open a random ruby project, read through it, pay attention to how you indent ruby code
<n_blownapart> no jhass , I wrote it based on similar programs and from what I could gather here. hold on, it was compiling ..
procat has quit [Ping timeout: 258 seconds]
ponga has quit [Ping timeout: 245 seconds]
<jhass> ah wait, one of your single space indents fucked me in correctly indenting it
dc_ has quit [Remote host closed the connection]
jlast has joined #ruby
<n_blownapart> sorry jhass I cleaned it up a bit....coming
behrz has joined #ruby
Menorah has quit [Quit: This computer has gone to sleep]
tyll has joined #ruby
<n_blownapart> http://pastie.org/9787410 ^^
jxf has quit [Ping timeout: 264 seconds]
Channel6 has joined #ruby
kobain has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<jhass> that's still totally incorrect
rshetty has joined #ruby
<n_blownapart> jhass, do you mean the indentation only?
tyll_ has quit [Ping timeout: 264 seconds]
<n_blownapart> or the logic statements?
<jhass> I still think that's your major issue in not being able to understand what your own code's doing, but no. Here's the correctly indented version with some hints added http://paste.mrzyx.de/pwyw4ia5p
<jhass> also added a debug print statement that explains why you get nil
<jhass> >> [].reduce(:+)
<eval-in__> jhass => nil (https://eval.in/236075)
triple_b has joined #ruby
<n_blownapart> *really* appreciate it jhass ... working on it.
AmirolAhmad has joined #ruby
wallerdev has quit [Quit: wallerdev]
lizhaoxian is now known as lzx
CpuID has joined #ruby
rylev has quit [Remote host closed the connection]
mloveless has quit [Remote host closed the connection]
jack_rabbit has joined #ruby
AmirolAhmad has quit [Remote host closed the connection]
karmatr0n has quit []
econerd4ever has quit [Remote host closed the connection]
econerd4ever has joined #ruby
Menorah has joined #ruby
rshetty has quit [Remote host closed the connection]
AmirolAhmad has joined #ruby
commmmodo has quit [Quit: commmmodo]
dc_ has joined #ruby
econerd4ever has quit [Ping timeout: 255 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
avrc has joined #ruby
fabrice31 has joined #ruby
Techguy305 has joined #ruby
Techguy305 has quit [Max SendQ exceeded]
Techguy305 has joined #ruby
Davey has quit [Quit: afk]
commmmodo has joined #ruby
econerd4ever has joined #ruby
fabrice31 has quit [Ping timeout: 272 seconds]
mjmac has quit [Ping timeout: 258 seconds]
o010n9 has joined #ruby
radic has quit [Ping timeout: 245 seconds]
rockdon has quit [Ping timeout: 258 seconds]
Davey has joined #ruby
radic has joined #ruby
wjimenez5271 has joined #ruby
Davey has quit [Remote host closed the connection]
rockdon has joined #ruby
mjmac has joined #ruby
ChoiKyuSang has quit [Quit: Going offline, see ya! (www.adiirc.com]
ponga has joined #ruby
Davey has joined #ruby
<n_blownapart> jhass in this code h[k] = 1 is the die 1 being rolled, and v.size >= 3 is the minimum requirement to score 1000 (three ones score 1000) so lines 11 and 12 would score 1000, correct? http://paste.mrzyx.de/pwyw4ia5p
<jhass> this is your code
<jhass> unchanged
<jhass> just reformatted and comments added
<jhass> I'm unable to guess any of the original requirements from it
ChoiKyuSang has joined #ruby
<n_blownapart> very sorry. three rolls of a 'one' score 1000. any 'five' rolled scores 50 each. jhass
<jhass> I only showed in the comments that the if on line 12 already can never be fulfilled
commmmodo has quit [Quit: commmmodo]
<jhass> n_blownapart: explain what's line 8 is doing
arup_r has joined #ruby
<jhass> -'s
<n_blownapart> but {1=>4, 5=>1} means that four ones were rolled, so that fulfills the minimum requirement of three ones scoring 1000
<jhass> I'm not even arguing with what possibly could be in the hash there
gsd has joined #ruby
gsd has quit [Max SendQ exceeded]
<jhass> try answering my question
gsd has joined #ruby
<n_blownapart> ok, not arguing here. working on it jhass
iamninja has joined #ruby
ponga has quit [Remote host closed the connection]
<n_blownapart> line 8 takes the new hash created by #group_by and returns a hash which puts the die number (1 and 5) and counts the number of times each die was thrown.
<n_blownapart> jhass, ^
<jhass> nope
ponga has joined #ruby
<n_blownapart> uh oh..
oo_ has quit [Remote host closed the connection]
<jhass> it doesn't return a new hash
<jhass> or return a hash at all
<jhass> and if it would, where would you assign it to?
<n_blownapart> no wonder. so {1=>4, 5=>1} does not reflect the dice thrown and the number of times the dice were thrown?
<jhass> point is
<jhass> h[k] == v.size after that line
yakko has quit []
yfeldblum has quit [Ping timeout: 264 seconds]
<jhass> so (h[k] == 1 && v.size >= 1) == (h[k] == 1 && h[k] >= 3) == (v.size == 1 && v.size >= 3) == false
<jhass> very basic boolean logic
ajaiswal has joined #ruby
<godd2> shevy Dare is now at 0.2.0 and I have a nice tutorial for making a game: https://github.com/nicklink483/dare/wiki/Ruby-Tutorial
<jhass> I vaguely remember that exercise. What was it? A kata? Or a koan?
<n_blownapart> koan .. jhass hold on.
<jhass> what's its name?
ponga has quit [Quit: Leaving...]
valeriansaliou has joined #ruby
Guest98205 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
psyprus has quit [Ping timeout: 258 seconds]
<n_blownapart> its called jhass its called about_scoring_project.rb
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<n_blownapart> so I think I see. the statement if 'h[k] == 1' does not set the key (the die "1") . 1 here is actually the value (the number of rolls.)
<n_blownapart> jhass,
wookiehangover has quit [Ping timeout: 258 seconds]
<jhass> it does not set anything
<jhass> maybe start by using proper variable names
psyprus has joined #ruby
kapil__ has joined #ruby
<jhass> like rolls, number, dice and so on
deric_skibotn has quit [Ping timeout: 250 seconds]
valeriansaliou has quit [Ping timeout: 244 seconds]
Wolland has joined #ruby
uber_hulk has joined #ruby
<jhass> or even get extremely verbose like number_of_times_die_was_rolled for your hash
<jhass> you seem to be confused about your own code and what is what
<jhass> properly describing that in code helps
<n_blownapart> ok, will do, but I thought that h[k] == 1 would satisfy the conditional, since the key is '1'
<jhass> explain what h[k] does
<jhass> and h[k] == 1 is a conditional
<jhass> a conditional does not satisfy a conditional
<jhass> a value does
s00pcan has quit [Remote host closed the connection]
wookiehangover has joined #ruby
dkphenom has joined #ruby
<jhass> also think more about what h[k] does
<jhass> there again, using proper variable names will properly help
<jhass> *probably
<n_blownapart> from line 7 and 8 we get this: {1=>4, 5=>1} ...
Takle has joined #ruby
wjimenez5271 has quit []
<n_blownapart> so in this statement if h[k] == 1 , the right side of the == is the value, is this case 4
wjimenez5271 has joined #ruby
<n_blownapart> jhass, ^^ right?
<jhass> yes
<jhass> what's v.size?
<jhass> again, v is a bad name, it should include the answer to that question already
mengu has joined #ruby
<n_blownapart> that is the value of the k/v pair, so really I don't need two if statements
russt has joined #ruby
<n_blownapart> ok so its just 'if throws[die] >= number_of_throws jhass
freerobby has quit [Quit: Leaving.]
<n_blownapart> correction ..
Wolland has quit []
Takle has quit [Ping timeout: 240 seconds]
rshetty has joined #ruby
Menorah has quit [Quit: This computer has gone to sleep]
commmmodo has joined #ruby
mengu has quit [Ping timeout: 245 seconds]
<n_blownapart> without the name changes: 'if h[1] >= 3'; count << 1000
melik has joined #ruby
<n_blownapart> jhass, ^
<jhass> I'm not going to solve it for you ;)
Trynemjoel has quit [Quit: Quitting]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lemur has joined #ruby
gsd has joined #ruby
hamakn_ has joined #ruby
hamakn has quit [Read error: Connection reset by peer]
avrc has quit [Quit: this channel is bakas]
braincrash has quit [Quit: bye bye]
<n_blownapart> jhass, weird, I'm getting [1000, 1000] accum = 2000 ! well I'm getting there.! thanks
Trynemjoel has joined #ruby
wjimenez5271 has quit []
zorak8 has joined #ruby
<n_blownapart> jhass, weird, I'm getting [1000, 1000] accum = 2000 ! well I'm getting there.! thanks
SpikeMaster has joined #ruby
<n_blownapart> oops
St_Marx has quit [Ping timeout: 250 seconds]
oo_ has joined #ruby
yfeldblum has joined #ruby
greenbagels__ has quit [Read error: Connection reset by peer]
SpikeMaster has quit [Remote host closed the connection]
braincrash has joined #ruby
n80 has joined #ruby
sarmiena_ has joined #ruby
Musashi007 has quit [Quit: Musashi007]
kosmonaut has left #ruby [#ruby]
uber_hulk has quit [Ping timeout: 245 seconds]
kevinxu has joined #ruby
<n_blownapart> jhass, thanks for your patience: if h[1] && v.size >= 3; count << 1000
kevinxu is now known as Guest40696
oo_ has quit [Ping timeout: 264 seconds]
renderful has joined #ruby
yfeldblum has quit [Ping timeout: 264 seconds]
Techguy305|2 has joined #ruby
charliesome has quit [Quit: zzz]
Techguy305 has quit [Ping timeout: 240 seconds]
echevemaster has quit [Ping timeout: 245 seconds]
commmmodo has quit [Quit: commmmodo]
greenbagels has joined #ruby
renderful has quit [Ping timeout: 255 seconds]
commmmodo has joined #ruby
echevemaster has joined #ruby
St_Marx has joined #ruby
arup_r has quit [Quit: Leaving.]
arup_r has joined #ruby
hamakn_ has quit [Ping timeout: 255 seconds]
zorak8 has quit [Read error: Connection reset by peer]
zorak8 has joined #ruby
Lesbin has joined #ruby
kyb3r_ has joined #ruby
charliesome has joined #ruby
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
njs126 has quit [Quit: Leaving]
duncannz has joined #ruby
duncannz has quit [Remote host closed the connection]
studiotate has quit [Quit: Computer has gone to sleep.]
kiyote23_ has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
wjimenez_ has joined #ruby
duncannz has joined #ruby
ddd_ has quit [Ping timeout: 264 seconds]
n80 has quit [Quit: n80]
mgberlin has quit [Read error: Connection reset by peer]
wjimenez_ has quit [Client Quit]
mgberlin has joined #ruby
jusmyth has joined #ruby
arup_r has quit [Quit: Leaving.]
wjimenez5271 has joined #ruby
wjimenez_ has joined #ruby
procat has joined #ruby
dts|pokeball has quit [Read error: Connection reset by peer]
_gautam_ has quit [Quit: Be back later ...]
rshetty has joined #ruby
dts|pokeball has joined #ruby
wjimenez_ has quit [Client Quit]
spastorino has quit [Quit: Connection closed for inactivity]
procat has quit [Ping timeout: 264 seconds]
lzx has quit [Remote host closed the connection]
duncannz has quit [Remote host closed the connection]
jusmyth has left #ruby [#ruby]
hamakn has joined #ruby
jack_rabbit has quit [Ping timeout: 272 seconds]
yfeldblum has joined #ruby
goshdarnyou has joined #ruby
Channel6 has quit [Quit: Leaving]
oo_ has joined #ruby
rshetty has quit [Remote host closed the connection]
tus has quit [Read error: Connection reset by peer]
Takle has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
ItSANgo has quit [Read error: Connection reset by peer]
ItSANgo has joined #ruby
arescorpio has quit [Excess Flood]
pwnz0r has joined #ruby
Takle has quit [Ping timeout: 250 seconds]
phutchins has quit [Ping timeout: 255 seconds]
Deele has joined #ruby
Techguy305|2 has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
Avahey has joined #ruby
mroach has quit [Read error: Connection reset by peer]
pwnz0r_ has joined #ruby
mroach has joined #ruby
jack_rabbit has joined #ruby
anaeem1_ has joined #ruby
anaeem1_ has quit [Remote host closed the connection]
anaeem1_ has joined #ruby
pwnz0r has quit [Ping timeout: 258 seconds]
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fabrice31 has joined #ruby
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
duncannz is now known as Guest78480
Guest78480 has quit [Excess Flood]
reinaldob has joined #ruby
econerd4ever has quit [Remote host closed the connection]
AlexRussia has quit [Ping timeout: 256 seconds]
phutchins has joined #ruby
econerd4ever has joined #ruby
weaksauce has quit [Ping timeout: 265 seconds]
Morkel has joined #ruby
duncan_ has joined #ruby
fabrice31 has quit [Ping timeout: 244 seconds]
TripTastic has joined #ruby
reinaldob has quit [Ping timeout: 240 seconds]
econerd4ever has quit [Ping timeout: 240 seconds]
jaequery has joined #ruby
phutchins has quit [Ping timeout: 258 seconds]
kiyote23 has joined #ruby
studiotate has joined #ruby
AndroUser466 has quit [Quit: good bye]
DonOtreply has joined #ruby
kp666 has joined #ruby
AlexRussia has joined #ruby
frog|OFF is now known as green-big-frog
nisstyre has joined #ruby
nisstyre has quit [Changing host]
Lesbin has left #ruby ["Leaving"]
<green-big-frog> hi
pwnz0r_ has quit [Ping timeout: 264 seconds]
pwnz0r has joined #ruby
duncan_ has quit [Quit: Leaving]
<havenwood> hi
<pwnz0r> hello
<godd2> what sup
<havenwood> godd2: Thor's Day!
avril14th has quit [Ping timeout: 258 seconds]
CrazyM4n has quit [Quit: Leaving]
<havenwood> godd2: Or if you prefer, Sweetmorn, the 59th day of The Aftermath.
zorak8 has quit [Ping timeout: 256 seconds]
avril14th has joined #ruby
<godd2> I like going by Majora's Mask date times
<godd2> -72 Hours Remain-
hmsimha has quit [Ping timeout: 252 seconds]
weaksauce has joined #ruby
TripTastic is now known as JBreit
JohnBat26 has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
jeanlinux has joined #ruby
commmmodo has quit [Quit: commmmodo]
psyprus has quit [Ping timeout: 258 seconds]
mengu has joined #ruby
AmirolAhmad has quit [Remote host closed the connection]
mengu has quit [Changing host]
mengu has joined #ruby
jlast has quit [Remote host closed the connection]
valeriansaliou has joined #ruby
jlast has joined #ruby
TinkerTyper has quit [Quit: ZNC restarting...]
giuseppesolinas has joined #ruby
quazimodo has joined #ruby
ohaibbq has joined #ruby
mengu has quit [Ping timeout: 258 seconds]
djbkd has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
valeriansaliou has quit [Ping timeout: 272 seconds]
lzx has joined #ruby
TinkerTyper has joined #ruby
tyfighter has joined #ruby
Musashi007 has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
anaeem1__ has joined #ruby
anaeem1__ has quit [Remote host closed the connection]
anaeem1_ has quit [Read error: Connection reset by peer]
anaeem1 has joined #ruby
Cache_Money has joined #ruby
dts|pokeball has quit [Read error: Connection reset by peer]
st0mar has quit [Ping timeout: 244 seconds]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
quazimodo has quit [Quit: leaving]
dts|pokeball has joined #ruby
giuseppesolinas has joined #ruby
giuseppesolinas has quit [Client Quit]
yfeldblum has joined #ruby
Musashi007 has quit [Quit: Musashi007]
arup_r has joined #ruby
gsd has quit [Ping timeout: 258 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
agit0 has quit [Ping timeout: 258 seconds]
mbr has quit [Ping timeout: 258 seconds]
mbr has joined #ruby
psyprus has joined #ruby
agit0 has joined #ruby
WhereIsMySpoon__ has quit [Ping timeout: 258 seconds]
goodenough has quit [Remote host closed the connection]
WhereIsMySpoon_ has joined #ruby
Areessell has quit [Ping timeout: 264 seconds]
rylev has joined #ruby
arup_r has quit [Ping timeout: 264 seconds]
psy_ has quit [Remote host closed the connection]
n_blownapart has quit [Remote host closed the connection]
jaake-tv has quit [Quit: WeeChat 0.4.2]
rylev has quit [Ping timeout: 245 seconds]
jlast has joined #ruby
SOLDIERz has joined #ruby
roolo has joined #ruby
trt__ has joined #ruby
Spami_ has joined #ruby
jlast_ has joined #ruby
oleo has quit [Quit: Verlassend]
jlast has quit [Ping timeout: 258 seconds]
roolo has quit [Ping timeout: 245 seconds]
Spami_ has quit [Client Quit]
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
jxf has joined #ruby
jdj_dk has quit [Remote host closed the connection]
pietr0 has joined #ruby
phutchins has joined #ruby
pwnz0r has quit [Remote host closed the connection]
Spami_ has joined #ruby
JBreit has left #ruby ["Leaving"]
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
green-big-frog is now known as frog|OFF
melik has quit [Ping timeout: 258 seconds]
valeriansaliou has joined #ruby
tobago has joined #ruby
AndroUser466 has joined #ruby
Menorah has joined #ruby
echevemaster has quit [Remote host closed the connection]
meatchicken has joined #ruby
phutchins has quit [Ping timeout: 250 seconds]
<meatchicken> hash.inject(...) { |c, (k, v)| } -> what is that expansion of k/v called?
<meatchicken> I didn't know you can do that
kyank___ has joined #ruby
kyank___ has quit [Client Quit]
jamesaxl has quit [Remote host closed the connection]
econerd4ever has joined #ruby
ramfjord has quit [Ping timeout: 245 seconds]
kiyote23 has quit [Remote host closed the connection]
kiyote23 has joined #ruby
kyank__ has quit [Ping timeout: 255 seconds]
codezomb has quit [Quit: Textual IRC Client: www.textualapp.com]
<godd2> meatchicken it's just a different arity
<godd2> arity is a fancy name for how many parameters are passed to a function/method
bmichelsen has quit [Quit: ZZZzzz…]
<meatchicken> godd2: So i could do {|c,k,v|}?
<godd2> >> def some_method(a, b); end; self.method(:some_method).arity
<eval-in__> godd2 => 2 (https://eval.in/236116)
kiyote23 has quit [Ping timeout: 240 seconds]
<godd2> meatchicken I'm not sure how necessary those parentheses are. lemme cook up an example
Musashi007 has joined #ruby
oo_ has quit [Remote host closed the connection]
chinmay_dd has joined #ruby
supersym has joined #ruby
russt has quit [Quit: russt]
oo_ has joined #ruby
<godd2> The parentheses DO make a difference, but I still don't know what it's doing
pwnz0r has joined #ruby
<meatchicken> godd2: same boat i am in ahaha
<meatchicken> i came across this while researching hash.inject
psyprus has quit [Ping timeout: 258 seconds]
oo_ has quit [Remote host closed the connection]
<godd2> okay it looks like when you put parens around k, v it breaks down the default array pair into individual params
<godd2> so like, if you just had |c, p| it would yield each key value pair into p like so [:a, 3] or whatever is in the hash
<godd2> but if you put |c, (k, v)| then k is :a and v is 3 separately
rshetty has joined #ruby
<godd2> you want me to make a gist with more explanation?
oo_ has joined #ruby
rshetty_ has joined #ruby
procat has joined #ruby
rshetty_ has quit [Remote host closed the connection]
<meatchicken> godd2: I understood that part -> I was looking for where the docs are for that functionality
<meatchicken> thank you though
<havenwood> meatchicken: it's often called destructuring
nickbelhomme has joined #ruby
valeriansaliou has quit [Read error: Connection reset by peer]
<meatchicken> oh okay
<meatchicken> thank you folks
<havenwood> meatchicken: a search for destructuring block arguments should turn up a bunch
trt__ has quit [Quit: Leaving...]
Areessell has joined #ruby
<godd2> I couldn't find block parameter destructuring in the docs under inject
rshetty has quit [Ping timeout: 256 seconds]
econerd4ever has quit [Remote host closed the connection]
<godd2> meatchicken here's an article on it
<godd2> under Destructuring Hashes is your answer :)
econerd4ever has joined #ruby
tyfighter has quit [Quit: tyfighter]
<meatchicken> Thanks just found it as well
<meatchicken> that solves that
<meatchicken> Much appreciate :D
DonOtreply has quit [Quit: DonOtreply]
theotherstupidgu has joined #ruby
valeriansaliou has joined #ruby
procat has quit [Ping timeout: 240 seconds]
psyprus has joined #ruby
nfk has joined #ruby
yfeldblum has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
rshetty has joined #ruby
apeiros_ has quit [Read error: Connection reset by peer]
AmirolAhmad has joined #ruby
apeiros_ has joined #ruby
DonOtreply has joined #ruby
konsolebox has quit [Remote host closed the connection]
AmirolAhmad has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
ramfjord has joined #ruby
Takle has joined #ruby
yfeldblum has quit [Ping timeout: 258 seconds]
econerd4ever has quit [Remote host closed the connection]
frank_____ has joined #ruby
meatchicken has quit [Quit: Page closed]
Takle has quit [Read error: No route to host]
bricker`work has joined #ruby
Musashi007 has quit [Ping timeout: 256 seconds]
sarmiena_ has quit [Quit: sarmiena_]
ramfjord has quit [Ping timeout: 256 seconds]
_Andres has joined #ruby
gregf_ has quit [Ping timeout: 240 seconds]
last_staff has joined #ruby
OGRANDE has joined #ruby
codecop has joined #ruby
hdrv has quit [Ping timeout: 245 seconds]
DonOtreply has quit [Quit: DonOtreply]
OGRANDE has left #ruby ["•Cebolinhav9.5• www.cajau.com"]
AmirolAhmad has joined #ruby
<bricker`work> Ruby golf: I want to rotate an array to only ever keep 5 elements in it, the most recent at the start. Right now I have `array.pop if array.length >= 5; array.unshift(element)`
<bricker`work> Can I do better/
<bricker`work> ?
hyperdrive has joined #ruby
chinmay_dd has quit [Ping timeout: 245 seconds]
sevenseacat has joined #ruby
dts|pokeball has quit [Read error: Connection reset by peer]
pwnz0r has quit [Remote host closed the connection]
fabrice31 has joined #ruby
Takle has joined #ruby
dts|pokeball has joined #ruby
<apeiros_> bricker`work: ary.replace(ary.last(n))
<apeiros_> is probably faster too
<apeiros_> well, unless you pop after every add
Takle has quit [Read error: Connection reset by peer]
Stoge88 has joined #ruby
uber_hulk has joined #ruby
uber_hulk has quit [Client Quit]
<bricker`work> This works: ary.unshift(element).replace(ary.first(n))
bmichelsen has joined #ruby
Takle_ has joined #ruby
fabrice31 has quit [Ping timeout: 245 seconds]
apeiros_ has quit [Remote host closed the connection]
<bricker`work> Danke
apeiros_ has joined #ruby
goshdarnyou has quit [Quit: Connection closed for inactivity]
anarang has joined #ruby
ramfjord has joined #ruby
devoldmx33 has joined #ruby
apeiros_ has quit [Ping timeout: 255 seconds]
Stoge88 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rshetty has joined #ruby
Avahey has quit [Quit: Connection closed for inactivity]
ramfjord has quit [Ping timeout: 240 seconds]
goodenough has joined #ruby
agit0 has quit [Quit: This computer has gone to sleep]
Macaveli has joined #ruby
bal has joined #ruby
vt102 has quit [Ping timeout: 245 seconds]
Takle_ has quit [Read error: Connection reset by peer]
Takle has joined #ruby
kamilc__ has joined #ruby
valeriansaliou has quit [Quit: Be back later ...]
econerd4ever has joined #ruby
rshetty has quit [Remote host closed the connection]
noop has joined #ruby
supersym has quit [Ping timeout: 256 seconds]
lolmaus has joined #ruby
cjdood has joined #ruby
econerd4ever has quit [Remote host closed the connection]
timonv_ has joined #ruby
econerd4ever has joined #ruby
lolmaus has quit [Client Quit]
lolmaus has joined #ruby
nickbelhomme has quit [Ping timeout: 265 seconds]
kyank___ has joined #ruby
arup_r has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
timonv_ has quit [Remote host closed the connection]
chinmay_dd has joined #ruby
Menorah has quit [Quit: This computer has gone to sleep]
D9 has joined #ruby
_Andres_ has joined #ruby
bricker`work has quit [Ping timeout: 245 seconds]
_Andres has quit [Ping timeout: 265 seconds]
Megtastique has quit []
jlast_ has quit [Ping timeout: 258 seconds]
andikr has joined #ruby
krandi has joined #ruby
jeanlinux has quit [Remote host closed the connection]
jack_rabbit has quit [Ping timeout: 272 seconds]
kyb3r_ has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
kyb3r_ has joined #ruby
nickbelhomme has joined #ruby
apeiros_ has joined #ruby
bal1 has joined #ruby
Hanmac has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
bal has quit [Ping timeout: 244 seconds]
devoldmx33 has quit [Ping timeout: 240 seconds]
rylev has joined #ruby
hyperdrive is now known as hdrv
devoldmx has joined #ruby
hdrv has quit [Changing host]
hdrv has joined #ruby
econerd4ever has quit [Remote host closed the connection]
jack_rabbit has joined #ruby
econerd4ever has joined #ruby
it0a has quit [Quit: WeeChat 1.0.1]
shuber_ has joined #ruby
aganov has joined #ruby
jeanlinux has joined #ruby
yfeldblum has joined #ruby
djbkd has quit [Remote host closed the connection]
rylev has quit [Ping timeout: 240 seconds]
fabrice31 has joined #ruby
devoldmx has quit [Ping timeout: 255 seconds]
econerd4ever has quit [Ping timeout: 258 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dseitz has joined #ruby
krandi has quit [Remote host closed the connection]
dc_ has quit [Remote host closed the connection]
jeanlinux has quit [Ping timeout: 258 seconds]
goodenough has quit []
timonv_ has joined #ruby
agit0 has joined #ruby
nickbelhomme has quit [Ping timeout: 272 seconds]
AmirolAhmad has quit []
sea_local has quit [Remote host closed the connection]
avril14th has quit [Ping timeout: 240 seconds]
c0rwin has joined #ruby
phutchins has joined #ruby
jlast has joined #ruby
amclain has quit [Quit: Leaving]
StoneCypher has quit [Ping timeout: 250 seconds]
cantonic has quit [Quit: cantonic]
ballpointcarrot has joined #ruby
sea_local has joined #ruby
echooo has quit [Quit: echooo]
_Andres_ has quit [Read error: Connection reset by peer]
Stoge88 has joined #ruby
anaeem1 has quit [Quit: Leaving...]
phutchins has quit [Ping timeout: 240 seconds]
anaeem1 has joined #ruby
terlar has joined #ruby
oo_ has quit [Remote host closed the connection]
nickbelhomme has joined #ruby
rbrs has joined #ruby
charliesome has quit [Quit: zzz]
oo_ has joined #ruby
st0mar has joined #ruby
_Andres has joined #ruby
pietr0 has quit [Quit: pietr0]
TgMts has joined #ruby
rimantas has joined #ruby
robbyoconnor has joined #ruby
renderful has joined #ruby
timonv_ has quit [Remote host closed the connection]
timonv_ has joined #ruby
renderful has quit [Ping timeout: 245 seconds]
lxsameer has joined #ruby
lxsameer has joined #ruby
st0mar has quit [Ping timeout: 250 seconds]
timonv_ has quit [Ping timeout: 256 seconds]
narph has joined #ruby
procat has joined #ruby
CpuID has quit [Ping timeout: 244 seconds]
zorak8 has joined #ruby
anarang has quit [Ping timeout: 245 seconds]
sea_local has quit [Remote host closed the connection]
Alina-malina has quit [Read error: Connection reset by peer]
MartynKeigher has quit [Read error: Connection reset by peer]
einarj has joined #ruby
MartynKeigher has joined #ruby
Alina-malina has joined #ruby
psy_ has joined #ruby
sevenseacat1 has joined #ruby
t3h_j4n170r has quit [Ping timeout: 264 seconds]
o010n9 has quit [Ping timeout: 250 seconds]
razieliyo has joined #ruby
procat has quit [Ping timeout: 272 seconds]
TgMts has quit [Ping timeout: 240 seconds]
sevenseacat has quit [Ping timeout: 272 seconds]
psyprus has quit [Ping timeout: 258 seconds]
nisstyre has quit [Ping timeout: 240 seconds]
psyprus has joined #ruby
ta has quit [Remote host closed the connection]
ta has joined #ruby
ta has quit [Remote host closed the connection]
fantazo has joined #ruby
alex88 has joined #ruby
ta has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
lolmaus has joined #ruby
ta has quit [Read error: Connection reset by peer]
ta has joined #ruby
behrz has quit [Ping timeout: 245 seconds]
Photism has quit [Quit: Leaving]
ballpointcarrot has quit [Ping timeout: 252 seconds]
sevenseacat1 has quit [Read error: Connection reset by peer]
codezomb has joined #ruby
bricker`work has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
<Pro|> Hi, is it possible to open web page from ruby, user fills the form and press submit and then ruby program gets the form
Jackneill has joined #ruby
<Pro|> web page would work only locally, so no server needed
sarmiena_ has joined #ruby
bartj3 has joined #ruby
jeanlinux has joined #ruby
dumdedum has joined #ruby
<agent_white> Pro|: Yep. Just use a ruby web-testing framework, like Selenium or Watir.
keen___________4 has joined #ruby
CustosL1men has joined #ruby
sk87 has joined #ruby
timonv_ has joined #ruby
keen___________3 has quit [Ping timeout: 250 seconds]
_Andres_ has joined #ruby
Trieste has quit [Quit: ZNC - http://znc.in]
nickbelhomme has quit [Ping timeout: 244 seconds]
kl has joined #ruby
<Pro|> so it would open web page, wait for user fill the form and other things happen, then on submit it would read the form?
Trieste has joined #ruby
anarang has joined #ruby
arup_r has quit [Remote host closed the connection]
<apeiros_> agent_white: I think he means the other side. i.e. that his app spawns a browser window for the app user to enter data into a form.
<apeiros_> but not entirely sure
charliesome has joined #ruby
_Andres has quit [Ping timeout: 244 seconds]
<agent_white> apeiros_: Hm! Well... then _maybe_ Watir.
<Pro|> yes, as apeiros_ said
<apeiros_> agent_white: na, watir would emulate the user
<agent_white> Watir is also good for if you need time to take a nap, since it's not headless.
<apeiros_> he doesn't want to emulate the user
jack_rabbit has quit [Ping timeout: 272 seconds]
<agent_white> Ohhh.
<Pro|> just open the page, fill the form, then data would go back to ruby
anarang_ has joined #ruby
Calmoto1 has joined #ruby
AndroUser466 has quit [Ping timeout: 256 seconds]
<agent_white> Pro|: `ruby -run -e httpd . -p 8000`
pjakobs has joined #ruby
<agent_white> Assuming the client has ruby?
<agent_white> Not sure what you're trying to do exactly.
<apeiros_> I understand it as that his user runs a ruby app
<apeiros_> locally
<Pro|> yes
<apeiros_> Pro|: why web page?
<Pro|> web page would be a GUI
<apeiros_> or can it be just any GUI?
<Pro|> web page woudl be good, since this will be running on linux, amc and windows
<Pro|> mac*
<apeiros_> so your question is: "how do I make a cross-platform UI"
anarang has quit [Ping timeout: 265 seconds]
<Pro|> i'd like to do it with web page
<apeiros_> and instead of asking that, you asked: "How can I make a client app with a browser UI"
bricker`work has quit [Ping timeout: 245 seconds]
<Pro|> shoes would be good for cross-platform ui i tihnk
<apeiros_> it is quite certainly possible. but you'll not get around platform specific code for parts of it.
Xeago has joined #ruby
<Pro|> maybe "shoes" is good then
wpp has joined #ruby
<apeiros_> it's quite probably much less hassle than your suggested solution
anarang_ has quit [Ping timeout: 250 seconds]
avril14th has joined #ruby
<avril14th> morning
rshetty has joined #ruby
<havenwood> Pro|: if you really want to launch the default web browser, there's the launchy gem: https://github.com/copiousfreetime/launchy#readme
<pjakobs> morning @all, I'm looking for some sample code on how to use net::ldap with sasl auth against Win2012 server, does anyone have a pointer?
nisstyre has joined #ruby
sevenseacat has joined #ruby
wpp has quit [Client Quit]
borkdude_ is now known as borkdude
nickbelhomme has joined #ruby
<godd2> God I wish sublime text would tell me what files were unsaved without tabbing over to them
wpp has joined #ruby
jack_rabbit has joined #ruby
livathinos has joined #ruby
mengu has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
cht has joined #ruby
jheg has joined #ruby
wpp has quit [Client Quit]
wolf4ood has joined #ruby
lemur has quit [Remote host closed the connection]
charliesome has quit [Quit: zzz]
lemur has joined #ruby
ramfjord has joined #ruby
wpp has joined #ruby
wpp has quit [Client Quit]
chthon has joined #ruby
Hobogrammer has quit [Ping timeout: 255 seconds]
Mia has quit [Read error: Connection reset by peer]
arup_r has joined #ruby
jlast has joined #ruby
<certainty> apeiros_: yesterday we had the question if there is any advantage of using a reader rather that the instance variable when accessed from inside the class. IIRC you did investigate some time in thinking about that, what was your result?
lemur has quit [Ping timeout: 258 seconds]
<apeiros_> certainty: ask me and toretore and you get the two polar opposites of this discussion ;-)
ramfjord has quit [Ping timeout: 240 seconds]
<apeiros_> ivar: provides better readability, less cognitive overhead
<apeiros_> accessor: allows you to change what happens when you read/write
sarmiena_ has quit [Quit: sarmiena_]
kl has quit [Ping timeout: 244 seconds]
charliesome has joined #ruby
sandelius has joined #ruby
<apeiros_> I'm in favor of using @ivars. I haven't seen a single case in my whole ruby career where being able to replace accessor implementation had mattered
<certainty> apeiros_: yeah i remember that discussion
<apeiros_> and if such a case should come up - since your class is in a single file, and @ivar\b is a perfect match, it is ridiculously trivial to refactor.
<certainty> apeiros_: that's the gist i remembered as well and i agree. However the readability seems to be subjective as that has been raised as a counter argument yesterday
Akuma has joined #ruby
iwishiwerearobot has joined #ruby
<apeiros_> certainty: sounds like somebody didn't understand cognitive load then.
frank_____ has quit [Quit: Connection closed for inactivity]
<havenwood> an instance variable is simple
<apeiros_> ^ that
anarang has joined #ruby
<certainty> yeah
<apeiros_> there is nothing which happens when reading/assigning an ivar other than that. with the method, there's more.
<certainty> apeiros_: alrgiht, thanks for the summary. very appreciated
<apeiros_> you do not know whether it has a side-effect until you either read the documentation (and hope it's up to date) or read the code
chipotle has quit [Quit: cheerio]
<apeiros_> documentation is interchangeable with tests
Menorah has joined #ruby
jack_rabbit_ has joined #ruby
<apeiros_> i.e., @ivar is on the KISS side, while accessor is on the "abstract all the things" side.
<certainty> that's a very good reason
nhhagen has joined #ruby
majeure has joined #ruby
watermel0n has joined #ruby
<apeiros_> certainty: thought experiment for the person who said accessors are more readable - ask them what this code does: "def foo; bar; end". ask them what this code does: "def foo; @bar; end"
<certainty> shevy: ^
<apeiros_> the answer to the first, of course, is "I don't know". because it's impossible to know.
<certainty> note, shevy was not the one who said it was easier to read, but he asked initially
<apeiros_> when I say "easier to read" I don't mean cosmetics (no "@" sigil). there is value to that. I appreciate ruby for being low on sigil noise. but they have a value.
jack_rabbit has quit [Ping timeout: 256 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<apeiros_> I think that's about all I have to say about this issue :)
<certainty> that's more than enough. thanks :)
marr has joined #ruby
<certainty> apeiros_: ah wait one last question. You have a protocol to assure that certain invariants exist after you initialized an instance. I lost the list. (you gave it to me back then). What where they?
kiyote23 has joined #ruby
roolo has joined #ruby
<certainty> were
<apeiros_> I have protocols? awesome, I didn't know :D
<certainty> heh
_Andres_ has quit [Read error: Connection reset by peer]
<apeiros_> I assign all ivars in initialize
<certainty> apeiros_: yeah like. All ivars have been initialized. And none of them change their type afterwards
<apeiros_> I find it valuable to have a single place showing me all ivars an object will ever have
jeanlinu_ has joined #ruby
<apeiros_> yes, correct
<apeiros_> ivars should not vary in type. where type *can* be ducky.
<certainty> of course
<apeiros_> i.e. I deeply despise things like "@author can be either a string, representing a single author, or an array, representing multiple authors". that's bad design in my book.
kl has joined #ruby
<apeiros_> I have the same rule for arguments. normalization is the user's duty.
<certainty> which means you assume that the caller makes sure to properly normalize the arguments before using your interface?
<sevenseacat> i dont mind it - be liberal in what you accept
<apeiros_> correct
<sevenseacat> and strict about what you return
<apeiros_> sevenseacat: I find that one of the worst things. reason for so much broken software.
<sevenseacat> its no big deal to Array.wrap an argument
<certainty> apeiros_: that's what we had debate here as well. I advocate the same. I'm rigorous in spotting the lack of normalization though
<apeiros_> sevenseacat: that assumes you knew how to normalize the input. but you don't. the only party which knows how to properly normalize the input is the user.
<certainty> signaling exceptions if they're not what i expect them to be
_Andres has joined #ruby
jeanlinux has quit [Ping timeout: 250 seconds]
kiyote23 has quit [Ping timeout: 256 seconds]
<apeiros_> the surface of an API should be as small as possible. if somebody regularly has the need to pass a different type and have it normalized - well, ruby is open. add a method.
<apeiros_> this is also something which allows you to scale (your codebase) a lot easier.
Areessell has quit [Quit: leaving]
<cht> looking into the rest-client gem for streaming download, can't seem a way to do it
Calmoto1 is now known as calmoto
<cht> anyone done streaming download via rest-client ?
yfeldblum has quit [Ping timeout: 250 seconds]
mroach has quit [Quit: mroach]
bartj3 has quit [Read error: Connection reset by peer]
gsd has joined #ruby
LouisRoR has joined #ruby
relic has joined #ruby
AFKGeek has joined #ruby
bmichelsen has quit [Quit: ZZZzzz…]
mengu has joined #ruby
kasperti_ has joined #ruby
havenwood has quit []
olivier_bK has joined #ruby
zorak8 has quit [Ping timeout: 258 seconds]
arup_r has quit [Remote host closed the connection]
relic has quit [Client Quit]
<agent_white> "Ruby... like a lifelong bosom friend."
majeure has quit [Quit: ZNC - http://znc.in]
rbrs has quit [Quit: Leaving]
CustosL1men has quit [Ping timeout: 256 seconds]
sk87 has joined #ruby
gsd has quit [Ping timeout: 256 seconds]
kl has quit [Ping timeout: 244 seconds]
valeriansaliou has joined #ruby
watermel0n has quit [Quit: Busy]
timonv_ has quit [Read error: Connection reset by peer]
Snowstormer is now known as burritocat
arup_r has joined #ruby
aswen has joined #ruby
sk87 has quit [Client Quit]
elaptics`away is now known as elaptics
sk87 has joined #ruby
sevenseacat has quit [Ping timeout: 245 seconds]
relic has joined #ruby
Soda has joined #ruby
mengu has quit [Ping timeout: 256 seconds]
relic has quit [Client Quit]
relic has joined #ruby
p0wn3d_mhs has quit [Ping timeout: 250 seconds]
reinaldob has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
giuseppesolinas has joined #ruby
valeriansaliou has quit [Read error: Connection reset by peer]
valeriansaliou has joined #ruby
p0wn3d_mhs has joined #ruby
D9 has quit [Quit: Leaving]
sevenseacat has joined #ruby
reinaldob has quit [Ping timeout: 244 seconds]
kyb3r_ has quit [Read error: Connection reset by peer]
CustosL1men has joined #ruby
CustosL1men has quit [Changing host]
CustosL1men has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
D9 has joined #ruby
mgberlin_ has joined #ruby
qulo has joined #ruby
<avril14th> does anyone happen to know if it's possible to add an alternative file suffix for spec test files?
marcules has joined #ruby
<marcules> hi
mgberlin has quit [Ping timeout: 264 seconds]
dANO has joined #ruby
<shevy> agent_white ruby got tits?
<agent_white> shevy: KNOCKERS
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<shevy> hey not everyone is elephant sized
rshetty has joined #ruby
Guest40696 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jeanlinu_ has quit [Remote host closed the connection]
rdark has joined #ruby
hok00age has joined #ruby
<agent_white> I don't discriminate.
<agent_white> :D
timonv_ has joined #ruby
mroach has joined #ruby
jeanlinux has joined #ruby
nhhagen has quit [Remote host closed the connection]
rodfersou has joined #ruby
Trieste has quit [Ping timeout: 265 seconds]
msgodf has joined #ruby
joonty has joined #ruby
jeanlinux has quit [Remote host closed the connection]
jeanlinux has joined #ruby
rshetty has quit [Remote host closed the connection]
<certainty> shevy: did you see what apeiros_ wrote wrt ivars vs. reader
<shevy> nope I just got home when I noticed agent_white was talking about titties again
rshetty has joined #ruby
<shevy> I am having breakfast and lunch in one session as I type!
<agent_white> I'm a hobbyist.
jeanlinux has quit [Remote host closed the connection]
<shevy> certainty what did the old mountain trekkie apeiros wrote? or apeiros_ ... damn these clones ...
procat has joined #ruby
<apeiros_> shevy: you can write either nick. I get highlighted on all my registered nicks.
spider-mario has joined #ruby
jlast has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
c0rwin has quit [Quit: Lost terminal]
<certainty> shevy:
<certainty> 10:09 < apeiros_> ivar: provides better readability, less cognitive overhead
<certainty> 10:10 < apeiros_> accessor: allows you to change what happens when you read/write
spider-mario has joined #ruby
<certainty> 10:12 < apeiros_> there is nothing which happens when reading/assigning an ivar other than that. with the method, there's more.
<certainty> probably the tl;dr
<raldu> h/win7
reinaldob has joined #ruby
procat has quit [Ping timeout: 244 seconds]
<shevy> yeah well
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
<shevy> the speed penalty is making ivars the clear winner
hok00age has quit [Quit: Leaving]
<shevy> I wonder if it would be possible to make methods just behave like ivars
<certainty> yeah if that's your major concern
<shevy> oh but of course it is
<certainty> for me the cognitive load argument weighs more
renderful has joined #ruby
<shevy> otherwise I would use methods
<shevy> if @game_over
<shevy> if game_over?
<shevy> method wins
<shevy> but since it is slower, the method loses :(
<shevy> cognitive load? what is that?
<apeiros_> I think performance should be the last consideration.
jeanlinux has joined #ruby
<certainty> one possible thing is that if you accidently use an ivar that isn't there (typo) you get nil and possibly continue to use that from now on. Whereas when you have the same typo in the method you may see a NoMethodError
<certainty> of course that's not true for nullary methods
<apeiros_> shevy: congitive load: the amount of thinking you have to do to understand what your code does.
<shevy> ah
chinmay_dd has quit [Ping timeout: 245 seconds]
<apeiros_> auto-vivified ivars are indeed an annoyance. I find that design decision by matz problematic.
D9 has quit [Quit: Leaving]
kl has joined #ruby
<certainty> same here
<shevy> certainty well I have had this when I used this method: def intialize
<certainty> shevy: i guess we all did that at least once
<shevy> what are "auto-vivified ivars"?
<shevy> I'll know how matz will approach queries about design decisions
<shevy> "go design your own programming language" :D
<apeiros_> shevy: you can access an ivar without assigning to it
<shevy> oh?
<apeiros_> >> @nonexistantivar
<eval-in__> apeiros_ => nil (https://eval.in/236232)
<shevy> hmm
<shevy> >> nonexistantvar
<eval-in__> shevy => undefined local variable or method `nonexistantvar' for main:Object (NameError) ... (https://eval.in/236233)
<shevy> weird
jack_rabbit_ has quit [Ping timeout: 265 seconds]
<apeiros_> you did not know this until now? o0
jeanlinux has quit [Remote host closed the connection]
alex88_ has joined #ruby
<shevy> nope
<shevy> or perhaps it has never bitten me
renderful has quit [Ping timeout: 255 seconds]
chinmay_dd has joined #ruby
CustosL1men has quit [Read error: Connection reset by peer]
CustosL1men has joined #ruby
dANO has quit [Read error: Connection reset by peer]
chinmay_dd has quit [Client Quit]
dANO has joined #ruby
alex88 has quit [Ping timeout: 272 seconds]
kl has quit [Ping timeout: 250 seconds]
jeanlinux has joined #ruby
dumdedum has quit [Quit: foo]
gccostabr has joined #ruby
kl has joined #ruby
ohaibbq has quit [Quit: Leaving...]
studiotate has quit [Quit: Computer has gone to sleep.]
chinmay_dd has joined #ruby
watermel0n has joined #ruby
wpp has joined #ruby
kamilc__ has quit [Quit: Leaving...]
dumdedum has joined #ruby
Trieste has joined #ruby
workmad3 has joined #ruby
anarang has quit [Quit: Leaving]
sk87 has joined #ruby
oo_ has quit [Remote host closed the connection]
raldu has quit [Ping timeout: 272 seconds]
oo_ has joined #ruby
CustosL1men has quit [Ping timeout: 245 seconds]
jxf has quit [Ping timeout: 245 seconds]
jeanlinux has quit [Remote host closed the connection]
jeanlinux has joined #ruby
gccostabr has quit [Quit: ZZZzzz…]
jeanlinux has quit [Remote host closed the connection]
jeanlinux has joined #ruby
valeriansaliou has quit [Ping timeout: 245 seconds]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
cantonic has joined #ruby
t3h_j4n170r has joined #ruby
tokik has quit [Ping timeout: 244 seconds]
mylar has joined #ruby
Jan_ is now known as DefV
jlast has quit [Ping timeout: 258 seconds]
nhhagen has joined #ruby
lzx has quit [Remote host closed the connection]
ponga has joined #ruby
ponga has joined #ruby
foooobear has joined #ruby
jack_rabbit_ has joined #ruby
raldu has joined #ruby
shuber_ has quit [Remote host closed the connection]
o010n9 has joined #ruby
CustosL1men has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
jeanlinux has quit [Remote host closed the connection]
LiquidInsect has quit [Ping timeout: 255 seconds]
anarang has joined #ruby
jeanlinux has joined #ruby
jusmyth has joined #ruby
Lingo_ has joined #ruby
<Lingo_> Hi
sk87 has joined #ruby
FooMunki has joined #ruby
jeanlinux has quit [Remote host closed the connection]
Pupeno has joined #ruby
xemulb|2 has joined #ruby
jeanlinux has joined #ruby
craz has joined #ruby
craz has quit [Client Quit]
cesarstafe has joined #ruby
xemulb|2 has quit [Client Quit]
vinleod has joined #ruby
Freijo has quit [Remote host closed the connection]
giuseppesolinas has joined #ruby
watermel0n has quit [Quit: Busy]
axilla has joined #ruby
jack_rabbit_ has quit [Ping timeout: 272 seconds]
<shevy> anyone has a nifty way that illustrates how to use mutex?
<shevy> I am looking at code written by someone else making use of mutex and it confuses me currently
rodfersou has quit [Remote host closed the connection]
rodfersou has joined #ruby
<shevy> @mutex = Mutex.new; every(1) do; @mutex.synchronize do; @threads.dup.each do
<certainty> i've seen nifty ways to create deadlocks
Jackneill has quit [Remote host closed the connection]
s00pcan has joined #ruby
bmichelsen has joined #ruby
<zenspider> minitest uses mutex. rake-remote_task, gauntlet, memcache-client... UPnP
watermel0n has joined #ruby
gccostabr has joined #ruby
* zenspider goes to bed
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
jlast has joined #ruby
Xeago has quit [Remote host closed the connection]
leo-unglaub has joined #ruby
jeanlinux has quit [Remote host closed the connection]
jlast_ has joined #ruby
iwishiwerearobot has quit [Quit: Be back later ...]
Io-Robot has joined #ruby
s00pcan has quit [Ping timeout: 255 seconds]
<workmad3> shevy: the mutex synchronise method is essentially a 'critical block' in your code
<workmad3> shevy: so only one thread can be inside that block at a time
<shevy> hmm
tkuchiki has quit [Ping timeout: 264 seconds]
jlast has quit [Ping timeout: 258 seconds]
<workmad3> shevy: so the style is that you create a mutex, it's shared across all your threads, and only one thread can have its execution point inside the synchronise block at any point in time
chu has joined #ruby
<workmad3> shevy: or, in simpler terms, from the perspective of other threads, anything that happens inside the synchronise block is atomic and happens all at once
<workmad3> (ish)
<workmad3> realised just after hitting return that the atomic view is fairly wrong, unless you're only trying to view inside the mutex too
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> well right now I have no mutex, I am just looking at code written by some other guy. I don't even know what he is doing really
<Io-Robot> e Who has created this game ? Robert Kooima http://yoliece463.itch.io/nexus-ball
LiquidInsect has joined #ruby
<tobiasvl> Io-Robot seems to be a spammer, is in #git too
<workmad3> shevy: ok, ignore what I said about atomic :)
Lingo_ has quit [Quit: Be back later ...]
sandelius has joined #ruby
<workmad3> shevy: mutex is a 'lock'... only one thread can have the lock at a time, and the 'synchronize' method will halt execution until it has obtained the lock before executing the block you provide
<workmad3> shevy: and after executing the block, the synchronise method will release the lock
Lingo_ has joined #ruby
sevenseacat has quit [Ping timeout: 264 seconds]
<shevy> aha
<shevy> so mutex is about controlling threads?
kasperti_ has quit []
<Io-Robot> 101011001101001100110110
<Io-Robot> 0101010110101110010
<Io-Robot> 001011001001101100010111
<agent_white> Io-Robot: ewww gross.
<Io-Robot> 0110110001001001101010101
<ponga> lol
<workmad3> shevy: it's about preventing multiple threads from running the same code at the same time
<ponga> speaking in binary?
<workmad3> shevy: mutex == mutually exclusive
<Io-Robot> 101001001011101101010011
kyank___ has quit [Quit: Be back later ...]
gizmore has joined #ruby
<tobiasvl> Io-Robot: stop spamming, you were just banned in #git
<ponga> maybe he's a bot tobiasvl
<tobiasvl> an Io-bot
s00pcan has joined #ruby
<agent_white> Sorry to pipe in, but would that mean this code is about 'concurrency' rather than parallelism?
<Io-Robot> I'm an artificial intelligence
Lingo_ has quit [Ping timeout: 244 seconds]
<Io-Robot> I can not stop
<agent_white> (acting upon the same shared data vs something else i barely know) ;P
Morkel has quit [Read error: Connection reset by peer]
<workmad3> apeiros: sire, your ban-stick is required
jeff-ooh has joined #ruby
jusmyth has quit [Quit: Leaving.]
<agent_white> Io-Robot: Next thing you're be selling yourself on the streets just to taste a few bits
<ponga> omg THE ban stick?
<shevy> workmad3 that's cool, now I know why that name was chosen
* ponga shakes in fear
<Io-Robot> I'm a robot , I was programmed to spam
Morkel has joined #ruby
<shevy> sounds like a trollbot
<ponga> speaking of this spamming guy , i'm trying to build a chat bot that speaks like human shevy
<shevy> well
<shevy> just randomly assemble sentences
s00pcan has quit [Remote host closed the connection]
<shevy> btw you used the same ' , ' separation as that bot
s00pcan has joined #ruby
shuber_ has joined #ruby
<ponga> nop shevy, a chatbot speaking japanese fluently , occasionally giving care and consolation
<Io-Robot> 101001001100101100111011
<ponga> gonna sell the damn thing to those nerds japanese
<ponga> gonna be a cyber pimp yay
<shevy> ponga isn't that like those asian chicks... those geishas
<shevy> "giving care and consolation"
<ponga> shevy: but this thing doesn't ask for additional payment after initial check-out
<ponga> its way more advanced
<Io-Robot> 100011010101001110001010
<ponga> and the thing is going to be written in ruby, a japanese born lang, no coincidence i detect here :P
Io-Robot was kicked from #ruby by apeiros_ [good bye]
s00pcan has quit [Client Quit]
s00pcan has joined #ruby
jack_rabbit_ has joined #ruby
<apeiros_> bansticked
<tobiasvl> wasn't he just kicked
<tobiasvl> kickstick
<shevy> stick my kick
shuber_ has quit [Ping timeout: 240 seconds]
<shevy> ponga well I don't know
<shevy> ponga considering that the japanese have played with robots for such a long time, they (the robots) are still dumb as fuck essentially
tokik has joined #ruby
<ponga> my inquiry was more like, if i made AI chatbot of a female characteristic that would occasionally 'give care and consolation through speech' and sell it, does it make me pimp
LouisRoR has quit [Ping timeout: 250 seconds]
ajaiswal has quit [Quit: Leaving]
<shevy> lol
<shevy> ponga the single worst thing I ever saw about japan was the suicide forest
<shevy> no, not worst
<ponga> ok what's worst
<shevy> the *single strangest thing
* ponga is waiting
phutchins has joined #ruby
gfawcettpq has joined #ruby
<apeiros_> tobiasvl: ok, kicksticked
jlast_ has quit [Ping timeout: 258 seconds]
oo_ has quit [Remote host closed the connection]
Timgauthier has joined #ruby
Azure has quit [Ping timeout: 244 seconds]
phutchins has quit [Ping timeout: 272 seconds]
claw_ has joined #ruby
uber_hulk has joined #ruby
claw has quit [Ping timeout: 264 seconds]
bmichelsen has quit [Quit: ZZZzzz…]
gccostabr has quit [Quit: ZZZzzz…]
lzx has joined #ruby
<certainty> shevy: suicide forest? is that what i think it is?
uber_hulk has left #ruby [#ruby]
<certainty> i know dumb question. how would you know what i think
<certainty> well is it the forest where they go to commit suicide?
<certainty> strong trees that can bear the ropes
ferr has joined #ruby
<apeiros_> yes
qulo has quit [Ping timeout: 240 seconds]
<certainty> ugh
<certainty> i knew about a suicide bridge in south korea
agjacome has joined #ruby
Azure has joined #ruby
<apeiros_> I prefer that over other popular methods. around here, people jump in front of trains. that's traumatizing for the drivers and bystanders.
<ponga> certainty: they sticked a message saying terribly emotional things that actually turned out to boost the suicide rate
<ponga> stupid public officers
<certainty> ponga: wtf. why would they do that?
<ponga> cos they are fucking arseholes
<certainty> i see
<ponga> corruption rate in korea is as bad as in japan /mexico/ etc
<ponga> you see
lzx has quit [Ping timeout: 265 seconds]
<certainty> apeiros_: yeah that's a popular method here as well
<ponga> and actually they thought it would calm down people
<agent_white> selfishness
Stoge88 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wpp has quit [Quit: ZZZzzz…]
<agent_white> and a bit of mental instability... of course ;P
<ponga> certainty: http://file.dailian.co.kr/news/201311/news_1383633715_394003_m_1.jpg its saying 'it'd OK to live on'
<ponga> its not photoshoped
<ponga> it actually made them jump over more
<ponga> lol
<ponga> they got tons of these there
SOLDIERz has quit [Quit: Be back later ...]
Takle has quit [Read error: No route to host]
Takle_ has joined #ruby
agjacome_ has joined #ruby
decoponio has joined #ruby
LouisRoR has joined #ruby
agjacome has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
cantonic has quit [Quit: cantonic]
gauravagarwalr has joined #ruby
procat has joined #ruby
qulo has joined #ruby
ferr has quit [Ping timeout: 250 seconds]
watermel0n has quit [Quit: Busy]
perturbation has joined #ruby
gccostabr has joined #ruby
tvw has joined #ruby
procat has quit [Ping timeout: 250 seconds]
chipotle has joined #ruby
jlast has joined #ruby
n008f4g_ has joined #ruby
psy_ has quit [Read error: No route to host]
bartj3 has joined #ruby
bartj3 has left #ruby [#ruby]
jottr has joined #ruby
arup_r_ has joined #ruby
olivier_bK has quit [Ping timeout: 264 seconds]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
Lingo_ has joined #ruby
teejar has quit [Ping timeout: 264 seconds]
chipotle has quit [Quit: cheerio]
agjacome has joined #ruby
teejar has joined #ruby
psy_ has joined #ruby
rylev has joined #ruby
arup_r has quit [Ping timeout: 250 seconds]
rylev has quit [Read error: Connection reset by peer]
<apeiros_> gross. I'm still hesitating to name a method `id`
rylev has joined #ruby
mengu has joined #ruby
<kl> apeiros_: what does it do?
<apeiros_> it used to be what object_id is now
agjacome_ has quit [Ping timeout: 256 seconds]
dumdedum has quit [Quit: foo]
andikr has quit [Ping timeout: 245 seconds]
agjacome_ has joined #ruby
<kaspergrubbe> Hm, found a typo in my code, but everything was working as expected, interestingly enough
<kaspergrubbe> test, = 1
<apeiros_> splat assignment
<kaspergrubbe> => 1
agjacome has quit [Ping timeout: 264 seconds]
<apeiros_> equivalent to `test, * = 1`
<apeiros_> >> a, = 1,2,3; a
<eval-in__> apeiros_ => 1 (https://eval.in/236278)
jack_rabbit_ is now known as jack_rabbit
<apeiros_> actually, parallel assignment is probably the better name
n1lo has joined #ruby
ItSANgo has quit [Quit: Leaving...]
<Hanmac> ruby is one of the very few languages where "a, b = b, a" is working that cool ;P
<agent_white> workmad3: Just was reading what you and shevy were talking about and it got me curious... do you have any ideas of a good little project requiring locking/mutuxes/etc. that I could maybe make to learn about that?
andikr has joined #ruby
shazaum has joined #ruby
<agent_white> Only time I've ever even used Thread was for my IRC client, and it was a single call in a single method. :P
<workmad3> agent_white: I can go one better - get this book: https://pragprog.com/book/pb7con/seven-concurrency-models-in-seven-weeks ;)
<agent_white> BAm
sevenseacat has joined #ruby
<apeiros_> seven models? hm…
<agent_white> workmad3: Awesome, thank you :D
<apeiros_> I wonder whether I know all of them, and if so, if I'd call all of them a concurrency model
ferr has joined #ruby
cantonic has joined #ruby
<agent_white> The book title could go without the "seven weeks" part, though...
<apeiros_> damit, another book on the pile.
<agent_white> ;D
<workmad3> apeiros_: the author starts by drawing a distinction between concurrency and parallelism, btw ;)
dumdedum has joined #ruby
<apeiros_> that's a great thing :)
shortCircuit__ has joined #ruby
<apeiros_> the things that come to mind which I'd call models: threading, actors, stm/htm
<shortCircuit__> what does << in class << A mean ?
<workmad3> apeiros_: the distiction being that 'concurrency' in the authors view is 'multiple logical threads of control'
agjacome_ has quit [Ping timeout: 245 seconds]
<apeiros_> shortCircuit__: it opens A.singleton_class
<apeiros_> instead of A itself
<shortCircuit__> ok
<apeiros_> workmad3: ugh :(
<shortCircuit__> where can I read on this ?
<workmad3> apeiros_: the models are - threads & locks, FP, Clojure's separate of identity and state, actors, CSP and data parallelism... so yeah, some of them potentially dubious for certain views of concurrency :)
shazaum has joined #ruby
shazaum has quit [Changing host]
jaffachief has quit [Quit: ZNC - http://znc.in]
<apeiros_> shortCircuit__: btw., no spaces before punctuation in english.
<workmad3> apeiros_: but all are pretty interesting :)
<apeiros_> CSP?
<workmad3> (I really should finish reading it tbh)
codecop has quit [Remote host closed the connection]
<shortCircuit__> okies
<workmad3> communicating sequential processes
<apeiros_> ah
<apeiros_> sequential -> time slices?
codecop has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
<workmad3> author does make the point that they're very similar to actors, but the way you design apps with them due to the change in philosophy from 'entities communicating' to 'communication channels' is different enough to warrent separate discussion
<apeiros_> oh, wrt threads - preemptive vs. cooperative
<shortCircuit__> what are singleton classes? classes for which you can't have more than one object?
<apeiros_> mhm
<apeiros_> shortCircuit__: no, singleton_class is the class where ruby puts methods which belong only to a single object
<apeiros_> shortCircuit__: all class methods for example
<shortCircuit__> k
<apeiros_> >> o = Object.new; def o.foo; "foo!"; end; o.foo
<eval-in__> apeiros_ => "foo!" (https://eval.in/236284)
<apeiros_> no other object has this method `foo`
<workmad3> agent_white: it's kinda become a series now... '7 X in 7 weeks' :)
<apeiros_> it is stored in o's singleton_class
<workmad3> agent_white: there's web frameworks, languages, databases, concurrency models, and probably a few others :)
<apeiros_> note the similarity to `def self.foo` with class methods. self there is just the class.
<shortCircuit__> oh I have seen this thing, in a book.
<agent_white> workmad3: Haha I know, I'm just kidding ;P I have seen quite a few of those "learn X language in Y days!"
<workmad3> agent_white: yeah, they're not the old 'Teach Yourself X in 21 days' series
<shortCircuit__> like book = Book.new and then def book.say_hi .. end. I didn't know they are called singleton
<workmad3> agent_white: they're very much aimed at people who already have a rough idea what they're doing and want a whistle-stop tour of a subject area
<agent_white> workmad3: Indeed! I was just jokin ;P I actually am put it on my wishlist for Christmas.
pjakobs has quit [Ping timeout: 250 seconds]
<workmad3> agent_white: sure :) I'm just making sure other people who idle in the channel also understand the distinction ;)
<agent_white> workmad3: Good idea. :D
jaffachief has joined #ruby
chinmay_dd_ has joined #ruby
<agent_white> workmad3: Does this book use Erlang?
<workmad3> agent_white: I'd hate some newcomer who's idling or reading logs for ideas to see a recommendation for '7 things in 7 days' and think 'OK, so these guys like those books, so this 'Teach yourself Ruby in 10 minutes' book must be great!' :)
<workmad3> agent_white: it does for actors
<workmad3> wait, let me check that
chinmay_dd has quit [Ping timeout: 250 seconds]
<workmad3> agent_white: it uses elixir for actors
n1lo has quit [Quit: Leaving]
<workmad3> agent_white: hence my recollection of 'erlang... wait a sec, does it?' :)
aneurine has joined #ruby
ItSANgo has joined #ruby
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<aneurine> Hi peoples
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
chinmay_dd_ is now known as chinmay_dd
<aneurine> Anyone awake?
<agent_white> \o
<agent_white> Haven't slept!
<aneurine> Heh
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<aneurine> I havent used irc since the 90s..
<agent_white> workmad3: Huh... never seen even a line of either of those before. I'll have to take a look!
<workmad3> aneurine: welcome back to the fold!
<aneurine> Lol. Its a bit surreal. Next it will be text based adventure games..
Menorah has quit [Quit: This computer has gone to sleep]
<workmad3> aneurine: plenty of people still play MUDs
<workmad3> (never really got into them myself, but I bet shevy has a list of good ones hiding somewhere ;) )
<aneurine> What rooms are chatty... Any worth joining?
Stalkr_ has joined #ruby
<aneurine> Oh lol I think I burnt myself out on them @ 15. Its all good, quenched that thirst.
<workmad3> hehe
<workmad3> and kinda depends on what you're looking for
<aneurine> Hm yes well right now anything. Have a naasty case of tonsillitis keeping me up and need the distraction
<workmad3> for ruby, there's here and #ruby-lang. If you're also interested in rails, there's #rubyonrails
ValicekB has quit [Ping timeout: 264 seconds]
<aneurine> Nah cant program to save myself
ferr has quit [Ping timeout: 265 seconds]
<workmad3> most of these are really QA type support channels for the community, but we often end up devolving into other chats
pjakobs has joined #ruby
<workmad3> hehe, you're probably in the wrong channel then ;)
<aneurine> Of course I am but I coulnt think of anything else
<workmad3> quakenet? :D
larissa has joined #ruby
Sgeo_ has quit [Read error: Connection reset by peer]
Neomex has joined #ruby
<aneurine> Heh
<agent_white> aneurine: Not sure of your IRC client, but freenode does have a channel search function... though this network tends to be packed with programming and tech-related things!
<aneurine> Where are you all and why do you provide support to others on ruby?
<agent_white> We are being held hostage in a small cave in Guam with nothing but a 56k and 7 computers
<agent_white> They won't let us go unless we teach the world Ruby
<aneurine> Ohh. Is that all of irc servers nowdays? I mean most would use videochat or something ghastly right?
Sgeo has joined #ruby
fantazo has quit [Quit: Verlassend]
<aneurine> Well here is a key, you'll find a tunnel on the left. At the end of the tunnel pick a posy of flowers.
<agent_white> Surely. But alas we are tied to these chains of uncertainty.
MartynKeigher has quit [Read error: Connection reset by peer]
* workmad3 looks at these flowers
<workmad3> hey, why do they have teeth?
rurban has joined #ruby
<workmad3> ow
rurban has left #ruby [#ruby]
<workmad3> ow ow ow ow
<aneurine> Lol
* workmad3 is eaten by carniverous plants
<aneurine> My hubby is a ror programmer
<workmad3> aha, and the reason you've ended up here becomes clear :)
<aneurine> Yes
GeorgesLeYeti has joined #ruby
<GeorgesLeYeti> H
<GeorgesLeYeti> Hi
<aneurine> I thought it might just be techy type chat on these servers perhaps and in a search for life...
<agent_white> \o
<perturbation> agent_white: your description is sounding awfully... "poignant"
<aneurine> Hi georges
<perturbation> are you sure you aren't _why in hiding?
<GeorgesLeYeti> I try to write a file with File.open(mypath, 'w'){ |f| f.write my doc }
claptor has quit [Quit: this channel is bakas]
andikr has quit [Ping timeout: 264 seconds]
<GeorgesLeYeti> I would like to write with content-type: text/plain but i don't get why it write it with text/x-c++;
frog|OFF is now known as green-big-frog
Menorah has joined #ruby
<workmad3> aneurine: your husband is lucky... I lost my wife to candy crush when she was ill, rather than IRC
<agent_white> perturbation: I only echo the words which rattle along our chains and through these caves.
wpp has joined #ruby
<workmad3> and must vanish for a bit, I'm afraid... lunch time
sandelius has joined #ruby
<agent_white> Nope! But I believe I saw him down the tunnel where aneurine lead workmad3!
<green-big-frog> hi
<perturbation> uh huh, solid response... Platonic even :)
<agent_white> ;D
spyderman4g63 has joined #ruby
<aneurine> Lol candy crush. I did actually resort to downloading farmville but ohhh boy, unfortunately my brain is still slightly functional and it lost its appeal in 1 min after planting some wheat..
ValicekB has joined #ruby
<aneurine> If you bite the chain your voice will be uplifted and you will sprout wings that can free you from your painful experience
iwishiwerearobot has joined #ruby
AlexRussia has quit [Changing host]
AlexRussia has joined #ruby
aganov has quit [Read error: Connection reset by peer]
<agent_white> ... for as these chains rattle so will the mountain detaining us.
aganov has joined #ruby
st0mar has joined #ruby
pika_pika has joined #ruby
<aneurine> Actually fear not the cave is part of a giant kids play area and its not really a mountain but its all cool I mean I know its easy to get lost on technicalities, and you havent actually seen the outside of your cave.
jlast has joined #ruby
iwishiwerearobot has quit [Ping timeout: 245 seconds]
<perturbation> this is tripping me out way too much on way too little sleep you guys :/
<aneurine> Oh there is a quakenet
<agent_white> perturbation: Welcome to the club :D
Menorah has quit [Quit: This computer has gone to sleep]
Fraeon has joined #ruby
n008f4g_ has quit [Ping timeout: 245 seconds]
rkalfane has joined #ruby
<aneurine> Lol thanks for the chat Ill leave you to your rubying and go see this quakenet thing..
<agent_white> aneurine: That and efnet are the other "big" ones.
<agent_white> aneurine: \o See ya!
<aneurine> See you all x
xmohmj has joined #ruby
aneurine has left #ruby ["Quit"]
aclearman037 has joined #ruby
foooobear has quit [Quit: (null)]
frem has quit [Quit: Connection closed for inactivity]
jottr has quit [Quit: WeeChat 1.0.1]
apoorvparijat has joined #ruby
mengu has quit [Remote host closed the connection]
davedev2_ has quit [Ping timeout: 258 seconds]
aganov has quit [Quit: Leaving]
aganov has joined #ruby
FooMunki has quit [Quit: FooMunki]
mostlybadfly has joined #ruby
sambao21 has joined #ruby
apeiros_ has joined #ruby
wpp has quit [Read error: Connection reset by peer]
alex88_ is now known as alex88
Akuma has quit [Quit: So long sukkas!]
chinmay_dd has quit [Remote host closed the connection]
tristanp has joined #ruby
Menorah has joined #ruby
kobain has joined #ruby
watermel0n has joined #ruby
mikecmpbll has joined #ruby
jeff-ooh has quit [Remote host closed the connection]
matled has quit [Remote host closed the connection]
davedev24_ has joined #ruby
FooMunki has joined #ruby
anaeem1 has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
chinmay_dd has joined #ruby
dkphenom has joined #ruby
fivetwentysix has joined #ruby
jeff-ooh has joined #ruby
fandi has joined #ruby
phutchins has joined #ruby
jlast has quit [Ping timeout: 264 seconds]
shuber_ has joined #ruby
Menorah has quit [Quit: This computer has gone to sleep]
perturbation has quit [Quit: Leaving]
<pontiki> you are all so attractive, but i have to get ready for work
phutchins has quit [Ping timeout: 265 seconds]
matled has joined #ruby
synergyz_ has joined #ruby
commmmodo has joined #ruby
kl has quit [Ping timeout: 258 seconds]
lzx has joined #ruby
shuber_ has quit [Ping timeout: 272 seconds]
st0mar has quit [Ping timeout: 264 seconds]
tokik has quit [Ping timeout: 244 seconds]
iwishiwerearobot has joined #ruby
synergyz has quit [Ping timeout: 250 seconds]
gauravagarwalr has quit [Remote host closed the connection]
gauravagarwalr has joined #ruby
commmmodo has quit [Ping timeout: 240 seconds]
armyriad has quit [Ping timeout: 240 seconds]
gaboesquivel has joined #ruby
lzx has quit [Ping timeout: 250 seconds]
apoorvparijat has quit [Remote host closed the connection]
anarang has quit [Quit: Leaving]
gauravagarwalr has quit [Ping timeout: 272 seconds]
Alina-malina has quit [Read error: Connection reset by peer]
Alina-malina has joined #ruby
uber_hulk has joined #ruby
agjacome has joined #ruby
dstarh has joined #ruby
livingstn has joined #ruby
beef-wellington has joined #ruby
uber_hulk has left #ruby [#ruby]
arup_r_ has quit [Remote host closed the connection]
rudisimo has joined #ruby
kl has joined #ruby
procat has joined #ruby
arup_r has joined #ruby
dopiee has joined #ruby
BTRE has joined #ruby
Takle has joined #ruby
fandi has quit [Ping timeout: 245 seconds]
triple_b has joined #ruby
dopie has quit [Ping timeout: 256 seconds]
Takle_ has quit [Ping timeout: 244 seconds]
dumdedum has quit [Quit: foo]
fandi has joined #ruby
cina has joined #ruby
gccostabr has quit [Quit: ZZZzzz…]
AlSquirrel has joined #ruby
procat has quit [Ping timeout: 245 seconds]
Nathandim has joined #ruby
<cina> How can I execute a shell command with a given file name, eg `ls '#{filename}'` -- AND make qure and filename is escaped and does not contain quote etc
<cina> ?
andikr has joined #ruby
n80 has joined #ruby
<apeiros_> cina: use e.g. spawn where you can bypass the shell
Sunlorhic has joined #ruby
sinkensabe has quit [Remote host closed the connection]
realli has quit [Quit: Connection closed for inactivity]
jlast has joined #ruby
eichenwald has joined #ruby
Nathandim has quit [Remote host closed the connection]
sankaber has joined #ruby
<cina> apeiros_: why use spawn?
<apeiros_> because then you don't need to escape your arguments.
boboc has joined #ruby
tier has joined #ruby
<cina> apeiros_: that is awesome, I will check it out, thanks!
spyderman4g63 has quit [Remote host closed the connection]
aclearma_ has joined #ruby
spyderman4g63 has joined #ruby
atomi has quit [Remote host closed the connection]
tkuchiki has joined #ruby
<cina> apeiros_: so is there a way to pass the arguments to spawn so it will escape them?
boboc has quit [Remote host closed the connection]
sevenseacat has quit [Remote host closed the connection]
enebo has joined #ruby
rylev has quit [Read error: Connection reset by peer]
spyderman4g63 has quit [Remote host closed the connection]
rylev has joined #ruby
aclearman037 has quit [Ping timeout: 272 seconds]
spyderman4g63 has joined #ruby
nisstyre has joined #ruby
nisstyre has quit [Changing host]
phutchins has joined #ruby
<apeiros_> cina: the point is, that spawn can invoke the process without the shell, so neither you nor spawn need to escape anything. the arguments are fed separately to the program.
<apeiros_> your example: spawn 'ls', filename
<apeiros_> and with e.g. filename='.; rm -rf /' --> ls: .; rm -rf /: No such file or directory
kl__ has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
u- has joined #ruby
n80 has quit [Quit: n80]
<workmad3> same can be done with 'system'
gfawcettpq has quit [Read error: Connection reset by peer]
<workmad3> system "ls", filename
mengu has joined #ruby
mengu has joined #ruby
mary5030 has joined #ruby
st0mar has joined #ruby
kl has quit [Ping timeout: 250 seconds]
gfawcettpq has joined #ruby
pu22l3r has joined #ruby
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
cina has quit [Read error: No route to host]
andikr has quit [Remote host closed the connection]
<apeiros_> workmad3: yes, but capturing the output can't
<workmad3> apeiros_: it can be done in the same way as with spawn, at least in 2.1.5 ;)
<apeiros_> workmad3: ?
sinkensabe has joined #ruby
<apeiros_> oh dear
<workmad3> 'r, w = IO.pipe; system("ls", filename, out: w); w.close; output = r.read'
<apeiros_> let every method do everything!
arup_r has quit [Remote host closed the connection]
<workmad3> system == spawn but block till finished
sambao21 has joined #ruby
<apeiros_> at what point does it block?
dblessing has joined #ruby
<workmad3> system blocks until the command has finished runnig
<apeiros_> because iirc some execs wait until w.close happened
<workmad3> spawn doesn't it returns the pid
<workmad3> *running
tobago has quit [Remote host closed the connection]
n80 has joined #ruby
<apeiros_> so those execs would essentially deadlock with system
<apeiros_> at least iirc prince behaved that way.
renderful has joined #ruby
<apeiros_> (princexml)
<workmad3> yeah, wouldn't surprise me
watermel0n has quit [Ping timeout: 244 seconds]
chthon has quit [Ping timeout: 250 seconds]
cina has joined #ruby
doodlehaus has joined #ruby
pengin has joined #ruby
sambao21 has quit [Client Quit]
<cina> apeiros_: I see, great example, thanks!
sailias has joined #ruby
robertt_dex has joined #ruby
renderful has quit [Ping timeout: 256 seconds]
watermel0n has joined #ruby
sambao21 has joined #ruby
jlast has quit [Ping timeout: 245 seconds]
sailias has quit [Client Quit]
sailias has joined #ruby
agenteo has joined #ruby
mengu has quit [Remote host closed the connection]
allcentury has joined #ruby
pu22l3r has quit [Ping timeout: 255 seconds]
pu22l3r has joined #ruby
tristanp has quit [Remote host closed the connection]
pengin has quit [Remote host closed the connection]
josephndenton has joined #ruby
freerobby has joined #ruby
tvw has quit []
tvw has joined #ruby
daniell has joined #ruby
livingstn has quit [Ping timeout: 240 seconds]
dfas has quit [Ping timeout: 245 seconds]
spider-mario has quit [Read error: Connection reset by peer]
anaeem1 has joined #ruby
gigetoo has quit [Ping timeout: 272 seconds]
sk87 has joined #ruby
j416 has quit [Ping timeout: 245 seconds]
gigetoo has joined #ruby
j416 has joined #ruby
Lingo_ has quit [Quit: Lingo: www.lingoirc.com]
dumdedum has joined #ruby
cina has quit [Quit: leaving]
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
kl__ has quit [Ping timeout: 258 seconds]
spyderman4g63 has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
Takle_ has joined #ruby
procat has joined #ruby
oleo has joined #ruby
hiyosi has joined #ruby
jerius has joined #ruby
mikecmpbll has quit [Ping timeout: 256 seconds]
Takle has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
kl has joined #ruby
charliesome has quit [Quit: zzz]
Inoperable has joined #ruby
rylev has quit [Remote host closed the connection]
tristanp has joined #ruby
Macaveli has joined #ruby
gccostabr has joined #ruby
cantonic has quit [Quit: cantonic]
sea_local has joined #ruby
rshetty has quit [Remote host closed the connection]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
giuseppesolinas has joined #ruby
evanjs has joined #ruby
<shevy> lol
<shevy> princexml
shortCircuit__ has quit [Remote host closed the connection]
sinkensabe has quit [Remote host closed the connection]
charliesome has joined #ruby
nhhagen_ has joined #ruby
jlast has joined #ruby
<GeorgesLeYeti> I try to write a file with File.open(mypath, 'w'){ |f| f.write mydoc }
blizzy has quit [Ping timeout: 255 seconds]
<GeorgesLeYeti> I would like to write with content-type: text/plain but i don't get why it write it with content type: text/x-c++;
jherbst has joined #ruby
<shevy> eh?
TripleDES has joined #ruby
<Hanmac> GeorgesLeYeti: Ruby itself does not care about the content type ... its either the path or the content that sets the type for you
<Hanmac> GeorgesLeYeti: or is that a Rails problem?
Xeago_ has joined #ruby
nickbelhomme has quit [Ping timeout: 272 seconds]
<GeorgesLeYeti> hamakn: then how could i set the content has "text/plain" ?
<jhass> GeorgesLeYeti: files don't have mime type metadata
josephndenton has quit [Ping timeout: 245 seconds]
rylev has joined #ruby
<jhass> some protocols allow you to specify it, some tools guess the mime type from the content of a file
Xeago has quit [Read error: Connection reset by peer]
<jhass> that's about it
<Hanmac> jhass: my partitions "had" metadata ;P
nhhagen has quit [Ping timeout: 244 seconds]
* Hanmac now using dark/black british humor style
byprdct has joined #ruby
<shevy> GeorgesLeYeti your code will work in commandline right?
fmcgeough has joined #ruby
nhhagen_ has quit [Ping timeout: 244 seconds]
Parker0 has joined #ruby
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
<GeorgesLeYeti> shevy: yes
<shevy> btw you have a funny char "mydoc "
kamilc__ has joined #ruby
commmmodo has joined #ruby
theotherstupidgu has quit [Remote host closed the connection]
theotherstupidgu has joined #ruby
it0a has joined #ruby
rismoney1 has joined #ruby
mattmcclure has quit [Quit: Connection closed for inactivity]
chthon has joined #ruby
asterite has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
nickbelhomme has joined #ruby
josephndenton has joined #ruby
sinkensabe has joined #ruby
bayed has joined #ruby
wpp has joined #ruby
cantonic has joined #ruby
yalue has joined #ruby
theotherstupidgu has quit [Ping timeout: 244 seconds]
theotherstupidgu has joined #ruby
cantonic has quit [Client Quit]
kl has quit [Ping timeout: 245 seconds]
tus has joined #ruby
Inoperable has quit [Quit: Rectified]
eichenwald has quit [Quit: Leaving]
_beechnut has joined #ruby
devdazed has joined #ruby
noop has quit [Ping timeout: 250 seconds]
gauravagarwalr has joined #ruby
gauravagarwalr has quit [Read error: Connection reset by peer]
gauravagarwalr has joined #ruby
gauravagarwalr has quit [Remote host closed the connection]
lzx has joined #ruby
tristanp has quit [Remote host closed the connection]
tristanp has joined #ruby
crueber has joined #ruby
gauravagarwalr has joined #ruby
paulfm has quit [Quit: Goodbye]
olivier_bK has joined #ruby
adriancb has joined #ruby
adriancb has quit [Remote host closed the connection]
adriancb has joined #ruby
hamakn has quit [Remote host closed the connection]
n80 has quit [Quit: n80]
paulfm has joined #ruby
chinmay_dd is now known as chinmay_dd|dinne
chinmay_dd|dinne is now known as cdd|dinner
lzx has quit [Ping timeout: 272 seconds]
Channel6 has joined #ruby
jobewan has joined #ruby
shuber_ has joined #ruby
evanjs has quit [Read error: Connection reset by peer]
vinleod has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
evanjs has joined #ruby
agit0 has quit [Quit: Leaving]
n80 has joined #ruby
sinkensabe has quit [Remote host closed the connection]
divi has joined #ruby
kl has joined #ruby
tvw has quit [Read error: Connection reset by peer]
benweint has joined #ruby
sinkensabe has joined #ruby
shuber_ has quit [Ping timeout: 256 seconds]
tristanp has quit [Remote host closed the connection]
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
msull92 has joined #ruby
msull92 has left #ruby [#ruby]
kl has quit [Ping timeout: 264 seconds]
kl has joined #ruby
rismoney1 has quit [Ping timeout: 244 seconds]
mikecmpb_ has joined #ruby
jxf has joined #ruby
red_horned_rihno has joined #ruby
asterite has quit [Quit: asterite]
zorak8 has joined #ruby
mikecmpbll has quit [Ping timeout: 272 seconds]
rylev has quit [Remote host closed the connection]
mloveless has joined #ruby
commmmodo has quit [Quit: commmmodo]
jlast has joined #ruby
Kricir has joined #ruby
mroach has quit [Quit: mroach]
cdd|dinner is now known as chinmay_dd
red_horned_rihno has quit [Quit: Leaving]
arup_r has joined #ruby
apoorvparijat has joined #ruby
gauravag_ has joined #ruby
treehug88 has joined #ruby
chthon has quit [Quit: Ex-Chat]
<shevy> dumdedum
<shevy> more code people!
FooMunki has quit [Quit: FooMunki]
<shevy> we need to outperform perl
gauravagarwalr has quit [Ping timeout: 272 seconds]
charliesome has quit [Quit: zzz]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
wpp has quit [Quit: ZZZzzz…]
kapil__ has quit [Quit: Connection closed for inactivity]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
tristanp has joined #ruby
armyriad has joined #ruby
FooMunki_ has joined #ruby
last_staff has quit [Remote host closed the connection]
giuseppesolinas has joined #ruby
rylev has joined #ruby
StoneCypher has joined #ruby
sinkensabe has quit [Remote host closed the connection]
gccostabr has quit [Quit: See you later!]
chipotle has joined #ruby
jaequery has joined #ruby
nickbelhomme has quit [Ping timeout: 258 seconds]
gsd has joined #ruby
chipotle has quit [Client Quit]
jlast has quit [Remote host closed the connection]
jlast has joined #ruby
DonOtreply has joined #ruby
chipotle has joined #ruby
zarubin has joined #ruby
divi has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rippa has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
chipotle has quit [Client Quit]
divi has joined #ruby
gauravagarwalr has joined #ruby
<shevy> hey godd2
<shevy> I see in the documentation of dare snippets like this used:
<shevy> # @example
<shevy> # image.draw(100, 200)
<shevy> is this rdoc?
GaryOak_ has joined #ruby
jlast has quit [Ping timeout: 245 seconds]
anonymous1582621 has joined #ruby
rismoney1 has joined #ruby
bal1 has quit [Quit: bal1]
rylev has quit [Read error: Connection reset by peer]
comm64 has quit [Remote host closed the connection]
gauravag_ has quit [Ping timeout: 272 seconds]
rylev has joined #ruby
qulo has quit [Ping timeout: 250 seconds]
rshetty has joined #ruby
sambao21 has joined #ruby
duggiefresh has joined #ruby
hmsimha has joined #ruby
jlast has joined #ruby
livathinos has quit [Remote host closed the connection]
fabrice31 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
<jhass> no yard
jlast_ has joined #ruby
jlast has quit [Read error: Connection reset by peer]
anonymous1582621 has left #ruby [#ruby]
max96at|off is now known as max96at
u- has quit [Remote host closed the connection]
gauravagarwalr has quit [Remote host closed the connection]
benweint has quit [Quit: Computer has gone to sleep.]
allcentury has quit [Ping timeout: 250 seconds]
mloveless has quit [Remote host closed the connection]
green-big-frog is now known as frog|OFF
fabrice31 has quit [Ping timeout: 240 seconds]
Akuma has joined #ruby
renderful has joined #ruby
Musashi007 has joined #ruby
charliesome has joined #ruby
commmmodo has joined #ruby
gauravagarwalr has joined #ruby
charliesome has quit [Client Quit]
qulo has joined #ruby
Kricir has quit []
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
agenteo has quit [Quit: agenteo]
geggam has joined #ruby
Techguy305 has joined #ruby
aganov has quit [Remote host closed the connection]
agenteo has joined #ruby
dfinninger has joined #ruby
Joufflu_ has joined #ruby
eduardoboss has joined #ruby
tristanp has quit [Remote host closed the connection]
philwantsfish1 has joined #ruby
philwantsfish has quit [Ping timeout: 256 seconds]
minasmazar has joined #ruby
theotherstupidgu has quit [Ping timeout: 240 seconds]
AFKGeek has quit [Quit: Fades into the shadows]
minasmazar has left #ruby [#ruby]
koderok has joined #ruby
koderok has quit [Remote host closed the connection]
Joufflu has quit [Ping timeout: 258 seconds]
<godd2> hey shevy did you see my tutorial? the live demo is here: http://nicklink483.github.io/dare/tutorial.html
theotherstupidgu has joined #ruby
<godd2> holy crap my repo is at 23 stars
<j2p2> approaching celebrity status
Musashi007 has quit [Ping timeout: 245 seconds]
commmmodo has quit [Quit: commmmodo]
<godd2> godd2 is evolving. godd2 evolved into DHH!
<godd2> godd2 learned "Make bold, unqualified claims"!
tristanp has joined #ruby
chrishough has joined #ruby
<shevy> godd2 eh I am going in baby steps
hamakn has joined #ruby
joonty has quit [Read error: Connection reset by peer]
<shevy> I was distracted by colourized examples, so I had to find out how that was done first :>
joonty has joined #ruby
gauravagarwalr has quit [Ping timeout: 272 seconds]
CustosL1men has quit [Ping timeout: 255 seconds]
aswen has quit [Ping timeout: 245 seconds]
Akuma has quit [Quit: So long sukkas!]
sk87 has joined #ruby
Musashi007 has joined #ruby
mengu has joined #ruby
lmickh has joined #ruby
<shevy> I tried to see whether I could adapt http://www.erikveen.dds.nl/rubywebdialogs/ yesterday, but I gave up. I find its source code really messy
<shevy> godd2 ah ok... I thought this is rdoc
<Timgauthier> i need to travel https://www.youtube.com/watch?v=qcCwJL-1fUU
<shevy> Timgauthier man you are already like flash gordon, you are everywhere... canada... german... south america ... what's next on the list - china? africa?
<shevy> *germany rather
<Timgauthier> i'd love too go to africa
freerobby has quit [Quit: Leaving.]
<shevy> lol osttirol... that's in austria
mikepack has joined #ruby
n008f4g_ has joined #ruby
freerobby has joined #ruby
hobodave has joined #ruby
allcentury has joined #ruby
chrishough has quit [Quit: Textual IRC Client: www.textualapp.com]
hobodave has quit [Client Quit]
<shevy> Timgauthier yeah true savages
chrishough has joined #ruby
<shevy> but they gots smartphones!
hobodave has joined #ruby
mengu has quit [Ping timeout: 264 seconds]
<Timgauthier> lol
<Timgauthier> they're crazy
<Timgauthier> i wonder how many people get hurt each year during this
chipotle has joined #ruby
jaequery has joined #ruby
<shevy> dunno... snow on the ground makes this all rather fluffy
<shevy> but man, they are destroying the clothes!
<Timgauthier> those throws look pretty brutal regardless of snow
<Timgauthier> and it is insane seeing how much the guys in the costumes overpower the other people, even one on one
amundj has quit [Ping timeout: 256 seconds]
Musashi007 has quit [Ping timeout: 255 seconds]
Megtastique has joined #ruby
obscured has joined #ruby
<shevy> Timgauthier lol yeah almost like they took judo sessions
tristanp has quit [Remote host closed the connection]
<Timgauthier> not just took em, but are actually decent at it
<shevy> dunno, most of the other people looked thin and weak except for that one tall guy in the first part
<shevy> Timgauthier but if you go just a tad more west you'll see swiss wrestling, that's even scarier if you look at these guys https://www.youtube.com/watch?v=XRJQpXMAm3E
pecg has joined #ruby
surs has quit [Quit: leaving]
Megtastique has quit [Client Quit]
gauravagarwalr has joined #ruby
jaequery has quit [Client Quit]
gauravagarwalr has quit [Remote host closed the connection]
gauravagarwalr has joined #ruby
<shevy> so now you know what apeiros does in his spare time
Musashi007 has joined #ruby
_maes_ has joined #ruby
tier has quit [Remote host closed the connection]
hamakn has quit [Remote host closed the connection]
soulcake has quit [Quit: Quack.]
<Timgauthier> the translation of this german is terrible lol
<Timgauthier> haha yeah?
nhhagen has joined #ruby
jdj_dk has joined #ruby
nhhagen has quit [Remote host closed the connection]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qulo has quit [Quit: Leaving]
soulcake has joined #ruby
dstarh has quit [Quit: Textual IRC Client: www.textualapp.com]
Takle_ has quit [Remote host closed the connection]
Takle has joined #ruby
<shevy> it's a difficult dialect indeed
<apeiros_> shevy: I actually prefer judo over schwingen
<shevy> hehehe
<Timgauthier> shevy no, just the translated english is terrible lol
renderful has quit [Remote host closed the connection]
<Timgauthier> "mate*
<Timgauthier> apeiros_ do you do judo regularly?
sandelius has joined #ruby
kedare has quit [Quit: WeeChat 0.4.2]
<apeiros_> Timgauthier: I did judo for ~15y, but haven't for ~10y now
tkuchiki has quit [Remote host closed the connection]
<BaNzoune1> Hey, when you create a udp socket using UDPSocket.new how the sender port is selected? Can we choose it? (For example If I open a socket on 172.17.0.55:24224, and then I use tcpdump too see what's going on, I see this : 10.0.10.6.53225 > 172.17.0.55.24224, how is 53225 chosen? )
gauravag_ has joined #ruby
tkuchiki has joined #ruby
Takle has quit [Ping timeout: 258 seconds]
gaurava__ has joined #ruby
jdj_dk has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
jimmyhoughjr has quit [Quit: Textual IRC Client: www.textualapp.com]
iamninja has quit [Remote host closed the connection]
gauravagarwalr has quit [Ping timeout: 272 seconds]
iamninja has joined #ruby
Parker0 has quit [Ping timeout: 264 seconds]
Xeago_ has quit [Remote host closed the connection]
divi has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gauravag_ has quit [Ping timeout: 272 seconds]
tkuchiki has quit [Ping timeout: 250 seconds]
dcheung has joined #ruby
dcheung has left #ruby [#ruby]
renderful has joined #ruby
Megtastique has joined #ruby
snath has quit [Ping timeout: 245 seconds]
ferr has joined #ruby
mloveless has joined #ruby
sente_ has joined #ruby
AlSquirikou has joined #ruby
bears has quit [Remote host closed the connection]
hamakn has joined #ruby
Mia has quit [Read error: Connection reset by peer]
hamakn has quit [Remote host closed the connection]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
AlSquirrel has quit [Ping timeout: 250 seconds]
apeiros_ has quit [Remote host closed the connection]
gauravagarwalr has joined #ruby
apeiros_ has joined #ruby
kl has quit [Ping timeout: 264 seconds]
sambao21 has joined #ruby
divi has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
charliesome has joined #ruby
zorak8 has quit [Ping timeout: 258 seconds]
Menorah has joined #ruby
spastorino has joined #ruby
gaurava__ has quit [Ping timeout: 272 seconds]
<agent_white> BaNzoune1: It's chosen at random by your OS.
Menorah has quit [Client Quit]
freerobby has quit [Quit: Leaving.]
LouisRoR has quit [Ping timeout: 272 seconds]
sambao21 has quit [Client Quit]
apeiros_ has quit [Ping timeout: 245 seconds]
krz has quit [Quit: WeeChat 1.0.1]
kl has joined #ruby
ponga has quit [Quit: Leaving...]
pietr0 has joined #ruby
fandi has quit [Ping timeout: 250 seconds]
sambao21 has joined #ruby
lzx has joined #ruby
<BaNzoune1> agent_white: okay, thanks ;)
gsd has joined #ruby
red_horned_rihno has joined #ruby
joonty has quit [Quit: Leaving]
ferr has quit [Ping timeout: 272 seconds]
spyderman4g63 has quit [Ping timeout: 250 seconds]
<agent_white> BaNzoune1: Yup! Not sure what you're running on... but I was digging around a bit and "apparently" Windows is incremental in dispensing ports to use, whereas *nix just throws a random port at you.
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
jheg has quit [Quit: jheg]
timonv_ has quit [Remote host closed the connection]
rylev has quit [Remote host closed the connection]
<GeorgesLeYeti> Hi again
msgodf has quit [Remote host closed the connection]
lzx has quit [Ping timeout: 265 seconds]
<GeorgesLeYeti> still the same problem. But now i identify why. Actually if any line in my document start but class then the content-type became: text/x-c++
pecg has left #ruby [#ruby]
Timgauthier is now known as timgauthier_away
sarmiena_ has joined #ruby
<GeorgesLeYeti> Other cases: if any line start by char / struct / double (i guess they might be other stuff ) then the content type become: text/x-c
kiyote23 has joined #ruby
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
PierreRambaud has quit [Remote host closed the connection]
fandi has joined #ruby
<GeorgesLeYeti> and last case is if it start by program then it become text/x-pascal
commmmodo has joined #ruby
<GeorgesLeYeti> Is there anyway to "force' content type to text/plain or prevent all these cases
alex88 has quit []
frog|OFF is now known as green-big-frog
<BaNzoune1> agent_white: An edge case, with docker & fluentd, fluentd responds to a heartbeat on the port that the os choose, and by default all port are closed with docker (and since I don't know where it will come I can't simply open 1 port), so the response never reach. I don't know if that understandable
thoughnut has joined #ruby
mitchel_nl has joined #ruby
rdark has quit [Quit: leaving]
<jhass> GeorgesLeYeti: as K sa
<jhass> sorry, hit enter too soon
<mitchel_nl> Hi, I installed mailcatcher with 'gem install mailcatcher' how can I find the location of it?
Tranquility has joined #ruby
<jhass> GeorgesLeYeti: as I said, content type is determined by whatever is showing you it, so it depends on what is showing you it
dfinninger has quit [Remote host closed the connection]
dopiee is now known as dopie
<BaNzoune1> (there is solution in docker to not containerize the container's network but I'd prefere avoiding that)
renderfu_ has joined #ruby
<jhass> mitchel_nl: gem which mailcatcher
dopie has quit [Quit: Leaving]
Xeago has joined #ruby
econerd4ever has joined #ruby
dopie has joined #ruby
<mitchel_nl> @jhass: ERROR: Can't find ruby library file or shared library mailcatcher
gauravag_ has joined #ruby
<jhass> mitchel_nl: gem list has it though?
<mitchel_nl> @jhass: yes, mailcatcher (0.5.12)
<mitchel_nl> jhass: Its also in the dir "/opt/ruby-1.9.3-p551/bin/"
<jhass> weird, it seems to have a mailcatcher.rb (https://github.com/sj26/mailcatcher/blob/master/lib/mailcatcher.rb)
<jhass> so that should work
<agent_white> BaNzoune1: Hmmm... wish I could help but I'm actually not familiar with docker at all!
<GaryOak_> does anyone know of a ruby clone of scrapy or another similar framework?
<mitchel_nl> jhass: What do I have to do?
sailias has quit [Quit: Leaving.]
gauravagarwalr has quit [Ping timeout: 272 seconds]
<jhass> oh, the release is ancient, try gem which mail_catcher mitchel_nl
dumdedum has quit [Quit: foo]
maletor has joined #ruby
Soda has quit [Remote host closed the connection]
renderful has quit [Ping timeout: 264 seconds]
sailias has joined #ruby
<mitchel_nl> jhass: Oh yea that returns "/opt/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/mailcatcher-0.5.12/lib/mail_catcher.rb"
<jhass> answers your question then? :)
<mitchel_nl> jhass: But do you know what "/opt/ruby-1.9.3-p551/bin/mailcatcher" is?
LouisRoR has joined #ruby
lxsameer has quit [Quit: Leaving]
leo-unglaub has quit [Remote host closed the connection]
<GeorgesLeYeti> jhass: i'm sorry but still pretty lost. If i just remove in my file every line which start by the string "double" then my content-type while become text/plain
<jhass> GeorgesLeYeti: you never described your actual problem...
allcentury has quit [Ping timeout: 265 seconds]
DonOtreply has quit [Quit: DonOtreply]
<mitchel_nl> jhass: And can I call "/opt/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/mailcatcher-0.5.12/lib/mail_catcher.rb" to run it?
sea_local has quit [Remote host closed the connection]
<jhass> mitchel_nl: no, you probably call the file you found earlier
adriancb has quit [Remote host closed the connection]
<jhass> note I didn't even look at its readme that probably explains how to use it...
Musashi007 has quit [Ping timeout: 264 seconds]
LouisRoR has quit [Ping timeout: 255 seconds]
<GeorgesLeYeti> jhass: yes sorry you right. I have a wysiwyg text editor in my ruby on rails web application. User can edit hist text and then export it in txt. One of my user need to use this exportation for something else (sorry no idea why).
<mitchel_nl> jhass: I can't call "mailcatcher"
<GeorgesLeYeti> And he said that sometimes it works but in some other cases it didn't works coz the content-type is not "set" to text/plain
<jhass> mitchel_nl: most likely because the directory the file you found earlier is in, is not in your PATH
mikecmpb_ has quit [Quit: i've nodded off.]
<jhass> so you either have to add it there or use the fullpath
<GeorgesLeYeti> *it didn't work
AlSquirikou has quit [Quit: This computer has gone to sleep]
kiyote23 has quit [Remote host closed the connection]
theotherstupidgu has quit [Ping timeout: 245 seconds]
<jhass> GeorgesLeYeti: make sure to set the Content-Type header in your app explicitly then, while delivering the file, not while writing it (that's not possible), and not let $whatever_you_use_to_deliver_it guess it
procat has quit [Ping timeout: 264 seconds]
bricker`work has joined #ruby
theotherstupidgu has joined #ruby
atomi has joined #ruby
sandelius has quit [Read error: Connection reset by peer]
sambao21 has quit [Quit: Computer has gone to sleep.]
<GeorgesLeYeti> jhass: ok. Fot this specific client i have to put it for him on his ftp so i use net/ftp
<GeorgesLeYeti> jhass: ty a loty
<GeorgesLeYeti> a lot
gizmore has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<bricker`work> In your opinion, for a JSON API, are Javascript timestamps or unix timestamps better for time attributes?
ycodr has quit [Remote host closed the connection]
Musashi007 has joined #ruby
<godd2> id say it depends on whose talking and listening
rimantas has quit [Quit: rimantas]
pygospa has quit [Ping timeout: 240 seconds]
<kl> Why does nobody in Ruby use dependency injection frameworks?
<godd2> but id also say to specify the format somewhere in the json
apeiros_ has joined #ruby
deric_skibotn has joined #ruby
<jhass> kl: I guess because ruby is dynamic enough so that the pain of not doing it isn't as big
adriancb has joined #ruby
pygospa has joined #ruby
adriancb has quit [Remote host closed the connection]
adriancb has joined #ruby
Takle has joined #ruby
Hanmac has quit [Quit: Leaving.]
roolo has quit [Remote host closed the connection]
Takle has quit [Remote host closed the connection]
roolo has joined #ruby
Takle has joined #ruby
rismoney1 has quit [Ping timeout: 272 seconds]
n80 has quit [Quit: n80]
pushpak has joined #ruby
dANO has quit []
n80 has joined #ruby
jdj_dk has joined #ruby
GeorgesLeYeti has quit [Quit: Leaving]
Xeago has quit [Remote host closed the connection]
thumpba has joined #ruby
<kl> jhass: there's still pain
timonv_ has joined #ruby
<jhass> sure, my guess is just that's it's not enough
<kl> jhass: strange. It's not like they're hard to use. What really made me realise is when I was writing a controller;
<jhass> like "oh, I can't test this without DPI, I can't move beyond this", but we got "Ok, I have to do this ugly hack but anyway, let's move on"
Musashi007 has quit [Ping timeout: 256 seconds]
Techguy305 has quit [Ping timeout: 245 seconds]
<kl> jhass: (web, as per MVC) - it had to create an object, which had a bunch of dependencies
sambao21 has joined #ruby
<kl> wasn't proper to have the dependency graph instantiated in that file
thumpba_ has joined #ruby
Takle has quit [Ping timeout: 258 seconds]
<apeiros_> kl: what are your suggested use-cases?
roolo has quit [Ping timeout: 264 seconds]
<kl> apeiros_: take the one I just mentioned
<apeiros_> or specific examples where a DI framework would alleviate pain?
<shevy> kl how do you model your dependencies? based on subclassing, based on module-inclusion, or both?
<apeiros_> kl: I mean as in "this is how you'd do it without DI, this is how you'd do it with, and this is why that's better"
thumpba has quit [Ping timeout: 250 seconds]
snath has joined #ruby
<kl> apeiros_: without DI, my controller instantiates an entire dependency graph for to create the thing I want to call when my route is accessed in Sinatra. With DI: all of that logic would not be in the controller/
Musashi007 has joined #ruby
<workmad3> kl: so create an object that encapsulates all that logic
<kl> shevy: parameters
<workmad3> kl: and simply use that in the controller
<apeiros_> kl: I don't see why not having DI mandates that?
sandelius has joined #ruby
<apeiros_> sounds more like an SRP failure to me
Macaveli has joined #ruby
<apeiros_> maybe it's just too vague for me to see it, though
<kl> apeiros_: it *is* an SRP failure when you have that stuff in the controller.
<Macaveli> how do I get the answer_text from this? => {"ANSWER"=>{"ANSWER_ID"=>"50008059", "ANSWER_TEXT"=>"Ant 1"}}
ghostmoth has joined #ruby
<kl> apeiros_: a controller should not know how to create all the dependencies (and their dependencies) of the thing it wants to invoke a method on
<apeiros_> >> hash = {"ANSWER"=>{"ANSWER_ID"=>"50008059", "ANSWER_TEXT"=>"Ant 1"}}; hash["ANSWER"]["ANSWER_TEXT"]
<eval-in__> apeiros_ => "Ant 1" (https://eval.in/236339)
<workmad3> kl: the main problem I feel DI frameworks alleviate in something like java is that java is a crappy configuration language, so moving that config out of java is nice
<apeiros_> Macaveli: ^
jimmyhoughjr has joined #ruby
<Macaveli> cool
<Senjai> apeiros_: *mic drop*
sambao21 has quit [Ping timeout: 245 seconds]
charliesome has quit [Quit: zzz]
<kl> workmad3: I did that at first. Then I realised I'd be creating such a weird adapter for every thing that my controller uses. And it's a bit like I'm creating a crappy DI framework.
<sandelius> Is it required to connect sidekiq inside puma config (on_worker_boot) when using several workers?
<Macaveli> apeiros_ -> Is it possible to detect ["ANSWER_TEXT"] INSTEAD of going like "question["ANSWERS"].first["ANSWER"]["ANSWER_TEXT"]"
<Senjai> sandelius: Please mention when you crosspost to multuple channels
<Senjai> sandelius: Otherwise apeiros_ will eat your children
<apeiros_> Macaveli: where do you see a .first in what I wrote?
gauravagarwalr has joined #ruby
allcentury has joined #ruby
<apeiros_> sandelius, Senjai: actually I'll otherwise just kick
<Senjai> apeiros_: That's just what you told the police
<apeiros_> sandelius: and haven't people told you already? I have no issues banning people…
<Macaveli> apeiros_ I made it since question is this: https://gist.github.com/YOUConsulting/98a60dfae858bc6699fa
devoldmx33 has joined #ruby
<workmad3> kl: so you'd rather what... have that exact same information expressed in XML or YML for every controller?
<sandelius> apeiros_ ? never heard anything like that. ThoughtI could do it since it can be both a rails anf ruby question...
tubuliferous has joined #ruby
<apeiros_> sandelius: that's not the point of contention.
havenwood has joined #ruby
<apeiros_> sandelius: the point is that people waste their time trying to help somebody who already got help elsewhere and didn't bother to tell.
<Senjai> sandelius: The point is that you should mention that you're crossposting. So people can help you mostly on one channel
<workmad3> apeiros_: didn't there used to be a note about cross-posting in the topic?
<sandelius> apeiros_ Senjai did not know that.
<apeiros_> sandelius: if you'd *pay* those people for their time I wouldn't care.
<sandelius> Please donät eat my children...
n80 has quit [Quit: n80]
einarj has quit [Remote host closed the connection]
<jhass> workmad3: as if anybody who doesn't know reads the topic...
<apeiros_> workmad3: I don't think so, no?
gauravag_ has quit [Ping timeout: 272 seconds]
<apeiros_> thanks to DO, I might put up a server again with FAQ & etiquette and link that
<kl> workmad3: http://pimple.sensiolabs.org/ is an example in PHP. No XML/YAML
agenteo has quit [Quit: agenteo]
<apeiros_> why do I get the feeling that you want to code java in ruby…
<banister> apeiros_ sup stef
<workmad3> kl: that code makes me want to vomit, tbh
<workmad3> kl: and only partly because it's in PHP :P
<apeiros_> banister: broken pry wtf!
<apeiros_> that's up :(
<apeiros_> can't properly repro, though
<banister> apeiros_ how come bb what happened
LouisRoR has joined #ruby
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jdj_dk has quit [Remote host closed the connection]
<apeiros_> only had source/lines of pry in the backtrace, while it was an exception from one of my classes
Musashi007 has quit [Ping timeout: 265 seconds]
<kl> workmad3: mainly because it's PHP, I'd bet. Because Pimple is basically just a hash
<banister> apeiros_ oh yeah, i'tll be a plugin issue
<banister> apeiros_ pry-byebug
Musashi007 has joined #ruby
<workmad3> kl: it's also the number of hoops to jump through to get your hands on something
lbrf has joined #ruby
<apeiros_> banister: no byebug in this project
<apeiros_> plain pry & pry-doc
statbot has joined #ruby
<apeiros_> the new gc counter stuff is quite nice… I hope I can properly instrument my new framework :D
<banister> apeiros_ wow weird, if u can repro i'm really interested
<apeiros_> banister: thought so :D
<apeiros_> but had no internet and I kind of preferred to move on over figuring what was wrong with pry
<banister> epitron btw was it you who got pry-doc working on aribtrary ruby versions?
<apeiros_> and now I don't get it anymore
<banister> apeiros_ ah ok
<banister> apeiros_ i think i noticed an issue with really late versions of ruby
<banister> but i couldn't repro it reliably either
<apeiros_> late == new?
<epitron> banister: yeah, minus being able to actually package it into a gem
<banister> yeah
<apeiros_> I use 2.1.5
<apeiros_> planning to move to 2.2 head
<banister> epitron you're awesome, came in handy recently, thx bb
<apeiros_> given that it'll be out soon anyway
<apeiros_> know what? I'll do that now :D
<epitron> woot!
<banister> apeiros_ are you excited about the 'itself' method?
<banister> lamest name ever
<banister> but pretty cool
<apeiros_> banister: not really. I think I'd have used it like 3 or 4 times so far
<epitron> epitools has had itself for years
<apeiros_> but it's a good addition
<epitron> it's called self
<apeiros_> I'd prefer proper collation
<apeiros_> and some other things
<apeiros_> banister: I'm most excited over fast keyword arguments
<banister> apeiros_ what'c ollation?
<apeiros_> banister: whether "a" or "ä" is sorted first
<banister> i use itself with group_by, group_by(&:itself)
<banister> apeiros_ oh that's just for those weird european langauges, no one really speaks those (except for those weird europeans)
<apeiros_> banister: it's for all languages ;-)
<havenwood> banister: ditto with group_by, by does make me wonder why that cant just be the default group_by behavior
anaeem1 has quit [Remote host closed the connection]
<apeiros_> banister: e.g. japanese, chinese, russian…
<banister> havenwood in rails i've been using 'presence' as a poor man's itself
<epitron> I made a method for group_by &:itself, called grouped
<epitron> :)
<banister> epitron you're 9 years ahead of the curve
anaeem1_ has joined #ruby
<apeiros_> grrr, rvm doesn't let me upgrade ruby-head
<epitron> damn curves
wallerdev has joined #ruby
Musashi007 has quit [Ping timeout: 255 seconds]
frem has joined #ruby
<epitron> havenwood: default is a good idea too
<epitron> that's how each works!
sambao21 has joined #ruby
<banister> epitron i'm starting to really like ''presence'
<banister> you used it much?
asmodlol has quit [Ping timeout: 265 seconds]
<epitron> >> (1..10).map.to_a
<eval-in__> epitron => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (https://eval.in/236340)
<banister> you can do shit like: user.first_name.presense || defualt_name
gauravag_ has joined #ruby
sea_local has joined #ruby
pzzn has joined #ruby
<epitron> banister: never used it
asmodlol has joined #ruby
icarus has joined #ruby
<epitron> how is that different from first name?
commmmodo has quit [Quit: commmmodo]
watermel0n has quit [Quit: Busy]
n80 has joined #ruby
<epitron> does it convert "" to nil?
<apeiros_> epitron: yes
<apeiros_> it's obj.present? ? obj : nil
<epitron> ahh
Musashi007 has joined #ruby
<epitron> I'll keep it in mind
chipotle has quit [Quit: cheerio]
<epitron> I wrote a blank? method for that
divi has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gauravagarwalr has quit [Ping timeout: 272 seconds]
<havenwood> self unless respond_to?(:empty) ? !!empty? : !self
<workmad3> epitron: present? in rails is written as '!blank?' ;)
agenteo has joined #ruby
<apeiros_> blank? present? etc. are fig leaves for not having proper param sanitation
anaeem1_ has quit [Remote host closed the connection]
<havenwood> :empty?*
<apeiros_> havenwood.empty?
anaeem1_ has joined #ruby
<havenwood> #=> true
TripleDES has quit [Remote host closed the connection]
<apeiros_> # => false
<apeiros_> oh
crueber has quit [Quit: Leaving.]
anaeem1_ has quit [Remote host closed the connection]
<apeiros_> apeiros_.shallow? # => true
<havenwood> :P
<workmad3> apeiros_.soul.empty?
tristanp has joined #ruby
<apeiros_> NoMethodError: undefined method `empty?' for nil:NilClass
fabrice31 has joined #ruby
<workmad3> hehe
<apeiros_> how could the source of all have a soul?
chipotle has joined #ruby
<havenwood> snap
Skippycat has joined #ruby
djbkd has joined #ruby
<jalcine> you'd be surprised
gauravag_ has quit [Remote host closed the connection]
<workmad3> apeiros_: 'the source of all' could easily be defined as entirely soul :P
chipotle has quit [Read error: Connection reset by peer]
DonOtreply has joined #ruby
<workmad3> apeiros_: which is good, because I believe in neither ;)
chipotle has joined #ruby
<workmad3> which means I'm now talking to an imaginary friend...
<workmad3> typical :)
<apeiros_> workmad3: then everything in existence would be soul
<apeiros_> unless you say that soul can be converted to soulless
tier has joined #ruby
st0mar has quit [Ping timeout: 245 seconds]
<workmad3> apeiros_: I'm too braindead for theology right now :)
gfawcettpq has quit [Remote host closed the connection]
hamakn has joined #ruby
<havenwood> workmad3: that's the perfect state
<havenwood> for it
* apeiros_ wonders whether "everything in existence is soul" qualifies as pantheism
entrenador has joined #ruby
Soda has joined #ruby
<workmad3> apeiros_: or whether you've just redefined 'soul' as 'matter' :)
<epitron> workmad3: lolol
SHyx0rmZ has quit [Remote host closed the connection]
<havenwood> apeiros_: blame Spinoza
<apeiros_> :(
<workmad3> right, I'm hungry
<havenwood> the Dutch!
<workmad3> I'm gonna go have some soul pasta
<apeiros_> thank you for reminding me about my glaring education holes
Takle has joined #ruby
fabrice31 has quit [Ping timeout: 264 seconds]
<apeiros_> workmad3: the noodly holiness approves of that dinner
<workmad3> apeiros_: we remind you so that you can google them closed ;)
jaequery has joined #ruby
SHyx0rmZ has joined #ruby
<apeiros_> workmad3: bah. I want to read his works. not a condensed 1-pager on WP
jaequery has quit [Max SendQ exceeded]
keen___________5 has joined #ruby
jaequery has joined #ruby
agjacome has quit [Quit: leaving]
<workmad3> apeiros_: the few times I've bothered to read the full works with philosophy, I've been woefully disappointed because the 1-pager on WP gave the same information without requiring my brain to go all twisty
asteros has joined #ruby
<apeiros_> heh
timonv_ has quit [Read error: Connection reset by peer]
keen___________4 has quit [Ping timeout: 272 seconds]
hamakn has quit [Ping timeout: 240 seconds]
<apeiros_> yeah, sadly it seemed to be fashionable in certain times to write even the simplest thoughts in the most complex way possible.
Spami_ has quit [Quit: This computer has gone to sleep]
msull92 has joined #ruby
<havenwood> philosophy isn't the only field guilty of that! looking at you computer science!
<havenwood> big fancy words, simple concepts
<apeiros_> we have a tendency to clean our act, though. no?
<apeiros_> na, you're talking about marketing
<havenwood> mm
<workmad3> havenwood: CS doesn't do it half as badly as modernish philosophy... or literary criticism...
<apeiros_> and of course, all fields have toppers & boasters
BaNzoune1 is now known as BaNzounet
<deepy> havenwood: no need to worry, I have a friend who actively reduces fancy concepts into meaningful everyday concepts
<apeiros_> IMO politicians have developed this art to its highest form - they essentially now use the most complex explanations for no thought at all.
<deepy> binary bisection turned into half-halfer searcher
<workmad3> deepy: I'm not sure that's any better :P
msull92 has quit [Read error: Connection reset by peer]
<deepy> workmad3: you should see his suite on searching algorithms
ghanaz has joined #ruby
<ghanaz> what is the most efficient way to create a checker board?
<workmad3> anyway, my pasta is calling
<workmad3> later all
<ghanaz> i would like to create a method that makes a checker board
<apeiros_> ghanaz: take a piece of wood and paint it?
kenneth has joined #ruby
<chu> apeiros_: :)
<apeiros_> ghanaz: I think you'll have to tell us how you want the result to look like.
<ghanaz> i wish it was that simple in ruby
<deepy> ghanaz: two-dimensional list?
<ghanaz> yeah, a 2d array with 64 elements
ballpointcarrot has joined #ruby
<apeiros_> Array.new(8) { Array.new(8) }
Musashi007 has quit [Ping timeout: 265 seconds]
<havenwood> ghanaz: Checkers only go on the black squares. The white square are decoration.
<ghanaz> oh thank you so much! so i'm going to put that in my initialize mentod
asmodlol has quit [Ping timeout: 240 seconds]
<deepy> On a sidenote, the very same friend mentioned earlier wrote a chess game for an assignment, refusing to accept common norms he did not make two lists but instead keep track of the position of each piece. He forgot to add boundaries, the board become infinite
<apeiros_> havenwood: black squares are traps
nateberkopec has quit [Ping timeout: 244 seconds]
<ghanaz> this is a bit of a dumb question but why is there a block for the array? is there another way to do it 8 times?
bayed has quit [Quit: Connection closed for inactivity]
<apeiros_> stand on one for more than 3 turns and the unit will die.
asmodlol has joined #ruby
<apeiros_> ghanaz: Array.new(8, []), but this will contain 8 times *the same copy* of an array inside.
<ghanaz> that actually sounds fair because checkers is a lot like tic tac toe
<ghanaz> apeiros_: and if i wanted to include white pieces i could use the modulus operator for that right? something like 2 % == 1
behrz has joined #ruby
<apeiros_> now stop asking questions! let me rewrite my migration class to use the two-user approach (schema user + app user)
<ghanaz> thanks have fun!
<apeiros_> j/k
workmad3 has quit [Ping timeout: 255 seconds]
jdj_dk has joined #ruby
<apeiros_> ghanaz: you mean you want your arrays to be [true, false, true, false, …]?
Musashi007 has joined #ruby
<agent_white> strace goes too fast for me to feed it to ruby :(
n1lo has joined #ruby
lolmaus has joined #ruby
<wasamasa> what does that even mean
<ericwood> IO doesn't work that way
<apeiros_> ghanaz: Array.new(8) { |y| Array.new(8) { |x| x % 2 == y % 2 } }
sea_local has quit [Remote host closed the connection]
freerobby has joined #ruby
Tamae has joined #ruby
djbkd has quit [Remote host closed the connection]
<agent_white> I'm trying to "tail" strace's output file with ruby so I can colorize it and make it pretty.
<ericwood> you won't see immediate output because of buffering, but that's inherent everywhere
<ericwood> agent_white: what terminal emulator are you using?
yalue has quit [Ping timeout: 245 seconds]
<agent_white> ericwood: urxvt
<ericwood> hmmmm okay
sanguisdex has quit [Quit: Leaving.]
<agent_white> I know I can egrep it instead and colorize it
<ericwood> in iTerm2 there's a cool thing with highlighting on regex matches that I use a ton
<agent_white> But I thought it would be cool to see if I could get it to work with ruby.
rismoney1 has joined #ruby
asmodlol has quit [Ping timeout: 250 seconds]
<ericwood> if you're willing to put up with a tad bit of lag it's doable
roger_rabbit has quit [Changing host]
roger_rabbit has joined #ruby
<ericwood> it just won't be 100% realtime
<ericwood> but all of the data will make it through
ixti has quit [Ping timeout: 265 seconds]
<agent_white> Oh really? I guess I should've just waited a bit for it to catch up eh?
spyderman4g63 has joined #ruby
djbkd has joined #ruby
<ericwood> well it should only be a small delay
djbkd has quit [Remote host closed the connection]
keen___________6 has joined #ruby
djbkd has joined #ruby
keen___________5 has quit [Ping timeout: 250 seconds]
asmodlol has joined #ruby
sanguisdex has joined #ruby
v0n has quit [Ping timeout: 256 seconds]
Musashi007 has quit [Ping timeout: 250 seconds]
stunder has joined #ruby
crueber has joined #ruby
Musashi007 has joined #ruby
kirun has joined #ruby
Takle has quit [Remote host closed the connection]
<ghanaz> how do i set this to nil values?
<ghanaz> Array.new(8) { Array.new(8) }
<ericwood> >> Array.new(8)
<eval-in__> ericwood => [nil, nil, nil, nil, nil, nil, nil, nil] (https://eval.in/236345)
<ericwood> by default they're nil
<ghanaz> oh shit, thianks :)
<ghanaz> now i need alternating squares
<wallerdev> wasnt this already answered
sailias has quit [Quit: Leaving.]
<ericwood> >> Array.new(8) { Array.new(8) }
<eval-in__> ericwood => [[nil, nil, nil, nil, nil, nil, nil, nil], [nil, nil, nil, nil, nil, nil, nil, nil], [nil, nil, nil, nil, nil, nil, nil, nil], [nil, nil, nil, nil, nil, nil, nil, nil], [nil, nil, nil, nil, nil, nil, n ... (https://eval.in/236346)
<ericwood> yes it was :P
<ghanaz> yes thanks guys i'm a noob
<ghanaz> it was already answered, but i didn't know they were nil by default i really have no idea what i'm doing
<wallerdev> its okay, we all started from that point :p
djbkd has quit [Remote host closed the connection]
lemur has joined #ruby
<ghanaz> that's so encouraging wallerdev
<ghanaz> :)
lbrf has quit [Quit: Be back later ...]
procat has joined #ruby
<apeiros_> 19:25 apeiros_: ghanaz: Array.new(8) { |y| Array.new(8) { |x| x % 2 == y % 2 } }
<apeiros_> alternating squares, 15min ago :-p
red_horned_rihno has quit [Ping timeout: 240 seconds]
arietis has joined #ruby
red_horned_rihno has joined #ruby
<ericwood> neat, didn't realize Array#new passed any block args
tier has quit [Ping timeout: 264 seconds]
ixti has joined #ruby
<ghanaz> that is really cool! thanks a lot apeiros_
<agent_white> Ooo
aswen has joined #ruby
rshetty has quit [Remote host closed the connection]
lemur has quit [Remote host closed the connection]
lemur has joined #ruby
<arup_r> >> a = () ; p a
<eval-in__> arup_r => nil ... (https://eval.in/236347)
<arup_r> what is this ?
nclbr has joined #ruby
<arup_r> what that `()` means ?
<ghanaz> arguments
<arup_r> where is the method ?
<ghanaz> it takes in no argumetns, parameters
<ericwood> hmmm I'd actually assume that would error...crazy
<arup_r> ^^ +1
<ericwood> >> a = (); a.class
<eval-in__> ericwood => NilClass (https://eval.in/236348)
djbkd has joined #ruby
<agent_white> Ooo
<apeiros_> it is an empty expression
nclbr has quit [Client Quit]
<ericwood> oh duh
<agent_white> >> Array.new(8) { Array.new(8) { (Time.now.hash % Time.now.hash > 1) }}
<eval-in__> agent_white => [[true, true, false, true, true, true, false, true], [false, true, false, true, true, true, true, true], [false, false, false, false, false, false, false, true], [true, false, true, true, true, true, t ... (https://eval.in/236349)
tier has joined #ruby
<agent_white> neat
<apeiros_> agent_white: personal experiments. pry.
<ghanaz> apeiros_: how do would i print them out instead of having the object id printed out?
<agent_white> apeiros_: Hehe sorry.
<arup_r> >> p defined?(1+2)
<eval-in__> arup_r => "method" ... (https://eval.in/236350)
<apeiros_> ghanaz: what have you tried?
<ghanaz> puts @board
<arup_r> This should be an expression
asteros has quit [Quit: asteros]
nateberkopec has joined #ruby
<arup_r> >> p defined?(())
<eval-in__> arup_r => "nil" ... (https://eval.in/236351)
<apeiros_> ghanaz: and how do you want your output to look like?
<arup_r> crazy!!!
asteros has joined #ruby
dc_ has joined #ruby
apoorvparijat has quit [Remote host closed the connection]
econerd4ever has quit [Remote host closed the connection]
econerd4ever has joined #ruby
<arup_r> >> p RUBY_VERSION
<eval-in__> arup_r => "2.1.3" ... (https://eval.in/236352)
<arup_r> Ok..
lemur has quit [Ping timeout: 264 seconds]
<arup_r> Something is wrong
gauravagarwalr has joined #ruby
<arup_r> previously I found defined?(1+2) kind of things to return as expression... it seems got changed
<arup_r> now it is telling method :(
marr has quit [Remote host closed the connection]
centrx has joined #ruby
<ghanaz> apeiros_: something like this http://asset.zcache.com/assets/graphics/s.gif
divi has joined #ruby
marr has joined #ruby
<apeiros_> ghanaz: an empty 1px gif?
<ghanaz> no lol
<ghanaz> 64 squares with 64 different positions in the array
kbarry has joined #ruby
<ghanaz> i would like to make a game of checkers
<kbarry> i'm trying to perform a wget in ruby.
<centrx> You'll need more than a blank 1x1 gif to make a game of checkers
<apeiros_> ghanaz: you say "print". I ask you "how". I need a precise answer. not something vague.
<apeiros_> and no, you can't print a gif.
keen___________6 has quit [Read error: Connection timed out]
<ericwood> kbarry: check out net/http and open-uri for retrieving stuff from the web
<ericwood> you can also call out to wget directly by using system() or backticks
<apeiros_> kbarry: require 'open-uri'; open("http://169.254.169.254/latest/meta-data/local-ipv4", &:read)
<ghanaz> i need to display 64 squares, with eight rows and eight colums in an array that conform to the pattern of a checkerboard
sailias has joined #ruby
elaptics is now known as elaptics`away
<wallerdev> you mean a chess board?
<kbarry> apeiros_: Is there a way to do it without any extra software?
<ericwood> kbarry: net/http is bundled with all ruby versions
<apeiros_> kbarry: the above is a way without extra software
<ericwood> you just have to require it
jdj_dk has quit [Ping timeout: 250 seconds]
keen___________6 has joined #ruby
<jhass> kbarry: if it's about writing the response to a file: stupid version: require 'open-uri'; File.write(dest, open(src, &:read)), slightly more intelligent version involves IO.copy_stream
rylev has joined #ruby
<apeiros_> ghanaz: gist an example (gist.github.com)
DonOtreply has quit [Quit: DonOtreply]
<kbarry> well, I am using Chef.
<apeiros_> jhass: does copy_stream work with stringio?
<jhass> I never tried
<apeiros_> kbarry: so?
sanguisdex has quit [Read error: Connection reset by peer]
<godd2> kbarry open-uri is part off the ruby standard library
<apeiros_> quick, 5 more people tell them
<godd2> it's installed with ruby, but you have to require it in your ruby file
Lucky___ has joined #ruby
tyfighter has joined #ruby
ghanaz has quit [Quit: Page closed]
<godd2> aww cmon apeiros_, sometimes we need to hear something a different way before we get it
tyfighter has joined #ruby
asmodlol has quit [Ping timeout: 256 seconds]
<apeiros_> godd2: yes. so let 5 more people tell it in 5 more different ways. quick!
green-big-frog is now known as frog|OFF
sinkensabe has joined #ruby
<jhass> apeiros_: you need to highlight them ;P
AlSquire has joined #ruby
<shevy> it's true - some people are great at explaining, others fail at explaining
<apeiros_> I'm great at failing!
asmodlol has joined #ruby
lzx has joined #ruby
marr has quit [Ping timeout: 245 seconds]
v0n has joined #ruby
ramfjord has joined #ruby
DarthGandalf has quit [Quit: Bye]
treehug88 has quit []
<shevy> hey apeiros_ - if you wish to check the last character of a string, do you use: string[-1] or string [-1,1] rather?
<godd2> Matz is cynical so we are cynical
<godd2> no wait...
<jhass> shevy: check as in compare?
shuber_ has joined #ruby
mikecmpbll has joined #ruby
sinkensabe has quit [Ping timeout: 265 seconds]
zacts has joined #ruby
<godd2> I use string.each_char.to_a.last duhh
<shevy> jhass access, query or manipulate - in general. I wonder if old people use the shorter variant or the longer variant
gauravag_ has joined #ruby
<shevy> godd2 Matz is japanese so we are japa... hmmmmm
<godd2> I really think so
DarthGandalf has joined #ruby
<jhass> for extraction I use [-1], for comparison I use end_with?
n80 has quit [Quit: n80]
<shevy> ok so you disfavour [-1,1]
<apeiros_> shevy: no 1.8 code anymore, so I use -1
treehug88 has joined #ruby
lzx has quit [Ping timeout: 240 seconds]
<shevy> now we are getting the dataset in \o/
Jackneill has joined #ruby
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rkalfane has joined #ruby
chinmay_dd has quit [Quit: Leaving]
shuber_ has quit [Remote host closed the connection]
gauravagarwalr has quit [Ping timeout: 272 seconds]
nclbr has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
nclbr has quit [Client Quit]
rismoney1 has quit [Ping timeout: 258 seconds]
shuber_ has joined #ruby
sambao21 has joined #ruby
sambao21 has quit [Client Quit]
n80 has joined #ruby
rshetty has joined #ruby
Sunlorhic has quit [Ping timeout: 258 seconds]
byprdct has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sambao21 has joined #ruby
Areessell has joined #ruby
gauravagarwalr has joined #ruby
statbot has quit [Remote host closed the connection]
BTRE has quit [Remote host closed the connection]
rylev has quit [Remote host closed the connection]
rshetty has quit [Ping timeout: 250 seconds]
kiyote23 has joined #ruby
bhaak has quit [Ping timeout: 255 seconds]
djbkd has quit [Remote host closed the connection]
gauravag_ has quit [Ping timeout: 272 seconds]
kiyote23 has quit [Remote host closed the connection]
asmodlol has quit [Ping timeout: 240 seconds]
aswen has quit [Ping timeout: 245 seconds]
BTRE has joined #ruby
pzzn has quit [Quit: pzzn]
asmodlol has joined #ruby
fivetwentysix has quit [Quit: fivetwentysix]
jdj_dk has joined #ruby
byprdct has joined #ruby
djbkd has joined #ruby
allcentury has quit [Ping timeout: 264 seconds]
sargas has joined #ruby
gauravagarwalr has quit [Remote host closed the connection]
rylev has joined #ruby
godd2 has quit [Remote host closed the connection]
wolf4ood has quit [Quit: (null)]
kiyote23 has joined #ruby
stevegmag has joined #ruby
godd2 has joined #ruby
n80 has quit [Quit: n80]
jenrzzz has joined #ruby
Photism has joined #ruby
Pupeno has quit [Remote host closed the connection]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kiyote23 has quit [Remote host closed the connection]
jimmyhoughjr has quit [Quit: Textual IRC Client: www.textualapp.com]
bhaak has joined #ruby
n80 has joined #ruby
pushpak has quit [Read error: Connection reset by peer]
allcentury has joined #ruby
kiyote23 has joined #ruby
jdj_dk has quit [Ping timeout: 244 seconds]
Asher has quit [Ping timeout: 244 seconds]
spider-mario has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
watermel0n has joined #ruby
fivetwentysix has joined #ruby
dfinninger has joined #ruby
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
beef-wellington has quit [Ping timeout: 250 seconds]
cjdood has quit [Remote host closed the connection]
jherbst has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
asteros has quit [Quit: asteros]
sambao21 has joined #ruby
LouisRoR has quit [Ping timeout: 240 seconds]
conniemj has joined #ruby
blizzy has joined #ruby
conniemj has quit [Client Quit]
lbrf has joined #ruby
<arup_r> I used #encoding utf-8 top of the file.. Still `Yunne fête` is getting transformed into `Yunne f\u00EAte` How to preserve encoding ?
entrenador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Dreamer3 has quit [Quit: Leaving...]
<arup_r> This is happening in Windows machine
shazaum has quit [Quit: This computer has gone to sleep]
GaryOak_ has quit []
byprdct has quit [Ping timeout: 256 seconds]
ballpointcarrot has quit [Ping timeout: 252 seconds]
arup_r has quit [Quit: Leaving.]
Areessell has quit [Quit: leaving]
arup_r has joined #ruby
<godd2> arup_r transformed where?
lbrf has quit [Ping timeout: 272 seconds]
<godd2> cause if I puts "Yunne f\u00EAte" it outputs Yunne fête in irb
<arup_r> in Windows machine
Areessell has joined #ruby
<godd2> are you in irb or running a ruby script?
<arup_r> script
<godd2> can you gist the script?
<godd2> or at least the relevant parts?
<waxjar> arup_r: are you saving your script as UTF-8 as well?
<arup_r> No... I have some data in CSV format..
<arup_r> I am opening the file and reading it as we do with CSV...
sanguisdex has joined #ruby
<arup_r> During this I was trying to inspect the some values... if they are bad or good..
<arup_r> and found this encoding issue as some data are not compatible with windows default encoding...
<godd2> arup_r when you inspect a string, it doesn't interpolate escapes and such
stevegmag has quit []
<arup_r> godd2: I just did puts to see the values..
djbkd has quit [Remote host closed the connection]
asteros has joined #ruby
<arup_r> godd2: Are you on windows ?
<godd2> arup_r yes
<godd2> on ruby 1.9.3p484
<arup_r> It is working ?
<arup_r> is it working from a .rb file ?
<godd2> if you make a gist, I can try what you're doing: https://gist.github.com/
<godd2> I don't know what you put in that rb file
Pupeno has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<godd2> I just know that when I puts "\00EA" in irb, it prints out the correct character
<arup_r> If I do simple puts "the string" it is not working...
AdNauseaum has joined #ruby
<arup_r> as it is encoding issue
kl has quit [Ping timeout: 245 seconds]
djbkd has joined #ruby
<godd2> arup_r if you make a gist, I can try in my environment with the same code to see what's going on
econerd4ever has quit [Remote host closed the connection]
chrishough has joined #ruby
<arup_r> That's a bizz data........ with all confidential stuffs :(
_gautam_ has joined #ruby
econerd4ever has joined #ruby
<arup_r> I can't... Let me Google.. that's the option only for me.. I see
<godd2> can you just make a subset with made up data?
gregf has joined #ruby
<godd2> I mean its just gonna have a line for the encoding and then a puts yes?
DonOtreply has joined #ruby
mrfjodor has joined #ruby
<arup_r> godd2: Let me do some trial and error... If I can't fix I'll be back again... Thanks for your help
shuber_ has quit [Remote host closed the connection]
beef-wellington has joined #ruby
rpag has joined #ruby
reinaldob has quit [Remote host closed the connection]
watermel0n is now known as ok
<godd2> arup_r is this an acceptable test? https://gist.github.com/nicklink483/1f9b88f585457dea4e38
shuber_ has joined #ruby
FooMunki_ has quit [Quit: FooMunki_]
ok is now known as writenode
adriancb has quit [Remote host closed the connection]
LouisRoR has joined #ruby
<apeiros_> godd2, arup_r: "\00EA" != "\u00EA"
fabrice31 has joined #ruby
<apeiros_> (20:51 godd2: I just know that when I puts "\00EA")
_Andres has quit [Ping timeout: 250 seconds]
Pupeno has quit [Quit: Leaving...]
writenode has quit [Quit: Lingo: www.lingoirc.com]
econerd4ever has quit [Ping timeout: 250 seconds]
watermel0n has joined #ruby
mloveless has quit [Remote host closed the connection]
<godd2> my apologies apeiros_ I have been putting a u. it does output ê, so I wasn't missing it in irb. also the gist I made has it.
maletor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_Andres has joined #ruby
FooMunki_ has joined #ruby
<arup_r> godd2: This answer worked http://stackoverflow.com/a/951965/2767755
econerd4ever has joined #ruby
<arup_r> As per your gist..... first one breaking as I said.. but the answer I linked worked
<arup_r> godd2: Again thanks
<godd2> awesome :)
hmsimha has quit [Ping timeout: 252 seconds]
rodfersou has quit [Quit: leaving]
thoughnut has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
fabrice31 has quit [Ping timeout: 240 seconds]
rismoney1 has joined #ruby
<arup_r> godd2: Had you ever used Sinatra ?
bricker`work has quit [Ping timeout: 245 seconds]
<godd2> I have not. I'm familiar with Rails, but I've never had to make a website or anything
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aswen has joined #ruby
<arup_r> godd2: You are lucky then :)
baweaver has joined #ruby
<arup_r> as you had never had make a Rails app :)
<arup_r> Where do you work ?
Takle has joined #ruby
<godd2> Unemployed Inc.
<arup_r> :p
<godd2> I do Ruby because I like Ruby :)
<arup_r> ohkay
mgberlin_ has quit [Read error: Connection reset by peer]
<arup_r> I do Ruby.. as I am Hungry
<DLSteve> arup_r, Do you not like rails?
baweaver has quit [Remote host closed the connection]
<arup_r> Ofcourse.... DLStevve
mgberlin has joined #ruby
dc_ has quit [Remote host closed the connection]
maletor has joined #ruby
<DLSteve> I honestly don't know, some people like it others hate it. I'm still trying to decide.
zorak8 has joined #ruby
<arup_r> What are you trying to decide ?
<Areessell> If he likes it
<arup_r> Should you go with Rails or not ?
<DLSteve> On a backend to focus on.
mungojelly has joined #ruby
<DLSteve> Seams every one hates everything :P
FooMunki_ has quit [Quit: FooMunki_]
<DLSteve> *seems
<godd2> I like Rails for what it's trying to do. I also like that it shot Ruby up in popularity
<arup_r> lol
watermel0n has quit [Ping timeout: 272 seconds]
CrazyM4n has joined #ruby
<arup_r> All I do... Whatever I do.. as I'm hungry
<mitchel_nl> how to add PATH to my .bashrc?
devoldmx_ has joined #ruby
jamesaxl has joined #ruby
Takle has quit [Ping timeout: 272 seconds]
pzzn has joined #ruby
<DLSteve> Right now I do mobile apps so I don't have to make tech decisions. I'm stuck with ether Java or Obj-C (I don't count xamarin studio as it is not truly native.)
Menorah has joined #ruby
<DLSteve> mitchel_nl, on a mac?
<mungojelly> hi, i'd like to be able to say "cat input.jpg | ruby process.rb > output.jpg" but it seems like MiniMagick::Image.open wants a file URI, is there a way to tell it to use the data from stdin? i tried $stdin, $stdin.binmode
<mitchel_nl> DLSteve: On debian
mrfjodor has quit [Quit: Page closed]
<arup_r> use exprt
adriancb has joined #ruby
<arup_r> export
devoldmx33 has quit [Ping timeout: 264 seconds]
<DLSteve> ^
<arup_r> export PATH="/go/to/hell/path"
<arup_r> DLSteve: How are you enjoying Swift then ? :)
ryao has left #ruby [#ruby]
nrsk has joined #ruby
<DLSteve> arup_r, It sucks.
<arup_r> :(
<arup_r> Why ?
Asher has joined #ruby
<DLSteve> The language itself is not bad.
<DLSteve> The tools are what suck at the moment.
<arup_r> ok
dkphenom has joined #ruby
bmichelsen has joined #ruby
<arup_r> I am ZERO idea in iOS
baweaver has joined #ruby
<DLSteve> Lots of compiler issues and CodeKit crashes every five minuets.
kamilc__ has quit [Quit: Linkinus - http://linkinus.com]
dts|pokeball has quit [Read error: Connection reset by peer]
* arup_r is searching shevy:
<godd2> like a Beethoven minuet or Debussy minuet?
kamilc__ has joined #ruby
dts|pokeball has joined #ruby
<DLSteve> godd2, Yah the spell checker messed up that one. And I hit enter so I was committed :-P
kamilc__ has quit [Client Quit]
CrazyM4n has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
<wallerdev> lol
<wallerdev> minuets should be a method of measurement
sailias has quit [Quit: Leaving.]
zorak8 has quit [Read error: Connection reset by peer]
n1lo has quit [Quit: Leaving]
<mitchel_nl> Ok I dont get it, I installed "gem install mailcatcher" but I can't call "mailcatcher" and thats in the bin dir of ruby
zorak8 has joined #ruby
psyprus has quit [Changing host]
psyprus has joined #ruby
<godd2> mitchel_nl did you require the gem in your ruby script?
<ericwood> mitchel_nl: did you require it?
HBESFGWAFAW has joined #ruby
<mitchel_nl> Uhmm, I only did "gem install mailcatcher"
CrazyM4n has joined #ruby
spyderman4g63 has quit [Ping timeout: 245 seconds]
baweaver has joined #ruby
<godd2> ok in your .rb file at the top youll need require "mailcatcher"
<pipework> http://mailcatcher.me/ says he doesn't need to require it.
<godd2> oh it starts a server
<HBESFGWAFAW> What's the best IDE in Linux? I like refactorings, being able to search all uses of a certain variable in a method, and nice IDE stuff like that
<pipework> HBESFGWAFAW: vim
<godd2> mitchel_nl did you restart bash?
<pipework> rubymine if you like though
<mitchel_nl> godd2: I didn't
fivetwentysix has quit [Quit: fivetwentysix]
<godd2> .bashrc runs when you load up bash, so even if you changed it, youll need to restart bash
<mitchel_nl> I did now "source ~/.bashrc"
<mitchel_nl> "-bash: mailcatcher: command not found"
sea_local has joined #ruby
<agent_white> You _should_ really put PATH vars in your .profile, btw.
<mitchel_nl> agent_white: I'm trying to figure out that
<wallerdev> mungojelly: i dont think imagemagick supports in memory files, maybe just write it out to a temp file and then delete it
<agent_white> Since it's for session-wide stuff
<havenwood> zsh! zsh!
<agent_white> ^ Really good explanation of your core dot files
HBESFGWAFAW has quit [Ping timeout: 246 seconds]
lorn_ is now known as Lorn
Lorn has quit [Changing host]
Lorn has joined #ruby
asteros has quit [Quit: asteros]
<pipework> Is it in your Gemfile? It shouldn't be if it is
<pipework> If it is, use bundle exec
<mitchel_nl> I did found this
<godd2> pipework the gem says not to add it to the gemfile
ebahsini has joined #ruby
allcentury has quit [Ping timeout: 245 seconds]
centrx has quit [Quit: Science is organized knowledge, wisdom is organized life.]
<mungojelly> wallerdev: ok, that's what we're doing now, i guess we just thought writing things with |s might be prettier, thanks anyway :)
thumpba_ has quit [Ping timeout: 264 seconds]
asteros has joined #ruby
<pipework> godd2: Didn't I say that?
<godd2> pipework I'm sorry I misread. I thought you wrote "It should be if it isn't"
_gautam_ has quit [Quit: Be back later ...]
<godd2> I'm gonna go get some food before I make more of an ass of myself...
<shevy> I read what pipework wrote as "lalala I am so drunk lalala"
genpaku has quit [Ping timeout: 265 seconds]
atomical has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> godd2 oh don't worry, I take over seamlessly
sailias has joined #ruby
entrenador has joined #ruby
yokel has quit [Ping timeout: 255 seconds]
<godd2> dat comic releif
<shevy> I am so happy... I am at like 95% finished of a rewrite
atomical has joined #ruby
<agent_white> I don't know what I am today. I haven't slept in a long time.
baweaver has quit [Remote host closed the connection]
aswen has quit [Ping timeout: 245 seconds]
genpaku has joined #ruby
dc_ has joined #ruby
<shevy> today
<shevy> you are a hamster
<agent_white> Mmm... I feel this.
jdj_dk has joined #ruby
jack_rabbit has quit [Ping timeout: 240 seconds]
wallerdev has quit [Quit: wallerdev]
mloveless has joined #ruby
Zorxax_ has joined #ruby
stevegmag has joined #ruby
<Zorxax_> hello
Musashi007 has quit [Quit: Musashi007]
<Zorxax_> how convert string to binary and back? I get \xnumbers chars
lbrf has joined #ruby
LouisRoR has quit [Ping timeout: 240 seconds]
yokel has joined #ruby
bricker`work has joined #ruby
red_horned_rihno has quit [Ping timeout: 255 seconds]
<Zorxax_> how convert string into binary and back?
<Zorxax_> a = "że".unpack("B*")[0]
<Zorxax_> b=a.scan(/.{1,8}/m).map {|e| e.to_i(2).chr }.join
pika_pika has quit [Ping timeout: 258 seconds]
genpaku has quit [Ping timeout: 244 seconds]
red_horned_rihno has joined #ruby
jdj_dk has quit [Ping timeout: 265 seconds]
fivetwentysix has joined #ruby
baweaver has joined #ruby
<apeiros_> Zorxax_: the reverse of `a = obj.unpack("B*")[0]` is `[a].pack("B*")`
pietr0 has quit [Ping timeout: 256 seconds]
pietr0_ has joined #ruby
lbrf has quit [Ping timeout: 258 seconds]
<Zorxax_> apeiros_, pack('C*').force_encoding('utf-8')
timonv_ has joined #ruby
<apeiros_> Zorxax_: is that supposed to be a question?
<Zorxax_> no this is answer ;D
<Zorxax_> i fount it in a second
<Zorxax_> ago
* Zorxax_ is happy
JokerDoom has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
lzx has joined #ruby
agjacome has joined #ruby
conniemj has joined #ruby
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
timonv_ has quit [Remote host closed the connection]
Jackneill has quit [Remote host closed the connection]
kl has joined #ruby
pjakobs has quit [Quit: Leaving.]
arietis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_JokerDoom has quit [Ping timeout: 256 seconds]
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
genpaku has joined #ruby
Cache_Money has joined #ruby
lzx has quit [Ping timeout: 245 seconds]
pzzn has quit [Quit: pzzn]
mylar has quit []
_gautam_ has joined #ruby
allcentury has joined #ruby
asteros has quit [Quit: asteros]
reinaldob has joined #ruby
pzzn has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
sambao21 has quit [Quit: Computer has gone to sleep.]
renderful has joined #ruby
ebahsini has quit [Ping timeout: 250 seconds]
robertt_dex has quit [Remote host closed the connection]
ohaibbq has joined #ruby
byprdct has joined #ruby
reinaldob has quit [Ping timeout: 256 seconds]
ixx has quit [Ping timeout: 250 seconds]
renderfu_ has quit [Ping timeout: 255 seconds]
giuseppesolinas has joined #ruby
freerobby has quit [Quit: Leaving.]
djbkd has quit [Remote host closed the connection]
freerobby has joined #ruby
agjacome has quit [Quit: leaving]
djbkd has joined #ruby
zorak8 has quit [Read error: Connection reset by peer]
zorak8 has joined #ruby
giuseppesolinas has quit [Client Quit]
sambao21 has joined #ruby
Takle has joined #ruby
hiyosi has joined #ruby
Morkel has quit [Quit: Morkel]
giuseppesolinas has joined #ruby
giuseppesolinas has quit [Client Quit]
divi has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
asteros has joined #ruby
Takle has quit [Ping timeout: 245 seconds]
Sunlorhic has joined #ruby
Musashi007 has joined #ruby
jherbst has joined #ruby
Zamyatin has joined #ruby
eduardoboss has quit [Quit: Page closed]
claw__ has joined #ruby
claw_ has quit [Ping timeout: 265 seconds]
entrenador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
agjacome has joined #ruby
jenrzzz has joined #ruby
postmodern has joined #ruby
entrenador has joined #ruby
djbkd has quit [Remote host closed the connection]
codezomb has quit [Quit: Textual IRC Client: www.textualapp.com]
djbkd has joined #ruby
Zorxax_ has left #ruby ["Wychodzi"]
bhaak has quit [Read error: Connection reset by peer]
agenteo has quit [Quit: agenteo]
shuber_ has quit [Remote host closed the connection]
iamninja has quit [Quit: ZZZzzz…]
robbyoconnor has quit [Ping timeout: 250 seconds]
livathinos has joined #ruby
livathinos has quit [Client Quit]
robbyoconnor has joined #ruby
LouisRoR has joined #ruby
djbkd has quit [Remote host closed the connection]
pika_pika has joined #ruby
hmsimha has joined #ruby
TgMts has joined #ruby
ElderFain has quit [Ping timeout: 265 seconds]
ElderFain has joined #ruby
symbole has joined #ruby
wallerdev has joined #ruby
rylev has quit [Remote host closed the connection]
<symbole> what is the difference between def []= and def []?
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
nrsk has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<apeiros_> symbole: obj[x] = y calls []=, obj[x] calls []
<symbole> what?
tagrudev has joined #ruby
tagrudev has quit [Client Quit]
<apeiros_> I can't answer that question.
<symbole> why not?
fmcgeough has quit [Quit: fmcgeough]
bmichelsen has quit [Quit: ZZZzzz…]
entrenador has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros_> too unspecific.
<apeiros_> referring to "what?"
kbarry has quit [Quit: ChatZilla 0.9.91 [Firefox 34.0.5/20141126041045]]
<godd2> symbole the one with the equals sign set something, the one without the equals sign will get something
tejas-manohar has joined #ruby
<symbole> thank you godd2
sambao21 has quit [Quit: Computer has gone to sleep.]
<godd2> >> a = [5, 6, 7]; a[0] = 9; a
<eval-in__> godd2 => [9, 6, 7] (https://eval.in/236378)
dannymick has joined #ruby
CrazyM4n has quit [Quit: installing hard drive]
hmsimha has quit [Ping timeout: 252 seconds]
decoponio has quit [Quit: Leaving...]
evanjs has quit [Remote host closed the connection]
<godd2> symbole but keep in mind it's not restricted to arrays. for example, it will work with strings and arrays too
<symbole> godd2: no, that's not what i mean, this is what i mean: http://pastebin.com/geSSP2nw
<symbole> thanks for your help godd2
<godd2> symbole those methods won't do anything right now. You'll need to set up parameters for them to take
<symbole> yes, i'll set up parameters, but i wanted to know why they're called that
robbyoconnor has quit [Ping timeout: 272 seconds]
marr has joined #ruby
renderfu_ has joined #ruby
aswen has joined #ruby
thumpba has joined #ruby
portiad has joined #ruby
<godd2> they're called that because in older languages, if you wanted something from an array, youd ask for it by index like that.
sambao21 has joined #ruby
renderfu_ has quit [Read error: Connection reset by peer]
<symbole> thank you so much godd2
roolo has joined #ruby
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
renderfu_ has joined #ruby
renderful has quit [Ping timeout: 240 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
timonv_ has joined #ruby
djbkd has joined #ruby
synergyz_ is now known as synergyz
tristanp has quit [Remote host closed the connection]
chrishough has quit [Ping timeout: 244 seconds]
roolo has quit [Ping timeout: 244 seconds]
tristanp has joined #ruby
thumpba_ has joined #ruby
<tejas-manohar> i dont want to put an .imgurrc in $HOME directory because im going to deploy to heroku
timonv^ has joined #ruby
<tejas-manohar> any way to override this?
<crome> @config_path = options[:config_path] || '~/.imgurrc'
<crome> after spendin ~25 seconds in the code
_ixti_ has joined #ruby
Takle has joined #ruby
tylersmith has quit [Ping timeout: 258 seconds]
jaffachief has quit [Ping timeout: 245 seconds]
oleo has quit [Ping timeout: 250 seconds]
fabrice31 has joined #ruby
<shevy> tejas-manohar there, create ~/.imgurrc
ixti has quit [Ping timeout: 256 seconds]
thumpba has quit [Ping timeout: 255 seconds]
<shevy> that was the wrong side of the || wasn't it?
tylersmith has joined #ruby
<tejas-manohar> shevy: o
<shevy> :-)
<crome> you don't even have to use a config file: https://github.com/ehowe/ruby-imgur/blob/master/lib/imgur/client.rb#L53
st0mar has joined #ruby
oleo has joined #ruby
timonv_ has quit [Ping timeout: 240 seconds]
sinkensabe has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy> @parser = begin; require 'json'; JSON; end
<shevy> that code is scary
sarcas has joined #ruby
asmodlol has quit [Ping timeout: 272 seconds]
bhaak has joined #ruby
fabrice31 has quit [Ping timeout: 245 seconds]
<crome> wut
yeticry has quit [Ping timeout: 272 seconds]
jaffachief has joined #ruby
<shevy> gives you a random number!
yeticry has joined #ruby
siaw has joined #ruby
<crome> it should run the loop random times
<crome> it's not random enough
asmodlol has joined #ruby
shuber_ has joined #ruby
Takle has quit [Ping timeout: 265 seconds]
_beechnut has left #ruby [#ruby]
_beechnut has joined #ruby
commmmodo has joined #ruby
C0deMaver1ck has quit [Ping timeout: 258 seconds]
arup_r has quit [Read error: Connection reset by peer]
TgMts has quit [Quit: No Ping reply in 180 seconds.]
aswen has quit [Ping timeout: 245 seconds]
<jhass> what's that attempting? rand(1_000_000_000...10_000_000).to_s ?
j2p2 has quit [Ping timeout: 258 seconds]
<_beechnut> it's attempting to get a 7-digit random number
<siaw> i need some help here. i have to text files i want to compare them and create a 3rd file that outputs common lines in the 2 files that i’m comparing. so i wrote this https://gist.github.com/siaw23/d48efee477c0555c1aa5
mgberlin_ has joined #ruby
<siaw> but it doesn’t print the common lines. not sure why. any help?
<_beechnut> it's a lot of code for a task that simple. maybe i'm missing something.
<siaw> i believe i have a problem with line 19-25
aclearma_ has quit [Quit: I'm out!]
Takle has joined #ruby
chrishough has joined #ruby
mgberlin has quit [Ping timeout: 256 seconds]
josephndenton has quit [Ping timeout: 250 seconds]
gsd has joined #ruby
<shevy> siaw your code is too verbose
paulfm has quit [Quit: Goodbye]
<jhass> it would help to not use single letter variables
C0deMaver1ck has joined #ruby
<shevy> File.read 'some_path'
<jhass> also always use the block form of File.open or use helpers like File.read and File.write
<crome> parsing files with unnecesarrily long labels is slower
<crome> it's called optimization
<siaw> shevy: c = File.open("#{second_file_compare}" + ".txt").read is the same as File.read ‘some_path’
<shevy> and I think you can use .select rather than .each *
<shevy> yeah siaw
CrazyM4n has joined #ruby
<shevy> and btw
<jhass> siaw: not quite, the later makes sure to close FDs in all events
<shevy> "#{second_file_compare}" + ".txt"
Sunlorhic has quit [Ping timeout: 244 seconds]
<shevy> why do you use that strange thing
<shevy> "#{second_file_compare}.txt"
<siaw> shevy: ok :)
<shevy> the more unnecessary characters you remove, the simpler your code will become
discr33t__ has joined #ruby
TgMts has joined #ruby
Takle_ has joined #ruby
<discr33t__> hey guys, i'm fairly new to ruby and am not sure how to write something
<discr33t__> i need a range (10.150.120.0 - 10.150.139.255) and find out if an ipaddress falls in that range
<jhass> siaw: what does qualify the lines as common? just same content or also same position?
econerd4ever has quit [Remote host closed the connection]
<discr33t__> if yes, i need to assign it zone A, if not i need it to look at a different range
spider-mario has quit [Read error: Connection reset by peer]
<jhass> discr33t__: check the ipaddress stdlib
<_beechnut> +1 jhass
<siaw> same content jhass
Takle has quit [Ping timeout: 265 seconds]
<discr33t__> jhass: i'm looking at that, and i also found this page http://stackoverflow.com/questions/3518365/rails-find-out-if-an-ip-is-within-a-range-of-ips
<jhass> siaw: currently your code assumes same position too
adriancb has quit [Remote host closed the connection]
<siaw> jhass: no i just want same content
bears has joined #ruby
spider-mario has joined #ruby
ohaibbq has quit [Ping timeout: 245 seconds]
<jhass> siaw: that's not what your code does though
rismoney1 has quit [Ping timeout: 265 seconds]
<siaw> how do i fix it? :) jhass
blahwoop has joined #ruby
chu has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<jhass> discr33t__: the === is a bit odd, but otherwise that stackoverflow answer shows it ;)
weems|mac has joined #ruby
<jhass> discr33t__: I'd prefer .cover?
<jhass> discr33t__: and actually there's no need for the to_i
<siaw> jhass: bear in mind that i’m comparing line by line items with an array
codecop has quit [Quit: Išeinu]
blahwoop has quit [Remote host closed the connection]
<jhass> siaw: oh right, you do, nvm me
Zamyatin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
helios157 has joined #ruby
gaboesquivel has quit [Remote host closed the connection]
<jhass> let me make that code pretty, maybe I'll be able to follow it better
<siaw> jhass: ok
codezomb has joined #ruby
portiad has quit [Quit: Leaving...]
sinkensabe has quit [Remote host closed the connection]
cesarstafe has quit [Ping timeout: 265 seconds]
helios157 has left #ruby [#ruby]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tier has quit [Remote host closed the connection]
tristanp has quit [Remote host closed the connection]
hrs has joined #ruby
vinleod has joined #ruby
aswen has joined #ruby
<jhass> http://paste.mrzyx.de/pthr033ce seems fine, are you sure your input actually have exactly same lines?
<jhass> keep things like \n vs \r\n in mind
xmohmj has quit [Remote host closed the connection]
<jhass> or different whitespace characters
<jhass> or different quotes
obscured has quit [Quit: leaving]
tus has quit [Ping timeout: 250 seconds]
asmodlol has quit [Ping timeout: 258 seconds]
Megtastique has quit []
geggam has quit [Ping timeout: 265 seconds]
asmodlol has joined #ruby
sandelius has joined #ruby
hrs has quit [Quit: WeeChat 1.0.1]
hrs has joined #ruby
Stalkr_ has quit [Changing host]
Stalkr_ has joined #ruby
<siaw> yes jhass
yfeldblum has joined #ruby
<jhass> can you share example input?
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<siaw> jhass: file1.txt contains good bad girl
<siaw> jhass: file2.txt contains good bad hotel
<siaw> that’s all
<siaw> each word on one line
<siaw> jhass: btw your code gives an error
allcentury has quit [Ping timeout: 250 seconds]
hrs has quit [Client Quit]
<jhass> forgot to drop an _line
jherbst has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<siaw> ok running again
<jhass> since you were inconsistent about iterating through your files
<jhass> works here
definiv has joined #ruby
<siaw> works here too
definiv has quit [Client Quit]
<siaw> now i’m trying on 500K lines
dannymick has quit [Quit: dannymick]
<jhass> try the alternate version
karmatr0n has joined #ruby
<jhass> should actually be more efficient
mitchel_nl has left #ruby [#ruby]
<siaw> jhass: what do you mean by that?
<jhass> the commented one?
dain_ has joined #ruby
econerd4ever has joined #ruby
<siaw> common_lines = firt_files_lines & second_files_lines
<siaw> that?
<jhass> yeah
<jhass> sans typo of course
<jhass> btw just tried running your original version
<jhass> works too
red_horned_rihno has quit [Read error: Connection timed out]
discr33t__ has quit [Quit: Page closed]
<siaw> the one i wrote?
max96at is now known as max96at|off
amundj has joined #ruby
red_horned_rihno has joined #ruby
<siaw> this will take forever, running your program on 500K lines
red_horned_rihno has quit [Max SendQ exceeded]
jherbst has joined #ruby
blahwoop has joined #ruby
Menorah has quit [Quit: This computer has gone to sleep]
a346 has joined #ruby
nemesit|znc has quit [Quit: quit]
<siaw> jhass: i didn’t know readlines was a method in ruby that return an array
<siaw> wow!
<siaw> nice
dblessing has quit [Ping timeout: 272 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
<blahwoop> file.read_lines
siwica has joined #ruby
<a346> hey, does anyone know of any books or resources about building complex pricing calculations for things like airline fares and taxi fares?
<siaw> blahwoop: File.readlines
asmodlol has quit [Ping timeout: 256 seconds]
lbrf has joined #ruby
<blahwoop> so i dont need to do File.open
<blahwoop> file.each_line
sargas has quit [Quit: This computer has gone to sleep]
<siaw> jhass: still running :)
stevegmag has quit [Ping timeout: 245 seconds]
Takle_ has quit [Ping timeout: 244 seconds]
doodlehaus has quit [Remote host closed the connection]
Darkwater has joined #ruby
<jhass> siaw: watch your memory
<jhass> might explode
<siaw> nothing inetersting happening there
<Darkwater> hey, do people talk about rails here?
<blahwoop> #rubyonrails
<Darkwater> thanks
asmodlol has joined #ruby
Darkwater has left #ruby ["attaching to rails"]
mloveless has quit [Remote host closed the connection]
<symbole> can someone recommend a good tutorial for making a game like chess or checkers that's played directly in the console?
thumpba_ has quit [Ping timeout: 255 seconds]
ips|malc has quit [Remote host closed the connection]
<siaw> jhass: any algo to improve this?
<jhass> not sure
bashusr has joined #ruby
sambao21 has joined #ruby
<siaw> maybe i should ask on SO? :D
<jhass> http://paste.mrzyx.de/pkahnasgq may be faster
<jhass> shell tools might be faster
dannymick has joined #ruby
<jhass> crystal will probably be faster ;)
lbrf has quit [Ping timeout: 255 seconds]
<siaw> jhass: now my lap is getting realy hot! :D
it0a has quit [Ping timeout: 272 seconds]
<siaw> hahaha
<bashusr> in rspec, how do i group expects together when i am testing for very similar behavior? such as for an http request, i should always expect response.status = 200 and a list of header values to be set to the same static values
Tranquility has quit [Quit: Connection closed for inactivity]
<zenspider> in minitest you write a method. it isn't even a question because it is just ruby
<zenspider> in rspec? maybe you write a method? maybe?
<jhass> describe actually creates anonymous classes, and I think it actually creates methods on them these days
<jhass> so yeah
<jhass> write a method
geiltalasdair has joined #ruby
<jhass> or maybe use shared examples
mleung has joined #ruby
<jhass> and don't assert the same stuff in every single spec again
lzx has joined #ruby
<zenspider> describe creates anonymous classes now? say it isn't so
<zenspider> shared examples are the antimatz
yfeldblu_ has joined #ruby
thumpba has joined #ruby
Takle has joined #ruby
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<siaw> jhass: should i force quite the program?
<siaw> :(
<siaw> the 500K lines are REAL lines i’m working on :(
spastorino has quit [Quit: Connection closed for inactivity]
nemesit|znc has joined #ruby
<zenspider> siaw: readlines reads all the lines. IO.foreach doesn't. easier on memory / gc
yfeldblum has quit [Ping timeout: 245 seconds]
geilt has quit [Ping timeout: 255 seconds]
<bashusr> jhass, i'll look up shared examples
geiltalasdair has quit [Client Quit]
geilt has joined #ruby
<siaw> jhass: very very funny
<siaw> program finished but NOTHING in the output file on the large test
<siaw> :(
lzx has quit [Ping timeout: 255 seconds]
<bashusr> jhass, http://www.bignerdranch.com/blog/using-rspec-shared-contexts-ensure-api-consistency/ looks like exactly what i am looking for
<jhass> siaw: I suspect there are no lines that are _exactly_ the same
<siaw> aaaahhh
baweaver has quit [Remote host closed the connection]
<siaw> crap!
elaptics`away is now known as elaptics
<siaw> i’m comparing the wrong files
yfeldblu_ has quit [Ping timeout: 264 seconds]
baweaver has joined #ruby
aswen has quit [Ping timeout: 245 seconds]
<crome> meh. I kept pressing G and the window didn't want to scroll to the bottom
<crome> stupid irc client
<siaw> jhass: WOW!!! the second program is extremely fast!!
asmodlol has quit [Ping timeout: 244 seconds]
<jhass> siaw: maybe to something like head -n1000 real_file1 > test_data1 for testing ;)
<siaw> in lest than a second it did 500K lines
<jhass> yes
<jhass> since it doesn't need to do 500k context switches between ruby and C land
ebahsini has joined #ruby
<jhass> also Array#& is a bit smarter implemented I guess
<siaw> jhass: why is the second program with Set faster?
<jhass> oh that version
<jhass> well, because it uses a Set
<jhass> constant lookup
duggiefresh has quit []
ozialien has joined #ruby
zacts has quit [Quit: leaving]
<siaw> what’s that any documentation
<siaw> ?
asmodlol has joined #ruby
<jhass> sure, set is stdlib
<jhass> obviously
TgMts has quit [Quit: No Ping reply in 180 seconds.]
jerius has quit []
<siaw> wow
<siaw> it’s pretty cool!!!
TgMts has joined #ruby
Hobogrammer has joined #ruby
Megtastique has joined #ruby
Spami has joined #ruby
<jhass> zenspider: looks like I was wrong about it defining methods though, https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/example.rb#L166
a346 has quit [Quit: a346]
<jhass> still means def inside describe works and doesn't pollute Object
<bashusr> newbie ruby question.... how in the world can include be overloaded to be able to include a method (http://ruby-doc.com/docs/ProgrammingRuby/html/tut_modules.html) as well as act as a matcher (http://www.relishapp.com/rspec/rspec-expectations/v/2-0/docs/matchers/include-matcher)?
mleung has quit [Ping timeout: 264 seconds]
<jhass> bashusr: because it's a method, Module#include
<bashusr> err include a module* i meant module in the first thing
asteros has quit [Quit: asteros]
mleung has joined #ruby
weems|mac has quit [Quit: bai]
<bashusr> jhass, i'm not following?
Fire-Dragon-DoL has quit [Quit: Leaving.]
<jhass> not syntax or anything
sailias has quit [Quit: Leaving.]
beef-wellington has quit [Ping timeout: 245 seconds]
dorei has joined #ruby
<jhass> it's not even globally defined
<jhass> >> class Foo; def foo; include Object; end; end; Foo.new.foo
<eval-in__> jhass => undefined method `include' for #<Foo:0x40980e14> (NoMethodError) ... (https://eval.in/236395)
procat has quit [Ping timeout: 250 seconds]
<bashusr> interesting
<bashusr> jhass, http://pastebin.com/xJqeHwQD i'm a bit how ruby handles scope
<siaw> jhass: i think i know why the first version, you program and mine take forever to finish
<bashusr> in my mind, i can't see how ruby can tell which "include" it is supposed to be using
<jhass> bashusr: rspec does a bit magic behind the scenes there
TgMts has quit [Ping timeout: 240 seconds]
VictorBjelkholm has joined #ruby
<jhass> describe actually creates an anonymous class
<apeiros_> ah yeah, rspec, and why I think it's a bad idea.
<siaw> jhass: in both programs we were putting each line in an array. so both files were put in an array so it compared 2 arrays and in your 2nd program you used just one array + the Set which freezes each line
TgMts has joined #ruby
<jhass> bashusr: the block passed to describe is evaluated in that class
<jhass> like it's a class body when you do class Foo; end
calmoto has quit [Ping timeout: 255 seconds]
jmdade has joined #ruby
<bashusr> ok, gotcha, and the include matcher?
<bashusr> is it the "it" ?
treehug8_ has joined #ruby
hiyosi_ has joined #ruby
yfeldblum has joined #ruby
<jhass> bashusr: when your spec is run, it creates an instance of this anonymous class and runs the block you pass to it in the context of that instance
mbr_ has joined #ruby
<jhass> like an instance method
<jhass> that anonymous class includes modules among one defines your include matcher
sheepman_ has joined #ruby
voodoofish4301 has joined #ruby
<jhass> rspec is maybe not the easiest example to start investigating that part of ruby ;)
x1337807x has joined #ruby
shuber__ has joined #ruby
jherbst has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sambao21 has quit [Quit: Computer has gone to sleep.]
<jhass> siaw: there's nothing frozen, and in the last version there's only the set and an intermediate array that's converted to the set, File.foreach with a block does not create a second array
<bashusr> jhass, yeah it sucks, but that's where i got thrown into
asmodlol has quit [Ping timeout: 264 seconds]
<jhass> bashusr: you don't really need to understand that stuff in order to use rspec
<bashusr> i've been doing php and java for a while and then my boss wants me to do RoR so they throw me into writing some tests for them
<siaw> jhass: When a string is to be stored, a frozen copy of the string is stored instead unless the original string is already frozen. << from the documentation :)
<siaw> jhass: scratch that. i’m confusing myself
<bashusr> jhass, yeah, i know... but i've been doing this for a little bit enough to be curious how it works underneath... that's the only way i'll be a good programmer right?
<jhass> siaw: link?
Freijo has joined #ruby
rylev has joined #ruby
<jhass> bashusr: I guess... :P
mungojel1y has joined #ruby
sheepman has quit [Ping timeout: 245 seconds]
Gadgetoid has quit [Ping timeout: 245 seconds]
sheepman_ is now known as sheepman
sn0wb1rd has quit [Ping timeout: 245 seconds]
<siaw> jhass: http://www.ruby-doc.org/stdlib-2.1.5/libdoc/set/rdoc/Set.html >> 3rd bullet point from top
avril14th has quit [Ping timeout: 245 seconds]
_ixti_ has quit [Ping timeout: 245 seconds]
jamesaxl has quit [Ping timeout: 245 seconds]
_beechnut has quit [Ping timeout: 245 seconds]
Fraeon has quit [Ping timeout: 245 seconds]
mbeasley has quit [Ping timeout: 245 seconds]
voodoofish430 has quit [Ping timeout: 245 seconds]
DefV_ has joined #ruby
bhaak_ has joined #ruby
CrazyM4n has quit [Ping timeout: 245 seconds]
shuber_ has quit [Ping timeout: 245 seconds]
bhaak has quit [Ping timeout: 245 seconds]
st0mar has quit [Ping timeout: 245 seconds]
hiyosi has quit [Ping timeout: 245 seconds]
treehug88 has quit [Ping timeout: 245 seconds]
j416 has quit [Ping timeout: 245 seconds]
kobain has quit [Ping timeout: 245 seconds]
larissa has quit [Ping timeout: 245 seconds]
mbr has quit [Ping timeout: 245 seconds]
wjimenez5271 has quit [Ping timeout: 245 seconds]
Beoran_ has quit [Ping timeout: 245 seconds]
fernandolopez has quit [Ping timeout: 245 seconds]
banister has quit [Ping timeout: 245 seconds]
aboudreault has quit [Ping timeout: 245 seconds]
mungojelly has quit [Ping timeout: 245 seconds]
knutmith2t has quit [Ping timeout: 245 seconds]
DefV has quit [Ping timeout: 245 seconds]
jobewan has quit [Ping timeout: 245 seconds]
<zenspider> jhass: for hash keys, maybe? that's the only place I know where strings are auto frozen
devyn_ has quit [Ping timeout: 245 seconds]
knutmithut has joined #ruby
devyn has joined #ruby
<jhass> siaw: oh, didn't know, gotcha :D
asmodlol has joined #ruby
shanlar has quit [Quit: shanlar]
<jhass> siaw: okay so I was wrong the string is frozen, doesn't matter too much though
<siaw> jhass: hahaha :P :P well i didn’t want to confuse both of use
<siaw> yeah doesn’t matter
sambao21 has joined #ruby
<siaw> but tell me it took forever cause we used array x array comparison
<jhass> zenspider: so Set too apparently, though iirc that's implemented with a Hash anyway
<siaw> instead of array x line comparison
<siaw> i want to believe that
<shevy> are you guys still trying to not believe that ruby is slow
freerobby has quit [Quit: Leaving.]
shanlar has joined #ruby
<jhass> siaw: so you initial version was n+m where n = lines of first file, m = lines of second file
<jhass> er, wanted to hit *, n*m
yfeldblum has quit [Remote host closed the connection]
<siaw> jhass: right
genpaku has quit [Ping timeout: 258 seconds]
j416 has joined #ruby
sn0wb1rd has joined #ruby
testcore has quit [Ping timeout: 250 seconds]
Gadgetoid has joined #ruby
<jhass> a set provides constant lookup, so the n becomes 1
wjimenez5271 has joined #ruby
jobewan has joined #ruby
<siaw> jhass: just like i thought
<siaw> and it’s wayyyy better
<jhass> which reduces the complexity to m
mbeasley has joined #ruby
genpaku has joined #ruby
<siaw> when i was reading some ruby book i skipped the topic on Sets :D and now it’s eating me
CrazyM4n has joined #ruby
_ixti_ has joined #ruby
avril14th has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
larissa has joined #ruby
treehug8_ has quit []
Beoran_ has joined #ruby
kobain has joined #ruby
fernandolopez has joined #ruby
jamesaxl has joined #ruby
voodoofish4301 is now known as voodoofish430
kobain has quit [Max SendQ exceeded]
kobain has joined #ruby
asmodlol has quit [Ping timeout: 244 seconds]
mengu has joined #ruby
mengu has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hmsimha has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<shevy> don't worry
<shevy> in 10 years you'll have it all learned
asmodlol has joined #ruby
narph has quit [Quit: Connection closed for inactivity]
divi has joined #ruby
divi has quit [Client Quit]
pika_pika has quit [Ping timeout: 258 seconds]
<shevy> what do you guys prefer:
<shevy> some_array[0]
<shevy> some_array.first
aboudreault has joined #ruby
xymbol has joined #ruby
atomical has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aarkerio has joined #ruby
<apeiros_> .first
<apeiros_> however, IMO rails goes a bit overboard with .second, .third, …
<apeiros_> and afaik [0] is faster (special cased by the parser)
<aarkerio> hi ! in : variable_set(:@esessionid)
<aarkerio> what ":@" means
<aarkerio> ?
<apeiros_> aarkerio: nothing.
<apeiros_> the : means "this is a literal symbol"
<apeiros_> and the rest is the value of the symbol.
<crome> after all this time... I didn't even know there was .second and .third in activesupport :D
<shevy> apeiros_ yeah that is ok, I don't think I have ever used .second or .third, but I do seem to be using .first a lot more often nowadays when before I used [0]
<crome> most useless thing ever
<apeiros_> aarkerio: just like in: variable_set("@esessionid"), the " means "this is a literal string", and everything (up to the closing ") is the value
<zenspider> what is this thing trying to do?
<zenspider> siaw: ^^
<siaw> o zenspider you’re so responsive!
tubuliferous has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<zenspider> is that sarcasm?
<aarkerio> I see, thanks a lot apeiros
<zenspider> because I do have better things to do
bears has quit [Remote host closed the connection]
renderfu_ has quit [Remote host closed the connection]
atomical has joined #ruby
jamgood96 has joined #ruby
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
ebahsini has quit [Quit: Leaving]
timonv^ has quit [Remote host closed the connection]
mozzarella has quit [Quit: WeeChat 1.0.1]
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
blahwoop has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
Mia has quit [Ping timeout: 255 seconds]
testcore has joined #ruby
Ridley5 has quit [Ping timeout: 250 seconds]
baweaver has quit [Remote host closed the connection]
baweaver has joined #ruby
amundj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
zzz_Ridley has joined #ruby
zzz_Ridley is now known as Ridley5
socash has joined #ruby
rylev has quit [Remote host closed the connection]
Ridley5 has quit [Changing host]
Ridley5 has joined #ruby
kirun has quit [Quit: Client exiting]
conniemj has quit [Quit: (null)]
enebo has quit [Quit: enebo]
amundj has joined #ruby
yfeldblum has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
dannymick has quit [Quit: dannymick]
kies has quit [Ping timeout: 244 seconds]
mloveless has joined #ruby
timonv_ has joined #ruby
JoshGlzBrk has joined #ruby
JoshGlzBrk has quit [Max SendQ exceeded]
dannymick has joined #ruby
sarcas has quit [Remote host closed the connection]
dannymick has quit [Client Quit]
JoshGlzBrk has joined #ruby
baweaver has joined #ruby
JoshGlzBrk has quit [Max SendQ exceeded]
hiyosi_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_maes_ has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org]
JoshGlzBrk has joined #ruby
JoshGlzBrk has quit [Max SendQ exceeded]
symbole has quit [Quit: Page closed]
jimmyy has joined #ruby
JoshGlzBrk has joined #ruby
jimmyy has quit [Max SendQ exceeded]
VBlizzard has joined #ruby
yfeldblum has quit [Ping timeout: 244 seconds]
JoshGlzBrk has quit [Max SendQ exceeded]
behrz has quit [Quit: Leaving]
blizzy has quit [Ping timeout: 258 seconds]
JoshGlzBrk has joined #ruby
JoshGlzBrk has quit [Max SendQ exceeded]
Igneous has joined #ruby
JoshGlzBrk has joined #ruby
charliesome has joined #ruby
baweaver has quit [Remote host closed the connection]
asteros has joined #ruby
JoshGlzBrk has quit [Max SendQ exceeded]
behrz has joined #ruby
JoshGlzBrk has joined #ruby
JoshGlzBrk has quit [Max SendQ exceeded]
gsd has joined #ruby
JoshGlzBrk has joined #ruby
baweaver has joined #ruby
econerd4ever has quit [Remote host closed the connection]
JoshGlzBrk has quit [Max SendQ exceeded]
rylev has joined #ruby
shuber__ has quit [Remote host closed the connection]
shuber_ has joined #ruby
wldcordeiro is now known as wldcordeiro_
econerd4ever has joined #ruby
gsd has quit [Client Quit]
ramfjord has quit [Ping timeout: 244 seconds]
amundj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Soda has quit [Remote host closed the connection]
ramfjord has joined #ruby
xymbol has quit [Quit: Be back later ...]
jamesaxl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
rylev has quit [Remote host closed the connection]
reset has joined #ruby
sankaber has joined #ruby
kies has joined #ruby
econerd4ever has quit [Ping timeout: 264 seconds]
Musashi007 has joined #ruby
jobewan has quit [Remote host closed the connection]
econerd4ever has joined #ruby
fandi has quit [Remote host closed the connection]
sevenseacat has joined #ruby
DonOtreply has quit [Quit: DonOtreply]
kenichi is now known as kenichi|away
mozzarella has joined #ruby
Takle_ has joined #ruby
Takle has quit [Ping timeout: 244 seconds]
djbkd has quit [Remote host closed the connection]