Ogeon

joined 1 year ago
[–] [email protected] 16 points 5 months ago

A "mantra" more programmers should have is to fix the cause of the issue, and not just the symptoms. You have to understand what the problem is to be able to fix it.

[–] [email protected] 32 points 5 months ago* (last edited 5 months ago)

Ah, taking inspiration from late 1940's literature, I see. Smart!

[–] [email protected] 13 points 6 months ago (1 children)

Simple features are often complex to make, and complex features are often way too simple to make.

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

I assumed the handles are for chairs that are overly heavy and hard to grip.

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

That's nice to hear! And the Ok* color spaces are indeed quite neat

[–] [email protected] 6 points 7 months ago (1 children)

ICC profiles are definitely part of the field, but that's sort of a topic of its own. At least in terms of scope. The color space rabbit hole is so deep that I never got as far as including them. There are other crates that go into those parts and it should be easy to bridge between them and Palette.

I would say Palette is more for the "business logic" of working with colors, so converting, manipulating and analyzing. The difference from ICC profiles when converting with Palette is that you need to know more about the source and destination color spaces during compile time. ICC profiles use more runtime information.

Palette could be used for applications like image manipulation programs, 3D rendering, generative art, UI color theme generation, computer vision, and a lot more. A lot of people also use it for smaller tasks like converting HSL input to RGB output or making gradients.

[–] [email protected] 48 points 10 months ago (1 children)

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

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

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

[–] [email protected] 2 points 11 months ago* (last edited 11 months 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.

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

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

[–] [email protected] 5 points 11 months 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.

[–] [email protected] 20 points 11 months 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!

view more: ‹ prev next ›