ASPL Manual v 1.00
© 2024 by SetSphere.COM


11-1

   ASPL by Examples

When you start ASPL by issuing the bare command aspl at the UNIX prompt, the interpreter starts by loading the default workspace TRIVIAL. However the product is shipped with several sample workspaces that can be loaded to show the power and usability of ASPL in processing various grouped data. These workspaces represent various grouping classes that vary and covering topics as such: players tossing dice, UNIX filesystem directories, UNIX administrative data, random polygons and geometric data, streaming oscillating data, etc.

The metadata of a workspace is defined in the ASPL Element Grouping Class Container. That is each workspace has its metadata described in the ASPL Element Grouping Class Container, and you will use the attributes command at the ASPL prompt to view the worskspace attributes metadata. You can also issue display the attributes of a workspace on the UNIX prompt, for example the command
asplcmd 'load WS1;attributes'
displays the attributes of the worspace WS1.

To display the description of the workspace WS1, at the UNIX prompt you issue the command
asplcmd 'load WS1;description'

■ List of Sample Workspaces

This chapter shows some examples for using the ASPL interpreter using various workspaces, namely the following workspaces: RANDONEBITMIX DICERS JMXJAR JMXPARTITION JDBCINFORMIX TXJAR WS1 TESTGGDIR SIGNALS POLY2PLANES POLY3PLANES POLY2CLOUDS POLY3CLOUDS MONSOCKET BAYS12MON WASCLOUD .

These workspaces are available in the WORKSPACE1 folder. To view the location of the workspaces folder add the option -verbose when starting ASPL. To list the workspaces you issue wls command at the ASPL prompt.

The following is a list of references detailing the description of each workspace.

see SECTION 11.2.1 [RANDOM GROUPS WITH ONE BIT]

see SECTION 11.3.1 [TOSSING DICE SIMULATION]

see SECTION 11.4.1 [Comparing Java JMX TX Jar Files]

see SECTION 11.5.1 [Partitioning Java JMX Jar Files]

see SECTION 11.6.1 [Comparing JDBC INFORMIX JAR Files]

see SECTION 11.7.1 [Comparing Java TX Jar Files]

see SECTION 11.8.1 [Group Operations on UNIX Filesystem]

see SECTION 11.9.1 [Glob Directories on UNIX Systems]

see SECTION 11.10.1 [TIE OSCILATOR SIGNALS TO ATTRIBUTES]

see SECTION 11.11.1 [RANDOM POLYGONS IN TWO 2D PLANES]

see SECTION 11.12.1 [RANDOM POLYGONS IN THREE 2D PLANES]

see SECTION 11.13.1 [RANDOM POLYGONS ON TWO SPHERES]

see SECTION 11.14.1 [RANDOM POLYGONS ON THREE SPHERES]

see SECTION 11.15.1 [MONITORING UNIX SOCKET STATUS]

see SECTION 11.16.1 [WATER LEVEL BETWEEN BAY1 AND BAY2]

see SECTION 11.17.1 [MINING WEBSPHERE JMV IN A CLOUD]

 

● RANDOM GROUPS WITH ONE BIT

WORKSPACE RANDONEBITMIX DESCRIPTION:

Creating random groups, subgroups, and elements in ASPL grouping space. This workspace is used to introduce ASPL in the chapter "Getting To Known Your ASPL Interpreter". Make three random groups (gcount), label them starting at index 1, each of the group can have two subgroups (dcount) randomly indexed between [2,3], and two subsubgroups (scount) indexed between [2,3] in which one element (sfcount) is created whose index between [2,3], and one element (fcount) whose index between [2,3] is added to each random group. In particular the named labels are a randomly mix of names, and it is possible to use the same label name for either a subgroup or an element.

see SECTION 11.2.1 [RANDOM GROUPS WITH ONE BIT]

 

● TOSSING DICE SIMULATION

WORKSPACE DICERS DESCRIPTION:

Retrying the outcome of a die increases the certainty of the outcome, hence the enthropy also decreases as the certainty increases. The following ASPL variables have been assigned the result of three players throwing a pair of dice on a craptable. p123 is assigned the set results of ggdiceS() for the three players throwing the pair of dice 900 times. t123 the same as p123 except that die1 is retried 5 times to realize a face with 5 dots, and die2 is retried 5 times to realize a face with 3 dots. u123 the same as p123 except that die1 is retried 7 times to realize a face with 5 dots, and die2 is retried 7 times to realize a face with 3 dots.

see SECTION 11.3.1 [TOSSING DICE SIMULATION]

 

● Comparing Java JMX TX Jar Files

WORKSPACE JMXJAR DESCRIPTION:

This workspace is used to show how to use ASPL set operators to compare Java JMX TX JDBC JAR files. The JAR files have been extracted in their corresponding directories relative to /tmp directory. In the following the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.4.1 [Comparing Java JMX TX Jar Files]

 

● Partitioning Java JMX Jar Files

WORKSPACE JMXPARTITION DESCRIPTION:

This workspace is used to show how to use ASPL set operators to compare Java JMX JAR files by using the partitioning set operators. In the tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.5.1 [Partitioning Java JMX Jar Files]

 

● Comparing JDBC INFORMIX JAR Files

WORKSPACE JDBCINFORMIX DESCRIPTION:

This is workspace is used to show how to use ASPL set operators to compare Java JDBC INFORMIX JAR files by using the partitioning set operators. In the tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.6.1 [Comparing JDBC INFORMIX JAR Files]

 

● Comparing Java TX Jar Files

WORKSPACE TXJAR DESCRIPTION:

This is workspace is used to show how to use ASPL set operators to compare Java Transaction TX JAR files. In the tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.7.1 [Comparing Java TX Jar Files]

 

● Group Operations on UNIX Filesystem

WORKSPACE WS1 DESCRIPTION:

This is workspace is used to show how to use ASPL set operators to compare files on your UNIX filesystem. In the tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.8.1 [Group Operations on UNIX Filesystem]

 

● Glob Directories on UNIX Systems

WORKSPACE TESTGGDIR DESCRIPTION:

This is workspace is used to show how to glob directories on the UNIX systems using ASPL global grouping function ggdir() and how to compare directories, subdirectories, and files. In the following the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.9.1 [Glob Directories on UNIX Systems]

 

● TIE OSCILATOR SIGNALS TO ATTRIBUTES

WORKSPACE SIGNALS DESCRIPTION:

This workspace demonstrates how you can tie oscillating signals to ASPL attributes.

see SECTION 11.10.1 [TIE OSCILATOR SIGNALS TO ATTRIBUTES]

 

● RANDOM POLYGONS IN TWO 2D PLANES

WORKSPACE POLY2PLANES DESCRIPTION:

This workspace shows how to use ASPL operators to do contextual set operations on geometric data. Worspaces that have a name suffixed with GEO causes ASPL to switch it f& and f\ to do contextual set intersection and set difference according to contextual routines, here they are the GEOmetric routines. Read the ASPL book on how to create GEO workspaces. In this tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.11.1 [RANDOM POLYGONS IN TWO 2D PLANES]

 

● RANDOM POLYGONS IN THREE 2D PLANES

WORKSPACE POLY3PLANES DESCRIPTION:

This workspace shows how to use ASPL operators to do contextual set operations on geometric data. Worspaces that have a name suffixed with GEO causes ASPL to switch its f& and f\ to do contextual set intersection and set difference according to contextual routines, here are the GEOmetric routines put at work. In this example the random polygons in three 2D planes are being intersected and are being differentiated. Read the ASPL book on how to create GEO workspaces. In this tutorial the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.12.1 [RANDOM POLYGONS IN THREE 2D PLANES]

 

● RANDOM POLYGONS ON TWO SPHERES

WORKSPACE POLY2CLOUDS DESCRIPTION:

This workspace shows how to use ASPL operators to do contextual set operations on geometric data. Worspaces that have a name suffixed with GEO causes ASPL to switch its f& and f\ operators to do contextual set intersection and set difference according to contextual routines, here they are the GEOmetric routines. This workspace shows the power of ASPL set operators when performing operations on geometric data set. In this example we will call the GG function ggRPO2Sov() to create 170 polygons, namely triangles, on two spheres. The result is assigned to G12_170, and the labeling of the first sphere is G1, and of the second sphere is G2. We will split the resulting set variable G12_170 into two set variables G1 and G2: G1 contains the first sphere polygons, and G2 contains the second sphere polygons. We will call f& on G1 and G2 to get their intersects, and assign the result to G12. We will call f\ on G1 and G2 to get their difference, and assign the result to G1_2. We will call f\ on G2 and G1 to get their difference, and assign the result to G2_1. The merge operation shown below is not required with latest version of ASPL. The merge of a variable into itself will just add a GADg to the variable, but if it is not needed then spare the memory. Finally we will dump the GADg of the variables so that we can plot them with drawgad command. Read the ASPL book on how to create GEO workspaces. In this tutorial the 'aspl>' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.13.1 [RANDOM POLYGONS ON TWO SPHERES]

 

● RANDOM POLYGONS ON THREE SPHERES

WORKSPACE POLY3CLOUDS DESCRIPTION:

This workspace shows how to use ASPL operators to do contextual set operations on geometric data. Worspaces that have a name suffixed with GEO causes ASPL to switch it f& and f\ to do contextual set intersection and set difference according to contextual routines, here they are the GEOmetric routines. This workspace shows the power of ASPL set operators when performing operations on geometric data set. In this example we will call the GG function ggRPO3Sov() to create 100 polygons, namely triangles, on three spheres. The result is assigned to S123_100, and the labeling of the spheres are S1, S2, and S3. We will split the resulting set variable S123_100 into three set variables S1, S2, and S3. We will call f& on S1 and S2 to get their intersects, and the result is pushed on the stack. We will call f& on S1 and S3 to get their intersects, and the result is pushed on the stack. We will call f& on S1 and S3 to get their intersects, and the result is pushed on the stack. We will call f& on S1 S2 S3 to get their intersects, and the result is pushed on the stack. We will pop the stack and assign the results to S123, S23, S13, S12, S23 respectively. Finally we will dump the GADg of the variables so that we can plot them with drawgad command. Read the ASPL book on how to create GEO workspaces. In this tutorial the 'aspl>' refers to the ASPL prompt, and the '#' refers to the shell prompt.

see SECTION 11.14.1 [RANDOM POLYGONS ON THREE SPHERES]

 

● MONITORING UNIX SOCKET STATUS

WORKSPACE MONSOCKET DESCRIPTION:

This workspace shows how to monitor the state changes in the UNIX socket. This MONSOCKET workspace has the element grouping class SOCK. In this example a program is started with a socket listening on port 12345. Locate the process number of the program that opened the socket, eg. in here it is program whose process is 32036. The program process is treated as a group label, and the socket as an element of the group whose attributes are the socket attributes. We will create a variable sok12345, then we will interrogate the variable sok12345 seventeen times with a delay of one second. In the meantime on the system we start a client program to connect to opened socket of the process 32036. The client program writes to the opened socket. The changes in the state of the socket are being captured by ASPL in the variable sok12345. That is ASPL monitors the process number and update the ASPL variable sok12345.

see SECTION 11.15.1 [MONITORING UNIX SOCKET STATUS]

 

● WATER LEVEL BETWEEN BAY1 AND BAY2

WORKSPACE BAYS12MON DESCRIPTION:

This example shows how you can tie attributes to sensors and have an attribute with anonymous function to process the data collected by these tied attributes. In what follows, the ASPL commands are these that start with aspl> and the UNIX shell commands start with hash #

see SECTION 11.16.1 [WATER LEVEL BETWEEN BAY1 AND BAY2]

 

● MINING WEBSPHERE JMV IN A CLOUD

WORKSPACE WASCLOUD DESCRIPTION:

ASPL mining the IBM WebSphere Application servers JVMs and JARs processes during run time. Use ASPL in cloud computing environment where applications are being heterogeneously distributed: being clustered, or having repetitive configuration, or being bootstrapped horizontally with multiple virtual machines. Comparing the configuration of distributed systems has been problematic, however it can be realized with the use of the ASPL interpreter that objectify the configuration data and compare it as datasets.

see SECTION 11.17.1 [MINING WEBSPHERE JMV IN A CLOUD]