Monday, 30 April 2007

Real content management

Lately I've been working with Vlad on designing a proper website for use on an upcoming project.

In the past I've used PHP for various different things, including hacking together a simple blog site of my own.  This blog included the classic blog pages, as well as static pages and (theoretically) interchangeable themes.  I built this on top of PEAR and Smarty for PHP.

Never before have I been faced with designing a website that really /matters/.  By this I mean a site that, I hope, lots of people will be visiting.  The website will be an integral part of a greater project.

This website must have a number of different content types: static pages, a 'blog' (or similar), a Wiki-style section for easy Wiki-linking, a photo gallery and a rather specialist/custom mapping section.  There's no big deal here... until you start actually trying to design how these fundamentally different blocks fit together in a seamless and logical way.

We're coming close to a draft specification and there are a few key points we've identified:

  • Once implemented, the site *has* to be low maintenance.  We really can't afford something full of security holes, or even something that requires any but the most basic maintenance.  We don't want to have to deal with spam of any form, maintaining links, categories, etc.

  • The project as a whole involves travel and so physical locations are interesting to us.  We want/need the ability to provide a geo-reference for every item of content (and potentially categories too) on the site.  This means at the very least a latitude and longitude, but also an altitude where at all possible.

  • Latitude and longitude is all very well and good... but what does it really mean?  The website needs to have a fundamental understanding of 'reverse geocoding'.  Geocoding is the term given to translating a "man-made" location into a latitude/longitudinal value... for example a post code, city name, etc.  Reverse geocoding is a slightly more specialist application of geocoding, and involves (surprisingly) geocoding in reverse.  i.e. converting a latitude/longitude into a readable location.

  • Access to the data must be trivial for any visitor.  This largely boils down to search, and manipulation of a structure.  For example a user might want to view all content related to a given physical location... this should be straightforward.


Having identified these problems we've come up with a few ideas that we hope to implement:

  • We will provide a basic rigid content structure.  This will be at a country name level, e.g. England, Scotland, Wales, etc.

  • Further categorisation of data will be done on a 'free tagging' basis.  i.e. we will not extend the rigid structure in a hierarchical manner to include, for example, England->Manchester.  In some ways this is desirable but maintenance is non-trivial and the rewards don't fully match the effort to maintain such a structure.  In terms of the end user, if an entry has been tagged correctly it should be trivial to locate it by tag-based search.

  • We will provide two different views on data: ordered by time and ordered by location.  By default the user will see both but more specific views will be available.  These will be as natural as possible.


The things that have really got me stumped are what format we will use for the URLs.  There are many different ways of expressing useful information in URLs but ultimately we will pick just one way.  In the meantime I'm enjoying* writing out URL schemes and considering their various benefits/drawbacks.

Walk to Work

Saturday was largely spent catching up on sleep (i.e. in bed).  But I had a really super idea towards the end of the day (i.e. too late to actually carry out said good idea)... I could walk to work.

Right now I live in a town/village called Yately, which is the other side of the A30.  Each day my drive takes me along Cricket Hill Lane and Minley Road to work -- in total the drive is almost four miles.

I had a go at sketching a route with Google Earth, Google Maps, etc. before finally asking my Dad to have a look for me (as the shops were shut and I couldn't pick up a decent OS map).

He plotted roughly the same as I'd come up with in Google Earth, but of course the OS maps have much more information -- public footpaths, bridleways and other useful details.

walktowork.jpg

Here's a very quick estimate of the route using Google Maps... it's largely inaccurate, but it gives a good idea of the route.  Up top is where I live and Guillemont Park is down at the bottom right.

With the map sorted I drove to work at 4PM yesterday and proceeded to walk home.  There's a really handy pass-operated gate to get out of the carpark and into the area surrounding Hawley Lake.

Two hours and fifteen minutes later, I arrived home.  I must have covered five or six miles on Sunday, thanks to my utter inability to follow a map.  This isn't entirely true, as in the woods around Guillemont Park it is very easy to get lost -- if you're on a bike it's no big deal as the area isn't that large, you just backtrack and set yourself right.

But on foot you can spend quite a while... but the bigger problem is that you come out at the wrong area, and your whole route is now buggered up.  On Sunday I ended up at the Blackwater A30 roundabout and had to walk back up the A30 to make the crossing over the road into the carpark.  Here I got lost again and ended up taking a slightly different (longer) route home.

With all of this in mind, I set off to work this morning at 6:50AM, thinking it would take me at least an hour and a half to two hours.

In reverse (and with a little knowledge of) the route is much more straightforward.  As I do the suburbia sections first, I'm guaranteed to hit the entrance to the wooded area at the right spot, which makes getting through it much more straightforward.

All in all it took me one hour and ten minutes to get to work -- an improvement of well over an hour.

Wednesday, 25 April 2007

Boat race around the world

I've known about this since just before I went to China/Cambodia/Thailand last.  My Uncle Quentin has signed up for an around-the-world yacht race.  He's done the initial training/evaluation and is getting ready to take part in the race.

The Hull Daily Mail have an article about it at http://tinyurl.com/23hjdm

Dealing with Office Stress

Some days things just don't go right... but for those not involved these days are clearly the best.

Vlad showed me the first one (which is easily the best), but the second two are also pretty good :)





