The Well House Newsletter - Friday, 26th April 2024
About us and this newsletter [link] ...
Previous editions: March 2024January 2024November 2023September 2023July 2023May 2023March 2023January 2023November 2022 • this is the current edition

Public Transport Training from Well House Consultants And also ... Tcl, Tcl/Tk and Expect Programming in Lua Python Programming Well House Manor - Hotel and Training Centre Apache HTTP and Tomcat Servers The Perl Programming Language and its use Ruby and Ruby on Rails PHP - the language and its application C and C++ Programming Linux and Shell Programming Melksham SQL and MySQL For the Webmaster, Postmaster and moderator Java and the Java Environment Fun and Flames Running a training and hotel company Around, about and nearby to Wiltshire Client Side Languages (HTML, CSS, Javascript) Keynote Articles General Programming Topics
Keynote article ...

Regression testing - via a very short C testing framework

Code testing is important. Separation of code into separate, managable sections is important. Retesting of code running all the old tests is important when the code sections are enhanced / debugged.

At the end of this week's C course, we wrote a whole series of pieces of logic relating to web server log files - loading data into dynamic (realloc'd arrays of structs, and then extracting data from those structures. And we wrote an initial main routine to run and test from the command line. For initial development, that's great but ...
... the main couldn't remain as we started to build with the logic
... lots of sections / routine groups need testing.

Solution?
• Rename main to a different name such as test_access and leave it in the original file
• build a tiny test harness that runs each set of tests and correlates the results
• have the test harness send standard output (stdout) within the tests to a file

Result?
A rudemintary regression testing system, where each time you add a new set of routines or change something, you can rerun all the tests and get an automated set of replies.

The results of running the test suite look a bit boring:

  WomanWithCat:cj16 grahamellis$ ./framework
  
  .F..
  Failed 1 test(s) out of 4, passed 3
  
  WomanWithCat:cj16 grahamellis$


Commented framework source is [here] and tests and routines to be tested [here] and [here].
(this article written on 2016-01-29)

Other articles ...

Linux and Shell Programming
[4587] shell - bash. Writing conditional tests and statements - the options available
[4586] Extending your bash shell with aliases, functions and extra commands
[4585] What is make? What is gcc?
[4584] Bash ... some new scripts to - handling user input
[4487] Starting MySQL. ERROR! The server quit without updating PID file - how we fixed it.
Top or Show all for Linux and Shell Programming

Apache HTTP and Tomcat Servers
[4708] Scons - a build system in Python - building hello world
[4491] Web Server Admin - some of those things that happen, and solutions
[4434] Public training courses - upcoming dates
[4432] Java web application for teaching - now with sessions and clustering / load balancing demonstrations
[4431] A Java servlet that is also a stand alone program. And a server that is also a web client.
Top or Show all for Apache HTTP and Tomcat Servers

C and C++ Programming
[4635] Encapsulating logic in functions and structs - the C approach to Object Oriented techniques
[4633] String handling in C - new examples of extracting integers from a string
[4566] C - why is slow to write and debug) but fast to run?
[4565] Allocation of memory for objects in C++ - Stack v Heap
[4563] Formatting and outputting your own classes in C++
Top or Show all for C and C++ Programming

Melksham
[4738] Melksham Chamber of Commerce - my final Presidents report
[4706] Melksham trial train service is to be made permanent
[4704] Three months in community rail pictures
[4703] What do people use the bus for in Wiltshire - survey interim results.
[4701] Pretty at the station too
Top or Show all for Melksham

Training from Well House Consultants
[4769] Python, Tcl, Lua and other Open Source programming courses for 2018
[4751] Final day of training at Well House Manor - Python, Lua, Tcl and C/C++ continue at The Spa, Melksham
[4705] Course dates - from October 2016 to December 2017
[4689] Training Course schedule for summer and autumn 2016
[4671] Ruby training, half a world away
Top or Show all for Training from Well House Consultants

Running a training and hotel company
[4613] Our best hotel customers help us ... to help them ... be our best customers.
[4603] Happy New Year. Our customers are our ambassadors
[4543] Saturday morning at Well House Manor
[4521] Should we get an AA or Visit Wiltshire hotel assessment?
[4468] Four in a Bed - most popular answers
Top or Show all for Running a training and hotel company

