I was playing around with this for use in my video games which store a ton of data in IndexedDB (too much to read into memory at once) and thought maybe some other people might be interested in it too, since I haven't seen any other discussion of this topic.
The goal here is to move data from IndexedDB to a file without reading all of the data into memory at once. If you are able to read your data into memory, you can create a blob
and use URL.createObjectURL
to download it to a file - but that's old news. This is about streaming.
The building blocks of this are two fairly new web APIs: the Streams API and the File System Access API. The File System Access API is currently only supported in recent versions of Chrome, but it's the only way to stream data to a file.
What about getting data out of IndexedDB? The IndexedDB API predates streams, so it has no built-in support for that. But it does have cursors, which allow you to iterate over data in your database, which is basically the same thing.
Read more...
I got a fun email earlier today - a support request for literally the second piece of software I ever wrote, back in 2001 when I was a kid with a couple months of programming under my belt.
It's a click tracker that I called Click Manager. Pretty simple stuff - a Perl CGI script that counts how many times a link was clicked, storing the data in a flat file database.
Eventually I even added a nifty UI to view the stats. Check it out, in all its early 2000s glory:
Read more...
There are two possible goals that a government might have when imposing lockdown. The first goal is to eradicate the disease. The second goal is to prevent overloading hospitals with tons of sick patients at the same time. This is the "flatten the curve" strategy, where the idea isn't really to prevent people from getting infected, but to spread out the infections over time.
Those two goals are pretty different. Eradicating the disease is much harder. It requires a much stricter lockdown, and it is much more difficult to achieve when the disease is widespread in the population. Flattening the curve is easier (not "easy", just "easier") because it requires a less strict lockdown.
Read more...
Over at FiveThirtyEight there is a great article about why it's so hard to model the effects COVID-19. Basically their answer is that there are many factors that go into a model, but many of them are very uncertain, and many of them are also dynamic. For instance, what is the probability of transmission when an infected person interacts with a non-infected person? There's a lot of uncertainty in that estimate. But also, it's going to change over time. Particularly, as the pandemic worsens, people will likely do more social distancing and other mitigation strategies, resulting in a lower transmission rate.
Tricky stuff to predict precisely! But I think that's not quite the complete picture, and there's an even simpler and clearer explanation.
Read more...
I have a bit of time on my hands right now, so I figured I'd write up my current COVID-19 take. Not really because I think anyone cares. I mean, there are many better informed takes out there. I'm mostly writing this for myself, so I can look back on it and see how my perception has changed.
Read more...
In late 2019, a few videos appeared online showing some Pete Buttigieg supporters doing a corny dance to Panic! at the Disco's "High Hopes". Here's one, and another, yet another, and still one more.
The rapid release of all those different videos suggested to me that this was not an isolated incident. Crazed Mayor Pete fans must be doing that lame dance all over the place!
I was excited to see more videos. But sadly that never happened. Those are still the only four Pete Buttigieg dance videos I have ever seen.
So what happened? Did Mayor Pete decide to crush the high hopes of his supporters by banning their fun little dance? Or are they still doing it, but with extreme levels of security to prevent further online ridicule?
Very important stuff here!
Take a look at a portion of a normal NCAA tournament bracket. This is one region, cut off at the sweet 16, with all the favorites filled in:
Read more...
In 2010, I was kinda tuned out of the rap game. I'm not saying there was no good hip hop music in the late 2000s. There was definitely some good stuff. Big names like Kanye, of course. Some underground guys like Big K.R.I.T. and Wale were releasing great stuff. But there was also a lot of trash. Overall, it didn't hold my interest.
In 2012, by chance I heard Goldie on the radio. It sounded new, fresh, interesting, exciting. I wanted more. I started seeking out new hip hop music, and I was rewarded by discovering a ton of incredible new artists. This is why, even though I was born in 1985 and started listening to hip hop in the 90s, the 2010s are my decade for hip hop music. And as the 2010s are coming to an end, I'm feeling nostalgic for what a great decade it was.
So here we are. I'm going to go through the 2010s, starting in 2011, and talk about my favorite albums from each year. Why start in 2011 rather than 2010? Because that's when A$AP Rocky's first mixtape dropped.
Read more...