Microsoft’s Windows 7, Outlook 2007 and Adobe’s Acrobat just do not play well together on 64-bit systems. After receiving a PDF document via email, Outlook usually cannot display the PDF.

Outlook PDF Preview

When selection Preview File, you will simply get the message PDF Preview Handler for Vista (Vista!?) caused an error.

Outlook PDF Preview Handler for Vista

For now, the only way to view the PDF file is to open it in an external PDF reader. Leo Davidson provides a fix that finally solves this issue. Just get the fix, and run the Adobe Reader preview handler x64 fixer.exe which is included in the file.

Leo Davidson's Preview Handler Fix 

After applying the fix, both, the 32-bit AppID as well as the 64-bit AppID will show the value as correct.

Leo Davidson's Preview Handler Fix

No reboot required, just go back to Outlook (worked even without restarting the application) and et voilà.

Fixed Outlook PDF Preview

Thanks to Leo Davidson, who provides this outstanding fix. Well played.

Posted at Tuesday, January 12, 2010 12:49:18 AM (W. Europe Standard Time, UTC+01:00) 
Comments [0] #      | 

One major drawback of ReSharper 4.5 was the fact that when navigating to a compiled class, ReSharper always opened the Visual Studio Object Bowser. However, personally I prefer the Metadata View of Visual Studio:

Visual Studio Metadata View 

With Version 5.0 ReSharper (currently available as EAP) there comes a major improvement. The first time you navigate to a pre-compiled class, ReSharper offers you to choose your favorite view: Object Browser, Metada View or directly the .NET framework sources.

JetBrains ReSharper 5.0

In case your change your mind (or the selected sources is not available) you can define the order for the code navigation within Visual Studio at the ReSharper Options from ReSharper / Options… / Tools / External sources:

ReSharper Options: External sources

Posted at Sunday, December 27, 2009 5:35:48 PM (W. Europe Standard Time, UTC+01:00) 
Comments [0] #      | 
Clean CodeI do not agree with all statements in Clean Code by Robert C. Martin. One of the sections I though is completely obsolete was a statement  about disinformative names:

“A truly awful example of disinformative names would be the use of lower-case L or uppercase O as variable names, especially in combination. The problem, of course, is that they look almost entirely like the constants one and zero, respectively.”

The corresponding example he gives is the following:

Disinformative names in Clean Code

So far I though it is obvious not to write such code, however, I came across similar code these days.

for (int o = 0; o < args.NewItems.Count; o++)
{
string s = args.NewItems[o].ToString();
...
}

What’s the problem here? The variable name o is used for a counter and initialized with 0. While this is already hard to read, o might indicate that we deal with an object here. So when having just a brief look over this code you might get the impression it iterates through a set of objects. This is further supported by the usage of the NewItems property here, as in .NET object references is quite commonly used to resolve e.g. a key/value pair within collections.

When using a counter variable without meaning one should use common names such as i or j that a commonly recognized as counter variables.

for (int i = 0; i < args.NewItems.Count; i++)
{
string s = args.NewItems[i].ToString();
...
}

This is only a slight modification but already improves the readability of the code.

Posted at Tuesday, December 22, 2009 2:54:07 PM (W. Europe Standard Time, UTC+01:00) 
Comments [0] #      | 

If you experience issues with a USB device not being recognized under Windows 7, there might be a simple solution to solve this. For example the MSI USB 2.0 All IN 1 Card Reader aka MSI StarReader is recognized as eHome Infrared Receiver (USBCIR) using Windows 7. The device works great using Windows Vista or even the Windows 7 pre-release versions. Unfortunately, with the final Windows 7 the device just won’t work.

MSI USB 2.0 All IN 1 Card Reader

A quick look into the Device Manager will show that the device is recognized as eHome Infrared Receiver (USBCIR). When connecting the first time Windows 7 won’t give any notice that the installation of the driver failed or that the device is not ready to use. It will simply not work.

Device Manager

This seems to be known problem, however, there is no need to wait for a Software Update from Microsoft. The solution is to manually choose the device.

  1. Start Device Manager
  2. Right-click the eHome Infrared Receiver (USBCIR) entry
  3. Select Update Driver Software
  4. Choose Browse my computer for driver software
  5. Choose Let me pick from a list of device drivers on my computer
  6. Make sure the Show compatible hardware box is checked
  7. Select the USB Composite Device and you are done

Show compatible hardware

After a few seconds the driver should be installed and the device should be ready.

Driver Software Installation