Well House Manor - Hotel and Training Centre
[4715] Well House Manor - Still five out of five!
[4644] In your room at Well House Manor, Melksham, Wiltshire
[4582] A near-empty plate of pastries - sign of a breakfast enjoyed
[4567] Japanese and Malaysian food in Melksham
[4379] Well House Consultants / Well House Manor - Prices for 2015
Top or Show all for Well House Manor - Hotel and Training Centre

For the Webmaster, Postmaster and moderator
[4651] Pressure selling in the fire safety business
[4520] No cold sales calls please - but delighted to hear from others!
[4492] Almost so wrong, but perhaps it's right for some?
[4474] Effect on external factors on traffic to our web sites - an update
[4426] FileMaker Day to Unix Time conversion
Top or Show all for For the Webmaster, Postmaster and moderator

General Programming Topics
[4763] Regex Reference sheet
[4707] Some gems from an introduction to Python
[4673] Separating detailed data code from the main application - Ruby example
[4663] Easy data to object mapping (csv and Python)
[4656] Identifying the first and last records in a sequence
Top or Show all for General Programming Topics

PHP - the language and its application
[4655] Image indexer / thumbnail display scripts in PHP
[4642] A small teaching program - demonstration of principles only
[4627] Caching results in an object for efficiency - avoiding re-calculation
[4626] Singleton design pattern - examples and uses
[4483] Moving from mysql to mysqli - simple worked example
[4437] Adding a PHP build option, rotating an image based on camera data, and a new look at thumbnails in PHP
[4366] Changing what operators do on objects - a comparison across different programming languages
[4356] Object factories in C++, Python, PHP and Perl
[4319] PHP - some quick fixes if scripts have issues, and how to use our support
[4310] Problem ... I want to print a series of numbered forms
[4244] Disambiguation - PHP List
[4136] How do I post automatically from a PHP script to my Twitter account?
[4106] Web server efficiency - saving repetition through caches
[4075] Further recent PHP examples
[4074] A comment on comments in PHP
[4073] Learning about Object Orientation in PHP - a new set of examples
[4072] Splitting the difference with PHP
[4071] Setting up strings in PHP
[4070] Passing variable between PHP pages - hidden fields, cookies and sessions
[4069] Even early on, separate out your program from your HTML!
[4068] Arrays in PHP - contain different and even mixed data types
[4062] Sessions, forms and validation in CodeIgniter - early examples
[4060] CodeIgniter - an excellent PHP framework with an easy start point
[4059] Curl and curling from PHP
[4057] stdClass in PHP - using an object rather than an associative array
[4055] Using web services to access you data - JSON and RESTful services
[4053] Frameworks - learning through exploring and understanding data sources
[4050] A couple of new fast-start PHP examples
[3999] Handling failures / absences of your backend server nicely
[3966] Our examples work with any recent version of PHP
[3959] Testing code coverage (have I tested everything?) in PHP
[3958] Testing classes for your PHP website with PHPUnit
[3956] Zend / layout of MVC and other files in an example application (PHP)
[3955] Building up from a small PHP setup to an enterprise one
[3953] Objects in PHP - Revision
[3952] PHP revision ... by example.
[3946] Moving from a warning system to a control system - PHP, forum spammers
[3926] Filtering PHP form inputs - three ways, but which should you use?
[3918] Multiple page web applications - maintaining state - PHP
[3916] PHP variables - dynamically typed. What does that mean?
[3841] Copying, duplicating, cloning an object in PHP
[3840] Autoload in PHP
[3820] PHP sessions - a best practice teaching example
[3817] Fpdf - generating .pdf documents easily from your PHP program
[3813] Injection Attacks - PHP, SQL, HTML, Javascript - and how to neutralise them
[3789] More than just matching with a regular expression in PHP
[3747] An easy way to comply with the new cookie law if your site is well designed
[3734] QR codes with marketing logos embedded
[3635] Parse error: parse error, unexpected T_STRING on brand new web site - why?
[3584] QR codes - graphics images that provide quick phone links
[3568] Telling which ServerAlias your visitor used - useful during merging domains
[3540] Easy session example in PHP - keeping each customers data apart
[3539] Separating program and artwork in PHP - easier maintainance, and better for the user
[3536] UK Mapping Data - and more to come - under government Open Data measures
[3534] Learning to program in PHP - Regular Expression and Associative Array examples
[3515] PHP - moving from ereg to preg for regular expressions
[3458] On this day ... one PHP script with three uses
[3453] Reading and using emails including enclosures on your web server.
[3379] Sorting data the way YOU want it sorted
[3210] Catchable fatal error in PHP ... How to catch, and alternative solutions such as JSON
[3197] Finding and diverting image requests from rogue domains
[3186] How to add a customised twitter feed to your site
[3163] Twitter - the special use of @ # and http: in tweets
[3143] On time
[3132] Virtual Hosting with Apache http server - an overall scheme, and avoiding common pitfalls
[3094] Setting your user_agent in PHP - telling back servers who you are
[3036] Sending out an email containing HTML from within a PHP page
[3029] PHP data sources - other web servers, large data flows, and the client (browser)
[3027] Server logs - drawing a graph of gathered data
[3025] Learning to Program ... in PHP. Course examples.
[3020] Handling (expanding) tabs in PHP
[2981] How to set up short and meaningfull alternative URLs
[2939] Protecting your images from use out of context
[2921] Does copying a variable duplicate the contents?
[2918] Downloading a report from the web for further local analysis
[2917] Upload Image, Store in database, redisplay in browser. PHP and MySQL
[2912] Predictions for the seagull population
[2774] PHP - Object Oriented Design in use
[2773] Dynamically watching your web site via a PHP wrapper
[2742] A simple server benchmark script
[2738] What is all this SESSION stuff about? (PHP)
[2729] Uploading a document or image to its own URL via a browser
[2684] Exception handling in PHP
[2682] Adding extensions to PHP Open Source applications - callbacks
[2680] Static class members in PHP - a documented example
[2679] How to build a test harness into your PHP
[2667] Web page to telephone calls / links using an iPhone
[2646] Compile but do not run PHP - syntax check only
[2635] A PHP example that lets your users edit content without HTML knowledge
[2632] Shipping a test harness with your class in PHP
[2631] How to show a large result set page by page in PHP
[2630] Static variables and ampersands in PHP
[2629] Curly braces within double quoted strings in PHP
[2589] Your PHP code does not work? Here is where to start looking.
[2583] Reducing image size on digital photos - PHP
[2545] Scraping content for your own page via PHP
[2539] Changing Images
[2488] A variable number of arguments in a PHP function
[2478] How did I do THAT?
[2433] Controlling, supressing, enabling PHP error messages
[2432] Using print_r in PHP to explore mysql database requests
[2430] Not just a PHP program - a good web application
[2400] Are you wanting to learn PHP?
[2361] Geocoding - converting address to latitude / Longitude with PHP via Google
[2343] World Flags in your PHP pages
[2320] Helping new arrivals find out about source code examples
[2317] How to make a Risotto (PHP build style)
[2304] Extracting real data from an exported file in PHP or Perl
[2275] Debugging multipage (session based) PHP applications
[2274] PHP preg functions - examples and comparision
[2222] A (biased?) comparison of PHP courses in the UK
[2221] Adding a newsfeed for your users to a multipage PHP application
[2215] If nothing, make it nothing.
[2196] New Example - cacheing results in PHP for faster loading
[2174] Application design in PHP - multiple step processes
[2166] Crossrefering documents with uniqueness and inconsistency issues - PHP proof of concept demo
[2160] PHP - getclass v instanceof
[2137] Reaching the right people with your web site
[2107] How to tweet automatically from a blog
[2097] PHP Course - for hobby / club / charity users.
[2073] Extra PHP Examples
[2071] Setting up a MySQL database from PHP
[2051] A Presentation about our company - web and PHP
[2046] Finding variations on a surname
[2031] Choosing from an image with an image map
[2025] Injection Attack if register_globals in on - PHP
[1995] Automated server heartbeat and health check
[1983] Keeping PHP code in database and running it
[1962] Index Card System for Game Characters in PHP
[1958] PHP - Parse error: syntax error, unexpected $end ...
[1956] Images for Christmas
[1938] Predictive Load Balancing - PHP and / or Java
[1936] Quick Summary - PHP installation
[1923] Making it all worthwhile
[1911] Remember Me - PHP
[1820] Sorting objects in PHP
[1794] Refactoring - a PHP demo becomes a production page
[1787] Howto - write and manage a news box on your web page
[1780] Server overloading - turns out to be feof in PHP
[1779] Injection Attacks - avoiding them in your PHP
[1778] Pointing all the web pages in a directory at a database
[1768] What is built in to this httpd and PHP?
[1756] Ever had One of THOSE mornings?
[1752] Dynamic maps / geographics in PHP
[1747] Who is watching you?
[1739] Bath, Snake or Nag?
[1736] Current visitors from around the world - PHP
[1734] All around the world?
[1733] memcached - overview, installation, example of use in PHP
[1722] PHP examples - source code and try it out too
[1716] Larger applications in PHP
[1694] Defensive coding techniques in PHP?
[1688] cannot restore segment prot after reloc message - PHP / httpd
[1684] Two PHP include files to make easy web site indexing and navigation
[1682] Accounts in PHP - an OO demo
[1679] PHP - Sanitised application principles for security and useability
[1667] Checking server performance for PHP generated pages
[1649] Easy conversion - image formats, currencies and distances
[1647] Exchange Rates - PHP with your prices in your users currency
[1646] Using cookies and sessions to connect different URLs - PHP
[1634] Kiss and Book
[1628] Gant charts - drawing them with a PHP script
[1623] PHP Techniques - a workshop
[1603] Do not SHOUT and do not whisper
[1576] Making PHP and MySQL training relevant to the course delegates
[1549] http, https and ajp - comparison and choice
[1542] Are nasty programs looking for security holes on your server?
[1535] OO PHP demonstration - comparing objects and more
[1533] Short and sweet and sticky - PHP form input
[1506] Ongoing Image Copyright Issues, PHP and MySQL solutions
[1505] Script to present commonly used images - PHP
[1496] PHP / Web 2 logging
[1487] Efficient PHP applications - framework and example
[1485] Copyright and theft of images, bandwidth and members.
[1482] A story about benchmarking PHP
[1396] Using PHP to upload images / Store on MySQL database - security questions
[1390] Converting from postal address to latitude / longitude
[1389] Controlling and labelling Google maps via PHP
[1387] Error logging to file not browser in PHP
[1380] Static variables in PHP
[1379] Simple page password protection - PHP
[1357] Clean my plate, but keep my wine bottle. (PHP; Static)
[1323] Easy handling of errors in PHP
[1321] Resetting session based tests in PHP
[1270] PHP Standalone - keyboard to screen
[1267] is there a lookup function in php?
[1210] PHP header() function - uses and new restrictions
[1199] Testing for one of a list of values.
[1194] Drawing hands on a clock face - PHP
[1182] Painting a masterpiece in PHP
[1169] Emailing as HTML (Web Page) - PHP example
[1166] Back button - ensuring order are not submitted twice (PHP)
[1153] Object Oriented Model - a summary of changes from PHP4 to PHP5
[1116] PHP adding arrays / summing arrays
[1114] PHP Image upload script
[1113] File and URL reading in PHP
[1104] Drawing dynamic graphs in PHP
[1096] Sample script - FTP to get a file from within PHP
[1094] PHP fread - truncated data
[1086] Injection attacks - safeguard your PHP scripts
[1058] PHP Regular expression to extrtact link and text
[1053] Sorting people by name in PHP
[1052] Learning to write secure, maintainable PHP
[1021] PHP - static declaration
[1010] Dates, times, clickable diarys in PHP
[1008] Date conversion - PHP
[997] Most recent file in a directory - PHP
[936] Global, Superglobal, Session variables - scope and persistance in PHP
[934] Clustering, load balancing, mod_rewrite and mod_proxy
[920] A lion in a cage - PHP
[917] Syntax checking in PHP
[915] Paging through hundreds of entries
[904] Of course I'll tell you by email
[896] PHP - good coding practise and sticky radio buttons
[863] Double and Triple equals operator in PHP
[832] Displaying data at 5 items per line on a web page
[822] PHP - a team member leaves
[806] Check your user is human. Have him retype a word in a graphic
[789] Hot answers in PHP
[767] Finding the language preference of a web site visitor
[716] Evaluating arithmetic expressions in configuration files
[709] Handling huge data files in PHP
[646] PHP - London course, Melksham Course, Evening course
[624] It's REALLY easy to add a little PHP
[603] PHP - setting sort order with an associative array
[589] Robust PHP user inputs
[574] PHP - dividing a string up into pieces
[563] Merging pictures using PHP and GD
[558] Converting between acres and hectares
[542] Morning image, afternoon image
[537] Daily Image Santafied
[484] Setting the file name for a downloaded document
[483] Double Dollars in PHP
[481] PHP upgrade - traps to watch
[451] Accessing a page via POST from within a PHP script
[443] Server side scripting of styles to suit the browser
[425] Caching an XML feed
[422] PHP Magic Quotes
[421] Don't repeat code - use loops or functions
[410] Reading a news or blog feed (RSS) in your PHP page
[406] Assignment, equality and identity in PHP
[394] A year on - should we offer certified PHP courses
[376] What brings people to my web site?
[372] Time calculation in PHP
[356] Sudoku helper or sudoku cheat
[343] Should I use structured or object oriented?
[341] Happy Birthday, PHP
[339] Passing information into and out of PHP functions
[337] the array returned by preg_match_all
[322] More maps
[320] Ordnance Survey - using a 'Get a map'
[223] There is a function in PHP to do that
[205] PHP5 lets you say no
[135] Too many Perls
[132] Portrait of the author
[123] Short underground journeys and a PHP book
[93] Case Sensitive?
[67] Object Oriented Programming in PHP
[55] Evening classes to learn PHP
[54] PHP and natural sorting
[50] Current cost in your local currency
[48] PHP - onwards and upwards
Top or Show all for PHP - the language and its application

Java and the Java Environment
[4428] Using the lead - passing arrays and other collections in Java
[4427] Java example - for loop and conditionals from course exercise
[4422] Objects - from physical to virtual or abstract - Java
[4420] Flexibility in input - read from file, web resource or keyboard
[4419] Java Inheritance example - group of classes - step by step
Top or Show all for Java and the Java Environment

Around, about and nearby to Wiltshire
[4702] Up and down TransWilts - some pictures off the rails!
[4653] Coats of arms - towns and authorities in Wiltshire
[4622] Frosty morning, beauty of Wiltshire
[4265] A lovely meal in Swindon - just a short walk from the station
[4233] Open for the new year - Imber
Top or Show all for Around, about and nearby to Wiltshire

The Perl Programming Language and its use
[4700] Obfurscated code - it might work, but is it maintainable?
[4620] Perl 6 - a Practical Extraction and Reporting example!
[4611] Hungarian, Camel, Snake and Kebab - variable naming conventions
[4610] Sorting by key or by comparator - Perl 6
[4609] Mapping an array / list without a loop - how to do it in Perl 6
Top or Show all for The Perl Programming Language and its use

Client Side Languages (HTML, CSS, Javascript)
[4037] Cascading Style Sheets and formatting your web page
[4036] HTML tags uses in these blog articles
[4035] Special characters in HTML
[4034] The VERY basics of a web page ... and web site
[3532] Sharing the user experience - designing a form with the customer in mind
Top or Show all for Client Side Languages (HTML, CSS, Javascript)

