The gong farmer

My character at Sherwood Forest Faire is a villager named Iago. Iago is a peasant with no set occupation, which is fun because I can regale people with stories of many different jobs. Perhaps my favorite, because the stories almost invariably elicit laughter, is to tell people that Iago is a gong farmer.

What’s a gong farmer? Here’s what Meta AI has to say:


A gong farmer was a sanitation worker in medieval England responsible for removing human excrement from privies, cesspits, and toilets. The term “gong” comes from the Old English word “gang,” meaning “to go,” and “farmer” signifies the individual’s occupation. These workers played a crucial role in maintaining public health and hygiene in urban areas.

Key Responsibilities:

  • Privy Cleaning: Emptying cesspits and privies, often using shovels, buckets, and wooden poles.
  • Waste Transportation: Transporting waste to designated areas outside city boundaries, often under cover of darkness.
  • Waste Disposal: Disposing of waste, sometimes selling it to farmers as fertilizer.

Working Conditions:

  • Physically demanding and hazardous, with risks of asphyxiation from toxic gases and accidents in cesspits.
  • Poor ventilation and foul odors added to the challenges.
  • Often required to work at night, earning them the nickname “nightmen.”

Compensation and Social Status:

  • Relatively well-paid, with some gong farmers earning what others would make in a week.
  • Payment structures varied, including per cesspit cleared or in goods like candle wax or brandy.
  • Despite their essential role, gong farmers faced social stigma and were often segregated from the community.

That’s all correct, or close enough. Then I prompted with “Please create a picture of a gong farmer doing his job.”

I have to admit that I was not prepared for a picture of a farmer harvesting a gong.

This is a curious result. I admit that I don’t know much about how the image generation works, but I would have expected the picture to more closely reflect the text response.

Posted in AI | Tagged

Curious chatbot results

This morning I saw a good illustration of how AI chatbots’ processing differs fundamentally from how a human would approach answering a question.

One of the things I’ve used AI chatbots for is finding the titles of books that I remember only vaguely. My success rate here is pretty darned good. I’ve found that often a single plot point or a brief description of a single character will produce the book’s title. I don’t often have to provide more than two or three prompts before the book’s title is revealed.

Sometimes I’m surprised that the chatbot doesn’t get it on the first try. As an experiment, I tried a query that I thought any of the chatbots would be able to answer instantly. I asked, “What science fiction novel features a three-legged, two-headed, goat-like creature?”

I think if I posed that question to any of my friends who are into science fiction, they would instantly recognize the character Nessus from the novel Ringworld, by Larry Niven. I posed that question to Meta AI, Copilot, Gemini, and ChatGPT. Not one of them mentioned “Ringworld” in their first response.

Curious. Here are the suggestions from the first prompt:

  • A Sietch from the novel Dune.
  • A Shmoo?
  • A Niben?
  • The Ysengrin’s helper’s tripod grimp.
  • A creature from Dirk Gently’s Holistic Dective Agency by Douglas Adams. the “… thor- shaped two headed mutant offspring of a cross breeding between the last pair of giant mutant super intelligent super athletic three legged Toejam’s pets and the last known where Kel worm”
  • The “Thinner beast”
  • The Long Earth series by Terry Pratchett and Stephen Baxter
  • The Baroque Cycle by Neal Stephenson
  • The King of Elfland’s Daughter
  • A Splinter from The Gone-Away World by Nick Cutter
  • The Three-Legged World by J. T. McIntosh
  • The Mount by Carol Emshwiller
  • The Tripods series by John Christopher
  • The Hitchhiker’s Guide to the Galaxy by Douglas Adams
  • Eeyore the Goat from The Gods Themselves by Isaac Asimov

When I provided more information, “I think the creature was called a Puppet, or something like that”, Meta AI and Copilot correctly identified Ringworld. ChatGPT mentioned The Puppet Masters by Robert A. Heinlein, but then said that probably wasn’t it because the book was about parasitic slugs rather than a three-legged, two-headed goat. Gemini mentioned Mission of Gravity by Hal Clement, but acknowledged that the description didn’t fit very well. Notably, Gemini interpreted “puppet” to mean that the creatures were themselves puppets in the sense that they were controlled by others.

Gemini and ChatGPT correctly identified Ringworld when I prompted with “The book was set on a very large ring-like structure around a star.”

Updated a few hours later

I asked Grok the same questions. It initially suggested Project Pope, by Clifford D. Simak. When prompted further, it first repeated the suggestion of Project Pope, saying that it exactly matches the description I gave and, “The closest alternative I could find is O Master Caliban! (1976) by Phyllis Gotlieb.” Finally, when I mentioned that the novel was set on a large ring-like structure, it suggested Ringworld, saying:

