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!

Advent of Code: Day 24

Source

Part 1: Split a list of integers into three groups of equal sum. Find the grouping such that the smallest group has the least items, breaking ties by the smallest product for that group.

read more...


Advent of Code: Day 23

Source

Part 1: Create a simple virtual machine with two registers (a and b, non-negative integers) and six instructions:

  • hlf (a|b) - divide the given register by half, round down
  • tpl (a|b) - triple the given register
  • inc (a|b) - add 1 to the given register
  • jmp [+-]\d+ - jump forward/backwards by the given number of instructions
  • jie (a|b), [+-]\d+ - if the given register is even, jump
  • jio (a|b), [+-]\d+ - if the given register equals one, jump

read more...


Advent of Code: Day 21

Source

Part 1: Given a shop full of weapons (buy exactly one), armor (buy zero or one), and rings (buy 0, 1, or 2), determine the set of items that will defeat a given enemy for the minimum cost (see the original writeup for more details).

read more...


Advent of Code: Day 20

Source

Part 1: P(n) is defined such that for each number i, add 10i to any number divisible by i. Find the first value n such that P(n) is at least a given target number.

read more...


Advent of Code: Day 17

Source

Part 1: Given a list of containers of varying sizes and a total volume to contain, determine how many different combinations of containers match exactly the given volume.

read more...


Advent of Code: Day 16

Source

Part 1: Given a list of target values of the form:

children: 3
cats: 7
samoyeds: 2

And a list of ‘Aunt Sues’, each with known values:

Sue 1: children: 1, cars: 8, vizslas: 7
Sue 2: akitas: 10, perfumes: 10, children: 5
Sue 3: cars: 5, pomeranians: 4, vizslas: 1

Determine which Sue has no unset but matching values.

For example, Sue 1 is invalid because children is 1 versus 3 and Sue 2 because children is 5 versus 3. Given only the values above, Sue 3 would be valid since there are no contradictions.

read more...