An Occasional Coding Exercise Leads To Puzzle Book Sales

March 5, 2026 Leave a comment

There was a time back in my early Amazon career, when I was managing the Independent Publisher Portal, also known as Kindle Direct Publishing, that I wanted to end to end test the publishing process. The challenge with doing so was that the publishing workflows were really good at recognizing duplicative content as part of its fraud detection. This made testing repeatedly close to impossible, because each test required a new, unique book.

I decided to pop open Visual Studio, fire up my rusty C# skill, leverage Microsoft Word’s XML based formatting, and write some code to automatically generate books. Because I wanted them to be legitimate, repeatable, and make it to the Amazon marketplace, I couldn’t just randomly generate text files.

So I wrote a program that automatically generated Sudoku puzzles. First, I wrote a randomizer that would generate a random 9×9 sudoku grid filled with a solved and valid result. Then I wrote a sudoku solver to validate that the puzzle in its final form had a solution.

I then decided I wanted to have three different levels of solvable sudokus, with about 30 of each in a book. So, for each level, I removed a certain number of random digits from the puzzle, one by one, until the solver determined that the puzzle was no longer solvable. I then stepped back to the last solvable version and marked that as a “hard” puzzle, added two more digits back for a “medium”, and then two more digits back for an “easy” puzzle.

With that code written, I went online and downloaded a free use sudoku puzzle image, and created a Word document template including the cover file. I saved that file so I could open it later, along with a few fields I could merge in, such as the volume number, as well as the colors for the cover so any books I created could be unique. With that, a few parameters could be passed in to my program, generate 60 puzzles, add them as pages to the Word document, and save out a new, unique puzzle book.

I was able to successfully test my publishing workflow. Ten of these puzzle books were published out to Amazon. They remain available for sale today, and I still occasionally sell one.

With that done, I decided to go back and write a different puzzle output, adding a dictionary integration and code that created word search puzzles. There are ten of those out at Amazon as well. It was a fun little project that took a bit of thinking to get through, and over the course of several years managed to pay for a couple of dinners.

Categories: ASP.NET Code, C# Code Tags: ,

A Prompt Response

March 3, 2026 Leave a comment

Today’s Prompt

What is your favorite drink?

So, ordinarily I would say Diet Coke. In fact, one of my old peers used to tell me they often judged how well my day was going by how much (or how little) Diet Coke I had consumed that day.

I don’t like coffee, I don’t like tea, so my caffeine intake comes from Diet Coke. And I don’t even like the aroma of either coffee or tea. One of my early memories is getting up one night as a child, seeing a pitcher of grape Kool-Aid in the fridge, pouring a glass, taking a drink, and realizing way too late that it was actually Iced Tea. Haven’t had any since.

But I’m not sure that’s really the question here.

I’m not a big drinker, not by any stretch. I’ve got health issues that sort of encourage me (require me?) to avoid alcohol. I don’t like the taste of most alcohols, especially beer, which I find just awful. Even the non-alcoholic beers just don’t do it for me, although I did try Zima a bit here and there back in the day. And more often than not, I’m the one driving. Add it all up and I rarely if ever have a drink.

Many of my friends and colleagues are aware of this. Many more tried over the years to get me to have one here or there. But it remains rare: the last time I had one was a failed attempt in New Orleans earlier this year to order a beverage that the bartender got completely wrong, and was simply not tolerable.

That was a Fuzzy Navel.

Somehow, they left out the orange juice when they made the drink. Which is most of the goodness of the drink. I actually like the taste of a Fuzzy Navel. When I do drink, it’s for the taste more than the experience.

About 12 years ago, there was an engineering wide company meeting in Santa Barbara. My manager, who lived in Irvine, and I were good friends but rarely saw each other. After dinner, I made the mistake of letting him buy me a Fuzzy Navel…because everyone I knew there saw me with the drink, and then proceeded to repeatedly buy me ones for the remainder of the night, even occasionally upgrading to my second favorite drink, Double Kamikaze Shots. Then they followed me around the rest of the night to see what happened, including my mild-mannered QA tester who insisted they would outlast me.

Sadly for them, I don’t really get affected much by the alcohol personality-wise, I just get chill. As long as you ignore the 1am ping pong game where I told my QA tester I was going to unequivocally kick their butt.

