Office: 270.275.6510 Emergency: 270.752.0059
Site Contents


Blade's Edge
Contracts & Policies


Software Engineering
Systems Analysis
Networking & Security
Repairs & Upgrades
Training & Support


Landmark Projects
Government Projects
Non-Profit Projects
Development Tools
Scientific & Technical Projects
Support & Business Tools
Consumer Products
Portfolio: Scientific and Technical Projects
Jump To:  Overview |  HipSIP |  CatScan / CatStat |  Agriscience |  MasterKey |  VBDbImg

Although it's greatly satisfying to create software used by global corporations and thousands of individuals, many small projects produce equal rewards in very different terms.

We've been blessed to work on a diverse mixture of such small, but uniquely-positioned projects. We summarize two that are of a semi-scientific nature below, followed by a couple of solutions we devised to overcome technical obstacles encountered by other software companies.

Although not world-changers, these projects provided worthy opportunities to work in unfamiliar domains, develop new abilities, and apply well-worn skills in previously-unimagined ways.

Jump To:  Overview |  HipSIP |  CatScan / CatStat |  Agriscience |  MasterKey |  VBDbImg


Since 2005, we've been privileged to work frequently with an embarrassingly-brilliant scientist, Andrés Ferreyra. A doctor of agricultural and biological engineering, Andrés also picked up a masters in agrometeorology and an electrical engineering degree along the way, presumably to satisfy some of his satellite curiosities. ;-)

A true polymath, Andrés.

Among his long-held lesser interests is emerging applications on mobile platforms. To this end, Andrés enlisted us to assist in a research project devised to measure human efficiency against an array of highly-varied soft input panels (SIPs).


Andrés designed a lineup of SIPs featuring both general purpose and numeric configurations. These designs were translated into images, and from images to image maps. Another file was created to host test-values and instructions to the test-subjects and input test values. Because nothing more complicated (and slower, and more difficult to modify) was needed, image maps and test values were expressed as comma-separated values: Andrés heartily agrees with us that over-architecting is a cardinal sin.

While Andrés was synthesizing the source data, we created HipSIP (Hip as in cool), a simple PocketPC program that presents the series of SIPs and input tests, measures completion times, and tallies errant responses. Because HipSIP is driven from CSVs and bitmaps, Andrés was able to continually improve the experiment with no intercession from us once he had the program in his hands.

R E S U L T S   A N D   P O S T - M O R T E M

Through Andrés' academic ties, Murray State University shipped busses filled with students to a company conference room where we distributed handhelds, issued instructions, and administered the tests. I compiled and surrendered the resulting data to Andrés. The results demonstrated several SIPs clearly superior to their companions.

Jason wrote code to replace the standard Windows CE SIPs with these improved incarnations in two company products. In keeping with his scientific nature, I expect Andrés shared his findings with at least some of the mobile manufacturers of the day.

Click Any Image to Enlarge

Click right half of image to move forward
Click left half of image to move backward
Or use LEFT and RIGHT cursor keys

CatScan / CatStat
Jump To:  Overview |  HipSIP |  CatScan / CatStat |  Agriscience |  MasterKey |  VBDbImg


The aforementioned R. Andrés Ferreyra, acting in a consulting role, had been studying the operations of a local business that encompassed both a sizable fish farm and a processing plant. He outlined two applications to improve efficiency and brought us on board to implement them.

These applications were tentatively named CatStat and CatScan, simply because catfish represented a significant portion of the farm's revenue stream and names with fish in them didn't come to mind as easily or roll off the tongue as smoothly. ;-)


We began developing two distinct programs:

  1. CatStat was built to simulate fish farming. By modifying production variables, harvest count and weight could be predicted. Comparing the various cost vs. yield projections, the farm could maximize profits. Further, by comparing post-season results with pre-season predictions and identifying the reasons for any non-trivial differences, the program could be improved through time.

    Andrés' education as an agricultural and biological engineer complemented the farmers' real-world experience perfectly. Jason banged-out the GUI, data layers, and application plumbing while Andrés cemented the algorithms, but it wasn't long before the second program demanded priority . . .

  2. CatScan relied on handheld barcode scanners and label printers to track fish from the moment they were extracted from a pond, through every step of the processing plant, to the time they were placed in consumers' hands, whether that be by local delivery or across country via air-mail. This was both to enable the farm to prove to any suspicious customer that its products were processed and delivered in a timely manner and to get ahead of evolving state law that Andrés believed would inevitably require such product-traceability.

    RFID tags were considered in place of barcodes, but were ultimately rejected due to a) the immaturity of the technology at the time, b) its greater cost, and c) the potential effects of extreme and rapdily-changing environmental conditions on the tags.

    Other CatScan features included inventory control, QuickBooks integration, and reporting. CatStat was eventually "rolled into" CatScan.

