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
some14u has joined #ruby
markong has quit [Ping timeout: 256 seconds]
seydar has quit [Ping timeout: 272 seconds]
seydar has joined #ruby
Sheilong has joined #ruby
seydar has quit [Ping timeout: 272 seconds]
TCZ has joined #ruby
dviola has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
dviola has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
o|||||o has quit [Ping timeout: 248 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dviola has quit [Ping timeout: 268 seconds]
dviola has joined #ruby
dviola has quit [Ping timeout: 246 seconds]
dviola has joined #ruby
dviola has quit [Max SendQ exceeded]
dviola has joined #ruby
dviola has quit [Ping timeout: 246 seconds]
dviola has joined #ruby
dviola has quit [Ping timeout: 248 seconds]
dviola has joined #ruby
dviola has quit [Remote host closed the connection]
dviola has joined #ruby
dviola has quit [Ping timeout: 256 seconds]
dviola has joined #ruby
favadi has joined #ruby
favadi has quit [Client Quit]
yossarian has quit [Ping timeout: 272 seconds]
yossarian has joined #ruby
yossarian has quit [Changing host]
yossarian has joined #ruby
dviola has quit [Ping timeout: 248 seconds]
TCZ has quit [Quit: Leaving]
dviola has joined #ruby
dviola has quit [Remote host closed the connection]
dviola has joined #ruby
dviola has quit [Ping timeout: 268 seconds]
seydar has joined #ruby
duds- has joined #ruby
dviola has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
dviola has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
dviola has joined #ruby
seydar has quit [Ping timeout: 268 seconds]
dviola has quit [Max SendQ exceeded]
dviola has joined #ruby
donofrio has joined #ruby
seydar has joined #ruby
seydar has quit [Ping timeout: 248 seconds]
seydar has joined #ruby
seydar has quit [Ping timeout: 248 seconds]
justOkay is now known as justChili
seydar has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
dviola has quit [Ping timeout: 248 seconds]
seydar has joined #ruby
seydar has quit [Read error: Connection reset by peer]
dviola has joined #ruby
dviola has quit [Ping timeout: 246 seconds]
dviola has joined #ruby
dviola has quit [Max SendQ exceeded]
dviola has joined #ruby
dviola has quit [Ping timeout: 256 seconds]
dviola has joined #ruby
dviola has quit [Ping timeout: 248 seconds]
donofrio has quit [Ping timeout: 268 seconds]
dviola has joined #ruby
goepsilongo has quit [Quit: Konversation terminated!]
dviola has quit [Ping timeout: 246 seconds]
dviola has joined #ruby
Hess has quit [Quit: Ping timeout (120 seconds)]
Hess has joined #ruby
dviola has quit [Ping timeout: 246 seconds]
dviola has joined #ruby
Sheilong has quit []
seydar has joined #ruby
seydar has quit [Read error: Connection reset by peer]
dviola has quit [Ping timeout: 246 seconds]
favadi has joined #ruby
agrosant has joined #ruby
dviola has joined #ruby
seydar has joined #ruby
seydar has quit [Ping timeout: 248 seconds]
dviola has quit [Ping timeout: 248 seconds]
dviola has joined #ruby
dviola has quit [Max SendQ exceeded]
dviola has joined #ruby
seydar has joined #ruby
dviola has quit [Ping timeout: 248 seconds]
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
seydar has quit [Ping timeout: 256 seconds]
seydar has joined #ruby
favadi has joined #ruby
dviola has joined #ruby
oxfuxxx has joined #ruby
seydar has quit [Ping timeout: 248 seconds]
_ht has joined #ruby
dviola has quit [Max SendQ exceeded]
seydar has joined #ruby
dviola has joined #ruby
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
seydar has quit [Ping timeout: 248 seconds]
dviola has quit [Max SendQ exceeded]
seydar has joined #ruby
seydar has quit [Ping timeout: 248 seconds]
favadi has joined #ruby
oxfuxxx has quit [Ping timeout: 248 seconds]
seydar has joined #ruby
favadi has quit [Client Quit]
dviola has joined #ruby
dviola has quit [Changing host]
dviola has joined #ruby
dviola has quit [Client Quit]
seydar has quit [Ping timeout: 248 seconds]
dviola has joined #ruby
dviola has quit [Max SendQ exceeded]
dviola has joined #ruby
dviola has quit [Max SendQ exceeded]
u0_a151 has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
o|||||o has joined #ruby
u0_a151 has quit [Client Quit]
Tempesta has quit [Ping timeout: 265 seconds]
seydar has joined #ruby
Tempesta has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
ur5us_ has joined #ruby
seydar has joined #ruby
seydar has quit [Ping timeout: 256 seconds]
seydar has joined #ruby
oxfuxxx has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
seydar has quit [Ping timeout: 268 seconds]
seydar has joined #ruby
o|||||o has quit [Ping timeout: 248 seconds]
seydar has quit [Ping timeout: 256 seconds]
ur5us_ has quit [Quit: Leaving]
seydar has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
favadi has joined #ruby
favadi has quit [Client Quit]
seydar has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
seydar has quit [Ping timeout: 256 seconds]
oxfuxxx has quit [Quit: [H]EAT ROX FUCK R0X SHIT BRIX.]
justChili has quit [Remote host closed the connection]
justChili has joined #ruby
georgemp_ is now known as georgemp
ur5us has quit [Ping timeout: 268 seconds]
jhass has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
jhass has joined #ruby
some14u has joined #ruby
teclator has joined #ruby
ssh073 has quit [Quit: The Lounge - https://thelounge.chat]
ssh073 has joined #ruby
ssh073 has quit [Client Quit]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ssh073 has joined #ruby
fercell has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
roadie has joined #ruby
markong has joined #ruby
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
seydar has quit [Ping timeout: 272 seconds]
donofrio has joined #ruby
seydar has joined #ruby
seydar has quit [Ping timeout: 268 seconds]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
seydar has joined #ruby
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
dionysus69 has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
seydar has quit [Ping timeout: 268 seconds]
some14u has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 256 seconds]
seydar has joined #ruby
o|||||o has joined #ruby
donofrio has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
goepsilongo has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
Sheilong has joined #ruby
seydar has joined #ruby
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
seydar has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
seydar has quit [Ping timeout: 272 seconds]
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
seydar has joined #ruby
TCZ has joined #ruby
donofrio has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
factor has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
favadi has joined #ruby
dionysus69 has joined #ruby
some14u has joined #ruby
roadie has quit [Ping timeout: 248 seconds]
some14u has quit [Client Quit]
o|||||o has quit [Ping timeout: 246 seconds]
hololeap has quit [Remote host closed the connection]
some14u has joined #ruby
roadie has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
Coop has joined #ruby
roadie has quit [Ping timeout: 248 seconds]
TCZ has quit [Quit: Leaving]
seydar has joined #ruby
seydar has quit [Ping timeout: 272 seconds]
seydar has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
seydar has quit [Ping timeout: 248 seconds]
roadie has joined #ruby
seydar has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
seydar has quit [Ping timeout: 248 seconds]
<ox1eef> :: def foo(...); bar(...); end; def bar(a,b,&c); Kernel.p [á,b,c]; end; bar(1,2) {}
<ruby-eval> ERROR: undefined local variable or method `á' for main:Object
<ruby-eval> (eval):1:in `bar'
<ox1eef> :: def foo(...); bar(...); end; def bar(a,b,&c); Kernel.p [a,b,c]; end; bar(1,2) {}
<ruby-eval> [1, 2, #<Proc:0x044795d8 (eval):1>]
<ruby-eval> => [1, 2, #<Proc:0x044795d8 (eval):1>]
<ox1eef> thats nice
roadie has joined #ruby
seydar has joined #ruby
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fef has joined #ruby
seydar has quit [Ping timeout: 268 seconds]
seydar has joined #ruby
graywolf has joined #ruby
Guest26nakilon has joined #ruby
<Guest26nakilon> where is Hash#dup documented?
<Guest26nakilon> I feel like it's doing something weird, not what I expected
seydar has quit [Ping timeout: 268 seconds]
<Guest26nakilon> hm, it feels like when I use a Struct (that I modify in process) as a key  they go as different keys
<Guest26nakilon> but when I dup, it probably calls some rehash and the hash gets "corrupted", i.e. becomes smaller, all the keys merge
dionysus70 has joined #ruby
<Guest26nakilon> yeah it's funny
dionysus69 has quit [Ping timeout: 256 seconds]
dionysus70 is now known as dionysus69
seydar has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
seydar has quit [Ping timeout: 268 seconds]
donofrio has quit [Ping timeout: 268 seconds]
sylario has joined #ruby
Guest65 has joined #ruby
<Guest65> Anyone else has that character ¶ at ruby documentation? https://ruby-doc.org/stdlib-3.1.1/libdoc/optparse/rdoc/OptionParser.html
<Guest65> not sure if it's my bad or something wrong with the documentation
<leftylink> I also see such a character
<adam12> Guest65: It's a shortcut link.
<adam12> Guest65: If you click it, it updates the hash in the URL.
<Guest65> Nice to know. Useful feature. But isn't beautiful. Another way to do this would be great.
<Guest65> :)
<Guest65> Thanks for the response
<adam12> Guest65: Those aren't the official docs, so...
<Guest65> I will switch to the official one. The examples copied from there
donofrio has joined #ruby
Guest65 has quit [Quit: Client closed]
_aeris_ has joined #ruby
aeris has quit [Remote host closed the connection]
_aeris_ is now known as aeris
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
donofrio has quit [Ping timeout: 248 seconds]
oxfuxxx has quit [Quit: [H]EAT ROX FUCK R0X SHIT BRIX.]
<Guest26nakilon> is there official doc on right hand assignment? I don't see it here https://ruby-doc.org/core-3.1.0/doc/syntax/assignment_rdoc.html
<Guest26nakilon> and how do I skip the values? like [1,2,3] => x,_
<Guest26nakilon> it throws a syntax error
<ox1eef> where are the official docs? i dont know of any except third party efforts
donofrio has joined #ruby
<Guest26nakilon> oh I see, I need brackets
markong has quit [Ping timeout: 248 seconds]
<Guest26nakilon> ox1eef I guess this https://docs.ruby-lang.org/en/3.1/index.html
<Guest26nakilon> though it had formatting issues on some pages too
<Guest26nakilon> leftylink thanks
<ox1eef> oh nice. i wasn't aware the docs were hosted on ruby-lang these days.
some14u has joined #ruby
<Guest26nakilon> I always felt like those are some Windows documentation format and so they might be very old
some14u has quit [Client Quit]
some14u has joined #ruby
<Guest26nakilon> they are exactly the same as the .chm file coming with Ruby Installer
graywolf has quit [Quit: WeeChat 3.3]
some14u has quit [Client Quit]
seydar has joined #ruby
fercell has joined #ruby
some14u has joined #ruby
<ox1eef> i like yard, not perfect either but pretty powerful.
<Guest26nakilon> people are reinventing the https://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help, idk why Microsoft had it proprietary (and abandoned?) as Wikipedia says
seydar has quit [Ping timeout: 246 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Guest26nakilon> I remember Windows API, C and C++ docs were on CDs in this format -- they were perfect to use when you have no internet yet
<Guest26nakilon> I also wonder why no one makes fxri
<Guest26nakilon> it stopped working with ruby 2.0 IIRC
<ox1eef> in todays world we have the file:/// protocol and a browser, as long as the HTML follows some simple rules i think it should work just as well
<Guest26nakilon> if you have a browser you might have an internet though
<Guest26nakilon> it's just today's days that we have browser launched all the time
<ox1eef> yeah
seydar has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
g0zart has joined #ruby
g0zart has quit [Quit: Leaving]
dionysus69 has joined #ruby
Guest26nakilon has quit [Quit: Client closed]
dionysus69 has quit [Ping timeout: 268 seconds]
guest_nakilon has joined #ruby
<guest_nakilon> imagine I have an array that I want to iterate through exactly once; the thing is that my algorithm's iterations are not equivalent to array's elements, so I have to kinda move a pointer
<guest_nakilon> I used to call the array.first and array.shift when I need to step further, but now I want to eliminate the mutation; how do I do that? if I make enum = array.to_enum, and utilize peek and next, then it does not stop gracefully
<guest_nakilon> I mean when I do the last peek it throws StopIteration, I don't want to handle exceptions
guest_nakilon has quit [Remote host closed the connection]
guest_nakilon has joined #ruby
<guest_nakilon> doing enum = [*array, nil].to_enum would be a kludge
<guest_nakilon> (the https://web.libera.chat/gamja/ client is weird, got some "disconnect" message but it's not clear when did it really happen)
guest_nakilon has quit [Remote host closed the connection]
guest_nakilon has joined #ruby
guest_nakilon has quit [Remote host closed the connection]
guest_nakilon has joined #ruby
<guest_nakilon> I mean in my current implementation I just check for array.first.nil?
Thanzex has quit [Read error: Connection reset by peer]
taupiqueur has joined #ruby
Thanzex has joined #ruby
guest_nakilon has quit [Remote host closed the connection]
guest_nakilon has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
ssh073 has quit [Quit: The Lounge - https://thelounge.chat]
ssh073 has joined #ruby
guest_nakilon has quit [Remote host closed the connection]
fef has quit [Remote host closed the connection]
guest_nakilon has joined #ruby
guest_nakilon has quit [Remote host closed the connection]
guest_nakilon has joined #ruby
guest_nakilon has quit [Remote host closed the connection]
guest_nakilon has joined #ruby
guest_nakilon has quit [Remote host closed the connection]
brw has quit [Quit: The Lounge - https://thelounge.chat]
guest_nakilon has joined #ruby
guest_nakilon has quit [Remote host closed the connection]
dionysus69 has joined #ruby
brw has joined #ruby
guest_nakilon has joined #ruby
some14u has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
guest_nakilon has quit [Remote host closed the connection]
guest_nakilon has joined #ruby
<guest_nakilon> nevermind, I just replace "break unless array.first" with "enum.peek rescue break" and it seems to be working
roadie has joined #ruby
seydar has quit [Ping timeout: 246 seconds]
seydar has joined #ruby
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
noname has joined #ruby
noname has quit [Remote host closed the connection]
teclator has joined #ruby
seydar has quit [Ping timeout: 256 seconds]
_ht has quit [Remote host closed the connection]
seydar has joined #ruby
___nick___ has quit [Ping timeout: 268 seconds]
seydar has quit [Ping timeout: 268 seconds]
ssh073 has quit [Quit: The Lounge - https://thelounge.chat]
ssh073 has joined #ruby
seydar has joined #ruby
taupiqueur has quit [Quit: taupiqueur]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
seydar has quit [Ping timeout: 248 seconds]
wand has quit [Ping timeout: 240 seconds]
nirvdrum has joined #ruby
seydar has joined #ruby
dionysus69 has joined #ruby
libsys has quit [Ping timeout: 256 seconds]
libsys has joined #ruby
seydar has quit [Ping timeout: 248 seconds]
nirvdrum has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
markong has joined #ruby
gfawcett has quit [Quit: Ping timeout (120 seconds)]
dionysus69 has quit [Quit: dionysus69]
gfawcett has joined #ruby
seydar has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
seydar has quit [Ping timeout: 248 seconds]
some14u has joined #ruby
gfawcett has quit [Quit: Ping timeout (120 seconds)]
gfawcett has joined #ruby
nirvdrum has joined #ruby
gfawcett has quit [Client Quit]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
victori has quit [Read error: Connection reset by peer]
roadie has joined #ruby
ur5us has joined #ruby
FetidToot1 has joined #ruby
roadie has quit [Ping timeout: 260 seconds]
FetidToot has quit [Ping timeout: 260 seconds]
FetidToot1 is now known as FetidToot
victori has joined #ruby
nirvdrum has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roadie has joined #ruby
roadie has quit [Read error: Connection reset by peer]
seydar has joined #ruby
some14u has quit [Ping timeout: 272 seconds]
FetidToot8 has joined #ruby
FetidToot has quit [Ping timeout: 256 seconds]
FetidToot has joined #ruby
FetidToot8 has quit [Ping timeout: 260 seconds]
comet23 has joined #ruby
<comet23> hello everyone i am stuck on a homework problem :(
<comet23> how can i use inject to find the biggest or smallest number?
sylario has quit [Quit: Connection closed for inactivity]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<adam12> comet23: assign to acc if num is greater than acc
<adam12> (or less than acc)
<adam12> comet23: ie. change acc when it's smaller than the number currently being compared.
<adam12> comet23: You're almost there, probably just using inject wrong.
<comet23> so like { |acc, num| acc if num > acc }
<weaksauce> acc must be something every time
<adam12> comet23: Don't forget to return acc always
<adam12> acc = num if num > acc; acc
<weaksauce> also you don't pass in a starting value so you have to check for the acc being nill
<comet23> i didn't know i can use semi colons in ruby
<weaksauce> nil even
<adam12> And like weaksauce said, inject(0)
<weaksauce> well or something smaller than any reasonable input
<weaksauce> personally i'd do a acc = num unless acc and check normally
<comet23> thank you so much for your help
<comet23> my code is working now but i think i can shorten it to a one liner with the hint provided by adam12
<adam12> That's true. I'd probably inject(nums.first) or something.
<weaksauce> yeah that works too
<weaksauce> still doesn't check for the nil
<comet23> nums.inject { |acc, num| acc = num if num > acc; acc }
<adam12> :: def max_inject(*nums)= nums.inject(nums.first) { |acc, num| acc = num if num > acc; acc }; max_inject(30, 28, 18)
<ruby-eval> => 30
<comet23> why do i need to check for nil?
<weaksauce> :: def max_inject(*nums)= nums.inject { |acc, num| acc = num if num > acc; acc }; max_inject(30, 28, 18)
<ruby-eval> => 30
<adam12> :: def max_inject(*nums)= nums.inject(nums.first) { |acc, num| next (num > acc ? num : acc) }; max_inject(30, 28, 18)
<ruby-eval> => 30
<adam12> bbiaf
<weaksauce> weird i got a nil problem when i ran it
justChili is now known as justErkel
<weaksauce> oh nevermind it was the original code
Thanzex has quit [Read error: Connection reset by peer]
<weaksauce> that didn't always return acc
<weaksauce> it uses the first value as the default memo
Thanzex has joined #ruby
seydar has quit [Ping timeout: 260 seconds]
comet23 has quit [Ping timeout: 250 seconds]
seydar has joined #ruby
Sheilong has quit [Quit: Connection closed for inactivity]
seydar has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 268 seconds]
seydar has joined #ruby