Ruby and Ruby on Rails
[4682] One line scripts - Awk, Perl and Ruby
[4681] Ruby testing with RSpec - a new example
[4680] Processing data line by line - iterator in Ruby with yield
[4679] Reading in XML in Ruby with xmlsimple
[4676] Running shell (operating system) commands from within Ruby
Top or Show all for Ruby and Ruby on Rails

SQL and MySQL
[4493] Forgotten / lost MySQL root password
[4481] Extracting data from backups to restore selected rows from MySQL tables
[4436] Accessing a MySQL database from Python with mysql.connector
[4406] Fixing damaged MySQL tables - Error 1712 and Error 2013
[4390] Checking MySQL database backups have worked (not failed)
Top or Show all for SQL and MySQL

Tcl, Tcl/Tk and Expect
[4762] Coverage map in Tcl - how many times has each proc been called?
[4678] Expect with Ruby - a training example to get you started
[4616] Still teaching Tcl in 2016?
[4525] What does Tcl do if you try to run a command that is not defined?
[4524] Tcl - a new example for data reformatting
Top or Show all for Tcl, Tcl/Tk and Expect

Programming in Lua
[4753] Lua, Tcl, Python, C and C++ courses - at our Melksham HQ or on your site - forward from July 2017
[4575] Learning not just what a program does, but how to design it in the first place.
[4574] repeat until in Lua - a one or more rather than a zero or more loop
[4573] Classic style OO code - in Lua
[4572] Tables with values and code in Lua - looks like an object?
Top or Show all for Programming in Lua

