Friday, 5 December 2008

iPhone shipments overtake Windows Mobile

As reported by Silicon Valley Insider. Their analysis covers the challenge to the current wisdom (that buyers want customised models) that this poses, and the fact that other manufacturers seem to be turning to non-Windows OSes such as Android to counter Apple.

All of which must be deeply embarassing for Microsoft. I suppose they'll just have to grin and bear it (there'll be a lot of people wanting to help them with that — at least with the grinnning part) while they do yet another revision of Windows Mobile.

It looks to me like Microsoft's in real trouble here though. It wouldn't be so bad if they'd "only" been pushed out of the number three spot (after Symbian and BlackBerry). Symbian is clearly in trouble itself and has been more or less abandoned by Nokia (that's the perception at least, after the recent open-sourcing, whatever Nokia might say) so you might expect its market share to be gobbled up by the others over time. However Windows Mobile shipments were actualy down in real terms, not just as a proportion of a growing pie: by 3% over the year.

In a world where perception matters, Windows Mobile is looking weak: the only one doing all-around worse in the mobile space is Linux. Manufacturers, like investers, tend to stampede. Will 2009 be the year Windows Mobile collapses?

Thursday, 2 October 2008

Notes on the Fiscal Crisis and Bail Out

A very useful, exceptionally clear analysis of what went wrong with the US mortgage investments market. It's very good at showing the causal chain (if I may use such a discredited notion) of events. Find it here (PDF). Hat tip, if that's the right phrase, to Tyler Cowen at Marginal Revolution.

Tuesday, 30 September 2008

The Jules Verne

The video of the re-entry of the cargo ship Jules Verne into the atmosphere is quite spectacular. (If you don't know, the Jules Verne took supplies up to a space station, stayed docked for a while, and was then packed full of rubbish and set off on a trajectory that ensured it would burn up during reentry thus disposing of both itself and all the rubbish.) It looked, of course, like a rather large meteorite burning up in the same manner. There's something very pretty about such fireworks, even if you know that it's "really" just incinerating rubbish. It's the distance I suppose.

What really interested me though was reading that the crew of the space station had found the Jules Verne, while it was docked, to be a nice, quiet place to go and spend some free time. Some of them even chose to sleep there.

Excuse me? They went to sleep in a vehicle that they knew was going to undock, blast off, fall hundreds of miles while burning up and finally explode in a million fiery pieces? I know that the moment I fell asleep there the nightmare would start. The clang of the airlock shutting, locking. The hiss and rattle of the couplings disconnecting. The roar of the engines that, curiously, wouldn't be enough to wake me up... Astronauts it seems, are made of sterner stuff.

Sunday, 21 September 2008

The Hand that throws the dice :)

Reading Richard's latest post, I eventually stumble upon his reading list for the 9th September. A little way down I find Ian Stewart's Does God play Dice with its reference to Einstein's famous statement that he didn't believe that God played dice with the universe, and suddenly realise what's been troubling me about that remark ever since the first time I heard it.

Which is that, in classical mechanics at least, throwing dice gives you a perfectly causal and non-random result!

Wednesday, 17 September 2008

Interesting Google Reader behaviour

Quite a while back I decided to try to drum up some page rank for wow.gedsguides.com by creating a few blogs. Whenever one of my characters completed an interesting quest, or quest line, as well as updating gedsguides.com I would write about it in that character's blog. The end result of course, as any seasoned blogger could have told me, was four blogs that weren't updated frequently enough to be interesting, and that still didn't cover all the WoW characters I've got.

So I've decided to amalgamate all these blogs into one new blog — the hard way. Instead of spending a couple of hours tediously cutting and pasting from one window to another, and then fiddling with the settings of each post to faithfully reproduce the date of the original, I'm going to spend a couple of days writing a python script to do the same thing programmatically.

Of course, the real objective is to kill two birds with one stone and to improve my still extremely sketchy knowledge of Python. That will then feed back into useful skills should I eventually decide to Django-ise gedsguides.com, as I'm still thinking about doing, and also for anything I might do with Google App Engine.

Anyway, along the way, I saved the xml data feed that the script was getting back from the Blogger API, and looked at it in a browser. Lots of guff, lots of urls. One url being an Atom feed of the list of all (that is, all four of) the blogs belonging to the account that I set up to publish them.

So I rather naively took that url off to Google Reader and plugged it into the Add Subscription box. I suppose I vaguely thought that Google Reader might be clever enough to add the Atom or RSS feeds for all four of those blogs at once.

Instead, it simple-mindedly read the Atom feed, containing brief descriptions of the blogs taken from their settings, and presented that as its list of "new postings".

OK, so it wasn't as clever as I thought, and I reached for the Delete button to remove the feed. But wait! I'd been thinking of Google Reader as a blog / news reader. What it really is, is a vehicle for presenting any old Atom / RSS feed!

Well I knew that Google Calendar presents an XML feed, so I copied the feed url and tried adding it as a subscription in Google Reader. Success! Seconds later I was reading my calendar entries in Google Reader!

