WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Flume math app BETA version 0.9.0  (Read 6028 times)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Flume math app BETA version 0.9.0
« on: November 07, 2010, 09:21:15 AM »
I have bumped the version number up to 0.9.0 and re-releasing it as BETA software.  If approved by the TinyCore repository maintainer, this version may be soon available in binary form.  For now, you can still build it from source if you are sufficiently motivated.  ;)

Until it appears on the official repository, you can post bug reports and suggestions to this thread.  Later on, perhaps we can start a thread in the TCE subforums.  I'll post the user help info below.  Hope you like it.
--
Mike Lockmoore



Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flume math app BETA version 0.9.0
« Reply #1 on: November 07, 2010, 09:22:58 AM »
Flume

BETA Version 0.9.0, November 2010

Flume is a fast, light utilitarian math environment. It can be used from the command-line for simple calculations, or in GUI form as a desktop calculator or a one-column spreadsheet. Calculations are performed with your CPU's floating point hardware, so the range and precision of numbers are somewhat limited, but suitable for most uses. Flume uses the FLTK user interface library, which makes it is especially efficient on TinyCore Linux. The source code of Flume is released under the GNU license. See http://www.gnu.org/licenses/ for more details.

CAUTION: Flume 0.9.0 is BETA SOFTWARE. While due care was taken during development, it has not been tested exhaustively. Mathematical calculations in Flume are done within the precision and limitations of IEEE-standardized floating-point computations. Flume does NOT have arbitrarily high precision (like some math packages), and is subject to round-off errors and other issues. DO NOT use Flume BETA as your sole mathematics tool for your P.h. D dissertation, preparing tax filings, or unlocking the secrets of an ancient script. Even when Flume BETA is used in more mundane applications, it is likely at some point to produce an inaccurate result, lose your work, steal your dog, tell an embarrassing story at your wedding, or otherwise do something that disappoints you. Please help make Flume better by reporting bugs and offering suggestions. Suggestions are especially welcome that come with specific test cases that reproduce errors or code changes that can be easily integrated. Thanks!

Command-Line Options

--f filename              load content of file "filename" into work area upon startup
--d              angles expressed as degrees
--r              angles expressed as radians (default)
--t N              "terseness", with N = 0(very verbose) to 5 (very terse)
--v              print name and version on command-line
Command-Line Mode

If you invoke Flume from the command line and provide it a mathematical expression after any command-line options, Flume will immediately try to calculate and print the result and then exit without opening the graphical user interface (GUI). For example, if you enter:
    $ flume 6*7[Enter]
you will see the result:
    6 * 7 = 42
Command-line mode will only parse and calculate one result, so some features of Flume, such as references, will not work properly. If your expression contains any characters that are special for the command-line shell, such as parentheses, please enclose your expression in double-quotes:
    $ flume "1.0+(2.0*2.0)"[Enter]
    1.0 + (2.0 * 2.0) = 5.0