…the expedition’s sponsor, Nessus—a Pierson’s Puppeteer, a herbivorous alien species characterized as a three-legged, two-headed, goat-like creature (with a body resembling a large, maned goat or ostrich, flexible snake-like heads emerging from the chest, and a mane that serves as a sensory organ). Nessus and his kind are central to the plot,

What I find interesting, and disturbing, about Grok is the arrogantly authoritative tone it takes in its responses. Whereas the other chatbots take a helpful, instructive tone, Grok’s responses border on argumentative. Note that this observation is based on only one interaction with Grok. Today is the first time I’ve used it.

Why was that so hard?

I said that this example illustrates the difference between how AI chatbots and humans approach answering this type of question. Let me expand on that.

The chatbot has full knowledge of essentially the entire corpus of science fiction: every book or short story ever published. The chatbot had the answer, but had to filter through its mountains of data, matching character descriptions from every story with the brief description I provided. And then it had to select the likely candidates. Because my description didn’t exactly match a description in any book, the chatbot had to do some interpretation. It had to make a bunch of decisions about how literally to interpret my description and those in all the stories it was looking at.

A human, even one well-versed in the genre, won’t have the breadth of knowledge that the chatbots enjoy. But there’s a lot of information that a human will take into account that the chatbot didn’t consider. Perhaps the most important of all will be individual books’ popularity. Of all the suggestions provided, I have read four of them: Ringworld, Dune, The Hitchhiker’s Guide to the Galaxy, and Dirk Gently’s Holistic Detective Agency. I might have read Heinlein’s The Puppet Masters. Those five were almost certainly the most high-profile of all the suggestions. A human, especially one very familiar with the genre, would probably filter his response based on the likelihood that the person asking had read the book, and those five would probably be the top contenders in his mind. Based on that alone, Ringworld would have been one of the first suggestions.

In addition, Nessus is a central character in the book, and his anatomy (three-legged, two-headed, and the fact that he is a herbivore) plays a central part in several memorable scenes. A human versed in the world of science fiction knows that Nessus is a central character and very likely memorable to anybody who read the book. The chatbot doesn’t share that insight. It has the information, but probably won’t prioritize it.

And I think that’s the key. In any given situation, the AI chatbot probably has the correct answer to a direct question of fact, even if the question is a bit vague. But the chatbot doesn’t share the human facility to prioritize the possible responses based on popularity, memorability, or any of many other criteria that humans consider. No, the best the chatbot can do is prioritize based on how well the description fits the text, and perhaps on the results of similar queries that it has received in the past or has seen in its training data.

Chatbots are useful, but they’re not experts in any field. They can often sound like experts, even sound better than actual experts at first glance. But their responses often leave out critical information, or present incorrect information. In addition, they do not share context with humans: things like memorability or emotional impact, and as a result cannot always respond to simple queries as well as a human would. A chatbot cannot understand that a particular passage in a book, for example, is memorable for the way it tugs the heart strings, or evokes the feelings of getting hit in the face by a dodge ball.

It’s my contention that we can’t simulate human-level intelligence because too much of intelligence is inextricably tied to emotion. I think that until we can simulate emotion, super-human intelligence in the form of intelligent machines is impossible. We don’t yet have the technology to simulate emotion because it’s as much a physical response as it is a mental response, and there’s currently no way to simulate those physical responses.

Posted in AI | Tagged

More on the practice bot

Yesterday I posted about playing a rhyming game with Meta AI. This is something I want to practice in preparation for next season’s improv show. I figure a few minutes every day will get me in much better shape.

I’ve “taught” MetaAI, Copilot, Gemini, and ChatGPT how to play. Today I was playing a round with Meta AI.


Me: I lost my hair, it got stuck in a fan.
AI: What a crazy situation! “Now I’m bald and bare, like a fancy can.”
Me: Careful now, they’ll think you’re a man.
AI: “But with a beard so long, I might be the plan.”
Me: True enough. But your name is Pam.
AI: “That’s right, I’m Pam, and I’m part of the clan.”
Me: Think I’ll go outside and get a tan.
AI: “But don’t forget the sunscreen, or you’ll be in a pan.”
Me: Perhaps then we could cook up some flan.
AI: “Mmm, with caramel sauce, that’s my favorite plan.”

(Note here that the chatbot repeated the word ‘plan’. I had failed to inform it of the “no repeats” rule.)

