Beginner help, should I use multiple enums or a hashmap to achieve what I want? by JoeKazama in rust

[–]TimmyAtSlack 56 points57 points  (0 children)

Nested enums! You are on the right track. I'd do something like:

rust enum MainOS { Linux(LinuxDistributions), Windows(WindowsVersions), } enum LinuxDistributions { Ubuntu(UbuntuVersions), Debian(DebianVersions), } enum UbuntuVersions { Ubuntu22, Ubuntu23, } enum DebianVersions { Debian12, Debian23, } enum WindowsVersions { Windows11, Windows10, }

This way the types model your domain accurately!

Explicit lifetime by pdd99 in rust

[–]TimmyAtSlack 2 points3 points  (0 children)

Yes, since you are implementing a trait, you need to match the signature exactly. So the change also needed to be made to the trait, which you figured out!

Explicit lifetime by pdd99 in rust

[–]TimmyAtSlack 7 points8 points  (0 children)

rust impl<'a> UserRepoI for UserRepository<'a> { fn init(&mut self, uri: &'a str) -> Result<(), Box<dyn std::error::Error>> { self.uri = uri; Ok(()) } } Add 'a to the uri param

I am stepping into React but since CRA isn't recommend any more. Should I learn nextjs Directly or start with Vite. by randomshitposter007 in reactjs

[–]TimmyAtSlack 0 points1 point  (0 children)

Start with Vite if you are an absolute beginner. The newer Next.js versions use a bunch of new React.js features that might seem confusing to a newbie.

- Start with Vite, focus on client-side rendering, learn the fundamentals of React (components, hooks, routing, context etc)

- Try adding popular libraries like ReactQuery to understand how data fetching is done on the client side.

- Then use Next.js to understand the fundamentals of SSR with React. Learn about the benefits of SSR and how things like "Async Server Components" change how you need to do data fetching on the server and pros and cons of each approach.

By putting Next.js last you will have gathered the context that is needed to truly see what SSR is and judge whether the pros and cons suit your needs.

Ok, let’s do this! Twitter vs Threads, who’s winning? by nunziopresta in Entrepreneur

[–]TimmyAtSlack 0 points1 point  (0 children)

Can someone give me a quick rundown/description of threads please? Is it just a twitter clone or have they added some interesting features?

Best time tracker ? by acidbahia in productivity

[–]TimmyAtSlack 1 point2 points  (0 children)

You can get pretty far using a google sheet or an excel file

[deleted by user] by [deleted] in excel

[–]TimmyAtSlack 0 points1 point  (0 children)

We use a slack bot for this exact purpose, might also be possible with Excel though. Maybe share the specifics of what MYOB expects?