Snake on a Sphere

May 23rd, 2021

I participated in Ludum Dare 48, a game jam where you try to make a game in 48 hours. This year’s theme was “Deeper and Deeper” and I made Snake on a Sphere, a version of Snake where you’re on a sphere and it get smaller and smaller as you get longer and longer. You can play it on the web.

I used Unity again to make the game, which helped a lot. This year, I also used jsfxr to create sound effects and the LICEcap to generate animated gifs.

I was pretty pleased with my results. Out of 1145 people participating in the Compo version (where it’s a single person, writing a game from scratch), my overall rating was 112th, so in the top 10%. There were also a bunch of different categories, including “Fun”, in which I got 23rd place, which is just about the top 2%! So, that was exciting.

I tend to scope my projects pretty tightly. That helps me actually finish something in 48-hours. But my game is pretty simple and I noted that a bunch of games have a leveling-up mechanic where you go through the game multiple times and get a little more powerful each time, which I think adds a lot of replayability. So if I do something like this again, I’m going to try to be a little more ambitious and incorporate something like that as well.

Politics and Meditation

February 1st, 2021

Wow, it’s been a year, right? I don’t know about you, but I’ve had a hard time dealing with all the stuff that’s going on. Even after the election, which I thought would be the end of it, it just felt like it just kept on coming. I felt exhausted and stressed all the time.

Then I started meditating. It’s not a magic bullet or anything, but it made it possible to deal with everything and keep on functioning. By the time the Capitol riots happened, I still felt frustration about it all but I could tell it wasn’t taking over my life like I think it would have before. So, anyways, I thought it’d be interesting to make a video about what that experience was like for me.

On a lighter note, if you’ve seen any of Julie Nolke’s Explaining the Pandemic to My Past Self series, you’ll recognize what my video is inspired by. It was a fun challenge to try to match that in style from camera angles to the font she used in the date at the beginning. It also made me wish I had a better camera, better sound, and better lighting; was a better actor, a better writer, and a better director. But hey, you work with what you’ve got. =)

Ventriloquism and Singing

December 30th, 2020

I had this idea for a silly video where the joke is that one character is somehow able to sing a barbershop quartet by himself. I’ve done a bit of singing in the past so I thought it wouldn’t be too hard. Well, turns out that trying to get the timing right with yourself is incredibly challenging. Fortunately, I was sorta able to fix it in the edit with a copious amount of retiming.

I could have used some pitch correction as well cuz I’m a bit rusty with the singing (I think this is the first time I sang since before the pandemic began) but that would have been too much work.

Another fun detail is that the puppets came from a sock puppet movie I directed over a decade ago. That was a lifetime ago so it was good to see them put to use again.

New Day Job

October 12th, 2020

I work at Apple now! I’m a software engineer on the prototyping team in the design studio. This is something I’ve been working on for a while. In fact, the hardware archeology posts I made back in May were related to a presentation I gave during the year-long process:

  • October, 2019 – Contacted by a recruiter about the role.
  • November, 2019 – Met with someone on the team who knew of me from Pixar to learn more about the team.
  • January, 2020 – Meet and greet with with the team at the Apple campus.
  • March, 2020 – The pandemic hit.
  • April, 2020 – Virtual interview with a several members of the team.
  • June, 2020 – Gave a presentation over video chat to the larger team and interviewed virtually with more people.
  • September, 2020 – Got an offer from Apple.

A couple issues came up during this whole process. One is that it’s a pretty long commute. I initially passed on applying because of that but I kept on hearing great things about the team and the more I heard about the role, the more it felt exactly like what I wanted to do. But the second issue was the whole pandemic. That probably delayed everything by a few months and it was also more challenging to interview virtually than in person. On the plus side, it looks like I won’t have to worry about the commute for a little while.

This is what it looked like to switch companies during a pandemic.

Looking back, I’m very grateful for my seven (!) years at Google. I learned so very much and got to work on cool projects like object scanning, the Cardboard app, and of course, Tilt Brush. I got to work with incredibly talented people, travel the world, and eat some wonderful free food. I still think it’s a great place to work and would heartily recommend it to anyone interested. But the company has shifted focus in the past year or so and I’ve been looking for an opportunity to do the kind of work that I think the new role at Apple will provide.

Watching Tenet During the Pandemic

September 15th, 2020

It’s been a weird year. But even for 2020, September 9 was an outlier as the sky turned orange in Berkeley because of the ash from the California wildfires. There’s just something undeniably surreal when the entirety of your world looks completely different from anything you’ve ever seen before.

