MDRSESCO – Software for the Masses
All the software described herein was designed and developed by MARK DANA ROCKMAN, over a period of years, without assistance or compensation from any person or organization. Good design makes for satisfactory results. Or you can “architect” an app and take your chances. Email: usermark at mdrsesco dot biz.
BigDigitClock displays the current time-of-day. This seems trivial, but at a radio station, with three analog clocks, that are supposed to be synchronized with a GPS time-source, but aren’t, this app fills a void. Together with the KeepClockUpdated daemon, BigDigitClock let’s announcers know when to begin speaking at the start of a live broadcast.
MERGE finds corresponding files in two directory trees and merges them into a third directory.
Some files may appear in one directory but not the other. These are sent to the output directory. Those files that appear in both directories are compared to learn which one of the two is the more recent. The more recent one is sent to the output directory.
MERGE is handy when you maintain several separate but related collections of files, organized into directories and sub-directories. It sometimes becomes convenient to combine collections through de-duplication.
CopyMaster is an app that allows you to duplicate the latest directory structures and files so they appear on two different computers at the same time. This redundancy has two advantages. First, there is a current backup copy of your important files. Second, there is convenience in being able to find all your favorite stuff on at least two different computers.
How You Work It
Map the A: drive to \\ComputerOne\C$ and the B: drive to \\ComputerTwo\C$. Then launch CopyMaster. When CopyMaster finishes doing what it does do, you’ll have two computers that sport nearly identical contents (ignoring the operating system and extra software files).
You can create a $.txt file in the C:\Users\Public\$$$DeleteMe directory that instructs CopyMaster to get rid of unwanted directories on both computers.
Suppose you have a directory that contains a florid tree of sub-directories along with files at many levels and you want to be rid of the whole mess.
Windows has a rule that says you may not delete a read-only file. This prevents you from deleting a directory that contains a read-only file.
Deltree: to the rescue. Just point Deltree at the root of the mess and it’s gone in three shakes of a lamb’s tail.
Now try doing that with the del or erase command in the ordinary Windows shell. Oh. It will do something. But it won’t do what you want.
WAVConcatX takes a collection of WAV files and concatenates them. It optionally inserts an audio separator between the files. The output is a single WAV (audio) file made from the contents of the WAV files in the aforementioned collection.
The individual WAV files can exhibit varying attributes. For example, there is the sampling rate, one channel or two channels, and sample size (8-bit, 16-bit). You choose the sampling rate and the number of channels in the output file. WAVConcatX takes care of the necessary conversions.
Downdater for Windows PC
A “downdater” is a text file comparison program. It produces from similar inputs (2 files) a differences file (1 file) that can be applied to the “A” file to produce the “B” file. Differences are denoted
The lines that follow –N are inserted after line N in file “A”. The lines that follow –N,M are inserted in place of lines N through M in file “A”.
You can compare two files with DOWN by using the following syntax:
• DOWN <name-of-file-A> <name-of-file-B> <differences-file>
You can compare files in corresponding directories with the following syntax:
• DOWN <name-of-directory-A> <name-of-directory-B> <differences-file>
When comparing directories, the various difference files are separated with a record of the form:
Note that only certain source code and symbolic files are eligible for comparison. A complete list is available if you send a stamped, self-addressed envelope to the author.
A better way to compare an old folder containing symbolic files with an updated version of the same folder involves a special call to DOWN, followed by execution of a skeleton, followed by execution of a BAT script that calls DOWN repeatedly to create several differences files rather than the single such file that otherwise is produced. The syntax of the special call is
• DOWN *<name-of-older-folder> <name-of-newer-folder> <name-of-new-differences-folder>
Notice the asterisk that comes before <name-of-older-folder. This signifies that DOWN is to produce an SSG skeleton in the new-differences-file together with an SGS file to be used with the skeleton. The skeleton, in conjunction with the stream generation statements, produces a CMD script that builds a DifferencesFolder inside the new-differences folder. Only those folder pairs that exist and exhibit differences end up in the DifferencesFolder.
Example: Run DOWN *first-directory second-directory directory-to-place-skeleton. Then CD to directory-to-place-skeleton and type RUN.BAT. This launches a lengthy DOS script that repeatedly calls DOWN to construct a DifferencesFolder, which see. As part of this mechanism, the tree structures of the first-named directories are compared and differences reported, if any. This operation requires that you have installed the Symbolic Stream Generator (SSG).
SIRASM2 takes the output of DOWN and applies it to what is called a base text file to produce an updated text file. For example, suppose the base file is
And the updated file is
Then DOWN will produce the following differences file
SIRASM2 base diff updated
reproduces the updated file given only the base file and the differences file.
IBMCHECK implements the Luhn Algorithm. It allows you to enter a credit card number and be informed whether it is valid. You can enter the number as it appears on your credit card, with spaces every four digits, press a button, and the spaces disappear. The number is copied to the Windows Clipboard for pasting into a text box on some retailer’s website. Retailer websites typically get upset when you leave the spaces in place.
SSG (Symbolic Stream Generator) is an app that compiles a program called a “skeleton” and simultaneously compiles a text file that is filled with Stream Generation Statements (SGSes). The skeleton contains the logic. The SGSes contain the data. The program creates a text file in accordance with directives in the SGSes. SSG is a handy tool when you want to generate, for example, a lengthy program structure (e.g. a case statement for incorporation within a C++ or C# app) based on a list of things. I have used it many times for that purpose. But SSG is capable of doing more complex things. For example, a commercial software publisher uses it to generate MXML, the language of Adobe Flex, to produce web apps that allow end users to enjoy a Rich Internet Experience. The SGSes describe what the page or pages are supposed to look like and the skeleton transforms the description into exactly the right MXML for the purpose. You can RTFM at http://www.mdrsesco.biz/SSGManual.htm.
CORR is the Directory Date Corrector. Ideally, Windows would ensure the timestamp applied to every directory would reflect the contents of each directory. The file inside a directory with the latest last-date/time-of-modification would be honored to have its timestamp applied to its enclosing directory or directories. So that is what CORR does. Which directories (now called Folders by marketing) get what timestamps is decided by tournament rules. CORR makes it possible to inspect the folder contents of a folder and decide which folders need further inspection because of recent updates to the files inside.
KeepClockUpdated is a service app that ensures the system clock stays accurate, with checks done for accuracy every 5 minutes. This entails a time source query every 5 minutes. In one commercial application, KeepClockUpdated is responsible for setting the clock on 24 different computers by comparing each computer's clock with a local time source; one that obtains its very accurate reading from GPS satellites. (The native Windows time setting mechanism only checks the computer maybe once per day. Its time source is a computer on the Internet.) All the magic depends on an understanding of the Network Time Protocol (NTP) that communicates via UDP on port 123. You can set the calendar and time-of-day to an inaccurate value and wait until some multiple of five minutes past the hour arrives on the clock. From the time source, KeepClockUpdated obtains the date and time and compares them with the computer's own notion of date and time. When the two are at variance, KeepClockUpdated changes the computer's clock and calendar to match. KeepClockUpdated is not appropriate to every setting. For example, you would not properly employ it where the time source is not in the same building complex as the computers that are running the app.
WINSVCFILCPY is service app that runs 24/7. Once a day, at 0300, it copies key files from their usual staging area to a backup staging area. This is done in order to mitigate the risk that the usual staging area, a Microsoft software-based mirrored pair of HDDs, may become useless as a Microsoft software-based RAID-5 cluster did in September 2013.
FileLogger monitors file changes. It displays them as they occur in real-time. It keeps a running log of changes and can copy the log to a file if you choose to do so.
Password Generator generates random passwords. They are, by default, a mixture of numerals, upper- and lower-case letters. You specify the length you want up to 40 characters. You can choose to have only upper-case or only lower-case letters. A non-alphanumeric character can be randomly inserted if you choose to do so. The generated password is put on the Windows Clipboard for ease of placement in a textbox on a web page. These passwords are hard for hackers to guess and that makes them extraordinarily secure.
File Mover Service (FMS)
FMS is responsible for copying TRV files in folders P1 through P9 from the production computer to the backup computer. This is in progress all the time, with throttling imposed to limit impact on Telephone Reader, except during the graveyard shift. However, see note, below, regarding limitations imposed by Telephone Reader. A given file is copied under the condition that the source file is newer than the destination file or when there is no destination file. For example, suppose \\DIALIN1\P1\1547.TRV is to be copied to \\DIALIN2\P1\1547.TRV . It follows that copying will occur only when \\DIALIN2\P1\1547.TRV does not already exist and when \\DIALIN2\P1\1547.TRV time-of-last-write indicates that it is older than \\DIALIN1\P1\1547.TRV .
You can change the direction of copying with the application NamedPipesClient. Simply connect, then type from-1-to-2 or from-2-to-1 in the Send Message area of the dialog box and press the Send button. When you switch the phone lines from DIALIN1 to DIALIN2 (or the reverse), you should remember to change the direction of copying. NamedPipesClient must be run with elevated privileges.
Limitations Imposed by Telephone Reader
Telephone Reader detects anomalies all the time and responds to them idiosyncratically. It reboots the computer upon detection of all anomalies.
Among things that are classified as anomalies are cases where a file Telephone Reader wants access to is “locked” (that’s the formal terminology: locked) by a process not recognized to be part of Telephone Reader.
FMS is designed to take non-exclusive access rights upon opening of any file that it wants to copy to an opposite machine. This was done in hopes that Telephone Reader would cooperate and accept that an unrelated process might have a file open for reading that Telephone Reader wants access to for reading or (horror!) writing.
Evidently, and that means evidence has surfaced, Telephone Reader refuses to play nice with other processes. It expects to have perpetual exclusive access rights to all the files that it touches. Those who dare touch any of its files (audio files, database files) risk crashing Telephone Reader and the entire computer.
The best available workaround is to copy files from Telephone Reader’s domain at times during which Telephone Reader is least busy. This is defined to be the period starting at 2200 hours and extending into the next day until just before 0400. This period is termed Prime Time. Should Telephone Reader crash the computer during Prime Time, it is less likely to inconvenience those who use Telephone Reader to browse publications and those who record audio files for publication via Telephone Reader.
Once it was disclosed by Telephone Reader’s developers that Telephone Reader is extremely sensitive to external process interference with its functions, changes were applied to FMS that avoid copying files until the clock reads 2200-2259. This most assuredly improved the situation. However, there was one nasty incident in which Telephone Reader rebooted the system on account of a “locked” file outside the aforementioned period. It turns out FMS was not copying files, but it was probing files to discover those files that may require copying. This entails querying file metadata and that apparently is also sufficient to “lock” the file. And, as we have seen, Telephone Reader is of the opinion that a locked file is a bad thing and must be punished with a reboot.
The latest “fix” is to arrange for FMS to touch none of Telephone Reader’s files except during Prime Time. Obviously, Telephone Reader was not designed to operate with a production computer and a hot standby computer.
Individual Computer Housekeeping Service (ICHS)
ICHS is responsible for performing three functions:
1. Midnight Movers
2. Sunday Movers
3. Richmond Download
Midnight Movers happens at 29 minutes past midnight every night. It prepares for the upcoming business day by clearing today’s stories out of their today’s slots and moving them to yesterday’s slots.
Sunday Movers happens at 28 minutes past one o’clock on Sunday morning. It prepares for the upcoming business week by clearing files from their daily slots and putting them into a weekly backup location.
Richmond Download implements the File Transfer Protocol so as to acquire copies of files 1501.TRV through 1505.TRV, which are voice files from the Richmond Times-Dispatch. This download occurs daily at five minutes past noon.
Original P1 Daily Copy To New P5
Original P6 Daily Copy To New P6
Per the script that formerly was launched on Sundays:
del from P1 4801-4899",
del from P1 9601-9699",
del from P1 9701-9799",
copy p1 2901-2999 to p1 4801-4899",sb
copy p1 2501-2599 to p1 9601-9699",sb
copy p1 2401-2499 to p1 9701-9799",sb
move p1 2901-2999 to p1 4801-4899",
move p1 2501-2599 to p1 9601-9699",
move p1 2401-2499 to p1 9701-9799",
The indicated files are deleted from the P1 directory, copied from the P1 directory, or relocated away from the P1 directory, in the indicated order. The sb notation indicates that copying is directed to the SundayBackup directory.
Simple Backup/Restore makes backup files from collections of directories. You choose which directories to backup. The backup file sports the filename extension .SB. The content of each backed up file is internally associated with its name and its time of last modification. Simple Backup/Restore was developed in response an incident where a commercial file backup app failed when the computer, which it was backing up, failed catastrophically. The partially readable backup file had to be recovered through the purchase of additional commercially available software that was capable of sifting through a complex, partially corrupted database. The central concept of System Backup is simplicity. A partially completed backup file remains readable. All the work completed up to the point of failure, if any, is fully recoverable without resort to extraordinary means.
The Metropolitan Washington Ear, a radio reading service for the blind, offers audio streaming via the Internet. They moved to their own, dedicated building and infrastructure in 2008. Their website was not appropriately updated to cater to different audio streaming software. This web page was developed by MARK DANA ROCKMAN to allow listeners to hear the audio stream: something that was impossible before I created this page and hosted it on my corporate web site.
A Complete List of Rockman's Text Editor Commands
The Rockman Text Editor accepts commands from the keyboard or from a file. The syntax of the shell command is
ed [name-of-file-to-be-edited [name-of-command-stream]]
You can omit both command line arguments, in which case commands can establish what is to be edited, and commands shall originate at the keyboard. You must provide name-of-file-to-be-edited when you want to provide name-of-command-stream.
Commands comprise three parts: 1) the name of the command, 2) option, 3) arguments. Example:
contains the r command, the option 11, and the argument PAIJ. Only the name of the command is mandatory.
The editor maintains the file that is being edited in area called the memory file. The content of the memory file can be created from scratch or it may originate in a file in a file system on a device. The primarily purpose of the Text Editor is to support your efforts to make changes to the memory file. Eventually, once you are done making changes, the memory file is copied to a file in a file system on a device for long-term storage.
The editor is either in EDIT mode or in INPUT mode. You can switch between modes by entering a blank line. In EDIT mode, you can instruct the editor with commands. In INPUT mode, non-blank lines are successively added to the memory file.
The editor pulls all of the file's text into memory. In memory is where all the editing occurs. At the end of your editing session, it is your choice whether to save any changes that you have made or to discard the changes. Type EXIT to save the changes. Type OMIT to discard them.
While you are editing, keep in mind that there is always a current line, which you can see by typing PRINT. Navigation throughout the memory file is by line number, which may be absolute (e.g. go to line 5) or relative (e.g. go 5 lines down from here).
The text editor is one of several Rockman's Tools that you may find useful. The Symbolic Stream Generator allows you to write programs that generate text files based on simple, structured data. The Downdater allows you to see the differences between text files presented in -n and -n,m notation. SIRASM2 allows you to apply changes in -n and -n,m notation to a text file in order to obtain a new text file.
Write to email@example.com.
The add command brings in at the current location additional lines from either of two sources. If you name a text file then the full file is added at the current point in the file being edited. If you don't name a file then lines from the most recent COPY or DCOPY command are added at the same place.
The append command relocates the current edit point to after the last line in the file being edited. The editor then goes into INSERT mode.
The begin command works with the COPY and DCOPY commands to mark the starting line of a copy operation.
The bt command displays the operating system version, the computer name, the time of last system reboot (also called system restart), and the duration of current system uptime. Additional information about the computing environment is provided in the edit file. For example, OSArchitecture 64-bit is an environmental factoid that may interest you.
The cd command changes the current working directory to the named directory.
The change command replaces one occurrence of a string with something else. The argument contains the pattern /old-string/new-string/ where the slash is some convenient delimiting character, old-string is a substring to be replaced, and new-string is what the replacement shall be.
The changeall command is identical to the change command except that all occurrences of old-string on the current line are changed.
The changewholefile command is identical to the changeall command except that the entire file being edited is targeted for change.
The climit command limits the range of columns affected by any of the forms of the change command. Specify the left and right column numbers separated by a comma. Example: cli 4,6
The close command causes the editor to write the lines in the memory file to disk and then causes the editor to terminate.
The commands command lists the cannonical names of all the editor's commands in sorted order.
The copy command creates a store that contains the lines between the begin marker and the current line.
The deleteafter command finds a match on the current line, erases the match, and everything to the right of the match.
The dcopy command is identical to the copy command except that the lines that are sent to the store are deleted.
The delete command removes one or more lines from the file being edited starting with the current line. You can specify the number of lines to delete (e.g. DELETE 5). The default number is 1.
The dhold command saves the current line to a special store (named the "hold" buffer) and deletes the line from the file being edited. You can resurrect the line with the dup command.
The dnext command deletes the current line and sets the current line to the line that follows it.
The dse command performs a Directory Structure Examination. You can detect structural differences between similar directories.
The dup command inserts one or more lines at the current position. The lines inserted originate in the hold buffer. You can specify the number of lines to duplicate (e.g. DUPLICATE 5). The default number is 1.
The eject command causes the operating system to flush the buffers of a removable device and, perhaps, to physically eject the device. The format is ej drive-letter.
The elname command displays the name of the file that is being edited.
The exit command causes the editor to write the lines in the memory file to disk and then causes the editor to terminate.
The f1 command changes routes.rb in a Ruby on Rails application file so that the application uses named routes.
The find command searches the lines following the current line for a matching pattern. In the pattern, space characters match any character at the same relative position on a targeted line. You can use find to locate based on columnar position. When a tab character is defined (see tab command), you can use them as part of the pattern. For example, suppose LMJ appears in columns 11, 12, and 13 respectively. With the tab character set to semi-colon and tab positions set to 11, 21, and 39, the command
matches on the first line following the current line that contains LMJ in columns 11, 12, and 13. The command option specifies the desired number of match occurrences. The default is 1.
The flist command creates in the current file a complete listing (with headings) of the symbolic files of the named directory.
The goto command relocates the current position to the line whose number is given. A synonym for goto is simply the line number.
The head command is identical in function to goto 1.
The hold command saves the content of the current line to a special place inside the editor called the "hold" buffer. You can resurrect the line with the DUP command.
The hw command sets a horizontal window on the file being edited. The window applies to a specified range of columns. For display purposes only, columns outside the window do not appear. Suppose you want to see columns 11 through 21. You enter hw 11 21.
The ibefore command is identical to the insert command except that the line is inserted before the current line.
The insert command inserts a new line after the current line.
The last command relocates the current position to the last line in the file.
The lgoff command causes the editor to exit without saving the current file and causes the Windows logon session to terminate.
The locate command is similar to the find command except that there is no columnar bias in the pattern. Searching begins with the first line after the current line and is not case sensitive.
The ls command lists the directories and file in the current working directory.
The mdl command maps a drive letter to a share (i.e. a shared directory (also known as a shared folder)). The argument is of the form <drive-letter> <share>. Example: mdl B \\fserv\wpdocsb
The next command relocates the current position to the next line in the file.
The o command is similar to the print command except that printing starts with the line following the current line.
The omit command causes the editor to exit without saving the memory file to disk.
The open command begin a new editing session by loading the named file's lines into memory. The named file must pre-exist.
The opennew command is similar to the open command except that the file need not pre-exist and, if it does, the content of the file is truncated.
The print command prints the current line and the next n minus one lines that follow it, where n is the number stated in the command. Example:
means print the current line and the 4 lines that follow it.
The putquotesaround command revises the lines of the current file so that each line is quoted (surrounded by double-quotes) and preceeded by the characters TAG followed by a space. Should a line contain a double-quote character, putting quotes around a quote character would be ambiguous. You can provide a substitute for such characters as in PQA `. In this example, the ` character replaces all occurrences of ". The default substitution is \".
The pwoff command causes the editor to exit without saving the current file and causes Windows to power off the computer.
The rb command causes the editor to exit without saving the current file and causes Windows to reboot (also known as "restart") the computer.
The retype command is similar to the insert command except that the line affected is the current line. The option of the retype command, when present, specifies the column at which the first character of the argument is to be placed. For example,
leaves alone the content of columns 1 through 10 and puts the argument into the line starting at column 11.
The reverse command reverses the order of the lines in the file. For example, the file 1 2 3 becomes 3 2 1. Apply the command twice and 3 2 1 becomes 1 2 3.
The ro command takes a directory argument and marks as read-only all the files the directory (and its directories and their directories). The opposite operation is handled by the uro command.
The scale command prints a column scale extending from column 1 through column 80.
The sort command reorders the lines in the memory file so that they appear alphabetically.
The tab command allows you to establish a tab character and several column stops. This is handy when entering columnar data. For example, if you enter the command
tab ; 11 21 39
then enter the command
i ;LMJ;X11,EDIT$;. Open the EDIT$ packet
you will create a new line with the various segments left-aligned at the indicated column stops.
The td command displays the date and time last written of the file being edited.
The toc command erases the current file in memory and creates a new file in memory that enumerates the directories and files in the named directory.
The top command sets the current line to zero.
The touch command updates the time-of-last-write of the argument file to match the current time. Should the file not exist, it is created with zero content.
The up command sets the current line to the line immediately above (numbered one less than) the current line.
The uro command removes the read-only attribute from all the files in the argument directory (and the directories it contains and the directories they contain).
The vw command sets a vertical window in which appears a subset of lines of the file being edited. If an n-line subset of the file is in the vertical window then the lines are numbered 1 to n and changes that you may apply affect only the lines in the window. You set the vertical window by stating the starting and ending line numbers as in vw 2 4 which saves the entire file to a hidden location and commences editing of the subset. You merge the subset back into the main file by entering vw without arguments.
The write command transfers the lines in memory to the named disk file and terminates the editor.
Nutrients to Foods (NTF)
Anybody can look up the nutrients contained within foodstuffs. But what if you know what nutrients you want? What foods should you eat to get those nutrients? The answer is provided by NTF.
There are two version of SHUTDOWN. Both of them work. The second one fully exercises the Windows API for logging off and for rebooting and powering off the computer.
This app is much handier than pointing and clicking around Windows’ own user interface for doing what SHUTDOWN does.