Courier, Microsoft's answer to the Apple Tablet?  

Wednesday, September 23 2009

Microsoft Courier

I came across a concept video of Microsoft Courier today and I was blown away. I have wanted a device like this for as long as I can remember; it is basically the same form factor as Penny’s computer “book” from Inspector Gadget. It was a folding computer book that had two separate touch screens.

There seems to have been some research done by Microsoft on the concept for several years. I came across this research paper on Courier that describes it as a “Collaborative Phone-Based File Exchange System.” There is more information about the MSR Courier Group here. A lot of the interactions in the demo video remind me of some ubiquitous computing paradigms; the hand writing of the URL into the web browser in particular.


  • Posted by Charlie Robbins

Useful Tools for .NET Development  

Thursday, September 17 2009

Over the last several months there have been a number of tools, snippets, macros, and templates that I’ve used at Lab49 to streamline my .NET development and make things move more quickly. Many of these resources were created by my colleague Dan Simon. Here’s the list:

Tools

Visual Studio Team System (a version of Visual Studio that includes set of tools on top of the standard VS2008): http://msdn.microsoft.com/en-us/teamsystem/default.aspx

StyleCop (Code Style Analysis): http://code.msdn.microsoft.com/sourceanalysis

FxCop (Static Code Analysis, we actually use the “Static Analysis” tool in VS Team System, which uses FxCop under the covers): http://msdn.microsoft.com/en-us/library/bb429476%28VS.80%29.aspx

GhostDoc (Generate XML Comments automatically with some nice features): http://submain.com/products/ghostdoc.aspx

Regionerate (Automatically organize your code with regions): http://www.rauchy.net/regionerate/

Code Snippets and Templates

StyleCopClass.zip: A Visual Studio template for creating StyleCop compliant classes by default. To install copy to C:\Documents And Settings[Your User]\Visual Studio 2008\Templates\Item Tempaltes

Regionerate StyleCop Rules.xml: A set of rules for Regionerate that organizes code according to StyleCop guidelines. To install copy to C:\Program Files\Regionerate\My Code Layouts

StyleCopMacros.vb: A Visual Studio macro that executes a number of useful tools together for making code more StyleCop compliant.

cmdprop.snippet: A snippet for a command property in a ViewModel. To install copy to C:\Documents and Settings[Your User]\Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets

filehead.snippet: A snippet for an XML file header including relevant information. To install copy to C:\Documents and Settings[Your User]\Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets

notifyprop.snippet: A snippet for a property in a class that implements INotifyPropertyChanged. To install copy to C:\Documents and Settings[Your User]\Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets

It’s important to note that some of these snippets and templates require a little editing for each project they are used on. The filehead.snippet and StyleCopClass.zip files have the name “MyCompany Inc.” in them. To change it just simply open the files in Notepad (or other text editor), and save the files in the appropriate directory outlined above. All of the resources are available on GitHub. Enjoy!


Read More...
  • Posted by Charlie Robbins

Getting around Covariance ... sometimes: Dynamic Dispatcher with C# 3.5  

Tuesday, September 15 2009

One language feature that I'm looking forward to in C# 4.0 is support for covariance and contravariance of generics types. The definitive series of posts on these language features for C# can be found on Eric Lippert's blog and I would invite you to go read there first before if you haven't got the slightest clue what I'm talking about. My outlook on these features wasn't always so sunny though; it was only recently that I ran into a situation where I really wish that I had them. Luckily, I was able to find a small nuance that allowed me to work around covariance limitations in a small subset of problems: covariance of parameters to delegate types.

The particular problem that I was mucking around with had to do with dynamic dispatch. This simply involves registering a key to type generic callback function (Func) in a Dictionary for later use. The important nuance here is that in each place that I register, I want the type that is passed into the callback to be strongly typed (i.e. I don't want to have to downcast in the function I pass as a parameter). So in this kind of Dictionary:


/// <summary>
/// The lookup registry for dispatching operations by name and type
/// </summary>
private Dictionary<Type, Dictionary<string, DispatchRegistration<object>>> dispatchRegistry = new Dictionary<Type, Dictionary<string, DispatchRegistration<object>>>();

As always, all of this code is available under the MIT license on GitHub.

Read More...
  • Posted by Charlie Robbins