Flume supports the following number formats:
    Decimal integer:     7
    Real number:         7.0
    Scientific notation: 7.0e0
    Hexadecimal integer: 0x07 or 0X07
    Binary integer:      0`111 or 0b111 or 0B111
Note the first form of binary notation uses a back-quote, not single-quote! Negative numbers should be prefaced with a - (dash) with no space before the numerals.

Flume will parse your entries and try to provide grouping parentheses to resolve any ambiguity in the order of operations. For example, if you enter the expression
    2*3+4^2
You will see flume re-write the expression as:
    (2 * 3) + (4 ^ 2)
If this grouping is not what you intended, please edit the expression with the exact grouping you need.

Comments may be added to the end of an expression a semi-colon:
    sin(pi / 4.0) ; sine of 45 degrees

All expressions in the main workspace area are recalculated each time you press the Enter key, so you may easily edit and update multiple results as in spreadsheet applications. Comments will be preserved, but any text between the equal symbol and the first semi-colon will be replaced by new results.

It is acceptable to enter a single number by itself as an expression, which is simply evaluated as the entered value (identity principle). This form is useful for changeable input values used in a later calculation. For example:
    5.0 = 5.0 ; width, inches
    7.0 = 7.0 ; length, inches
    3.0 = 3.0 ; height, inches
    p[3] * p[2] * p[1] = 105.0 ; volume, cubic inches
Operators, Functions, and Constants

The spelling of operators, functions, and constants is generally case-insensitive with exceptions noted below.

The following infix operators are used between two numbers or sub-expressions:
    +           add
    -           subtract
    *           multiply
    x or X      multiply, or part of hex number if directly preceded by zero
    of          multiply (e.g. "1/2 of 732")
    /           divide
    ^           raise to a power
    MOD         integer modulus
    & or AND    bit-wise integer AND
    | or OR     bit-wise integer OR
    XOR         bit-wise integer exclusive-OR

The following prefix operator should be used before its operand:
    ~           bit-wise integer NOT (invert)

The following postfix operators should be used after their operand:
    %           divide by 100.0
    !           factorial (non-neg. integers only)

Flume can compute the following functions:
    sqrt()   square root
    sin()       sine of an angle
    cos()       cosine of an angle
    tan()       tangent of an angle
    arcsin()    arcsine (inverse sine) of an angle
    arccos()    arccosine (inverse cosine) of an angle
    arctan()    arctangent (inverse tangent) of an angle
    remainder() real-number remainder after division
    deg2rad()   multiply by PI/180.0
    rad2deg()   multiply by 180.0/PI
Note: for trigonometric functions, the default angle encoding is radians. From the GUI or command-line, the encoding can be switched to degrees.
Flume will provide the following constant values:
    PI          3.141592...
    e           2.7182818... (lower-case only!)
Referring to Prior Results

You may reuse prior results in an expression using absolute or relative references.

Absolute references specify an expression row (or "result") number in the form of r[n], where n is the row number from 0 (the first row number) up to the maximum. No matter where the absolute reference shows up, it refers to the same expression row. Warning: referring to a higher-number row will recall the old calculation result for that row, which may change during the subsequent calculations.

Relative references specify an expression row a specified number of rows displaced from the row containing the reference. The form of relative references is p[n], where n is the number of rows offset in the prior direction. For example, p[1] refers to the immediately prior row and p[2] refers to an expression two rows back. Negative values for the row offset will make forward-references, which may produce inconsistent results.

When Flume parses expressions, the single-quote character (') will be automatically expanded into p[1], while the double-quote character (") will be automatically expanded into p[2], making it a little more convenient to chain calculations together as you type them in.
Files

Flume may open and insert the contents of a text file into the main work area. This can be done by specifying a file on the command-line or by pressing the "Open" button in the GUI and selecting a file. The file selection dialog defaults to browsing files with the ".flume" filename extension, but ".ume", ".txt" or all files may be browsed by changing the filter field.

If the file contents are successfully retrieved, Flume will attempt to evaluate each line of the file. If any line is not a valid expression, Flume will report an error and place the editing cursor at the end of that expression. The name the retrieved file is displayed in the GUI main window title. If the content has been modified, the filename in the title will show an asterisk (*) prefix.

You may save your current workspace content as long as there has been at least one valid expression. The entire workspace content is saved to the file, even if some of that content has not been parsed and calculated yet. After Flume successfully writes the current workspace content to the file, the file modification flag and title asterisk is cleared.

If the file modification flag is currently set when try to quit or open a new file, you will be notified that quitting will cause the modifications to be discarded. You may either choose to discard and quit anyway or chose to cancel the quit request so you may save the modified content.
Quirks and Tricks

Flume doesn't (yet?) handle imaginary numbers, so sqrt(-1) returns "-nan" (not a number).

Multiple sequential "raise to the power" operators will expand into a strange looking expression, but will calculated OK. For example, 3^2^2 will expand to (3 ^ (2) ^ 2), but will still equal 81. Use parentheses if an exponent is a complicated expression.

Flume keeps track of the format of a number (integer, hexadecimal, etc.), and most results will "inherit" the format of the last number entered. You can exploit this behavior with the Multiplicative Identity (multiply by one), using the form of the number one you want to convert the first number or expression to. For example, to convert 192 into hexadecimal:
    $ flume 192 x 0x01[enter]
    192 x 0x01 = 0xC0

To convert 1/1000 into scientific notation:
    $ flume "(1.0/1000) * 1e0"
    (1.0 / 1000) * 1e0 = 1.000000e-03

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Flume math app BETA version 0.9.0
« Reply #2 on: November 07, 2010, 05:20:57 PM »
Minor typo in "!" popup: ARITHMETIC   ;)

While scrolling in help browser there is error output, not of any obvious functional essence though.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flume math app BETA version 0.9.0
« Reply #3 on: November 07, 2010, 06:05:50 PM »
@tinypoodle: Thanks! Typo fixed for the next release.  Can you give me any more info on the help browser error message you see?  Where do you see it?  I don't think I've ever seen something like that.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Flume math app BETA version 0.9.0
« Reply #4 on: November 07, 2010, 07:40:53 PM »
Output in aterm, when flume is started from CLI.

Code: [Select]
X_ChangeGC: BadMatch (invalid parameter attributes) 0x3000186
X_ChangeGC: BadPixmap (invalid Pixmap parameter) 0x2e00100
X_ChangeGC: BadPixmap (invalid Pixmap parameter) 0x2e000ff
etc...

On further testing this seems only to appear while scrolling at the very top of the document.

(FWIW, running TC 2.10 here)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flume math app BETA version 0.9.0
« Reply #5 on: November 08, 2010, 12:08:04 PM »
I'm currently developing on TC 3.1 and 3.0.  I don't know of any reason it should not compile and run OK on TC 2.10, but maybe the version does have some impact.  Is there anything else unconventional about your setup (WM, XOrg instead of VESA, etc)? Unless I find a posting by someone else who ran into a similar FLTK problem, I don't know if I can duplicate and fix it.  :-\

UPDATE: A bit of searching did not lead to any specific causes or fixes. This kind of error seems to pop up in many different situations with many different applications.  My only thought after looking at these is to think about whether you have the proper XOrg development headers installed for your setup, especially if you are using XOrg as your display server.
--
Mike
« Last Edit: November 08, 2010, 12:28:12 PM by MikeLockmoore »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Flume math app BETA version 0.9.0
« Reply #6 on: November 08, 2010, 12:21:31 PM »
Using jwm-snapshot and the Xvesa.tcz extension (as opposed to Xvesa included in base).
I wouldn't really label this as a problem, as there appears to be no impact whatsoever in functionality.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Flume math app BETA version 0.9.0
« Reply #7 on: November 08, 2010, 12:44:30 PM »
FWIW, I have actually Xorg-7.4-dev.tcz (as a dependency of some app) installed, without having Xorg installed.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flume math app BETA version 0.9.0
« Reply #8 on: November 08, 2010, 02:40:18 PM »
@tinypoodle:  Maybe the headers have nothing to do with it.  I wonder if the Xvesa.tcz has a slight incompatibility with FLTK's runtime API lib. If I can ask, why install Xvesa.tcz?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Flume math app BETA version 0.9.0
« Reply #9 on: November 08, 2010, 02:50:09 PM »
There are some rather minor differences in behaviour in some aspects, couldn't recall all at the moment; but I have observed "leaking" of memory to a big extent with Xvesa in base, e.g. last time I had reached a res mem usage of 230MB - Right now is around 100 MB (couldn't say exactly as I am using swap) with Xvesa extension after 29 d uptime.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flume math app BETA version 0.9.0
« Reply #10 on: November 09, 2010, 02:12:24 PM »
Everyone:  Flume is now available on the official TCE repository for TC 3.x.  ;D

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Flume math app BETA version 0.9.0
« Reply #11 on: November 18, 2010, 04:40:54 PM »
flume has an unusual behaviour under jwm-snapshot.
As I couldn't see a way to resize it, I tried Maximize-x & Maximize-y.
Consequence is that flume would "snap" to the left resp. top edge of screen, and when being dragged elsewhere it would instantly snap back upon release of mouse button.

Note: the builtin help browser can be resized as expected.
« Last Edit: November 18, 2010, 04:51:00 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Flume math app BETA version 0.9.0
« Reply #12 on: November 19, 2010, 10:38:49 AM »
@tinypoodle: thanks for documenting that.  Maybe I will allow full resizing the next time I work on it.  For the shorter term, maybe I can come up with a way to ignore the resize events from the WM.

Frank

  • Guest
Re: Flume math app BETA version 0.9.0
« Reply #13 on: November 19, 2010, 12:15:33 PM »
Quote from: Flume 0.9.0
3.99 - 3 = 0
« Last Edit: November 19, 2010, 12:18:08 PM by Frank »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Flume math app BETA version 0.9.0
« Reply #14 on: November 19, 2010, 02:13:52 PM »
Quote from: Flume 0.9.0
3.99 - 3 = 0
Code: [Select]
3.99 - 3.0 = 0.99
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)