Python Programming
[4724] From and Import in Python - where is the module loaded from?
[4723] Conditional operators in Python
[4722] Embedding more complex code into a named block
[4721] When to check an object type - Python isinstance example
[4719] Nesting decorators
Top or Show all for Python Programming

And also ...
[4768] 2017 - the final six months
[4767] Some thoughts on 2017, and looking forward to 2018
[4761] Looking forward to the autumn.
[4759] Sale of effects and furniture - 12th and 13th August 2017
[4756] Learning how to be a more effective community partner
Top or Show all for And also ...

Public Transport
[4770] GW franchise - my response
[4765] Breich Station - current pictures, and future options
[4764] Some thoughts on the closure proposal for Breich station
[4760] Rotary Talk, 25/7/2017
[4727] Learning from travelling further afield
Top or Show all for Public Transport

Fun and Flames
[4392] Interview conditions,and other instructions to staff
[4354] Wiltshire Police - assuming someone is guilty just on the say-so of a member of the public?
[4329] Does Santa Claus need a CRB check?
[4304] Please do not ask me to be the chair!
[4282] On tipping - and the expectation of a tip
Top or Show all for Fun and Flames

Keynote Articles
[2483] Clustering on Tomcat
[2384] Looking ahead to the Autumn season of training and accommodation
[2144] Looking for a career change - Physician to Web Site Designer
[1955] How to avoid duplicating web page maintainance
[1857] November and December Public Course Schedule
Top or Show all for Keynote Articles

