« April 2006 | Main | June 2006 »

May 31, 2006

The eye

Today is the eye of the storm. And I feel a strange calm. In Saudi Arabia, I run the last day of Perl training that I'm giving here and start for home. In the UK, we complete on the purchase of Well House Manor.

Posted by gje at 04:33 AM | Comments (4)


Related topics: via article database
More about Graham Ellis of Well House Consultants

May 30, 2006

(Perl) Callbacks - what are they?

In most programming applications, you'll write code that calls system functions or subroutines - for example, you'll write a program that reads data from a file (via a system call), splits the data into an array (perhaps via a further system call), and prints it out (through system calls).

On a few occasions - for example, when writing a GUI event handler or a use defined sort routine, you'll break the pattern. You'll call a system routine which will itself call back to a named piece of code that you have written. This concept isn't always easy for newcomers to grasp, and on yesterday's Perl course I wrote an extra training example to show what's really going on ...

In Perl, you sort using the sort function. Easy. But if you want to sort in a different way (perhaps sorting by the length of a string rather than alphabetically), you pass sort the name of a function that you've written which takes two input variables - globals $a and $b - and returns a negative, zero, or positive result if $a is less than, equal to, or greater than $b. In other words, the sort function that's Perl provided does the difficult bit of managing what needs to be compared with what, swapping items over as necessary, and minimising the number of comparisons you make; you're left with writing a simple piece of code that just ranks two records against each other.

Like to see what I mean?

I wrote a demo - a piece of code in Perl that sorts a list of hash keys based on the number of characters in the value held in the hash. The sort call was:
@names = sort bylength (keys(%hols));

I then re-wrote that line as:
@names = wingit ("bylength",keys(%hols));
and provided an extra piece of code called wingit that provided alternative functionality to Perl's sort, and calls bylength internally. Of course, this is purely illustrative and Perl's built-in sort will be much more efficient.

Both pieces of code work - full source code here.

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


Related topics: via article database

Useful link: Perl training

May 29, 2006

Coloured text in a terminal from Perl

If you're looking to do something in Perl and the back of your mind tells you that, surely, someone's done this before then there are two things to note:
• Someone probably HAS and
• It's probably available on the CPAN or as a built in module.

Thus when I was asked the question "How do I get coloured text in a terminal window in Perl" last week, I know there was going to be a module out there - and there is - Term::ANSIColor.

As ever, there's an excellent set of reference notes on th CPAN, but no complete cut-and-paste-this sample for you to try out, so I've written one and it's available here.

Posted by gje at 02:28 PM | Comments (0)


Related topics: via article database

Useful link: Perl training

May 28, 2006

New Tape Librarian

Even before I started University way back in the 1970s, I was working as a tape librarian - a library of some 60,000 tapes of data recorded by boats and land crews undertaking seismic oil exploration - setting off explosives or using a strong vibrator to shake the earth and record echos from which the strata deep below could be mapped. A fascinating technology.

Yesterday afternoon, I was speaking with my modern day counterpart at Saudi Aramco, who is responsible for about 10 times the number of "field tapes" we had back in those days - and the tape's capacity has risen by several orders of magnitude too. But there's still the same issue of knowing where a tape is if needed, of keeping backup copies off site, and of managing the whereabouts of each tape plus the 10,000 or so extra reels (sorry - cartridges now) which are used for processing work-in-progress.

Some things remain the same, it seems - such as the need to be utterly sure that the data from the field does NOT get overwritten - it would cost a fortune to send a crew back to a surveyed area. And the need to ensure that the right process tapes are available at each stage along the way. The mechanisms may have changed, tape use may now be recorded automatically to a database of some sort, but there's still the issue of loosing tapes or the records of a tape along the way which means "dead" units in the system; too much of that leads to a squeeze on active / available resources that we were very familiar with way back when.

These days, there are some commercial TMS (tape management systems) available, and there's OpenTMS too. As opposed to the old system I once wrote, this latter is written, I understand, largely in Perl and hence my delegate's attendance on the course. Wow - what would I have given to have had Perl on those old Xerox SDS9300 computers. What took me weeks to develop in Fortran would have been a couple of days of work ... and all the extra admin and tracking facilities described to me could have been practically implemented too.

Posted by gje at 05:19 AM | Comments (0)


Related topics: via article database

May 27, 2006

Boys will be boys, saved by Ubuntu

Many things were very different in the 1960s to the way they are today. Rosey-tinted spectacles, looking back on what's perceived as a golden age, may persuade many that life simpler and better back then, and there's a saying that "School days are the happiest days of your life". Well - I've news for you; there were some rough times, and with the right attitude / approach / employment, things can only get better rather than worse.

What brings these comments on? I've spend last week, and I'm spending next week, in a highly segregated society. The workforce at the hotel is all male, the course delegates are all male and some elements remind me of my all male school days. A certain rivalry and a certain prankishness that proves, I suppose, that 'boys will be boys' and to be very happy that both Chris and Kimberly went to mixed schools. Were we just swimming with the tide when we chose the school? No - it was a conscious decision and I've see just one tiny corner of the old carpet lifted here to remind me why.

---OOO---

When I travel, I know what I'll do in the event of a hardware failure, or a problem with a course. The further I am from base, the more are the precautions taken ahead of time. Delegate workstations here are provided by the company organising the course, so that's really outside my area ... but I brought two rather than one laptop for my own use, backed up onto each other, and a selection of backup CDs and cables as well. "Better safe than sorry". It turns out that my backup plans are rather better than the local ones, and when the internet connections they have set up for the classroom doesn't function, I have two machines on line through which the delegates can check their email. And when one of their systems won't connect even to the classroom intranet, a data CD quickly allows the delegates access to the vital sample files we use during the course. Another machine has keyboard mapping issues, and a quick substitution for one of my own systems resolves THAT issue.

---OOO---

Some of my faster schoolboys, a.k.a. systems administrators, got to playing about for a few minutes during last week's course. Cross-login pranks; nothing too harmful or that detracted from the course once the ones who were newer to the subject had caught up with the exercises. Save for the fact that one, in self defence, changed all the passwords including root and put his system on an anti-intruder footing. Which made it kinda-hard for me to get beyond the login screen when I had to get the machine ready for the coming week. No easy "rebuild the machine" for me which is what I would have done with my own resources to hand.

But I am carrying an Ubuntu live CD - allows me to boot up a PC into linux without effecting the hard disc contents. And the one thing that hadn't been tightened on the rogue machine was the Bios / boot order, so I had my route in. Alas, all too quick and easy in the end ...

sudo mkdir /hard
sudo mount /dev/hda2 /hard
sudo vi /hard/etc/shadow
- delete the encoded password for root
- w! to save the changes
and reboot back to the hard drive to a system without a root password at all!

Posted by gje at 05:24 AM | Comments (0)


Related topics: via article database

May 26, 2006

Keeping customers informed by email

If you're doing a postal marketing campaign and you get a 5% response rate, you're doing really well - 19 out of 20 circular letters don't get any response, with a fair proportion of them going in the bin unopened. "Cost of Marketing and Sales".

How about an online campaign, then? Is that going to fare any better? With all the spam traffic that's around, surely an even higher proportion of bulk emails will disappear into the ether, never to be heard of again, won't they?

Our "Of Course" newsletter is being mailed out from the office in England this week, and we have a good list of clients, prospective clients, and "network" people to whom we send. It's not cheap printing and posting newsletters - the cost each is around 1.50, although much of the print cost is in the setup so that the cost per item drops as the run length increases. So where there's a contact who we've not heard from in a while, wouldn't it be sensible all around to ask if he wants a newsletter through an email ... perhaps it would, but are we going to suffer a catastrophic silence if we try?

So, lunchtime yesterday (the weekend here in Saudi Arabia), I tentatively fired off an announcement through a mailing list program (waste not, want not - an adaption of the program I use on the "save the train" site), pointing a random 10% of individuals to a series of links with which they could indicate their - one click - preference.

And I sat back an waited. And what happened?

At first, it was rather like vomitting in front of a mirror. A great wave of material spewed straight back into my inbox with the subject line masticated into DSN: failed ('Of Course' newsletter (1039) - Well House Consul). Hmmm - yes - I HAD anticipated that; five years is a lot of history in our database, and people and companies have moved on. How actually refreshing to get those returns - each and every one is a potential 1.50 saving straight away, though some bring a tear to the eye. Memories of a young and brilliant Matt with his guitar, and a somewhat older and more demanding Sheila who you couldn't help admiring even though in the end we had to turn around and say "we can't be your private tech support service" ... a hole is left when those emails bounce.

