This year's Christmas mission

Once more this year I devised a Christmas mission for my son.  I posted about the one I made up for him last year, and he liked it so much that he requested another one this year.  In fact, he requested it multiple times in the weeks before Christmas, so I pretty much had to come up with one.

This year's mission was based on the Peanuts comics where Snoopy pretends he's a World War I flying ace fighting the Red Baron.  That became my son's latest obsession this year (I'm not even sure how) and he's constantly making up games and stories about it, so that seemed like a good theme.

The mission this year was a bit longer than last year, consisting of a series of seven messages which build on each other and lead to a series of surprises.

  1. The first message was an unsigned, cryptic note placed in an envelope on the Christmas tree.  This one was intended to be found and contained an encoded message at the bottom.  The accompanying plain-text informed him that this was a "substitution cipher" and that the cats had the key with their treats.  
  2. The second message was hidden with the cat food.  It was a note from Captain Snoopy giving him the key to use with the first message.  The "key" was simple chart a mapping each plain-text character to a cipher-text character.
  3. The message from the first note decoded to "your stocking is in the cat tree", which led my son to...the cat tree, where his stocking and the next note were hidden.  This note was a message from General Pershing laying out the mission: to save Christmas by engaging the Red Baron and preventing him from shooting down Santa Claus.  It gave him the hint that he need to be in tip-top condition for this mission, so his next clue was with the training equipment.
  4. The next note was in the basement, between two presents, next to my barbel and squat rack.  The presents were some exercise equipment - some "workout dice", an agility ladder, and a kids punching bag set.  The note, signed "Agent Fifi" (apparently Fifi was Snoopy's girlfriend), told him to use these to get in shape to fight the Red Baron and included an excerpt from the Wikipedia article for the Battle of Verdun.  The clue said that the next message was in a room where the number of seasons matched the result of a simple subtraction problem based on the start and end dates of the battle, which yielded three.
  5. Note number five was in the three-season room (get it?) off the back of the house.  I left that one in plain sight, because it was cold and I didn't want to spend a lot of time out there hunting for it.  In addition to the note, it contained a "poster" my wife got on Etsy - a color print of Snoopy sitting on his dog house in his World War I outfit, printed on an old dictionary page.  The note, signed "Captain Linus van Pelt", contained a "double encrypted" message, with instructions to use the same key as the previous message, but to shift the letters by two.  The message told him to "look in the drier".
  6. The sixth note was in the laundry room,  hidden inside the drier.  With it was a hat in the style of a World War I era aviator, complete with goggles.  The note from "Colonel Charlie Brown" (I'm not sure how I came up with the fake ranks) told him that this was the last piece of equipment he needed to face the Red Baron.  The final clue to the Baron's location was another "double encrypted" message, this time with the clue to shift the key by the number of letters in the Baron's first name, again including an excerpt from the relevant Wikipedia page.  The message told him to look "under your laptop".
  7. The final message (hidden under his laptop) was from the Red Baron himself.  It was a taunt, daring my son to come and face him.  It included instructions on how to start up an old "Snoopy vs the Red Baron" video game that I found.  I thought that seemed like a nice prize at the end, and also gave him something to do until the rest of the family arrived and we could open presents.

It took me about an hour and a half to come up with this and write up all the clues.  Of course, I was far too lazy to do the encoded messages by hand, so I wrote a little program to encode and decode them for me.  I even printed it out and hid it with the last message, on the off chance that my son might be interested (spoiler: he wasn't).

While I feared that I might have gone a little overboard, the mission was a big hit.  My son was a little unsure about the encoded messages at first, but once we showed him how to do it he took right to it.  By the last message, he was completely engrossed and dove right into it.  He seemed to enjoy the rest of the mission and seemed to like having the series of gifts worked into it.

But the aftermath was what really showed me how much my son enjoyed himself.  You see, he saved all the individual notes, and when his grandparents came over to open presents, he insisted on giving them a debriefing of his mission.  He read them all the notes, told them about the presents and the decoding process, and how he figured out the clues.  And the next day, when his other grandparents came to visit, he repeated the whole debriefing again.  

The only question is: How am I going to top that for next year?

My son beat his first Switch game

Today we experienced a somewhat significant event: my son beat his very first Nintendo Switch game.  It was Splatoon 3, which he got for Christmas.  He's been playing it since then and just this morning he finally beat the final boss for the first time.

I've never played the game, so I have no idea how difficult it actually is.  However, several times I've seen my son get frustrated and upset because he was having trouble with it.  So it's a life-lesson - a small one, but a lesson nonetheless.  He struggled, he stuck with it, and eventually persevered.  Games can be very useful for that sort of thing.

My son was very happy to finally beat the game.  He called me in to watch the end and called his grandmother afterward to tell her about it.  It was really nice to see him to excited and to be there with him to share this small triumph.  Call it one of the joys of parenthood.

Vim macro recording is really nice

This is probably a big "duh" for anyone who's used it before, but Vim's macro recording is pretty handy.  It's one of those things I've been vaguely aware of for a long time, but never actually used before.  Until now, I really only ever recorded a macro by accident.

But the other night I was playing around with my attempt to learn Go by writing a NES emulator.  I'm working from a demo of writing one in Rust, which recommends having highly comprehensive unit tests, so that's what I'm trying to do.  The problem I'm running into is that this results in lots of repetitive test cases.  The individual test cases are short, usually six to ten lines, and take the form of a struct defining the processor state and expectations.  The thing is, there are a lot of them.  By that, I mean that so far I've implemented 20 of around 150 opcodes and my unit test file is already pushing 1000 lines, compared to about 250 lines of production code.

Now, a 4:1 test to prod ratio isn't necessarily a bad thing, but it does seem a little high.  And the tests are all very similar, so they're kind of hard to read and navigate - unless you know the exact term to search for, they all just blend together.  So I really wanted to condense them down, preferably to one line per test case.  So I finally decided to make a few functions to extract the common stuff into a template so that I can condense all those structs down into one-liners.  Great!  But I already have 1000 lines of code to update.  Not so great.

Enter the Vim macro reorder.  For each opcode, a wrote a function to create the test template.  Now I had to take the existing structs and convert those into function calls.  Unfortunately, this was too complex for a simple substitution and it was just too tedious to do that many by hand.  However, the exact same series of steps could be repeated for each test case, so I decided to look up that macro recorder that I've been accidentally turning on for years.

Turns out it's super simple.  You just start recording by using "q" with a register name (e.g. "qa") in command mode, do a bunch of stuff, and then run "q" again to stop.  Then you can execute the macro with "@" and the name, e.g. "@a" and repeat that with "@@".  By itself, this is not terribly remarkable.  But with Vim movements and actions, it's really easy to make a macro that performs a complex manipulation on structurally identical blocks of text.  So I was literally able to start recording, just do the manipulation like I normally would, and then stop recording, leaving me with a macro that works perfectly with basically zero extra work.

Like I said, nothing really new or ground-breaking here.  Just discovering one of those handy features that I've never really used before.  But now I know how to take advantage of that for future use.

New keyboard - and not the computer kind

Earlier this year, I decided to treat myself to a new keyboard.  No, not a replacement for my UHK, but a digital piano.  Specifically, a Roland FP-30X, the white one, complete with stand and pedal bar.

I got the idea from a music shop in the Colonie Mall in Albany.  We stayed at a nearby hotel on the way home from our vacation this summer and were walking around the mall to stretch our legs after the long drive.  The shop had a bunch of digital pianos set up, and the FP-30X was one of them.

I tried a out a few and quite enjoyed playing the Roland.  The main attraction was the keyboard action, which was very realistic - much closer to a real piano than most keyboards I've tried.  The keys were well weighted and, even though they're plastic, they felt close to ivory.  It was also pretty compact - only about a foot deep - while still having a full-sized keyboard.  That's actually what made me think about buying one.

IMG_20221125_185547-small.jpg

Our old upright piano is nice, but it takes up a pretty good chunk of the living room, which is the only place we have to put it.  It's also getting very out of tune.  I mean, it's been very out of tune, but for a long time it was "in tune with itself", i.e. everything was out of tune in the same direction, so if you were playing by yourself, you didn't really notice.  However, that's increasingly not the case anymore.  And that's the piano I learned to play on when I was in high school, which my mother bought second-hand when I was a kid, so it's not exactly new.  I'm not sure how much it would take to get it make into proper tune and repair, but I figured it would probably cost about as much as the retail price of that Roland keyboard.  So why not just replace the piano with the keyboard?  It would probably cost the same and it's small enough to fit in my office, so it fixes two problems at once.

So that's what I did.  I bought the keyboard a few months ago.  It fits comfortably against the back wall of my office.  I even got a matching bench to go with it.  And we just got rid of the old upright today.  My wife put it on Facebook marketplace and a very nice couple took it off our hands for their daughters to use.  It served me well for many years and I hope they enjoy it.

But back to the new keyboard.

IMG_20221212_203528-small.jpg

I already mentioned that I really like the action and feel of the FP-30X.  I'm no audiophile, but the sounds is pretty good as well.  The maximum volume level is just about what I would expect for a "real" piano and the internal speakers project the sound well.  But one of the "killer features" to me was the plain, simple headphone jack.  (Actually, there are two - a 3.5mm and a 6.35mm, if I'm not mistaken.)  One of the main down-sides of the old acoustic piano was the fact that you can't play it while people are using the living room or trying to sleep.  I mean, you can try to keep the noise down, but that doesn't really work all that well.  But with the Roland, I just plug in some headphones and now I can play after my son has gone to bed.  It's great!

The one thing that's kind of a mixed blessing about the FP-30X is the control scheme.  As you can see from the picture, there's no display of any kind and there aren't exactly a lot of buttons either.  On the one hand, I really like this from an aesthetic standpoint.  It makes the unit look more like a musical instrument and less like something they pulled out of an air traffic control console.  But on the other hand, that makes it a little awkward to change the settings.  Of course, you can configure pretty much everything using just the keyboard, but that involves combinations of holding down control buttons and pressing specific keys.  It's weird and you really can't do it unless you have the reference sheet right there.

However, the preferred control method is Bluetooth.  The FP-30X supports MIDI over Bluetooth, so you can pair the piano to your mobile device and control it using Roland's Piano App.  The app itself is...fine.  The interface and control scheme is decent, but not remarkable.  The pairing and connection is sometimes a little slow and doesn't always work the first time, but it does work as advertised and it does allow you to twiddle with all the settings of the keyboard.  It also includes some paid extras, like downloading sheet music in the app and things like that which I haven't played with much.  However, using the app to control the more advanced features is definitely preferable to using key combinations.

If you want to read more about the Roland FP-30X, I found this review very helpful and informative.  Honestly, a lot of the details there went over my head, but the gist is that it's pretty darn good for a budget digital piano.  I just know that it meets my needs well and I've been having a very good time using it to play Christmas songs this week.

New desk

After working from home for the last two years, I finally broke down and got myself a new desk.  This one is significantly smaller than the one in my previous home office setup.  That one was a larger L-shaped desk.  However, I found that I actually didn't need that much space.  The L extension meant that it was hard to reach and hence use the far corner.  I also didn't really have any need for the extension and it basically turned into a dumping ground for random stuff.

IMG_20220804_150947-small.jpg

This one is much more compact.  That means that, not only do I actually use all of the space, but my office (which is pretty small) feels bigger.

The other big win is that this is a standing desk.  I got a 60-inch by 30-inch Uplift V2 adjustable height desk with the rubberwood surface and I'm very happy with it.  The Uplift desks are fun because there's a lot of customization you can do.  Of course, that also means that the price can vary wildly.  I mean, they start at $600 for a basic 42-inch model, but as you upgrade the size, material, add-ons, etc., it adds up quickly.  The price tag for mine ended up at around $1300.

There are lots of fun add-ons, though.  I got:

  • The casters so I can roll the desk around easily.
  • The bamboo drawer.
  • The upgraded programmable adjustment control.
  • The upgraded cable management system.
  • Three shelves for monitors etc.
  • Two of the powered grommet covers
  • The extra power outlets (so I actually have 2 USB and 6 conventional plugs on the desk).
  • The foot hammock.
  • A standing mat.
  • The bamboo Rocker-X board (with comfort pad), which is surprisingly satisfying.

The assembly took a while, but wasn't too bad.  The main challenge for me was that I had to assemble the desk more or less in-place with the other desk still in the room.  That's because I had no place to put my work setup while I assembled the desk (which I did over a couple of days) and, due to the door and hall size, the new desk couldn't easily be moved into my office after it was assembled (it would have to be turned on one edge, and that's a two-man job).  However, the instructions were fairly clear and the assembly wasn't too difficult.  There were a few steps where I needed to drill holes in the underside of the desktop, but other than that it was pretty much just screw drivers and Allen wrenches.  It takes some time, but it's not especially complicated - though some of it depends on what add-ons you get.

So if you're looking for a standing desk, the Uplift V2 is a good choice.  And if you've never used a standing desk, you might want to look into it.  I find that it really does help.  With my old desk, I sometimes found my legs starting to get stiff or cramped from sitting too long.  But if I get up and walk around frequently, that can sometimes interrupt my flow and make it harder to get things done.  A standing desk is a good compromise, because you can keep working, but still stretch your legs and move around.

I also found that the combination of the standing mat and the Rocker-X board really helps.  Just standing on the hard floor can be better than sitting, but it's still not super comfortable, especially if you're working at home and not wearing shoes.  The standing mat gives you a nice cushion, which makes standing for long periods in socks or bare feet much more comfortable.  And the Rocker-X board, while it looks like a silly gimmick, is awesome, especially if you're a fidgeter like me.  Even when I'm sitting, I'm constantly moving my legs and feet around.  The Rocker-X board lets you shift your weight and move your feet constantly, while still keeping you in a position where you can work.  I highly recommend giving it a try.