Source Code

Jump to: navigation, search


Java Sudoku Puzzle Solver

I wrote a Java program to solve Sudoku puzzles. It uses a recursive brute-force algorithm to try all possible combinations.

I wrote a Java/Swing GUI front end for my Java Sudoku puzzle solver. Its currently fairly crude.

This Java program shows how to use the above programs.

Concentric Circles Layout

I wrote this Java/Swing class, for use in conjunction with the JGraph toolkit, to layout vertices in concentric circles. Nodes are placed within concentric circles based on the number of neighbors they connect to -- most to least are placed inner to outer. Note that these two Java classes are coded to work with JGraph version 5. Porting to Jgraph version 6 (known now as JGraphX) is underway.

Webcal Datafile Conversion

We currently use a web-based calendar program called Webcal written by Michael Arndt. We wanted to sync our calendar with newer programs like Lookout (Outlook) and with our iPods/iPhones which all provide varying degrees of support for RFC 2445 (iCalendar).

I wrote the following Perl script to take the Webcal data file and generate an iCal data file. The following script parses iCal data files to check them for syntax errors. The scripts require perl's DateTime package as well as the iCal::Parser package.

Fetch Image from TRENDnet TV-IP110W, D-Link, Foscam, and Axis Neteye 2120 Webcams

I wrote this perl script to quickly fetch the current image from a TRENDNet TV-IP110W webcam. iPhones and other devices (that do not run Java) cannot view the live feed from this webcam. Consequently, I use this script to fetch live images and place them on my own webserver. Then, I can view those images with my iPhone. Alternatively, if the webcam is placed on an internal network (not reachable from the Internet), you can use this script to fetch images and put them on an Internet-accessible webserver.

New version of the perl script also fetches images from D-Link DSC-920 and Axis Neteye 2120 webcams as well as adds a date/time-stamp to the image.

Packaging Scripts

Packaging software is a royal pain. Each platform has its own, different set of conventions, practices, and formats. Most are seemingly well-documented but anything that would deviate ever so slightly from the default is often not covered and my software always seems to fall into the latter category. Thus, I've posted my packaging scripts in order to add to the body of examples.

For Windows, we use NSIS (Nullsoft Scriptable Install System) to generate graphical click-through installers. For Linux, we generate an RPM file, and for Solaris (x86 and Sparc), we generate a package (pkg).

Random Platform-Specific Notes:

  • For Windows, we use the NSIS (Nullsoft Scriptable Install System). Its free, open source, and generates nice looking fully functional installers.
  • On Windows, we also use the HM NIS Editor tool for mangling the scripts and invoking the NSIS compiler. Its also free, open source, and easy to use.
  • On Windows, we create the graphical installer and uninstallers. For the Cartographer agent, our installer includes several dialogs and registry mods.
  • On Windows, our Cartographer GUI checks to see if Java is installed and asks the user to continue if Java is not installed.
  • Or Linux, our Cartographer GUI RPM simply installs and removes the files but makes no other system mods nor checks to see if Java is installed.
  • On Linux, our spec files do not build source code nor bundle it when constructing RPM file. We do not build/bundle source code since all our packages (e.g. Windows, Linux, Solaris) include binaries for all supported platforms (remember, I said we always seem to deviate from the conventions). Also, we do not bundle our source code since we are dealing with several different license agreements.
  • On Linux, we generate a 32-bit package but that package is installed on 32-bit and 64-bit systems.
  • For all platforms, we pluck our distributables out of a single release sub-directory and then mangle the packages accordingly.
Personal tools