git-rebase's new powers

Woah. Look how many fancy things git rebase -i knows how to do now:

# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
#                    commit's log message, unless -C is used, in which case
#                    keep only this commit's message; -c is same as -C but
#                    opens the editor
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
#         create a merge commit using the original merge commit's
#         message (or the oneline, if no original merge commit was
#         specified); use -c <commit> to reword the commit message
# u, update-ref <ref> = track a placeholder for the <ref> to be updated
#                       to this position in the new commits. The <ref> is
#                       updated at the end of the rebase

Brexit

Thanks Brexit, for making the process of ordering and receiving a replacement for an aging peripheral so exquisitely painful. In the old days, goods moved from the UK to other EU countries effortlessly. Now, their transit resembles an Odyssean epic straight out of Greek mythology.

  • Day 1. Place the order. Get an email from the merchant, asking if I’m really sure I want to proceed with the order, given that I’m going to have to pay import duties when I receive it (and they want to avoid me returning the item when I find out how expensive and painful that’s going to be). Confirm my willingness to run the gauntlet, and see exactly how deep the rabbit hole goes.
  • Day 2. Receive notification from DHL that the order is on the way, with an estimated delivery date 7 days in the future.
  • Day 3. Order arrives in my country.
  • Days 4 and 5. A weekend. All quiet on the Western Front.
  • Day 6. Order arrives in my city.
  • Day 7. Order shows as "detained", but status page notes that DHL will contact me to obtain details necessary.
  • Day 8. Order still shows as "detained". Given that DHL hasn’t contacted yet, I contact them. Receive email from DHL asking me to fill in an authorization for them to handle the dispatch through customs. I fill it in and send it back immediately.
  • Day 9. DHL emails me to say they are "going to initiate the corresponding procedures for customs dispatch". Estimated delivery date comes and goes.
  • Days 10 and 11. A weekend. All quiet on the Western Front.
  • Day 12. I receive my daily status update email, informing me that my parcel’s currently in an "exception state".
  • Day 13. Another daily status update ("exception"), and the status page again tells me that DHL needs some information from me and will contact me to let me know what they need; given that they don’t contact me, I contact them, asking them what they need.
  • Day 14. I receive a reply from DHL, indicating that they are still waiting to physically receive the package (which seems false, given all the status updates showing the package’s transit — in DHL’s custody — from the source country to the destination country), and that I should write to the seller to ask them what date they sent it. Finally, later in the day I receive email from DHL inviting me to pay the import duties on the order, which amount to 32.6% of the cost of the goods. Why is this amount more than the expected 21% (this is the rate of the Value Added Tax in my country)? Well, it’s because DHL helps itself to 52.51€ for its "administration" services, in addition to the 9.99€ I paid for shipping in my original order (supposedly, to cover delivery in the span of "3–6 business days"). Mousing over to see the description of what these "administrative services" consist of, I am greeted with the dystopianly inaccurate claim that they refer to "assitance provided by DHL Express to facilitate the efficient clearance of shipments through customs processes; this includes documentation management, ensuring regulatory compliance, and handling duties and taxes" (emphasis added).
  • Day 15. Item is actually delivered.

So, in that 15-day itinerary, 9 days were spent with the package sitting on some shelf waiting to be "processed", while I received an irritating bombardment of inaccurate notifications and requests to engage in hoop-jumping. That they would charge me a premium to facilitate this circus, and have the gall to describe it as "efficient", is the most annoying part.

Advent of Code 2024

Seeing as I hang out on Hacker News, I’ve been aware of Advent of Code for many years now, but it was only in 2023 that I participated for the first time.

In 2023, I fully completed 16 days (both parts)[1] and partially completed an additional 4 days (only the first part). There was one day that I attempted but didn’t even solve the first part, and 4 days in which I didn’t participate at all. I optimized for getting the solutions quickly, not necessarily elegantly, and if I felt like I was taking "too much" time on a particular problem, I stopped.

