« October 2009 | Main | December 2009 »

November 30, 2009

Global and Enable - two misused words!

The word global is used in declaring variables in some languages such as Tcl and Python to indicate that the variable being referred to is shared with the variable of the same name at the top scope. To use the word global, which implies that the declaration makes the variable visible everywhere, is misleading

The word enable is used in places such as the Apache http server build process to request that a facility is included within the build. But it does not mean that the facility is actually switched on and usable when the build has been done - other quite separate configuration work is needed to truly enable it!

I have some sympathy with the people who have to come up with words to describe what these words actually do - I'm not sure if I would have done any better; I do know that I have to be very careful when explaining "Global" and "Enable" on our courses.

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


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

Status Page / breaks of service in early December

Our two dedicated servers will be offline overnight - one from 1st to 2nd December 2009, and the other from 10th to 11th December, while the companies that host them perform upgrades / maintenance at their centers.

We maintain a status page at http://www.wellho.net/share/status.html which allows us to update you on our servers. If the server for "www.wellho.net" is out of commission for an unscheduled, extended period we can also switch the DNS to point to a backup system which offers limited service, including a newsflash to keep you updated.

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


Related topics: via article database

November 29, 2009

Through the arches

Melksham Town Hall from The Tavern

What's happening in Melksham?

The Tavern from The Art Cafe

What businesses are there in Melksham?

Guests at Well House Manor

Where can I stay in Melksham?

"What is there to see in Melksham?" ... so asked a lady I was talking to on the phone on Friday ... and I gave her some thoughts appropriate to the time she'll be in town and the people that'll be with her. But look around - look above - and you'll see that even at this time of year there's a certain beauty to the place. Make Melksham your destination ... and if you're a business in Melksham, why not help us make Melksham a destination
!

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


Related topics: via article database

Blogging accuracy - open invitation for any corrections

I make every attempt to be accurate on my blog - but they're written quickly, so you'll find typos in them (and the more passionate I get, the more typos jump in!). Usually, it's obvious what I mean and there's no significant change to the message I have - although it may be diluted by my confused wording, but on a few occasions a mistake can be significant. I'm always careful to get my "now" and my "not" right - that's a known trap - but there are others.

Code examples are cut and pasted from live working code, so are not subject to the same degree of error - however, on rare occasions the encoding of < and & characters for web publication can lead to errors.

Spelling mistakes and errors of hard fact can easily be fixed ... but it's less easy when it comes to posts which don't offer a full story (perhaps because I knew only a half of the story at publication time), where facts are challenged, or where we're looking at a point of view that I'm expressing ("In my opinion" / "As far as I know" type stuff).

What is my / or policy on corrections in the blog? Please tell me if you spot something that's in error and I'll check, usually agree, and add in a correction - if appropriate with an apology for the error and any confusion it may have caused. I say that I'll "usually" agree - I'm unlikely to agree (as in one recent case) that my report of a meeting I attended two years ago, written within hours of the meeting concluding, is incorrect and should be removed or replaced by an alternative provided by someone who wasn't even involved at the time, let alone at the meeting.

What about different opinions / other sides to a story? Please let me know with specific comments you would like adding, and I'll almost certainly add them in; I've had to turn off "Blog comments" simply because of the spam levels, but if it's on topic, and legal to post, it'll be posted.

Recent articles which have given rise to comment / requests for amendment include Perl Regular Expressions, Learning to program and a whole series relating to what was happening at the FSB two years ago - 1, 2, 3, 4, 5, and 6.


P.S. I can also re-open the "Save the Train" blog archive if I need to in order to add comments; a recent such request was made for this item to be amended.


P.P.S - where - say 'tell me' - by email to graham@wellho.net, or through our web page here. Phoning me isn't very effective, as I'm usually in front of a class and if you do get through, I'll probably need time to go back and look the article up anyway.

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


Related topics: via article database

November 28, 2009

Why we have two buses an hour - but not a half hourly service

A problem

We have two buses an hour to Bath. But that's not a half hourly service - they run within a few minutes of each other and then leave a gap that's little short of an hour. On the return from Bath, the two buses are scheduled to leave two minutes apart, and most of the day they're just a minute apart when they get back to Melksham.

We have two buses an hour from Chippenham too ... and the same grouping occurs. Departures at 08:57 and 09:00, 09:57 and 10:00, 10:57 and 11:00, 11:57 and 12:00 ... would be far better spread out (as far as I am concerned) to leave at 08:30, 09:00, 09:30, 10:00, 10:30, 11:00, 11:30 and 12:00.

Am I a lone voice saying "the current scheduling is not in the best interest of people who want to travel" and also "look - if you run the buses evenly, you'll encourage a rise in passenger numbers using the total service to the benefit of the bus operator's farebox income too"? No - I'm not a lone voice ... the topic's not a new one, and came up again in at the Core Strategy discussions on Thursday evening - in some ways a little off topic, but in others it's an example of some of the crazy situations that really ought to be sorted for the mutual benefit of service providers, service users, and service subsidizers.

Within limits, if you increase the frequency of a public transport service along a major flow, you'll increase the passenger numbers. A very rough rule of thumb says that a service's steepest increase of use is when the service frequency and journey times are about equal - so that enormous traffic gains are to be made when an service with 55 minute gaps is increased to one with 30 minute gaps where typical journey times on the service are 25 to 35 minutes

Why

Why do we have such an odd situation where the buses are so uneven that the overall service seems designed to suppress use, and where the timetable is both a laughing stock and a frustration to the people who use it or who want to use it? It all appears to come down to the competitions system, the subsidy system, and the apparent desire of the operators to put their profit before passengers.

Bus operators running 'commercial' services are free to run to any schedule they like, subject only to giving six weeks notice of changes.

Both of the "Great Cross" service through Melksham - Chippenham to Trowbridge and beyond, and Bath to Devizes and beyond - ran hourly, provided by Badgerline - for years. The service was taken over by the First group who continue to run the derivate service, at fares which we find steep. Along came Fosseway Coaches, looking at the lucrative market in which the existing service had a monopoly, and decided to compete. So they added services just ahead of the existing service, with a view (it would appear) to "mopping up" early passengers at the bus stops along the way. Fosseway are now Faresaver.

Faresaver's little wheeze appears to work well for them - a high proportion of bus travelers make their journeys free at the point of traveling - on senior citizens passes, for the most part, and such travelers will get onto whatever bus comes along - especially as the second (or First) bus isn't very reliable at present - see [here].

But it's not just simply a question of people getting on one bus or another. Tickets are not interchangeable, which is highly frustrating to the minority who actually pay as they travel and buy return or regular tickets to try to keep the cost per journey down somewhat. On many journeys, Faresaver is actually more expensive. in spite of the name which is, I think, derived from their scheme under which you make 10 journeys at full price and can get the 11th for "free"; I consider this misleading, and my view is shared by others.

Interestingly, travelers who don't pay when they travel (i.e. on bus passes) will get on any bus, and the local taxpayer will later pick up their bill which is a proportion of the regular fare - so it's a valid commercial practice (though you may consider it a sharp one) to hike fares as high as possible and go for the "don't know / care how much it costs the taxpayer" market. And - let's face it - I expect that if you ask the typical bus pass traveler what the regular fare would be, who is actually paying for them, and how much, they probably wouldn't know anyway.

One final piece of information for the jigsaw, before we speculate on solutions. By law, the bus companies are not allowed to arrange things directly between themselves as this would be a cartel and anti-competitive to anyone else who wanted to come into the market. There are / have been solutions to this in the past - with split operations on routes such as X4 / X5 (Bath to Salisbury) which has now been split into two at Warminster, and X49 (Swindon to Trowbridge) which is - I think - now single operator.

Wouldn't it make the most enormous sense for everyone to run a regular - half hourly - service on each route. Passengers would gain. Passengers would be gained. Buses would be more heavily loaded. Income would be greater for both bus companies ... but the problem is "how do we get there from here"

Exploring solutions

And, suddenly, I come to a halt in writing.

