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
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
[4608] Introspecion in Perl 6
[4607] Classes and object - first steps in Perl 6
[4606] Using Perl 6 to analyse and report on data
[4605] Hello World - in Perl 6
[4604] Perl - version 6 - official version launched at Christmas
[4395] Preparing data through a little bit of Perl
[4301] Perl - still a very effective language indeed for extracting and reporting
[4296] Polishing the Perl courses - updated training
[4100] Perl Dancer - from installation to your first real application
[4099] Perl Dancer - a Perl Framework - Installation and first test
[4031] Showing what programming errors look like - web site pitfall
[3941] Building an object based on another object in Perl
[3940] Run other processes from within your Perl program
[3939] Lots of ways of doing the same thing in Perl - list iteration
[3927] First match or all matches? Perl Regular Expressions
[3914] While, for, foreach or something else to loop.
[3875] Using CGI and Perl to put a simple application online. Sometimes still the best way.
[3874] Using Perl to read an RSS feed off a web site and extract data - via LWP and XML modules
[3870] Writing more maintainable Perl - naming fields from your data records
[3839] Spraying data from one incoming to series of outgoing files in Perl
[3833] Learning to use existing classes in Perl
[3830] Traversing a directory in Perl
[3823] Know Python or PHP? Want to learn Perl too?
[3770] Sample answers to training course exercises - available on our web site
[3707] Converting codons via Amino Acids to Proteins in Perl
[3630] Serialsing and unserialising data for storage and transfer in Perl
[3581] Perl - calls to methods that use => - what do they mean?
[3577] How to do multidimensional arrays (or rather lists and hashes) in Perl
[3574] Perl functions such as chop change their input parameters
[3547] Using Perl to generate multiple reports from a HUGE file, efficiently
[3546] The difference between dot (a.k.a. full stop, period) and comma in Perl
[3485] Perl - retrieving and caching web resources
[3449] Apache Internal Dummy Connection - what is it and what should I do with it?
[3446] Awk v Perl
[3445] Perl and CGI - simple form, and monitoring script.
[3444] Take the dog on a lead - do not carry her. Perl references.
[3412] Handling binary data in Perl is easy!
[3411] Single and double quotes strings in Perl - what is the difference?
[3409] When variables behave differently - Tie in Perl
[3407] Perl - a quick reminder and revision. Test yourself!
[3406] Not multidimentional arrays - but lists of lists. Much more flexible. Perl!
[3400] $ is atomic and % and @ are molecular - Perl
[3398] Perl - making best use of the flexibility, but also using good coding standards
[3377] What do I mean when I add things in Perl?
[3375] How to interact with a Perl program while it is processing data
[3374] Speeding up your Perl code
[3335] Practical Extraction and Reporting
[3332] DNA to Amino Acid - a sample Perl script
[3326] Finding your big files in Perl - design considerations beyond the course environment
[3322] How much has Perl (and other languages) changed?
[3106] Buckets
[3105] Adventure with references to lists and lists of references
[3098] Learning Object Orientation in Perl through bananas and perhaps Moose
[3097] Making Perl class definitions more conventional and shorter
[3077] Perl 6 - significantly nearer, and Rakudo looks very good
[3059] Object Orientation in an hour and other Perl Lectures
[3012] Exception handling in Perl - using eval
[3011] What are .pid files?
[3010] Children, zombies, and reaping processes
[3007] Setting up a matrix of data (2D array) for processing in your program
[3005] Lots of ways of doing it in Perl - printing out answers
[3004] Increment operators for counting - Perl, PHP, C and others
[2972] Some more advanced Perl examples from a recent course
[2970] Perl - doing several things at the same time
[2969] What does blessing a variable in Perl mean?
[2967] Multiway branches in Perl - the given and when syntax
[2963] Removing the new line with chop or chomp in Perl - what is the difference?
[2877] Further more advanced Perl examples
[2876] Different perl examples - some corners I rarely explore
[2874] Unpacking a Perl string into a list
[2840] Just pass a pointer - do not duplicate the data
[2836] Perl - the duplicate key problem explained, and solutions offered
[2833] Fresh Perl Teaching Examples - part 2 of 3
[2832] Are you learning Perl? Some more examples for you!
[2825] Perl course - is it tailored to Linux, or Microsoft Windows?
[2821] Chancellor George Osborne inspires Perl Program
[2818] File open and read in Perl - modernisation
[2817] Setting a safety net or fallback value in Perl
[2816] Intelligent Matching in Perl
[2815] switch and case, or given and when in Perl
[2813] Iterating over a Perl list and changing all items
[2812] What is Perl?
[2811] Igloos melt in the summer, but houses do not
[2805] How are you getting on?
[2801] Binary data handling with unpack in Perl
[2798] Perl - skip the classics and use regular expressions
[2783] The Perl Survey
[2736] Perl Course FAQ
[2688] Security considerations in programming - what do we teach?
[2657] Want to do a big batch edit? Nothing beats Perl!
[2551] Perl and the Common Gateway Interface - out of fashion but still very useful?
[2532] Analysing Google arrivals by country of origin
[2484] Finding text and what surrounds it - contextual grep
[2427] Operator overloading - redefining addition and other Perl tricks
[2416] Automating access to a page obscured behind a holding page
[2405] But I am reading from a file - no need to prompt (Perl)
[2402] Automated Browsing in Perl
[2399] Firefighting with Perl
[2382] Giving up on user input - keyboard timeout in Perl
[2379] Making variables persistant, pretending a database is a variable and other Perl tricks
[2376] Long job - progress bar techniques (Perl)
[2375] Designing your data structures for a robust Perl application
[2374] Lead characters on Perl variable names
[2321] Uploading and Downloading files - changing names (Perl and PHP)
[2243] Changing a variable behaviour in Perl - tieing
[2242] So what is this thing called Perl that I keep harping on about?
[2241] Perl references - $$var and \$var notations
[2235] Sending awkward characters by email in Perl
[2234] Loading external code into Perl from a nonstandard directory
[2233] Transforming data in Perl using lists of lists and hashes of hashes
[2232] Why sendmail one way, and pop3 the other?
[2231] What is CGI.pm / A dozen new examples
[2230] Running a piece of code is like drinking a pint of beer
[2229] Do not re-invent the wheel - use a Perl module
[2226] Revision / Summary of lists - Perl
[2219] Configuring httpd, or Tomcat, to run CGI scripts in Perl
[2213] Keyboard reading in Perl - character by character not line by line
[2129] Nothing beats Perl to solve a data manipulation requirement quickly
[2070] Converting to Perl - the sort of programs you will write
[2069] Efficient calls to subs in Perl - avoid duplication, gain speed
[2067] Perl - lists do so much more than arrays
[2047] Small Web Server in Perl
[2045] Does robots.txt actually work?
[1951] Whisky - Setting and reading cookies from Perl
[1947] Perl substitute - the e modifier
[1946] Variable Types in Perl
[1924] Preventing ^C stopping / killing a program - Perl
[1922] Flurinci knows Raby Lae PHP and Jeve
[1921] Romeo and Julie
[1920] Progress Bar Techniques - Perl
[1918] Perl Socket Programming Examples
[1917] Out of memory during array extend - Perl
[1897] Keeping on an even keel
[1865] Debugging and Data::Dumper in Perl
[1863] About dieing and exiting in Perl
[1861] Reactive (dynamic) formatting in Perl
[1856] A few of my favourite things
[1852] Perl and Blackberries
[1832] Processing all files in a directory - Perl
[1829] Dont bother to write a Perl program
[1828] Perl - map to process every member of a list (array)
[1826] Perl - Subs, Chop v Chomp, => v ,
[1825] Question Mark - Colon operator (Perl and PHP)
[1753] Perl v PHP, choosing the right language
[1750] Glorious (?) 12th August - what a Pe(a)rl!
[1728] A short Perl example
[1727] Equality and looks like tests - Perl
[1726] Hot Courses - Perl
[1721] Perl 6 - When will we have a production release?
[1717] Q - Should I use Perl or Python?
[1709] There is more that one way - Perl
[1705] Environment variables in Perl / use Env
[1704] Finding operating system settings in Perl
[1703] Perl ... adding to a list - end, middle, start
[1702] Running operating system commands in Perl
[1665] Factory method example - Perl
[1664] Example of OO in Perl
[1581] What is an lvalue? (Perl, C)
[1514] Autovivification - the magic appearance of variables in Perl
[1510] Handling Binary data (.gif file example) in Perl
[1509] Extracting information from a file of records
[1508] How not to write Perl?
[1468] Lexical v Arithemetic testing, Bash and Perl
[1444] Using English can slow you right down!
[1416] Good, steady, simple example - Perl file handling
[1397] Perl - progress bar, supressing ^C and coping with huge data flows
[1395] Dont just convert to Perl - re-engineer!
[1320] Perl for Larger Projects - Object Oriented Perl
[1316] Filtering and altering Perl lists with grep and map
[1312] Some one line Perl tips and techniques
[1289] Pure Perl
[1251] Substitute operator / modifiers in Perl
[1232] Bathtub example
[1225] Perl - functions for directory handling
[1222] Perl, the substitute operator s
[1221] Bathtubs and pecking birds
[1219] Judging the quality of contributed Perl code
[1215] An update on Perl - where is it going?
[1191] Smart English Output - via PHP and Perl ? : operator
[1183] Improving searches - from OR to AND?
[1073] Heartbeat script in Perl
[1009] Passing GET parameters through Apache mod_rewrite
[975] Answering ALL the delegate's Perl questions
[969] Perl - $_ and @_
[968] Perl - a list or a hash?
[965] KISS - one action per statement please - Perl
[930] -> , >= and => in Perl
[928] C++ and Perl - why did they do it THAT way?
[872] Email metrics
[867] Being sure to be positive in Perl
[839] Reporting on the 10 largest files or 10 top scores
[765] Perl - turning seconds into days, hours, minutes and seconds
[762] Huge data files - what happened earlier?
[760] Self help in Perl
[743] How to debug a Perl program
[738] (Perl) Callbacks - what are they?
[737] Coloured text in a terminal from Perl
[733] Perl for Systems Admin - suid scripts
[702] Iterators - expressions tha change each time you call them
[662] An unhelpful error message from Apache httpd
[641] Simple but rugged form handling demo
[639] Progress bars and other dynamic reports
[622] Queues and barrel rolls in Perl
[618] Perl - its up to YOU to check your file opened
[616] printf - a flawed but useful function
[608] Don't expose your regular expressions
[604] Perl - multiprocess applications
[599] Perl/Tk real time display
[597] Storing a regular expression in a perl variable
[594] Twice is a co-incidence and three times is a pattern
[590] Danny and Donna are getting married
[588] Changing @INC - where Perl loads its modules
[586] Perl Regular Expressions - finding the position and length of the match
[583] Remember to process blank lines
[582] DWIM and AWWO
[577] Learning to program in Perl or PHP
[531] Packages in packages in Perl
[493] Running a Perl script within a PHP page
[454] Time conversions in Perl
[400] New in the shops
[358] Use standard Perl modules
[357] Where do Perl modules load from
[355] Context in Perl
[314] What language is this written in?
[293] Course follow-ups
[263] Harmony
[262] A little bit of fun - the new Perl Quiz
[255] STDIN, STDOUT, STDERR and DATA - Perl file handles
[254] x operator in Perl
[246] When to bless a Perl variable
[243] new 'Perl on the Web' example
[242] Satisfaction of training
[240] Conventional restraints removed
[230] Course sizes - beware of marketing statistics
[140] Comparison Chart for Perl programmers - list functions
[138] Perl - redo and last without a loop
[113] A Parallel for Perl 6
[112] Avoid the wheel being re-invented by using Perl modules
[89] When will Perl 6 be available
[86] Talk review - Idiomatic Perl, David Cross
[45] CGI v mod_perl
[43] Hash of lists in Perl
[31] Here documents
[28] Perl for breakfast
[25] Release numbers
[12] How many people in a room?
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