Friday, 2021-12-03

Gemini in November

Not quite as much as last month but still keeping up a decent pace.

Link to portal.

Wednesday, 2021-12-01

Advent of Code 2021

Project website: Advent of Code 2021.

Previous years: 2015, 2016, 2017, 2018. 2019. 2020.

I use Perl for all the solutions.

Most assume the input data is in a file called input.txt in the same directory as the file.

Ratings

I’m giving each puzzle a subjective rating between 1 and 5. This is based on difficulty, “fiddliness” and how happy I am with my own solution.

A note on scoring

I score my problems to mark where I’ve finished a solution myself or given up and looked for hints. A score of 2 means I solved both the daily problems myself, a score of 1 means I looked up a hint for one of the problems, and a zero score means I didn’t solve any of the problems myself.

My goals for this year (in descending order of priority):

  • get 40 stars or more (75%)
  • solve all problems up until day 15 without any external input
  • solve all problems within 24 hours of release

Link to Github repo.

Day 1 - Day 2 - Day 3 - Day 4

Day 1 - Sonar Sweep

Day 1 - complete solution

And we’re off!

I wonder if I got a bit too clever by half in this solution, as I’ve been looking over older solutions and can’t even remember solving them. But that’s how it goes I guess.

Puzzle rating: 3/5

Score: 2

Day 2 - Dive!

Day 2 - complete solution

A “standard” Perlish solution (well, my kind of Perl, anyway): a dispatch table for the else/if “switch” construct, and a compact hash containing the state of the two solutions.

Puzzle rating: 3/5

Score: 2

Day 3 - Binary Diagnostic

Day 3 - complete solution

I was honestly surprised that the canonical solution to this wasn’t some esoteric bit-twiddling trick that reduces it to a one-liner.

In part 2, the naive solution is to loop through each “column” to determine which values to count so as to determine whether they are most frequent or not. I used an index for each “set” to keep track of the values already assigned to that set.

Puzzle rating: 3/5

Score: 2

Day 4 - Giant Squid

Day 4 - complete solution

Fairly straight-forward, although part 2 threw me for a loop. I didn’t find a good way to determine the exit condition.

Puzzle rating: 4/5

Score: 2

Tuesday, 2021-11-30

November

S:a Clara Mr. Walker

Nov 2020 | [Nov 2019] | Nov 2018 | Nov 2017 | Nov 2016 | Nov 2015 | Nov 2014 | Nov 2013 | Nov 2012 | Nov 2011

Friday, 2021-11-12

Four books by Isaac Asimov

  • A Pebble in the Sky
  • Foundation 🚀☀️ Foundation and Empire 🚀☀️ Second Foundation

A Pebble in the Sky

This is Asimov’s first published novel but unlike the Foundation series itself it’s not a fix-up from earlier short stories.

There are some good nuggets here, I enjoyed it more than I thought I would. Far-future Earth under the Galactic Empire is a radioactive hell-hole, and Earthmen (emphasis very much in the original) are despised throughout the Galaxy as diseased and bigoted primitives. The planet can only support 20M people and this is enforced by mandatory euthanasia at the age of sixty. The world is ruled by a figurehead assisted by a sinister Secretary - the real power behind the throne.

So far, so 1950s era anti-Soviet. The devious Earthlings plan on unleashing their native viruses on the rest of the Galaxy, thereby killing everyone without their native immunity. But our heroes - a rock-ribbed Galactic citizen, his Earth-born love interest, and an elderly tailor transported through time from our own age, foil the plot, despite the Secretary’s machinations and the Empire’s prejudices.

The Foundation trilogy

Foundation is better than I remembered. I first read it in Swedish translation back in the 80s when I started reading SF, and I made an effort to “re-read” them via audiobook about 7 years ago but had to give up because the prose was so clunky.

If you’re writing a story inspired by the fall of the Roman Empire, you can do worse than crib from Gibbon - but you can do better, too. Asimov obviously knew his audience, and his generation’s attention to “tech detail” is quite amusing, mixing in as it does wild speculation with assumptions that some thing will never change.

Take this passage for example from the beginning of the novel, when the “prophet” Hari Seldon reveals his plans to his new employee Gaal:

It was not a large office, but it was quite spy-proof and quite undetectably so. Spy-beams trained upon it received neither a suspicious silence nor an even more suspicious static. They received, rather, a conversation constructed at random out of a vast stock of innocuous phrases in various tones and voices.

