Some people write books or articles, I write software. Writing software is a strange mix of art, as one tries to attain a certain elegance, and engineering, since the software has to correctly perform the function that it was created for. Just as writing a book or an article allows the writer to express their creativity, writing software can be a creative process. Usually this creativity is buried when one writes software professionally, since the software belongs to one's employer. Since a lot of money is spent creating the software, it is rarely made public.
The Web is revolutionary because it allows low cost publishing. And like books, material on the Web should be protected by the first amendment, although this is something that congress does not seem to understand. One of the reasons that I set up www.bearcave.com is to publish the software that I have written on my own time, for my own enjoyment. Just as writers publish so others can enjoy their work, I am publishing my software.
I have not found software engineers to be an overly modest group. This is a trait that gets us into trouble, since we tend to overestimate our skills and underestimate the amount of difficulty and effort involved in new probjects. When I started to think about publishing my software on the Web, the following joke kept occuring to me.
How many software engineers does it take to screw in a light bulb?
Twenty one. One software engineer to actually do the work and twenty to watch and tell each other "I could do it better".
The software published here spans a number of years. For example, the DXF software and the software to build Sierpinski pyramids dates from my early days as a C++ developer. If I were to write this software again, I would do it differently. While it is humbling to look back on software written years ago, the embarrassment is a healthy sign, since it means that I have gotten better. If we don't continue to learn, we become like the computers we write software for.
In some cases the software is not as complete as I wish it were. For example, after weeks puzzling fruitlessly over POLYLINE entities in the DXF file format, I finally decided to leave the DXF conversion program alone and move on to other things. After all, I'm not getting paid for this. It's supposed to be fun.
Most of my software has been developed using the latest version of Microsoft Visual C++, on Windows NT (or 2000, or XP or what ever the minions of The Dark Lord decide to call it). When ever possible, the code is written to be platform independent (e.g., POSIX compliant). In the cases where there are Win32 or Windows NT specific calls, this will be noted in the comments for the code. In some cases the code is tested on UNIX systems as well (freeBSD or Linux).
I wrote this time series server to gain some experience with the D programming language.
The Bear Transfer Protocol program is my own version of the UNIX File Transfer Protocol program, or ftp. This program allows text and binary file transfer between UNIX systems and NT systems. The source is written to be as operating system independent as possible and compiles and runs on Solaris, BSD and Windows NT 4.0.
This software is derived from the classes used to construct BTP (above). It implements the skeleton for a TCP/IP client/server. The client and server can passed either pure commands back and forth or packets consisting of commands and data. This software is published on the same page as BTP, since it was derived from it.
This is a model (e.g., small and simple examle) application of a client/server built using the C++ Qt class library. The documentation on the Qt networking classes is pretty sparse so I hope that this will be useful to others.
The web page publishes the source code for a C++ String container. This String container allows character strings to be treated as "first class" objects to which many of the basic operators can be applied (e.g., +, +=). This String container is loosely modeled after the Rogue Wave RWCString class, from the Tools.h++ template library.
The String container is a reference counted class, which increments a reference count rather than copying data when the whole object is assigned. When a shared String is modified, the container implements copy-on-write.
The base class for the String container is an instance of a reference counted "growable" character array. This character array instance is derived from a reference counted array template that can be used to create reference counted arrays of other types (e.g., double). Classes and templates are also provided to build other reference counted objects.
This is a third generation SPAM filter that is designed for UNIX/Linux shell based email. The spam filter is designed to be fast (it is written in C++) and to recognize what I classify as SPAM as early as possible. The SPAM filter uses a parameter file which allows it to be customized without recompiling.
Just before the turn of the twenty-first century (that would be 1999) I designed and implemented a set of C++ objects for a VHDL compiler. The group I was working with had a VHDL front end and these data structures were designed for the intermediate that would be generated from processing the front end data structures. These objects were never used, so I'm publishing them here.
Most of the software I have published is either elegant (or at least I thought it was elegant when I wrote it) or is useful and interesting. The software indexed on this page is largely software that I've written once and have no interest in writing ever again. So its indexed here as much for my future reference as for its use to you, dear reader.
Thie web page publishes several C++ templates:
A growable array template, which is similar to the Standard Template Library vector template.
A template for creating static tables.
These tables are shared by all instances of a given template instance and are designed to be initialized at static constructor time. They are also growable, althought he fancy operator overloading of the growable array, above, is not supported. This code also serves as an example of the C++ syntax for templates with static variables, which is particularly convoluted.
A template to support translation between enumeration values and C strings (i.e., const char *).
Early OpenGL Software
More Adventures with Perl. This Perl script updates a build directory from another directory. I find Wall and Schwartz's book Programming Perl poorly organized and difficult to use (click here for a book review of Wall and Schwartz's book). As a result, I find examples of Perl code useful references. On the assumption that others may feel the same way, I have included yet another Perl script here.
Ian Kaplan, January 1996
Last revised: September 2003
back to home page