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
Wednesday, July 8, 2009
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");
}
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.
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.
Tuesday, October 14, 2008
My Camaro
Its not much, but its a start. I finally have a genuine 1967 Camaro Rally Sport. Its just a shell with doors, a rear axle, some interior parts, and other bits. The good news is that it came with an Ontario registration and paperwork from GM Canada showing that it was a 275hp 327 with an M20 4 speed and a 12 bolt posi rear axle.
Now, if they'd only get my new garage finished.
Go to Flickr for the full set.
Now, if they'd only get my new garage finished.
Go to Flickr for the full set.
Wednesday, August 13, 2008
Lucas Restorations
If you are looking for someone to restore your First Generation Camaro, THIS looks like the place.
An awesome website to browse and see some nicely restored first gen Camaros.
By the way, this is exactly what I'd like to build. This is a real 67 Z/28, but I'd settle for a good clone.
Lucas Restorations
Thursday, August 7, 2008
Use Windows Installer Properties When Setting Registry Key Values
Whew! That's a mouthful!
I needed to set a registry key value based on the the installation directory of the package. Turns out you can use Windows Installer properties enclosed in square brackets.
Like this...
[TARGETDIR]bob.exe
... to get at the bob.exe in its install directory. This expands to...
C:\Program Files\Bob Application\bob.exe
... in the registry during installation.
You can use properties like
I needed to set a registry key value based on the the installation directory of the package. Turns out you can use Windows Installer properties enclosed in square brackets.
Like this...
[TARGETDIR]bob.exe
... to get at the bob.exe in its install directory. This expands to...
C:\Program Files\Bob Application\bob.exe
... in the registry during installation.
You can use properties like
- TARGETDIR
- ProgramFilesFolder
- Manufacturer
- ProductName
- SystemFolder
Subscribe to:
Posts (Atom)