cjungmann.github.io

Personal Website

View on GitHub

Chuck Jungmann’s GitHub Page

When I started using git, I was attracted to the ability to review or even return to previous code commits. I felt safer exploring possibilities when I could easily undo unproductive ideas. I also liked having a remote backup of my work.

It became my habit to put all new work on github.com. As my collection of GitHub projects has grown, I realized that it can also serve as an introduction to my programming abilities and interests.

GitHub Projects

Schema Server

source

This C++ program, schema.fcgi, is an attempt to make an efficient, secure, and self-sufficient solution for delivering database-driven web applications. MySQL procedures are the templates of all interactions, the procedure parameters become HTML forms and the procedure query results become XML documents to be transformed on the client using XSLT.

schema.fcgi provides the following features:

In the interest of efficiency, preventing memory leaks and fragmentation, and to see if I could do it, I decided early on that my code would exclusively use stack memory. Older code is a little awkward as I worked out the kinks with this strategy, but I refined my methods as I gained experience.

Schema Framework

source

A client-side interface for SchemaServer. Until recently, this project also hosted the schema.fcgi SchemaServer program, and it still hosts a large amount of the documentation for schema.fcgi.

The fundamental operating principle of this framework is to use XSL transformations to convert XML from schema.fcgi into web pages. It takes advantage of XSLT’s mature language definition and the browsers’ native implementation of transformation code.

Apache File Handler Guide

source

I wrote this guide after I finally succeeded in getting Apache to use my Schema Server object to process requests to files that had an .srm extension.

Lambda Expressions Presentation

source

Having extensively used lambda expressions in Javascript, I also used lambda functions in the Schema Server. I agreed to make a presentation on this topic for a new C/C++ Meetup group in the Twin Cities. Along with the slideshow, I performed several experiments to confirm my assumptions about how closures work, particularly with respect to variable lifetimes and visibility.

Web Scraping for Weighted Names Lists

namegen source
scrape source

While testing Schema Framework with a very large dataset, very poor performance reminded me that I had neglected keyed element access in the XSL stylesheets. Wanting an arbitrarily large life-like dataset, I decided to write a program to generate it for me.

This program collects surnames and boys and girls names from internet sources, using frequency values to make weighted lists of names. The weighted lists are used to create families or student registration lists with a somewhat realistic distribution of first and last names. No attempt is made to match names according to suggested cultural norms, that is Jose is no more likely to be assigned to a Lopez family than a Johansen family.

XSL-Import

source

The built-in XSLT processors of some browsers are unable to reconcile stylesheets. Although the XML processor of the Schema Framework is prepared to consolidate the files, having to handle imports can interfere with caching.

Both methods (Framework and xsl-import) recursively open import files and, after discarding duplicate match attributes, insert the contents of the import file into the importing file. Neither method works with xsl:apply-imports because the resulting file no longer contains any xsl:import elements.

libmysqlcb

source

With an eye toward future development of the Schema Server, I wanted to learn about shared-object libraries in order to break the large project into smaller self-contained pieces for improved readability and maintainability. Although not currently a complete replacement for the MySQL code in the Schema Server, this library provides most of that functionality, and is successful in the goal of working as a dynamically-loaded library.

The project includes a small C++ source file that demonstrates how to use the library.

gensfw to Generate Schema Framework Scripts

gensfw source
bashmysql source
yaddemo source

The command, gensfw is a CI command that uses mysql to collect schema information from MySQL tables to generate SRM and SQL scripts. The mission of this program is to ease the tedious process of writing the standard procedure and response mode scripts, matching datatypes of the tables with the parameters of the procedures, and creating scripts that follow standard Schema Framework practices.

bashmysql runs a query and makes its results and result schemas available in environment arrays that are used by a callback function.

Because the setup and result of YAD dialogs, relying heavily on command line arrays, made my customary XSLT methods too cumbersome, I decided that this project would also serve as experiment for learning BASH.

Along the way, I discovered some unexpected language “features” that suggested new programming approaches. yaddemo contains several experiments I conducted to confirm my suspicions, especially about unusual variable scoping.

pxml2ods for Creating Spreadsheet Files from XML.

source

This project is an improved and standalone implementation of the export feature of the Schema Server. It seems that the ODS file format resides in the sweet-spot between universal readability, effortless importing, and ease of coding. In fact, ODS is much more complicated to create this format than the universally-accepted CVS, but is favored because of its unambiguous presentation of rows and columns.

Hacker Rank Competition Solutions

source

I played with this site for a few weeks, trying my hand at pure C code to solve some programming challenges. I wanted to test my unusual preference for stack-exclusive memory allocation against some memory- intensive programs.