Programming

The earliest memory I have of ‘programming’ is in the early/mid 90s when my father brought home a computer from work. We could play games on it … so of course I took the spreadsheet program he used (LOTUS 123, did I date myself with that?) and tried to modify it to print out a helpful message for him. It … halfway worked? At least I could undo it so he could get back to work…

After that, I picked up programming for real in QBASIC (I still have a few of those programs lying around), got my own (junky) Linux desktop from my cousin, tried to learn VBasic (without a Windows machine), and eventually made it to high school… In college, I studied computer science and mathematics, mostly programming in Java/.NET, although with a bit of everything in the mix. A few of my oldest programming posts on this blog are from that time.

After that, on to grad school! Originally, I was going to study computational linguistics, but that fell through. Then programming languages (the school’s specialty). And finally I ended up studying censorship and computer security… before taking a hard turn into the private sector to follow my PhD advisor.

Since then, I’ve worked in the computer security space at a couple of different companies. Some don’t exist any more, some you’ve probably heard of. I still program for fun too, and not just in security.

But really, I still have a habit of doing a little bit of everything. Whatever seems interesting at the time!


All posts

Recent posts

AoC 2025 Day 7: Laser Splittinator

Source: Day 7: Laboratories

Full solution for today (spoilers!).

Part 1

You are given a map like this:

.......S.......
...............
.......^.......
...............
......^.^......
...............

A laser shines from the top S and splits each time it hits a ^, making this:

.......S.......
.......|.......
......|^|......
......|.|......
.....|^|^|.....
.....|.|.|.....

The two lasers in the center of this example merge to count as one laser.

Count how many times lasers hit splitters.

read more...


Advent of Code 2025

It’s back! (Advent of Code)!

It’s been ten years (of advent of code, I haven’t done them all (yet)) and oh what a ten years it’s been. This time around, there will be only 12 days instead of 25, but honestly, that means I’m not working on these right up until Christmas. So I’m okay with this.

Once again, Rust! But this time, I won’t be using cargo-aoc, instead I wrote my own proc macros. Mostly to see if I could. 😄 See this section for more information.

Full solutions will once again be posted to GitHub (including previous years and possibly some I haven’t written up yet): jpverkamp/advent-of-code

read more...


API Tricks: Wikipedia Table JSON API

Quick, what is the order of the (as of now) 63 released Walk Disney Animation Studios films?

$ api=https://www.wikitable2json.com/api; \
  page=List_of_Walt_Disney_Animation_Studios_films; \
  curl -s "$api/$page?table=0&keyRows=1" \
  | jq '.[0][].Film' -rc \
  | egrep -v '^as' \
  | nl

     1	Snow White and the Seven Dwarfs
     2	Pinocchio
     3	Fantasia
...
    61	Strange World
    62	Wish
    63	Moana 2

There is a list on Wikipedia: List of Walt Disney Animation Studios films, but the tables there are … a bit of a pain to copy paste. I could very well just manually do that, but where’s the fun in that?

Luckily, someone went through the work of providing a wrapper around Wikipedia that will extract all (or selected) tables from a Wikipedia page!

To break down the command:

  • curl -s https://{...}?table=0&keyRows - Download the first (zero based indexing) table on the page; use the first row as column names (-s for ‘silent’ mode)
  • jq '.[0][].Film - Extract the first table in the response (.[0]), for each row in that table [] extract the film name .Film
  • egrep -v '^as - Remove rows starting with ‘as …’; these are extra rows when the studio was renamed

And that’s it!

read more...