Entries close

Entries for the JOK Chasing Sprint closed this evening which was a great relief. This was to have been the year of the Web 2.0 entry system but, in reality, other commitments meant that my annual rewrite of the system only got as far as a stateless interface. This should stand me in good stead for next year though… Rails still continues to be a pleasure to use and the more I learn (I splashed out on the PDF version of the soon to be released Agile Web Development with Rails: Second Edition) the better it gets. New improvements to the development process this year were Git for version control and Capistrano for deployment. These certainly gave me more a lot more confidence in making updates to the live system.

One area that was certainly lacking this year was testing – again reflecting the lack of spare time – with three major blunders making it out in to the wild. Firstly, I was rounding juniors in odd years down rather than up so a 17 year old boy became M16 rather than M18. Fortunately the course allocation was based on the actual age so no-one noticed until I added an age class column to the start list. Thanks to Maureen Brown for setting me straight.

Secondly, and most significantly, when adding the export function back in I noticed that it seemed to think that a fair proportion of the competitors hadn’t paid. This turned out to be another rounding error. I had made the mistake of dividing one Ruby integer (fee in pence) by another (100) to which Ruby responds with another integer. Consequently, every £4.50 junior/student entry fee was displayed as £4. This was just the displayed value for each line so some entries may have seen interesting sums like £4 + £4 = £9! Unfortunately, the same rounding was then applied to the final total sent to the payment provider so anyone who had an odd number of juniors/students in their entry saved 50p. Strangely enough, no-one seemed to spot this and, given that it cost JOK less than £20, it doesn’t seem such a big deal. I blame the organiser for picking a fractional entry fee for the first time!

The last problem was also a rounding problem of sorts. The entry system, rather unfortunately, ground to a halt on the last day of entries. Having compared the closing date with the current date I would allow an entry to proceed. Unfortunately, when calculating the fee I would then compare the closing date with the datetime when the entry was created. As a date value is considered to be at a time of 00:00 for comparison with the datetime then the entry would always appear to be after the closing date at this point and everything collapsed in a heap. Just a shame I didn’t check my mail until early evening on that day!

Calculating start times also proved to be a bit tedious. I must implement an algorithm that takes in to account preferred start block, other competitors on the same form and the requirements of the FCC seeding.

With all that said, we had 274 competitors on the start list of which 271 were entered online – I’ll call that a success.

7 Responses to “Entries close”

  1. Did you solve the problem of displaying peoples surnames correctly? If so, fancy sharing?

    • Dave says:

      What problem was that then?! Is this how to cope with foreign characters, apostrophes etc when converting between input text, output HTML and exported data? If so, no – I don’t have an answer to share I’m afraid.

      • No, its names like McPherson, and double surnames like Davey-Jones, there needs to be a nice normalization function. I just capitalize at the moment but the exceptions dont look right.

        Think i’ll have to write one myself then.. 🙂

        • Dave says:

          What’s the purpose of the normalization? Something programatic (e.g. avoidance of duplicates) or just consistency of display? At the moment I just leave everything as it is entered by the user but admit I have manually corrected a couple of ‘capitalization optional’ entries!

  2. Thanks!
    The python example looks just the ticket. I’ll port it to ruby when I have the chance.

Leave a Reply