[Seldon] put his fingers on a certain spot on his desk and a small section of the wall behind him slid aside. Only his own fingers could have done so, since only his particular print-pattern could have activated the scanner beneath.

[…]

“You will find several microfilms inside,” said Seldon. “Take the one marked with the letter T.”

Gaal did so and waited while Seldon fixed it within the projector and handed the young man a pair of eyepieces. Gaal adjusted them, and watched the film unroll before his eyes.”

Quite the mix of spot-on prediction and … stuff that will probably not last 15,000+ years into the future.

And then we have anachronisms that are not quite as charming:

“All my project; my thirty thousand men with their wives and children, are devoting themselves to the preparation of an “Encyclopedia Galactica.”

(my emphasis)

There is not a single female character in Foundation who has a name.

Foundation is put together from short stories, and that’s quite a good thing. It keeps the action (such as it is) contained and the tale is quite snappy. It’s classic sub-Whig history in which the decadent Empire gets replaced first by technology masking as religion, and then by hard-nosed “Yankee” traders.

Foundation and Empire comes alive when the Mule is introduced. We also get our first named female character, who saves the day by being, well, kind and beatiful and motherly.

Second Foundation is a slog. Asimov can’t decide whether the Second Foundation (who can control people’s minds, and even themselves say they have to potential to create a Master Race) are a promise or a threat. In the end they’re succesful in hiding themselves from the masses of humanity (with the help of the most cringe-worthy depiction of a female teenager imaginable) so the Seldon Plan can continue. Yay? Maybe Asimov expands on this in the prequels and sequels but someone would have to gift me a hell of a lot of money for me to read those.


Part of the reason I read these works was this HN thread referencing a New Yorker review of the recent screen adaptation.[1] I was honestly surprised to see someone presumably my age or less who actually rated Foundation. I mean, it’s a 70-year old work, and of course SF like most genre literature is in constant dialog with the stuff that came before. But maybe SF is unique in that its foundational[2] texts are still “what SF is” to a worrying number of people.

Compare and contrast Foundation to Alfred Bester’s The Stars My Destination with its criminal antihero protagonist, or Harrison’s Bill, The Galactic Hero, which mercilessly skewers the very idea of a Galactic Empire, or Charles Stross’ Neptune’s Brood which basically declares humans will never colonize space - but our android descendants might. And of course, Ann Leckie paints the Empire where everyone is technically a female protagonist…

[1] Hacker News is bad at a lot of things but they’re almost uniquely bad concerning SF
[2] see what I did there?

Tuesday, 2021-11-02

Heretics and Believers: A History of the English Reformation by Peter Marshall

I tweeted while reading this book:

can’t wait to quit work so I can continue reading about the English Reformation

It sounds weird, but a narrative history about the English reformation is just that good. Marshall keeps the story moving along briskly through the decades and scores of characters. Highly recommended.

Sunday, 2021-10-31

Wednesday, 2021-10-27

15,000 dead in Sweden

Wednesday, 2021-10-20

30 minute offset

Some hacker tried to interest us in their new project, and was quickly torn to pieces corrected on HN.

This got me thinking, how large a percentage of the world’s population can’t use this tool?

  • Afghanistan, pop. 32.9M on UTC+04:30
  • Central Australia (Northern Territory and South Australia), pop. 2.017M on UTC+09:30
  • Central Western Standard Time (Eucla, Australia), pop. ~100 on UTC+08:45
  • Chatham Islands, pop. ~600 on UTC+12:45
  • India, pop. 1.353B on UTC+05:30
  • Iran, pop. 83.1M on UTC+03:30
  • Myanmar, pop. 55.6M on UTC+06:30
  • Nepal, pop. 28M on UTC+05:45
  • Newfoundland and Labrador, pop. 520k on UTC-03:30

That’s a total of 1.556B people, which is around 20% of the world’s population.

Needs more work.

Bonnie Prince Charlie: Charles Edward Stuart by Frank McLynn

A great biography, even if it’s showing its age (published in 1988). There’s a bit too much pop psychology and hidebound attitudes towards homosexuality for my taste. That said, even if the women in Charles Edward’s life are routinely described as “calculating” and “coquetteish”, the book does acknowledge that their situation was a difficult one.

There’s rarely a dull moment in this book, even if you’d think that after the excitement of the ‘45 and the “prince in the heather” things would get boring. On the contrary, it’s Stuart’s precipitous fall in health and wealth that grips you the most.

I also enjoyed reading about Gustav III of Sweden basically cajoling Charles Edward for the title of Grand Master of the Masons, something he really didn’t have the authority to give away. Masonry, like Jacobitism, was way bigger back then apparently.

