Today marks the 171th anniversary of the release of Herman Melville’s Moby-Dick; or, The Whale, a fictionalization of the sinking of the Essex by a sperm whale and the pursuit of the unrelated sperm whale Mocha Dick.

If you haven’t seen it, you might want to take a look at 2010’s crowdsourced Emoji Dick, which amusingly provides emoji “translations” for each sentence, some more precise than others. ☎👨⛵🐳👌, indeed.

An illustration of Moby-Dick destroying a whaling boat

And since my writing almost certainly doesn’t live up to Melville’s, let’s just quietly segue into the programming projects.

Social Media

I don’t have any code, here, but I do want to note that, since I do see people moving onto Mastodon, I set up cross-posting from Twitter to Mastodon.

Should you need to do something similar, I decided to use the service at https://crossposter.masto.donte.com.br/, for now. I could run my own, but I don’t consider this a particularly high priority. If an article gets lost, it’ll still end up in the Friday posts.

Chances are, I’ll refine this in the future, but right now, I’ll apply a content warning of “From Twitter” to such cross-posts, and the tool will only cross-posts actual tweets from me, so that I don’t accidentally start cluttering my Mastodon timeline.

Entropy Arbitrage

GitHub - jcolag/entropy-arbitrage-codeThe Jekyll blog for https://john.colagioia.net/blog - jcolag/entropy-arbitrage-code

Chances seem good that nobody will ever notice the difference, but the blog now ignores .git and .github folders, so that I don’t need to worry about the post issue template ending up published.

You might notice some slight changes in verbiage to upcoming Friday posts. It seems well past time to squeeze out passive voice. I have a post in the works on why.

And definitely noticeable, but not as a change, I added some CSS for yesterday’s short story to support the social media post mock-ups. It came out surprisingly well, given that it had to represent almost any site.

I actually almost wrote a series of plugins to create different kinds of posts with different CSS classes to support distinct styles, but this seemed to work well enough.

CPREP

GitHub - jcolag/background-generatorCPREP: A simple web application to provide semi-believable background details for fictional characters - jcolag/background-generator

I don’t know how much I have to say, here, other than “work progresses.”

Specifically, the non-server page now has enough of a path to load, identify, and process all external data files. It even knows how to handle JSON and CSV files differently, and bumped the original load handler code to the end of the startup sequence. It’ll probably move more, as I get other things squared away, but at least things look consistent, now.

Admittedly, it has required some odd choices, like putting all the stored data in a single object. Few programming languages, as you probably know, have a way to choose a destination variable to store data, and JavaScript doesn’t number among them, so I needed to put them all in a common place, separated by a key.

Other than that, however, my hack of maintaining a list of files to use as a synchronization method inspired by semaphores seems to work better than I would have expected. I say “inspired by” semaphores, because we expect software to monitor an actual semaphore and begin or continue a process when it clears. By contrast, I set it up so that the final fetch() thread knows—because it empties the list—that it can continue, while the rest of them exit silently.

I don’t believe that JavaScript interpreters would currently allow two of these asynchronous tasks to proceed simultaneously. But if they do in the future, then I’d need something more robust, to make sure that the code doesn’t corrupt its own management structure. For example, if it finished reading two files simultaneously, then it could try to remove both filenames from the list at the same time. In such a case, one task would delete the wrong filename from the list, making it impossible to continue, because the expected filename would never leave the list.

Next

I’ll probably continue with CPREP, though I notice that I have some library updates building up to deal with, too.


Credits: The header image is one of Augustus B. Shute’s illustrations for the 1892 edition of Moby-Dick, long in the public domain.