I've been able to describe the absurd situation we have. I've been able to describe where we should be. But I'm darned if I can see an easy way to get where we should be from where we are.

Is there a lead that "The County" could take - rather like a a "golden share" - through which they could offer a subsidy of 1p per journey (that's about 400 pounds per year in total) to two operators but specifying more closely the service they wish to buy? Perhaps I should ask County ... ;-)

In fact - perhaps I should offer County the 400 pounds per annum as Sponsorship - "This timetable is sponsored by Well House Manor - the Melksham Business Hotel"

Update - 30th November 2009

I have been copied in on previous correspondence from the Council - and reproduce a reply dated 14th April 2009 from the council leader, with permission:

Dear Mr Xxxxx

Thank you for your email. I have looked into the issues you raise regarding the buses 234 and X34 and unfortunately the uneven spacing of buses on these services is because the two bus companies that run on these routes are in competition with each other and have no interest in operating an evenly spaced timetable. In particular, the Faresaver bus company prefers to time its buses to always run a few minutes in front of the buses operated by First, as it believes it will pick up more passengers that way. Whilst this may seem rather wasteful, it is perfectly legal and regrettably there is nothing that the Council can do to change the situation as we are confined by the Transport Act 1985.

I hope this clarifies the situation.

It strikes me that there may actually be some opportunities, now, to re-address the situation. Up until 1st April 2009, Wiltshire County Council did indeed have no input as it wasn't providing funding for the services and - as stated - was confined.

From that date, the unitary authority took over the District's responsibilities for making payments for "Free" bus passes to the bus operators so in effect it is now the largest paymaster of Faresaver; I wonder whether that gives it any influence.

Finally, I wonder if the new Community Area Partnership, which is an independent body that can do things with out some restrictions, could play a hand in brokering a deal. A lot of it comes down to what carrot (if any) can be offered to sort the situation which isn't good for the passengers out; I would much rather that than any stick, even if I was sure that one is available.

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


Related topics: via article database

November 27, 2009

The road show has been - where now?

Yesterday Wiltshire Council's "Road Show" came to town - showing their core strategy plans for the next 20 years. Rather than allowing haphazard and undirected growth and development there is sense if the unitary council providing a degree of 'steer' ... making sure that any new housing is built in places where access, drainage, schools, shops, jobs, leisure, open space, refuse, road, bus, train, medical facilities, etc are sensibly accessible rather than on land that is cheap but unserviced, and making sure that all those other facilities are in place in the right quantities as the housing becomes available.

The $64,000 questions, though, are things like "how much housing is wanted", "where do the existing people want it", "do we want to provide neighborhood or centralized services". And it is difficult - very difficult - to excite people to give you there inputs about where they would like things in 2 years, and to share there local knowledge on that with you, let alone for 20 years time.

So on one hand I have a great deal of sympathy with Wiltshire Council's Spatial Strategy team ... and on the other, I feel that they're making assumptions about what the local population wants / sees as the way it wishes to go forward - that plans (or draft plans) are still too much imposed. That the Spatial Strategy people were out of line with Melksham's view is was clearly illustrated by their objections to Countrywide moving less that 100 yards, where the town votes 70 to 2 in favor of the move being allowed. That they're still possibly out of line was brought home to me again yesterday in a comment that "look - if we allow growth here it might mean more houses like at Chippenham and Trowbridge - is that what you really want" to which my reply was "well - perhaps we want to ensure that Melksham's large enough, and rounded enough to be relatively self standing rather than being a satellite suburb for other nearby towns". But a discussion was opened, and that's good news. The afternoon brought a drafty "mobile unit" to the Market Place with a third of the space of the similar exhibition in Chippenham (and an earlier closing time, so that people coming back to Melksham from working elsewhere couldn't get in); the evening brought a consultation with 'local community representatives' in the Assembly Hall. A few comments on both to follow - probably tomorrow - but the real inputs are going to be written one submitted by 5 p.m. on 31st December.

It is important, I feel, to get written inputs correlated and submitted. There are really serious questions about where we should be going, and really serious questions about some of the maps. Areas marked "preferred development" were, we are told on one hand, probably not going to be developed as the map was just a broad indication, yet on the other hand we were told we need to make inputs now rather than waiting until such things are clearer, as they will be policy by then. So I think we need to make inputs.

If they're important, then, will these inputs have any effect? Great play was mad of how they will be gathered, correlated and published. And they will be considered, we are told. But I wonder how much of than consideration will be taking a real look at suggestions, and how much will be that they will be considered to be the inputs of people who are not professional planners, and simply kept for the record.

I'm going to study them in more detail - I have them on CD and I'm going to think for myself and ask around; if I agree with the suggestions, then all will be well and I must admit that some of the detail isn't as dreadful as the headline posters in Chippenham implied it would be for Melksham!. But I rather suspect that some inputs along the lines of "Oy!" will be useful ... and that it will be useful to chase up the submissions to ensure that they're not just published then filed on a dusty shelf.

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


Related topics: via article database

November 26, 2009

Wiltshire Council purchases Melksham Station Land

Wiltshire Council has purchased the land at Melksham Station that the BRB Residuary body has been looking to dispose of - see [here] and what EXCELLENT news this is. It means that the land is safeguarded to provide facilities when a better rail service is provided - in the words of Richard Gamble, the county portfolio holder, "The deal is self financing and a long term protection measure designed to ensure that should there be an increase in the number of trains running through the station, we are much better placed to make improvements to the station. Our aim is to create conditions in which a good train service can be an economic success and we are talking to train operators to try and persuade them to increase the level of service through the station." More about this story here.

I knew this was coming - great news - just thought it wasn't going to hit the press for another few days hence the rushed item ;-)

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


Related topics: via article database

November 25, 2009

Kim of the Castle

Castle Newsagents, in the Market Place on the corner of Spa Road, closed suddenly last week after many year. The local press asked me for comment and frankly I was at a bit of a loss as to know what to say. It's sad to loose another business, and one that's been in the town for so many years too ... but it's not the first, probably won't be the last, and it wasn't a shop I used very often as I found their displays tired and I didn't feel 'at home' there. I was wondering to myself "What's that going to do to Kim", who's the lady who took over the Cornerstone Cafe next door about 20 months ago, and has taken it from strength to strength.

Good news ... EXCELLENT news ...

Kim is taking over the Newsagent store and will be opening from 5 a.m. next Monday morning ... under her "Cornerstone" banner. A fresh start, a fresh look, fresh stock ... and I wish her well.


You'll find further comment on "The Cornerstone" here on this site.

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


Related topics: via article database

November 24, 2009

The story of the railway land at Melksham Station

Once upon a time, a long long time ago, Melksham Station was a thriving operation with two platforms, a reasonable service, and goods yards for general traffic, and for heavy industry such as Spencer's, near the railway. But that was a long, long time ago.

In the dark days of Dr Beeching, the station was closed and just a single track remained through, with a weekly passenger train and a bit of freight; the general traffic went, then all the heavy industry dedicated traffic. British Railways demolished the station. They sold off all of the land that they no longer used to the North West. They even sold off half of the remaining platform ... but they did retain a short piece of the platform, old good sheds to the South East, the approach road itself, and the land to the East of the approach road, which they let out to various companies.

A limited train service returned in 1985, using the short remaining piece of platform and the approach road still owned by BR. However, when BR was privatized the land outside the station's current limits - the approach road, the old goods sheds and the surrounding area - were transferred to the "BRB Residuary Body" which was set up with the task, basically, of working itself out of a job by getting rid of land that had once been used for railway purposes but wasn't any longer.

