desnudopenguino has quit [Ping timeout: 272 seconds]
desnudopenguino has joined #ruby
wyclif has joined #ruby
wyclif has quit [Ping timeout: 260 seconds]
finsternis has joined #ruby
jenrzzz has joined #ruby
wyclif has joined #ruby
TomyLobo has quit [Ping timeout: 268 seconds]
wyclif has quit [Ping timeout: 252 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
wyclif has joined #ruby
wand has joined #ruby
wyclif has quit [Ping timeout: 260 seconds]
<zayd>
https://bpa.st/CIWA trying to put the function gr33n7007h gave me into a class, and it says "undefined local variable or method `parse_lspci_output' for class Rubyfetch::GPU (NameError)", i'm assuming i missed something obvious here?
wand has quit [Remote host closed the connection]
wand has joined #ruby
wyclif has joined #ruby
wyclif has quit [Ping timeout: 264 seconds]
wyclif has joined #ruby
pascal_blaze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
pascal_blaze has joined #ruby
Guest18 has joined #ruby
Guest18 has quit [Client Quit]
jenrzzz has quit [Ping timeout: 245 seconds]
fercell_ has joined #ruby
fercell has quit [Ping timeout: 268 seconds]
<weaksauce>
zayd yes
<weaksauce>
you are setting it on the class itself
<weaksauce>
def initialize and do it there on an instance
<zayd>
i changed the function to initialize
<weaksauce>
no
<zayd>
oh
<weaksauce>
the @gpus part
<weaksauce>
attr_reader :gpus
<weaksauce>
def initialize; @gpus = ... ; end
<weaksauce>
GPU.new.gpus
<zayd>
hold on i'm kind of lost here
<zayd>
so i add the attr_reader, put @gpus into initialize(), and then what?
<weaksauce>
use it
<weaksauce>
create a new gpu and use the var
<zayd>
weaksauce: i put `puts "GPUs: #{GPU.class_eval '@gpus', __FILE__, __LINE__}"`, but it doesn't print anything. i assume at this point it would be best to just create the classes normally instead of doing this :p
<zayd>
yeah i'll do that
<weaksauce>
x = GPU.new
<weaksauce>
x.gpus
<zayd>
yep it worked
<zayd>
i just need to iterate the values and then i'm done with that part
<zayd>
sorry for always seeming so braindead in here btw, i'm still kind of new to ruby and am often going on less than 4 hours of sleep lol
<weaksauce>
no worries
<zayd>
oh god apparently sandisk drives fit the "3D" regex due to weird branding, i'll fix that later on though as it seems easy to do
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
konsolebox has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
pascal_blaze has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pandabot>
stderr: playpen: application terminated abnormally with signal 31 (Bad system call) - exit 1 - https://carc.in/#/r/grok
<leftylink>
you are kidding me sir
<leftylink>
and how ignominious that I got it on an ID that is an actual word
oz has quit [Remote host closed the connection]
ox has joined #ruby
<leftylink>
you know what, it must be because I asked for too many things at once
<leftylink>
pandabot rb require 'prime'; (1..100).select(&:prime?).repeated_combination(6).lazy.filter_map { |x| s = x.sum; s if s.prime? && s < 100 }.tally
Linux_Kerio has quit [Read error: Connection reset by peer]
konsolebox has quit [Quit: .]
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 256 seconds]
rvalue- is now known as rvalue
ken_barber has quit [Quit: Client closed]
___nick___ has quit [Ping timeout: 260 seconds]
polishdub has quit [Ping timeout: 252 seconds]
user71 has quit [Quit: Leaving]
konsolebox has joined #ruby
_ht has quit [Remote host closed the connection]
Perflosopher has joined #ruby
<havenwood>
leftylink: Since Ruby's Prime is so slow I might even not use it to check for primes on the second pass. 🤦 I think Ruby should just switch to mame's faster_prime gem as the default Prime.
<havenwood>
valid = Prime.take_while { |prime| prime < 100 }
<havenwood>
(valid & valid.repeated_combination(6).map(&:sum).filter { |sum| sum < 100 }).tally
reffle has quit [Remote host closed the connection]
reffle has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
dstein64- has joined #ruby
jenrzzz has joined #ruby
dstein64 has quit [Ping timeout: 264 seconds]
dstein64- is now known as dstein64
<adam12>
mooff: Have you used it at all?
<adam12>
Is anyone going to Rails World
<havenwood>
weaksauce: There are a few issues about making Prime faster, but apparently as a "hobby library" folk want Prime to stay simple. https://bugs.ruby-lang.org/issues/16468
<havenwood>
I think anything in stdlib should be recommendable for use, personally. Mere examples don't need to be in user space.
<havenwood>
I'd rather have no Prime in stdlib rather than an overly simple implementation that performs very poorly.
<havenwood>
Way more folk are using Prime compared to folk gazing at the simple code. The faster_prime library is simply better.
<havenwood>
Ruby stdlib isn't generally good examples of Ruby code, so I think we should focus on correctness and performance rather than "hobby" and "for fun" code.
<havenwood>
Or at least document that things like #curry won't ever work properly, since they're "for fun" and not real. You wouldn't guess from the docs.
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<havenwood>
Prime should at the minimum mention it's intentionally simple and give faster_prime a shoutout as what you should use if you really want a pure Ruby Prime library with the stdlib interface.
<havenwood>
I'd rather make these things real or remove them, but documenting the jokes and just for fun or example stuff would be nice.