March 2007 Entries
During a database schema upgrade yesterday, I had to create a new primary key field for a table and then generate the new primary key values. At the moment this key value is a custom generated value by a Python class, but it will eventually use an RFC 4122 or ISO/IEC 9834-8 compliant algorithm (see Wikipedia for more information). I had to decide how to generate this value and I ended up using a combination of Python, gawk, and T-SQL. I suppose I could have left out the gawk, but it would have taken almost the same amount of time...
One of the strange requirements I had on a project was to use the joystick button to synchronize the computer clock with an outside contact. The idea was that all of the clocks in the plant would be synchronized periodically by using a digital contact. The software would wait for the joystick button and adjust the clock to the nearest hour. You must realize that this was long before GPS devices were common and so it seemed like a good idea at the time. This all occurred around the Y2K issue, so adjusting the clock turned out to be the...
A while back I needed the dashboard for the
Key Performance Indicators (KPI) to display nicely formatted numbers. When
the KPI values started to get large (millions, billions, etc.) the numbers became
almost unreadable. In order to simplify the display of the numbers, I ended up converting
the values to scientific
notation. However in order to make the numbers even more readable, I converted
the scientific notation into powers of 103. I converted the floating
point number into a string that was still a valid floating point number, but it
used the exponential notation such as 1.0e6. I then used a regular expression to
convert the exponent into...