Giter Site home page Giter Site logo

modularcalculator's People

Contributors

jordanl2 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

pieush-ds

modularcalculator's Issues

Coordinate type

Single object that encapsulates 2 or more dimensions.
Written as a series of numbers separated by commas. A separate parser must be written and Operand type created.
Numbers can't have units.
-- OR --
Use arrays for the type, and just write special functions that take arrays as inputs and treat them as coords.

Functions:
find distance between two coordinates
find mid point between two coords (or X% between them)

Number statements in input and output

To more easily find a particular statement and its result in the output, number each statement in the input and the corresponding result in the output.

Implicit multiplication of constants

A number followed by a constant should do implicit multiplication with higher precedence than normal operators.

Eg:

speedoflight / 2 earthgravity

should be equivalent to

speedoflight / (2 earthgravity)

Dialog to Insert unit system

Function format takes an optional second parameter, of type system.

Currently user has to guess the IDs of unit systems rather than being able to insert them from a list.

Option reset button

Add a button in the feature options edit dialog to reset that feature's options to default.

Remove Edit Menu

There isn't anything in the menu apart from undo/redo which can be done through hotkeys or the context menu.

Trinary operator with array input fails sometimes

Eg:

a = [0, 1]
(a > 0) then 1 / a else 0

Should return: [0, 1]

Instead returns:

[0, ("Could not execute operator / with operands: '1', '[<modularcalculator.objects.items.OperandResult object at 0x7f6410130e80>, <modularcalculator.objects.items.OperandResult object at 0x7f6410130790>]' - Could not execute Operator /", [<modularcalculator.features.structure.innerexpressions.InnerExpressionItem object at 0x7f6410130970>, <modularcalculator.features.nonfunctional.space.SpaceItem object at 0x7f6410130be0>, <modularcalculator.objects.items.OperatorItem object at 0x7f6410130340>], '/')]

Interface - save state occasionally

Either:

  1. Save state every x minutes
    or
  2. Save state every time it changes
    or
  3. Combination of the two, every x minutes save state only if it's changed

Add 'root' operator

Same as ^ except second param is inverted.

Eg: "16 root 2" is the same as "16^0.5"

Add auto-execute mode

Would be nice to have an option to activate automatic execution each time the input changes.

If it is too resource intensive to update after every change, maybe add a bit of latency and update the output after 1 or 2 seconds of unmodified input.

Function parameters are inconsistent

"Haystack" params: "string", "array"
"Needle" params: "substring", "pattern", "character", index params ("start", "end", "number")
These param types should be in the same order for all functions.

"Haystack", "Needle" (HN) functions:
element(array, number)
regexcount(string, pattern)
regexget(string, pattern, [group])
regexsub(string, pattern, replacement, [group])
find(string, substring)
lstrip(string, character)
rstrip(string, character)
replace(string, substring, replacement)
strip(string, character)
substr(string, start, end)

"Needle", "Haystack" (NH) functions:
regexsplit(pattern, string)
join(substring, strings)
split(substring, string)

Split/join methods in other languages:
Python: split is HN, join is NH
Perl: Split and join are NH
Ruby: Split and join are HN
Java: Split is HN, join is NH
In total:
Split - HN in 3/4 languages studied
Join - NH in 3/4 languages studied
Split and join are inconsistent with each other in 2/4 languages studied

Inline anonymous functions

Ability to write a function definition, and reuse it multiple times, in the same script. More convenient than writing an external function (which involves writing and saving a separate file).

The function definition should involves storing a reference to the function in a variable. E.g.:

x = {
    PARAM1 / 2
}

Executing the function uses the same syntax as executing an external function. E.g.:

# returns 2
@x(4)

Auto-handle multiple arrays passed to function that takes one array and returns non-array

This is so we can pass multiple arrays to min, max etc, and have the function performed on the list of values at each position in the arrays at once. Eg:

min([0, 3, 6], [4, 2, 5])
= [0, 2, 5]

Rule defintion:
IF argument types are ONE array only
AND return type is not array
AND inputs provided are more than one array
THEN:

  1. Execute function once for each element in the first array, passing an array of the elements at that position in all arrays each time
  2. Put results into an array and return

Make Wiki

  • Interface
    • Entering, executing statements and seeing results
      • Undo / redo
    • Open / save
    • Tabs
    • Insert menu
    • Options
      • Precision
      • Simplify units
      • Unit system preference
      • Install / Remove features
        • Presets
        • Custom Features
      • Feature Options
  • Language
    • Whitespace / statement layout and termination
      • Comments
    • Types
      • Numbers
        • Decimal
        • Non-decimal
        • E notation
      • Booleans
      • Strings
      • Date and time
      • Units
    • Operations
      • Operators
        • Type interpretation
        • Precedence
        • Implied multiplication
      • Functions
    • Inner-expressions
    • State
      • Variables
      • Constants
    • Arrays
    • User-defined functions
  • List of operators
  • List of functions
  • List of units
  • Features (in depth explanation)

Option for binary numbers keeping their width

At the moment, binary numbers will preserve their length, and zero-pad after an operation. This is to make bitwise operations work (eg shift).

Possibly this should be an option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.