As a programmer for a steel mill, Josh gets to see all sorts of interesting things. And not the "everyday" things like the gargantuan ladles that carry hundreds of tons of molten steel. Or the red-hot, 2000°F slabs flying through the hydraulic rollers in the hot strip mill. Or even the giant vats of hydrochloric and sulfuric acid used by the pickler. No, I'm talking about The Code.
The Code — the lifeblood of the steel mill's information system applications — was originally developed by a highly paid consulting firm who specialized in the manufacturing industry and hired "only the brightest of developers". And that turned out to be their downfall: given the boring nature of the steel mill's information systems, the developers often made things far more complicated than they needed to be.
Recently, Josh needed to modify some of the workflow logic in an environmental application that used a web service to save signatures as image files. The signatures originated from various PDAs around the plant whenever an environmental inspector would go from area to area and sign off on a particular task, and were eventually stored as compressed, 300x100 monochrome bitmaps.
When Josh went to look for some test data for the workflow changes, he noticed something strange. The uncompressed bitmap data transmitted through the webservice weighed in at about 290KB. Naturally, that piqued his curiosity as a bitmap as, even with 24-bit color data (which it didn't have, anyway), there was no way that a signature would need 290KB for a 300x100 monochrome bitmap. So he decided to diagramed out the entire process.
On the PDA, when the stylus was moved on a picturebox control, the application logged each X,Y coordinate and saved it in an array. A typical signature would generate about 1000 points of data and a handful would go to 2000 if the signature was fancy. This array was then put into a DataTable, named "Signature", with single byte column called signature. This table was then serialized into XML via the DataSet.GetXML() method. The resulting XML looked like this...
<Signature <signature> 87 </signature> </Signature> <Signature> <signature> 127 </signature> </Signature> ... rinse and repeat 1000-2000 times ...
Once this XML file was passed up to the webservice, the webservice then saved the XML into a file in a specific folder. A job then ran once a minute to process the files in this folder, plotting the X,Y data on a picturebox and saving the result as a compressed bitmap.
All told, it was certainly one of the more interesting things that Josh has seen while at the steel mill.