« April 2008 | Main | June 2008 »

May 31, 2008

Westonbirt Arboretum Postcode

The postcode for Westonbirt Arboretum is GL8 8QS.

Why am I putting that on my blog? Because I was woken this morning - and not for the first time - by a phone call and a voice asking "what's the postcode of the Arboretum?". One of the hazards on having a strong online presence is that you'll come up high - far higher than is proper - in certain Google searches, and we're quite used to certain calls. In the case of Westonbirt, I think it's probably because people find this page

As you may image, train and rail time enquiries are not unusual, and at times Lisa feels that she's the secretary for a campaigner on "the next line across" as the press try and reach him but find out site instead. And I have been asked if I can nip into Bathampton church yard an email someone a photo of some of the graves there. But perhaps the strangest was a call the other week, enquiring as to the status of the industrial dispute that had made the news at the Grangemouth oil refinery that had been making the news a couple of weeks previously

Actually, I don't mind the odd call like this (the odd odd call!) occasionally. It adds to the spice of the variety that life brings, and we get to talk to some people who we wouldn't even know existed!

Posted by gje at 11:04 PM | Comments (0)

More about Graham Ellis of Well House Consultants

Equality, sameness and identity - Python

Is the number 7.0 the same as the number 7.00000? A trick question, because it depends on how you look at it. It has the same value, but it is not identical. And if eachof them is held in computer memory, there's no chance at all that they're both the same thing - i.e. held in the same memory location - at the same time.

Does it matter which type of identity you use? Sometimes it does!

a) In Python, if you use the == operator on two objects, it uses the __cmp__ method to compare them, and if that returns 0 they are considered to be the same. This could lead to some quite bizarre situations if you code it that way - you could for example decide that all animals are going to be equal simply by having an __cmp__ method in class animal that returns a zero. From version 2.2 onwards, you can also use a method called __eq__

b) The __str__ method creates a string from an object, and those strings could be compared - that's another form of equality in Python. And although identical objects will always return identical strings (unless you're using a time or random element in creating the string!), it's quite possible than non-identical objects will also return identical strings. So this is NOT going to check if two instance variables point to one and the same object.

c) The "trick" in in the __repr__ method, which has a shorthand in the backquote, Using this method, you can return the official string representation of any object, which includes trhe object's class and its address on the stack. And comparing these strings .. if two instance variables both return an identical string, then you can be reassured (stupid programming excepted!) that the are both instances pointing to the same variable.

I've written an example to show a) b) and c) in use - bring up the source in a separate window here. And you can see the results from running that below. Note that "mydesert" is copy of the "toffeepudding" variable (i.e. a reference to the same thingy) but all the other objects are at different addresses - even though "jamrollypolly" has identical settings to "toffeepudding"

toothpaste: A thingy which is sticky and with an edibility no
toffeepudding: A thingy which is sticky and with an edibility yes
jamrollypolly A thingy which is sticky and with an edibility yes
forum_topic: A thingy which is sticky and with an edibility no
water: A thingy which is wet and with an edibility no
mydesert: A thingy which is sticky and with an edibility yes
 
Use of ==, showing that == does NOT mean identity
Toothpaste and Toffeepudding are equal
Water and Toffeepudding are NOT equal
 
Comparing the print strings - does not test for same object
toothpaste and forum_topic are the same
toffeepudding and mydesert are the same
 
Compare two objects via __repr__ - are they the same object
toffeepudding and mydesert are identical refs to same object
toffeepudding: <__main__.thingy object at 0x68a70>
mydesert: <__main__.thingy object at 0x68a70>
jamrollypolly: <__main__.thingy object at 0x68a90>

It's getting late at night and this talk of food is leaving me rather hungry - I think I'll head off for some "Ice Cream" before "I Scream" at how complex a subject equality is. But I would be very happy to go through it - at length if necessary - on our Python Course

Posted by gje at 10:35 PM | Comments (0)


Useful link: Python training

May 30, 2008

Korn shell - some nuggets

I've presented some Korn Shell Training over the last couple of days ,,, and I cut and pasted a few snippets which I thought might be of interest.

• Korn Shell - looping through a series of outputs from a command

$ for file in `ls`; do
> echo $file
> done
LinuxBasicsAdmin.book.pdf
Sefas.book.pdf
dat_backup
dat_backup2
dat_backup3
filestat
funky
gvar
hello_korn
kornserver.cgi
ksh.book.pdf
ksh.ps
numtee
pippa
script_korn
selk
sharon
stroppy
townline
tracey
$

• Korn shell - integer (counting) loop

$ for (( kay=0 ; $kay<10 ; kay=$kay+1 )) ; do
> echo $kay
> done;
0
1
2
3
4
5
6
7
8
9
$

• there are a lot of clever modifiers in the Korn shell you can use on variables such as these which will let you look at part of a string.

$ stwing="jhkasdhjkasdhjkadshjkasdtqwetyuqwe678678sdhjksdhjkasd"
$ print ${stwing:40}
sdhjksdhjkasd
$ print ${stwing:40:5}
sdhjk
$

• using read to read from stdin in ksh, including a prompt.

$ read treacle?pie
pieCustard
$ echo $treacle
Custard
$

• capturing STDERR into a variable in the Korn Shell

