Gobbel2000

joined 2 years ago
[–] Gobbel2000@feddit.de 5 points 2 years ago (1 children)

What do you know? How do you know!?

[–] Gobbel2000@feddit.de 2 points 2 years ago (1 children)

I like it, it's simple and to the point. I've learned that one of the most helpful things to do when solving these puzzles is to not make it more complicated than it needs to be, and you certainly succeeded better at that today than I did.

[–] Gobbel2000@feddit.de 5 points 2 years ago

Rust

I've been using Regexes for every day so far, this time it helped in finding numbers along with their start and end position in a line. For the second part I mostly went with the approach of part 1 which was to look at all numbers and then figure out if it has a part symbol around it. Only in part 2 I saved all numbers next to a gear * in a hash table that maps each gear position to a list of adjacent numbers. Then in the end I can just look at all gears with exactly 2 numbers attached.

Also it has to be said, multiplying two numbers is the exact opposite of getting their ratio!

[–] Gobbel2000@feddit.de 6 points 2 years ago

Rust

Pretty straightforward this time, the bulk of the work was clearly in parsing the input.

[–] Gobbel2000@feddit.de 23 points 2 years ago

It's not a good sign that this meme appeared on day 1 already...

[–] Gobbel2000@feddit.de 2 points 2 years ago (1 children)

That's very close to how I solved part 2 as well. Using the greedy wildcard in the regex to find the last number is quite elegant.

[–] Gobbel2000@feddit.de 8 points 2 years ago* (last edited 2 years ago)

Rust

Part 1 Part 2

Fun with iterators! For the second part I went to regex for help.

[–] Gobbel2000@feddit.de 13 points 2 years ago

That was quite the rabbit hole, and know I know that my CPU has a bug. Great.

[–] Gobbel2000@feddit.de 10 points 2 years ago

I want to make a joke about how terrible the name is with just throwing in an 'a', but I don't think it would be right since I'm using Fira Code.

[–] Gobbel2000@feddit.de 7 points 2 years ago (3 children)

If you're on Arch, why don't you just use the discord package from extra repositories and have discord simply update with pacman?

[–] Gobbel2000@feddit.de 1 points 2 years ago (1 children)

I still don't see how having a flat subvolume layout would make that more problematic. You can still (even better in my opinion) choose what subvolumes to automatically snapshot, which to include in backups etc.

[–] Gobbel2000@feddit.de 9 points 2 years ago (5 children)

Yes, that seems correct to me. I would also say that the flat layout is preferable because it makes dealing with snapshots later easier. When snapshotting the rootfs subvolume you won't have to keep track of where exactly the home subvolume is located and it is easier to boot into a different rootfs snapshot.

view more: ‹ prev next ›