Useful Programs and Functions

This section describes programs and functions available for general use. These functions are in addition to those supplied as part of the PostgreSQL system. Typically, one would use one of these programs as part of a special process not part of the regular Babase system. One would use one of these functions in a SQL - SELECT statement, a query, a report, or perhaps in a special purpose program, or a new Babase system program you might want to write. For more detailed information on the operation of these programs and functions see the documentation written into the program header of the program source code.

Documentation on the use of these programs can be found in the Protocol for Data Management: Amboseli Baboon Project and in this document. This document also contains the coding standards and design philosophy of the system, which should be followed by anyone modifying or adding programs to this directory.

Note

There are a large number of procedures and functions which are part of Babase but are not intended to be used by the end-user. These functions either begin with the underscore (_) character, or end in _func.[273]

Functions

Logout: Logout From Babase Custom Programs

The logout program logs the user out of the Babase web based collection of programs.

Note

Babase consists of many programs, only some of which are web based programs written specifically for Babase. The logout program only controls access to those programs written specifically for Babase, other off the shelf programs have their own logout mechanisms.

Note

Logout from Babase is automatic after a period of inactivity.[274]

Wwwdiff: World Wide Web based Difference program

The wwwdiff program compares two text files. It can be found on the Babase Web site.

Among other uses, this program provides a useful data validation mechanism. To validate data, have two different individuals enter the data and compare the results with the wwwdiff program. It is unlikely that both individuals will make identical errors and so almost all data transcription errors should be caught using this method.

Tip

The program uploads the two files to be compared. For security reasons most web browsers will always clear the names of the uploaded files once they have been uploaded. This makes it difficult to repeatedly upload the same or similar files, as when re-comparing two files after correcting errors. The situation is not as bad as it might sound because browsers will often provide a browse button and keep track of the directory last accessed, removing the need to re-navigate to the location of the data files. But it is still awkward to have to repeatedly point and click.

One solution is to use the browser's reload button. This will repeat the upload and comparison of the two files, but using the new, corrected, file content. A second, less desirable possibility is to have the have the pathnames of the files handy in a text document and cut and paste them as needed. A third possibility might be to use the browser's back button, but browsers will often clear the file upload information in this case in the same fashion they would with password information.

The wwwdiff program provides 4 comparison methods:

Tabular by Word

Useful where the data consists of individual words aligned as rows and columns of data. Compares the files contents on a word-by-word basis and displays the entire content of both files as a table with differences marked.

Caution

When one file contains whitespace[275] that is not in the other, this comparison method shows extra cells in the output. Words are separated by whitespace but because there is only extra whitespace the cells are empty. Thus, when one file contains more whitespace than the other those rows will contain more columns. Normally the data in the extra cells would be color coded to inform as to whence they came, but because the cells are empty there is nothing to color code. The operator must compare the files by hand to determine which file contains the extra whitespace.

By Word

Useful where the data consists of words and there are relatively few changes or where paragraphs have been refilled and words have moved from line to line. Compares the file contents on a word-by-word basis displaying the entire content of both files as plain text.

By Line

Useful when there is a large amount of textual data. Compares the file contents on a line-by-line basis and displays only a small amount of context surrounding those portions of the text which differ between the files.

By File

Useful when comparing non-text files. Reports the location (by line and byte offset from the beginning of the files) of the first difference found.

Overview of Data Analysis Procedures

These procedures provide a mechanism for manually updating the analyzed data which Babase maintains. As a rule the analyzed data are kept up-to-date automatically by Babase (the exceptions are the CYCSTATS and the REPSTATS tables), but at times it may be necessary to reconstruct the analyzed data. One such occasion would be the discovery of a bug in the Babase code which keeps the analyzed data up-to-date.

The procedures tend to come in pairs, one of which updates an entire table and the other of which updates only the data related to a specific Sname.

Data Analysis Procedures



[273] Those that end in _func are the procedures used by the triggers for data validation.

[274] Currently 1 hour.

[275] Spaces, tabs, and whatever other characters that can't been seen.


Page generated: 2016-07-22T23:08:49-04:00.