$ tryme=`mkdir 2008-05-29 2>&1`
$ echo $tryme
mkdir: cannot create directory `2008-05-29': File exists
$

• branching on the status returned by a command in the Korn Shell

if mkdir 2008-05-29
then
echo yay
else
echo nay
fi

See also Korn Shell Training and Korn Shell Resource Index.

Look back at the previous entries on this blog so see examples of environment settings in the Korn Shell, and also how variables may be used for Strings, Integers and as arrays.

Posted by gje at 08:31 AM | Comments (0)

String, Integer, Array, Associative Array - ksh variables

• In the Korn Shell, variables default to be being strings ...

$ r 26
kay=7
$ r 30
while (( $kay>3 )); do
echo $kay
kay=$kay-1
done;
7
7-1
7-1-1
7-1-1-1
$

• ... but you can declare them as integers.

$ integer kay
$ kay=7
$ kay=$kay-1
$ echo $kay
$ (( g = 8+8 ))
$ echo $g
16
$ h=8+8
$ echo $h
8+8

• Variables can also be arrays

• and even associative arrays (i.e. with named elements)

$ typeset -A stuffing
$ stuffing[turkey]=sage
$ stuffing[chicken]=onion
$ print ${stuffing[turkey]}
sage
$

You can get out the keys and the values to iterate through them ...

typeset -A places
places[Bristol]="Temple_Meads"
places[Radstock]="Shut_Doen"
print ${places[Bristol]}
print ${places[Radstock]}
# Values
print ${places[*]}
# keys
print ${!places[*]}

Posted by gje at 08:28 AM | Comments (0)

Some useful variables and settings in the Korn Shell

Here are some hidden "gems" ...

• -C sets "noclobber" mode in which redirects do not overwrite files

$ set -C
$
$ ls > fred
$ ls > fred
ksh: cannot create fred: File exists
$ set +C
$ ls > fred
$

• CDPATH lets you change the target for your cd command to a list of directories whihc are searched in turn.

$ CDPATH=/etc:/bin
$ pwd
/home/trainee/sefas/f
$ cd
$ pwd
/home/trainee
$ cd init.d
/etc/init.d
$

• OLDPWD remembers where you were last in ksh, and cd - takes you there

$ pwd
/home/trainee
$ echo $OLDPWD
/etc/init.d
$ cd -
/etc/init.d
$

• Korn Shell - elapsed seconds, and a randon number between 0 and 32767

$ echo $SECONDS
14294
$ r
echo $SECONDS
14297
$ r
echo $SECONDS
14299
$ r
echo $SECONDS
14301
$ echo $RANDOM
28369
$ r
echo $RANDOM
5877
$ r
echo $RANDOM
28995
$

Posted by gje at 08:25 AM | Comments (0)

May 29, 2008

Farewell, Newcastle to Stavanger, Haugsund and Bergen

I was very sad to hear on the radio this morning that DFDS are withdrawing their ferry from Newcastle to Norway - a short item and I have no detail,s but it brough back memories of a 24 hour crossing one winter a few years ago, on the "Venus" run - in those days - by Color line. Rising fuel costs are blamed - the service is no longer economic - and that's going to be a huge disappointment to all the Norwegians who have been coming across to see Newcastle United and to shop in the Metro Centre.

Picture a large, windswept keyside with a great loading area and a handful of cars and some "heavies" loading - quite quiet and even 15 years ago, before I ran my own business, I wondered at the financial model. And yet I was missing something; I knew that our berth was "the only one we have left" and was situated under the car deck. Then I saw what was missing. The first of a convoy of double decker busses appeared, and rolled down to stop by the boat, where the hordes of Norwegians on them rolled out and on board. "Booze Cruise"

Crossing - rough. So rough that passengers for Haugsund were advised the boat couldn't get in, and they should get off at Stavanger. But I'm used to rough crossings - am I allowed to say I enjoyed it. And I have a further big memory - of an 8 hour drive on through a blizzard to Oslo, an arrival there after midnight at a locked hotel, and (as you will have guessed!) a Perl course the next day.

If you need a course in Norway ... we'll still have other means of getting over to you. I would love to come. Please. ;-) ...

Posted by gje at 08:32 PM | Comments (0)

May 28, 2008

Be careful of misreading server statistics

Here's a mystery for you.

Background

Over the past weekend, I was "fighting" server outages on another computer where - about once an hour - the httpd daemon appeared to be running away in some sort of hole or denial of service attack. Tricky one to find, as the temporary fix I had in place was in the form of a "heartbeat" script that killed all existing connections and freshened up the server. And when the server was busy, it was so much "treacle" that I couldn't run any Linux commands from a shell to see what was going on.

Mystery

I was aware from my heartbeat log of a total of around 20 seconds per hour during which the server was not accepting requests - that's about 0.5% of the time. Yet I had a user who was telling me that in his experience, downtime was around 10%. Wow - that's some scary figure, isn't it?

Any ideas?

Turns out to be a case of how you gather your statistics!

Solution

My heartbeat script clicks in at the start of every minute and if there's a problem it tidies up - 5 seconds. Having clicked in once, it then does a further precautionary clean the following "top" of minute, and perhaps if it's not sure that load levels are dropping as they should, the following minute. So in a bad hour, 4 outages of 5 seconds = 20 seconds.

It turns out that my user was running an automated script to check our server, again at the top of the minute. So he had syncronised his tests to our server in such a way that he always saw it during that brief clean up. Looking at his log activity later, I noticed that if he got a failure he had programmed in a second hit straight away to confirm it - so he was seeing 4/60 or 8/64 failures - that's 6.5% or 12.5% to report.

Lies, damned lies and statistics

This is a "object lesson" in being careful with statistics - at best, they're helpful and at worst they can give a totally incorrect picture. But I have to say that this example really took the biscuit!

Footnote - server issue solved. Availability now over 99.8% and the remaining outages in the last couple of days relate to me testing.

Posted by gje at 06:47 AM | Comments (0)

May 27, 2008

A date for your diary - 16th July 2008

We're big fans of working with other local businesses which is why we're members of various local business groups, and why we run "Speed Networking Evenings" - they're great for us too!

Business to Business Networking Evening at Well House Manor

If you run a business, buy from or sell to business in North or West Wiltshire or Devizes, this is an opportunity to meet 19 other businesses. We started these events soon after we opened at the end of 2006, and run them three times a year.

• Arrive between 6 and 6.30 p.m.

• From 6.30 to 7.30, you'll meet 10 other businesses - for five minutes each. That's not much more that a quick intro and "hey - what do YOU do?" - but that's enough to see if you could and should talk further.

• A half hour break, with snacks and soft drinks served, gives you a chance to talk for a little longer with the people you have already met, and to look around the hotel and conference facilities if your wish.

• From 8 to 9, meet the remaining 9 businesses - again, 5 minutes each. And from 9 you can continue talking of you wish.

You need to book ahead. The cost is £15.00 if you sent one representative, or £20.00 if there are two of you. Call us on 01225 708225 or email christine@wellho.net to reserve you place. Wednesday, 16th July. Well House Manor.

Links to previous events and pictures: March 2008 and again. October 2007 and April 2007. And further pictures>.

Posted by gje at 12:41 PM | Comments (0)

May 26, 2008

The old sayings are the best (FSB)

My attention has been drawn to an old page about goings on at the FSB and I was reminded of the various happenings in this area last year which I talked about on 13th September, 20th December and again briefly on 18th February this year.

I am reminded of the saying "a leopard cannot change its spots". And, reading the above and hearing that there's still more happening on the basis of "if at first you don't succeed, try, try again", I'm very glad that I decided not to stand for the local committee this year. "Choose your battles carefully" they say, and I have chosen mine in the campaign for appropriate public transport across Wiltshire, not in the in-fighting of the FSB who seem to have forgotten that "The Customer is King" - and that their customers are the businesses who join them.

Posted by gje at 11:11 AM | Comments (0)

May 25, 2008

How do Google Ads work?

I came across this rather curious message on the top of a forum that I'm not associated with ...

... and it struck me that I've never given a quick intro (in my words) to how Google Ads 'works'.

The Google Ads model

1. Google generates a lot of visitors to its search engine - a huge number of people use it, and they use it when they are looking to find something

2. In order to provide as wide a range of answers as possible, thus encouraging visitors to return, Google lists as many websites as possible and for free. It needs really good content lists, so a crawler called "Googlebot" automatically visits sites and lists pages. Google is also free to the information seeker, as again it wants to build up a heavy and loyal traffic.

3. Commercial Operations want their business to come high in Google's listing and much work is done with "Search Engine Optimisation" by web site builders and maintainers. Indeed, commercial organisations are prepared to pay Google to make them more visible - and that's where AdWords comes in. Companies (and we use the service) place a two line advert with Google, which Google will display on appropriate pages. Three notes:

3a. Google uses a context sensitive placement system so that adversisers can tune their adverts to appear on search results pages which they (the advertiser) will consider relevant.

3b. Payment is on a "pay per click" basis, so that adverts are only paid for when a searcher actually clicks through the advert. This encourages advertisers to sign up, as it's "no interest, no fee". And it's on an an auction / bid system so that the adverts shown on any particular page are those which - broadly speaking - bring Google the highest income per click

3c. Adverts are kept apart from the "line entry" or free listings to encourage a continuing foundation for the search engine.

So why that strange message I started this email with? In order to allow their adverts to reach even more potential customers, Google allow their adverts to also be displayed on other web sites that choose to do so.

4. Web sites that wish to display Google Ads sign up to Google for an advert feed, and then display those adverts.

5. When visitors click through the Google Ads on a third party site, Google is notified of that click through to bill the company who's site has been visited.

6. Google also pays a fee to the third party site that gave them and the adveriser the extra exposure - a financial inducement to carry Adwords on the site.

Back again to that curious message that I stared this post with. What it's really saying is "Look - you're probably not interested in these adverts, but have a look at them anyway so that you get the advertisers to pay me some money!"


At Well House Consultants, we do place some advertising with Google through AdWords but we have made a business decision not to include their advertising on our pages. As metrics change, we may find a different balance in the future that leads to a review of this decision in certain techincal areas. It's not "on principle".

Posted by gje at 10:25 AM | Comments (0)

May 24, 2008

Old Sarum airfield brings back fond memories

It must have been some 15 years ago that I flew with Dick (a retired flyer with rthe US military who had gone on to a distingued career managing their flight maintainance base and in civvy life) from Montgomery field in San Diego up to the back of the LA basin (I am trying hard to remember the place name) where we landed at an airstip, parked up the plane as one would park up a car, and had a darned good ham and eggs brunch. Those are memories that I hold quite out of proportion to the tiny amount of time they took - as are my memories of working with Dick in some rewarding but politically challenging times of company takeovers, re-organisations and backstabbing through which we tried to do our techincal work to the very best of our abilities and with our customes at heart. We sorta kept no eye on our own positions and at the conclusion Dick retired and I was working elsewhere - my move into a nearly full time training role. Some other fabulous times with Dick and Dottie too - showing them around the UK, visiting with in Coronda, and at Mammoth Lakes where they (and we) skied. We (and it's all down to me) have lost touch rather in the last few years, but we still hear very occasionally and should I be passing through San Diego (pretty darned unlikely) I would be sure to have them at the top of my "must look up" list.

Why the flying memory, and the memory of the smell of cows from thousands of feet up? Because last Wednesday I did a day of Linux Consultancy about 30 miles from our base at Old Sarum Airfield, with the airport's cafe - chair and tables laid out on a lovely May Day on the edge of the airfield - and it is literally an airFIELD.

Old Sarum was a First World War airbase, and the aircraft hangar there is the oldest in the country (that's still standing? still in use?) - a listed building with great wooden beams that looks slightly down at heal but created a magnificent first impression and a feeling of awe and wonder.

The military's control room building is still exeant too - with the office I was working in for part of the day being that classic map room where, on old films, you see the wrens moving model aircraft around while the top brass stand in the gallery and plan the battle high above.

See here for another First World War site on Salisbury Plain, and here for more about Old Sarum.

Posted by gje at 08:29 AM | Comments (0)

May 23, 2008

ls command - favourite options

The ls command has so many options that it's confusing. Here are my personal favourite selection:

How to display the information
A long listing with ownerships, sizes, dates and permissions - ls -l
Names, with * / and @ to indicate executable, directory and link - ls -F

Which information to display
Information about directories not their content - ls -d
Include hidden files and directories - ls -a

The order in which it is displayed
Sorted by modification time - ls -t
Reverse the order - ls -r

Options in combination ...
    ls -lart
Full information, including hidden files - with the latest files that were change last.

Posted by gje at 06:14 AM | Comments (0)

May 22, 2008

Looking for files with certain characteristics (Linux / Unix)

I was about to use chown to change the ownership of an entire subdirectory tree that had been passed from one user to another. But - hang on - were there any files there that belonged to someone else for any reason? One way to find out - a find command:

find . -not -user savethetrain -print

"Find all the files in or below the current directory that do not belong to the savethetrain account"

Other options to find include:
-name - look by name
-uid - look by user id
-mtime - look by file modified time
-perms - look by permissions
-size - look by file size

Posted by gje at 06:47 AM | Comments (0)


Useful link: Linux training

May 21, 2008

Easy conversion - image formats, currencies and distances

If you're converting between distances (inches, feet, metres, centimetres, metres, furlongs or perches), between currecies (dollars, euros, pounds, roubles, lira) or between graphic file formats (.jpg, .png, .gif, .xbm, .tiff), chances are you'll have any one of a large number of different inputs to change to any one of a large number of different outputs. With - for example - 10 currencies, you'll have 100 (one hundred) possible conversions - and the code will get much bigger and less practical with each new currency added.

The solution is to choose an intermediate standard - for example, to convert the incoming currency to the Euro, then from the Euro to the target currency. That reduces your 100 down to 20 conversions .... and if you had 20 currencies, it would reduce 400 down to 40.

I've got an illustrated example of this techinque on our PHP Techniques Workshop - source code here and the code may be run here. It's also in use on our hotel currency page if guests with to pay in Euros or Dollars - that's based on a more general exchange rate convertor here.

Please consider with this technique that you need to be careful to avoid a loss of precision / information at the intermediate stage.

If your intermediate graphic file standard was .jpg ... it would be a poor choice. .jpg is a lossy standard which makes some compromises. Similarly, an 8 bit image standard would not be suitable.

If your exchange rate tables include commission or are not mid-rate, once again the double conversion I advocate above would lead to an incorrectly rounded result with some loss of data or accuracy. (The ECB tables we use ARE midrate, so there's not an issue!)

Posted by gje at 08:31 AM | Comments (0)

May 20, 2008

The tourists guide to Linux

When visitors come to this country for a touring holiday, they'll land at Gatwick and take in London, Stonehenge, Bath, Stratord-upon-Avon, York (pehaps) and Edinburgh. That will give them a flavour but none of the details (and of course they'll miss gems such as Melksham and Radstock). But they will get a flavour and want to come back

The Linux File system, even on a newly built system, has a very large number of files and directories ... but there are a few areas that you'll really want to be aware of. Let's have a quick look around, starting at the root.

Under /

/mnt - where other devices are mounted "casually"

/bin - "binary" - i.e. programs
Specifically - programs that are needed early in boot process

/etc - config files and info

/dev - devices

/home - user's home directories
Often mounted from a separate slice / partition
(slice is a p.c. alternative word to partition!)

/lib - "programmer's libraries"
BUT BE CAREFUL - they are dynamically loaded so you must keep 'em

/sbin "SYSTEM binary" - i.e. programs that only the admin needs
Specifically - programs that are needed early in boot process

/var - things that vary within the main system as it runs
(e.g. mail and print queues, system logs)

/usr - the main operating system - things that do NOT vary
This is HUGE. more to follow below!

/tmp - temporary file
A scratch area for anyone to use!

LETS GO DEEPER ;-)

In /usr ... you find a bit more of the same!

/usr/bin
/usr/sbin
/usr/etc
/usr/lib
/usr/tmp
Same as in root ... but not needed at early boot stage! (History - in the past, when discs were expensive, most of the OS was shared over the network on some installations and /usr was a mount point) and also ...

/usr/share
Things which don't change even between architectures - e.g. fonts, time zone definitions, manual pages ...

/usr/include
Programmer's include file

/usr/local
see further below!

LETS GO DEEPER ;-)

In /usr/local ...

... you find the things you have added locally to the operating system. That's great because you keep it all in one place and can back up from system "Trowbridge" and install on system "Chippenham" without having to do all the build work on Chippenham. You can also backup /usr/local, upgrade or reinstall the base OS, then restore the backup ... oh - and you can also save the need to back up the rest of /usr very often (and it's huge!) as it never changes!

/usr/local/bin
/usr/local/sbin
/usr/local/etc
/usr/local/lib
/usr/local/share
/usr/local/include

/usr/local/src
Sometime an "src" turns up for source code as do things like ...
/usr/local/apache2
/usr/local/tomcat
/usr/local/java
/usr/local/[other application name!]

Posted by gje at 04:14 PM | Comments (0)


Useful link: Linux training

May 19, 2008

Exchange Rates - PHP with your prices in your users currency

Would you like to tell your user what your product will cost in his local currency? What a great idea, except that exchange rates change!

The European Central Bank, though, makes a file of exchange rates betweenthe Euro and other currencies avaialble abnd publicly accessible, and you can pick this up in your PHP application - see source code example from our PHP Techniques Workshop

You can run that code here and use our include file that gives you the currency names from here

Posted by gje at 10:42 PM | Comments (0)


Useful link: PHP training

May 18, 2008

Using cookies and sessions to connect different URLs - PHP

One of the great beauties of cookies (and derived from that, of PHP sessions) is that they can be used across a series of pages on the same server - indeed we use cookies on this site to record our visitor's preferences for colour, font size, country and open source langauge(s) via our user preference page, and we then use those inputs to apply to all pages and styles on the site.

We're a simple session demonstration showing this in a module from our new PHP Techniques Workshop that we ran for the first time last week - the source code of the first page is here and the source of a second page is here.

Run the first page here and each time you do so you'll step through a limeric. Run the other page hereto report on the status of the first page from a different URL.

Practical uses of this? Anything from two applications which need to share data but are maintained by different teams to applications with multiple top level pages - and even captcha technology, where the session is used to link the graphics to the page. More about that latter here and try in here

Posted by gje at 09:42 PM | Comments (0)


Useful link: PHP training

May 17, 2008

Seeing how others do it - PHP training

We're always keeping an eye open for "how others do it" - we're quite happy to learn from others in the training business. But more often than not, we'll spot something and say "I would never do THAT" or "that wouldn't work for us". Here are some I found on a single site this morning.

"All of our courses are have a strong practical bias, with exercises that will help trainees grasp the essentials of what they're trying to learn, preparing them for the sorts of tasks they'll encounter when they start developing real-world applications. Therefore, as a matter of course, we will always cover essential aspects like security and best practices."

I agree with that. Completely. I could have written exactly the same thing about our courses, although I would probably have written learning rather than trying to learn as I know you WILL learn with us!

"Scheduled Courses ... if you are to be the only attendee on a particular day, it'll cost slightly more.".

Cheeky! If the company running the public course has only managed to sell one seat, they'll charge you slightly more - their definition of "slightly" being about 90 pounds

"The beginners PHP training course (30th June to 4th July) looks like it'll be going ahead."

Ah - so you can register for a course and they'll decide later whether it's worth their while to run it.

"if you want a ... cheap way of learning how to program ..."

My view is that quality is more important than price - yet I note that their daily rate if they've only managed to sell one seat is exactly the same as ours.

"Working with databases may be covered subject to delegate progress"

If you are held back because there are some slow people on the course, you'll miss out on this important subject.

"Each course will run from 10am to 4pm, with lunch provided."

That's a mighty short day - about five hours after breaks.

"Delegates have access to our training notes for a year after the course."

And after a year, tough!

"Generally this implies small groups (<10) at one time."

The word "generally" worries me, and my definition of small is a couple lower. The chances are that in a group of 10 there will be one or two slower ones, and (see above) subjects will be left out.

"If you would like to attend, phone or email us, so we can reserve your place"

What - no online booking system? When PHP is used as a shopping cart application ;-) ?


Here's my contrast: - About Well House Consultants PHP courses

At Well House Consultants, you can book a place on our public course and the booking will be your assurance that it WILL run - even if you're the only delegate - and at the good price you signed up to pay too. We will cover all subjects that are listed on the course description - the only exception being that we may skip a non-key subject which is not required by any delegate on the course. Delegates have access to the equipment and training room around the clock, the tutor is available from 8 a.m. to 6 p.m. at least, and the course runs from 9 a.m. to 5 p.m.

We provide printed training notes which are yours to keep for ever, and all of our examples are available for you to run (exception - scripts that illustrate security holes) and also copy and paste our source from our server - with no time limit. We limit the number of delegates on a public course to just eight so that there's plenty of time for each individual to cover his / her own specific questions and concerns. Each of our training modules is accompanied by practical exercises and additional examples, so that everyone gets a chance to practise what they have just learned during the course. There is plenty of optional material so that faster delegates can study, with the tutors help, to a greater depth until slower delegates have completed a minimum practical.

We welcome phone calls and emails as many delegate want to talk through their requirements and ensure they have the right course - but you're welcome to book online too - the choice is yours.

And yes, we provide lunch too.

Sound a bit like an advert? Perhaps I had better give you some URLs:
PHP Programming - 4 days
PHP Technique Workshop - 2 days
Object Orientation in PHP - 1 day
and tell you of our many years of experience, regularly revised notes, new laptops for each delegate to use during the course, associated accommodation for delegates who travel a distance, library of over 600 books ... and wicked real coffee machine!

Posted by gje at 09:43 AM | Comments (0)


Useful link: PHP training

Using a utility method to construct objects of different types - Python

When you call an object's constructor method, you'll be allocating memory to hold the information about that object and the method will return an instance variable - a reference with which you can later refer back to the object.

That's good as far as it goes - but there are times when you'll have data from which you want to construct an object but the object type is hidden within the data. For example, I could have a file of data record like
Estate Agent, 01380 724040, 2500
and
Graham, 600
where the lines with three comma separated fields are customers, and the lines with two comma separate fields are team members. And you want to construct two different types of object, depending on the data.

The first possible answer is to have your application program work out from each data line which particular object type you need to build for each piece of data but that is messy as it means that the data-specific code that should be common to all uses of the class has to migrate outside the class to the application, with serious issues about code duplication, reuse and maintainability.

The preferable alternative is for you to provide a utility method within(Java, etc) or in association with (Python, etc) the class coding which takes the data record and constructs either a "customer" or a "team member" record, and returns whichever instance variable type it finds to be appropriate.

I have an example of this principle in the Intermediate Objects in Python module from our Python Programming Course.

The "control case" - the example which shows the decision made in the application code without the utility method reads as follows:
operation.append(customer("Local Council","01225 776655",10000))
operation.append(customer("Estate Agent","01380 724040",2500))
operation.append(employee("Charlie",20))
operation.append(employee("Graham",600))

which is modified to read as follows when you use utility method calls:
operation.append(fing("Local Council, 01225 776655, 10000"))
operation.append(fing("Estate Agent, 01380 724040, 2500"))
operation.append(fing("Charlie, 20"))
operation.append(fing("Graham, 600"))

Which looks a subtle enough change when the data is a simple example, but becomes significant when the number of object types increases and the data is read from file.

Here's the code of the utility method, which will be stored and maintained with the classes:
def fing(about):
  bits = about.split(", ")
  if len(bits) == 3:
    return customer(bits[0],bits[1],int(bits[2]))
  return employee(bits[0],int(bits[1]))

See control example - source and example with utility method - source

Posted by gje at 06:50 AM | Comments (0)


Useful link: Python training

May 16, 2008

A lack of technical content

There were two emails in my inbox on Thursday, receive within a few minutes of each other> "Going mad here" says one as its subject line; "boom or bust - is the training industry on the verge of a recession" asks the other. The first was from Lisa, reporting that the enquiries and admin were flowing in quicker than she could deal with them (but then Thursday is our busiest day of the week!) and the second was a spam looking to sell us some service or other to keep our heads above the water. How little do they realise!

Looking back through my blog for this week, I note a lack of technical content - that's a bit odd really considering that I've given a Python course and a PHP course, both with plentiful examples written "on the fly" for receptive and questioning audiences that were both a little different form the norm - the sort of course that I love top give, but leaves me happily drained. Fear not, geeks amongst you - I have bothe Python and PHP items off to the side and the will follow. But for now, 6 p.m. on Friday, I'm going to clock off. It's been a long day - was it really over 12 hours ago that Lisa and I were down at Tesco in Trowbridge buying Loo brushes ...

Posted by gje at 05:46 PM | Comments (0)

May 15, 2008

Summer!

Summer came at the start of this week ... here are Monday, Tuesday and Wednesday pictures - at the Barge at Seend, with the Chamber of Commerce meeting in the garden at Well House Manor, and at lunch on the Python course on Wednesday when we couldn't resist grabbing a picnic and going and seeing the locks on the local canal.

Today the weather's cold and nsty. Looks like Summer's over!

Posted by gje at 06:07 PM | Comments (0)

May 13, 2008

Tektronix 4010 series / Python Tuples

The Tektronix Storage Tube was a cathode ray screen across which a beam of electrons could be swept directed, leaving a trail behind it rather like the plume behind an aircraft (technology note). The technology was developed further to allow the picture generated to be held on the screen for quite a long period, and with various electronics, an RS232 interface and a keyboard, the whole combination formed the major product range in Tek's IDG (Information Display Group) / IDD (Information Display Division) in the 1970s. In those days, fast computer memory was very expensive and products such as the 4014 gave the first practical graphics terminals, addressable to a very high 4000 x 3000 resolution.

One of the problems, though, was how to get rid of the image ... and it had to be done by erasing the entire image and recreating a new one - a "redraw". For some applications this was a big issue (comment here), but not for others where a series of pages being displayed one after another worked very well indeed.

I was reminded of this yesterday with a parallel being drawn between Python's Tuples (which have to be rebuilt from scratch if they need modification) and the storage tube, contrasting to Python's lists, which can be modified element by element like a modern raster scan device refreshed from memory 30 or 60 times a second. And like the storage tube, the tuple does have its ideal uses but (let's be frank!) we do need more dynamic devices and lists too.

I joined Tektronix in 1976 as the UK's Technical support specialist for these devices, and formed a fondness for them. Built like tanks, priced at a level where they weren't exactly a consumer product (over 10000 pounds for some terminals!) , they were an ideal solution for many interesting research and development projects ranging from the geothermal energy project through to nuclear research, defense, and the design of the stopping patterns for lifts!

Researching last night to find information about the old "tek" products online I found very little and found myself recalling numbers and models. So for no particular reason (other than that other Tektronix oldtimers may be here too!) I give you the list of some that I recall

The early models (superseded before I joined)
4002
4002A

The main product range

4010 11" Storage tube terminal
4010-1 11" Storage tube terminal with ability to read back screen for printed copy
4012 12" Storage tube, with readback for print
4013 12" Storage tube, with APL keyboard and readback for print
4014 19" storage rube terminal
4014-1 19" Storage tube terminal with ability to read back screen for printed copy
4015 19", APL keyboard
4015-1 19", APL keyboard, readback
4016 25" storage tube terminal

also the 4006 - a desktop version of the 4010 introduced a little later as electronic shrunk and got lower cost

The 4112 and 4114 were a next generation storage tube terminal with much enhanced electronics - didn't do very well in the market which had moved on with cheap memory for raster devices and PCs

The 4020 series were (hiss, hiss!) raster graphics terminals.
4023 early Alpha terminal
4024 and 4025 introduced after the hayday of the 4010 series (4024 alpha, 4025 graphics)
4027 Colour Raster Graphics - the first such product from Tektronix

Graphic Computers

4051 11" Screen with a basic interpreter, tape drive and motorola 6800 chip
4052 11" Screen with a basic interpreter, tape drive and bit slice processors - MUCH faster!
4054 19" Screen, basic, tape, bit slice.

The 4050 series was 8k up to 32k (4051) and 32k up to 54k (4052 and 4054) and you could add an 8" disc drive, model 4907.

4081 Fortran based 19" storage tube workstation.

Peripherals

4601, 4631, 4611 Printers - three generations - for copying storage tubes. The 4601 and 4631 were photographic and the 4611 was thermal

4632, 4634, 4612 Also printers - for video screens via a video out, NOT for the storage tubes

4662 A3 flatbed plotter
4663 A2 (? A1) flatbed plotter
4923 and 4924 Cartridge tape drives with RS232 (4923) and GPIB (IEEE 488) interfaces (4924)
4953 and 4954 Digitisers (graphics tablets) for use with 4010 series
4956 graphics tablet for use with 4050 series
4911 and 4912 - Paper Tape and Cassette tape

Software

These were the pieces of code that it was my role to get running on any computer from a Perkin Elmer to a PDP 11, via a Norsk Data box, a system running RSX11M and an ICL 1905.

Plot 10 TCS (Terminal Control System) Fortran Driver Routines
Plot 10 AGII (Advanced Graphing II) Additional Fortran routines to add graphing capability
Other Plot-10 software (utimities mainly) and Plot-50 software for the 4050 series

Where are YOU now? ... former colleagues such as Brock Wadsley, Allen Mathhews, George Wreford, Brian Burke, Steve Boniwell, John Thomspon, Lorraine Perrott, Colin Eddy, Alan Mawdsley, Peter Wilde, Val Hill, Bob Shaw, Jim Rew, Paula Lumby, Mike Crowley, Dave Brackenridge, Bob Wakefield, Bob Wainwright, Nigel Payne, Rodger Alexander, ...

Update - 16th July 2008. I've heard from David Browne - who took over in Scotland from Dave Brackenridge, and a whole host of other names who brought back memories on the "T&M" or Test and Measurement side, in addition to the IDD / IDG folks listed above (and he's reminded me of a name or two I have added!).

And does anyone have ... a copy of the source of TCS.

Posted by gje at 09:53 AM | Comments (0)


Useful link: Python training

May 12, 2008

Walking on The Wiltshire Downs

Summer is here! A lovely walk yesterday - on Roundway Hill Covert which is only about 6 miles from Melksham

The Marlborough Downs fall away at Roundway Hill, where a battle was fought (1643) in the English Civil War. The next hill across is known as "Olivers Castle" after Oliver Cromwell.

Behind the hill, the Marlborough Downs are a carpet of yellow at the moment.

Posted by gje at 12:27 PM | Comments (0)

May 11, 2008

Minehead Marauder

A lovely day out in Minehead yesterday ... an excursion by train from Westbury, organised by The Railway Children Charity, on a train loaned free of charge by First Great Western for the day, track access costs waived by Network Rail and by the West Somerset Railway, time given for free by all the staff concerned, sponsorship of the buffet and raffles by various people / companies - meant that all the money taken goes to the charity without an initial admin layer.

Minehead is a lovely town to choose as the destination for such an excursion, and I have returned with too many lovely pictures to do them all justice, and so many happy memories that I'm looking to record just a few of them here and on other pages before I hit this week's Python and PHP courses.

"Minehead Marauder" - ah - the name of the special train! I have posted some slightly more rail related pictures here

Posted by gje at 08:36 AM | Comments (0)

May 10, 2008

Pictures far apart

I'll tell you something about the following two pictures ... and that's that I'm the photographer in each case. The I'll ask you how far apart in distance and in time you think they are.

I have some pictures that look similar that are taken at similar times ... and then others where you say "they're almost the same" and they turn out to be far apart. I was looking at a picture of a crowded Pilning station the other day and thinking how similar it looked to a crowded Melksham taken last December.

But the two above look worlds apart, don't they?

They're not - they're about 100 yards apart, and the time interval between them is the time I took to walk that 100 yards. And if you wonder, it's not some European City that's been fought over and is now easily reached (daily, at an obscure hour, from Stansted) by Easyjet. It's Winchester!

Posted by gje at 02:15 AM | Comments (0)

May 09, 2008

Providing exceptional service - and carrying on doing so.

Nothing gives me greater please than to hear from a customer who writes "My line manager is quite keen for me to work on those web programming skills for various proposed, so we've already discussed it, and I don't think he'd be looking at me going elsewhere for training - what you do is so much better than everywhere else we've looked. It's just matter of what the training budget will allow!" And that's because we're achieving what we want to achieve - a product that's exceptionally suited to our client's needs.

Actually, it's been rather a good week for such things; a conversation with guests checking out this week - a group of three with two back next week and the third staying elsewhere because we were full. yes, he is wait listed. And as he explained as he checked out - "I'm the boss and I want my staff to be really comfortable when they're away from home; I'm used to a lot of different places" and with an assurance that the following booking - when we do have room - he'll be with us.

These two discussions related to the PHP Techniques Workshop and to hotel rooms at Well House Manor

But we have to be careful - very careful - not to rest on our laurels; it would be so natural and easy for us to let standards slip which is why the opportunity has been taken this week, with things a little quieter than normal, to catch up on a few things, adjust things to crisp them up before they are customer visible, and so on. Which has left me doing some very odd things like photographing bed settings to remind me (and everyone else) just how those duvets look in the duvet covers.

Posted by gje at 05:11 PM | Comments (0)

May 08, 2008

What to do if the Home Page is missing

The Web Server Administrator has two choices as to what he / she should do when a content provider doesn't supply a home page (index.html or similar) in a directory - either he can generate an error such as a 403 ("Forbidden") or 404 ("Not found"), or he can generate a directory listing, so that the web site visitor can access the content of the directory anyway.

Question - How does the web site admin turn directory listing on and off?

The Web Server configuration file is usually called httpd.conf, though were you find it varies depending on your operating system and configuration. For a web server installed on a Linux server, as configured on our Linux Web Server and Deploying Apache httpd and Tomcat courses, you'll be looking at /usr/local/apache2/conf.

Find the Options line for the directory in which the directory tree you're interesting in altering is located and add (or remove) Indexes. For example:

<Directory "/home/www/htdocs">
Options Indexes FollowSymLinks

allows web directories served from within /home/www/htdocs to display their contents, but

<Directory "/home/www/htdocs">
Options FollowSymLinks

will give anyone who tries a 400 series error.

Question - can the web develop control this too?

Yes, if given such permission by the Web Site Admin. The Web Site Admin need to allow overrides - if the httpd.conf file says

AllowOverride None

then the web developer has no control but it it says either of

AllowOverride Options

or
AllowOverride All

the it CAN be overridden by the web developer ... who would provide a file called .htaccess in the top level directory to which the automatic indeing should apply. The line in that file would be either

Options Indexes

to allow Indexes (only) or

Options +Indexes

To turn indexes on in addition to options inherited from the directory above.

There may be other things in the .htaccess file too, and these files can exist in multiple places on the web site - here's an example of mine that allows a directory listing and turn off any page rewrites too:

RewriteEngine Off
Options Indexes

and here's one which (by contrast) diverts all .html and .htm requests to a script with the undescriptive name 8.php, passing in the name of the page that was called up as a parameter.

RewriteEngine On
RewriteRule ^(.*)\.htm 8.php?pagename=index&sharename=$1&%{QUERY_STRING}


Question - is it a good idea to allow automatic indexes?

In general NO. If you leave out the home page from a directory by mistake, you'll be exposing yourself to anyone who visits your web site. When I go to a web site following a link to an obscure page on a domain I don't know, I often "research" the domain by cutting sections off the path. By disallowing, you stop people like me spying around, and perhaps finding backup files (e.g. copies of .php scripts that have a .bak extension) from which I could (but wouldn't!) break holes in your site.

But if you want to make a directory from which people can quickly and easily grab pictures and you're not too worried about it looking pretty, then in these LIMITED CIRCUMSTANCES it can be a good idea.

In fact I have turned in on for one of my directories today - here where you can some some record shots of this morning's breakfast setup, and of Devizes last night.


Note - than answers on this page apply to the Apache httpd web server, which is used to serve the majority of domains on the web. Options and configuration files differ for other servers.

Posted by gje at 05:01 PM | Comments (0)

Spring in Devizes

Yesterday evening, Lisa and I got a breath of fresh air in Devizes - a beautiful Spring evening with leaves on the trees where 2 weeks ago there were just twigs.

Moored at the wharf on the Kennet and Avon Canal was a cluster of modern narrowboats (and what a wonder it is that my modern camera let me shoot this right into the sun!

Looking out towards Honey Street and Pewsey, "Unity" is moored up. Now "Unity" is a famous name - a barge built in the days of commercial carrying, horse drawn, and operated by Robbins Lane and Pinnegar - a long established firm of carriers on the canal. She looks beautiful - but is she original, or a reproduction? And if she's original, just how much of the original boat remains? Questions that I don't know answers to!

Questioning "Unity"s credentials is rather like questioning our credentials to describe our breakfast as "Continental" when we're certainly not on the mainland of Europe, and our breakfast products are sourced locally where possible. Not only do local products help us to support local businesses, but they also cut down on greenhouse gases from Transport, and they give distant visitors a local taste rather than the standard fayre from a worldwide chain.

Our niche at Well House Manor, where we cater for business travelers to our computer courses and to other local businesses also allows us to provide products that would be out of the question at a more general hotel. The picture here shows the preparation of fruit which we allow guests to juice for themselves - bringing a true new meaning to FRESHLY squeezed orange juice - but it's something we couldn't entertain allowing if we were to accept bookings from children.

Posted by gje at 03:38 PM | Comments (0)

May 07, 2008

Kiss and Book

The headline on our story reads "We've got a New Online Booking System for our Open Source courses" ... but there's a story behind that headline.

We pride ourselves in our flexibility - the ability to treat each customer as an individual and offer him a solution to meet his or her needs. And that means that we're likely to ask each and every delegate booking a course with us a whole string of questions - some to establish that he or she is booking on the right course (not something too advanced or basic), whether she or he prefers to work at a Linux system, with a Mac, or with Windows Vista, whether a station pickup is required and if there are any special dietary requirements, and whether a hotel room is wanted - if so, bath or shower preferred? But our flexibility leads to the danger of a very complex online booking system!

"KISS" - "Keep it Simple, Stupid" ... a 4 letter acronym! A booking system needs to be simple and easy to use - and our new one is.

• On the first page, simply fill in the names of the delegates you want to send on each course, and if necessary check a box if they don't want a hotel room.

• On the second page, fill in the contact details of the person who's making the booking, and an order number.

• And on the third page, tell us how you want to pay. If that's by credit or debit card, the whole of the booking system is using a secure site so you can enter the details.

• The final page isn't a form - it's a confirmation. Yes, it's that easy! You'll get an automated email to let you know that your order is in the system.

You'll also get a nice note from Lisa, thanking you for your booking and dealing with many of the things that we're very flexible about - and it will be personalised. Book from outside the UK and Lisa will ask you whether you need directions from the airport, or a taxi. Book from one of our regular client companies, and she'll know how you PO system works .. or from a new company but requesting to pay on account, and she'll set that ball rolling.

Our conundrum of how to keep it straightforward, and yet provide the flexibility, isn't unique to us - in fact it's a common feature of most customer-aware businesses. When I book a train ticket and I'm offered (as I was the other day) 37 different fares for the same journey on the same train, I take an object lesson and say "please let this be a reminder to me to make sure that our system NEVER gets like that".

Go on - try it out ... why not find a course and book it today!

Posted by gje at 12:22 PM | Comments (0)

May 06, 2008

Changing a screen saver from a web page (PHP, Perl, OSX)

Here's a challenge. I want to change the screen saver on a mac mini, running OSX, from a browser anywhere in the world.

You may well ask why ... the screen of the mac mini is to be visible at Well House Manor where it will provide an information screen at the front door when it's not otherwise in use, and we want it to say things like "Sorry - no Vacancies" and "Welcome to the Chamber of Commerce"

Task achieved! Using PHP ... and Perl ... and Web2 technology. With a smattering of OSX!

Here's the control widget on our web page ... the page is in PHP and this particular widget is only displayed to staff members who are logged in - if you look at our Staff Resources Page you won't see it.

And the PHP that's run when you press the update button:

if ($_POST[door] == 12) { // Door Status changed
  $ds = $_POST[doorst];
  $fho = fopen("door.txt","w");
  fputs ($fho,stripslashes($ds)."\n");
  fclose ($fho); // Host and Port changed for security
  $done = file("http://zzz.wellho.net:8080/cgi-bin/dodo.pl?$ds");
  }

That piece of viewing software was called a controller on the Mac - which is running as a Web Server on a port enabled on our firewall, and redirected with NATS to the Mac Mini.

The Perl software dodo.pl looks like this:

#!/usr/bin/perl
print "content-type: text/html\n\n";
print "Changing Page";
`rm -rf /Users/lisaellis/FrontDoor`;
`cp -r /Users/lisaellis/$ENV{QUERY_STRING} /Users/lisaellis/FrontDoor`;
open (FH,"ps aux|");
while (<FH>) {
  if (/ScreenSaverEngine/) {
  @n = split;
  kill 9,$n[1];
  print "$n[1]<br>";
  }
}
sleep 1;
open (FH,'|/System/Library/Frameworks/ScreenSaver.framework/Versions'.
'/A/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine' );
close FH;
print "Changing Page";

And there's also a standalone version here if you want to download a copy for your own use.

You'll notice - typical use of PHP to front a web application, typical use of Perl as "glueware", and typical use of a Unix / Linux / OSX utility - in this case Mac's ScreenSaverEngine - to do the oddball job we needed.

Posted by gje at 05:49 PM | Comments (0)


Useful links: Perl training, PHP training

May 05, 2008

Lua - a powerful, up and coming scripting language

Lua is a powerful, lightweight scripting language. It combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. It is ideal for configuration, scripting, and rapid prototyping. Lua has been used in many industrial applications, with an emphasis on embedded systems and games, and indeed is currently the leading scripting language in games.

Here's a quick Download, build, install, test procedure for Lua

• Download from http://www.lua.org/ftp/ and save to disc. The file you choose is lua-5.1.3.tar.gz

• unpack tar file and build

tar xzf lua-5.1.3.tar.gz
cd lua-5.1.3
make linux

• Install (as root, into /usr/local)

su -
cd ~trainee/lua-5.1.3
make install
exit

• Test (as trainee, once again)

[trainee@holt ~]$ lua
Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print "hello world"
hello world
>
[trainee@holt ~]$

I've put a simple program - the next step beyond "Hello World" that shows some of the basics of the language here, and I would be delighted to spend a day or two going through the language with you ... (Keywords - Lua Courses / Training / Classes!)

Posted by gje at 10:57 AM | Comments (0)

May 04, 2008

Looking back through some photos

A Sunday afternoon - and a Bank Holiday one at that. I'm not sure why (suggestions of age and workload are probably along the right lines!) but I lay down just after lunchtime and dozed ... and, up again now, I am starting to do some low key stuff including labeling up some old pictures.

Photoshop is, of course, a marvelous piece of software for adding art and zest to a dull picture such as this one of a steam engine at Bressingham, taken just a fortnight ago. You may argue that the best place for this picture was the recycle bin - but, hey, I'm an amateur and an amateur will show you as many of his pictures as he possibly can. In fact - if you want to see the other ones that I have just been labeling up they are here

Another picture - from last Thursday, at Bibury. [more pictures of Bibury]. A certain timelessness, and an opportunity to take a rare picture - one that has no road, no vehicles, no signs of the 21st or even the 20th Century in it. Or so one might think, but I do wonder as to just how similar (or otherwise) this scene might have been in 1908 rather than 2008.

And finally, a pair of pictures that lead me to start thinking just how European we have become in Great Britain - with photographs on the steps in Norwich and in Rome.

Stop Press - Image search at http://www.wwuu.co.uk

Posted by gje at 04:41 PM | Comments (0)

To provide external links, or not?

My email this morning brought me a report of a broken link on our web site. Which I investigated, and found to be within a blog entry I had written a year ago, and linked to someone else's site over which I have no control.

I'm a great believer in providing a wide range of linked resources for our customers, and for other visitors to our web site. With links to sites that we manage (and there are lots of them, from our company overview microsite to Save the Train and from our PHP course pages through to image reuse details via the hotel and the First Great Western customer page), I know how likely (or otherwise) it is that the URLs will go away or change in the future (and can link accordingly), but with most external sites, the best I can do is make an educated guess!

This is not an exact science ... so what can I suggest?

a) That links to the major pages of well established organisations are likely to remain substantially correct, as are links to pages that one's encouraged to link to

b) That links by IP address, to obscure URLs especially within blogs, forums and wikis, are likely to go out of date

It's regrettable that there's no way that you can register any links you add and get the people to whom you've linked to let you know when they take pages away ... but the good ones will replace pages they remove with "301" redirects rather than just abandoning you - as I found this morning - to a "404" not found.

There's another option. You can write a spider / script that will visit all the pages to which you have provided links from time to time, and update you on their status. I have one of these somewhere in a dusty directory - written in Perl and using the LWP module, it trawled my own pages for external references, then visited each of those internal references in turn. But I admit - it's years since I've looked back at it and I need a month of Sundays to catch up on such things.

My current view is that external links within my main pages are very carefully selected, and will rarely go out of date - and I would typically know very quickly. External links on blog articles and on forum answers - well - the reasonable person may expect them to go out of date over time, especially if they're something like an advert for an event in July!


Posted by gje at 08:50 AM | Comments (0)

May 03, 2008

A short introduction to our courses

Hotel guests and other visitors are often interested in the Computer Training we do at Well House Manor, but hitherto our sales and marketing material really hasn't included a handy single sheet to explain. There's a good reason for this - with niche course such as ours, our main market hasn't been a local one (and that's why we have the hotel, after all!)

However - in response to a request at last Friday's Staff meeting, I have put together a page, suitable for printing out on a single sheet, that pulls together the training and the hotel business.

See what you think here

Posted by gje at 04:29 PM | Comments (0)

Gant charts - drawing them with a PHP script

I wrote a piece of project planning code - to generate GANT charts in PHP - when we were planning all the works on Well House Manor the best part of 2 years ago now. And although I did little more that provide a screen capture here on "The Horse's Mouth", one of our popular hits has turned out to be that page.

So I've looked through the code and realised that I can publish it, and the sample data - and indeed I can have a running copy on our web server. So here you are:

Example Gant chart (PHP)
Source code for Gant Chart program
Sample Data file

Techniques such as these are covered on our new PHP Techniques course

Posted by gje at 03:47 PM | Comments (0)


Useful link: PHP training

May 02, 2008

Amazing family members

Look around at your family, and you'll find some remarkable people - and look a little beyond your immediate group to slightly more distant relatives, and you'll find some people who amaze you.

We knew her as "Molly" but by birth she was Mary O'Loughlin White; Dad's cousin who we met from time to time, and who passed away towards the end of last month. "I haven't seen an obituary this long ..." said the priest who officiated at her funeral yesterday, and indeed she had been an accomplished journalist on the staff of the Witney Gazette, which he had in his hand.

But how many of us have (or will) learn to fly - to get a pilot's license - in our 50s? How many of us will fly with the RAF's heavy lift aircraft, and helicopters from other nations too, for famine relief in Ethiopia? And write "The Foodbirds" - a book on her experiences too.

Posted by gje at 08:53 AM | Comments (0)

May 01, 2008

Early May - a short chance to regroup and improve

Welcome to May. A mad busy April gives way to a quiet week next week - perhaps caused in a part by the fact that I've simply not had the time to go out marketing courses, and in part by the fact that it's another Bank Holiday week, and in part by the fact that whenever there's a major turbulence in the news or the economy, company's first reaction is to freeze expenditure on training until it blows over ... or until they realise that life is going on anyway. We saw it with regard to 9/11, we saw it when Iraq was invaded, and we have sensed a cut in training bookings in the current financial climate.

I predict that this quietness won't last; companies need to invest in their staff and, once they're sure where they're going the quieter times are an excellent opportunity to catch up on training and backroom work so that they can hit the ground running as things accelerate forward again. We're certainly taking that opportunity.

In a month, it will be two years since we took over Well House Manor and now is a good time for us to take stock and move onwards and upwards.

And on the training course side, with the ongoing popularity and growth of PHP we've added our PHP Techniques workshop to our regular PHP programming and OO Programming with PHP courses. PHP Techniques are critical to the success of a web based application, and they're what our new course covers. A user friendly, flexible, easily maintained site that hides the complexity from the customer and is secure is critical to a web campaign's success - but is often overlooked. This course will be a really good investment for anyone who knows the principles of PHP programming but wants tips, techniques and help as to how to make best use of them. But it is going to be a hard one for people to "sell" to their bosses ...

It's been brought home to me in the last few days just how effective an online application can be ... looking as an example at our Save the Train pledge page. Over 350 people - with over 90% of them from Wiltshire and the local area - have signed up on the page I wrote on Easter Monday, and I hear the "whisper" that the interest that it has generated has been noted in the high places that matter with regards to decisions on whether we'll see a more appropriate train service next year across Wiltshire, or a continuation of the current travesty.

* If you've not signed up to support the train yet, please click here

* If you've not booked for PHP Techniques on 15th / 16th May - please click here for a description - and if you book by email (graham@wellho.net) for that first course, we'll give you a £100.00 introductory discount.

Posted by gje at 08:40 AM | Comments (0)