View code

This section describes the structure of the SERVER workspace and allows you to display the APL code for the functions it contains.

Although each page could have been set up statically, the pages that display the Dyalog code are generated on-the-fly. The function listings even contain hyperlinks to the other functions that they call or to which they refer in comments...just another example of the power of Dyalog!

To see how this is done, check out the CODEVIEW Namespace. This in itself is fairly sophisticated, because it displays the code in a FrameSet, with a GIF for the function name in the upper frame.

 

Workspace Structure

The workspace is organised in a series of namespaces which are described below together with a brief description of each of their main functions. To view the code, click on a function name. Sub-functions and utilities are not listed here, but may be accessed via hyperlinks from the main function code.


Namespace

Description

Server Namespace

The main controlling namespace. It contains the functions that handle the TCP/IP messages and execute client requests.

Codeview Namespace

Contains the functions that generate the pages to display the APL code in this workspace.

Loan Namespace

The Loan example

Driller Namespace

The Driller example

Rain Namespace

Graphics examples

Wine Namespace

Interactive graphics examples


 

SERVER Namespace
spacer

Function

Description

RUN

This function starts the web server and creates a listening TCP/IP socket ready for the first client request.

ACCEPT

 

This function accepts a new client connection. It also spawns a new thread containing a new listening socket ready for the next client connection.

RECEIVE

 

This function receives and processes a client request. It analyses the request string, splitting out the name of the application function to be run and decodes any parameters supplied by your browser. It then calls the requested application function and returns the resulting page or graphical image back to your browser. At any point in time, there may be many threads concurrently running this function and any application code it calls. In addition, there is always one other thread containing a listening socket ready to accept a new client connection.


 

CODEVIEW Namespace
spacer

Function

Description

FRAME

 

This function creates the HTML Frameset that appears in the right side of the page. This contains a "banner" frame at the top and a "contents" frame underneath it.

BANNER

 

This function creates the HTML for the "banner" frame. This consists of a bitmap background pattern, and a centred image. The image is not held on a file, but is generated on-the-fly by the IMAGE function.

IMAGE

 

This function generates a GIF image for the "banner" frame. The image consists of the Dyalog bitmap (stored on file) with the name of the function you requested alongside it.

FUNCTION

 

This function generates the HTML for the body (codeVR) of the function you requested.


 

Loan Namespace
spacer

Function

Description

RUN

 

This function processes the data entered in the Loan Example form, calculates the repayments matrix, and generates the HTML to display it. Notice that the HTML for the Form itself, together with the data you entered in its fields, is also returned in the result.


 

Driller Namespace

This namespace contains a set of data variables that describe the financial transactions for Cool Supplies Limited. Each transaction consists of a nominal code, a date, a department number and a value.

The data is first presented as a consolidated P&L account in which each number is a calculated from a particular set of transactions. Each number has a hyperlink associated with it that tells the system how that number is derived, so that the user may drill down to the next level of detail by clicking the number.

Each hyperlink identifies the function to drill down to the next level, together with the parameters that this function will need. These parameters include the department, the period, and the set of nominal codes for the sub-set of transactions from which the total was derived.

Function

Description

RUN

 

This function generates the HTML table for the top-level P&L statement. Suitable hyperlinks are attached to each of the table cells to allow the user to drill down to the next level of numbers behind these totals. Each hyperlink contains the name of the next drill-down function to run, SHOW_NC or SHOW_NC_BY_DEPT, together with information that describes how the total was derived.

SHOW_NC

 

This function breaks a total down into account items by nominal code and generates an HTML table. A hyperlink is attached to each cell that identifies the function to drill down to the next level (NC_ANALYSE) together with information that describes how the figure was derived.

SHOW_NC_BY_DEPT

This function performs a similar drill-down to SHOW_NC, but the figures are broken out by department.

NC_ANALYSE

 

This function performs the lowest level breakdown that tabulates all the individual accounting transactions that make up a nominal code/departmental total.


 

Rain Namespace
spacer

Function

Description

Fourier

Displays a graph illustrating an experimental Fourier fit

Timeseries

Displays a sample timeseries plot

Sample

Displays a set of sample charts

Climate

Displays all the rain graphs together


 

Wine Namespace
spacer

Function

Description

Piechart

Displays a sample pie chart

 

 

Dyalog Image