Ogeon

joined 1 year ago
[–] Ogeon@programming.dev 2 points 10 months ago

Förutom att välja de som verkar mest intressanta (finska vinterkriget är en bra klassiker) skulle jag också säga att man kan börja med de senaste och gå bakåt. De har en del repriser med bättre ljudkvalitet som man lätt missar annars. Enstaka serier är de enda man kan behöva se till att man börjar i rätt ände av, men de är tydligt numrerade eller ihopklippta.

[–] Ogeon@programming.dev 48 points 1 year ago (1 children)

It's useful for keeping track of your mental gymnastics.

[–] Ogeon@programming.dev 8 points 1 year ago

I don't know, something about seeing the same diarrhea pills ad over and over doesn't exactly spark joy for me.

[–] Ogeon@programming.dev 2 points 1 year ago* (last edited 1 year ago) (1 children)

It may be possible to use the Any trait to "launder" the value by first casting it to &Any and then downcasting it to the generic type.

let any_value = match tmp_value {
    serde_json::Value::Number(x) => x as &Any,
    // ...
};

let maybe_value = any_value.downcast_ref::< T >();

I haven't tested it, so I may have missed something.

Edit: to be clear, this will not actually let you return multiple types, but let the caller decide which type to expect. I assumed this was your goal.

[–] Ogeon@programming.dev 11 points 1 year ago

My shower has its own favorite temperature and will slowly readjust itself to it.

[–] Ogeon@programming.dev 5 points 1 year ago

I considered the smaller one at first, but decided to take the larger one and use the compression straps to keep it tight when packing a smaller volume. It doesn't feel as bulky as I thought it would at first.

[–] Ogeon@programming.dev 19 points 1 year ago (2 children)

Got myself a proper hiking backpack. An Osprey Exos 58L. Shifting much of the weight to the hips makes a massive difference and my back was very happy!

[–] Ogeon@programming.dev 3 points 1 year ago

Also the Swedish classic "glida in på en räkmacka" ((to) slide in on a shrimp sandwich), which basically means to end up somewhere (location, career, situation) without any difficulties. The shrimp sandwich symbolizes a life without difficulties or in some luxury.

Then there's also "halka in på ett bananskal" ((to) slip in on a banana peel), which is similar to the above, but not always favorable and you don't have any plan or preparation. You just winged it or it just happened by accident.

[–] Ogeon@programming.dev 2 points 1 year ago

Absolutely, I didn't mean to suggest otherwise. :) I'm just giving a bit of context and perspective from someone who has used it for a while.

[–] Ogeon@programming.dev 22 points 1 year ago (2 children)

Static types aside, the file system has a lot of failure cases, which every language is affected by, and Rust makes them very visible. This can indeed feel like a lot, but it's an intentional feature and makes more sense in larger projects. I guess the feeling may get amplified by the author's style of long form posts with a lot of details.

Error handling in practice contains a lot of "let the caller deal with it", using the ? operator to pass errors up the call stack. The more verbose options are for when you need to actually handle it.

[–] Ogeon@programming.dev 3 points 1 year ago

They interviewed multiple eye witnesses.

[–] Ogeon@programming.dev 6 points 1 year ago (4 children)

To make things worse, that teapot doesn't have a bottom surface.

view more: ‹ prev next ›