Wednesday, 2 December 2009

Code Contracts in .NET 4

Overview

One of the new features that’s included in .NET 4 is something called Code Contracts. (In fact Code Contracts are available already, but they're being made a standard part of the Framework in .NET 4.)

I'll say up front that I haven't really used Code Contracts yet, but I like the basic idea so thought it'd be worth writing down a quick summary of what they do.

Code contracts allow you to specify various conditions, or contracts, that must be met by your code and / or any code that calls it.  These contracts can be enforced with a combination of static (reported by the tools) and run time checking (reported by asserts or exceptions).

There are three types of contracts:

  • Preconditions – these specify conditions that function arguments must satisfy when a function is called.
  • Postconditions – these specify conditions about the return value, or the state of the object when a function returns.
  • Object Invariants – these specify conditions that the public state of the object always meets.

The main aim of Code Contracts is to formalise coding assumptions you make, and to help find and locate bugs in your code.  The Code Contracts are written in code so that they are human readable, and so that they can be analysed and enforced by the tool chain.

An Example

Examples always help, so here we go:

Preconditions:
// Calling this function with null, or with an object with TestValue less than zero 
// would fail the contract
public static void MyTestContractFunction(MyTestContractClass testItem)
{
  // Preconditions:
// Ensures testItem is null. 
// Throw NullReferenceException if not satisfied at run-time
Contract.Requires<NullReferenceException>(testItem != null); // Always compiled in
Contract.Requires(testItem.TestValue >= 0); // Compiled in depending on tool options

}
Or an alternative, more familiar way:
public static void MyTestContractFunction(MyTestContractClass testItem)
{
  // You can also write code contracts in the 'old-style' argnull exception way
  if ( testItem == null )
    throw new NullReferenceException("test item must not be null");

  // But you need to specify the end of the contracts
// i.e. if statements up to here classed as contracts
  Contract.EndContractBlock();

  // Do stuff...
}
Postconditions:
public static void MyOtherFunction(MyTestContractClass testItem)
{
  // Do stuff...

  // This line would cause the post-condition to fail
// (if it compiled- there appears to be a bug in the tools?!?)
  //testItem.TestValue = 0;

  // Postconditions:
  Contract.Ensures(testItem.TestValue >= 0); 
} 

Getting Started

To get started you need to download the tools as although the libraries are included in .NET 4, the tools aren’t.

The tool chain uses binary re-writing to enable runtime checking, as well as generating xml documentation to include contracts and performing static checking of code to catch potential violations at compile time (Visual Studio Team System version only).

Check out the following links to get more detail about Code Contracts and how they work:

CLR Inside Out: Code Contracts

Code Contracts FAQ

Getting Started With Code Contracts Video (VS2008)

Thursday, 29 October 2009

Google Maps Navigation

Well, it was bound to happen.  Google have released a new version of Google Maps that’s designed to provide in car navigation. 

Cunningly entitled Google Maps Navigation it basically does what you expect from in-car Sat Nav plus what you expect from Google Maps.  I imagine this is going to cause a dent in the sales of Tom Tom, Co-Pilot etc!

Currently it’s only available in the US on Android 2 handsets, but I’m sure it’ll be available elsewhere before long.  A more interesting question is whether Google will release it for Windows Mobile?  I’ve noticed that Google Sky Map only seems to be available for Android, so it looks like they might use all these applications to add value to the Android platform.  Not a bad strategy.  It means I probably won’t be able to get it for my Touch HD though.  :-(

Friday, 16 October 2009

Application Lifecycle Management Tools

Revision Control with Work Item Tracking

At the company I work for we’ve been thinking of moving revision control systems.  We currently use CVS and are looking at moving to subversion. 

Before we moved over I thought it would be a good time to have a quick look at team based Development / Application Lifecycle Management suites. 

The idea would be that the system would be designed for teams and combine some basic project management, requirements capture, task and bug tracking with revision control software, and a way of encouraging / enforcing certain development practices (e.g. Test Driven Development). 

Because we’re only a small team, it would have to be integrate well or at least be lightweight in terms of day to day use; ideally having a web interface and integrating in to both Eclipse and Visual Studio (the two IDEs we use).  It would also have to be (very) cheap! :-)

The Different Offerings

I started off my search with a bit of Google and Wikipedia.  Unsurprisingly, most of them are aimed at Enterprises rather than small teams like us.  This meant you had to either call for a price, or the price was just too high.

Code Beamer

Code Beamer looked like it would fit the bill.  They do a free version, but the licensing for it is a bit unclear.  In the end I decided as a commercial company doing proprietary software, we wouldn’t be able to use the free version.  You have to contact the sales team for pricing of the commercial version.

JavaForge runs on Code Beamer, which gives you an idea of how it looks and feels. Apparently there’s integration in to Eclipse, but unfortunately not in to Visual Studio.  Also the code analysis tools support Java and C/C++ but not C#, and it’s likely the C# apps that we’ll using any system with to start with.

I wasn’t blown away by JavaForge, not having any pricing details at all put me off somewhat (whatever it is, it’s probably too expensive for us!), and I finally gave in at the download page.  Perhaps worth another look later, but in this quick tour I didn’t have the enthusiasm.

Borland Star Team

The Star Team website didn’t particularly inspire me either.  Again, no hint of pricing so probably too expensive.  Not really any screenshots and stuff either.  But it does support Eclipse and Visual Studio.  You can download a trial, which might be worth a go at some point.

Rational Team Concert

The first one I actually wanted to try out was IBM’s Rational Team Concert.  Part of the Jazz software set.  Why?  Because it has a version that’s free for 10 users or less, has clients for both Eclipse and Visual Studio and had a decent website to back it up.

So I downloaded the Team Concert Express-C version.  The installation instructions looked a little convoluted, but actually it was really easy to set up and I was impressed at how easy it was to get something up and running on my desktop.

The feature set also looked to cover what we wanted, and after a brief play I decided to try and import an existing C# project in to it.  So I installed the Visual Studio client and started looking at the Revision Control it includes.  It took me a little while to work out how it worked, but I got the basic idea and liked the idea of workspace streams and change sets.  So I decided to import the Visual Studio Solution I was currently working on.

This particular solution had three projects in it.  The main project, a test project and a library project that it uses.  I obviously wanted to install the library project in a separate component within the revision control project, so that it could be shared in other projects when required.

This is where I started to bang my head against the metaphorical brick wall.  It appears that when using the Visual Studio client, you have to import a solution as a Revision Control Component and you can’t easily exclude any of the projects it contains.  So I imported the solution, and then looked at a way of splitting out the sub-folder containing the library in to a separate component.  But I couldn’t seem to do this (although the docs suggested you could).

After much frustration, and a few errors about updating, and even at one point accidentally removing all the code from the Revision Control Project I managed to get the separate components by importing separate Solutions.  I then tried to create another solution that contained the projects I wanted to work with, but then got a load more errors.

Given the struggle I had, the various errors and the fact I managed to do some stuff I couldn’t quite understand how I did, I eventually gave up.  What ever system we have, it has to be simple and easy- CVS has caused people here issues at times!

To be fair, I think some of the problem here maybe be the difference between the way the Visual Studio and Eclipse plug-ins work.  But I didn’t really want to have to download and install Eclipse for editing of C# projects.

Team Foundation Server

Team Foundation Server is Microsoft’s offering in this area, but unfortunately we don’t get it as part of the Microsoft Action Pack we subscribe to, and it’s too expensive and probably over the top for a small company like ours.  But after my struggle with Team Concert, I thought I’d download the demo Virtual Machine and give it a go out of interest.

As it was a Virtual Machine it was easy to get running (although they could really do with having a getting started tutorial linked from the desktop of the VM or something), and creating a new Project was easy.

Then to importing the project.  This was easy, I imported the projects and could say which bits went where.

Then on to trying out some of the Work Item tracking.  Again, all relatively easy from within the Visual Studio client, and does the kind of thing I was looking for.

The website end of TFS is basically a Sharepoint site, but doesn’t seem as comprehensive when it comes to the management of various parts as the Team Concert site.

So I liked the kind of thing TFS had to offer but well, it’s too expensive!  I was bemoaning the lack of a version that didn’t include an MSDN subscription that I didn’t want, and also wondering how much you were being charged for Sharepoint, which we already have.  Then the day after I’d finished playing I read that MS are releasing TFS Basic- a cut down version that doesn’t include Sharepoint, and presumably excludes MSDN as well. designed to replace Visual Source Safe and still provide the work item tracking functionality, so I’ll be interested to see that when it comes out.

In Conclusion

I didn’t spend much time looking in to all these solutions, and so probably haven’t done them justice. 

Rational Team Concert has potential, but it had a few too many niggles and I’m not sure that the Revision Control system is straight-forward and logical enough.

I’m interested to see what Team Foundation Server Basic is like (it’s going to be part of VS2010 Beta 2, which I’ll be trying), and ultimately how much it costs.

Finally, I think there might be an opening in the market for a simpler solution aimed at small businesses / teams.  Especially an Open Source one that bases itself on existing packages such as Subversion, Bugzilla etc (which incidentally, you can already do some linking between).  Eclipse are already doing some work in this area-  they’ve started a Framework designed to provide a standard way for different development packages to work with each other, but there still seems to be a lack of clearly defined product suites out there.

If anyone else has any recommendations, I’d be happy to check them out! :-)

