havenwood changed the topic of #ruby to: Ruby 3.3.0, 3.2.3, 3.1.4 https://www.ruby-lang.org | Rules https://ruby-community.com | Logs https://libera.irclog.whitequark.org/ruby
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
mark22k has quit [Quit: Ping timeout (120 seconds)]
mark22k has joined #ruby
bambanxx has joined #ruby
jenrzzz has joined #ruby
rvalue has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
rvalue has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
Vonter has quit [Ping timeout: 256 seconds]
Vonter has joined #ruby
<sam113101> is there a method that gives the position(s) the item is found in an array? like [0, 1, 2, 3, 4, 6, 3, 5].method(3) = [3, 6]
<adam12> sam113101: None built in that I am aware of. `index` only returns first and won't support offset. filter_map.with_index would get you what you want. [0, 1, 2, 3, 4, 5, 6, 4, 5, 3].filter_map.with_index { |el, idx| idx if el == 3 }
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jas-maelstrom has quit [Quit: Leaving]
gr33n7007h has quit [Ping timeout: 272 seconds]
gr33n7007h has joined #ruby
jenrzzz has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 256 seconds]
gaussianblue has quit [Quit: leaving]
brw5 has quit [Remote host closed the connection]
brw5 has joined #ruby
fercell_ has quit [Quit: ZNC - https://znc.in]
jenrzzz has joined #ruby
fercell has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
desnudopenguino has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
bambanxx has joined #ruby
bambanxx has quit [Client Quit]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
<[0x1eef]> .with_index supports an offset.
<[0x1eef]> Hrm. Doesn't actually offset the element that is yielded. But increments the index from the offset instead.
nirvdrum has joined #ruby
jenrzzz has joined #ruby
orbyt_v10 has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jas-maelstrom has joined #ruby
PedroG2 has quit [Quit: Got you]
jenrzzz has quit [Ping timeout: 252 seconds]
PedroG1 has joined #ruby
joako_ has quit [Ping timeout: 260 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
kokoro has quit [Ping timeout: 256 seconds]
kokoro has joined #ruby
jenrzzz has joined #ruby
rvalue has quit [Ping timeout: 260 seconds]
nirvdrum has quit [Quit: nirvdrum]
jenrzzz has quit [Ping timeout: 264 seconds]
nirvdrum has joined #ruby
orbyt_v10 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nirvdrum has quit [Client Quit]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
avsej has joined #ruby
infinity_fye is now known as infinityfye
jenrzzz has joined #ruby
avsej has quit [Quit: avsej]
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
grenierm has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
_ht has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
Vonter has quit [Ping timeout: 256 seconds]
Vonter has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
gaussianblue has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
benjaminwil has quit [Ping timeout: 252 seconds]
benjaminwil has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
pusewicz_ has quit [Quit: https://www.layer22.com]
bambanxx has joined #ruby
gaussianblue has quit [Quit: leaving]
<havenwood> I think `filter_map.with_index` should be perfect for most situations. I wrote an Array#indices without an extension to see how it compares, and it's a couple times faster with larger Arrays. https://gist.github.com/havenwood/9a105e9a0077dd81db8497fdd29b7be4
<havenwood> sam113101: FWIW ^
jenrzzz has joined #ruby
pascal_blaze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
sam113101 has quit [Remote host closed the connection]
sam113101 has joined #ruby
adam12 has quit [Quit: Ping timeout (120 seconds)]
whysthatso125070 has quit [Quit: Ping timeout (120 seconds)]
adam12 has joined #ruby
whysthatso125070 has joined #ruby
caleb__ has quit [Ping timeout: 256 seconds]
conjunctive has quit [Ping timeout: 256 seconds]
conjunctive has joined #ruby
caleb_ has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
donofrio__ has joined #ruby
donofrio_ has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
joako has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
rovanion has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
RetroPunk has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
Guest15 has joined #ruby
Guest15 has quit [Client Quit]
infernix has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
hightower2 has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
hightower2 has joined #ruby
rvalue has joined #ruby
hightower2 has quit [Remote host closed the connection]
hightower2 has joined #ruby
hightower2 has quit [Remote host closed the connection]
hightower2 has joined #ruby
hightower2 has quit [Remote host closed the connection]
rvalue has quit [Ping timeout: 256 seconds]
rvalue has joined #ruby
jenrzzz has joined #ruby
rvalue has quit [Ping timeout: 255 seconds]
rvalue has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 252 seconds]
yeahitsme has joined #ruby
rvalue- is now known as rvalue
jenrzzz has quit [Ping timeout: 255 seconds]
rvalue has quit [Ping timeout: 268 seconds]
user71 has joined #ruby
rvalue has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 264 seconds]
Vonter has quit [Ping timeout: 268 seconds]
rvalue- is now known as rvalue
Vonter has joined #ruby
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 260 seconds]
rvalue- is now known as rvalue
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
passbe has quit [Ping timeout: 268 seconds]
pascal_blaze has joined #ruby
rvalue has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
Vonter has quit [Ping timeout: 268 seconds]
rvalue has joined #ruby
Vonter has joined #ruby
passbe has joined #ruby
rvalue has quit [Ping timeout: 272 seconds]
rvalue has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
rvalue has quit [Ping timeout: 264 seconds]
user71 has quit [Quit: Leaving]
rvalue has joined #ruby
gaussianblue has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
rvalue has quit [Ping timeout: 268 seconds]
weaksauce has quit [Quit: Textual IRC Client: www.textualapp.com]
weaksauce has joined #ruby
graywolf has joined #ruby
eddof13 has joined #ruby
eddof13 has quit [Quit: eddof13]
jenrzzz has joined #ruby
pascal_blaze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 252 seconds]
rvalue has joined #ruby
eddof13 has joined #ruby
rvalue has quit [Ping timeout: 252 seconds]
rvalue has joined #ruby
jenrzzz has joined #ruby
wryishly has quit [Quit: %blank%]
wryish has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
eddof13_ has joined #ruby
eddof13_ has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
osc4rpt has quit [Ping timeout: 246 seconds]
osc4rpt has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
osc4rpt has quit [Ping timeout: 264 seconds]
osc4rpt has joined #ruby
osc4rpt has quit [Ping timeout: 252 seconds]
osc4rpt has joined #ruby
eddof13_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
c10l52 has joined #ruby
c10l5 has quit [Ping timeout: 264 seconds]
c10l52 is now known as c10l5
gaussianblue has quit [Quit: leaving]
c10l5 has quit [Remote host closed the connection]
c10l5 has joined #ruby
eddof13_ has quit [Ping timeout: 268 seconds]
eddof13 has quit [Quit: eddof13]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
rvalue has quit [Quit: ZNC - https://znc.in]
Al2O3 has quit [Quit: Good mourning, good after nun, g'nite, and goober evenings.]
jenrzzz has joined #ruby
rvalue has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
_ht has quit [Remote host closed the connection]
graywolf has quit [Quit: WeeChat 4.0.4]
pascal_blaze has joined #ruby
eddof13 has joined #ruby
eddof13 has quit [Ping timeout: 255 seconds]
pascal_blaze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Vonter has quit [Ping timeout: 268 seconds]
brw5 has quit [Remote host closed the connection]
brw5 has joined #ruby
Vonter has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
orbyt_v10 has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
orbyt_v10 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
pascal_blaze has joined #ruby
Al2O3 has joined #ruby
Al2O3 has quit [Client Quit]
Al2O3 has joined #ruby
jenrzzz has joined #ruby
orbyt_v10 has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
pascal_blaze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
yeahitsme has quit [Quit: Leaving]
donofrio_ has joined #ruby