BM-Bloggers

The blogs of Black Marble staff

Dell Mini 9: A Day In The Life

Colour me impressed. I managed well over four hours’ battery life today and found the Mini 9 a joy to use. I have encountered a snag, however, and it wasn’t one that I expected.

You see, I’m now sitting on the 21:30 train from London Kings Cross to Wakefield after having been in the big smoke for a day of meetings. I got onto an empty train and picked a seat with a table – I want to get some work done on the documents required after my meeting and I thought the space would be nice.

Great, except I’m on 17% battery charge as I wait for departure, and I can’t use the plug in the wall. As a result, I* have switched seats to a cramped airline seat, also next to a plug.

The problem is, the charger I so complimented in my previous post is too deep to plug into the socket by the table. The power cable won’t bend and there’s only about an inch between the socket and the table. Not enough to use the Dell charger.

So I now sit with the Mini 9 on a fold-down tray, and it fits quite well, I must say. One could even say it was made for it.

Anyway, the Mini performed like a champ. It was small enough not to get in the way during the meetings I had today, made no distracting noises as my other laptop is prone to do as it’s fans spin their merry dance, and just.. kept… working. Exactly what I asked it do do with no problems at all.

I wonder if Richard will notice if I don’t give him it back…?

Further thoughts on mocking out a SMTP Server

I posted on the problems I had had mocking out an SMTP server, well I have moved on a bit. As I said in the update note in the last post, I had given up on nDumbster and moved over to LumiSoft's freeware mail server.

