RSS

The Notes System

11 Jun

Most all of you, I suspect have seen the little screen above. Way, way back in 2003, Tyler posted a note to the indicated locomotive, and this is how it displays if you click the Notes button for that locomotive. The website maintains a count of how many Notes are attached to each locomotive, and has done so for the last 17 years. The problem is this: I just discovered that it was not counting accurately. Thus, for some locomotives the count of notes stored in the locomotive’s record was actually larger than the number of notes for the locomotive stored in the system. And therein lies the problem. The image below shows two rows of the search results when I searched for locomotives in Calgary.

The little red and green dots are supposed to indicate whether the locomotive has a particular feature. Thus, the locomotive in the first row has a green dot for Notes, indicating that there are notes pertaining to this locomotive. The locomotive in the second row has red for that feature. Unfortunately, there was a bug in the system, since 2003 that failed to reduce the count of notes for a locomotive when a note was deleted. This meant that the counts for more than 1000 locomotives were above zero, when they should have been zero. So the little green dot would appear, you’d go to read the note(s) and it wasn’t there.

So in a fit of productivity, I wrote a nifty little utility to analyze the data and correct it. Now everything works correctly and I got to write a fun little blog entry.

 
Leave a comment

Posted by on June 11, 2020 in Website

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: