wulf

joined 2 years ago
[–] wulf@lemmy.world 4 points 3 days ago

Miniflux for me as well, I find the progressive web app for mobile has the best color scheme for my eyes

[–] wulf@lemmy.world 4 points 2 months ago

Personally I use mailbox.org, it's not free, but you are not the product

[–] wulf@lemmy.world 6 points 6 months ago

Invidious is awesome, if possible, self hosting one in docker is great and keeps it up to date

[–] wulf@lemmy.world 14 points 1 year ago (2 children)

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.

[–] wulf@lemmy.world 2 points 1 year 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();
}
[–] wulf@lemmy.world 2 points 1 year ago

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

17
submitted 1 year ago* (last edited 1 year ago) by wulf@lemmy.world to c/programming@programming.dev
 

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();
}
[–] wulf@lemmy.world 7 points 1 year 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 🙄

[–] wulf@lemmy.world 1 points 2 years ago

Those Sony ones look perfect, thank you!

Do you know if the Bose are significantly better and worth waiting for a sale?

6
Purchase Advice (lemmy.world)
submitted 2 years ago* (last edited 2 years ago) by wulf@lemmy.world to c/headphones@lemmy.film
 

Looking to get new headphones since the battery is now shot in my Corsair

I'm looking for:

  • Mostly listening to music, some online meetings, some single player games (I am not an audio file)
  • Bluetooth that can save multiple devices
  • Over ear
  • Noise cancelling (preferably adjustable, but not necessary)
  • Microphone (preferred but not necessary)
  • Under 300 (preferably under 200)

Whenever I search online the lists are always "here is the best for 500 - 1000, or really affordable, but with no features"

Thank you in advanced!

 

So for our kids, who are still quite young, instead of opening an entire other savings account for them, we decided to do "virtual" savings accounts.

Essentially, we have a spreadsheet with what money they have gotten from birthdays and other events, then we just deposit it in our savings. They can withdraw whenever they want.

In this spreadsheet, I've been trying to keep track of interest (in a basic way), to show how saving can also help them "earn" money. However, I don't think I'm doing it correctly.

See Google sheet: dates are not correct and interest rates are not accurate. I just wanted to show that we are attempting to give the "correct" interest rate for the given date. (I know interest rates fluctuate all the time, just trying to not make it not too difficult to maintain)

https://docs.google.com/spreadsheets/d/1rwwIFVOGYt-lIx8Dtuv_6PGz28jSNQbH7LcZG2qKlfg/edit?usp=sharing

Thank you for taking a look, I've been trying to get this right for a while.