In 2024, I completed all 25 days, and the whole business felt subjectively easier. I wasn’t sure though: was it really easier than the year before, or had I just gotten a bit better at solving this kind of question? Alternatively, had I tried a bit harder in 2024?[2] Might it even be true that I was, um, "scrappier" in 2024; that is, more willing to throw elegance, purity, and truth out the window in service of getting the right answer?

Ideally, I want my solutions to be based on applying my toolkit of data structures and algorithms to the problem at hand. I think it’s ok to look up details of a specific algorithm that you know about but which you can’t necessarily implement from memory alone, but not to go onto Reddit in order to have a recipe for how to solve the problem handed to you on a platter. This year, for example, I used Dijkstra’s algorithm a couple of times (day 16 and day 18); this is a path-finding algorithm that is simple enough that I can mostly remember the shape of it even if I only make use of it once a year, but my first cut wasn’t quite right and I needed to check the details. On day 23, I used the Bron-Kerbosch algorithm for finding the maximum clique in a graph; that was a case where I knew the kind of algorithm I wanted, but couldn’t recall the name of it, so I went to Wikipedia and skimmed through the list of Graph algorithms to find what I was looking for. Given that I couldn’t remember the name, I definitely wouldn’t have been able to implement the algorithm without looking it up. That seems like fair game to me.

Likewise, for non-trivial data structures (ie. anything that doesn’t come with the language or standard library), I think it’s ok to copy an implementation I’ve previously written. This year, the only such thing I grabbed was a binary heap implementation and the corresponding thin wrapper around it that turns it into a priority queue. At one point, I thought I might use a Union-Find but I ended up not doing so. I wouldn’t get very far writing a Union-Find implementation from scratch without looking it up. And I think I could write more than 50% of a heap implementation without looking anything up, but it would probably have bugs, and I’d have to look up the rest anyway, so I figure I may as well use an at least somewhat battle-tested implementation that I myself have previously produced.

Needless to say, no LLMs for something like Advent of Code. Using them seems not to be in the spirit of the exercise.

So, I’ve got principles, if you know what I’m saying. But there were a couple of days this time that troubled me, where I used "by-hand" analysis of the problem input, or what I’d call "extrinsic knowledge" to strongly guide the solution, as opposed to coming at things from "first principles":

  • On day 17, I figured out what the provided byte-code was supposed to do (ie. I effectively "disassembled" the byte-code and wrote down exactly how the information would flow through the registers), and used that knowledge to run a search over possible values, effectively running the computation in reverse, ultimately arriving back at the necessary initial value. In other words, I didn’t write an algorithm that would run over the input data and spit out an answer; instead, I wrote code that would leverage some analysis (that I could have done with pencil and paper) to spit out an answer.

  • On day 24, I used knowledge of how binary addition can be implemented using logic gates to explore the problem input finding deviations from the expected wiring. That is to say, instead of taking the problem input and asking "how can I make use of data structures and algorithms to solve this task?", I asked "how can I make use of data structures and algorithms, combined with knowledge of how logic gates can be used to perform addition[3], to solve this task".

Both of these felt somehow like "cheating", but the truth is I cared more about getting the answer than doing it in a "pure" way, so I went with it. Based on comments from folks at work, I feel like at least a few of my colleagues were able to produce more "fundamental" solutions for both of these days.

In any case, let’s get back to our initial question. Was Advent of Code 2024 easier than 2023? That’s a very hard question to reliably answer, so I posted an ultra-scientific poll at work and found that 9 respondents thought 2024 was easier, and 1 thought it was about the same. I guess that settles it, then.


  1. On one of those days, I got stuck, and ended up looking on Reddit for a hint for how to proceed with the second part. ↩︎

  2. I don’t think so, as I there were only a few days where I felt like I took longer than I should have to arrive at a solution. For the most part I felt like I got things done more quickly than the previous year. ↩︎

  3. Knowledge that I vaguely recalled, but which I obviously had to look up online to actually get the details right. ↩︎