« August 2004 | Main | October 2004 »
September 30, 2004
Get the strategy worked out and the tactics just fall into place.
I'm always one for finding a little time to think well ahead - it really can be just a little time, and thinking can be done in the shower, driving a car, or seated in a train. I find that if I've thought through the longer term strategy (what do I want to achieve / why are we doing this) then the short term tactics and decisions become easier and (I believe) better. And there's a huge reduction in reversed decisions, And (in a customer facing environment) there's far less chance of one employee saying something and another contradicting it. And all members of the team can be far more empowered to make decisions, leaving senior staff more time to play golf. ;-)
Except for the playing golf(!!) this is the approach we try to take at Well House Consultants and it does seem to work for us; we achieve a lot, it seems effectively, and we know where we're headed.
I have to admire the organisation at the company I'm at this week. They've grown in the semiconductor business from nothing to a billion-dollar company in 10 years, and they've weathered out the storms in their industry well. They have strategies which they impart to their staff, and these strategies are detailed on the wall of the conference room I'm in. "Enjoying our work", "very open communications", "integrity" and "teamwork" are the four I can read from where I'm sitting, and each goes on to list about half a dozen bullet points. It's NOT all about "be nice to everyone" - there are some difficult things there like "if you don't like what someone has done, tell them privately, politely and with respect and don't let it fester". Good strategy, and I'm sure it's lead to things being brought out into the open and dealt with quickly and easily.
Posted by gje at 06:16 AM
More about Graham Ellis of Well House ConsultantsSeptember 29, 2004
Object Oriented Programming in PHP
PHP started life as a language that was used for embedding simple executable content in a web page, and has grown rapidly into a fully fledged system - by release 4 (PHP4) it had become almost as flexible as as any other language for web based applications while retaining its ability to do simple web page inserts very easily. An Object Oriented model was introduced at PHP4, which sits on top of the other facilities of the language and, whilst it's good, has one or two quirks and limitations. Taking the background from which PHP came, the type of applications run, and the fact that OO was essentially bolted on the side, uptake / use of objects in PHP 4 has not been huge.
Our regular PHP course - a 4 day course introducing PHP for newcomers to the language - briefly mentions Object Orientation in PHP but goes no further - realistically, for most people the OO has been something that haven't wanted to use, and to learn both the principles and practise within a 4 day session in which you learn all the rest of PHP is a bit of a tall order.
With the release of PHP5, we have added a one day "Object Orientation in PHP" course to our schedule. It's for experienced existing PHP programmers who are probably NOT familiar with the principles of Object Orientation (or if they are, they've just learnt the theory and never used them fully in a practical application) and it covers:
a) The principles of Object Orientation
b) Object Orientation in PHP version 4
c) Object Orientation in PHP 5 (an extended syntax from PHP4)
d) A discussion of differences between the PHP4 and PHP5 model and how this effects code
If you're using PHP4, you'll find that some 80% to 85% of the material presented will be immediately relevant, and that the remaining section on PHP5 will both prepare you for the future and warn you of those aspects of OO in PHP 4 which might lead to the need for code modifications when you step up to PHP5
Posted by gje at 07:12 AM
Useful link: PHP training
September 28, 2004
A Taste or Ireland
I get a chance to train in Ireland 3 or 4 times a year, and it's a trip I enjoy. Ireland is like a sibling country to Great Britain; there's a close relationship and much is similar, and yet in some aspects there's a deep seated rivalry (not sure if that's the right word) that wouldn't be tolerated between two less close countries. I'll meet and enjoy working with people here who are proud to be Irish and really aren't keen on the English as a nation, and yet are so polite and such a delight as individuals and welcome someone English as a brother.
Public Transport in Dublin
The first new tram line (the Luas) opened two months ago, and already there have been three crashes blamed on car drivers not being used to the trams. As one of the accidents was a collision between two trams, I'm not entirely sure how it's the car driver's fault, but never mind.
The Second line opens today and I understand I can try it for free. As I'm staying at a hotel close to the Red Cow stop, I may go for a ride tomorrow evening. Let's wish it luck and hope it sorts out some of the transport issues here; the buses are on strike today (a wildcat strike due, I'm told, to a dispute about one man's pay when he didn't make it into work over the weekend).
Three or four years ago, there was a shortage of taxis in Dublin. They were strictly licensed and limited, and taxi plates were changing hands for tens of thousands of pounds. Vehicles we being run 24 hours a day, with different drivers working them in shifts. Times, I'm told, have changed. You can get taxi plates now for just a few thousand Euros, and I understand one well known tycoon has bought himself a set so that he can drive (or be driven) along the bus and taxi lanes.
Advert
I was watching the TV last night ... an advert with a young couple smooching on the back seat of a taxi. Clearly very much into each other. And he's thinking "please don't let them be up". They pull up outside his house, and as the couple get out of the taxi the upstairs light goes on. "Can we go to your place?" he asks his girlfriend. More smooching and now she's thinking "please don't let them be up". Guess what - as soon as the taxi door opens, on goes a light.
Amusing advert - slightly risqué for Ireland with its strict Catholic history. What were they advertising, though? Answer at the end of this article.
The Smoking Law
The "No smoking in public buildings" law that came in a few months ago has made a significant difference; the ferry that I travelled across on was a smoky pit as we left Liverpool (in spite of "No smoking" signs), but part of the wakeup call on the tannoy at 04:30 reminded us that we were now in Irish territorial waters and couldn't smoke inside. Breakfast was a pleasure.
The hotel bar has changed significantly too, and the restaurant there is much fresher and much busier. But ... walk out of the front door by reception, or walk out onto the deck of the ferry and you're now hit by a wall of fumes as you push your way through "smoker's corner".
Breakfast
My Perl course is starting at 9 each morning - 14 bright eyed and bushy tailed trainees, delightful people every one of them - and that's typical for this client site (and in general for our Dublin customers). And at a quarter to 10 we break - for breakfast! I admit it - I'm used to having my breakfast before I start training and the very first time this happened I was already full and really quite unable to do any justice to further sausage, bacon, eggs, tomato, or even hash browns and black pudding.
The couple were advertising Mortgages for one of the major Irish banks.
Posted by gje at 07:53 PM
September 27, 2004
Ireland
I'm in Ireland this week ... custom Perl course at the start of the week, Linux course to take me through to Friday. Excellent Ferry crossing over last night - I prefer the Liverpool boat as it give me a good long crossing on which I can get a cabin and sleep well, and it's reliable even in rough weather. Back on Saturday's 10 p.m. boat. I wondered how the P & O Staff were going to be with the press comment yesterday on P & O thinking of shedding 1000 staff, but they seemed fine. But then, the Irish crossings were thinned out earlier in the year with the Mostyn boat being taken off, so perhaps the thing has happened here already.
Posted by gje at 05:59 PM
September 26, 2004
Shell Script for CGI on the web
In the course of duty (providing simple "how-to" examples), I've come up with a short shell script in the Bourne again shell that allows a rudimentary lookup in a data file on a server running CGI. Nothing special about this, except it's a short example.
Run it from this link and try putting in data such as "Ca" and "DD" and "don". The source is also posted on our web site ... Enjoy!
Security note - you need to take extreme care with shell scripts that read from user form entrys and pass the values entered into commands like grep. I strongly recommend that you filter all inputs as I have done in the example using sed
Posted by gje at 07:45 AM
Almost like old times
It felt almost like old times yesterday - now that we're doing a LAMP deployment course (with the "L" standing for Linux if anyone's new to that term), customers have started to ask for the on site Linux element tailored / with a few additions. I found myself writing new material to cover Linux Utilities and Shell Programming and it was great fun - I think the saying is "water off a duck's back".
Linux has a huge array of useful utilities that are sometimes under-rated; what better way to filter out records on a one-off basis or to script some operating system issue? I started training on the Unix equivalents some 10 to 12 years ago, and although I've been standing up in front of classes teaching languages such as Perl and Java in more recent times, I always have a fondness for grep. It'll be good to overview them occasionally again, and it was a pleasure to write and put the utilities, shell programming and languages like Perl each in context with one another in our own new notes.
Posted by gje at 07:33 AM
September 25, 2004
Technical Open House
Lisa and Graham are planning a "Technical Open House" at our place in Melksham, Wiltshire from early afternoon on Saturday, 27th November [2004] through to early afternoon on Sunday, 28th November. We say "come as a student, leave as a friend" and many have; we'll do some update presentations on what's happening in the Open Source world on the Saturday afternoon and Sunday morning - we'll really be up to speed on this as we're scheduled to attend talks by Rasmus Lerdorf, Monty Widenius and Larry Wall next month, and we've recently written quite a bit of new material. I'd also be very happy to hear about Simple Machines, OS Commerce, Zope, Plone and other topics from those of you who, I know, are using them!
Talks / sessions will be kept fairly light and frothy and we'll make sure to include some Perl, some Python, some PHP and some MySQL. Based on past experience, there'll also be some Mac geek sessions, graphics art and web site subjects too such as the old perennials of search engine placement and easy site maintenance. Perhaps XML, XSLT, graphics ... we also have a library and lounge so that you can sit sessions out and chat if you wish. Some first ideas have already been posted to OpenTalk and I've opened a further thread there too that's not Perl-specific.
It's been suggested that on the Saturday evening, we descend on the local Indian restaurant for a curry (I'll alert them ahead of time so that we can be sure to get in), and I can recommend / check with local hotels / B&Bs if necessary. We're not in the accomodation business ourselves - simply not set up at all for overnighters.
Tea, coffee, cold drinks, snacks, computers (and connections for your own), internet access, pens, pads, "Of Course" newsletters all on hand and available free of charge. No charge for the the lectures either - this is a personal offer from Lisa and Graham and we're not looking for a penny, though you will need to pay travel and accommodation if you stay locally. Charlie the cat has promised to be available for stress relief (stroking) at least some of the time. If we descend on the Indian restaurant, we'll get the bill split evenly. Note - they don't serve alcohol but you're welcome to take your own or buy it from Kwiksave across the road.
Please:
* Email me (graham@wellho.net) if you're interested - even if it's just "provisional".
* Email me if I can persuade you to give anything from an informal 5 minute talk to an hour's lecture.
* Let me know what topics you're especially interested in - no promises, but I'll see what I can do
Useful Information / Links
Map of our location
Accommodation and other services in Melksham
Plenty of parking available, and we'll do a pickup run to Melksham station to meet the 12:57 arrival on Saturday (from Southampton, London connection leaves at 10:45 and Bristol connection at 11:58). Drop off for "the 13:43" on Sunday.
Posted by gje at 06:07 AM
September 24, 2004
Python is a fabulous language
I'm running a Python course this Wednesday-through-Friday and for students who have self-taught themselves just enough of a structural programming language, it's a big challenge and also an opening of a door through which a bright light shines. Even I'm still amazed by the cleanness of it all and the way the simple components of the language bolt together to produce short, clear, easy to follow (once you have some experience) code. Just look at this example that sets up and displays a list of lists
menu = [["Soup","Salad"],["Chicken","Beef","Vegetarian"],["Spotted Dick",\
"Trifle","Sticky Toffee","Cheese"]]
for course in menu:
for option in course:
print option,
print
I'm very familiar with saying "There's a function to do that" on our PHP courses ... and I'm delighted to be able to say "There's a method to do that" for Python too ;-)
Posted by gje at 06:35 AM
Useful link: Python training
September 23, 2004
Birth Notice
To Graham and Lisa a son, Virtual Person Ellis. Virtual is a Designer child, conceived with the assistance of P and O Irish Ferries' web site support team to assist his father in the booking of a cabin on a sickly web site. At the tender age of 4 days, he's booked to accompany his father on a crossing from Liverpool this coming Sunday evening, and his father is hoping he sleeps through.
There are some daft booking systems and prices around! "Invent an infant" was the advise given to me by the ferry operator as I wrestled with their web site on Tuesday. "That way, you get the booking you want, and the web discount. There's no charge for an under 4, but if I book it for you you won't get the web price".
Ah - Dublin again next week; I think I must have been running private Perl courses in Dublin for 7 or 8 years now, and I've also run the odd public (open enrolment) Perl course on behalf of a reseller who consolidated a number of requirements. I was quite chuffed when one of my students on that course commented "Oh good - glad it's you Graham. Heard a lot about you; you're known as Mr Perl at our place". Of course, the Irish have a great line in Blarney (and, yes, I have visited Blarney castle and kissed the Blarney Stone - it helps in my teaching), but the proof of the pudding is that I continue to get regular bookings from the employer of that student.
Posted by gje at 07:21 AM
September 22, 2004
MySQL - Pivot tables
If at all possible, you should normalise information in your database using Codd's principles of database normalisation. Basically, this means that you don't duplicate information, store information that can be recalculated based on other fields, or store more than one piece of information in a single cell of your table.
This is all well and good until you want to store (for example) information about a person with a list of his children; the solution is to use two tables, with one table being joined to the other when you select your data out of the database.
That's what we call a "one to many" mapping, and the situation becomes slightly more complex when it goes a stage further and we have a "many to many" mapping. In such a situation, the best solution is usually to provide a third table known as a pivot table.
The subject came up during yesterday's MySQL Course and I wrote an example that I've posted to the solutions centre here on this site. The example will appear on appropriate future courses, and the data is available for viewing on the module description page.
Posted by gje at 06:38 AM
Call Centres, selling, and a pause for thought
Have you noticed that telephone calls you "have to" make to renew a service are now being taken as an opportunity to sell to you? It happened to me just the other day when I called in to confirm receipt of a new credit card. "While we're waiting for the computer to authorise you, can I just ask you about your household cover ...." ... Yuk!!
I called to renew my car insurance yesterday - should have been a simple transaction but the gentleman on the other end of the phone was pushing a new product and wouldn't let me renew until I had heard him out in full. Clearly part of his job; I got a little sharp with him, but once the renewal was in place I commented "I'm sorry I got a little sharp - it's nothing personal but I get so many people trying to sell me things. I wouldn't want your job". His reply? "You're lucky that you have the choice". Indeed I am, and I shouldn't forget that; he's doing what he's told in a call centre in New Delhi as the only way to keep himself and his family.
Posted by gje at 06:25 AM
September 21, 2004
Posting 1000 letters!
We do a big mailing of over 1000 newsletters twice a year, and we never know quite how the local Post Office is going to receive us when we walk in pulling a trolley stacked with 120Kgs of franked mail. Get a "jobsworth" on the counter, and they'll insist that you pass over the envelopes in bunches of about 50 because "there's a limit on the weight we're allowed to lift"; get someone more helpful and they'll contact their sorting colleagues round the back and let you transfer the mailing directly into one of their trolleys or even (if your timing is right) put it straight on the next van to the sorting office.
Posted by gje at 08:50 AM
September 20, 2004
Dress Code
I was told during last week's course that I'm much more approachable that I look in my picture and I'm delighted with that, though at the same time wondering if I should change the picture concerned to one that's a little less formal.
I'm following a conversation on a list server concerning dress for an event I'll be attending for a week next month, on which there are two "formal evenings". The attendees seem split between those who enjoy dressing up formally and those who don't enjoy it (some of whom are so "anti" that they're not going to attend those two evenings). You can put me into the "anti" group, but I'll be dressing up and attending on those two evenings; it's all a part of the job.
Occasionally, we're asked about dress code for our courses and we say "smart casual" - in fact, we've just added a couple of sentences to our joining instructions to this effect. However - the real answer is "wear whatever you feel comfortable learning in". There are trainees who are suited all day in their work, and feel that they can't work in what are leisure clothes to them, and that's fine. And we have some quite extraordinary dressers - usually people who turn out to be brimming with confidence to carry it off, and fabulous people to have along. Ah - we have a fabulous clientèle. I had better go get read for today's MySQL course.
Posted by gje at 06:45 AM
September 19, 2004
Evening classes to learn PHP
I've often felt that the best way to learn a subject such as PHP would be to take half a day of training per week over a period of perhaps 8 to 10 weeks. Practicals exercises to try between each week's session, with the tutor starting each session / lecture with a review of issues that trainee have raised by email from the previous one. However, I've see some logistical problems with this approach:
a) Trainees come from far and wide and wouldn't wish to travel every week
b) Trainees might not have the commitment to do the practicals during the week, and would have forgotten one lesson by the next
c) Trainees might not be able to make every one of the (say) 10 sessions which would mean they would miss a vital subject
I'm delighted, then, to see my old University (City University) offering a
10 week evening class in PHP starting on 5th October, and again next Spring. It's pretty much in central London, so it's likely that they can overcome the travel problem for anyone who's working in the City, and if anyone's committed enough to stop in London from 18:30 to 20:30, then they'll probably be committed enough to do the practicals too ;-).
Cost wise, it looks good too - around £14 per hours compared to the £29 per hour that we charge for a place on 4 day intensive public PHP course. Our products, markets and costs are very different, and I'm quite happy to post up information on City's courses here. Our real competition at Well House Consultants on PHP training is the Central London course that costs £1375 (that's about £41 per hour) ... but even that's not really a competitor. I've lost count of the number of times that this expensive course has been cancelled at the last minute and we've had people contact us in some panic as they've got to learn PHP within a few weeks as part of their employment.
Posted by gje at 03:09 PM
Useful link: PHP training
PHP and natural sorting
If you sort (8, 9, 10, 11, 12), how do you want them to be output? "In the order you've just listed, Graham", you'll probably say. But if they're strings and you sort them, then you'll get the order 10, 11, 12, 8, 9 output if you just use a default sort, because the character "1" comes before the character "8" in the alphabet.
Using PHP, you could write your own sort routine (using usort) ... but there's a better way - a function called "natsort". Remember the PHP rule of thumb - if you think surely someone's done that before then often the solution will be there's a function to do that.
Here's an example of the output from an illustrative program:
Original
0 .. 12 Drummers Drumming
1 .. 7 Swans a'Swimming
2 .. 11 Pipers Piping
3 .. 9 Ladies Dancing
4 .. 10 Lords a'Leaping
5 .. 8 Maid a'Milking
Default Sort
0 .. 10 Lords a'Leaping
1 .. 11 Pipers Piping
2 .. 12 Drummers Drumming
3 .. 7 Swans a'Swimming
4 .. 8 Maid a'Milking
5 .. 9 Ladies Dancing
Numeric sort
0 .. 7
1 .. 8
2 .. 9
3 .. 10
4 .. 11
5 .. 12
Natural Sort
1 .. 7 Swans a'Swimming
5 .. 8 Maid a'Milking
3 .. 9 Ladies Dancing
4 .. 10 Lords a'Leaping
2 .. 11 Pipers Piping
0 .. 12 Drummers Drumming
This program can be run from here and you can view the source code here.
Posted by gje at 10:01 AM
Useful link: PHP training
September 18, 2004
Drive the drive
Our training centre is in an old Georgian Lodging House on the outskirts of Melksham, Wiltshire. Well set back from the road, long driveway. Plenty of parking, and quiet. Just a bit of a nuisance when we get a major delivery, as our historic gates have just 9'4" clearance ...
Yesterday, a big articulates lorry draws up in the road, and driver walks up. Our Autumn newsletter has been printed, and he can't get in. It's one of those rare occasions when we drive to the end of our own drive ... tranship the newsletters off the pallette on the lorry into the car ... so that the newsletters finally arrive.
A short message only today; we're having a "stuffing party".
Posted by gje at 08:01 AM
September 17, 2004
International awareness
I never cease to be amazed by how international the world has become - with travel from country to country being the norm. "If it's Tuesday, it must be Belgium". Yet at the same time, there are laggards and at times the USA seems to have more than it fair share of these. Perhaps that's just because the USA is such a large country that people can travel thousands of miles and still not be "international".
Three cases arose yesterday ... some problems in completing a web form (on the site of an international shipper!) which wouldn't accept our UK phone number ... questions about which state "Ireland" is in ... and a nearly-completed course order which turned out to be "well over my budget. I'm not ready to spend all this money now", all the more amazing because our site very carefully adds in prices in US Dollars when visitors arrive from a USA based IP address.
OK - grouch over. My wife's from the USA, my daughter-in-law is from South Africa. We have friends and customers from all over the world and we love it! I'll be in England, Wales and Ireland later this month, the same three countries plus Italy, Turkey and a couple of others in October.
Posted by gje at 07:57 AM
September 16, 2004
Gym and swimming - Melksham Blue Pool
When you're away from home on a training course, why should you have to take a break from your fitness regime if you're that way inclined? Our training centre is less that a mile from the Melksham Blue Pool, open from 7 in the morning into the evening. We work closely in conjunction with them to ensure them to ensure that their facilities are available to trainees who in Melksham for just a few days. Please email Lisa (or ask when you're here) for details.
Melksham is set in the heart of beautiful countryside. If the treadmill and pool are a bit too energetic for you, we've got a network of footpaths nearby (one passes right beside our centre) and we're about a mile from the Kennet and Avon canal with a lovely towpath all the way to "The Barge" and "The Three Magpies".
Bring you walking shoes, gym kit and trunks with you - see joining instructions
Posted by gje at 03:52 PM
Current cost in your local currency
If you're selling internationally on line, it's a nice gesture to your customers to tell them roughly what things cost in their local currency, before you charge their credit card in pounds, dollars, euros, or whatever currency you use yourself. Tables of current exchange rates are easy enough to find, but they change all the time and your site can rapidly become misleading.
The European Central Bank provides a daily set of conversion rates to and from the Euro on their web site, and those are mid-rates so that you can easily convert from (say) pounds to Euros, then on to Rand, fairly accurately. The data is available as an XML feed, and can be very easily picked up in a PHP web page:
$stuff = file("http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml");
We have a sample PHP script in operation on our web site
PHP's ability to read data from a URL as easily as it can read data from a file has a very wide range of other uses too, but you need to take care of issues such as copyright, robot exclusion and the traffic you'll generate before you write such pages. In the case of the ECB page, the page is stated to be publicly available information, and live scripts that are heavily used should be written to cache a copy of the data locally from your script as it only changes once every 24 hours.
Posted by gje at 07:11 AM
September 15, 2004
Business is the predominant user of Tomcat, Perl and Tcl
I started using Open Source languages as a hobby about 10 years ago, but I became involved in them with my work ("Graham ... you know some Perl, don't you? .....") and these days I'm fortunate to earn my living from what was just a hobby.
Is the predominant use of Open Source languages the hobby / personal user, or the business user? How could we possibly find any statistics / measures / indicators?
I've noticed a consistent pattern in our web logs from this site - our traffic is double on a Monday - to - Friday compared to our Saturday and Sunday traffic; I can read an "ls" report of daily log files like a calendar to tell me days of the week. And the difference is even more significant as we have a noticeable "crawler" traffic from search engines indexing our pages which averages out to a constant 7-day-a-week, 24-hour-a-day spread.
Search engine terms give a further clue - that's words entered into known search engines that bring visitors to our site:
For Tomcat for every visitor on Sunday, we got 2.94 on Monday
For Perl, the ratio is 1 : 2.73
For Tcl, it is 2.63
and those are pretty significant figures; I've looked around at some of our other subjects too - and the ratio for PHP is 2.09, for Java is 2.05, and for Python is 1.88; slightly lower figures but still significant.
Overall sample size for the detailed statistics was 15000 search terms entered on Sunday and Monday last for hits on our www.wellho.net web site.
Posted by gje at 04:45 AM
Useful links: Perl training, Tcl training
September 14, 2004
PHP - onwards and upwards
I could never have imagined when I wrote in the Spring, 2001 edition of "Of Course" "Just because we don't offer courses in PHP or Python or MySQL.... doesn't mean we can't help" ... where that comment would lead.
This week, I'm running our two-monthly PHP Programming course - today will be the first day and it will continue on to Friday. Yesterday was available as a Technology for PHP day for potential trainees who aren't up to speed on underlying technologies such as web site structure, HTML, and the principles of programming and database design, and we also offer an object oriented programming in PHP advanced day. Next week, I'm running a MySQL course on Monday and Tuesday, and Python Programming for the rest of the week.
PHP, Python, and MySQL (not forgetting Perl, the language in which this appliaction is written) are fabulous technologies - I can't imagine where we (or this web site) would be without them - they provide for fast, efficient application development that means that one can achieve in a day what would have taken a week with previous generation languages - and a month two generations ago. And I expect that they'll get to be more efficient yet - certainly PHP has come on since the days of PHP 4.0.x, which was out just as I started to use the language ... and I'm off on a Geek Cruise next month to learn further of the current trends and developments in Perl, in MySQL ... and also to attend what promises to be a fascinating lecture on PHP applications by the originator.
Posted by gje at 06:38 AM
Useful link: PHP training
September 13, 2004
Effective fundraising
The charity evening, arranged by four local restaurants in aid of Bangladeshi flood relief last night, seemed a great success; from a quick count up around the room, I'm estimating that several thousand pounds were raised, which isn't at all bad for a wet Sunday evening in Melksham. Good to see the owners of the Refa, the Sultan, the Melksham Tandoori and the Spice of Bengal (Calne) working together when they're competitors in their day-to-day businesses. All food given free, as was the entertainment / bands.
Lisa and I came away saying - "Yes, that's how it should be done"; I for one have spent long days in the past running jumble sales for local charities, raising perhaps a hundred pound of profit for long hours before hand and on the day, but last night they had it right. Well done.
See Melksham Dining for contact information for restaurants and takeaways in Melksham.
As a separate subject - I do have concerns about money given for charity actually reaching the people it's intended for rather that running a vast machine along the way. However - that is not to decry last night's magnificent effort which was excellent and where care was taken to translate the amounts given into the effect it would have on the ground.
Posted by gje at 07:43 AM
September 12, 2004
Near and far security
If you wanted to prevent Joe Bloggs from attacking John Smith, you would have two choices. You could restrain Joe Bloggs, or you could protect John Smith. In other words, you could apply the security near to John Smith, or far from him. Trying to apply the security halfway would be ineffective - if Joe lived in Southampton and John in Northampton, then no amount of security in the Oxford area (on the direct A34 road between the two towns) would prevent Joe catching the train into London and our again and circumventing all your expensive efforts in Oxford.
I'm reminded of these near and far security issues when looking at Internet, operating system and Web security. Systems provided have a choice between applying security as tight as possible around each user and offering a minimum of facilities, which is the historic norm, or providing protection at the individual resources which is the way that it's always been done in Unix operating systems and its variants.
I was looking at our web logs this morning, and I saw some 3000 hits from a .ac.uk domain in the last week; upon further examination, they all came within a half hour period on Friday, with some user running the "wget" utility to copy our website onto his local machine at the rate of 2 pages per second and downloading 43kbytes per second for that whole period. On a lower-specification web site, the effect could have been a denial of service for other potential visitors but as far as we're concerned it something to note, to be aware of, and to let go. One of the major purposes of a web site such as ours is to provide information on our products and a service for potential customers, and we take the approach of not vetting everyone before they have access. In any case - I'm inclined to think that this particular download was a result of someone not understanding the wget utility rather than any malicious intent; it's possible that it's someone who's interested in competing with our courses - but, hey, I'm flattered if that's the case ;-)
We work with a network of good friends and contacts who we want to welcome to our site, and we don't want to let incidents like this damage the access for the majority - so we're much more in favour of "far" security rather than "near", but with a few checks and protections in place. The same thing applies to the Opentalk forum and comments here on "The Horse's Mouth" - contributions are encouraged and we prefer not to have to restrict. Various tools we have in place do mean that we're likely to spot any issues, and a further few custom lines of Perl (using command line options and topicalisation) will quickly allow us to extend our analysis tools to look at specific cases. Here's what I wrote a short while back:
#!/usr/bin/perl -naif (/xx.ac.uk/) {
$amount += $F[9];
$lines ++;
}END {
print "$lines accesses totalling $amount bytes\n";
}
and it tells me
earth-wind-and-fire:~/netlogs grahamellis$ ./sumbytes ac_20040910 3107 accesses totalling 78675086 bytes earth-wind-and-fire:~/netlogs grahamellis$
Posted by gje at 10:24 AM
September 11, 2004
CGI v mod_perl
Just debunking a couple of myths today ...
CGI (Common Gateway Interface) scripts are run on a web server computer under the control of a piece of web server software (typically Apache httpd), but as separate processes. This means that each time a script is called up, it has to be translated from the script language into something that can be run through compilers / interpreters depending on the language involved. Also a separate process is started on each invocation. This is all very well and good for a script that's not run very often, but if you've got a script that you expect to be run many times per minute, the constant recompiling may have a significant effect on resources.
mod_perl is the Perl interpreter built into the Apache httpd server. No separate process to be started, and no re-compile each time a server side script is run, so much more efficient. Once a script has been run, it stays as part of the httpd web server.
As the name kinda-implies, mod_perl scripts must be in Perl whereas CGI scripts can be in any scripting language (yes, the is a mod_python too). Since mod_perl scripts are not recompiled and re-initialised, you should ensure that all variables in them are specifically initialised rather than being assumed to be empty / zero, which is an assumption you can make with a Perl CGI script. However - a word of caution; you are likely to be running multiple processes as part of httpd each of which will have its own copy of your scripts, so you cannot assume that a variable left after one run of a mod_perl script will retain that value when the next person calls it up. More details covered, of course, on our Perl on the Web course.
Posted by gje at 11:41 AM
Useful link: Perl training
September 10, 2004
Serious subject
I know it's a serious subject but it seems just too hard for the media to talk about obesity at the moment without dropping into dreadful puns. Is it just me that notices "There's been too much growth in obesity" and "there are big questions to answer" and many more sound bites like this?
Posted by gje at 05:28 AM
September 09, 2004
Hash of lists in Perl
Here's a short program that reads data into a hash of lists, sorts the keys and displays output data - a simple Perl program showing powerful capabilities of the language.
while () {
my ($name,@temporary) = split;
$want{$name} = \@temporary;
}
foreach $person (sort keys %want) {
print $person," ",$want{$person}[0]," ",$#{$want{$person}}+1,"\n";
}
__DATA__
antonia Perl XML PHP Tcl/Tk MySQL
ethel MySQL Perl Tcl/Tk ASP
iris Perl MySQL Java Tcl/Tk
olivia MySQL Python ASP PHP
uva MySQL Perl Java PHP
adam Tcl/Tk Perl Python MySQL
ed Ruby Perl Java PHP
ivan Ruby Java Perl Tcl/Tk MySQL
orpheus MySQL Ruby Tcl/Tk XML
ulsyees Java PHP Perl
Results:
adam Tcl/Tk 4 antonia Perl 5 ed Ruby 4 ethel MySQL 4 iris Perl 4 ivan Ruby 5 olivia MySQL 4 orpheus MySQL 4 ulsyees Java 3 uva MySQL 4
A little demo I wrote today while talking about more complex data structures.
Things always turn out so easy in Perl!
Posted by gje at 06:02 PM
Useful link: Perl training
September 08, 2004
Do languages change?
How fast do computer languages change? Not as quickly as you might expect - and yet we're regularly updating our courses. This is because the underlying bedrock (languages) don't change very much, but the functions / libraries / classes / technologies that use them do change, and the applications that use the libraries and technologies change even faster. Many of the examples from the first Perl course that I taught will still work, but the style is dated and there are better ways and technologies. In those days, XML and XSLT were unheard of, MySQL was very new and a specialist interest, and the Web was in its infancy.
I was talking about this yesterday, and drew this parallel ...
A programming language is like a railway track. It's specified and laid out and survives broadly unaltered over hundreds of years. Small improvements in alignment and quality are made and there's considerable strengthening for progressing requirements, but basically it's still the same track.
Functions / libraries / classes / technologies are rather like the trains that run on the tracks. Trains have a lifespan of perhaps 25 to 40 years - they have teething troubles in the early days ("the wrong sort of snow") but then give many years of sterling service, to be replaced with new at the end of their life cycle. You can see a good example of how this happened in programming terms with libraries such as the Java Utility classes where the Java 1.0 classes were largely deprecated in favour of new libraries prior to the release of Java2.
Finally, applications are more transient again - they change rather like the fittings and fixtures in the train. Travelling on (the same) trains over the past 20 years, I've seen second class become standard class, the addition of hammers to break the windows to escape in an emergency, the advent of quiet carriages and a family carriage and more.
Posted by gje at 07:24 AM
September 07, 2004
A Thousand and four words

Posted by gje at 06:37 AM
September 06, 2004
Take the train to training
When we moved to Melksham, we noted the railway station as a "nice to have" but limited facility. It had been closed from 19th April 1966 to 13th May 1985, at which date a single train each Monday to Friday had been restored, passing through towards Swindon in the morning and returning in the evening.
Then, on 21st May 2001, the service was increased to 5 trains each way each weekday, with slightly fewer trains at the weekend. Good connections at Westbury and Swindon combine to give us 7 or 8 daily services to London (with one change), and in the three years since the local train has become very much a part of our infrastructure.
Customers can leave Paddington on the 07:45 London to Penzance train, and change at Swindon arriving at Melksham at 09:12. We're expecting such an arrival for today's Perl course, and another customer arrived by train last night; it's not untypical for a half of our visitors to arrive at the station. By prior arrangement, we'll pick them up and bring them to the training centre, and at the end of the course, drop them back off for the 17:07 or 18:18 departures.
As you can imagine, I can be found down at the station on Sunday evenings, Monday Mornings, Friday afternoons and other times, and it's great to see how in the last three years the traffic has increased. The single coach train can still cope well, but gone are the days just after the service was increased when I would be meeting the only passenger. Mind - I don't quite need our "Well House Consultants" meet and greet board on most occasions but I take it along to re-assure our customers that, yes, you *have* got off at the right place.
Posted by gje at 08:09 AM
September 05, 2004
A Change is as good as a rest
Well - so they say but having just driven 3 hours behind slow traffic, I do wonder. Blog service resumes tomorrow!
Posted by gje at 10:29 PM
September 03, 2004
An update for old friends
From time to time, old friends from the days that I was presenting courses for First Alternative get in touch with us - we're always delighted to hear. It seems a long time since I was training on Solaris in Harwell with Mick Hosegood and Peter Burton, and a lot of water has passed under the bridge since then.
In 1996, I wrote the first Well House Consultants course - on Perl - after repeated requests from customers. The course was fronted by First Alternative as at the time they had their own facilities and we didn't. It was a huge success and Java courses followed about a year later. Quite quickly, I found myself only presenting my own courses and Mick found that a very high proportion of his business was being brought in by a contract trainer - a situation that he wasn't prepared to have carry on.
So - in summer, 2000, we took on the sales and marketing of our own courses, and all invoicing and collection tasks too, bought our own equipment, and opened our our training centre in Melksham, Wiltshire. We were fabulously placed to provide courses that the customers wanted - we had learnt in the business, Lisa and I were (and remain) enthusiastic.
But any business should look forward - using history only as a learning tool to help us know how to do better in the future. So where are we now?
- Our courses cover Perl, PHP, Python, MySQL and Tcl/Tk with some Linux and java topics - but we can't cover every aspect of those huge subjects
- We run regular public courses at our own training centre in Melksham, Wiltshire, UK
- Private courses are tailored to customer needs and run on site at their offices - mostly in the UK but also elsewhere in Europe and even further afield.
- Prices are good, facilitates superb, trainers fully trained, class sizes limited to a sensible maximum and we have policies and systems that we think make us "a step above".
- We research and write all our own materials (samples online) and our "Of Course" newsletter
Posted by gje at 06:26 AM
Security and Safety
"We no longer offer that facility for [security / safety] reasons".
How many times have I been told or read that in the last few years? Am I getting to be too much of a cynic to think that the truth is more often along the lines of "it doesn't make commercial sense to provide that any more" or "it's too much bother for us and we can get away without it". Don't get me wrong - safety and security are vital factors and I wouldn't advocate any service provider decision without taking them properly into account but I do feel they're "milked" at times; people simply won't challenge what they're told in this area, since they might appear to be unpatriotic or careless.
On line, security issues have shaped the whole way we work and many of the exciting possibilities of new technologies are muted or lost due to them; I'm not suggesting that this is all excuses, by the way, although there are a few excuses around just as the real life incident that got me going on the subject. I remember the days when I didn't need email filters. When firewalls were un-necessary. When I would have been able to allow unmoderated comments here. And I shed a tear at all the possibilities that have been stillborn too.
Even in our own training centre, we have certain security procedures - we can't be immune from them, and occasionally they'll limit legitimate use. I would prefer us NOT to need an alarm system linked to a monitoring station, and I would like to be able to allow trainees to email example files off their training machines. In each case, though, we ensure that we have good alternatives in place that mean that our students are not inconvenienced, and perhaps get something even better. Our training centre is available and staffed from 8 a.m. to 6 p.m. daily - usually much later - and we offer a whole raft of after course resources including an automatic email to the trainees of all their coursework.
Posted by gje at 05:59 AM
September 02, 2004
Tesco at 5
Great time in the morning to go shopping! It's just after 6 and I'm back and getting ready for the day - buffet lunch for the Linux course keeping cool, emails, forums to check, "Horse" to write and I'll still be ready for students from 8.
Posted by gje at 06:15 AM
September 01, 2004
Autumn arrives right on time
I'm sure it's a nonsense to suggest that it rains more on weekend days than on weekdays, and yet people do suggest that. I can remember hot and sunny weeks cooped up in an office followed by miserable weekends, but put them down as "one of those things" that I have remembered when I probably forgot another wet week that turned into a lovely weekend.
What set me off on these thoughts? It's the first day of September today and I woke up to an Autumnal mist - looking out of the training centre window, I can only just see the trees at tour front entrance; indeed, their bases are completely swathed in white, with the tops popping out of the ground-cloud as it thins as it rises - vague ghostly shadows.
Posted by gje at 07:04 AM