jhass[m] changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.2, 3.0.4, 2.7.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
osXnut has quit [Quit: leaving]
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
Rounin has quit [Ping timeout: 250 seconds]
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 has joined #ruby
dionysus70 is now known as dionysus69
Laplace has joined #ruby
ur5us has joined #ruby
jpn has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
jpn has quit [Ping timeout: 276 seconds]
Vonter has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
hanzo has quit [Quit: Connection closed for inactivity]
Ziyan has joined #ruby
RickHull has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 has joined #ruby
idiocrash has joined #ruby
idiocrash_ has joined #ruby
dionysus70 is now known as dionysus69
idiocrash has quit [Ping timeout: 256 seconds]
jpn has joined #ruby
r3m has quit [Quit: WeeChat 3.6-dev]
r3m has joined #ruby
jpn has quit [Ping timeout: 260 seconds]
Sankalp has quit [Ping timeout: 260 seconds]
Sankalp has joined #ruby
Laplace has quit [Quit: Connection closed for inactivity]
r3m has quit [Quit: WeeChat 3.6-dev]
r3m has joined #ruby
idiocrash_ has quit [Ping timeout: 260 seconds]
mooff has quit [Remote host closed the connection]
mooff has joined #ruby
hanzo has joined #ruby
idiocrash has joined #ruby
idiocrash has quit [Ping timeout: 256 seconds]
idiocrash has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 is now known as dionysus69
z4kz has joined #ruby
swaggboi has quit [Ping timeout: 248 seconds]
z4kz has quit [Quit: Client closed]
swaggboi has joined #ruby
jpn has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
jpn has quit [Ping timeout: 248 seconds]
idiocrash_ has joined #ruby
idiocrash has quit [Ping timeout: 246 seconds]
jmcgnh has quit [Ping timeout: 248 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex5 has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
vvmt0 has joined #ruby
vvmt0 has left #ruby [#ruby]
jpn has joined #ruby
vvmt0 has joined #ruby
vvmt0 has quit [Client Quit]
jpn has quit [Ping timeout: 256 seconds]
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 has joined #ruby
dionysus70 is now known as dionysus69
u0_a87 has joined #ruby
_ht has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 has joined #ruby
dionysus70 is now known as dionysus69
u0_a871 has joined #ruby
jpn has joined #ruby
u0_a87 has quit [Remote host closed the connection]
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
u0_a871 has quit [Remote host closed the connection]
u0_a871 has joined #ruby
Ziyan has quit [Ping timeout: 248 seconds]
Ziyan has joined #ruby
Ziyan has quit [Client Quit]
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
dionysus70 is now known as dionysus69
dionysus70 has joined #ruby
dionysus70 has quit [Read error: Connection reset by peer]
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
Guest26nakilon has joined #ruby
<Guest26nakilon> >> "asd"[/.#{/s/}./]
<Guest26nakilon> anyway; is it possible to interpolate one regex into another one discarding its modes?
<Guest26nakilon> more example, I have a regex REGEX_UUID = /\A[a-f0-9]{8}-[a-f0-9]{4}-[0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\z/ and I want to insert it into another regex but the \A\z thing makes it not match
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
<Guest26nakilon> or is the only way to remove \A\z from it and append them when I use it without interpolation?
<Guest26nakilon> ohhh, I'm stupid, those are not modes at all, they are the part of the string, of course it won't work
dionysus69 has quit [Quit: dionysus69]
dionysus70 has joined #ruby
dionysus70 is now known as dionysus69
dionysus69 has quit [Quit: dionysus69]
dionysus70 has joined #ruby
u0_a871 has quit [Remote host closed the connection]
dionysus70 is now known as dionysus69
u0_a871 has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
u0_a871 has quit [Remote host closed the connection]
ur5us has joined #ruby
u0_a871 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
Guest26nakilon has quit [Quit: Client closed]
oxfuxxx has joined #ruby
dionysus69 has quit [Remote host closed the connection]
Ziyan has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
u0_a871 has quit [Remote host closed the connection]
u0_a871 has joined #ruby
Guest26nakilon has joined #ruby
goldfish has quit [Ping timeout: 260 seconds]
jpn has joined #ruby
Tempesta has quit [Quit: See ya!]
u0_a871 has quit [Quit: WeeChat 2.5]
jpn has quit [Ping timeout: 260 seconds]
Ziyan_ has joined #ruby
Tempesta has joined #ruby
Ziyan has quit [Ping timeout: 276 seconds]
dionysus69 has joined #ruby
protektwar has quit [Ping timeout: 260 seconds]
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
Guest26nakilon has quit [Quit: Client closed]
Ziyan_ has quit [Quit: Textual IRC Client: www.textualapp.com]
oxfuxxx has quit [Ping timeout: 256 seconds]
oxfuxxx has joined #ruby
Rounin has joined #ruby
seydar has joined #ruby
<seydar> wow i just learned about Enumerable::Lazy
<ox1eef> havenwood seems to have deep knowledge about it, he has pasted gists using it in some interesting scenarios
<seydar> i'll have to keep any eye out for his stuff
<seydar> i'm shocked that today is the first time i'm hearing about lazy
moldorcoder7 has quit [Ping timeout: 250 seconds]
moldorcoder7 has joined #ruby
<seydar> i was thinking about how i don't have a good grasp of how to do stream processing (e.g. IO -> gzip -> xml parsing), and then stumbled upon lazy as an option
<seydar> i'm not sure if #lazy is the correct answer, but i'm excited to find out
ur5us has quit [Read error: Connection reset by peer]
ur5us_ has joined #ruby
ur5us_ has quit [Ping timeout: 240 seconds]
jpn has joined #ruby
<seydar> also does anyone have any thoughts on vim vs neovim? am i just a caveman for still using vim?
oxfuxxx has quit [Ping timeout: 248 seconds]
jpn has quit [Ping timeout: 276 seconds]
Guest26nakilon has joined #ruby
<Guest26nakilon> adam12, hi
<Guest26nakilon> rubydoc.info has "permalink" anchor on methods, your site does not
<adam12> seydar: I've switched back to VIM (from VSC + Vim bindings), and I didn't switch to Neovim because of the lack of a GUI. Fighting with 256 colour support is annoying in terminal.
<adam12> Guest26nakilon: Interesting. Must be a theme thing. I'll look. Thanks.
twosuns has joined #ruby
<adam12> seydar: There are Lua plugins for Neovim that aren't available for Vim (obviously), but if you're not using them yet you're not missing anything.
<adam12> seydar: I say, just use what you're familiar with.
twosuns has quit [Quit: ...]
<seydar> adam12: the boring answer is often the correct one
<seydar> people in #haskell were saying similar stuff
<seydar> but i'll prolly start checking out plugins so as to be less of a caveman
<seydar> thanks!
seydar has quit [Quit: leaving]
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
Ziyan has joined #ruby
jpn has joined #ruby
mahlon has quit [Ping timeout: 248 seconds]
jpn has quit [Ping timeout: 260 seconds]
<ox1eef> emacs was my thing before switching to vscode.
<ox1eef> i kinda think emacs is the developers editor, and vim is the sysadmins editor.
dionysus69 has quit [Ping timeout: 250 seconds]
SteveR has joined #ruby
SteveR has quit [Client Quit]
Ziyan has quit [Ping timeout: 246 seconds]
Ziyan has joined #ruby
roadie has joined #ruby
teclator has joined #ruby
mr_tr0n has joined #ruby
jpn has joined #ruby
whysthatso125075 has joined #ruby
rhe7 has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
mr_tr0n has quit [Quit: mr_tr0n]
mr_tr0n has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
mr_tr0n has quit [Changing host]
mr_tr0n has joined #ruby
protektwar has quit [*.net *.split]
nemesit has quit [*.net *.split]
Liothen has quit [*.net *.split]
JayDoubleu_ has quit [*.net *.split]
rhe7 is now known as rhe
whysthatso12507 has quit [*.net *.split]
rhe has quit [*.net *.split]
Nowaker has quit [*.net *.split]
r0bby has quit [*.net *.split]
enyc has quit [*.net *.split]
whysthatso125075 is now known as whysthatso12507
protektwar has joined #ruby
r0bby has joined #ruby
JayDoubleu_ has joined #ruby
nemesit has joined #ruby
enyc has joined #ruby
Nowaker has joined #ruby
Liothen has joined #ruby
r0bby has quit [Ping timeout: 248 seconds]
r0bby has joined #ruby
mr_tr0n has quit [Quit: mr_tr0n]
hsiktas[m] has quit [Quit: You have been kicked for being idle]
reset has joined #ruby
z4kz has joined #ruby
jpn has joined #ruby
z4kz has quit [Quit: Client closed]
oxfuxxx has joined #ruby
Thanzex5 has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
roadie has quit [Remote host closed the connection]
jpn has quit [Ping timeout: 248 seconds]
roadie has joined #ruby
iramaro[m] has joined #ruby
roadie has quit [Ping timeout: 248 seconds]
oxfuxxx has quit [Ping timeout: 276 seconds]
oxfuxxx has joined #ruby
roadie has joined #ruby
Guest26nakilon has quit [Quit: Client closed]
roadie` has joined #ruby
roadie has quit [Ping timeout: 248 seconds]
roadie` has quit [Ping timeout: 248 seconds]
mahlon has joined #ruby
gr33n7007h has joined #ruby
roadie` has joined #ruby
mixfix41 has quit [Ping timeout: 260 seconds]
roadie` has quit [Ping timeout: 252 seconds]
roadie` has joined #ruby
roadie` has quit [Ping timeout: 260 seconds]
RickHull has joined #ruby
roadie` has joined #ruby
jpn has joined #ruby
smp has quit [Ping timeout: 260 seconds]
jpn has quit [Ping timeout: 248 seconds]
roadie` has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
r3m has quit [Read error: Connection reset by peer]
r3m has joined #ruby
RickHull has quit [Ping timeout: 260 seconds]
oxfuxxx has quit [Remote host closed the connection]
RickHull has joined #ruby
ur5us_ has joined #ruby
<John_Ivan> hi. I'm using nokogiri "Element" class as per https://www.rubydoc.info/gems/watir-nokogiri/WatirNokogiri/Element
<John_Ivan> I see there's a .elements() method, which is great for enumerating children of the node you have selected
<John_Ivan> is there any way I can get the next layer of nodes that are children to the node you have selected, but only that layer instead of the children's children?
<ox1eef> is this a question or a statement of fact
<John_Ivan> a question.
<ox1eef> when i use nokogiri, i usually stick to using css selectors. have you tried that?
<John_Ivan> yup. e.g if "div" has children "a, a, a, a, a" and each "a" has "img", I want only the "a's" returned, as an ElementCollection so I can iterate over that.
<John_Ivan> ox1eef, I'm using that, yes.
<ox1eef> then i can't think of how to do it beyond filtering those out.
<ox1eef> in ruby-land.
<John_Ivan> yeah. that's why I'm in a pickle :)
<John_Ivan> there should technically be a ".subchildrenElements()" as opposed to just ".childrenElements()"
<John_Ivan> where the latter one gives me "everything"
<ox1eef> if you have an array of elements, who include children you don't need/want, then you might be able to exclude the ones further down by simple indexing, eg.. [0..-5] (include all but last 5)
<John_Ivan> aye, so I thought. but it seems I managed to end up with a "single element" (which actually has subchildren and subsubchildren)
<John_Ivan> so looping over it doesn't work and calling ".elements()" gives me everything rather than being able to loop only through the sublayer.
<ox1eef> can you show some code, it's hard working purely in the land of theory
<John_Ivan> sure
<John_Ivan> ox1eef, doc.div(id: "favcontainer").elements().each() do | gallery_work |
<John_Ivan> favcontainer has lots of a's
<John_Ivan> and a's have lots of imgs.
<John_Ivan> I only want to iterate over the a's.
<John_Ivan> but that code above forces me to do so :(
<ox1eef> why can't you do doc.css("#favcontainer a") - that'd give you the <a> elements, then you can read its attributes or go further down the chain to its children (the img tags)
<John_Ivan> ox1eef, oh....
<John_Ivan> ox1eef, yeah. that will work.
<ox1eef> cool
<John_Ivan> but yeah. I wanted to have the "a"s only.
<John_Ivan> ox1eef, well. doc.css() will definitely work. which is cool. but there's no other way to do it without it is there?
<John_Ivan> e.g no ".subchildren()" :( ?
<ox1eef> not that i know of, you seem to be relying solely on the nokogiri api and i don't think that's as well known as css selectors, or documented that well.
<John_Ivan> ox1eef, no worries. well, thank you then :)
<ox1eef> sure
axisys has quit [Remote host closed the connection]
_ht has quit [Remote host closed the connection]
smp has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 276 seconds]
axisys has joined #ruby
ur5us_ has quit [Ping timeout: 240 seconds]
smp has quit [Quit: ZNC 1.8.2 - https://znc.in]
protektwar has quit [Ping timeout: 248 seconds]
smp has joined #ruby
smp has quit [Client Quit]
smp has joined #ruby
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
smp has quit [Quit: ZNC 1.8.2 - https://znc.in]
smp has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 260 seconds]
ur5us_ has joined #ruby
r3m has quit [Read error: Connection reset by peer]
fercell has joined #ruby
ferr_ has quit [Ping timeout: 240 seconds]
emcb54 has quit [Ping timeout: 240 seconds]
emcb54 has joined #ruby
<John_Ivan> ox1eef, hmm
<John_Ivan> unrelated to the previous matter.
<John_Ivan> I think I may have found some fatal leak in Nokogiri
<John_Ivan> in particular the method "Nokogiri::HTML(page)"
<John_Ivan> because as soon as that call finishes, my next variables and other code gets corrupted
<John_Ivan> variables output wrong values.
<John_Ivan> and by wrong, I mean, completely unrelated to the existing code I'm supposed to have lol
<John_Ivan> if I didn't add the 'puts "a"', my start_of_image variable would've ended up corrupted, treated as ".1" rather than "1"
<John_Ivan> further causing chaos when then passed to further calls below, in particular mechanize's agent.get()
<John_Ivan> also, calling puts results in ".a"
<John_Ivan> agent.get() previously threw an error reading my "1" as "%0D1"
<John_Ivan> or something of the like.
ur5us_ has quit [Ping timeout: 240 seconds]
<John_Ivan> an "/%0A1" to be more exact.
<John_Ivan> anyone else experience a corrupted leak from Nokogiri?
<John_Ivan> which affects your ruby code?
jpn has joined #ruby
emcb54 has quit [Read error: Connection reset by peer]
gr33n7007h has quit [Ping timeout: 248 seconds]
emcb54 has joined #ruby
jpn has quit [Ping timeout: 256 seconds]
<ox1eef> try URI.decode_www_form_component on that.
<ox1eef> it looks like a newline (%0A)
<John_Ivan> ox1eef, it's a line feed.
<John_Ivan> ox1eef, interestingly enough if I do "line = line.chomp()" at the very top, I get some crazy errors. but the code fixes itself.
<ox1eef> [432] 0x1eefenv.rb (main)> URI.decode_www_form_component '%0A'
<ox1eef> => "\n"
<John_Ivan> which makes me believe that Nokogiri is not fond of data coming from mechanize that has been passed with a line feed.
<John_Ivan> e.g in the url.
<ox1eef> well, it is regular, that's how such characters have to be passed between http client and server.
<John_Ivan> ox1eef, line = line.chomp() seems to fix everything. just gotta fix the massive parsing error now.
<ox1eef> you should have a decode step to handle it
<ox1eef> i wouldnt rely on that, decode and chomp, but definitely decode - that's a problem waiting to happen
<John_Ivan> I hear ya.
<John_Ivan> thanks
<ox1eef> youre welcome
ur5us_ has joined #ruby
mr_tr0n has joined #ruby
<ox1eef> time to learn how github actions work i guess, i prefer that than installing the jvm locally
<John_Ivan> ox1eef, hmm?
<ox1eef> i have a gem id like to test to see if it works on jruby, ive had bad luck with that in the past, it seems most code i write doesnt work on the jvm
<John_Ivan> ah
<ox1eef> bit of a headache but worth the effort all the same
<ox1eef> plus the jruby are usually responsive, even if it doesnt work out in the end
<ox1eef> the jruby team*
<John_Ivan> ox1eef, working with java from ruby does sound like something worthwhile
<ox1eef> yeah, it's suppose to be great for that, all of the java ecosystem at your fingertips
mr_tr0n has quit [Quit: mr_tr0n]
mr_tr0n has joined #ruby
mr_tr0n has quit [Client Quit]
<John_Ivan> let's see
<John_Ivan> 50MB * 5000 = 250,000MB
<John_Ivan> which is 250GB
<John_Ivan> I'll need that much allocated for this...
<John_Ivan> 1 second * 150 = 150 seconds * 5000 = 750,000 seconds, is 12,500 minutes which is...208 hours...
<John_Ivan> or 8.6 days.
<John_Ivan> at 0.5 seconds, that'll be 4.2 days.
<John_Ivan> 0.25, 2.1 days.
<John_Ivan> holy shit
<John_Ivan> 0.125 would be 1.05 days.
<John_Ivan> 24 f-ing hours.
<ox1eef> for what?
<John_Ivan> ox1eef, my "slightly more advanced" spider which is meant to download comics off a site
<John_Ivan> ox1eef, I have about 5000+ favourited comics.
<John_Ivan> ox1eef, I assumed 1 request a second since I download 1 image per page.
<John_Ivan> but it'll take 8.6 days if I were to do that. which isn't a problem waiting. I'm just afraid the OS won't last that long.
<John_Ivan> and requests every 0.125 seconds sounds like something the server might refuse or lock me out for "too many requests"
<John_Ivan> ox1eef, I basically need to download 250GB worth of comics.
<weaksauce> the OS?
<weaksauce> as in operating system or some other initialism
<John_Ivan> yes. windows.... tends to crash in any period longer than 2-3 days :P
<weaksauce> hh
<weaksauce> uptime => 16:59 up 45 days, 7:39, 9 users, load averages: 9.21 5.57 6.42