Unclassfied Articles
[4766] Moving on from Sunnyside and Devizes
[4758] Even more images!
[4757] Images ... continued
[4733] Python examples - updates under way
[4732] Reviewing TransWilts performance 2015-16
Top or Show all for unclassified

Public Transport Training from Well House Consultants And also ... Tcl, Tcl/Tk and Expect Programming in Lua Python Programming Well House Manor - Hotel and Training Centre Apache HTTP and Tomcat Servers The Perl Programming Language and its use Ruby and Ruby on Rails PHP - the language and its application C and C++ Programming Linux and Shell Programming Melksham SQL and MySQL For the Webmaster, Postmaster and moderator Java and the Java Environment Fun and Flames Running a training and hotel company Around, about and nearby to Wiltshire Client Side Languages (HTML, CSS, Javascript) Keynote Articles General Programming Topics

A little more about this newsletter ...

At Well House Consultants, we run niche IT training courses ... and we run a hotel for delegates on those courses and other visitors to Melksham too. And we make a lot of friends - have a lot of ambassadors with whom we want to keep in touch. So every day Graham (that's me, writing this piece) puts together an article or two which might include the latest sample programs that I've written during the current course, new information about Well House Manor - our business hotel, tips on search engine optimisation, announcements of upcoming public courses, pictures of local places, and even (on occasions) rants and whimsical pieces to keep those friends up to date and in touch. The feeds are available directlt via the Blog - "The Horse's Mouth", they're on our Twitter Feed and you can find me at my LinkedIn profile. But most people just want to look us up occasionally - every month or two, and then to catch up on the latest news just for their particular subjects of interest ... and that's what this newsletter is about

You'll find above the titles of ALL the new articles written in the last two months, listed by major subject area, and showing as (new) with their date of publication. You'll find additional articles in each category too - topping each category up to a minimum of five articles. And you'll find a link at the end of each section which lets you expand that section to show the titles of every article that's been published in that section. After all, "the old ones are often the best ones", aren't they?

go to Top or other editions March 2024January 2024November 2023September 2023July 2023May 2023March 2023January 2023November 2022 • this is the current edition


Training sample © 2024, WELL HOUSE CONSULTANTS LTD
This is http://www.wellho.net/demo/newsletter.php
Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
Phone: +44 (0) 1225 708 225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net