Tuesday, 22 September 2009

Coding Dojo

Mark mentions on his blog that he attended a Coding Dojo the other day.  I won’t go in to details here as Mark covers it all in his post, but it’s an interesting idea.

It made me think, maybe we should do some exercises like this at work?

Monday, 7 September 2009

Windows 7 and .NET Framework 4 Beta 1

As mentioned in an earlier post, I recently upgraded from Vista to Windows 7.  Be warned, if like me, you have Visual Studio 2010 and the .NET Framework 4 Beta 1 installed the Windows 7 upgrade breaks .NET 4 quite drastically!  If only I’d seen Scott Hanselman's post first!

Luckily the following steps seemed to have done the job on my PC:

1. Uninstall VS2010 Beta

2. Uninstall .NET 4 by doing the following:

For x86 OS:
cmd /c "msiexec /x {19BD09BF-3BBD-3663-A5ED-50B6B2B07E42} /qb"
cmd /c "msiexec /x {1DF6A8F6-5048-323F-8758-DA533CE0F07E} /qb"
For amd64 OS:
cmd /c "msiexec /x {175D5555-EE49-3033-99AF-BC1E206223FD} /qb"
cmd /c "msiexec /x {13B27C82-19BA-3494-9420-F932B40673CA} /qb"

3. Reboot, just in case!

