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
rvalue has quit [Ping timeout: 256 seconds]
jenrzzz_ has quit [Ping timeout: 255 seconds]
rvalue has joined #ruby
nmollerup has quit [Remote host closed the connection]
CRISPR has quit [Ping timeout: 252 seconds]
jenrzzz_ has joined #ruby
szkl has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 240 seconds]
jenrzzz_ has joined #ruby
Vonter has quit [Ping timeout: 256 seconds]
Vonter has joined #ruby
jenrzzz_ has quit [Ping timeout: 264 seconds]
jenrzzz_ has joined #ruby
reset has quit [Quit: reset]
<zayd> How do I get the value of an @ variable in a class from outside of that class? Would I have to write a small function inside the class to do that or is there a more simple way to do it?
<KOTP> some_instance.get_instance_variable(:@whatever)
<KOTP> No, it is `instance_variable_get(:@whatever)`
<zayd> KOTP, thanks
jenrzzz_ has quit [Ping timeout: 268 seconds]
<weaksauce> zayd or add attr_reader :whatever
Linux_Kerio has joined #ruby
Linux_Kerio has quit [Read error: Connection reset by peer]
szkl has quit [Quit: Connection closed for inactivity]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 264 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 256 seconds]
Guest43 has joined #ruby
Guest43 has quit [Client Quit]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 255 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 268 seconds]
Vonter has quit [Ping timeout: 252 seconds]
Vonter has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 264 seconds]
jenrzzz_ has joined #ruby
grenierm has joined #ruby
jenrzzz_ has quit [Ping timeout: 252 seconds]
shokohsc51081294 has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 255 seconds]
jenrzzz_ has joined #ruby
summerisle is now known as eof
ih8u has quit [Remote host closed the connection]
ih8u has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 268 seconds]
jenrzzz_ has joined #ruby
<rapha> the latter would be better if it's supposed to be public
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
_ht has joined #ruby
___nick___ has joined #ruby
grenierm has quit [Ping timeout: 250 seconds]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
infinityfye has quit [Quit: Leaving]
reset has joined #ruby
ht_ has joined #ruby
_ht has quit [Ping timeout: 264 seconds]
ht_ is now known as _ht
shokohsc51081294 has quit [Ping timeout: 255 seconds]
<henk> I have an Array of domain names and a function that takes a domain name and return the apex domain for it, e.g. hnjs.ch => hnjs.ch, henk.hnjs.ch => hnjs.ch. I want to transform e.g. `['henk.hnjs.ch', 'hnjs.ch', 'hnjs.de']` to a hash `{'hnjs.ch' => ['henk.hnjs.ch', 'hnjs.ch'], 'hnjs.de' => ['hnjs.de']`. `Enumerable.group_by` works: http://pastie.org/p/1ROoLgNL0Rcx8U9EhYLrMO but I would like to make
<henk> those dns queries in parallel, i.e. with `Thread`s and I don’t know whether this can be done in the `group_by` block but my intuition says "no". AFAICT I would need some step in between which transforms the array of domains into a hash of "domain => apex_domain", where I can use threads. but I don’t find a function which could do this transformation. any ideas how to approach this?
the9ine has joined #ruby
hightower3 has joined #ruby
hightower2 has quit [Ping timeout: 255 seconds]
<henk> trying with merge: merge(*other_hashes) how can I pass array_of_hashes[1..] to it? this syntax complains about »no implicit conversion of Array into Hash«
szkl has joined #ruby
reset has quit [Ping timeout: 268 seconds]
reset has joined #ruby
<rapha> can't help with the Thread part of the question, henk, but an Array will only let itself be turned into a hash if it's 2-dimensional, with exactly 2 elements on the inner dimension.
jenrzzz_ has quit [Ping timeout: 268 seconds]
infinityfye has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 256 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 252 seconds]
reset has quit [Quit: reset]
ht_ has joined #ruby
_ht has quit [Ping timeout: 252 seconds]
ht_ is now known as _ht
TomyLobo has joined #ruby
Vonter has quit [Ping timeout: 252 seconds]
Vonter has joined #ruby
user71 has joined #ruby
donofrio_ has joined #ruby
donofrio has quit [Ping timeout: 246 seconds]
<henk> yep, I know
<henk> rapha: thanks
<henk> and I found the answer to my other question: splat operator
Pixi` has joined #ruby
Pixi has quit [Ping timeout: 256 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 276 seconds]
Munto has quit [Ping timeout: 264 seconds]
Munto has joined #ruby
the9ine has quit [Quit: Updating details, brb]
the9ine has joined #ruby
crespire has quit [Remote host closed the connection]
rvalue has quit [Ping timeout: 240 seconds]
crespire has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
Starfoxxes has quit [Ping timeout: 264 seconds]
rvalue has joined #ruby
desnudopenguino has joined #ruby
Starfoxxes has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 240 seconds]
reset has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 252 seconds]
Pixi__ has joined #ruby
Pixi` has quit [Ping timeout: 252 seconds]
krocos has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 252 seconds]
krocos has quit [Quit: Textual IRC Client: www.textualapp.com]
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 260 seconds]
desnudopenguino1 is now known as desnudopenguino
desnudopenguino has quit [Ping timeout: 260 seconds]
Goodbye_Vincent has quit [Ping timeout: 240 seconds]
Goodbye_Vincent has joined #ruby
desnudopenguino has joined #ruby
Goodbye_Vincent has quit [Ping timeout: 252 seconds]
Goodbye_Vincent has joined #ruby
Goodbye_Vincent has quit [Ping timeout: 264 seconds]
jenrzzz_ has joined #ruby
user71 has quit [Quit: Leaving]
<henk> and I found a solution for my problem: http://pastie.org/p/6Wm9cjsbNEPZ0pGwbJNKOl will probably need some refinement but it’s not so bad …
jenrzzz_ has quit [Ping timeout: 260 seconds]
Goodbye_Vincent has joined #ruby
Goodbye_Vincent has quit [Quit: Ping timeout (120 seconds)]
dixan has joined #ruby
___nick___ has quit [Ping timeout: 260 seconds]
Pixi__ has quit [Quit: Leaving]
Goodbye_Vincent has joined #ruby
Pixi has joined #ruby
<rapha> that looks very fancy. i think i'll save that for whenever i want to get into threads :)
<rapha> thanks for sharing :)
<henk> rapha: found it to be slow, though. I did in line 5 s/Recursor/Resolver/ which is a lot faster and usually accurate enough
<henk> no idea whether it really is fancy, I only just got started with threads. and more or less with ruby, too.
<rapha> see, and i don't even know what a recursor is :)
<rapha> and i've been doing ruby since 2001 and don't think i could have written this, so more power to you!
<weaksauce> looks pretty good
<rapha> also the name apex domain is sort of badass :P
<henk> this Recursor instance acts like a recursing resolver for DNS in that it actually does all the dns resolving itself, i.e. starts with questioning the root servers, then goes down the labels until it gets an authoritative answer for the requested name. this Resolver instance does not do that but just ask another recursing resolver, if none explicitly given the one the system it’s running on uses.
<henk> which possibly already has stuff cached. creating a global Recursor instance in the program and using that instead of creating a new one everytime would also enable caching in that instance, so it would also be faster.
<henk> yes, it is (:
<henk> thanks for your feedback! I’m happy I’m not producing good that makes experienced people want to scratch their eyes out :D
<weaksauce> the only thing you might want to do if it gets more complex is throw it into a class
<henk> weaksauce: yeah, that’s definitely something I have to keep an eye on: complexity … I _want_ to write small methods. but some are not that easy to pick apart. and I should do that before I lose track of things …
jenrzzz_ has joined #ruby
<henk> but there are better things to do! I have found a better approach that will surely be faster and I want to implement that! there is no time for tidying!
jenrzzz_ has quit [Ping timeout: 252 seconds]
dixan has quit [Quit: leaving]
_ht has quit [Remote host closed the connection]
<weaksauce> ever get your answer rapha
<weaksauce> or figure it out yourself?
<rapha> weaksauce: no, the channel was completely quiet. i've been checking every few hours, but was afk most of the time...
<rapha> i'm meaning to try out one of their streams. just a hunch.
<weaksauce> maybe the ruby discord might have someone that knows?
<rapha> worth a shot for sure!
<rapha> re-posted.
<weaksauce> nice
<weaksauce> rails might be a better place but i'm sure the weekend is slow
<weaksauce> for either of those two rooms
<rapha> actually, you're right, i'll move it there.
<rapha> oh, wow, everyone's there, too? seeing havenwood ...
<[0x1eef_]> I'm not :)
<rapha> well ok just the less important people then :)
<[0x1eef_]> Lol
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
jenrzzz_ has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
Goodbye_Vincent has quit [Ping timeout: 260 seconds]
jenrzzz_ has quit [Ping timeout: 276 seconds]
Goodbye_Vincent has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 264 seconds]