Like a lot of people, I’d been struggling with the challenges of 2020 and September hit me particularly hard. We weren’t even done with the year and then the whole state catches fire?! But something about the weirdness of that day made me … well, not exactly hopeful, but it did make me feel like change was in the air. And I felt like I wanted to do something adventurous.

So I decided to drive my family an hour and a half to a drive-in theater in Sacramento to go watch Tenet.

It was amazing. The movie was everything I was hoping for. More than that, I felt like the world was still full of possibilities. And for the first time in a long time, I felt inspired to work on another personal project: a video about Tenet using the time travel mechanics of that movie’s universe.

This was going to be one of my most ambitious videos so I had to do a huge amount of planning. I had to plan out all the time-streams and figure out where to break them so I could splice them back together. I also needed to be precise about stage directions because I had to shoot everything in a single day so that my camera would be consistent for all the shots.

But another huge challenge was that I needed to do the main section in a single take. That meant memorizing and performing a couple minutes of dialog and action without making any mistakes. It was particularly hard because I had to pause and react to imaginary versions of myself. Also, I’m not the greatest at memorizing dialog and motions, so I had to rehearse a bunch and did many, many takes.

In the end, I managed to get a few decent takes and then came all the editing. A green screen or some software to automatically extract the background would have been great, but I didn’t have those so I manually rotoscoped a bunch of stuff for hours in Final Cut Pro X. In the process, I discovered that my camera had moved slightly in between and the lighting changed significantly while shooting.

But you know what? I’m pretty happy with the result. It’s not perfect and I don’t think a lot of people are going to see it, but I accomplished what I had set out to do: make a video with cool time travel mechanics about a movie that I delighted in experiencing.

If you’re curious and you’ve seen the movie, here’s my final video. If you’ve seen the video, here’s some director commentary:

  • The scene where I get the hat? I performed it backwards so that I dropped it after wiggling my fingers. Then I reversed it in the edit so that it would look like I wiggled my fingers and it popped into my hand.
  • The second time the hat pops into my hand, I’m actually using my other hand from offscreen to throw it.
  • The “oxygen mask” is actually just an N95 mask taped to an extension cord.

Pandemic vs Politics in One Graph

July 19th, 2020

I wanted to get a sense of how effective masks were in curtailing the pandemic spread. Unfortunately, I couldn’t find a source of data per state for that. (This NY Times article is close, but they don’t list out the counties.) But I did find a Wikipedia article on political party strength. So I combined that with the New York Times covid data repo and came up with the graph above (here’s the spreadsheet). The color indicates which party that state voted for in the 2016 elections. All the lines have been normalized per state population.

I was stunned. When this all started, I figured it would mostly be an issue in the states that are more densely populous, which is mostly the blue states. So it’s not surprising to see higher positive case numbers for the blue lines. But I was shocked to see how much faster the red lines were growing in the last few weeks. The highest blue lines are New York, New Jersey, Rhode Island, and Massachusetts. The highest red lines are Louisiana, Arizona, Florida, and Mississippi.

I think this is a pretty clear indication of the effect of politicizing what should absolutely not be a political decision. We have medical experts, epidemiologists, data scientists, and examples from other countries. Politicians should be taking their cues from them.

Here’s another graph, focusing on California, which is where I’m from so I’m a little more familiar with it:

In this one, I graphed the number of positive cases last week (normalized per million people) versus a “Republican factor” that I got from this Wikipedia article on voter registration numbers per county (further right is more Republican). I’ve also made the dots for the 12 biggest counties bigger for easier visibility. As you can see, California isn’t an entirely blue state.

The thick gray line going through the middle of the dots is the trend line and it’s pretty flat. That means there’s no correlation between political party infection rates in California. But looking at the counties I’m most familiar with, I see that San Francisco and Alameda are pretty low and I also know that mask usage in the SF Bay Area is pretty good. But I’ve heard from friends in LA that mask usage down there is pretty bad and sure enough, Los Angeles has a significantly higher infection rate right now. So from this, I take away two things:

  • Leadership is important. I believe the reason we don’t see any political correlation at the county level is that the Governor sets the rules for the entire state. Each county has to follow the state guidelines.
  • Individual choices are important. I believe the reason we see such a variation between Los Angeles and San Francisco is that individual people are choosing whether to obey the social distancing and mask guidelines. The guidelines can only do so much. People still have to be responsible.

