VirtualKeyboard.jpg I recently purchased an iTech Bluetooth Virtual Keyboard for use with Michelle’s PDA. It’s basically a little box that’s about the size of two packets of chewing gum with a red window in the top. It projects a keyboard onto a flat surface and detects when you press the keys. It’s one of those devices that looks too cool to work, but it does, kinda… Unfortunately there were driver problems with the iPaq 4150 that meant that it would work for around 20 keypresses and then stop, reset itself, reconnect and then start working again… At first I thought that it was a problem with the keyboard but it worked fine with my laptop (though that’s hardly the point!
LEGO has announced a new version of their Mindstorms autonomous robot building system. I did a fair amount of playing around with the original Mindstorms kit way back when and created a system that allowed you to control your robots over a NetMeeting connection. The new Mindstorms NXT system sounds pretty cool. I like the idea of being able to use bluetooth to control and download programs to the robots and the new sensors sound much more complex than the old stuff.
Another extremely powerful tool that you can use to ensure that your C++ code communicates as clearly as possible is const. By correctly using const all the time when designing your abstractions you can divide an object’s interface into two smaller, easier to understand interfaces; one which does change the object’s internal state and one which doesn’t. By correctly using const all the time when defining constants and variables you can clearly communicate which are which.
When designing code it’s often easy to include undefined behaviour. The need for code that exhibits this kind of behaviour is, however, generally pretty rare and there are often ways around allowing undefined behaviour. In general it’s usually best to try to avoid undefined behaviour and instead be clear about exactly what happens under all usage conditions.
Undefined behaviour can be part of your contract with the client, you expect them to adhere to their side of the contract and if they do then you will keep your side; if they don’t then all bets are off.
One of my main aims when writing code in C++ is to have the code clearly communicate its purpose. I find it useful to be able to look at a single line in isolation and have a pretty good idea of what its effects are on the code that it cooperates with. Unfortunately C++ code can often be written in an imprecise way that makes reasoning about what it actually does harder than it needs to be.
There’s the first part of what I expect to be a very nice article about programming by contract in C++ over at The C++ Source: The Nuclear Reactor and the Deep Space Probe.
Updated 3rd Jan 2006 - the article now appears to be called Contract Programming 101.
Len is back working with the Commerzbank Bonds and Money Markets teams in London with their Excel add-ins, C++ CORBA system and Java servers.
Len originally created much of this for them back in 2001 and is back to help guide the team in adding some new functionality.
As I mentioned a while back, I got a Garmin eTrex Vista C handheld GPS as a Christmas present and there’s code available from the Garmin website that lets you talk to it via its USB interface. There’s also a specification document for the protocols that it uses. At first glance this is great. I’ve seen better specifications but with a little trial and error I’ve managed to transfer the saved GPS tracks from the device to my code and I can set the device up to send it GPS position every couple of seconds (so I could use it as an external GPS receiver for mapping software) etc.
Does anyone in IT use paper clips for anything other than resetting hardware either by pressing those hard to reach reset buttons or by shorting out bios batteries, etc?
I got a Garmin eTrex Vista C handheld GPS as a Christmas present. Another cool tool to add to my geeky ski stuff. So far I’ve only used it to navigate to and from a restaurant yesterday lunch time, but it seems to have lots of features that will make it useful on the mountain. The best thing about it? There’s an SDK that you can download to communicate with the device.