Then, after the wave, the shocked silence after the waters have passed.

Then - drip. Drip. Drip, drip. Subject: [oc] 2,1729 - email - as a .pdf file. Just two minutes after the flood, lights started popping on - emails twinking into my mailbox - life that has survived the storm of time. Subject:[oc] 3,1513 - email - link to newsletter and Subject: [oc] 5,1047 - email - at an updated email address. Soon, like darkness falling a few little lights had turned into a twinkling sky, and it was all I could be doing to sending people links, adding little notes back on - "Do you remember that course in York", and "are you still using Tcl" and "is your PHP / MySQL project live yet? Some miracles too - folks I had thought would be long since moved on coming back and answering ...

I've no conclusion ... no moral to draw, no figures to quote to conclude this post; after a handful of hours - an afternoon - monitoring and answering. What I can reported it to being heartened - very heartened - by the responses, support and ongoing relationship with you our customers and other contacts.

If you're not familiar with our "Of Course" Magazine, you can find out more about it here. You can also use our mailing response script (though NOT the single click 'yes, you have me right' buttons as we can't identify web visitors by name ... for a copy by post or a copy by email or to sign up a colleague or even to have us contact you to discuss a training requirement.

Posted by gje at 04:49 AM | Comments (0)


Related topics: via article database

May 25, 2006

Perl for Systems Admin - suid scripts

I've just completed a week teaching Perl to a systems administration team, and most of their work is involved in traversing data logs and system reports and extracting pertinent information / seeing when characteristics change - classic for a Practical Extraction and Reporting Language from which "Perl" got its name.

But there's more to Systems Admin work. For example, there are occasions when the admin script author wishes to allow some very specific privilage normally reserved for root to a user. My delegates were already aware of how to do this with the bash shell, and were also well aware of the security implications. If you are not aware of these implications, FIND OUT about them before you use the methods described here.

To run a Perl script with root privilage:
a) Set the owner of the script to root
b) Set the suid bit on the file on (chmod u+s filename)
c) Turn off read permission, and on execute permission to the file to everyone except root (chmod go=x)

Your script will run in Perl's "tainted mode" if the suid bit is set. This means that all user inputs are marked as being unclean / risky, and neither they nor any variables with content derived from them is available in 'dangerous' calls such as backquoted commands, open functions, system calls, etc. The purpose of this is to avoid injection attacks; it's frustrating when you first see it, but you'll be very glad of the extra help in identifying potential holes that's provided.

If you do need to mark a variable "clean" in tainted mode, you do so by capturing the clean parts into special variables $1, $2, $3 etc in a regular expression match. In this one case, the derivative of a tainted variable is marked as being clean, so you can the make full use of your cleaned user inputs.

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


Related topics: via article database

Useful link: Perl training

May 24, 2006

Where is a web site visitor browsing from

Here's an extract (reprinted with permission) from an email I received from James - a fellow web site owner, trying to identify visitors to his web site ... he had found and used our IP lookup, and was impressed that we got it right ....

I have just bought a csv database from [[supplier deleted]]. But their database says an ip is ntl when yours says its Virgin. His ip is a virgin ip, as its my friends.

"I think I have been robbed. Now I am looking to find the correct or accurate database. I am using a program written in php to read the users ip and then cross reference the true IP number (long) with a mysql database.

Some interesting points raised ... my answer ..

James, none of these databases / techniques is going to be 100% accurate. I have customers in Surrey who pop up as being in Ireland, and customers in Bristol claimed for France. In Cambridge last week, my hotel internet connection defaulted to Google in German. Expect between 98% and 99.5% accuracy, and provide a page that lets your user change his country.

To identify systems by country, we use the Maxmind database. There's an open source varient there, updated monthly, but it's now quite hard to find on their site. We use that for our user tracking page and, yes, that page is in PHP.

To identify the visiting host more closely, I would start with a reverse DNS lookup - the Apache web server can be set up to do this itself and it means that you don't need to hold a detailed local database at all. This comes up with a name for around 80% of host computers worldwide, from which you can deduce a lot more information, even though the strings are a bit inconsistent and tricky to work with at times. Simply change
HostnameLookups Off
to
HostnameLookups On
in the httpd.conf file and your log lines will contain strings such as
client-82-3-85-219.manc.adsl.virgin.net and ata01cs603.americas.hp.net
instead of
82.3.85.219 and 212.118.35.6

The other technique I would look at, and I think this is our page that you may have found, uses a whois database lookup. Once again, we're not holding a local database but going out to the authoritative version on the web. Be careful of automating this one too often though as it's intended for human (non-robotic) use and you could get yourself banned if you pile in thousands of requests. If you're using a Linux / Unix server, call up the man page on whois to get you started.

Where you SHOULD use a database locally is in cacheing your results. There's little chance that an IP address will move except rarely, so if you hold on to your results for - say - a week, then you only have to check back with the reverse DNS / whois / maxmind very occasionally - great for efficiency, and also avoids you irritating them to the extent that your traffic gets questioned.

Further useful links -
Our IP lookup script - public available page
Change country - page on our site
Source code - whois access in PHP
Source code - generating "select country" pulldown

Posted by gje at 05:55 AM | Comments (0)


Related topics: via article database

Hotel Technology Requirements

Lisa emailed me an item from e-hotelier.com: "I recently attended a three-day sales conference in a major resort hotel. The location was chosen because ... [snip] ... and last but definitely not least, the promise of sufficient technology to satisfy business and leisure requirements alike." The article goes on to conclude that the very limited wired points and their high cost, the availability of WiFi only beside the dance floor, and the limited in-room entertainment have cost the hotel a repeat $60,000 booking for next year. (link to full item)

I'm writing this in my hotel room this Tuesday evening. I'll post it, Wednesday Morning, from the training room; there *is* WiFi there but it bottlenecks out through what feels like a single analogue line shared by everyone. Keeping odd hours and getting to know the staff helps. A oh boy, do I know how Chris Hartmann and Beat Barblan felt when they wrote that article, and I expect the chap who I tripped over when I came out of the training room, seated on the floor with his laptop on his knee and a cable trailing over the corridor to a power point, feels the same way too.

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


Related topics: via article database

May 23, 2006

Reading the newspaper and working with other restrictions

Refered by a contact to an article in "The Sun" concerning trains and politics, I was given the screen above when I tried to follow the link yesterday. And that's not the first time I've seen that page since I got here {Saudi Arabia] late last week.

In an earlier, long, blog I talked somewhat of my first impressions of a people and a society that seems far more regulated that the one that I'm used to - of a border crossing with five separate checkpoints to pass. On one of the English language gulf TV channels this morning, there's talk of a scandal in that it's suggested that Saudi school text books are teaching Islam in such a way that, in places, it encourages learners to become fanatics and go out and fight for the religion. Worrying? Yes, yet I'm glad to see that it HAS become a scandal rather than just being accepted; the questioning of the texts on the local TV means that it's not something everyone accepts as natural.

"Oh - everything IS available here" people tell me. I wonder at the "San Miguel malted drink" on the menu; alcohol free beer, perhaps? Or perhaps not quite so Alcohol free if you tip the waiter? I don't know, I'm not going to try it. Pork is banned, but rumour has it that it can be smuggled in wrapped in beef.

Did I manage to read my article in "The Sun" then? Yes, I did, twice over. A summary was emailed to me by someone who I emailed with a "can you believe this", and my spell checker that I wrote just 2 days back turned out to be an excellent proxy server for the whole text. Aren't such spinoffs great?

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


Related topics: via article database

Career development advice

This article is an answer to an Opentalk forum post asking for suggestions and advise as to how to move a career towards the consultancy / training side of programming, and asking for suggestions as to which technologies I would recommend. It's of general interest so I've posted it here where it will get more exposure that the Opentalk thread

I've always found that the key answer to "which technology / language" when looking at a career move is about choosing something which is:
a) Suitable for use in the field you want to work in
b) Enjoyable to you
and c) has a good future / with some demand.

What you enjoy and what I enjoy may be the same, or maybe not. I'll give you some ideas / thoughts of how I am where I am, and you can then put your own spin on that and come up with the same, or different, answers.

Niche or Common use?

Personally, I enjoy working with niche languages and technologies where I'm a somewhat larger fish in a smaller pond. I really don't want to be offering - let's say - Word and Excel training, good though those products are. With something as frequently-needed as that I know there's a good training and consultancy living to be made, but there's also a great deal of competition in the market; sales fights and techniques that I know but sometimes despise as they're against the clients best interests are sometimes employed and I have better things to do with my time. BUT, it means I have to travel quite a bit - I'm writing from Saudi Arabia this week, I was in Cambridge last week and I'm in Lancashire and Ireland in the next month.

Open source or commercial?

Open source technologies have typically been chosen because they're the right technical tool for the job, and you'll find that classes are almost always enthusiastic, and the people you're consulting for very much back the choice made. You'll find they're very bright people, keen to learn, anxious to ask questions and get as much as they can out of their sessions with you.

You may enjoy this, or you may find it daunting. I teach Perl, Python and PHP, but my "ex" taught English and Drama in school; I used to say I couldn't stand
for the "I can't be bothered / I'm just waiting for my 16th Birthday so I can leave school" approach, and she used to say that she wouldn't like the pressure of being right in front of the bright, paying customer with the adrenalin having to run high all the time to get it spot-on right. But put another way, she enjoyed the somewhat more mundane-ness of the daily routine as it was less pressured and I enjoy the daily challenge.

The other aspect of Open Source is that it has typically sold itself into applications, so it has been chosen on the right grounds. I rarely find Python, Perl or PHP in use for the wrong application. But Java ... get a public course with 6 people attending and at least one or two of their applications will leave me thinking, or even saying "why on EARTH did you choose Java". Java's excellent for certain jobs - huge applications, big programming teams type stuff. It's less than ideal for research datamonging applications and yet it's often been sold into such. On consultancy / training sessions, I find that the one or two mis-users require a disproportionate amount of help and support through and I prefer challenges that are involved in getting the very best practical solutions for people rather that something that's more akin to a game of getting technology "x" to cope with requirement "j".

One or more technologies?

Whenever I run a Web based course - it could be PHP, Tomcat, Java - I have a need to use a whole raft of technologies. Take a file of PHP. It contains not only C-like PHP code, but also elements of HTML, SQL, Javascript, CSS and English all in the one file. And I have to have at least some knowledge of each of these technologies and how they interact. The very name LAMP - Linux, Apache, MySQL, PHP/Perl/Python - shouts multi-technology. This interaction of elements is huge fun, and I enjoy going further and knowing some alternatives too. I feel it's important for a consultant and trainer to know his own fields, and also to know of other fields that relate.

By contrast, let me recount one of the enduring memories I have of a Geek Cruise lecture I attended back in 2004. Rasmus Lerdorf, founding author of PHP, was on the platform taking questions from an audience of Perl, Linux and MySQL famous names - people of a similar standing to him in their own languages. "The Gods" if you like. One "God" asked Rasmus - goodness - one of the most basic of questions about why people use PHP - almost "what is PHP". I was shocked, but thinking back, this God asking the question is so much involved in his own technology and he pours all his resources in there.

You can choose to be a bit of a generalist like me - able to offer intertechnology training and consultancy, or you can choose to super-specialise. But bear in mind that Larry Wall (Perl founder and NOT the one who asked the question of Rasmus) describes Perl as being like an onion - a big vegetable made up of lots of layers, but only a tiny rhizome at the very core.

The right tool?

Language selection. The right tool for the job. It depends on what job your clients and you will be doing as to which is right.

For a complete banking system - an OO language, a heavily policed language such as Java where everything that's to be visible outside your own area is declared public, and APIs between areas are planned months in advance and heavily documented - is ideal.

Systems admin scripts, such as my trainees this week. A much quicker plug-and-play language. No compiler needed, a few lines of code written to sort out an ongoing crisis such as a denial of service attack or to filter a log file that's gone wild. And Perl is their correct choice.

For web applications, we use PHP predominantly these days. It's the only language of the ones we know that was designed for server side programming in the first place and so it's so beautifully tuned to that requirement. No bits and pieces cobbled on to make a more general language work on the web.

Take a research team. A whole lot of people who are involved in handing similar or related data types day in, day out, but in a moving world and application. Then an OO language that doesn't require the policing and compiling of Java - the wood without the trees - is what you need. And the jewel that shines out in that scenario to me is Python.

Supply, demand and future

We're getting an increased hit count for all the languages that I've mentioned in this post on our web site; they're all great, modern technologies that are buoyed by their own elegance, power, and practicality. And all of them have an intertia and an enthusiastic team behind them.

Perl is headed to Perl 6, and Guido van Rossum is now talking "Python 3000". With PHP and MySQL, new releases have been coming thick and fast.

But absolute numbers / number of programs written in a language are NOT what you should take as your director. We get about the same number of web site hits for Perl as we do for PHP; Python is a little lower, as is Java. That doesn't mean that Java is small compared to Perl - rather, it indicates that there's fewer resources per searcher out there on Perl than on Java. And it's this supply and demand, and the balance between them, that's more important than the overall raw numbers.

Indeed - how are people going to find a small training company such as ourselves in an obscure English town? Are they going to walk past the door and think "I'll go in for a MySQL course today". No - of course not; they're going to work through word of mouth, through searches, and that's where the supply and demand comes in.

Summary

I'm conscious that I've not directly answer the "which technology" question I was asked. Rather, I've said that it's up to you based on the fields you want to work in and what you enjoy. That has to be the right decision.

After yesterday's training session, W**** stopped around and chatted for a good hour. He's just 22, and very much the youngster of the traditionally-dressed Saudi group on my course. He was telling me of how he's self-taught in Linux and how that stood him in such excellent stead for his current role. Taken on by an oil giant, working with colleagues who have far more paper qualifications than him, he's destined to be a high-flyer. He's been selected for the Perl course (and, hey, that was his employer's right decision as he's getting so much out from the course and the extras), he's off for some formal Linux certification, and the sky's the limit in a role he enjoys.

Posted by gje at 05:52 AM | Comments (0)


Related topics: via article database

May 22, 2006

Looking ahead and behind in a Regular Expression

Regular expressions in Perl and PHP include facilities called zero width assertions, zero width lookahead and lookbehinds. A case of jargon that looks almost calculated to confuse?

Zero width assertions are where a regular expression matches some sort of condition in the line, without actually consuming any characters from the incoming string - the three most common examples are ^ (must be at start of string), $ (must be at end of string) and \b (must be at word boundary).

There are times when you may wish to say "if followed by", "if not followed by", "if following" and "if NOT following" in a regular expression match, but to not actually move backward or forward over the incoming string - for example, in a spell checker I was writing yesterday (source, read about it and try it out) I was looking to split my incoming string at each word boundary, but only if NOT following or followed by a single quote. And, crucially, the single quote character was not to be included in the matched string itself - I was just saying "no break here" in the case of words like hasn't and I'll. This is a requirement for a zero width negative look behind written (?<!') and a zero width negative look ahead written (?!').

Here's the complete regular expression of my example:
$elements = preg_split("/\b(?<!')(?!')/",$page);

Footnote - Zero width positive lookaheads are written (?=xx) and zero width positive look behinds are written (?<=xx), where xx is the expression that you're looking back or forward to match

Posted by gje at 05:48 AM | Comments (0)


Related topics: via article database

May 21, 2006

A journey, an arrival, a people

It's a long, long time since I sat down and wrote a "travelogue"; although I enjoyed writing about places and people, there was getting to be much of a similarity in what I wrote - indeed, the world is a smaller place year by year. But yesterday, I flew into [place to be named later] and although the first restaurant I saw out from the airport was McDonalds, and the first bank was HSBC, there is a good "story" here. All is NOT what I expected, and you may enjoy some surprises from this personal tale.

Let me start with a question. How does a lady wearing a burka that only exposes her eyes though a tiny slit eat her lunch in a restaurant? I'll come back to dress issues later too ...

Jump to First Impressions
Jump to The People

Journey

4 a.m. could be considered a cruelly early time to have to get up, but I don't mind it. Lisa gave me a lift the six miles into Chippenham and I joined other passengers on the 5 a.m. National Express coach to Heathrow. There were 20 or so passengers on, another four joined at Chippenham, and perhaps a further dozen at Swindon. The bus driver was disgustingly good humoured for that time of the a.m.! I dozed around Wootton Bassett, and slept rather better past Reading, Maidenhead and Slough.

I suppose Heathrow's central bus station IS in the centre of the airport. Which means that it's not really near to any of the terminals. I dragged my cases down the lift and on a long walk to the Heathrow Express to connect on by train to Terminal 4, Noting wryly as I did a "First Connect" train arriving to terminate with just two passengers on board. And then another walk at Terminal 4 up to the lifts to check in. In this safety-conscious age, it's great to see the trolley barriers near all the platforms and escalators stopping one taking a cart for one's luggage -- just have to hope that the Heathrow trolley team, as featured on "Airport", has the right number of trollies in the right place at the right time. And in some places they do.

"Self service check-in - beat the queues" says the enticing sign. Sure, why not? And after a few screens and some data entry, a boarding pass and receipt are issued. Lousy choice of seats (all middle-of-three jobbies), but then it was a cheap flight and I wasn't surprised. Oh well, only six hours on the plane.

Now to drop off the luggage. "Fast luggage drop" say the signs, but most people don't read them, it seems, as two BA bruisers were turning away a steady stream of people from the entry to that area. Taking my credibility in my hands, I approached them and was allowed through. Round a couple of turns in the barrier and .... onto the back of a queue.

The lady at the fast-drop was polite but firm. My bags were overweight, and it would cost me more than my return trip ticket for them as excess baggage. OK, I needed them; they had 20 sets of delegate notes in them. So they had me by the short-an-curlies. Hmm. "Gosh, is there anything you can do?" I asked. "I'm much lighter than some of the other passenger, I'm sure". Yep, I know they've heard it before but I would rather be a considered a bore/twit than have to pay all that much. And, d'you know, she did budge. "Is that a laptop in there?" she asked pointing to my shoulder bag". "Yes". Oops, is that going to be weighed too? "It's not really hand baggage to I can allow you an extra six Kgs in the hold. THANK you. That's more than a hundred quid saved. And the lady looked at my boarding pass and suggested that I might like a better seat ... found me an aisle. The only place there was no queue at Heathrow was the desk to pay my excess. I guess commercial companies are only too glad to ri... take payments. Then into the security queue.

Tempted by the shops? Yes and no. Bought some more travel adaptors (I'm sure that the cat eats them in the middle of the night at home - can never find enough no matter how many I buy) and was very tempted by a 250-quid 8-Megapixel tiny digital camera, you know the sort of "end of Gondola" special. But thought of the money just spent on excess baggage which, company's money though it is, will reflect in profits and our own pockets in due course, damn it. Lisa and I own Well House Consultants. And sanity prevailed.

So, NOT tempted by the shops very much. Did spend a fiver on a Wifi session, answered a few emails and made good use of time and, as my hour ran out, they were announcing the flight. "Gate 1b". Umm - sounds ominous and, sure, Gate 1b is a queue-for-the-lounge, sit and wait, queue-for-the-bus, queue-at-the-aircraft-steps job. Some of the first class passengers, standing on the bus, were complaining; "at some airports they do a car for first class, a minibus for Club and a coach for Cattle ... but here at Heathrow, we're all together". As one of the cattle, I think I'm grateful to people like this for helping to keep the airline flying, in profit, and able to provide seats at a better price for the likes of me (and I suspect of most of my readers). I do feel that it was a little, err, arrogant of them to express their views of their fellow-travellers right in front of everyone.

I was glad to get on the plane, find my seat, and store my carry-on bag. The two laptops and heavy weight of books and other paperwork in it were killing my shoulders by this point.

Flight. Painless. Big chap to my left, spilling over the armrest into my seat. Elbowing me as he opened his butter pat at lunch time. But nice enough. Chap in front of me reclined back nearly onto my lap for the flight. Would have offered him a shoulder massage as he was just in the right position, but decided to watch King Kong instead. Was able to hear the sound by keeping permanent pressure on the jack for the headset. From the state of the armrest, clearly someone else had suffered the same problem and lost their cool with the rest. Only thing that was missing from the typical flight was the kicking child in the seat directly behind, so I was able to sleep through most of the first film showing and woke to wonder how this damned Gorilla had got to New York in the first place. Second run of the film filled me in.

My fellow travellers were a mixed bunch, but mostly British, and mostly men travelling on their own. The odd person in Arab clothing, a woman or two wearing clothes that covered everything but the eyes - perhaps a pleasant contrast to the still-wannabe-young damsels in skimpy shirts and in tight-but-loose waisted jeans, with midribs bulging out between the two items of clothing, and offering you the chance to read a label telling you where they bought their pink knickers if that's what turns you on.

The food was by "Gate Gourmet" - the spun-off company from BA at which there was that big industrial dispute a year or two back. I was pleasantly surprised, though, nothing to "blog" about [oops]. And the flight attendants were more helpful and friendly than I remember from previous BA flights, but still far short of what we expect on Virgin.

France - Eastern Europe - the Black Sea - Turkey - Iraq. Occasional glances at the travel map showed our progress, and so on to The Gulf. Around six hours from Heathrow, we touched down in Bahrain and I left the plane -- my first visit to the Middle East. Now WHAT was I going to find?

I found an easy customs procedure (Lisa - please note $6 charge for a Bahrain Transit Visa) and a driver holding up my name, along with a throng of other drivers, and I came out of the arrivals channel. Could have been an airport anywhere in the world. The first "this is different" feeling was the whoosh of heat as we left the terminal. Hotter than Florida in August.

Jump back to Journey
Jump to The People

First Impressions

The airport in Bahrain is modern. Step out of the terminal building, and apart from the heat you could be in any Southern USA provincial airport - there's a driveway with various traffic that's picking up and dropping off passengers, crossed by Zebra crossings, and beyond it a large parking lot. Raise the eyes further and you see the glittering lights (for it was dark when I arrived) of skyscrapers quite close by. It's busy, but not Heathrow-uncomfortably so, and there's a few abandoned trollies around. And there's the "I can't walk another few yards" mentality on show that seems to have slid all the cars in the car park down to the terminal side as if the parking lot was on a slope and the cars skated over it like ice. Oh, and there's a queue to exit the parking lot.

I can't give you much of an impression of Bahrain, for I was on a 24-hour transit visa and probably stayed there, once out the airport, for around 24 minutes. I can tell of a modern, high rise and being-expanded city. Where names like McDonalds, Citibank, HSBC and Debenhams decked out the buildings. Where building sites proudly had pictures of skyscrapers under construction - not just straight-up ones, but shapes that seem to lean and glide; an elegance and size that make London's Gherkin and Hammersmith's Ark look like failed attempts at something. In Bahrain, the shear size allows a success is taking the breath away, at least.

And hotels. And shopping malls. My driver talks of the expansion continuing in this tiny territory, of all the offices and holiday makers, and the people packed in around to work in those offices and service those hotels. It's a bustling, lively road scene - dual carriageway and busy even on a Friday, which is the equivalent of Sunday. The car beside us is a recent VW Beetle, bright yellow, the driver a woman wearing a burka. This is no place that's greatly different; I could be in Denver, Dallas or Detroit, apart from the fact that everything's too clean and new, and the signs are Wales-like labelled up in English and something else that I can't understand. OK, something else I can't even read; it's Arabic.

Want to know more of Bahrain? Perhaps you do, but I'm not your man. We swing off the dual carriage way down a slip road and join traffic on a much quieter "dual". "Busy today" says my driver, though it isn't such to me. I think of the two hours I spent on the M25 the previous evening and feel that my guy probably hasn't seen the nth degree of busy-ness. But he's a good talker, keeps me well informed and, were I wanting a tour I might encourage him to be my guide.

The quieter road turns into a low causeway; there's water on both sides of us and I prepare for a crossing like "Alligator Alley" -- a road with nothing much on either side for perhaps an hour. But it's not like that; we stop at a toll booth and pay 20 Riyal - between 3 and 4 quid - and our driver grumbles about the money being made. We laugh and joke that governments always want money. Then another low section, a rise over a shipping channel, and another low section and - what's this - a service area island? Yes, there's a restaurant and a cafe ... and a sign pointing for "Diplomatic Passports" off to one side. And ahead I can see traffic lights and a short backup of traffic. We're reaching the border and preparing to cross into the Kingdom of Saudi Arabia.

Let me see if I can get the border sequence right. The first queue was to get a piece of paper that indicated our registration number and number of passenger in the car (I think - my driver was taking care of it). At the check point ahead is the second queue, and passports were checked. Just before the third check point I thought this was also a convenient loo stop for all the women too, as there were a lot of them getting in and out of cars and going over to a building that I saw a "Mens toilets" label on, and assumed there was a woman's one too. Not so - the ladies were showing their faces to an appropriate authority so that their picture ID could be checked in private, and this check point ensured that all IDs were confirmed. Apparently, there was a precious problem with people, both women and men, passing on someone else's papers.

After that third check point was the fourth (perhaps you hoped we were done?), and here every car was inspected. We were gestured into a parking bay, opened the boot, and stood away from the car. A guard came over, looked in the boot, walked over to the front and back door on one side, opened them and looked around inside for a few seconds. Satisfied, he walked over to his table and stamped our paper. We were free to move on, and we queued for the fifth - and final - checkpoint. Simple really - it was just to collect any papers and, I guess, any monies owed on goods being imported.

I wasn't surprised that our car was stopped and searched, after all it was carrying a non-local, but I was surprised that every single car was routinely stopped. My driver commented how easy our transit had been and that it's really tough if you fly in to the airport in Dammam. "Takes a couple of hours - all queues". He went on to explain that these days, they're really concentrating on drugs and alcohol at the border, though they're also on the lookout sometimes for DVDs and pictures they consider to be pornographic, and for pork that's freely on sale in Bahrain, but strictly against the law in Saudi.

The signs changed. The top language was now Arabic, with smaller English translations below. The speed limit was 80 k.p.h., we were doing around that ;-) ... and cars were flashing past us. "Do the police check speeds?" I asked, and was assured that they do. Over 120 k.p.h. and you're taken straight to jail for three days (do not pass GO, do not go to court, pay 50 pounds fine for release). I don't really know if it's 50 quid, but I expect it is - and that's a lot of money here.