Posted at Saturday, December 12, 2009 11:12:06 PM (W. Europe Standard Time, UTC+01:00) 
Comments [8] #      | 

Vedea Martin Calsyn recently unveiled the second project we are working on at the Computational Science Laboratory at Microsoft Research in Cambridge,  UK. The Microsoft Visualization Language codenamed Vedea is an experimental language for creating interactive infographics and data visualizations. The language initially targets non-programmers, however, Vedea also provides sophisticated features such as LINQ for experienced developers as Martin demonstrates in his post. 

Vedea was demoed the first time at PDC09 to the public. The demo shown there visualizes global IP traffic monitored during a 24h time span. The data is organized in a standard CSV file and contains source, destination, geographical coordinates, IP numbers and the time and some more statistical information. 

Example Source Data

The data itself is rather unspectacular and the most useful for some statistical analysis. However, with Vedea is is relatively easy to visualize the data in a handsome manner. Before you go on, please be aware that the language is still under development and the given example just represents the state of development at the time of PDC09.

  1: img = LoadImage("world.png");
  2: Scene.Add(new Vedea.Image(img, 0, 0));
  3: 
  4: for (i=0; i<len; i=i+1) {
  5: 
  6:     b = Noise(i*255);
  7:     Stroke(20, 0, 0, b);
  8: 
  9:     x1 = csv.SourceLon[i];
 10:     y1 = cvs.SourceLat[i];
 11:     x2 = cvs.DestLon[i];
 12:     y2 = csv.DestLat[i];
 13: 
 14:     c = new Vedea.Curve(x1-10, y1-b, x1, y1, x2, y2, x2, y2-b);
 15:     Scene.Add(c);
 16: }

The fist two lines of code are used to load background image. after loading, the image is added to the current scene. The Scene object describes the standard canvas, the programmer draws on. This demonstrates the object oriented capabilities of Vedea. As Vedea is a  dynamic language which is based on the DLR, there is no need  to declare the type of the image object.

At the next lines we find a simple for-loop that iterates through all lines of the source data. The data file has been loaded similar to the image beforehand into an data file called csv and len is a value of roughly 100.000. So yes, we draw an manage about 100.000 primitives here. Most of the language features in Vedea can be used in a imperative or declarative way. Noise for example is a built-in language features that returns a random number (between 0.0 an 1.0) based on a one-dimensional Perlin noise function. This function is used to create a smooth color gradient with a alpha channel of 20 for our visualization.

Vedea Curve Stroke is used in a declarative way to set the stroke color for all primitives drawn afterwards. The next four lines simply read the x- and y-coordinates Finally, a curve is drawn and added to the current scene. The fist and the last point specified are control points that determine the curve’s flexure while the second and third point describe the actual start and endpoint of the curve. Of course the Curve primitive can be used in an imperative or declarative style (or both) as well:

  1: Stroke(255, 0, 0);
  2: Scene.Add(new Vedea.Curve(5, 26, 5, 26, 73, 24, 73, 61));
  3: Stroke(0, 0, 0); 
  4: Curve(5, 26, 73, 24, 73, 61, 15, 65); 
  5: Stroke(255, 0, 0);
  6: Curve(73, 24, 73, 61, 15, 65, 15, 65);

In the original example we use the previously generated random value b also to vary the curves control points corresponding with the color. Once we run (remember, we are based on the DLR and thus we don’t compile) the example, we finally get our visualization.

Vedea Vizualization 

In his post Nick Eaton stated that

Users of Vedea obviously need to have some background in coding.

This is not necessarily true as the example above should show. Using the declarative style of the language it is relatively easy to create appealing visualizations with only little knowledge about programming structures and technologies such as DirectX, GDI+ or WPF. As seen in the example above its within the nature of Vedea to forgive various mistakes which makes it easy to use from the very beginning.

Vedea is a research project of the Computational Science Laboratory of Microsoft Research in Cambridge, UK. The project and still under development. The example shown here represents the state of the project at the time of PDC09 as it was presented to the public. As this is an ongoing project the language might evolve, new features will be developed and others might become obsolete.

Posted at Friday, December 04, 2009 6:20:09 PM (W. Europe Standard Time, UTC+01:00) 
Comments [4] #      | 

One disadvantage working for Microsoft Research is that you cannot talk about your current work all the time. For two years now we were working on two exiting projects. However, there was not a lot to talk about since now…

The very first time we have shown Microsoft Computational Science Studio was at TechFest 2008 at that time codenamed ‘Discovery’. There we showed it to the public the first time to visualize, simulate and predict future development of global forest growth based on a novel scientific model developed by scientist Drew Purves.