I found this in a forum post linked from Scott’s page.

Friday, 4 September 2009

Pinning a network folder to the start menu in Windows 7

In Vista, I had the root of one of the network drives I use pinned to the top of the start menu as a UNC shortcut (i.e. not a mapped drive).  I seem to remember getting this to work in Vista was non-obvious, but I got it there somehow. 

I recently upgraded to Windows 7, and one of the things that was missing was my network drive shortcut.  After some playing around I managed to get it back there by doing the following:

  • Create a shortcut to a random local folder, and place the shortcut somewhere you don’t mind keeping it.
  • Drag the shortcut to the start menu where it will give you the option to pin it to the start menu. (The option to pin it to the start menu isn’t present on the right-click menu without some registry hacking).
  • Right click on the shortcut, choose properties and change the name of the shortcut and the target location as desired.
  • Job Done!

Of course, this could be how I did it in Vista as well?!?

Friday, 31 July 2009

Sharepoint Designer and Workflows

As mentioned in my previous post, in order to get the Help Desk functionality we required I had to start creating some workflows.

To try to keep things simple and understand how Sharepoint and Workflows work at the top level I decided I didn't want to have to write any code. This means using Sharepoint Designer to design Workflows.

In case you don't know what a Sharepoint Workflow is, it's basically a step by step process that allows you to update Sharepoint lists, collect information from other users, send out notification emails and other things like that.

