Chinatown, at night
It is a little strange to think back on when I used to post here pretty much every day.
Since closing our store, spending a year finding a new job, and now being thoroughly immersed in that job for nine months, I have felt very uprooted from having a particularly healthy routine. Did I ever have a healthy routine? Maybe not, but in any case it has felt particularly unhealthy the last few years. Living in an ongoing, barely-acknowledge pandemic and the collapse of the United States probably isn’t going to feel particularly healthy any time soon, either.
But I am trying, and part of that has been getting out and enjoying the city of Los Angeles.
Every weekend there is a Thai night market in Chinatown (called “DS Night Market” which doesn’t have a website but you can search for their Instagram). They have different entertainment each night, but Sunday is always Karaoke Night. There are some great vendors, the people watching is fantastic, and it is a great excuse for us to walk to and/or from Chinatown.
It is disappointing that Chinatown isn’t getting the investment it could use to become a thriving community again, but the sort of sustained small/mid-scale investment that would be needed just isn’t something that exists any longer. I fear this story from the Los Angeles Times about Yue Wa Market closing is just another heartbreaking example of what is going to keep happening.
(The photo was one I took on the way back from the night market one weekend. The night market itself is a few blocks away from this.)
The Martian Contingency
The Martian Contingency by Mary Robinette Kowal is the latest in the Lady Astronaut series. I guess I started reading this series while I wasn’t blogging my little notes like this. It is an alternate-history/science-fiction series where a meteor strikes the East Coast of the United States, which spurs space exploration. It shares a tiny bit of DNA with For All Mankind, re-casting the end of the space race as if had continued with the same sense of urgency that it had started with instead of fizzling off into what it has become.
They are enjoyable novels, but I find myself simultaneously appreciating how it is exploring gender and race relations in this context, and people tackling with mental health issues, and annoyed at how clunky it can be.
I find myself also annoyed at the whole premise of colonizing Mars when the leading proponent of that right now is a vainglorious white supremacist fascist. It is an implausible scenario to begin with, and it is harder to suspend my disbelief to enjoy the fiction of science fiction when it is tied up in that.
Using AutocompleteSelect in a Django Admin form
I was building an action for a Django Admin changelist
view to allow associating models to a related model. But to select the related model on the form, a regular ModelChoiceField
would load all of the possibilities to populate the <select>
form field, which was pretty terrible when there are thousands to tens of thousands of options.
Within the change
view of the model, you can just add that field to autocomplete_fields
and Django has a nice built-in widget that uses a Select2-style form input. It is called AutocompleteSelect
. I couldn't find any examples of someone using this widget outside of it being pulled in by autocomplete_fields
but it ended up being surprisingly easy.
Here is a rough example of the form definition at the heart of the solution:
from django import forms
from django.contrib.admin.widgets import AutoCompleteSelect
from .models import Model, RelatedModel
class BatchAssociationForm(forms.Form):
related_field = forms.ModelChoiceField(
queryset=RelatedModel.objects.all(),
label="Related",
help_text="Select the object to relate to",
widget=AutocompleteSelect(Model.related_field.field, admin.site)
)
No extra package necessary. I am using Django 5.2, and I have no idea if this will work with earlier versions.
A while back, I wanted to build a filter for a changelist
admin that used the autocomplete widget for selecting the value(s) to filter on. Now that I cracked it for a form, maybe I should revisit that idea.
An earlier rhyme
1177 B. C. : The Year Civilization Collapsed by Eric H. Cline is about the collapse of the empires in the eastern Mediterranean in the early 12th century B.C. There seem to have been several factors, but the evidence that a mega-drought that impacted the area in that time may have been the most significant seems to me to be growing. What is fascinating is how unknown this history is, and the ways it has to be pieced together from various archeological digs, studies of climate change, and trying to fit it together with the stories that are attributed to these times (like the exodus of the Old Testament). What are future historians and archeologists going to have to do to piece together how our current empires fall?
The Mercy of Gods
Picking up The Mercy of Gods by James S.A. Corey was my way of getting my reading habit un-stuck. This is the first novel in what will presumably become a sprawling series of works like the novels and short stories of The Expanse.
This is (so far) totally removed from our reality, set initially on a world that humans appear to have colonized, but that is in the distant, not-quite-known past. The world is invaded by an alien empire which enslaves or exterminates all of the worlds it encounters, and the core group of protagonists (scientific researchers who had just discovered how to bridge the two “trees of life” on their world) are taken to a prison/research facility where they need to prove their (and humanity’s) worth.
It reminded me a bit of both Octavia Butler's Xenogenesis series and, honestly, a bunch of other science fiction that I couldn’t name specifically. They are not breaking any particularly new ground here, but it is a pretty solid story and I look forward to seeing where they go with the series.
Exordia
Exordia by Seth Dickinson is a door stopper of a book, but still manages to only feel like the prologue to a bigger story. I'm not sure I would recommend it, sort of how I felt about his other book series.
Fly, little blog, fly!
In the early days of my job search, I applied for a position at Fly.io. Their hiring process is structured around “work-sample challenges” that are meant to show the kind of work you’d be doing. The challenges are done on Fly.io infrastructure, of course, so they gave me an account loaded up with credits. I never actually got around to doing the first challenge before they paused hiring.
The most recent setup of this blog running on a $2/month VPS from IONOS was mostly okay, but the particular configuration of Caddy with PHP-FPM was prone to getting stuck, and I was also interested in trying to move to using SQLite instead of MySQL.
So now this is running on Fly machines using LiteFS, which is a distributed file system that replicates SQLite databases. So really this is running on two Fly machines, and I could scale that up and across regions. It seems pretty snappy to me on just two machines in one region.
James
I finished reading James by Percival Everett recently. It is a reimagining of Mark Twain’s Adventures of Huckleberry Finn from the point of view of Jim, the escaping slave that Huck befriends along his journey. The spin this puts on it is fantastic, although I wish I had re-read the original first so all of the crossovers and callbacks would have hit more fully.
End of the year reading catch-up
I have finally been able to get back into reading some books for pleasure, and so I need to catch up with some mini-reviews.
Dissolution by C. J. Sansom is the first in a series of books set in Tudor England featuring Matthew Shardlake, a hunchbacked lawyer working for Thomas Cromwell, in this one investigating a murder at a monastery as those institutions are being dismantled. In the time between when I first put a hold on this book and finally started reading it, the cover changed to highlight that there is now a television series on Hulu called Shardlake that is based on the books. It is a good mystery that seems to be absolutely loaded with historical details and atmosphere, and eventually I will probably get around to reading more of the series and perhaps checking out the show.
The Ministry of Time by Kaliane Bradley is a wonderful time-travel story. A mysterious door has allowed the government (British) to pluck several individuals out of time and bring them to the present day, and the protagonist works as a “bridge” to one of the “expats,” a naval officer from 1847 who would have otherwise died as part of the Franklin expedition to the Arctic. Like any good time travel story, it gets weird. It’s being adapted as a series by the BBC and A24, so that is promising.
Those Beyond the Wall by Micaiah Johnson is a sequel to Space Between Worlds which I read back in 2022 when I wasn’t writing here. The first book was very much a “multiverse” sort of story, and while the second shares the setting and some characters, the story stays in one world. The characters and world are really well-developed. It has more than a little of a Mad Max vibe but commenting more directly on American racial and queer politics. My memory is a little fuzzy on the first book, but it had made enough of an impression that I picked up the sequel without hesitation.
Just make it better
This access hatch on a sidewalk on Main St. in downtown Los Angeles used to have chipped concrete around the edges and the doors had a lot of flex to them when you walked over them. A few weeks ago, it was finally fixed up and now it looks clean, the doors don’t have any flex to them, and my near-daily experience of walking on that stretch of sidewalk feels a little bit better and safer.
Today, the website for the PHP Documentation Team was finally moved to a new host. Everything (or nearly so) related to the installation is on the appropriate repositories, it’s being served up over TLS, some of the code has been cleaned up, and the contribution guide has gotten more focused attention than it has had in several years.
None of this is perfect. None of it is done. But making things incrementally better is the kind of good trouble that I want to continue.
Another side of the fence
I keep running into things about the Zig community that intrigue me. The latest was this post by Loris Cro about “Critical Social Infrastructure for Zig Communities,” where these paragraphs really grabbed me:
We definitely also need bolder moves, but for now let's try to take it one step at a time, starting from structuring our communities around the idea that other interesting Zig communities exist out there, and that we should try harder to at least stay informed of what we all are collectively working on.
Conversely, we should also strive to make it easier for others to keep track of what we are doing. The time for bolder moves will come, but this a strong prerequisite before can we get to those.
Maybe it is because it is a new and small community compared to PHP’s, but the Zig community seems pretty great. Mitchell Hashimoto’s investment in the community is a good sign.
A lot of what Loris wrote about also brought to mind the IndieWeb principles and my own interest in promoting the ideal of doing open source development in the open using open tools. I chafe every time a community is centered on Discord or Slack, or finding that the real discussions and decision-making is happening in inaccessible places. One person’s tight-knit community can be another’s exclusive club.
What we have now
I ran across this RFC “analysis” by Zeev Suraski that was a response to a proposal about PHP adopting a Code of Conduct. Particularly the section headlined “The RFC process is [all that] what we have.”
In it, he says:
A person that joined internals@ only after the RFC process was enacted in 2011 may be excused to believe that the RFC process is all we have, and that it governs every possible aspect of the PHP language. However, that isn't true - and there's ample evidence for that available.
First, there are fundamental principals which date all the way back to the late 1990's, that are apparent to anybody who reads the archives. One of these core tenets was covered above - open unrestricted discussion.
Another, which is just as real, is decision by consensus for critical decisions.
As a principal author of the Voting RFC and as the person who came up with the 2/3 bar - I can say with absolute confidence that it was meant to regulate feature proposals - and not transforming policy changes - which this proposal certainly falls under. You don't only have to take my word for it - there - 'clues' are available all over the various RFC documents, beginning with the Voting RFC itself:
[ ... ]
It's true that since the Voting RFC process was enacted, it was used for limited-scope / tactical policy decisions. However - neither of these imply that it suddenly became as our sole form of governance that can be applied to everything - especially as it attempts to make the giant leap to cover topics like project participation policies, mailing list censorship and full-fledged banning of members. It's also worth pointing out that even in the handful of cases where it was used for minor policy changes - all of these policy changes effectively cleared the bar of decision by consensus, and not just barely clearing a 2/3 bar - which would have implied an extremely controversial decision.
That was five years ago, and it looks like the PHP project has only veered further away from Zeev’s ideal of a consensus-based approach for anything but feature proposals.