Monday, February 9, 2009

Another Monday

Oh well - I messed up a tiny bit with the whole prime number thing.  It was pointed out in a comment that 1 is not a prime number.  I'm struggling to remember where I heard the definition that included 1, but after looking around at a few references it is simpler to leave 1 out.  This is post 158 - obviously not prime, but it is the product of two primes - 2 and 79.  Pretty nice.  Prime factorizations are interesting too.  I found it very interesting that people still insisted on bringing calculators with them to class or exams at Waterloo, particularly the Math faculty.  I think most people who made it past second year simply lost their calculators - they were pointless to the curriculum.  Much more interesting to work out things in an abstract way and supply concrete values later.

That reminds me of something that I have to introduce at work - the idea of doing complexity analysis on our code.  Complexity in the form of big-O notation.  Since we create software that runs on a variety of hardware and operating systems, we need to ensure that it is as efficient as possible.  Every time the topic of performance comes up, everything is described in wall-clock terms - methods evaluated and user-visible tasks timed.  Such things are specific to a particular instance - a particular lab environment, a particular device, a particular firmware version etc.  If we could prove the quality of our code through big-O (and related) analysis, we could prove that we are running well.  I created an internal blog posting about the use of local variables to store the results of system calls.  I think there would be more agreement with this idea if I had included a big-O analysis of both cases.

On the home front, we are getting our piano tuned soon - tomorrow I think.  It is horribly out of tune and it is in need of some repairs.  My wife suggested we consider an electronic piano, partly because the repairs might be expensive and partly because an electronic piano can be used with headphones for quiet practicing.  So I had a look online at what is available.  I'm sure that the current state-of-the-art has improved from when I last tried them, and back then it wasn't horrible.  I've read there are electronic pianos that have hammer-action keys.  This adds some of the mechanics of a real piano into the electronic version so that it feels more authentic.  That would be worthwhile, as I can tell the difference between a decent piano and a good piano.  Maybe not anymore, but at one time I could.  Anyway, it's something I'm curious about now - the electronic part is intriguing because of the silent play.  Plus there are lots of directions to move in with MIDI and so on.  I think I really need to get into a store and see the difference between the different brands and judge for myself what is good.

No comments: