entropy-arbitrage/2022-03-21-discrim.md

6.4 KiB

layout title date categories tags summary thumbnail proofed
post Developer Journal, Elimination of Racial Discrimination 2022-03-21 07:29:05-0400
programming
project
devjournal
Progress on assorted projects /blog/assets/Mother-Tongue-Day-Islamabad.png true

Today is International Day for the Elimination of Racial Discrimination, commemorating the slaughter of almost seventy peaceful protestors in 1960 South Africa. I assume that it probably doesn't need more explanation than that.

Islamabad demonstration supporting the Punjabi language

You don't need to learn a new language now, though. You can wait until after I ramble about projects.

Morning Dashboard

{% github jcolag/dash %}

Some refactoring turned out to be necessary, here. The code previously tested for the existence of a date-line several times, for some reason, so that is now a single check with multiple subordinate conditions.

You could rightly ask why this is an issue now, instead of cleaning up that code far sooner, and the answer is...time zones. Twice a year, I have trouble updating the blog, because posts written ahead of time don't account for the changing clocks. To fix that, the dashboard code now validates the offset from UTC and, if it doesn't match the current time's offset, warns that it needs fixing.

Of course, this code goes in just as the United States Congress is deliberating whether to eliminate daylight saving time permanently.

G.L.O.B.E.

{% github jcolag/g-l-o-b-e %}

As promised by both the title and my rambling about the game, G.L.O.B.E. now has its enemy.

As mentioned [on Sunday]({% post_url 2022-03-13-globe %}), players now have a travel budget of roughly twenty-five thousand miles (the circumference of the Earth) to find the destination country. If the player goes over that budget to reach the target, an Agent of E.N.E.M.Y.---I'll probably work out the acronym later...or maybe not---wins instead, represented by the 🕵🏿‍♀️ detective emoji of varying genders and skin tones.

Unicode doesn't have a "spy" emoji, but many font creators have apparently realized this oversight and dressed their detectives in trenchcoats and sunglasses, rather than the expected magnifying glass. Surely, that won't cause some sort of apocalypse, when Unicode eventually adds a "secret agent" code-point in a few years...

Iungimoji

{% github jcolag/iungimoji %}

During the week, I happened to notice that a player can win the game, then continue clicking the finished game to bump the click total. I doubt that anybody would do that deliberately, so it was time to change that.

Unfortunately, Iungimoji doesn't really have a custom win-state---because players can see that they have exposed all cards without any special feedback---so this requires a sneaky move in the click-handler. Yes, that last phrase originally read "quick trick in the click-handler," before realizing...well, ick.

if (
  document.getElementsByClassName('success').length ===
  document.getElementsByClassName('cell').length
) {
  return;
}

Because the game adds and removes CSS classes for its basic animations, it can count the exposed cards to compare them with the total number of cards using those CSS classes.

Ham Newsletter

{% github jcolag/ham-newsletter %}

It's certainly not a sophisticated problem to have solved, and it should have---and definitely would have---gotten quietly lumped in with a different issue if I noticed it in time, but I finally fixed the inane rogue period in the newsletter boilerplate text.

For those not signed up to the newsletter, (a) you're missing out on great content 😇, but more relevant here, (b) I had at least a couple of months when my description of changed posts ended a sentence prematurely, probably because my finger slipped when expanding that text. You might think that the grammar checker would spot "hey, there's a period after the word it, and then the next sentence starts with a lowercase letter," but apparently not, even though it definitely harasses me about each of those issues whenever I include code in a post, like above, where it complains that length isn't capitalized...

Entropy Arbitrage

{% github jcolag/entropy-arbitrage-code %}

In an effort to catch more potential issues in future blog posts, two static checkers now join the standard analysis process.

  • alex tries to catch terms that a reader might not consider inclusive.
  • write-good makes stylistic recommendations.

Neither tool is perfect. Both have a tendency to make blanket pronouncements about an assortment of words---that certain words are profane or that certain adverbs "weaken meaning"---without explaining their contexts or looking at the word's context in the text. However, the false-positives feel potentially worthwhile, since other tools ignore passive voice and exclusionary language.

Maybe of interesting to some readers, neither tool outputs JSON, which the blog's analysis script presents. This required writing formatters. The write-good code takes a --formatter argument to present the output in useful forms. However, alex only has a --parse option to output a colon-delimited list of issues. In both cases, I wrote some quick JavaScript to output what I need, stored in the _plugins folder.

Next

I haven't quite decided. I would like to finish the game aspects of G.L.O.B.E., by adding the artifacts to find. Also, as the number of tools checking these blog posts grows, the output becomes more difficult to follow, as I need to keep jumping back to the top of the file and start over, so---especially now that I handle some intermediate processing of output---I may try to unify the different JSON blobs.


Credits: The header image is Mother Tongue Day, Islamabad by Khalid Mahmood, made available under the terms of the Creative Commons Attribution Share-Alike 4.0 International license.