212 results for "":
Day 7 (Advent of Code 2022)
The day 7 challenge talks about trees! File trees that is.
The temptation to solve it before starting to write this article so I don’t look silly is high, but I’m explicitly not doing so, so that we can bang our collective heads against any walls at the same time, and see how we can get out of it! Trees are serious business!
Part 1
The sample input looks like this:
Day 8 (Advent of Code 2020)
Time for another Advent of Code 2020 problem!
That one sounds like it’s going to be fun. Our input is pretty much assembly, like this:
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6
So, the first thing we’re going to do is write down some types.
There’s more than one way to approach this problem, but let’s go with this:
#[derive(Debug, Clone, Copy)]
enum InstructionKind {
Nop,
Acc,
Jmp,
}
#[derive(Debug, Clone, Copy)]
struct Instruction {
kind: InstructionKind,
operand: isize,
}
type Program = Vec<Instruction>;
Ludum Dare #25 Post-mortem
Last week-end, I participated to Ludum Dare for the fourth time in a row!
Downloads: Linux (64) | OS/X | Windows
Story
So here is our entry: Legithief. The backstory is simple, yet cunning: you are an ordinary thief practicing ordinary acts of thievery in the houses of ordinary people to make a living. But one day.. you are quietly robbing yet another home, when you are suddenly smashed in the head with a bat.
Day 17 (Advent of Code 2022)
Advent of Code gets harder and harder, and I’m not getting any smarter. Or any more free time. So, in order to close out this series anyway, I’m going to try and port other people’s solutions from “language X” to Rust. That way, they already figured out the hard stuff, and we can just focus on the Rust bits!
Sounds good? Good. Let’s proceed.
Async fn in trait, for real this time
async_trait
’s one weird type ascription trick
Now that I got the Log in with GitHub feature working, let’s explore
what this would’ve looked like with the async_trait
crate.
First up, the trait definition:
/// Something that can refresh credentials
#[async_trait::async_trait]
pub trait CredentialsRefresher {
async fn refresh(&self, creds: &FutileCredentials) -> eyre::Result<FutileCredentials>;
}
More devops than I bargained for
Background
I recently had a bit of impromptu disaster recovery, and it gave me a hunger for more! More downtime! More kubernetes manifest! More DNS! Ahhhh!
The plan was really simple. I love dedicated Hetzner servers with all my heart but they are not very fungible.
You have to wait entire minutes for a new dedicated server to be provisioned. Sometimes you pay a setup fee, et cetera. And at some point to server static websites and serve as a K3S server, it’s simply just too big, and approximately twice the price that I should pay.
Building poppler for Windows
I know what you’re thinking: haven’t we strayed from the whole “content pipeline” theme in this series?
Well… fair. But compiling and distributing software is part of software engineering, and unless you’re in specific circles, I see that taught a lot less than the “just write code and stuff happens” part.
Technically it’s release engineering, but who’s keeping track.
The bottom emoji breaks rust-analyzer
Some bugs are merely fun. Others are simply delicious!
Today’s pick is the latter.
Reproducing the issue, part 1
(It may be tempting to skip that section, but reproducing an issue is an important part of figuring it out, so.)
I’ve never used Emacs before, so let’s install it. I do most of my computing on an era-appropriate Ubuntu, today it’s Ubuntu 22.10, so I just need to:
Thoughts on going down the network stack
So!
I have no shortage of ongoing writing projects - I still need to edit and publish the final parts of making our own executable packer, and I’ve recently announced I was working on a Rust book/series. Those are still both on the table.
Buuut… I’m also looking at other things. My best writing happens when I’m learning about something at the same time I’m writing about it. So for example, the Rust book is a bit harder to write, because I’m mostly trying to distill knowledge I’ve already absorbed (for the most part).
Day 1 (Advent of Code 2020)
I was not planning on doing anything specific this December, but a lot of folks around me (on Twitter, at work) have chosen this Advent of Code to pick up Rust, and I’ve got big FOMO energy, so, let’s see where this goes.
I’ll be doing all of these on Linux, so there may be some command-line tools involved, but don’t worry about them - the code itself should run on all platforms no problem.