Friday, September 25, 2009

The Duct Tape Programmer

I have been reading Joel Spolsky's stuff for a long time. He has a particularly unique common sense approach to software development. His outlook tends to support my own feelings on 'big business' and software development.

His latest article hits particularly close to home.

The Duct Tape Programmer talks about 'practical programmers', that is, programmers who are more concerned with just getting the job done, and less concerned about being flashy. I have worked with a number of astronaut developers who work far above the actual product. These people are more concerned with using the latest tool or technique. What the customer wants, or WHEN they want it, is a secondary concern to them.

Read Joel's article and gain a little insight into blue collar software development.

Friday, August 28, 2009

SQL Server, Windows locales, and the default user

I've run into this before, so I'm writing it down now.

I have a package of software that contains an interactive component, as well as several services. All pieces add and update SQL server database entries that contain dates. These dates are of DateTime type.

We ran the package on a machine that was originally configured with a Canadian locale, and its associated date formats. At some point, the admin user account had its locale changed to US and then SQL server 2005 was installed.

The problem was that the interactive component created database entries with correct date formats, but the services were trying to update with incorrect date formats. Both pieces got their date values using the DateTime.Now function.

Turns out that the services were running as the LocalSystem user, and the interactive piece was running as the logged in admin user. The LocalSystem uses the locale associated with the Default user. The admin user had been configured with a US locale, and the Default user still had the Canadian locale that was set during the initial Windows install.

To fix this,

- Open Control Panel
- Select Regional and Language Options
- In XP, select the Advanced tab
- Select the check box "Apply all settings to the current user and to the Default user profile"
- Click Apply
- In Vista, select the Administrative tab
- Click the "Copy to reserved accounts..."
- Click Apply

You will need to restart any services that are running as the LocalSystem user for this to take effect.

Whew!!

Wednesday, July 8, 2009

A Car Show In Cedar Falls Iowa


I recently took a driving vacation with my family to see Mount Rushmore. It included a stop over in Cedar Falls Iowa for a day off from driving and a chance to check out their annual car show.

Here are some pics on the way to, and at the show.
Flickr

I especially liked the Corvair pickup I saw in the parking lot of a neighboring hotel when we went to leave the next morning.

Why Tape Measure Claws Move Around

I always wondered why the claw at the end of my tape measures never seemed to be riveted on securely. My favorite tool blog has the answer!
Toolmonger

Thursday, March 26, 2009

Specify a Date Format on The Fly

I write DICOM migration software in C#, and was recently faced with the task of setting a date format on the fly so that I could convert any date to DICOM format.

After much Googling, I found that DateTime has a TryParseExact() method that will allow you to specify the source string date format and put the successfully parsed date into a previously defined DateTime object. Once it was here, it was easy to use ToString() to format it DICOM-style.


CultureInfo enUS = new CultureInfo("en-US");
DateTime dt;
if (DateTime.TryParseExact(txtDateToConvert.Text, txtDateFormat.Text.Trim(), enUS, DateTimeStyles.None, out dt))
{
if (null != dt)
txtDICOMdate.Text = dt.ToString("yyyyMMdd");
}

Thursday, January 29, 2009

Fixing Vista's Folder Views

I finally had enough of Vista seemingly randomly setting the folder view on me. It never seems to be right. I want a details view for everything, so I went digging for the answers and came up with the following.

You can force the 'All Items' template on to all folders with the following:

Copy the text between the lines below into notepad & save as a .reg file.
Watch out for line wrap -- [HKEY_CURRENT_USER\...\Shell] is all one line,
there is a space between 'Local' and 'Settings'.

--------------------------------------------------
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell]
"FolderType"="NotSpecified"

--------------------------------------------------

Merging the .reg file will set the 'All Items' template for any folders that
don't currently have a view saved with a different template. You can clear
all saved views by deleting the

"HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags"

key BEFORE merging the .reg file. If any folders open with a different
template after clearing the 'Bags' key & merging the .reg file, they most
likely have a template specified via their desktop.ini file.

Quotes

Just a few quotes I found while cruising the HAMB. The thread was created for car-related quotes and sayings, but I think that some of these apply to 'life'.

  • After working on it you can climb in and go places. Who's got a cooler hobby?
  • It's the pushing that matters, not the boundary.
  • A lack of pre-planning on your part does in no way constitute an emergency on mine
  • Proper planning prevents piss poor performance
  • "Our Lady of Blessed acceleration, don't fail me now" Elwood J. Blues
  • When you get done polishing a turd you still have a turd.
  • Anything worth doing is worth overdoing.