No Magic Numbers

Action Solitaire 1.31 is now available for download.

After the last posting, we discovered a rather significant bug in Action Solitaire. It was fortunate that it was discovered in house, but unfortunate that it was not found during beta testing and, hence, required a public update. The problem caused two of the 65 games to behave incorrectly (or even crash) when large or huge card sizes were selected, either explicitly or implicitly through automatic sizing.

The problem turned out to be magic numbers in the code. We released the first version of Action Solitaire back in 2003, which was six years of coding experience ago and at a time when I felt under some (self-imposed) pressure to get the product finished. Unlike some of the other projects, the source code for this game has not been refactored, except to the extent necessary to make updates for Vista and add new games, so I never revisited these (working) games to see the problem.

For those who do not know, a magic number is an explicit and undocumented constant in the source code for a program, so named because the value works like magic, without any proper explanation. In this particular case, the width and height of an image buffer were set to constant values, calculated (manually) to accommodate an area based on the largest card sizes supported by the game at that time. Rather than actually letting the computer determine the necessary buffer size, based on named constant values (e.g., MaxCardWidth and MaxCardHeight), the code just used constant numbers directly. When the maximum card size increased, the buffer was too small and problems ensued. Such are the dangers of magic numbers.

It did not take long to find and fix the problem, but it should not have been necessary in the first place, especially since we had standards, even back then, that discouraged the use of magic numbers. I made an exception and got burned. Ouch.

Anyway, Action Solitaire can be downloaded here, and I guarantee ample opportunity to find other bugs in this product, but the game is fun (and addictive) as well.

Action Solitaire 1.30

Can you believe it? Another product release!

Goodsol Development has released Action Solitaire 1.30, continuing the string of product update releases in 2009. This latest version of Action Solitaire adds five more games and (belatedly) implements support for larger card sizes, including those provided in all of the newer downloadable cardsets. The new action games are:

  • Two Cells
  • Three Cells
  • Klondike Deal Three
  • Canfield Deal Three
  • Black Hole

One nice thing about these new games is that it creates 5 more opportunities for players to climb to the top of the standings (or ten, if one counts both tables for each game).

As this product was in beta testing, I noticed that, oddly, all of our Action Solitaire releases have been in odd years, starting in 2003:

  • Version 1.0 – December 9, 2003
  • Version 1.1 – April 18, 2005
  • Version 1.2 – May 24, 2007
  • Version 1.3 – June 16, 2009

Following this pattern, this would be the last update until the second part of July, 2011! However, a popular clambering for a Mac version would probably result in AS 2.0 well before that time.

Download and enjoy! [from here]

2009 People’s Choice Awards

Only two days left to vote!

This year, the leadership of the SIAF (Shareware Industry Awards Foundation), the group which produces the Software (nee Shareware) Industry Conference (SIC) each year, made the unfortunate decision not to present the Shareware Industry Awards this year. These premier awards were basically the Oscars of this industry, voted on by other industry members, and represented peer recognition. No SIA was presented for any standard game category last year (2008), so our own Pretty Good MahJongg was the last game to win one of these prestigious awards for the 2007 Best Non-Action Game.

In the absence of the Shareware Industry Awards, the People’s Choice Awards take center stage at the SIC banquet (presumably). With no nomination process, and voting open to anybody with an email address, there is no particular anticipation for these awards (and with no game PCA presented since 2006, even less for us). Nevertheless, I will support the awards process, so I submitted my ballot today.

The deadline is looming [Monday, June 15th], but if anybody has not yet voted and still has time to do so, we would certainly appreciate consideration of some of our products:

Although I certain could have done so, I did not fill all seven lines on my ballot with our games. I did an evaluation of the products that I use on a regular basis and which greatly aid my (development) productivity, and these products really stood out:

  • Beyond Compare is an absolutely indispensable part of my development toolkit, and I use it almost daily for code diffs, file syncing, single line editing, and even viewing of Japanese/Unicode resource files (which VC6 cannot handle).
  • Inno Setup is the easy choice for creating professional installers, and though it is not shareware, it is downloadable (free/donationware).
  • Help & Manual is simply the best help editor I have ever used (though I will admit to preferring version 4 without the ribbon interface).
  • PC-lint is critical to my C++ programming work and it is run, literally, alongside my compilations to guard against both silly mistakes and serious errors in order to help keep the quality of my code as high as possible (although there is no downloadable trial version, unfortunately).


To vote for the 2009 People’s Choice Awards, simply register to vote [Editor’s note: invalid link has been removed] (with just name and email address) and then follow the link that will be emailed to you and enter up to 7 software products. Easy.

A Tale of a Good Anti-spam Tool

Spam, spam, go away… You are not welcome ANY day.

My approach to my primary email address, from the very start (more than 13.5 years ago) was that potential clients and customers should be able to contact me without jumping through hoops, so I have never bothered to hide or obscure my address: seelhoff@sophsoft.com . I have always published it in plain view (and to do otherwise would now be closing the barn door long after the horse has bolted and gone on to live free and happy until dying of old age).

Of course, this also allows any spamming slimebag with an address harvester to easily add me to each and every email database on the planet, so I do get spam. Lots of spam. To be honest, though, the level of spam to my “open” account seemed to plateau fairly quickly, although I never really kept track. Over the years, it may have been slowly and steadily rising, but I know that my patience has been slowly and steadily declining, so a while ago, I added some tools to stem the tide.

Let’s talk numbers, first. Since the beginning of April, my primary email account has received 75,000 email messages. Of those, almost exactly 98% are spam. Of the other (legitimate) messages, 80% are business (1.6% of the total), and the remaining 20% (0.4% of the total) are personal. Both of these categories include active mailing lists, such as Carbon and DirectX development (business) and community events (personal). I set up my email client to automatically sort these (and marketing messages) into appropriate folders, and the number of messages specifically to me, from clients, customers, family, and friends, is just a handful per day. These are the only ones that actually hit my inbox and trigger a notification sound.

To be honest, not all Bayesian filtering is created equal, and my email client is probably about average. It handled much of the junk, but an annoying number of spams were being missed, and signalling me (incorrectly) that I had a legitimate message. When I finally had enough, I downloaded and installed POPFile upon a recommendation from somebody in the ASP. I had been leery about installing an interim mail server on my system simply for filtering email, but it turned out to be an excellent choice.

After several months of training, POPFile is 99.92% accurate selecting among business, personal, and spam classifications and, importantly, I have gone for more than a month without a false positive for spam. (Most of the classification “errors” are simply unclassified messages that need to be trained.) Used in series with my email client, I can review messages that either think may be legitimate (ideally, to never miss a valid email), but I am only notified of incoming mail if they both agree on the validity. This has greatly reduced interruptions and made my days more productive.

Of course, there is some training involved so POPFile can “learn” the difference between legitimate messages and spam, but the initial process goes pretty quickly (and when one averages more than 1000 messages per day, there is lots of data). If I were to start all over again, I would not have chosen to have business and personal messages separated, since that distinction is not particularly necessary for me (and not always clear, either, such as when a family member reports a server problem, or a business associate invites me to a party).

If you are looking for an anti-spam solution local to your own system, I strongly recommend POPFile.