havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.5, 2.5.7, 2.7.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
_mossplix has quit [Ping timeout: 276 seconds]
bruce_lee has quit [Ping timeout: 265 seconds]
bruce_lee has joined #ruby
Intelo has quit [Ping timeout: 240 seconds]
sgen has quit [Ping timeout: 250 seconds]
poontangmessiah_ has quit [Remote host closed the connection]
iAmDecim has joined #ruby
dasher00 has quit [Ping timeout: 250 seconds]
iAmDecim has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
edwardly has quit [Read error: Connection reset by peer]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
edwardly has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
phaul has quit [Quit: :wq]
weird_error has quit [Quit: weird_error]
Azure|dc is now known as Azure
Swyper has joined #ruby
freedom has quit [Quit: freedom]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 276 seconds]
gix has quit [Ping timeout: 276 seconds]
Technodrome has joined #ruby
bambanx has quit [Quit: Leaving]
r3m has quit [Quit: WeeChat 2.7-dev]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
r3m has joined #ruby
drincruz has joined #ruby
r3m has quit [Ping timeout: 246 seconds]
Swyper has quit [Remote host closed the connection]
banisterfiend has joined #ruby
r3m has joined #ruby
Swyper has joined #ruby
cadeskywalker has quit [Ping timeout: 240 seconds]
honigkuchen has joined #ruby
nowhere_man has joined #ruby
nowhereman has quit [Ping timeout: 276 seconds]
cadeskywalker has joined #ruby
honigkuchen has quit [Ping timeout: 240 seconds]
Swyper has quit [Remote host closed the connection]
sagax has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
sagax has joined #ruby
Swyper has quit [Remote host closed the connection]
cd has quit [Quit: cd]
ravenousmoose has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
ravenousmoose has quit [Ping timeout: 276 seconds]
ravenousmoose has joined #ruby
Swyper has joined #ruby
AJA4350 has quit [Quit: AJA4350]
Swyper has quit [Remote host closed the connection]
cyclonis has quit [Read error: Connection reset by peer]
Swyper has joined #ruby
Swyper has quit [Ping timeout: 240 seconds]
cyclonis_ has joined #ruby
cyclonis_ has quit [Read error: Connection reset by peer]
cyclonis has joined #ruby
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 276 seconds]
chalkmonster has quit [Quit: WeeChat 2.6]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
iAmDecim has joined #ruby
claw has quit [Ping timeout: 276 seconds]
claw has joined #ruby
grilix has quit [Ping timeout: 246 seconds]
brool has quit [Ping timeout: 276 seconds]
ravenousmoose has quit [Ping timeout: 276 seconds]
smccarthy has joined #ruby
donofrio has quit [Remote host closed the connection]
BustyLoli-Chan has quit [Ping timeout: 240 seconds]
iAmDecim has quit [Ping timeout: 276 seconds]
rainmanjam has quit []
dellavg has joined #ruby
fphilipe has joined #ruby
smccarthy has quit [Remote host closed the connection]
fphilipe has quit [Ping timeout: 240 seconds]
apg has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_mossplix has joined #ruby
chalkmonster has joined #ruby
dhollinger has quit [Ping timeout: 240 seconds]
tdy has quit [Ping timeout: 265 seconds]
dhollinger has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem has joined #ruby
<akem> Hey
<akem> I'm trying to get qt4ruby however it looks like it is not packaged anymore for Ubuntu 18.04 and it looks like rubyforge.org is not working atm, anyone using qt4ruby on Ubuntu?
absolutejam has joined #ruby
_mossplix has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
cnsvc_ has quit [Ping timeout: 260 seconds]
tsujp has joined #ruby
_mossplix has joined #ruby
apg has quit [Quit: Leaving]
apg has joined #ruby
apg has joined #ruby
apg has quit [Changing host]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
freedom has joined #ruby
_mossplix has quit [Ping timeout: 264 seconds]
andikr has joined #ruby
absolutejam has quit [Ping timeout: 276 seconds]
_mossplix has joined #ruby
tsujp has joined #ruby
absolutejam has joined #ruby
DarthGandalf has quit [Ping timeout: 244 seconds]
tsujp_ has joined #ruby
DarthGandalf has joined #ruby
tsujp has quit [Ping timeout: 240 seconds]
xco has joined #ruby
Mrgoose84570 has joined #ruby
Mrgoose8457 has quit [Ping timeout: 245 seconds]
terens has joined #ruby
absolutejam has quit [Ping timeout: 265 seconds]
honigkuchen has joined #ruby
honigkuchen has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
xco has quit [Quit: xco]
schne1der has joined #ruby
DTZUZO has quit [Ping timeout: 265 seconds]
tsujp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsujp has joined #ruby
fphilipe has joined #ruby
fanta1 has joined #ruby
absolutejam has joined #ruby
nowhere_man has joined #ruby
honigkuchen has joined #ruby
BH23 has joined #ruby
Mrgoose845701 has joined #ruby
Mrgoose84570 has quit [Ping timeout: 250 seconds]
chalkmonster has quit [Quit: WeeChat 2.6]
nowhere_man has quit [Ping timeout: 240 seconds]
gavlee has quit [Excess Flood]
esrse has joined #ruby
gavlee has joined #ruby
Intelo has joined #ruby
lxsameer has joined #ruby
conta1 has joined #ruby
Intelo has quit [Remote host closed the connection]
Intelo has joined #ruby
vondruch has quit [Quit: vondruch]
Intelo has quit [Remote host closed the connection]
Intelo has joined #ruby
andikr has quit [Ping timeout: 240 seconds]
andikr has joined #ruby
freedom has quit [Ping timeout: 265 seconds]
tdy has joined #ruby
chalkmonster has joined #ruby
weird_error has joined #ruby
vondruch has joined #ruby
andikr has quit [Quit: No Ping reply in 180 seconds.]
andikr has joined #ruby
NL3limin4t0r has quit [Ping timeout: 240 seconds]
NL3limin4t0r has joined #ruby
Jonopoly has joined #ruby
DTZUZO has joined #ruby
mn3m has joined #ruby
rippa has joined #ruby
mn3m has quit [Remote host closed the connection]
Intelo has quit [Remote host closed the connection]
Intelo has joined #ruby
gdrc has joined #ruby
DTZUZO has quit [Ping timeout: 276 seconds]
absolutejam has quit [Ping timeout: 240 seconds]
Intelo has quit [Remote host closed the connection]
Intelo has joined #ruby
Mrgoose8457019 has joined #ruby
Mrgoose845701 has quit [Ping timeout: 268 seconds]
absolutejam has joined #ruby
apg has quit [Remote host closed the connection]
bruce_lee has quit [Ping timeout: 265 seconds]
cyclonis has quit [Read error: Connection reset by peer]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cyclonis has joined #ruby
bruce_lee has joined #ruby
Intelo has quit [Ping timeout: 246 seconds]
hightower2 has quit [Ping timeout: 265 seconds]
absolutejam has quit [Ping timeout: 250 seconds]
bruce_lee has quit [Ping timeout: 252 seconds]
absolutejam has joined #ruby
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
hightower2 has joined #ruby
dhollinger has quit [Ping timeout: 246 seconds]
Bish has joined #ruby
<Bish> is there a pretty way to express
<Bish> { |k,v| == x }
<Bish> { |_,v| == x }
<Bish> { |x,_| == x }
<Bish> vice versy
<Bish> versa*
<Bish> { |_,v| == x }
<Bish> { |x,_| v == x } rather
dhollinger has joined #ruby
cyclonis_ has joined #ruby
Intelo has joined #ruby
cyclonis has quit [Ping timeout: 240 seconds]
postmodern has quit [Quit: Leaving]
conta1 has quit [Quit: conta1]
ellcs has joined #ruby
tdy1 has joined #ruby
bruce_lee has quit [Ping timeout: 240 seconds]
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
tdy has quit [Ping timeout: 245 seconds]
chalkmonster has quit [Quit: WeeChat 2.6]
bruce_lee has quit [Ping timeout: 240 seconds]
bruce_lee has joined #ruby
cgfbee has quit [Ping timeout: 240 seconds]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
<voker57> no
cyclonis_ has quit [Read error: Connection reset by peer]
Mrgoose84570191 has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Max SendQ exceeded]
cyclonis has joined #ruby
Mrgoose8457019 has quit [Ping timeout: 268 seconds]
_mossplix has quit [Remote host closed the connection]
_mossplix has joined #ruby
NL3limin4t0r has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
drincruz has quit [Quit: WeeChat 2.6]
_mossplix has quit [Ping timeout: 268 seconds]
Swyper has quit [Remote host closed the connection]
NL3limin4t0r has joined #ruby
Swyper has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Nicmavr has joined #ruby
Swyper has quit [Remote host closed the connection]
dasher00 has joined #ruby
chalkmonster has joined #ruby
tdy1 has quit [Ping timeout: 264 seconds]
poontangmessiah has joined #ruby
Swyper has joined #ruby
tsujp has joined #ruby
kp666[m] has joined #ruby
iAmDecim has joined #ruby
dbugger has joined #ruby
TCZ has joined #ruby
<TCZ> t
AJA4350 has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
mn3m has joined #ruby
i9zO5AP has joined #ruby
Ai9zO5AP has quit [Ping timeout: 245 seconds]
_mossplix has joined #ruby
_whitelogger has joined #ruby
weird_error has quit [Quit: weird_error]
chalkmonster has quit [Quit: WeeChat 2.6]
weird_error has joined #ruby
Mrgoose845701915 has joined #ruby
Mrgoose84570191 has quit [Ping timeout: 268 seconds]
weird_error has quit [Quit: weird_error]
Lyubo1 has joined #ruby
grilix has joined #ruby
donofrio has joined #ruby
TCZ has quit [Quit: Bye Bye]
conta1 has joined #ruby
iAmDecim has quit [Ping timeout: 240 seconds]
absolutejam has quit [Ping timeout: 268 seconds]
absolutejam has joined #ruby
iAmDecim has joined #ruby
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
NL3limin4t0r has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.6]
Swyper has quit [Remote host closed the connection]
esrse has quit [Ping timeout: 268 seconds]
grilix has quit [Read error: Connection reset by peer]
grilix has joined #ruby
al2o3-cr has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
BH23 has quit [Ping timeout: 265 seconds]
chalkmonster has joined #ruby
AJA4350 has joined #ruby
drincruz has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
Swyper has joined #ruby
chalkmon1 has joined #ruby
chalkmonster has quit [Ping timeout: 245 seconds]
yann-kaelig has joined #ruby
Esa_ has joined #ruby
hutch1 has joined #ruby
chalkmon1 has quit [Ping timeout: 265 seconds]
_mosspli_ has joined #ruby
_mossplix has quit [Read error: Connection reset by peer]
BH23 has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
cyclonis has quit [Quit: -a- Connection Timed Out]
honigkuchen has quit [Quit: Leaving]
golevka6489 has joined #ruby
golevka has quit [Quit: Leaving]
golevka6489 has quit [Remote host closed the connection]
hutch1 has quit [Ping timeout: 276 seconds]
cyclonis has joined #ruby
_mosspli_ has quit [Remote host closed the connection]
andikr has quit [Ping timeout: 264 seconds]
andikr has joined #ruby
grilix has quit [Ping timeout: 240 seconds]
golevka has joined #ruby
jcalla has quit [Ping timeout: 240 seconds]
Mrgoose845701915 has quit [Ping timeout: 245 seconds]
conta1 has quit [Quit: conta1]
jacksoow has quit [Read error: No route to host]
xco has joined #ruby
jacksoow has joined #ruby
hutch1 has joined #ruby
akemhp_ has joined #ruby
akem has quit [Read error: Connection reset by peer]
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 250 seconds]
akemhp_ has joined #ruby
akem__ has quit [Ping timeout: 250 seconds]
hightower2 has quit [Changing host]
hightower2 has joined #ruby
akemhp has joined #ruby
akemhp_ has quit [Ping timeout: 245 seconds]
akemhp has quit [Remote host closed the connection]
jrafanie has joined #ruby
Swyper has quit [Remote host closed the connection]
lucasb has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
_mossplix has joined #ruby
TomyWork has joined #ruby
cow[moo] has joined #ruby
andikr has quit [Quit: No Ping reply in 180 seconds.]
andikr has joined #ruby
stryek has joined #ruby
_mossplix has quit [Remote host closed the connection]
<Jonopoly> is there a good library for anonymizing a database using ruby?
hutch1 has quit [Ping timeout: 250 seconds]
ajunior_ has joined #ruby
xco has quit [Quit: xco]
cd has joined #ruby
_mossplix has joined #ruby
schne1der has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
chalkmonster has joined #ruby
jcalla has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
drincruz has joined #ruby
grilix has joined #ruby
ajunior_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
za1b1tsu has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
Fischmiep has joined #ruby
_mossplix has quit [Remote host closed the connection]
GodFather has quit [Ping timeout: 268 seconds]
Ca1us is now known as Caius
GodFather has joined #ruby
phaul has joined #ruby
Fischmiep has quit [Ping timeout: 240 seconds]
mn3m has quit [Read error: Connection reset by peer]
akemhp has joined #ruby
_mossplix has joined #ruby
KeyJoo has joined #ruby
yann-kaelig has quit [Quit: yann-kaelig]
KeyJoo has quit [Max SendQ exceeded]
KeyJoo has joined #ruby
_mossplix has quit [Ping timeout: 240 seconds]
TCZ has joined #ruby
<havenwood> Bish: In 2.7: { _1 == x }
Fischmiep has joined #ruby
<havenwood> Bish: In 2.7: { _2 == y }
<havenwood> Bish: Err, actually, it was changed, I forgot. Now _1 is { |x| } not { |x,| } like it was.
<havenwood> What was _0 is now just _1.
mn3m has joined #ruby
hutch1 has joined #ruby
Rapture has joined #ruby
Rapture has quit [Remote host closed the connection]
Rapture has joined #ruby
drincruz_ has joined #ruby
terens has quit [Quit: Leaving]
xco has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
ajunior_ has joined #ruby
spiette has quit [Quit: ZNC 1.7.3 - https://znc.in]
spiette has joined #ruby
_mossplix has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
otaznik[m] has quit [Remote host closed the connection]
mistergibson[m] has quit [Remote host closed the connection]
fig-le-deunch[m] has quit [Remote host closed the connection]
Hanma[m] has quit [Write error: Connection reset by peer]
turt2live has quit [Read error: Connection reset by peer]
bertocq[m] has quit [Read error: Connection reset by peer]
linuus[m] has quit [Remote host closed the connection]
kp666[m] has quit [Remote host closed the connection]
eein[m] has quit [Read error: Connection reset by peer]
danielk43[m] has quit [Remote host closed the connection]
kira_rose[m] has quit [Read error: Connection reset by peer]
qbrd[m] has quit [Remote host closed the connection]
aecepoglu[m] has quit [Remote host closed the connection]
tsrt^ has quit [Max SendQ exceeded]
Corey[m] has quit [Remote host closed the connection]
iotatron[m] has quit [Remote host closed the connection]
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
tsrt^ has joined #ruby
tsrt^ has quit [Excess Flood]
troulouliou_div2 has joined #ruby
tsrt^ has joined #ruby
Fischmiep has quit [Ping timeout: 240 seconds]
GodFather has quit [Ping timeout: 276 seconds]
jacksoow has quit [Read error: Connection reset by peer]
jacksoow has joined #ruby
ajunior_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xco has quit [Quit: xco]
GodFather has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
<adam12> Jonopoly: What's your end goal? An anonymized database dump?
hutch1 has quit [Ping timeout: 252 seconds]
hutch1 has joined #ruby
<adam12> Jonopoly: I've always seen it done in two steps. pg_dump | psql. Then psql sanitize.sql where sanitize.sql is a bunch of UPDATE users SET name = "User " || id, etc.
<Jonopoly> yeah adam12
<adam12> Jonopoly: You could probably build your own with Sequel + Faker or something. Depending on number of rows, the faker support would slow things down.
<Jonopoly> database has 40tables :(
<Jonopoly> and is 7gb
<adam12> Jonopoly: I'd probably try to do it all in SQL then. If you can get by with generic values (User 1, User 2, etc) then it's super simple. If you need someting more realistic, you could always maybe use a CTE and then build a table of fake names, fake addresses, etc. and then maybe try to pick one at random.
DTZUZO has joined #ruby
<adam12> Jonopoly: This looks interesting too, tho I don't think it's in Ruby. https://gitlab.com/dalibo/postgresql_anonymizer
<adam12> (you'd have to be on pg as well, obviously :))
Fischmiep has joined #ruby
drincruz has joined #ruby
hutch1 has quit [Ping timeout: 264 seconds]
drincruz_ has quit [Ping timeout: 265 seconds]
mahlon has quit [Quit: WeeChat 2.5]
ged has quit [Quit: WeeChat 2.5]
Fischmiep has quit [Ping timeout: 250 seconds]
sgen has joined #ruby
jeremycw has joined #ruby
mahlon has joined #ruby
schne1der has joined #ruby
_mossplix has quit [Ping timeout: 265 seconds]
brool has joined #ruby
suukim has joined #ruby
absolutejam has quit [Ping timeout: 268 seconds]
akemhp_ has joined #ruby
akemhp has quit [Ping timeout: 245 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Intelo has quit [Remote host closed the connection]
alem0lars has joined #ruby
AJA4350 has joined #ruby
Inline has joined #ruby
<adam12> Anybody know if there was ever a name applied to the pattern Rack uses? I swore there was one but can't seem to find any references to it. It's a reducer of some sort.
TCZ has quit [Quit: Bye Bye]
BH23 has quit [Ping timeout: 268 seconds]
greypack has quit [Ping timeout: 240 seconds]
<havenwood> adam12: I see someone calling it a nested handler pipeline. Phoenix just calls theirs a pipeline.
<adam12> havenwood: I swore it had a name at some point but maybe I'm misimagining it. It's basically middleware.reverse.reduce(App.new) { |app, middleware| middleware.call(app) }
<adam12> havenwood: I'm looking into a nicer method chaining solution but was hoping to look up some implementations first.
<havenwood> adam12: That reminds me of almost-rack: https://github.com/rkh/almost-rack/blob/meister/almost-rackup
<adam12> lol
<havenwood> adam12: Which you wouldn't want to use without almost-rack-protection, of course: https://github.com/rkh/almost-rack-protection
<adam12> I thought function composition would be a good use case here but I'm not sure it would work with yield.
<havenwood> Does pair well with almost-sinatra: https://github.com/rkh/almost-rack-protection
<havenwood> adam12: Yeah, more like a Phoenix Plug approach. Hmmmmm.
poontangmessiah has joined #ruby
ajunior_ has joined #ruby
etupat has joined #ruby
ajunior_ has quit [Client Quit]
freedom has joined #ruby
ellcs has quit [Ping timeout: 265 seconds]
Jonopoly has quit [Quit: WeeChat 2.5]
troulouliou_div2 has quit [Remote host closed the connection]
fphilipe has quit [Quit: WeeChat 2.4]
hightower2 has quit [Ping timeout: 246 seconds]
aecepoglu[m] has joined #ruby
greypack has joined #ruby
Swyper has joined #ruby
<Swyper> hi
<Swyper> I have an array of objects, each object has a name and losses attribute, I want to make name the key and losses the attribute
wildtrees has joined #ruby
<Swyper> whats the easiest way to do that (to convert it into a hash)
poontangmessiah has quit [Remote host closed the connection]
<NL3limin4t0r> I'd say something like: array.map { |object| [object.name, object.losses] }.to_h
<NL3limin4t0r> Assuming you can access the attributes through an attribute reader.
<phaul> or with new enough ruby s/map/to_h/
cow[moo] has quit [Ping timeout: 265 seconds]
<phaul> and s/to_h//
<NL3limin4t0r> Keep in mind that using the "name" attribute as key means that it should be unique.
poontangmessiah has joined #ruby
<Swyper> thanks NL3limin4t0r
<Swyper> and Phaul
<Swyper> yah name will be unique
<phaul> X = Struct.new(:name, :losses); [X.new('a', 13)].to_h {|obj| [obj.name, obj.losses] }
<phaul> &>> X = Struct.new(:name, :losses); [X.new('a', 13)].to_h {|obj| [obj.name, obj.losses] }
<NL3limin4t0r> phaul: I've encountered that use of #to_h somewhere, but always forget it's an option.
<rubydoc> # => {"a"=>13} (https://carc.in/#/r/7q34)
poontangmessiah has quit [Read error: Connection reset by peer]
<phaul> NL3limin4t0r: it's new. Can't remeber maybe 2.6
<phaul> &25>> X = Struct.new(:name, :losses); [X.new('a', 13)].to_h {|obj| [obj.name, obj.losses] }
<rubydoc> stderr: -e:4:in `to_h': wrong element type X at 0 (expected array) (TypeError)... check link for more (https://carc.in/#/r/7q35)
poontangmessiah has joined #ruby
<NL3limin4t0r> I guess I've missed the feature since it's not in the release notes.
<Swyper> game.rb:13:in `block in initialize': undefined method `name' for #<Array:0x00007fb23f06ae70> (NoMethodError)
fanta1 has quit [Quit: fanta1]
<Swyper> @score = @players.map { |players_list| [players.name, players.losses] }.to_h
<Swyper> hm
<NL3limin4t0r> ^ @score = @players.map { |player| [player.name, player.losses] }.to_h
jrafanie has joined #ruby
<Swyper> sweet, ty
andikr has quit [Remote host closed the connection]
<NL3limin4t0r> You backreference to "players" in your block, while you should use the yielded player
orbyt_ has joined #ruby
<NL3limin4t0r> np
TomyWork has quit [Ping timeout: 246 seconds]
<NL3limin4t0r> Swyper: If you use 2.6.0 or higher you could shorten it by using #to_h with a block as mentioned by phaul.
<NL3limin4t0r> @score = @players.to_h { |player| [player.name, player.losses] }
<Swyper> interesting
ramfjord has joined #ruby
<havenwood> Should we add a Struct#slice, maybe?
cyclonis has quit [Ping timeout: 240 seconds]
poontangmessiah has quit [Remote host closed the connection]
<havenwood> I guess there's the nasty question of whether it'd be by name or position. I prefer name, but I guess the other related methods are by postion.
<havenwood> Yeah, by position I don't care. Never mind. :P
<NL3limin4t0r> I was just about to say around the same thing.
<NL3limin4t0r> Array#slice returns an array. Hash#slice returns a hash
hiroaki_ has joined #ruby
<NL3limin4t0r> There is already a Struct#values_at method which returns based on position.
fphilipe has joined #ruby
<NL3limin4t0r> But the parameters are a bit weird since it's index based.
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
<leftylink> I was about to make a passsionate argument for this case, citing "there is precendence in the standard library that T#slice returns a T" but then found out the this is not true for Array#slice so my argument is broken and I cannot argue it
poontangmessiah has joined #ruby
<leftylink> that is a shame
Swyper has quit [Remote host closed the connection]
jacksoow has quit [Read error: Connection reset by peer]
<leftylink> whoops, s/precedence/precedent/
poontangmessiah has quit [Remote host closed the connection]
duderonomy has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
duderonomy is now known as Guest42181
jacksoow has joined #ruby
qbrd[m] has joined #ruby
mistergibson[m] has joined #ruby
iotatron[m] has joined #ruby
kp666[m] has joined #ruby
turt2live has joined #ruby
linuus[m] has joined #ruby
sepp2k has joined #ruby
eein[m] has joined #ruby
Corey[m] has joined #ruby
danielk43[m] has joined #ruby
kira_rose[m] has joined #ruby
otaznik[m] has joined #ruby
bertocq[m] has joined #ruby
Hanma[m] has joined #ruby
fig-le-deunch[m] has joined #ruby
poontangmessiah has joined #ruby
suukim has quit [Quit: Konversation terminated!]
<NL3limin4t0r> leftylink: You're referencing to the fact that it can return `nil` when out of bounds?
Rapture has quit [Ping timeout: 264 seconds]
Guest42181 has quit [Read error: Connection reset by peer]
duderono_ has joined #ruby
DTZUZU has quit [Quit: WeeChat 2.2]
duderono_ has quit [Read error: Connection reset by peer]
duderono_ has joined #ruby
alem0lars has quit [Ping timeout: 250 seconds]
<leftylink> you know how in the game "Codenames" whenever the field operatives makes a guess that ends up being correct, the spymaster simply marks it correct (by placing the appropriately-coloured token on it) without explicitly specifying whether it was what the spymaster had in mind
<leftylink> Correct.
bambanx has joined #ruby
<leftylink> however, that is not as threatening to the argument I would have made
<leftylink> Array(T)#slice returning T was much more threatening
<leftylink> pretty much broke my entire argument for "this proposal for Struct#slice is inconsistent with the standard library precedent"
<leftylink> because... well, that would have made it consistent
duderono_ has quit [Read error: Connection reset by peer]
<NL3limin4t0r> The arguments accepted by #slice are also not consistant across the board.
duderono_ has joined #ruby
<NL3limin4t0r> Array#slice accepts 1 or 2 arguments, being an index, range or index + length. While Hash#slice accepts any amount of keys.
fphilipe has quit [Ping timeout: 264 seconds]
cyclonis_ has joined #ruby
Ai9zO5AP has joined #ruby
<NL3limin4t0r> But I guess we already have Array#values_at if you want to select certain indexes.
i9zO5AP has quit [Ping timeout: 265 seconds]
<NL3limin4t0r> I got to bounce. Have a nice evening.
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
Swyper has joined #ruby
<Swyper> hi
<Swyper> @score = @players.map { |player| [player.name, player.losses] }.to_h
hiroaki_ has quit [Ping timeout: 264 seconds]
<Swyper> play.losses should be a reference to that objects losses attribute right? if so how come it does not increment
<daed> map returns a new variable, not a reference
<daed> pretty much every functional programming paradigm is immutable by nature, so it's a copy into a new variable
<Swyper> ah
<Swyper> how can I make it mutable ?
<Swyper> is there something else I should use in place of map
<daed> since you've made @score a .to_h already, it's an O(1) lookup and you can just directly increment on your new @score variable
dionysus69 has quit [Ping timeout: 240 seconds]
<Swyper> thats fair
<daed> i can't see the rest of your code but i'm assuming list_of_players looks like an array of objects?
Intelo has joined #ruby
<daed> i usually prefer .map and immutability over .each and mutation so you have the right idea
<daed> depends on context, if you look at haskell and elixir i think everything is immutable/functional by default.. but functional programming isn't quite as performant
<daed> but it's more thread-safe
<daed> those pesky trade-offs in design
gix has joined #ruby
hiroaki_ has joined #ruby
jmcgnh has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
DTZUZU has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
Swyper has quit [Remote host closed the connection]
<leftylink> if it is (for some completely unintuitive reason) required that one must also be able to update the backing objects' attributes through `[]`, you may consider defining a `[]=` that does the appropriate thing, but one should stop to consider whether this behaviour would be surprising before one goes down such a route..
<leftylink> oops, I thought I didn't type a period yet
jmcgnh has joined #ruby
redlegion has quit [Ping timeout: 268 seconds]
Rapture has joined #ruby
etupat has quit [Remote host closed the connection]
hiroaki_ has quit [Ping timeout: 240 seconds]
etupat has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bruce_lee has quit [Ping timeout: 250 seconds]
hiroaki_ has joined #ruby
poontangmessiah has quit [Ping timeout: 250 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
ravenousmoose has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
sameerynho has joined #ruby
dionysus69 has joined #ruby
Intelo has quit [Ping timeout: 276 seconds]
redlegion has joined #ruby
<leftylink> wait a second
<leftylink> the person isn't even around to see that response
<leftylink> all my effort was wasted
<leftylink> feels bad.
hiroaki_ has quit [Ping timeout: 265 seconds]
duderono_ has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
duderonomy is now known as Guest71456
<daed> leftylink: who?
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
hiroaki_ has joined #ruby
absolutejam has joined #ruby
Guest71456 has quit [Read error: Connection reset by peer]
duderono_ has joined #ruby
duderono_ has quit [Read error: Connection reset by peer]
duderono_ has joined #ruby
etupat has quit [Remote host closed the connection]
etupat has joined #ruby
_mossplix has joined #ruby
etupat has quit [Remote host closed the connection]
etupat has joined #ruby
etupat has quit [Ping timeout: 265 seconds]
jeremycw has quit [Ping timeout: 252 seconds]
jeremycw has joined #ruby
duderon__ has joined #ruby
duderono_ has quit [Read error: Connection reset by peer]
etupat has joined #ruby
etupat has quit [Ping timeout: 245 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
TCZ has joined #ruby
duderon__ has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
duderonomy is now known as Guest81602
dionysus69 has quit [Ping timeout: 265 seconds]
BH23 has joined #ruby
BH23 has quit [Remote host closed the connection]
greengriminal has joined #ruby
cgfbee has joined #ruby
etupat has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
jrafanie has joined #ruby
ctp has joined #ruby
Guest81602 has quit [Read error: Connection reset by peer]
duderono_ has joined #ruby
ctp has quit [Remote host closed the connection]
KeyJoo has quit [Quit: KeyJoo]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ctp has joined #ruby
duderono_ has quit [Read error: Connection reset by peer]
duderono_ has joined #ruby
absolutejam1 has joined #ruby
duderono_ has quit [Read error: Connection reset by peer]
duderono_ has joined #ruby
absolutejam has quit [Ping timeout: 240 seconds]
jrafanie has joined #ruby
matheusmoreira has quit [Ping timeout: 245 seconds]
duderon__ has joined #ruby
duderono_ has quit [Read error: Connection reset by peer]
matheusmoreira has joined #ruby
tdy1 has joined #ruby
dellavg has quit [Remote host closed the connection]
absolutejam2 has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
absolutejam1 has quit [Ping timeout: 276 seconds]
mn3m has quit [Ping timeout: 246 seconds]
cow[moo] has joined #ruby
dionysus69 has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
ramfjord has joined #ruby
_mossplix has quit [Remote host closed the connection]
jacksoow has quit [Ping timeout: 265 seconds]
jacksoow has joined #ruby
cnsvc_ has joined #ruby
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grilix has quit [Ping timeout: 240 seconds]
etupat has quit [Remote host closed the connection]
etupat has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
AJA4350 has quit [Ping timeout: 268 seconds]
etupat has quit [Ping timeout: 240 seconds]
_mossplix has joined #ruby
poontangmessiah has joined #ruby
_mossplix has quit [Ping timeout: 268 seconds]
poontangmessiah has quit [Read error: Connection reset by peer]
poontangmessiah has joined #ruby
etupat has joined #ruby
etupat has quit [Remote host closed the connection]
etupat has joined #ruby
ctp has quit [Remote host closed the connection]
ctp has joined #ruby
etupat has quit [Ping timeout: 240 seconds]
Intelo has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
ctp has quit [Remote host closed the connection]
Nahra_ has joined #ruby
ctp has joined #ruby
xco has joined #ruby
Nahra_ has quit [Client Quit]
dionysus69 has quit [Ping timeout: 268 seconds]
poontangmessiah has quit [Read error: Connection reset by peer]
etupat has joined #ruby
cthulchu_ has joined #ruby
etupat has quit [Remote host closed the connection]
etupat has joined #ruby
cthu| has quit [Ping timeout: 264 seconds]
ramfjord has quit [Ping timeout: 268 seconds]
etupat has quit [Remote host closed the connection]
etupat has joined #ruby
ramfjord has joined #ruby
schne1der has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
duderon__ has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
duderonomy is now known as Guest79571
nisstyre has joined #ruby
<nisstyre> Why does DateTime.new(1582,10,8) raise an exception?
greengriminal has quit [Quit: This computer has gone to sleep]
Guest79571 has quit [Ping timeout: 240 seconds]
<Intelo> nisstyre, the problem with ruby is that its good but not much users
<Intelo> so less support
<nisstyre> yes I agree
<Intelo> nisstyre, why fewer devs despite its good? I wonder
<leftylink> in fact, let us see
<leftylink> &>> require 'date'; (1..31).reject { |i| DateTime.new(1582,10,i) rescue nil }
<rubydoc> # => [5, 6, 7, 8, 9, 10, 11, 12, 13, 14] (https://carc.in/#/r/7q44)
<leftylink> very interesting.
<leftylink> I guess those days just don't exist.
<nisstyre> would be nice to know why
<nisstyre> is this some historical accuracy thing?
<Intelo> leftylink, those days?
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<leftylink> indeed, since the code output more than one day.
<leftylink> therefore I must say "those days" and not just "that day"
<Intelo> oh
<Intelo> leftylink, why fewer devs despite its good? I wonder
<leftylink> don't know don't care
<leftylink> not my job to get more devs using ruby
<leftylink> so long as I use it, that is good enough for me
<Intelo> leftylink, but survival in community for support is
<Intelo> who will save you if you get stuck some time leftylink
<Intelo> leftylink, you never though
<Intelo> t
Fernando-Basso has joined #ruby
etupat has quit [Remote host closed the connection]
etupat has joined #ruby
ramfjord has joined #ruby
etupat has quit [Remote host closed the connection]
etupat has joined #ruby
Intelo has quit [Ping timeout: 268 seconds]
jeremycw has quit [Ping timeout: 268 seconds]
etupat has quit [Ping timeout: 265 seconds]
Intelo has joined #ruby
etupat has joined #ruby
linduxed has quit [Ping timeout: 240 seconds]
cyclonis_ has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
etupat has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 265 seconds]
gix has joined #ruby
gix- has quit [Ping timeout: 268 seconds]
linduxed has joined #ruby
jhass has quit [Quit: Bye]
chalkmonster has joined #ruby
drincruz has quit [Ping timeout: 264 seconds]
etupat has joined #ruby
absolutejam3 has joined #ruby
absolutejam2 has quit [Ping timeout: 245 seconds]
absolutejam4 has joined #ruby
absolutejam3 has quit [Ping timeout: 240 seconds]
etupat has quit []
cyclonis has joined #ruby
hiroaki_ has quit [Ping timeout: 240 seconds]
<brool> if i'm running a sinatra app with "set :bind, '0.0.0.0'" i should be able to connect to it over LAN, right?
Swyper has joined #ruby
<brool> i remember doing it successfully months ago but i don't know what i did differently then
absolutejam4 has quit [Ping timeout: 276 seconds]
<brool> i try connecting to `192.168.1.85:9292` on my phone but it won't connect, although the sinatra app says it's listening on `localhost:9292`
cyclonis has quit [Read error: Connection reset by peer]
ramfjord has joined #ruby
yokel has quit [Ping timeout: 265 seconds]
cyclonis has joined #ruby
yokel has joined #ruby
<Iambchop> nisstyre: "In order to restore March 20 or 21 as the day of the lunar equinox, Clavius recommended that 10 days be skipped. Pope Gregory XIII issued an order that Oct. 5-Oct. 14 be dropped from the calendar in 1582." http://www.findingdulcinea.com/news/on-this-day/September-October-08/On-this-Day--In-1582--Oct--5-Did-Not-Exist-.html
<nisstyre> Iambchop: I see, so basically "history"
nowhere_man has joined #ruby
bvdw has joined #ruby
<jidar> brool: you can verify it's bound to 0.0.0.0:<port> with either ss or netstat -nltop
<jidar> localhost:port means it's not listening on all interfaces
<havenwood> jidar: require 'socket'; Socket.ip_address_list.find(&:ipv4_private?).ip_address
<brool> jidar: yeah i bugged the ##linux nerds about it, i figured out i needed to pass a -o argument to `rackup`
<brool> thanks
<havenwood> brool: it should work to: -o 0.0.0.0
<havenwood> brool: Are you trying the same addy returned by? Socket.ip_address_list.find(&:ipv4_private?).ip_address
<jidar> havenwood: returns blank on one system and nomethoderror on another :P
<havenwood> haha
<brool> havenwood: yeah it's working now that i pass `-o 0.0.0.0` navigating my phone to `192.168.1.85:9292`
<havenwood> jidar: Works on my machine. :P => "192.168.86.65"
<brool> time to write @media queries x.x
<jidar> is that a threat :P
xco has quit [Quit: xco]
edwardly has quit [Read error: Connection reset by peer]
AJA4350 has joined #ruby
akemhp has joined #ruby
grilix has joined #ruby
akemhp_ has quit [Ping timeout: 252 seconds]
GodFather has quit [Ping timeout: 245 seconds]
sgen has quit [Ping timeout: 245 seconds]
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
nowhere_man has quit [Ping timeout: 276 seconds]
weird_error has joined #ruby
fphilipe has joined #ruby
jmcgnh has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Bye Bye]
fphilipe has quit [Ping timeout: 268 seconds]
jmcgnh has joined #ruby
grilix has quit [Read error: Connection reset by peer]
cow[moo] has quit [Read error: Connection reset by peer]
grilix has joined #ruby
Fernando-Basso has quit [Remote host closed the connection]
Freshnuts has joined #ruby
sameerynho has quit [Ping timeout: 265 seconds]
iAmDecim has quit [Ping timeout: 276 seconds]
Freshnuts has quit [Remote host closed the connection]
Freshnuts has joined #ruby
Azure has quit [Quit: Textual IRC Client: www.textualapp.com]
dbz_ has joined #ruby
jhass has joined #ruby