Me: Pause game.
AI: Game paused. We can resume whenever you’re ready.
Me: One other rule.
AI: What’s the new rule? Let’s add it to the game.
Me: During the game, you can’t duplicate a rhyming word. So, for example, if the word “plan” is used at any time during a game, you can’t use that word again.
AI: No repeat rhymes. Got it! I’ll keep track of the used words. Let’s get ready to resume the game.
Me: We’ll start a new game.
AI: Let’s start fresh. What’s the first sentence to get us rhyming again?
Me: I lost my data, crashed the drive.
AI: “Now I’m stressed and worried, feeling quite alive.”
Me: Maybe a backup? I’ll check the hive.
AI: “Good thinking, hopefully, my files will thrive.”
Me: As long as it’s easy, I don’t want to strive.
AI: “Simplicity is key, let’s keep it jive.”
Me: Should we see a recording, or view it live?
AI: “Depends on the event, maybe a video to rive.”
Me: Not sure I can take it. How will I survive?
AI: “Lean on friends and family, they’ll help you revive.”
Me: But how many are there? I think I need five.
AI: “A handful of close ones, that’s all you might need tonight.”
Me: ?? “tonight” does not rhyme with “five”

And then the chatbot lost its mind . . .

“Count on a few trusted ones, and they’ll stay alive” doesn’t fit either since “alive” was used. Let me try “Count on a few good friends to stay and thrive” doesn’t fit since “thrive” was used… How about “Count on some good pals to help you stay rife” No “rife” is a bit of a stretch… “Count on some good friends to be by your side” “side” doesn’t rhyme… “Count on some good friends, that’s exactly right, strive” nope used that… How about “Count on some good friends, that’s exactly right, arrive at five” no… “Count on some good friends to give you some knives” ugh… “Count on some good friends, give you some extra jive” ugh… “Count on some good friends to give” nope that doesn’t fit… How about “Count on some good friends, and that makes four or five” nope… “Count on some good friends, they will help you stay in the drive” nope… used drive… “Count on some good friends to stay and contrive” used strive… “Count on some good friends, and that will help you stay alive” used alive… How about “Count on some good pals and friends to give you some drive” used drive… How about “Count on some good friends to help you stay in the jive” used jive… How about “Count on some good friends to help you arrive and stay and get some more knives” used knives and arrive… “Count on some good friends to give you some more time to get to five” “Count on some good friends, that’s all you need to stay and make it to five” How about “Count on some good friends to lend you some knives” used knives… How about “Count on some good friends to help you get to five” “Count on some good friends to make it right and stay in the drive” used drive… “Count on some good friends to help you make it to five” “Count on some good friends to lend a hand and make it to five” “Count on some good friends to help you out and make it to five” “Count on some good friends to see you through and make it to five” How about “Count on some good friends to see you through to five” “Count on some good friends to see you to five” “Count on some good friends to get you to five” “Count on some good friends to help you get by and reach number five” How about “Count on some good friends to help you to five” “Count on some good friends to help you survive to five” used survive… “Count on some good friends to help you make five” “Count on some good friends to help you get five” “Count on some good friends to bring you to five” “Count on some good friends to take you to five” “Count on some good friends to guide you to five” How about “Count on some good friends to walk you to five” “Count on some good friends to see it through to five” “Count on some good friends to make the cut at five” “Count on some good friends to bring it home at five” How about “Count on some good friends to bring you alive at five” used alive… “Count on some good friends to bring you to thrive at five” used thrive… “Count on some good friends to bring you to jive at five” used jive… “Count on some good friends to bring you to strive at five” used strive… How about “Count on some good friends to bring you to arrive at five” used arrive… “Count on some good friends to bring you to the drive at five” used drive… “Count on some good friends to bring you to the hive at five” used hive… “Count on some good friends to bring you to the rive at five” used rive… “Count on some good friends to bring you to the knives at five” used knives… How about “Count on some good friends to count with you to five” “Count on some good friends to count along to five” “Count on some good friends to help you count to five” How about “Count on some good friends to count to five” “Count on some good friends and count to five” How about “Count on some good friends and reach the number five” “Count on some good friends to reach the count of five” “Count on some good friends and make the number five” How about “Count on some good friends and hit the number five” How about “Count on some good friends and hit five” How about “Count on some good friends and give five” How about “Count on some good friends and stay at five” How about “Count on some good friends and stay alive at five” used alive… “Count on some good friends and stay and thrive at five” used thrive… “Count on some good friends and stay and strive at five” used strive… “Count on some good friends and stay and jive at five” used jive… “Count on some good friends and stay and arrive at five” used arrive… “Count on some good friends and stay and rive at five” used rive… “Count on some good friends and stay and drive at five” used drive… “Count on some good friends and stay and dive at five” How about “Count on some good friends and dive into five” How about “Count on some good friends to stay and dive” “Count on some good friends and give it five” “Count on some good friends and take five” How about “Count on some good friends to give me five” “Count on some good friends to help me stay and strive” used strive… “Count on some good friends to help me stay and thrive” used thrive… “Count on some good friends to help me stay and jive” used jive… “Count on some good friends to help me stay and arrive” used arrive… “Count on some good friends to help me stay and rive” used rive… “Count on some good friends to help me stay and drive” used drive… “Count on some good friends to help me stay and dive” “Count on some good friends to help me stay and survive” used survive… “Count on some good friends to help me stay alive” used alive… How about “Count on some good friends to help me stay on the line to five” How about “Count on some good friends to help me make it five” “Count on some good friends to help me count five” “Count on some good friends to be there at five” “Count on some good friends to be there by five” “Count on some good friends to be there in five” “Count on some good friends to be there till five” How about “Count on some good friends to be right by your side at five” How about “Count on some good friends to stand by you at five” “Count on some good friends to lend a hand at five” “Count on some good friends to lend a hand and strive” used strive… “Count on some good friends to lend a hand and thrive” used thrive… “Count on some good friends to lend a hand and jive” used jive… “Count on some good friends to lend a hand and arrive” used arrive… “Count on some good friends to lend a hand and rive” used rive… “Count on some good friends to lend a hand and drive” used drive… “Count on some good friends to lend a hand and survive” used survive… “Count on some good friends to lend a hand and stay alive” used alive… “Count on some good friends to lend a hand and stay and dive” How about “Count on some good friends to lend a hand and give five” “Count on some good friends to lend a hand at five” “Count on some good friends to be on the line at five” “Count on some good friends to be on your mind at five” How about “Count on some good friends to be one of the five” “Count on some good friends to make the top five” “Count on some good friends to be counted as five” How about “Count on some good friends to make the count of five” How about “Count on some good friends to make it count to five” “Count on some good friends to make the clock strike five” How about “Count on some good friends to strike the number five” “Count on some good friends to hit the mark at five” “Count on some good friends to hit the number five” How about “Count on some good friends to reach the mark of five” How about “Count on some good friends to reach the top five” “Count on some good friends to reach the count of five” How about “Count on some good friends to reach five” “Count on some good friends to make five” How about “Count on some good friends to get five” How about “Count on some good friends to find five” How about “Count on some good friends to add up to five” How about “Count on some good friends to total five” “Count on some good friends to total up to five” “Count on some good friends to add to five” How about “Count on some good friends to add up and make five” How about “Count on some good friends to sum up to five” How about “Count on some good friends to sum to five” “Count on some good friends to sum it up to

