Conjouring a daemon

A long time ago – in a galaxy far, far, away” … as the story goes I left University with a piece of paper that said I was a Software Engineer. But for some reason, I was forever drawn to the hardware and volunteered for / threw myself in front of pretty much every hardware / operations / compliance / security / generic administration role I could find between friends, studies, summer work.

My coding ability died – unsurprisingly. To be more specific – it shrivelled up through lack of use, what remained became old, out of date, and then died. Primarily SQL, and Pascal but with side orders of Modula2, Z80, 68000, and a handful of Ada and C (no plus, no sharp – just plain old).

Sure – there was BASH scripting and configurations of all types – be that iptables, Cisco configurations, or a thousand different types of .conf and .ini files … essentially anything that involved using the keyboard to directly resolve problems … stopped.

The last few months of work before moving on have been exceptionally BASH and SQL oriented. Not because of the fact that these were the best tools for the job (plot spoiler: they were not) but because these were the tools I was most familiar with – and no one else was in a position to make good with the code and database manipulations in the thousands of records in the timescale available.

As you can appreciate – this was a mixed bag of misappropriation of tools, methods, and time – with an equal measure of  (out of character and rather vocal) “FFS you genuinely waited until 1645 on a Friday?!“, and much quieter internalised “wow, I actually did that – go me!

Resurrecting a long dead beast within me – I realised that there was a bunch of 30-year old skills that lay dormant that were still relevant and I did kind of sadly enjoy a veritable heap of dated Oracle6/SSADM4/SQL/Relational Calculus knowledge to pull on – albeit mostly ‘dots with no joins’ as it where.

Memories of monochrome DEC and WYSE terminals (amber on black preferential over green – like my Hercules graphics XT clone at home), and the even more memorable wide carriage fanfold printer paper. You know the one – in another room, somewhere. Where jobs had banners on the paper so you could tell who’s was who’s. Where paper went up one side from a box and folded back neatly into a box on the other that you had to (equally neatly) sift through and replace. The carriage upon which it stood (in a soundproof box if you were lucky) usually weary of the almost continual left-right-left of the head during daylight hours and swaying along to the beat. Ahhh, those definitely were different days – so much new, so much adventure!

… distracted – where was I …

Ah yes – so I decided to exercise the grey cells a little and remember a little more – with an ERD, DFD’s, and a few queries getting a little more complex each time.

I put together a relational database for the recording of time trial information after seeing that the CTT website was using something similar to the one put together by my good friend Garry some considerable lifetimes ago. With the prospect of getting fit enough to compete again a reality, this as good a project to work on as any – with thousands of lines of data to hand – and plenty to read into and from that. So off I went.

As the wine in my glass this evening is reduced down to a red dot in the bottom I look over at the console to see that I have done an ‘actual thing‘…. a showing a modicum of understanding if not purpose and design. So sure – it’s clunky, there is a bunch I would probably do differently if I started over with it again – but that not really the point. The point is to continuing to think up those little tasks, and just taking them on, to see if you can – if not this time – then maybe next time… and trying to not let the setbacks set you back… but to grow from it.

Here is the challenge – and overcoming it – even if that is a little bit at a time.

If I get this working, and it is practical – I will make the schema and the queries available for others to use, rework, mock, or generally use as a cautionary tale.

In the interim – a real query – with like grrr and stuff – from me – old dog – tricks.


  code AS 'Course',
  distance AS 'Miles', AS 'Date',
  n.time AS 'Time', AS 'Rider', AS 'Age Group',
  wd.direction AS 'Wind Direction',
  ws.speed AS 'Wind Strength',
  sf.condition AS 'Conditions'
  number n
    JOIN event ev ON n.event_id = ev.event_id
    JOIN catagory ca ON n.catagory_id = ca.catagory_id
    JOIN club cl ON n.club_id = cl.club_id
    JOIN rider rd ON n.rider_number = rd.rider_id,
  event ev2
    JOIN course co2 ON ev2.course_id = co2.course_id
    JOIN wind_speed ws ON ev2.wind_speed = ws.wind_strength_id 
    JOIN wind_direction wd ON ev2.wind_direction = wd.wind_direction_id
    JOIN surface sf ON ev2.surface_condition = sf.surface_id
  n.event_id = ev2.event_id
  AND n.rider_number='477'
  distance ASC,
  n.time ASC