Over the past four of five years, BRB Residuary has given notice on several occasions that they're going to put up the land for auction, with a view to selling it for development. The only protection for station access looked like it would be just a right of way - i.e. footpath - and not motor vehicle access. That would certainly have scuppered any future plans for taxis, buses, or parking at the station (which, come on, a station with a fit-for-purpose service for a growing town currently of 22000 people needs), and would also have eliminated any possibility of continuing the cul-de-sac to the station through to Spencer's Gate, where a roundabout already has an outlet pointing to the station. The big benefit of this extra section would be to put the station on a road that buses and taxis could go THROUGH on their natural journeys - providing a good road-rail interchange. The extra road section would also open up easy access to Melksham Station from the Spencer Gate ("Foundry Close") development, Leekes and other stores in the area, North Melksham, and by footpath over the river to Melksham Forest. This extra road section is specifically 'reserved' in the county's plans, and the station / service is fully supported by them in the current local transport plan.

The train service itself - 5 trains each way daily - was cut back by First as part of their current franchise in 2006 at the behest of the Department for Transport, and we now have just two trains a day. It was regarded in "Marsham Street" - the DfT in London - as something of a basket case, and I was told by unofficial sources that "if you can win an improvement for this service, you can win it for any service." Hmmm - how times have changed in 3 years. The service remains dire (though we did get back a southbound Sunday service), but we've now got the best BCR (Benefit to Cost ratio) of any line that's looking at improvement in the South West.

So - coming up to date, we have ... a rail service that fully justifies improvement and a body looking to sell off the very land that would be needed as it's improved. Watch the local papers this week ... I think you'll find some excellent news in the next chapter. Not the end of any story, but certainly a superb step forward.

Story Continues .... [here]

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


Related topics: via article database

November 22, 2009

The music of the stock market

Over this weekend, I have come to realise just how similar the music is to high finance (and that I should take a day off occasionally!). I love the range of applications that I look at ... and on Saturday, I was looking at sequences of stock values at regular intervals, whether they were going up and down over periods, and other factors such as percentage changes and how erratic the movements were. On Sunday I was dealing with the music of composers who's names were new to me, but well know to my delegate, and looking at their ups and downs, rates of change, and how erratic they were.

In fact, it took me a few hours to "twig" the connection ... and its struck me like a bolt from the blue when I realised that both my city-type and my musician had split their data sets into bars of a certain length.

Today was Python, yesterday was Lua, and tomorrow will be C and C++; I don't know the details of tomorrow's application, but even if it turns out to be web log analysis, I expect we'll be spitting our data down into a series of equal length periods and looking for trends between them.

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


Related topics: via article database

November 21, 2009

A life lesson from the accuracy of numbers in Excel and Lua

Floating point numbers aren't held EXACTLY in a computer's memory - they're held to a certain accuracy (number of significant figures or binary digits to be more accurante) after which they are truncated or rounded. And this means that at time 1.0 / 3.0 * 3.0 doesn't go full circle and come back to the value one - it comes back to 0.99999999999999 or something like that. Does this matter? Yes - sometimes it does.

The first thing to be aware of is that if you say
if (result == 1.0)
in some langauges, you may get a false result back even if result should - mathematically - equal 1.0.

The second thing to be aware of is how you can loose precision. This came up today on an example that I was writing during the extra Lua course that we had scheduled at the last minute.

Scenario - the value of an asset changes fractionally each day; using 4 byte floats, it's held to 7 significant decimal places and yesterday it was worth 1.634294 pounds per litle and today that's 1.634241 pounds. So that's a loss of 0.000053 pounds, right. Well - yes - it's right, but look at the accuracy of that - I've only been able to quote it to 2 significant figures, and it's showing an error of +- 2%.

The software we were developing was making a further calculation which it compared with that 0.000053, and which had a great deal more accuracy in it and - at times - 'less than' and 'greater than' tests were coming up with different results in Lua to Excel!

Did this matter? No and yes, and no again. If we were simply summing the differences between the two numbers being compared, it wasn't a problem save for the limited accuracy. If we used the "a" is greater or "b" is greater result to make a decision - such as who should be promoted - then we have clearly made to very different decisions whihc could have dramatic consequences. But if the numbers were so close to each other the results, although very different, were by definition virtually identical as to how good they were.

A fascinating subject - and a reminder that there are times that if we are agonisoing over a decision, unsure which of two courses of action are the best ... it might just be that the alternatives are vitually as good as one another and we'ld do better to make a choice - EITHER choice - and get on with handling the results of that decision.

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


Related topics: via article database

Useful link: Lua training

November 20, 2009

Community Area Partnership - inaugural AGM