By the time we had completed this conversation, we came over land and a slip road joined us. In the narrow triangle between the merging lines sat a police car and a low-loader vehicle. To take the cars of people who had been driving over the 120 limit to a pound as they were taken to jail, I'm told.

A contrast. Bahrain had been a city reaching every higher for the sky, but Al-Khobar is a great flat sprawl - the economics of plenty of land. Saudi Arabia is the size of Western Europe. And other things differ here too. The stores are names that I don't recognise. Just the occasional English subtext to help the visitor. And the housing very much Arabic in style - the streets off to the side look like some of the cities we see in war footage from Iraq or Afghanistan, save for the condition which is pristine in comparison.

We sweep off the main road, and onto the road to Dhahran. "Air base" it says, and air base it is. Not much else around. "Gate 1" or "Gate 2" say the signs, and we follow "Gate 1" ... coming up ahead is a great military fort - high, high high fence, floodlights, and a gate to match. But just a few yards before we get there, though, we take a left and there's a hotel - palm trees around, a drive up to the front door and an efficient porter service that grabs my cases and loads them onto his trolley before I can say boo to a goose. I thank my driver, wish him a pleasant evening, and - oh help - what is the tipping rule?

Dhahran airport, up until the 1992 Gulf War, was civilian and military. The new civilian airport is 50 km away at Dammam, and this one has been left to the Air Force. (Aside - distances are great, and the nearest tourist attraction is some caves and geysers 150 km away according to my guide). So the Dhahran International Hotel sits incongrously here -- service the base, the Aramco Oil company who are nearby, and the King Fahad University of Petroleum & Minerals (please excuse any misnaming there - I tried to take all this in, honestly).

The hotel lobby is plush. Spacious. Rows of comfy sofas set amongst the a couple of fountains and a palm court area. An atrium rising - high for standards here - to stories. Just off to the side of the restaurant is a case with a strange article in it. "Do you know what that is?" asked one of my new friends and delegates the next day. No, I didn't. Turns out to be a Patriot missile that was fired at an incoming Scud during the - was it really that long ago? - 1992 conflict. The debris from the Patriots - 16 were fired at this scud - did more damage than the scud would have done had it landed, and the Patriots cost a million dollars each. "Someone trying to put up the cost of the war to get re-elected" suggests one of my group. And this is the hotel that we got used to seeing on TV where the press briefings were held during those wars ...

Jump back to Journey
Jump back to First Impressions

The Saudi people

Still reading? I admire your stamina, and hope you're enjoying. I do think, exceptionally, this trip so far has been worth a travelogue. It's a long way from Chippenham.

I've headed this section "The Saudi People" but all I can really tell you about are Saudi men, and the clothing that Saudi women wear. I've not bee introduced to a Saudi woman yet, and perhaps never will be. You see eyes. You see the occasional wrinkling of the skin around the eyes that indicates a smile behind. And you see a pair of utterly out of place high-healed shoes poking out from below the black. But that's it. a segregated society where it's illegal for women to drive, where women must be met by a male relative at the international border if they've been out of the country. The women that I work with in the UK, the woman I love and live with, would find it very hard, I think.

The Saudi men. A beard. A white tunic. A headscarf that's always white, with red, chequered decoration in the centre and perhaps a border - red and white too, but varying a little from one to the next, and a black - gosh - scarf-holder that sits on top; about six inches across, like two loops of a curled snake, and always black it's pushed down on their head and re-adjusted from time to time. Oh - and brown slip-on sandals and no socks.

Quite daunting to see a group of almost-uniformed, bearded men talking away. But here's a surprise. Look at the human side and you'll find real persons and real personalities. Are they just like British men, then? No - I'll argue not; in this society the ones that I've met at least have taken on some of the humanity, caring, and gentleness that is so much the woman's prerogative - "girly" - in The West. And it provides an underlying something that's ... all-pervading and an aspect of the society that makes it deeply attractive.

"Meet Abdul in the training room at 8" said my contact here in one of his final emails before I travelled. Only when I got to the training room did I realise that the client had been given an 08:00 start time and some of the group had arrived. Seated being a U shaped conference table, piled high with a big old tower computer and monitor at each of 9 seats, was a group of men dressed as previously described. Chatting amongst themselves, eating sandwiches that were on a table to the side and sipping coffee. Yikes - I find it emotionally REALLY hard to do a setup with delegates already waiting, and I sure needed to clear the desks a bit so that my trainees could see the board. I was relieved to see a projector which there had been some doubt about the previous evening, and mystified by an extra box - a modem - sitting on top of each c.p.u. with a pile of modem boxes in the corner.

I got no help, little interaction, as I walked into the room center and lifted each c.p.u. box, turned it around, and lowered it to the ground in the centre. I managed to step on one power cord and pull it out - a make-shift jungle that (Lisa , please note) make our place look tidy. But there's 10 delegates, aren't there? The 10th machine was set up as if I was to use it, so more movement. Another table found, and I brought out my two Macs. "Oh - wow" - the 17" laptop has that affect the world over!

I invited John, the VP of the company that had arranged this training, to stop and listen as I started. He looked astonished at the offer but took it up with fervour. OK - I wanted to show him that he and Thomas had made the right choice in choosing me for this one. And I wanted him for - a couple of minutes - just in case it went pear-shaped. Yet he stood at the back - clearly NOT about to do an intro. OK - here we go:

"As-salam alaikum" (Peace be upon you). Pause. Slight surprise at my start? "Wa alaikum as-salam" replys my group in a quiet chorus. And smiles. The ice broken, and I introduce myself; I tell them how important it is for me to know a little background on whether they've programmed before ("little point in me comparing Perl to Cobol if none of you knows Cobol" I comment), and I go around the room talking to each in turn. "Eldest first" suggest the guidances I had read, but the eldest was seated in the middle; I started at the end nearest to him so he did rank highly. "The quiet ones are often the important ones" say the guidances. I don't think that's universal, nor unique to Saudi - it's always my way to talk to everyone and establish a rapport with the quiet, too. So around the room we went.

John smiled, then was grinning, the group jelling, and we were rolling along. John slipped away after a couple of minutes, and soon the group learned how to check whether Perl was loaded (and confirm that it was), how to check which version, and how to write a program to print out the words "Hello World".

"Just another course" then. No, certainly NOT, quite apart from the fact that there is NEVER "JUST" another course. I always interact - get delegate inputs, keep the whole thing as a group activity. But here, that's especially relevant. Sh****, the patriarch who says he has not programmed before is writing wickedly brilliant code on his first day. Ab**********, whose name I had some problem writing down when he first gave it, and is quiet and I suspect is quite senior, smiles with delight and spells his name in full as I use it with others in an example. The rest of the room mutters as I had only picked on four for that excercise, but then laugh when I say that "oh, your turn will come". I'm really REALLY enjoying this course and it's made by the class.

Perfect course? No, there's the usual incidents and things to resolve, and I'm not in my own centre nor at the customer's site - a trainer's nightmare. The modems have been installed but not configured nor tested. The delegates get a bit antsy because they need to check emails. Sh****'s machine has an Arabic+Latin keyboard and the keycaps don't match the special characters that are generated when they're pressed. "Where is the '\'?". Goodness, I don't know, and it's unfair to expect the guy to remember the mappings anyway. And the heat - the air conditioning isn't very effective and my local audience is falling asleep and grumbling about it.

This has been a long "write". Written off line, Saturday evening and it's now Sunday morning here. I should get my 8 hours before the second day - START at 08:00, Sunday. I know now. I don't know what the day will bring - whether I'll even be able to get on line to post this - but I do know that I'll enjoy the day.

