Lisa and I came across this impressive array of locks on what we have since learned is probably the
back gate to the National Grid's Lacock Switching Station, about 3 miles North of Melksham.
[picture/details]
Our first reaction was "wow - that must be REALLY secure - what
are they doing in there?" as we imagined a group of five people all having to turn up and the same time in that bleak and desolate spot, with high power electricity pylons humming above to get into the place.
But a careful look at the picture later leads me to think that if any one of those locks in undone and the holding bar that it locks is removed, the over bars will slide to the left and the main bar can be removed; rather that been a very secure site indeed, there are simple five locks there so that the electric people, the water folks, the fire brigade and two others (the local council have powers of entry almost everywhere, so they probably have a key, and perhaps the ambulance service) can each gain access without having to wait for the others.
It's very common when writing code to link up conditions using
and and
or operators - in some languages written as
&& and
||, and it's quite tricky sometimes for newcomers to get their head round the enormity of the difference between then. I think I'll use this picture on future courses.
I have concluded that locks probably do work with "or" not "and" for another reason. The chain looks pretty flimsy, and a good pair of bolt cutters would get you past the gate in a jiffy. It's highly unlikely that such a lowgrade chain would have been used if the security of five locks all to be opened at the same time HAD been what this mechanism was about! (written 2010-01-17, updated 2010-01-20)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Q110 - Object Orientation and General technical topics - Programming Algorithms [202] Searching for numbers - (2005-02-04)
[227] Bellringing and Programming and Objects and Perl - (2005-02-25)
[642] How similar are two words - (2006-03-11)
[1157] Speed Networking - a great evening and how we arranged it - (2007-04-21)
[1187] Updating a page strictly every minute (PHP, Perl) - (2007-05-14)
[1391] Ordnance Survey Grid Reference to Latitude / Longitude - (2007-10-14)
[1840] Validating Credit Card Numbers - (2008-10-14)
[1949] Nuclear Physics comes to our web site - (2008-12-17)
[2189] Matching disparate referencing systems (MediaWiki, PHP, also Tcl) - (2009-05-19)
[2259] Grouping rows for a summary report - MySQL and PHP - (2009-06-27)
[2509] A life lesson from the accuracy of numbers in Excel and Lua - (2009-11-21)
[2617] Comparing floating point numbers - a word of caution and a solution - (2010-02-01)
[2894] Sorting people by their names - (2010-07-29)
[2951] Lots of way of converting 3 letter month abbreviations to numbers - (2010-09-10)
[2993] Arrays v Lists - what is the difference, why use one or the other - (2010-10-10)
[3042] Least Common Ancestor - what is it, and a Least Common Ancestor algorithm implemented in Perl - (2010-11-11)
[3072] Finding elements common to many lists / arrays - (2010-11-26)
[3093] How many toilet rolls - hotel inventory and useage - (2010-12-18)
[3102] AND and OR operators - what is the difference between logical and bitwise varieties? - (2010-12-24)
[3451] Why would you want to use a Perl hash? - (2011-09-20)
[3620] Finding the total, average, minimum and maximum in a program - (2012-02-22)
[3662] Finding all the unique lines in a file, using Python or Perl - (2012-03-20)
[4325] Learning to program - what are algorithms and design patterns? - (2014-11-22)
[4401] Selecting RECENT and POPULAR news and trends for your web site users - (2015-01-19)
[4402] Finding sum, minimum, maximum and average in Python (and Ruby) - (2015-01-19)
[4410] A good example of recursion - a real use in Python - (2015-02-01)
[4652] Testing new algorithms in PHP - (2016-02-20)
[4656] Identifying the first and last records in a sequence - (2016-02-26)
[4707] Some gems from an introduction to Python - (2016-10-29)
Q101 - Object Orientation and General technical topics - Programming Principles [2001] I have not programmed before, and need to learn - (2009-01-19)
[2022] Pre and post increment - the ++ operator - (2009-02-03)
[2228] Where do I start when writing a program? - (2009-06-11)
[2310] Learning to write high quality code in Lua - (2009-07-30)
[2327] Planning! - (2009-08-08)
[2415] Variable names like i and j - why? - (2009-09-22)
[2510] The music of the stock market - (2009-11-22)
[2550] Do not copy and paste code - there are much better ways - (2009-12-26)
[2737] Improving your function calls (APIs) - General and PHP - (2010-04-24)
[2769] Easy - but for whom? - (2010-05-18)
[2878] Program for reliability and efficiency - do not duplicate, but rather share and re-use - (2010-07-19)
[2915] Looking up a value by key - associative arrays / Hashes / Dictionaries - (2010-08-11)
[2964] An introduction to file handling in programs - buffering, standard in and out, and file handles - (2010-09-21)
[3026] Coding efficiency - do not repeat yourself! - (2010-11-02)
[3456] Stepping stones - early coding, and writing re-usable code quickly - (2011-09-24)
[3542] What order are operations performed in, in a Perl expression? - (2011-12-07)
[3548] Dark mornings, dog update, and Python and Lua courses before Christmas - (2011-12-10)
[3551] Some terms used in programming (Biased towards Python) - (2011-12-12)
[3673] Object oriented or structured - a comparison in Python. Also writing clean regular expressions - (2012-03-26)
[3878] From Structured to Object Oriented Programming. - (2012-10-02)
[3928] Storing your intermediate data - what format should you you choose? - (2012-11-20)
[3954] Lesson 1 in programing - write clean, reuseable and maintainable tidy code - (2012-12-16)
[4003] Web and console - same principle, same code - Ruby example - (2013-02-14)
[4061] Seamless, integrated IT - we have a long way to go! - (2013-04-11)
[4090] Test Driven Development in Python - Customer Comes First - (2013-05-16)
[4118] We not only teach PHP and Python - we teach good PHP and Python Practice! - (2013-06-18)
[4153] Rooms available tonight - how to code an algorithm from first principles - (2013-08-19)
[4206] Writing the perfect program in Tcl? - (2013-11-13)
[4611] Hungarian, Camel, Snake and Kebab - variable naming conventions - (2016-01-03)
[4632] Remember to ask the question before you listen for the answer - (2016-01-26)
[4645] What are callbacks? Why use them? An example in Python - (2016-02-11)
Some other Articles
A healthy, local breakfast in MelkshamYour PHP code does not work? Here is where to start looking.Freddies Wood and the K and A CanalBowerhill as a cycling communityAnd and Or illustrated by locksConsultation in Melksham, on Melkshams futureMelksham Food and Drink Festival, 2010Reducing image size on digital photos - PHPStarting to arrange the picture librarySnow scenes - and how snow effected our business