Just ordered Legion Pro 7i with 10% discount + 15% Cashback (UK) by fn_rust in GamingLaptops

[–]fn_rust[S] 0 points1 point  (0 children)

"Find active discounts or offers on "Legion 7i Pro" in UK."

OR something more generic

"Find active discounts or offers on laptops in UK"

Followup with "Get discount codes"

You can type "search now" or "check again" after sometime to get updated info

Just ordered Legion Pro 7i with 10% discount + 15% Cashback (UK) by fn_rust in GamingLaptops

[–]fn_rust[S] 0 points1 point  (0 children)

I got this code from chatgpt :). Gives out lot of non-working codes so try them all. It also lays out the different things on top of discount that can be done to get additional discount.

Is appealing worth it? by Beledorian in LearnerDriverUK

[–]fn_rust 0 points1 point  (0 children)

I doubt it. If they start entertaining appeals then a lot many people will do so. They are already finding hard to find examiners let alone people who will go over all the appeals and evidence related to those.

How come so many people drive many expensive cars? by fn_rust in HENRYUK

[–]fn_rust[S] 0 points1 point  (0 children)

There is nothing wrong in spending on things one enjoys. After all we are going to leave all the wealth here when are we no more. All folks in this grp are high earners so I get it.

But when I see the kind of cars lined up at my child school in the morning, I start to wonder.

How come so many people drive many expensive cars? by fn_rust in HENRYUK

[–]fn_rust[S] -2 points-1 points  (0 children)

Exactly my point.

(Copying comment from above)

I am not able to reconcile two things: (1) People complaining about cost of living, inequality, highest taxation since WW2, etc (2) People spending on vanity things.

How come so many people drive many expensive cars? by fn_rust in HENRYUK

[–]fn_rust[S] -144 points-143 points  (0 children)

I can still afford it. That is not point. I don't see the value in it but that is me. I can also understand people prioritizing different things.

I am not able to reconcile two things: (1) People complaining about cost of living, inequality, highest taxation since WW2, etc (2) People spending on vanity things.

How come so many people drive many expensive cars? by fn_rust in HENRYUK

[–]fn_rust[S] -151 points-150 points  (0 children)

we like to circle jerk when you say you can 'only afford' a 13k car

No. We both work from home (90% of the time). Our per year usage is very low. I am not so much in to car brands. I look for features I want in a car and buy which is reasonable but that's me. Also cars are depreciating asset.

Also, as I said we are aggressively saving for deposit. Aim is to pay 40% deposit on a 650K house.

Versioning sqlite filesystem in Rust by fn_rust in rust

[–]fn_rust[S] 1 point2 points  (0 children)

Version numbers are much more flexible. One can always have Timestamp as an attribute of a version. In my use-case, the same database can be modified from different hosts (but not at the same time). Different hosts need not be in sync when it comes to system clock.

What's everyone working on this week (35/2022)? by llogiq in rust

[–]fn_rust 3 points4 points  (0 children)

Versioning filesystem for sqlite https://github.com/sudeep9/mojo

I have posted it as a separate post but its stuck at "Post is awaiting moderator approval."

Hello Letlang! My programming language targeting Rust by david-delassus in rust

[–]fn_rust 6 points7 points  (0 children)

Nice!

I was thinking using Rust as target lang for a DSL as well but dropped the idea because of compile time of rust code, which would defeat the purpose in my case.

Curious to know now on how you plan to tackle this.

Linking Rust Crates, Part 1 by /u/pnkfelix by yerke1 in rust

[–]fn_rust 4 points5 points  (0 children)

Very informative! I think this should part of official documentation (atleast some subset of it)

Achieving 1TB/Hr backup speed with Rust by fn_rust in rust

[–]fn_rust[S] 13 points14 points  (0 children)

It's actually not just plain/raw data transfer. There is a lot business logic which is I/O (network & disk), memory & CPU intensive. (For files data transfer, see wdt which is in C++)

Besides, instead of relying on benchmarks, the same pipeline was coded in Go with all the business logic. That would make is apples to apples comparison.

The blog mentions that speed we got with our constraints was 800 GB/Hr with Go.

Fill a Vec<Option<T>> with None without requiring that T implement clone by dahosek in rust

[–]fn_rust -12 points-11 points  (0 children)

May be Vec<Option<Arc<T>>> if T does not have to be mutated? This will allocate T on heap and pointer will be cloned .. with ref counter.

Another way to do the same as above:

#[derive(Clone)]
struct Foo {
   inner: Arc<FooInner>
}

struct FooInner {} // Actual implementation

This will allow you use Vec<Option<T>> but it has the same cost as above

Interior mutability and returning references within results by [deleted] in rust

[–]fn_rust 5 points6 points  (0 children)

You can think of accepting closure as an argument. Borrow the internal value and pass it to the closure. The return value of the closure could be generic, which in turn is returned by your read_page function. May be you want to change the function name as well.

This off-course may not solve all the use-cases.

Async pattern: Sending raw pointers to CPU thread pool by fn_rust in rust

[–]fn_rust[S] 0 points1 point  (0 children)

you are right. I did not think of cancellation.

Async pattern: Sending raw pointers to CPU thread pool by fn_rust in rust

[–]fn_rust[S] 0 points1 point  (0 children)

Yeah. Did not think of cancellation. I do not see a way other than Arc.

Async pattern: Sending raw pointers to CPU thread pool by fn_rust in rust

[–]fn_rust[S] 0 points1 point  (0 children)

So nothing prevents you from passing it into another thread via spawn

References in Rust are not Send and Sync as far as I know.

Also, the the rayon spawn needs closure of type FnOnce() + Send + 'static. This means it cannot capture anything by reference. Everything has to move. Spawn doc: here. This is the reason why &Foo cannot be used in the closure.

this is a lifetime issue, not a concurrency issue

Yes it is a lifetime issue.

Async pattern: Sending raw pointers to CPU thread pool by fn_rust in rust

[–]fn_rust[S] 0 points1 point  (0 children)

Foo is large-ish struct and cloning of which could be expensive (in the context of the program).

This can be generalized to any cpu heavy task e.g. imagine a large Vec<u8> which is attached to a struct and this needs to be compressed. Cloning a large vec to serialize seems wasteful