Skip to main content

Simplifying things by complicating them

I have an application to modify which wants to go from a hard-wired Wyse VT-100B-clone character terminal emulation to a GUI interface with all stops in between, plus wants to go from spitting escape-sequences at a specific model of dot-matrix impact printer to spitting A4 pages out of name-your-printer, plus wants to go from unindexed flat (fixed-with binary records) data storage to an SQL backend (probably PostgreSQL to start with).

How do I do this, step by step, so I can continue to validate the functionality of the application at each step?

Feature Set One: wrap all of the terminal I/O in a standard set of functions; then figure out how many pixels wide/high a bog-standard Courier (fixed-width) character is at a standard scale (12 point?), multiply the text coordinates by those factors in the top-level code, then (when addressing a text screen) divide the resulting coordinates by the same factors before cramming the result down ncurses’ throat.

Feature Set Two: wrap all of the printer I/O in another standard set of functions which open a text file, write the print output to that (maybe with embellishments such as bolding), then hand the result to a HTML-to-PDF application (like htmldoc) which then spools the output to a printer or publishes it where an EMail application can attach it.

Feature Set Three: wrap all of the data storage or access code in a set of simple functions which expect & return a fixed-sized memory structure regardless of the underlying storage format. Amongst other things, copying a flock of flat data files into an SQL server’s collection of TABLEs would be a short iterative loop.

Comments

Popular posts from this blog

new life for an old (FTX) PSU, improved life for one human

the LEDs on this 5m strip happen to emit light centred on a red that does unexpectedly helpful things to (and surprisingly deeply within) a human routinely exposed to it. it has been soldered to a Molex connector, plugged into a TFX power supply from a (retired: the MoBo is cactus) Small Form Factor PC, the assorted PSU connectors (and loose end from the strip) have been taped over. the LED strip cost $10.24 including postage, the rest cost $0, the PSU is running at 12½% of capacity, consumes less power than a laptop plug-pack despite running a fan. trial runs begin today.

every-application-is-part-of-a-toolkit at work

I have a LibreOffice Impress slideshow that I wish to turn into a narrated video. 1. export the slideshow as PNG images (if that is partially broken — as at now — at higher resolutions, Export Directly as PDF then use ‘pdftoppm’ (from the poppler-utils package) to do the same). 2. write a small C program (63 lines including comments) to display those images one at a time, writing a config file entry for Imagination (default transition: ‘cross fade’) based on when the image-viewer application (‘display,’ from the GraphicsMagick suite) is closed on each one; run that, read each image aloud, then close each image in turn. 3. run ‘Imagination’ over the config file to produce a silent MP4 video with the correct timings. 4. run ‘Audacity’ to record speech while using ‘SMPlayer’ to display the silent video, then export that recording as a WAV file. 4a. optionally, use ‘TiMIDIty’ to convert a non-copyright-encumbered MIDI tune to WAV, then import that and blend it with the speech (as a quiet b...

boundaries

pushing the actual boundaries of the physical (not extremes, the boundaries themselves) can often remove barriers not otherwise perceived. one can then often resolve an issue itself, rather than merely stonewalling at the physical consequences of the issue.