November 23, 2014

Good, stable, reliable local businesses

I took a phone call from Robin Denton, of Denton's directories. For as long as we've lived in Melksham, "Denton's" has been delivered every year and has been the direcory of choice that we keep to hand when looking for local numbers. We have a limited marketing budget (and a limited need to advertise the hotel; even yesterday - a wet November Saturday - we had to turn down walk-in would-be guests because we were fully booked). However, Denton's does get looked at, and does bring the occasional enquiry which turns into a visitor then an annual repeat visitor.

Good, stable, local businesses mean so much to us and to the local economy. It's a testimony to both of our companies that I knew Robin when he called, discussed his IT, and was able to give him the go-ahead with unaltered working for the coming year. Both of our companies move forward from a strong base, with things changin, but with things changing to mirror the times. When Denton's was set up in 1967, no-one would have thought of online, but they now have an online dietory, and facebook and twitter. And when Well House Consultants was set up in 1995, we would not have through of a hotel and accommodation.

Last night, we had a split between business and leisure (event in Melksham) guests. Everyone staying with is was with a company or group that has stayed before - guests become friends who know how the place works, and when it works for them, that leaves them in their comfort zone and coming back to us.

And tomorrow I start a series of courses for an organisation I have trained before. Not for a very long time, let it be said. But then in the training business, I certainly don't want the same person to take the same course a second time as that would indicate a degree of failure the first time ... it does - and acceptably - happen on rare occasions where someone learns but gets pulled from a project, only to find him / herself on a similar project a number of years later. Testimony to our training, I think, that they come back to us.

Things do change, and do need to change. I said to Robin that exactly the same text suits for 2015 as suited for 2014 (and 2013) on our adverts. It's too early to say what the case will be for 2016 yet, but I am very much aware of 2000 new homes, and a number of businesses, moving to Melksham, and I'm also aware of plans to include a 125 room hotel as part of one of the developements. For sure, the coming of the canal will help Melksham move itself into a leisure and tourism niche, but thats going to call in some adjustments and changes just as we've seen changes at Denton's and at Well House Consultants over the years.

Posted by gje at 07:06 AM | Comments (0)
More about Graham Ellis of Well House Consultants
Related topics: via article database

November 22, 2014

Learning to program - comments, documentation and test code

Updates material from our courses for newcomers to programming ... we're very happy to help newcomers learn about the basic principles of programming, running an extra day for a very small group on the front of our regular courses for delegates who have programmed before, but in different languages.

In this final session of "learning to program in xxx", I'm going to stress the importance of some of the more mundane elements, but practical requirements of programming.

1. You should comment your code so that the PROGRAMMER who follows behind you (or yourself in a year or two) can understand what has been done, and pick it up, fix issues, and update it. You should also include things like a version number so that you're not left puzzling which version is which, nor fixing an old version

2. You should document your code so that the USER who makes use of it knows how to do so. That user could be someone visiting your web page, running your application, or another programmer calling in elements of your code as part of his program; we've seen the use of library routines during the day so far ... and YOU may be providing such library routines.

3. You should provide SAMPLE / TEST code so that you can test the continued operatation of the application / routines in the future, and ensure that they're still running right when you transfer a copy to a computer running a different operating system.

Comments and documentation are not, entirely, extras that you have to provide in addition to the running code. By a good choice of variable names, and by insetting the code sensibly and spacing it out, you're doing much of than work within the code. And your test code not only helps you get the code right in the first place, but also provides examples of how it should be used for others who'll be making use of your code.

Posted by gje at 03:32 PM | Comments (0)
Related topics: via article database

Learning to program - what are algorithms and design patterns?

There are common themes for how programming statements are put together to give complete section of code to perform combined tasks. And typically these are putting together building blocks in a similar way to we would do things if we were working something out by hand.

Looking for the maximum value in a column of numbers, for example, we would start off by guessing that the first number was the maximum, and then we would check against each of the following numbers to see if it was greater, updating our guess if it was. Come the end of the reading down the column, the final value is no longer just a guess, it really is the maximum.

Such standard application of coding is known as the application of algorithms or design patterns - that latter term especially applicable to what we'll describe to you later on the course as Object Oriented Programming

