London 7th July 2005

It’s eerie walking through London trying to get home today.

As Liverpool Street is obviously shut following the terrorist bombings, i decided to try going to Eastbourne from Victoria instead.

Buckingham Palace is partially sealed off, and armed soldiers in combat gear are patrolling instead of the usual dress sentries standing outside.

As buses are suspended, the bus station at Victoria was deserted. It was also strange seeing Oxford Street without a single bus running down it.

Trains are a nightmare. I’m on a special Brighton service as very few trains are running. There are no tubes or buses running so it’s very busy.

Strangely, despite all the trains being messed up, the public information board cheerfully informs us there are no reported problems today, and tries to sell us balloon rides, gay pride and Party in the Park tickets.

Thu 07/07/2005 15:31 - Buckingham Palace
Thu 07/07/2005 15:43 - Victoria Bus Station
Thu 07/07/2005 16:01 - no delays?

I’m In London, But OK

Just so you all know, I’m in central London, but safe.

Looks like I’ll be stuck here as the entire transport system has shut down here after todays terrorist attacks.

It’s a good job I didn’t come via Liverpool Street today!

Whatson.com – The Best In UK Commercial Radio

Whatson.com - Kerrang

I’m really pleased as I made the new Whatson.com site live today. It’s the result of several months hard work by a small team, with me as the lead developer.

Currently it’s the home for 8 radio players at present, with more to follow soon!

Kerrang Radio, Kerrang 105.2, Kiss 100 and Magic 105.4 contain a mix of live radio streams, the best of the weeks previous shows and some other special content.

The BBC has been doing something similar for a while with the BBC Radio Player, and ourselves with the Kiss player, but this a first for UK commercial radio.

All the players cross link to each other and we try to offer highlights from other stations to give visitors a real choice of listening.

Anyway, there’s more to come, so keep tuned in.

Whatson.com - Kiss

Whatson.com - Heat

Whatson.com - Smash Hits

Using Symbian Perl

I’ve been playing with Jarkko Hietaniemi’s port of Perl for Series 60 Symbian devices on my Nokia 7610.

There is a lot of work to be done on it still, but it works, and I can run simple Perl scripts.

Perl running on a Nokia 7610 phone

The screenshot above show’s me running a simple script to list the contents of the Lifeblog directory on my series 7610 phone. Here’s the code that was run on the phone to generate the listing.


my $directory = "C:\system\Data\lifeblog\";
print "$directoryn";
opendir(DIR,$directory);
foreach my $file (readdir(DIR)) {
print "$filen";
}
closedir(DIR);
sleep(5);

As you can see it’s simple stuff. I added the sleep(5) at the end just to allow me to take a screenshot as when the script has been run it prompts you to press any key to exit. In this case, the screenshot key, caused an exit. 🙂

It may not look much, but it’s bloody exciting stuff for me. The possibility of running decent Perl applications on my phone has me salivating in anticipation of the next release. At present the version out there (0.1.0) doesn’t offer any interface into the native Symbian libraries from Perl, but I’m sure that will be changing soon.

It’s easy to write simple scripts, as all I had to do for this one was to just drop it into the Perl directory on my memory card (via Nokai PC Suite) and use the PerlApp application supplied in the Symbian distribution.

The Python guys are luckier to have a fuller featured release of their favourite scripting language, but watch out, the Perl Mongers are coming!

Nokia Sensor – First Thoughts

Nokia have released a new product called Sensor.

It’s a social networking tool that scans the local area via Bluetooth and reports back on other users in the area with Sensor enabled on their phones.

It’s very similar to Mobiluck in the way it works, but seems to have taken the concept to the next stage.

I had a similar idea a while back, and even got as far as coding the Bluetooth detection in Java. My idea was to tie into a FOAF file so you could look for friends or see who knew who in the area. The stumbling point was the difficulty in parsing RDF in J2ME. Ideally the parsing would have to be done on a seperate server somewhere, but like I said, it was just an idea that never got taken further.

When you load up Sensor you have a basic menu of options.

Nokia Sensor Menu

I’ve added a simple profile that can be exchanged with other Sensor users. Here I’ve taken a photo of Larry the Perl camel to use as the photo other Sensor users see when they check my profile out.

Nokia Sensor profile

When you have a profile, you can look for other Sensor users.

Nokia Sensor scanning

Of course, there aren’t any other Sensor users here at present so I can’t see what happens when there is someone else in the area.

It’ll be interesting to see the Bluetooth messages passed and if some bright spark will code up a desktop version. It defeats the object of course, but it’s still interesting to know how it works exactly.

It’s great to see Nokia supporting their handsets with great pieces of software like this and of course Lifeblog. Shame it’s just for Series 60 smart phones at present as this is the sort of thing that I can see the kids loving, and unfortunately not all of them can afford the best handsets.

I wonder when the first Sensor wedding will be… 🙂

Lifeblog Proxy Idea

Sitting in a Lifeblog debrief earlier, one thing that struck me was that others had the same problem as me regarding wanting to post to multiple blogs.

It seems most would like to seperate a work blog from a personal blog, but unless it’s hosted on the same Typepad account for example, Lifeblog doesn’t let you do this. From a service point a of view it’s a one to one match.

Posting on Lifeblog

Sitting there, my mind was mulling the problem over, and it would appear that a simple Lifeblog proxy would solve the problem. If blogs are hosted on the same service and accessible by the same username and password, Lifeblog lets you post to different blogs. Why not just build a service that can proxy between various Lifeblog compatible blogs, so you wouldn’t have to host them all together.

Posting on Lifeblog via a proxy

So how may this work from a technical perspective.

Well Lifeblog posts using a flavour of the Atom protocol. For security it uses WSSE encryption on the posts. This means that the proxy would need to it’s own username and password to authenticate against when talking to Lifeblog. The various blogs it would be proxying onto would also need different username and passwords, and proxy would have to insert these as it passes the post onto the relevant blog. We could potentially store all the blogs we’re allowing posts to in an XML config file. For example…

<blogs>
<blog>
<name>My Blog</name>
<url>http://work.blog.com/post.pl</url>
<username>robertprice</username>
<password>secret</password>
</blog>
<blog>
<name>My Blog 2</name>
<url>http://my.website.com/post.pl</url>
<username>rob</username>
<password>lifeblog</password>
</blog>
</blogs>

Here all the blogs are listed, along with their name, posting url, username and password. The proxy would take this list and return a localised list of blogs that when posted to, would just pass the relevant data across. So this means there are two areas to break the proxy down into.

First, the list of blogs. This reads the XML and returns a list of localised blogs and posting URL’s that Lifeblog can use to upload content.

Secondly, the actual localised posting URL needs to remove the Lifeblog WSSE authentication, and replace it with the correct username and password for the real blog before passing it on to the real upload URL.

It could be as simple as that. Maybe I’ll mock something up in Perl to test the theory out.

Anyway, who’s to say this just has to proxy Lifeblog. It could alternatively be a gateway that could translate into one of the common blogging API’s, instantly opening up Lifeblog to millions more users. Now that would be cool!

UPDATE 23/04/05

Hugo emailed me to say Lifeblog 1.6 can handle some of what I have suggested…

Actually, Lifeblog 1.6 can have post to more than one account, and is
available for the Nokia 6630, 6680, 6681, 6682. Unfortunately Lifeblog
1.5 (for 7610, 6670, 6260, 3230) can only post to one blog. And the PC
can post to multiple accounts.

Lifeblog – Review and Thoughts

I’ve been lucky enough to have taken part in a Lifeblog trail for Nokia in the UK over the past few weeks.

We were given a lovely new Nokia 6630 phone (that unfortunately we have to return at the end of the trial), equipped with Lifeblog and just asked to evaluate it.

Here are my thoughts, experiences and opinions on using Lifeblog.

