havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.0, 2.7.2, 2.6.6: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.org | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3
dfucci has joined #ruby
ur5us_ has joined #ruby
<tempate> Is there a way to get elements at different indexes from an array all at once?
<tempate> [3,1,4,1,5].get([0, 2]) would give [3,4]
<tempate> something like that
turt2live has quit [Ping timeout: 246 seconds]
<al2o3-cr> tempate: values_at
<tempate> al2o3-cr: thank you very much
PaulePanter has quit [Ping timeout: 245 seconds]
jordanh has quit [Ping timeout: 246 seconds]
hkoot_hoot[m] has quit [Ping timeout: 246 seconds]
<al2o3-cr> np :)
stnly510 has quit [Ping timeout: 245 seconds]
PaulB[m] has quit [Ping timeout: 246 seconds]
sagax has quit [Ping timeout: 245 seconds]
gueorgui has quit [Ping timeout: 245 seconds]
gueorgui has joined #ruby
bucareli has quit [Ping timeout: 245 seconds]
PaulePanter has joined #ruby
hkoot_hoot[m] has joined #ruby
PaulB[m] has joined #ruby
jordanh has joined #ruby
moldorcoder7 has quit [Ping timeout: 276 seconds]
turt2live has joined #ruby
adam128 has joined #ruby
adam12 has quit [Quit: adam12]
adam128 is now known as adam12
ruby_noob has quit [Quit: Connection closed]
lbwski has joined #ruby
neshpion has quit [Ping timeout: 268 seconds]
va5c0 has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
va5c0 has quit [Ping timeout: 260 seconds]
lbwski has quit [Ping timeout: 260 seconds]
moldorcoder7 has joined #ruby
jonhg has joined #ruby
jonhg has quit [Ping timeout: 260 seconds]
bucareli has joined #ruby
lbwski has joined #ruby
akem_ has quit [Quit: leaving]
dfucci has quit [Ping timeout: 264 seconds]
akem has joined #ruby
Rudd0 has quit [Ping timeout: 260 seconds]
akem has quit [Client Quit]
jenrzzz has joined #ruby
akem has joined #ruby
neshpion has joined #ruby
shokohsc has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
bucareli has quit [Quit: Lost terminal]
gearnode has quit [Ping timeout: 260 seconds]
lbwski has quit [Ping timeout: 265 seconds]
akem has quit [Quit: leaving]
jonhg has joined #ruby
va5c0 has joined #ruby
TCZ has quit [Quit: Czesc]
snickers has quit [Ping timeout: 260 seconds]
sagax has joined #ruby
jenrzzz has joined #ruby
jonhg has quit [Ping timeout: 245 seconds]
va5c0 has quit [Ping timeout: 246 seconds]
themsay[m] has quit [Ping timeout: 265 seconds]
jordanh has quit [Ping timeout: 265 seconds]
daillusionist has quit [Ping timeout: 240 seconds]
PaulB[m] has quit [Ping timeout: 240 seconds]
Hanma[m] has quit [Ping timeout: 240 seconds]
JanHebler[m] has quit [Ping timeout: 240 seconds]
jo-so has quit [Ping timeout: 240 seconds]
mahlon has quit [Ping timeout: 246 seconds]
tpanarch1st_ has quit [Ping timeout: 260 seconds]
swann11[m] has quit [Ping timeout: 258 seconds]
f3rno has quit [Ping timeout: 244 seconds]
kktt0071 has quit [Ping timeout: 244 seconds]
shokohsc has joined #ruby
lazypwny[m] has quit [Ping timeout: 240 seconds]
turt2live has quit [Ping timeout: 240 seconds]
hkoot_hoot[m] has quit [Ping timeout: 240 seconds]
matthewd has quit [Ping timeout: 246 seconds]
tpanarch1st_ has joined #ruby
mahlon has joined #ruby
matthewd has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
daillusionist has joined #ruby
jo-so has joined #ruby
evdubs_ has joined #ruby
evdubs has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
themsay[m] has joined #ruby
jonhg has joined #ruby
jordanh has joined #ruby
Hanma[m] has joined #ruby
jonhg has quit [Ping timeout: 260 seconds]
JanHebler[m] has joined #ruby
PaulB[m] has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
tpanarch1st has quit [Ping timeout: 264 seconds]
tpanarch1st_ has quit [Ping timeout: 246 seconds]
s3nd1v0g1us has quit [Quit: WeeChat 3.0.1]
turt2live has joined #ruby
lazypwny[m] has joined #ruby
hkoot_hoot[m] has joined #ruby
akem has joined #ruby
swann11[m] has joined #ruby
rubydoc_ has joined #ruby
rubydoc has quit [Remote host closed the connection]
kktt0071 has joined #ruby
moldorcoder7 has quit [Ping timeout: 265 seconds]
niv has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
niv has joined #ruby
moldorcoder7 has joined #ruby
patr0clus has joined #ruby
akem has quit [Quit: leaving]
neshpion_ has joined #ruby
akem has joined #ruby
neshpion_ has quit [Client Quit]
neshpion has quit [Remote host closed the connection]
va5c0 has joined #ruby
lbwski has joined #ruby
siery has quit [Ping timeout: 260 seconds]
va5c0 has quit [Ping timeout: 245 seconds]
patr0clus is now known as s3nd1v0g1us
lbwski has quit [Ping timeout: 246 seconds]
cloud69 has joined #ruby
ChmEarl has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 258 seconds]
s3nd1v0g1us has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jonhg has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
jonhg has quit [Ping timeout: 245 seconds]
Rudd0 has joined #ruby
jonhg has joined #ruby
jonhg has quit [Ping timeout: 260 seconds]
ur5us_ has quit [Ping timeout: 240 seconds]
patr0clus has joined #ruby
va5c0 has joined #ruby
patr0clus is now known as s3nd1v0g1us
akem has quit [Quit: leaving]
shokohsc has quit [Quit: Ping timeout (120 seconds)]
va5c0 has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
shokohsc has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
m27frogy has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ruby
va5c0 has joined #ruby
akem has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
va5c0 has quit [Ping timeout: 264 seconds]
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 246 seconds]
<akem> hey
<akem> why ruby -e 'puts "10".hex' returns 16 and not A?
<havenwood> akem: 10.to_s(16) is the other way around.
<havenwood> akem: '10'.hex is like '10'.to_i(16)
<havenwood> akem: (10 is the hex, 16 is the base 10)
<akem> havenwood: how can i print an hex to a dec? print "%d" % \xff ?
<akem> 255
lbwski has joined #ruby
<havenwood> akem: "\xff".bytes #=> [255]
<akem> Thank you havenwood.
Technodrome has joined #ruby
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
<havenwood> akem: "\xff".unpack1('H*').hex #=> 255
<havenwood> akem: You're welcome.
bucareli has joined #ruby
jonhg has joined #ruby
lbwski has quit [Ping timeout: 260 seconds]
jonhg has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
va5c0 has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
va5c0 has quit [Ping timeout: 264 seconds]
cloud69 has joined #ruby
siery has joined #ruby
<nakilon> &>> 0xff
<rubydoc_> # => 255 (https://carc.in/#/r/ai0h)
<nakilon> I don't see a sign that he had it as a String instance
al2o3-cr has quit [Ping timeout: 256 seconds]
nofxx__ has joined #ruby
nofxx_ has quit [Ping timeout: 245 seconds]
<havenwood> puts "\xff"
<havenwood> nakilon: That ^ doesn't do what they want but 0xff would have already worked.
<havenwood> nakilon: I assumed it was a String, I think correctly.
<havenwood> print "%d" % 0xff #>> 255
<havenwood> So they'd not ask why it doesn't work, since it does. ¯\_(ツ)_/¯
cliluw has quit [Read error: Connection reset by peer]
<havenwood> nakilon: Maybe there was a grander question and I missed it?
meimeix2 has quit [Ping timeout: 260 seconds]
<havenwood> akem: Was \xff that you wrote above meant to be a String and you just omitted the quotes?
nickb has quit [Ping timeout: 258 seconds]
nickb has joined #ruby
<akem> havenwood: i meant 0xff, just typing convention mismatch. nm.
s3nd1v0g1us has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood> akem: Oh, then you can just: print 0xff
<havenwood> akem: Is that what you meant?
<havenwood> nakilon: I guess you were right!
<akem> havenwood: yeah, you're right it prints in decimal.
<akem> I use ruby on Android on Termux terminal, it's great.
<akem> just like on a real linux box.
<akem> ruby 3.0
<havenwood> &>> [0e10, 0b10, 0o10, 0d10, 0x10]
<rubydoc_> # => [0.0, 2, 8, 10, 16] (https://carc.in/#/r/ai0l)
trautwein has joined #ruby
<akem> havenwood: what is the first one 'e'?
<havenwood> akem: scientific notation
CrazyEddy has quit [Remote host closed the connection]
<havenwood> akem: one unlike the others :)
<havenwood> exponential notation
<akem> &>> [0e20]
<rubydoc_> # => [0.0] (https://carc.in/#/r/ai0m)
<akem> Ok.
<akem> never had any use for it, i guess maybe for math people it may be usefull.
<havenwood> &>> 4.2e-3
<rubydoc_> # => 0.0042 (https://carc.in/#/r/ai0n)
<havenwood> &>> 4.2e3
<rubydoc_> # => 4200.0 (https://carc.in/#/r/ai0o)
<havenwood> akem: That ^ kinda stuff.
<akem> Haa ok...right havenwood, now i get it.
jonhg has joined #ruby
lbwski has joined #ruby
vondruch has joined #ruby
jonhg has quit [Ping timeout: 245 seconds]
vondruch has quit [Read error: Connection reset by peer]
vondruch has joined #ruby
patr0clus has joined #ruby
patr0clus is now known as s3nd1v0g1us
jenrzzz has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
lbwski has quit [Ping timeout: 256 seconds]
Rounin has joined #ruby
gearnode has joined #ruby
raddazong has quit [Quit: leaving]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord_ has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
jonhg has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
va5c0 has joined #ruby
va5c0 has quit [Ping timeout: 260 seconds]
<tempate> Is it possible to test a function that isn't part of a class with rspec?
<tempate> I have https://dpaste.org/yQTK right now but it's not giving an output
<tempate> Alright, I was importing rspec instead of rspect/autorun
va5c0 has joined #ruby
s3nd1v0g1us has quit [Quit: Textual IRC Client: www.textualapp.com]
jenrzzz has joined #ruby
split-brain has joined #ruby
gix- has quit [Ping timeout: 246 seconds]
cloud69 has quit [Quit: Connection closed for inactivity]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
michael_mbp has quit [Ping timeout: 260 seconds]
michael_mbp has joined #ruby
cd has quit [Quit: cd]
bzb has joined #ruby
jla has joined #ruby
jla has left #ruby [#ruby]
lbwski has joined #ruby
bucareli has quit [Quit: leaving]
gearnode has quit [Ping timeout: 260 seconds]
va5c0 has quit [Ping timeout: 260 seconds]
lbwski has quit [Ping timeout: 260 seconds]
va5c0 has joined #ruby
<tempate> Is there a better way to do 9.times.map{ [] } ?
TCZ has joined #ruby
ferr_ has joined #ruby
fercell has quit [Ping timeout: 264 seconds]
al2o3-cr has joined #ruby
Technodrome has joined #ruby
RougeR has joined #ruby
weaksauce has quit [Ping timeout: 264 seconds]
ruby[bot] has joined #ruby
tpanarch1st has joined #ruby
tpanarch1st_ has joined #ruby
bzb has quit [Remote host closed the connection]
gearnode has joined #ruby
<adam12> tempate: Better how?
<tempate> adam12: I meant in a more idiomatic way. [] * 9 doesn't work, for instance.
<adam12> tempate: There’s `Array.new(9) { [] }`
<tempate> oh right!
<adam12> tempate: If `[] * 9` could work, it would be risky because `[]` would be the same object each time.
<adam12> tempate: There’s `Array.new(9, [])` that suffers the same.
<tempate> adam12: I hadn't thought of that
<adam12> tempate: If you would do ary[0] << “ohai”, all of them would have the same “ohai” string in them.
<adam12> Tho I guess Ruby could be smart about it and call dup on the object. But it doesn’t afaik.
roadt_ has joined #ruby
roadt__ has quit [Ping timeout: 245 seconds]
nertzy_ has quit [Read error: Connection reset by peer]
nertzy has joined #ruby
CrazyEddy has joined #ruby
split-brain has quit [Ping timeout: 256 seconds]
split-brain has joined #ruby
split-brain has quit [Client Quit]
m27frogy has joined #ruby
bambanx has joined #ruby
shokohsc has quit [Quit: Ping timeout (120 seconds)]
lbwski has joined #ruby
shokohsc has joined #ruby
nertzy_ has joined #ruby
nertzy has quit [Read error: Connection reset by peer]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lbwski has quit [Ping timeout: 260 seconds]
yann-kaelig has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
akem_ has joined #ruby
al2o3-cr has joined #ruby
akem_ has quit [Read error: Connection reset by peer]
akem has quit [Ping timeout: 256 seconds]
bambanx has quit [Read error: No route to host]
akem has joined #ruby
lbwski has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
naftilos76 has joined #ruby
TCZ has quit [Remote host closed the connection]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
jenrzzz has joined #ruby
bzb has joined #ruby
vondruch has quit [Ping timeout: 265 seconds]
cow[moo] has quit [Remote host closed the connection]
va5c0 has quit [Read error: Connection reset by peer]
va5c0 has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
lbwski has quit [Ping timeout: 265 seconds]
lbwski has joined #ruby
RedNifre_ is now known as RedNifre
lbwski has quit [Ping timeout: 264 seconds]
Technodrome has joined #ruby
cow[moo] has joined #ruby
jenrzzz has joined #ruby
vondruch has joined #ruby
ferr_ has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 276 seconds]
lbwski has joined #ruby
shokohsc has quit [Quit: The Lounge - https://thelounge.chat]
shokohsc has joined #ruby
jenrzzz has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has joined #ruby
gearnode has quit [Ping timeout: 264 seconds]
nemesit|znc_ has quit [Quit: ZNC 1.6.3+deb1ubuntu0.2 - http://znc.in]
nemesit|znc has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
fercell has joined #ruby
va5c0 has quit [Ping timeout: 264 seconds]
va5c0 has joined #ruby
bzb has quit [Quit: Leaving]
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
gigetoo has quit [Ping timeout: 260 seconds]
gigetoo has joined #ruby
cow[moo] has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
TCZ has joined #ruby
va5c0 has quit [Ping timeout: 245 seconds]
TomyWork has joined #ruby
va5c0 has joined #ruby
hiroaki_ has quit [Ping timeout: 260 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
totoro2021 has quit [Ping timeout: 240 seconds]
totoro2021 has joined #ruby
hiroaki_ has joined #ruby
nertzy_ has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
SuperLag has quit [Ping timeout: 264 seconds]
ruurd has joined #ruby
GodFather has joined #ruby
jonhg has quit [Remote host closed the connection]
jonhg has joined #ruby
ChmEarl has joined #ruby
shtirlic has joined #ruby
jonhg has quit [Ping timeout: 260 seconds]
shtirlic_ has quit [Ping timeout: 260 seconds]
coniptor has quit [Ping timeout: 260 seconds]
coniptor has joined #ruby
va5c0 has quit [Ping timeout: 245 seconds]
trautwein has quit [Ping timeout: 260 seconds]
va5c0 has joined #ruby
ruurd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ferr_ has joined #ruby
fercell has quit [Ping timeout: 245 seconds]
TCZ has quit [Quit: Czesc]
ferr_ has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 245 seconds]
jla has joined #ruby
va5c0 has quit [Ping timeout: 256 seconds]
easbarbosa has joined #ruby
ruurd has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
apoc has quit [Ping timeout: 272 seconds]
mniip has quit [Remote host closed the connection]
apoc has joined #ruby
dinfuehr has quit [Ping timeout: 260 seconds]
dinfuehr has joined #ruby
mniip has joined #ruby
TomyWork has quit [Remote host closed the connection]
ruurd has quit [Ping timeout: 260 seconds]
howdoi has joined #ruby
akem_ has joined #ruby
akem_ has quit [Read error: Connection reset by peer]
akem_ has joined #ruby
akem has quit [Ping timeout: 260 seconds]
cuerbot has quit [Read error: Connection reset by peer]
easbarbosa has quit [Remote host closed the connection]
madhatter has joined #ruby
gearnode has joined #ruby
elcuervo has joined #ruby
dasher00 has joined #ruby
jordanm has quit [Remote host closed the connection]
jordanm has joined #ruby
Technodrome has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
gix has joined #ruby
RougeR has quit [Read error: Connection reset by peer]
patr0clus has joined #ruby
patr0clus is now known as s3nd1v0g1us
dasher00 has quit [Ping timeout: 245 seconds]
tpanarch1st_ has quit [Ping timeout: 260 seconds]
tpanarch1st has quit [Ping timeout: 260 seconds]
tpanarch1st_ has joined #ruby
tpanarch1st has joined #ruby
englosh has joined #ruby
<englosh> if I define a function/method on the top-level like `def hello; end` then is that a method or a function? I'd say function but would most others say method?
<WA9ACE> it becomes a method on the object Kernel
<englosh> right, it automatically becomes part of a class if you define it on the top level
<WA9ACE> yeah
cd has joined #ruby
jonhg has joined #ruby
jenrzzz has joined #ruby
jonhg has quit [Ping timeout: 245 seconds]
Emmanuel_Chanel has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
weaksauce has joined #ruby
Fire-Dragon-DoL has quit [Ping timeout: 276 seconds]
Fire-Dragon-DoL has joined #ruby
<adam12> Just to clarify, it’s actually `main` that receives the `hello` method.
SuperLag has joined #ruby
<WA9ACE> oh yup, you're right, for some reason I was thinking that was only in IRB
jonhg has joined #ruby
<adam12> WA9ACE: I had to check too.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has joined #ruby
jla has quit [Ping timeout: 276 seconds]
englosh has quit [Quit: Connection closed]
ByronJohnson has quit [Ping timeout: 240 seconds]
ua_ has quit [Ping timeout: 256 seconds]
kristian_on_linu has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
Rudd0 has quit [Ping timeout: 264 seconds]
ByronJohnson has joined #ruby
ua_ has joined #ruby
gigetoo has quit [Ping timeout: 260 seconds]
gigetoo has joined #ruby
naftilos76 has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
englosh has joined #ruby
hiroaki_ has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 264 seconds]
hiroaki has joined #ruby
jla has joined #ruby
hiroaki_ has joined #ruby
hiroaki_ has quit [Ping timeout: 246 seconds]
duderonomy has joined #ruby
hiroaki_ has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
lbwski has quit [Ping timeout: 256 seconds]
siery has quit [Ping timeout: 265 seconds]
duderonomy has quit [Ping timeout: 276 seconds]
duderonomy has joined #ruby
siery has joined #ruby
Rounin has quit [Ping timeout: 260 seconds]
jonhg has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jonhg has joined #ruby
englosh has quit [Quit: Connection closed]
jonhg has quit [Ping timeout: 245 seconds]
lbwski has joined #ruby
al2o3-cr has joined #ruby
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
Rudd0 has joined #ruby
lbwski has quit [Ping timeout: 260 seconds]
jla has quit [Ping timeout: 265 seconds]
englosh has joined #ruby
jonhg has joined #ruby
jonhg has quit [Ping timeout: 276 seconds]
englosh has quit [Quit: Connection closed]
TCZ has quit [Quit: Apophis sie zbliza]
lbwski has joined #ruby
hiroaki_ has quit [Ping timeout: 272 seconds]
lbwski has quit [Ping timeout: 246 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
hiroaki_ has joined #ruby
siery has quit [Ping timeout: 245 seconds]
neshpion has joined #ruby
hiroaki has quit [Ping timeout: 246 seconds]
hiroaki_ has quit [Ping timeout: 272 seconds]
siery has joined #ruby
hiroaki has joined #ruby
hiroaki1 has joined #ruby
hiroaki has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
yann-kaelig has quit []
lbwski has joined #ruby
hiroaki_ has joined #ruby
lbwski has quit [Ping timeout: 260 seconds]
hiroaki_ has quit [Ping timeout: 272 seconds]
lbwski has joined #ruby
gearnode has quit [Ping timeout: 272 seconds]
akem has joined #ruby
postmodern has joined #ruby
lbwski has quit [Ping timeout: 260 seconds]