<havenwood>
"blocked #{reason} forever" is at least poetic
jsnwesson has quit [Client Quit]
ouestbillie has quit [Ping timeout: 256 seconds]
<nakilon>
oh it's ok, it's not me who is poetically blocked, it's the page of the user I try to read
<ox1eef>
IRC, where east meets west.
ouestbillie has joined #ruby
<nakilon>
I want to draw a bar plot with X axis going in the middle with two sequences of bars -- one color bars up and another color bars down from the axis
<nakilon>
should I interpolate the data from ruby to html as a json literal for chartjs like I usually do and learn to render another type of plots or should I use gnuplot? their manual is 400 pages long...
<ox1eef>
i've been using HTML5's canvas for something vaguely similar. It is pretty fun to learn.
<nakilon>
do you mean you drew rects manually?
<ox1eef>
yep
<nakilon>
_<>
<ox1eef>
and it can do much more, it's worth having in your toolbox
<nakilon>
and if I order this as "Thread.new do cache_json.call do delayed.call do" I'll spawn user.size amount of threads immediately
<nakilon>
that is higher than ulimit and will cause an error
constxd_ has joined #ruby
<mooff>
nakilon, is each_with_progressbar more like map_with_progressbar?
perrierjouet has quit [Quit: WeeChat 3.4]
BSaboia has quit [Quit: This computer has gone to sleep]
<mooff>
i think you're spawning user.size amount of threads immediately in the paste already
BSaboia has joined #ruby
perrierjouet has joined #ruby
<mooff>
sorry, now i see
<mooff>
in the first form, put next if File.exist? "#{id}.json" before delayed.call
<mooff>
i think that's the quick solution ^ at least the one that avoids e.g. Queue, a fixed thread pool
oxfuxxx has joined #ruby
<mooff>
i think to be robust on a cold start you might need a thread pool + Queue anyway
oxfuxxx has quit [Client Quit]
<mooff>
don't have more time to analyze, sorry :)
fredlinhares has quit [Quit: WeeChat 3.4]
Pipip has joined #ruby
<nakilon>
the only solution I see currently is to teach the cache_json to see that yielded result is a Thread and spawn another Thread for delayed to file write
<nakilon>
*delayed file write
<nakilon>
that is ugly and doubles the number of thread for no obvious reason
<nakilon>
or maybe I should go for the "spawn users.size threads" but replacing them with Fibers that I unfortunately don't remember how to use
duderonomy has quit [Read error: Connection reset by peer]
<nakilon>
though probably fibers won't make requests go in parallel so it won't work
<nakilon>
hm "00:42:02 <havenwood> nakilon: yes, looking at the code it looks like you can do: task = Async::Reactor.new" -- hm, it waits for every task to finish
<nakilon>
gr33n7007h that example is still wrapped in Async do
Inoperable has joined #ruby
<gr33n7007h>
nakilon: i'm not sure what you're trying to acheive tbh.
<nakilon>
the problem is that Async do does not return what is in the block even if you put the .wait on all asyncs inside
<nakilon>
I want an array of results
<nakilon>
outside of Async do
<gr33n7007h>
nakilon: hold up, let me play around.
<nakilon>
so this returns thousands of results that are being cached and if there is no cache it waits at least 100msec after previous cache miss
<IsoLinCHiP>
Hi. Any recommendations for a library to assist in creating console based interactive list manipulation tools? I have various tasks that would benefit from having a list I can page through with cursor keys, while having either a detail/preview panel showing info pertaining to that item and then selecting one or many items to execute actions on them.
constxd_ has quit [Ping timeout: 256 seconds]
<nakilon>
IsoLinCHiP either cli-ui or tty-prompt
perrierjouet has joined #ruby
<gr33n7007h>
nakilon: you do know using Sync is a synchronous operation making `end.map.with_progressbar(&:wait)` redundant, because it waits for the block to complete anyway.
<nakilon>
cli-ui looks more polished but when I asked an obvious feature from tty-prompt I've got some weird rejection response
<nakilon>
so I'm probably back to tty-prompt
goldfish has quit [Ping timeout: 256 seconds]
<nakilon>
gr33n7007h oh, nice, indeed looks like it's waiting for all that was started inside
<nakilon>
but then how do I show the progress_bar?
<nakilon>
hm the progressbar does not work actually ..\
<IsoLinCHiP>
nakilon: thanks for the cli-ui recommendation, hadnt come across that yet. Ive used tty-prompt for some projects already, its preatty neat. I have however not yet been able to create something that would show a preview in a seperate panel depending on the current selection. Would you think that might be possible with cli-ui?
<nakilon>
ffs dpaste captcha
<IsoLinCHiP>
Specifically Im really struggling to find a convenient 'windowing' toolkit
<nakilon>
looks like progressbar works if put one level inside the block
<nakilon>
IsoLinCHiP if it's not in readme, then probably not
bluedust_ has joined #ruby
<nakilon>
nice, 6000 requests one by one was going to take 2 hours yesterday, now it should be 10 minutes
<havenwood>
you
<gr33n7007h>
nakilon: :P yeah, async does seems like a real game changer
<nakilon>
also I could even reduce the 100msec since by net lib parses the x-ratelimit header
<havenwood>
nice
<nakilon>
gr33n7007h I could do the same semaphore with Thread but yeah, I don't want to be limited with 1024 or whatever
<gr33n7007h>
nakilon: async has the potential for millions :)
bluedust has quit [Ping timeout: 250 seconds]
<nakilon>
I wonder why it does not interrupt on ^C though
<gr33n7007h>
nakilon: how many tasks are you spawning?
<nakilon>
1 per 100msec
<nakilon>
it has spawned like 700
<nakilon>
there is no progressbar print anymore and htop is low so it's not building any crazy backtrace, it's just stuck
<gr33n7007h>
hmm, weird.
<nakilon>
cpu 0.2%
wiz42 has quit [Quit: Client closed]
<nakilon>
adding Signal.trap("INT"){ task.interrupt } does not work
easbarba has joined #ruby
<rapha>
if you wanted to implement something like midnight commander (=> horizontal split, left panel and right panel) in ruby, would you use the curses gem and go by foot, or is there something more specialized for that?
gr33n7007h has quit [Quit: WeeChat 3.4]
<nakilon>
my script now hangs in some another place, looks like I open too many network connections so I should make it all in some different way.... or maybe add another semaphore with n=100
<nakilon>
so I merged the delayed and request lambdas from my yesterday code
bluedust has quit [Remote host closed the connection]
teclator has quit [Remote host closed the connection]
mdemo has joined #ruby
mdemo has quit [Client Quit]
mdemo has joined #ruby
mdemo has quit [Client Quit]
mdemo has joined #ruby
mdemo has quit [Client Quit]
mdemo has joined #ruby
mdemo has quit [Client Quit]
vit has joined #ruby
justIrresolute is now known as justJustache
vit is now known as Guest9014
<IsoLinCHiP>
What dependencies do I need to be able to use Curses::Menu? Documentation seems a bit thin here.
<IsoLinCHiP>
Or is this a debian packaging issue, that it doesnt seem to be available?
goldfish has quit [Ping timeout: 250 seconds]
<havenwood>
IsoLinCHiP: Do you have the curses gem installed? It no longer ships with the Ruby stdlib.
<IsoLinCHiP>
yes, I installed the debian package ruby-curses. Trying to obtain it through `gem install curses` did not work. I wont go into details, it was a nightmare
infinity_fye has joined #ruby
infinityfye has quit [Ping timeout: 250 seconds]
<IsoLinCHiP>
the simple examples like `rain.rb` are working, but menu and forms are not, as the Constants are not defined.
graywolf has quit [Quit: WeeChat 3.4]
bluedust has joined #ruby
ouestbillie has joined #ruby
bluedust_ has joined #ruby
bluedust has quit [Ping timeout: 256 seconds]
<nakilon>
I hate that ruby 3 irb prints arrays vertically -- can I disable it?
<nakilon>
it's stupid to waste 10 pages for .methods instead of one
ouestbillie has quit [Ping timeout: 256 seconds]
ouestbillie has joined #ruby
fef has quit [Ping timeout: 276 seconds]
infinity_fye has quit [Quit: Leaving]
ouestbillie has left #ruby [#ruby]
Bounga has joined #ruby
bluedust has joined #ruby
bluedust_ has quit [Ping timeout: 250 seconds]
duderonomy has joined #ruby
bluedust_ has joined #ruby
bluedust has quit [Read error: Connection reset by peer]
bluedust has joined #ruby
<nakilon>
I feel like I drag more and more gems around for every new program ..\
bluedust_ has quit [Ping timeout: 250 seconds]
_ht has quit [Remote host closed the connection]
<IsoLinCHiP>
Amen
skali has joined #ruby
skali has quit [Quit: bye]
bluedust has quit [Remote host closed the connection]
Guest6697 has joined #ruby
Guest43 has joined #ruby
<Guest43>
Hello. I toyed a bit with Ruby years ago and recently found my way back. I was looking into the tooling and it seems like a straight `gem install foo` would install a package/library globally but if I wanted to keep them local to a project in a given directory, I'd use Bundler. Is that correct?
<leah2>
yeah
<Guest43>
Cool, thanks. And Bundler installs packages, not versions of Ruby.
<leah2>
yes
<leah2>
that's rbenv or other tools
<Guest43>
Right. Pretty sure I used rbenv back in the day. Looks like there's a handful of options there.
Guest6697 has quit [Quit: Ping timeout (120 seconds)]
gproto23_ has quit [Ping timeout: 250 seconds]
<weaksauce>
rbenv is nice
Guest43 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]