adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.3, 3.0.5, 2.7.7: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://libera.irclog.whitequark.org/ruby/
Rounin has quit [Ping timeout: 248 seconds]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
fowl has joined #ruby
rinkydink is now known as kerframil
kerframil is now known as tirnanog
ur5us has quit [Ping timeout: 255 seconds]
gordea has quit [Quit: gordea]
caedmon has joined #ruby
Al2O3 has quit [Ping timeout: 260 seconds]
caedmon has quit [Ping timeout: 252 seconds]
D_A_N_ has quit [Quit: leaving]
moldorcoder7_ has quit [Ping timeout: 248 seconds]
Tempesta has quit [Quit: See ya!]
reset has quit [Quit: reset]
moldorcoder7 has joined #ruby
otisolsen70_ has joined #ruby
polishdub has quit [Ping timeout: 264 seconds]
Tempesta has joined #ruby
Sankalp has quit [Ping timeout: 260 seconds]
Sankalp has joined #ruby
darkstardevx has joined #ruby
Michaela has quit [Remote host closed the connection]
desnudopenguino has quit [Ping timeout: 256 seconds]
Michaela has joined #ruby
teclator has joined #ruby
FullMetalStacker has joined #ruby
desnudopenguino has joined #ruby
___nick___ has joined #ruby
desnudopenguino has quit [Ping timeout: 255 seconds]
Rounin has joined #ruby
desnudopenguino has joined #ruby
polishdub has joined #ruby
Linux_Kerio has joined #ruby
dionysus69 has joined #ruby
TomyWork has joined #ruby
CalimeroTeknik has quit [Ping timeout: 252 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
CalimeroTeknik has joined #ruby
ur5us has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
smp_ has joined #ruby
smp has quit [Ping timeout: 260 seconds]
smp_ is now known as smp
<leftylink> ahh so recently I had to do a thing that was like xs = xs.zip(ys).map { |x, y| x + y }. I wonder if there's a way to do this in-place...
<leftylink> pandabot: rb xs = [1, 2, 3]; ys = [4, 5, 6]; xs.map!.with_index { |x, i| x + y[i] }; xs
<pandabot> stderr: -e:2:in `block in <main>': undefined local variable or method `y' for main:Object (NameError) - exit 1 - https://carc.in/#/r/e5ts
<leftylink> pandabot: rb xs = [1, 2, 3]; ys = [4, 5, 6]; xs.map!.with_index { |x, i| x + ys[i] }; xs
<pandabot> [5, 7, 9] - https://carc.in/#/r/e5tt
<leftylink> oh, I guess there was
<leftylink> map! is doing good work, then
<leftylink> it does feel a little unsatisfying though that you have to deal with the indices. I wonder if we can put that zip back in somehow
grokify has joined #ruby
<leftylink> I'm not convined I can, because Enumerable#zip doesn't have the right type for what would need to happen
<leftylink> for what map! is expecting to happen
<leftylink> so I'm just going to keep the zip and map instead of the map!.with_index
<leftylink> wish I could do otherwise, but that's life
<leftylink> uh. well
<leftylink> pandabot: rb xs = [1, 2, 3]; ys = [4, 5, 6]; ye = ys.each; xs.map! { |x| x + ye.next }
<pandabot> [5, 7, 9] - https://carc.in/#/r/e5tu
<leftylink> wellllllllllllllllllllllll............
<leftylink> or uh I guess you can shift off of ys if you're okay with mutating ys, but I actually wanted not to mutate ys.
<leftylink> only xs
<leftylink> so, no
<leftylink> you could obviously make a copy and shift off of that, but in that case you're doing the exact same thing as the one with ye = ys.each and ye.next
<leftylink> and I'm sort of philosophically opposed to stateful blocks passed to map/map! anyway because philosophically the idea should be that you can map the elements in any order
<leftylink> even though you don't actually map them in any order
<leftylink> but it's the philosophy
<leftylink> couldn't run it in parallel, and other problems
<leftylink> so lets move on. just the zip and map
<leftylink> but if you look at what's going on in the eperiments with map!.with_index ... it's cool to think that with_index can do the job. I think it might be an interesting exercise to think about how you would implement with_index
<leftylink> I'll not focus on the behaviour when it's not passed a block (in which case it returns another enumerator), nor worry about the optional index argument. I just want the basics for now
<leftylink> okay
<leftylink> that's not so bad
<leftylink> pandabot: rb using(Module.new { refine(Enumerator) { def my_with_index; i = -1; each { yield(_1, i += 1) } end }}); xs = %w(a b c); ys = [1, 2, 3].freeze; xs.map!.my_with_index { |x, i| x + ys[i].to_s }; xs
<pandabot> ["a1", "b2", "c3"] - https://carc.in/#/r/e5tv
<leftylink> so obviously this could easily be extended to handle the optional index argument
<leftylink> the behaviour without block is probably standard, it's just that I need to study more to know the standard
perrierjouet has quit [Quit: WeeChat 3.7.1]
CrazyEddy has quit [Ping timeout: 260 seconds]
perrierjouet has joined #ruby
grokify has quit [Remote host closed the connection]
otisolsen70_ has quit [Quit: Leaving]
desnudopenguino has quit [Ping timeout: 260 seconds]
gonix has joined #ruby
grokify has joined #ruby
otisolsen70_ has joined #ruby
grokify has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
cartdrige has joined #ruby
gonix has quit [Read error: Connection reset by peer]
Michaela has quit [Remote host closed the connection]
Michaela has joined #ruby
otisolsen70_ has quit [Quit: Leaving]
otisolsen70_ has joined #ruby
gonix has joined #ruby
Michaela has quit [Remote host closed the connection]
Michaela has joined #ruby
_aeris_ has joined #ruby
aeris has quit [Ping timeout: 255 seconds]
_aeris_ is now known as aeris
gonix has quit [Ping timeout: 268 seconds]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
cartdrige has quit [Ping timeout: 260 seconds]
<leah2> anyone know how Array#sample was designed?
Michaela has quit [Remote host closed the connection]
<leah2> it seems at first they just got n random indexes, retrying when they were the same
mweckbecker has joined #ruby
Michaela has joined #ruby
<leah2> and then they added a hash on top of that
mweckbecker has quit [Client Quit]
aeris has quit [Remote host closed the connection]
mweckbecker has joined #ruby
aeris has joined #ruby
mweckbecker has quit [Client Quit]
mweckbecker has joined #ruby
mweckbecker has quit [Client Quit]
mweckbecker has joined #ruby
Michaela has quit [Ping timeout: 255 seconds]
<ox1eef_> leah2: iteratively xD
<ox1eef_> But no, I have no clue.
<leah2> today there are three algorithms
<leah2> one for <=10 elements
<leah2> one that uses a hash
<leah2> and one that copies and then removes some elements
<leah2> i just wonder if one of the known reservoir sampling algorithms would be better :p
<ox1eef_> A lot of the time, arr[rand(arr.size)] is fine.
Michaela has joined #ruby
<leah2> i dont mean single sample, that's trivial
<ox1eef_> Simplicity is a feature :p
<leah2> i mean [10 elts].sample(9)
<leah2> but it's probably within reasonable practical bounds
<leah2> and it seems to be fair, but i'm not totally sure about that
mweckbecker has quit [Read error: Connection reset by peer]
<ox1eef_> Oh - first I knew of its argument. I have never used it like that before.
mweckbecker has joined #ruby
<leah2> (note that it gets n different elements)
<ox1eef_> That's a cool feature.
<leah2> but yeah, it probably makes sense to special case 1,2,3 elements
teclator has joined #ruby
mweckbecker has quit [Read error: Connection reset by peer]
<ox1eef_> 9.times.map { arr[rand(arr.size)] } though. I don't know. It depends on your requirements, and the size of the array you're sampling.
<leah2> well that will yield repetitions
<ox1eef_> I think it makes sense for a small array to be a special case.
<ox1eef_> Sure, but don't they become less likely, the bigger the array?
Michaela has quit [Ping timeout: 255 seconds]
<leah2> but perhaps it's a small array :D
<ox1eef_> Indeed, that's a tricky one that i'd handle specially.
otisolsen70_ has quit [Quit: Leaving]
mweckbecker has joined #ruby
otisolsen70 has joined #ruby
Michaela has joined #ruby
mweckbec1er has joined #ruby
cartdrige has joined #ruby
D_A_N_ has joined #ruby
mweckbecker has quit [Ping timeout: 260 seconds]
FetidToot has quit [Ping timeout: 260 seconds]
FetidToot has joined #ruby
mweckbec1er has quit [Read error: Connection reset by peer]
mweckbecker has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
teclator has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 265 seconds]
XR0DRiG0 has joined #ruby
Guest3 has joined #ruby
reset has joined #ruby
Guest3 has quit [Client Quit]
<gr33n7007h> >> class Integer def rand(n) = self end; [*0..99].sample 10, random: 42
<ruby[bot]> gr33n7007h: # => [42, 43, 44, 45, 46, 47, 48, 49, 50, 51] (https://carc.in/#/r/e5uz)
<gr33n7007h> interesting...
<leah2> interesting :) what's the protocol for Random?
<leah2> shouldnt it call .rand
Guest73 has joined #ruby
Guest73 has quit [Client Quit]
Rubidium has joined #ruby
<Rubidium> Hello, we are a software developers agency and we are hiring Ruby developers ATM. Please apply here https://forms.gle/YnC34Gyd2BteoYXb6
FullMetalStacker has quit [Remote host closed the connection]
yxhuvud has quit [Read error: Connection reset by peer]
Rubidium has quit [Client Quit]
yxhuvud has joined #ruby
some14u has joined #ruby
FullMetalStacker has joined #ruby
<FullMetalStacker> @Rubidium Do you have usage for trainees or juniors**2 ?
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 265 seconds]
FullMetalStacker has quit [Remote host closed the connection]
CalimeroTeknik has joined #ruby
CalimeroTeknik has quit [Changing host]
crax23 has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
Y05hito__ has joined #ruby
FullMetalStacker has joined #ruby
alexherbo2 has joined #ruby
cartdrige has quit [Ping timeout: 265 seconds]
crax23 has quit [Ping timeout: 260 seconds]
Y05hito__ has quit [Client Quit]
cartdrige has joined #ruby
some14u has joined #ruby
some14u has quit [Client Quit]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
grokify has joined #ruby
dionysus69 has joined #ruby
XR0DRiG0 has quit [Quit: Leaving]
grokify has quit [Ping timeout: 248 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
<FullMetalStacker> #poll #editor #ide Hey guys, what is the preferred IDE or editor for Ruby that is 100% open source and thus included in popular linux distribution's repos?
desnudopenguino has joined #ruby
<adam12> FullMetalStacker: You're not going to get a great answer to this I suspect, since editors/IDE's are kind of like religion amongst developers.
<adam12> FullMetalStacker: I use Neovim.
<caleb> same, vim8/9 or neovim
<gr33n7007h> i use vim/nano i'm a simple guy xD
<caleb> I don't use anything lua or neovim specific so it doesn't matter which one comes up at this point. I have a neovim config that loads my vimrc and such as usual.
<caleb> while we're getting into this editor religion talk
<caleb> I've seen people go from TextMate -> Sublime -> Atom -> VSCode, while tmux and vim never changes, never had random updates break my stuff and generally "just works"
<caleb> the older I get the more I value my tools not changing
<adam12> Agreed.
<adam12> I
some14u has joined #ruby
some14u has quit [Client Quit]
<adam12> I've actually been cutting from my limited stack as it is. I no longer use tmux locally, as I found it was getting in my way more often than not.
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
<adam12> And for terminal colours/theming, I am using vim-dim, which just uses the terminal colour pallete. Set it once and it's the same everywhere, which has been _much_ nicer.
<adam12> I'd love a Ruby-specific LSP plugin for Neovim tho. I've been tempted to write one, but haven't had time. I might even sponsor one if I saw one.
<adam12> The only LSP-like feature I currently use is K (which is actually a vim builtin). Brings up Ruby help for method under cursor :)
dionysus69 has quit [Ping timeout: 248 seconds]
<FullMetalStacker> @adam12 #religion I am aware. But I want to know what your religions are. I cant find a good IDE and am wondering if i am overlooking something. I should had added: "anything else than VIM" though :-D
<FullMetalStacker> given that I am searching for a GUI IDE, my best shot so far is KATE. but it falls far behind the good user experience i had with Sublime, back then when I was forced to use non-FLOSS software for a while
<caleb> "anything else than VIM" you might be in the wrong place lol
<FullMetalStacker> @caleb I was afraid of that :-D
grokify has joined #ruby
<FullMetalStacker> My very first contact to linux back in '98 was to get trapped in vim and not finding out, forcing me to reboot the production server, i guess this trauma prevents me from getting anywhere near VIM again still today, 1000 years later
grokify has quit [Remote host closed the connection]
<FullMetalStacker> i guess you guys are using VIM since an eternity and thus are super productive with it. i am wondering what your take is on this: would you really advice a noob in 2022 to go for VIM and through all the pain of learning it? does this investment still pay off in 2022?
<FullMetalStacker> ohhh! **-) https://github.com/vhakulinen/gnvim
FullMetalStacker has quit [Remote host closed the connection]
jetchisel has quit [Ping timeout: 260 seconds]
jetchisel has joined #ruby
FullMetalStacker has joined #ruby
<caleb> I honestly truly believe this. VIM was around before I was born, and it will be here in some form long after I'm dead.
<caleb> I can count on one hand the number of tools in computing that I believe that will be true for.
alexherbo2 has left #ruby [#ruby]
<caleb> but if you join the Ruby Discord I'm sure everyone will tell you to use VSCode
grokify has joined #ruby
<adam12> The only downside of learning Vim imho, is it's super challenging to unlearn it. If I end up in nano/other, I get random :w's saved in files sometimes :)
grokify has quit [Ping timeout: 252 seconds]
<caleb> oh man isn't that the truth
<caleb> I really love Nova https://nova.app/
<caleb> but goodness, I'm so entrenched in muscle memory that when I bump up against the corners of a VIM mode it almost counts as physical pain
<ox1eef_> The only downside to learning vim is missing out on emacs !
<caleb> heh, I didn't say it but emacs and evil mode is the best possible VIM
<caleb> and I would be using it if I could stand using elisp to configure things
<ox1eef_> I disabled that :) I am using 'doom emacs' - it does a good job at being emacs with the expectations we have from modern editors like vs code.
<ox1eef_> I also use 'mg' a fair bit. It is a stripped down emacs that can be used in the console, not that different to 'vi'.
<ox1eef_> And to be honest, vs code is still superior for things like React / JSX. I haven't found an optimal emacs setup for that yet. It works, but it is quirky.
Michaela has quit [Ping timeout: 255 seconds]
Michaela has joined #ruby
stirl has joined #ruby
D_A_N_ has left #ruby [#ruby]
tiziodcaio has quit [Quit: Bridge terminating on SIGTERM]
sixecho has quit [Quit: Bridge terminating on SIGTERM]
wuming2[m] has quit [Quit: Bridge terminating on SIGTERM]
Alhamdulillah[m] has quit [Quit: Bridge terminating on SIGTERM]
jhass[m] has quit [Quit: Bridge terminating on SIGTERM]
M1ll173r47[m] has quit [Quit: Bridge terminating on SIGTERM]
andrea[m]12 has quit [Quit: Bridge terminating on SIGTERM]
jhass[m] has joined #ruby
walez has joined #ruby
sixecho has joined #ruby
M1ll173r47[m] has joined #ruby
andrea[m] has joined #ruby
tiziodcaio has joined #ruby
wuming2[m] has joined #ruby
Alhamdulillah[m] has joined #ruby
caedmon has joined #ruby
finsternis has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
finsternis has joined #ruby
gonix has joined #ruby
<FullMetalStacker> @caleb: Although I dont doubt that VSCode is the best IDE out there I cannot use it out of ideological reasons.
<FullMetalStacker> I will never forget ballmer calling open source a cancer and i will never forget that M$ strategy is to embrace and strangle
<FullMetalStacker> that is what they are doing with github, vscode, etc.
<adam12> Your options are likely limited. RubyMine is pretty good as far as Ruby specific IDE's go and not being Microsoft, but it's definitely not FOSS.
walez has quit [Quit: Leaving]
<FullMetalStacker> yes, rubymine looks nice, but as you said: proprietary.
<FullMetalStacker> and the company already had security issues in the past AFAIK
caedmon has quit [Quit: caedmon]
gonix has quit [Ping timeout: 246 seconds]
grokify has joined #ruby
caedmon has joined #ruby
grokify has quit [Remote host closed the connection]
TomyWork has quit [Quit: Leaving]
soknte5 has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
grokify has joined #ruby
___nick___ has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
soknte5 has quit [Ping timeout: 252 seconds]
some14u has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 252 seconds]
_ht has joined #ruby
Linux_Kerio has quit [Ping timeout: 265 seconds]
ur5us has joined #ruby
mweckbecker has quit [Quit: leaving]
Sophira has quit [Ping timeout: 252 seconds]
Sophira has joined #ruby
cryptkeeper has quit [Quit: Connection closed for inactivity]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 252 seconds]
some14u has joined #ruby
caedmon has quit [Ping timeout: 246 seconds]
Jonopoly has joined #ruby
m_antis has quit [Quit: ZNC - https://znc.in]
m_antis has joined #ruby
walez has joined #ruby
walez has quit [Client Quit]
CrazyEddy has joined #ruby
___nick___ has quit [Ping timeout: 252 seconds]
_ht has quit [Quit: _ht]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
desnudopenguino has quit [Ping timeout: 256 seconds]
some14u has joined #ruby
FullMetalStacker has quit [Remote host closed the connection]
desnudopenguino has joined #ruby
cryptkeeper has joined #ruby
stirl has quit [Read error: Connection reset by peer]
stirl has joined #ruby
Al2O3 has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #ruby
Michaela has quit [Ping timeout: 255 seconds]
Michaela has joined #ruby
<gr33n7007h> AOC in 6 hrs whoop whoop xD
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
stirl has quit [Ping timeout: 268 seconds]
moldorcoder7 has quit [Ping timeout: 265 seconds]
<adam12> gr33n7007h: Yeah :) I have some vacation time so I might actually make it past day 5 or so :P
otisolsen70 has quit [Quit: Leaving]
Jonopoly has quit [Quit: WeeChat 3.0]
cartdrige has quit [Ping timeout: 260 seconds]
<gr33n7007h> adam12: haha nice :) going to try the first few in a different language this time round, in addition to ruby xD
stirl has joined #ruby
stirl has quit [Remote host closed the connection]
stirl has joined #ruby
<leftylink> excited
<leftylink> I'm committed to doing every day in both ruby and haskell. we'll see about other languages
<leftylink> maybe rust if I want to push performance
<leftylink> but tehre was no 2021 problem I made a rust port for
<gr33n7007h> leftylink: nice :) i find it strange why i didn't even attempt any in 2019 & 2020.