<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Horse&apos;s Mouth</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/horse/" />
<modified>2009-07-04T14:23:40Z</modified>
<tagline>Musing, events and thoughts from Graham Ellis</tagline>
<id>tag:www.wellho.net,2009:/horse/1</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2009, gje</copyright>
<entry>
<title>Westbury Bypass Refused - looking forward</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/07/index.html#002268" />
<modified>2009-07-04T14:23:40Z</modified>
<issued>2009-07-04T10:48:34Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2268</id>
<created>2009-07-04T10:48:34Z</created>
<summary type="text/plain">The report of The Public Enquiry into the proposed Westbury Bypass was published a couple of days ago, together with the Secretary of State&apos;s decision based on that report. As someone who attended the enquiry briefly and made a statement,...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p>The report of <b>The Public Enquiry into the proposed Westbury Bypass</b> was published a couple of days ago, together with the Secretary of State's decision based on that report. As someone who attended the enquiry briefly and made a statement, I have received a copy of the various papers from the Department for Transport, and from the Department for Communities and Local Government.</p>

<p>In summary, the enquiry recommended that the planning application by Wiltshire (County) Council be refused, and the Secretary of state agreed with that recommendation. Formally <b>"He hereby refuses planning permission for the construction of a new single carriageway road with a climbing lane over part of the route, roundabout junctions, associated infrastructure and works in accordance with application number W.07.09002 dated 14th February 2007."</b></p>

<p>The covering letters and reports are in two sections - those relating to the Department for Transport and those relating to the Department for communities and local government. They are online:</p>

<p>Transport:<br />
letter - <a href=http://www.gos.gov.uk/nestore/docs/transport/laos/westbury_ltr.pdf>http://www.gos.gov.uk/nestore/docs/transport/laos/westbury_ltr.pdf</a><br />
report - <a href=http://www.gos.gov.uk/nestore/docs/transport/laos/westbury_report.pdf>http://www.gos.gov.uk/nestore/docs/transport/laos/westbury_report.pdf</a></p>

<p>Local Government:<br />
letter - <a href=http://www.communities.gov.uk/documents/planning-callins/pdf/1271537>http://www.communities.gov.uk/documents/planning-callins/pdf/1271537</a><br />
report - <a href=http://www.communities.gov.uk/documents/planning-callins/pdf/westburybypassreport.pdf>http://www.communities.gov.uk/documents/planning-callins/pdf/westburybypassreport.pdf</a></p>

<p>Public Enquiries such as this have tended to come down on the side of the official authorities who propose them in the past; such authorities have the full time team to present an excellent, logical case, the access to expertise, and access to taxpayer's money to fund the presentation of the case.  They are the Goliaths at such enquiries. Organisations who oppose do not have access to the official funding, and are very much on their back foot through the procedure as they have to be reactive rather than pro-active, prepared for any "curved ball" which the proposing authority throws at them, and within their own funding.  They are the Davids.</p>

