# Thursday, July 30, 2009

We have an application at work that pulls images from a proprietary binary file and saves them to a local directory. The directory path and filename on the local machine are built on the fly based on client information. The application went through a full round of testing and passed all cases. However, when we moved the application to production and ran it against live data we ran into the following error:

System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+

We spent most of the day trying to track down the error, but nothing I found on the Internet gave a clue. First we thought that perhaps we were getting image data in a format that we didn't expect (i.e. loading JPEG data and saving it as a TIFF file), but that wasn't it. Finally, we tried writing the raw data out to disk using a FileStream instead of Image.Save(). This did not solve the problem, but it produced a different Exception that pointed us in the right direction. The new Exception stated something similar to the message below:

"Could not find part of the path 'C:\TEMP\2345\111299\Bin1\Slot3\Company.Bin1\Slot3.PartNumber_1.TIFF'"

The clue came in the last part of the message. The path format was supposed to be:

<Root_Dir><CompanyID><FranchiseID><StorageSection><FileName>.TIFF

where...

<FileName> = <CompanyID>.<StorageSection>.<PartNumber>.TIFF

Looking closely we discovered that our path was including a <StorageSection> that had a backslash in the name (i.e. "Bin1\Slot3"). Therefore, when .NET tried to create a file with the name "Company.Bin1\Slot3.PartNumber_1.TIFF" an Exception was thrown.

A simple one line change to our application fixed the issue by cleaning up the file name before attempting to save the file:

// Ensure that we have a safe filename
strFileNamePrefix = Regex.Replace(strFileNamePrefix, @"[\\/\?\:\<\>\|\*]", "_");

Hopefully the above will help you save more time than it took us to figure this out.

 

posted on Thursday, July 30, 2009 8:35:07 PM (Central Daylight Time, UTC-05:00)  #    Comments [0]
# Monday, June 09, 2008
I just signed up for Technorati. This blog is currently ranked: 3,900,162. Looks like I've got a little ways to go before I hit the top 100.

Here's my technorati profile:
Technorati Profile
posted on Monday, June 09, 2008 4:43:21 PM (Central Daylight Time, UTC-05:00)  #    Comments [0]
I just downloaded the Oracle client tools for a job I’m working on. It was an interesting experience.

Strike One: I had to download 3 different zip files named “Disk1”, “Disk2” and “Disk3”. Huh? I thought multiple floppies went out with the advent of DSL.

Strike Two: Once I downloaded and unzipped the three disk images into my “My Documents” folder I double-clicked the setup application in the Disk1 folder. An hourglass popped up, then went away. Huh? Nothing happened. Tried again. Nothing. So I rebooted. Went to the Disk1 folder and tried again. Nothing. Opened Task Manager. Didn’t appear that setup was even running. <sigh> On a whim decided to move the 3 disk image folders to the C: root. Opened the first image directory, double-clicked the setup again... walla! Oh come on. You’ve got to be kidding. Long file names and directory paths with spaces in them became common place with Windows 95.

As I was talking about in my Feeling Clean post, it is that last 5% of the effort that can make all the difference. Do you know how hard it is to make an application accept spaces in the application path? One line of code. One simple line of code to be sure you customer experience is pleasant and uneventful. Instead, I lost the current state of every application I was running as well as the web pages I had open for consultation on the setup I’m trying to do. All because a Windows application running in 2007 doesn’t support spaces in the file path. This is the type of behavior you might expect in a high school homework project or even in some shareware application, but is not what I would expect from a technology powerhouse that has aspirations of knocking Microsoft off the top of the hill.

Not a big deal you say? Well, let’s think about this. There’s an old saying you’ve all no doubt heard: “You never get a second chance to make a first impression.” Your installer application is the first impression any customer has of your company. If I had not tried to move these 3 folders to the C: root, I would have likely spent several hours, maybe even days trying to find the answer to how to get this application installed. That would cost me money. If I had contacted one or more of the guys I work with to get their help that would have cost even more money. The more help, the more money. Finally, if I had picked up the phone and called Oracle I’m quite certain it would have cost a whole lot more money; either my own for the support fee or Oracle if they have “free” or shall I say complementary support. Either way, this small and reasonably simple oversight on both the part of the developer and the testing team has almost certainly cost many people, many hours of frustration and in turn many dollars in lost time.

