Home | Blog | Publications | Photos | Services | About | Contact

Blog Archive - October, 2006

Back to Blog index.

Mon, 30 Oct 2006 14:50:50 GMT:
Borland runs a Delphi 2006 developer survey, take part!

Borland has announced a developer survey for the year, and this time it is for Delphi developers. Your participation is warmly welcome, because not it is time to affect Borland's (and DTG's) future direction with Delphi.

Sat, 28 Oct 2006 13:46:26 GMT:
It's getting cold: garage time!

Just for my future records: this year, it was late October that I had to ride my bike to the garage to wait for the warmer spring season. It's not yet snow on the ground, but since next week looks like it's going to be cold, there aren't probably going to be any rideable evenings anymore, so it's time to close the season and return to car-only driving.

Sat, 28 Oct 2006 07:25:44 GMT:
Getting information about the system in .NET

If you have programmed .NET with C# or Delphi, the chances are you have had the need to get information about the operating system that your application runs on. Depending on the information you are looking for, there are several classes in .NET BCL that help you get the information you need. For basic information, there's the System.Environment class. However, if you are interested in information about the Windows user interface and graphics setup, such as screen size, number of mouse buttons, and so on, you can use the System.Windows.Forms.SystemInformation class.

This class has over 100 properties that you will find especially useful in WinForms programming. This is the reason this class is part of the System.Windows.Forms namespace. However, it is worth noting that some of the properties duplicate functionality in the System.Environment class. From this perspective the differentiation between "WinForms useful information" and "generally useful information" isn't clear, but the idea is that if you choose to use the SystemInformation class, you can get most of the information you need from one place.

Fri, 27 Oct 2006 19:44:32 GMT:
Meeting with the Finnish MVPs and IT pros in Nuuksio

I had the chance to attend the Finnish MVP meeting yesterday in Nuuksio. I was once again fun and informative to meet other MVPs and community activists. Microsoft also demonstrated us a new portal for IT professionals called ITPro.fi. It is currently geared towards IT professionals and not software developers per se, but I'll see what I can do about it.

Wed, 25 Oct 2006 13:37:54 GMT:
Correction about Virtual PCs .ISO image support

I wrote on Saturday that Virtual PC doesn't support .ISO images for DVDs, only for CD-ROMs. I found out today that I was mistaken; Virtual PC indeed does support DVD .ISO images.

So when I previously tried to use DVD .ISO images, they had to be either corrupted, or, there's some kind of limitation within Virtual PC that doesn't like very large files inside .ISO images. If you know the answer, let me know, as I probably don't have the time to investigate the issue since I still use VMware primarly.

Mon, 23 Oct 2006 15:06:22 GMT:
A new type of SQL attack surfaces, beware!

I read with great interest from the latest MSDN Magazine article about a new type of (to me, at least) SQL attack that is similar to the famous SQL injection attack. This time, it is about using the single quote characters ' in input strings. So if you are using Microsoft SQL Server as your database, or other databases that do similar things with quotes that SQL Server does, be sure to read this article, and check out your code.

Sat, 21 Oct 2006 08:31:29 GMT:
A solution to Vista RC 2 install error

Last week, I tried installing Windows Vista RC 2 to my PC, but it failed under VMware Workstation because of a missing CD/DVD driver, or at least so the error message said. Today I had more time to test, and I found a solution to my problem by using Microsoft Virtual PC 2004 (now free) instead.

However, even using Virtual PC didn't directly solve the problem, but I got around the problem and wanted to share my findings. Firstly, I had downloaded the Vista RC 2 .ISO image from MSDN, and since (unlike VMware) Virtual PC doesn't support using DVD .ISO images directly, I had to burn the .ISO image to a DVD+RW disc. Then, I fired up a Virtual PC virtual machine, only to find out that Vista failed to install:

Windows cannot open the required file D:\Sources\Install.wim. The file may be corrupt
or missing. Make sure all files required for installation are available, and
restart the installation. Error code: 0x80070570.

Oh well! My first thought was that I would either have a corrupted .ISO image download, or a corrupted DVD burn. The latter seemed more likely, so I reburned the DVD, but that didn't help. Since I didn't want to wait another 8 hours to download the .ISO image again, I instead went browsing for the error message on TechNet forums, and found that there's a nifty little utility called "Virtual CD-ROM", a freebie written by Microsoft, and only 32 KB in size.

Now, this tool does what it promises. It's a bit obscure to use, but you get a ReadMe file with the instructions. The files you need are (in addition to the instructions, that is) VCdControlTool.exe and VCdRom.sys. These very small files (the device driver is only 9 KB!) are downloadable from Microsoft's web site. I don't know if there's a link available that isn't directly to the EXE file, and the only place on Microsoft's web site I could find a reference to this utility was in the KB article 916902.