<p>So the result is a bit of a surprise ... I'm not sure what proportion of such enquires recommend a rejection of major proposals into which so much time and public money has gone (millions of pounds that could have bought a train service for many years) ... but it's certainly something of a surprise.  It is <u>important to study the reasons given</u> (<a href=http://www.firstgreatwestern.info/coffeeshop/index.php?topic=4964.0 target=pix>summary</a>), but it is <b><u>doubly important now to look forward, and say what can and should we be doing for transport flows in this corridor, now with the changed metrics brought about by the refusal</u></b>.</p>

<p><i>Local (i.e. council tax payer's) funding of the rejected bypass would have accounted for some 10% of the scheme's cost. We may now have a golden opportunity to look at how that money saved can be used, never the less, to meet the objectives of improved journey times through Wiltshire by both private and public transport, and reduced traffic levels through Westbury and elsewhere resulting in an improved environments there.</i> </p>

<p>One such scheme is an appropriate passenger train service on the parallel railway - see <a href=http://www.transwilts.org.uk>here</a>; that should be enhanced by better integration of different transport modes, which can be done at very little cost (and in some cases cost saving) ... encouraging people to use public transport where they can with a carrot rather than with a stick, in so doing reducing the number of vehicles using the current road network, leaving it clearer for those journeys for which there is no sensible alternative than private motor vehicles.</p>]]>

</content>
</entry>
<entry>
<title>winmail.dat enclosure ... reading on an Apple</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/07/index.html#002267" />
<modified>2009-07-04T14:24:44Z</modified>
<issued>2009-07-03T18:47:48Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2267</id>
<created>2009-07-03T18:47:48Z</created>
<summary type="text/plain">I use an Apple Mac ... run OSX ... and I have that problem of how to deal with applications data files. I have become a passed master at Word documents and Excel spread sheets! How about an attached file...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p>I use an Apple Mac ... run OSX ... and I have that problem of how to deal with applications data files.  I have become a passed master at Word documents and Excel spread sheets!   How about an attached file winmail.dat?</p>

<p><b>winmail.dat</b> is used by thing like Microsoft Outlook ... so you can easily read it if you have Microsoft Outlook too.  But I haven't. </p>

<p>Solution? <b>TNEF's Enough</b> from <a href=http://www.joshjacob.com/macdev/tnef/>http://www.joshjacob.com/macdev/tnef/</a>. </p>

<p>Drag and drop (sorry - this is a Mac world solution!) your winmail.dat file onto the application, and it'll be revealed to be a container like a tar or zip of stuffit file with loads of other files held in it. Click on the one you want (sorry - this is a Mac solution!) and you can get at that individual component.</p>]]>

</content>
</entry>
<entry>
<title>Travelling</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/07/index.html#002266" />
<modified>2009-07-03T15:39:30Z</modified>
<issued>2009-07-02T22:44:50Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2266</id>
<created>2009-07-02T22:44:50Z</created>
<summary type="text/plain"> Six trains ... a bus ... four walks ... and a day&apos;s work too. Still - as you can see from above, a wide variety of places!...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p><img src=http://www.wellho.net/pix/j9tr1.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9tr2.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9tr3.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9tr4.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9tr5.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9tr6.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9tr7.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9tr8.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9tr9.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9tra.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9trb.jpg style="border:3px solid #FFDDBB"><img src=http://www.wellho.net/pix/j9trc.jpg style="border:3px solid #FFDDBB"><br clear=all></p>

<p>Six trains ... a bus ... four walks ... and a day's work too.  Still - as you can see from above, a wide variety of places!</p>]]>

</content>
</entry>
<entry>
<title>A chance to do the tourist thing</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/07/index.html#002265" />
<modified>2009-07-01T21:43:58Z</modified>
<issued>2009-07-01T21:36:56Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2265</id>
<created>2009-07-01T21:36:56Z</created>
<summary type="text/plain">Just occasionally, work takes me to exactly the right place at exactly the right time ... and so it was this evening when after a good day&apos;s work I had a chance to let my hair down, join the leisure...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p>Just occasionally, work takes me to exactly the right place at exactly the right time ... and so it was this evening when after a good day's work I had a chance to let my hair down, join the leisure visitors, and have a look around York ... with some lovely lighting effects<center></p>

<p><img src=http://www.wellho.net/pix/yk002.jpg><br>Point of arrival in York</p>

<p><img src=http://www.wellho.net/pix/yk008.jpg><br>River</p>

<p><img src=http://www.wellho.net/pix/yk009.jpg><br>Maltings Pub</p>

<p><img src=http://www.wellho.net/pix/yk010.jpg><br>City Centre</p>

<p><img src=http://www.wellho.net/pix/yk011.jpg><br>Geese</p>

<p><img src=http://www.wellho.net/pix/yk012.jpg><br>Wall</p>

<p><img src=http://www.wellho.net/pix/yk004.jpg><br>Minster</p>

<p><img src=http://www.wellho.net/pix/yk003.jpg><br>A Pie and Pint to finish the day</center></p>]]>

</content>
</entry>
<entry>
<title>Learning about others private lives</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002264" />
<modified>2009-07-01T07:35:29Z</modified>
<issued>2009-06-30T18:36:56Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2264</id>
<created>2009-06-30T18:36:56Z</created>
<summary type="text/plain">The woman sitting next to dad is worried about tomorrow&apos;s meeting now that Emily has had to pull out ... she wonders if Lucinda can go on her own and how that can be turned to her advantage. She left...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p>The woman sitting next to dad is worried about tomorrow's meeting now that Emily has had to pull out ... she wonders if Lucinda can go on her own and how that can be turned to her advantage. She left a curry in the bottom of the fridge, but is having her son check to make sure that it doesn't have cashews in it by carefully going through the ingredients. And she wants to be sure that he's going to be doing school work while it heats up, and before she gets home.   He came second in today's singing competition, but it seems rather less well in the sports - but "it's the taking part that's important".</p>

<p>Only one carriage on the National Express train from London King's Cross to York (and on to Edinburgh) was designated a "quiet carriage", and judging by the number of people using their mobiles, that's about the right ratio.   Dad and I sat there, hot and sweaty (the train was an old "125" with the air conditioning our of action in some carriages, and the people packed in to the remaining ones).</p>

<p>I used to treasure travel time as a time to regroup, to think, to make notes, to learn.  And not really a mobile communications centre.   I suppose I still do ... I used National Express's Wifi to check in briefly, then learned about my fellow passengers, as you can see from above.   Was I snooping on them?  Hardly - I couldn't but help learn all these things - there were no ear plugs provided at our seat, and certain speakers can probably penetrate ear plugs anyway.</p>]]>