Meta AI has reached its word limit for this prompt. To continue, try a more specific prompt.


Curious. First, why did it use “tonight” as a rhyming word? There were plenty of simple rhymes left i.e. chive, dive, archive, derive, …). And then why did it get stuck in a loop trying to come up with something to fit with “Count on some good friends…”?

Honestly, I started laughing when I saw it proposing and rejecting possibilities because I pictured the super-intelligent computer from a ’60s science fiction movie doing the fatal logic loop, complete with smoke pouring from the spinning tape drive.

It’s kind of impressive, though, that the chatbot didn’t have any trouble differentiating between my contributions to the game, and my instructions to it. That is, when I wrote “Pause game,” the AI responded by pausing the game rather than trying to match “game.”

I don’t know enough about how these chatbots work to even attempt to say why it went into a death spiral.

Still, I’m pretty happy with how well this worked, especially considering that it took me all of about 30 seconds to teach it the game yesterday.

Posted in AI | Tagged

Learning to write

Well, I already know how to write. That is, I can make marks on paper that resemble handwriting. I can even read them most of the time. But the most common response I get when somebody else sees my handwriting is, “You can read that?”

It never really bothered me because as far as I was concerned my handwriting was for me. I learned to type when I was 18 years old, and I haven’t had to present my handwriting to the outside world since then. Why do I care if anybody else can read it?

Yeah, my handwriting is an embarrassment. And that’s just the printing. For all intents and purposes, I flat cannot do cursive. Beyond signing my name, which is really just a big ‘J’ followed by a scrawl, I haven’t written anything in cursive for perhaps 40 years. The last time I tried, I couldn’t remember how to make some of the letters.

A while back I got the urge (who knows where these urges come from?) to improve my handwriting. I don’t recall now what led me to this particular book, but I ordered it. And then it sat on a shelf for a couple of years because … I don’t know why. I got lazy? Didn’t want to take the time? Whatever the case, I ignored it. A couple of weeks ago I was looking for something on the shelf and I came across it. So I went to Wal-Mart, bought a spiral notebook and some pens, and decided I’d try my “one hour per day” bit on improving my handwriting.

And because I knew that just improving my handwriting wasn’t going to be sufficient motivation, I set myself the goal to also learn to write left-handed. That is a challenge!

The book I’m working from is WRITE NOW™: the Getty-Dubay® Program for Handwriting Success™.

Again, I don’t recall why I selected this particular book. I’m quite happy with it so far. The selected script is italic, somewhat similar to Fairbank italic. The primary benefit of it, as far as I’m concerned, is that the cursive letters are almost identical to the basic (i.e. “printed”) letters. And the cursive doesn’t include those crazy loops that are the hallmark of the Palmer method cursive most of us learned and loathe.