Sunday, 22 April 2007

Social structure in Japan

Japan has historically had a very rigid and conformist social structure.  In 1590 Hideyoshi Toyotomi unified Japan under his rule and swiftly set into

Historically Japan has had a very rigid and conformist social structure.  This
In 1590 Hideyoshi Toyotomi brought the whole of Japan under his rule when

Harajuku, Tokyo

Japan is a mixed-up country. Last week I spent some time to discuss Fuji-san and sakura and the place they still hold in a modern Japanese society.

I've decided that I'm going to attempt to introduce some of the Harajuku stereotypes to the few people that read my blog.

Everything that I know about schooling in Japan suggests that we have things pretty easy over here in the UK... but of course some of the inner-city schools are very different to the experience I had at at a medium-sized primary school and then public senior school and college.

By all accounts growing up in Japan is a constant struggle -- kids are under pressure to perform well, to get to good universities and become good salarymen or housewives. Bullying is a much bigger thing in Japan, and in many cases there might be an aspect of yakuza (Japanese mafia) involved. Japan has historically been a very rigid and conformist society, an aspect nurtured by centuries of Feudal rule.

This rigid social structure lives on today in the form of salarymen, yakuza, elite businessmen

Growing up in Japan would appear to be a constant struggle -- there is the pressure of performing well

"Harajuku girls" are known to many to be the Japanese teenagers refusing to be 'hammered down' like all of the other kids.

Harajuku in the Shibuya district of Tokyo is a small area around Harajuku station. It is here that some Japanese teenagers refusing to be 'hammered down' will hang out and make their statement by way of 'Gothic lolita' dress.

11.jpg

A top-ranking Google Images result

RAM is good, swap is essential

My machine has completely and utterly locked up a couple of times over the past month.  It's been pretty annoying but I've always been in the "damnit, I was busy working" mood when it happens, and never looked beyond that.

It happened again about an hour ago.

This time I bothered to think about why it might have happened.  Two seconds after deciding to think about it I figured that I should have probably configured a swap partition for my Linux install.

I have no idea why I didn't do this when I installed, but I bothered to do it this time.  5GB should be more than sufficient, and it makes me feel better about my horrendously under-utilized boot disk.

Saturday, 21 April 2007

Karl Bushby: Giant Steps

I picked up an updated copy of Karl Bushby's travel book, Giant Steps, while looking around Waterstones today.

Karl Bushby is an ex-paratrooper from Hull who, in 1998, decided to walk back home from South America.

Apart from the fact that in 2006 he was the first Brit to cross the Bearing Straits on foot, I know nothing more about him.

I've had a quick flick through the book and I have to say that I'm totally amazed by it... this guy is obviously the real deal and an inspiration to anybody who has ever wanted to attempt the impossible.

More to come when I've got at least some proper reading done!

Subway, a tale of two cities

Subway is an awesome place to eat... they make sandwiches that are edible thanks to the fact that they actually bother to ask you what you want to put on it.  In addition to this the BBQ sauce is really nice.

I grabbed my usual footlong BMT on Italian bread with green peppers, cucumber, jalapeno peppers and BBQ sauce, sat down to enjoy my breakfast/lunch and was suddenly reminded of the last time I ate Subway.

Quentin, Xiaoxiao, my mum and I were all wandering around Shanghai on our last day in China.  I was hungry and we somehow managed to convince a taxi driver to take us to a Subway.  I have no idea how we did this as we didn't know the Chinese name for Subway, or even where it was.

But, anyway, we got there, wandered in and began to order.  The guy that worked there also appeared to live there.  No doubt behind the curtain he had a bed, TV, computer, etc.  This guy was totally weird and found the whole situation very amusing.

As soon as we got sat down and started to eat a bunch of four or five Japanese girls came in.  I can only imagine they found the same taxi driver that we did.

Anyway, these Japanese girls clearly spoke less Chinese than I did, but managed to ask for the toilet (finding the toilet was an experience in itself) and spend a good fifteen minutes deciding what they wanted.  In the end they laughed a lot (classic Japanese schoolgirl) and left... without ordering anything.

To make the whole situation more amusing they all decided that they would take a photo of the Subway once they'd gotten outside.

I can see their photo album now: "Subuwayu... didn't eat here."

