<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>
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.
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>
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