The Accidental Teacher

The following is the text from my speech to the Ocala Early Bird Toastmasters on May 19, 2018.  If you’re in Ocala and would like to learn more about leadership and public speaking, come join us for breakfast on Saturday mornings at The Egg and I.

My name is Andrew Comeau and I am … a public school teacher?

I say it that way because It’s been a study in irony for me. If you told me just a couple years ago that I’d be teaching a nighttime programming class for vocational students, I’d have laughed. When others suggested I should be a teacher, I said it wasn’t for me.

Then when I was told that a new programming course was needed in Ocala and I had the choice of designing and teaching it myself or hoping someone else did it well, I automatically said Yes.

Continue reading

Site Changes

Looking over my web presence earlier this year, I decided to do some consolidation. I had three sites – Drewslair.com, which has been in operation for 15 years, my business site, ComeauSoftware.com, which hasn’t changed much for quite awhile and the site for my networking group, OcalaITProfessionals.com, which needs a lot more attention and content.

Comeau Software Solutions is my consulting business which, in one way or another, is meant to encompass any technology-related business that I do from my work with clients to my various writing projects to some future projects I have ideas for.  I decided it was time to let it take its proper place and that means merging ComeauSoftware.com and Drewslair.com into one site.

I’ll be keeping the Drewslair.com domain for at least another year to maintain the many links that have been made to it over the years.  One of the things I like about modern web hosting is how domains and sites can be moved around pretty quickly with just a few changes in settings.

I’m thinking about some changes to the look and feel of the site but all the content will remain and I hope to provide a lot more great articles and posts in the coming year.

 

 

How to Convert Between Roman and Arabic Numerals in C#

The Challenge

My latest challenge to my database programming students was to create a C# class that would perform various number conversions, starting with Arabic numbers (0 to 3999) to Roman numerals and vice versa.

I required that all public functions in the class needed to be declared as static, so that they could be called from outside the class without having to create a new instance. Also, the class was to be completely portable;  it must not use any functions such as message boxes that would prevent them from copying the entire class into any other type of project and referencing it.  Of course, all code must also have error handling and commenting.

My students came up with various solutions and I think some had more help from StackOverflow than others.  I know that one of them learned the hard way not to search for “XXX” on Google.

One popular strategy was to use the C# Dictionary class to hold the Roman characters and their equivalents.  I don’t always get around to writing up my own solutions to these challenges before I assign them, so I happily swiped that strategy for my own code which was otherwise written from scratch. I ended up using the SortedDictionary class instead.

Continue reading

How to Create Lookup Fields in C#

I started my (more or less) serious database development training many years ago in Microsoft Access.  One of my favorite controls was the Combo Box, a nice little drop-down field that enabled the user to select one of many values but collapsed down onto a single line.  The Combo Box control in Access was very configurable and one of the nice features was that  you could display one value while actually saving another value to the field the control was bound to.  For example, you could display the Customer Name while saving the associated CustomerID that the database would use to reference the customer record.

C# also has a Combo Box control that can do much the same thing but offers a lot more options through code.  The .NET version maintains a collection of objects, any kind of objects, and displays whatever text is presented by the object’s ToString() method.   The code can then use any other property of the object to carry out operations in the background.

Continue reading

How to Retrieve Data from SQL Server into C#

The .NET framework has a few different automated methods for managing connections to SQL Server and other databases. The framework has been around since 2003 and various versions have introduced new, improved data management tools while maintaining the old ones for backward compatibility.

It’s still possible, however to retrieve data from SQL Server and other database systems with just a few lines of code and it’s important to know how to do this to truly understand how the communication between SQL Server and a language like C# actually works.

Continue reading

How to Convert Between Decimal and Binary in T-SQL

For the past six months, I’ve been teaching night classes in database programming and my students are just about ready to take Microsoft’s 98-364 exam. Now, we’re transitioning over to C# programming for the next phase of the program but I have to keep their SQL skills fresh for the exam.  Tonight, it was time to teach them to understand the binary number system.  I dropped some hints on it a couple of months back to brace them but now it was time to get it done with once and for all.

