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
cacheerror has quit [Quit: WeeChat 3.0]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
bsdbandit-01 has joined #ruby
<greengriminal> havenwood, - this is what I have: https://gist.github.com/davidpatters0n/62beef2406ca4af57512cdaa71759e7e but you'll see that keys (L5) are fixed to X Y and Z
<greengriminal> what I'm trying to do is read out the values based on the keys I columns I supply.
<greengriminal> It's not necessarily true that i'll always be asking to sort by 3 values. I could very well be sorting by 1 or 2 values.
<leftylink> and you say columns is an array of symbols... well that's good, then you can index into each hash using each element of `columns`, can you no
<leftylink> but here is something that will help
<leftylink> &ri Hash#values_at
<leftylink> note that it expects multiple parameters, not one parameter that is an array, but you can of course fix that problem with a splat.
<leftylink> those are all the ingredients I would use to solve the problem as presented.
<leftylink> note however that the problem as presented in text is not consistent with the code
dfucci has joined #ruby
<leftylink> the problem presented in text says columns is an array of symbols, but this is not true at line 3. line 3 is an array of strings not an array of symbols
bsdbandit-01 has quit [Read error: Connection reset by peer]
<leftylink> line 2 has arrays with symbol keys, true, because of the colons, but there is no reason for the quotes to be there
al2o3-cr-null is now known as al2o3-cr
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
TCZ has quit [Quit: Kindergarten is elsewhere!]
greengriminal has quit [Quit: This computer has gone to sleep]
rzjian has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
dfucci has quit [Ping timeout: 256 seconds]
somazero has quit [Quit: Leaving]
<havenwood> If they come back, the keys are Symbols but the columns are Strings.
<havenwood> Use snake_cake for method names, so min_by_order here.
<havenwood> table.min_by { |row| row.values_at(*columns) }
bsdbandit-01 has joined #ruby
evdubs has quit [Quit: Leaving]
bsdbandit-01 has quit [Read error: Connection reset by peer]
evdubs has joined #ruby
<adam12> havenwood: Have you ever made a gist for module builder pattern? I'm working on the API for a library and I need some inspiration.
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
dionysus70 is now known as dionysus69
krma has joined #ruby
krma has left #ruby [#ruby]
GankMove has quit [Ping timeout: 256 seconds]
spacesuitdiver has joined #ruby
bsdbandit-01 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
harlin has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
stryek has quit [Quit: Connection closed for inactivity]
<adam12> Sorted it, but not sure I love it.
harlin has quit [Quit: Leaving]
chovy has left #ruby [#ruby]
harlin has joined #ruby
harlin has quit [Client Quit]
harlin has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
dfucci has joined #ruby
dionysus69 has joined #ruby
<havenwood> adam12: I often can't tell which way I like until I implement them all, heh. Going to stick with module builder?
harlin has quit [Remote host closed the connection]
<havenwood> adam12: I don't think I have.
dionysus70 has quit [Ping timeout: 264 seconds]
TCZ has joined #ruby
harlin has joined #ruby
harlin has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
Technodrome has joined #ruby
bsdbandit-01 has joined #ruby
mao has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
dfucci has quit [Ping timeout: 260 seconds]
Mia has quit [Read error: Connection reset by peer]
TCZ has quit [Quit: Kindergarten is elsewhere!]
rzjian has quit [Ping timeout: 272 seconds]
Iarfen has quit [Remote host closed the connection]
dionysus69 has quit [Read error: Connection reset by peer]
mao has quit []
compufre_ has quit [Ping timeout: 260 seconds]
rzjian has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
rzjian has quit [Ping timeout: 272 seconds]
rmnull has joined #ruby
rmnull has quit [Client Quit]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
gix- has joined #ruby
gix has quit [Disconnected by services]
m27frogy has quit [Ping timeout: 246 seconds]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
maryo has joined #ruby
GankMove has joined #ruby
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #ruby
dfucci has joined #ruby
ChmEarl has quit [Quit: Leaving]
dfucci has quit [Ping timeout: 246 seconds]
arahael has joined #ruby
rzjian has joined #ruby
plujon has quit [Quit: ERC (IRC client for Emacs 26.3)]
cliluw has quit [Ping timeout: 256 seconds]
TomyWork has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
cloud69 has joined #ruby
al2o3-cr has quit [Quit: WeeChat 3.0]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dfucci has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
schaerli__ has joined #ruby
emptyflask has quit [Ping timeout: 264 seconds]
emptyflask has joined #ruby
emptyflask has quit [Ping timeout: 256 seconds]
MasterNayru has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
schaerli_ has joined #ruby
schaerli__ has quit [Read error: Connection reset by peer]
MasterNayru has joined #ruby
vondruch has joined #ruby
Caspy has quit [Ping timeout: 256 seconds]
cliluw has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
schne1der has joined #ruby
cd has quit [Quit: cd]
siaw23 has joined #ruby
coniptor has quit [Ping timeout: 265 seconds]
Tempesta has quit [Quit: See ya!]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
fandre1986 has joined #ruby
coniptor has joined #ruby
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
siaw23 has quit [Quit: Textual IRC Client: www.textualapp.com]
siaw23 has joined #ruby
siaw23 has quit [Quit: Textual IRC Client: www.textualapp.com]
xco has joined #ruby
MasterNayru has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
gix- has quit [Ping timeout: 265 seconds]
Tempesta has joined #ruby
MasterNayru has joined #ruby
xco has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
rzjian has quit [Ping timeout: 256 seconds]
xco has joined #ruby
sylario has joined #ruby
akem_ has joined #ruby
coniptor has quit [Ping timeout: 264 seconds]
akem has quit [Ping timeout: 240 seconds]
akem__ has joined #ruby
akem_ has quit [Ping timeout: 265 seconds]
akem has joined #ruby
coniptor has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
vondruch has quit [Ping timeout: 268 seconds]
xco has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
cliluw has joined #ruby
fandre1986 has quit [Quit: Connection closed]
greengriminal has joined #ruby
cliluw has quit [Ping timeout: 264 seconds]
hsiktas[m] has quit [Quit: Bridge terminating on SIGTERM]
tfreedman has quit [Quit: Bridge terminating on SIGTERM]
MeVegan[m] has quit [Quit: Bridge terminating on SIGTERM]
batisi[m] has quit [Quit: Bridge terminating on SIGTERM]
electragician has quit [Quit: Bridge terminating on SIGTERM]
jcp has quit [Quit: Bridge terminating on SIGTERM]
nyota[m] has quit [Quit: Bridge terminating on SIGTERM]
kateskips has quit [Quit: Bridge terminating on SIGTERM]
turt2live has quit [Quit: Bridge terminating on SIGTERM]
jo-so has quit [Quit: Bridge terminating on SIGTERM]
so1e[m] has quit [Quit: Bridge terminating on SIGTERM]
Hanma[m] has quit [Quit: Bridge terminating on SIGTERM]
woodruffw has quit [Ping timeout: 246 seconds]
Technodrome has joined #ruby
woodruffw has joined #ruby
woodruffw has joined #ruby
<greengriminal> leftylink, - `values_at` was what I needed
tfreedman has joined #ruby
vondruch has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
coniptor has quit [Ping timeout: 264 seconds]
coniptor has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
vondruch has quit [Ping timeout: 244 seconds]
m27frogy has joined #ruby
schaerli__ has joined #ruby
schaerli_ has quit [Ping timeout: 268 seconds]
Pierreb has quit [Quit: Going offline, see ya! (www.adiirc.com)]
jcp has joined #ruby
electragician has joined #ruby
kateskips has joined #ruby
leni1[m] has joined #ruby
turt2live has joined #ruby
hsiktas[m] has joined #ruby
Hanma[m] has joined #ruby
jo-so has joined #ruby
MeVegantheythem[ has joined #ruby
so1e[m] has joined #ruby
nyota[m] has joined #ruby
batisi[m] has joined #ruby
somazero has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
vondruch has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
dhollinger has quit [Ping timeout: 264 seconds]
dhollinger has joined #ruby
elcuervo has quit [Read error: Connection reset by peer]
vondruch has quit [Ping timeout: 264 seconds]
ellcs has joined #ruby
vondruch has joined #ruby
linoge has joined #ruby
elcuervo has joined #ruby
linoge has quit [Read error: Connection reset by peer]
linoge has joined #ruby
bsdbandit-01 has joined #ruby
Rudd0 has quit [Ping timeout: 240 seconds]
MasterNayru has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
bsdbandit-01 has quit [Read error: Connection reset by peer]
burgestrand has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
kristian_on_linu has joined #ruby
chalkmonster has joined #ruby
ElCapitanMarklar has joined #ruby
coniptor has quit [Ping timeout: 246 seconds]
prion has joined #ruby
<ElCapitanMarklar> I'm after some chruby help if anyone has any clues. I'm trying to install the passenger gem on an older ruby version `chruby-exec ruby 2.4.3 -- gem install passenger -v "5.1.12"`
<ElCapitanMarklar> But if I then check it with `chruby-exec ruby 2.4.3 -- passenger-config about ruby-libdir`
<ElCapitanMarklar> its showing the gem isntalled under 2.6.0 /opt/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/passenger-5.1.12/src/ruby_supportlib
coniptor has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
TomyWork has quit [Remote host closed the connection]
BTRE has quit [Remote host closed the connection]
BTRE has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
vondruch has quit [Ping timeout: 256 seconds]
bsdbandit-01 has joined #ruby
stryek has joined #ruby
greengriminal has quit [Quit: Leaving]
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
akem has quit [Ping timeout: 246 seconds]
akem__ has quit [Ping timeout: 264 seconds]
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
thecoffemaker has quit [Ping timeout: 260 seconds]
impermanence has quit [Quit: Connection closed]
thecoffemaker has joined #ruby
burgestrand has quit [Quit: burgestrand]
kristian_on_linu has quit [Ping timeout: 246 seconds]
dionysus69 has joined #ruby
dionysus69 has quit [Changing host]
dionysus69 has joined #ruby
burgestrand has joined #ruby
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
dionysus69 has joined #ruby
coniptor has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
dionysus69 has joined #ruby
prion has quit [Ping timeout: 256 seconds]
burgestrand has quit [Quit: burgestrand]
vondruch has joined #ruby
kristian_on_linu has joined #ruby
burgestrand has joined #ruby
dionysus69 has quit [Quit: Konversation terminated!]
dionysus69 has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Client Quit]
dionysus70 has quit [Client Quit]
dionysus69 has joined #ruby
dionysus69 has quit [Changing host]
dionysus69 has joined #ruby
coniptor has joined #ruby
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
dionysus69 has quit [Client Quit]
iNs has quit [Ping timeout: 240 seconds]
iNs has joined #ruby
_aeris has joined #ruby
siery has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
lightstalker has quit [Ping timeout: 240 seconds]
<siery> Hey, Im trying to figure out how to refere to the self return value of a singleton class or a static module instance. I mean the value returned when calling ModuleName.
<chalkmonster> siery: elaborate
<chalkmonster> or better, paste some sample code
_aeris_ has quit [Read error: Connection reset by peer]
_aeris is now known as _aeris_
lightstalker has joined #ruby
dionysus69 has joined #ruby
<siery> Like for e.g to modify the return value of a class instance you can overwrite the 'self.new' method. My question is, how to do the same with a static type?
Technodrome has joined #ruby
<siery> So simply, when calling module 'Config' I wold like to refere directly to Config.data, is that possible with static types?
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
<chalkmonster> so I'm unclear on what you mean when you say "call" a module
<chalkmonster> do you want a module with a bucnh of static methods?
<chalkmonster> module Math; def blah; end; end
<chalkmonster> and use it as `Math.blah`?
<chalkmonster> also when you talk about doing things to the #new method, you have to realize that classes and modules are basically the same thing, except that modules can't be instantiated with #new
<chalkmonster> so whatever you're doing to your class can't be directly translated to modules probably
<chalkmonster> it would be more helpful if you could write up a few lines of code to indicate what exactly it is you want
<chalkmonster> siery: ^
jeromelanteri has joined #ruby
burgestrand has quit [Quit: burgestrand]
burgestrand has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
prion has joined #ruby
ChmEarl has joined #ruby
SeepingN has joined #ruby
bsdbandit-01 has joined #ruby
al2o3-cr has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 246 seconds]
cthulchu_ has joined #ruby
bsdbandit-01 has joined #ruby
BSaboia has joined #ruby
Rudd0 has joined #ruby
emptyflask has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
BSaboia has quit [Ping timeout: 264 seconds]
spacesuitdiver has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dfucci has quit [Ping timeout: 256 seconds]
coniptor has quit [Ping timeout: 256 seconds]
dionysus69 has joined #ruby
dionysus69 has joined #ruby
schne1der has quit [Quit: schne1der]
kristian_on_linu has quit [Ping timeout: 272 seconds]
spacesuitdiver has joined #ruby
coniptor has joined #ruby
chalkmon1 has joined #ruby
schaerli__ has quit [Ping timeout: 246 seconds]
chalkmonster has quit [Ping timeout: 246 seconds]
dfucci has joined #ruby
bsdbandit-01 has joined #ruby
burgestrand has quit [Quit: burgestrand]
bsdbandit-01 has quit [Read error: Connection reset by peer]
dfucci has quit [Ping timeout: 260 seconds]
akem has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
TCZ has joined #ruby
bsdbandit-01 has joined #ruby
crankharder has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
dfucci has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
coniptor has quit [Ping timeout: 256 seconds]
somazero has quit [Remote host closed the connection]
dfucci has quit [Ping timeout: 256 seconds]
coniptor has joined #ruby
htmnc has joined #ruby
jess has quit [Quit: brb]
m27frogy has quit [Ping timeout: 240 seconds]
m27frogy has joined #ruby
cliluw has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
somazero has joined #ruby
plujon has joined #ruby
kristian_on_linu has joined #ruby
swann11[m] has joined #ruby
Technodrome has joined #ruby
robotmay has quit [Quit: Be excellent to each other]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
kristian_on_linu has quit [Ping timeout: 246 seconds]
adu has joined #ruby
TCZ has quit [Quit: Kindergarten is elsewhere!]
vondruch has quit [Read error: Connection reset by peer]
robotmay has joined #ruby
hmmm has joined #ruby
chalkmon1 has quit [Quit: WeeChat 3.0]
swaggboi has quit [Remote host closed the connection]
swaggboi has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
kristian_on_linu has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
cd has joined #ruby
impermanence has joined #ruby
Iarfen has joined #ruby
coniptor has quit [Ping timeout: 264 seconds]
maryo87 has joined #ruby
maryo has quit [Ping timeout: 260 seconds]
coniptor has joined #ruby
gix has joined #ruby
bsdbandit-01 has joined #ruby
clemens3 has quit [Quit: brb]
bsdbandit-01 has quit [Read error: Connection reset by peer]
maryo87 has quit [Ping timeout: 264 seconds]
<Iarfen> hi!
<Iarfen> bundler gives me this error: Your Ruby version is 2.5.5, but your Gemfile specified 2.7.1
<Iarfen> my .ruby-version file especifies ruby-2.7.1, what's happening?
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
cliluw has quit [Ping timeout: 264 seconds]
coniptor has quit [Ping timeout: 260 seconds]
cliluw has joined #ruby
siery has quit [Read error: Connection reset by peer]
mconnolly has joined #ruby
coniptor has joined #ruby
naftilos76 has joined #ruby
<naftilos76> Hi everyone, can anybody please explain the join method with the limit param ? https://apidock.com/ruby/Thread/join . If i understand well, the thread executes and wait for the time passed to join and then exits?
<leah2> it returns
<leah2> the thread keeps running
<naftilos76> leah2: i cannot say you enlightened me...
<leah2> look at that example
<leah2> it prints waiting several times
<Iarfen> it's normal that yarn install takes a lot of time?
<naftilos76> leah2: ok ok thanks...
<leah2> not sure this is super useful tbh :p
<naftilos76> Please have a look at this: https://pastebin.ubuntu.com/p/nYHMNcVtHs/
<naftilos76> i will show you the output in a min
<adam12> Iarfen: What's the output of `ruby -v`
<naftilos76> Something that i do not understand is why the messages that indicate the "started after" part is not sorted by time
<Iarfen> adam12: it's 2.7.1p83, but I've already solved that problem
<naftilos76> thread no 8 appears after no 4 (that includes the 'started after' substring)
cliluw has quit [Ping timeout: 264 seconds]
<naftilos76> Threads 2-1-5-6-7-10-4 are sorted by time but after that thread no 8 follows and then no 9
<naftilos76> which seems weird to me
<naftilos76> FYI: etime() equals => Process.clock_gettime(Process::CLOCK_MONOTONIC)
<naftilos76> you can omit String.next_color() since it is just for producing different ansi colors in the terminal making it easier for me to read the text
hmmm has quit [Quit: WeeChat 3.0]
<naftilos76> you can omit String.next_color() since it is just for producing different ansi colors in the terminal making it easier for me to read the text
<naftilos76> sorry - my bad
Reshi has joined #ruby
Reshi has quit [Client Quit]
somazero has quit [Quit: Leaving]
<phaul> naftilos76: my bet would be that thread 8 / 9 start running and samle the timer quite early on, but then they get suspended for some time and other threads jump in before they have a chance to puts their timing report
<naftilos76> so it is something related to the scheduler?
Reshi_ has joined #ruby
<naftilos76> does the join(time_out) start when the thread starts?
<phaul> join(time_out) starts when you call it.
<naftilos76> so yes when the execution of the current thread is suspended and the thread starts executing
Reshi_ has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
<naftilos76> or resumes execution if previously timed out
<phaul> I guess Im just not sure where the confusion is. Or what it has to do with join(timeout). I think this is what's happening : a = Thread.new { time = sample_timer; puts time } ; b = Thread.new { time.sample_timer; puts time }; a.join; b.join. And it seems you expect the timer reported to be monotonic but it can be in any order
<naftilos76> phaul: i understand that threads are not supposed to start in the order they were created
dfucci has joined #ruby
<naftilos76> that is obvious by the results of the link i sent
coniptor has quit [Ping timeout: 265 seconds]
<naftilos76> that off course hold true only when join is not called
dfucci has quit [Ping timeout: 246 seconds]
dilated_dinosaur has quit [Ping timeout: 240 seconds]
bsdbandit-01 has joined #ruby
dilated_dinosaur has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
coniptor has joined #ruby
siery has joined #ruby
linoge has quit [Remote host closed the connection]
somazero has joined #ruby
<phaul> It's not that they are not started in order, it's that they are running in concurency - effectively at the same time. One can overtake the other. If you have a single CPU and 2 threads competeting for that CPU, it will run one thread a bit, then it suspends it, runs the other one a bit and so on. I think the misunderstanding comes from the assumption that the code block in the thread runs from start
<phaul> to finish without other threads interrupting it. That is not the case
<naftilos76> tbh it is not clear in my mind - that is for sure
<naftilos76> anyway i will keep testing...
<naftilos76> thanks for your time
moldorcoder7 has quit [Ping timeout: 260 seconds]
<phaul> no worries, I wish I could explain it better..
<naftilos76> phaul: one last thing, i did this: y = Thread.new { 10.times {|ctr| sleep 0.2; puts ctr }} and then
<naftilos76> puts "Thread starts"
<naftilos76> y.join(1)
<naftilos76> puts "Thread resumes"
<naftilos76> and finally this: loop { sleep 1 }
<naftilos76> the thread stopped after one second
<naftilos76> and then resumed when main thread reached the loop
<naftilos76> am i correct here?
<naftilos76> if the loop was not there the thread would have been killed as per the docs
<naftilos76> i never saw anywhere that a stopped thread would resume after the time out....
<naftilos76> this is one thing that i do not understand
bsdbandit-01 has joined #ruby
<phaul> I'll try to explain line by line what happens: line 1. y = .. Thread is started and is running. line 2. main thread prints. 3. main Thread suspends for 1 second or until y completes whichever is sooner. 4. main thread prints 5. main thread goes into infinite loop. What's happening in the main thread is happening in paralell with what's happening in y thread. Right from line 1 onwards
moldorcoder7 has joined #ruby
<naftilos76> phaul: you never said where the y thread resumes execution - only one second of its' 10.times {...} block was executed
crankharder has quit [Ping timeout: 264 seconds]
Reshi_ has joined #ruby
hmmm has joined #ruby
<phaul> y thread can be thought of as started on line 1, and then running in paralell with the main thread (line 2 onwards) Where it is in its execution compared to where the main thread is in its execution is up to timing and expected to be random
dfucci has joined #ruby
cloud69 has joined #ruby
<phaul> in this (hypothetical) model y never resumes as it never stopped. It runs in paralell with the main thread
<naftilos76> ok again thanks for your time - i keep seeing things like "this or the other thing may happen" and i am thinking that there is a lot of uncertainty in the air...
<naftilos76> i won't spend more of your time.
<naftilos76> I ll just keep reading
<naftilos76> regards
<naftilos76> good night
<phaul> concurency / parallelism are indeed hard
<phaul> all the best
naftilos76 has quit [Quit: Leaving]
<adam12> Any JSON-RPC users? Looking for library suggestions before I roll my own.
crankharder has joined #ruby
siery has quit [Read error: Connection reset by peer]
prion has quit [Ping timeout: 240 seconds]
dfucci has quit [Ping timeout: 264 seconds]
cnsvc has joined #ruby
cnsvc has quit [Remote host closed the connection]
cnsvc has joined #ruby
TCZ has joined #ruby
<phaul> maybe... the misunderstanding was that on line 3 y.join suspends the *main* thread not y? idk
<Iarfen> where does rvm stores the ruby interpreters?
<havenwood> Iarfen: ~/.rvm/
<Iarfen> havenwood: thanks
_whitelogger has joined #ruby
jess has joined #ruby
TCZ has quit [Remote host closed the connection]
Rounin has quit [Ping timeout: 256 seconds]
cthu| has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthulchu_ has quit [Ping timeout: 256 seconds]
hmmm has left #ruby ["WeeChat 3.0"]
cthulchu_ has joined #ruby
cthu| has quit [Ping timeout: 264 seconds]
<Iarfen> how I can configure the ruby version to use for the root user? I'm using rbenv, but I can use another tool if necessary
Reshi_ has quit [Ping timeout: 260 seconds]
<havenwood> Iarfen: ruby-install --latest ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
<havenwood> Iarfen: It'll be autodetected in /usr/local/ by chruby. https://github.com/postmodern/chruby#chruby
<havenwood> Iarfen: Basically these steps, but with sudo or as root: https://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you
<Iarfen> havenwood: thanks!
oddp has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
bsdbandit-01 has joined #ruby
TCZ has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
oddp has quit [Quit: quit]
bsdbandit-01 has quit [Read error: Connection reset by peer]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
adu has quit [Quit: adu]
al2o3-cr has joined #ruby
bsdbandit-01 has joined #ruby
impermanence has quit [Quit: Connection closed]
impermanence has joined #ruby
emptyflask has quit [Ping timeout: 256 seconds]
emptyflask has joined #ruby
bsdbandit-01 has quit [Read error: Connection reset by peer]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthulchu_ has quit [Ping timeout: 272 seconds]