havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.2.1, 3.1.3, 3.0.5, 2.7.7: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://t.ly/9ua4 | Logs: https://libera.irclog.whitequark.org/ruby/
Mikaela has quit [Remote host closed the connection]
Mikaela has joined #ruby
gemmaro`` has joined #ruby
gemmaro`` has quit [Remote host closed the connection]
quazimodo has joined #ruby
shaffl43 has joined #ruby
stirl has joined #ruby
nirvdrum has joined #ruby
John_Ivan has quit [Remote host closed the connection]
John_Ivan has joined #ruby
shaffl43 has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
John_Ivan has quit [Read error: Connection reset by peer]
John_Ivan has joined #ruby
crespire has quit [Read error: Connection reset by peer]
crespire has joined #ruby
nirvdrum has quit [Ping timeout: 246 seconds]
nirvdrum has joined #ruby
markong has quit [Ping timeout: 260 seconds]
wk_ has joined #ruby
desnudopenguino has quit [Ping timeout: 246 seconds]
wk_ has quit [Ping timeout: 255 seconds]
weaksauce has quit [Quit: Textual IRC Client: www.textualapp.com]
weaksauce has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
stirl has quit [Ping timeout: 246 seconds]
supers47 has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
matoro has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
helge has quit [Ping timeout: 276 seconds]
matoro has joined #ruby
helge has joined #ruby
stirl has joined #ruby
razetime has joined #ruby
nirvdrum has joined #ruby
matoro has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
matoro has joined #ruby
matoro has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
matoro has joined #ruby
razetime has quit [Ping timeout: 276 seconds]
supers47 has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
grenierm has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
razetime has joined #ruby
ur5us_ has quit [Ping timeout: 252 seconds]
razetime1 has joined #ruby
razetime has quit [Ping timeout: 276 seconds]
razetime1 is now known as razetime
TomyLobo has quit [Read error: Connection reset by peer]
ur5us_ has joined #ruby
wk_ has joined #ruby
wk_ has quit [Ping timeout: 246 seconds]
Linux_Kerio has joined #ruby
c10l73 has quit [Read error: Connection reset by peer]
c10l733 has joined #ruby
hololeap has quit [Ping timeout: 255 seconds]
hololeap has joined #ruby
ur5us_ has quit [Ping timeout: 250 seconds]
mooff has quit [Remote host closed the connection]
mooff has joined #ruby
stirl has quit [Ping timeout: 250 seconds]
ur5us_ has joined #ruby
offhan59 has joined #ruby
offhan59 has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
desnudopenguino has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
wk_ has joined #ruby
desnudopenguino1 has joined #ruby
moldorcoder7 has joined #ruby
desnudopenguino has quit [Ping timeout: 246 seconds]
desnudopenguino1 is now known as desnudopenguino
wk_ has quit [Ping timeout: 276 seconds]
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
crespire1 has joined #ruby
teclator has joined #ruby
TomyWork has joined #ruby
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
razetime has quit [Ping timeout: 250 seconds]
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
desnudopenguino has quit [Ping timeout: 250 seconds]
desnudopenguino has joined #ruby
Thanzex326 has quit [Ping timeout: 268 seconds]
grenierm has quit [Ping timeout: 260 seconds]
Thanzex3268 has joined #ruby
razetime has joined #ruby
infinityfye has joined #ruby
___nick___ has joined #ruby
otisolsen70 has joined #ruby
_ht has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
dionysus69 has joined #ruby
ur5us_ has quit [Ping timeout: 252 seconds]
wk_ has joined #ruby
wk_ has quit [Ping timeout: 255 seconds]
rvalue has quit [Ping timeout: 250 seconds]
Mikaela has quit [Ping timeout: 255 seconds]
rvalue has joined #ruby
Mikaela has joined #ruby
mexen has quit []
MalusVulgaris has joined #ruby
markong has joined #ruby
MalusVulgaris has quit [Quit: MalusVulgaris]
MalusVulgaris has joined #ruby
razetime has quit [Remote host closed the connection]
c10l733 is now known as c10l
Sankalp has quit [Ping timeout: 264 seconds]
nirvdrum has joined #ruby
Sankalp has joined #ruby
nirvdrum_ has joined #ruby
nirvdrum has quit [Read error: Connection reset by peer]
nirvdrum_ has quit [Client Quit]
weaksauc_ has joined #ruby
JayDoubleu__ has quit [Ping timeout: 250 seconds]
itok has quit [Ping timeout: 250 seconds]
weaksauce has quit [Ping timeout: 250 seconds]
desnudopenguino1 has joined #ruby
JayDoubleu__ has joined #ruby
itok has joined #ruby
vito_ has quit [Ping timeout: 250 seconds]
desnudopenguino has quit [Ping timeout: 250 seconds]
desnudopenguino1 is now known as desnudopenguino
FullMetalStacker has joined #ruby
vito_ has joined #ruby
<FullMetalStacker> #benching #performance: I see you guys from time to time benching the performance of various approaches and compare them so to know which code is better. Currently I want to compare the performance of:
<FullMetalStacker> str.each_char.tally.to_a and
<FullMetalStacker> str.chars.tally.to_a. Can someone give me a hint on how I can do that benching on my own?
<MalusVulgaris> Is it this you're looking for? => https://ruby-doc.org/stdlib-2.5.0/libdoc/benchmark/rdoc/Benchmark.html
<FullMetalStacker> @MalusVulgaris: I guess so! Thank you very much!
<adam12> I'd use benchmark-ips
<adam12> Or rather, _I_ use. You can use either, but I find ips a better metric than time.
<adam12> Yes.
<FullMetalStacker> alright, will check out both, thank you very much!
<FullMetalStacker> what do you mean with "better metric"?
<FullMetalStacker> ah ok i got it.
<adam12> FullMetalStacker: I generally don't care how long something is taking, more so I want to know how many times per second something can be done.
<adam12> Not sure if that helps.
<FullMetalStacker> iterations per second is a better metric than measuring time
<adam12> Yeah, at least IMHO.
<FullMetalStacker> got it
maroloccio has joined #ruby
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
nirvdrum has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
nirvdrum has joined #ruby
otisolsen70 has quit [Quit: Leaving]
nirvdrum has quit [Quit: nirvdrum]
ccapndave has joined #ruby
razetime has joined #ruby
maroloccio has quit [Quit: WeeChat 3.7.1]
nirvdrum has joined #ruby
razetime1 has joined #ruby
razetime has quit [Ping timeout: 246 seconds]
razetime1 is now known as razetime
nirvdrum has quit [Client Quit]
nirvdrum has joined #ruby
ccapndave has quit [Quit: Textual IRC Client: www.textualapp.com]
<apteryx> hi! can Rake use some kind of search path to find Rake files? e.g. can 'fn' as documented here: https://ruby.github.io/rake/Rake/DefaultLoader.html#method-i-load be looked from some configured environment variable path?
<apteryx> seems it uses the Ruby LOAD_PATH?
nirvdrum has quit [Quit: nirvdrum]
<apteryx> actual problem I'm facing: I have this on my GEM_PATH: /gnu/store/lfplkhhibjmj6w4hf079vfn741xnzdmp-ruby-railties-7.0.4.2/lib/ruby/vendor_ruby; the Rake file is at /gnu/store/i5d1x7b6k1xg33fs2wg37grwy8sgsziz-ruby-railties-7.0.4.2/lib/ruby/vendor_ruby/gems/railties-7.0.4.2/lib/rails/tasks/engine.rake, but 'load "rails/tasks/engine.rake"' in the Rakefile doesn't find it
<apteryx> it says: LoadError: cannot load such file -- rails/tasks/engine.rake
wk_ has joined #ruby
<ox1eef_> apteryx: You have 'Rake.application' in Rakefile.rb, and it has methods like 'add_import', and another method that loads those automatically (using Kernel#load). That's where I would start exploring. In Rakefile.rb, add 'binding.irb' and take a look around.
defectiverobot has joined #ruby
<apteryx> thanks
dviola has quit [Ping timeout: 276 seconds]
yossarian has quit [Quit: And then he took off.]
yossarian has joined #ruby
yossarian has quit [Changing host]
yossarian has joined #ruby
nirvdrum has joined #ruby
defectiverobot has quit [Remote host closed the connection]
defectiverobot has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
defectiverobot has quit [Ping timeout: 252 seconds]
dviola has joined #ruby
defectiverobot has joined #ruby
defectiverobot_ has joined #ruby
defectiverobot has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 250 seconds]
TomyWork has quit [Remote host closed the connection]
dionysus69 has joined #ruby
ye13 has joined #ruby
defectiverobot_ has quit [Ping timeout: 252 seconds]
razetime1 has joined #ruby
razetime has quit [Ping timeout: 276 seconds]
enarth86 has joined #ruby
razetime1 is now known as razetime
<ox1eef_> Welcome.
ye13 has quit [Ping timeout: 252 seconds]
NightMonkey_ has joined #ruby
NightMonkey has quit [Ping timeout: 246 seconds]
NightMonkey_ is now known as NightMonkey
defectiverobot has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
defectiverobot has quit [Remote host closed the connection]
razetime has quit [Remote host closed the connection]
defectiverobot has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
defectiverobot has quit [Ping timeout: 255 seconds]
ultralan has joined #ruby
ultralan has quit [Remote host closed the connection]
defectiverobot has joined #ruby
defectiverobot has quit [Remote host closed the connection]
mexen has joined #ruby
MalusVulgaris has quit [Quit: MalusVulgaris]
nirvdrum has joined #ruby
hansolo has quit [Read error: Connection reset by peer]
apteryx has quit [Ping timeout: 248 seconds]
hansolo has joined #ruby
seborr72 has joined #ruby
seborr72 has quit [Remote host closed the connection]
uncoun46 has joined #ruby
enarth86 has quit [Ping timeout: 256 seconds]
uncoun46 has quit [Remote host closed the connection]
condui39 has joined #ruby
apteryx has joined #ruby
dionysus69 has joined #ruby
<havenwood> FullMetalStacker: +1 Benchmark.ips, it's nice. Also be sure to check YJIT impact since sometimes it inverts the results.
<havenwood> FullMetalStacker: The other thing you might look at is memory usage.
<havenwood> Unsure if you're using UTF-8 and this applies to you, but often folk should consider `grapheme_clusters` instead of `chars`.
<FullMetalStacker> hi @havenwood: thanks! how do i bench the RAM?
<havenwood> Or `each_grapheme_cluster` in place of `each_char`.
<havenwood> FullMetalStacker: There are a variety of options for memory, but it's not as straightforward as checking iterations per second.
<havenwood> One option would be a tool like cmdbench https://github.com/manzik/cmdbench#readme
<FullMetalStacker> grapheme cluster: never heard of it before, will look into it
<havenwood> I wish hyperfine had a memory option, since I like that tool https://github.com/sharkdp/hyperfine#readme
nirvdrum has quit [Quit: nirvdrum]
<FullMetalStacker> CMDBEnch is a general purpose benchmarking tool? So do i understand it correctly that there is no option to measure that within ruby alone, but have to use system tools for the entire system_
<FullMetalStacker> ?
nirvdrum has joined #ruby
<havenwood> An aside, but protip if you're making Ruby command line apps without use of RubyGems, it's way faster to disable gems.
<havenwood> hyperfine 'ruby --disable-gems -e "0"'
<havenwood> FullMetalStacker: You can look at `GC.stat` etc, but I like to check actual memory used external to the program.
<FullMetalStacker> got it
<havenwood> Or there are various Ruby gems that will query for the memory usage of the current Ruby process.
<FullMetalStacker> how about just using top (since CMDBench is for linux pirmarily)
<havenwood> FullMetalStacker: If it's a long enough running program that you can catch it. :)
<havenwood> Or be fancy, and `htop`.
<FullMetalStacker> got it
<havenwood> Or the Rust variants, ytop or bottom.
<havenwood> I do like the color. :P
<dmn> I got "10.128.10.1" as string or IPAddr - what would be a good way to get to "10.128.11.1" - +255 was my first idea, but that didn't work
<dmn> ` IPAddr.new(previous_ipaddr.to_i + 256, Socket::AF_INET)` would work, but feels clumsy ;)
<FullMetalStacker> @havenwood thanks for your input! will look at those things, thanks a lot!
<ox1eef_> dmn: (ip_addr | 254).succ
markong has quit [Ping timeout: 246 seconds]
medall44 has joined #ruby
condui39 has quit [Ping timeout: 265 seconds]
medall44 has quit [Ping timeout: 256 seconds]
nirvdrum has quit [Quit: nirvdrum]
micros29 has joined #ruby
micros29 has quit [Read error: Connection reset by peer]
<havenwood> I can think of a few bad ways. >.>
<havenwood> (IPAddr.new('10.128.10.1')..).lazy.drop(256).first
<havenwood> Enumerator.produce(IPAddr.new('10.128.10.1'), &:succ).lazy.drop(256).first
<adam12> lol
dviola has left #ruby [WeeChat 3.7.1]
dviola has joined #ruby
howdoi has joined #ruby
<ox1eef_> TIL the 'shorthand:' syntax applies not to just locals that are in scope, but methods too: https://gist.github.com/0x1eef/81ea57483866f61b39ed82973ff2b6df
<havenwood> ox1eef_: Aye, handy sometimes but see it more often with locals.
<havenwood> >> {rand:}
<ruby[bot]> havenwood: # => (https://carc.in/#/r/eph6)
<havenwood> #=> {:rand=>0.8414538412801474}
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 246 seconds]
desnudopenguino1 is now known as desnudopenguino
<ox1eef_> Very cool xD
nirvdrum has joined #ruby
<adam12> Would you consider the shorthand "magic"?
<adam12> I'm always trying to reduce mental load and be more explicit, especially on teams where there may be juniors, and the shorthand would probably be non grata on my projects.
<ox1eef_> I'm familiar with it because of JavaScript, but AFAIK JavaScript keeps it to locals that are in scope. function foo() {}, and foo = function() {} both evaluate to {foo: function() {}} when used with {foo}.
<ox1eef_> And I agree, it is bit of a mind bender at first.
nirvdrum has quit [Quit: nirvdrum]
fowl has quit [Quit: The Lounge - https://thelounge.chat]
fowl has joined #ruby
<weaksauc_> i think that's too much magic personally
nirvdrum has joined #ruby
ur5us_ has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #ruby
mexen has quit []
nirvdrum has joined #ruby
<ox1eef_> It tripped me up at first but after reasoning that it can refer to anything that's available to the current 'self' it made more sense.
_ht has quit [Remote host closed the connection]
nirvdrum has quit [Quit: nirvdrum]
___nick___ has quit [Ping timeout: 264 seconds]
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #ruby
Linux_Kerio has quit [Quit: Konversation terminated!]
Linux_Kerio has joined #ruby
nirvdrum has joined #ruby
defectiverobot has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
defectiverobot has quit [Remote host closed the connection]
infinityfye has quit [Ping timeout: 264 seconds]
infinityfye has joined #ruby
markong has joined #ruby
teclator has quit [Ping timeout: 255 seconds]
infinityfye has quit [Ping timeout: 255 seconds]
Linux_Kerio has quit [Ping timeout: 268 seconds]
FullMetalStacker has quit [Remote host closed the connection]
tomtmym has quit [Read error: Connection reset by peer]
tomtmym has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
sidetracking has joined #ruby
sidetracking has quit [Quit: Client closed]
sidetracking has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<ox1eef_> Few things warm the heart as much as seeing a good person land a new job after being laid off in questionable circumstances.
sidetracking has quit [Quit: Client closed]
tomtmym has quit [Quit: Gone.]
hansolo has quit [Read error: Connection reset by peer]
hansolo has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]