All the languages that we teach have at least some algorithms and / or design patterns built into the language, as standard pieces of code in the library that we've referred to earlier in this module. In some languages, such as Lua and Tcl the standard libraries are quite small, and on the course we'll be showing you how to code certain algorithms yourself. In others such as PHP, we have a standing joke around the class that says "there's a function to do that" ... and indeed a huge array of common functions are available to you which you can call up in a single line to run a particular algorithm against some of your variables, passing back a result into another variable. Java, Python, Perl and Ruby - and some of the other languages - have a large number of algorithms available to you, included in the language distribution (as so present on your computer's disc / file system) but only loaded in to memory at run time, typically on your request through a program statement asking for them to be loaded. And resources are available in virtually every language on teh web to provide shared algorithms which, whilst to commonly enough needed to included in the distribuiton, are never the less worth sharing.

Posted by gje at 03:16 PM | Comments (0)
Related topics: via article database

Learning to program - variables and constants

Further material from our "learning to program in ...." courses ... an introduction to variables and constants

variable basics

Information - data - needs to be stored in a program between statements. Or rather it needs to be stored in the computer's memory. At the lowest of levels, that's a binary pattern of 0s and 1s in a numbered memory location that's encoded in such a way that it can be formed back into something that represents a number, or a string of text. I've programmed computers that work like this - in the very early days - it works, but it's pretty impractical for anything but elementary programs. So what do we do?
- We give descriptive names to the places we need to store the data
- We allow the programming language stuff to decide where to store the data in memory so we don't have to bother
- We have the programming language deal with all the low level formatting too

Variable names are typically of the programmer's choice, subject to a strict series of rules that differ from langauge to language. Typically, they'll be comprise a letter, followed by more letters, digits and underscores. Maximum name length, whether capital and lower case letters have a different meaning, whether a variable name may start with an underscore differ. Also
- In some langauges, variable names are [sometime] preceeded by a special character - a "sigil"
- And in some languages, certain words can't be used as variable names - "reserved words" such as if and break

In some languages, the programmer is required to state the names of the variable that wil be used so that the compiler can allocate memory efficiently; that also has the benefit of making the programmer thinks about exactly what's going on. In other languages, it's the langauge internals which work out what storage is needed, and how it's to be used / coded, based on the context in which it's used in the code. Although this latter solution sounds easiest to write and is good, it does have the disadvantage that it's all too easy for a variable to be misnamed and for the programmer to end up with a 'bug' that's hard to find.

On types and Scope

I've mentioned different types of data that need to be stored .. there are whole numbers, numbers with decimals, pieces of text, and others too - collections or groups of variables, booleans ("true" or "false") and indeed composite varaibles of our own type definition. As you get deeper into programming, you'll need to understand these various type.

Data sometimes need to be converted between types - for example a string of characters input by our user at the keyboard needs converting into a number on which calculations can be done. In sorme languages, this is done automatically for you, but in others you have to request explcitly that it be done.

There's also the matter, as programs grow, of how long the data in them (and the name) is retained - it would be wasteful in a long running program to retain data that's only required for a very short period as the program starts up right through to when the program finished running, but it would be frustrating if the programmer came to use a piece of data to find that it had gone away. There's the further matter here of a program that's got sections written by different programmers, and the need for variable names used by each of the programmers to be distinct from each other. Think of two families living in the same town, both who have daughters who they name "Lorna". That's find and good around the home, but when the two young ladies end up in the same class as school, the teacher says "please stand up Lorna" and both will stand up ... so there needs to be something extra. This subject is called the scope of a variable, and it's so important that we raise it to make you aware of an upcoming issue even on your very first day of programming, though solutions and detailed discussions must wait until we're further into the course.


There are some numbers - "constants" - which won't change (or you don't expect to change) in your program. There are 24 hours in a day, and 7 days in a week. And there are some values which are constant to you - the maximumm number of delegates on a public course might always be 7, the number of working days in the week might be 5, the BMI levels below which and above which a person is regarded as being unhealth may 20.0 and 25.0.

There's nothing to stop you writing these numbers directly into your program, but that's not a good idea:
* You'll find it hard to find all occurrences of the number should it ever change
* You'll write code that's confusing in the extreme if the same constant happens to apply to two things
* The code won't be very descriptive when you come to read it back.

So you'll find that early on we recommend that you assign constants into named locations, and on this first day of the course we'll use variables. However, many languages also support a special notation for named constants, and if you use that:
* Your code can run more efficiently as there needs to be no mechanism to amend a value
* In languges which statically assign memory, a whole heap of complexity can be solved is the constant is a "maximm number of ..."
* The maintenance programmer is clearly told "this value won't be changing at run time"
* The constant can be much more widely scoped so that its's available right through your code without scope conflicts.

Posted by gje at 02:40 PM | Comments (0)
Related topics: via article database

Learning to program - Loop statements such as while

If your program always ran each statement just once (indeed skipping over statements which were in blocks in false conditions) it would run very quickly and would have little use. You couldn't (for example) run a program which went through a whole series of results from a database query and displayed particular data from each of them (plus perhaps a summary on the end).


So all programming languages have the ability to repeat a block of code, and the most fundamentel of these repeats ("loops") looks like this:
  while {some sort of condition is true} then {run a group of statements}

You'll note that this is exactly the same format as the if statement in the previous section, apart from the replacement of the word if by the word while. Operationally, it differs in that once the group of statements in the block has been performed, the program rechecks the condition and if it's still true it runs the block again, keeping doing so until the condition becomes false.