Then, as I like to do with this class, I came up with a lesson plan that would incorporate the best of both subjects …

Continue reading

Quick and Easy Setup of MySQL for Windows


One of the great things about MySQL is its versatility of installation. It can be setup as a Windows service and trimmed out with some extra utilities or it can be installed on a flash drive as a portable server.

The easiest installation is certainly the Windows Installer with a wizard that will guide you through the installation of the server and all the options you want.  Myself, I still like self-contained programs that won’t interfere with anything else on my system and can be easily removed without leaving hidden traces. I also don’t like adding a lot of stuff to my Windows startup.

If you have a basic comfort with using the Windows command line and control panel, doing a minimal installation of MySQL is not difficult once you understand a few steps. The full documentation is available for reference on MySQL.com but here are the essentials to get you started.

Continue reading

Unplugging to Reconnect – The Technology Sabbath

It Started With a Game …

By now, you’re probably familiar with Pokemon Go, the game where people search for Pokemon characters around town with their smartphones. In 2015, I played a forerunner of this game called Ingress. The basic idea was the same – run around town accessing game spots, collect digital items, compete with other players for territory, etc..

At first, the game seemed like a great idea. I figured it would get me out for some desperately needed exercise and it did. I found out some of my favorite walking routes had a bunch of game spots I could access while  walking and I was out there at 6 a.m. every morning … willingly! It was a miracle!

Continue reading

Screen Rapidly Flashes On and Off After Windows 7 Update

Problem

After installing updates in Windows 7, I found that my primary display flashed on and off rapidly and I was unable to activate any menus on the screen. My extended display, powered by a StarTech USB to VGA Adapter, remained off even though the drivers were properly installed and everything had been working prior to the updates. Unplugging the StarTech adapter restored the primary display to normal but left me without a second monitor.

Cause

The recent update had included dozens of individual security updates so I researched the issue online and found the symptoms linked to the following Windows update:

KB2670838 – Platform update for Windows 7 SP1 and Windows Server 2008 R2 SP1

This is a graphics performance update that has had a number of reports of compatibility problems and other issues.

Solution

My solution was to simply uninstall the update. This required a restart of the system, after which both monitors worked fine.  The KB2670838 update is a prerequisite for Internet Explorer 10 / 11 and removing it will cause these versions of IE to malfunction or be removed from the system. Re-installing IE 10/11 will also reinstall KB2670838. Removing it did not affect my installation of Google Chrome, however.

Windows 7 Update Gets Stuck While Looking for Updates

Windows UpdateAfter doing my year-end rebuild of my Windows 7 system, I went ahead and did a check for updates, preparing to wait for awhile as there were currently over 150 important updates for my system even after installing SP1.

So I waited … and waited … and waited some more.

After a couple hours, I knew something was up so I started searching for solutions. Finally I found an update that took care of it; an update was needed to fix the update process.

KB3135445 – Windows Update Client for Windows 7 and Windows Server 2008 R2

To apply this fix:

  1. Restart your computer. I prefer to do a complete shutdown, wait a few seconds and then start it backup.
  2. To be safe, disable any anti-virus programs you have running. This update might not work if they’re active.
  3. From the above link, download the version of the fix that’s appropriate to your computer.
  4. Double click on the file to run it and follow the prompts. The installation process is short and simple.
  5. After the update finishes, restart your computer again.

When you run Windows update, it should now find any available updates within a reasonable amount of time.

If that update doesn’t fix the problem, there are a couple of others that I found out about when dealing with this problem on another machine.

KB3020369 – April 2015 servicing stack update for Windows 7 and Windows Server 2008 R2

KB3172605 – July 2016 update rollup for Windows 7 SP1 and Windows Server 2008 R2 SP1

Again, be sure to disable your anti-virus software when installing these and possibly when checking for updates as well.