Now, by downloading this utility and following the instructions (the utility isn't something what I would call really easy), I could mount a virtual CD drive from my MSDN .ISO image, and then use that as the physical CD/DVD drive for Virtual PC. And suddenly, I could easily install Vista Release Candidate 2. Rock on!

Fri, 20 Oct 2006 15:57:26 GMT:
Column in Prosessori magazine

The Finnish Prosessori magazine has published my column about Borland's future in their "Vieraskynä" section.

Wed, 18 Oct 2006 14:22:38 GMT:
Internet Explorer 7 is here

Seven. Why, I didn't even think one would need so many version of a seemingly simple piece of software, a web browser. Well, today a web browser is much more than an HTML visualizer, it is an personal information processing solution and a highly programmable platform for running applications.

So the news is out: IE 7 is now ready to be downloaded for your Windows XP SP2 system. eWeek has a review here. Tabs, better security, RSS support and slicker user interface are here for you to enjoy!

Mon, 16 Oct 2006 14:12:06 GMT:
Vista UAC architecture information

To me, Windows Vista's User Account Control (UAC) is still something I cannot say I'd fully master. For this reason it's important that Microsoft publishes the details about this technology that soon (in few year's time, anyway) affects most of us. As part of the Vista Developer Story, there's an article titled "Windows Vista Application Development Requirements for User Account Control". Highly recommended reading for any Win32 or .NET developer!

Sun, 15 Oct 2006 05:22:49 GMT:
Vista RC 2 fails to install on my PC :-(

Just when I wanted to test the newly-downloaded Windows Vista Release Candidate 2 (build 5744) on my VMware Workstation, I noticed it failed to install. :-( The problem is a missing CD/DVD driver which sounds a bit odd in my opinion, but that's what Vista keeps telling me:

"A required CD/DVD drive device driver is missing." Hopefully, the RTM version will work better. Until then, I'm going to stick to my RC 1 version.

Thu, 12 Oct 2006 16:12:22 GMT:
My Visual Studio tip in CodeZone.fi

The local Microsoft CodeZone web site has published my latest tip of using the Code Analysis feature in Visual Studio 2005. The article is titled "Automaattinen koodin analysointi" and is obviously in Finnish. Enjoy!

Tue, 10 Oct 2006 13:56:11 GMT:
Two new C# FAQ entries available on MSDN

Two new of my C# FAQ entries are now on-line at the MSDN C# FAQ Blog. This time, the entries are titled "How do I send out simple debug messages to help with my debugging?" and "How do I calculate a MD5 hash from a string?".

Hope you find the entries useful. Of course, feel free to comment on them on the blog page.

Sun, 08 Oct 2006 13:45:26 GMT:
.NET development info from Yahoo!

Did you know that Yahoo! has it's own .NET developer center at their Developer Network? I didn't, and it's good to see that Yahoo! is helping .NET developers to get forward with their stuff. Often both C# and VB.NET code is given.

Of special interest to me is their topic/sample code about using Windows Presentation Foundation (WPF, aka Avalon) to access their information. The example given shows how to use a XmlDataProvider to accress one of Yahoo!'s RSS feeds to read information about the current weather, and sunrise/sunset times for the day. Looks good!

PS. A couple of new photos are available for your enjoyment at my Photos page.

Sat, 07 Oct 2006 09:48:00 GMT:
Reading list of users from an Active Directory domain with C#

I needed to write a simple C# application that reads me the names of user accounts in an Active Directory domain (Windows Server 2003 based domain). The .NET class library contains a whole namespace dedicated to directories: System.DirectoryServices. This namespace contains a class called DirectoryEntry that you can use to read the user accounts in a given organizational unit (OU). Here's the example code:

using System.DirectoryServices;

private void ReadActiveDirectory()
{
    string path = "LDAP://OU=ChildOU,OU=TopLevelOU,DC=mycompany,DC=local";
    DirectoryEntry entry = new DirectoryEntry(path);
    foreach (DirectoryEntry child in entry.Children)
    {
        textBox1.Text += child.Name+"\r\n";
    }
}

Here, the most important thing is of course the LDAP "URL", which starts with the string "LDAP://". Note: it is very important that you write the word "LDAP://" with upper-case (capital) letters. If you don't, you will get a binding error at runtime.

To help you solve this problem, here are the details what happens if you type in for example "ldap://" by accident. The error is:

{"Unknown error (0x80005000)"}
{System.Collections.ListDictionaryInternal}
ErrorCode -2147463168
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)

In short: don't do it! Other than that, using the Active Directory from .NET is quite simple. And if you are using .NET 2.0 (you should), then you can also utilize the new namespace System.DirectoryServices.ActiveDirectory. Happy ADSI (Active Directory Service Interfaces) programming!

Thu, 05 Oct 2006 15:11:34 GMT:
No news is inexcusable for Borland

Since Borland announced in February that they are going to spin off their IDE business (including Delphi and InterBase), the Developer Tools Group (DTG) has been busy doing stuff and preparing for the spin-off, but none that energy has gone into informing the current customer base what is happening. Good news have always been available just "next week", but now that it's already October, I'm growing a bit impatient about Borland DTG and their ability to actually deliver what thay say the would.

But, I'm not the only one complaining. Check out the Borland Usenet newsgroups, or see the blog entry from DevExpress. Or, check the response to latest Nick Hodges blog post.

What especially Delphi developers need is a clearly and loudly communicated, official information what the company is doing for it's products (Delphi) and how the spin-off is doing. Customers are looking for .NET 2.0 support (heck, .NET 3.0 is soon here and Borland doesn't even have a Delphi .NET 2.0 beta out), the 64-bit compiler, and support for mobile development (Windows CE/Pocket PC). In this situation, a no-news strategy is inexcusable, if Borland DTG is willing to keep its current customer base. Otherwise, those left will rapidly move to Visual Studio. With the current state of things, I don't think many look back.