A workflow can be started when a list item is created or updated, and can also be started manually by a user. The problem I mentioned before, where I wanted to automatically set the Customer field of an item based on the person that reported the problem, would be an example of a workflow that runs whenever an item is created or updated. A user initiated workflow might be one that a user chooses when they want to close a call; a new task is created and assigned to the support manager asking them to review the content of the call and approve or reject the close request.

Sharepoint Designer provides a 'friendly' way of editing Sharepoint pages and creating simple, but relatively powerful, workflows. This used to be a paid for tool, but now it's a free download.

Microsoft Office Sharepoint Server Workflows are based on Windows Workflow Foundation. When you design a Workflow with Sharepoint Designer it generates the mark-up required to describe the Workflow and any user input forms needed to get data from a user. You design the Workflows by entering simple step by step instructions.

As an example, here's the logic of the Customer field update workflow.

  1. Get value of Customer field from the Contact's record referenced in the Reporter field of the current list item (the list item that has changed causing the workflow to run).
  2. If the value of the customer field of the current list item is not equal to the value above, then set the value.  (As the workflow is started whenever an item is changed, you should only change the value if necessary, otherwise the workflow will be started over and over again).

I found putting together a Workflow relatively simple.  Although the way you specify the data you want to lookup, and the relationship it has to the current record is a bit confusing until you understand how it fits together.

Wednesday, 8 July 2009

Sharepoint Help Desk Reporting

Reports Requirement

In order to move our Help Desk to Sharepoint, one of the requirements is the ability to run monthly reports for some customers. Currently these reports contain a list of all calls that have been opened, all that have been closed and all that are active within a month. The reports go out in PDF format.

SQL Reporting Services

I wondered if SQL Server Reporting Services could generate these reports for us, but after fiddling around I couldn't seem to get these to work properly. I read some articles about it, and it's possible (using the Sharepoint web services stuff) but it would probably have been a lot of hassle and a bit of a maintenance nightmare! It seems that SQL Server Reporting and Sharepoint integration is a relatively new piece of functionality, and it's something I reckon Microsoft needs to work on improving.

Access and Lookup Fields

After giving up on SQL Reporting I tried using Access to generate the reports, and this turned out to be pretty easy. One thing that I did need to do was create a new field for the Support Call list that contains the customer that owns that call. Originally, the list just had the reporter in and you could get the customer by following the link to the reporter's details (each reporter works for one of our customers). But in order to do customer based reports, adding the customer field in to the list was necessary.

I thought that automatically setting (or restricting) the content of one lookup field based on the content of another lookup field might be something that Sharepoint supported within a list definition. This isn't the case, and in the end I had to write a workflow that sets the customer field based on the content of the Reporter field.
This kind of one-removed relationship does seem to be a bit of weakness in Sharepoint. I've seen you can get 3rd party solutions that allow you to do this, but really I reckon this should be a standard feature in Sharepoint.

Anyway, workflows aside, the end result was a simple form that lets you define the month and the customer, click a button and the PDF is generated. This Access generated report looks better than our old one, and it was easy to add extra bits such as a simple pie chart showing the state of all the support calls active within the chosen month.

Tuesday, 7 July 2009

C# and the CLI gets Microsoft Community Promise

I’ve just read on Miguel de Icaza’s blog that both C# and the CLI are getting the Microsoft Community Promise patent licensing applied to them.  That basically means that MS promise not to sue anyone for implementing the specs, regardless of how they do it.  Quite timely given my recent post.

From the announcement:

It is important to note that, under the Community Promise, anyone can freely implement these specifications with their technology, code, and solutions.

You do not need to sign a license agreement, or otherwise communicate to Microsoft how you will implement the specifications.

The Promise applies to developers, distributors, and users of Covered Implementations without regard to the development model that created the implementations, the type of copyright licenses under which it is distributed, or the associated business model.

Under the Community Promise, Microsoft provides assurance that it will not assert its Necessary Claims against anyone who makes, uses, sells, offers for sale, imports, or distributes any Covered Implementation under any type of development or distribution model, including open-source licensing models such as the LGPL or GPL.

Good news for Mono.  Maybe some of the anti-Mono types will back off a bit now; although some how I doubt it.

Thursday, 25 June 2009

Mono and FLOSS Zealots

I was reading Is Linux Suffering From Mono? the other day. This is an issue that crops up now and again- is Mono a traitor to the Open Source community? Quite frankly I think the argument that Mono is somehow going to be downfall of Linux is a pile of s!*@t!

The anti-Mono arguments all seem to revolve around the fact that it’s based on Microsoft technology and so is evil. The arguments are all very negative, full of speculation and FUD. Here are some of the arguments as I see them:

Mono is based on proprietary technology

Mono is an implementation of the .NET Framework, a Microsoft technology, but C# and the CLI are both ISO and ECMA standards. I reckon MS set out with the idea of creating a cross platform framework to encourage adoption and help compete against Java etc, rather than use it as a some kind of patent Trojan Horse (see below).

From a MS perspective there’s nothing ‘official’ about the Mono implementation of the .NET framework, but they certainly don’t have anything against it. In fact MS did work with the Mono team to produce an official cross platform version of Silverlight. Again, I think MS needed to do this in order to compete effectively with Flash (and the AIR) who obviously have a massive head start.

Microsoft will try to enforce Patents

I just can’t see this happening. Trying to enforce a patent after you’ve released an Open Standard and encouraged other implementations has got to be pissing in the wind. I’m no expert, but I just can’t see how this would ever work. I can’t see how it would fly legally, it would be bad PR and would damage MS’ relations with developers. I suppose it’s possible they might try to enforce some patent to do with the implementation, but anything in this vein could easily be worked around. The Mono team are pretty careful about this kind of thing (i.e. no copying of MS code!).

FLOSS Zealots

I’ll try not to get in to a discussion about the merits of Open Source versus proprietary software, but I have to say the FLOSS (or FOSS) zealots do get me going! These are the issues I have with them:

  • Their arguments are generally negative. They’re all about criticism (MS, or Mono or whoever).
  • Their arguments are hypocritical. “I want everything Free and Open” as long as it’s done the way I want, and you don’t use any software I don’t like.
  • They complain about companies spreading FUD, and then spout more crap and FUD than anyone else.
  • They apply double standards. Anything from someone they don’t like has to be meet their standards to a much greater degree than someone they do like.
  • They’re basically Fan Boys (or their opposite).

My Take

I actually quite like MS software and the development support they give. I have Vista on my desktop, C# is a good language, Visual Studio is a good development tool, .NET is a decent framework.

Within the company I work for .NET and Mono are great for the following reasons:

  • C# is a strongly typed OO language that has decent performance and string handling. XML and other string based technologies aren’t handled particularly well in C / C++!
  • Makes resourcing easier. C# is relatively easy for people to pick up- teaching web programmers C / C++ is probably not the best way forward. You can write Web Services and embedded programs in C#. Once you have a few people that know C# it becomes a lot easier to resource projects.
  • Multiple languages, one framework. This means you only have one Framework to learn and you’re able to choose the language (or multiple languages) for the job. One of the projects we did was prototyped in Python, made to run in IronPython (pretty easy) and then gradually replaced module by module by C# code.
  • You can develop and test on Windows, and deploy on Linux (ok so you have to test on Linux as well). Which is a good thing given most of us have Windows on our desktop. Most of our Linux machines are command line only, so less trawling through text files, more stepping through code in the debugger! Yay!