</content>
</entry>
<entry>
<title>Mysqldump fails as a cron job - a work around</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002263" />
<modified>2009-07-01T07:29:54Z</modified>
<issued>2009-06-30T08:05:31Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2263</id>
<created>2009-06-30T08:05:31Z</created>
<summary type="text/plain">Here&apos;s a curiosity ... running a mysqldump as a crontab job, nothing happens on one of our servers. Now I HAVE included the full path to the executable file in my crontab line, and I have redirected the output to...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p>Here's a curiosity ... running a <b>mysqldump</b> as a crontab job, nothing happens on one of our servers.   Now I HAVE included the full path to the executable file in my crontab line,  and I have redirected the output to a full path ... so something else is tripping it up.</p>

<p>What do I do?  An Internet search and I discover that I'm not the first to have the problem (I didn't expect that I was) and that although no definite solution has been found on the places that I'm visiting (someone ditched MySQL and went to PostGRESql instead!!). it's suspected as being something to do with the rudimentary shell environment that cron provides.</p>

<p>I'm on a time-scale today, so rather that spend a long time finding out what was happening, I decided to spend a shorter time achieving what I needed in another way (a.k.a. a work around!).   By writing a short script that includes the MySQLdump, I can get the MySQLdump to run under a full <b>bash</b> shell.  And I can easily call up that script from cron.</p>

<p>Problem not explained / solved exactly ... but I have achieved what I need.</p>]]>

</content>
</entry>
<entry>
<title>History is not always pretty</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002262" />
<modified>2009-07-01T07:26:14Z</modified>
<issued>2009-06-30T07:44:33Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2262</id>
<created>2009-06-30T07:44:33Z</created>
<summary type="text/plain">Around 200 years ago, Melksham was the largest town for many miles around - it dwarfed even places like Swindon. However, in the Victorian age it grew very much slower and it hasn&apos;t caught up yet. So looking around the...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p><img src=http://www.wellho.net/pix/mbacka1.jpg align=left hspace=5>Around 200 years ago, Melksham was the largest town for many miles around - it dwarfed even places like Swindon.   However, in the Victorian age it grew very much slower and it hasn't caught up yet. So looking around the town you'll find, hidden in odd corners, a very great deal of history.</p>

<p>This particular building backs on to the High Street - close to the rear of Asher's Cafe, and it seems to be a piece of history that's just lying discarded.  And it's not alone<br clear=all></p>

<p><img src=http://www.wellho.net/pix/mbacka2.jpg align=left hspace=5>From the town centre, there used to be pathways to neighbouring towns.  Some have become roads (and quite major ones). Others, such as Stratton's walk, have decreased in their importance into mere local alleyways, such as Stratton's Walk.   If you follow the path beside the Baguette bar, you'll go through this uninviting passage then come out onto suburban roads and go past the Co-op ... following futher, I suspect it leads into the path to Redstocks, Rowde and Devizes although with some sections missing.</p>

<p>But the section n town ain't pretty!<br clear=all></p>

<p><img src=http://www.wellho.net/pix/mbacka3.jpg align=left hspace=5>There are other cut through / alley ways that also have historic significance - but are a little further out and a little greener. Hardie Walk follows the path of the Old Wilts and Berks canal. Well - at least it's green on one side, but wouldn't it be so much more welcoming if there was indeed still a canal here?<br clear=all></p>]]>

</content>
</entry>
<entry>
<title>Tcl - nice and nasty</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002261" />
<modified>2009-06-30T07:22:55Z</modified>
<issued>2009-06-29T21:54:41Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2261</id>
<created>2009-06-29T21:54:41Z</created>
<summary type="text/plain"><![CDATA[Tcl is a lovely engineers language ... but goodness you can do some nasty things with it, and write some unmaintainable code. set count 1 foreach type {if while} { &nbsp;&nbsp;$type {$count &lt; 5} { &nbsp;&nbsp;&nbsp;&nbsp;puts "yay $type $count" &nbsp;&nbsp;&nbsp;&nbsp;incr...]]></summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p>Tcl is a lovely engineers language ... but goodness you can do some nasty things with it, and write some unmaintainable code.</p>

<p><code>set count 1<br />
foreach type {if while} {<br />
&nbsp;&nbsp;$type {$count &lt; 5} {<br />
&nbsp;&nbsp;&nbsp;&nbsp;puts "yay $type $count"<br />
&nbsp;&nbsp;&nbsp;&nbsp;incr count<br />
&nbsp;&nbsp;}<br />
}</code></p>

<p>Which runs as follows:</p>

<p><code>earth-wind-and-fire:~ grahamellis$ tclsh tty<br />
yay if 1<br />
yay while 2<br />
yay while 3<br />
yay while 4<br />
earth-wind-and-fire:~</code></p>

<p>A sign of a pure interpretative language ... the code changing from an <b>if</b> to a <b>while</b> as it runs.  Is this:<br />
a) An example of how you should NOT write code<br />
b) An example of polymorphism when you least expect it<br />
c) A feature looking for a benefit<br />
d) All three of the above<br />
And the answer is, of course, (d)</p>]]>

</content>
</entry>
<entry>
<title>Important - the future of Melksham / Chamber of Commerce</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002260" />
<modified>2009-06-29T08:43:20Z</modified>
<issued>2009-06-28T22:50:55Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2260</id>
<created>2009-06-28T22:50:55Z</created>
<summary type="text/plain">There&apos;s a difference between &apos;urgent&apos; and &apos;important&apos; ... and one of the things that we sometimes do is get bogged down in the urgent without looking ahead to the longer term important. Here is a piece I have just written...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p><i>There's a difference between 'urgent' and 'important' ... and one of the things that we sometimes do is get bogged down in the urgent without looking ahead to the longer term important.  Here is a piece I have just written for the "Party in the Park" program ...</i></p>

<p><b>A message from the Melksham Chamber of Commerce and Industry</b></p>

<p>Did you realise that there are over 400 businesses in Melksham - from the large companies such as Cooper Avon and Knorr-Bremse through to sole traders working from home?  Did you know that if you phone to respond to a charity appeal for an international emergency you may be calling Melksham, or that if you want to learn how to program for computer games, you could end up on a course in the town?  Whether you're shopping in the town centre or contacting a firm in one of the industrial areas ... whether you're shopping on line or in person ... whether you're buying a product or a service ... Melksham has a great deal to offer.</p>

<p>We live in changing times. The recession has dramatically changed the operating model of many businesses, but there are local factors too. Melksham is earmarked to grow, with 100 acres marked for probable development. Traffic on the A350 will surely increase if and when Westbury is bypassed and the route becomes more attractive for lorries that currently travel through Bath. Recent changes in local government mean that the old District Council's functions have been taken over by the new unitary Wiltshire Council, with an 'Area board' covering Melksham Town and the surrounding area having its first meetings this Spring.</p>

<p>I was elected as president of the Melksham Chamber of Commerce late last year. I'm passionate about the town, and its future.  Melksham is a diverse, friendly town and I am proud to represent it, to advocate its case for the future, and to encourage and help its businesses for the present through advise and networking. And I am delighted to admit that by helping Melksham, I help my own business - customers who buy in Melksham don't do so just from a single source - with a wide ranging, attractive  and friendly combination of shops and services, they make Melksham as a whole their destination.</p>

<p>Melksham Chamber of Commerce is organising the "Spot the Oddity" competition for local traders that's running until 31st July in parallel with the Carnival and Party in the Park. That brings more visitors to town centre shops. We will be representing the businesses of the town at the West Wilts show from 23rd to 25th July in Trowbridge.  We are organising a new businesses competition - a prize of 1000 pounds is offered for the Melksham area, with the winner going forward to the Wessex Association of Chambers final for a possible further prize. And we put the case for the town's businesses at meetings as diverse as the police budget consultation, town centre improvement committees, and planning hearings. At times the process may feel slow, yet I can already look back having been the President for just a few months and say that we can and do make a difference.</p>

<p>If you're a local business that's not already a member of the Chamber, then please join us. We're looking at the future of the town - where we will be in a year, or five, or ten. Do we want Melksham to be a dormitory town for Greater Chippenham and Greater Trowbridge, or a town with its own heart?  Do we want a town centre that's throttled by traffic trying to park, a town centre that's mouse-quiet while traffic clogs up the bypass, or something else?  The direction we take things may not be urgent, this week or next - but it is important for our future and our children's future.</p>

<p>See <a href=http://www.wellho.net/melksham/diary.html>Upcoming Melksham events</a> including Chamber of Commerce ones!</p>

<hr>

<p><a href=http://www.wellho.net/melksham/chamber.html>Melksham Chamber of Commerce and Industry</a> - founder member of the <a href=http://www.wessexchambers.org.uk/>Wessex Association of Chambers of Commerce.</a></p>