There were almost certainly thousands and thousands of straws on the back of that proverbial camel before it finally broke. Large established companies have lots of details to fret. Nonetheless, there is always a point where one too many mistakes were made. One too many dissatisfied customers simply walked away. One too many small details were overlooked.

Here’s the lesson: You are never too big and you are never too small to sweat the details. It is the small stuff that counts. It is the details that set you apart from everyone else. It is the little things that will keep your customers coming back and telling their friends about your products. What you do, or don’t do, says a lot about who you are and what your company is like. When you don’t care enough to insure my installation is carefree, how can I be sure you’ll care enough to support me when I’m depending on your product to run my business and take care of my own customers?

Take this opportunity to look at the products and services that you offer. Ask yourself if there are any holes in your offering that may cause your customers to have a bad experience; better yet, ask your customers. Create an ongoing list of rough spots in your product offering; then fix them. It may very likely mean the difference between surviving and thriving.

posted on Monday, June 09, 2008 2:51:17 PM (Central Daylight Time, UTC-05:00)  #    Comments [0]
# Thursday, June 05, 2008
I’ve been using a Mac for over a year now. Before that I was a Windows user since 1988.

Why did I switch? Quite simply, the Mac feels clean. When you turn it on you feel welcomed and embraced; understood even. Sounds silly, but it’s true. The small things make all the difference.

Take Microsoft Outlook for instance. When I switched to the Mac I stopped using Microsoft Outlook and began using Mail and iCal to manage all my email and tasks. These applications work good and I never really thought about Outlook or even missed it. However, yesterday, for work reasons, I started running Windows again as my primary development computer. In doing so I started using Outlook again.

Wow! What a nice application. When Microsoft Outlook first opens it is clean, tidy and well organized. I felt in control immediately. That’s how all software should be. Clean.

How do your products make your customers feel? What is their first impression of you and your company? Do you make them feel clean? Do you help them to feel in control? Let me encourage you to put in the extra effort to make a strong, positive first impression. It will pay dividends in customer satisfaction and loyalty.

posted on Thursday, June 05, 2008 6:03:47 PM (Central Daylight Time, UTC-05:00)  #    Comments [0]
# Wednesday, June 04, 2008
In 1987 I used Microsoft Word for the first time. It was bad. Functional, but unintuitive and hard to use. WordPerfect owned the market and Microsoft was still trying to get a foothold. Fast forward 10 years to 1997. Word is much easier to use, still difficult for a beginner, but much better. WordPerfect is fading fast and all but non-existant. Fast forward 10 more years to 2007. WordPerfect? What is that? Microsoft Word is hands down the king of the word processor market and for good reason. The application is clean, powerful and easy to use by almost anyone.

Same story with Outlook. When Microsoft Outlook first came out it was big, bloated, slow and clumsy. I hated it. I said I would never, ever use it. If there were an “I hate Outlook” club, I probably would have joined. Outlook today, however, is clean, powerful and delightful to use. It is the type of application that makes people want to use a computer. Had I joined the “I hate Outlook club, I’m afraid I would have to withdraw my membership.

There are dominant people and organizations in all facets of life. Last night, for instance, we were at the softball fields. There is a team that plays in our league that is, well, to be honest, way out of our league. They literally look like a professional team on the field. A lot of people don’t like that. They are critical, even offended by these guys. However, the fact is that this guys have earned their level of excellence. They have been together for a long, long time. They play hard. They are serious. They practice and they recruit the best. Yes, this is church league softball that I’m talking about, but the rules are the same for everyone. Any team in the league has the right to play at the same level as Patton; most, however, choose not to and that is their choice. Patton has looked beyond our local church league and has set their sights on winning the national tournaments.

