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);

Where did my Disk Space go?

Hard drives these days seem ridiculously large, and yet I've run out of disk space! So where does 120Gb go on an installation of Vista these days? Manufacturer losses Firstly its not 120Gb. Its actually 120,000,000,000 bytes or 7.3% less. Disk manufacturers conveniently believe users cannot multiply by 1024 and so they round it down for us. OS reinstallation partition. No shiny Windows Vista DVD with your laptop? That's because they've saved some money by eating up your drive space. I loose a whopping 5.15Gb of mine to the ServiceV002 partition. So really I only have 106Gb. Total loss 14Gb Windows losses So how much memory have you got on your machine? Bigger is better right? Well sort of? As soon as you hibernate that laptop that you need at least the same amount of space to swap the memory out to. Lose another 2Gb Page files, event with a 2Gb machine I somehow need a whopping 6.1Gb of swap. Finally remember that annoying Disk Cleanup tool from XP, well it's actually useful now. It managed to root out another 4.3Gb of disk space. Mainly from our old friend the temp folder 3Gb, but also from Windows Error reporting, Office cached installation files, and lots of Windows update patch folders. Total loss 12.4Gb Stuff I really want That leaves me with three parts I should have left. Windows itself, Programs and of course data. Total 44Gb So where is the rest? Now I have to take some of the blame here. I've been trying to get  Windows Seven working on a VHD. The VHD was 6Gb and the copy that I took and recycled was another 5Gb. So 11Gb was in the recycle bin. The one thing I've noticed since Vista is that the world has gone backup crazy. My hardware provider, Lenovo, provide a tool to do it. Windows itself does. Most annoyingly my Anti-Virus does too. Now I can turn off Windows backup without any annoying nags, but if I try to do the same with OneCare I cannot get a green icon. Fortunately I can tell OneCare to backup to a network drive. That unfortunately leaves the Lenovo backup. As much as I am a great believer in system images it can't really take up 40Gb can it. Actually yes it can. It took a full backup after I built the machine at about 15Gb, and then a couple of incrementals at 11Gb, mainly due to the VHD. So what can I do? Strangely enough I'm going to say goodbye to the Lenovo backup and restore.  I have a plan. I have already used the service partition to export myself a couple of DVDs that I can use to the rebuild the system, and should I have to do that I'll have a whole 111Gb drive to write to. Next I am turning off Lenovo Backup for good, and should I ever rebuild my machine again I'll use the options to remove it from the machine install. Next I am going to rebuild myself a modest partition of 20Gb and install Windows Seven. Partly because I want to try it out, but also because I get to install a clean Windows without any hardware manufacturer enhancements. I'll still have to track down drivers but I'm looking forwards to picking my build again, just as I did on XP. Finally I am going to save my pennies, I want an SSD and they don't come in big sizes yet (at least without a lot of pennies). When I get that I am going to take an image and slap it on another drive. The image will be neat and clean and have no local backups enabled. Maybe its living on the edge but if I really have a problem that I can't reboot from, I'll have an old hard drive sitting around ready to go.