Thursday, 2021-10-14

“Sweden didn’t have lockdowns” and other COVID myths

During the height of the COVID-19 pandemic it was common to see Sweden singled out as “not implementing lockdowns”. It was as if Sweden didn’t take any action against the spread of the virus. This was used both as praise and condemnation, depending on the views of the person saying this.

The truth is a bit more nuanced.

First, “lockdown” is a slippery term, but I’ll define it as a situation where a citizen is not allowed to leave their homes except to get groceries, medicine or other essential supplies, and the authorities have a legal way to enforce this.

Sweden lacked the legal framework in the beginning of the pandemic to enforce anything like this. The constitution adopted in 1971 explicitly avoided implementing a “state of emergency” clause because it was seen as a gateway to tyranny. Any emergency legislation would have to be implemented by the Riksdag.

Sweden implemented a number of voluntary measures to enforce social distancing:

  • everyone who could work from home was encouraged to do so
  • the normal 1-day sick day without pay (karensdag) was waived
  • the state took over the payment of the first fortnight of sick leave from employers

(Sick pay is generally 80% of take-home pay up to a limit.)

Restaurants, theaters and sports venues were regulated by public health laws that were implemented to restrict attendance. But these laws do not extend to other venues such as hairdressers or general stores.

Controversially, this also applied to political demonstrations.

The net result was a marked decrease in the number of people traveling to work, going out to lunch, etc.

After a few months, legislation was passed that enabled the authorities to restrict opening hours in restaurants and bars.

As of Oct 2021, all restrictions have been lifted.

What all this didn’t really help with was with Sweden’s total deaths, which I personally believe had more to do with the shameful lack of preparation and protection of elderly people in care homes. But I do believe it helped limit the spread of the disease, thereby preventing health care resources from being overwhelmed.

Did this help Swedish businesses? Its hard to say. Those that relied on people coming in like restaurants, hotels, travel in general suffered a lot. Hardware stores and places that could deliver probably saw increased business.

Sweden’s per capita death rate is about average compared to other EU countries (and lower than Belgium’s which had famously strict lockdowns), but much higher compared to other Nordic countries like Denmark, Norway and Finland. This has been a source of great debate and is, I believe, attributable to different handling of the very old and infirm.

Sunday, 2021-10-10

Proposal for healthy webforums

This archived Kuro5hin post by user ‘anaesthetica’ poses a number of provocative questions, and although dated (posted 2009) still has relevance for today’s fora.

It’s a long read, I’ve reproduced the conclusion below.


Conclusion

There are serious problems with existing web forums’ institutional capacity to sustain constructive interaction over the long term. The foregoing has been an attempt to rethink what constitutes community and society on the web, and what the requirements for sustaining them are in an environment of rapid scaling.

The conclusions reached about the weaknesses of current forums are:

  • Eternal September presents web forums with an inability to avoid the dilemma that scaling creates for socialization.
  • Community and society, as forms of interaction, are not just different in scale but also different in kind.
  • Community doesn’t scale, and society is difficult to enforce.
  • User registration and barriers to participation do not prevent community-destroying behavior.
  • Scale quickly outpaces moderators’ ability to enforce socialization of new users.
  • Current forms of user moderation and trust ratings are vulnerable to gaming and attack.

Recommendations for a hypothetical forum structure are summarized as follows:

  • Forced anonymity fosters society by countering vanity, making users modular, and placing the focus on the content/comments.
  • Moderation can be improved by making it passive, scarce, and focused on comment quality rather than agreement with the substance of the comment.
  • Conversation, not isolated comments or voting scores, must be the central criterion of user interaction.
  • Communal groupings can emerge organically from society based on demonstrated constructive conversation.
  • Forums should discriminate between original content, link-n-blurb content, and personal content.
  • Story promotion and front page position should be determined by quality of conversation not voting.

It should be stressed that none of these are radical innovations. Most are already implemented piecemeal in some form or another in the various web forums, bulletin boards, chat rooms, and newsgroups throughout the internet. But there is no forum providing a coherent combination of these elements. I believe that these factors will provide the institutional foundation for a web forum that can achieve a greater scale-free status than any that we currently possess.

Wednesday, 2021-09-29

Setting up a Gemini server

I host my stuff on a Digital Ocean VPS.

I already have a webserver running, and my domain points to it.

