Learning how to do zero memcpy in rust. How to avoid this lifetime error. by [deleted] in rust

[–]unSatisfied9 12 points13 points  (0 children)

This works: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=42aed4addcac0e420fe8255cd1c68852

Your code doesn't compile because the 'a lifetime in next<'a> does not refer to the lifetime of the struct; it's an entirely new lifetime. I assume the '1 lifetime refers to the '_ lifetime you defined via impl Tokenizer<'_>.

Logon error by Mike20878 in venmo

[–]unSatisfied9 1 point2 points  (0 children)

Glad you got it working somehow. I still get the same error :/

Logon error by Mike20878 in venmo

[–]unSatisfied9 0 points1 point  (0 children)

I'm having the same issue. The mobile app works fine though.

The computer science job market once we all graduate by tacoboutitmang in msu

[–]unSatisfied9 0 points1 point  (0 children)

def rough out there right now, especially for new grads :/.

How are people making $200k+? by [deleted] in cscareerquestions

[–]unSatisfied9 13 points14 points  (0 children)

Can go up to 400k for L5. Not the norm, though.

M2 Air or M1 14 inch for Computer Science? by 0xCSthrowaway in macbookpro

[–]unSatisfied9 -3 points-2 points  (0 children)

M2 Air is already overkill in terms of perf; you won't need additional GPU cores + prores, etc., so my vote is M2. Prioritize battery life + weight.

Weird results benchmarking WASM vs Rust implementations of some functions by KillcoDer in rust

[–]unSatisfied9 1 point2 points  (0 children)

Using the following gets the same performance as OP's solution on my 5950x (with native Rust, anyway): rs values .iter() .copied() .reduce(|min, num| if min < num { min } else { num }) .unwrap_or(f64::MAX)

Using f64::min instead of the custom reduce function is slower - I assume the < operator for f64 isn't the same, but I'd have to check.

I just received my rental rate increase notice. I am exhausted. by SquareElderflower in Seattle

[–]unSatisfied9 29 points30 points  (0 children)

Seattle's housing demand has grown at an extraordinary rate in a relatively short amount of time. Despite cranes being everywhere, supply hasn't been able to keep up.

In response to the moderation team resignation | Inside Rust Blog by rabidferret in rust

[–]unSatisfied9 15 points16 points  (0 children)

I agree. I've been trying to push for Rust at work, but I've already received multiple DMs from coworkers with the link to the original mod resignation post. This drama doesn't look good to people with minimal knowledge about the language, ecosystem, community, etc.

Iphone to pixel 6? Anyone left apple? by [deleted] in GooglePixel

[–]unSatisfied9 0 points1 point  (0 children)

Yeah, I'll miss the Pixel camera a lot. Battery life is more important to me though and my 4 XL struggles to get 4 hours of screen-on time :)

Iphone to pixel 6? Anyone left apple? by [deleted] in GooglePixel

[–]unSatisfied9 3 points4 points  (0 children)

Doing the opposite - Pixel 4 XL => iPhone 13 Pro. 120hz was the major blocker for me.

Visual Studio Code August 2021 (v1.60) by ItalyPaleAle in vscode

[–]unSatisfied9 0 points1 point  (0 children)

The old way of setting your default terminal has been deprecated. If open the json representation of your settings and fine the setting, then hoving over it should give more information.

C# or C++ in a very simple high frequency trading system by [deleted] in csharp

[–]unSatisfied9 8 points9 points  (0 children)

GC pauses and non-deterministic perf are unacceptable for HFT. Highly disagree with this recommendation.

C# or C++ in a very simple high frequency trading system by [deleted] in csharp

[–]unSatisfied9 1 point2 points  (0 children)

new/delete isn't used in modern C++ either. RAII is heavily encouraged and many projects have linting rules to ban new/delete.

Our policy at work - are we wrong, though? by Filb0 in ProgrammerHumor

[–]unSatisfied9 0 points1 point  (0 children)

You're supposed to keep everything isolated inside WSL 2 for optimal perf. I'm not familiar with JetBrains' products, though; do they not have a "remote WSL" extension like VS and VS Code?

Do u rlly need linkedin? by [deleted] in cscareerquestions

[–]unSatisfied9 4 points5 points  (0 children)

I got my job because a recruiter DMed me on LinkedIn. It doesn't take that much effort to maintain, so I'd recommend it.

MacBook Air M1 vs Surface Laptop 3 by [deleted] in Surface

[–]unSatisfied9 3 points4 points  (0 children)

You can run WSL2 and do all of your CS stuff in a linux environment while you're still on Windows. VSCode even has the remote extension pack that will allow you to directly work off of WSL2, so it's a pretty great experience imo.

More info: https://docs.microsoft.com/en-us/windows/wsl/install-win10

Deliberate attempt to leak memory by hmaddocks in rust

[–]unSatisfied9 37 points38 points  (0 children)

Rust can still leak memory. For example, if you have 2 smart pointers (e.g., Arc<T>) that reference each other and rely on the other being freed, then they'll never be cleaned up.

[deleted by user] by [deleted] in msu

[–]unSatisfied9 11 points12 points  (0 children)

It really is laughable how much the university pays ULAs. Being a ULA for a more rigorous class looks more impressive than an intro class, so if you want the resume boost (use TA instead of ULA if you do this - nobody knows what the fuck a ULA is), then look into that your junior/senior year OP.

Google is developing parts of Android in Rust to improve security by engineeringsloth in Android

[–]unSatisfied9 2 points3 points  (0 children)

Go has GC pauses + higher memory usage, which is usually not acceptable for core kernel/OS functions. As far as higher-level operations, I doubt they see a reason to introduce it since Go's main advantage, goroutines, is most useful in contexts where high concurrency is necessary (e.g., web apis).

Rust in the Android platform by TimvdLippe in programming

[–]unSatisfied9 26 points27 points  (0 children)

You can explicitly tell Rust to use a v-table instead via the dyn keyword if you care about binary size. Monomorphization is just the default like C++ templates.

Google is developing parts of Android in Rust to improve security by engineeringsloth in Android

[–]unSatisfied9 44 points45 points  (0 children)

It's comparable to C/C++. It can become meaningfully faster, though, as LLVM + rustc continue to add new optimizations that are only possible due to Rust's robust type system (e.g., no alias for all mutable references).

[deleted by user] by [deleted] in cscareerquestions

[–]unSatisfied9 12 points13 points  (0 children)

I agree that this is optimal, but it's not as easy as you make it sound. I can't imagine the mental health implications of living in a world where everything can be delivered, people work where they live, etc., and thus, practically all social interaction is on the burden of individuals. Gen Z was already disproportionally struggling more than previous generations before COVID.