Archive for the ‘code’ Category

AutoComplete with a .NETCF ComboBox

Sunday, June 17th, 2007

.NET Compact Framework doesn’t support auto-complete in text entry controls. I didn’t realise that until I wanted it for a Form I was throwing together tonight, but there you go.

So, in the spirit of Hack Day (which I’m still gutted to have missed!) I had a quick stab at throwing together something myself.

Read on to see what I mean, and how I did it. (And to tell me a better way to do it!)

(more…)

Working out where my PDA space has gone

Sunday, May 27th, 2007

I mentioned last week that watching Doctor Who made for a good chance to absentmindedly play with some code. I seem to have started a new habit, so thought I’d share what I was worked on this week. 🙂

One of the problems with my HTC Universal is running out of storage space when trying to install new apps. The core Windows Mobile 5 tools that you can use to work out why you’re short of space are fairly limited:

  • Search – listing all files on the device larger than 64KB (an odd size to choose – and without the ability to specify which folder(s) to search in, you end up with a very long list)
  • File Explorer – shows file sizes and lets you sort a folder’s contents by size (but going through each and every folder on the device manually is fairly tedious, and there is no way to get the size of a folder without adding together the size of the contents yourself)
  • Memory applet – showing you how much space available and how much in use (useful to identify that you have a space issue, but not any use in working out why)

You often just look around and rely on trial-and-error to free up space. (Like clearing the Pocket Internet Explorer cache then finding that you have a big chunk of space freed up.)

The aim for yesterday evening was to produce something to visualise the usage of storage space on the device.

Not a terribly original idea (basically a simplified approach to drawing a tree map), but unless my ability to use Google is getting worse, I don’t think anything like this is available for Windows Mobile at the moment.

I think it might be a useful little app, and it only took a bit of an evening to throw together. 🙂

If you’re curious, read more to see some screenshots and a quick description of what I did.
(more…)

Running Windows Mobile apps from a PC using RAPI Start

Monday, May 21st, 2007

People keeping half an eye on my Wakoopa feed might have noticed that I started playing with RAPI Start this weekend.

RAPI Start is a command-line tool that lets you remotely run commands on a Windows Mobile device from a connected desktop. It’s quite neat, so I want to see what sort of things I can do with it.

Here is noddy first attempt number 1 🙂

The problem:
I get a text message while I’m sat at my desk with my mobile connected to my computer. (For a mobile device, it spends a large amount of it’s life tethered to a desktop – but that’s a discussion for another time!)

I want to reply, but writing on a mobile device is fiddly. I’m sat at a full-sized keyboard, so why can’t I just use that instead?

(more…)

Playing with Google Maps

Thursday, May 17th, 2007

Can’t sleep.

So I thought I’d go back to some of the Google Maps API stuff I last played with about a month ago.

The Google Maps code I wrote before would show my last stored location.

I thought it’d be more interesting to see a number of updates over a period of time – so went back to the code and tweaked it to show updates from the last day, week or month.

Code is a bit messy, but in my defense it is past midnight 🙂

I wanted to use the Google routing algorithm used to show directions – to link together the points that I have been to over time. Assuming that I will probably have taken the most direct route between points, then you would end up with something approximating my travelling over time.

Unfortunately, Google don’t expose their routing stuff in the API. Shame.

And on a related note, apparently if I’d used the Yahoo Maps API to do all of this, I’d be breaching their terms of service.

A friend sent me this:

You may use location data derived from GPS or other location sensing devices in connection with the Yahoo! Maps APIs, provided that such location data is not based on real-time (i.e., less than 6 hours) GPS or any other real-time location sensing device, the GPS or location sensing device that derives the location data cannot automatically (i.e. without human intervention) provide the end user’s location, and any such location data must be uploaded by an end-user (and not you) to the Yahoo! Maps APIs.

Spoilsports! (Well, I guess it’s more to do with the demands of who provides their mapping data, but pah – yay for Google)

Note: This post is a bit thin on content – sorry about that. But Twitter is down, so had to say this somewhere! 😉

Turning C# programs into PowerShell scripts

Tuesday, April 17th, 2007

I mentioned PowerShell – the new Windows command shell and scripting language – last year when I first tried it out. But other than playing with it a little, I kind of put it to one side and forgot all about it.

Yesterday I picked it up again and started playing with it again – using it to develop functions for WebSphere MQ (accessing it through the .NET DLLs that come with WMQ). The idea was to start and produce something which expands on the command line administration tools that come with WMQ – adding features that perhaps we don’t already provide.

You can see a walkthrough of what I’ve come up with so far on a post I wrote for the Hursley WMQ blog, but I thought I’d quickly draw out some of the more interesting bits that I learnt in doing it.

(It’s worth pointing out that if you’ve come to this page from Google looking for PowerShell tips and best practice, that I’m very much a beginner. As I highlight in the WMQ post, this is the product of an evening’s playing around – pretty much just trial and error and seeing what tab-complete suggests. It seems to work, but whether it’s the best way to do it… dunno 🙂 )

(more…)

RE: Where am I?

Friday, April 13th, 2007

I mentioned yesterday that I never got round to writing the bit of code for my location service client which would look for known wi-fi access points.

To recap, the idea is that my phone should be able to look for the access points within range, comparing the SSIDs against a list of known locations. If a match is found, it looks up the name and GPS coordinates of the location from the known store, and uses an HTTP request to send the update to the server.

It was really easy – the interesting bit of the code looks like this…

(more…)

Where am I?

Thursday, April 12th, 2007

I first come across Plazes a few months ago. The idea is pretty neat – you update a service to let people know where you are.

I’m not a big fan of the implementation though. It’s too tied to using the network you’re connected to to identify where you are – which means it can’t seem to tell the difference between any IBM site in Europe. And as I spend the majority of my time connected to an IBM network, that leaves Plazes thinking that I’m somewhere in Germany half the time. Not very impressive.

It has an API which is always a good thing, but that won’t let you create any new ‘Plaze’ which it doesn’t already know about. Which makes it a little useless for many circumstances.

And it relies on me being at my laptop. This is a bit limiting as I don’t always have my laptop with me. What would be really cool would be a service which actually updates where I am. (Okay, so they have a mobile client, but that’s for Symbian only so that’s no use to me 🙂 )

With this in mind (and my newly rediscovered love for PHP after having to do some work on the SYA database on Tuesday), tonight I decided to have a go at knocking together a solution that would better suit my needs…

(more…)

I miss pine

Friday, March 2nd, 2007

Does anyone still use ‘pine’? We used to use it at my University, and I loved it.

For those who’ve not come across it before, Pine is a very nifty text-based email client. And (as I seem to be going through a nostalgic love for all things command-line based at the moment), I miss it.

With that in mind, for no reason in particular other than that my mind was wandering in a particularly boring meeting, I thought of creating a pine-inspired email client for myself. A bit like pine, but more task-oriented to fit in with my GTD approach to personal organisation.

(more…)