R E S U L T S   A N D   P O S T - M O R T E M

Unfortunately, during the development process, the processing plant was unexpectedly closed and the farming operation sold and downsized. That not every project sees the light of day is simply a fact of programming life.

Still, that doesn't mean that our investment in the project was without its returns. We became familiar with barcode programming and some of the more esoteric aspects of the surrounding technology — and when else will we ever get paid to code a fish-farming simulator? Developers are always excited to learn new technologies, and on that point, we emphatically agree; but learning new businesses is underappreciated, and consistently one of the very best perks of our industry.

[Click Image to Enlarge]

Jump To:  Overview |  HipSIP |  CatScan / CatStat |  Agriscience |  MasterKey |  VBDbImg

Over the course of more than a decade, we've been proud to work with astute agriscientist Andrés Ferreyra on dozens and dozens of projects. Our work has touched areas of e-agriculture, including irrigation systems, soil-management, field-scouting, genetically-modified organisms, restricted-use pesticides, and many others.

Our many research and development initiatives have provided us the opportunity to create, leverage, and integrate with an immense spectrum of hardware and software systems in both general farm-management and precision agriculture. Along the way, we've coordinated our efforts with other scientists and engineers in some of the largest agricultural companies in the world to design, implement, support, validate, and analyze experiments and trials.

From Blade Technologies principal Jason Purcell:

Our work has been significant in the authoring of standards for electronic inter-operation in the agriculture industry, particularly in regard to the endeavors of AgGateway's Standardized Precision Ag Data Exchange (SPADE) and Precision Ag Irrigation Language (PAIL) initiatives. Andrés often chairs AgGateway committees and heads working groups, and as one of his primary code monkeys, I get to come along for the ride!

Well, I do a bit more than that, but suffice it to say that working with Andrés, whom I consider a truly brilliant man, has helped improve my own work by learning to look at problems from angles I wouldn't have before imagined, as well as by increasing my attention to detail via his insistence on sanity checks, redundant systems, and data validation techniques of all sorts, every step of the way.

Jump To:  Overview |  HipSIP |  CatScan / CatStat |  Agriscience |  MasterKey |  VBDbImg


From Blade Technologies principal Jason Purcell:

Another software company, for which I'd already been working, was suffering from crippling problems in a critical area of its flagship application. Support was at its collective wits' end, pleading for a solution. The app's developers had not only failed to identify a solution, but responded to support's cries for salvation by pronouncing the dilemmas irrefutably unsolvable.

Now, since my very earliest days working with other programmers, claiming that something can't be done has been far-and-away the most agitating of developer-birthed irritants — hard evidence, no doubt, of my father's successful indoctrination of his "there's no such thing as can't" mantra.

Once I began hiring and managing developers during my days at Hawkins Research, my aggravation at hearing "It can't be done" only grew. In my decades of experience, I've not once encountered a problem that — appropriated sufficient resources — could not be solved.

Yet, here we had an entire team of developers who together determined that the world held no answers for not one, but two distinct defects! So of course, I just had to take an unsolicited shot at these supposed supernatural monstrosities.


The two bottlenecks, and their solutions:

  1. Symptom: Decrypting thousands upon thousands of records from a database and loading them into a grid required 45–70 seconds when tested across the range of modern company hardware. (Dear readers, ignore the question of why thousands of records were being loaded into a grid in a single operation in the first place. [smh, eye-roll, face-palm])

    Problem: The insistence on using bloated, third-party database objects and data-bound controls. The backing database engine was a very early version of SQL Server Compact Edition, so conventional database paging wasn't an option. I could have rolled my own paging, but all the controls were data-bound and I wanted an overnight solution. I felt there must be a simpler way lurking beneath the surface.

    The developers were using NHibernate data objects because — at least at the time — they generally provided significantly increased performance over intrinsic .NET data objects, in addition to a multitude of extended features. However, I'm sure NHibernate's creator's would've been as surprised as I to learn how their components were being abused in this instance.

    Solution: I circumvented NHibernate data objects by writing my own, barest-of-bones versions, intended only for this specific programming context — a solution not considered by the app's developers, as they were all irreparably indoctrinated with the "write once, reuse everywhere" fallacy increasingly taught by universities as software gospel. (A lovely dream, too often dispelled by reality.) I set the grid to unbound mode and instead loaded it via a loop that leveraged my custom data object.

  2. Symptom: Using the incremental search feature was painfully slow. As in CHUNK-LONG_PAUSE-CHUNK slow.

    Problem: The developers' were using the grid's native Find)_ method, assuming that they couldn't create a faster implementation in managed code.

    Solution: Inside the grid-loading loop, I added each item name/Id descriptor and grid row-index to a hash table and added code to perform searches against this data structure, bypassing the grid's native FIND method. Once a hit was made, I set the grid's selected record using the associated row-index from the hashtable match, and finally set the grid's viewport to make the selected record the first visible row.

