Occasionally connected clients

One thing that NO application developers seem to get right is support for regularly disconnected connections. If you try to use a cell phone and travel at the same time, you get a regular drop in connectivity and occasional disconnect. For example I currently have just reconnected to the network and received full connection. However thirty seconds and (according to Live Search on my mobile) as we enter the next cell, then my initial connection suddenly loses its ability to perform any IP traffic whatsoever. One swift(!) disconnect and reconnect I’m ready to try again.  One of the best applications for coping with this is, not surprisingly, Outlook.  In the background it will note the fact that the IP connection is there and suddenly take advantage of this, swinging into life and attempting to grab those connections back to email servers. DotNet network information In fact it is remarkably easy to add to your own applications as since DotNet 2.0 there is a whole network connectivity interface that lets you determine just how connected you are, see System.Net.NetworkInformation. When I first looked at this a few years ago I found that hooking into the NetworkChange event handlers,  and if you listen just to the the NetworkAvailabilityChanged event, then it arrives just a little too early. It’s fine for disconnections, but you often get told that the Network is connected before you have an IP address. In particular I recommend checking the IP address that’s now available on the NetworkAddressChanged event. this can be used to dig right down. You can check the type of connection and even the subnet you've attached to. With power comes responsibility The question to consider at this point is how nicely should we play, when network connectivity becomes sparse how should we share it? For years I used a mobile cell tariff that didn’t include data, and positively prohibited it at its rate per Mb. My problem was literally killing off all those inconsiderate applications that were about to downloading as soon as they had the chance. A lot of programs that are better now as they at least only check for new updates once a week, but the question is how considerate should our applications be. Most users would want to I am writing the latest anti-theft program that will send those few bytes out telling people who has stolen their mobile device laptop then we need to wait before connecting to the internet. Unless Windows 7 comes along and provides means of categorising your data usage then we shouldn’t we provide a dialog that lets the user choose what to do with the connection when you first connect to it, maybe something like this

Querying LDAP with multiple domains

I'm trying to query an ActiveDirectory but at my current client site, I have a problem. There's a few. The client has previously migrated their DC from XPERT to EUROPE, and now they've bought a division of another company and added that in as well. As a result the default DC only supplies half of the staffs email addresses. Fortunately you can override the default DC by the use of,  DirectoryEntry root = new DirectoryEntry("LDAP://DC=SUBDOMAIN,DC=DOMAIN,DC=com"); Just update DOMAIN and SUBDOMAIN to where you are. More details on http://msdn.microsoft.com/en-us/library/system.directoryservices.directorysearcher.searchroot.aspx

A Bluetooth triangle

I’ve recently bought a Jabra BT3030 . My excuse was so that I have a hands free for in the car, instead of putting the phone on speaker and leaving it in front of the gear stick (which works surprisingly well). However being the classic developer, I'm not just a power user, but a 'use it to destruction' user. This morning I had the opportunity to really test it out. I was already listening to music and reading the web when the phone rang. l love me way you do a crappy scribble on a tablet and just stick it in as an acceptable webpage diagram. My only complaint with my B73030 is that I’m having problems connecting it so that it can play music from either the phone or the laptop. It only accepts an A2DP stream from the last one it was paired with. I’ve contacted Jabra support and been told There is no upgrade for the BT3030. and it should be working. So please tjeck if there are there are new firmware updates for the phone. After much searching I’ve found the update, shame about the page error that’s blocking me from updating!


So my first major Linq project is nearly under my belt and l just have to say how much I like LinqPad. This is both a great learning and debugging tool. My favourite part of the site is the LinqPad challenge with the encouragement to "Delete the shortcut to SQL Enterprise Manager". I haven't but LinqPad is now pinned to the top of my start menu way above Enterprise Manager Download LINQPad

Definition of annoying

Your account is locked out. But it worked before I left the office!

Heaven is having your hardware back

A short while ago I had a minor problem Tablet Hinge popped and since then I’ve been suffering Missing my tablet. But the good news is its back. In seven days, including a delay while they gathered parts. I’m very impressed and very happy.

Missing my tablet

My tablet PC is being fixed at the moment and boy am I missing it, but strangely for all the wrong reasons. Keyboards You never realise just how used to a keyboard until you use a different one. Now I normally use two a day, one on the work PC and that on my tablet. Since my tablet has a US keyboard and everything else is UK I already have to do things differently, but today I'm struggling. The big reason is that I borrowed Melissa's Dell XPS M1330 and the keyboard on that is just not right. The first difference is that the keyboard has keys in very different places, and I've been coding all day. Home, End, Page up, just aren't in the same place as anything I've used before. That includes Toshiba, IBM/Lenovo and normal desktop. Worse the key width is just a little bit bigger than a normal keyboard such as the one I'm using right now. The number of times today I've type *( instead of (). However the greatest problem I've had is with the Shift and Ctrl keys. These keys are a bit wider than most other keys and unless you hit them in the centre, they don't go down. I've typed and corrected [ more times than I've typed {. Widescreen I bought the last non-Widescreen laptop that Lenovo make, and with Visual Studio as my primary application I have my windows docked just where I want them. I go for a two column, with an extra row across the main window [At this point I would scribble a little diagram to show you I mean if I had my tablet]. It just doesn't fit on a Widescreen machine. Maybe I've got spoiled by 1400x1050, but 1280x800 just doesn't allow enough vertical space to have the errors or a callstack showing at the bottom while still seeing a useful amount of code above. Strange really since my previous laptop was 1024x768. Weight and Balance The nice thing about a tablet is that the unit is a single flat piece of technology and so (convertibles in tablet mode, slates all the time) the balance is much easier than using an opened laptop on your knee. I've got so used to relaxing in the evening with my tablet on my knee, I'd forgotten that the screen helps those normal laptops topple backwards. Fortunately I didn't drop it though. Tablet Yes I miss the pen for pointing, clicking and hand writing, but it these other factors that caught me by surprise. Hurry up Lenovo. I really love my Tablet.  

Lenovo X61 Tablet : Hinge popped

Unfortunately the hinge has popped on my tablet, when I came to close it up last night. It felt very loose wobbling horizontally and looking at the case it tablet mode I can see that the top is separating from the bottom, allowing the hinge to wobble. Will be contacting Lenovo/IBM today to see what will happen.

Letters that Katie can read

abc-e--hijklm-op--st---x-z Lets see how many she can do next time

Proxy authentication with retry

Need to talk through a proxy? Try this. You'll probably want to refactor in a factory method to allow the correct creation and re-creation of the WebRequest. Note that attempt one uses the default proxy with Windows authentication parameters, subsequent attempts ask for a user name and password. Or at least they will once you convert the comment into a nice call to a GUI. int retries = 0; bool retry = false;   HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://alski.net"); HttpWebResponse response = null;   do { try { Console.WriteLine("Attempt " + retries.ToString()); response = (HttpWebResponse)request.GetResponse();   Console.WriteLine("Success"); } catch (WebException wex) { Console.WriteLine(wex.Message); if ( ((HttpWebResponse)wex.Response).StatusCode == HttpStatusCode.ProxyAuthenticationRequired) { //Can't change proxy after request has been submitted so we recreate the request request = (HttpWebRequest)WebRequest.Create(request.RequestUri); switch (retries++) { case 0: retry = true; request.Proxy = WebRequest.GetSystemWebProxy(); break; case 1: case 2: case 3: request.Proxy = WebRequest.DefaultWebProxy; //Show form to ask for credentials and maybe change proxy request.Proxy.Credentials = new NetworkCredential("user", "passsword"); break;   default: retry = false; break; } } } } while (response == null && retry);