Jump back to Journey
Jump back to First Impressions
Jump back to The People

Posted by gje at 05:44 AM | Comments (0)


Related topics: via article database

May 20, 2006

In praise of training course delegates.

There are some characteristics of people that are the same the world over. I'm training this week in Saudi Arabia (so my week is Sunday to Wednesday) and - I admit - I was in some nervousness of my first trip to the middle east. But - what lovely, personable people and a great bunch of keen Perl learners. We often think we live in a charmed world of with the people we train, and it extends to Dharan too.

Even the sounds here are like home - the sound of aircraft flying close overhead from time to time, and just like at home the room can get very hot in summer, which it is. But not everything's identical. When I trained on the Isle of Skye, I had fiddle practise in the next room to contend with. Here, a gentle middle eastern music drifted in through the doorway to set the scene.

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


Related topics: via article database

May 19, 2006

Better communication

When we first set up this website, we had a phone number and fax number that most people called us on, and an email address that was occasionally used. We provided a link to a map and directions for people driving, and a link to a railway timetable that we had to put online ourselves for people coming that way. People thought I was pretty odd when I added our OS reference to the map.

How times have changed; most communication is via email, the train timetable is still there but has been enhanced by a link to tell you whether the train is cancelled or on time, and I've added our latitude and longitude to the map in addition to the grid reference. On the phone number side, we've got extra 0845 or "locall" numbers which, for UK clients, may save them money when calling us.

From a simple telephone answering machine we've moved on to a computer system too - it IS one of those ones that can be programmed to offer you loads of options and can send you in circles around a series of menus, but that's not how we use it. Phone us, and we'll pick up after 2 rings (Leah), 3 rings (Lisa), or 4 rings (Graham). If none of us is available to answer, we'll take a message that will be emailed to us around the world, as will be faxes. So don't be suprised if you hear back from half a world away.

And now, we're set up on VOIP - Voice over IP. Experimental for the moment, but Lisa and I are set up as wellholisa and wellhograham on Skype. Lisa can usually be reached at work via her account, but I'm a little trickier to get hold of that way - I simply can't be interrupted while I'm standing up in front of a class. But I do expect that we'll be chatting amongst ourselves using this medium while I'm away in future.

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


Related topics: via article database

May 18, 2006

Helping mental health through diet, exercise and other lifestyle matters

A broken leg has laid my son Chris low for the past few months. A car pulling out in from of his motorcycle lead to is entire left leg being in a plaster cast for several months; it's now in a reduced cast and he's getting somewhat more mobile.

Chris has always been immersed in computing - from hacking around (in the good way not the bad way) as a child, he moved on to running an internet cafe and then another job with a lot of customer relation and computing involved. I was delighted that he was mobile enough to join us for last week's PHP course, and that his wife Delene able to lend him to us for the week.

Actually, it was to both their advantages too. Delene and Chris have just set up the web site for Helix Health - offering "A holistic non-drug approach to naturally correct underlying physical problems frequently responsible for mental health symptoms experienced". Delene is qualified up to the gills (and beyond) for this, and does all the consultations; Chris is an enthusiastic backroom supporter.

I always find it hard to work out what the medical terms mean. Basically, Delene helps people look at the life styles, diets, etc, and helps relate them to sleep disorders, anxiety, depression, etc that the people may be suffering. Then they can - largely through self-help but with Delene's support look at improving what they eat, how they exercise and live .... dealing with the physical issues can do wonders for the attitude, stress, trauma management etc.

I know that I can vouch for Delene's ability. When I had my recent blood pressure / cholesterol scare and was, frankly, panicking a bit at a letter from my doctor she was a great help with a large amount of information, time to discuss and help encourage me to make some adjustments. I'm a bit of an odd-ball case in that until I had the letter from the doctor, I was feeling great. I've now managed to loose a few pound so that I'm no longer technically overweight, cut out a great deal of cholesterol and almost all my caffeine and - err - I still feel great.

And - gosh - who better could Chris have around to help him through the physical and emotional side of the motorbike accident? And he's ... well ... taking it all remarkably well. Or perhaps it's not remarkable - it's Delene's influence and help ;-)

Posted by gje at 12:38 AM | Comments (0)


Related topics: via article database

May 17, 2006

Viewing images held in a MySQL database via PHP

LOTS of questions on this at the moment. We have a couple of sample scripts that do it - have a look at:

* feeder.php which adds images into a database if they've been uploaded as plain text files, displays them from the database if that's where they are already, and generates a rather more informative than usual graphic if you call up a picture that does not exist.

* pic_alog.php which selects images by title from a database. There's a page here which explains this a bit more, and points you at the upload script too.

Posted by gje at 04:59 AM | Comments (0)


Related topics: via article database

Useful links: PHP training, MySQL training

May 16, 2006

I'm answering a job applicant

I get a lot of job applications emailed to me.

I am aware that each and every person who writes in looking for employment is an individual, and I look at and answer each email individually out of respect for the time taken to send to us and out of respect that here's a human being who clearly needs employment, even if the applicant is totally unsuitable. If my answer can help them learn who and how to approach others, that's great!

I never cease to be amazed at the number of people who don't research the companies to whom they're applying; I'm just responding to a request asking if we have for any jobs in the Cork area ... which seems a pretty unlikely thing for a three person company from Melksham, Wiltshire, England to have on offer.

I am not impressed by clearly circular letters which don't address one of us by name, make no reference to the company in the enquiry, and come in to the general "info@" email address.

I like an email introduction that says "thank you for reading this and considering it" when I get to the end of it, and leaves me with a warm feeling.

I find emails that have every single paragraph starting with the word "I" to be very self centred, and that's quite an inappropriate approach for anyone who might be interested in joining our team.

I .... OOps ;-) ....

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


Related topics: via article database

May 15, 2006

Residential

Why "residential"?

We've spent this weekend planing Well House Manor - the facilities and services we should be offering in our new business hotel for Melksham, and that word kept cropping up. Well House Manor should be a home for our business travellers away from home - somewhere that's their residence for the few days that they're with us - their residence - and not a regular hotel.

What does this mean? It means that our guests won't be wanting to stuff themselves with a full meal every night, but they will be wanting instead a wide selection of light and not-so light food nearby, and the opportunity to bring it back in if they choose.

It means that our guests will want to feel well looked after, yet will also want to be left alone to do their own thing without feeling they're being given intrusive attention from staff or landlady.

It means that our guests will want good communications and plenty of space in their rooms at which to work, and that they'll want a light breakfast to be available from early in the morning. And will want plenty of secure parking for themselves and any guests they have or anyone picking them up or dropping them off. And they'll want ...

The list goes on, but I'm sure you get the idea.

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


Related topics: via article database

May 14, 2006

Planning a hotel refurb - an example of a Gant chart in PHP

We're planning for a grand opening in the Autumn of Well House Manor, and we've a very great deal to do ahead of time. A sound building, 100 years old, is showing the signs of age in a frumpy decor, an access that's suitable for the horse and cart era, and a garden where the Leylandia tower above the neighbour's houses. What a lot to plan (and to pay for!), and that dreaded fear that something will be overlooked - that we'll end up without mirrors for the bathrooms, coffee beans for the coffee machine, or staff aprons for the kitchen a few days before we open.

Lisa and I have spent much of the weekend getting tasks and purchase lists together, and entering them; I've gone for a plain text file just at first - a "spike" solution and test of concept that may migrate to a database, and as we all want to see the data through our browsers, I wrote a piece of PHP code this morning to display it.

Yes, it's a Gant chart ... I did a module on Critical Path analysis, Gant charts and all the rest at University way back 'when', and it all came flooding back!

Interesting to note too that as I started to write the code associated with each task, including correlating it with other tasks and analysing specification strings, I came down to writing my task handlers via a PHP class - that way, I can encapsulate all the awkward data handling and heterogenous mix of variables I need to hold for each task in an object, and just pluck information out as I need it; the display you see above is the first I've produced, but I'm sure it's the first of many I'll be producing with the same data yet my once-only class writing is already complete and I'll just need to extend that a little as the project progresses.

You're very welcome to view my source code if you wish - we teach this sort of technique on our Object Orientation in PHP course which next runs on 7th July if you want to know more.

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


Related topics: via article database

Useful link: PHP training

May 13, 2006

Gardens, Well House Consultants HQ

During their courses, our delegates are welcome to wander around the gardens at 404, The Spa.

I have to take my hat off to Nigel, who keeps all this in order; so much more than just a gardener. Indeed, last night Lisa picked up a "Melksham in Bloom" competition form and we mused as to whether we should even enter. No - we should not unless / until we've had a word with the man behind all this beauty.

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