Go Mono! That’s what I say! :-)

Thursday, 11 June 2009

Sharepoint

At the company I work for we’ve started using Sharepoint for some of our internal intranet stuff.  Sharepoint is billed as a platform that aids content management and business processes. 

As far as functionality goes it allows you to store documents in libraries, store information in what Sharepoint calls lists (they’re essentially just database tables), and create web pages by placing modules on a page template as you see fit.  These pages can can then be customised by the user.

Originally I was just playing with the technology, but after a while I started using it for To Do Lists, Support Rotas and the like.  Although we could write web pages to do this in house this ultimately takes away resources from stuff that makes us money.  Plus I was setting this up and my PHP experience is fairly limited, and I don’t really have a great desire to learn it! :-)

With things like the TODO lists, Sharepoint allows you to easily change the information that’s stored in the list and automatically provides forms to display and edit the data without having to write any code.  It also gives you a lot of functionality for free, for example- login management, email notifications, version control and site search etc.

So far the simple to do lists, rotas etc have all been fine, and as long as you don’t want to do anything fancy then the project tracking template can be useful as well.

One thing that’s been needing a bit of a revamp for a while is our Help Desk system (a set of pages written in house by a summer student).  We’re currently trying out moving it to Sharepoint which will be much more of a test of Sharepoint’s capabilities.  Hopefully I’ll be covering how we get on with this in future posts.

Thursday, 14 May 2009

Singleton Vs Static Class

In the office today the subject of whether to use a singleton or a static class to implement a global object came up.

Static Class
I’ve tended to use a static class for access to a set of related global functions or resources. Particularly those that are inherently global. A good example of this might be importing a set of ‘C’ library functions:

static class SafeNativeMethods
{
internal const int ERROR_SUCCESS = 0;

[DllImport("SomeDll")]
internal static extern int InitialiseLibrary();

[DllImport("SomeDll")]
internal static extern int TerminateLibrary();
}

Those imports are static by their very nature, and it makes sense to group related functions and constants etc in one class.

Singleton
I then use a singleton for something that feels more like a traditional class than just a grouping of global stuff. That is, something that represents an actual programming object, even if it’s global and there’s only one of them.

But as I hadn’t really had pause to consider the issue for a while, I decided to do some searching to see I could find some more pearls of wisdom on the relative advantages of each approach.

Pros and Cons of The Singleton
The singleton class has bigger overheads, is more complicated to implement (but not much!), and there are some multithreaded issues to consider.

On the other hand it provides normal class functionality and hence a lot more flexibility:


  • Derivation, polymorphism etc. (And so control over the actual object that’s created).
  • You can control how and when the object is created (and destroyed). E.g. Lazy instantiation
  • You can implement interfaces. (And implement a Dispose method for cleaning up resources)
  • You can pass your singleton as a parameter to a function, which you can’t do with a static class.


Of course, most of these are really drawbacks of the static class.

Summary
I don’t think there are any hard and fast rules, but static classes are useful for wrapping fixed global resources or for more simple solutions.

If it looks like you’re ever going to want to do anything a bit more complicated you’re probably better off with a Singleton. Or maybe a combination of the two…

Useful Links
Singleton Pattern Versus Static Class in C# (dotnetperls)
Singleton (MSDN)
Implementing Singleton in C# (MSDN)
Static Classes and Static Class Members (MSDN)

Thursday, 16 April 2009

Strange mod_mono behaviour with similar path names

We saw some very strange behaviour the other day when testing an ASP.NET Web Service under mod_mono and Apache.

The application we were testing stores some configuration information in a file that’s in the root application directory. As part of the testing we wanted to setup two instances of the application with different configurations, so we copied the contents of the directory from /srv/www/htdocs/ShoutAlarmService to /srv/www/htdocs/ShoutAlarmService2 but changed the contents of the configuration file in the copy. We’re using AutoHosting on the server so the application was automatically available at the appropriate URLs: http://localhost/ShoutAlarmService/Service1.asmx and http://localhost/ShoutAlarmService2/Service1.asmx.

