Archive for May, 2008

New CLI Script class in Haddock CMS

Tuesday, May 27th, 2008

Haddock CMS has always been intended for running programs at the command line as well as on a web server. Separating the interface from the meat of the program has always been an aim, so where the programs are run shouldn’t matter.

So far, command line scripts have been been contained in .inc files. This has worked quite well but it’s overly complicated and hard to maintain.

CLI scripts are now contained in classes that extend a class called CLIScripts_CLIScript. To run a script, first a set of script object runner scripts are generated. These use the reflection API to run the code in the class.

Haddock CMS Wiki

Saturday, May 17th, 2008

Saul and I have resurrected an internal wiki that we started on Haddock CMS a few months ago and made it public.

http://wiki.haddock-cms.com/

A lot of stuff is out of date and we’ll be updating all that shortly.

The wiki software that comes with Google code package has a lot going for it but I prefer MediaWiki. Also, I’m a little paranoid about hosting these sorts of things myself.

Logical Fallacies

Tuesday, May 6th, 2008

Depressed at the thought of wasting time mucking around with wireless on Ubuntu and worried that I was a Talker rather than a doer, I decided to put together a site that I’ve been meaning to write for more than a year:

http://www.logical-fallacies.net/

The aim is to collect as many examples of logical fallacies on the internet as I can and then analyze them.

I’m getting faster at putting the bits together for a basic Haddock CMS site, although it’ll need to be scripted before many people will want to use the framework.

I’ve got a good idea of the DB structure already (the fun part). Hopefully, I’ll get to write that shortly.

How did Microsoft get Vista so wrong?

Tuesday, May 6th, 2008

Before anyone accuses me of being a Linux bigot, I would like to say that I’ve been frustrated by Ubuntu lots of times. Wireless networks on laptops have always been a bit of a bugger and my latest install on a partition of my laptop has been no exception. Getting an EEE PC has shown me how good Linux on a laptop can be, if it’s set up right by the manufacturers. Ubuntu does quite a good job at this but it’s certainly not for the impatient. Dell, Samsung, anyone, please start selling more Ubuntu laptops with all that boring driver nonsense sorted out!

Working with Debian servers at the command-line has never been anything but an unalloyed pleasure. I have a extremely complicated set of tasks that I want to achieve and the stable version of Debian has always done them quickly and painlessly. Some stuff takes research. I’ve no idea how much of my career has been taken up with reading tutorials on the syntax of UNIX config files, probably more time than I’m going to get back. But once you know something and it works it works well. On servers (which, at a glance, are indistinguishable from their counterparts from the 1970s), the bottlenecks have always been my intellect, knowledge and imagination.

And then there’s Vista.

At first I thought that it was a brilliant. Good look, nice fonts, WinKey+Tab 3D funkiness and so on. But then you use it and before long you need a shot of whiskey just to calm your nerves.

If I access an FTP server (even on a cheap shared host) or SSH daemon, logging on and moving from directory to directory is quick. Most programs, including Nautilus out of the box on Ubuntu, allow you to store previous connections. XP used to remember the SMB shares that I had accessed. However, in Vista, every time I go to the network window in the start menu, the list has to be refreshed. Why? And does this takes so long? Does the computer ping the whole of 192.168.*.* or something?

Eventually, you get a list of computers on the LAN. You start to move about but just going from one folder to another can take up to a minute. Eventually you get to a folder that just locks up the computer for a few minutes, Explorer tells you that access is denied and restarts Explorer.

You get a link to

http://support.microsoft.com/?kbid=937097

which tells you that an error occurred and gives you information on how to load up the event viewer that also tells you that an error occurred. Great! I guess that I better contact my system administrator.

I had hoped that the Vista service pack would sort this sort of nonsense out but it hasn’t.

I’m loath to spend an evening hacking away at config files on the Ubuntu partition of my laptop just to get the sodding wifi adapter to work but anything’s gotta be better that the soul destruction that is using Vista all day everyday.

People talk about Cognitive Surplus:

http://jeremy.zawodny.com/blog/archives/010218.html

I guess that any system where the bottleneck isn’t your intellect, like Vista and Ubuntu some of the time, then the thoughts that should be going into your work end up getting clogged. Hence, the need for hard liquor…

Ad-Hoc Data Serialisation Formats

Sunday, May 4th, 2008

I’ve been doing a bit of tidying up of the code that goes into the Navigation plug-in for Haddock CMS. An enhancement that I think is quite necessary is to have navigation lists saved in files under version control rather than in DB tables. This makes testing and collaboration much simpler.

The question that any CS student will ask himself is “What format should I use?” I’ve used XML a lot in different parts of Haddock CMS and it is certainly more than expressive enough to be able to store the data for simple navigation lists.

However, it seems like overkill.

Also, I might want to allow users to be able to edit the navigation list specification files in the admin navigation back end.

A simple whitespace delimited data serialisation format springs to mind. This wouldn’t be too difficult to define or implement and I think that users could understand it without too much difficulty.

I started to imagine this language and wrote out a few examples. I started to think about the grammar of the language in BNF. This is definitely an area of programming where the test first approach is very sensible.

It seems that web programmers are very fond of text files and formal languages. I started to wonder about whether there is a version of YACC for PHP and whether such a beast would be a good idea or not.

Haddock CMS site redesign for narrow screens

Thursday, May 1st, 2008

As promised, I’ve rearranged the divs on the Haddock CMS site to work better on narrower screens.

I made all the edits to the code using Komodo Edit on an EEE PC. The only modification that I’ve made to the EEE PC is to use the full desktop and install Komodo.

Shelling in to my dev and production servers for SVN and to run the various Haddock CLI scripts is not really any different on the small machine. Komodo connects to the dev machine using SCP better on Xandros than it does on Vista (which isn’t hard). phpMyAdmin and cPanel are also fine on the small screen.

While I wouldn’t want to work like this all the time, my main objection is anatomical rather than to do with the performance of the machine. My neck is a little sore.

The only things that I need on the EEE PC at this point are Subversion and TrueCrypt. I’m sure that I can get them working soon enough. Other than that, I would only need the bigger machine for testing what the sites look like other browsers on a larger screen.

Love for my EEE PC

Thursday, May 1st, 2008

After one factory reset and a bit of an ache in my hand, I’ve grown fond of my new EEE PC.

I have to say that it’s making me rethink web design to some extent. Left navigation bars are hopeless and annoying on a seven inch screen. Perhaps I should shift them to the top of the page? I’ll try moving the DIVs around on

http://www.haddock-cms.com/

later today to see if it’s much of an improvement. Are sites going to new a stylesheet for iPhone, EEE PC, laptop and wide screen Media Center style machines? We’ll see…

Staring at this small screen and then looking at the 17 inch screen on my Samsung laptop is a bit like teleporting from England to America. Everything is recognisable and similar but noticeably bigger.