Author Archive

New Day Job

Monday, 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

Tuesday, 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

Sunday, 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É

Sunday, 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

Sunday, 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

Friday, 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?

Thursday, 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.

Innocuous Pong

Sunday, April 26th, 2020

Last year, I participated in a weekend game jam with some friends to make Pigsy Banksy, a simple little platformer where you play a flying piggy bank. This year, I decided to try the solo version and made a game on my own in 48 hours. Details are on the Ludum Dare page. You can download it for Windows or Mac and even play it on the web.

The theme was “Keep it Alive” and I was doodling some ideas around something like paddle ball. Dyson looked at it and said, “How about Pong?”. So I considered that for a bit and thought it might be kinda cool to make a simple one-player version of Pong that steadily got more and more complex.

It’s a very simple concept but I’m pretty happy with what I did for the ultimate level when the player gets a score of 15. The other thing I’m pretty happy about is that I managed to come up with all the sound in the last couple hours.

If you can, try out the game and see if you can get to a score of 15. Otherwise, feel free to check out the full game demo video below:

Two Weeks Later

Sunday, April 12th, 2020

A couple weeks ago, I tried to make some predictions on how things might go depending on whether we continued isolating or not. How did it go? Well, for the most part, the U.S. has adhered to isolating and it really showed when looking at the graph of growth rate (the dots almost completely overlap the “No Action” prediction):

The two weeks went almost exactly how I imagined, which was:

Gn = (Gn-1 – 1)/(Gn-2 – 1) * (Gn-1 – 1) + 1

Or in other words, a function that geometrically decayed towards 1. That’s great news as it means that if we continue holding out, we’re over the inflection point. Similarly, the total number of cases was pretty close as well:

Unfortunately, my prediction for “lethality” didn’t turn out as well as I had hoped:

In hindsight, this makes sense. Even if we were perfectly isolated, it would have taken a few days for that to reflect in the numbers for people who already had it. We can see that better in the graph for total number of deaths:

The graph is starting to taper, but it took a few more days for it to taper than I had initially hoped. Still, it’s been getting better. So I think we’ve avoided the worst of it. The bigger question is how long can we hold out? What will the world look like when this is over?

COVID-19 Over the Next Two Weeks

Friday, March 27th, 2020

I am not an epidemiologist. That’s very important to keep in mind.

But I do have a little experience with data analysis and spreadsheets so I’ve been tracking the COVID-19 data from in this spreadsheet, trying to make sense of it. Specifically, I’ve been trying to figure out what might happen over the next couple of weeks, say, by Easter.

Bottom line: what we do next could be the difference between 10,000 and 100,000 deaths.

First, I started by modeling the “growth rate” of the total confirmed positive cases. This isn’t a great number because we know we’re not testing everyone, so the actual number is probably significantly higher. But looking at all the countries, there’s a noticeable pattern:

Every country went through a spike as it saw outbreaks and then a gradual tapering down as they started to take action. The U.S. started taking aggressive action a week or two ago (depending on the state) and so it’s possible that we’re starting to see a slowdown of the growth. The two dotted lines represent my guess over the next two weeks depending on whether we stop isolation or if we continue isolating. So from there, we can extrapolate numbers for the total confirmed cases:

Depending on what we do, this could be the difference between 750,000 and 3,000,000 total confirmed cases. From there, I tried to estimate the number of total deaths that would be by trying to guess what the “lethality” is (the number of deaths per confirmed case). Again, it’s not a great number because there are so many factors going on. But looking at the graphs for all the countries, there seems to be a reasonable pattern:

The countries that have taken aggressive action seem to level off at some ratio, which is probably proportional to how much testing they do. But some countries start seeing so many cases that their medical infrastructure starts to get overrun and then they start seeing more deaths per case. I took a guess at what that might look like in the U.S. From there, we can use that to extrapolate how many people might die in total:

And what you see there is the difference between 10,000 and 100,000 people dying from this. The scary thing about the “No Action” scenario is that it’s exponential growth, which means that it’d hit 1,000,000 deaths a week later. This is why we need to take this seriously. Yes, the cost is huge and not just economic. But if we do the right thing, we can get through this.

In related news, I’m glad to see that Japan postponed the Tokyo Olympics. I’ve never been so happy to have a video made obsolete.