The strange thing was that when we went to /ShoutAlarmService2/ it was actually using the ShoutAlarmService configuration file. Further investigation seemed to show that mono was actually serving the files in the ShoutAlarmService directory rather than the copy- we renamed one of the files in the copy, but it was still found ok! We also created an HTMLPage1.aspx file in each directory, but had them printing out different messages. Regardless of the URL you went to you got the same result. However, if you did the same thing with a .htm file then you got the different files. This suggested something wrong with Mono rather than some strange Apache configuration. In the end to get it working we just renamed the copy to BlahAlarmService.

I wanted a bit of a better explanation though, so today I did some more experimentation and found that if you just copy the directories as described above you get the problem. However, if you copy the directory and then restart apache a couple of times it all works correctly. Copying to a directory called BlahAlarmService seems to work without any issues.

My guess is that there’s a funny in the AutoHosting implementation and the way it maps virtual and physical application directories. But working out the exact problem isn’t my top priority at the moment!

Wednesday, 15 April 2009

ASP.NET Web Site Paths

Finding out your web application’s path seems to cause a little confusion.

A good place to start is this MSDN article. The HttpRequest object that contains all these paths is available via the HttpApplication, HttpContext, Page, and UserControl classes.

For example, to get the physical location of the Web Application you could do the following:

HttpRequest request = HttpContext.Current.Request;
string applicationRoot = request.PhysicalApplicationPath;

If you need to extract a particular part of a path, then you probably want to use the System.IO.Path member functions.

Monday, 6 April 2009

GPS and HTC Touch HD

I've got an HTC Touch HD and use it to listen to music while running (good phone by the way). I thought it would be good to use the built-in GPS to log my route and load the results up to MapMyRun or Google Maps, so I went on the hunt for some free software that I could try.

A little searching later and I found WMMiniGPS. It logs your position at a configurable time interval and allows you to export it to KML or GPX format. Google Maps accepts KML and MapMyRun takes GPX so it seems to fit the bill!

I gave it a try this weekend and it did the job fine. The only issue I had was leaving it running in the background seemed to cause Windows Media Player to stutter a little sometimes.

Once I'd uploaded the results, both MapMyRun and Google Maps showed the route and distance travelled. I was hoping that MapMyRun could use the plotted points to work out my speed over various sections, and record my total time. But apparently it doesn't have that functionality.

Thursday, 12 March 2009

Enhance Vista Start Menu Search

Start++ is a little utility for Vista that allows you to setup search shortcuts that run configurable commands. For example you could setup a shortcut 'n filename' that opens the specified file in notepad.

I'm not sure how useful, or otherwise, this will be yet. But it sounds like it's worth a bit of a play.


Note: One of the examples the application gives is 'sudo ' which runs the command with elevated privileges, however you can actually do this by hitting 'ctrl + shift + enter' once you've typed your command in the search box, so it's a bit redundant really.

Wednesday, 18 February 2009

Mono Web Service Test Forms Broken

In case it saves anyone else some time and effort, the auto-generated Mono web service test forms don't work with methods that contain an 'out' parameter. You get the following error back:

500 - Internal Server Error
Method MyMethod not defined in service MyService

The problem is with the test form, not the web service.

Friday, 23 January 2009

ASP.NET with Apache and Mono

Getting "Type MyType not found" exception or "An element with the same key already exists in the dictionary" exception from System.Web.Compilation.BuildManager.AddToCache in mono after deploying an ASP.NET page on Linux?

Check that you have the option:

MonoSetEnv MONO_IOMAP=all

In your Apache config file. It maps windows file names and paths to Linux ones.

You can find more details at http://www.mono-project.com/IOMap and http://www.mono-project.com/Guide:_Porting_ASP.NET_Applications