Samples of my code

I'm in the process of a complete site redo after upgrading to a serious server. All the time stamps were reset during the transfer. I'll reset as I find on backups but anything stamped (08-05-13) was written between 1995 and 2005. Most of it will probably bew replaced with current stuff.

Note these are samples of code written for my own use are NOT examples of code written for clients. Most of these were never released to the public so they are not as clean or as documented as code intended to maintained by others. Also as the hosting provider does not support Spring, Hibernate or JSP 2.0 on their systems there are no examples of that code here.
Still the samples below should give a pretty good feel for the style of code I generally write.
Most of the code used on my sites can be found here and java docs here
The links automatically convert to text any source file that would normally be interpreted by the server so I don't have to maintain a text version and you can view almost any file of this site. (See ViewSourceServlet below.)

JSP / Servlets

This a few files from from my web based photo album. It's still a work in progress but it gives you an idea of how I think the JSP / Servlet model should be done.
Last Updated File name Description
Updated 05-30-11 (05-30-11) BaseServlet.java Base servlet class
Updated 09-18-13 (09-18-13) AddPicData.java Servlet class for sizing and loading pictures into the album. Note normally run as command line though.
Updated 05-30-11 (05-30-11) ViewSourceServlet.java Servlet class to allow viewing of source files otherwise compiled by the server. (Used right here.)In fact you can view almost any source file for this site with this servlet to see how this site works. Obviously files with passwords in them or other sensitive data are not viewable.See the java doc for more info.

Struts

This is more of the photo album stuff but using struts.
Last Updated File name Description
Updated 09-18-13 (09-18-13) MenuDataForm.java Form class that holds the information about an album menu.
Updated 09-18-13 (09-18-13) menu.jsp JSP for viewing an album menu.
Updated 09-18-13 (09-18-13) EditMenuAction.java Action class for displaying a menu.

Java AWT and Swing

Simple time tracker I wrote.
Last Updated File name Description
Updated 08-22-13 (08-22-13) MainFrame.java Main class of a simple timesheet program using AWT and Swing.

Java Threads

Used in my home controller app.
Last Updated File name Description
Updated 05-30-11 (05-30-11) TimeCommanderPlus.java Main thread in an interface to a home controler I'm working on.
Updated 05-30-11 (05-30-11) EchoProcessor.java One of the task threads in an interface to a home controler I'm working on.

C/C++

These are part of my orginal hot list program that imported a Netscape bookmark file into a database, checked the links and then generated hot list pages of the working links plus a new bookmark file containing private bookmarks and an empty structure for new bookmarks.
The first 3 were written in the C style (no classes) but were written to use the C++ complier on AIX and some other versions of Unix. The 4th is true C++ of AIX. The last was written for the windows platform.
Last Updated File name Description
Updated 05-30-11 (05-30-11) bm2db.C Bookmarks to DB converter.
Updated 05-30-11 (05-30-11) db_io.C DB interface code.
Updated 05-30-11 (05-30-11) db_io.h Header file for above.
Updated 05-30-11 (05-30-11) gen_attrldif2.C Utility for generating test data. This one is a bit iffy since I wrote it while at IBM but since I wrote it just to make my life easier I doubt they will mind.
Updated 07-29-13 (07-29-13) bm2js.c Converts Netscape bookmark file directly into Javascript data file used by my dynamic hotlist menu (jmenu).

Javascript

This is part of my dynamic hotlist menu.
Last Updated File name Description
Updated 08-22-13 (08-22-13) mtop3.html Routines that write the jmenu menu.

Shell Script

This is one of the scripts I used to automate updating my code with the source control system back when I was at IBM.
Last Updated File name Description
Updated 05-30-11 (05-30-11) upcmvc.sh Compares local copy of source tree against version control system and generates a script for checking it changes.

perl / cgi-bin

More stuff to make tracking CVMC bugs easier.
Last Updated File name Description
Updated 05-30-11 (05-30-11) showHot.pl Script for displaying a defect report as a web page.
Updated 05-30-11 (05-30-11) showHot.sh Same as above but in korn shell instead of perl.

PHP

File from the PHP verion of the online photo album and barncam pages.
Last Updated File name Description
Updated 05-29-11 (05-29-11) index.php Script for displaying my barncam pics in time order.
Updated 09-17-11 (09-17-11) afunctions.php Subroutines used in photo album pages.
Updated 05-29-11 (05-29-11) menu.php Photo Album menu page.



This page has been viewed 2990 times