iPhone now blogs
So finally the application I’ve been missing has turned up on the Application Store. Wordpress from those lovely people at Automattic has provided a free app to blog direct to my self-hosted blogs. It’s a great first step and works really well.
I hope a future version will include an admin interface as well. So hello from Esendex Towers and me blogging from my iPhone!
Good morning and welcome from Clumber Street in Nottingham outside the O2 store. It’s nearly time and we’re quietly confident here at the front of the queue. I’m in 9th place so fingers crossed!
Mobile post from the Esendex BlogIt service
The Night before iPhone
Twas the night before Friday, when all through the house, the PC was crashing, couldn’t talk to its mouse.
The taxi was booked for 5:20 with care, with hopes that a 16Gb iPhone soon would be there.
His fiancee was nestled all snug in the bed, while visions of multitouch danced in his head.
And to ensure that the world would hear news bit by bit, he’s set up and using Esendex’s BlogIt!
Mobile post from the Esendex BlogIt service
ODear, no iPhone
It took me a while to spot my email from O2 this morning admittedly. The chance to pre-order a 3G iPhone for delivery on launch day on Friday. A perfect opportunity to avoid queuing for nothing before work. I was all excited and started to fill out the forms convinced that as I’d added a 16Gb iPhone to my shopping cart that I’d managed to secure one.
So as I was filling out my address details as a new customer I clicked next to find myself back on the online shop home page. Aaaaaargh! Not now, I thought. Further attempts brought up the maintenance page. So close yet so far. The shutter had com down too late and I waited for the site to come back up to be greated with the news that the 16Gb had sold out. What an utter shambles it was. This wasn’t a denial of service attack. This was a set of real or existing customers whose load they should have tested and predicted!
So now I have to take my chances on Friday to get one. Bad day O2, your website failed a prospective customer.
NMock Out Parameters
I’ve often thought that NMock is under-documented. The way I’ve started to learn how to use this extremely useful library is through the well-formatted examples that Ian has left around. Practical examples often show you far more than a glossary of terms or a list of available methods.
This week Andy and Drew were wanting to test a method which had both a return value and an out parameter. A quick look through the NMock Quickstart, Tutorial, Advanced or Cheat Sheet pages didn’t show any way of achieving this. Thankfully the Blogosphere came through once again to prove that you can do this with NMock.
Say you have a method in your mockable class called:
public string AddGreeting(string userName)
you could expect to write a Stub declaration such as
Stub.On(mockObject)
.Method(AddGreeting)
.With("World")
.Will(Return.Value("Hello World"));
If your method has an out parameter as well, such as:
public string AddGreeting(string userName, out int characterCount)
then your Stub declaration will need to look like this:
Stub.On(mockObject)
.Method(AddGreeting)
.With("World", Is.Out)
.Will(new SetNamedParameterAction(["characterCount", 11), Return.Value("Hello World"));
The Is.Out is setting the expectation that one of the parameters you’re specifying is an Out parameter. The SetNamedParameterAction object is undocumented and has been found using reflection. This is a useful feature which hasn’t been documented. The NMock project appears to being built using continuous integration these days but that obviously doesn’t happen with the project documentation.
NaNT .build file Intellisense
If you want to get some limited Intellisense when you’re editing or creating NaNT .build files then you can try the following:
- Copy the nant.xsd file from inside your NaNt schema directory.
- Paste it into your Visual Studio XML Schemas directory (e.g. C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas\
- Restart Visual Studio
When you next load up an existing .build file, Visual Studio should detect it correctly as an XML document. To get the Intellisense to work, you will need to add the XML Namespace to the <project> tag. Start typing the additional attribute ‘xmlns=’ within the opening <project> tag and Visual Studio should offer you the following auto-complete option:
xmlns=http://nant.sf.net/release/0.85/nant.xsd
So your full project tag should look something like :
<project xmlns="http://nant.sf.net/release/0.85/nant.xsd" name="Your Build Name" default="all" basedir=".">
For new .build files, you can select the Schema you want to base your new XML document on by browsing in the Schemas box in the Properties window. You should find xml\Schemas expanded and the nant.xsd entry able to be selected. Tick the nant.xsd box.
The Next Release
Now that the development team at Esendex Towers is growing, so is the pace. Nicholas has just posted the next set of tasks on the board for our next release in a few weeks.
As you can probably see, there’s not much cork left in view! Saying that, I’ve just seen the inch-thick pile of cards that Nicholas has just removed from the current release. Whilst electronic methods of project tracking might offer lots of improvements, there’s something satisfying about hearing the riffle of all our hard work!
TryParseExact and UTC DateTime
I’m in the midst of SIP-land at the moment and looking at the expiry time of requests. After discovering a subtle difference in the parsing of DateTime strings between my development machine and the production servers, we’re now using the DateTime.TryParseExact() method to specify exactly what the service should expect to see.
One of the parameters allows you to specify a DateTimeStyle and as I knew the time was going to be in UTC time I chose the AssumeUniversal DateTimeStyle. The MSDN information for DateTimeStyle defines AssumeUniversal indicating
“that if no time zone is specified in the parsed string, the string is assumed to denote a Coordinated Universal Time (UTC). Cannot be used with AssumeLocal or RoundtripKind.”
It seemed to be exactly what I wanted until I started testing it. The time I was getting back was an hour ahead so it was being converted to local time as we’re currently in British Summer Time (GMT+1) here.
The solution was to use the AdjustToUniversal DateTimeStyle instead. I’ve tested this with my system time in British Summer Time and without the local adjustment and it works fine for both.
Here’s the small console application I wrote to test the TryParseExact() method. Try it with AssumeUniversal instead of AdjustToUniversal if you want to see the difference for yourself.
class Program
{
static void Main(string[] args)
{
DateTime requestExpires;
DateTime.TryParseExact(”23/05/2008 08:30:49″, “dd/MM/yyyy HH:mm:ss”, null, DateTimeStyles.AdjustToUniversal, out requestExpires);
Console.WriteLine(requestExpires);
Console.ReadLine();
}
}
New iPhones ahoy?
The recent news that the 8Gb version of the iPhone was discounted wasn’t a huge shock with rumours of a pending 3G / Business flavoured iPhone in the distance. However, today sees MacRumours reporting that O2 have stopped selling ANY iPhones, 8Gb or 16Gb.
Sales might have been lighter than they anticipated, due to the lack of 3G maybe, but to stop selling it altogether? Surely this points at the suspected release date for the updated iPhone of June being brought forward a lot sooner?
I know personally that I’ve been waiting for this refresh, partially fuelled by the development work I’ve been doing on the iPhone SDK which will allow applications to be deployed on this version of the firmware, and the improved feature set including 3G.
I hope they’ll also keep the prices keen if they’re wanting businesses to take them up as serious alternatives to RIM. After having used a Blackberry for my on-call support duties, I know I’d much rather interact with an iPhone any day.
So, keep your ears to the ground and hopefully we’ll see a brand new iPhone very very shortly.
SourceSafe: “Only one database connection at a time is supported.”
I’ve been having intermittent problems with Visual Studio 2005 and SourceSafe 2005 occasionally complaining that “Only one database connection at a time is supported” when I load up solutions with multiple projects in them.
A Microsoft Knowledge-base article pointed me to the potential problem. Looking in the mssccprj.scc files for both .csproj files loaded in the solution, I spotted one of them had an extra entry for a .sln file as well as the .csproj file. Both of the SCC_Aux_Path variables for the .csproj definitions were the same so the knowledge-base fix wasn’t quite correct.
Removing the definition for the .sln file from the mssccprj.scc file has helped remove this problem. Saves doing the usual suggestion of ‘SourceSafe is screwed on your machine, you should get it reinstalled’.


