wulf

joined 1 year ago
[–] [email protected] 14 points 8 months ago

Call me a socialist, but the moment the tech was proven either the US or some UN based org should have eminent domained and brought Starlink.

That way there wouldn't be multiple companies sending tens of thousands of satellites into space. And hypothetically there would be a greater expectation of equal access. Oh and access wouldn't be at the whim of a pretty billionaire.

[–] [email protected] 5 points 10 months ago

Ha, I did the same thing. Was getting really tired of pip issues and attempting to use pyenv and messing up a lot. Figured I'd start clean.

Didn't realize so much depended on python and ended up needing to rebuild the whole thing.

Now I don't mess with python on my host and only use VMs for Dev or messing around.

[–] [email protected] 1 points 10 months ago

This was my problem, it's enabled by default, so double check that

[–] [email protected] 2 points 10 months ago

SOLUTION:

Here is the solution I came up with:

pub struct Configuration {}

impl Configuration {
    fn get std::str::FromStr>() -> Result {
        Ok(T::from_str("1234");
    }
}

fn main() {
    let my_conf_val = Configuration::get();
}
[–] [email protected] 2 points 11 months ago* (last edited 11 months ago)

Afraid this might have been the case, if Ogeon's suggestion doesn't work out, I'll probably end up with multiple getters, one per type. There aren't that many anyway

Thank you!

[–] [email protected] 2 points 11 months ago

Correct, I would want the caller to know what they're getting, I'll see if this works, Thank you!

16
submitted 11 months ago* (last edited 10 months ago) by [email protected] to c/[email protected]
 

Background: I have a large serde_json value that I want to be read-only (the authoritative source is an encrypted SQLite DB and should only be updated when that gets updated)

The issue, I would like a single get function that returns a generic type

use serde_json;

pub struct Configuration {
    config: serde_json::Value,
}

impl Configuration {
    async fn get(&self, key: &str) -> Result {
        let tmp_value: = &self.config["test"];

        // This would be repeated for String, bool, etc
        if tmp_value.is_i64() {
            match tmp_value.as_i64 {
                Some(x) => Ok(x),
                Err(e) => Err(()),
            }
        } else {
            Err(())
        }
    }
}

However I get: "mismatched types expected type parameter T found type i64"

Is it even possible to return multiple types from a single function?

EDIT: SOLUTION

Here is the solution I came up with:

pub struct Configuration {}

impl Configuration {
    fn get std::str::FromStr>() -> Result {
        Ok(T::from_str("1234");
    }
}

fn main() {
    let my_conf_val = Configuration::get();
}
[–] [email protected] 7 points 11 months ago (3 children)

Yes! It shouldn't be difficult to purchase a house, but when we were looking, none of the seller agents would even talk to us until we had a buyers agent 🙄

[–] [email protected] 15 points 11 months ago (1 children)

Any Ubuntu affiliated distro is required to use snaps, so Kubuntu will use them. Startup times are terrible, but running performance should be the same.

Another simple distro to try would be either Mint or Pop-OS. Both are still Ubuntu based, but without snaps

Mint's interface (Cinnamon) is similar to Windows, Pop-OS uses a modified GNome

[–] [email protected] 8 points 11 months ago (1 children)

I'm not sure of exactly how they manage everything, but my county library system uses Debian with an XFCE interface.

Not sure if it's because it's been this way long enough now, or it just looks close enough to Windows, but I haven't known anyone to complain (and my in-laws complain about everything else)

[–] [email protected] 1 points 1 year ago (1 children)

Using gnome now, but have always enjoyed Xfce. Was going to use it for my current setup, but at the time it didn't support Wayland. It looks like it's getting close, but not quite there yet.

Maybe once Wayland is fully supported I'll give it a shot again.

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

Yep, I'm 36, mid Atlantic US, started driving stick when I was 18. I inherited this little Geo Metro for college, so it was learn stick or no car. (I really liked that car dispite it not having air conditioning, no tachometer, and manual everything)

Next car I bought was a manual. Now since my spouse can't drive stick we only have automatics.

Whenever we need a new car it'll be electric, which unfortunately (by design) are not manuals. So no more stick for me.

view more: next ›