Utility-programs

In the past I have written these programs mostly for fun, but also because I wanted a small and tiny tool for one precise purpose at a time.

There are probably a dozen alternative ways to achieve the same with more elaborated software that you will easily find on the web or elsewhere. However, where I encountered these other programs, most were overloaded with functionality that I had either no use for or was too complicated to adapt to my own task at hand.

Installation instructions

All programs, presented on this page are written in C++ and use the Qt-libraries, meaning that they can run with any operating system that allows you to install these libraries and to compile the C++ code. I will now outline the procedure to build the software on your computer.

Preparation

The QMake utility is needed. It is part of the Qt Development Framework which you must install to compile any of the programs. For the later execution the shared Qt-libraries would be sufficiant, but you are not there yet. So make sure that a recent version of Qt is installed on your system (version 4.4 and newer is alright at the time of this writing).

Note: If you have already built other programs from source-code, you may be familiar with the so called autotools which serve the same purpose to create a Makefile from a provided project-configuration. QMake is just Trolltech/Nokia’s platform-independent way to do this.

Unzip the compressed program-archive. This will result in a new directory being created corresponding to the ZIP-archiv that you just expanded. Access this directory in the terminal-application that is available on your platform (a Shell in Unix-derivates, some DOS-like application in Microsoft-OSs).

The first step to create an executable program from the sources is to run the QMake-utility right there in the uncompressed project-directory. QMake will find the project-file [program].pro automatically and generate from its contents a Makefile that is already adapted to the platform that QMake is currently running on.

user@machine:~/[SOURCE_DIRECTORY][/programname]$ qmake

make the program

Provided that QMake did not report any errors, the Makefile is now created and if there are also a C++ compiler and the make-tool available, you can call make right away:

user@machine:~/[SOURCE_DIRECTORY]/[programname]$ make

The C++-compiler will be called to build the program from the source-files in the folder src or the top-level directory.

The option clean to the make command can serve to clean the project-directory from all built files, possibly in preparation for a new build:

user@machine:~/[SOURCE_DIRECTORY]/[programname]$ make clean

Installation of the binary in the file-system

This lies in your responsibility. The executable program-file may be moved to the place that is considered the right one on your operating system. Linux-users may like the use the paco package management utility for the installation, as it keeps a list of all the changes done and thus allows a clean de-installation, once it becomes necessary.

Upsslideshow

Yet another slide-show program. But this is mine. :-)

New page: Go there for a more detailed explanation of all the functionality of UpsSlideshow: http://www.uplawski.eu/technology/upsslideshow

C++/Qt Source-code upsslideshow_1.3.zip
Digital signature upsslideshow_1.3.zip.sig
GnuPG/OpenPgp-KEY 2048D/74A227D5
SHA256 hash-sum 13a492a8472effdbe8f1af5f99f4f491aac4c2f2734b4f48d4b41182f7311fff

I wanted a program to swiftly browse through a number of photographs in order to choose one or more for a particular purpose. The first idea came with my decision to publish photos from my walking tours in the Provence on a web-page.

screen shot
The interface is spartan. All user action is restricted to either the execution of a keyboard-shortcut or the selection from the context-menu. The two initial actions which you must know to use the program are:

Beartail

I do not like the name of the other program. But that amounts to only half the motivation for me to program a rolling log-file viewer.

C++/Qt source-code beartail.zip
Digital signature beartail.zip.asc
GnuPG/OpenPgp-KEY 2048D/74A227D5
SHA1 hash-sum 3aa5725dbf6ece358d00b51676471124dea07ea9

At the time, I had to look for a program which could keep track with the current activity of a web-server and the applications deployed there. I did not want the helper-tool to be just as complicated as the system under test and in the end returned to the tail command as the most appropriate solution. However, others have created overloaded GUIs for the purpose and I did not want to cede the laurels to them.

screen shot
Beartail does not offer many configuration-options, apart from the amount of data shown and the font-settings. These values can be persisted and will be restored in the next Beartail-session. The program lets you do the following:

XPMWriter

An image-to-XPM conversion tool.

C++/Qt source code xpmwriter.zip
Digital signature xpmwriter.zip.sig
GnuPG/OpenPgp-KEY 2048D/74A227D5
SHA1 hash-sum f21ea016ddda7a422cf4a069c79027e2b50acee5464776acaab4dfab0fec5e29

When I need icons or other small graphics in my C++ programs, the XPM-format is the easiest to embed, because these images consist of a simple two-dimensional byte-array, like in the following example of a small icon which contains only two colors.

/* XPM */
static char *dummy[]={
"24 24 2 1",
"# c #3a27bf",
". c #ffffff",
"........................",
"........................",
"........................",
".........#####..........",
".........######.........",
".........#######........",
".........########.......",
".........########.......",
".........#########......",
"...################.....",
"...#################....",
"...#################....",
"...#################....",
"...################.....",
".........#########......",
".........########.......",
".........########.......",
".........#######........",
".........######.........",
".........#####..........",
"........................",
"........................",
"........................",
"........................"};
will look like this: Arrow

XPMWriter is a console program, however written by use of the Qt-framework which supports a number of graphic-formats and conversions between them. The ImageMagick tools could be used to perform arbitrary conversions and an incredible amount of other work on graphic-files, while my XPMWriter does only convert images of one of the supported formats into XPM, nothing else.

The advantage of XPMWriter is in my opinion that, calling the program, you do not need to add any arguments apart from the name of the source-image.

Execute XPMWriter without arguments at a command-prompt to see the usage-information together with the list of supported image-formats:

user@machine:~/html/utilities/images$ xpmwriter
ERROR! No input file!
Usage: xpmwriter <image>
Officially supported image formats:
        bmp gif
        ico jpeg
        jpg mng
        pbm pgm
        png ppm
        svg tif
        tiff xbm
        xpm

To convert the above arrow-icon from PNG to XPM, I executed the following command:
user@machine:~/html/utilities/images/$ xpmwriter xpm_example.png
This results in the new file xpm_example.xpm being written alongside the original PNG-version. The contents of the new file is shown above.
Ω


2011, Michael Uplawski e-mail address to copy into your MUA