Active Examples
An "active example" is a set of applets that combine to
give an interactive example of some concept.
The example is interactive since the user is able to enter
some inputs and observe the result.
The simplest form is a single input area where the user
enters say, an integer, and an output area where the
results of some calculation, such as all the divisors
of the integer, are displayed. More complex forms can
have several inputs and outputs.
Here are a number of active examples for the
IDA project.
An initial example is given in each active example as it is loaded.
Users can then try different values as they wish.
- Simple active examples
- Multiples
displays some multiples of an integer.
- Divisors
displays all the (positive) integer divisors of an integer.
- Primes
displays the first n primes.
- More complex active examples
- Greatest Common Divisor
displays the positive integer divisors of each of two integers
and their greatest common divisor.
- Least Common Multiple
displays some multiples of each of two integers,
some common multiples of the two integers and their
least common multiple.
These tend to load slowly since the initial example can't be done
until all the applets required are loaded.
The greatest common divisor page has five applets and the least common multiple
page has six!
Applet Communication Failures
Sending applets try for 30 seconds to establish communications
with a receiving applet. If communications can't be established,
the message "Applet error!" appears in the data input box of the
sending applet. If a sending applet has several receivers, it can
still send data to any receivers it can communicate with, but the
"Applet error!" message will remain.
If you have problems, check that the
name of each receiving applet is specified correctly as the
value of the appropriate applet parameter of the sending applet
and that the receiving applets are named accordingly.
The Java console will display more information about any
communication failures.
If the names are correct, then this appears to be a browser
problem, since 30 seconds should be ample time to load all
the applets on a page. Reloading the page with Shift-Reload may help.
Common Parameters
All these active examples have the following applet parameters
- example Value to use for the example shown when the page loads
- inputwidth Width of input field (in columns, but it's not clear
how wide a "column" is relative to the width of a character)
- font Name of font (eg. TimesRoman, Helvetica, Dialog)
- fontsize Size of font (eg. 18 for an 18 point font)
- fontstyle Style of font (eg. bold, italic, plain, bolditalic)
- bgcolor Background color in RGB form (eg. FFFFFF for white)
- fgcolor Foreground color in RGB form (eg. 000000 for black)
There are default values provided for all of these parameters, usually
18 point plain TimesRoman in black on white, with an initial example of 30
and an input field width of 20 columns.
Special Parameters
The following applet parameters can be used with some of the applets.
- rows is the number of rows to show when the output is
displayed in a scroll box (ie. primes, divisors)
- cols is the number of columns to show when the output is
displayed in a scroll box (ie. primes, divisors)
- limit is the number of multiples of an integer to display
in the applets that show multiples of an integer
- gcd is the abbreviation (gcd, ggd, etc) to use for
"greatest common divisor"
- lcm is the abbreviation (lcm, kgv, etc) to use for
"least common multiple"
- sendto for simple examples (one receiver) is the name of the
receiving applet
- sender identifies the sending applet (values 0, 1, ...)
when a receving applet has multiple senders
- There are also parameters XXXrcv
to specify the names of the receiving
applets in the more complex applets.
Comments? Thanks.