Related topics: via article database

May 12, 2006

Protecting images from theft

You want people to visit your website, see your wonderful product and be sold on what you have to offer through wonderful pictures. But you don't want them to take copies of the pictures and use them on their own web sites, nor do you want them to link in to your images and use your costly artwork and bandwidth for their own purposes. Right? It's a bit of a conundrum, isn't it?

The graphics on our website aren't our bread-and-butter living, so I don't mind the odd image being copied or even people using a selection of images - but what if my images were my livelihood? Here are some of the techniques I would look at:

a) Marking the images in some way - either a logo in one corner, or a watermark across the picture. On colour mapped formats, the water mark could be in "white on white" so that it wouldn't be visible to the naked eye, but could be seen via certain software. Some images formats also allow for annotation in their headers.

b) Supplying the online images only at a lower resolution as needed by the web page. This will cut down on theft for print, but the resolution might not be a problem for a web site thief. PHP includes a thumbnailing capability - sample code - which means you can store high resolution on the server but only provide low res on the fly.

c) Image splitting, where images are held in multiple images. Try to copy the whole image below onto your web site - you won't find it as easy as usual ;-) :

Once again, PHP can help you with the setup.

The techniques I have listed above all effect what's sent to the client when the graphics are being displayed, but there are some other server based techniques you could use if you've got a setup where you can front your images with PHP. Indeed, it can be much more efficient too for you to store large numbers of images in a MySQL database (or other database) rather than in a file-and-folder structure where the operating system efficiency isn't brilliant with tens of thousands of files!

d) Track and log image requests in your PHP by incoming IP address, and once a certain IP address has requested more then 20 images in a five minute period (say), start adding watermarks to the pictures through the PHP.

e) Check the referer field, and only supply unwatermarked images where the referer is a know page on your own site.

You need to code these facilities carefully bearing in mind that you may WANT spiders like Google images to grab all your pictures, and you won't want to piss off your very interested genuine customers who call up a lot of pages in their excitement with your site. Also remember that people can go to the trouble of falsifying headers if they want. You may come up with a scheme that logs image requests, and simple emails you the first time there's an unusual referer from another site, allowing you to put in a "watermark" or even "this image is stolen" response when the same remote image request comes up again.

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


Related topics: via article database

May 11, 2006

A customer service company

"We're a customer service company who happens to be in the computer training industry". So said the sign stuck on the wall at a training centre where I was a guest presenter a few weeks ago. The words were the right ones for them, and they're right for us too, but their actions based on those words were not the correct ones - the ethos seemed more down to cutting corners to make life easy for the staff while as many customers as possible were pushed through, and cutting budgets and facilities to provide a minimal service that's just acceptable at a maximum profit.

So it was with great pleasure that I got some of my own thoughts on our customer service approach for a talk I was to give to the local Chamber of Commerce in Melksham on Tuesday evening. We call our approach "a mint on the pillow", based on the pleasant surprise you'll get at the occasional hotel that leaves a chocolate mint on the pillow when they turn down the sheets. We aim to provide a service that goes one step beyond what customers would expect of excellence.

I came up with "three E's" to illustrate and tie together the parts of my talk:
Enthusiasm from ourselves and our staff which is infectious - it makes for positive, enthusiastic delegates too.
Empowerment to our delegates, our staff and ourselves to take the initiative and go one step beyond what any operations manual can say (I note with pride Leah presenting a customer who had been raving over our ginger beer with a sixpack as he left).
Ethos in terms of creating an environment for the enthusiasm and empowerment to work.

The net results? Firstly, WE enjoy what we do, and we want everyone here to enjoy what they're doing too. Secondly, a lot of happy people who'll want to come back and will tell all their contacts about us. It may mean that our costs aren't the lowest in the business, but it does mean that our order book gets quite busy. "My next available day is 14th July" I said last night - that's 2 months ahead for a single day - I had to say yesterday. "Fair enough, I'll can wait for that ...." and the business is NOT lost.

You can read my full talk - Creating Really Memorable Experiences in our Solution Centre

Outside the training room window - which do you prefer?

The "mint on the pillow" approach:

or the "where can we get a good cost office" approach:

Posted by gje at 04:56 AM | Comments (0)


Related topics: via article database

May 10, 2006

Evaluating arithmetic expressions in configuration files

An interesting question came up in a consultants session this evening - how to take an expression that's held in a configuration file such as (A3+C3)*(A5+E6) and have the program work out the expression in the "conventional" programming sense - i.e. BODMAS (Brackets, O???? Division, Multiplication, Addition, Subtraction).

Now - I learnt how to do this at University and I even did it way back in CGL days when I wrote a complete geometric language - the algotithm is known as a Dijkstra Shunt - but I was blowed if I wanted to try to rewrite it this evening. My visitor had a Visual Basic solution which involves him using a .dll file from Office, but his customers weren't happy having to install office as a pre-requisite to running his software. It was wanted on a web site, so how to do it in PHP?

When you think about it, all the languages we use these days already have the Dijkstra shunt built into them .... we just need to make use of it. In the case of PHP, it's available via the eval function and that's what we ended up using:

a) Take the expression and use a regular expression to extract each of the variables in turn
b) Substitute the variable with the value that it contains (that's a database lookup in my example, since C3 means the third column, 3rd row of a table
c) Use the eval function to do the sum.

Total - a few hundred bytes of code ... (see here) ... and a visitor who left feeling that in an hour I had given him the mechanism to take a complete step and an expensive piece of software out of his system.

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


Related topics: via article database

Useful link: Lua training

May 09, 2006

First way to get rid of customers

A course, three delegates ... but not one brought their own car. I used to say to people that around 40% of our customers came by train, but this week it's 66% and that's not been unusual of late.

Any using the train isn't easy - you just try to find out about it in Swindon, where it starts. Go up to the timetable sheets that list departures and you'll find no mention of Melksham on there ... nor Trowbridge, nor Westbury. And you'll be lucky if the timetable racks contain the appropriate timetable. "Sorry - they're out of print" the young lady who was filling the rack on Saturday told me. "You could go up to the ticket counter and they'll print something out for you" she said, pointing me in the direction of a queue. "There's only three trains a day, otherwise you change at Bath".

It isn't as if these trains are unused, either. Here's a picture that I look last Saturday afternoon of a service that's to be withdrawn from December. Do you know what I think it is? Until last month, the train service to Melksham was run by Wessex Trains - part of National Express - and was a limb of their services that ran into First Group territory; it always felt like an unwelcome guest and information was hard to come by. The First Group told us that there would be no magic solution to all the problems and issues, but they did pull their finger out by removing the Wessex trains name from our station in the days BEFORE they took over, and getting new notices there within a couple of days and new uniforms for all their staff too, so surely they have now had plenty of time to put up fresh timetables to cover the new service they've just taken into their fold?

Here's the Saturday train again, on its way back to Melksham. Pretty busy, eh? Where's the "Fresh Air" that the previous secretary of state thinks our train is carrying around?

I don't actually object to the staff who fill the brochure rack at Swindon not knowing about train services, but I do object to them getting it wrong. There are NOT "only three trains a day", there are five. And you do NOT change at Bath at other times - or at least, if you change at Bath, it's a dogleg journey and a change into a BUS at the nearby bus station.

Was my experience unfortunate and unique? I wish it was!

On Monday morning, I went to meet a customer off the 09:12 and no-one arrived. Indeed the train looked very quiet indeed ... never seen it quite so bad for many months. The mystery was solved when we got a phone call from our customer telling us that he was stuck in Swindon; the London connection had been 20 minutes late, and so had missed. I'm told that the staff at Swindon suggested he wait for the next train at about 14:30 ... indeed, they advised him that these were the ONLY TWO trains each day to Melksham ...

Isn't it ironic that with the huge increase in traffic on this line over the past few years, and with the roads getting more and more clogged, it IS to be killed back to 2 trains a day in the Autumn. Looks like the First staff at Swindon just can't wait for it to happen!

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


Related topics: via article database

May 08, 2006

Room for Octopuses

Have you ever tried to manoeuvre your luggage in and out of a hotel room, through firedoors at inconvenient locations directly at the top of the stairs and up narrow flights that seem designed for smaller people? Yes, I have too.

This room in Scotland was a "classic" .... and we're watching and learning from such things these days. A door handle and a yale, both sprung, both without the ability to latch .... a room fit for octopuses. Yes, I do think that we can do better ...


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


Related topics: via article database

May 07, 2006

Pictures from my travels