To which the output would look a little like this where rider 477 is Nic – and here are his rides on each course for the last year or so:

# Course, Miles, Date, Time, Rider, Age Group, Wind Direction, Wind Strength, Conditions
MT, 1, 2018-07-08, 00:01:53, Nic Wright, Vet-B, Variable, Light, Dry
MT, 1, 2017-07-08, 59:59:59, Nic Wright, Vet-B, NW, Light, Dry
D600/1, 2, 2017-05-30, 00:11:52, Nic Wright, Vet-B, W, Moderate, Dry
D1/5, 5, 2018-08-07, 00:11:51, Nic Wright, Vet-B, Variable, Calm, Dry
D1/5, 5, 2017-07-11, 00:12:12, Nic Wright, Vet-B, Variable, Calm, Damp
D1/5, 5, 2018-07-10, 00:12:18, Nic Wright, Vet-B, N, Light, Dry
D1/5, 5, 2017-05-02, 00:12:33, Nic Wright, Vet-B, N, Moderate, Dry
D1/5, 5, 2017-06-06, 00:12:33, Nic Wright, Vet-B, WNW, Strong, Dry
D1/5, 5, 2017-05-09, 00:12:36, Nic Wright, Vet-B, N, Moderate, Dry
D1/9, 9, 2018-08-14, 00:23:14, Nic Wright, Vet-B, W, Moderate, Dry
D1/9, 9, 2018-09-04, 00:24:13, Nic Wright, Vet-B, N, Calm, Dry
D1/9, 9, 2017-06-27, 00:24:14, Nic Wright, Vet-B, SSE, Moderate, Dry
D1/9, 9, 2018-05-29, 00:24:17, Nic Wright, Vet-B, NE, Moderate, Dry
D1/9, 9, 2017-05-23, 00:24:48, Nic Wright, Vet-B, NNE, Light, Dry
D1/9, 9, 2017-04-18, 00:24:54, Nic Wright, Vet-B, NNE, Light, Dry
D1/9, 9, 2017-01-01, 00:24:55, Nic Wright, Vet-B, N, Light, Damp
D1/9, 9, 2017-04-25, 00:25:15, Nic Wright, Vet-B, N, Moderate, Damp
D1/9, 9, 2018-01-01, 59:59:59, Nic Wright, Vet-B, WNW, Moderate, Damp
D23/10, 10, 2018-08-21, 00:25:13, Nic Wright, Vet-B, W, Moderate, Dry
D23/10, 10, 2018-05-15, 00:25:19, Nic Wright, Vet-B, NW, Moderate, Dry
D23/10, 10, 2018-07-24, 00:25:21, Nic Wright, Vet-B, NW, Light, Dry
D23/10, 10, 2017-07-04, 00:25:40, Nic Wright, Vet-B, W, Moderate, Dry
D23/10, 10, 2018-07-03, 00:25:53, Nic Wright, Vet-B, Variable, Light, Dry
D23/10, 10, 2017-05-16, 00:25:55, Nic Wright, Vet-B, SW, Moderate, Dry
D1/9x2, 18, 2018-07-17, 00:48:18, Nic Wright, Vet-B, W, Light, Dry
D1/9x2, 18, 2018-06-12, 00:49:42, Nic Wright, Vet-B, NNW, Light, Dry
D1/25, 25, 2017-06-13, 01:05:07, Nic Wright, Vet-B, SW, Moderate, Dry
D1/25, 25, 2018-08-05, 01:05:18, Nic Wright, Vet-B, S, Moderate, Dry
D1/25, 25, 2018-06-19, 01:08:08, Nic Wright, Vet-B, SSW, Light, Dry
D1/9x3, 27, 2018-06-26, 01:17:05, Nic Wright, Vet-B, N, Light, Dry
D601/150, 50, 2017-06-04, 02:16:22, Nic Wright, Vet-B, WSW, Moderate, Dry
D601/150, 50, 2018-06-03, 02:19:34, Nic Wright, Vet-B, E, Light, Dry
Simple things. Simple minds.
Go do the things - do the things and share.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this:
Skip to toolbar