<p>Member services and benefits include:<br />
* Regular networking with other local businesses<br />
* Promotion and publicity for members<br />
* Have a voice on local issues, and up to a national level with Wessex Association backing<br />
* Regular training days on anything from Waste disposal to health and safety (often in association with other towns)<br />
* Discounts and special deals for members from other members - 'worth hundreds'</p>

<p>We are open to all businesses no matter how small; membership fees are on a sliding scale based on the number of employees.</p>

<p>If you are reading this article ... <a href=mailto:graham@wellho.net>email me</a> if you are thinking of joining ... <i>if you're a Melksham business, you should!</i></p>]]>

</content>
</entry>
<entry>
<title>Grouping rows for a summary report - MySQL and PHP</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002259" />
<modified>2009-06-29T07:06:42Z</modified>
<issued>2009-06-27T17:57:09Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2259</id>
<created>2009-06-27T17:57:09Z</created>
<summary type="text/plain">It&apos;s quite quick and easy to write a loop that goes through a mysql result set and displays the content on an HTML page (but remember security of data, size of resulting HTML page, and the need to consider special...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p>It's quite quick and easy to write a loop that goes through a mysql result set and displays the content on an HTML page (but remember security of data, size of resulting HTML page, and the need to consider special characters such as &lt;).  But what if you want a shorter report, grouping records together in summarising blocks?</p>

<p>One way of grouping records - highly efficient if it provides the facilities you need - is to use the <b>GROUP</b> clause in your MySQL select statement. More flexible but slower, you can group within your web application.  This example is in PHP, but the principles are the same for other languages.</p>

<p>Where you are counting records, you start off with an immediate 'problem'.  When you have generated your first potential output, based on your first input record, it is exactly how I have described it - a <i>potential</i> output.  You can't actually output it until later - when you have read in the next record to see if you need to increment the count, and realised that the next record is part of a new batch to be counted separately.</p>

<p>The solution to this problem?   You save the record for output (in my example in the variable $prev_line) and a separate counter, and only when you find data that starts a new batch do you output the old one.   Care must be taken to avoid a zero (null) record being output at the very beginning, and to flush the final record from $prev_line once you have completed the processing of your data set.</p>

<p>Here's the method I describe in (tested) source code:</p>

<p><code>&lt;?php<br />
mysql_connect("localhost","[username]","[password]");<br />
mysql_select_db("[database]");<br />
$rset = mysql_query("select ... order by ...");<br />
&nbsp;<br />
$html = "";<br />
$prev_line = "";<br />
$tlc = 0;<br />
&nbsp;<br />
# Fetch each row in turn<br />
&nbsp;<br />
while ($row = mysql_fetch_row($rset)) {<br />
&nbsp;<br />
&nbsp;&nbsp;# Make up a (potential) row<br />
&nbsp;<br />
&nbsp;&nbsp;$line = "&lt;tr&gt;";<br />
&nbsp;&nbsp;foreach ($row as $item) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;$icook = htmlspecialchars($item);<br />
&nbsp;&nbsp;&nbsp;&nbsp;if ($icook == "") $icook = "&nbsp;";<br />
&nbsp;&nbsp;&nbsp;&nbsp;$line .= "&lt;td&gt;$icook&lt;/td&gt;";<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;<br />
&nbsp;&nbsp;# If this is a new row, output any PREVIOUS<br />
&nbsp;&nbsp;# The store the current as "previous"<br />
&nbsp;<br />
&nbsp;&nbsp;if ($prev_line != $line) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;if ($prev_line != "") {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$html .= "$prev_line&lt;td&gt;$tlc&lt;/td&gt;&lt;/tr&gt;"; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;$prev_line = $line;<br />
&nbsp;&nbsp;&nbsp;&nbsp;$tlc = 1;<br />
&nbsp;<br />
&nbsp;&nbsp;# And if not a new row, add one to the count<br />
&nbsp;<br />
&nbsp;&nbsp;} else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;$tlc++;<br />
&nbsp;&nbsp;}<br />
}<br />
&nbsp;<br />
# When done, add final row to output <br />
&nbsp;<br />
if ($prev_line != "") {<br />
&nbsp;&nbsp;$html .= "$prev_line&lt;td&gt;$tlc&lt;/td&gt;&lt;/tr&gt;"; <br />
&nbsp;&nbsp;}<br />
&nbsp;<br />
?&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;IP addresses of posts&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;table&gt;<br />
&lt;?= $html ?&gt;<br />
&lt;/table&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code></p>

<p>You might want to add a further 'special case' to handle a completely empty result set rather than producing a blank table, and you might want to add a set of headers to the table so that you know which column is which.</p>

