Author Archives: cleek

Smooth Criminal

Pete got into one his Mr Hyde moods the other night and bit me on the arm. In the morning, one of the punctures had started to swell. So, I went to the urgent care to get some antibiotics.

Apparently there's a county regulation that any doctor treating an animal bite has to report it to the local animal control department. So, last night I got a call from an animal control officer who took a statement about the incident and asked for Pete's vaccination records, etc.. He also said that Pete has to be quarantined for ten days - but, he can do that at home. Which is no different from any other 10 days, because Pete isn't allowed outside. And, they're going to send an animal control officer around to check to make sure that he's in quarantine (aka: in the house) twice during those ten days.

Our little guy now has a permanent record.

Stateless Actor

The latest version of Visual Studio (VS 2026) has Microsoft's AI assistant "Copilot" built-in. So, I've been trying to find a use for it.

Here's how that's going.

I have a class (CParameter) that can hold one of several types of data: integers, floating point numbers, text strings, booleans, etc.. This is used to pass parameters from a script (written in JSON) into an arbitrary set of "actors" who will perform various operations on still images. And then there's a class that holds a collection of these parameters (CParameterMap). So these are utility classes. They don't interact with the user or the screen; they simply exist to shuffle data from one place to another, transforming it from one type to another (ex. text to number) as necessary. And they are fairly simple. But since they are at the heart of the application I'm writing, I thought I would see in Copilot had any suggestions.

Classes like these show up in a lot of applications. "Data from outside sources needs to be collected and presented to the code that uses it in a way the code expects" is a common situation. I would expect Copilot to have seen many variations of this.

OK. Open the CParameter / CParameterMap file, open the Copilot chat pane, type "analyze this for performance".

Copilot chugs away for a few minutes, then comes back with 20 paragraphs of suggestions. Uh oh.

First paragraph:

Hot spots and costs

  • Key type and container
  • std::map uses ordered tree lookups: O(log N). Every lookup constructs a temporary CString CListCtrl::GetEmptyText from const char* and then does node traversal — cost includes allocations/comparisons and pointer chasing.

Yes, maps have overhead. String keys are not ideal. I know.

"Every lookup constructs a temporary CString CListCtrl::GetEmptyText" ?

What?

CListCtrl is a UI component that shows collections of things, in various ways: strings, icons, grids, lists. The original Windows Explorer was built around it (maybe it still is). It's the classic example of what the control does: Here's your list of files in a grid; here they are in a list; here they are as icons of a different size; change the columns show, change the size. Same data, just shown in different ways. It's very useful and infinitely flexible, though notoriously complicated to use.

But specifically, CListCtrl::GetEmptyText is a function of CListCtrl that gives you a copy of what is known as the 'zero-state' message. It's the "There's nothing to display here" or "Your search returned no results" text. It's what gets shown when the list of things you would otherwise show is empty.

I don't use a CListCtrl, or anything like it, anywhere in my application. And a big complex UI component like CListCtrl has nothing to do with what my parameter collection code does.

But eight of the 20 paragraphs Copilot returned mention CListCtrl::GetEmptyText ! And I don't know why.

So, even though I know LLMs have no concept of their own internal state, and so they can't actually answer the question, I ask it anyway:

"Why are you talking about CListCtrl ?"

Here's the response:

Sorry — that was a mistake. There is no CListCtrl in the ParamMap.h you opened; any mention of CListCtrl was a context mix-up on my part.
Focus now: your CParamMap/CParameter analysis and optimizations. I can:

  • Add non-copy lookup helpers (findParam, readRef) to avoid CString CListCtrl::GetEmptyText copies, or
  • Convert m_paramMap to std::unordered_map with a CString CListCtrl::GetEmptyText hash/equal for faster lookups, or
  • Run a targeted profiler pass to show hot call sites.

Which would you like me to do next?

Perfection.

Deus Ex Machina

Joe Rogan recently told the American Alchemy podcast that AI-powered machines could one day have a 'virgin birth,' creating advanced robots, or 'offspring,' capable of performing real-world miracles using technology.

'Jesus is born out of a virgin mother. What's more virgin than a computer?' Rogan told podcast host Jesse Michels during the interview released on Sunday.

'So if you're going to get the most brilliant, loving, powerful person that gives us advice and can show us how to live, to be in sync with God, who better than artificial intelligence to do that?'

Rogan suggested that AI-powered technology could soon replicate some biblical feats, potentially enabling humans to bring people back from the dead using medicine or mind-uploading technology.

'Artificial intelligence could absolutely return as Jesus. Not just return as Jesus, but return as Jesus with all the powers of Jesus. Like all the magic tricks, all the ability to bring people back from the dead, walk on water, levitation, water into wine,' Rogan claimed.

I've never been that high. Alas.

Strudle

Strudel is a music live coding environment that runs in web browsers. It brings the TidalCycles pattern language to JavaScript.
You can write code and create or change music in real-time. This makes it perfect for live performances and music production, where you can create music spontaneously through programming.

As a programmer, the way the text editor shows which events are happening in real-time is beautiful.

Uneasily Positive

A few months ago, our vet found a mass in Pete's abdomen.

So, he went to the 'specialty vet' (which is the same vet Tricksey went to for her cancer treatments, so I already have doubts...). They did an ultrasound and a biopsy. The biopsy was "inconclusive" for cancer. So... But... the diagnosis was "gastrointestinal eosinophilic sclerosing fibroplasia", which is a form of intestinal inflammation that cats are prone to. It's non-cancerous but can be dangerous because it can block their intestines or rupture or ... etc..

"Surgery!" The vet said. $10,000 worth of surgery! Intestinal surgery that could kill him or leave him with a lifetime of digestive problems including the need for constant vitamin injections and constant diarrhea!

Pass.

Instead, we opted for oral steroids. They make him constantly hungry. All of this coincides with the loss of Pepper. That loss meant losing access to Pepper's leftover food, for Pete. She had almost stopped eating in her last months, leaving a ton of extra (high-fat, low protein) food for him to eat when we weren't looking. And he lost a lot of weight (which he needed to lose) in the months after. This has the vets somewhat concerned. We've increased his food.

Last week he went back to the vet for a followup ultrasound. And, they found no sign of the mass. It was gone? He goes back to the regular vet in a few weeks to check again.

I'm afraid of optimism because no story that starts with "found a mass" has ever ended well, in my experience. But, I guess I'll take what I can get.