Clamping Angles, Especially Without Trigonometry
Sometimes you need to clamp angles, and it’s a bit harder when they’re actually vectors.
Sometimes you need to clamp angles, and it’s a bit harder when they’re actually vectors.
#[non_exhaustive] worked with struct update syntax
It’s pretty annoying that in Rust, #[non_exhaustive] structs don’t support “struct update” / “functional record update” syntax (the syntax that powers Stuff { a: b, c: d, ..blah }).
I’d like a variant of realloc that takes the number of bytes that should be copied, in the case a copy is needed.
There are… several things I find wanting about the current version of the core::alloc::Allocator trait (as of 2023-08-06). I’m going to do a short series where I post about some of the bigger issues, and explore the different tradeoffs and design choices we might make. This post is an introduction to that.
Miri is an evaluator for rust that detects many kinds of undefined behavior. Here are some things it could (possibly) do that would catch bugs I’ve had/seen before.
saturate/clamp01 function
Let’s talk about clamping a float between 0.0 and 1.0.
In an effort to post more, I’m going to start posting shorter (and frankly, lower effort) blog posts known as “Codelets”.
Most major OSes offer some form of futex-like functionality at this point. Some of these are a bit obscure and hard to remember, though, so I thought I’d write some stuff about them down so that I can refer to it or link it later.
Here’s some blocks of yaml you can copy-paste to make github actions work for your Rust project. Go nuts.
If you’ve ever thought “Using a Mutex<[f32; 3]> is pointless, what’s the worst
thing that could happen here?”, I’ve written the Cell type that empowers you
to find out the answer to that question yourself.