Version 1.0.0.2 can be found here. This update adds the ability to change the font - including the font name, size, style, and weight.
Saturday, February 03, 2007
Thursday, January 18, 2007
Wednesday, January 17, 2007
FluentInterface
I've posted before about the StringBuilder tip in .NET.
Martin Fowler describes this as an ExpressionBuilder pattern.
More formal terms are described in his post, for instance, a FluentInterface which allows code like this:
customer.newOrder() .with(6, "TAL") .with(5, "HPK").skippable() .with(3, "LGV").priorityRush();
I personally like this style but agree that if every object had these strange looking methods it would certainly pollute an API.
Another formal term describing how not to pollute an API is CommandQuerySeparation. Basically, this means that a method that changes the observable state of an object shouldn't have a return value.
The ExpressionBuilder pattern is the solution to this: it is a seperate object that defines the FluentInterface and yet doesn't pollute the API.
I'm glad that I now know more than 3 patterns, the Factory pattern, the Visitor pattern, and the Submarine pattern.
Friday, December 22, 2006
Settling into my XNA Development Environment
Microsoft recently released the XNA toolkit for XBox 360 and PC games development. The supported IDE for this is Visual C# Express.
I am quite picky about my development environment, for instance: I like the Consolas 12pt font; I like 2 tab spaces instead of 4; I like virtual space in the editor; etc. etc.
Visual Studio Express does not give the option to change tab size and virtual space settings so I immediately jumped into regedit and edited the values. Then I thought that maybe I could export my settings from Visual Studio 2005 Professional and import them into Express.
This worked, with the exception of some command bar stuff that isn't supported in Express. The added bonus was that the Options screen now displays more settings that before:
Options screen before import:
Options screen after import:
Very nice. It's just a shame that Express doesn't support plug-ins as I really miss ReSharper.
Tuesday, December 12, 2006
ReSharper 2.5 Released
The download links don't seem to work at the moment (they're still pointing to version 2.0.2). The link to the direct download is http://download.jetbrains.com/resharper/ReSharper-2.5-setup.exe (which I rather cleverly deduced from the existing broken link of http://download.jetbrains.com/resharper/ReSharper-2.0.2-setup.exe)
Remember though, this is Visual Studio 2005 only.
Thursday, November 30, 2006
In the name of science
What is the speed of meme? People write in general (typically truimphant) terms about how swiftly a single voice can travel from one side of the internet to the other and back again, but how often does that actually happen?
If you have a blog, please read this and follow the instructions. I'm supposed to beg you to do this, but the title of this post is "In the name of science" and not "In the name of science and commision" !
FAJAX - Fake AJAX!
AJAX is great for reducing page flicker when posting back to the same page (for instance, updating a listbox or a textbox), but a lot of a web-site navigation involves clicking around to different pages.
DHTML behaviour has been around a good few years allowing page developers to have page transitions (such as wipe, chequerboard etc.) when the page loads and unloads. None of these transitions were that great and a certain amount of flicker was still present.
I’ve seen a few sites recently that have a nice fade transition that is much smoother than DHTML behaviours. I’ve just discovered from this blog, how it’s done.
Tuesday, November 21, 2006
I Hate ClearCase Part II - When a text file isn't a text file!
Here's a question: If you have a text file that contains a very long line of text (>8000 characters), is it still a text file?
I'd say Yes. But ComputerClearCase says No. Or at least hinted it meant No via several obscure error messages.
The file in question is a whole bunch of JavaScript code (part of the Microsoft AJAX release) that is not intended to be read by anyone viewing a web page, and hence is sensibly put on one line (albeit 69168 bytes in length).
Firstly, I was getting a strange error when adding them to ClearCase. Apparently, despite of the error, they were being added – I found them in a checked-out state. Upon trying to check them in, I got:
Error checking in '...MicrosoftAjax.js'. Type manager "text_file_delta" failed create_version operation.
Unable to check in '...MicrosoftAjax.js'
...followed by OK and Cancel buttons (quite how one can Cancel an operation that can't be done anyway is beyond me!)
I then thought I’d take a look at the file and did a ‘diff’ with the previous version. I got this:
Error encountered doing compare operation.
"c:\temp\ccdm02327" is not a 'text file': it contains a line exceeding 8000 bytes.
Use a different type manager (such as a compressed file).
So, according to ClearCase, a text file is not a text file if it has lines of over 8000 characters!
Anyway, the solution was to use the cleartool command line tool to add the file using a different 'type' - a compressed text file type. Note that this doesn't actually change the contents of the file, nor the way it's handled (thankfully!). Of course, once the solution was presented to me...
C:\folder\ScriptLibrary\Release>cleartool mkelem -nc -eltype compressed_text_file MicrosoftAjax.js
...everything became perfectly clear!
Monday, October 30, 2006
I Hate ClearCase - Part I
ClearCase isn't my favourite source control system. I find the UI clunky and for the most part, it's way over engineered.
I've just tried deleting a file and I'm getting an error message that says:
Trigger "NO_RMNAME" has refused to let rmname proceed.
Unable to remove "[file]".
WHAT DOES THIS MEAN AND HOW DO I DELETE A FILE?!
My 20+ years of working with software - coupled with my powers of deduction, have led me to "guess" that this means I don't have the permission to delete a file! (I could be wrong; I'm waiting for the in-house ClearCase administrator to advise!)
I'm going to stop using the advanced features of this software and continue with the basics...
Tuesday, October 24, 2006
Cassini and assembly loading problems
Cassini is the Visual Studio development web server. Generally, Cassini is great; you give it a port number and a path and off it goes - hosting ASP.NET pages in a similar fashion to ISS but much quicker. Plus, it's unloaded when you stop debugging.
One issue I came across today was with Cassini and the loading of assemblies. During development of .NET applications, I like to use project references rather than binary references (whether those references are in our out of the GAC).
The problem lies with the fact that Cassini occasinally switches app domains, forcing objects to be serialised across. This serialisation was failing as one of our serialisable objects were in an assembly that wasn't in the GAC and wasn't available anywhere for the Cassini process to load. The exact error was:
Type is not resolved for member 'Company.Product.Type,Company.Product.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=blah'
Investigation led to the suggestion to use DEVPATH. Basically, this means adding the following entry to the ‘runtime’ section of the machine.config file:
<developmentMode developerInstallation="true"/>
… and setting the DEVPATH environment variable to the directory where your private copies of assemblies are located. This is supposed to load a matching assembly regardless of version. Unfortunately, this didn’t work and for whatever reason, a ComException was being thrown very early on when Cassini started.
Although this didn't work, there was a link in the page to another MSDN article describing a way to redirect assembly loading. This again used the runtime section of the machine.config file, but this time using:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Company.Product" publicKeyToken="blah" culture="neutral" /> <codeBase version="1.0.0.0" href="file://C:/Blah/Company.Product.dll"/> </dependentAssembly> </assemblyBinding>
This worked great and saved me having to use IIS or copying my assemblies all over the place so Cassini can load them.
I hope this post proves useful to anyone having a similar problem. It will probably prove useful to me when I come across the problem again in the far future having forgotten how I got around it the first time!