R E S U L T S   A N D   P O S T - M O R T E M

MasterKey produced a performance of magnitude increase in grid-loading performance, and roughly a 4x-5x reduction in incremental search performance. (The latter which was more difficult to quantify.)

Was this ground-breaking stuff? Well, certainly not to any of my contemporaries, but apparently, it's nothing less than black frakkin' magic — with all the appropriately terrifying and repulsive accoutrement — to today's exclusively-college-educated whippercoders. The application team was forced to adopt this old man's code to their program, though I'm sure they were cursing me the entire time for introducing such dirty hacks to their bleached-clean artwork. ;-)

Sorry, no screenshots
due to non-disclosure agreements
Jump To:  Overview |  HipSIP |  CatScan / CatStat |  Agriscience |  MasterKey |  VBDbImg


VBDbImg is simply an example program — illustrative code, nothing more. That's why it looks the way it does, with non-graphical, native-only controls and no polish of any kind. Decidedly unshiny.

It shows how to use vanilla Visual Basic to stash an image file into a database, and conversely, to spit a database image into a file, i.e. the time-honored "suck & blow" design pattern. ;-) So why do I include the equivalent of a pop song amongst so many symphonies?

In '96, a old friend and fellow programmer drove an hour to have lunch with me. When he walked into my office, I happened to be working on the inventory area of an application for a used-car dealer, and a PictureBox was displaying an image of some vehicle. He remarked what a pain it was to have to maintain image files in Visual Basic, and what a simple matter it was to use an unbound database field for image storage in Delphi.

Of course, I asked what he was talking about, and he informed me that as far as he knew, no one had figured it out, as he hadn't uncovered anything on the sad little digital rag that passed for the Web back then. So, I pulled up AltaVista. (Google wasn't a thing yet. Literally. It didn't exist. And AltaVista wasn't Yahoo yet, either. It was still AltaVista, the Google of our day!) Anyway, my friend was right: No matter how we searched, we found nothing of use. (We were specifically looking for storage/retrieval to/from an unbound field.)

Now, I'm sure I wasn't the only one to figure out how to work with database images in VB: From time-to-time, everyone sees an "obvious" solution almost no one else can find no matter how hard they look. (In fact, this was the same guy that within the next year or two wrote a C function I needed for PowerClaim, so what comes around . . .) Yet, of all of us that had discovered the answer, it seems that not a one bothered to share the wealth. Hence, this project.


Like probably every VB3 app, this one uses the Access/Jet database engine. As I was poking around in access, I stumbled upon what was then called a BLOB data type: Binary Large OBject. Now, when I opened this sucker up today, I saw that Access identified my image field as an OLE Object, but back when I created the app, BLOB fields were used to store all kinds of binary data, including OLE Objects. So I think it's the same thing today as it was then. I didn't exactly go digging for nuances on the web since we're talking about twenty-year-old code, so you're welcome to investigate yourself and drop me a line if you want to educate me.

Anyway, the "secret" is to use the AppendChunk() and GetChunk() methods from VB's Recordset.Field object. To store the image, open the file for Binary input, read it in as a byte array, and use AppendChunk() to push it into the field. Reverse the process with GetChunk to push it back out. No more complicated than that. You can see the relevant code in FPrimary.SaveFileToDatabaseRecord() and FPrimary.ExportDatabaseImageToFile().

R E S U L T S   A N D   P O S T - M O R T E M

Besides being upgraded from VB3 to VB6 and switching out the original database images for some slightly newer, higher-res pics, this project is unchanged from '96. It was posted on early versions of the Hawkins Research web site, but was understandably dropped at some point, as it simply wasn't relevant to company business.

This is the way I handled images all the way through VB6: Since the code is succinct and lightning fast and I'd already written it into my personal library, I just never bothered to see if Microsoft ever provided an easier way. Surely they did, but for all you guys and gals charged with maintaining and extending twentieth-century Visual Basic applications, you're welcome!

You can download VBDbImg here.

[Click Image to Enlarge]

[Back to Top]