Friday, July 11. 2008
ALT.net UK conference
Well I've started a new job (actually I started in feb) working with Body worn video cameras for the police, and I'm just escaping from the post april we must spend our budget panic of installs and upgrades. More on this later but right now I hate Codecs.
Ben Hall has just announced the Alt.net Uk conference is now open for registration. I've booked my place but be warned you'll need an OpenId account to get registered.
Thursday, January 10. 2008
Cargo cult time
Note to readers: This is written by a linux newbie so corrections are welcome, flames are not.
Linux on the eee is NOT ready for the casual user yet. I've been doing cargo-cult programming getting the Eee to talk to my windows mobile 6 phone.
Broadly speaking the steps involved installing a compiler (requires a new repository adding to apt-get), subversion, download the kernel, rebuilding it then FINALLY building the driver I needed. Most of this involved typing in make commands that I'm not sure I needed and finally a bit of magic adding to a system file that I'm not sure is correct.
Having said that it does actually work unlike WMWifiRouter (turns your phone into a router) which works fine for the Vista machine but the Eee can't seem to route correctly via, it sees the phone connects and gets an address over DHCP but gets no further. I have tried it on the Ubuntu VM I have lying around and the situation is somewhat better as I had to install just subversion then the make files just worked.
My big problem here is that I'm typing in stuff that I've googled and found on the web with magic incantations that have no explanation and for some I've no idea why I need to it (why do I need to edit /etc/networks/interfaces) I feel like a cargo cult programmer who just cuts and pastes stuff straight of the web with no understanding of what it does. Worse still since I'll hopefully only ever need to do most of this once it doesn't even make commercial sense to actually spend the time to learn why (it may be worth doing for intellectual curiosity reasons). Someone could have messed with the wikis where I found this stuff and inserted in a 'rm -rf *' (or suitably obfuscated equivalent in perl for example) into the instructions and resulted in me nuking the machine without me having any chance of spotting it.
Sadly according to this interview with Linus TorvaldsI'm not sure the situation is going to get any better here are some choice quotes from Linus:
So, there’s a real reason why we need to be able to have source code which means that to all kernel developers, a binary interface is basically – it is only a bad thing. There is – there are no upsides whatsoever.
....
And this is something you do see in other projects where, yes, they have binary interfaces for one reason or another—quite often because of commercial reasons—and that just means that they cannot fix their fundamental design. They sign up not just the binary interfaces, they also sign up to the exact design they had when they came up with that interface.
....
So, there’s – that’s the second major reason why a stable ABI is not going to make – in fact, that means that we don’t even guarantee a stable API; so, even on a source level we say, “Okay, this is the API and we’ll – if you have external drivers that use this, we’ll help you fix them up when we have to change the API. But we don’t guarantee that the same API will work across versions.” And it doesn’t.
Jim Zemlin: But by opening up, you’d obviously be able to work with those issues.
Linus Torvalds: Right. Immediately when people work with, like, source API and then we can say when somebody complains, “Hey, it doesn’t compile anymore. My external module here depended on that function and now it doesn’t exist anymore,” at that point at least we can fix it for them.
So, that’s not a huge deal. It does mean that people who maintain external modules, even with source available, they can’t assume that they can just recompile unmodified across many different versions.
Sorry Linus this is a huge deal if Linux wants to escape the datacentre and make it over on to the desktop, I can't just go to a manufacturers website and pull down a linux driver, double click on the download hit next a few times and away I go. What you have suceeded in doing is transferring the pain from the kernel developers out to the driver developers (which may explain why you don't see as a problem) and the end users will never be able to cope with the pain. Wireless drivers seem to be a great example where there is a shim layer called ndis-wrapper which wraps windows drivers for linux. Oddly driver manufacturers put effort into their windows drivers where there is a stable interface, not into an environment where they have to release their source code and keep several different variants around in case someone decides to reconfigure the ABI / API. Windows drivers basically fall into four catagories: pre Win32 (Windows 3.11 and friends) Windows 9x, Windows NT and Windows NT 64 bit (ignoring Itanium). In practice as a driver writer today you can get away with writing drivers just for Windows NT and Windows 64bit possibly doing itanium drivers if you feel like it. Certainly the source code for both 32 & 64 bit windows can be the same, the rest is driven by compiler flags.
As an ex hardware engineer (many many years ago) I can well understand why driver manufacturers don't want to release their source code. It could be something embarassing, such as the need to reset a card when it times out sending a packet or it could be something which speeds up the network by 25% via a software hack and you'd like to keep secret.
To be fair to the Linux community on Windows I have the problem that I have no idea what a driver manufacturer will be installing (HP seem bad at installing other crap) but if the driver has been WHQL tested I have a fair idea that it will work and the testing MS perform on drivers has shaken the worst of the bugs out and I can always run DriverVerify myself on a really bad day. The version of 64bit Vista I run on my main machine forces drivers to be signed which can be a pain sometimes but means my system has only crashed when I've had actual hardware faults i.e. the MiniPCI network card in machine or the slot it's plugged into went wrong and brought the machine down.
Part of the problem here is the assumption on the part of the GPL crowd that binary compatibility doesn't matter. For me as the end user of the little Eee it isn't an issue out of the box it has an office suite and a webbrowser so it's probably good enough for most folks, but it doesn't have all the bluetooth bits you need to talk to a phone in place without a bit of compilation (or adding some repositories I think one of the Eee community ones has the bits). It doesn't have the stuff I wanted to talk to a Windows mobile phone either, it's a pure pain point that on windows I solve by finding the manufacturers website (or sticking in the supplied CD) clicking next a few times.
For software vendors binary compatibility IS a big issue, today you can get away with targetting JUST the NT code base (2000, xp, 2003, vista, 2008 and 64 bit variants) and for my current project I'm ignoring 2000 as I want to use WPF for learning purposes. Windows solves this pain point for me and it's where I'll be working for the forseeable future.
Monday, January 7. 2008
Asus eee first thoughts
(Posted from the eee) Santa was good to me and brought me the Asus eee I wanted for christmas I couldn't resist and took a somewhat crap photo of it sitting on the big Rock laptop:

So far I've been medium impressed with the default linux install on the machine, I've had a few problems following an update I ran into the same Firefox segmentation fault that Tim Anderson did which was a disappointment. Also synaptic seems to fall over with great regularity (I'm getting to be a dab hand with apt-get from the command line now) as detailed in the the eeeuser wiki here sometimes it works, sometimes it doesn't.
Also a lot of the dialogs on programs aren't correctly sized for the screen which means lots of dragging by holding down the alt key. I tried to like "easy" mode but I've cracked and gone to the advanced mode desktop.
While in Edinburgh I met up with my old friend Rupert Goodwins for a quick drink and Karen (plus other half) from zdnet joined us to escape the rain. Her other half is a travel writer and while Karen failed to buy an eee for him before christmas I think its safe to say it is a hit as a present even for the non-geek in your family.
Overall I like the machine BUT I do feel desktop Linux has some way to go before it's ready to take over the world and for a machine like the eee where the hardware is pretty standard a bit more work is required on the vendors part.
I couldn't make the wireless stuff talk to my phone with WMWifiRouter which turns a windows mobile phone into a wireless router, the eee didn't seem to get a DHCP address correctly and if I fudged that dns lookups didn't seem to work. Sadly neither Rupert or I could persuade it to work with "internet connection sharing" and bluetooth dongle either (although the Rock doesn't have a problem)
For me once I'd got back from Edinburgh to the home network downloaded advanced mode, erlang and gcc I felt a lot happier with the final result. Now I have small machine that I can take out and about and use without being tethered to mains electricity.
Overall:
Hardware 8/10 - Good for it's size and cost but could be better in the screen department, more flash memory and a longer battery life would be nice.
Software 6/10 - Nearly there, good enough for older kids but granny might struggle with some dialog boxes and toileting my webbrowser with an upgrade is poor.
Note these are scoring against something which from everyother vendor would cost three times as much so I'd still recommend it.
Wednesday, October 24. 2007
DDD6 is open
Mirroring SQL servers with no domain
At the SQLBITS conference I bumped into Liam Westley who kindly 'volunteered' me for one of the Grok talks. Since Barry Dorrans is now an MVP (congrats Barry) he had also been 'volunteered' into organising the Grok talks so I went along and filled in some space on his flip chart and gave a quick talk on SQL mirroring without using a domain controller (which means you can save having two domain controllers if you want resilience).
Finally I have had some free time to convert the notes Liam and I made at a previous gig into a standalone word document which you can download here. This was a bit of a rushed talk on the day since I hadn't been planning to do a Grok talk but I think it gave folks a flavour on the day of why you would want to do this (Liam somewhat unfairly had done some preparation on his talks).
Now back to getting to grips with WPF for a talk I'm planning for DDD7.
Note to: Barry / Ian yes I will come along and do dry runs to the nxtgenug / London DNUG before then, but I want the finest MSDN socks available to humanity, I want them here, and I want them now.
Wrong about Silverlight
Tuesday, September 11. 2007
BBC iPlayer and Moonlight
I think it's been interesting to see the free software crowd moaning about the lack of support for iPlayer on Linux. Sadly given the DRM rights requirements of broadcasters which in the BBCs case are forced on them by both the content producers and the repeat fees for talent we aren't likely to ever see content which doesn't require DRM. I have spoken to senior BBC folks about this and their view is that currently content without DRM is a non starter much as some of them would like to it happen.
The current state of play is that beeb saying that there will eventually be a version of iPlayer for Linux but that for the next year or so it will be Windows and Mac only. The w3c.org website stats at http://www.w3counter.com/globalstats.php?date=2007-08-30 only show Linux having a 1.34% share of the browser market so the beeb are going at this in the right order.
This means that potentially one of the more interesting bits of the moonlight annoucements is in Miguel de Icazas blog where he talks about codecs and where he says that Microsoft are going to be supplying binary codecs for Moonlight.
Sounds to me like this is a means to deliver the iPlayer on Linux for the BBC without having to get too entangled with the GPL if you're Microsoft and the GPL certainly isn't friendly to DRM.
So the somewhat lame responses the BBC trust are giving back to the online petitions are both understandable and correct.
Tuesday, August 14. 2007
64bit Vista on a D900K
Well for some reason the big Rock Xtreme64 decided to go into thrash the hard disc mode under 64bit Vista. I suspect it was down to an interaction between some MS beta software and windows update. So I decided to reboot in XP grab the stuff from the Vista partition I needed and reformat.
The Rock xtreme64 is based on a D900K chassis and makes a nice (if heavy) Vista laptop and by now most of the driver issues have been sorted out (last week the webcam finally appeared on windows update). There are a few things you will need drivers for which windows update won't find:
D90K_MSBT_X64 Bluetooth driver
D90K_MS6833B_X64 Wireless network card
D90K_AP-KEY_X64 AP keyboard driver
I have decided to host these (click here to download) as I no longer remember which manufacturers website I found them on and at least this way they're stored offsite if I need them. Also I downloaded the latest mouse pad driver from synaptics. Since they are 64 bit drivers they should be signed and I would recommend you check them if you download them from here. You'll need the wireless driver as at some point Vistas problem resolution system says that there won't be a driver for the network card.
The gentoo wiki says that this model has also been branded as an alienware Aurora M7700, Sager 9750 (or NP9750) VoodoPC Envy u:709 and various other names incorporating D900K
This of course was followed by the obligatory full day reinstalling various bits of software getting all the updates etc but this time I remembered to install a second mixed mode authentication instance of MS SQL server 2005 before I applied the service pack (an older app I work with requires this).
One final thought I don't run a lot of games on this machine so I use the out of box GeForce Go 7800 driver which you have to hand select from the driver browse dialogs in Vista using the "show me all the drivers" check box. You may want to get an updated laptop driver from http://www.laptopvideo2go.com/ if you do.
Monday, July 9. 2007
Cobwebs
Last week at DDD5 Liam Westley said that he presumed I was busy since my blog hadn't been updated recently and he's right.
One task has been doing some reading of the "Inside SQL Server 2005" books which I'm still waiting on the "Query Tuning and Optimization" volume by Kalen Delaney which hasn't yet been published but the bits I've read so far in the companion volumes have all been good stuff.
I also have an article in the works on .Net databinding and whats wrong with some of it but I need to cleanup the code, document my findings and see if the workaround I have in mind will actually work. (Reflector was a big help here)
Other than that I've been following Ian Coopers advice to learn a new programming language a year and trying to work my way through Programming Erlang by Joe Armstrong (I'm around the 50% mark currently). This means I'm having to go back to my college days and "relearn" functional programming again.
At DDD5 I also bumped into Oliver Sturm as I was leaving the building and we had a small conversation about functional programming and how it's going to be more important in the future thanks to Linq. He's threating me with doing a joint talk on functional programming at the next DDD so I'd better get on with finding a good application for Erlang that's going to be relevant to a .net crowd.
Friday, May 4. 2007
Geek dinner changes date
If you were planning to come along to the London Geek Dinner that zi makki has been organising on the 24th of May (some of the usual suspects from the London .net user group will be along), it has now been moved to the 17th of May.
The wiki to signup is here: http://66.129.68.3/wiki/17MayGeekDinner.ashx
Meanwhile I've been trying to get new developers on board (at my new gig) and we've failed to find the right person for the job so far. So if you're a C# developer with some SQL skills for whom working in Bexleyheath (technically Kent, but actually inside the M25) doesn't seem like too bad an idea then get in touch.
One thing that is beginning to annoy me is a CV that has an objective section on it. While this is NOT a bad thing to talk to your recruitment consultant about if you're being honest, when it arrives at the other end it's the last thing we read it is about much use as a corporate mission statement as it's always a bit "fluffy bunny".
However we did get this one arrive in the office "Objective: To pursue an exigent career in Software diligence with an organization that affords potential intensification." which I suppose at least makes you stand out.
Wednesday, February 14. 2007
Fun with reflector and comboboxes
I’ve been having some fun with a combobox which created duplicated (or doubled) the items in the list. If you select one of the items that have been duplicated you get a somewhat scary FatalExecutionEngineError exception. When I investigated I found some code that looked like this (this is from my test rig):
testCombo1.HandleCreated += new EventHandler(testCombo1_HandleCreated);
The event handler looked like this
void testCombo1_HandleCreated(object sender, EventArgs e)
{
testCombo1.DataSource = testList;
}
Now I wouldn't recommend handling a HandleCreated event unless you have a really good reason (you’re mid way through setting up the control) but this was being done to delay reading in some values and due to the component based architecture we have it seemed like a good idea to one of my colleagues. So in my case I moved this so once our database connection property got set, we then did a read and setup the data and the job was done.
Now I have a little time on my hands and I decided to do a little spelunking with Reflector to see what is going on under the skin. My initial guess is when the HandleCreatedEvent fires, as we set the datasource which adds the contents of the list to the combo box. OnHandleCreated is then called which proceeds to add the contents of the datasource again. I got lucky and I’m correct. The offending lines are in the RefreshItems() (Called by setting the datasource) of the comboBox which adds if IsHandleCreated returns true.
try
{
if (base.IsHandleCreated)
{
this.NativeClear();
}
if (objArray1 != null)
{
this.Items.AddRangeInternal(objArray1);
}
if (base.DataManager != null)
{
this.SelectedIndex = base.DataManager.Position;
}
else
{
this.SelectedIndex = num1;
}
}
AddRangeInternal eventually calls AddInternal which has this code:
num1 = this.InnerList.Count - 1;
if (this.owner.IsHandleCreated)
{
this.owner.NativeAdd(item);
}
In the OnHandleCreated for a ComboBox is this lump of code which adds the contents of the current items to the combobox, by this point it’s too late.
if (this.itemsCollection != null)
{
foreach (object obj1 in this.itemsCollection)
{
this.NativeAdd(obj1);
}
So to prove the point I've created a small test rig (downloadable from here, to show the problem if you select the bottom three items the combobox throws an exception) and created my own ComboBox class so I can override the OnHandleCreated method and print out some diagnostics to the debug window. The code for this is shown below:
class TestCombo : ComboBox
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, string lParam);
public int GetCount()
{
return ((int)SendMessage(new HandleRef(this, this.Handle), 0x0146, 0, null)); //CB_GETCOUNT
}
protected override void OnHandleCreated(EventArgs e)
{
if (base.Items != null) Debug.Print("Count before OnHandleCreate={0}", GetCount());
base.OnHandleCreated(e);
if (base.Items != null) Debug.Print("Count after OnHandleCreate={0}", GetCount());
}
}
In the main form which contains the combo box I added the following code to handle the HandleCreatedEvent
void testCombo1_HandleCreated(object sender, EventArgs e)
{
System.Diagnostics.Debug.Print("HandleCreatedEvent before setting datasource Count={0}", testCombo1.GetCount());
testCombo1.DataSource = testList;
System.Diagnostics.Debug.Print("HandleCreatedEvent before setting datasource Count={0}", testCombo1.GetCount());
}
When I ran the code the output in the debug trace was this:
Count before OnHandleCreate=0
HandleCreatedEvent before setting datasource Count=0
HandleCreatedEvent before setting datasource Count=3
Count after OnHandleCreate=6
The moral is “Don't do that” for general winform programmers and I think to fix this Microsoft should call this.NativeClear(); in the OnHandleCreated routine of the ComboBox.
Monday, February 5. 2007
Grok talking and WPF links
Ian Cooper asked for folks to give Grok talks at the Dot Net Users group forthcoming Vista and Office launch. Being the fool that I am I said I'd give a quick talk on Expression Blend and WPF from a developers perspective.
So I'm now in mad panic mode as I work my way through the Microsoft samples and see if I can give folks some guidance on how to let designers make changes to your UI, thankfully a Grok talk is only supposed to be 10 minutes long so I don't have to work too hard to get a presentation together.
So far I have a fancy calculator, but I'm not really happy with it as I think it's a bit specialised for general use. I think I'd like to get a decent CRUD style application for my demo but I'm still playing around at the moment (Crunch time is this weekend as the talk is on the 22nd)
Anyway these guys (via Tim Sneath) have some video up and I'm awaiting the next parts so I can see what I've missed. Also Eric Nelson has a list of .net 3.0 training stuff here that is still supposed to be free (Eric seems to think shortly it will cost money)
Friday, January 19. 2007
WPF goodness
I went off to Microsoft yesteday for an all day event and had some Vista and Expression juice pushed into my veins. I have to say the the new WPF demos they have (as demonstrated by Jon Harris) look very sexy indeed.
Jon is an ex Adobe employee and demonstrates on Mac Book laptop and has arrived at MS via MacroMedia. His slides with the egg showing the tension between a designer and the programming team match up closely with real life. Sadly the demo gods weren't with him on all the demos and my guess is that his Mac running Vista has the same resuming from sleep problem I have with networking on the Rock laptop.
WPF at the moment still looks a little raw for my tastes but the new Expression stuff looks like it allows folks to keep the UI design experience seperate from the programming. The first generation of WPF designs will probably stink a bit and I'm worried about the usability levels of the current lot of designs they look great with 3D pictures, but I have a nasty feeling it's still a bit like the early days of wordprocessing with lots of random fonts because you can.
I have a small personal project which is a natural for WPF that I've been meaning to work on for a while and this has fired me to finally get the Petzold WPF book off the shelf and read it properly.
Tuesday, November 14. 2006
Live.com (it's worth a try)
Recently I've changed my IE home page over to live.com for me it seems to give more relevant results. Amazingly it seems like Microsoft may actually now have a better search engine than google. It's only missing one big feature for me, the google news page which I periodically glance at during the day, although live will search through news pages it doesn't give me that catagorised list of highlights to look through.
Sadly I still come top of the search rankings for certain terms (such as my laptops brand with Vista) which is a bit weird when you're looking for help (it's happened three times recently) One hidden thing is that although live.com can be limited to look only at certain sites (by adding site:xyz.com) to the search finding this requires a good rummage through the help (It can be found from the contents)
In a similar vein I've now stopped looking at Robert Scobles site http://scobleizer.com/ for my microsoft centric tech news and now use Mike Gunderloys site at http://www.larkware.com/ now this isn't entirely fair as Scoble no longer works for Microsoft but he seems to be trapped in that narrow Silicon Valley Web 2.0 bubble and seems to get less relevant each time I visit his site.
Wednesday, September 27. 2006
VS2005 SP1 on Vista, it's not that bad
seems to have caused some consternation since they're saying they need a new service pack for Vista and VS2003 won't be supported.
The truth is a bit more mixed than that as Scott Guthrie writes, nothing stops your 1.x apps running on Vista the problems are apparently that they've had to rewrite the debuggers for Vista (not all that surprising given the security changes Vista introduces) and MS don't want to rewrite the older versions of VS.
I've been resisting the call of running without UAC during my beta-testing of Vista, and I've not noticed too much wrong with debugging.