Well firstly Lifeblog is really two pieces of software. One part runs on your series 60 based smartphone and the other runs on a fairly high spec PC running Windows. The phone stores your messages, photos, videos, etc until you can sync up with a PC to download them. I’ll cover each part separately, then as a whole.

The phone based software is excellent. All content appears in Lifeblog automatically. So I now no longer have to open various different applications to see different content. Lifeblog captures SMS and MMS messages both sent and received. It also captures any photos or videos I take. Content is kept in order, so I can cycle through by day and see all my data in order. This is great at keeping messages in context.

Best of all is the ability to post to a blog directly from the phone handset. Because Lifeblog is so well linked into the way the phone works, it means I can quickly select the content I want to blog about, and get it up on my site very rapidly. Behind the scenes, Lifeblog uses a flavour of the Atom protocol to communicate with the blog. Six Apart‘s Typepad service is supported by default, but other services are coming on stream now with a Lifeblog plugin available for Moveable Type, and a gateway into Flickr. I was even able to link Lifeblog into my own homebrew Perl based blogging system. Going over my website, you’ll probably see the posts I’ve sent via Lifeblog as I include a little strapline at the bottom of each entry highlighting the fact.

From a social point of view, as I always have my phone with me, I can blog wherever and whenever I like. It’s great that the high end Nokia phones have megapixel cameras as the images are so sharp. Lifeblog does shrink the image when posting to the web, but that’s just great, it saves me money in data charges. It’s amazing to be able just point the phone at something, and know it’ll be online a minute a later. I’ve been showing off this ability to the guys at work to much excitement.

Now for the PC side of Lifeblog…

Unfortunately this is where I’ve been having some problems. The concept is great, but its current incarnation still needs a bit of work done on it. For example, it won’t run on my 1ghz laptop. It keeps asking to update DirectX, even though I’m on the latest version. This is a shame as it’s my main machine. However, it will run on my office desktop machine, so I can share my experiences of that.

The PC version of Lifeblog takes over the whole screen when linked in. Microsoft Windows disappears and Lifeblog takes over.

The screen looks beautiful, and has the same timeline experience as the mobile version, though it contains everything that was ever in your handset. It’s great being able to scan back and see old message and photos being kept in order. There is also the ability to post to a blog from here as well, though I’ve not actually tried that, being such a fan of posting from the handset.

It’s easy to sync between the PC and the mobile phone. It just uses Nokia’s existing PC Suite software to connect up and from there it’s just an option on the menu to copy everything across. Very simple. During data transfer, Lifeblog show’s you the content coming across in real time on the screen.

Now for the overall take on Lifeblog.

I think it’s bloody brilliant. Nokia’s concept of a Digital Shoebox works really well. It’s a place to keep all that content that may otherwise be lost or backed up in various places all together. As the mobile phone takes a central role in modern lifestyles, the ability to automatically use it as a multimedia diary is very powerful.

The downside is the software needs a powerful PC to run on. This will probably be addressed as the software matures and older computers are replaced. The other side is the cost. I’ve been lucky at being able to use a full version as part of the trial instead of having to pay for it. The price point is a little too high I’d say at present, but a reduction here would really boost uptake.

There is a free version of Lifeblog available from Nokia that can store up to 200 items. If you have a compatible phone, I’d really urge anyone to give it a try. Beware though, it can be addictive 🙂

This review was based on Lifeblog 1.5.

Nokia Release Series 60 Patch For Perl

It looks like Perl on Nokia Series 60 phones is getting closing as Jarkko Hietaniemi has just commited a patch to the Perl 5 Porters mailing list that enables Perl 5.8.x and Perl 5.9.x to work on Symbian smartphones. The message specifically states that it is known to work on Nokia Series 60 phones. The port is copyright Nokia.

I’m now officially very excited! Perl could very soon be running on my Nokia 6630!

A quick delve into the attached README reveals…