<p>Note that the algorithm used in this example relies on the MySQL query returning all the records in a grouping in a single clump - you would do this by making sure that your <b>ORDER</b> clause was appropriate. If it is not practical to clump in this way, you would keep all the resultant rows in an associative array, which you would sort prior to generation of the HTML.  If you need to do that, it's a further reduction in efficiency (may not be a problem) and a further shift of logic from the MySQL engine to the PHP one.</p>

<p>Here's some sample data - from reporting on forum log files.   For privacy reasons, I am only providing sample rows for my own user name ... and I have provided an expanded example which has also noted the first and last timestamp on each IP.</p>

<table border=1 cellpadding=2><tr><td>1</td><td>grahame</td><td>66.14.122.134</td><td>1</td><td>Fri, 26 Sep 2008 02:15:59 +0100</td><td>Fri, 26 Sep 2008 02:15:59 +0100</td></tr> <tr><td>1</td><td>grahame</td><td>66.59.98.210</td><td>7</td><td>Sat, 20 Sep 2008 19:45:12 +0100</td><td>Sun, 21 Sep 2008 15:19:09 +0100</td></tr> <tr><td>1</td><td>grahame</td><td>68.101.40.100</td><td>1</td><td>Sat, 11 Aug 2007 13:33:21 +0100</td><td>Sat, 11 Aug 2007 13:33:21 +0100</td></tr> <tr><td>1</td><td>grahame</td><td>69.85.104.47</td><td>9</td><td>Fri, 20 Mar 2009 11:35:18 +0000</td><td>Sun, 22 Mar 2009 18:49:14 +0000</td></tr></table>]]>

</content>
</entry>
<entry>
<title>Questions I have been asked on answering the phone</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002258" />
<modified>2009-06-28T09:57:08Z</modified>
<issued>2009-06-26T21:15:33Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2258</id>
<created>2009-06-26T21:15:33Z</created>
<summary type="text/plain"> What does a fishing license at Shearwater cost and who sells it? Dunno ... What light bulb do I need for my fitting? Err ... What&apos;s the best way to sell a mango press? (I can&apos;t work out why...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p><img src=http://www.wellho.net/pix/shw1.jpg align=right width=150 hspace=5> What does a fishing license at Shearwater cost and who sells it?  <a href=http://www.wellho.net/share/shearwater.html>Dunno ...</a><br clear=all></p>

<p><img src=http://www.wellho.net/pix/lhs9_r.jpg align=right width=150 hspace=5> What light bulb do I need for my fitting?  <a href=http://www.wellho.net/course/al.html>Err ...</a><br clear=all></p>

<p><img src=http://www.wellho.net/pix/mango.jpg align=right width=150 hspace=5> What's the best way to sell a mango press?  <i>(I can't work out why Google send people to <a href=http://www.wellho.net/archives/2009/01/index.html>this page of ours</a>)</i><br clear=all></p>

<p><img src=http://www.wellho.net/pix/wbirt3.jpg align=right width=150 hspace=5> What is the postcode for Westonbirt?  <a href=http://www.wellho.net/share/westonbirt.html>Yer wot ...</a><br clear=all></p>

<p><img src=http://www.wellho.net/pix/er_pd_hist.jpg align=right width=150 hspace=5> What is the currency exchange rate / will you change money for me?  <a href=http://www.wellho.net/resources/ex.php4?item=h112/exchange.php>Err no ...</a><br clear=all></p>

<p><img src=http://www.wellho.net/pix/churchyard.jpg align=right width=150 hspace=5> Is there a gravestone in Bathampton Churchyard for xxxxxxxx?  <a href=http://www.wellho.net/share/bathampton.html>How should I know ...</a><br clear=all></p>

<p><img src=http://www.wellho.net/pix/oldlacock2.jpg align=right width=150 hspace=5> How can I travel from London to Lacock by public transport?  <a href=http://www.wellho.net/demo/bustimes.php>Not really my line, but ...</a><br clear=all></p>

<p><img src=http://www.wellho.net/pix/woodrand.jpg align=right width=150 hspace=5> Can I speak with Mrs Wood please?  <a href=http://www.wellho.co.uk/resources/T205.html>Yes, but you won't do so on this call ... we don't have one here!</a><br clear=all></p>

<p><img src=http://www.wellho.net/pix/magnight.jpg align=right width=150 hspace=5> Is that the Three Magpies?  <a href=http://www.wellho.net/share/threemagpies.html>Sorry, it isn't - it's a software training company and hotel in Melksham</a><br clear=all></p>

<p><i>There are times that having a wide internet presence leads us to some interesting questions and research</i></p>]]>