* If the condition is false when first checked, the block isn't performed at all - a loop runs zero or more times
* If the condition never goes false you potentially have an infinite loop that goes on for ever
* Conditions are just the same as the conditions mentioned for the if statement in the language you're learning.

Newcomers to programming sometimes take a few minutes to grasp their first program with a loop statement, as for the first time the code jups backwards as well as forwards as it runs. And they sometimes have trouble working out which statements go where.

* If something may need to be run multiple times, it goes within the block (or within the condition to the while)
* If something only runs once and that's BEFORE the code in the block that may repeat, it goes before the while ("initialisation")
* If something runs once after any repeated code, that goes AFTER the block that may repeat (e.g. printing a total

Your tutor will show you a while loop in the language you're learning at this point, and have you write one too.

breaking out of loops

At times, you'll want to jump out of the middle of a loop and continue running code below - if (for eaxmple) you've identified inoming record that you were looking for from a stream of data, or if you have reached a threshold. So languages provide you with a statement that you can put witin a loop to get out of that loop even though the condition at the top hasn't been checked and gone false. The keyword used is usually break but sometimes (in some languages) it's last.

Putting a break into a loop to be run unconditionally would be rather pointless, so you'll find that any break statements will be within a conditional statement such as i(but not limited to) an if within the loop.

Most languages also support a continue statement (sometimes next) which allows you to skip the rest of the block code and go back up to test the condition straight away. Very useful if you're filtering a stream of data and you've identified a record such as a comment that you want to skip over without further processing.

Some languages have other flow controls in loops to - you may come across redo and retry. Early programming languages supported goto statements (and indeed some still do), but except in exceptional circumstances, their use is discouraged - they make for code that it very difficult to debug or to follow, and often impractical to upgrade when specifications change ... and there are now far better ways.

Other loops

while is the most fundamental loop statement, and it's the natural one for us to choose to introduce on this first day of our "learning to program in ..." course. But there are many other forms of loops that you'll come across later in the course, and in practise you'll find such other loops used more that while. Keyowords are for, foreach, loop, until and repeat.

If you are writing web applications (Java Servlets or JSPs, PHP scripts, or CGI or otherwise server based code in other languages such as Ruby, Python, Tcl, Lua, C or C++) Your whole application will potentially be run in a loop. Each time a user submits a form to your code, (or an automated client calls up your URL), the code is run, in effect in a loop that's controlled by the web server with your code be the innards or the loop. This means that there are times wher code towards the top of your web application may be run after code than appears later in your web application (due to condtionals) even though it doesn't look like it's in a loop at first glance.

Posted by gje at 10:55 AM | Comments (0)
Related topics: via article database

November 21, 2014

Learning to Program - the conditional statement (if)

Every language has some sort of conditional statement. That's a way of looking at some sort of setting or status in the program and performing some sort of action based on that setting or status.

such statements take the form ...
  if {some sort of condition is true} then {run a group of statements}


The word if applies in every language that we teach at Well House Consultants at present, but how we define the condition, how we signify the end of the condition and the start of the group of statements, and how we stop and start that group varies.

Some definitions
- a BLOCK of code is a series of statements grouped together. Actually zero or more statements, as at times you'll want to have a "do nothing" group
- DELIMITERS are the characters or character groupings thet start and end blocks. They may be the words then and , they may be the characters { and }, or thy may be a pattern of spaces and tabs that insets the block in the source code. Sometimes they may be left out, and if the language supports that they imply a block of a single statement.

The condition that's used in an if statement if going to be an expression that evaluates to a "yes" or "no" value - true or false. Exactly what comprises true and false varies between languages - very often if your conditional expression works out at zero, that's false and it it works out to any other number, that's true. But numbers are only used in this way a small proportion of the time, as languages come with special oeprators which compare two values and return true or false based on that comparison. Commonly they are:
  == ... "is equal to"
  != ... "is not equal to"
  < ... "is less than"
  <= ... "is less than or equal to"
  > ... "is greater than"
  >= ... "is greater than or equal to"

But BEWARE ... in some languages (SQL and Lua) even these vary, and in many languages (Perl, PHP, Shell for example) there are alternatives which do somewhat different things, and in some (Java, Python, Ruby, SQL, C, C++ for example) there are functions (I'lltell you about those another time) which you may call to make alternative comparisons. In other words, you're never limited to just the six comarisons.

These are notes to accompany your "Learning to program in xxxxx" course at Well House Consultants, so I'm not going to attempt to describe all the options here. Instead, your tutor will demonstrate the first, most basic conditional statements to you at this point and let you try them out.

One of the question that comes up for newcomers to programming is "why do I need a closing delimiter?". It's needed to tell your program that you've reached then end of code that's only run in certain circumstances and you're back into "always" code beyond that point. Imagine that you're driving a car and you decide to pull into a service station:
  if (ineed == "loo") then { ......}
The block of code in the curly braces defines what you need to do in the service station, but then when you get backon the main road it's "carry on as before", even if one or two of the variables (such as your comfort level) have been amended. The closure is vital as it removes the need for all subsequent code to be repeated - it's an indication of the coming together.

elseif and else

Usually, you'll want to perform one action if a condition is true, and some different action if the condition is false. Whilst it would be possible for you to write the "opposite" if statement, that's ineffiecent (at writing and run time) and prone to error, so languages support some sort of otherwise statement.

You can follow an if with one or more elseif or elsif or elif clauses (the keyword varies from language to language!) which in each case will have a further condition attached to them, and they'll have a block of code that runs if that alternative condition is true.

Note that the order of the various conditions is important, as once a true condition is found as the code runs, that's the block that will be run and the following ones won't be, even if the condition on them is also true.

Finally, you may finish your if statement with else and a block to accompany it. This is your 'catch all' or safety net which will be performed if neither the if condition, nor any of the el[se]if conditions was true. The else is optional, you can only have one of them, and there is no condition attached to it.

nested and joined conditions

You'll often find that you want to test for conditions within conditions (i.e. within the block of what to do) and you can do this. If you've stopped at the service area above because you needed a natural break, you'll be making other subsidiary decisions in there about wheth to use the loo, have a coffee, buy sweets for the kids, call your desination to update your arrival time, etc. Note that you'll complete all of those extra actions before you complete the main action of making a stop at the service area ... So nested conditional start in the order 1, 2, 3 but end 3, 2, 1.

There are also times that you want to perform a certain action only if two conditions are true. You could do this with nested blocks, but you'll also have an alternative, typically using the words and or or to link up conditions into a single composite conditions. Very often, either && or & are alternatives (with subtle differences) for and, and or may be relplaced by || or |. This is a subject for much deeper study later in the course.


As soon as you start introducing condtional code, you introduce multiple routes through the code so it becomes very important to give throught to a thorough testing regime.

As a minimum, you should test your progran before its use in a live application by running every single possible condition though its true and false routes. And you should consider also:
* Running your code such that all combinations of conditions are tested
* Testing your data where both valid and invalid user inputs are made
* Remember to test "boundary" conditions ... if you're testing for age under 18, run your code with (say) 16 and 20 ... BUT ALSO with 18 itself.

Testing gets to be repetitive and (let's admit it) a bit boring at times, and it's far too easy for us to skip. Yet it really should be repeated in full for each and every iteration / release of the code. We'll broach the detail of testing later on the course, but for the moment bear in mind that a standard set of tests, automated in a file so that you can easily rerun them, and with extra software to pick up hundreds or thousands of passes and the occasional fail is going to be far better that your programmer working through each and every test at every upgrade. You might even want to write the tests before you write the code that it's going to be testing - that's Test Driven Development or TDD

Posted by gje at 07:53 PM | Comments (0)
Related topics: via article database

November 20, 2014

Are administration / review charges on hotel guests acceptable?

I see from the press that a hotel in Blackpool charges £100 to guests who post poor reviews of them online, and that the hotel is rated as number 858 of 894 hotels in the town. My cynic's view is that they might be finding it a goor way to raise extra money, especially as they're quite a cheap place towards the lower end of the market.

These day, though, all good hotels and B and B proprietors are working to get good reviews, thoughtful in handling justified but poor reviews, and concerned at what do do in the event in an unjustified, perhaps malicious, slamming. You may wonder "would that really happen" ... well, yes, I'm afraid it would.

1. We opened our doors to the cameras of "Four in a Bed" - a TV show in which only the highlights of a week's visits by guests least likely to choose to stay (given the option) are broadcast. It's set up to be an interesting show, and it's marvellous publicity - but it also raises emotions including (we have learned) in people who have never stayed, and who judge a place purely by what they see of it and its owners on TV, and have those emotions raised to such an extent that they follow up on what they think as if they had stayed.

2. People love a bargain. And some love complaining in order to get a better deal. "We always look for faults when we check in so we can complain and get an upgrade" said a contact to me once ... and I can believe it of her. We've been caught once (once too many) when I suggested to a guest who had reported a spec on the mirror that shouln't have been there that she pay what she felt to be the right amount, and she walked out at the end of her stay paying nothing. And this tiny minority of people will quite cheerfully threaten a poor review unless [insert what they want here] ... occasionally following through if the hotel doesn't give way.

So, I have an understanding for the folks in Blackpool. I think they have it wrong; I think they need to look at their product as say "perhaps these people have a point" ... but I do have an understanding.

And I was taken by a peverse parallel too. We too have a £100 charge in our terms and conditions which we may levy. We have a very late cancellation without penalty policy as business guests do need to change plans at the last minute on occasions, but late cancellations do cost us. So we reserve the right to make a charge of up to £100 in cicumstances where cancellations are not bona fide or prompt - say someone books a room "just in case", or if they decide they're not travelling weeks ahead, but only let us know with little notice. And we would also apply the charge should someone cancel, then phone in to re-book a few minutes later and ask for a last minute bargain price because "I know you had a room just cancel". They would probably find, indeed, that they weren't welcome to rebook even with the £100 penalty as the trust that's needed between guests and operator would have been broken. We have - never - made the charge. But if there's a good case to do so, make no mistake that we would.

Posted by gje at 06:00 PM | Comments (0)
Related topics: via article database

An example of Model-View-Controller techniques in a Perl / CGI script

Separating out the look and feel of a web application, the calculation logic involved therein, the standard stuff that's needed in most web applications, and the glue that holds the pieces together was become pretty standard web programming practise.

We call the look and feel the VIEW
We call the calculation logic the MODEL
We call the standard stuff that runs it all the FRAMEWORK
We call the glue holding it together the CONTROLLER
And we call the standard functions we need to do extra bits the HELPERS

If you have with a very small application, then all this separating out of elements is more trouble than it's worth ... and on our courses, we start with small applications. However, in the last couple of days I wrote a Perl script using the Common Gateway Interface as part of a web server deployment course, and split it down to show where the elements come from. The complete script is here and you can run it [here].

Take a look at the script, projected here on the left, and you'll see the work I did on the course to show delegates where each of the elements lie in my simple script.

• the HTML at the page base is the view
• the calculation code to convert a height and weight into a BMI is the model
• the logic that takes and checks the inputs, calls the model and puts the results into a hash is the controller
• Helpers populate the view with the contents of the hash and output them
• the framework is new code that's written to wrap the other components together.

So the actual code ...
The Framework - [here]
The Model - [here]
The View - [here]
The Controller - [here]
and the Helpers [here].

Posted by gje at 04:13 PM | Comments (0)
Useful link: Perl training
Related topics: via article database

November 19, 2014

PHP - some quick fixes if scripts have issues, and how to use our support

PHP is a language which is highly configuable throguh the php.ini file - and indeed there are options added / that go away in that file between releases too. So sometimes you'll get warning messages from our scripts even though they work completely correctly for us.

All of this is explained on our courses, and our material on this site is primarily course supporting in its nature. And because of that supporting nature, some of our examples are simplified to the extent that they don't start doing checkes for all possible php.ini settings and reconfiguring to suite.

As a quick rule of thumb, most of the warnings will be cleared by adding
  error_reporting(E_ALL & ~E_NOTICE);
to your code. To some extent this is a "work around" but it will clean things up.

If you know enough PHP to make these changes, fantastic and good for you - please feel free to use the examples in your work (but remember that they come without warranty - it's at your risk). If you don't understand my instruction, I'm going to make three suggestions:
  a) Come on one of our PHP courses to learn it
  b) Arrange to pop by one evening and (at no charge), I'll help you for an hour or two
  c) If neither (a) nor (b) is practical, find yourself a local expert who can help
I can help debug code by email at time, but it's not a practical way for me to teach the basics - sorry. It can be done but it's a huge time drain, and it's going to be very frustrating for you too. Rather like a correspondence course that's being specially written, and I don't belive that our regular customer base would want to see less courses and higher prices while I sort out the basics for people who I want to encourage, and to whom I've offered three alternatives, only one of which would cost them anything. Much appreciate your understanding!

Posted by gje at 08:35 AM | Comments (0)
Useful link: PHP training
Related topics: via article database

November 16, 2014

Learning to Program - how we start to teach you at Well House Consultants

At Well House Consultans, we offer courses at two levels in a number of programming languages. Our "learning to program in ..." courses are for delegates who have never programmed before, or who are rusty, who lack confidence, or want a refresher of the basic principles. Our "... programming" courses are for delegates who have prior programming experience, but are converting from another programming language to the one that we're teaching at the time. By offering two different starying points in this way, we can ensure that newcomers to programming aren't swamped in the first hours, yet experienced programmers don't have to sit through a day of the basiss.

This module accompanies the "learning to" courses and intentionally leaves out code examples. It's very easy for the tutor on your course to show you "one I wrote earlier", but that doesn't teach you as a newcomer how to write a program for yourself - you need to see the thought process, so it will be done by demonstration. The examples written will be made available to you after the course, and you'll also find code in the following modules of the notes which also apply to the courses where we start with experienced programmers.

So - let's start!

Stored programs ...
* We start with a series of instructions in a text file
* Each instruction is separated from the next somehow
* Instructions are run sequentially
* Possibly wrapped in some sort of named block to say "Start here"

Running a stored program ...
* We need to translate from text to runnable
* That may be through an intermediate process - there are three common ways (compiler, pure interpretter, and virtual machine)
* There will be common code to all / most applications, and that will be loaded from standard libraries

Hello World ... and Hello delegates too
It's traditional on all programming courses for the first example to output the words "hello world" onto the programmer's screen. Of course, that's very much more simple than any practical program but it show you
* How you input the program, what you write and where you store the "source code"
* How (and if) you translate that program into a different format from which yu can run it
* And how you run the program

The tutor will demonstrate this to you, and have you try it out too. It will feel clunky at first. Don't worry about that - you'll speed up later, and there will be lots of other things to learn about in yor chosen language that will make it easier too.

At this point, one of things to think about is how portable your program will be between different computer architectures and operating systems. You may feel it's early to look at this, but right from the start you'll want to know about the portablity and re-usability of your work.

Commenting your code

Also at this point, we'll take a first look at code documentation. "Hello World" really doesn't need too much backup information for the maintenance programmer - either a colleague of yours, or you yourself when you come back and try to remember what you did in 6 months or 6 years time because it needs updating.

* Every language allows for comments in some way or another, and we'll add some to "Hello World".

Comments make no difference to the running of your code, but they make a huge difference later on. You should include information about what the blocks of code do, and also any notes about the environment in which they are designed to run. Version numbers, copyright, and support contact details and terms and conditions are also worth considering in serious code blocks.

As well as programmer's comments, instructions for your user should be provided. Most languages provide you with specific tools and an ability to build these instruction into your source code. And it's very likely too - with modern programmig - that you'll also provide some sort of test suite that lets you and your customers check that the program's functionallity is still working as planned after upgrades and changes.

To see our upcoming public course schedule, take a look [here]. The format above is your starter in each and every language, but it's adapted to the language of choice - we start as we mean to go on!

Posted by gje at 06:11 PM | Comments (0)
Related topics: via article database

Java - an update of the basics

Java is a programming language - a way of specifying a series of operations to be performed one after another to a computer which is written in a coded way - often described as "English Like" - rather than in a binary pattern of zeros and ones which all computers work with at the lowest level.

If you're using Java, you'll usually write your operations or instructions into a file with a .java extension, and then use a program (a "java compiler") to convert those instructions into a format that's not human-readable called a "class file". That class file is designed to be efficient in operation when you run your program, to be modular so that code can easily be shared between multiple programs, and to be portable so that it can run on all sorts of different systems without needing to be changed. And in order for it to run so widely, each machine it runs on needs to be provided with a common interface to run it - that's itself a program called a Java virtual machine or JVM.

Java started off at release 1.0 and has progressed through to Java 1.8. Sun Microsystems, Java's originators, were very conservative in moving release numbers forward, sticking with "1.x" because the code written for 1.0 is still operational on 1.8 (i.e. to this day) with no breaks in compatability.

However, Java was extended and provided with so many extra packages over time that it's became a different prouct and so it was known as "Java 2" from around version 1.2 ... and that carried on until "Java 2" version 1.5. From that point onward, the marketing name has been Java 5, Java 6, Java 7 and now Java 8.

Now an Oracle product, with Oracle having bought out Sun Microsystems in 2010, Java these days is both a server and a device programming language, with web servers supporting major applications written in Java, and phones such as the Android also having their apps written in Java. The days of it being just an embedded language within a browser are a distant memory.

At Well House Consultants, we have taught Java from the early days of the language - and you'll find many examples on our web site including stand alone ones, ones to be embedded in browsers ("applets") and also server side code in the form of Servlets and JSPs (Java Server Pages).

Java is a well designed language - however, in the earlier days it was much oversold and I found that a significant proportion of delegates learning the language were doing so to use in applications for which its wasn't / isn't suited - there are circumstances where Perl or Tcl or PHP were much better in those earlier days, and today perhaps Python, Lua, PHP or Ruby might be a good decision. And so - with many other courses to offer, and many other people teaching Java, we dropped public Java courses while continuing to offer the training on closed or private courses to companies and organisations who we felt were using Java for reasons that we could endorse - of which there are many.

Progressing, Java has branched off in many directions. Where there were just 8 standard add-on packages with Java 1.0, there are now thousands, and it's simply not possible for one small company to honestly say they know them all (or even all of the common ones!) ... and training requirements will often include not only the basics, but also some extension or other. And as we just know "of" the extensions, rather that their detail, our private Java courses these days are limited to the fundamentals of programming in the language. We are happy - very happy - to teach your group "Learning to program in Java" and indeed I have a series of such courses coming up. And we also provide one area of more extended training, which is in deploying Java applications under the Apache Tomcat server - that as a public course as well as a private course - see [here].

Posted by gje at 04:18 PM | Comments (0)
Useful link: Java training
Related topics: via article database

Too many Staffies, too many lurchers

On a lovely autumn day yesterday, dad and I (and Billy and Gypsy) joined the walk organised by Swindon's Needy Dogs around Coate Water - the old reservoir that used to serve the Wilts and Berks Canal. I remember Coate Water well - a rural park setting on the outskirts of Swindon; not only a canal feeder way back, but an open swimming pool too in days gone by with an iconic diving board structure that says to me "THIS is Swindon".

I take my hat off to the people of "Swindon's Needy Dogs" - mostly, it appeared, ladies, who were out with their own dogs and a selection of dogs available for adoption. Sadly, the latter group comprising a handful of lurcher / sighthounds and a raft of Staffordshire Bull Terriers - all of them beautiful dogs; some being timid but the majority just wanting to be friends.

The statistics of numbers of dogs who are unwanted is frightening; it's the lucky ones who make it to a rescue such as SNDogs and many, many, many more who are put to sleep through no fault of their own. The fault, in my view, lies with the system and the people who allow for an overbreeding of a domestic animal with supply far outstripping demand. I look into the eyes of that Staffie puppy on the walk and I think "than goodness you are safe, but xx (I was quote a number) are put to sleep every day. Yet as an individual, I can do nothing and I wonder at whether the rescues at times are just putting a sticking plaster on the situation and perhaps even providing a climate in which more dogs are bred than would otherwise be the case.

Dad and I walked slowly and the group was soon ahead of us. Gypsy loves stopping for a sniff, and the autumn made for a pleasant strole. And we caught up with the lady walking the "for adoption" puppy. A mum, and a couple of toddlers with her, were chatitng - "I'm so glad I met you". "I'll go home and have a chat with my husband". Kid with arms around the dog; love at first sight? It seems / seemed almost a barbaric way of doing things - back to the days of putting slaves in the market, and yet what can a rescue do but market the dogs, tug at heart stings. I rest assured, though, that SNDogs do have a house check procedure and that although I may have witnessed "love at first sight", they also know "a dog is not just for Christmas" ... I really hope that what I saw was 3 and 1 coming together, making 6 in love for the mutual happyness of everyone. I hope it works out for them, or is identified as "not in this case" before it's too late to avoid heartbreak. Mum, little lad and his sibling walked on; an initial tear, but then a skip of looking forward as mum said "we'll talk with Dad".

A couple of months back, we fostered Bobby who was in desperate need of temporary - or long term - accommodation in a loving family. Beautiful loving dog. Alas, our Billy was rather jealous and try as we might fur was flying - with the blame on Billy, Bobby being only to blame for his super-friendly, "I want to play" mentality. For the safety of both Billy and Bobby, Bobby is now kennelled at Animal Care (in Lancaster) where they have a policy of keeping dogs for as long as it takes to find the right home.

Bobby is always going to be a hard dog to rehome on a "love at first sight" basis. He's black (and, yes, people do have a bias against black dogs), he's Bull Terrier based (and there's no shortage of those, with an incorrect reputation of 'nasty') with some greyhound (again, there are so many of those).

If on reading this article you think "we would love to have a dog", or if you're looking to add a forever dog to your family, starting at the Christmas period, please take a look at Bobby - [here] - if ever there was a dog wanting to be with someone, loving them and being loved by them, it's Bobby!


Posted by gje at 10:34 AM | Comments (0)
Related topics: via article database

Welcoming genuine forum posters quickly - but turning away off topic advertisers

Running a forum such as the First Great Western Coffee Shop - a public facing site for passengers (and wannabe passengers) on train services in the Thames Valley, Wessex, South Wales and the South West of England - brings in around 70 pubicly posted messages a day. Such messages are the lifeblood of the forum, and we have a large number of members, with many more viewing as guests; we believe that people come and read the site to find out about what's going on in the area, and to get answers to rail and area related questions which are otherwise hard to come by.

With our open door policy of welcoming anyone who has something to say in our speciallity area, a typical sign up request will be from someone we don't know - after all, there are millions of journeys made on First Great Western trains each year, but our membership is only around 1,600 / readership around 11,000 different people in any month. Alas, that significant readership attarcts a large number of requests to sign up from people who want to use us as a platform to advertise their products, services, scams and opinions which are well outside our areas of interest.

We have automated tools which help us categorise signups - a "three star" signup results in an email to the admin team so that we can do a quick visual check and approve most genuine newcomers quickly. "Two star" signup requests get logged and the admin team checks on them on a regular basis; less that two stars, and take a quick look every couple of days just to see if anything useful may have appeared there, but the zero star category goes further and actually bans further signup requests from that source. I'm not totally telling you how we do it (in case this is read by people who want to sign up to advertise something off topic), but I will comment that there is good co-operation between forum operators so that intelligence is shared automaticlly; "forum spammers" as they are known will cheerfully adverstise their wares on just about any site where they can find a platform.

We're so well set up to cope with these things these days that the daily effort isn't huge, and indeed some of the user names and email addresses used help to create a light amusement. From this morning ... "Skinny Grape 415", "Nauseating Dinnex", "Saphire Moot", "", "" and "" ... I particularly admire the cheek of the person looking to sign up to spam post the forum with a "spamavert" email address. Yeah, right ;-)

Posted by gje at 09:14 AM | Comments (0)
Related topics: via article database

PHP training - refreshed modern course, backed up by years of practical experience

Our PHP course agendas were updated recently, and last week we ran our first series of courses in the new way. Learning to program in PHP started on Monday for delegate who are new to programming (or rusty) and PHP Programing for experienced programmers converting to PHP staretd on Tuesday.

Programming languages themselves change little over the years. A newcomers's first reaction to this statement is to look at the fast-changing technology world and be surprised and a little worried at an apparent lack of progress, but when you stop and think about it, you (as a programmer or a compny) want the work your do / the money you invest this month to have a use years and perhaps a decade ahead. So what does change? It's the use of the language, how it's applied and how new things are added for it to grow with the technology.

Until this autumn, we offered a separate Object Oriented Programming in PHP course, but now the OO approach is gently integrated with the main course. It's not rammed down the throats of people for whom it's an interesting but perhaps impractical tool, but it's there through the course. Please get in touch if you're a non-OO PHP user who wants to learn OO; we can still run the OO day on request!.

Much of the the PHP course - since its inception, years ago - has been about writing excellent code that's robust, reliable, easy to maintain and easy to upgrade / reuse as requirements change. And that's unaltered. We've spoken about Rasmus Lerdorf's 4 layer model (Rasmus is the father of PHP!) and how it's split out the helper routines that are common to many pages, the application specific calculations, and the template that give a look and feel to the site. Having such a structure allows the site to be looked after much more easily, with natural test points provided, an abilitly to update the look of the site without distrubng the maths, and an ability to change application algorithms without messing about with the look and feel. The four layer model has been ahead of its time ... for "template" read "view", for "appliaction calculations read "model", for the code that pulls it together read both "framework" and "controller". And what do you have? A Framework, with Model View and Controller, and sets of helper functions ... and best practise these days is very much to use an "MVC framework". The course has always encouraged appliaction authors to use the 4 layer approach, but we're now presenting it in a Framework / MVC way as well, thus bringing best practise to our delegates in such a way that they understand why it's an excellent way to work, and to help them decide if the way forward for them is to use their own structure, or to use a framework such as Zend or CodeIgniter.

The next "Learning to Program in PHP" course starts on 23rd February 2015, with subsequent courses in May, August and November. If you come back to this page in our archive, take a look [here] for our current public course schedule. If you have a group of 4 or more delegates requiring the same course at the same time, it's going to be cost effective for you to set up a private course instead - we can do that at our Melksham, Wiltshire training centre, elsewhere in the UK, or indeed just about anywhere in the world where it's legal (visa and work permit issues) and safe for us to do so, and where we share a common spoken language for use during the training course.

Posted by gje at 08:42 AM | Comments (0)
Useful link: PHP training
Related topics: via article database

Moving community rail support from amateur to professional

You'll have noticed an absence of posts recently on this blog - "overworked" I think is the term. Important immediate things like training courses and making sure our hotel customers require and have had attention, and I've been spending a great deal of time on voluntary stuff that's been immediate too, like making sure that I'm fulfilling the press and publicity role I have with the Community Rail partnership to the best of my ability in a year in which it's been critical to inform and draw people in to the new services.

However, as a volunteer doing this - and with significant help from others too - I've not been able to attend the meetings that I would wish, and the time has come for the role to become part time paid, rolling in with a Community Rail Partnership officer role. Along with the voluntary nature, I've 'short cut' some corners to get things done, and at times been far more preseidential than I should - very embarrassing the other day to be introduced as the chair of the CRP (which I'm not) and hear someone being told that I've brought the service in (which I haven't - I've just been part of the mouthpiece). And in this desire and push to get things done, I've caused some consternation / negative reaction in some parties such as neighbouring groups and officials we should be working with who feel that their toes are being trodden on, and that they're not fully informed as I have worked on their turf. I'm not getting any younger, either.

So - come the AGM of the Community Rail Partnership in January, I'm not going to offer myself as a candidate for any of the officer / official roles. There are a number of strong people on the team who can do professionally what I've been helping with as an amateur, and if requested I'll be happy to support them as best as I can. Perhaps I'll be more involved with "special projects" and I'll certainly be making sure that there's a smooth hand-on if that's required, and retain my position as a cheerer for the rail services in thee parts.

Posted by gje at 08:02 AM | Comments (0)
Related topics: via article database

Well House Consultants Ltd.
Copyright 2014