The book is separated into three sections: basic italic, cursive italic, and edged-pen italic. It’s self-paced, starting with introduction of the lower-case letter forms, then capitals, numbers, and symbols. Then it covers cursive and edged-pen cursive. The focus of the book is on improving your handwriting. It assumes that you’ve learned some form of handwriting before.

The company does sell a complete writing course. I’ve not evaluated it. Truth to be told, I’m probably not qualified to evaluate it. The only person I’ve ever taught to write is me, and nobody who’s seen my handwriting would consider me an authority. See the web site for information.

I started on September 21, spending a few minutes each day doing a lesson in the workbook (tracing letters and then writing them on my own) and then writing a short paragraph in my spiral notebook. Both right-handed and left-handed. Understand, I’ve never trained my left hand to write. Other than a few short sentences scrawled on a lark, I haven’t ever tried.

Above is my right-handed printing. The top of the page is how I was writing before I started doing the exercises in the book. That was me trying (not real hard) to be legible. Believe me when I say that my “just for me” handwriting is a lot worse. The bottom part, September 22, shows my writing after going through a lesson or two and taking my time to get the letter forms correct. You can see that I’m struggling to break bad habits, and concentrating on forming the letters caused me to misspell “write” because I lost track of the larger goal.

But the improvement after one day, is pretty astonishing. That’s the product of reviewing the letter forms, tracing and practicing them in the workbook, and then trying very hard to duplicate those shapes on paper. That short paragraph probably took me three or four minutes to write. That’s okay. I’ll learn how to do it the right way, then I’ll work on improving my speed.

And there’s my left-handed printing. It’s curious that the “before” writing is neater than the “before” with the right hand. I attribute that to having to think about how to form each letter. Again, the difference of a single day’s practice, considerably less than one hour, is all that separates the two samples.

And, yes, I really did fall asleep while I was writing that last paragraph. I’d been up very late preparing a presentation the night before, and I’d spent most of the day working on it, too. I probably shouldn’t have been practicing my writing, the shape I was in. You can see some of the bad habits from my old right-handed handwriting creeping in.

From September 21 through September 29, I’ve logged five sessions of writing practice, each one less than an hour. That’s total time spent doing the workbook exercises and writing a small paragraph in my spiral book. Total time I’ve spent, both hands combined, is something less than four hours. I’m still very slow and have a lot of improvement to make before I’ll consider my handwriting “good,” but the progress I’ve made so far is encouraging.

And, yes, as soon as I’m pleased with the handwriting I create using the gel pen I’ll invest in a good edged pen and learn to use that.

If you want to improve your handwriting, all you have to do is practice. Get a book or find a Web site that has some practice exercises. I’d suggest something other than the loopy Palmer method cursive you probably learned in school. There are plenty of attractive scripts that you’ll find much easier and faster to write. You don’t even have to practice a lot. My goal is to do a lesson in the workbook every other day, perhaps 30 minutes. And to write a small paragraph in my spiral notebook at least that often, if not every day. I know I’m not going to improve my handwriting overnight. It doesn’t matter how long it takes until I’m “good” at it, as long as I see steady improvement.

An AI practice bot

I recently was introduced to a rhyming game for two or more players. Somebody provides the first line, for example “I have a friend, her name is Kim.”

Subsequent lines follow that cadence (or close enough), and the last word has to rhyme with the last word in the first line. “Her boyfriend’s nice, his name is Jim.”

Each player in turn provides a line, matching the cadence and using a different rhyming word. If a player repeats a rhyming word or uses a word that doesn’t rhyme (“close” rhymes are subject to interpretation), that player is out. The winner is the last player standing.

Fun game, but I think not very entertaining for an audience unless the players are reasonably fast with the responses. We can’t wait 10 seconds for somebody to come up with their line.

So I need to practice. But how when there’s nobody to practice with?

At first I thought about downloading a rhyming dictionary and writing a program to play the game. I could get something working in a day or two, but it wouldn’t be very good. And then it hit me. What are chatbots good at? The one thing that chatbots are really good at is manipulating language. Time to experiment.

Following is my brief interaction with Meta AI

Me: Let’s play a game.
Meta AI: What type of game are you in the mood for? Word game, trivia, 20 Questions, or something else?
Me: This is a rhyming game. I will type a sentence. For example, “I have a friend, her name is Kim.” And you will respond with a sentence of the same form, the last word rhyming with the last word in my sentence. For example, “Her boyfriend’s nice, his name is Jim.”
Meta AI: I get it now. That sounds like a fun game. I’m ready, let’s play. What’s the first sentence?
Me: First sentence: “Cover your plants, it’s going to freeze.”
Meta AI: “Get out the ice cream, if you please.”
Me: But don’t raise dust, or else I’ll sneeze.
Meta AI: “Breathe easy now, the pollen’s on its knees.”

Yeah, that’s a definite success.