This evening was the public meeting and first AGM of the new Melksham Community Area Partnership. The CAP is an independent (there's an interesting word!) body that mirrors the area covered by the Melksham Area Board of Wiltshire Council, and is (I understand) the last such CAP to be set up of 20, as it was delayed because of previous issues relating to Melksham 1st.

The provisional steering group was set up in July [link] to look at what the constitution should be, etc, and they reported back together with a financial budget / report. Last night, it was up to the public meeing to approve the constitution - done after some last minute changes - and to 'elect' an ongoing steering group. Or rather, to appoint all willing volunteers. Fairly esoteric - the next stage, for the steering group to look at what it's to steer, comes at a meeting which is on 9th December ... more details to follow, since I'm one of the willing vlunteers.

Presentations ... from Trowbridge, where the CAP was taken over from a similar orgainsation and they've been running for about five years ... from one of the early steering group who are convinced that an interactive web presence is needed (agreed) and that it can be limited only to those who have broadband access (I have questions) and will cost xxxx pounds to set up (I have questions there too!). I do agree with an inclusiveness adn an involvement of the total community - or putting the online and offline communicators both on a good footing, and of being inclusive with a real community - having (at our table) Seend, Poulshot and Melksham who have been rather thrown together gaining from that combination, rather than grumbling and resenting it.

When I looked a few months ago, there wasn't much written about Wiltshire CAPs so I noted it down as I understood it and documented it here.

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


Related topics: via article database

November 19, 2009

Admission

opendir(DH,".");
 
for $sd (readdir DH) {
   next if ($sd !~ /\./);
   next if ($sd !~ /[a-z]/);
   print "$sd backup ...\n";
   `tar czf 20091119/20091119_$sd.tgz $sd`;
   }

I admit it ... when it comes to the "crunch" and I need a quick script to do some systems admin work, it still has to be Perl!

The script above is currently running, via another window, on one of our two dedicated servers. "It's a very old machine - you should upgrade it" said their technician as he did a hard reboot for us yesterday; hmmm - it's not *that* old, but having heard a comment like that I think I'll ensure we have a fresh mirror of each virtual host ...

Learn how to write perl PROPERLY - i.e. commented, nicely structured, maintainable, without constants hard coded ... on our Perl Programming course. That will also equip you to write 'nasty' little scripts like the one above when you have the need!

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


Related topics: via article database

November 18, 2009

Good example of recursion in Python - analyse an RSS feed

I'm not keen on recursive code - code that calls itself. Very often, such code is elegant in a way, yet so 'clever' that it is hard to follow. There are, however, exceptions where I say "THAT is a good use of recursion". Once such is in the handling / parsing of RSS (Really Simple Syndication) feeds.

I was asked by one of my delegates about how he might download and analyse an RSS feed in Python ... and after a quick scout around, we downloaded feedparser. The code to grab the feed is silly-trivial:

import feedparser
stuff = feedparser.parse("http://www.wellho.net/horse/index.xml")

stuff, though, is a dictionary that contains other dictionaries, lists, and strings ... and those other dictionaries and strings contain further dictionaries and strings and lists. After all, RSS is an XML feed and the parse method give you back something synonymous with a DOM object.

So I have "pretty print"ed stuff using a function I wrote called display_dict which itself calls display_dict and display_list as appropriate. display_list itself calls display_list and display_dict. You can see the source at [link]

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


Related topics: via article database

Useful link: Python training

November 16, 2009

I almost put the bins out this morning

It feels like Tuesday - so I almost put out the bins before I left home for the fortnightly rubbish collection. But it isn't Tuesday - it's only Monday morning, and only just 8 O'Clock

It was something of an experiment when we added an optional day onto the front of our programming courses, when we noticed a trend for a small proportion of our delegates to be completely new to programming, whereas in the past they have been much more "convertors" who learned to program at college - perhaps in a language such as pascal. And we added the day, sometimes, on a Sunday so that we didn't need to reschedule the regular course, advised by a couple of potential candidates that they would be very happy to attend on a Sunday and give up their weekend, since their employer was retraining them for a new future role and paying for the course, and they should give some of their time too ...

The experiment has been the most amazing success. And we had four out of five of our hotel rooms taken on Saturday night by delegates attending Learning to Program in Python starting yesterday. The remaining room was taken last night by a further delegate attending Python Programmin which starts in an hour, and there are three other delegates too for that course who are taking the non-residential option.

Have a look at our late 2009 and all of 2010 training schedule if you're looking to learn to program ("never done it before / don't know where to start" or "goodness - not done any programming for 20 years and that was in assembler on a PDP/11") in Java, Perl, C, C++, Tcl, Lua, PHP, Ruby ... or Python. In each case, we cover basis principles on that extra first day. But in each case, all of the examples I use will be in your target language - there's no longer the need to learn the principles in Basic or Pascal, then switch to a different target language for your job role.

Illustration - our "Wilts" training room, at 08:30 on Sunday morning - ready for delegates who were at breakfast at the time!

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


Related topics: via article database

November 15, 2009

Learning to program in ...

These are bullet point topics to accompany the "Learning to program in ..." days which are available to complete novices in front of Well House Consultants programming courses. The day is presented using examples in PHP, Lua, Python, Ruby, C, C++, Tcl, Java or Perl as appropriate, with examples written in front of the class so that they'll see not only WHAT a programmer does, but also HOW a programmer decides on what to do.

Stored programs ...

• A series of instructions in a text file
• Each instruction separated from the next somehow
• Instructions run sequentially

Running a stored program ...

• Need to translate from text to runnable
• Compiler, load and go, and interpreter options
• Need for library routines

Hello World ... and Hello delegates too

• Why we do a "hello world" example on every course
• How "Hello World" works in [target]
• Try it yourself.
• Cross-operating system issues

Operators and operands (or commands)

• The two language patterns, and which [target] uses
• Writing a numeric expression
• Bodmas and brackets

Variables

• Storing a result under a name for later use
• Variable naming rules
• Declaring variables - type, size and scope, perhaps?
• Integer, Float, String and Boolean FAMILIES
• Other types and your own types
• Strong or weak typing
• Casting, converting and co-ercing
• Outputting a variable's content

Constants

• Writing constants - implicit type
• Language support for constants
• Giving constants a name - for maintainability

Your first useful program ... needs user input

• Reading from the user
• Converting a string into the right type
• The need for validation (to come back later)
• Exercises!

Conditionals

• Boolean Conditions
• Optional coding
• need for blocks to define how much is optional
• elseif and else
• Testing needs increased
• if - unless - switch - note shorthands for later
• what is equality
• equality in floats
• nesting
• Exercises!

Loops

• repeating block of code
• difference to conditional
• need to ensure you always exit the loop
• break and perhaps others
• Exercises!

Algorithms - a first bite

• Accumulator
• Min, max, average

Documentation - a first bite

• Comments
• Commentish code
• User documentation
• Exercises!

From here on, we're looking far more at demonstrations to show the delegates the way ahead - there's a revision of how the subjects above relate to the particular language on the main programming course that follows the "learning to program" day, and we'll go on to cover many of the following topics in much greater depth too - and with practicals!

Structure and more blocking

• Avoid repeated code via loops
• Avoid repeated code via named blocks
• Parameters in, parameters out
• Why default global is convenient but bad
• static variables or a clean start?
• Scoping in [target]
• Namespaces, and Structured and OO code

Collections

• Need to store multiple values under a single name
• Accessing via indexes
• Keys 0 based, 1 based, or not based at all.
• Fixed or variable length?
• Dealing with overflow

Pointers

• Extended collections (objects, structures, unions)
• Passing multiple bits of data as one
• Multiple names
• Symbol table and heap model
• Garbage Collection

Loading and Libraries

• Don't reinvent the wheel
• Sharing code between programs
• Sharing code between programmers
• Library Load order
• Mixing languages
• Version Control

Design

• Structured programming and the OO model
• What the user requires
• UML - using the concepts at least
• Future Proofing

And also ...

• Usability, maintainability, robustness and legality
• Debugging and tools
• Other algorithms - sorting and selecting
• Coroutines, parallel processing, threads, network resources
• Coding environments and standards
• Updates and language upgrades
• Security - abuse, misuse and error.
• Tailoring Standard Applications
• User training and support
• How does it work on The Web
• Open source, sell your programs, or just use yourself?

Footnote ...

• HTML, XML and SQL are not PROGRAMMING languages.
• But stored procedures, XSLT and even bash are.

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


Related topics: via article database

November 14, 2009

Melksham manslaughter case concludes - sort of

After the deadline for the local newspapers this week, the court case against Tom Minshull who was accused of the manslaughter of Adrian Cooksey concluded - with the jury taking 90 minutes (according to the press) to reach a "Not guilty" verdict. Mr Cooksey was found lying in Spa Road in the early hours of 9th March and died later in hospital.

I wasn't in court, but from the reports, and from speaking directly with professionals who were involved with the case on both sides as it went through the system, the case was far from an obvious one. There was extensive local disquiet, and there would have major surprise had a "guilty" verdict been returned. That said, the prosecution must have thought they had a good chance, but I personally don't know how or why.

So - was it the 'right' verdict? Well - yes - but only as far as it can go.

In Scotland, I understand that three verdicts are possible in similar cases - "Guilty" as in England, "Not Proven" which means "He possibly did it, but we can't be sure beyond reasonable doubt" and "Not Guilty" which means "No - he didn't do it".

Tom's defense, which (if it is why the jury reached the decision that it did), was that Adrian was killed by someone else. Tom's connection was merely that he was in the area at the time, and didn't even know what had happened close to where he was, until much later. Which implies that a Scots "Not Guilty" rather than a watered down English one would have been the verdict had the crime taken place in Montrose not Melksham. Yet that is just my speculation, which I understand is now allowed with the case concluded.

Because we don't know for sure what the Scots verdict would have been, we are now left with a most unsatisfactory situation, where each key player is a victim. Adrian Cooksey is dead, and his family grieve. Tom Minshull has been through what must have been the most daunting 8 months, and surely won't be able to walk away as if nothing has happened to him. Yet bearing in mind the "mistaken identity" defense if that is why the jury deliberated as they did, it goes even deeper. It could have been you or me that the police picked up (I often walk along Spa Road). And the person who actually struck the killer blow is still unreprimanded by the law and is probably still in our midst.

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


Related topics: via article database

November 13, 2009

Monday night, Tuesday night

Where did I stay earlier this week? Read my review!

"""An overpriced airport hotel (even at the LaterRooms price which was less than half the rack rate), overdue for refurbishment, and with staff who rightly knew they didn't need to be more than routinely polite to guests coming through the door, because most are unlikely to pass this way again.

Open a cupboard door, and you find that the back of the cupboard's missing and you can see the dust wall and the wiring at the back. The only way to find which is the hot tap and which is the cold by trying them both out, because both have long since lost their labels. Wonder at the carpet which looks like it expanded when it was deep cleaned, the didn't shrink back to size and is now "baggy". Go to the parking desk, then queue at reception to get your ticket stamped "resident" then go back to the parking desk so that you 'only' have to pay ten pound for the pleasure of parking in the hotel's car park overnight. And everything is cream, or yellow, lighting anemic. It IS clean (and I have rated that "good") but a little musty.

I'm invited as I complete this review to say if I would recommend the hotel for a group of friends. as a romantic retreat, as a country escape, as a relaxing Spa, a city break or a family holiday. Sorry - none of those. If I had to find a room for a few hours one night before an early flight, I just might stop there for convenience if I could get a room for forty quid and couldn't find anywhere else in the same price bracket ... but the 145 rack rate is a joke, surely!"""

How tempting ... to post the review above and to identify the hotel in question! And how sad that I was tempted to do so. "Raise issues at the time, not later" is the usual advise, and I had considered doing so. But in my heart, something told me that I would get mere platitudes if I tried, and I too was dog-tired at the end of a long day of training to be bothered.

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


Related topics: via article database

November 12, 2009

Simples

So said one of my delegates on todays course - pronounced with a long "I" - "Seemples". And we knew he was impersonating one of those meerkats here. One of the classics of modern advertising along with the Cadbury's Gorilla.

Object Oriented Programming is one of those subjects that many people find hard to grasp when they first come across it - but then there's a sudden, lighbulb, moment. And the basics and the beauty suddenly become clear as the delegate(s) say "YES", I have it.

Today, I spend in north Oxfordshire teaching a one day Object Oriented Programming in PHP day to a room of well established PHP programmers - most with 5 to 7 years experience of the language, the "baby" as he celled himself with just 3 ... and I loved it. We looked at Object Orientation principles and how they're applied in PHP, we looked at MVC (Model, View, Controller) , the 4 layer model and UML ... and - wow - what a rewarding day. But not a long post tonight, as I worked my butt off, and am exhausted - all my energy into a rewarding course for me - and for them.

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


Related topics: via article database

November 10, 2009

Dynamically formatting your results (Lua)

Scenario: You're producing a short (text) table of results and you want to keep it reasonably small - not a great deal of white space, but the data in some of your columns differs dramatically from one set of results to another. How can you do it?

Discussion: You can use your traditional "printf" type formatting in C, Perl, PHP, Python (via the % operator), Lua (string.format) and Tcl (string format) to give each field a width, but you'll need to ensure that the fields are wide enough to take the data to be placed in them every time, or accept occasional spillages when the data "busts its bank".

Solution: Parse the data for the report before you print anything out at all, and calculate the maximum width for each field for the current report. Then make up your own dynamic formatting string for use just on this occaasion. Here's an example of what I mean:

oak = {"beer","beer","beer","beer","beer","legs",
  "spilled spaghetti sauce","top","draw",
  "spit","polish","secret"}
table.sort(oak)
 
-- ====================================
 
syze = #oak[1]
for k=2,#oak do
  if syze < #oak[k] then syze = #oak[k] end
end
 
clen = #(string.format("%d",#oak));
using = "%"..clen.."d %"..syze.."s"
print ("Output format: " .. using)
 
for k,v in ipairs(oak) do
  print (string.format(using,k,v))
  end
-- ====================================

And the result:

Output format: %2d %23s
 1                    beer
 2                    beer
 3                    beer
 4                    beer
 5                    beer
 6                    draw
 7                    legs
 8                  polish
 9                  secret
10 spilled spaghetti sauce
11                    spit
12                     top

Notes: 1. If the question had been asked for web use, I would have used a browser and a table in my html to do the dynamic formatting

2. The code in the ========== section should be saved as a function for re-use later

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


Related topics: via article database

Useful link: Lua training

November 09, 2009

ourdog is Greyhound, Staffie and Ginger Cake

It was the fact that the cake wrapper was on the bed, and not on the bedside table that was the clue that triggered me to realizing that something wasn't quite where I had left it. And examining the wrapper and finding it empty and clear, I realised that something else - the remaining slice of cake - was missing completely.

Which is why in my Lua coding example today I wrote that gypsy comprises Greyhound, Staffordshire Bull Terrier, and Ginger Cake.

gypsy = {"Greyhound","Staffordshire Bull Terrier","Ginger Cake"}

But that was yesterday and - well - she's our dog, so Lisa gave her some dogfood and the gravy she loves this morning:

ourdog = gypsy
ourdog[3] = "dogfood and gravy"

Now it appears that I have just changed the copy that I made of the table called "gypsy", doesn't it? And that if I were to print out the original table, it would still contain the Ginger Cake? Well - that turns out not to be the case:

print (table.concat(gypsy," and "))

gave me:

Greyhound and Staffordshire Bull Terrier and dogfood and gravy

and looking at the two tables:

print (gypsy, ourdog)

tells me that they're one and the same:

table: 0x9e34fd8 table: 0x9e34fd8

In Lua, when you copy a table, you're really just copying the reference - in other words you're giving it another name. And if you then alter it under one name, you'll alter it under the second name too.

As a second example, I asked one of my delegates today what he called his mother. "Mum" he replied. And I asked him what his father called his mother. "Margaret" he replied (not really, I'm protecting names). "Now - if your father poured a tin of pink paint over Margaret, would you say 'Mum, you're pink'" I asked. "Yes" he replied ...


Python behaves in the same way as Lua, as does version 5 of PHP ... version 4 of PHP and Perl both replicate the whole of a list / array, and you would still have seen the ginger cake when you printed out what Gypsy's made of! The Lua / Python / PHP5 behavior also has its equivalent in C with the copying of a pointer.

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


Related topics: via article database

November 08, 2009

Remembrance Sunday 2009, Melksham

Remembrance Sunday - and I was honored to be asked by the Chamber of Commerce to lay a wreath at the war memorial on their behalf. It was a real community gathering and a really poignant service in the church which concluded outside at the war memorial. Good to see such a large congregation, so many young and old. And the horror of war was brought home to us this year with injured representative of the troops from Iraq and Afghanistan there with us. No longer the old men on sticks and in wheelchairs from wars fought in times before I can remember, but the immediate and shocking present too.

I was going to write about this event as part of my previous 'busy weekend' post. But this merits a quite separate article.

I was going to provide you further pictures and say that I wish that even more people could have joined us, but it was such an event, and my involvement was such, that it would have been disrespectful of me to click away while I was still a part of the proceedings.

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


Related topics: via article database

Brown horses in Melksham

You'll see white horses at Westbury, at Cherhill and Hackpen Hill and (if you know where to look) at Devizes and Marlborough too. But you won't often see four brown horses in Melksham - here, pictured at the end of our street this morning.

It's been an interesting weekend. Yesterday, I was asked to go along and help with the jumble sale run by the ladies of the "Bowerhill Villager" - a free news sheet that's produced by their own team, and distributed every month to over a thousand homes. Funding for the newspaper comes from advertising, from grants, and from money that the ladies raise themselves at events such as the jumble sale at Bowerhill Village Hall. Abbi Dark - the Melksham Carnival Princess - was on hand at 10 a.m. sharp with a pair of scissors that turned out to be not QUITE so sharp to declare the sale open ... and they flooded in!

It turned out that there was very little indeed for me to do. The team has run the jumble sale for years and I was something of a spare cog - in fact I wandered out and went round photographing some of the Bowerhill Industrial Units in that lull you get at jumble sales between the initial surge and tidying up all the unsold goods at the end. However, I took some pictures of the sale too, to help encourage others to come along next year, and to show you what an excellent range of good were for sale. And at the end of the day, this hard work netted a profit of around a hundred pounds which goes towards keeping the Bowerhill Villager running.

Naturally, even Melksham Princesses need to let their hair down sometimes ... here's Abbi in some of her time off during the sale taking some pictures too.

Melksham is really lucky with its free newspapers.

The "Bowerhill Villager" is keenly read right across Bowerhill, with advertisers regularly letting the team know what a good response they have got. The regular report from the local community police officer, parish and club news, letters which can get every bit as heated as ones at a less local level, tips, recipes, and even a regular monthly cartoon.

The "Melksham Independent News" covers the whole town - and has a quite remarkable editorial content for a 'free-sheet'. I'm sure that's no accident - it's a carefully designed feature that means that the MIN is really valued and read from cover to cover ... which of course helps to keep the advertisers happy.

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


Related topics: via article database

November 07, 2009

A better design of mouth

When you think about it, having a mouth on the side of your face is something of a poor design in some circumstances. There's that awkward maneuvering of food on a fork, or with hands to get into the mouth, and the drips of curry and tomato source that fall onto your white shirt when your co-ordination falls below perfection. And the assistance has to be provided to get the chewed food to the throat too.

Surely it would be far better to have the mouth facing upward - on the top of the head - as demonstrated here by Gypsy. And little flakes of Tesco's chicken kievs which list should drop her way, be that accidentally intentionally or on purpose, will slide into the mouth, and beyond, with the minimum of effort - perhaps just the slightest tilting of the head, and a licking of the lips and a deep sign to say "Thank you"

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


Related topics: via article database

Planning the future of Wiltshire

Background to planning the future - the mechanism

Where will Wiltshire be in 20 years time? Will it grow, and if so how - will development all go into 2 or 3 major towns, leaving smaller towns to loose their significance and hearts? Will development spring up all over the place, or in a new town as I suggested (tongue in cheek) a couple of years ago in Bratton and Edington New Town. And if housing grows, will businesses, schools, shops, leisure medical facilities grow alongside, or will those be centralized giving need to increased travel and transport needs. Will such extra facilities be underdeveloped, leading to a worsening of services, or thought through ahead of time so that they're on stream when needed? And will the character of our towns and city, and our villages and countryside, be retained ... or will we become just like every other set of towns and cities across the land with individuality stifled? And how will all this effect carbon footprint / global warming / sustainability / quality of life?

The Regional Spatial Strategy has laid down the broad brush strokes of development for the next 20 years, and that provides for major grown West of Swindon, and in North and West Wiltshire. And now Wiltshire Council is starting to put flesh onto those bones, looking further as to where the growth that is planned will go in this area. There's a consultation on the Core Strategy going on at the moment - some documents were published for public comment on 31st October, and there are public displays in most towns over the next month, at which the public are invited to look at posters and make comment. In each town, a forum to discuss the plans is held in the evening after the meeting, and full consultation inputs are to be made by 5 p.m. on 31st December.

The core strategy will be drawn up more closely next year, comment will be invited as to whether the process has been fair, and a government inspector will then look at the plans and hold a formal public hearing into them prior to the strategy being adopted.

Does it matter what the strategy says and how it is arranged?

Yes, it does - very much. The draft strategy calls for ...

A "significant level of economic and housing development where higher order facilities and services exist" in Chippenham, Trowbridge, and the area to the West of Swindon.

"Sufficient new development to consolidate and develop their service role" in Market tows (their spelling mistake!) which are listed as Calne, Corsham, Devizes, Malmesbury, Marlborough, Melksham, Tidworth/Ludgershall, Warminster, Westbury and Wootton Bassett

"Development only to support their existing service centre role for a rural hinterland" for smaller towns and larger villages (no list given)

"Development restricted to accommodate the local housing need" for small villages.

Looking at their "Market Town" strategy, the plans read very much as if the spatial planners see their futures as dormitory settlements, with jobs and facilities going in to Chippenham, Trowbridge, West-of-Swindon. That may suit some of the town - but it does not suit what the people of Melksham want. How can I be so sure? Because the spatial planners recently suggested that the new Countrywide store be built in Chippenham or Trowbridge, rather than in Melksham - moving some 35 to 40 jobs from the town; everyone objected, and the vote that's been running on the Chamber of Commerce Web Site has - as I speak - attracted 50 votes to have the new Countrywide store in Melksham and just one to send Countrywide packing.

If we don't want to have to fight the strategic developers for every single employment opportunity - every chance of improved local shopping, transport and parking - every chance of facilities for our young people to have something to do of an evening other than a pub crawl ... then we should make strong inputs into the process at this stage and we should continue to do so. The current size and setup of Marlborough, Malmesbury and Melksham are radically different, and their futures should be very different too. The planner's ideas might be right in line with the Marlborough folks - but they are out of step with Melksham and we should not all be lumped together.

Where do we go from here

The core strategy consultation tour display comes to Melksham on 26th November and (uniquely) will be in a mobile unit in the Town Centre - initial feedback when I asked "where in the town" is "Outside Peacocks". I will be attending, and I suggest that others do too.

The display, which is open to the general public, is followed by a consultation discussion / forum for invited community group representatives only. And (based on experience and talking with people when I went up to Chippenham last night), invitations are very tightly drawn ... I gave my details to a Wiltshire Council Officer who told me that I should attend the public display and add post-it notes onto the displays. It's unlikely that I'll get an invite, as they were looking for community representatives who would make positive inputs (a.k.a. rubber stamp their plan?) rather than people who run/represent businesses in the area. In the car park outside, Lisa and I met up with one of the prospective MPs on his way in. He's been selected by a major political party and has a good chance of winning the Chippenham seat, but I understand that even he was told that the display, and not the forum, was the place for him. I wonder if they relented and allowed him an input [Update - I understand he WAS admitted] - I would certainly welcome inputs from all of our candidates for MP on the subject of Melksham's future. I will be asking for a formal invite to the discussion and I suggest that others do so too

The Grand Kingdom of Wiltshire

We watched a video about the plans and process, and I was struck by the words of Andrew Cunningham, of Wiltshire Council. "We want to control the development ..."

Ah. He's given the game away.

It shouldn't be a question of controlling. It should be a question of helping and facilitating development, surely. Of generating the right conditions for new housing, businesses, leisure facilities, etc, to be built in logical places and to preserve the history and environment and to improve the quality of life. So - if you like - he and his officers should be making it easier for things to move forward in the way that fits what the people of the county want, and not trying to impose planning decisions and policies to manipulate developments so that they are lords and masters of the Kingdom of Wiltshire.

Footnote

This displays on show in Chippenham are "not yet on line" though much of the core strategy stuff is - links to that here - and there were no copies to take away, So we, the public, were limited at this stage to reading what was on the wall and commenting without taking it away and giving it further thought, and I can't reproduced too much detailed text here without transposing it from pictures I took. You'll see from the picture here that the opportunity to add anonymous comments was being taken up and there is a more serious ability to make inputs via forms / email

Some of the "postit" views ...

You talk about sustainable transport here. Yet the only transport change you actually show is a link road. This is hardly sustainable.

What confidence can we have in this proposal when Market Towns is spelt "Tows"

Your total for Chippenham doesn't add up

Difficult to comment as no specific information

Why are we taking waste to South Wales

I'll reserve my comments for the Melksham road show, and for when I have listened a bit more

[link] to forum page on this topic

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


Related topics: via article database

November 06, 2009

Making Linux Politically correct

[trainee@easterton ~]$ man ls
Manual page displayed here
[trainee@easterton ~]$ woman ls
-bash: woman: command not found
[trainee@easterton ~]$ alias woman=man
[trainee@easterton ~]$ woman ls
Manual page displayed here
[trainee@easterton ~]$

OK - I'll admit that this is quite a trivial use of the "alias" command which (if your running the default 'bash' shell) lets you rename commands - replacing longer names with shorter ones, and adding in some default options too. Here's an example of that, where I am adding the -F option to all my ls commands, as I would like a trailing @ * or / to indicate a link, executable or directory on my listing:

Dorothy-2:nov09 grahamellis$ ls
LinuxAdmin.book.pdf
LinuxBasicsAdmin.book.pdf
chamber.org.uk.tgz
no_50.rtf
notes
phpvna
pics
try
Dorothy-2:nov09 grahamellis$ alias ls='ls -F'
Dorothy-2:nov09 grahamellis$ ls
LinuxAdmin.book.pdf
LinuxBasicsAdmin.book.pdf
chamber.org.uk.tgz
no_50.rtf
notes
phpvna
pics/
try/
Dorothy-2:nov09 grahamellis$

alias commands remain active only for the life of the current shell - type them in at the command line, and they'll not be transferred to any new windows. And you'll loose them completely when you log out or close the window in which you have set them. If you want to make them permanent, edit them into your .bashrc file - that's the file that's read every time you start a new shell.

oh .. ".bashrc" => "Bourne Again Shell Runtime Commands" if you wondered!

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


Related topics: via article database

Useful link: Linux training

November 05, 2009

Melksham buses to/from Chippenham, Trowbridge, Bath, Devizes, London

First (Bristol bath and the West), Faresaver, Frome Minibuses, AD Raines, Bodmans and National Express all operate scheduled bus services to and from the Melksham area, and First Great Western operate train services. As these companies compete with each other, there are no easy combined printed timetables - here is a list to the best of my knowledge, November 2009.

Buses from BATH to Melksham are operated by First (7 days a week, hourly on Monday to Saturday and every 2 hours on Sunday) and by Faresaver (Every hour, Monday to Friday). AD Raines also run one bus a day, Monday to Friday. First's services also run, but less frequently, in the evening. Links: First - routes 271/272/273, Faresaver - see route X72.

Buses from CHIPPENHAM to Melksham are operated by First (Monday to Saturday, hourly), and by Faresaver (Monday to Friday, hourly). First run a less frequent service in the evening, and there is no service on a Sunday. Links: First - route 234, Faresaver - see route X34.

Buses from FROME and TROWBRIDGE to Melksham are an extension of the services from Chippenham - see links in that paragraph. An additional service, Monday to Saturday about every 2 hours is provide by Faresaver on their route 237 from Trowbridge via Holt. There is a further additional service run by Frome Minibuses from Frome via Bradford-on-Avon to Melksham in early morning, returning in the late afternoon. The National Express coach on route 402 runs from Frome via Westbury and Trowbridge to Melksham early EVERY morning (including Sunday - so it's the only service that day from Trowbridge or Frome) and return in the mid evening. Finally, route 235 runs once a day (morning peak) Melksham to Trowbridge and it returns in the later afternoon.

Buses from DEVIZES to Melksham are an extension of the First service from Bath - routes 271, 272 and 273. See the links in the Bath paragraph. One Faresaver bus is extended to Devizes and back in the early afternoon. These buses run beyond Devizes to Potterne, West Lavington, Market Lavington, Easterton and Urchfont. An additional daily service is provided by the National Express coach bound for London on route 402.

Trains from SWINDON and CHIPPENHAM to Melksham run twice a day (once on Sunday). They continue to TROWBRIDGE, and WESTBURY. Trains from WESTBURY and TROWBRIDGE to Melksham run twice every day, and continue on to Chippenham and Swindon. The trains are operated by First Great Western. Some trains continue to / start from Worcester, Cheltenham, Gloucester (to the north) and Salisbury and Southampton (to the south).

A long distance coach runs from Victoria coach station, LONDON and London's HEATHROW airport to Melksham late in the afternoon, every day of the week. It return from Melksham to Heathrow and Central London at Breakfast time. This is route 402. See this link.

A bus from MARLBOROUGH and CALNE to Melksham is run by AD runs in the morning and returns in the afternoon. Marlborough (but not Calne) is also server by the daily National Express coach to / from London.

Buses from CORSHAM to Melksham are provided by Faresaver on their routes 72 and 73.

The town bus (service 14) runs every 30 minutes through the day, linking the Melksham Forest and Queensway areas with the town centre and Sainsbury's. Faresaver's 72 and 73 services provide local bus to North Melksham area, and also Berryfield. The buses to Devizes (plus service 235 and Faresaver X72) provide services to and from Bowerhill.

Most of the times mentioned above are included in the Wiltshire Council Bus Timetable which, however, is not up to date, and there have been changes.

See here for insider's tips on bus services to and from Melksham

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


Related topics: via article database

November 04, 2009

Lua Classes - open enrolement



Advert - Extra Course!


I've just scheduled an extra Lua course - running from 19th (Thursday) to 22nd (Sunday) of November, on Lua. It's "last minute" which means that the group of delegates will be a small one and you'll get plenty of personal attention to YOUR application and requirements. Venue - Melksham, Wiltshire, England. At our training centre, where we also have rooms available if you want to stay overnight ... email us or call 0800 043 8225 or (+44) 1225 708225 from outside the UK to book.

See http://www.wellho.net/course/ulfull.html for the course description - it's "Learning to program in Lua". Or join us on Friday morning - see http://www.wellho.net/course/ubfull.html for "Lua Programming" which assumes some prior programming knowledge.

We now run regular public Lua courses ... so that if you've missed the date, the link above will still be useful and you should still get in touch.

For anyone asking "and what is Lua" ... well ... it's this great programming language that I'm delighted to teach ;-)

P.S. The course will be formally running from 10 a.m. to 6 p.m. each day, which is an hour later than normal. But there's nothing to stop delegates arriving early and leaving every later ... the tutor will be around from 07:30 until late!

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


Related topics: via article database

Useful link: Lua training

November 03, 2009

Root is root for a reason!

A busy day ... major update to the Chamber of Commerce Site, and a heart-stopping moment when I realised that we had moved our server's clock forward by a year instead of by a few minutes. A few log files have some funny time stamps in them, and web stats will look odd for a while ... and there was a heart-stopping moment when the Horse's Mouth went blank as I hadn't posted in the period that's displayed. In the end, a site rebuild solved the issue. Lesson for us all - there is a well protected password on the root account or a VERY GOOD reason!

However - on a lighter note, I was delighted to get this search result:

Yes, Well House Manor is top of its class - a great place to stay. And the place is made by the team that run it - front of house and behind the scenes.

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


Related topics: via article database

November 02, 2009

Friendly Hotel in Melksham, near Bath


Lisa emailed me a link to a web site listing dog-friendly hotels for our own future use when traveling. Now for Betty and Phil, a hotel that's dog friendly is a blessing, but by contrast Gordon and Sarah wouldn't want to stay somewhere that's overrun with other people's dogs.

So let's see ... where does Well House Manor - our hotel in Melksham, Wiltshire, England - fit in?

I'll explain each of these in more detail a bit later, but we are:

• Adult friendly
• Biker friendly
• Business traveler friendly
• Car friendly
• Cyclist friendly
• Diet friendly
• Early and late arrival friendly
• Early and late departure friendly
• Gay and Lesbian friendly
• Internet friendly
• Last Minute friendly
• One night friendly
• Overseas guest friendly
• Public Transport friendly
• Solo traveler friendly
• Tourist friendly
• Walker friendly
• Weekend guest friendly

In order to balance the presentation, let me tell you that we don't have facilities for dogs, smokers (inside), wheelchairs, children and babies. An apology to those of you who might like to smoke in your room, or bring the kids ... but then it lets us guarantee a quiet clean-aired environment for the guests for whom we've really tailored what we offer, and you'll be much happier letting the children run around and play at Beechfield, or having Fido in you room at The Shaw, or with level access to your room at Antonia House.


Well House Manor - 48 Spa Road, Melksham, Wiltshire, SN12 6QL

We are on the Devizes Road out of Melksham, just a few hundred yards from the Market Place, yet in our own quiet grounds with plenty of parking. All five rooms are large, en suite, and feature large screen TVs with over 50 channels, King or superking beds and much more.

All rooms are double or twin. Single occupancy - £80.00 per night, Double occupancy, £90.00 per night, including an extended continental breakfast. For any stay of 2 or more nights that include a Saturday or Christmas Holiday period night, we are offering a "Winter Special" of £70.00 per room per night.

0800 043 8225 • 01225 709638 • http://www.wellhousemanor.co.uk

I promised you an explanation of each friendly term ...

Adult friendly ... we offer a quiet environment suited to business visitors, and to couples and singles visiting Wiltshire to see family and friends, or to tour the beautiful countryside and historic villages of Wiltshire.

Biker friendly ... Cyclist friendly ... we have locked garaging available for cycles and motor bikes, and we're just 200 yards off the Sustrans national cycle network. Large, well heated bedrooms and bathrooms mean plenty of space for drying your 'gear' on wet days. A garage two doors away, and a motor cycle and cycle specialist stores within easy walking distance in the town.

Business traveler friendly ... You want to be able to come and go as you please. To have Internet access, a large work desk, copying facilities. To get breakfast early, and to be able to bring dinner in or get it delivered rather than eating in a hotel restaurant every night. To get taxis booked, and to have your business contacts come to the hotel to meet you. You want a variety of healthy foods at breakfast ... you've got it!

Car friendly ... We've plenty of free parking. Any you can drive in and out whenever you like, or leave your car with us if you're going out with friends of colleagues, or want to take the bus into Bath. There's a garage, open from 6 a.m. to 10 p.m. just two doors up from us, and Classic Motors are always helpful if you've something on your car that needs urgent attention.

Diet friendly ... Whether you've got a special dietary requirement for health, religion or life-choice reasons, let us know and we can usually help.

Early and late arrival friendly ... Early and late departure friendly ... Whether you're arriving off an overnight flight from the USA and will be with us at 9 a.m., or landing at Bristol Airport at midnight, that's fine by us. We do ask you to let us know an approximate arrival time, but we don't have a "must check in between 3pm and 10pm" rule as you may find up the road. An early departure? I was making breakfast at 5 a.m. last week!

Internet friendly ... Last Minute friendly ... Book online, even last minute, and your booking will be made against our live database - you can be certain that if we say a room is available, it really is available, and you don't have to wait for us to check. At the hotel, all rooms have wireless and wired broadband internet access, and its unlimited use (subject only to our AUP) is included in the price of your room. There's even a publicly available printer on the network so you take hard copy if you like.

One night friendly ... No minimum stay - yes, we are happy for you to check in on Saturday afternoon and check out on Sunday morning - or even to arrive on Christmas day and leave on Boxing day.

Overseas guest friendly ... My wife was born in the USA and brought up in various countries including Lebanon. Chris's wife comes from South Africa, and both moved to the UK when we got married. We're delighted to welcome guests from outside the UK, to make them feel at home, to provide facilities they need and to introduce them to our lovely part of the UK ... that's after we left them in peace and quiet if they need it to recover from a long journey and jetlag.

Public Transport friendly ... the bus from Bath stops right outside. The coach from London calls at the Market Place (400 yards) each day. And the train station is within a mile. Let us know what time your train's arriving and we can pick you up. Leave your car with us, and take the bus to Bath or Devizes from right outside, to Lacock, Chippenham, Trowbridge or Frome from the Market place.

Solo traveller friendly ... I have traveled extensively - I still do in the training element of my job. And the hotels I want to stay in, and keep going back to, are the ones where I am made to feel welcome - where I am promptly looked after and where the staff are greet their guests and take an interest in their individual well-being. We make a special effort to ensure that lone guests feel at home, and know that they're every bit as important as the couples and the groups.

Tourist friendly ... We live in a lovely park of the UK, and we're delighted when people come and stay with us, taking an interest in the area. It's often said that people who live in an area know it far less well that visitors, but we take steps to be exceptions to that rule. We go out, we learn our area, and we're happy to tell people about what there is to do - the well known and the secret places too. Maps are available on loan, books on the area for reading, and we have a wide range of local brochures that would make an establishment with ten times our footfall proud.

Walker friendly ... from my home (about half a mile up the road from the hotel) we can strike out onto footpaths and walk for miles without seeing a vehicle. From Bowerhill in Melksham, you can join the Kennet and Avon Canal towpath and walk all the way to Bath or Reading. And from Well House Manor, you can walk a few hundred yards to a variety of eating places and pubs in the evening. We even have local maps with suggested local walks ... all of which I have walked myself.

Weekend guest friendly ... "Business Accommodation" is how we style ourselves ... but businessmen and course delegates come back, on their own or with their partners, to spend a weekend in Wiltshire. And we welcome them - ambassadors for our hotel - and other leisure guests too.

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


Related topics: via article database

Parallel Pinging, using Python Threads or Expect spawn lists

Ping is a very useful command to use within scripts for checking the presence (or absence) of a live system on our network, or indeed on the Internet. However, there are subtle differences in the format of its report on different operating system flavors, so any code that you write that needs to analyse the results may need to be tuned when you re-host.

Here are some similar (but different!) ping responses, by way of example:

earth-wind-and-fire:~ grahamellis$ ping -q -c2 192.168.200.65
PING 192.168.200.65 (192.168.200.65): 56 data bytes

--- 192.168.200.65 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
earth-wind-and-fire:~ grahamellis$

-bash-3.2$ ping -q -c2 192.168.200.65
PING 192.168.200.65 (192.168.200.65) 56(84) bytes of data.

--- 192.168.200.65 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms

-bash-3.2$

wellcouk@tornado:~/public_html$ ping -q -c2 192.168.200.65
PING 192.168.200.65 (192.168.200.65): 56 octets data

--- 192.168.200.65 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
wellcouk@tornado:~/public_html$

Many people find our Python scripts alive, kicking, fullrange and fullandfast useful - both as demonstrations of threading in Python and for live system checking but you do need to change the scripts if you use them to reflect the OS on which you're running!

The same need to tailor applies to Tcl / Expect scripts such as our basic expect example, our Tcl /expect parallel ping examples - we have them already modified for Caldera and Red Hat. Finally, ours Tk example for Linux may also need a little tailoring depending on your Linux flavor!

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


Related topics: via article database

Useful link: Python training

A variable number of arguments in a PHP function

Do you want to vary the number of arguments you pass in to a PHP function?
   loadarticles(2,3,6,5,4);
   loadarticles(5,7);

Simply declare your function with a minimum of parameters that you need (perhaps zero) and use the func_get_args() function to get you an array of all the parameters. Here's an example:

function loadarticles() {
  $abase = array();
  database_connect();
  $inputs = func_get_args();
  foreach ($inputs as $article) {
    $row = database_get("select * from mt_entry where entry_id = $article");
    $abase[body] .= "<tr><td class=\"pageName\">$row[entry_title]</td></tr>";
    $abase[body] .= "<tr><td class=\"bodytext\">$row[entry_text]</td></tr>";
  }
  return $abase;
}

The func_num_args function can be used to obtain just the number of arguments used to call your current function, and the func_get_arg function to obtain a specific argument by position number.

Although you can write a function to pick up a variable number of arguments, it is usually better programming practice to pass in an array of varying length ... so in other words, I'm advising you to used func_get_args sparingly!

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


Related topics: via article database

Useful link: PHP training

November 01, 2009

Melksham Forum

• Do you live in Melksham?

• Do you work in the town, or nearby?

• Do you shop here, or visit from time to time - on business, to see friends and relatives, or because you just like the place?

• Do you travel through, or past, and wonder what we have to offer?

• Are you thinking of visiting us?

If you can answer "yes" to any of these questions, please visit the new Melksham Forum. Sponsored by the Melksham Chamber of Commerce and Industry, the forum is open to anyone who has an interest in the town. Whether you live here, work here, or shop here, or perhaps all three, you'll be welcome. And if you're considering moving to the area, or have lived in Melksham or nearby in the past - perhaps being based at RAF Melksham, for example, you're also welcome to sign up, tell us about the past, and ask us about Melksham and the future here. The forum is open for visitors to Melksham too - if you're visiting family, or a business, or just touring the area, pop in and see us.

The Forum *is* new - so please register when you visit us and help us start to provide a really useful local service. You'll find thriving forums in other neighboring towns, but there's a been a gap in Melksham that this forum is intended to fill. When you register, you'll be asked to choose a user name and a password to secure your account. You'll be able to change the name that's applied to your posts in public from that user name, later on, if you want to do so. You may also be asked to retype some letters as a security check. Submit your request and within a few hours we'll confirm your account ... actually, it can often be within a few minutes, but the validation is a manual process, so we can't promise it will be 'lightning quick'.


Melksham, Wiltshire is a town of around 22,000 people situated about 100 miles to the west of London, on the Bristol River Avon. It boasts a wide variety of local industries - both old and new, manufacturing, service and distribution, physical and online. The town boats over 200 retail businesses welcoming walk-in trade, and many specialists are located here too, making Melksham very much a destination for select visitors from all over the world. The town has been growing, and is expected to continue to grow rapidly, based on government plans and encouraged by The County, the Town Council and others. With growth come the issues of growth - where extra employment should be located to, whether recreational and shopping facilities should be increased, or if the new inhabitants should be encouraged to travel for their services, and how the existing infrastructure an 'pinch points' such as car parks can continue to serve the current and be improved to server the new - or whether we should rip much of the town down, and start afresh.

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


Related topics: via article database