About
Software architect who is Customer-focused in everything that I do. My goal for every…
Services
Articles by David
Activity
-
Though I am unsure how this found its way into my feed, I am incredibly glad that it did because it gives me an opportunity to pay a high compliment…
Though I am unsure how this found its way into my feed, I am incredibly glad that it did because it gives me an opportunity to pay a high compliment…
Shared by David Gray
-
A leader on my team told his people not to “lean on AI too much.” His concern is fair, but that kind of thinking boxes your potential in. It’s…
A leader on my team told his people not to “lean on AI too much.” His concern is fair, but that kind of thinking boxes your potential in. It’s…
Liked by David Gray
Experience
Education
-
Jacksonville State University
Activities and Societies: Sigma Alpha Alpha, the Student Accounting Association Business Manager, Chanticleer (student newspaper)
During my term as business manager, out of necessity, due to absence of its Editor, edited and produced several issues of the newspaper, and wrote several articles, including one covering a major speech by former Alabama governor and Presidential candidate George C. Wallace.
-
Licenses & Certifications
Volunteer Experience
-
Club Officer
Rotary Club
- 15 years 10 months
Children
For the most part, I enjoyed the work. There were many occasions when I learned something surprising about myself. For example, I was once tasked with helping school age boys select the right size shirts and pants for school. Much to my amazement, I very quickly became very good at gauging the correct size to suggest for each boy. This reduced the number of articles that each boy had to try on, shortening the wait for the dressing rooms.
Publications
-
Storage Sizes and Other Useful Properties: Windows, C++, and C Variable Types
The Code Project
See publicationThis article describes a reference chart that doubles as the engine behind a data structure mapper for use by C, C++, VBA, and C# programming. This is one of many tools that I have built as Microsoft Excel workbooks and templates. If you need to know the memory size of an obscure Windows object, such as a LANGID, it's probably here.
-
The Improved Resource String Generator in Action: Thou Shalt Eat Thine Own Dog Food, and Like It!
The Code Project
See publicationI was reminded today why it is essential for developers either to use their own creations (Eat their own dog food.) or work closely with dedicated testers who do so. It’s all too easy for a developer working independently to miss important details that make their creations harder to use than they should be, or outright defective. By the end of the project, I had a really convincing reminder of how much work it takes to anticipate everything that can sabotage even the simplest sounding task, and…
I was reminded today why it is essential for developers either to use their own creations (Eat their own dog food.) or work closely with dedicated testers who do so. It’s all too easy for a developer working independently to miss important details that make their creations harder to use than they should be, or outright defective. By the end of the project, I had a really convincing reminder of how much work it takes to anticipate everything that can sabotage even the simplest sounding task, and how many steps get done without giving them a second thought.
-
Time Zone Lab II: Exploring the DST Adjustment Rules
The Code Project
See publicationTo test some boundary cases in a program that reads the time stamps attached to the files stored on a Windows computer, I needed ready access to the Daylight Saving Time (DST) transition dates for any year.
Two years ago, to meet a similar requirement, I wrote a program that I called my Time Zone Lab, about which I wrote in "Time Zone Lab: An Expedition into Windows Time Zones." To meet a closely related, need, I concluded that the simplest way to extract the information that I needed…To test some boundary cases in a program that reads the time stamps attached to the files stored on a Windows computer, I needed ready access to the Daylight Saving Time (DST) transition dates for any year.
Two years ago, to meet a similar requirement, I wrote a program that I called my Time Zone Lab, about which I wrote in "Time Zone Lab: An Expedition into Windows Time Zones." To meet a closely related, need, I concluded that the simplest way to extract the information that I needed from the time zone tables in the Windows Registry was to extend the Time Zone Lab, then construct a Microsoft Excel worksheet around the output of the new program. -
Compiler Warnings: Ignore at Your Own Risk
The Code Project
See publicationWhile you can often get away with ignoring compiler warnings, failing to at least scan them can bite hard!
Especially in the early stages of development, it is tempting to ignore compiler warnings without much thought, or, at the very least, set them aside to address in a subsequent build. However, this is not always true, since there are a handful of warnings that could justify promotion to fatal errors that stop a build short of the link step. -
sprintf_s: Speed Bumps Ahead
The Code Project
This article documents issues that I have identified in the new secure overloads of the CRT buffered print routines.
A few weeks ago, I upgraded a program that I initially developed using Visual Studio 6, and wrote entirely in C++, to use the new CRT library that ships with Visual Studio 2013. Since the Security Development Lifecycle checks are enabled by default (even in a project that is an upgrade from Visual C++ 6), the first compiler log flagged all of its many calls to swprintf as…This article documents issues that I have identified in the new secure overloads of the CRT buffered print routines.
A few weeks ago, I upgraded a program that I initially developed using Visual Studio 6, and wrote entirely in C++, to use the new CRT library that ships with Visual Studio 2013. Since the Security Development Lifecycle checks are enabled by default (even in a project that is an upgrade from Visual C++ 6), the first compiler log flagged all of its many calls to swprintf as potentially insecure, and recommended replacing them with calls to swprintf_s.
Although the Visual C++ team thoughtfully provided convenience macros to ease the transition, they cannot be used unless the output buffer is a static array. Unfortunately, all but two of the swprintf calls in question use static buffers that are accessed through pointers. Nevertheless, those weren’t the problem, because the DLL that owns the buffers exports companion functions that return their sizes.
The problem arose with the two others, both of which use smaller buffers, also accessed through pointers. Alas, when I added the sizeOfBuffer argument to them, I habitually specified the same size as the bigger buffers exported by the DLL. Suddenly, I had a very unexpected, and ugly, buffer overflow exception. What happened? -
Console Magic, Part 1: Messages in Living Color
The Code Project
See publicationThis article describes a class that adds color to console program displays.
Having spent quite a bit of time in front of a NetWare console and written my share of QuickBASIC utility programs, I knew that it was possible to output text in colors other than the default text and background colors set for the console window in which it runs. While doing so isn't all that hard, I decided to discover what it would take to make the task transparent.
The MessageInColor class is intended…This article describes a class that adds color to console program displays.
Having spent quite a bit of time in front of a NetWare console and written my share of QuickBASIC utility programs, I knew that it was possible to output text in colors other than the default text and background colors set for the console window in which it runs. While doing so isn't all that hard, I decided to discover what it would take to make the task transparent.
The MessageInColor class is intended for use as a more or less drop-in replacement for the System.Console.Write and System.Console.WriteLine methods, with convenience features to simplify displaying messages in something other than the default screen colors. It is intended for adding “spot color,” such as when you need to call attention to something important, such as an error message. Everything this class does can be achieved using built-in properties and methods of the System.Console class, but it’s a tad more work -
Collision Proof Shared String Resources
The Code Project
See publicationShare Win32 string resources without the risk of conflicting resource IDs.
This article presents a straightforward approach that solves two problems.
Use Microsoft Excel to efficiently manage read only Win32 string resources, without manually editing the resource script.
Even if the material seems inapplicable to your needs, it includes a number of useful tips that make the article worth at least a quick skim.
For years, I have been frustrated by the record keeping…Share Win32 string resources without the risk of conflicting resource IDs.
This article presents a straightforward approach that solves two problems.
Use Microsoft Excel to efficiently manage read only Win32 string resources, without manually editing the resource script.
Even if the material seems inapplicable to your needs, it includes a number of useful tips that make the article worth at least a quick skim.
For years, I have been frustrated by the record keeping required by the methods suggested for sharing Win32 string resources among applications. Why hasn't this record keeping been automated? One day, I had a specific application that was infinitely easier to code if all of its strings lived in a satellite DLL. As I was completing it, I realized that the same approach can be used to package any set of strings, so that you can have string libraries that are as easy to use as code libraries.
Since the project that gave rise to this requirement is a library that requires a custom string library for each application that employs it, I also needed a way to generate them efficiently. This gave rise to the Excel application, which uses worksheets to store the strings and their associated IDs and to drive a VBA macro that generates the read only resource script and its associated header, and integrates both into the default resource script of a Visual Studio project. When you revise a set of strings, the generator recognizes that the secondary script is already incorporated into the main script, and leaves the main resource script unchanged. -
A Robust CSV Reader
See publicationThe routines in this library can parse any string that I can throw at it, including Common Name strings read from X.509 Digital Certificates.
In the course of writing a program to generate a report about the properties of the contents of a Windows certificate store, I discovered that none of the CSV readers that I had at my disposal could process the unusual CSV strings found in many digital certificates. Turning to The Code Project, I found A Fast CSV Reader, which I eagerly downloaded,…The routines in this library can parse any string that I can throw at it, including Common Name strings read from X.509 Digital Certificates.
In the course of writing a program to generate a report about the properties of the contents of a Windows certificate store, I discovered that none of the CSV readers that I had at my disposal could process the unusual CSV strings found in many digital certificates. Turning to The Code Project, I found A Fast CSV Reader, which I eagerly downloaded, built, and tested.
Regretfully, I quickly discovered that it couldn't handle these types of strings, either, and set about to roll yet another CSV reader of my own.
The type of string that broke every CSV reader at which I threw it looks like the following actual example from a production store of Trusted Root Certificates.
CN=RapidSSL CA, O="GeoTrust, Inc.", C=US
Specifically, the middle substring, O="GeoTrust, Inc.", is nonstandard, because the opening quotation mark that is intended to protect the comma in the organization name, GeoTrust, Inc. is the fourth character in the substring. This is by design, since the Common Name string is a series of name-value pairs, as are many other certificate properties.
Although every other CSV library in The Code Project and elsewhere that I reviewed mimics a base class, such as System.IO.StreamReader, I chose instead to adhere to the Single Responsibility Principle, and focus entirely on parsing strings, leaving you free to determine how to acquire and manage them -
Using Static Buffers to Improve Error Reporting Success
The Code Project
See publicationThis recent article illustrates a technique for ensuring that information is reported even when Windows is low on memory.
-
Time Zone Lab: An Expedition into Windows Time Zones
The Code Project
See publicationJoin me for an adventure in time zone conversion.
One of the requirements of a project that I just completed was to be able to evaluate the age of a file that had been deposited on a FTP server, based on a time reported in a different time zone than the one used on the local machine. The generally accepted approach to such a problem is to convert the time to UTC, get the UTC time from the local machine, and do the arithmetic.
However, that leaves the issue of reporting the…Join me for an adventure in time zone conversion.
One of the requirements of a project that I just completed was to be able to evaluate the age of a file that had been deposited on a FTP server, based on a time reported in a different time zone than the one used on the local machine. The generally accepted approach to such a problem is to convert the time to UTC, get the UTC time from the local machine, and do the arithmetic.
However, that leaves the issue of reporting the findings to an audience that is not accustomed to thinking in terms of UTC time. I was pleasantly surprised when a quick Google search led directly to ""Converting Times Between Time Zones," at http://msdn.microsoft.com/en-us/library/bb397769(v=vs.90).aspx, and the TimeZoneInfo.ConvertTime method.
Languages
-
English
-
Recommendations received
6 people have recommended David
Join now to viewOther similar profiles
Explore top content on LinkedIn
Find curated posts and insights for relevant topics all in one place.
View top contentOthers named David Gray in United States
2005 others named David Gray in United States are on LinkedIn
See others named David Gray