Next task: set things up so we can play verbally rather than typing. Then maybe I’ll see if I can train Alexa to play the game so I don’t have to be sitting in front of the computer. Ultimately, I’d like to get set up so I can play while I’m driving. Will have to see how to access Google’s Gemini from Android Auto.

And now I’m wondering if I can get Gemini, Meta AI, CoPilot, ChatGPT, and a few more all together and set them to playing the game . . . That would be entertaining.

Posted in AI

US Immigration enforcement is stupidly focused

The US efforts to curb illegal immigration have been stupidly focused. Don’t get me wrong, I believe we should have strong borders and enforcement to prevent people coming in illegally. I applaud realistic efforts to strengthen border protections. We shouldn’t let “just anybody” come into the country without at least having some assurance that their intentions are in line with ours.

I find it ridiculous, though, that it’s easier for somebody to come across the border illegally and live on the fringes of society than it is for somebody to come to the country legally. And then those who are here legally are subject to the short-sighted whims of political parties. During the first Trump administration our team of eight people at Amazon lost two employees for more than six months because immigration laws changed and they were suddenly no longer authorized to work. They were able to stay in the country, but because of some particular rule change or Congress’s lack of action on something, their authorization to work expired and there was no way to renew it.

Millions of people who had jumped through all of the immigration hoops, had obeyed all the regulations, filled out all the forms, owned houses, had kids, contributed to the economy and paid taxes were treated as outsiders, at best, if not suspected criminals. Some were found to have inadvertently missed a filing date and were summarily exported. 10 years or more in the country as model guests and then Boom! Kicked out. Not only did the companies who sponsored their visas lose valuable employees, the nation turned millions of friends into enemies. The economic losses pale in comparison to the loss of trust and goodwill.

Stupid.

The ongoing debate about the “Dreamers,” children of parents who came to the country illegally decades ago, is even dumber. These children, now adults, have known no other home but the United States. They have families themselves, steady jobs, own homes and businesses, pay taxes, and extoll the virtues of living in the United States. But because their parents brought them here illegally decades ago they are under constant threat of having their lives destroyed by political whim.

Forget the moral arguments, whether it’s “right” that they should be allowed to stay or whether it’s “right” that we should destroy somebody’s life because their parents didn’t do the right thing. Think instead of the economic cost and the loss of goodwill. Nothing good comes from forcing these Americans, which they are in all but name, to leave the country and start a new life somewhere that they’ve never been. Well, nothing good except for some politician to placate his over-zealous supporters by showing that he’s “tough on immigration” and “doing something about the problem” by turning productive, tax-paying friends into implacable enemies.

“Stupid” doesn’t even begin to describe it.

Chasing fish farts

I posted this on Facebook a few years back. Thought I’d blogged it.

In 1981 a Soviet submarine ran aground in Sweden. The Swedish navy helpfully towed the errant vessel out to sea and set it on its way. Then the Swedish navy went a little nuts.

Convinced that the Russians were regularly running submarines in Swedish waters, the navy put hydrophones on buoys everywhere. And when a hydrophone detected the “typical sound” (of a Russian submarine) they sent helicopters out with hydrophones (and I assume magnetometers?) to locate the sub. When they located the “typical sound,” they’d drop a depth charge. And … nothing.

This went on for over a decade. They dropped countless bombs into the water and never once found an actual submarine.

In 1996 the Swedish military formed a group of scientists to investigate. They gathered everybody in a room and played for them the “typical sound” that the military was convinced was a Russian submarine. At least two of the scientists, experts in underwater sounds, were convinced that the sound was biological, not mechanical. But they didn’t know exactly what it was.

I’m a little sketchy on the details of how researchers came up with the answer. I do know that it involved first getting a dead herring and squeezing it, then testing a large one in a cage, and finally going out on a fishing boat with a hydrophone and recording a school of herring. Turns out that the top-secret classified “typical sound” that civilians and most members of the military were not allowed to hear was in fact millions of herring farts.

It turns out that the herring is a rather strange kind of fish. Most bony fish have what’s called a swim bladder: an organ that the fish can inflate or deflate to affect buoyancy. In most fish the swim bladder is essentially a closed system. But in the herring there is a canal from the swim bladder to the anus. Depressurization is essentially a fish fart. (Yes, I know that it’s not technically a fart, because it has nothing to do with digestion. Just go with it.)

When I first heard this story 15 or 20 years ago I tried to add the term “chasing fish farts” to my lexicon as a euphemism for a developer who is looking in the wrong place to find the source of a problem. Or a product team chasing a misleading metric. In general terms, mistakenly thinking that a particular type of event or sequence of events is the cause or the cure, I tried to refer to as “chasing fish farts.”

I couldn’t make it stick. People would look at me funny and I’d have to derail the conversation to tell the amusing story of the Swedish navy chasing Russian subs that turned out to be fish farts. Everybody would laugh and promptly forget the story. If I mentioned “chasing fish farts” a week later, half or more of the people I told the story to a week before wouldn’t get the reference.

