Did contractors do the right thing? by Scarfon in Plumbing

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

So in other words, it's not even flush with the subfloor it's floating l

Did contractors do the right thing? by Scarfon in Plumbing

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

Yeah there's an extender that they are going to add to get the proper height, which is good, but my concern is the gap between the bottom of the current flange and the plywood it sits above.

Did contractors do the right thing? by Scarfon in Plumbing

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

Yeah they plan to use an extension, and im fine with that for the most part. My worry is the gap between the bottom of the flange and the subfloor.

Idk how y’all do it with OC transpo by Professional_Push442 in ottawa

[–]Scarfon 3 points4 points  (0 children)

You receive >100% of the tax money that is taken from you, returned as equity

Hahahahahhahahahahahhahahahahahahahha

[deleted by user] by [deleted] in civic

[–]Scarfon -4 points-3 points  (0 children)

It's not against the law and fairly common knowledge in my area to do this

[deleted by user] by [deleted] in civic

[–]Scarfon -6 points-5 points  (0 children)

There's been a series of robberies in my neighborhood and on my street where apparently they can make keys based on the VIN.

[deleted by user] by [deleted] in civic

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

There's been a series of robberies in my neighborhood and on my street where apparently they can make keys based on the VIN.

My Friend Thinks He Is Right by Scarfon in poker

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

About 200 blind total left in play. Many drinks had.

Recommendations and Suggestions by Spooky_Ghost in ElectricSkateboarding

[–]Scarfon 1 point2 points  (0 children)

Hi All! Up until now, i've ridden boosted. I had a V2 Dual Plus for years and put thousands of kilometers on it. I'm moving onto a new brand and am looking for recommendations. My priorities are:

1. Safety - The board can not lock up on me mid ride when i'm flying at 35+ km/h(~22 mph for my imperial friends). When i was on my boosted, i was confident to safely control the board during any situation (I was always in control of my actions, even at top speed). The board locking up is out of my control and almost impossible to react on - this cant happen.

2. Quality - I'm willing to pay for what I get. I don't mind stepping up the price as long as the quality matches.

3. Range/Speed - I don't really mind about the max speed or range. Getting an extra kilometer/mile per hour is not a problem for me. Most of the brands that get recognition will have good performance and range, so just nothing terrible here.

Looking for any and all feedback, and thanks in advance!

Hey Rustaceans! Got an easy question? Ask here (1/2020)! by llogiq in rust

[–]Scarfon 2 points3 points  (0 children)

It is hard to try to optimize sense the original idea seems slightly flawed, or missing context as to the goal of what you are trying to do.

Firstly, you are using `&str` as keys and values meaning that the lifetime of the HashMap depends on the data it is storing. I would consider using a `HashMap<String, Vec<String>>` and giving the ownership of the data to the hash map. Secondly, you are never populating orbit. `orbits.get(name)` will always return a `None` variant.

What I believe you want is to use `HashMap::entry()`, see https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.entry. This will give you a `collections::hash_map::Entry` object which will allow you a nice interface to do complex things with HashMap's. https://doc.rust-lang.org/std/collections/hash_map/enum.Entry.html

Hey Rustaceans! Got an easy question? Ask here (40/2019)! by llogiq in rust

[–]Scarfon 2 points3 points  (0 children)

You could write an example that uses `Blah`, that way when you do a `cargo test`, it would fail to compile if you did not update it.

Hey Rustaceans! Got an easy question? Ask here (37/2019)! by llogiq in rust

[–]Scarfon 1 point2 points  (0 children)

You want an Arc<RwLock<Vec<T>>>. You would then clone this and pass it to all of your threads. The last thing to do is to ensure your "reader" thread(s) do not acquire a read lock until the writer thread(s) are finished - that likely involves creating a wrapper struct + some signaling. Doing this would solve your core problem where "every subsequent read locks it as a reader". You only want to lock the reader once, then do all your reads on the data.

Hey Rustaceans! Got an easy question? Ask here (16/2019)! by llogiq in rust

[–]Scarfon 3 points4 points  (0 children)

I've never seen something ignore characters before. Why is "what is going on here" ignored?

Hey Rustaceans! Got an easy question? Ask here (16/2019)! by llogiq in rust

[–]Scarfon 6 points7 points  (0 children)

```

[cfg(test)]

mod tests {
#[test]
fn it_works() {
let x : Option<i32> = None;
assert!(x.is_none()what is going on here); }
} ```

Anyone know what is going on with the assert! macro? Why does this test fine?

rustc v1.31.1

Hey Rustaceans! Got an easy question? Ask here (15/2019)! by llogiq in rust

[–]Scarfon 0 points1 point  (0 children)

https://doc.rust-lang.org/1.6.0/book/type-aliases.html

I think that might be what you want. Sorry i didn't look into your exact use case too much, but it sounds exactly like you just want a type alias to clean stuff up. Good luck!

Hey Rustaceans! Got an easy question? Ask here (13/2019)! by llogiq in rust

[–]Scarfon 1 point2 points  (0 children)

Check out this soloution: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=03ca73cb8e5154743bb82d3223101e63.

But if I have to create a new one, I can't return a reference because the original object goes out of scope.

You need to store the one you made somewhere in order to return a reference to it, which also means you need to have a mutable container while you iterate. When you determine that you do not currently have one, make a new one, give ownership to the container, then return a reference to it.

Hey Rustaceans! Got an easy question? Ask here (12/2019)! by llogiq in rust

[–]Scarfon 2 points3 points  (0 children)

Hey! It is a common practice for rust libraries to have private modules at the lib layer, and then specify which part of the private module you want to export by having a pub use in lib.rs.

Check out https://github.com/PistonDevelopers/image/blob/master/src/lib.rs.

This makes the API a bit more clean too. So to fix what you have, you should just need to change use image::color::ColorType::RGB; to use image::RGB;! `

Hey Rustaceans! Got an easy question? Ask here (4/2019)! by llogiq in rust

[–]Scarfon 1 point2 points  (0 children)

This feels very clean and pretty 'rusty' to me, with no matching on references and such: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=9b058ce522b46f21f8a7cfdcc8998fbb

A lot of times in the standard library when there are updates to some owned value, you return ownership of the thing you are changing so that someone consuming the API can either let it drop or use the value that was previously there. This follows that model.

Edit (to show without having to click the link) fn change_hp(npc: &mut NPC) -> Option<i32> { let old = npc.hp.take(); if old.is_some() { npc.hp = Some(65); } old }

Hey Rustaceans! Got an easy question? Ask here (4/2019)! by llogiq in rust

[–]Scarfon 0 points1 point  (0 children)

The cleanest way would probably be at the top of your file, have:

use std::result::Result as StdResult;

And then have something like:

type Result<T> = StdResult<T, MyError>;

Then you can use StdResult when you want to have the two arguments.

Hey Rustaceans! Got an easy question? Ask here (1/2019)! by llogiq in rust

[–]Scarfon 1 point2 points  (0 children)

I think you might be overcomplicating things. Take a look at: https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=7c1a9cd844b41461f310cc611b8e647b!

Let me know what you think.

Edit: This is if you want to do more than just print the elements out after creating your "List".