PageRanking People and Blogs interviews
I recently learned about PageRank, the original Google algorithm for ranking webpages. It works by constructing a Markov chain on links between pages and computing the stationary distribution. The stationary probability of a given page measures the page’s centrality in the web, an index of popularity.
I wanted to try implementing the algorithm myself and fiddle with a few Rust libraries, so I wrote a script that runs PageRank on interviews from the People and Blogs series. P&B interviews are a tidy dataset for the algorithm, because Manu always asks interviewees to recommend other blogs, then he uses these recommendations to pick subsequent interviewees. This means the graph is well connected despite its small size.
I was going to share the results here, but ranking blogs by popularity seems against the spirit of the indie web ethos, so you’ll have to run the program yourself. (But to make it clear I’m not covering anything up, let me acknowledge that my interview is in a 61-way tie for last place, with all the other blogs that had no links to them.)
A few observations from this exercise below.
Find your perfect match with integer programming
Owen Lacey blogged about a reality game show called Are You the One? in which contestants win a prize by guessing the soulmate ordained for them by the show’s producers. Specifically, there are men and women, and each one has an unknown “perfect” match; to win the prize, the contestants (as a group) must pair everyone up correctly.
During each episode, the contestants get two kinds of clues:
- Truth Booth, where the contestants submit a single couple and learn whether that couple is a perfect match.
- Match Up, where the contestants submit a matching (assigning everyone to a couple) and learn the number (but not the identity) of perfect matches present in their matching.
The game ends after Match Up if all couples in the matching are correct. Definitely check out Owen’s post, which has a better (and illustrated!) explanation of the rules.
Below, I present an efficient algorithm for playing Are You the One. It exploits both the informational clues and contestants’ intuitions to find perfect matches quickly. With modest assumptions on the quality of players’ intuitions, my algorithm wins by episode 10 in 100% of simulated seasons.
Pytest + Ruff + Mypy
There is a pytest-ruff plugin for
Pytest (a Python testing framework) that will automatically run
ruff format --check and ruff check as part of your test suite. The
pytest-mypy plugin does the same thing
for Mypy. These plugins are handy, but for some reason , the tests they generate
are exempted from the pytest -k ... logic. Normally, you can use -k to
select a subset of tests to run, but if you install one of the plugins
mentioned, that plugin’s tests run no matter what. This can slow you down if,
like me, you develop on a slow computer.
So, here’s what I use instead of pytest-ruff and pytest-mypy: A humble
test/test_qa.py file with three functions.
import subprocess
import sys
from pathlib import Path
import mypy.api
REPO_ROOT = Path(__file__).parent.parent
def test_mypy():
stdout, stderr, returncode = mypy.api.run([str(REPO_ROOT)])
sys.stdout.write(stdout)
sys.stderr.write(stderr)
assert returncode == 0
def test_ruff_format():
subprocess.run(
[sys.executable, "-m", "ruff", "format", "--check"],
cwd=REPO_ROOT,
check=True,
)
def test_ruff_lint():
subprocess.run(
[sys.executable, "-m", "ruff", "check"],
cwd=REPO_ROOT,
check=True,
)
(I run Mypy via its Python API instead of the command line to save a tiny bit of
subprocess.run() overhead, but it doesn’t make a massive difference.)
This gets you all the functionality of the plugins, but with two fewer
dependencies, and the -k flag works:
# Run tests for an in-progress feature and skip QA
pytest -k test_some_feature
# Run only the QA tests
pytest -k test_qa
# Run all tests
pytest
Person of the Year 2006
If you need a fun fact for a corporate icebreaker activity, you can always say, “I was Time magazine’s Person of the Year in 2006,” then stand around awkwardly waiting for someone to Google it.
The official announcement of “your” accomplishment makes for good reading in 2025. In tech circles, we often regard the early days of Web 2.0 as a time of naivety when we thought that letting anyone post on the internet would democratize media and unlock an era of creative expression. Of course, we know now that it isn’t so simple—that open platforms can amplify extreme views, for example, or serve as vectors for misinformation. But apparently we also knew this then, in the earliest days of YouTube and Facebook:
Web 2.0 harnesses the stupidity of crowds as well as its wisdom. Some of the comments on YouTube make you weep for the future of humanity just for the spelling alone, never mind the obscenity and the naked hatred.
But that’s what makes all this interesting. Web 2.0 is a massive social experiment, and like any experiment worth trying, it could fail.
Obviously, the course we chose twenty years ago led us to the world of today. But we didn’t select this path arbitrarily, or without regard for the challenges it would present; we examined the risks and decided the experiment was worth it.
I got a similar sense from reading Thomas Friedman’s The World is Flat (2005), which lays out a theory of globalization based on the convergence of technological development (the internet) and trade liberalization. Some of the passages feel quaint:
If there is a skilled person in Timbuktu, he will get work if he knows how to access the rest of the world, which is quite easy today. You can make a Web site and have an e-mail address and you are up and running. (Ch. 3)
(In the ebook, I commented, “Taxes? Immigration law?”) But elsewhere, Friedman anticipates critiques of globalization which have now become standard:
In the flat world, the balance of power between global companies and the individual communities in which they operate is tilting more and more in favor of the companies, many of them American-based. These companies command as much if not more power than many governments. (Ch. 13)
Not to mention “What the world has never witnessed is an old-style pandemic in a Wal-Mart world,” later on in the same chapter.
Urban Arts Career Pathways Takeover
My team at work recently got to host a Career Pathways Takeover at Urban Arts, a nonprofit based in New York that teaches programming, animation, and storytelling education to high schoolers to prepare them for success in college and beyond.
I was so impressed by the students’ thoughtfulness and engagement. We walked our group of Game Academy students through our team’s event planning process, and in less than an hour they put together a rock-solid plan for a community arts program to raise awareness about mental health issues, including how they’d use data to capture the event’s positive impact (where I fit in). I hope the vision can become a reality before long…!
Massive thanks the Urban Arts team for hosting us and for all that you do through the Game Academy.