Friday, 20 April 2007

IPMI love for our main UK lab

In an unusual spate of activity and compassion I've spent the last two days configuring IPMI on all of the compatible hosts in our main lab.  In every Sun support lab we have a lot of hosts, any of which an engineer may book for his escalation.

The job of the labstaff is to sort out any physical hardware requirements they have... e.g. install a fibre channel host bus adapter, hook up some FC array goodness, etc.   In addition to this we support them on these machines... this means that if it breaks, we fix it.

A side effect of this is that if somebody comes along and types "init 5" (aka shutdown and power off), it is us that get called to the rescue.

IPMI is awesome... the first machines Sun shipped with IPMI support (that I know of) were the Cobalt lx50s.  Unfortunately the lx50, v60x and v65x machines require a reboot with the most bizarrely non-standards compliant CD going to get the IPMI going.  This means that I wasn't able to sit at my desk and do it all remotely... I had to actually go down to the lab (!) and put CDs into the drives!

But the work paid off, once I was done we could use the excellent "rpower" utility written by Keith Harvey to query and control the power status of the hosts.

So impressed I decided to take it further and configure IPMI and rpower for all of the other compatible hosts in our lab... this includes the v20z, v40z, X2100, X2200, X4100, X4200, X4500, X4600 machines.

As Keith, kami of the rpowerness, will have us know: it's all about consistency.  And now that rpower works for almost every host in the lab, we are getting close to living the dream.

Thursday, 19 April 2007

What colour is my brain?

Picking up where Chris left off, here is my brain:







Your Brain is Green


Of all the brain types, yours has the most balance.
You are able to see all sides to most problems and are a good problem solver.You need time to work out your thoughts, but you don't get stuck in bad thinking patterns.You tend to spend a lot of time thinking about the future, philosophy, and relationships (both personal and intellectual).

What Color Is Your Brain?


I have to admit... I'm a bit upset. I clearly should be a Purple brain, like Chris.

Anybody that knows my latest escapades clearly knows that I'm dreamy and thinking of being somewhere very different from here.

Tuesday, 17 April 2007

Love your $ENVIRONMENT

This evening I set up a simple Subversion repository to host some web content over on noisy at CompSoc.

Everything was up and running and Vlad and I were able to successfully checkout, update and commit changes to the Apache/mod_dav_svn repository. Permissions were configured in a sensible way. /home/lewiz/svn belongs to lewiz:www and is chmod 0770. Apache runs as the www user and this way I had total control over all of the files, while still allowing Apache to do the necessary goodness.

I came across an interesting FAQ in the Subversion docs that concerned me. As we are both doing web development and work in a standard change-commit-fix cycle it makes sense for the actual copy of the site to be always updated. I wanted to run an update every time a change was committed.

http://subversion.tigris.org/faq.html#website-auto-update covers this perfectly and makes use of the post-commit hook by way of a simple C programme. Everything seemed set but on my initial commit with the post-commit hook in place I saw:
$ svn commit
Sending index.php
Transmitting file data .
Committed revision 6.


