Ogeon

joined 11 months ago
[–] Ogeon@programming.dev 11 points 2 weeks ago

That's definitely part of "the deal" with MIT and Apache. The other end of it is that they shouldn't really expect to get anything more than what the authors are willing to give.

[–] Ogeon@programming.dev 12 points 1 month ago

Zooming in? In this economy?!

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

"Search prompt engineer"

[–] Ogeon@programming.dev 13 points 4 months ago (1 children)

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

[–] Ogeon@programming.dev 45 points 8 months ago (1 children)

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

[–] Ogeon@programming.dev 8 points 8 months 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 8 months ago* (last edited 8 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.

[–] Ogeon@programming.dev 15 points 9 months ago

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

[–] Ogeon@programming.dev 0 points 10 months ago

Do you want the background to have looped back to the start after one cycle? If so, you probably have to make it repeat N times more than the foreground, and move by a factor of 1/N in comparison to the foreground. Or put another way, have 1/N times the length. That means that after one cycle, the background has moved a distance of 1/N, but also repeated exactly once.

I hope this makes sense...