« December 2006 | Main | February 2007 »
January 31, 2007
Three sets of twins
I've heard it said that a hotel sets up a bedroom as a single if there isn't room for a double bed in the room, and as a double if there isn't room for twin beds. But our doubles aren't like that - we provide mostly double room since people, even on their own, usually LIKE a double bed. But we can split if needed and indeed this week rooms 1, 2 and 4 are both twins.

Room 2 as a twin

Room 1 as a twin
Plenty of space there - in fact you can hardly see the second bed in #2 as it's so well separated. More hotel pictures on the main hotel web site
Posted by gje at 07:06 PM | Comments (0)
Related topics: via article database
More about Graham Ellis of Well House Consultants
PHP Regular expression to extrtact link and text
How many special characters can you realistically use in a regular expression without a single space, letter or digit? Here's one I wrote yesterday.
eregi('href="([^"]+)"[^>]*>([^<]+)',$line,$parts);
Far fetched example? No - it's part of a link checker that picks out a URL and the text that appears on the link ...
Posted by gje at 05:57 AM | Comments (0)
Related topics: via article database
Useful link: PHP training
January 30, 2007
Selling by phone and Skype - our policy
Ever been "bugged" by sales calls ...as we enter the new business arena of being a hotel as well as a trtaining company, we're now being subjected to twice the number of these calls, and people are starting to sell via Skype too.
So ... for our staff ... and myself ... here's a policy statement:
It is company policy NOT to purchase supplies and services offered to us in unsolicited telephone calls, or sales contacts made via Skype. We find these cold call sales approaches to be disruptive to our work flow and ask that you contact us by post or personalised email if wish to sell to us.
I am tempted - VERY tempted - with some of the more persistant callers to suggest that we charge them for our time. Asking someone for his / her credit card details so we can put a five pound charge on their card is a wonderful way you get them off the phone ... when I remember to do it.
Posted by gje at 07:29 PM | Comments (0)
Related topics: via article database
Another frantic posting!
Are you wondering where I've been for 48 hours? Our busy life has been busier than normal! A Sunday brunch with people whom I have the greatest respect for in the travel and transport arena, a Monday Opening event at Well House Manor with local businesses, the Mayor, the district council leader, propective MP, Wiltshire Life magazine and many more. And today, answering strings of email enquiries (a very Python day!) and converting all the double rooms to twins for a full house of 8. Best news of day .... son Chris home from hospital.
Must rush - station run. Almost like old times
Posted by gje at 06:43 PM | Comments (0)
Related topics: via article database
January 28, 2007
Above the fold
Do you want to "placement" on web pages. Of course you do, but top isn't always a practical and acheived goal. But if you're looking to reach people from search / directory pages you really do want to be above the fold.
What do I mean? I mean that you want people to see your offering on the first page of results, and without having to scroll that page of results either. Thus - in printier's terms you want your advert to appear above where the paper would be folded.
I commented about the e-petitions on the Prime Minister's web site about a week ago, I think. A change remark from a delegate on one of our courses pointed me to what looked to be an ideal way to raise the profile of the appalling train service we've just been lumbered with in Melksham, and in the rest of the Bristol region. Well - I applied for a petition and it's been running for just over a week. 1300 signatures which ain't bad for a homespun local campaign with (let's be honest) no pre-planning.
The icing on the cake? On some searches, we're now "above the fold" ...

That's number 9 out of 348 petitions on transport and intracstructure matters.
This is a classic case where there's no way we'll achieve top position - but if you agree with my aims of getting an appropriate train service back, please visit the petition here and sign up. And ask your friends to do so as well - THANK YOU
Getting good search engine placement is rather like driving a big ship. You turn the propellor for an age and nothing seems to happen, then it all starts rolling along. So I'm going to pre-mention a site for First Great Western passengers that I'm working on at the moment. I don't expect much traffic for a while, but we're seaworthy enough there to start testing the engines ;-)
Posted by gje at 08:52 AM | Comments (0)
Related topics: via article database
January 27, 2007
UK legal requirements for your commercial web site
Running a commercial web site from a UK base? You need to be aware of changes to the UK's e-commerce regulations that were introduced at the end of last December without much publicity.
Your web site now needs to provide:
* Name of provider
* Email address at which you can be contacted
* Registered office and geographic information
* Regsitration number and place of registration
* VAT number if you're VAT registered
* Prices with clear VAT and delivery costs information
Other regulations apply to Email, SMS, Caching, online contracts, liabiities, etc. I'm no expert on these matters - so have a look at out-law.com
A quick check confirms that, yes, we have all that information here, and more too. Really, the new law is bringing things into line with best, reputable practise.
There's a raft of other regulations too - the disability discrimination act, copyright, libel, racial and religious discrimination, decency, distance selling regulations and so on ... all need to be taken into account too. More resources under the commecial aspects of running a website which you and all your developers and content providers ought to be aware of.
Posted by gje at 09:05 AM | Comments (0)
Related topics: via article database
January 26, 2007
Sorting people by name in PHP
Our petition for a reasonable train service is going great guns - over 1000 signed up in just over a week, amongst them significant players such as MPs, MEPs .... but, my goodness, the list as presented by the web site is hard to look through. So I've grabbed a copy of the list and sorted it - see here.
Sorting by name is not straightforward!
If you just do an alphabetic sort, you get everyone with the same forename first - I've got a customer who does that with their internal phone directory and, goodness, it's awkward to us. So you need a sort routine thats sorts based on the LAST space separated word.
Except that there's a group of people who add things like "MP", "MEP" and "MBE" after their names and that becomes the final field. Actually, I want to highlight those people into a separate list.
and then some MPs and MEP sign up and DON'T add in their 'letters' ....
If you want to have a look at my solution to the awkward sort, I've added in the source code to my training examples and it's here. It works well, but in some cases there's no east way that adding in specific tables of exceptions ....
Posted by gje at 07:25 AM | Comments (0)
Related topics: via article database
Useful link: PHP training
January 25, 2007
Learning to write secure, maintainable PHP
We're running a PHP course this week, and as ever I went around the room on the first day checking with the delegates what their "hot points" were, noting them on a board to the side to ensure that all the points ARE covered.
Security and maintainabily came up. And came up strong. Duly noted on the board, and aspects were covered right from the start of the course. These are vital subjects and it's no good at all learning just the mechanisms of PHP without being aware of these issues. You can write a dog's dinner in which all manner of traps could lurk, or you can produce a Picasso - and you should plan which from the very first paint stroke on the canvas!
So I'm delighted that my delegates are concerned about ... security, maintainability, fitness for purpose, usability, extensability. It tells me that they're on the right PHP course, and it's a pleasure to have their early inputs.
Posted by gje at 07:59 AM | Comments (0)
Related topics: via article database
Useful link: PHP training
January 24, 2007
Too busy to blog it - but it's great (mostly)
I try to write a blog entry every day - indeed, I feel an irrational guilt if I don't put something up by midnight and it takes an exceptional day for me to miss out completely - but that happened yesterday. So perhaps this is goin to turn into another of those "geeze look at my busy day posts".
Started - 05:30 preparing breakfast for 06:00. Ended - 00:45 when we got back from the RUH (Royal United Hospital) in Bath. In between ... a day of training a full class of eight. The usual "stuff" of running a business. Telephone calls to return to the press concerning the train petition that I started late last week and has now got over 600 signatures, including 5 MPs and 3 MEPs. A meeting of Melksham First to push forward on their plans for town rejuevanisation.
May I quote from a letter received on the train 'side' of things? " Just a letter of thanks to say there are a lot of us that have not been involved that appreciate your efforts. Unfortunately, those who commute usually have a job to do ....".
Funnily enough, I have a job to do - several of them. But time can be and is made. Yesterday was the exception in terms of length and I may suffer tiredness today, by that's how it goes. I have to say I enjoy the "zing". I really appreciate notes such as the one I've quoted above. And I really, really appreciate the help and support of all of those around - work colleagues and especially family and double plus especially Lisa. Couldn't do half of it without her.
You notice a "mostly" in my title. The trip to the RUH was because my son had just been in a road traffic accident and - well - I just WANT to be there and offer family support and I felt that we were useful last night as the events unfolded. Although it was a fraught evening (with a touch of black comedy when they reported that they had lost the patient); although Chris remained in hospital overnight, in the huge scheme of things it could have been so much worse and it brought familiy together.
Posted by gje at 07:21 AM | Comments (0)
Related topics: via article database
January 22, 2007
The HTML++ Metalanguage
What's the difference between a language and a metalanguage?
A language is a single specification - a way of describing a series of actions or how some particular data is handled. Whereas a metalanguage is a way of specifying a series of languages to a particular pattern.
An example? HTML is a language. There are different flavours (slightly) but basically it's a single language. What I descibe as HTML++ is a metalanguage - a way of adding to HTML to make it rather more that just HTML. Examples of HTML++ metalanguages include JSP, PHP, ASP, Rails, Eruby, EmbPerl, SSI; all differently languages as you need different compilers / interpretters to handle them, but all extending basic HTML in a similar way.
In the same way, XML is a metalanguage, and implementetations of it include XSLT, RSS, and many more from SOAP to Tomcat configuration files.
Update - January 2010 - we have added an optional Ruby on Rails day to our Ruby courses because it is becoming so popular - see [here]
Posted by gje at 08:04 PM | Comments (0)
Related topics: via article database
January 21, 2007
Java 6, Apache Tomcat 6.
I greet new releases of software that we teach with a joy that the software is moving forward, but with an element of trepidation - "what's changed" I wonder. Although programming languages rarely change in that they render the old code incompatible, thre are often changes in default configuration files over and above any additions to the product.
Java 6 and Tomcat 6 are with us (well - at Beta release at least for Tomcat). Did I rush out and change all my courses? No people don't upgrade their servers with anything like any haste, and a course based on a product that is in advance of what there employer is running isn't doing them any favours in the short term.
So this week's course ran with Java 5 and Tomcat 5.5. But with one eye to the future. On one of the systems we were using for practicals, we downloaded the very VERY latest Betas that were available (thank goodness for our high internet-to-trainee speeds!) and installed them; had they blown up in our face, very little would have been lost but - as is usual - a few things are in different places, some of the sample / default config files have been changed but basically it's all much the same. And that means that the delagates leave knowing primarily about their current system, but also a little of where things are headed.
Apache Tomcat's main configuration files have been, and remain in the conf subdirectory:
server.xml - the main file that configures the server, the service, the engine and the host (each via nested XML tags) and also the connectors. By default, shutdown, htttp and ajp connectors are swithed on, with comment samples for https and http proxy.
web.xml - the initially loaded file that's used for URL, MIME type mappings, and other web settings such as home page location (known as "welcome page") and session timeouts. This file is suplemented by settings in each web application's own web.xml
tomcat-users.xml - a file that defines realms and roles for users. We set it up on our courses to allow the manager application to be used to stop, start and deploy appications although we point the trainee at database and ldap alternatives too. The biggest change in the config files at release 6 is here, as the sample users provided in prior versions are no longer present.
Posted by gje at 12:51 PM | Comments (0)
Related topics: via article database
Useful link: Java training
Getting rid of people - hotel techniques
"Get rid of her first, then deal with the three men"
You can imagine the line from a Hollywood movie, can't you ... but this is Melksham, last Thursday evening. And the line was overheard by one of our friends from her seat in the restaurant, eating alone and already feeling somewhat uncomfortable. "Formal wear only" and a menu that insists on you choosing two courses as a minimum, cordon bleu food that takes a while to prepare, is great for a romantic evening but not if you're in town alone.
Now let's be fair - it could well be that the talk was technical kitchen talk, arranging the order of service. In fact that's more than likely the case. But it scarcely helped to make the customer feel at home.
We don't run a fine restaurant - we can and do cater as required for groups, but we feel that our own visitors prefer the less formal environment we offer, with a wide choice of local eating places they can go to or bring in a takeaway meal; it's a very different market, and I revel in the difference. We could conside this other place, which is just a couple of streets from our own Well House Manor to be competiton, but we don't - there's a big difference between a restaurant with rooms and a business hotel and although people may occasionally book into "a" when "b" is more in tune with their needs, the competition will be minimal.
What IS common to both "them" and "us" is the need to provide the customer with the service that's sought, to put yourself in their shoes, and to avoid making any comments - whether or not you think you're in earshot of the guests - that could be taken the wrong way. Indeed that's a good general rule; if any of you happen to be watching "Celebrity Big Brother" that's running at the moment, you'll have just seen Jade ejected amidst a great deal of coverage. Comments that she made appeared to be racist - she swears that they weren't.
Posted by gje at 07:41 AM | Comments (0)
Related topics: via article database
Maintainable code - some positive advice
Don't ask what class an object belongs to
Don't enquire where your cursor is
Don't do two things in a call
Don't duplicate data or code
Don't put two or more values in the same cell
There's lots of different ways of coding - from "dog's dinner" to "Picasso". The dog's dinner looks a mess and is very quickly gone and forgotten (even by the dog, who wants more), but a Picasso is a piece of beauty and lasts for generations. We can all feed the dog, but very few of us are Picassos. What we can all do is to make a good job of decorating a room so that it lasts and looks fresh for a year or two, and functions well without redecoration for pehaps 5 or 10 years.
The first time you slapped paint on, as a child, it wasn't going to last for even a year, was it? But with practise and applying a bit of discipline to yourself, you can do rather better now? Thought so! And it's very much the same with coding; your first program on a Perl course or your first MySQL database will be written to test basic functionallity - to check that you CAN store that data / stick that paint roughly where you want it on the wall. Improvements come once you understand the mechanism and have tested it.
Here are some of the improvements that you can make between "first test" and real application:
Don't ask what class an object belongs to. Use polymorphism, so that no matter what type of object you run a method on, your code will automatically do the right thing. If you redefine what an operator or method does (oveloading) by defining two blocks of code with the same name and footprint, then your need for lots of switches or if, elif, elif, elif sequences is eliminated.
Don't enquire where your cursor is, or what status your application is in - remember it in your code. Any piece of code that goes out to discover where it stands / what step it's at gets complex and hard to maintain - and such enquiries are prone to error. Much better to remember - it's often as simple as having a single integer status variable.
Don't do two things in a call. You want to format a piece of data and print it out? Sure - write a piece of code to do it and it'll work well. Until, one day, you want to format the data and do something else with it. Put it up on a widget or burn it into a graphic, perhaps. And the piece of code that's called from all over your program to do "a" and "b" suddenly doesn't seem so clever as this time you only wasnt "a". Much better to write code that performs a single logical operation in a single call; you can always write a wrapper to bring two commonly used operations together if you need to do that frequently.
Don't duplicate data or code. If you find yourself cutting and pasting code - WRONG. You're creating a branch which will give you two threads to debug, maintain for the life of the code. Better to take the code that's going to be used several times over, give it a name (i.e. make it a function, sub, def, proc) and call it by name. "But I need to change some things in the copy" you say. Yes indeed - those things you need to change are helping you to identify which elements are your parameters.
Don't put two or more values in the same cell. As soon as you start putting comma separated list, multiple space separated names or whatever in a string or database cell, you have an issue with the commands or code that searches them. One value per simple variable, one value per cell please. In programming terms, you can use lists, tuples, dictionaries (Python), arrays and lists (Tcl), hashes and lists (Perl) and arrays or any one of the many utility classes (Java). In database terms, you're looking at an additional table and a join. The decign may get more complex, but the data is kept simpler and unique. Find a data error and you've just one correction, not a multitude!
Why not review your coding against the suggestions I've made above? Get into the habit of following the guidelines suggested. And you'll find that you naturally move from producing a very temporary solution to an issue to something that will, far better, stand the test of time.
Posted by gje at 06:42 AM | Comments (0)
Related topics: via article database
January 20, 2007
Bounce, bounce, bounce
Is it frustrating to make a phone call and to transferred elsewhere, or to email someone and get an "out of office" with a note your email has been forwarded? No - a single transfer is acceptable on the lines of "I'm putting you through to Lisa who can take your room details" or "I've forwarded your email to Christine who will get back to you with catering options". And if Lisa, Christine, Tom, Dick, Harry or the other area expert isn't available to take a transfer, then taking a note of the call's details and question and promising a call back - with a given timescale and the name of the call returner stated - is good practise. The more so if the person has actually researched the answer when they call back.
I sent out a batch of emails yesterday ... and some of them bounced via "vacation" programs. Those that say "your email has been forwarded" need no further action on my part and I can smile. Those that give me alternative contacts that I have to re-email make me grit my teeth and do that extra bit of work. And when I've done that extra work, those that come back from the alternative contact's "vacation" program too have me rolling my eyes to the ceiling and saying 'what a shower'. The reponse that tells me that my new contact is out of the office moving house from 3rd to 5th September and I should get back in touch with the person I contacted in the first place really takes the biscuit!
I don't use a vacation program. Period. I tell people I'll email them back within 48 hours (but often achieve much better), and if I'm away and happen to be unable to check in, alternative arrangements are made to maintain service without troubling the original emailer.
Moving more into the general business line with hotel phone calls, we should be looking to maintain the same standard. Personally, I find phone calls intrusive as they pull me off concentrated effort, but there are time that they're appropriate - emergencies, things that would take an age of back-and-forth emailing, and so on. And I shouldn't let my personal bias effect the standard we offer.
Conscious effort to be made. (1) - phone calls on ANY of our lines to be answered with a clear statement of who we are, who is speaking, and an offer to help. (2) - a target that 80% of hotel queries and 40% of training queries can be answered by the person who picks the call up. (3) - a caller should never be told to call another number. Rather, we collect details and one of us calls back if need be; target time given to customer and (hotel side) "within the hour" sounds good to me.
"Bounce, bounce bounce" I started this piece - and that didn't relate to bouncing happily along. Bouncing contacts from pillar to post rapidly takes the spring out of them. We've been past masters at responding to training queries in "mint on the pillow" mode and we're learning and targetting the same on the hotel.
Posted by gje at 07:49 AM | Comments (0)
Related topics: via article database
January 19, 2007
Bang! Train campaign hits home
Right at the tail end of the second full day of the train petition I mentioned yesterday ... and we're already in the top 150 petitions out of over 2000. Not bad - it shows that people ARE concerned and we can reach them, that they'll sign up there names.
Not a regular reader? Campaign is for an appropriate train service, basedon but not necessarily identical to the one we had before the swinging cuts in December. My main concern is the Swindon - Chippenham - Melksham - Trowbridge - Westbury - Warmisnter - sSlisbury service - see here. Petiton is here and also covers better train service for everywhere from A to Z in the area - Avonmouth, Bedminster, Clifton, Dilton Marsh, Eastville, Filton, Gloucester, Henleaze ....
Posted by gje at 11:59 PM | Comments (0)
Related topics: via article database
January 18, 2007
Call for appropriate train services - Swindon, Bristol, Bath, West Wilts, Severn Beach etc
Regular readers may have come across the Save the Train web site which I help with. A disasterous timetable change last December crippled the usefulness of local trains based in Wessex - there's not just one line effected; everyone is up in arms! Yes - Melksham is worst effected but I'm working today with someone who used to be a regular Bedminster to Filton passenger when the service was appropriate ...
I came across a site actually run by the Prime Minister's office that allows people to set up a petition to the PM. Of course, petitions are vetted, but to my surprise ours has been accepted. And each person who signs up will get an email telling them of the outcome once it has closed and been considered.
If you feel that you would like to support us, please visit the petition page at http://petitions.pm.gov.uk/wessextrains/. If you want to know more about the cause before you sign up to it, have a look at more detail here and here.
How are we doing? The campaign hasn't yet run for a full day and already we're in the top 300 of 1900 petitions, some of which have been running since last November. Amongst the names to have signed up, I note 3 members of parliament, at least one candidate for next time around, and many other respected dignatories. Not bad for a an issue that relates just to a particular region!.
A thought - if YOU decide to join us in signing the petition, would your friends, colleagues and travelling companions like the opportunity too? If you think so, please point them here or at the site. Thanks!
Posted by gje at 04:19 PM | Comments (0)
Related topics: via article database
Sending an email from Python
Good question - came up on the course yesterday and all the examples I could find were longwinded or obfursacted to avoid them abusing the email addresses of the people named.
At the risk of getting lots of people trying this out and filling my mail box, here is a sample piece of code that emails grom graham@wellho.net to graham@sheepbingo.co.uk in Python, with the subject line "greeting from here" and the body just saying "Hello World".
# Emailing from Python
import smtplib
from email.MIMEText import MIMEText
# Set up a MIMEText object (it's a dictionary)
msg = MIMEText("Hello World")
# You can use add_header or set headers directly ...
msg['Subject'] = 'greeting from here'
# Following headers are useful to show the email correctly
# in your recipient's email box, and to avoid being marked
# as spam. They are NOT essential to the snemail call later
msg['From'] = "Graham J Ellis
msg['Reply-to'] = "Graham Ellis
msg['To'] = "graham@sheepbingo.co.uk"
# Establish an SMTP object and connect to your mail server
s = smtplib.SMTP()
s.connect("www.wellho.net")
# Send the email - real from, real to, extra headers and content ...
s.sendmail("graham@wellho.net","graham@sheepbingo.co.uk", msg.as_string())
s.close()
In our case, the machine I'm running the script on is not a mail server, so I've connected to a machine that is in the connect method. And, before you try it out, please note that our outgoing mail server is not an open relay. In other words you will need to change that to your own outgoing mail machine - it won't work for you one mine.
Posted by gje at 09:14 AM | Comments (0)
Related topics: via article database
Useful link: Python training
Nested exceptions in Python
Yes, you can nest exceptions in Python - here's an example from yesterday's course.
I'm reading in lines from a data file and counting the numbe of occurrences of a particular series of events in a dictionary of dictionaries.
An exception is thrown if a counter doesn't already exist ... we'll catch that and create the extra counter if we have to ... excpet that ...
The incoming data line may be a short header, in which case we ignore it.
Here's the code:
import urllib
fh = urllib.urlopen("http://192.168.200.67/data/access_log.xyz")
counter = {}
goofs = 0
while 1:
line = fh.readline()
if not line: break
hinfo = line.split(" ")
try:
counter[hinfo[6]][hinfo[0]] += 1
except:
try:
counter[hinfo[6]] = {}
counter[hinfo[6]][hinfo[0]] = 1
except:
pass
print counter
print "problem count =",goofs
Remember that in Python, you inset code to indicate your block structure, and that the pass statement can be used to create a do-nothing block.
Posted by gje at 08:19 AM | Comments (0)
Related topics: via article database
Useful link: Python training
January 17, 2007
Learnt in London - Ruby, Martini, Coral and the Core
We're only a fortnight into the new year yet, already, I've spent two fascinating and very different evenings in London meeting up with other users of our technologies and listening to visions for the future. Training is all about planning for the future ... and networking and learning about other's vision for the future so that we're prepared.
Here are a couple of background 'snippets' that I'm pushing up - things that I didn't know or hadn't thought of on the 1st January, and I've learnt on my London evenings since.
Core, and the Martini Culture.
Where will we be with media and training in 8 years time? A core of data - feeds in form all the different recording technologies to a central multimedia resource, with information from the core edited and produced into anything from a short audio clip to a 3D imac movie, to a virtual reality experience. Transcending fact, docu-fiction and fiction. And program content, training content (our own niche) and other data presentation.
The Martini culture - what you want, when you want it, how you want it. Your choice.
Origins of Ruby
The writing of Ruby started on 24th February 1993, and the first release was in 1995 and numbered 0.95. Ruby wasn't the only possible choice of name for the language - "Coral" was considered as an alternative and discounted quickly.
Such facts don't really make and difference in how you code ... but they're useful and interesting background for the inquisative mind, and the sort of thing that give some idea into how things tick - especially when learnt from those practioners involved with such things.
Posted by gje at 07:59 AM | Comments (0)
Related topics: via article database
Useful link: Ruby training
What the customer is looking for - effective training
Yesterday evening, we were invited to a BBC preferred training suppliers evening in London, to learn a little more about their staff training. There have been big changes in the organisation of training we do for them in the past year, and we welcomed the opportunity to here a little about what their "hot points" and objectives are, what they're especially looking for, and how their needs will develop in the future.
I've always apprceciated that our Perl courses are very much a niche and form a tiny, tiny part of the BBC's training budget, even though they're an important customer to us. But it came home to me last night just how tiny, and how niche.
The head of training was talking about 27000 days of training delivered to staff each year about budgets of ... well, never mind, I shouldn't quote the figure here even though they're clearly in the public domain - there were hundreds there last night, and everyone else in 'the business' heard the numbers too.
I've often marvelled at the quality of delegates from the BBC - we meet some superb people from a lot of organisations, but there seems to be something special and consistent about people from "the Beeb". Listening last night, it became clear that this is very largely due to good staff selection procedures, and a dedication to training which seems second to none. And oh boy, does it pay dividends.
Actually, much of the presentation related to training of major groups (journalists, authors, directors, camera crew, managers) for whom courses are run at BBC offices on a regular basis - a world apart from what we do with trainees coming to occasional private courses or public courses here in Melksham. But what did relate, across the board, were some of the more general things.
* The importance of setting training objectives prior to training, and of being prepared for the training.
* The importance of training being done at the right time, and put into practical use upon the delegate's return to his/her work.
* The importance of evaluating training for effeciveness, with a drive towards measuring return on investment.
From generality such as these came specifics - of how modern technology can help make more training available at the RIGHT time ("not JUST the e-learning argument), of consistency in evaluation so that key indicators can be followed and understood without change to the statistical base, and more.
The conclusion of the evening? That, basically, we're in tune with our customer and providing the type of service / product that he's looking for. But never the less giving us a handful of areas - technologies, crisping up of technique and perhaps a couple of formalisations - which we should implement to move forward with our training product so that it's not only an excellent fit for requirements early in 2007, but also early in 2008, early in 2010, and in 2015 which was indeed mentioned on some of the slides. We love working with forward-looking customers!
Posted by gje at 07:19 AM | Comments (0)
Related topics: via article database
January 16, 2007
Know to the police
Should I be worried when the local police(wo)man knows me by name?
A car accident on the corner just outside "Well House Manor" in the pouring rain. The bang could be heard from The Manor, and Martin and I go out to see if we can help. Three vehicles have come to rest in various inconvenient places; everyone seems OK, but shocked and traffic is building up.
Old habits die hard. What's needed. Medical? No thank goodness. Emergency service calls? Done already. Traffic direction. Funny how a skill taught and learnt over 30 years ago comes back, isn't it? Did you know I used to be a lollipop man, on a busy corner / roundabout at the top of an urban dual carriageway? I confess, I quite enjoyed keeping the traffic moving from 4 roads, each one at a time. And watching out for schoolchildren too / a quick word to make sure they knew to wait, and the balance between getting as much traffic through in big chunks and people getting frustrated at waiting.
One of the neighbours popped out with a brigher jacket than I was wearing - visibility is vital, especially as two of the sets of traffic were stopping a ways back. And then - thank goodness - up comes a police car ... with the officer going first to check on the accident and people involved. Then she comes over to me. "Thank you Graham" (yikes - known to police). "My pleasure, Anne - would you like to take over". "No thanks - you're doing fine. I've got someone coming along to take over from you ...." and sure, after a further five minutes I was relieved of duty.
I hope that some of the teaching and training that I do stays with people as long as the quick lessons I had from, tutor unknown, on traffic control. I suspect I was taught by David Howie who once refereed a final at Wimbledon, but that's a story for another day. I'm getting dry and calm enough now to stop blogging and get back to a letter on Zope.
Posted by gje at 08:23 AM | Comments (0)
Related topics: via article database
Impact Engineering and Backscatter
Here are two new technical terms for you that I've run across in the last few days. Can you guess what they refer to, or do you know them already?
Impact Engineering .... hitting a piece of equipment, typically but not always with a hammer or fist, in order to persuade it to work.
Backscatter Those irritating emails that tell you that your email to xxxxx could not be delivered ... when you have never even written to xxxxx in the first place.
Backscatter is typically caused when mail servers reject bulk emails that have been sent out by a 'spammer' or spamming program that's pretending to be you in their email address. As postmaster for a number of domains, my mailbox tends to collect quite a bit of backscatter; some of the spammers make up "from" addresses at known domains and I get those in addition to the more sophisticated ones that have hijacked one of our true addresses.
Recently, I've noticed a disturbing trend in services which are offering to protect their clients from spam by asking the originator to confirm that they're genuine. The very fact that these services ask means that they're highly sceptical about the original email, so they KNOW they're generating backscatter. "An unfortunate side effect of our system" one wrote to me. Hmm; if the service knows that the sender address is probably forged, isn't it generating an unsolicited email when it writes to the true owner of that address to ask about it>. And if the service is charging clients for its automated activity , doesn't that make its backscatter emails into unsolicited bulk commercial email?
Yes, these people believe that it's all right for them to send out spam ... in the very act of discouraging others from doing so. One rule for you, and another for me? Ick!
Posted by gje at 05:29 AM | Comments (0)
Related topics: via article database
Python Qt, wX, TkInter, and Jython - training??
Superb technologies which are included in our Python course notes for this week, but are being left OUT of the presentations. Why? Because our courses are tailored and the Web / Zope / Plone brigade is prominent this week. With group sizes that do not exceed 8 on our public courses, we can afford to tailor the material we cover to suit the needs of that 8-or-smaller group.
But please rest assured that if you attend our Python course next time it runs - that's within 2 months - then we WILL cover all the advertised topics you want. In full course weeks where we have a disparate range of topics to cover, they're balanced equally. At other times, the course is dynamically tuned to help the delegates get even more out of it.
Posted by gje at 05:21 AM | Comments (0)
Related topics: via article database
Useful link: Python training
January 15, 2007
Longer hours and better value courses
Last year, we started at a quarter to ten on the first day of our courses, and ended at about half past four on the last day. And indeed, hours like those are standard for EVERY day at some other establishments. How long lunch takes can be a significant factor too!
This year, we're starting daily at 09:00, and scheduled daily to 17:00. We may finish a little early on the last afternoon if all material has been covered to everyone's satisfaction, and we're dab hands at moving specific topics needed only by one or two trainees to the very end if other need to leave sharply for the airport or station.
But the customer experience extends even further than the extra hour. Our training centre, network, library, equipment is open to residential delegates 24 hours a day - giving good opportunity for another "go" in the evening and a quick revision before breakfast too. And for all delegates, whether or not they're staying, the tutor will be around from well before 8 (as I am this morning) until 6 or later on most days. When you come on a course, you need time to consolidate your learning as well as just attend the lectures.
Of course, we're unusual in that most of our delegates travel a long way to learn here (a niche business, and wherever we were people would have to travel), so we're fortunate to be able to offer this intensified and more effective training.
So how about going a step further? How about evening lectures? No. Or even "hell, no". There's a limit to how much people can take in during a session and during a day, and that would exceed it. We would be on to a diminishing return, exhausted delegates, complaints of a course they couldn't cope with. Better - much better - to make positive use of the time revising, discussing individual applications with other delegates and the tutor, and, yes, a tiny bit of socialising too.
Training limits:
* For a single type of session (e.g. lecture or practical), each session should be limited to ONE HOUR.
* A 15 minute nicotine and caffeine break should be taken every TWO HOURS
* Morning and afternoon sessions should not exceed FOUR HOURS of formal lectures or practicals each.
* The lunch break should not be less than 30 minutes, and should not generally exceed one hour.
There you have it - my formula for getting the most, and most effective, training done of your delegates.
With small class sizes and a course that's tuned as we run to cover the topics in the most effective manner for the group we have, we can achieve in 4 days what would take 5 if we increased our group size and used a prescribed standard presentation. Dear Reader, I wouldn't want to stretch it out to five days - I have plenty else to do, and I'm sure your delegate have too ... and you're paying them for every day they're here and not at their desks, aren't you?
Posted by gje at 07:35 AM | Comments (0)
Related topics: via article database
The new web site look spreads
If you explore our web site deeply, you'll see that over the weekend more of the pages have slid across to the new navigate, look and feel. Although the site has been highly parametrised for years, changes as radical as teh underlying one here are not going to be quick and straightforward, and there are still pages to go through. And - my - we have a lot of resources at hand.
"How do I put a long multi line and tagged string of text into a PHP variable within my program?" I asked on Skype last night and, sure, I had an example to hand on the Web Site. "Kewl" writes my correspondent - "and on YOUR site". That's the depth of it - let's just hope the new navigation helps more people find what they need here. Certainly, the right hand menu which now takes people to similar pages (sibling resources) if the hit slightly off target at first should help.
So we've done ..
pictures, Wiki pages, forum archives, training from [country] section, technology overviews, Individual training modules, Hourse's Mouth arhive, technical articles, source code examples, site usage statistics and of course course descriptions. Phew! a few hours sleep, I think!
Posted by gje at 03:00 AM | Comments (0)
Related topics: via article database
January 14, 2007
Empty at Easleigh, Missing at Melksham, Overflowing at Oldfield
"The Department for Transport are quite upset at pictures of trains stored at Eastleigh that have appeared, and will probably store units that aren't in use in more secret locations in the future".


I think they mean pictures like that. These pictures were taken on 7th January and published on Save The Train within 48 hours. I didn't take them, but I did have permission to use them.
Why are the DfT upset? Because they appear to have got themselves and the railways in our part of the country into a very silly state, where trains on some lines are overcrowded, on other lines are running at time when the customers don't want them. And they've put the best part of 20 trains into storage leaving an insufficient fleet to cope with the new timetable and the traffic offered. And even more ludicrous ... the way railway finances work, they can't simply send a driver down to Eastleigh to bring back a few of the "warm storage" trains. What a screw up!
I've been involved with "Save the Train for a year and a half now, and sometimes I despair at the stupidity of the system that's let us get to this pretty pass. No-one will admit to being happy about the situation, but everyone points out "railway" (1) and "safety" (2) and "complicated" (3) which mean things (1) have to be planned at least a year ahead, (2) cost 10 times what they did a few years ago, and 100 times what you would expect, and (3) that the members of the public like myself who want to use the service aren't consider knowledgeable enough to have our inputs - suggestions, comments and thoughts - listened to with any seriousness.
I'm not saying I could do better - there are some very good people around, and a lot of workers on the ground working their butts off to try to get passengers through and trains back into service - but I really do wonder if a breath of fresh air would do wonders in certain high quarters.
I don't think anyone who has pointed out the apparent craziness of the current situation is doing so with the prime intent of embarrassing anyone - certainly the intent in my small way was to help people turn on a few lights, make a few connections and - what a big hope - look and see if THEY can do anything. Alas, it has been suggested that pictures that have appeared in various places are more likely simply to ensure that future storage locations are likely to be chosen because they're not visible to the railway's customers ....
Posted by gje at 07:58 PM | Comments (0)
Related topics: via article database
January 13, 2007
Chronic fatigue help - a new discussion forum
Chronic fatigue is not a condition, but a symptom of a great many things. To reduce and eliminate chronic fatigue, then, you need to correct the underlying causes. What works for one person will, perhaps, leave another all the more tired as there's a real need to treat the condition and not the manifestation.
If you're chronically fatigued, what can you expect from your doctor, from the rest of the National Health service, and from your employer? How about family support - are they understanding and helpful? Do they try to help but end up hindering and leaving you all the more tired, or do they just think you're a lazy layabout?
I've got involved in setting up a number of discussion forums in my time - some I actually control and moderate, and other such as the Chronic Fatigue Discussion Forum I'm very much on the periphery of. But I'm proud to have been able to give a little help to Delene and Chris ... who would welcome you at the forum. It's early days yet - the boards are quiet - so you're guaranteed a good, thoughtful response to questions asked and point made. I encourage you to ask.
Posted by gje at 09:09 AM | Comments (0)
Related topics: via article database
robots.txt - a clue to hidden pages?
The robots.txt file is designed to provide spiders and crawlers with a list of places they should NOT go - it's described as the "robot exclusion standard" file and its intent is to allow the webmaster to segregate his site into indexable and non-indexable.
But because it lists directorys to be excluded, robots.txt is often an excellent source of links people don't want to be found. I have numerous examples that I've seen (and will NOT reproduce here!) where directories that are not for public consumption are listed. And - in theory - I'm perfectly at liberty to read the site's robots.txt with a regular browser then step through the places that robots are excluded manually to see what's there.
If you want to protect areas of your site from prying eyes / accidental discovery, do NOT rely on robots.txt - use a passwording system or some other form of authentication.
Our robots.txt file - which I'll happily reproduce here - lists URLs that I don't mind people finding - I just don't want them indexed. So even if they're looking with malicious intent - which I doubt - they won't "get" anywhere.
#
# robots.txt file for www.wellho.net and www.wellho.co.uk
#
# we encourage robots to visit and index almost ALL documents
# but not any executable scripts.
#
User-agent: *
Disallow: /cgi-bin/
Disallow: /net/unique.html
So all robots are allowed anywhere EXCEPT to cgi scripts, which we don't want indexed. On our site, all such scripts change their reports regularly and depending on the information entered, and so it would be misleading to encourage indexers to list them.
The /net/unique.html page is sortof-internal. It's generated by one of our site scripts and lists words that occur only once on the rest of the site. Purpose? to help us find spelling mistakes! I don't mind anyone seeing the page - and indeed I've just provide you with a link to it in this article - but people REALLY won't want to land there when they do a search!
Posted by gje at 08:23 AM | Comments (0)
Related topics: via article database
January 12, 2007
Hotel for Trowbridge
Tailored for the business traveller ... our rooms all feature wired and wireless internet connections (broadband), large, flat screen TVs, large uncluttered desks with plenty of power points, mini fridges, laptop safes. And that's in addition to the hospitality trays, en-suite facilities, etc, that you would expect to find in any high quality hotel. Oh - and all of our rooms are double or twin to give you that extra bit of space, or to enable your partner to join you.
Beyond your room, we have real fresh coffee and tea available 24 hours a day, we have a public access internet PC (with a printer and copier), plenty of parking, 3/4 of an acre of grounds you can walk around, and we're set in a quiet location just a few minutes walk from the town centre. We don't cook food in the evening - there's plenty of choice of pubs, restaurants and takeaways within a very easy walk, And we do happily provide cutlery and crockery, and a microwave, for you to use if you want to bring food in.
All our facilities that I mention are included in your room rate, as is a superior continental breakfast, served daily from 7 a.m. or earlier on request.
This is a somewhat different set of features for a hotel, isn't it? Well House Manor is set up for the technical business traveller to the area, and we don't compromise the facilities we offer in order to tap other incompatible markets. Our prime business is actually computer training - offering specialist courses for which delegates, sent by their employer, typically travel hundreds of miles. And we've learnt over the years what these people need, what they need to avoid, and what their typical likes and dislikes are. We travel ourselves, too, giving courses a long way from home and staying in hotels - where we can learn the bad and the good and bring the good back to Wiltshire.
"Hotel for Trowbridge" I've entitled this piece. We're in Melksham, a ten minute drive from the White Horse Business park. Our facilities are unique for West Wiltshire, I believe, and we've been quite surprised as to how wide our catchment area is. If you're a regular reader of this column, please forgive my shameless marketing piece. If you've found me through a search and you're looking for a hotel to stay in when you're visiting Trowbridge, Chippenham, Melksham or Devizes ... then look no further. You've found somewhere that's on your wavelength. We look forward to welcoming you to Wiltshire.
-- Graham Ellis
Posted by gje at 07:01 AM | Comments (0)
Related topics: via article database
January 11, 2007
Our search engine placement is dropping.
A year ago, if you did a Google search for Birth Notice, you would be sent to the Well House Consultants web site here, but now we're not even on the top page.
Search for Clock Image and you would come, top hit, here, and under Vancouver Skyline you would find us right at the top here. A search for Bristol Airport Arrivals brought traffic here
None of these searches will bring you to Well House Consultants in the top 3 any longer, and some are a long way down. But whilst I'm a little sad that my favourite demos - my party pieces - are no longer effective, I'm glad at the improved data mining efficiency of the search engines. For it means that people are not being brought spuriously to our site, and that they ARE coming here more effectively and when we're right for them. Our traffic is up, our search hits are up.
Here are some hits that will bring you, currently and correctly, to us - all "top 3" rankings too:
MySQL Left Join
Python Tuple
PHP upload image database
Ruby Course UK
Melksham Hotel
Perl Ftp
Tomcat Course
There's still a few surprises around. A search for Wiltshire business of the year brings you here, but I guess that I shouldn't be too surprised - we are indeed finalists, we're proud of our business, and we did have the judges round to impress them with our outfit on Tuesday. And how better for a company that's heavily into IT promotion than to have such effective IT promotion itself!
Posted by gje at 07:48 AM | Comments (0)
Related topics: via article database
January 10, 2007
Linux / Unix - process priority and nice
| Visit certain theme parks, stand in queues for the rides. OK - that's fair enough at time. But then see folks with "fast pass" special tickets go the front and get, more or less, straight on. You may have seen the scenario .... But look carefully, and the operators never let the whole of the fast-track bunch through at once. If there's a queue there too, they'll clear it rapidly, but still keep a modicum of flow running from the main lines. | A similar thing happens with Linux / Unix tasks that are awaiting the processor - known as "runnable"s. There's a concept known as "niceness". Default value 0 - standard queue. Positive value - a process that is nice to others and hold back, so lower priority. And a negative value - a process that barges in and gets higher priority treatment. But there's NOT an absolute rule that runnables are started are run without limit in the order "least nice first" - there has to be some sharing and although the higher priority processes will be kept waiting far less, they will be kept waiting on occasions. |
Posted by gje at 11:12 PM | Comments (0)
Related topics: via article database
Useful link: Linux training
January 09, 2007
Cue the music, I'm happy.
I'm not musical ... but this song keeps jigging around in my head.
"I'm back in the saddle again.
Out where a friend is a friend,
where the longhorn cattle feed
on the lowly gypsum weed.
Back in the saddle again."
First course of the New Year ... done, run and I love it!

Lining up the systems to check 'em out - a variety of Suse and Fedora Linux, and Windows in this case

A diagram - how PHP4 and PHP5 differ when you copy a variable that contains an object; PHP4 really clones - i.e. duplicates - the object, whereas PHP5 gives the same object an alternative name.

What's it really about - the customer. Snap taken during an exercise. And a great group ... including Adrian who, it turns out, I taught a totally different subject some 10 years ago.

In the evening, a chance to stretch my legs and take in some of the sights and scenes of where I am - in this case, Russell Square, London.

And by a great stroke of luck, It was the London Ruby User Group's meeting that night ... a pub quiz at the Old Crown on New Oxford Street.
It's great to be back in the saddle again.
Posted by gje at 06:04 PM | Comments (0)
Related topics: via article database
The Wheatsheaf 2, The Bell 0
Twenty past seven on Sunday evening, and Dad and I were travelling up to London. And a bleak old January night it was too! The wind blew the car about, and the rain pelted across the screen as we crossed Salisbury Plain. The roads were quiet ... I wonder why!
Neither of us had eaten before we left home - myself because I was busy updating websites and getting systems ready for Monday's course and Dad because. Well - Dad because he knew I was doing this and we would be stopping to eat. I had a place in mind - a roadside pub chain between Weyhill and Andover where I've eaten in the past. Open 7 days, great salad bar. So we drove past the "Goa" which is also on my "wanna try" list.
Dad got out the car before I pulled into a space, like many others in the quiet car park it was standing in an inch or two of water. I pulled up and, splash, paddled out, and in we walked. Very quiet. I put my head around the restaurant door; a young lady is clearing tables.
"Can you do us a table for two" I ask
"Sorry - we're closed" she replies
"I didn't realise you closed this early" I continues.
"Oh we don't usually, but we were quiet so we decided there was no point in staying open."
And on we drove - an excellent meal had later at the Wheatsheaf on the old road into Basingstoke, just a short diversion off the motorway. And The Bell at Weyhill, and the Harvester chain lost not only two meals that evening, but also their place on my list of "places to stop on the way for a meal".
Posted by gje at 04:18 PM | Comments (0)
Related topics: via article database
January 08, 2007
Tomorrow's keywords - London, Training, Course, PHP, Ruby.
Cheating here and posting a day early - for tomorrow I'm in London giving a PHP course during the day, at I'm at the London Ruby Users Group pub quiz in the evening.
{b}How long does it take to install LAMP?[/b]. The L for Linux can take a darned long time simply because of the size of the thing, but I did A M and P within the hour this afternoon (Apache, MySQL and PHP ... at the same time as tidying up 8 machines ready for their train use - OSX, Suse, Redhat and Windows. It's easy when you know how. And, yes, I can feel an advert coming on ... come to us and when you leave, you WILL know how.
Posted by gje at 12:19 AM | Comments (0)
Related topics: via article database
Useful links: Ruby training, PHP training
January 07, 2007
Web site - a refresh to improve navigation
With over 8000 pages on the web site, we're not short of visitors kindly sent by Google, Yahoo, MSN and friends ... but once they arrive at a potentially interesting article, they're all too often leaving again before exploring related material that could be of use to them.
The web site has grown over years and years and it's classified by "short articles", "longer articles" and date - which is the last type of categorisation you need if you're looking - say - so find out how to include an email subject line in a mailto URL, or how to get Internet Explorer to carry on a style between pages on printer friendly output.
These navigation issues haven't come to us out of the blue - I've been aware of them for a number of years and we've been categorising our articles and examples under discrete subjects too for quite a while - providing some help already with "more about this subject" questions. But from gently rocking the original site to accommodate these extra navigation tools, now is the time for us to tip it right over and have a much more context based navigation system.
Over the rest of this month, you'll see pages in the old style - with an identical navigation bar on the right and a lovely, but space-consuming image on the left, gently fading away ...
And in their place, a new design with more substantive and contextual navigation off to the right.
If you'd like to see some of the earlier pages that we've changed, have a look at an example on the horses mouth archive(Python), a sample training module's resources (Subroutines in Perl), and a top level page for a language for which I've chosen Ruby.
Posted by gje at 02:27 PM | Comments (1)
Related topics: via article database
January 06, 2007
Finding public writeable things on your linux file system
Wondering what files and directories on your (Unix, Linux, OS X) system are marked "public writeable"?
There should be very few indeed (none is good), but the following will wheedle them out.
find . -perm -2 -print
""Find, under the current directory ('.') all symbols with permission bit "2" set, regardless of other permission bits on that symbol, and print out the path to that symbol""
Posted by gje at 04:44 AM | Comments (0)
Related topics: via article database
Useful link: Linux training
January 05, 2007
No courses. No hotel guests. Rushed off our feet!
Have you noticed that this has been a very technical festive season here on The Horse's Mouth - in fact here we are 5 days into the new year and it's been "CSS this" and "PHP that". And there's probably a clue in that to tell you I've been beavering away with those technologies.
Traditionally, we have shut down for a two week period over Christmas and the New Year, and often gone ski-ing. It worked out well for us ... but now that we're truly empty-nesters, there aren't the same holiday time and access time issues involved. Add to that, we had such a busy time in the last half of 2006 - refurbishing and opening a hotel while running, without slackening off, our training business - that we really didn't have the heart to set off on major travels.
Tradition, modified. We still shut down - as far as courses and hotel are concerned - for 2 weeks. But we stayed at home and around, and used the opportunity to take a couple of days (but no more) as breaks, and to work on a major web site update, including online booking, that will be going live shortly. And on the hotel side, some we took the opportunity to do a few of the little jobs that have been on our "snagging" list.
"No-one wants a course during the first week back". It's something we've learnt over the years and we didn't schedule any public courses. And, surprise, surprise ... no-one booked any private training that week either. So we've just come to the end of another quiet week have we? Oh no we have not!
No-one is travelling on business yet. No-one is attending courses yet. BUT .. the first days back are a frenzy of people planning and booking. We've been busy, building up to a peak today. "Telephone calls are like London buses" I told a caller today, "you don't get one for hours, then 2 come together". Explaining that I couldn't put him through to Lisa as she was on another call, and that he would have to make do with me to help with his booking. But, truth be told, it was pretty busy all day - there weren't those gaps and one booking was scarcely complete before the next came in. "If it was like that every day" said Lisa "we couldn't cope with all the business".
Posted by gje at 07:10 PM | Comments (0)
Related topics: via article database
January 04, 2007
PHP - static declaration
If you want to retain the value of a variable between one call to a function and the next, you can declare it as static. And as part of the initial declaration, you can assign a starting value to it. This allows you to test whether you're calling a function for the first time, or for a subsequent time.
function getavail($stamp,$forevent = 0) {
static $haverooms = 0;
static $blocked, $held;
if (! $haverooms) {
$haverooms = 1;
$blocked = array();
$held = array();
etc
OK - so that's the feature - so what's the benefit?
Using a static in this way allows you to include code to initialise variables AND make use of them in the same logical block - making maintainance of code much easier than in would be if you were passing parameters around, or relying on globals.
A block of code that runs only the first time a function is called is also useful if the function is required to do some heavy work that doesn't change within a running of your program; there's no point in re-calculating a value that you had already calculated, but lost when you exited from a function, is there? The code snippet above is a good example of this - over the New Year, I've been updating our online booking system to include hotel rooms as well as courses, and to dynamically refer back to the databases as it offers available rooms and courses to web site visitors. My getavail function returns the number of (rooms) available on a certain date, passed in by the time stamp variable. The workings are quite intricate at times, and when we produce a calendar of availability we have to keep calling it for day after day .... so we seed the $blocked and $held arrays during the first call - pre-loading tables of events, courses, prior bookings and closure periods which aren't going to change within the few milliseconds the program takes to run.
Are statics always useful? No - they are fiercely anti-OO. In other words, I would have a major problem if I wanted to extend my events tables, etc, to cover two different hotel objects. Ah - but I don't see us opening a second hotel in the near future.
Posted by gje at 08:15 AM | Comments (0)
Related topics: via article database
Useful link: PHP training
January 03, 2007
Parallel processing in PHP
PHP is designed - where necessary to the exclusion of other uses - as a web page tool. In other words, where a language design decision needs to made between something that is good for the web use, but bad for more general use, the decision will always be in favour of the web. "I don't care how it effects the other users" said Rasmus Lerdorf when I attended a lecture of his a year or two back - but what Rasmus (the PHP originator and mentor) means is that he really does care that it should be great for web users.
So ... most of the other language I teach had a "fork" function or equivalent from the early days which lets you split the process in two, with each half performing a different task. In PHP, it's there too - as from 4.1 - under the name pcntl_fork. But forking a complete process can be resource-heavy and tricky to code and there are other options too - such as setting off parallel actions on pipes.
Here's some sample code links.
Pinging multiple hosts in parallel
Grabbing titles from multiple pages in parallel
You can try the second example here if you wish.
You'll notice that I've used the full path to PHP and my test script in the title grabber. That's because the PHP script will be called up with goodness only knows what path and current directory, and it's sometimes needed to get the thing to work. You may also find that some of the php.ini settings hamper you.
Finally, a note of caution. If you write a script that goes out and grabs lots of information from other servers, you're writing an automata or robotic process and you should check that this is acceptable to your target site - their robots.txt file.
Posted by gje at 05:40 PM | Comments (0)
Related topics: via article database
Useful link: PHP training
January 02, 2007
span and div tags - a css comparison
Both <span> and <div> tags allow you to set the style of your text - fonts, colours, weights, and so on. So what is the difference?
A <span>span tag allows you to alter the presentation style within the current hierarchical block, whereas the <div> tag starts a new block for you. And what does this mean? It means that you can specify options such as text alignment within a <div> but not within a <span>.
I understand people like to see these things in action:
A span - brown and should be right
and here's the HTML:
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; border-style: solid; border-color: green; padding: 3px;">
Basic Text<br />
<span style="text-align: right;color: brown;">A span - brown and <i>should</i> be right</span><br />
<div style="text-align: right;color: purple;">A div - purple and <i>will</i> be right</div>
More basic text</div>
Why did I use padding and not margin? Because padding goes into the element and margins go onto the element. That's "inside" v "outside"
Why did I put a <br /> after the brown but not after the purple? Because the <div> tag starts and ends its own block, so there's one there anyway unless you've set it to be inline, whereas there's no such block with the <span>.
Posted by gje at 07:46 AM | Comments (0)
Related topics: via article database
January 01, 2007
Open Source Courses and Business Hotel - products and prices for 2007
Welcome to an exciting range of scheduled public courses for 2007, all of which will be run at our Well House Manor hotel and training centre. Our schedule includes old favourites such as Perl and Tcl, Python and PHP, Linux and Apache httpd and Tomcat ... and some recent courses such as Ruby, and our C and C++ which were newly written last year.
Public courses in any subject cost £350.00 for the first day, and £250.00 for each subsequent day. If you want to stay overnight (and we recommend that you do if you live more that a few miles away), our luxury rooms are available at £60.00 per room per night for our delegates.
For 2007, private courses cost £900.00 for the first day, plus £800.00 for each subsequent day, plus £50.00 per delegate per day (at Well House Manor) or £80.00 per delegate per day (if we run the private course at your offices). If delegates wish to stay at Well House Manor, the charge is the same £60.00 it would be for a room while they were on a public course.
We are no longer charging hotel expenses while we're giving private courses at your office, and we've reduced the mileage charge to 50p per mile. We do not make any charge for our travel time to your offices, but we do have a minimum course size and duration as follows:
• within the UK - minimum 2 days, 4 delegates
• elsewhere in Europe - minimum 3 days, 5 delegates
• worldwide - minimum 4 days, 6 delegates.
And we're very happy to train just a single delegate for a single day at Well House Manor. If you want to see how this works out for your location, please use our automated quote page.
All prices quoted above are EXCLUSIVE of VAT.
Delegates who have attended a Well House Consultants course at any time in the past are very welcome indeed to come and stay at Well House Manor even if they're not attending a course, and at weekends until the end of June those rooms will be available at the delegate rate above.
Hotel rooms at Well House Manor for guests who are not attending a course or othere even there are £80.00 per night (single occupancy) or £95.00 per night (double occupancy), and those prices include VAT. We provide a superior continental breakfast and internet access for all guests, and they're included in the prices quoted.
Conference facilities - Bronze (day conference - training rooms and lunch room), Silver (all five bedrooms - your own private hotel), gold (conference and all five bedrooms) and platinum (catered conference including bedrooms) are priced separately - please contact Christine for details. We welcome business meeting and gatherings and can provide full technical facilities, and catering, but we aren't a suitable venue for weddings and other parties.
Posted by gje at 05:20 PM | Comments (0)
Related topics: via article database
css - handling white space and pre
"Thank goodness for the <pre> tag" I used to say - for it give the ability to copy and paste plain text output into a web page and get content up on line very quickly. But alas, the tag is now rather 'old hat' and we're told that it really shouldn't be used - "these things should be done with styles. But which one?
The white-space: pre; attribute replaces the <pre> to </pre>tag pair ... and with a fixed width font family such as courier, you'll find things line up just as they always did. You'll find examples all over our solution centre - for example here where we're presenting MySQL outputs.
Here's the style we used in full:
.codescript {
font-family: "Courier New", Courier, mono;
font-size: 11px;
font-style: normal;
font-weight: 700;
font-variant: normal;
color: blue;
margin: 0px;
padding-top: 12px;
padding-bottom: 12px;
padding-left: 12px;
text-indent: 0em;
white-space: pre;
}
Posted by gje at 12:37 PM | Comments (0)
Related topics: via article database