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?
<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]
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
<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]
<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
<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?
<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]
<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."
<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
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
<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?
<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
<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 :)
<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
<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
<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 ;)
<shevy>
Timgauthier man you are already like flash gordon, you are everywhere... canada... german... south america ... what's next on the list - china? africa?
<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…]
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.]
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)
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
<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
<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…
<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?
<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)
<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.
<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
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]
<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
<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?
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…]