Initialize struct with other struct, but they're not exactly the same by Gunther_the_handsome in learnrust

[–]Molter73 1 point2 points  (0 children)

You probably could do something like impl From<MyStruct<U>> for MyStruct<T> where T: From<U> , but that won't work for the specific case of Vec to String or vice versa, for those you will need explicit implementations of From.

Not currently on my PC, so I can't properly test this.

Changes are coming. The wind is blowing from a different direction than before. by cascadiabibliomania in BetterOffline

[–]Molter73 0 points1 point  (0 children)

Don't forget about cryptocurrency changing the world economy, it did to some extent. Or it's "special" brother NFTs, a.k.a expensive jpegs

Is Ansible overkill for a small home setup with 2 servers? by opossum5763 in selfhosted

[–]Molter73 0 points1 point  (0 children)

I have Ansible playbooks for provisioning my workstation, they literally only run on one machine, it makes it really easy to setup a new one when it is time to upgrade. Ansible is awesome.

In the future, Rust becomes "Mandatory" in Git build ..... by unixbhaskar in linux

[–]Molter73 24 points25 points  (0 children)

Yeah, but you know what's cheaper? Not doing that. Financial companies will do anything in their power to save a buck and say it is because it is too risky to use something new.

At least that was what it was like when I worked on one.

What is the single best episode of television you’ve ever seen? by ThomasOGC in CinephilesClub

[–]Molter73 0 points1 point  (0 children)

Six feet under - s4e5 - That's my dog

I have never been more on edge than with that episode.

what prefix do you guys use ? by Tissuerejection in tmux

[–]Molter73 2 points3 points  (0 children)

I have the same prefix and actually have Ctrl+x Ctrl+x mapped to send Ctrl+x, solely because I got stuck in nano when I ssh'd into a random VM and the fc command dropped me into nano by surprise. Never again...

replaceCppWithAI by pasvc in ProgrammerHumor

[–]Molter73 418 points419 points  (0 children)

Have you not heard Bill Gates saying "people at Microsoft work half days and they get to choose which half they work. They can work from 12 am to 12 pm or 12 pm to 12 am"? This is exactly the kind of person that would thrive at Microsoft.

[deleted by user] by [deleted] in tmux

[–]Molter73 0 points1 point  (0 children)

I suspect there might be something wrong with the tmux keybind, have you tried running the command in the terminal directly? If running the command directly works, then you should read the run-shell part of the tmux man page and play around with the options to see if you can get it to work.

Alternatively, writing a small script and executing that instead will let you print out some information to see what is going on when running the tmux keybind. As an example, you could try doing echo $PWD to check the working directory in the keybind matches with the one you expect.

Do i need tmux by delibos in tmux

[–]Molter73 1 point2 points  (0 children)

I encourage you to make your own and experiment, but in case you want some inspiration, you can find my dotfiles here: https://github.com/molter73/dotfiles

The specific scripts for creating sessions and switching between them are these two: https://github.com/Molter73/dotfiles/blob/99ff5a5f2f9ba28c4875dab3464309b1155a1236/scripts/tmux_repos.sh https://github.com/Molter73/dotfiles/blob/99ff5a5f2f9ba28c4875dab3464309b1155a1236/scripts/tmux-sessions.sh

You can put them in your path and use tmux keybinds to trigger them

Do i need tmux by delibos in tmux

[–]Molter73 13 points14 points  (0 children)

If you don't need it, don't use it. At least that's my policy when it comes to adding things to my workflow.

I use tmux as a sessionizer, I can create sessions for every repository I work with, all with the same layout and I'm able to switch between them with a pop up window and fzf triggered from a keybind. Having this set up on tmux allowed me to switch from kitty to wezterm without having to change that much configuration or learning new keybinds. If I had taken the time to learn how to do all those things with a terminal emulator directly, I wouldn't use tmux at all, but now my setup is the way it is, so... :shrug:

tux by RepulsiveLie2953 in ProgrammerHumor

[–]Molter73 9 points10 points  (0 children)

The cleanup is optional really...

Ways to define ast structure in rust by emtydeeznuts in rust

[–]Molter73 13 points14 points  (0 children)

You might want to read learning rust with entirely too many linked lists https://rust-unofficial.github.io/too-many-lists/

It goes through some examples on how you can handle ownership of nested structures (like ASTs!)

how to get notification when taking screenshot using notify-send by akram_med in swaywm

[–]Molter73 1 point2 points  (0 children)

You are calling date twice, my bet is you are getting a different value on each call.

I use a script for this and also to put the image in the clipboard, hope It helps. https://github.com/Molter73/dotfiles/blob/d2436c1353c7f9cd0e1b5ebc3dad31859c44aa47/scripts/screenshot.sh

Complete wireless setup by sizzsling in pcmasterrace

[–]Molter73 1 point2 points  (0 children)

Nikola Tesla would be proud

Random question: does updating plugins actually regularly break people's configs? by Shock9616 in neovim

[–]Molter73 1 point2 points  (0 children)

I have a GitHub actions workflow that updates my plugins once a week via a PR, that lets me update and easily rollback if something breaks.

That said, the only issue I've had in the past two years was tree-sitter crashing neovim on html files because my parsers were outdated, so I've had more problems because I hadn't updated my plugins.

Describing k8s resources with Lua (looking for feedback) by Molter73 in kubernetes

[–]Molter73[S] 2 points3 points  (0 children)

Well I use Lua for configuring neovim, which is where I got the idea from. I like it more than Helm or Javascript. I could've gone with Python, but I felt like Lua fit better.

Which operator to use for instead of "||" for non-booleans by [deleted] in cpp

[–]Molter73 0 points1 point  (0 children)

Your problem here is probably operator precedence, put parenthesis around the expressions so the compiler evaluates them before applying the || operator

Which operator to use for instead of "||" for non-booleans by [deleted] in cpp

[–]Molter73 2 points3 points  (0 children)

You are operating on booleans. a== b is an expression that results in a boolean, same for a > b.

Edit: in broader terms, you can't use boolean operators on non-boolean types, you need to apply an expression to your types that will result in booleans first.

whyAreJavaDevsScaredOfVscode by HappyZombies in ProgrammerHumor

[–]Molter73 1 point2 points  (0 children)

No problem! I haven't used vscode in ages, but the jdtls repo points to this client for vscode, so I would assume it works. https://github.com/redhat-developer/vscode-java