- Wednesday 30th October
Added a Live Updates FAQ.
- Tuesday 29th October
I only had time for a quick test yesterday on the Connect server of the
Live Updates system and it had several problems, all of which I fixed except
one, which had to wait until this morning (the Live Updates version of
the lottery home page needed extra files on the
Connect server that weren't there - without them, a half-completed set of
home page links were displayed).
There are now two separate time stamps (one for the seven winning numbers and
the other for the jackpot prize pool) during a live updates submission. Not
only are they treated separately, but neither is updated if the submission
isn't a change on the previous one (prior to today, there was only one
submission timestamp and it always was set to the last submission,
There are two stages to the jackpot pool submission of course - one prior to
9.00pm where only an estimate is known ("estimate" = a figure a exactly
divisible by £10,000) and the one after 9.00pm when Camelot releases the
exact figure. Note that if the jackpot pool amount submitted is <£100,
then it is now multiplied by 1 million on the assumption that the user meant
to supply the trailing zeroes, but didn't.
The code now rounds any non-estimate jackpot amount prior to 9.00pm
down to the nearest £10,000. However, any non-estimate jackpot figures
accepted after that time will now override estimate jackpots (providing that at
least 3 identical non-estimates have been received of course). Number
submissions prior to 8.00pm are now prohibited (the submitted numbers are
zeroed) because the draw normally takes place after that time.
Live Update tasks remaining for the weekend:
- Adding an override system for when I get a home Internet connection.
- I'm worried about the 8.04pm Saturday page update - it may clash with
the Live Updates version of the home page...needs testing/resolving.
- Probably need to separate out the "Overall Status" part of the returned
page from a submission into a CGI link instead (which can then be put in the
index page of the Live Updates section as well) - the returned status page
is way too long I reckon.
- Stats about how many times each number has been submitted (with the
earliest timestamp for each number) if it appears in the overall status.
Timestamp figure for the earliest submission of the jackpot prize pool is
- List of Top 10 submitters that have contributed towards this week's
overall winning numbers or jackpot prize pool (sorted in most numbers
submitted order for the winning numbers and then breaking ties with the
- Hall Of Fame for each week's (or day's during the testing period)
earliest person to submit the full set of winning numbers or jackpot prize
- A Frequently Asked Questions page about the Live Updates system. May
also need an Instructions page, though with a few more extra prompts and
Notes, that should hopefully be unnecessary.
Fixed a long-standing time zone straddle bug w.r.t. the midnight, 7.30pm
and 8.04pm fixed updates on a Saturday. I wasn't using the current time to
extract the time zone - instead, I was using the date of the previous
Saturday's lottery for some unknown reason. This now means that next
Saturday's fixed updates will correctly state "GMT" after the time, rather
than the "BST" they would have done if I hadn't caught this bug.
- Monday 28th October
Uploaded the results for
Lottery #102. Yes, I finally set up the
directory for the live updates log files, so it should work OK from 7.30pm
tonight onwards (fingers crossed). Note that the teletext/WWW updates will
not overwrite or reset the test versions of the updated pages
(index_live.html and LottLive.html), because it's useful to have those
hanging around to see what happened overnight.
I've now frozen the coding
for the Live Updates system until next weekend - the only changes until then
will be to fix bugs (or bad features) reported by users. Next weekend's
coding will add a mechanism to allow me to override the live updates when
I get an home Internet connection - I've left it on the back-burner because
I won't start using it for over a month of course.
I do know of
a few remaining loopholes with the live updates system, but I'm not
explaining them here :-) BTW, I suspect that - like my automatic results
update - the Live Updates system is probably unique on the Internet.
There's so much coding involved to get it working smoothly that I suspect
no-one else will implement it in the future...
Made some adjustments to correct column mis-alignments due to
a bonus number that hasn't appeared for 100 draws and over
£1 billion in jackpots that has now been won in total.
- Sunday 27th October
For some inexplicable reason, the teletext system was switched back on
at 1.15am and the exact jackpot amount magically appeared on my pages
thanks to that...
- Saturday 26th October
The teletext system was switched off during Saturday, so the fallback WWW
results were used from Syndication UK and Chris Prickett's site at 8.10pm.
Ironically, no-one had the results at 8.05pm, indicating that there is
indeed a need for a
Live Updates system...
Set about the live updates code with real gusto, managing to progress to
the point now where people can see two pages update live, albeit not on top
of the "normal" equivalent of those pages during this test period. These are
index_live.html (the live updates version
of the home page) and LottLive.html
(live updates version of the live draw's individual lottery page). Obviously,
when the system is launched on the 16th November, these two files will
overwrite the "real" versions during the live updates.
The new features/fixes added included:
- The CGI rejects requests if either before 7.30pm or after midnight,
so don't try to copy the submission form and use it after midnight for
- The system will now prevent live updates if there's teletext e-mail or
WWW page grabs that changed the pages (because they take priority over
the live updates).
- The two new pages generated now correctly use cached GIFs matching
their current live updates status (you couldn't see this bug on Friday
thanks to me not leaving the system usable, but it was annoying !).
- There's locking now when writing to the live update log files to avoid
- The correct person is now credited when the two pages are updated
(based on most numbers submitted and breaking a tie with the quickest
timestamp). Previously, it would have been the person who sparked off
the page generation who was credited (often the "right" person to credit,
but sometimes not).
- The winning numbers and jackpot pool amount quickest submitters
are now separately credited (unless both were fully submitted first by
the same person, in which case there's only one credit).
- Friday 25th October
I got home and realised I'd forgotten to create the directory to store the
live updates entry log, so the system blocked everyone from trying it
out over the weekend. Although this was annoying and a little embarrassing,
it was probably a good thing, considering the half-baked state the live
updates system was left in on Friday morning.
Received the latest fax from Camelot and duly updated the mid-week
Yesterday's CD selection ("music to auto-repeat whilst coding") included:
I tend to pick the title tracks of CD singles and auto-repeat them, unless
the other tracks are very good. Yep, I've been known to play the same track
for about 4 or 5 hours straight with no problem (has to be up-tempo though),
though this can only be done whilst concentrating on coding and leaving the
music as a backing tune to hum to occasionally !
- Alisha's Attic Alisa Rules The World CD singles #1 and #2
- Edward Ball The Mill Hill Self Hate Club CD single
- Dire Straits Live At The BBC CD album
- Bob Geldof/The Boomtown Rats Loudmouth - The Best Of CD album
- Manic Street Preachers Everything Must Go CD single #2
- The Rembrandts This House Is Not A Home CD single
- Vaya Con Dios Roots And Wings CD album
- Sophie Zelmani You And Him CD single
- Thursday 24th October
Took a day off, which enabled me to make real progress with the
Live Updates section. The second CGI-generated form will now
log each user's submission and the current policy is to treat each and every
IP/e-mail address key pair as a separate log entry, although I may have to
adapt this policy if it gets abused by people fooling around.
When numbers are submitted by a user, the CGI now does the following:
- Adjusts or adds the numbers to the live updates entry log.
- Generates a live updates version of the home page if necessary, available
via a temporary URL.
During this test period, this is not linked to from anywhere except from
this page and the page returned by the CGI after the numbers are submitted.
Obviously, when the system goes live on 16th November, it will directly
replace the current lottery home page, so normal visitors will see
- Create graphics both for the user numbers and the new version of
the home page if needed.
Adjusted the live updates activation cron job at 7.30pm each evening to be part
of the draw closure cron job on Saturdays and a standalone cron job for the
rest of the week. This stops the two cron jobs clashing on Saturday (one
would lock the other out thanks to my lock files for just this eventuality).
The cron job now does the following:
- Zeroes the live updates entry log file (both the offline and online
copies of it).
- Activates the registration form.
- Resets the live updates version of the lottery home page (i.e. just
soft-links it to the normal version !).
Coding was going well on Thursday evening and I was just getting to some
crucial sections when two sets of visitors arrived in quick succession,
losing me 3 hours of coding time :-( This basically unravelled my train of
thought and forced me not only to abandon coding for the day, but also to
hurriedly try to back out of some of the half-finished coding I was doing.
I've ended up having to put a few apologetic notes in here and there about
the incompleteness of the coding to date because of the major interruption.
- Wednesday 23rd October
Opened up a new
Live Updates section, but there's nothing exciting there yet
really. I've installed cron jobs to generate the form at 7.30pm and to remove
it at midnight each evening (eventually, the form will only be available on
Saturday evenings...and, er, Wednesday evenings now that the midweek draw has
been approved). The form's just a placebo at the moment - it does absolutely
zero with the submission except check the e-mail address is syntactically
reasonable and then displays the form input back to the user.
I now only recursively change permissions and ownerships of the entire lottery
WWW tree when restoring from a SyQuest. Prior to today, any command I typed
in to re-generate pages would "fix" the perms/owner of the whole tree, which
was ridiculously wasteful (and slow via NFS), especially since any page
generated has its permissions and owner individually correctly set anyway.
This long overdue change should double the speed of next Saturday's fixed
updates (midnight, 7.30pm and 8.04pm) yet again - last Saturday's fixed updates
took 84 seconds, 31 seconds and 40 seconds respectively (the time variation
was probably because other cron jobs were running). I would hope that all
fixed updates would be under 30 seconds next Saturday. Even more importantly,
the auto-updates should speed up significantly too - they are currently
hovering at around 50-55 seconds each.
Before you wonder what the use of a 50-55 seconds auto-update is when I come
to implement the live updates system, well, that system will update the live
server pages directly via a CGI, rather than using an off-line machine and
mirroring the pages across, which is how the current auto-update system
does it (to avoid overloading the live server).
- Tuesday 22nd October
Bought a couple of extra tickets for next
Saturday's rollover - there's now two newsagents on the Liverpool
University campus that sell lottery tickets in case you're curious. I
didn't buy from either though - I got the tickets from W H Smith
in the city centre. Temporarily moved the live updates proposal to a new
section, which I'll open up tomorrow (I've got a prototype form I'm preparing
that at least needs to do something sensible before I make it public).
Fixed the text input box in the
multiple ticket checker so that its width is based
on log10(number of lotteries), although I didn't use that maths
function otherwise I'd have to link with the maths library, which I'd
avoided so far (and still have of course). I'd done this for the
Have You Won ? page, but had neglected to do the same
for the ticket checker.
- Monday 21st October
Uploaded the results for
Lottery #101. Added three new categories to the
Lottery Links section, which just helped split up some of the
existing ones. The official site seems to have failed to update its winning
numbers and it's two days after the draw.
- Saturday 19th October
The first teletext e-mail update returned at 8.04pm, but only with 4 of the
7 numbers, so it was ignored. Syndication UK came through with the winning
numbers at 8.05pm and Chris Prickett's came through at 8.15pm, which meant
my pages updated at 8.16pm.
ITV teletext came through at 8.35pm with an
estimated jackpot of £9.8m, but when the pool forecast came through
(rollover draw), I only parsed it as "20" instead of "20m" because ITV teletext
stupidly repeated that there was an "estimated £20m jackpot" in the main
part of their pages as well as the top of each sub-page and yep, it
threw my page parsing because there was a monetary value in there. I've
adjusted the coding so that it should avoid this problem in the future.
Work commenced on the
live update system today, but don't expect even a
prototype to be available until at least the end of the month. Once
completed, it has the potential to be the only live UK lottery update on the
Internet, providing 3 people actually make the effort to enter the results
as the draw takes place (fat chance). I suspect that it won't be until I
get my home Internet connection that we'll see the truly live updates,
since people will probably say "I came to your pages to get the
winning numbers and not to supply them"...
- Friday 18th October
Adjusted the "180 days expiry" page updating code that runs at 11pm on
Thursdays so that it generates the pages from 24, 25 and 26 weeks ago to cover
the unclaimed prizes note near of the bottom of the individual pages.
Previously, I'd only been doing the 25 weeks ago page, which often skipped
the update because the unclaimed prizes info wasn't available until the
Proof-read many pages and tidied up bits'n'pieces. Received
the usual weekly fax from Camelot and updated the mid-week figures.
Did a major trawl for new lottery sites and managed to exceed 300 sites in
the lottery links section at long last.
- Thursday 17th October
In case you're curious, yes, I'm tracking the Swiss Franc exchange rate on
a roughly weekly basis using BBC 2 teletext page 251 (the page generation code
converts SFr into sterling and puts the conversion in brackets) and the pound's
just broken through the 2 SFr barrier for the first time since I've been
tracking it !
- Wednesday 16th October
Fixed problems with links in yesterday's live update proposal and moved it into
the Background Information section.
- Tuesday 15th October
A proposal for a new live update system was drafted.
- Monday 14th October
Uploaded the results for
Lottery #100 - this now includes 122
pages auto-generated on my work system, plus one more
(the best performing tickets
page) auto-generated on my home system because it takes so long.
I finally managed to hack the GIF of my latest cheque and put it on
the usual page.
I've been re-generating far too many pages that don't change during
the weekend auto-updates for many, many months now, so I finally
decided to restrict the page updating to only pages that change and this
should result in a doubling of the speed the updates take to appear on
the live server.
A good example is when a teletext or WWW result comes
through and the pages need updating. Last Saturday, I re-generated
50 pages when this happened. Next Saturday, it will only re-generate
21 pages. The midnight, 7.30pm and 8.04pm fixed updates were even more
excessive (64 pages each last Saturday) and will be trimmed to a mere 5
pages each next Saturday.
- Saturday 12th October
The first teletext e-mail update came through perfectly at 8.06pm and therefore
I didn't use any other WWW sites for the results. The exact jackpot amount
came through at 9.14pm.
- Friday 11th October
Received the weekly fax and my £10 cheque from last Saturday's win.
I've managed to update the weekly stats, but haven't had time to hack the
cheque GIF (it's been scanned in), thanks to 6 and a half hours of
Connect meetings I had today...the GIF will have to wait until Monday
morning I'm afraid.
- Thursday 10th October
I decided that the use of <H1 ALIGN=center> as the tag for my headings
in all documents was resulting in headings that wrapped onto 2 lines on a
PC. Hence, I reduced all headings to H2 and any sub-headings to H3 (they
were previously H2). Ironically, UNIX Netscape displays H1, H2 and H3 using
exactly the same size font, which explains why I hadn't noticed the problem
Unfortunately, I'd hacked the heading code generation for the virtual
incorrectly whilst attempting to scale it down to an
<H3> heading, resulting in very weird section numbers on the
form until I fortunately spotted this just before I went home and fixed it...
- Wednesday 9th October
Fixed a bug reported to me via e-mail with the 1994 and 1995 Unclaimed Prizes
pages - they had the "Prizes expire 180 days..." sentence in the Notes
section which shouldn't have been there (because all lotteries of those
two years have expired). Only the latest year pages (for 1996) and the All
pages should have had this sentence, so I duly adjusted the code for this.
- Tuesday 8th October
There was a case study of the IT involved in the UK lottery in
Computer Weekly (26th September issue), so I transcribed some of
the facts'n'figures into an extra question in the
- Monday 7th October
Uploaded the results for
Lottery #99. I had my 8th £10
win on Saturday ! Adjusted any analysis pages
that had the lottery number in a column so that they were correctly
right-justified to 3 chars. This prepares the pages for the 100th draw so
that the columns don't mis-align...
- Sunday 6th October
It's a good job I ask for teletext pages on Sundays, because the first request
today (9.05am) got back the exact jackpot from ITV teletext at long last.
- Saturday 5th October
Syndication UK updated at 8.05pm (they seem to be the fastest in recent weeks),
whilst the first e-mail request was a little slow to return (8.09pm). This was
no bad thing because it meant that the returned mail had all the numbers
and my pages updated at 8.10pm with a £9.7m estimated jackpot.
For some strange reason, ITV teletext failed to update their jackpot figure
during the rest of the evening though.
- Friday 4th October
Sales Figures section was launched, re-using much
of the layout code previously utilised exclusively for the
winning numbers section.
There's a whopping 51 pages in the new section (44 of which are brand
new, the remaining 7 having been located uneasily in the Numerical Analysis
section up until then) and this means that there's now over 700 lottery pages
Every time I do some major hacks, I'll now list the CD albums I listened to
whilst coding. Here's the batch for the last couple of days:
As you can see, my music philosophy is if it doesn't have a good, strong
female vocalist (er, OK, Clare Grogan isn't much cop really), it ain't worth
listening to and it won't surprise you to learn that this means I really don't
like Blur or Oasis (neither of which has decent singers or any females for that
- Altered Images Reflected Images - The Best Of
- Bangles/Susanna Hoffs Definitive Collection (Dutch double CD)
- Sam Brown 43 Minutes
- Amanda Marshall Amanda Marshall
- Aimee Mann I'm With Stupid
- Heather Nova Oyster
- Patti Rothberg Between The 1 And The 9
- Rebecka Tornquist Good Thing
Received the weekly Camelot fax and duly entered the data into the new
Sales Figures section. Noticed that InterLotto had redesigned their
pages yet again, so I had to do a rapid hack to switch to their new
style, which I managed after much gnashing of teeth. It now uses HTML tables
on every page, but lynx 2.6 deals with them quite well, so I'm happy about
My pages were reviewed in the November 1996 issue of Net User magazine,
but they a) said there wasn't an official lottery site (wrong - it's been
available since July 1996), b) did screen shots of the
newsflash (including an 18th August newsflash -
a full month after the official site was launched...) and
ticket checker pages [hardly two pages that visually
stand out] and c) gave it only 4 out of 5 after a glowing review !
- Thursday 3rd October
Day 2 of the hacks and I set to work on the HTML tables, which turned out to
be the widest tables I've constructed to date. This unfortunately means that
if you narrow your browser window significantly below 640 pixels, the tables
gradually degrade and nothing lines up :-( I've now put a note at the bottom
of all winning number and sales figures table pages to indicate that a
minimum width is required. I'd got the table pages into good shape by
mid-afternoon, so there was only some shifting around left to do.
One such shift was the "Where The Money Should Go" pre-formatted section,
which was previously buried only on the ticket sales page. It's now been
moved the bottom of the Sales Figures index page,
which is a much higher profile position. I added an extra column to the index
page to indicate the grand total figure of each of the categories (ticket
sales, scratchcard sales etc.). All coding was completed at 4.19pm in case
you're curious (no, I didn't think you were).
After such an upheaval, I
went through the usual site checks (re-compile with gcc [found the
-traditional-cpp qualifier that handles bhs macros like the K&R cpp does !],
lint, weblint, internal link checking and spell checking) and there were only
a few minor changes needed, so everything's in a pretty good state again.
All of these code hacks encouraged me to write many more functions which work
for both the winning numbers and sales figures pages (previously the code
was simply inlined into the winning numbers section) and should hopefully be
further re-usable when I come to convert other pages to HTML tables.
- Wednesday 2nd October
The first day off was initially spent cleaning up the existing setup ready for
the coding. I spotted an incorrect link returned from the
Number Palace CGI code since the top-level
winning numbers pages were moved into the "All" subdir, which was duly fixed.
I inspected all the lottery binaries and managed to re-arrange the source
code to ensure that the CGI and page generation binaries didn't have some of
each other's code (which wouldn't be called of course). Prior to the onset of
coding, the CGI binary was 88K, whereas the page generation binary was 144K
(InterLotto sizes were 56K and 96K respectively).
Coded the pre-formatted text part of the sales figures section in the
evening. The index page has unlinked years for the scratchcards
(1994) and Lucky Dip (1994 and 1995) because there's no figures for those
years of course. Added year navigation to the top of each yearly pre-formatted
page in the same manner as I did with the winning numbers pre-formatted pages.
It wasn't until nearly midnight before I was happy with the
pre-formatted version...but that's the easier of the two types to code - the
HTML table version is going to be "fun".
- Tuesday 1st October
Continued the preparation for the next 2 days of code hacking by moving the
seven sales pages (at the bottom of the Numerical Analysis
index page) to the "All" sub-directory. Yet again, I had
to run internal link checking, plus a major search-and-replace, to change
links for those pages from the Analysis dir to the All dir. I also weblinted
the pages, which found a few link errors due to faulty macro expansion
on the virtual lottery
FAQ page, which have now been fixed.