Microsoft Research U.K. Science Studio Team At the Advanced Developers Conference Keynote in Bonn, Germany I already talked about the unique collaboration within the Computational Science Laboratory within Microsoft Research in Cambridge, UK. A unique setup of brilliant scientists from various fields and a group of great software engineers work together creating next-generation software solutions to address future challenges in computational science. The team includes Martin Calsyn (Architect), Alexander Brändle (Head of Technology), Drew Purves (Scientist), Matthew Smith (Post-Doctoral Researcher), Stephen Emmott (Head of Computational Science Laboratory within Microsoft Research and Professor of Computational Science at Oxford University), Vassily Lyutsarev (Manager Scientific Computing), Benjamin Schröter (Software Engineer), Eric Hellmich (Systems Engineer), Shawn Barrett (Quality Assurance and Software Engineer) and myself.

As part of his College Tour, Craig Mundie presented our work, the Microsoft Computational Science Studio (MSCSS), to the public at University of Washington, University of Illinois, Harvard University and Cornell University. Among he said about MSCSS:

Now, the way that this is actually built is it's a bit like having Visual Studio, which is a toolkit for people writing programs -- these guys call this the Science Studio, because the goal is to allow people not to write programs in the traditional sense but to compose large scale models together for scientific purposes.

Indeed, he showed the large scale model we worked no the weeks before with our scientists:

The whole talk at University of Washington is available as webcast from UWTV. Further articles are available from CNET, TechFlash and The Seattle Times where later says

A guy who is a climate scientist or a tree biologist can make a direct contribution without having to understand everything else or becoming a computer wizard in the process," Mundie said. "I tell people this is sort of doing for scientists and policymakers what Excel did for the average business guy 20 years ago

Further posts on MSCSS and our second project called Vedea, being currently demoed at PDC09, will follow soon. Until then you might want to read an overview of MSCSS at Martin’s blog.

Posted at Thursday, November 19, 2009 7:17:29 PM (W. Europe Standard Time, UTC+01:00) 
Comments [0] #      | 

Nice eye candy in Windows 7. When selecting multiple items in the Windows Explorer, the preview stacks all the selected items.

Windows Explorer Preview

Posted at Thursday, September 10, 2009 9:32:53 PM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 

AWStats is a free, Perl-based analyzer for log files. To get results quickly on a Windows Server 2008 with IIS 7 you only have to follow a few steps. These are not well documented in the AWStats documentation and require some time of research. This post will show you how to set up AWStats with IIS7 in only a few minutes.

  1. Install Perl, e.g. ActivePerl. There are 32-bit and 64-bit versions available. Make sure that Perl is added to your PATH environmental variable. The ActivePerl installer usually provides this option during the installation.

  2. Install AWStats. Remember the path AWStats is installed. Paths used below are based on the installation folder of AWStats. In this example we use c:\awstats.

  3. Run the configuration script at c:\awstats\tools\awstats_configration.pl. Follow the on screen instructions. This will create a default configuration file in c:\awstats\wwwroot\cgi-bin e.g. called awstats.www.example.org.config. The site name www.example.org depends on whatever site name was provided while running the script. When asked for the Apache Web server path type in none.

    AWStats Configuration File

  4. Open the configuration file awstats.www.example.org.config with any text editor of your choice.

  5. AWStats already supports IIS, however, it is required to tweak the config file. First change the entry for LogFile. Log files for IIS might be found at c:\inetpub\logs\LogFiles\W3SVCNNN where NNN is a different number for each web site, IIS creates log files for. Change the entry to

    LogFile=”c:\awstats\tools\logresolvemerge.pl c:\inetpub\logs\LogFiles\W3SVC1\*.log |”

    This will merge all log files for a site provided by IIS. Adjust the paths corresponding to your installations and desired log file folders.

  6. The AWStats configuration file offers the possibility to set the LogFormat to IIS (LogFormat=2), however, the log entries provided by a standard installation of IIS 7 won’t match. The AWStats documentation recommends to change the settings of IIS. The change will take effect only after restarting the Web site and is only valid for entries after that particular moment. Consequently, this is not an option if you are going to analyze the logs of the last 12 months where the original settings were used. To make AWStats work with the standard log format of IIS 7 change the LogFormat  to

    LogFormat=”%time2 %other %method %url %other %query %other %host %other %code % %other %other %bytesd”

  7. Change SiteDomain and HostAliases to meet the settings of your site.

  8. Change to c:\awstats\wwwroot\cgi-bin\ and run

    awstats.pl -config=www.example.org

    This will build the statistics database for AWStats.

  9. To create output run

    awstats.pl -config=www.example.org –output –staticlinks > …\example_org_stats.html

  10. Not that example_org_stats.html is created one folder up. In case you do miss this, the output will not work correctly until you adapt the entries for DirCgi and DirIcons in the configuration file.

  11. The output file is now located in c:\awstats\wwwroot. You might want to create a Virtual Directory or set up a Web site to view the reports via the Web or your Intranet.

    AWStats Output