In the last couple of weeks, I seem to have been all over the country and I've just uploaded a whole raft of pictures ... with the addition of accommodation to my "brief" this year, I'm collecting a whole load of Wiltshire snaps to use the very best on our new sites, and you'll find much of the new raw material in the wiki - pictures on the Imber ranges, Swindon's Railway history, Shear Water at Longleat and Castle Combe.

I never cease to wonder at the beauty in Wiltshire - I came across Shear Water pictured above quite by accident last Autumn when we went on the vintage bus running day from Warminster and took the service up to Horningsham, behind the Longleat Estate. I swore I would go back.

I've travelled further afield too - you'll find new pictures on Oban, Mull and Iona, The Potteries, Linlithgow, Bo'ness, Perthshire, the Worth Valley, Halifax, the Penines, Beeston Castle Manchester and Moffat.

The picture to the right of this text was taken last Monday evening an Dunbeg, near Oban in the West Highlands. A great series of sunset pictures were taken that glorious evening and it's been very hard to know which one to select and post here!



Phew! Thank goodness I'm home based for the next week or so!

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


Related topics: via article database

May 06, 2006

Why reinvent the wheel

1. Because you feel you can do better.

2. Because you've nothing else to do and you want to be busy when your boss walks by.

3. Because it's so much more fun re-inventing the wheel than using someone else's.

4. Because you can learn from your experience.

5. Because you didn't realise that someone else already HAD invented it ... but ...

In Perl programming, we encourage you to use the CPAN. In Python, the Cheeseshop and Vaults of Parnassus will save you hours of work recoding and maintaining. In PHP, there are great time-saving resources at PECL and PEAR.

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


Related topics: via article database

THE home directory or MY home directory

When a user logs in to a Linux system, the user is taken to their home directory (folder) - a place where their personal work is kept in files and a further structure of sub-directories as appropriate. Configuration files are also kept in their home directory - files like .my.cnf for their MySQL defaults and .bashrc for commands run automatically as they open a shell.

Confusingly, there's also a directory called /home - a.k.a. the home directory created when Linux is installed - that is intended as the parent directory for all user's home directorys.

For example, if I have a login account "graham" on a Linux box, in all probability the system administrator will have put my home directory at /home/graham, and the home directory will be just /home.

Under OS X on the Mac, user accounts are placed into a directory called /Users rather than /home - so that my home directory would be /Users/graham. I found this odd when I first used it, but it certainly makes for a much more understandable system when writing practical exercises for a course!

Posted by gje at 04:20 AM | Comments (0)


Related topics: via article database

May 05, 2006

Linux training Glasgow, Python programming course Dundee

We run training courses so often in Scotland that I don't even need a map anymore, except perhaps a streetmap page showing the roads in the immediate vicinity of the training venue. But how do we reach our potential client base? How do they find out about us?

Firstly, we have good and tailored web resources - if you're looking for a course for a group of 3 or more delegate, we'll run it for you at your offices. You can find out all about private courses in general here, and get a specific quote for a private course in Glasgow here. Just one or two delegates? Not a problem - there's details here. Of Course, we've also got web pages covering our Linux Basics, Linux Admin and Linux Web Server course agenda and many more.

But Firstly isn't good enough - there are two more elements to consider, and they're how to bring people to our web site (Search Engine and Marketing optimisation) and site navigation (how to ensure people land at the right page and can easily navigate to all the information the need. If they want a Python Programming Course and are based in Dundee, they'll need to find the pages that I have provide links to in this paragraph - for private courses, with a quotation, or for public courses together with information about our training centre and where we are in relation to Dundee.

How do we get the search engine placement right? The simple answer is by a lot of hard work, by providing plenty of good content that doesn't get out of date, and by analysing our visitor logs to make sure that we're targetting correctly. There's a whole series of blogs for me to write on EVERY ONE of those subjects?

And how do we get on site navigation right? By providing plenty of logical links, by providing multiple indexes, and by tuning our site for search engine arrivals - we can tell what their search term was, so let's make the links to topics that will be of interest to them bolder, and collapse directory structures on other topics that they've not mentioned in their search. We can even recall what someone used for a search on one occasion, and offer them pages based on their preferences next time they visit the site. Oops - that's yet another series of blog articles I feel coming on!

Posted by gje at 07:55 AM | Comments (0)


Related topics: via article database

Useful links: Python training, Linux training

May 04, 2006

Handling huge data files in PHP

I've handled files up to 2 GBytes in size with PHP ... but there are a number of issues to consider.

1. The size of the PHP "footprint" in memory - when you have a huge data file, you cannot simply read it all in with file or file_get_contents (nor with fread, trying to read the file all at once). Rather, you need to iterate through the file in blocks - typically a line at a time (a loop of calls to the fgets function), but I've also worked in 100k blocks.

2. You are very likely to hit the fierce time limit that PHP imposes to stop a program that's looping infinitely from hogging the server for too long. You can solve that one by increasing the time limit. See the set_time_limit function

3. Browsers will also time out (and users of your page get bored too) if you're not able to give a response quite quickly. Options to solve this include sending out a holding page / update periodically (see the manual page on flush for a discussion of this) and - the way I did it - running my PHP analysis of the huge data file as a command line program rather than through the browser.

Looking at the issue more widely, if you do have a huge data file to handle while your users visit your website, it's an excellent idea to preprocess the data to extract all the information they may need as you load the data onto the server / update it OR if that's not going to work for you, to put the data into a MySQL database which is often a much more efficient way of handling huge data that needs regular analysis on the fly.

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


Related topics: via article database

Useful link: PHP training

May 03, 2006

Linescapes of Mull

On Monday, Dad and I sailed on the paddle steamer Waverley on her annual cruise from Oban to the island of Iona, where St. Columba set up his monastery in the 7th Century - the first such Christian place in Great Britain, said to have been chosen because on a clear day he could see Ireland.

Waverley approaches Oban
Waverley approaches oban

The cruise took us out the "back entrance" from Oban harbour, down Kerrera sound and across Lower Loch Linhe to cruise off from the sheer cliffs and barren
beauty of the Isle of Mull
Southern coast of Mull
Southern coast of Mull

The atmosphere is really difficult to capture in photographs; it looks great when there, but reviewing pictures they look less like landscapes and more line linescapes - thus my letter box format. And then you have the boat bobbing about like a cork on a pond, and if you're in the cabin the windows are splishsplashed with salty water.
Mull from Waverley's bar
Mull from Waverley's bar

Iona was ... beautiful as ever; looked so serene across the bay. A huge shame that having travelled all that way, it was decided that there was too much swell to transfer us safely to tenders to get us ashore, so here's the best view I got:
Iona from Waverley's bar
Iona from Waverley

And we turned and headed back. The crew, bless them, tried to make up for the disappointment - took us closer in to the coast of Mull so that we could get some better pictures ...
Photographing Mull
Photographing Mull

... and then they carried on past Lady's Rock on the southern tip of Lismore and its lighthouse ...
Lismore, Lady's Rock
Lady's Rock

... and past Duart Castle on the Easterly corner of Mull ...
Duart Castle, Mull
Duart Castle

... then up the rarely-navigated (by passenger ship) channel to the West of Lismore seeing the Glensanda quarries that causes a huge stink when they were first proposed for this lovely spot ..
Glensanda Quarry
Glensanda Quarry

... until in the distance we could just make out through the rain and squall the shape of Ben Nevis, snowcapped still even on 1st May.
Ben Nevis capped in snow
Ben Nevis, capped in snow, through the rain

Our thanks to the crew of "Waverley" - now the last seagoing paddle steamer operational in the world - for a magnificent day out. She'll be operating around the UK coast right through to October this year - why not visit the Waverley Web Site and see if she's going to be near you!

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


Related topics: via article database

May 02, 2006

A story of goldfish

Lisa put five goldfish in our pond the summer before last. We looked at the pond the day after they were introduced and we could see three - but there was plenty of pondweed to hide the others. A day or two later we could only see one fish, and even that was nowhere to be seen a week later.

Recently, Leah came in from the garden. "I thought you didn't have any fish in the pond" she says. Well - there was one and he's this long. And indeed, looking more closely there's a number of darker fish in the pond too that can only be the originals - we've certainly never put any other fish in there!


How easy it is not to notice something, someone, some member of the back room team? Yet all contribute to the ecology of the pond, the running and the overall success of the company.

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


Related topics: via article database

May 01, 2006

May day away

I'm away for a short break this long weekend - Hi from a wet, wet Oban - passing through on the way to the Isles. COuldn't resist nipping in to this Internet Cafe.

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


Related topics: via article database