Software


I really like Atmel AVR microcontrollers. They are simple, powerful, and inexpensive. There are lots of development tools out there, but I like AVR Studio. AVR Studio is made for Windows, but it works great inside Parallels desktop on my iMac. Parallels sees the AVRISP mkII USB programmer also. I had no problem upgrading firmware on the programmer. Now that I have a nice development environment set up, I might be able to finish some of the numerous hardware projects that have been languishing for years.

One minor problem I ran into was the clock rate on the ATtiny24. By default, the clock is divided by 8, so it runs at about 1 MHz using the internal RC clock. This was too slow for the default program clock, which caused programming errors. This is to be expected, but it ends up crashing Windows! After testing on a native Windows machine, I located the problem, reduced the programming clock and disabled the clock divider fuse. After that, everything was smooth. I even got AVR-GCC working using WinAVR.
I’ll post some of the circuits I’ve been working on in the coming months.

Many have observed the non-trivial nature of IE when viewing dynamic PDF documents. You know, the interesting ones that go beyond flat files on a static web server somewhere. It seems that IE will usually request a binary stream several times — often with unpredictable results. The only solution that is known to work reliably is to use the EMBED tag with IE and a regular link to your PDF (or dynamic web page that produces PDF) for all other browsers.

This particular problem exposed itself during a Websphere 5.1 to Websphere 6.1 migration. For some unknown reason, Websphere 6.1 decided to add a Cache-Control: no-cache header to the response. This caused IE to render a blank page — just what the user wanted :-) We couldn’t eliminate the header, but using the EMBED tag solved the problem. Interestingly, pages with frames containing dynamic pages worked fine.

I’ve been busy with all sorts of things lately. I’ve been having fun with Smalltalk, Squeak in particular. It is really cool, IMHO. Squeak by example is a free online book that’s a great place to get started.

A lot of LDAP and security work has led me into the gory details of ASN.1, which is the underlying encoding standard for X.509 certificates among other things. It’s yet another variation of LISP S-expressions, as is XML, and most structured data schemes in widespread use. Lists and atoms, that’s all you really need.

Back in March of 1998, Network World invited me to write an article about Java in the enterprise. Java was still untested technology back then, so it had it’s detractors. Of course, I saw many benefits in Java, so I agreed to offer my opinion.

On the other side was a fellow by the name of Mike Sax, a strong Microsoft supporter. There were a number of predictions made by both us, some came true, some didn’t. You can read the article and judge for yourself how accurate our predictions were.

It might be hard to follow which part of the article I wrote and which part was written by Mike. I wrote the first half, which ends with “There is no doubt that Java is ready for the enterprise today. And in the coming years, there will be even more improvements.”. The remainder of the article is written by Mike Sax.

In 1990, I was an engineer working at the Space Sciences Division of the Naval Research Laboratory in Washington, DC. We were building a payload containing several scientific instruments designed to measure airglow in the upper atmosphere. The payload was to be mounted and flown on the Earth side of polar orbiting NOAA TIROS satellite.

RAIDS instrument

Spacecraft design and development is somewhat unique. There is little margin for error, so lots and lots of testing is conducted to make sure everything works. Of course, this still doesn’t uncover all problems, as many spectacular spacecraft disasters have illustrated. I got involved in the project at about the mid point in development. Many of the major components were in fabrication and the flight software was already complete. There was little in terms of ground testing software, much of this testing was done by hand. This was not a large complex instrument, but it still required as long as three hours to fully test everything.

During the winter of 1990, there was a little down time. I had this crazy idea of automating most, if not all of the testing of our instrument. Armed with a wire wrap gun, an ISA bus prototype board, and Turbo C 2.0, I started working on the ground support interface board and software. The interface board connected the ground support equipment to an IBM PC/AT with 1 MB of RAM and a 20 MB hard drive. For testing automation, I developed a testing script language and compiler/runtime environment to execute test scripts.

Due to complications beyond our control, the experiment lost its ride on the particular NOAA satellite for which it was scheduled. The instrument, ground support equipment, and the PC/AT with all the software was packed up and placed in storage. The hope was that someday, another ride would come along and the instrument might be resurrected.

Last week, after nearly 17 years, I received an email from one of the remaining scientists on the project. It appears there is an opportunity to mount the instrument onto the International Space Station. It will be flown on a Japanese H-II Transfer Vehicle and deployed on the Experiment Module Exposed Facility.

From what I was told, the instrument, ground support equipment and that old IBM PC/AT were brought out of storage and unpacked. They fired up the PC and surprisingly it booted up. The next day, when the PC was powered on again, the hard drive spun briefly, and then ground to a halt. It failed completely. Apparently, there was no possibility of recovery.

Fortunately, there were some 5 1/4 floppy disks lying around with some backups of some of the software. Oddly enough, I also kept copies of some of it also, as it was one of the first, significant projects I worked on. The floppies were still readable after all those years.

Finding a PC that could accept an ISA board was a minor challenge, and the original DOS had to be replaced with FreeDOS. Turbo C 2.01 is now freely available, which is a big help. It sounds crazy, but it just might work…

I was reviewing some old bookmarks in my browser the other day and I ran into a link to Naked objects. This time, I decided to read more about and I found myself unusually inspired. In the recent past, I have been disappointed with the pace and quality of software engineering. Certainly, there have been evolutionary improvements, but nothing that I would consider new or unique.

Naked objects is an architectural pattern for development of business applications. It was developed by Richard Pawson during the 1990s and culminated in a book published by Wiley in 2002, now available online, and Pawsons Ph. D. thesis in 2003. Richard Pawson was awarded a PhD by Trinity College, Dublin in June 2004 for his work on Naked Objects.

Pawsons thesis is an incredible read. If you have any interest in software and object-oriented systems, I strongly encourage you to read it. It traces the evolution of object oriented principles and suggests that somehow, somewhere, we went wrong. This view is supported by the creator of the venerable Model-View-Controller (MVC) design pattern, professer Trygve M. H. Reenskaug. Reenskaug was a visiting scientist at Xerox PARC in 1978-1979. Reenskaug believes that MVC has been perverted to the point of making the computer control the user, which was entirely not his intent.

In a forward contained in Pawsons thesis, Reenskaug retraces the purpose behind the MVC pattern. He laments that his original ideas were not published, which lead to the “C” or controller acting as a script controlling the user, rather than the other way around. This has lead to the belief that modern software systems are so complex that ordinary people cannot be expected to understand them. In the end, users do not develop a mental model that expresses the underlying software model. This disconnect can only serve to increase the cost of quality software, if it can be developed at all.

MVC is the staple of most user facing software systems today. It is widely heralded as the solution for user interfaces. Indeed, it is better than most other proposed solutions of the past. The real problem, as Pawson points out, is that most domain models built today are behaviorally weak. They are no more than value objects or glorifed structures found in Pascal and C programs of two decades ago. For this reason, many have argued that objects don’t work, and maybe functional programming is a better model.

Pawson promotes the use of behaviorally complete objects, objects that are more than simple containers for data. It follows that if objects do not encapsulate behavior, or related business logic, the logic will be expressed in some other place negating to whole purpose behind object orientation. Most often, the behavior is placed in a controller, which makes it difficult to reuse. Further, behaviorally weak object tend to be tightly coupled to the controller, which leads to inflexibility.

Pawson coined the term Naked Objects, which describe a pattern of usage where behaviorally complete objects are presented to user transparently. The users mental model is the domain model, there is no other logic or data to get in the way. Robert Matthews took the idea further by developing a Java framework which automatically generates an object oriented user interface by introspecting the domain model. This leads to impressive productivity gains during development. The 3.0 release of the Naked Object framework represents years of development on business systems. 3.0 automatically creates an object-oriented user interface, or viewing mechanism, along with automatic persistence using Hibernate.
Pawson and Matthews put their ideas to work in real world, large scale applications for the government of Ireland. Their framwork is available as open source. Still, some developers were not impressed with the user interface and considered it more of good start rather than a production solution. To address some of these concerns, Eitan Suez has developed a very impressive framework called jMatter. The user interface is entirely based on Swing and persistence is automatically supported through Hibernate. Following Pawson and Matthews lead, the developer need only prepare a behaviorally complete domain model, the view and persistence is automatically supported by the framework.

This is far from the end of the story. It appears that many developers have been inspired by Pawsons ideas and continue to develop their own frameworks. HTML viewing mechanisms are currently under development which has the potential to significantly affect the way in which Web applications are designed and built.

For months, I’ve been trying to track down a nagging problem with Windows XP on one machine. I can logoff and shutdown without any problems through my account, but when others logon, they can neither logoff nor shutdown. Usually, RPC PDP server doesn’t respond to the shutdown event and everything is hosed after that. My guess is the XP eventually shuts down, but that’s often 10 minutes or more, which is well past the limits of my patience.

I think I finally solved the problem. There are rumors that shutdown problems are usually due to misbehaving device drivers. I had not installed any device drivers in years, so I don’t know why that should cause trouble. More importantly, why would one account shutdown fine, but others cause trouble? Eventually, I found some posts pointing to Lexmark/Compaq inkjet driver bugs. I don’t use inkjet printers anymore (that’s a rant for another day!), so I uninstalled the driver. That seems to have done the trick, or so it seems.

This leads me to deeper questions about the internal workings of Windows XP. I can understand that misbehaving code at any level can cause trouble, but what I don’t understand is why the entire operating system halts or at least acts like it’s lost its mind. Maybe I’m missing something, but I just don’t think an operating system should fail if one driver acts badly. In the worst case, the OS should nuke that process and move on. Sure, this might break something, but what’s the alternative? Something is already broken, so waiting indefinately won’t fix the problem.

Over the years, Windows has increased in complexity. This is not entirely the fault of Microsoft. To their credit, they have done their best to maintain backward compatibility, even if it hurts. The downside is that lots of legacy code hangs around and likely never gets fixed. Who knows what will happen if it does get fixed? They just keep adding code resulting in an ever increasing code base that becomes harder and harder to maintain.
The real solution, IMHO, is to start over. I think Microsoft realizes this and has tried to start over with Longhorn. The problem is that it has taken them decades to get to this point and it’s not a simple matter to build something completely new while maintaining backward compatibility. There have been plenty of articles written about Longhorn development woes. Even with all the resources of the worlds largest software company, it’s simply too hard of a problem to solve easily.

In contrast, Apple seems to have dealt with the problem of a flagging OS by throwing it out and starting over. Clearly, it can be done. The transistion from MacOS 9 and MacOS X was by no means smooth sailing, but it was a necessary step. Without it, the Mac would probably have failed completely in the market. After the transition, MacOS has emerged as a stable, reliable operating system.

It remains to be seen if Microsoft can reinvent Windows. I mean really reinvent it, not just add features or improve the look and feel.

A friend sent me a link to an excellent article about Web 2.0, it’s written by Tim O’Reilly. If you believe Tim, Web 2.0 is more than AJAX and cool web pages. It’s all about collaboration and applications that get better as more people use it. eBay, blogs, and wikis are some examples. Read the article, it has some very interesting insights.

Have you tried Eclipse Web Standard Tools (WST)? It is really nice! It has great support for editing a number of different types of files, including XML and XSD. It has a nice SQL query tool that works with any JDBC enabled database. It even creates Web service clients with a simple right-click on a WSDL file!

Installation requires three other plugins, and Eclipse SDK proper.

Labor day was a very slow day for email, or so it seemed. I got nothing, no response from previous emails, not even spam! This was suspicious, I couldn’t believe that every spammer was on vacation.

After a quick email from a secondary account, I got this bounce:

Recipient’s mailbox is full, message returned to sender. (#5.2.2)

I checked the mail server, but there were no messages there either. Clearly, something was configured wrong. Tech support determined there were more than 6500 emails in my inbox, but not the inbox I was looking at. It turned out that the primary email server was forwarding to a secondary email server and did not delete the originals. I was reading from the secondary email server and deleting messages, but the primary was filling up.

I logged into the primary and found that 6500 emails were received between March 2006 and September. That’s about 930 emails per month or 30 emails each day. Most of it was spam, of course.

Cleaning up my primary inbox without losing anything over the past few days was not trivial. Clicking through 300+ pages of emails would take at least half an hour. I figured I could use Thunderbird mail client to pull everything off and then sort out what I wanted to keep. I started it up and it seemed to cruise along at a reasonable clip. I figured it wouldn’t take more than an hour or so, but it didn’t. I failed to account for the non-linear distribution of email sizes. I went back to the server, sorted by email size and deleted the about 20 pages of really big emails. I guess I could have just pulled down headers only, but it wasn’t clear to me that messages would have been deleted on the server.

The POP mail client was still running on a laptop in the other room. The question of concurrency came to mind. What would the POP client do if messages were deleted from the server while it was retrieving? One would think it would just pull down what it could and keep going. When I went back to check, Thunderbird had stopped and complained that a message was missing. It didn’t seem to respond well after that. I restarted Thunderbird which took about 30 minutes to finish pulling down about 6000 remaining emails.

I’m getting spam now, so things seem to be back to normal.

Next Page »