I followed the steps in this instruction with some added wrinkles:

  • I could not get agate to start correctly, it would not bind to the ipv4 port 1965. After some desultory troubleshooting I used gemserv instead.
  • I didn’t bother compiling gemserv to use GGI, just static content.
  • The cert and key .pem files generated from the instructions worked great in gemserv
  • I used the systemd service example from the instructions, just replacing the call to agate with the call to gemserv

Update Wednesday, 2021-10-06

The main site can be reached on gemini://gerikson.com.

I’ve set up a gemlog using Blosxom on gemini://gerikson.com/gemlog/.

Tuesday, 2021-09-28

Gemini: the misaligned incentives

This is a followup to this post.

Since last time I took a dump long hard critical look at Gemini, I’ve decided to set up a server: gemini://gerikson.com. This article is reproduced there.

This has forced me to actually write gemtext, and boy do I not like it.

How does gemtext suck? Let me count the ways:

Long-ass lines

The Gemini protocol works line by line, so if you, like me, have been writing prose for time out of mind and have relied on your editor to justify paragraphs so the line isn’t just one long one… a client will probably mangle these, depending on the width it is using to display paragraphs. You get unbelievably ugly ragged borders.

But, the documentation says,

This means that, e.g. “dot point” lists or poems with deliberately short lines will be displayed correctly without the author having to do any extra work or the client having to be any smarter in order to recognise and handle that kind of content corectly. (sic!)

So, in order for simpler handling of “dot point” lists or poems, every author of gemtext will have to either live with long lines, or, more likely, introduce a software component before publishing to convert normally justified text paragraphs to long lines.

There’s another effect that I’ve noticed - boneheaded treatment of “text units” such as ISO dates and URIs. Most clients will happily treat a hyphen as an invitation to make a line break, regardless if this mangles dates or stuff like long command line options.

No inline links

I’ve already ranted about this, but now I’ve read some more Gemini content, and I still believe this is the greatest loss of Gemini. Hypertext is its own thing. Being able to be creative, or strict, or whimsical, or coherent with how you place your links or how you add the link text is a great expansion of human expression through text.

Gemini throws this away. It shows in most prose written in gemtext. The links are awkwardly placed, and the “placeholder” markers (such as numbers or brackets) to connect the text to the link below has not gelled to a standard.

No text markup (italics or bold)

Centuries of typographical refinement and tradition, thrown away for no good reason.

Note that this extents to newer conventions like code fragments, these are only supported as blocks, not inline.

What I don’t actively despise

The limit to 3 header levels and lack of numbered lists are personally ok for me.

Gemini culture prioritizes developers to a fault - but only up to a point

Just today I found a link about something called “favicon.txt” - essentially a single emoji that the console client I use (amfora) could use as a site identifier in its tabs.

In any normal project, this would have been seen as a cool feature, but in Gemini it is seen as a harbinger of the adtech apocalypse. The protocol is fixed in stone - for the stated reason that it should be easy for a normally talented developer to code a client over a weekend.

There’s nothing inherently wrong with this ambition, but it must be realized that it turns the usual developer/user dynamic on its head. Normally, the user’s requirements are interpreted by the developer, who makes concessions based on the user’s explicit and implicit actions. For example, the ubiquitous hashtag was something that emerged organically among Twitter’s users, and which the service incorporated as a new feature.

This makes economic sense as an expression of comparative advantage. Generally, users are prepared to “pay”[1] to not have to code something themselves. The developer can be seen a domain expert, prepared to spend time and resources to craft a product that appeals to the most users.

But Gemini states, as part of its explicit goals, that the protocol should be easy to develop for. This shifts the burden from the few (developers) to the many (users). To accommodate the ease of developers, users’ expression must be hobbled.

But it also means that developer’s natural curiosity has to be limited, lest they stray from the one true path of being able to easily develop a new client, should they wish to.

In short, Gemini is aligned towards a new developer, not invested in the ecosystem, to come in and develop software - but once they try to transition to a seasoned developer, or a user, the ecosystem denies them room to grow, to identify the pain points that have been overlooked by the original designers, or to take the project in a new direction.

As I’ve stated before, I’m sympathetic to the goals of Gemini, but the means are entirely inadequate to reach those goals. It’s an exercise in technical asceticism, dressed up in idealism.

Update Wednesday, 2021-09-29

This piece was submitted to lobste.rs and Hacker News and I think generated some interesting discussions. I urge the reader to peruse these to see where I am utterly incorrect above.


[1] this payment need not be monetary, as in the case of deep breath Free/Libre and Open Source Software.

Tuesday, 2021-08-31