Warning: 'post-commit' hook failed with error output:
Error validating server certificate for 'https://www.compsoc.man.ac.uk:443':
- The certificate is not issued by a trusted authority. Use the
fingerprint to validate the certificate manually!
Certificate information:
- Hostname: www.compsoc.man.ac.uk
- Valid: from Sun, 21 Jan 2007 15:34:35 GMT until Mon, 21 Jan 2008 15:34:35 GMT
- Issuer: The University of Manchester Computer Society, Manchester, UK
- Fingerprint: 39:2a:09:a1:d1:d1:4f:f6:44:fd:6b:1b:ad:c6:f4:55:29:e8:2e:07
(R)eject, accept (t)emporarily or accept (p)ermanently? svn: PROPFIND request failed on '/svn/lewiz/walktojapan/testsite'
svn: PROPFIND of '/svn/lewiz/walktojapan/testsite': Server certificate verification failed: issuer is not trusted (https://www.compsoc.man.ac.uk)

Ouch! This really isn't good. I initially assumed that the script was not running as me so I double-checked the setuid bit and so on. Once this was confirmed I realised that svn simply didn't know where to find my hashed password and certificates.

Some man pages and a Google later and we come across the true goodness of execle(3).

execle() allows a pointer to a null-terminated list of environment variables to be passed to the binary being exec()d. In my case the script now reads:
char *env[] = { "HOME=/home/lewiz", NULL };
execle("/usr/local/bin/svn", "svn", "update", "/tmp/myrepo", NULL, env);

Basic, maybe... but still new to me!

Saturday, 14 April 2007

Fuji-san

fuji7.gif


I've often wondered why Fuji-san is so revered in Japan. It's a puzzling thing how a big chunk of rock can be the focus of so much attention.

Fuji-san is not Mt. Arat or even Mt. Everest. In the big scheme of things it shouldn't really stand up there with the others, but it does.

If I really think about it, the only assumption that I can come up with is that like a thousand other things that are "over-hyped" in Japan. I mean, when you really think about it some of the quintessentially Japanese wonders are often not unique to Japan. Instead, they can be seen the whole world over. We're coming towards the end of the season now, but cherry blossom viewings, or hanami, are the number one example of this:

73242318_20ff5fe865.jpg


(image from http://www.flickr.com/photos/cktse/73242318/)

Sakura (cherry blossom) exists the world around; the Japanese donated thousands upon thousands of trees to the United States after the war, Korea has them (according to Wikipedia sakura originated in Korea!) and I even pass a fair few on my way in to Camberley town centre! So why is hanami such a big thing in Japan?

Cherry blossom are a turning point in the Japanese calendar; they mark the end of the wet winter months and the beginning of the stifling hot and humid summer months.

The interlude offered by sakura can be thought of as a brief respite from an otherwise trying climate. This alone is reason enough for the respect offered by the Japanese people, but consider also that sakura is near-clockwork in its 'life' and 'death'. In a land so heavily influenced by the historic class of samurai (lit. to serve) such an ultimately futile existence is sure to ring true.

This brings me back to the main question of why Fuji-san? Up until recently I had no idea... no amount of reading had offered any real insight beyond breaking down the origins of the name, 富士山, which more or less always comes down to neverending/immortal/infinite.

My inspiration to write this blog entry, the first real entry I've written for some time, was Fuji-san. I happened across a photograph (it could have been almost any photograph) and instantly I realised the answer to "why Fuji-san?".

Thursday, 12 April 2007

Marijuana

"My theory on this is that these people were just dumb to begin with, now they just have an excuse for it."

from http://www.xenex.org/fearandloath/weed.php

Wednesday, 4 April 2007

Here a core, there a core, everywhere a core-core!

Over at CompSoc (where this blog is hosted) we've had some issues with PHP for some time now.

PHP executes code as it should, but as it exits it was dumping core on signal 11.

I've probed this once before and spotted that the backtrace pointed fingers at the session module.

I decided to have another look at this today and, armed with the knowledge that PHP was dumping core unloading session.so, I did some searching.

It turns out that simply moving extension=session.so to the top of extensions.ini provides a fix.

I have to say I'm most unimpressed with that.

Tuesday, 3 April 2007

It's always the shoes...

I found out fairly last minute that I'd be needing some smart clothes for a meeting tomorrow.  Day to day I wear a pair of jeans and a t-shirt, but never a decent pair of trousers or shirt and tie.

Anyway, I couldn't realistically go all the way up to Leeds (ish) to grab a jacket, trousers and tie, so I figured I'd just head into town at lunch and buy a pair of trousers and shirt.

Annoyingly shops no longer sell sensible shirts.  The options have changed from regular shirt collars, to extra-wide ones, suitable only for Windsor knots.  Not content with this I checked out a few more shops to find an alternative -- I didn't manage this, but it did occur to me that I couldn't wear my regular shoes.

I've not bought a pair of shoes so quickly in my life... "do you have this in a 12?", "ah, yes, my foot fits in... I'll take them."

It's always the shoes...

Evince? Or Acroread?

Of course it depends on what you're doing...

but the answer is ultimately provided to us by the CIA at  http://www.lib.utexas.edu/maps/world_maps/world_physical_2006.pdf

Try it and tell me which is best.

Monday, 2 April 2007

A Thousand Years of Good Prayers

In China there is a saying: "It takes 3,000 years of prayers to place your head side by side with your loved one's on the pillow."

This collection of ten short stories delivers a truly insightful look on modern Chinese history through the eyes of common people living during the last hundred years.

Yiyun LI manages to cover the sensitive topics of the Communist Revolution, Great Leap Forward, Tian'anmen Square and homosexuality in a way that points no finger yet still tells it as it is.

One story best read each night before bed.  Well worth a read.

Sunday, 1 April 2007

Google Earth Political Overlay

I've been playing with Google Earth for the past two days and I have to say that I'm very impressed.

Thanks to the KML/KMZ overlays it can provide much more useful information than one might initially think.

Some of the high resolution imagery for interesting points, such as the Nepal-Tibet border crossing, is just outstanding.

However, so far one of the most useful overlays I've found (actually Vlad found it for me) is a political overlay that shows different countries in different colour.  This may sound basic, but when you're interested in borders and lots of different countries it is absolutely essential.  If you're interested follow this link and use the "View in Google Earth" link (Google Earth is obviously required).

Now if only there were an overlay which told me which page of my World Atlas to turn to for some hard-copy cartography!