So, yeah. Fuzzy Navels. Once about every 6-8 years.

This post is one of many in my responses to random prompts surfaced by the application that tracks my website statistics, as well as any others I encounter.

Medical Technology Update

February 26, 2026 Leave a comment

This week marks the 24th anniversary of my diagnosis as a Type II diabetic. The first 15 years were marked with difficulties maintaining my weight, diet, and a consistent blood sugar level. That all changed in 2018 when I switched doctors to an endocrinologist at Sansum Clinic in Santa Barbara. At the same time, the first iterations of continuous glucose monitors hit the commercial market.

Both events changed my entire outlook on how I managed my disease. I wrote about the impact of the first Dexcom device on my health in a post in 2018. At the same time, my doctor was really what I needed at the time. My very first diabetes doctor was a wonderful lady from Europe, but once I moved to the Central Coast, I struggled to find a doctor who had the right approaches to handle my condition. Switching to my endocrinologist was a literal lifesaver, as he worked with me to find treatments that worked rather than simply talked at me about what I should be doing.

And over the last eight years, the medical technology has continued to advance, leading to an unprecedented string of success in my management of my disease. One would think that over time success would slowly degrade, but the last two years I’ve managed to hit my best numbers yet, and maintain them.

For those of you who aren’t aware, the way diabetes is measured is by measuring the average volume of glucose in the blood stream over the trailing 3 month period. This measurement, the HbA1c (Hemoglobin A1c), is tested routinely every appointment. The HbA1c’s normal range is between 5.5 and 6.5, with anything over 7 considered to be diabetic. My target number in my head is 7 or lower. For historical context, when I began using a Dexcom, my HbA1c was a staggering 12.

This measurement is different than what the Dexcom measures, which is a point in time measurement of glucose volume in the blood stream. That normal range is between 80 and 120, and is the numeric value that appears on Dexcom’s monitoring app. For historical context, when I was diagnosed I was at an unfathomable 549.

As I mentioned in my previous post, which is worth a read, one of the things constant feedback allows is for the patient to have full visibility into how their blood is reacting at any point in time; I’ll admit at this point I understand way more about my blood chemistry than I ever wanted to learn. But the constant feedback allows for targeted action with insulin and diet.

The current device, the Dexcom G7, has come leaps and bounds in terms of reliability and accuracy. The device used to take hours to “warm up”; now readings after sensor application are available in about 20 minutes. The device used to be on the abdomen and could awkwardly catch on things, but now I wear it on the back of my upper arm. The applicator is easier to use, with a simple push button mechanism. And the technology on the phone has advanced to the point where it can extrapolate what my HbA1c will be based on its trailing 3 month data.

The transmitter (left) and applicator (right)

What this has meant for me is, I no longer fixate on what’s happening right this moment. I react to the changes in my blood chemistry as best I can, but I can also let things go from time to time, such as around the holidays. And this is because my target now is an average glucose level of around 130-140, which according to the application, loosely translates to a 7 on the HbA1c scale. That’s led to less worrying and less stress, allowing me to essentially push and pull on my readings as life happens.

The Dexcom App

This has been helped by updates to my medications, which are extensive. The biggest impact has been Mounjaro, which is a once a week injection that targets the blood sugar while also having the side effect of appetite suppression. Medications like Mounjaro, Ozempic, and Trulicity have been used for weight loss and have been advertised extensively in that manner, but their impact on diabetes can’t be overstated. I’ve dropped about 20 pounds and maintained that weight loss alongside the technology improvements that manage my life.

As a result, my HbA1c been under 7, and at times as low as 6.5, for two years running now. And to be fair, with less emotional burden or mental stress. Even at times like now, where the holidays have just wrapped up and I’ve had to deal with issues surrounding my job, I still managed to land a 6.8 for my trailing three month HbA1c score. I don’t fist pump often, but when I do, that’s the kind of thing that makes it happen.

And the improvements continue. Dexcom is coming out with a 15 day device (the current one lasts 10 days), which will reduce cost and make it that much simpler to use.

It hasn’t been easy managing my illness, but with all this assistance from my amazing doctor, medications, and technology, the last 2 years out of the last 24 have been the best so far.