Back to Microsoft. Yes, it’s true, that they have deep, deep pockets, but the lesson goes further than that. Microsoft has not always been a powerhouse. They started as two hardworking guys playing to win. They play hard and they don’t give up. Yes, they seem to bend the rules from time-to-time, but we have umpires in this league too. Several years ago several companies called “foul!” So, the umpires reviewed the tapes, looked at the plays, held meetings and ruled in favor of Microsoft. We can all gripe and moan, but that won’t help us beat them.  They are a powerhouse because they play hard and they earned it.

Back to softball. There’s another team in our league that is serious about the game. Last year they set their sites on Patton. They didn’t beat them, but they definitely gave them a run for their money. This year, they are even tougher. They look sharp on the field, they communicate clearly and they play hard. They are quickly becoming a serious threat to Patton’s undisputed rule of the ball field.

Google has done the same thing to Microsoft. In the late 1990’s they showed up in an already crowed Internet search market. They were simple, clean and very well put together. In short order they stole the entire market for Internet search, one that even Microsoft was playing hard to win. The story doesn’t end there, however. Google, came to play ball and they took the entire game to a new level. They continued to refine their process and eventually turned Internet search, a free product, into a revenue generating cash cow. Next, they set their sites on offering Internet based products that would compete with desktop products such as Word and Excel. Today, Google is a very serious threat to Microsoft and by many people standards has already surpassed them as the top dog on the block.

The lesson here is that we all have the opportunity to compete no matter how big and strong the competition is. The rules are the same for everyone. It’s just that not everyone is willing to pay the price that it takes to end up on top.

So ask yourself, Who is my Microsoft? Who is it that dominates my league? Who is it that has been around so long and is so powerful that no one can touch them? Then, look at what you’ve got to offer. Why does your offering fall short of the king of your league? Why are they beating you time and time again? Be honest, then go back to the drawing board and decide what you’re going to do about it.

Don’t give up before you start. You can win this game, but you’ve got to work hard at it, be smart and you’ve got to come to win. Create a clean solid offering that nails the expectations of your market. Then, expand on that offering; steadily adding to its value.

There are no untouchables out there; only well established, hard to beat competitors. As I said before, the rules are the same for everyone and everyone has the right to try as hard as they can. Good intentions won't do it. You have to be serious. You have to play hard and you have to come to win. So don't give up.

Lookout Patton. There’s a new ball team in town and they came to win.

posted on Wednesday, June 04, 2008 4:01:39 PM (Central Daylight Time, UTC-05:00)  #    Comments [0]
# Friday, February 23, 2007
I don't know why, but I thought Bob Parson's was a Christian. It must have been the fact that Parsons Technology marketed QuickVerse, among other Christian software. So, when I found out a couple of years ago that GoDaddy.com was owned by Bob Parsons, I was down right excited. Not only was GoDaddy.com a top-notch company, but there was a solid man of integrity at the wheel... or so it seemed.

Not long after I transferred my first domain over to GoDaddy.com I started to suspect that my first impressions of Bob Parsons were wrong. I began to see conscious decision on GoDaddy.com's part to use women in most of their advertisments and site design. I'm ashamed to say I turned a blind eye to that and have supported GoDaddy.com for several years now with about a dozen domains that are registered there. I've even recommended the company to others, but not any more.

In an email I got today from GoDaddy.com I read about their latest TV commercials. So I clicked on the link to to see, only to hastily scramble for the close button on my browser when I realized they are completely inappropriate and defilling. DO NOT go check them out for yourself. You can get all the information you need by reading Bob's personal blog.

So, I've learned my lesson. I won't turn a blind eye any longer. I don't want any of my domains associated with an organization who blatantly promotes the filth that GoDaddy.com peddles. I'm not exactly sure where to go, but I'm looking and once I find a registrar with integrity, morals and high standards I'll gladly pay 3 times the cost if I have to to support them. So if you know of such a registrar, please let me know. I'm interested.

With that, bye, bye Bob. I'm taking my business elsewhere... and if you by chance run across this low-traffic, low-profile blog, please take the time to read this. My prayer is that reading it will truly change your life... forever.

posted on Friday, February 23, 2007 11:24:31 PM (Central Standard Time, UTC-06:00)  #    Comments [2]