The attached patches enable compiling Perl on the Symbian OS platform:
Symbian OS releases 7.0s and 8.0a; and the corresponding Series 60
SDKs 2.0, 2.1, and 2.6.

Note that the patches only implement a “base port”, enabling one to
run Perl on Symbian, the basic operating system platform. The patches
do not implement any further Symbian OS or Series 60 (an application
framework) bindings to Perl. (A small Symbian / Series 60 interface
class and a small Series 60 application are included, though.)

It also seems that the patch allows Perl to be embedded into Series 60 C++ applications.

Since the primary way of using Perl on Symbian is a DLL (as described above),
I also wrote a small wrapper class for Series 60 (C++) applications that
want to embed a Perl interpreter, and a small Series 60 demonstration
application (PerlApp) using that wrapper class. As a bonus PerlApp knows
how to install Perl scripts (.pl, or hash-bang-perl) and Perl modules (.pm)
from the messaging application’s Inbox, and how to run scripts when invoked
via a filebrowser (either the one builtin to PerlApp, or an external one).

It’s fantastic to see that Nokia are working on getting Perl onto their smartphones. I’ve jealously looked on as Python developers have had their language implemented, now it seems that Perl could well be nearing an official launch.

Datasherpa And Automatic Page Tagging

A new product called Datasherpa has just been launched by Clickstream Technoligies with the aim of ensuring all pages served by a webserver are automatically loaded with web analytics tags.

They claim their new product eliminates the burden of creating, inserting and testing page tags, and ensures all pages are tracked accurately.

It’s a really simple idea, and bloody good one. We’ve been caught out before at work when a page hasn’t been correctly tagged and we’ve lost valuable traffic information.

It sounds like it would be really simple to build as a mod_perl handler for Apache. The handler would scan each page served, probably using the HTML::Parser module or even just a simple regular expression, detect the closing page </body> tag, and just before that insert the tracking tag corresponding to the virtual host being served.

We use Webtrends at work, and this approach sounds like it should work really well with their system. It may even be worth mocking up a proof of concept quickly.

Grayscaling Images With Perl

One thing that caught my interest today was how to convert a colour image into grayscale.

It turns out the basic algorithm is very simple. Basically it’s just…

grey = 0.15 * red + 0.55 * green + 0.30 * blue;

This can be turned into a Perl subroutine using the following code.

sub grayscale {
my ($r, $g, $b) = @_;
my $s = 0.15 * $r + 0.55 * $g + 0.30 * $b;
return int($s);
}

Here we pass in the RGB values of the colour we want to turn into gray. We apply the algorithm and return the integer value of gray.

The value we get for gray is used to replace each of the values for red, green and blue.

We can test this subroutine out with the help of the Perl GD module (available for free on CPAN).

#!/usr/bin/perl -w
use GD;
## grayscale subroutine
sub grayscale {
my ($r, $g,$b) = @_;
my $s = 0.15 * $r + 0.55 * $g + 0.30 * $b;
return int($s);
}
## create a new GD object with the data passed via STDIN
my $image = new GD::Image(*STDIN);
## iterate over the number of colours in the colour table
for (my $i = 0; $i < $image->colorsTotal(); $i++) {
## get the RGB values for the colour at index $i
my ($r, $g, $b) = $image->rgb($i);
## convert the RGB to grayscale
my $gray = grayscale($r,$g,$b);
## remove the original colour from the colour table
$image->colorDeallocate($i);
## add in the new gray
$image->colorAllocate($gray,$gray,$gray);
}
## make sure we output binary
binmode STDOUT;
## pass the image as a raw GIF to STDOUT
print $image->gif;

This code takes an image piped in from STDIN and outputs a grayscale GIF version of the image to STDOUT.

If the code was called convert.pl it would be called as ./convert.pl <test.gif >>test_result.gif.

Here’s a conversion I did earlier of a GIF image of Kitt, Bev and Justin at the Emap Performance Awards 2004 using the above Perl code.

Kitt, Bev and Justin in colour

Kitt, Bev and Justin in grayscale