Entering numerical data: a suggested standard.
William Overington
Copyright 2002 William Overington
Saturday 2 February 2002
In July 2001 I started a new thread in the discussion forum at http://forum.mhp.org entitled "Entering numerical data: a suggested standard.". The thread contained no other items until January 2002, when I added another posting to the thread. Subsequently, I added a number of other postings. As it happened, no one else posted to that thread.
I thought that it might be interesting to add a transcript of those postings into this sequence of documents. All but the first posting in the thread took place from Monday to Friday in the last full week of January 2002.
The postings are the text that appeared, except that I have corrected the spelling of register, procedure and eighths in one place each.
2001/07/30 07:39
I write to suggest the following as a standard for
entering numerical data into a program using a hand held infra-red
control device.
2002/01/21 19:15
Further to the above posting, I have now devised a
comprehensive system for loading information into calculator
programs using only the twenty buttons of the minimum set of input
events.
2002/01/22 07:59
In the interests of encouraging research and
programming experiments, here are a few more sequences.
2002/01/23 07:43
The sequences support two separate graphics systems,
though they could be intermixed if so desired.
2002/01/23 08:00
An interesting aspect of the sequences is that the
contents of the registers that are entered with these sequences may
be any of a number of different mathematical forms provided that the
Java calculator program accepts them. For example, a simple
calculator would only accept ordinary numbers. However, the
sequences provide facilities for entering complex numbers,
quaternions, vectors and matrices, including matrices of complex
numbers.
2002/01/23 12:11
Here is an additional sequence that may be of interest
in relation to entering numerical data into a Java calculator
program.
2002/01/24 18:39
I have been adding some longer commands into the
system and am posting some of them here as they illustrate an
important aspect of the design of the sequences.
2002/01/25 08:04
In using these sequences for entering numerical data
and commands into a Java calculator program, it will be important
that there is good machine to end user communication so that at each
stage an end user of such a Java calculator program will be able to
navigate straightforwardly through the program.
Copyright 2002 William Overington
This file is accessible as follows.
Scenario:
An end user is being
invited to enter numerical data into a program using a hand held
infra-red control device.
Standard:
VK_COLORED_KEY_2
(often yellow in colour) is used to enter a minus sign when the
numerical value is negative.
VK_COLORED_KEY_3 (often blue in
colour} is used to enter a decimal point when the numerical data
requires a decimal point.
Reasoning:
The entering of
numerical data into a program may require an end user to enter a
negative sign and may require an end user to enter a decimal point.
As there are no specific keys within the minimum set of user
input events for these facilities, I feel that it would be better to
have a widespread generally known about standard for entering a
minus sign and a decimal point rather than for programmers to need
to devise their own local standard for a particular program whenever
the need arises. End users will benefit as programs involving
entering a minus sign and a decimal point will have a standard way
of working to which end users could become accustomed.
William Overington
30 July 2001
The system does not specify any particular
calculator design, the system simply provides a standardized set of
button push sequences so that an end user may enter such of the set
that are recognized by any particular Java calculator.
The
Java calculator may be a stand alone calculator program or a pop-up
calculator within a larger program.
The Java calculator may
be a simple arithmetic calculator or a calculator with mathematical
functions as well. A calculator with a graphical display can be
used. A programmable calculator can be used.
Most codes are
produced by a sequence of either two or three button pushes. The
first button push of a sequence is either VK_COLORED_KEY_0 (which
might be red) or VK_COLORED_KEY_1 (which might be green).
The sequences are devised such that no sequence has two
successive characters identical to each other. Also, the digits
other than 0 are only used as the final digit of a sequence: though,
although most sequences end in a digit character, a few sequences
end in other characters such as left or right.
Here are some
examples, with the word red used to designate VK_COLORED_KEY_0, the
word green used to designate VK_COLORED_KEY_1, the word yellow used
to designate VK_COLORED_KEY_2 and the word blue used to designate
VK_COLORED_KEY_3.
For arithmetic the following are
designated.
red 1 add
red 2 subtract
red 3 multiply
red 4 divide
red 5 equals
For mathematical
functions, the following, amongst others, are designated.
green 1 sine
green 2 cosine
green 3 tangent
green 4 value of pi
green 5 exponential
green 6 natural
logarithm
green 7 sinh
green 8 cosh
green 9 tanh
Four registers and unlimited memory are supported. The
registers are a, b, c, d. There are codes for manipulating register
content, such as the following.
red 0 1 a=b
red 0 2 b=a
red 0 3 swap a and b
Focus on the screen can be
designated for data entry if that is the way that the particular
Java calculator is designed to work.
For example, red yellow
1 gives the a register the focus and red yellow 2 gives the b
register the focus.
Here are a few further example sequences
in order to give an idea of the comprehensiveness of the system.
green 0 1 the arcsine function
green 0 4 the
arctangent2 function
green 0 6 the base 10 logarithm
green left 2 Bessel function of the second kind
red
blue 3 start to define macro 3
red blue 0 end of defining a
macro
red teletext 5 in a macro, define label 5
green blue 3 run macro 3
green yellow 1 move the pen
without drawing on the graphics screen using the contents of the a
and b registers as data
green yellow 2 draw a line on the
graphics screen using the contents of the a and b registers as data
green yellow 3 choose the pen colour using the contents of
the a register as the colour number
William Overington
21 January 2002
red
9 clear a,b,c,d
red left get from memory
red right store
to memory
red 0 4 a=c
red 0 5 c=a
red 0 6 b=c
red 0 7 c=b
red 0 8 swap a and c
red 0 9 swap b and c
William Overington
22 January 2002
One of the
graphics systems supported is a simple graphics system that is
specified with some of the codes that begin with the two button
pushes green yellow: it can be called "green yellow graphics". The
other graphics system that is supported is the eutodraw system that
I developed for 1456 object code. It is described in detail in
documents indexed in the
http://www.users.globalnet.co.uk/~ngo/14560000.htm document. Two
documents near the start describe the basics of the eutodraw system.
Various other eutodraw commands are described in later documents.
The eutodraw system started for just drawing simple graphics, such
as lines and several basic shapes, but gradually got bigger and can
now draw such items as stars and regular polygons as built in shapes
that can be customized by numerical parameters.
The codes
for the green yellow graphics system are as follows.
green
yellow 0 Clear the graphics screen.
green yellow 1 Move the
pen without drawing on the graphics screen using the contents of the
a and b registers as data.
green yellow 2 Draw a line on the
graphics screen using the contents of the a and b registers as data.
green yellow 3 Choose the pen colour using the contents of
the a register to give the colour number. The colours are up to the
individual programmer, though the colour set in the document
http://www.users.globalnet.co.uk/~ngo/ast01300.htm is available for
use and if programmers used that set it would assist standardization
and also have the advantage of those colours that can do so having
the same numerical codes as the well know resistor colour code of
electronics. That is, colours are from 0 to 13 for standardized
colours and then there are colours 14 and 15 as well if people
choose to add them in.
green yellow 4 Draw a cencharacter
located by the present pen position, the shape of the particular
cencharacter being determined by the contents of the a register
green yellow 5 Draw the string from the text box starting at
the present pen position.
green yellow 6 Set the text size
that is to be used, based upon a number that is contained in the a
register. If this command is not used, a default text size is to be
provided so that use of green yellow 5 will work properly.
The sequence to set the focus to the text box is as follows.
red yellow 8 The text box gets the focus.
The word
cencharacter is a word that I have used for many years. It was the
name of a procedure call in the hardcopy plotter graphics package
for the Elliott 803 mainframe computer upon which I first used
computer graphics.
A cencharacter is one of those small
graphics drawn around a point on a scientific graph so that its
position can be clearly noticed. There is a circle, a square, a
triangle and so on. I remember that cencharacter(4) was a butterfly
style design made up of four straight lines, two of which passed
through the data point itself, whereas the circle, square and
triangle did not actually connect with the data point itself.
The sequences to support the eutodraw system are as follows.
green up 0 eutodraw $Z
green up 1 eutodraw $P
green
up 2 eutodraw $X
green up 3 eutodraw $Y
green up 4 eutodraw
$C
green up 5 eutodraw $M
green up 6 eutodraw $N
green
up 7 eutodraw $F
green up 8 eutodraw $E
green up 9 eutodraw
$Q
green up red eutodraw $r
green up green eutodraw $g
green up yellow eutodraw $c
green up blue eutodraw $b
Thus by using integers and the above commands in a suitably
programmed Java calculator program, graphics can be drawn using the
twenty push buttons of the minimum set of input events of the
DVB-MHP specification.
William Overington
23 January
2002
The various numerical types are achieved using just
three sequences. These are as follows.
red 6 field separator
red 7 column separator
red 8 row separator
In order to enter a complex number such as 1.2 -3.4i into a
Java calculator that will accept complex numbers, one would use the
following.
1 blue 2 red 6 yellow 3 blue 4
In order
to enter a two by two matrix which has a first row that contains 1 2
and a second row that contains 3 4 one would enter the following.
1 red 7 2 red 8 3 red 7 4
A quaternion would be
entered using three red 6 sequences between four numbers.
William Overington
23 January 2002
green red 0 The E code used for entering very large
and very small numbers.
William Overington
23
January 2002
green left
green 1 re the real part of a complex number
green left
green 2 im the imaginary part of a complex number, the result is
real
green left green 3 complex conjugate
green left
green 4 modulus of a complex number
These commands are
specifically for complex numbers and are four push button pushes in
length.
For addition of complex numbers one simply uses red
1 with two complex numbers and to find the exponential of a complex
number one simply enters green 5 just as one would for finding the
exponential of a real number, as this sequence system is simply a
method of sending information from an end user into a Java program
using the minimum set of input events of the DVB-MHP specification
and, if the Java program has the facilities to deal with complex
numbers, the Java program needs to recognise whether it is dealing
with a real number or a complex number and process the numerical
data accordingly.
It is only where a function involving a
complex number is something entirely different from what is done
with a real number that an additional sequence needs to be added for
that function. The more unusual the function, the more button pushes
are likely to be needed in order to signal its use to a Java program
by an end user.
William Overington
24 January 2002
I therefore
suggest that the Java calculator program could have drawn upon its
display area a number of buttons, square, or perhaps landscape
format rectangular, with rounded corners. These buttons, perhaps
"sequence buttons" is a good name, would just be a display feature,
not in any way active in the manner that buttons on a web page can
be active. A sequence button would be drawn as square, or perhaps
landscape format rectangular, with rounded corners, perhaps drawn so
as to look raised, and would have a centred horizontal line across
about seven eighths of the width of the sequence button. In the upper
half of the sequence button would be a description of the button's
effect in mathematical terms, such as a + symbol or the word cos or
whatever is appropriate, and in the lower half would be the sequence
of button pushes needed to use that sequence button. The sequence of
button pushes could include coloured filled squares, arrows and
digits and also a T character. In addition a pair of dots .. could
be used to indicate a cascading menu of buttons. For example, a
particular Java calculator could have sequence buttons for digits
and for + - * / = and for sine, cosine etc and a sequence button
labelled f(x) .. above the horizontal line of the sequence button
and green filled square 0 .. below the horizontal line of the
sequence button. Upon an end user entering green 0 the Java
calculator program would draw a new set of sequence buttons as a
cascading menu of sequence buttons showing functions such as green 0
1 arcsine and green 0 2 arccosine and so on.
The Enter key
could be used at any time to cancel the sequence already started to
be entered.
A sequence button could be greyed out once a
sequence started to be entered and the particular sequence button
could not be reached from the sequence already started.
William Overington
25 January 2002