Huckerts Page for Programmers
As a professional programmer I have concentrated on the following topics:
- Graphics Programming: compression, basic algorithms
- Document formats: parsers and generators for CCITT G3/G4, PDF,
ASN/1, RTF
- Programs to handle written natural language: hyphenation, spell
checkers, dictionary maintenance, parsers for NL, automatic translation
- Editors for text and programs
- Functional programming in several assemblers, C, Pascal, COBOL, PL/I
- OO technology in C++, C# and JAVA
- C++ technology using the framework wxWidgets.
I wrote my program HUMidi with wxWidgets and a lot of own C++ classes
- XML technology (XML parsers SAX and DOM, JDOM, XSLT, XML schema etc.)
- Scripting (makefiles, deployment scripts etc.) with ant
- Communication problems including network programming and firmware
for communication interface hardware
- Articles and books on programming languages and text processing
- System programming under UNIX and Windows
- IT architecture consulting
- Database design with Oracle, DB2, Mysql, Informix, PL/SQL
- Music software. I sell a professional C++ source code library.
For details see my HUMIdi page.
- IT related music theory. You will find here (in German) some theoretical
thoughts about music notation format elaborated in cooperation with my brother K.Huckert.
You find here my professional profile in
German or
in
French. The profile includes a list of all projects I was involved in.
Sample code and Articles
The sample code that you may download is generally portable between
UNIX (including LINUX) and Windows. If an application runs only under
a specific operating system than this is noted. Please look at the source
code headers to see what compiling options you must set
on the respective operating system.
PDF and Image Graphics:
- An article (in PDF) that explains the essentials of PDF:
pdfart.pdf.
- Demo code that generates a PDF file: pdfg.cpp
The test document generated by the sample program is
here.
- A sample program txtpdf.cpp that
converts text files (some HTML like tags may be included)
to PDF. The program also generates headers and footers and
breaks the input text into pages. The code contains PDF classes written
in C++
-
A command line program for Windows 32Bit called
tiff2pdf
that converts TIFF images into
PDF files that may be viewed with Adobes Acrobat Reader.
The program handles single files as well as complete directories
containing TIFF images.
I sold the source
code for this program to several commercial clients - this is why you
don't find the source code here. Ask me for the commercial conditions.
Ask me also for UNIX versions. The program has
been called "the fasted image to PDF converter on the market".
The exe-file offered for download has no restrictions except that my
copyright is inserted in the header line.
RTF:
- A C++ class called HU_RTF that I wrote to generate RTF
documents on-the-fly. RTF (stands for Rich Text Format) is the
Microsoft exchange format for word processors.
The class includes code for essential text formatting, for
meta information, for frames, for tables and images.
The generated RTF documents
can be used with Microsoft WORD or other RTF capable word processors
(Improved version 12-2005).
Portable multi threaded TCP server
New
This is a sophisticated
multi threaded server
that allows multiple simultaneous connections on the same listen port. It can be compiled and run
under Windows and Linux. As shown in this
architecture picture it uses three or more threads: a main thread
creating all other threads, an
accept thread that detects incoming connections and reports them
to the main command queue. And one or
more client threads handling the communication with the clients and invoking
business logic functions for the transmitted data. These threads communicate
via simple queues. The separate
accept thread resolves the usual problem of blocking
the main thread. The zip file contains the documented C++ code for all involved classes and a make file.
The business logic is very simple and must be replaced by more appropriate methods. The design
is not full OO - I like it that way.
Sockets (TCP/IP):
- Three C++ classes for TCP/IP access called
CLIENT_SOCKET, SERVER_SOCKET and MSGSOCKET
- two sample
applications called tcpcl4 and tcpsrv4 implementing a
simple file transfer (for a more serious file transfer
see hu_ftp below).
The server is a multithreaded server running both
under Linux and Windows. Under Linux POSIX threads are used. Client and server
use the classes mentioned above.
- a simple URL fetch program (a loader for HTML Pages) called urlfetch that uses the above classes
- make-files for the sample applications (for MS C++ with Windows)
- a simple file transfer program
called hu_ftp acting as both a server and
a client. This is a command line application i.e. it has no
graphical interface. The program uses my classes
SRVSOCKET, MSGSOCKET and CLIENT_SOCKET in a newer version. I designed
this very simple program as I was tired to be forced to install
a (usually large) ftp server. In contrast to LINUX the normal WINDOWS
versions don't have ftp daemons (they normally have a ftp client).
You can use this program with a direct network cable between two computers
(a "crossover cable") or in a larger network.
The archive contains also a short user manual. Important note: the protocol
is not identical with the one used in UNIX ftp.
Database and ODBC:
- a C++ class called HU_ODBC for ODBC access to databases
- a set of related auxiliary classes (among them a string class and
a class implementing a double linked list - I avoid STL whenever possible)
- a sample application called sql_odbc that accepts SQL statements
from a file or from the command line and executes them
- HUCursorDemo: a sample
application written in C#. This sample program (GUI plus business logic)
demonstrates how large cursor sets can be handled in a program design that
is slightly more complex than the usual "vanilla" cursor handling samples. Features
parallel threads for visualisation and DB operation. Contains the complete
C# source code and a PDF article
(at the moment in German only) entitled "Handling large cursor sets in database
clients with C#" (in German: "Bewältigung großer Treffermengen in
Datenbankclients mit C#") explaining the basic architecture of this
approach that has successfully been used with several million hit records.
- HuOdbc GUI
This is a simple user interface (see this screen dump)
written in C++ based on the
wxWidgets framework using my own ODBC classes.
It offers a users friendly grid control to show the results of a SQL query. The
query results can be converted to PDF using some of my own PDF classes. The
ZIP file contains all necessary source code classes (GUI, PDF, ODBC etc.)
to build the executable, a Make file and also an executable.
wxWidgets and a C++ compiler (I use always Digital Mars C++) must be installed. This
is certainly not a replacement for huge tools like TOAD but it works fine for many
daily tasks. It should work with any ODBC data source and every database product that
has an ODBC driver.
New
- Password generation in PHP The scripts in this ZIP file
generate encrypted passwords from cleartext passwords. The first version uses a file
as input, the second script reads and fills a database table. The database is accessed via ODBC.
The details are explained in the commented PHP files.
- Using the C-API to SQLite. This sample program in C/C++ demonstrates some
essential API calls to access SQLite databases. Illustrates how to connect to a database,
how to drop and create tables, how to insert records and how to retriev them.
Runs under Linux and with little or no changes also under Windows.
New
A context free parser for natural languages
This is based on very old code that I wrote around the early 80s. The first
C compiler I used then was Ron Cains "Small C" for 8080-based processors.
The program is totally command-line oriented - no fancy graphics! Here is a
description in PDF
(by the way generated via the program txtpdf mentioned above).
Features include:
- exe file and source code (Standard ANSI C) contained. The main component
hupars.c is very short (not more than 70KB code) and very fast.
- Uses an external grammar. The notation for the rules ressembles Backus-Naur
notation (or classical Chomsky normal form) enhanced by "complex notation" to cope for congruence phenomena
usually found in many indo-european languages.
- Can be used for many languages
- Offers a simple morphological component (endings only). A more powerful
morphological component will soon be presented here.
- A medium size German grammar and two simpler sample grammars (English and
French) are included.
- I include some utility functions like a syntax checker (syncheck.c),
a sort-and-merge program (HUWbsort.c) and a tokenizer for written texts (scanner.c).
- The dictionary maintenance program presented below can be used to
prepare the dictionaries
A dictionary maintenance program:
This may to be used in context with my old context free
parser for natural languages (see above). It can probably used
also in other contexts (linguistics):
- pure Windows program dictmant.exe and dictmant.cpp (the source: uses pure Windows SDK, nor MFC nor any other class library)
- a make file dictmant.mak for Microsoft C++, a definition file, a ressource file
- surrounding files: an ini file, a sample dictionary (German)
Design von Echtzeitanwendungen (in German)
In this article I describe patterns for building real time applications. The patterns are explained in a large sample program written in C++ for Windows.
I have written real time applications since more than 30 years and still
continue writing such applications. This is something like the summary of my experiences with own real time
applications and with foreign code that I had to support or review. The companion zip file contains
the complete source code in C++,
a Make file and two helper applications.
Miscellaneous Applications:
a task scheduler: a command line application that allows the start of applications at
specific times under Windows NT or Windows 95/98. The tasks to be started can be defined
in an configuraton file. This is a simplified replacement for UNIX crontab. I wrote
this application because I had problems with the at command under Windows NT.
serialcomm: a simple file transfer over serial lines for
Windows 32 Bit: this can be used to transfer file from one
computer to another. Note: the software is not prepared to use
modems- a direct line must be between the two computers
Code Snippets:
I collect here small programs I wrote in order to get familiar with
specific technical problems. These code snippets are normally very short - they
concentrate on the essence of the problems. They may contain code that I
found elsewhere on the internet. Note that my snippets do not answer all questions
related with the given problem: if you look into the code you will see that
very often open questions still exist!
Waitable timers: This program
demonstrates the use of waitable timers
in cooperation with callback routines. Context: Microsoft
Windows 32/64 Bit, C++,
system programming. This technique is used in my MIDI interpreter HUMidi.
Exception handling in Windows and Linux
(in German, German title: "Ausnahmebehandlung in C++ , Windows und Linux",
contains 4 larger sample programs): discusses the
standard and non standard ways of exeption handling
in C++. Tries to distinguish expected and non expected exceptions. Tries also
to find an answer to the question: what to do with exceptions in code that you
didn't write?
New
Application singletons under Linux. How can
I be sure to have only one running instance of an application? I was not
very satisfied with the aproaches I found on the Internet and wrote
therefor my own solution in C++. This simple
approach uses the exclusive lock capability of the fcntl() call
under Linux. The
zip file includes a simple main() method illustrating
the use of my class
FILE_Mutex. Note that this works for processes - not threads nor
other objects that should show singleton behaviour.
JAVA samples. Shows simple sample code for
the most frequent application classes: IO, exceptions, string handling, GUI (Swing),
collections, inheritance (derivation) and XML. I use this sample code if
I have to write JAVA programs again after longer projects in C++ or PLSQL or other
programming languages when I simply forgot the basic JAVA techniques.
Copyrights
I reserve the copyright for commercial use to me. Please don't use
this code in commercial contexts.