Archive for February, 2008

Learning from competitors

Friday, February 29th, 2008

http://port25.technet.com/archive/2008/02/27/opening-windows-server-2008.aspx

I’m glad that Microsoft are big enough to admit to being influenced by the OSS movement. I’ve always been turned off by all the computer tribalism that’s going round. Copying each other and improving on what’s gone before has got to be the way ahead.

I’m not likely to move away from Linux anytime soon, however…

The Howard Brothers in the Guardian

Tuesday, February 26th, 2008

Some friends of mine (the Howard brothers of Brighton Wok fame) were interviewed for the Guardian:

http://education.guardian.co.uk/egweekly/story/0,,2259874,00.html

Interesting that the government should seek to levy a tax for education in this way.

In my chosen field (programming), anyone who’s anyone seems to take pride in being self-taught. Programming is very much this sort of skill. Although many programmers have degrees in computer science, they are of little use day to day (if ever) for a programmer, other than to convince someone to employ you.

As I’m self-employed, I don’t send people my CV very oftern, so I consider the three years that I spent at university to have been a complete waste of time and money. Wikipedia, working with people, selling software to clients and long hours at the command line and cursing IE is where I consider my education to have taken place.

If the government were to levy a tax on web programmers to train other programmers, I would be completely against it.

If you want to know how to do something, you should go ahead and do it.

If you want people to give you money, try to sell them something that is of value to them.

Maybe I should put down this cup of coffee and my dog eared copy of “Atlas Shrugged“.

🙂

Darren Seymour’s Photos

Monday, February 25th, 2008

Just helped my mum put some photos that our neighbour Darren Seymour has taken of my sister, Georgina, and of our garden on Picasa.

http://picasaweb.google.com/amanda.impey/GeorginaSPhotos20080225
http://picasaweb.google.com/amanda.impey/20080225Woodlands

Thanks Darren!

Picasa’s such a simple program to use. Even though my mum is perhaps not the most computer literate person, she was able to get the photos in to the album simply and without too much hand-holding. A sure sign of a well built bit of software!

I often need to resize and upload photos to my own sites. My clients also often need this feature. It’s simple enough to upload photos with a browser and resize them using ImageMagick and php. The problems start when you have 400 full size (6 to 12 MB each) photos that need to be resized and uploaded to a server to be displayed on the web. Uploading the photos full size and resizing them all on the server is out of the question. Does anyone know of an open-source clone of Picasa that can resize and upload photos to an arbitrary script on any server? Ideally, it would create thumbnails and be able to call scripts that associate the thumbnails with the resized photos in an database.

Haddock CMS

Sunday, February 24th, 2008

Please check out the new site for the Haddock CMS:

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

There’s not much there at this point. But that’s the idea of a CMS – you add to the content as you go along.

Why you should aim for simplicity

Saturday, February 23rd, 2008

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

– Brian Kernighan

via

http://www.thescripts.com/forum/thread453493.html

Raymond Chandler on Childhood

Saturday, February 23rd, 2008

From

http://www.theatlantic.com/doc/194803/oscars-hollywood

… that godawful mixture of boredom and bad manners known more eloquently as the Impressionable Age.

Stupid Censors

Monday, February 18th, 2008

I can’t believe that the lawyers at Julius Baer thought that they would be able to make this work:

http://news.bbc.co.uk/1/hi/technology/7250916.stm

It took me about three seconds to get to this site, in spite of the DNS injunction:

http://66.102.9.104/search?q=cache:cKzgBuIMp6UJ:www.wikileaks.org/wiki/Camp_Delta_Standard_Operating_Procedure
http://88.80.13.160/wiki/Wikileaks.org_under_injunction

I’d never heard of the site before or Julius Baer. I have now. Many people will be in the same position.

Bit of an own goal for the Julius Baer lawyers, if you ask me.

Stochastic Selection in Back up script?

Monday, February 18th, 2008

I maintain a number of web servers and have a number of scripts running on the crontab of various machines that take care of backing up our data. For example, the output of running mysqldump for each of our databases is saved in dump files and copied to several back up machines. Once data has been copied to one of our back up machines, it is copied to a different directory and named according to the time that the data was copied. This way, we have lots of copies of our data from different times.

So that the hard drives don’t get filled with old copies of data, we also run scripts to delete old files:

http://haddock-cms.googlecode.com/svn/tools/server-admin/trunk/bin/delete-old-dump-files.pl

This isn’t very satisfactory as it simply deletes files that are more than a set number of days old. Also, different databases are different sizes. Some are only a few MB, so I might as well have hundreds of copies of the dump files going back months. Some are hundreds of megabytes, so we can’t afford to keep everything for ever.

I’ve been thinking about updating this script so that I can achieve the following:

  • I want as many recent copies as possible
  • I want a few really old copies.
  • I want the size of the back up dir to never go above a fixed level.

The current script doesn’t to this, I simply deletes files that are older than a set number of days.

The algorithm that I’ve come up with for achieving this is as follows:

  1. If the size of the back up dir is less than the set maximum, exit.
  2. For each file in the back up dir older than a given age, assign a score equal to the age in seconds times the size of the dump file in bytes.
  3. Pick a file non-deterministically and delete it. The probability that a file will be chosen is proportional to the score in step 2. Go to step 1.

I’ll probably want to play around with the score function a bit, e.g.

if the age is A and the size is S, f(A,S) could be

A + S
A * S
A^k + S^l

and so on.

Luckily, I’ve got more than one Debian box backing up our server data so I can play around with the script without putting the data at risk.

Tilda Swinton and Open Marriages

Wednesday, February 13th, 2008

I’ve just been listening to the Jeremy Vine show on radio 2 over lunch. They were discussing the love life of the actress Tilda Swinton and her two lovers. Normally, I wouldn’t write about celebrity gossip; I’ve no idea who Tilda Swinton is and I couldn’t care less about her sex life. However, at least one of the listeners’ reactions contained what might be a logical fallacy.

One listener phoned in and said that marriage was a Christian undertaking and that such an arrangement was doomed to failure.

A guest on the show spoke of her experiences as the other woman in a three way marriage. She accused the previous listener of being a Victorian moralist. Who was she to said how people should or should not behave? We’ve moved on and now everything goes. She then went on to talk about how much everyone had ended up being hurt by the affair. She said that we are all emotional beings and that when one considered human emotions behaving this way involved lots of risks.

Doesn’t she rather agree with the previous listener then? Whatever the aims of your morality and that of others may be (e.g. follow the doctrine of the Bible, try to maximise your own happiness, etc.), if you both agree that a type of behaviour is doomed in some way, you should accept and agree with the other person’s opinion. However flawed or mystical Christian morality may be, if your experience of an open marriage was painful, you shouldn’t get upset when a Christian tells you not to get involved in one.

Removing directory from SVN

Sunday, February 10th, 2008

A quick one-liner to remove a directory from SVN control on Linux:

find . -type d -name .svn | xargs rm -rf