After a long time
I realise as I write this that it has been almost exactly a month since I last updated the content on this site. Strange how having more free time actually leads to me doing less...
I’ll briefly update my situation. I am now in Belgium, although I went back to the UK last week for my graduation ceremony. As a result, I am now a graduate with a Master’s degree. (MEng Electronic Engineering with Language to be precise.) Apart from that, I am spending the time being generally idle.
The current hiatus in my life is not solely due to laziness. Next month, on 9th August, I’ll be flying to Japan. I have a working holiday visa, valid for a year, and an interview with a company for a job on 19th August. If that goes well, I’ll be set for the next twelve months. Once I get some money, I’ll get a digital camera, and be able to add some graphical flair to this site. I might even be able to afford a new laptop...
One of the things that has kept me from writing updates at the moment is that when I am doing very little from day to day, it is a bit difficult to write any news or keep a diary. I thought I should add something now to prove that I am still alive!
The second reason why I haven’t been working on the site is that I am designing a “mark 3” site engine. I am doing usability testing against myself, in a sense. I have designed this site for myself, trying to solve some specific problems in doing so:
- Automatic generation of navigation
- Easy to update
- Works in multiple languages
At the same time, my chosen solution has some distinct limitations:
- Only one presentational form (hierarchically arranged blogs, in essence)
- Difficult to move content around
- Can only be updated via command line (i.e. using ssh)
- File access problems (site engine reading from a file while I am trying to write it to update the content)
Therefore, in order to overcome these limitations, I am working on a new design. It will still work the same as it currently does, but will add some extra features:
- Chapter-based formatting as well as the current blog style
- Use a database for storage and extraction of data (MySQL)
- Cache pages once generated to improve speed
- Move static content (images, programs, etc.) to a separate tree to simplify references in the text. At present, there is some pretty weird code to try and second-guess things.
- Photo galleries
- Maintenance interface
I have recently been using the Ruby programming language, and I really like it. It’s very readable (unlike Perl, which is sometimes disparagingly compared to line noise) and is inherently object-oriented. OK, Perl can do object-orientation too, but after reading the documentation on that I quickly decided to give up trying to learn that. It’s the ugliest kludge I’ve ever seen. I do want to move to object-oriented programming for this site engine, for a few reasons:
- Clean up the namespace
- Enable re-use of data generated (i.e. have a single set of data and represent it in multiple forms without regenerating it from scratch)
Ruby is a beautiful, sensible, rational language, and although my subjective impression is that it is somewhat slower than Perl, I believe that this can be overcome using caching. It’s close enough to Perl in functionality that I can port over sections of the existing codebase, which will help my development.
I have been giving thought to the structure of the database. My design consists of two tables, Nodes and Documents:
Defines the navigational hierarchy of the site
- ParentId (links to Id of another row in Nodes)
Note 1: Flags is just a list of configuration options parsed by the engine. Rather than using separate fields in the database for each parameter, this is easily extensible without changing the data structure. E.g. “type=article;docs_per_page=1;show_contents=yes;sort=title”
Note 2: Languages is a list of languages available for the node, e.g. “en,ja”
Contains the text for each ’page’
- NodeId (links to Id in Nodes table)
I think that that just about covers everything except for picture galleries. Those would be dealt with using entries in Nodes.Flags such as “type=gallery;gallery_path=/images/party”. I still need a decent way of generating thumbnails automatically, but as I don’t have a digital camera at present, that’s not pressing.