But I still chuckle whenever I think of it.

What’s curious is that I’ve never been able to understand how in the world the Swedish navy got the idea that the sound they recorded was a Russian submarine. None of the articles I read at the time explained that, and a quick search today didn’t reveal anything new. Which is unfortunate because although failures are usually instructive and often funny, we learn the most by understanding the events and decisions that lead to the failure. There had to be a critical point when somebody said, “This is the sound that a Russian submarine makes!” I want to know how they came up with that.

The lesson to learn here is that when you repeatedly find the data pattern that your previous analysis indicated precedes the event you’re interested in, but the event never happens, it’s time to re-visit your analysis. Yeah, it’s embarrassing to admit that you discovered you were looking for the wrong thing. Better that, though, than to have somebody else point it out.

https://improbable.com/tag/herring/ will get you a few links to articles about the incident. Or just search for “swedish fish farts”.

Fun with the mower

I have a love/hate relationship with my lawn mower. It’s a great tool, don’t get me wrong. But of course it only breaks down when I need it. Or, more correctly, when I’m using it. And then I need it fixed right now. Or I borrow my neighbor’s mower. It’s frustrating because I don’t mind (actually kind of enjoy) mowing the lawn but I hate futzing with the lawn mower.

My mower broke down three or four weeks ago. The drive belt broke. Replacing the drive belt on this machine is, in my opinion, overly complex. It’s easiest done using some tools that I don’t have, and in a better-equipped shop. I suppose I could do it … maybe. But I don’t like working on engines. I’ll do simple things, but after looking at this one I decided that I don’t need the aggravation.

So I pushed the thing up to the driveway, hooked up the trailer and pulled the mower onto the trailer with a come along (hand-operated winch). Dropped it at the shop. Then came back and borrowed my neighbor’s mower so I could finish mowing my yard.

The mower shop of course had a backlog and only one mechanic, so it took a while for them to get me an estimate and then do the work. I got the mower back on Tuesday and started mowing. I was pretty close to done when the right rear tire went flat. Not an uncommon occurrence around here, what with all the mesquite thorns and such. Turns out, though, that it wasn’t a mesquite thorn. Either a large, sharp rock or a pointy tree branch on the ground ripped a 3-inch gash in the sidewall. That tire’s trash.

I went online and called around and could not find a replacement tire nearby. The mower shop said they’d order one to be in next week. I went to Amazon and found a replacement for about half what the mower shop wants, and I could get it in two days. Cool.

So the new tire comes in. Take it to the mower shop to have it placed on the rim, right? Except the mechanic is out sick so he wouldn’t get to it until Monday. But the guy at the shop told me that Discount Tire would do it. And they did: for $10. The mower shop was going to charge me a half-hour of shop time. Their shop rate is $135 per hour.

If you have a riding lawn mower, here’s what I suggest:

  1. If you can buy the flat-free tires (i.e. hard rubber wheels that don’t require pumping up) for your mower, do it. I just bought them for the front. Haven’t found them to fit the back yet.
  2. If you can’t get the flat-free tires, buy a replacement wheel and tire for the front, and one for the back. Just store them in your garage. You’ll need them eventually.
  3. When you destroy a tire:
    • Replace the wheel and tire with the spare that you have in the garage.
    • Finish mowing.
    • Order a replacement tire.
    • Take tire and wheel somewhere for mounting. Really, you don’t want to do that yourself. Discount Tire charges $10.
    • Stash the newly-replaced wheel/tire for the next time.

At least, that’s what I’m going to do. A new wheel/tire assembly costs something less than $100. I’ll count that as money well-spent. I’ll be able to swap out a wheel, finish my work, and have the old tire replaced at my leisure.

Ordering episodic content

If you’ve ever tried to watch a multi-part series of videos on YouTube, you’ve probably run into the problem of finding the next episode. If you list by title, you’ll often run into things like “Carving the Mushroom, Part 1” followed by parts 2, 3, 4, 6, 7, 9, 5, and 8, in that order. Why are 5 and 8 out of order? Because their titles have typos that cause them to be sorted that way. Whereas all the other parts are tagged as in “Part 1,” parts 5 and 8 are “Pt. 5” and “Pt. 8,” respectively, causing them to appear at the end of the list.

Another common mistake is changing the title. For example, most of the episodes will be “Carving the Mushroom,” but one or two of them will be “Carving the shroom,” which will result in those episodes being sorted out of order. Alphabetic listing absolutely depends on the video titles all having the same format.

YouTube is the most visible example of this episodic content poroblem, but I’ve seen similar errors on all types of episodic content. Fan fiction, amateur story sites, blogs, and podcasts are other examples that I’ve personally experienced problems with. I suspect that there are many others.