But I think there’s also room for optimism for red states. Right now, they still have a lower number of positive cases. It’s possible for individual people in those states to choose to take more precautions beyond what their Governors state and stay that way.

Hardware Archeology: Sony CLIÉ

May 31st, 2020

I went into the garage and found a couple more of my old devices. These were PDAs (Personal Digital Assistants) from around 2002-2004, which is what people had before there were smartphones. They were significantly less powerful (no internet or multi-touch) but surprisingly similar (color display, touchscreen, and apps for things like calendar, notes, etc.).

The first one I had was the Sony CLIÉ PEG-T615C. Two of the coolest features were the jog-dial (sorta like a mouse scroll wheel) and a dedicated non-display touch area that you could scribble on to input characters. It wasn’t as fast as typing but more convenient than trying to peck tiny buttons on the screen.

I got the Sony CLIÉ PEG-TG50 a couple years later and it had several big upgrades: its own physical keyboard, a microphone, and it could play audio. Also, I wrote a few programs for it.

One was another implementation of the card game Set. This was a significant improvement over my HP 48GX implementation in that it made use of the color display and the fact that it had a whopping 12.2 times as many pixels.

Another was a simple implementation of the PSP game Lumines. A friend had it on the PSP and I loved that game. Unfortunately, I didn’t have a PSP. But I did have an awesome PDA with a jog dial and a touch screen so I attempted to see if I could make a version of it on my CLIÉ. It’s been so long that I don’t remember what I wrote it in, but it was probably C++.

Hardware Archeology: HP 48GX

May 24th, 2020

Back in college, programmable calculators were starting to become a thing and by the time I hit grad school, the HP 48GX came out. It was the closest thing to a handheld computer that I’d ever had.

For the time, it was truly impressive. It could do all the standard calculator functions but it could also run simple programs and I wrote a few.

One in particular that I was pretty proud of was an implementation of a card game called Set. It’s based on trying to find sets of 3 cards that are all the same or all different in 4 categories: number, color, shape, and pattern. But the HP 48GX, as advanced as it was, was only black and white and had very low resolution (131×64 pixels). So I simplified the shapes and instead of colors, I re-used the pattern in the background of the shapes.

It worked out pretty well. The funny thing was that the processor on the calculator was so slow that I couldn’t check all the possible combinations very quickly. Instead it just checked for one combination per loop and it was possible for a human player to actually find a set before the calculator.

I managed to dig up my old calculator and was amazed to find it still worked when I put in some fresh batteries. Unfortunately, the memory was wiped but I found an archive of my old HP 48GX work and still have the original program and readme.txt file.

Reddit Tracking

May 22nd, 2020

I occasionally post on Reddit and the other day, I posted that admitting you’re wrong is a sign of growth, not weakness and it got pretty popular. Then it got deleted because apparently, the mods thought it was common sense. I disagree, but it’s their group so fair enough.

So then I thought it would have been interesting to see how the post’s popularity changed over time. But I don’t think Reddit keeps track of that kind of information. So I wrote a super hacky script to do just that. Then I ran it whenever I made another post and eventually made a post (about the difference between addictive and fun) that was moderately popular. I tracked it over 24 hours (with some breaks because the script crashed a few times; like I said, it’s super hacky) and that’s the blue graph.

So then I thought it would be kinda neat to post a graph to Reddit that tracked the popularity of the post itself! Unfortunately, images can’t be changed once posted. But if you post a link to an article with the image, Reddit extracts the image. So if you update an image in an article, would the image update on the Reddit post? I don’t know. But that’s what this blog post is attempting to find out.

Which States are Recovering?

May 7th, 2020

I’ve been looking at the COVID-19 dataset from the New York Times GitHub repository trying to get a sense of how states are doing and which ones are recovering. I wrote a little script to collate the data, put it all into a spreadsheet, and came up with this graph:

These are the states whose daily death counts have dropped to half of their maximum. (The spike at the end for New York is due to a large number of nursing home deaths that were finally added to the data, so hopefully it’s just a one-time correction.)

Most of the ones that are doing the best are very low population states except Hawaii and West Virginia. Hawaii is a special case because they’re an island and people flying in are quarantined for 14 days. This drastically cuts down on their tourist population so their beaches are naturally pretty empty compared to normal. As for the rest, they seemed to take their lockdown pretty seriously. So, long story short, the best strategies for fighting COVID-19 seem to be:

  • Have low population density.
  • Be an island and institute a 14-day quarantine.
  • Take lockdown seriously.