221 results for "":
Experiments in happiness
If you’re a regular, you might’ve noticed the place has changed around a little. Thing is, I’ve been spending time playing around with a radical new concept: happiness.
The year and a few months that I’ve spent working for a start-up were actually a pretty gloomy time for me, both for professional and personal reasons. It took me a while to get out of this hole and start thinking positive again.
Pin and suffering
Disclaimer:
async fn in trait has shipped in Rust 1.75, about 2.5 years after
this article was written.
I’d like to think that my understanding of “async Rust” has increased over the past year or so. I’m 100% onboard with the basic principle: I would like to handle thousands of concurrent tasks using a handful of threads. That sounds great!
A static poppler build: the easy way
Things that can go wrong when downloading
When I get a little bit too emotional about my current baby, the itch.io app, there’s always a timely support ticket reminding me that it is currently, still a glorified game downloader.
However true that is, that doesn’t mean it’s easy! In the past year, I’ve had to account for a bunch of failure conditions that can happen, some of which I didn’t realize were even possible. Let’s review them, for fun!
Open sourcing the home CMS
Next power of two
While looking to write a pure ooc version of ftgl, I was reading the source of ftgl-gl3 and I stumbled upon this piece of code:
static inline GLuint NextPowerOf2 (GLuint in )
{
in -= 1 ;
in |= in >> 16 ;
in |= in >> 8 ;
in |= in >> 4 ;
in |= in >> 2 ;
in |= in >> 1 ;
return in + 1 ;
}
This is needed because dealing with power-of-two textures (32x32, 64x64, 128x128, etc.) is more efficient with OpenGL (some implementations don’t even support non-power-of-two textures!).
FFI-safe types in Rust, newtypes and MaybeUninit
oocdoc, Part 1 — NaturalDocs
Documentation in ooc land has sucked for quite some time. The standard response is pretty much: “use the code, Luke!” — which is fine when doing small projects that don’t matter much, but not so when you want to get serious.
So when a newcomer, beoran, asked how to generate documentation, and later told us he got NaturalDocs to work, naturally, I had to see for myself how well it worked.
Day 14 (Advent of Code 2022)
I like how the day 14 puzzle sounds, because I think it’ll give me an opportunity to show off yet another way to have Rust embedded in a web page.
But first…
Let me guess: parsing?
You bet your furry ass, parsing.
Parsing
The input looks something like this:
498,4 -> 498,6 -> 496,6
503,4 -> 502,4 -> 502,9 -> 494,9
And each line is essentially… a polyline: we’re supposed to draw lines between every point on the path, and that determines rocks on the map.
Running an executable without exec
In part 1, we’ve looked at three executables:
sample, an assembly program that prints “hi there” using thewritesystem call.entry_point, a C program that prints the address ofmainusingprintf- The
/bin/trueexecutable, probably also a C program (because it’s part of GNU coreutils), and which just exits with code 0.
We noticed that when running entry_point through GDB, it always printed the
same address. But when we ran it directly, it printed a different address on
every run.