I wonder what else you could munge into an Atom publishing format and usefully view using Google Reader? I was thinking you could use it as a cheap workflow engine: someone could subscribe to an intranet url that gave them their to-do list for the day. Of course, the rather limited list of actions that you can do using Google Reader might not suit everything: you can jump to the posting's url or open it in a new tab or window, and you can mark the posting as read. Still...

If you could take an Atom feed from forum software, say for a partiular forum, or for a particular thread that you were interested in within that forum, then you could browse new postings in Google Reader.

A few years ago I worked with a crude kind of laboratory automation software at a pharmaceutical company. If you had a bioreactor chugging away, say, under program control, that program could expose an Atom feed with a new post every time it passed a particular milestone (sterilisation, cooling, adding medium, adding nutrients, adding organism) and you could check on the progress of your culture at the same time as browsing Slashdot :)))

Thursday, 11 September 2008

Django - first data!

With Django installed it was a question of seeing if I could get data out of the wow.gedsguides.com database. So I munged the table definition parts of my database build (structure) script, create.sql, into a Django-style model definition in a new model.py. OK, so I only did two of the tables, but it's the thought that counts.

Then just a matter of validating the models using Django's built-in manage.py tool, and once I'd fixed a couple of newbie bugs I looked at the generated sql, and it was certainly close enough to the original DDL in create.sql for me to be confident that the Django models were going to work with the existing database just fine.

Then it was time to go into the webmin interface of the new (soon-to-be-migrated-to) virtual server running on a box in jsp-servlet.net's data centre somewhere in San Francisco and tell postgres to let my home PC connect to the database.

Then an SSH session into the same virtual server, to run the actual database creation script — my original create.sql, naturally. I wasn't going to run the Django one for the pretty obvious reason that other applications have to be able to work with this database, so Django just can't be the lord and master there.

Once that was all done I tested connection from my home PC to the remote database by running pgAdmin III and that was fine, so I edited my new Django app's settings to tell it how to connect up, and then it was time to go into manage.py's interactive shell and start instantiating database objects:

>>> from ggw.admin.models import Stages
>>> qs = Stages.objects.all()
>>> print [p.name for p in qs]
[u'Stub', u'Notes', u'Rough draft', u'Final draft', u'Complete']
>>> print [p.id for p in qs]
[10, 25, 50, 75, 99]

Tomorrow I'll look at what it's come up with in the way of an automatically generated admin interface, and at that point I'll know whether I want to proceed or not.

Some things do stand out though. The rather ad-hoc nature of Django's query filter language being one. I don't know, it may be modelled on some absolutely standard object query language (I don't like them either) but it seems to have had to replicate, in an amazingly clunky and obtuse way, what you get as a nice, clear syntax in SQL itself. For example, I don't know how anyone can think that a where-clause expressed like this:

Entry.objects.filter(pub_date__lte='2006-01-01')

is an improvement on one expressed like this:

SELECT * FROM blog_entry WHERE pub_date <= '2006-01-01';

"Publication date less than or equal to equals some date" ... I don't know — how do you read that in a way that doesn't insult your linguistic sensibility? But obviously it's what you have to do when you have all that enormous object-relational machinery in the way. (It reminds me of the old saw about all applications evolving until they include a complete lisp interpreter, implemented very badly.)


Update: Sheesh, them thar interwebs are humbling things: no sooner do I write my half-baked objections in the last few paragraphs above, than I stumble — from a completely different direction — on someone making exactly the same point, a hundred times better, in a different-but-comparable context.

Wednesday, 10 September 2008

Moving to Django

Well wow.gedsguides.com needs a bit of t.l.c. — a facelift and some new functionality. And rather than plod through acres of Java code (and, IMHO, now that everything is supposed to be done via annotations it's actually more error-prone rather than less) I'm looking at Django to do the business.

Mostly I like what I see. The Django developers seem to be a pretty smart bunch, and if they've had to balance power, flexibility, economy and expressivity they seem to have got a very good bargain.

So there's just a few things I don't like. Number one (and I won't bother about the rest) is syncdb. I want to design my database first, and then have the ORM layer work with that. I don't want to design the object layer first and then have the database constructed from it automatically. I suppose I'm showing my age, swimming against the tide of history, etc. etc. And to a degree, it's a bit cheeky of me to expect to be able to use an ORM approach like Django's without having to pay the price.

Still, so far I've only installed Django and worked through the tutorial. I've yet to read the reference documentation for the models module(s). It may be that you can finesse the default behaviour, I hope so — and the flexibility and customisability I've seen in the rest of Django certainly gives me cause to hope; it would be a shame if it was completely hard wired in this one area.

I'll look at Djangoising the admin interface first. Since it's a completely separate application, I can do it in Django while leaving the public site still running with servlets/jsps. And I get the benefit that all I have to do is define the models and Django will generate an automatic admin interface for me — that's very attractive! (Subject to the proviso above, of course.)

And when and if the time comes to deploy it, I can even do it in baby steps, by simulating python/Django on the java server with the magic of jython: Deploying Django/Jython Projects on a J2EE App Server.