
Back to Blog index.
I recently found an interesting photography related site The Getty (not to be confused with Getty Images, the stock photography site), which contains an interesting section called Research Institute. Getty studies arts, and so photography is also included.
The links are especially useful to me: Data Standards and Guidelines and Introduction to Metadata. Enjoy!
The most recent TechNet magazine features an article about Windows Vista's backup features. Yes, yer ol' NTBackup isn't the best what Windows can offer anymore, so it's best to learn some new tricks.
I blogged previously about reading an application's (assembly's) description, product name, and so forth. However, I forgot to mention that if you are writing WinForms applications, you can read the ProductName and ProductVersion properties with great ease using the Application class. This class exposes two properties with the said names, which couldn't make your life easier.
In console applications I haven't found a method that would be as easy, so you need to revert to the code I gave previously. Of course, the code will still work in Windows Forms applications as well.
But if you want to display your application's name for example in a Help/About dialog box, use the Application class. This makes your life easier.
The Finnish Tietokone magazine features my latest article about digital photography: "Järjestä digikuvat avainsanoilla". The article talks about organizing your digital photos with folders, naming conventions and keywords. Also certain software applications such as Lightroom are discussed.
I recently had the need to convert a physical server into a virtual server for testing purposes. I had a Symantec LiveState image taken (a .s2vi file) from the server (Symantec has recently chosen to rename LiveState to Symantec Backup Exec System Recovery or BESR), and wanted to run this machine as a virtual one inside VMware Workstation 5.5.
VMware has the option to directly open a LiveState image as a virtual disk, but the Windows Server 2003 machine of which the image was taken refused to boot very early in the boot process, and thus I wasn't able to run it virtually. I suspect that this was because of the Adaptec RAID disks in use on the server.
However, I found a solution to this problem by using the VMware's tool called VMware Virtual Machine Importer (about which I blogged previously). This utility is a bit hard to find, since it lives in the following directory:
C:\Program Files\Common Files\VMware\VMware Virtual Machine Importer
Yes, this tool installs with VMware Workstation, but there's no icon in the Start menu, for example. Nonetheless, if you have Workstation 5.5, you have this tool, called v2vapp.exe. There's a PDF document available for this utility.
I used this tool to convert the LiveState image into a VMware virtual disk, and converting the 8 gigabyte image took about an hour. After the conversion, VMware asked whether I'd like to update the BusLogic SCSI drivers to LSI SCSI drivers, but I declined. Even so, the virtual machine now run nicely, and thus the problem was solved.
The Finnish IT community ITpro.fi arranged an event-planning meeting yesterday evening at Saunasaari, and I had the pleasure to attend (thanks JP!). It was exciting to plan the fortcoming, first bootcamp to be held in early September. I'm sure it'll be a great way to spend two days and learn many new things, espcially about Windows Server 2008.
Canon is at it again: this time three new interesting and important announcements: Canon EOS-1Ds flagship DSLR, new and vastly improved EOS 40D (all nine auto-focus points are now cross-type), and finally an updated 14mm ultra wide angle lens.
I do have to seriously consider purchasing the new 14mm lens, for I find myself limited with my current 17mm lens. It's dark at f/4, and I'd love to go wider. We'll see. :-)
The next Visual Studio version, codenamed "Orcas", and officially Visual Studio 2008, also comes with a new version of Team Foundation Server or TFS. There's a great blog post on MSDN that lists the final (new) feature set of TFS 2008.
Things of particular note include:
Sounds like a great new release to me!
I noticed a nice finding from Microsoft Research: they have researched on the process of deblurring (making clear) digital photographs that have blurred because of camera shake and long exposure. By combining with an underexposed, but non-blurred image, a crisper image can be restored.
This process is detailed in their research paper, available for free.
When I'm managing my files, I'm using Windows Explorer. But I often find myself in a situation where I'd need the full path and file name of a set of files, for example to be pasted to source code, documentation, or e-mail message. Up to Windows XP, you had to ready-made solution for this, and thus I ended writing simple console applications, that I would then place (or rather, the .EXE file's shortcut) in the Windows SentTo folder.
Then, when I would select one or more files in Windows Explorer, right-click, and then select my application form the Send To submenu, Windows would execute my program, and pass in the full path of each file selected as regular command-line parameters. Thus it would be trivial to pick them up in code, and place them in the clipboard, for example each on a line of their own.
For example in C#, you could write an application like this:
using System;
using System.Text;
using System.Windows.Forms;
namespace CopyFilenames
{
class Program
{
[STAThread]
static void Main(string[] args)
{
if (args.Length > 0)
{
StringBuilder paths = new StringBuilder();
foreach (string path in args)
{
paths.AppendLine(path);
}
Clipboard.SetText(paths.ToString());
}
}
}
}
Or, in Borland/CodeGear Delphi:
Program CopyFilenames;
{$APPTYPE CONSOLE}
Uses
Classes,
SysUtils,
Clipbrd;
Var
SL : TStringList;
I : Integer;
Begin
If (ParamCount > 0) Then Begin
SL := TStringList.Create;
Try
For I := 1 to ParamCount do Begin
SL.Add(ParamStr(I));
End;
Clipboard.AsText := Trim(SL.Text);
Finally
SL.Free;
End;
End;
End.
I've succesfully used this method since Windows NT 4.0 I believe, and even still on Windows XP. However, with Windows Vista, you don't need these kind of solutions anymore, as you can hold down the Shift key while right-clicking a file (or a set of files), and then selecting the "Copy as Path" command. Neat.
But still one question remains: why didn't Microsoft implement this quite trivial, but often essential little time saver function in Windows operating systems a long time ago? Raymond Chen's (of "The Old New Thing") article in the recent TechNet Magazine details why. Yes, they tried to do it, but it didn't work. As it often is, the more you know about a system, the more likely you are to accept its shortcomings.
On July 23th, I blogged about a problem with NULL characters and the .NET version 1.1 System.Web.Mail.SmtpMail class and its Send method. I got an e-mail from a reader in PA, USA giving additional details, and with his permission I'm stating the information I got here.
It turns out that the problem occurs after installing the security patch 928366, detailed in the security bulletin MS07-040. Further, there's a whole web page about the problem this fix addresses. On this page, this problem is called the ".NET Null Byte Injection Vulnerabilities".
Thanks Patrick for the update!
For example in Outlook 2003, Word (Office Word, to be precise) is the default e-mail editor. If you are like me, you most often send your e-mails in plain text (ASCII), and don't bother with fancy formatting or image attachments. Thus, you could simply disable Word integration (and speed up your Outlook) and happily type in your messages with Outlook 2003's default editor.
Now, since Outlook 2007 is here, it turns out that you cannot simply disable Word, because Outlook now relies on Word for e-mail editing, even if it is plain text only.
Now, this obviously raises the question "what happens if I don't install Word 2007 but only Outlook 2007". Good question. It turns out that whenever you install Outlook 2007, you will also install certain parts of Word, even though you wouldn't install the complete product. However, if you install Word as well as Outlook, you will get additional features.
There's a Microsoft white paper detailing this. You can download the .DOCX version directly here.
Quite often, I see the question "What is the difference between int and System.Int32? Or string and System.String?" in C#/.NET related newsgroups and forums popping up. There's also an answer to this question in the MSDN C# FAQ, but since not many are aware of this FAQ, I give my version of the answer here.
So, what is the difference between, say, int and Int32 in C#? The answer is that there's no difference at all. As noted in the C# Language Specification 1.2 (this also applies to C# 2.0 and 3.0), section 4.1.4, "Simple Types":
C# provides a set of predefined struct types called the simple types. The simple types are identified through reserved words, but these reserved words are simply aliases for predefined struct types in the System namespace, as described in the table below.And, a table from the C# Reference follows:
| C# Type | .NET Framework Type |
| bool | System.Boolean |
| byte | System.Byte |
| sbyte | System.SByte |
| char | System.Char |
| decimal | System.Decimal |
| double | System.Double |
| float | System.Single |
| int | System.Int32 |
| uint | System.UInt32 |
| long | System.Int64 |
| ulong | System.UInt64 |
| object | System.Object |
| short | System.Int16 |
| ushort | System.UInt16 |
| string | System.String |
That said, it doesn't matter whether you choose to use System.String or string. Both work equally well, lead to fast code, and so on. The difference is only cosmetic.
On July 19th, I made an order from Microsoft's Company Store which included some books, t-shirts, and similar. It was only today when I received my 15 lbs worth of stuff, even on UPS Express delivery. An unfortunate series of events took place, but even so, the UPS tracking listing is quite interesting reading:
| Location | Date | Local Time | Description |
| HELSINKI, FI | 08/07/2007 | 6:56 A.M. | IMPORT SCAN |
| HELSINKI, FI | 07/23/2007 | 9:33 A.M. | CLEARING AGENCY IS REQUIRING AN INVOICE COMPARISON TO THE ITEMS BEING SHIPPED / DELIVERY RESCHEDULED |
| 07/23/2007 | 7:10 A.M. | OUT FOR DELIVERY | |
| 07/23/2007 | 7:09 A.M. | IMPORT SCAN | |
| MALMO STURUP, SE | 07/23/2007 | 3:57 A.M. | DEPARTURE SCAN |
| 07/23/2007 | 3:06 A.M. | ARRIVAL SCAN | |
| PHILADELPHIA, PA, US | 07/20/2007 | 7:07 A.M. | ARRIVAL SCAN |
| LOUISVILLE, KY, US | 07/20/2007 | 7:00 A.M. | ADVERSE WEATHER CONDITIONS CAUSED THIS DELAY |
| 07/20/2007 | 5:40 A.M. | DEPARTURE SCAN | |
| 07/20/2007 | 12:33 A.M. | ARRIVAL SCAN | |
| HAPEVILLE, GA, US | 07/19/2007 | 11:07 P.M. | DEPARTURE SCAN |
| 07/19/2007 | 8:54 P.M. | ARRIVAL SCAN | |
| ROSWELL, GA, US | 07/19/2007 | 8:40 P.M. | DEPARTURE SCAN |
| 07/19/2007 | 8:35 P.M. | ORIGIN SCAN | |
| US | 07/19/2007 | 4:46 P.M. | BILLING INFORMATION RECEIVED |
For instance, I've never seen such an exception being made, nor the reference to bad weather. But most interestingly, the trouble was caused by the not-so-clever mess the Finnish Customs caused. Even though the delivery address was "c/o" ("care of") my employer, they figured out that my employer was the payer of all taxes and duties, which it of course wasn't, since I ordered the stuff to myself only. Secondly, the customs demanded the original invoice from my company, as the commercial invoice from eCompanyStore (the company hosting the Microsoft Company Store) prints on the invoice in capital letters: "This is not an invoice for payment". Which is perfectly fine, as Microsoft pays the taxes and duties, and the delivery term is DDP, meaning Deliver Duty Paid, and Incoterm (short for International Commercial Terms).
All in all, I'm not very happy with the Finnish Customs, but this isn't the first time. They made two mistakes this time: failing to understand what the very common term "c/o" means, and secondly failing to understand the DDP term. But that's enough ranting, as there's an happy ending to the case. :-)
Microsoft has yesterday updated it's Visual Studio Team System (VSTS) related guide called the "Development with Visual Studio Team Foundation Server Guide". Previously in "beta", this guide is now freely downloadable from the CodePlex site.
The documentation has about 500 pages and consists of the following topics:
Even so, the download is only less than 7 MB. Download your copy today!
I noticed that Microsoft had updated my favorite synchronization utility called SyncToy, which I use to synchronize my stuff with my external USB drives. SyncToy is now at version 1.4, and freely downloadable from their Download Center.
Previously, I had SyncToy 1.2 installed, so I wondered if there would be any migration (upgrade) problems. No instructions were given (or I didn't find them), so I just proceeded with the install. That went smoothly, even to the same directory as the previous install.
When I started SyncToy 1.4, all my previous folder pairs were intact, which was great. In fact, the folder pair settings are the most important data that SyncToy saves, and these settings are by default stored to (My) Documents\SyncToyData\SyncToyDirPairs.bin, which is a file you might want to back up as well. Another option is to simply take a screenshot of all your settings, which is easy to do, especially on Windows Vista with the new screen capture tool.
However, my initial feeling of success dismissed quickly, as pressing the "Preview All" button under "All Folder Pairs" simply did nothing. It didn't give any error messages either. I thought something had gone wrong in the installation, so I uninstalled SyncToy and installed it again. No help; the situation kept the same. I tried single folder pairs, but they failed as well. Then, I created a new folder pair, and it worked nicely.
Finally, I noticed the reason. SyncToy 1.2 allowed to use the backslash character (\) in folder pair names, which SyncToy 1.4 didn't anymore do. I didn't find a way to rename folder pairs (and I didn't want to edit the binary settings file, wish it'd been XML based instead), so I simply recreated them. Easy, but somewhat time-consuming, since I wanted to be sure my backups were not affected.
After the fact I also noticed error messages in the SyncToy log file, named "SyncToyLog.log" similar to these:
SYNC: 08/06/2007 21:34:46:687: *** System.IO.DirectoryNotFoundException: Could not find a part of the path 'SYNCTOY_C:\Batch'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.Threading.Mutex.<>c__DisplayClass3.<.ctor>b__0(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup( TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity) at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
Seems like SyncToy is creating a named Win32 mutex to help in thread synchronization, but that fails because of the illegal character in the folder pair name.
You might ask why on earth I did use backslashes on folder pair names in the first place? Since I used them to simply name the source directory (i.e. the left folder)! That was the easiest thing to do. Now I changed the backslashes to hyphens instead, and all is okay. Take this as your SyncToy migration crash course.
Keywords: Microsoft SyncToy, migration, update instructions, version 1.2 and version 1.4, photography, Windows XP ProPhoto.
My fellow ITpro.fi team member teached me about Windows Live Writer (WLW), which is an exciting-looking desktop application for blogging. The application is free, and currently in beta. It's technically a .NET application, which is good to see.

The application allows publish to many blog engines, including SharePoint 2007 sites and Windows Live Spaces, WordPress, Blogger, LiveJournal and TypePad, among others. Since I have myself built my custom blogger application in C#, it would be great to build integration into my publishing system. We'll see if I have to chance and time to dig into this. Could be fun. :-)
Thanks MB for the find!
Somewhat older news, but nonetheless interesting. Microsoft has recently released IronRuby, their Ruby language implementation for .NET.
There's also a site called Try Ruby! that allows you to try Ruby on-line, in case you are not familiar with the language. CodeGear is also working on products around Ruby, by the way.
Learned something new today: Windows 2000 and newer (that includes Windows XP and Windows Vista) support mapping keyboard scancodes to different codes, meaning that you can effectively disable or remap keys to something else. This feature can come handy in certain special situations, but I must say I'm a bit concerned about this registry key's existence from security and system stability point of view. Since the key is at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
...it is perfectly possible that some malicious program would disable certain important keys. But of course, there are many other critical keys in the registry as well, so the best thing is to make sure your HKEY_LOCAL_MACHINE key is indeed secured. Vista's UAC would help here!
Happy August, everyone! I noticed that Microsoft has during the summer updated the Windows Vista User Experience Guidelines (the "UX Guide") on MSDN. That's a set of documents that I'm greatly interested in. MSDN also hosts a single, 30 MB PDF download (yes, that's over 600 pages), but the problem is that this PDF compilation is an older version of the documentation from February.
In any case, it's best to start following the guidelines if you aren't already. If nothing else, check the top requirements and also top violations!
› Blog Archive