Game Programming, Etc.

Games, programming, and related topics — by John Giors

Archive for the ‘Tech’ Category

Your prototype is your final product (part 1)

Posted by jgiors on 2008-05-14

About 5 years ago, I worked at a division of Brooks Automation which built semiconductor wafer-sorting robots. My most interesting project was creating an experimental image-processing algorithm to detect a reference notch on a silicon wafer (which is used as a reference position for etching — we used it to locate ID numbers and barcodes). It was a challenging project — the reference notch is a rather small feature that only occupies a few pixels in a wafer image.

I was excited to demonstrate that the project should work in principle, so I threw together a prototype as quickly as I could. I made it very clear to everyone (including management) that this would be a prototype only, that it was unsuitable for mass-distribution, and that I would need some time after the demonstration to rewrite the code.

So, after about 3 weeks and with the help of some hardware tweaks (to provide a high-contrast image) I got it to detect the notch location about 90% of the time. Not bad for a first pass, but clearly it would need a lot of work to get that up to production quality (somewhere above 99%).

But, there was a problem…I had used a lot of “rapid prototyping” techniques (and hacking) to get things done as quickly as possible. I had used smart pointers instead of proper memory management, and as a consequence, there was a lot of memory waste (holding on to unnecessary images in the image processing chain) and thrashing/fragmentation (caused by allocation/deallocation of image buffers which could have been reused). The algorithm worked, but it was slow. I don’t recall exactly, but I think it took about 3 seconds to process an image.

But I thought “Not to worry, with some additional time to rewrite proper memory management routines, plus optimizations, that will easily reduce to half a second or less.”

The next day, my boss told me that we would use the code as-is.

I explained that the code was not ready for production, that I needed time to rewrite. I explained about the memory management problems and how optimization would require a different code structure. I also reminded him again that I had been upfront about the need to spend extra time for a rewrite (I had reminded him almost daily because I anticipated such a problem). He still wouldn’t budge and insisted that I continue with the current code base.

That’s when I learned the lesson which became the title of this post: Your prototype is your final product.

It’s a good thing to remember. Whenever you work on code (or engineer any product), what you think of as a prototype is likely to be seen as a final product by management. Once management sees visible results, they want it right away. And, in many cases, they just don’t understand the value of improving things that are “under the hood”. After all, what they see seems just fine to them, so what value could there possibly be in improvements?

[to be continued...]

Posted in Programming, Tech, Your prototype is your final product | Leave a Comment »

USB Flash Drive

Posted by jgiors on 2007-01-25

I finally picked up a 1 GB USB flash drive [actually, it was a few months ago, but I digress].

Maybe it’s because I’m an “old timer”, but 1GB in a tiny package at an “impulse buy” price point is just incredible. No wonder the 1.44 MB floppy disk is dead. This little flash drive holds almost as much data as 700 of those floppies, it’s small enough to leave on your keychain, and it’s far more durable.

Thinking even farther back, I remember when I loaded programs for my Atari 800 from a cassette tape! It took several minutes just to load a few dozen K of data. It was a big deal when I finally got a 5-1/4″ floppy drive. I got a special “double-density” drive which held about 180KB (you could flip the disk over to get another 180KB, for a total of 360KB)…So my flash drive holds almost as much as 3000 of those old floppies! Wow.

Posted in Tech | 2 Comments »

THX Deep Note

Posted by jgiors on 2006-04-21

Slashdot posted about The THX Sound, which details how the THX sound effect (affectionately known as "Deep Note") was created. Apparently, the guy wrote a 20,000 line C program to control an Audio Signal Processor (ASP). Sounds like way too much work by today's standards…but it was way back in '83 ! Wow, time sure flies. I wouldn't have guessed that THX was that old…

Posted in Tech | Leave a Comment »

WordPress ups and downs

Posted by jgiors on 2006-04-16

WordPress.com went down today, which was a little spooky. Coincidentally, I had just done my first RSS backup last night. Now, the servers are back online and all appears to be well. Hats off to them for getting everything back into working order.

Posted in Applications, Open Source, Tech, Uncategorized | Leave a Comment »

Batch file timestamp creation

Posted by jgiors on 2006-04-15

I've been looking for a good way to generate timestamps in batch files. I created this sample (Windows XP/2000 only) based on a comment posted about an article appearing in Windows IT Pro magazine.

Posted in Programming, Tech, Windoze | Leave a Comment »

Windoze power toys

Posted by jgiors on 2006-04-12

There are some useful Windoze XP upgrades in Microsoft's Power Toys.  The Alt-Tab ReplacementTweak UI, and Power Calculator seem like the most useful utilities.  Hopefully they don't bog down the system.  I'll post comments (or a follow-up) if I run into any problems.

Posted in Applications, Tech, Windoze | Leave a Comment »

FolderMatch

Posted by jgiors on 2006-04-05

My brother recommend FolderMatch for syncronizing files between systems.  I'm gonna give it a try ASAP.

Posted in Applications, Shareware, Tech | 2 Comments »