</content>
</entry>
<entry>
<title>Ramblings on church and state linkage in Melksham</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002257" />
<modified>2009-06-25T11:20:05Z</modified>
<issued>2009-06-25T09:11:33Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2257</id>
<created>2009-06-25T09:11:33Z</created>
<summary type="text/plain">With an interest in how the country, the county and the town is run, there are naturally times that I get invited to meetings and &apos;ceremonials&apos;, and so it was last Sunday, when I was invited to the Civic Service...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p>With an interest in how the country, the county and the town is run, there are naturally times that I get invited to meetings and 'ceremonials', and so it was last Sunday, when I was invited to the Civic Service at the Church, to confirm the new Mayor into office (or rather to reconfirm Richard Wiltshire as ongoing Mayor).  </p>

<p>I wish Richard all the very best in the continuing role. I think he does a great deal positive for Melksham.  And I am delighted that his term has been extended for a further period, as an annual change in this role, though fair on the basis of "buggin's turn", means that by the time someone works into the role on an annual changeover, they're already close to the twilight of there term and something of a lame duck.</p>

<p>So I went along - both personally and to represent the Chamber of Commerce - to the service.  And (personally) I felt an extreme disquiet at the words of the church service, at some of the things to say and sing as part of the proceedings. I don't think my views are unique, either; listening to others around me, their silence at certain of the more extreme mantras was notable.  I have a great respect for many of the people who hold these views / follow these faiths, but I really don't think they should have a place in the ordinary political life of what is a very mixed (and proud to be such) community in Melksham.</p>

<p>I read in our local paper that our Vicar, who lead the service, will be moving to a new role in Cyprus soon -  and perhaps when he goes I will have a more open mind and be able to accept Melksham's Church as a part of the community rather than its own community where on one hand it's established, or official, but on the other hand it excludes elements of the normal life of a town such as our.  I have not forgotten <a href=http://news.bbc.co.uk/1/hi/england/2219201.stm>the yoga ban</a>, nor the time that the Vicar went through our house in our absence, lighting candles and saying prayers in each room at the request of a neighbour who we had trusted with a spare key. There were errors of judgement on both sides there - our trust of our then-new neighbour (since moved on) and on the side of the Vicar too. </p>

<p>Conclusion?   I have no conclusion to these ramblings; I wish the Vicar all the best in his new role.  I hope (for the people of his new parish) that he takes with him the experience and a more open approach that means that he can work with not only his own 'flock', but also the rest of the community around him who may well have a similar set of moral beliefs, but do not share his particular way of implementing them.  And I look forward to seeing a new face with whom, I hope, the whole community can move on under the auspices of the established church, whether or not they are church members.</p>]]>

</content>
</entry>
<entry>
<title>Is it Python past cheetah already?</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002256" />
<modified>2009-06-25T06:28:24Z</modified>
<issued>2009-06-24T20:57:31Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2256</id>
<created>2009-06-24T20:57:31Z</created>
<summary type="text/plain">When my son was young, we had a clock with animals rather than numbers around the dial at each hour, and we used to refer to times like tiger past zebra, rather than twenty past twelve. In retrospect, and in...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p><img src=http://www.wellho.net/pix/z403.jpg align=right hspace=5>When my son was young, we had a clock with animals rather than numbers around the dial at each hour, and we used to refer to times like tiger past zebra, rather than twenty past twelve. In retrospect, and in a more enlightened age, this must have been needlessly confusing - the telling of times as "animal past animal" or "animal to animal" is still something that we joke about, which goes to show just how much these things stick.  It's bad enough having to teach that "4" is "twenty past" and "7" is "twenty five too", without having the beasts of the jungle coming into it.   </p>

<p>Not my image - so I'll provide <a href=http://hawaiiandays.com/DLC/pix/DLC-CRC9C-circus-animals-wall-clock-t.jpg>a link</a> to similar clocks that are for sale at <a href=http://hawaiiandays.com/DLC/vintage-wall-clocks.htm>Hawaiian Days</a> - and to be fair, thes clocks are very much better as they show pretty illustrations to attract one to read the clock, rather than <i>replacing</i> each number by an animal!  <i>Image illustraing this article - from <a href=http://www.gutenberg.org/files/13648/13648-h/13648-h.htm>Project Gutenberg</a> and under the license shown on that page.</i><br clear=all></p>]]>

</content>
</entry>
<entry>
<title>Past PHP delegates / others - coding help needed for next 3 months</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002255" />
<modified>2009-06-23T07:51:38Z</modified>
<issued>2009-06-23T07:49:28Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2255</id>
<created>2009-06-23T07:49:28Z</created>
<summary type="text/plain">To past delegates and other technical contacts ... I had a lunchtime meeting yesterday with a director who is working on a major PHP application and has urgent need of extra coding staff for a near-immediate start, with work lasting...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p><b>To past delegates and other technical contacts</b> ... I had a lunchtime meeting yesterday with a director who is working on a major PHP application and has urgent need of extra coding staff for a near-immediate start, with work lasting for just under 3 months.  Opportunities exist for individual contact work, and for "PHP shops" to bid for sections of the work.  A lot of the work is interesting, high level stuff and if I had an empty diary I would really enjoy jumping in ...</p>

<p>Please drop me an email (graham@wellho.net) if you would like me to put you in touch directly (which I am more than happy to do for people I know);  I can't recommend / advise on people's suitability as such, since many of my contacts were trainees at the time and I won't be aware of your progress ... so I'll bow out as soon as I've made the introductions.</p>]]>

</content>
</entry>
<entry>
<title>Forum membership - a privilege not a right</title>
<link rel="alternate" type="text/html" href="http://www.wellho.net/archives/2009/06/index.html#002254" />
<modified>2009-06-22T23:27:35Z</modified>
<issued>2009-06-22T17:30:42Z</issued>
<id>tag:www.wellho.net,2009:/horse/1.2254</id>
<created>2009-06-22T17:30:42Z</created>
<summary type="text/plain">How fortunate it is that the vast majority of online contributors respect the guidelines laid down, especially when they agree to terms applied to contributions that they make to forums. But there is a tiny minority who will feel the...</summary>
<author>
<name>gje</name>

<email>graham@wellho.net</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.wellho.net/horse/">
<![CDATA[<p>How fortunate it is that the vast majority of online contributors respect the guidelines laid down, especially when they agree to terms applied to contributions that they make to forums. But there is a tiny minority who will feel the the guidelines don't apply to them, or try to hide activities outside the Acceptable User Policy. I have just been looking at such a case and it lead to some interesting thoughts and discussions, which I will share in general terms.</p>

<p>I can recall, from before the days that I was administering any online forums (but only moderating one) some of the problems that were caused by a tiny proportion of members who signed up with multiple accounts.  There rarely seemed to be a legitimate reason for multiple accounts - there were the people who set up two accounts so they could post their real views (under one persona) and authoritative information under another, those who set up two accounts as "honey traps" in which they argued with themselves and entangled other members as friends of one of their accounts in order to con them, and those who had acted in such flagrant breach of the acceptable user policy (AUP) that they had been banned, but who tried to sneak back in under a new name. In fact, I consider multiple accounts without good reason (and without the facts being fully published and open) to themselves be a flagrant breach of the AUP on boards that I help look after - the people who set them up are tricksters and unwelcome - but what can the admin / board owner do?</p>

<p>There are three possible different levels of proof to consider before taking action against an account.  There is the legal (criminal) "beyond reasonable doubt", there is the legal (civil) "balance of probability" and there is the access I allow to my own space which is a privilege and I will describe as a "significant possibility" level of proof.</p>

<p>Which of these apply to a privately run forum, where any signed up member can post their own contribution?  It's the 'significant possibility' level that's all that's required.  It sounds a bit harsh, as decisions taken on this basis are likely to net some completely valid accounts. But when you think about it, it has to be. Having been alerted to a significant possibility of abuse, and become convinced that the significant possibility exists, I'm not only able but <b>required</b> to act.  To protect my members, to protect myself, to protect others (for example, the privacy of other people and their copyright in the case of posting abuse. Failure to protect members and others in this way would be, morally, a breach of my care to the majority.</p>

<p>There is a huge gap between "beyond reasonable doubt" and "significant possiblity". They are at opposite ends of the spectrum, and I would much prefer the luxury of "beyond reasonable doubt" before I take action on an account.  For if I think I have a conner - it might actually not be. Could you (hypothetical example) tell two of the Nolan sisters apart from their posting habits, assuming the posts had such close harmony as their singing?  One of the last things I want to do is close a valid account on suspicion alone.  Closing accounts always looks bad. Doing so when to someone who (it turns out) was a valid user looks doubly bad.  Setting up an innocent party with a potential grudge against you is trembly bad.</p>

<p>But at the end of the day, you have to protect yourself as the forum operator. You need to protect your members. You don't have to accept just anyone into your home, nor business orders from just anyone who wants to buy from you. And there are plenty of other places online where people you choose not to accept into your group can post ... heck, they could set up their own website ... and then post whatever they like, subject only to the laws that regulate it.</p>]]>

</content>
</entry>

</feed>