Error TF30224 – The First Project on TFS 2010 is the hardest

While setting up Microsoft Team Foundation Server 2010 Beta 2 one might into an non obvious issue with user rights. The error observed would look the following:

New Project TFS Error TF30224

The TFS installation considered is a single machine installation with SQL Server Reporting and Analysis services and SharePoint Services installed during the TFS installation.

The full descriptions of the error is:

Error
TF30224: Failed to retrieve projects from the report server. Please check that the SQL Server Reporting Services Web and Windows services are running and you have sufficient privileges for creating a project.

Explanation
The Project Creation Wizard encountered a problem while creating reports on the SQL Server Reporting Services on http://coruscant/ReportServer/ReportService2005.asmx. The reason for the failure cannot be determined at this time. Because the operation failed, the wizard was not able to finish creating the SQL Server Reporting Services site.

User Action
Contact the administrator for the SQL Server Reporting Services on http://coruscant/ReportServer/ReportService2005.asmx to confirm that the SQL Server Reporting Services server is running and you have sufficient privileges to create a project . Your user account on SQL Server Reporting Services must have Content Manager permission to create a new project. Also, you might find additional helpful information in the project creation log. The log shows each action taken by the wizard at the time of the failure and may include additional details about the error.

A wild guess might be checking all rights for SQL Server, SharePoint sites, SQL Server Reporting Services etc. Pat Ramadass comes up with the right hint that origins from the previous TFS version.

First of all do not look for the Reporting Service Configuration Manager. Go straight to http://localhost/Reports/ (logged in on your TFS server machine with administrator rights). You will get the SQL Server Reporting Services site. Select the Properties page and click on New Role Assignment.

SQL Server Repoting Services - Home

Now add exactly the user (or group) you tried creating the TFS Team Project with. Select at least Content Manager and confirm by pressing OK.

SQL Server Reporting Services - New Role Assignment

Go back to you local machine and try to create the TFS Team Project again. The users should now have sufficient rights to create the project.

How to use Google Calendar Sync with Microsoft Outlook on Windows 7

There is an urban legend that Google Calendar Sync would not run on Windows 7. Indeed, if you follow the installation instructions Google Calendar Sync will first ask you for your credentials and consequently fail to connect to Google Calendar. In the following you’ll find an solution how to use Google Calendar Sync with Microsoft Outlook 2007 on a Windows 7 system that that is provided under a works on my machine premise.

Google Calendar Sync 0.9.3.5

Once saved, Google Calendar Sync will try to connect but fail with error 2006. There is not many information about this error beside various frustrated users ranting about this and some statements that the current version of Google Calendar Sync (0.9.3.5) is not supported under Windows 7 yet.

Google Calendar Sync Error 2006

In the current case we will even run Google Calendar Sync on a Windows 7 64-bit system. Before you continue, make sure you exit Google Calendar Sync. First of all open a Explorer window and navigate to C:Program Files (x86)GoogleGoogle Calendar Sync or C:Program FilesGoogleGoogle Calendar Sync on a 32-bit Windows 7 system.

GoogleCalendarSync.exe

Right click on GoogleCalendarSync.exe and select Properties. Now select the Compatibility tab, check the Run this program in compatibility mode for and choose Windows Vista (Service Pack 2) from the drop down list. Click on OK and restart Google Calendar Sync either from your desktop icon or from the start menu entry.

GoogleCalndarSync.exe Properties - Compatibility Tab

Once restarted you can happily sync Google Calendar with Microsoft Outlook 2007 on (even a 64-bit) Windows 7 system.

Google Calendar Sync running on Windows 7

The Compatibility mode of Windows is a great feature to make usage of legacy programs that have not been or will never bee updated to the latest Windows version. Since Windows 7 even mode modes (including Windows Server) back to Windows 95 are supported. The number of supported versions might vary depending on the Windows 7 version you use, however, the Vista and XP mode should always be available.

Extension Method Naming Conventions Best Practices

With .NET Framework 3.5 Extension Methods were introduced to .NET developers. The concept of extension methods allows you to

“[… ] ‘add’ methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type.”

While the most common use for extension methods are LINQ standard query operators, extension methods provide aplenty of new possibilities. One issue one comes along is the correct naming if extension methods and their corresponding classes.

The signature of a extension method differs slightly from a common signature as the first parameter is preceded by the this modifier:

public static int WordCount(this string that)