Repeat steps 3-7 fore each site you want to create reports for. Repeat step 8 and 9 every time you want to create a new report.

Posted at Sunday, August 30, 2009 4:06:40 PM (W. Europe Daylight Time, UTC+02:00) 
Comments [6] #      | 

My Web Page Starter Kit is a lightweight content management system, entirely written in ASP.NET 2.0. It comes with a wide range of components that can be easily arranged and set up. However, it seems there is no possibility to include external application into the navigation structure of MWPSK.

In the following example you will learn how to integrate a application using the URI http://blog.example.org into a website using MWPSK at http://www.example.org.

Log into the site and navigate to select Administration / Pages and Navigation. Select New Page to create a new

My Web Page Starer Kit - New Page

Choose a virtual path such as blog. This will allow you to use a new URI in the form of http://www.example.org/blog.aspx.

Now open the global.asax file located in the root folder of your MWPSK installation and add the following method.

void Application_BeginRequest(object sender, EventArgs e)
{
    if (HttpContext.Current.Request.Url.ToString().ToLower().Contains
("www.example.org/blog.aspx")) { HttpContext.Current.Response.Status = "301 Moved Permanently"; HttpContext.Current.Response.AddHeader("Location", Request.Url.ToString().ToLower().Replace( "www.example.org/blog.aspx", "blog.example.org/")); } }
This will cause an URL rewrite of the HTTP-request, which is then sent to the external application at http://blog.example.org.
Posted at Sunday, August 23, 2009 8:06:54 AM (W. Europe Daylight Time, UTC+02:00) 
Comments [0] #      | 

After upgrading Windows Vista to Windows 7 you might encounter an issue with VMware Workstation and its network adapter.

VMware Workstation Error Message

When setting up a NAT or bridged network connection in VMware Workstation it shows a message telling

The virtual network drivers on the host are incompatible with the installed VMware application. Expected version 5. Please reinstall the product. Failed to connect virtual device Ethernet0.

Make sure all your virtual machines are powered off and quit VMware Workstation. Open a command shell as administrator and follow the steps below.

First cd %windir%\system32\drivers, check for the file vmnetadapter.sys, right-click it, select Details and check its version. It should be 4.0.2.0. If the file is not there,

cd "%ProgramFiles(x86)%\VMware\VMware Workstation"

rundll32 setupapi,InstallHinfSection VMnetAdapter1.Install 128 %CD%\netadapter.inf

vnetlib -- install devices

This will install the required adapters and devices. Do again a cd %windir%\system32\drivers and check for the First cd %windir%\system32\drivers, check for the file vmnetadapter.sys file.

vmnetadapter.sys

After a reboot of the host system, the NAT settings for the VMware network adapters should work again. Switching to bridged mode will probably result in another message.

VMware Workstation Error Message

Reason for the message saying

The network bridge on device VMnet0 is not running.  The virtual machine will not be able to communicate with the host or with other machines on your network.
Failed to connect virtual device Ethernet0.

might be the missing VMware Bridge Protocol on the according host network adapter.

Got to Network and Sharing Center and select Change adapter settings. Choose the network connection you want to use with your VMware network adapter, right-click, select Properties, Install, Service and finally Add. This will allow you to select the VMware Bridge Protocol. In case the entry is not listed, select Have Disk… and navigate to %ProgramFiles(x86)%\VMware\VMware Workstation.

VMware Bridge Protocol

After installing  the VMware Bridge Protocol restart the VMware Workstation and choose the bridged mode for the network adapter.

VMware Network Adapter

Posted at Monday, August 17, 2009 9:52:47 AM (W. Europe Daylight Time, UTC+02:00) 
Comments [1] #      | 
Copyright © 1995-2009 by Andreas Heil. aheil is a registered trademark of Andreas Heil. All rights reserved.
The opinions expressed herein are my own personal opinions and do not represent my employers' views in any way. Content and thoughts expressed on these pages and the weblog are subject to be changed. Out of date posts should not be considererd as my current thoughts and opinions.