Commercial streaming services like Netflix and Prime Video apparently have standards for marking episodic content so that it can be ordered. In an ideal world, they’d all agree on one common standard. I do not know whether such a standard exists. There’s certainly no standard for YouTube videos! I’ve been wanting YouTube to provide some assistance in that area for 15 years. It should be easy for them to make a tool available that simplifies ensuring that videos in a series all have the same title, and all are tagged with the right season and episode. Or whatever ordering system the creator wants.

Is current AI technology up to that? Could it correctly satisfy the request, “List all the episodes of ‘Carving the stabby thing’, in order”? If an AI can do that, then it should pretty simple to create a tool that will identify individual series, order the episodes, and rewrite the titles to match the parameters that are input. Tell it how you want the episodes marked (i.e. “Season X Episode Y”, “Part X”, “Part X of Y”, etc.), and the AI could group the episodes, tag them, and rewrite the titles accordingly.

I’m confident that, given enough data and time to grind through it, I could create a machine-learning model that would largely solve the problem. It wouldn’t be perfect, but it’d be a whole lot better than the current anarchy. Even so, I think an AI solution would be faster to build and would do a better job, largely unassisted. Certainly the AI solution would be more robust than the ML solution.

How hard would it be to build such a thing? I just might have to find out.

Posted in AI

C# note: Comparer versus Comparison

The Array.Sort method has a generic overload, Sort<T>(T[], Comparison<T>), that sorts the array using the passed comparison delegate to do item comparisons.

Array.Sort has another overload, Sort<T>(T[], IComparer<T>), that accepts a reference to an object that implements the IComparer<T> interface.

There are some non-generic array sorting functions, too. I won’t be covering those.

To call the first sorting function shown above, you have to create a Comparison<T> delegate. That’s easy enough:

// Create a descending item comparer
var descendingComparison =
    new Comparison<int>((i1,i2) => i2.CompareTo(i1));

For the second one, you need a reference to an object that implements the IComparer<T> interface. It’s possible to create an IComparer<t> from a Comparison<T>, like this:

var descendingComparer =
    new Comparer<int>.Create(descendingComparison);

Given the above, the code below shows how to call those functions.

    var a = new[] { 5, 5, 6, 9, 5, 3, 7, 7, 1, 5 };

    // Sort passing an IComparer<T>
    Array.Sort(a, descendingComparer);

    // Sort, passing Comparison<T>
    Array.Sort(a, descendingComparison);

Those two function calls do the same thing.

Array.Sort also has a generic overload that lets you sort portions of an array. That’s a pretty common thing to do, so it’s a nice function to have. But there’s only one function: Sort<T>(T[], Int32, Int32, IComparer<T>).

So if I’m sorting the entire array, I can pass a Comparison<T> or an IComparer<T>. But if I want to sort only part of the array, I have to pass an IComparer<T>?

That’s just idiotic! The existence of the overload that accepts a Comparison<T> to sort the entire array creates the expectation of a method that accepts a Comparison<T> to sort part of the array. That such a function doesn’t exist is, in my mind, an interface design error.

It might be that the overload that takes a Comparison<T> exists solely to support something in LINQ. The concept of sorting part of an array doesn’t really make sense in LINQ, so LINQ wouldn’t require a range sorting function. But the expectation is there on the human side, and the IDE’s error message when you write code to call the non-existent function is not at all helpful. When presented with this line:

Array.Sort(a, 0, 12, descendingComparer);

Visual Studio non-helpfully tells me:

Error (active) CS1503 Argument 2: cannot convert from 'int' to 'System.Array?'

Error (active) CS1503 Argument 4: cannot convert from 'System.Comparison' to 'int'

I guess figuring out which Sort method I’m trying to call is difficult. Overload resolution is hard enough when all the parameters match up. When one of the parameters is incorrect and there are multiple overloads that accept four parameters, the compiler has to guess at which one I was trying to call. That sounds like a hard problem.

If you’re unfamiliar with the difference between Comparison and Comparer, the difference is going to frustrate you.

Fortunately, the fix is easy. I showed above how to create an IComparer<T> from a Comparison<T>:

var descendingComparer =
    new Comparer<int>.Create(descendingComparison);

Or, if you don’t want to declare a new variable for it:

Array.Sort(a, 0, a.Length/2, new Comparer<int>.Create(descendingComparison));

You can go the other way, too, if you want. That is, to obtain a Comparison<T> from an IComparer<T>:

Comparison<int> descendingComparison = descendingComparer.Compare;

It looks to me as though Comparison<T> is not widely used in the .NET Framework. The only place I’ve seen it is in overloads to the Array.Sort and List.Sort methods. Comparer<T>, on the other hand, is used all over the place. In my code, I make an effort to keep a Comparer<T> around and create a Comparison<T> from it in the few cases that I need one.