Ogeon

joined 1 year ago
[–] Ogeon@programming.dev 13 points 1 week ago

A relatively cheap PC with Factorio and you are set. You won't spend much on food either, so win-win.

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

Reject C, return to assembly. Structured programming is the true oppression our generation never talks about.

[–] Ogeon@programming.dev 5 points 3 months ago (1 children)

That's silly. Luckily, I don't think this was the same situation. This was at a university and they had classes with other languages. The beginner classes were split into two variants, where some students (mostly CS students) learned C, and other students (economy, etc.) learned Python. I suppose they figured it was more useful to them or something.

[–] Ogeon@programming.dev 19 points 3 months ago (4 children)

I was a teacher's assistant in beginner's programming at university for a bit. I expected them to learn C, which I knew enough of, but I got assigned to a group that learned Python instead. I had never used Python at the time. I ended up having to speed learn it while trying to teach it, to not be completely useless.

[–] Ogeon@programming.dev 11 points 4 months 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 2 points 6 months ago

"Search prompt engineer"

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

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

[–] 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 15 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 20 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!

view more: next ›