So Borland, get your act together!

Thu, 05 Oct 2006 14:04:20 GMT:
Google Code Search helps you find the source code examples you need

Interesting stuff boiling in Google's labs: eWeek today reports that Google is preparing to launch a search feature called Google Code Search. As the name implies, this search will only look for source code.

Tue, 03 Oct 2006 14:03:14 GMT:
Speaking of photography, good DNG vs. Your-RAW-Format comparison

Stuart Nixon has written a detailed comparison between Adobe's Digital Negative format (DNG) and camera vendors' native RAW formats, like .CR2 from Canon. The basic message is: "DNG Is Not The Answer". He also gives insight into the file formats themselves, educating reading even if you are just interested in programming. His article appears on the OpenRAW site.

Mon, 02 Oct 2006 16:21:16 GMT:
Lucky me, lenses from B&H arrive on time

Christmas time again: UPS bought my packet from B&H today. I ordered it on Thrusday evening, so one can't complain about delivery times at all.

Mr. Postman brought me my Canon EF 17-40mm wide-angle and the EF 100mm macro. Let's see what I can come up with these two black ones.

Mon, 02 Oct 2006 14:17:03 GMT:
Why too aggressive an antispam filter is bad for you

There probably aren't many people on this planet that would love their daily dose of junk e-mail, although one can just wonder the creativity and efforts of the spammers.

Now, most everybody has somekind of spam filter in place. But, some people seem to take spam personally, and install an automatic filter that block incoming e-mail at the gateway/mail server. Yeah, that's cool technology, but when you turn the volume up and let the script kiddies (sorry) do the tweaking, that filter can literally kill your business.

I'd love to write a whole article about such bad filtering methods or the disastrous results, but it is enough to say that think twice before you install such a filter, and most importantly, do know how it works. In business, it is very scary to block e-mails based on reverse DNS rules, certain keywords, or mail header fields to name a few. Sure, no spam will get through, but at the same time, you will stop those orders coming in from customers or important mails from partners. Don't ask me how many time I've seen this happen in real life. Call this my anti-antispam quest, but watch out those free (Linux-based) "100% effective" filters. You've been warned.

Sun, 01 Oct 2006 17:00:18 GMT:
Checking the recent policy overrides from Team Foundation Server database

If you have Visual Studio 2005 Team Foundation Server (TFS) up and running in your organization (or the "free" Workgroup Edition on your personal development PC as I do), chances are you would like to list all those policy overrides that were done during a check-in operation. Now, there are two routes to this: using the TFS APIs (which are web services) or tinkering with the SQL Server database that TFS uses internally. Since I like SQL, I'd love to share my simple SQL statement for listing the most recent policy overrides. Here you go:

SELECT [cs].[CreationDate]
      ,[po].[Comment]
      ,[po].[ChangeSetId]
      ,[id].[DisplayName] as 'The Most Wanted'
FROM   [TfsVersionControl].[dbo].[tbl_PolicyOverride] po
	  ,[TfsVersionControl].[dbo].[tbl_ChangeSet] cs
	  ,[TfsVersionControl].[dbo].[tbl_Identity] id
WHERE ([po].[ChangeSetId] = [cs].[ChangeSetId]) AND
      ([cs].[CommitterID] = [id].[IdentityId])
ORDER BY [cs].[CreationDate] DESC

Of course, this statement will probably break once the next version of TFS comes out, but for version 1.0/2005, this works nicely (and is fast). Good luck!

 

› Blog Archive