The Lumisoft server is a far better starting point as it is a 'real' server that supports all the major mail protocols. As all the source (and binaries if you can't be bothered to build it yourself) are shipped it is easy to create a wrapper class for unit testing purposes that can do whatever you need.

However even with this much improved server I still had a problem with System.Net.Mail calls. I had four tests

  • Send a single email with System.Web.Mail
  • Send a single email with System.Net.Mail
  • Send a batch of three emails with System.Web.Mail
  • Send a batch of three emails with System.Net.Mail

Before each test a new SMTP server was created, and when the test completed it was disposed of. Each test worked if run by itself.

The problem was that if the tests were run as a batch the final test failed. When the SMTP server was checked it was found to have no messages recorded, not the expected three. However, the logging said three messages had been sent OK. Swapping the order if the tests did not effect the basic issue that the second System.Net.Mail test reported no emails received, whilst the System.Web.Mail tests were fine.

By adding a unique identifier to each created SMTP server it could be seen that the fourth test was sending its mail to the second SMTP server (which should have been disposed of well before the fourth test was started) hence the final test failing.

The problem appears to be that the threading model inside System.Net.Mail holds the TcpClient object in memory for longer than you would expect, so somehow allows the fourth test to reuse the connection (and server) from the second test. Though it is unclear how you are able to have two servers both on port 25 at the same time. I guess this theory could also go some way to explaining the issues I had with the nDumbster implementation.

Though not perfect, the solution I used was to make the Smtp Server instance static for the test class so for all the tests I created just one instance of the server. Before each test I cleared down the received messages store. Thus far this is working reliably for both single tests and batches of tests.

Update 6 Oct 2008 - The use of a static Smtp server per class is not a full solution, but just moves the problem on i.e. you get the same problem is you have two classe in the batch each with their own server. I need to find a better way to rip the Smtp server of memory - Maybe an AppDomain?

Update 10 Oct 2008 - Well AppDomains don't help. The best solution I have found is to not use a static Smtp server but to instaniate a non static member one and then start it in the test systems TestInit method. In the test systems TestCleardown I stop the server and dispose of it. However this does not fix the problem. I therefore then send an email to the server I have just disposed using System.Net,Mail. This obviously fails but does cleardown the internal cached items inside the System.Net.Mail structure. I just catch the expected exception and carry on. I know it is not elegent but it works both within a test class and an assembly containing many classes 

'Datadude' merged with Team Developer

It was announced overnight by Microsoft that the Database Professional SKU for Visual Studio will be made available to all people who have a licensed copy of Team Developer.

This is great news as it addresses the problem of where to put the expensive copy of DataDude (which I think has been a barrier to it's uptake), in most companies there is not the clear distinction between code and DB devs.

So as of tomorrow you can get DataDude via MSDN. You can read more about the recent announcements here: http://msdn.microsoft.com/en-us/vstudio/products/cc948977.aspx

First thoughts on the Dell Mini 9

I’m down in London tomorrow, and rather than lug my laptop on the train I’ve borrowed Richard’s shiny new Mini 9.

Overall, I’m quite impressed with it. I’m still not sure about the keyboard, even after a couple of hours typing away – the keys are small and some of them are smaller still, which makes typing an interesting experience. However, I’m sure I would get used to it with time. The thing is, a netbook is not aimed at being your everyday machine, so does a quirky keyboard become a barrier to use if that use is intermittent?

My wife saw it and immediately liked it for it’s size and weight. For a small, very capable device to use, for example, when down at the library researching our family tree the Mini 9 is a good fit. Long battery life (I’ve not charged it yet and I’ve racked up at least a couple of hours on about 50% charge) and robust design with no moving parts makes a good fit in a large handbag where you don’t want the charger.

The screen is nice and bright. I’ve not tried to use it outdoors yet, where I suspect the high gloss screen may be a disadvantage, but inside where I would use it most there is no issue with legibility. Resolution is tight at 1024x600, but you have to compromise somewhere. It will happily drive a second screen at higher resolution, however, so it may well find a place in my heart for roaming presentations at events. it’s also a perfect companion for conferences, at least for myself – not a dev needing the grunt of more power for Visual Studio work.

I have successfully coupled my Touch Diamond with the Dell and can use my 3G data connection when there is no available WiFi and I think that works well. I’ve not tried using bluetooth, cool though it may be, as I see no point in crippling the battery life of both devices. How hard was the pairing? Easy – installed ActiveSync 4.5 and start the Internet Connection app on my phone. Less than five minutes to get going, including the ActiveSync download!

My one annoyance is not really Dell’s fault. XP Home is most definitely not a good fit for corporate use, and the spec isn’t good enough for Vista. As an IT admin, I want to enable domain membership and disk encryption and group policies. Being a Gold Partner means I could install XP Pro, but not everybody has that option. Microsoft have really got themselves in a hole over this one – on the one hand they can’t extend the life of XP Pro any longer, but Vista isn’t lean enough for this sector and they don’t want to forfeit the market to Linux. In the olden days, the OS would have been Windows CE, but the market has already learned that for mass market appeal users need to run their existing applications, and in that regard CE just doesn’t cut the mustard.

I’ve not played much with the Acer Aspire one. I had a fiddle with one at the weekend (in Tescos, of all places) and I think being honest, the Acer has the edge for keyboard. However, the charger for the Dell is a bit like a phone charger on steroids, whereas the Acer has a traditional laptop-style cloverleaf cable and charger which is much bulkier and heavier to carry. Add to that the fact that to get XP you need to order the model with the standard hard drive and the lower battery life and I would probably choose the Dell over the Acer.

Could I use the Mini 9 as my only computer whilst travelling? The answer to that is a qualified yes. Ask me again after I’ve tried it on the train to London and I’ll give you a definitive answer.

So, pros and cons, before I go away and order one for myself!

Pro

  • Small and lightweight
  • No moving parts so less risk when travelling
  • Performance is great (after we decompressed the hard disk!)
  • Screen is excellent

Con

  • Keyboard is tricky. There are no separate function keys and even with the FN-key combination there’s no F11 or F12.
  • Upgradeable, but… Getting hold of PCIe SSD disks isn’t that easy, and Dell have left out the antenna and other bits for the WWAN.
  • Shiny case is sexy and impresses from a distance, but is a magnet for fingerprints.
  • XP Home. Need I say more.

Mocking out an email server

I am currently looking at automation of acceptance testing for workflows and a common task is to make sure an email has been sent. To do this in a TDD style I have been using the mock SMTP server nDumbster.

Now this was a port from Java in the the days of .NET 1.1 and does not seem to have had any development since. This can be seen because the following test using the .Net 1.1 System.Web.Mail call works beautifully, returning in a second or so

[TestMethod]
public void CanRecieveSingleWebMail()
{
System.Web.Mail.SmtpMail.SmtpServer = "localhost";
System.Web.Mail.SmtpMail.Send("somebody@foo.com", "everybody@bar.com", "This is the subject", "This is the body.");
Assert.AreEqual(1, smtpServer.ReceivedEmail.Length);
}

However the test using the .Net 2.0 System.Net.Mail is not so good

[TestMethod]
public void CanRecieveSingleNetMail()
{
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("localhost");
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage("somebody@foo.com", "everybody@bar.com", "This is the subject", "This is the body.");
client.Send(msg);
Assert.AreEqual(1, smtpServer.ReceivedEmail.Length);
}

It does work but takes 100 seconds to return, a bit of a pain for TDD!

After a bit of debugging I found the problem was the final input.ReadLine(); in HandleSmtpTranslation which we expect to get a null at the end of a message, for Systsem.Web.Mail this returns instantly, but for System.Net.Mail this takes 100 second, but then is fine.

As a work round I have put in the logic

string line = null;
if (smtpState != SmtpState.QUIT)
{
    line = input.ReadLine();
}
if (line == null)
{
    break;
}

This works fine for single mail messages, using both the old and new API.

There is still a problem, with the System.Web.Mail API you can send multiple emails in a test, but this still fails for System.Net.Mail – the first goes OK, but the second fails saying the server is not present.

By the way I have ruled anti virus and anything specific to port 25 causing the problem. I suspect a threading issue as I believe System.Web.Mail was single threaded wrapper for COM and System.Net.Mail is multi threaded pure .Net logic.

If I get a better solution I will post about it, but I have enough functionality for me at present.

Update 28th Sep – Got an email today via the SourceForge forum that pointed me at the freeware LumiSoft mail server. On a first look this certainly appears to do the job. You just need to wire it into your tests in a wrapper class of your own.

First thoughts on the Dell Mini 9

After Alt.net I had thought getting an ultra light notebook was a good idea. At most conference I need to browser, blog and read email; I don’t need to carry around a full development desktop replacement laptop.

Whilst at ReMix I had enough of the old battery in my Acer laptop, so just before it ran out of juice again I ordered a Dell Mini 9, which was actually cheaper than my HTC phone! Today it arrived, a lot sooner than I was expecting, Dell has said it would be next month.

Inspiron Mini 9

My first thoughts? Well the keyboard is small, typing is an interesting experience as I type this post. Also I would like a disk activity light; during the XP setup there a good period when I was not sure what was going on, a flickering led is always reassuring.

Other than these minor gripes it seem very good, it is light, the battery life seem as advertised and it is fast enough for Office 2007 (so I can use it for presentations) and messing around development (I popped on C#  Express but there is disk space left for VS2008 if I needed it).

I will report further when I have lived with it a while.

Post ReMix thoughts

So how was ReMix? well a bit like last year not earth shattering, but what can you expect. We have PDC in a month so there is going to be no major announcements, also this is a rerun event from the US MIX conference, again reducing the chances of anything new.

So if you are a developer and been to TechEd or just to local community events (and as Andy Westgarth said we are very lucky at the quality and number of community events and speakers in the UK) you will have heard nothing new about Silverlight etal. Though it is far to say that this may not be true for designers, and I felt the development track was pitched at this level.

It is with design where I think ReMix was different this year; there were noticeably more designers present and I thought the design track a lot stronger. As I had seen most of the developer track elsewhere I spent a good while in designer sessions, and as usual when going beyond your normal bounds it makes you think.

What has been bubbling in my mind is how does the design process fit into agile processes? Bill Buxton in his sessions (and new book) spoke about how it was important for the designer to provide a variety of concepts for the client/project and not invest all their effort in a single design, thus removing choice form the 'client' . It got me think should the same apply to the developers/architect? Is this even possible? At the grossest sense it would mean developers would propose (prototype?) versions of a product in PHP, Java, Flash ASP.NET, Silverlight etc. Now we all know this does not happen, early in a project a hopefully informed choice will made as to the technology to use (often this choice is made in the choice of who gets the business - a PHP house or a Microsoft house), and it is rare a change will be made in base technology once the choice is made. Even though a project is agile there are limits as to how major a change of direction could be,

So is this a difference between design and development, in web design we can ask the client how it should look, you still need to provide quality design with sane user interactions, but the client can have some choice e.g. 'I like  a more cartoon style', 'I want just like that but in red'. You are not going to get the same interaction from the bulk of clients for development and architecture, it is rare you hear 'Just like that but can you use SOAP'. Development constrains tend to be just that, things that must be done to meet a standard, not something open to choice at the non specialist level.

So ReMix was an interesting event, and good to see many friend from the community. And if it opened my mind to something new it must have been worth attending.

Local user groups

I have been asked a couple of times whist at the Alt.net and ReMix conferences about the local user groups around Leeds. Well these are the regular free community events I know about:

Black Marble community events - my company runs free community events at a hotel between Leeds and Bradford roughly monthly from autumn to spring. We invite a variety of leading .NET community speakers.

The Yorkshire Extreme Programming and Agile Methods Club (XPClub) - meets the 2nd Wednesday of the month in the centre of Leeds. This is a group of .NET and Java developers interested in agile development bast practice.

BCS West Yorkshire Branch - the local branch of the BCS meet either in the Leeds or York providing a wide range of IT related sessions (they also have links to the events run by the local Institution of Engineering and Technology branches)

Leeds branch of SQL Server User Group - the local branch of the national SQL User groups. As the name suggests is targeted at SQL users.

Geek Up - run monthly events cross the north of England targeted at web designers and web developers (I have not been to this group, but members of the XPClub have and say they enjoyed it)

Vbug - run some events in Leeds, but I think these are organised by the Manchester branch

Now there my be others that I don't know about, if you know of one please let me know.