havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.1, 3.0.3, 2.7.5: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
donofrio has joined #ruby
donofrio has quit [Client Quit]
SobiX has quit [Quit: Client closed]
donofrio has joined #ruby
ur5us has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
nirvdrum_ has joined #ruby
nirvdrum has quit [Ping timeout: 256 seconds]
John_Ivan has quit [Ping timeout: 250 seconds]
hanzo has joined #ruby
Guest48 has joined #ruby
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
jhawthorn_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
jhawthorn has joined #ruby
eddof13 has joined #ruby
dionysus69 has joined #ruby
nirvdrum_ has quit [Ping timeout: 250 seconds]
gproto23 has joined #ruby
rawley has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 260 seconds]
davidw has quit [Ping timeout: 240 seconds]
hanzo has quit [Quit: Connection closed for inactivity]
fowl has quit [Quit: cya pals]
o|||||o has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
fowl has joined #ruby
dionysus69 has joined #ruby
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jmcgnh has quit [Ping timeout: 272 seconds]
Guest48 has joined #ruby
Aylat has joined #ruby
Aylat has quit [Changing host]
Aylat has joined #ruby
reset has quit [Quit: reset]
jmcgnh has joined #ruby
Aylat has quit [Client Quit]
donofrio has quit [Ping timeout: 246 seconds]
seabre has quit [Remote host closed the connection]
seabre has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest48 has joined #ruby
Tempesta has quit [Quit: AdiIRC is updating to v4.2]
Tempesta has joined #ruby
teclator has joined #ruby
Furai has joined #ruby
d-s has joined #ruby
Tempesta has quit [Ping timeout: 265 seconds]
Tempesta has joined #ruby
infinityfye has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
Thanzex has joined #ruby
donofrio has quit [Ping timeout: 260 seconds]
Tempesta has quit [Quit: See ya!]
donofrio has joined #ruby
goepsilongo_ has joined #ruby
goepsilongo has quit [Ping timeout: 245 seconds]
nemesit has joined #ruby
SobiX has joined #ruby
oxfuxxx has joined #ruby
d-s has quit [Read error: Connection reset by peer]
d-s has joined #ruby
d-s has quit [Read error: Connection reset by peer]
gproto23 has quit [Remote host closed the connection]
gproto23_ has joined #ruby
d-s has joined #ruby
taupiqueur has joined #ruby
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
taupiqueur has quit [Ping timeout: 260 seconds]
Guest48 has joined #ruby
taupiqueur has joined #ruby
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
taupiqueur_ has joined #ruby
taupiqueur has quit [Ping timeout: 260 seconds]
oxfuxxx has quit [Ping timeout: 260 seconds]
markong has joined #ruby
oxfuxxx has joined #ruby
Guest48 has joined #ruby
Guest48 has quit [Client Quit]
taupiqueur_ has quit [Quit: taupiqueur_]
taupiqueur has joined #ruby
o|||||o has joined #ruby
oxfuxxx has quit [Ping timeout: 272 seconds]
Guest48 has joined #ruby
Guest48 has quit [Client Quit]
rhe has quit [Quit: Ping timeout (120 seconds)]
SobiX has quit [Quit: Client closed]
rhe has joined #ruby
gproto23_ has quit [Ping timeout: 272 seconds]
gproto23 has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
taupiqueur_ has joined #ruby
taupiqueur has quit [Ping timeout: 260 seconds]
taupiqueur_ has quit [Read error: Connection reset by peer]
taupiqueur has joined #ruby
oxfuxxx has joined #ruby
SobiX has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
<mooff> ello
taupiqueur has quit [Quit: taupiqueur]
taupiqueur has joined #ruby
<adam12> mooff: morning!
oxfuxxx has quit [Read error: Connection reset by peer]
oxfuxxx has joined #ruby
<mooff> morning adam12 :)
<adam12> mooff: how goes
infinityfye has quit [Ping timeout: 260 seconds]
oxfuxxx has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Ping timeout: 252 seconds]
reset has joined #ruby
<mooff> not bad adam12. hope you're well
<mooff> writing documentation. why is it so hard to do?!
<adam12> mooff: I am thanks. You as well.
<adam12> No kidding!
roadie has joined #ruby
markong has quit [Ping timeout: 260 seconds]
markong has joined #ruby
roadie has quit [Ping timeout: 245 seconds]
dionysus69 has joined #ruby
nirvdrum has joined #ruby
SobiX has quit [Ping timeout: 250 seconds]
Tempesta has joined #ruby
davidw has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
SobiX has joined #ruby
roadie has joined #ruby
John_Ivan has joined #ruby
oxfuxxx has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
entropie has quit [Read error: Connection reset by peer]
entropie has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
splud has quit [Ping timeout: 260 seconds]
roadie has joined #ruby
oxfuxxx has quit [Ping timeout: 272 seconds]
emcb5 has quit [Ping timeout: 260 seconds]
splud has joined #ruby
Tempesta has quit [Read error: Connection reset by peer]
taupiqueur has quit [Quit: taupiqueur]
royo25 has joined #ruby
rhe5 has joined #ruby
rhe has quit [Read error: Connection reset by peer]
rhe5 is now known as rhe
gproto23 has quit [Remote host closed the connection]
gproto23 has joined #ruby
<adam12> Neat.
eldritch has quit [Quit: bye]
glider has quit [Quit: ZNC - https://znc.in]
<adam12> include IIRC::Batteries Heh. https://rubygems.org/gems/batteries
gproto23 has quit [Remote host closed the connection]
gproto23 has joined #ruby
<mooff> hehe
<adam12> It's hard coming up with good gem names lately.
shokohsc has quit [Read error: Connection reset by peer]
<wnd> I may have a different definition for good names
eldritch has joined #ruby
glider has joined #ruby
shokohsc has joined #ruby
nirvdrum has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12> wnd: What's the definition?
<wnd> In this context, descriptive and searchable (read: unique). I know it's boring and not funny.
<adam12> wnd: I figure the gem summary / description would be sufficient to match any expected searches?
<adam12> I get where you're coming from tho.
royo25 has quit [Quit: Bye]
<mooff> the IIRC name was 'giving up' just to get it released ;)
<mooff> many that i liked were already taken
gproto23 has quit [Ping timeout: 260 seconds]
<John_Ivan> is there a particular method or approach to iterating a string from a given position? e.g suppose I want to start printing out the chars of "this_string" but from position 6.
<mooff> :: "this string"[6..]
<ruby-eval> => "tring"
<adam12> You can use String#slice if it reads better to you.
<John_Ivan> hmm. hold on, trying to figure out if that will work. thank you by the way.
<John_Ivan> mooff, no, it won't I'm afraid. because I need to be in control of the iterator to apply conditions to it
<John_Ivan> so basically I need
<John_Ivan> string.each_char_with_index_at(char, index, at) {}
<John_Ivan> so that I can continue my iteration from a given "at" position
<jhass[m]> string.each_char.drop(6).each
<jhass[m]> string[6..].each_char
<mooff> \o/ ^
<John_Ivan> I guess that works. cheers.
<jhass[m]> first might be slightly more performant for very big strings
<John_Ivan> it works well for my usecase. thanks mate. it won't work well if you want to go backwards though :)
<John_Ivan> because once you dropped the 6 chars, what if you want to iterate now in reverse? you have to reconstruct the string again rather than just using some pointer arithmetic
<adam12> You want StringScanner then, likely.
<jhass[m]> Maybe you want to write C not Ruby xD
<John_Ivan> I want to write Ruby with C :>
gproto23 has joined #ruby
<jhass[m]> Check Crystal then
emcb5 has joined #ruby
<adam12> Or StringIO..
<adam12> Not really sure what you're building tho.
<jhass[m]> More seriously though you might also consider just computing your indicies, a.upto(s.size) do |i| s[i] end; s.size.downto(b) etc
* mooff wishes that StringIO.new.is_a?(IO) was true :)
<John_Ivan> adam12, just making my own string lib, the one I mentioned yesterday.
<adam12> John_Ivan: Right. Did you have an example in another language? Just curious.
<John_Ivan> an example? of what
<adam12> John_Ivan: A library that you are modelling this from.
<John_Ivan> not really. I just made my own function called "GetStringBetween(char1, char2, occurence)"
<John_Ivan> and I figured that for the occurence, I'd have to scan back and forth keeping memory in mind (of occurences)
<jhass[m]> mooff: class StringIO; def is_a?(class); class == IO ? true : super; end; end; xD
<mooff> hehe jhass[m]
<John_Ivan> I normally do this with array indices in C
<adam12> John_Ivan: Gotcha. What's occurence?
<adam12> The string being worked on?
<mooff> jhass[m]: fwiw it's really IO === StringIO.new that i was interested in, for case statements
<John_Ivan> adam12, "this-occure-more-than-once" calling the function over this string would yield "more" rather than "occur"
<John_Ivan> 3rd occurence would yield "than"
<jhass[m]> mooff: aww, yeah, the one thing you can't really hack up in Ruby :(
<adam12> John_Ivan: Sorry, I still don't follow. But if you get something working I'd be curious to see.
<adam12> jhass[m]: LOL.
<mooff> lol
<mooff> using Insanity
eddof13 has joined #ruby
o|||||o has quit [Ping timeout: 260 seconds]
roadie has quit [Ping timeout: 245 seconds]
o|||||o has joined #ruby
Guest48_ has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
Guest48_ has quit [Client Quit]
roadie has joined #ruby
<John_Ivan> adam12, no worries. yeah. I'll get it working. once I figure out how to iterate back and forth in the same string. but basically
<John_Ivan> GetStringBetween("-", "-", 1, string_to_scan); //where string_to_scan is "this-is-a-string-to-scan", the return value should be "is". if the occurence is 2, the return value is "a". if it's 3, it's "string"
<John_Ivan> at least that's how I plan to design it
<John_Ivan> the params of the function are GetStringBetween(char1, char2, occurence, stringToScan);
TCZ has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
SobiX has quit [Ping timeout: 250 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mooff> John_Ivan: have you written that as a test case? :)
<John_Ivan> mooff, I use the exact format I mentioned above for testing, yes.
<John_Ivan> though I think I'm going to give up on it.
SobiX has joined #ruby
eddof13 has joined #ruby
<mooff> give up? how come?
<adam12> John_Ivan: I made an example using StringScanner for the lulz. https://gist.github.com/adam12/68491a792a7e28f1e8c69197cd475caa if you're curious.
<John_Ivan> adam12, I appreciate the interest :), I'll read it in a moment.
<John_Ivan> mooff, well, originally the string lib I'm making is meant to just ease my future work but
<John_Ivan> let's say that I'm slightly lost. I'm in between a stage where I am asking myself
<John_Ivan> "I can automate some of my data. but I could also just go and do it by hand. doing it by hand will be quicker if done in stages. but the automation will do it in a few seconds. I'll have to spend writing a few days. in which in those few days I'll probably have the stuff done. is there a point in this lib now? might be in the future. but automation will crop up again. I guess at that time, I'll just use the basic string operations and hope
<John_Ivan> to be good enough...
<John_Ivan> mooff, so "priorities" and "choosing what suits best", taking my state of mind in consideration
<John_Ivan> is the reason I figured I am probably wasting my time making that string library.
<adam12> I'd say YAGNI and rule of 3. Start doing what you're doing, and you dup it 3 times, extract it. And don't build anything you haven't needed yet (YAGNI).
<adam12> Unless it's for fun, in that case, there's no harm in throwing away code.
TCZ has quit [Quit: Leaving]
<John_Ivan> :)
gproto23 has quit [Remote host closed the connection]
skandal has quit [Quit: ZNC 1.8.2 - https://znc.in]
lunarkitty has joined #ruby
markong has quit [Ping timeout: 246 seconds]
SobiX has quit [Quit: Client closed]
roadie has joined #ruby
___nick___ has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
Tempesta has joined #ruby
roadie has joined #ruby
scottg489 has joined #ruby
hololeap_ has joined #ruby
hololeap has quit [Ping timeout: 240 seconds]
roadie has quit [Read error: Connection reset by peer]
roadie has joined #ruby
hololeap has joined #ruby
hololeap_ has quit [Ping timeout: 240 seconds]
roadie has quit [Read error: Connection reset by peer]
roadie has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goepsilongo_ has quit [Quit: Textual IRC Client: www.textualapp.com]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #ruby
nirvdrum has joined #ruby
<havenwood> adam12: Almost tempting to: val = check_until(right_pattern).delete_suffix(right)
<havenwood> There should be a #check_until that doesn't include the end. ¯\_(ツ)_/¯
<adam12> havenwood: Yeah. :\ I wish it didn't include the end and ran into this when I was parsing something else just recently.
<adam12> The something else I ended up using a look-ahead IIRC.
<havenwood> adam12: I guess you know you can safely: check_until(right).sub(right, '')
<havenwood> Since can't be a right in there.
<havenwood> Another one, I mean.
<havenwood> adam12: Yeah, makes sense.
<adam12> StringScanner is definitely one of my favs tho.
<havenwood> Beats Shell any day. ;)
<havenwood> Shell always has me scratching my head.
<havenwood> adam12: What's your least favorite?
<havenwood> They've removed so many of the obvious choices from stdlib!
<havenwood> WEBrick
<adam12> havenwood: Probably net/http :(
<havenwood> I guess we still have Net::HTTP ;)
<havenwood> Haha, yup
<adam12> I'm trying to use net/http more and more, but I usually want to wrap it
<adam12> so I'm back at Faraday, just without the dependency.
<adam12> Oh well.
<havenwood> The stdlib is for sure getting more crisp and maintained. That's nice.
<adam12> Be nice if we could settle on an API like Rack, but for HTTP requests.
<havenwood> mmmmm
<adam12> then it could be Square.build(my_own_http_client) and you could just my_own_http_client.get(path, headers, body) or whatever.
<adam12> Any large project seems to have 4-5 HTTP clients (transitively)
<adam12> My largest project has async-http, httparty, excon, faraday, and patron, with only Faraday being non-transitive.
TCZ has joined #ruby
lunarkitty has quit [Quit: Connection closed for inactivity]
<havenwood> adam12: Yeah, async-http, HTTP.rb and Typhoeus are my gotos.
<havenwood> adam12: I did use Faraday for our Ruby SDK since that seemed the most flexible to not mess with your world.
<havenwood> A Rack-like solution would sure be nice. The problem with Faraday is we'd all have to actually use it.
<havenwood> I guess Faraday is the closest we have.
<adam12> I wonder what it would take to make net/http nicer to use.
<adam12> I submitted a PR months ago without a peep, so I don't know whether it would even see any improvements outside of something that tickled core's fancy.
___nick___ has quit [Ping timeout: 245 seconds]
emcb5 has quit [Read error: Connection reset by peer]
emcb5 has joined #ruby
ur5us has joined #ruby
markong has joined #ruby
o|||||o has quit [Ping timeout: 272 seconds]
<mooff> is HTTParty still HTTPopular?
o|||||o has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
<adam12> lol
SobiX has joined #ruby
<havenwood> mooff: I avoid the Net::HTTP wrappers.
<havenwood> mooff: But Rails folk especially seem to party hard enough to use it. ¯\_(ツ)_/¯
<havenwood> mooff: Async, "no". Parallel, "no". HTTP/2, "no". So that's a "no" for me.
dionysus69 has joined #ruby
SobiX has quit [Ping timeout: 250 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has joined #ruby
eddof13 has joined #ruby
o|||||o has quit [Ping timeout: 250 seconds]
SobiX has joined #ruby
Guest465 has joined #ruby
<Guest465> Why are you silencing me?
<Guest465> Sorry wrong window :-)
<Guest465> Weirdos.
<Guest465> Creeps.
d-s has quit [Read error: Connection reset by peer]
d-s has joined #ruby
Guest465 has quit [Client Quit]
roadie has quit [Ping timeout: 250 seconds]
Guest7120 has joined #ruby
<Guest7120> Hey! Anybody in the Ruby Discord channel right now?
<Guest7120> Dude's cutting me off from talking because he disagrees with me.
<John_Ivan> I think... I'll need to go on a pilgrimage.
<Guest7120> Weirdos.
<Guest7120> All over the place.
<Guest7120> Especially since they won't show their real names or selfies.
<Guest7120> havenwood: You're a witness to this.
<Guest7120> But yet you let this happen.
<Guest7120> Talking points. Trying to tell me about the Islamic era. My dad's Muslim.
<Guest7120> Every time I show my selfie: https://www.tv2.no/v/1721701/
<Guest7120> Nope, that was my ex
<Guest7120> She's dead now btw.
<Guest7120> havenwood: There he is: https://soundcloud.com/jmtepstad
<Guest7120> Why the minute we started talking about slave trade, and I translated old Danish texts?
<Guest7120> Did I get silenced? All my texts show up red.
<Guest7120> Some hidden agenda to silence me on IRC for trying to have a normal discussion.
<Guest7120> I hate this place.
<Guest7120> None of you are willing to show your real names or selfies either.
TCZ has quit [Quit: Leaving]
roadie has joined #ruby
<John_Ivan> hey adam12, mind if I ask some questions outside ruby/programming? more like, discipline/principle/habit related. I've got an annoying problem of "organization".
Exuma has joined #ruby
Exuma has quit [Client Quit]
<Guest7120> John_Ivan: Dude's probably busy
<Guest7120> Wait, what day is it today?
<Guest7120> Wednesday, cool
roadie has quit [Ping timeout: 240 seconds]
<Guest7120> My best friend was named Ivan!
<Guest7120> After all his neighbors died from overdose
<John_Ivan> Guest7120, hi can I help you?
<Guest7120> He decided to marry and settle down in a different city
<Guest7120> John_Ivan: No, sorry
<Guest7120> John_Ivan: The Ivan I knew though, he lived next to these two twins. Before they took suicide.
<Guest7120> They ran around with knives and slashed innocent victims.
<Guest7120> They used to be good people. But all the pills and poverty messed with their heads.
<Guest7120> RIP. They never killed anybody at least.
<leah2> who had ops again? :p
<Guest7120> One of them hanged himself. After getting raped in prison.
<Guest7120> leah2: I'm done.
<mooff> Guest7120: what's the ninth letter of the alphabet?
<Guest7120> which alphabet?
<Guest7120> didn't expect that, did you?
<mooff> no :)
hololeap_ has joined #ruby
howdoi has joined #ruby
roadie has joined #ruby
hololeap has quit [Ping timeout: 240 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Client Quit]
oxfuxxx has joined #ruby
SobiX has quit [Ping timeout: 250 seconds]
roadie has quit [Ping timeout: 260 seconds]
oxfuxxx has quit [Ping timeout: 246 seconds]
hololeap has joined #ruby
hololeap_ has quit [Ping timeout: 240 seconds]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
o|||||o has joined #ruby
Guest7120 has quit [Read error: Connection reset by peer]
<adam12> leah2: Maybe we need more ops. havenwood jhass[m]
<adam12> John_Ivan: Sure no problem.
ur5us has quit [Ping timeout: 260 seconds]
<havenwood> Organization is hard...
<adam12> First time I can recall we've been trolled since the migration.
<havenwood> adam12: We can also +r but this was just a single intoxicated person.
<havenwood> I think we outlasted the trolls.
<John_Ivan> adam12, I have trouble deciding what to keep or what not to keep in terms of media. Let's say movies and music. I try to apply the "must keep or good to keep" rule on business management but I don't think it's helping. Is there some other framework you can recommend or other rules/hints/tips?
<adam12> John_Ivan: Is this movies and music specifically or just as an example?
<adam12> I'm probably the worst for this since I'm a closet data hoarder.
roadie has joined #ruby
<John_Ivan> adam12, it actually is movies and music.
<adam12> Tho I did delete my Windows 2003 server ISO's a few days ago.
<adam12> John_Ivan: Why not keep everything? Space is so cheap now.
<John_Ivan> yeah, I'm trying to lessen on the hoarding habit and actually keep what I need.
<John_Ivan> adam12, well, I kinda do. It's around 10TB. I keep them on 3 separate HDDs. the problem is actually working with the data tends to be time consuming.
<John_Ivan> such as applying labels, etc
<adam12> John_Ivan: Maybe they don't need labels? I use Plex and it seems to do OK (at least for visual media).
<adam12> John_Ivan: Let's move this to #ruby-offtopic
<adam12> (and I gotta duck out to put kid to bed. Back later / tomorrow)
<John_Ivan> sure
roadie has quit [Ping timeout: 260 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 272 seconds]
markong has quit [Ping timeout: 260 seconds]
<hwrd> in blocks, like { |x| ... }, what is the proper term for that x there?
eddof13 has joined #ruby
eddof13 has quit [Client Quit]