Simon Willison’s Weblog

Subscribe

March 2021

72 posts: 13 entries, 15 links, 3 quotes, 41 beats

March 1, 2021

Drawing the rest of the owl

My ambitious goal for the day was to get the new Django/PostgreSQL preview into a state where we could start sending example API requests to it from the help.vaccinate app.

[... 371 words]

How I cut GTA Online loading times by 70% (via) Incredible debugging war story: t0st was fed up of waiting six minutes (!) for GTA Online to load on their PC, so they used a host of devious debugging tricks to try and figure out what was going on. It turned out the game was loading a 10MB JSON file detailing all of the available in-game purchases, but inefficient JSON parsing meant it was pegging an entire CPU for 4 minutes mainly running the strlen() C function. Despite not having access to source code or debugging symbols t0st figured out the problem and managed to inject a custom DLL that hooked some internal functions and dropped load times down from 6m down to to 1m50s!

# 7:12 pm / debugger, hacking, profiling

March 2, 2021

API ready for testing, first video status update

To celebrate GitHub’s new support for drag-and-dropping mp4 files into Markdown, I decided to switch things around a little and include a video update with today’s blog entry.

[... 656 words]

TIL Writing tests for the Django admin with pytest-django — I'm using [pytest-django](https://pytest-django.readthedocs.io/) on a project and I wanted to write a test for a Django admin create form submission. Here's the pattern I came up with:

March 3, 2021

TIL Show the timezone for datetimes in the Django admin — Django supports storing dates in a database as UTC but displaying them in some other timezone - which is good. But... by default datetimes are shown in the Django admin interface without any clue as to what timezone they are being displayed in.

Replaying logs to exercise the new API

22 days ago n1mmy pushed a change to help.vaccinate which logged full details of inoming Netlify function API traffic to an Airtable database.

[... 542 words]

March 4, 2021

google-cloud-4-words. This is really useful: every Google Cloud service (all 250 of them) with a four word description explaining what it does. I'd love to see the same thing for AWS.

Update: Turns out I had.

# 12:40 am / google

March 5, 2021

Git scraping, the five minute lightning talk

Visit Git scraping, the five minute lightning talk

I prepared a lightning talk about Git scraping for the NICAR 2021 data journalism conference. In the talk I explain the idea of running scheduled scrapers in GitHub Actions, show some examples and then live code a new scraper for the CDC’s vaccination data using the GitHub web interface. Here’s the video.

[... 289 words]

The SOC2 Starting Seven (via) "So, you plan to sell your startup’s product to big companies one day. Congratu-dolences! [...] Here’s how we’ll try to help: with Seven Things you can do now that will simplify SOC2 for you down the road while making your life, or at least your security posture, materially better in the immediacy.

# 7:50 pm / security, startups

March 6, 2021

The simplest possible call queue

Today I’ve been working on the queue calling mechanism for the new Django backend.

[... 471 words]

March 7, 2021

TIL How to run MediaWiki with SQLite on a macOS laptop — Today I [got curious](https://twitter.com/simonw/status/1368414296888070146) about how MediaWiki records page history, so I started digging around and in the process figured out how to run it against a SQLite database on my macOS laptop!

Weeknotes: Datasette and Git scraping at NICAR, VaccinateCA

This week I virtually attended the NICAR data journalism conference and made a ton of progress on the Django backend for VaccinateCA (see last week).

[... 773 words]

New call queue ready to test. Also geography.

I just shipped the first working preview version of the new /api/requestCall API [#54]—the API that our caller app uses to get the next location that the caller should be contacting (and lock it so that other users don’t call it at the same time).

[... 697 words]

March 8, 2021

TIL Pretty-printing all read-only JSON in the Django admin — I have a bunch of models with JSON fields that are marked as read-only in the Django admin - usually because they're recording the raw JSON that was imported from an API somewhere to create an object, for debugging purposes.

March 9, 2021

APIs for importing locations

An important aspect of the new backend is the ability to import new locations.

[... 254 words]

March 11, 2021

Release tableau-to-sqlite 0.1 — Fetch data from Tableau into a SQLite database
Release tableau-to-sqlite 0.1.1 — Fetch data from Tableau into a SQLite database
Release tableau-to-sqlite 0.2 — Fetch data from Tableau into a SQLite database
TIL Flattening nested JSON objects with jq — I wanted to take a nested set of JSON objects and import them into a SQLite database using `sqlite-utils insert` - but I wanted to "flatten" some of the nested rows.
TIL Converting no-decimal-point latitudes and longitudes using jq — I had some data with weird co-ordinates in it:
Release datasette-ripgrep 0.7 — Web interface for searching your code using ripgrep, built as a Datasette plugin
TIL How to almost get facet counts in the Django admin — For a tantalizing moment today I thought I'd found a recipe for adding facet counts to the Django admin.

March 12, 2021

TIL Querying for GitHub issues open for less than 60 seconds — While [writing this thread](https://twitter.com/simonw/status/1370390336514658310) about my habit of opening issues and closing them a few seconds later just so I could link to them in a commit message I decided to answer the question "How many of my issues were open for less than 60 seconds?"

March 13, 2021

TIL Querying for items stored in UTC that were created on a Thursday in PST — This came up as [a question](https://news.ycombinator.com/item?id=26443148) on Hacker News. How can you query a SQLite database for items that were created on a Thursday in PST, when the data is stored in UTC?
Release django-sql-dashboard 0.1a — Django app for building dashboards using raw SQL queries
Release django-sql-dashboard 0.1a2 — Django app for building dashboards using raw SQL queries
Release django-sql-dashboard 0.1a3 — Django app for building dashboards using raw SQL queries
Release hacker-news-to-sqlite 0.4 — Create a SQLite database containing data pulled from Hacker News

March 14, 2021

Weeknotes: tableau-to-sqlite, django-sql-dashboard

Visit Weeknotes: tableau-to-sqlite, django-sql-dashboard

This week I started a limited production run of my new backend for Vaccinate CA calling, built a tableau-to-sqlite import tool and started working on a subset of Datasette for PostgreSQL and Django called django-sql-dashboard.

[... 792 words]

March 15, 2021

Release django-sql-dashboard 0.2a0 — Django app for building dashboards using raw SQL queries