What determines the wild encounter rate in Pokémon?

An encounter in Pokémon Emerald Oh, come on.

I was playing through Pokémon Emerald recently, but got really turned off by the sheer volume of random encounters. It was way higher than I remembered as a wee elementary school kid, but I couldn't find any hard data on how the encounter rate was determined. Not even on Bulbapedia, a Pokémon wiki with ridiculously detailed documentation of every last aspect of every game.

That's when I stumbled upon a GitHub project that hosts a disassembly of Pokémon Emerald. I can read code, I'm stuck inside indefinitely due to a global catastrophe, and I need something to do. Let's read some 16-year-old C code!

Full post >

Today a colleague and I were building out our frontend experiment framework. The idea was simple -- a static object, initialized on page load with a JS object containing a mapping of experiment names to cohorts, and a few convenience methods to see if the user was in a given cohort for an experiment. Easy enough, but we decided to take it a step further and use Flow to make sure of a few things:

  1. All experiment names passed into our convenience functions are valid.
  2. All cohort names are similarly valid.
  3. Ensure that all requests to see if the user is in cohort x for experiment y are valid; in other words, that x is one of the cohorts registered for experiment y.
  4. All of the above should be done statically by Flow.

This turned out to be surprisingly tough. The main issue we ran into is that it wasn't possible to type one argument based on another. In Flow-ish pseudocode, I wanted something like this:

/** * Determine if the user is in cohort `experimentCohort` * of experiment `experimentName`. */ function experimentInCohort( experimentName: ExperimentName, experimentCohort: ExperimentCohorts[ExperimentName], ): boolean {...}

But of course, that's not remotely valid Flow! I'd have to think of something a little cleverer.

Hitman Bingo!


I couldn't sleep on an international flight so I made a bingo card generator for HITMAN 2016. The code quality is garbage, it's pretty ugly, and there's no fanfare when you win, but it's cool.

Check it.

The Raspberry Pi you loaded this site from It's web-scale!

One fine morning, I decided I should get my own domain. I have friends with snappy domains like denise.li and, despite my much-longer name, I was determined to snag a vanity domain for myself. After much scouring the internet, I grabbed wn.zone for the sick sh@wn.zone email address and sha.wn.zone URL. I set up my Github Pages site to serve from the latter and ran into some issues. Of course, that left only one option: to rewrite the site from the ground up and host it myself. That's easier, right?

So now, there's a Raspberry Pi 3 on the floor in my room serving this site. VPSes are overrated when you can hit a blistering 87 RPS on a 4W passively cooled ARM chip! Comments are gone, but seeing as the only people who ever visit this site are myself and Russian SEO spammers, I don't think that's much of a loss. The code is here if you're interested, but it's a bog-standard barebones blog app. Feel free to copy it or something.

Hyperthreading has had a long, albeit checkered past in Intel's CPUs. Originally launched in 2002 on that year's revisions of the Pentium 4 and Xeon, it was great in theory, but a combination of an immature hardware implementation and several games not being programmed for the pseudo-multicore CPUs meant the initial incarnation of HT often caused more headaches than performance gains. Later revisions of the Netburst microarchitecture as well as newer, SMT-aware software eventually resolved these problems, but the feature went the way of the buffalo with the release of the Core line of CPUs in 2006. It wasn't until Nehalem in late 2008 that the feature returned, with a supposedly more mature implementation of the feature. Despite it being present on every Core m and i7 processor released since, as well as many Atoms, i3s, and i5s, plus almost all Xeons, I wasn't able to find any hard data on what kind of performance gains it brought. So naturally, I decided to gather some myself.