I haven’t found much about naming conventions, most about naming the methods itself, how to organize them or what you should not do with them. If you have read through Robert C. Martin’s Clean Code you might know that naming is an essential foundation of clean code. I’ve read through a lot of code outside and inside of Microsoft, however, I haven’t seen anybody following global guidelines. There might be group specific conventions but nothing that seems to be applied by the majority of developers.

1. Name the type parameter that

This seems to be very odd, but naming the type parameter that has quite some charm. When reading the signature you immediately see the type parameter, when reading through the method body you always know that that is the type parameter the extension is written for. When reading through many extension methods I found it very pleasant to read those methods following this convention.

public static int WordCount(this string that)

2. Create dedicated static classes for each type

No matter whether you put the extension methods in a separate library, in a specific sub-folder within your project or somewhere random

a) Do create separate files for each class containing extension methods.
b) Do create separate classes for each set of extension methods for a certain type.

Once you follow these simple rules you can think straight forward about naming of classes containing extension methods. If you collect all extension methods within a single class (or file) you might end ob with a lot of obsolete code while your application evolves. Due to rewriting your code and refactoring your application same extensions might become obsolete or some classes you extend do not exists anymore in your project. Using dedicated files make maintaining your code base much more easy.

Classes for Extension Methods

3. Use the Extension suffix

During our day job we realized that naming the class with the suffix Extension provide good semantics of the class. This indicates clearly that you are dealing with a collection of extensions. For example, while using the using the Visual Studio Object Browser you can easily identify those classes providing extension methods.

public static class StringExtension
{
    public static int CountWords(this string that)
    {
        ...
    }
}

4. Name what is being extended

It seems to be a good practice to name classes after what they extend. If you follow the previous two guidelines this should be a straight forward job. In addition your code is good to read and easy to understand. In practice we came along various conflicts with already existing naming guidelines. Anyway extensions are a relatively new concepts and one would expect that there might be conflicts with already existing naming conventions. The following will illustrate one of those conflicts:

Naming conventions for Extension Methods

By convention interface names should start with a capitalized ‘I’. So odes ICalculator. Following the above guidelines you might consider naming the corresponding class providing extension methods for the interface ICalculator type CalculatorExtension. In this case it seems reasonable to neglect the convention for interfaces:

Consequently, ICalculatorExtension provides extension methods for the ICalculator type, CalculatorExtension provides extension methods for the type Calculator. This approach will not only increase the maintainability of your codebase, I will also allow new team members to orientate quickly in your codebase.

There are various reasons for and against naming conventions for extension methods. Once writing Reactive Extensions for .NET this might get even more complicated as you will write a lot of extension methods for dedicated purposes. However, for common codebases the provided guidelines might help to develop easy to read and maintain, clean code.

Adobe PDF Preview for Windows 64-bit

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.

ReSharper 5.0 can Visual Studio 2010 Metadata View

One major drawback of ReSharper 4.5 was the fact if one navigates back 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 ViewWith version 5.0, ReSharper (currently available as EAP) comes a major improvement: The first time you navigate to a pre-compiled class, ReSharper offers you to choose your favorite view: Object Browser, Metadata View or directly the .NET framework sources.

JetBrains ReSharper 5.0

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

ReSharper Options: External sources

Clean Code: o = 0

I do necessarily  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:

int a = 1;
if (O == 1)
  a = 01;
else
  l = O1;

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.

<pre>

int a = 1;
if (O == 1)
a = 01;
else
l = 01,

</pre>

Fixing Wrong USB Devices in Windows 7

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

A Simple Vedea Example

VedeaMy colleague at Microsoft Research in Cambridge, 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.

img = LoadImage("world.png");
Scene.Add(new Vedea.Image(img, 0, 0));

for (i=0; i<len; i=i+1) {
  b = Noise(i*255);
  Stroke(20, 0, 0, b);

  x1 = csv.SourceLon[i];
  y1 = cvs.SourceLat[i];
  x2 = cvs.DestLon[i];
  y2 = csv.DestLat[i];
  c = new Vedea.Curve(x1-10, y1-b, x1, y1, x2, y2, x2, y2-b);
  Scene.Add(c);
}

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:

Stroke(255, 0, 0);
Scene.Add(new Vedea.Curve(5, 26, 5, 26, 73, 24, 73, 61));
Stroke(0, 0, 0);
Curve(5, 26, 73, 24, 73, 61, 15, 65);
Stroke(255, 0, 0);
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.

Introducing Microsoft Computational Science Studio

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.

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.