212 results for "":

The thumbnail for this page

Day 5 (Advent of Code 2022)

Part 1

The day 5 challenge actually looks fun!

Our input looks like this:

[D] [N] [C] [Z] [M] [P] 1 2 3 move 1 from 2 to 1 move 3 from 1 to 3 move 2 from 2 to 1 move 1 from 1 to 2

Which is a visual representation of stacks, and so, for once, we have some serious parsing to do, and that means I finally have a good reason to bust out the nom crate.

The many rewrites of the itch.io desktop app

I started working on the itch.io desktop app over 4 years ago.

It has arguably been my main project ever since, along with companion projects like butler, capsule and many smaller libraries.

I’m fuzzy on the initial history, but I remember the codebase went through a lot of changes. As early as 2014, the whole codebase was ported from vanilla JavaScript to TypeScript. In 2016, I released a timeline of all the changes. In 2018, I released a postmortem for v25 (which I then deleted).

The thumbnail for this page

Face cams: the missing guide

I try to avoid doing “meta” / “behind the scenes” stuff, because I usually feel like it has to be “earned”. How many YouTube channels are channels about making YouTube videos? Too many.

Regardless, because I’ve had the opportunity to make my own mistakes now for a few years (I started doing the video thing in earnest in 2019), and because I’ve recently made a few leaps in quality-of-life re: shooting and editing video, I thought I’d publish a few notes, if only for reference for my future self.

S-exps in your browser

The front end of the pool

I’ve been interested in reactive JavaScript for a while. At memoways, we strive to build snappy user interfaces for clients who like to interact with their data with as little latency as possible.

In the past two years, I learned front-end development on-the-fly, as the needs of the clients required it. Two years ago, I was still using jQuery. Then, I discovered space-pen thanks to my colleague Nicolas. It was nice to have proper ‘view’ objects, and use jQuery’s event system to have messages propagate throughout a hierarchy.

Things I struggle with

Putting thoughts in bits

I think about lots of things but when it comes down to writing them, drawing them, implementing them, it’s not that easy. Even with years of practice in each of these trades, it’s still an uphill battle.

Which is why I am not going to read that article after I wrote it and will go straight to publication.

Not assuming nobody cares

The thumbnail for this page

Day 6 (Advent of Code 2020)

The end of Advent of Code 2020 is fast approaching, and we’re nowhere near done. Time to do Day 6!

The problem statement here is a little contrived, as uh, as the days that came before it, but that won’t stop us.

Basically, the input looks like this:

abc a b c ab ac a a a a b

Each line represents one person, and “groups of persons” are separated by blank lines.

The thumbnail for this page

Setting up a local Ubuntu Server VM

The first step to using Nix to build Rust is to do so without Nix, so that when we finally do, we can feel the difference.

There’s many ways to go about this: everyone has their favorite code editor, base Linux distribution (there’s even a NixOS distribution, which I won’t cover). Some folks like to develop on macOS first, and then build for Linux.

The thumbnail for this page

A simple ping library, parsing strings into IPv4 address

We’ve just spent a lot of time abstracting over LoadLibrary, but we still have all the gory details of the Win32 ICMP API straight in our main.rs file! That won’t do.

This time will be much quicker, since we already learned about carefully designing an API, hiding the low-level bits and so on.

Let’s add an icmp module to our program. Actually, we’ve been dealing with an IPAddr all this time, it also sounds like it could use its own package:

The thumbnail for this page

Day 11 (Advent of Code 2020)

Another day, another problem.

This time the problem looks suspiciously like Conway’s Game of Life, or, I guess, any old Cellular automaton.

We have a map like so:

L.LL.LL.LL LLLLLLL.LL L.L.L..L.. LLLL.LL.LL L.LL.LL.LL L.LLLLL.LL ..L.L..... LLLLLLLLLL L.LLLLLL.L L.LLLLL.LL

And for each iteration:

  • L symbols turn into # if there’s no # in any of the 8 adjacent cells
The thumbnail for this page

The rest of the fucking owl

Cool bear

NO! No no no.

What?

Cool bear

WE WERE DONE!

Well… yes! But also no. We still shell out to a bunch of tools:

$ rg 'Command::new' src/commands/mod.rs 126: let variant = if let Ok(output) = run_command(Command::new("wslpath").arg("-m").arg("/")) { src/commands/cavif.rs 29: Command::new("cavif") src/commands/imagemagick.rs 25: Command::new(&self.bin) src/commands/cwebp.rs 25: Command::new("cwebp") src/commands/svgo.rs 25: Command::new("svgo")