Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 21 21:19

    axkr on master

    Refactorings (compare)

  • Aug 21 01:29

    axkr on master

    New GrapExpr class (compare)

  • Aug 21 01:29

    axkr on master

    Define specialized GraphExpr fo… Protect changes of symbols (compare)

  • Aug 20 18:44

    axkr on master

    Default() function and refactor… (compare)

  • Aug 18 17:03

    axkr on master

    Improve Compile() function (compare)

  • Aug 18 15:26

    axkr on master

    ExprParser (compare)

  • Aug 18 10:14

    axkr on master

    Refactor method ExprParser#conv… (compare)

  • Aug 18 09:48

    axkr on master

    Graph functions: GraphCenter, G… (compare)

  • Aug 18 07:12

    axkr on master

    Improve parsing for Inequality() TeXForm for Inequality() - chan… (compare)

  • Aug 17 16:38

    axkr on master

    readme (compare)

  • Aug 17 16:35

    axkr on master

    readme (compare)

  • Aug 17 11:12

    axkr on master

    readme (compare)

  • Aug 16 17:55

    axkr on master

    Improve special cases in patter… (compare)

  • Aug 15 16:09

    axkr on master

    PiecewisePlotExample (compare)

  • Aug 15 16:06

    axkr on master

    Use ternary ?...: operator for … (compare)

  • Aug 14 19:30

    axkr on master

    Attempt to convert Piecewise() … fix bug in UnaryNumerical (compare)

  • Aug 13 16:44

    axkr on master

    Create boolean operators in JSF… (compare)

  • Aug 12 22:38
    paulmasson closed #138
  • Aug 12 22:38
    paulmasson commented #138
  • Aug 12 19:00

    axkr on master

    Refactor IExpr#compareTo() meth… (compare)

Inofficial
Bye
Stu Btwotwo
@stub22
Thanks for info, that's a big help. Peace!
Ax Kr
@axkr
@stub22 in MMAConsole I try to mimic some of MMA behaviour
    public MMAConsole() {
        EvalEngine engine = new EvalEngine(false);
        fEvaluator = new ExprEvaluator(engine, false, 100);
        fEvaluator.getEvalEngine().setFileSystemEnabled(true);
        DecimalFormatSymbols usSymbols = new DecimalFormatSymbols(Locale.US);
        DecimalFormat decimalFormat = new DecimalFormat("0.0####", usSymbols);
        fOutputFactory = OutputFormFactory.get(false, false, decimalFormat);
        fOutputTraditionalFactory = OutputFormFactory.get(true, false, decimalFormat);
        fInputFactory = OutputFormFactory.get(false, false, decimalFormat);
        fInputFactory.setQuotes(true);
    }
together with this static initializer
    static {
        // distinguish between lower- and uppercase identifiers
        Config.PARSER_USE_LOWERCASE_SYMBOLS = false;
        F.initSymbols(null, null, true);

    }
Stu Btwotwo
@stub22
Thanks for calling out those sections. I started running MMAConsole after we talked yesterday. So far it works as I expect.
Stu Btwotwo
@stub22
Suppose we wanted to run 20 instances of EvalEngine, each on its own separate thread.
Let's say they are all using this same MMA-friendly config (so all the global settings of Config, F, can be set once and then left alone).
Then do we expect those parallel EvalEngines to work OK?
Or will their symbols collide due to shared state inside some F.java mutable variables?
(I presume that EvalEngine.get() and set() are doing work related to this question, but I have not had a chance yet to study what they do.)
Ax Kr
@axkr
@stub22 yes the EvalEngine have their own "Global" contexts and should work as you described. Unfortunately at the moment there is no Protected attribute, that prevents the "global functions" from being modified.
there has to be done some work to shield these global functions like Sin, Cos,...
Stu Btwotwo
@stub22
OK well that's good news, thanks. So as long as each math input stream is well behaved (i.e. doesn't try to redefine the 'builtins'), then it should work OK in parallel. Great!
Ax Kr
@axkr
yes
Ax Kr
@axkr
You can use command line flags in MMAConsole to get back a result immediately: https://github.com/axkr/symja_android_library/wiki/MMA-console-usage
Antoine Tran
@Tran-Antoine
Such a huge project ! I'm in admiration, how did you manage to do this (almost) on your own ? You've been working on this for quite a while I suppose
Ax Kr
@axkr
Yes almost on my own
But if you’re interested I‘m always looking for supporters
Antoine Tran
@Tran-Antoine
haha I'm pretty busy working on my own library, though it's a small one
but why not one day
Paul Masson
@paulmasson
Axel, I'll be at my computer for the next couple hours if you have questions about MathCell
Ax Kr
@axkr
I've seen you also have a math.js library
does it make sense to avoid the step of converting to JavaScript functions in Symja
Paul Masson
@paulmasson
Yes, for complex special functions
Ax Kr
@axkr
for exampe generate directly cos, sin, cot without Math. prefix
Paul Masson
@paulmasson
If you're only doing real-valued math then the JS functions will be a bit faster. If you want the option of complex numbers then use mine.
Ax Kr
@axkr
Overwise my javascript converter has to define code for example for a cot or coth function. So it will be easier to call the math.js functions directly
for both real and complex valued functions
Paul Masson
@paulmasson
Yup! That's why I wrote that library.
Ax Kr
@axkr
For the current issue I think http://localhost:8080/media/js/prototype/prototype.js line 403 calls the eval() function
Paul Masson
@paulmasson
Just to warn you those functions are also all global. I came at the problem after contributing to SageMath where it works that way, and I wanted the same convenience. Then again, there should only be one wat to define sin or coth, so global math makes sense to me.
Ax Kr
@axkr
Could this be the problem?
You have talked about an <iframe> solution in sagemath
Can I use the same solution here?
Paul Masson
@paulmasson
You're using eval() for injecting scripts, right? It doesn't make sense that it would alter JSON behavior, but as a dedicated JS person I never use eval() because it's considered unsafe, so maybe there's something I'm missing.
And yes, an <iframe> would take care of injection issues. The <script> still needs to be in a <div> of class=mathcell, then inside a <body> tag and that inside <html>. The source for the library can be in the body or the head. Then set the srcdoc of the iframe equal to the HTML string.
Ax Kr
@axkr
I must admit that the script is from mathics and modified for symja project
Paul Masson
@paulmasson
Would you like links to how this is done in SageMath?
Ax Kr
@axkr
As I said I'm not very good at javascript programming
Yes the sagemath solutioin would be nice to hava
Ax Kr
@axkr
@paulmasson Thanks in advance for your help. I have to leave now.
Paul Masson
@paulmasson
Iframe template is here. Returned full embedded document is here.
Or even simpler (without the bother of Python), here is how I do it in MathCell itself. Cheers!
The <iframe> approach will also take care of wrapping my global functions in a local context.
Ax Kr
@axkr
@paulmasson do you have any suggestions for JavaScript libraries which visualize graph theory structures?
Ax Kr
@axkr
@paulmasson I update the website https://symjaweb.appspot.com/ How can I calculate optimized "height" parameter for example if Manipulate shows a formula like Manipulate(Factor(x^n + 1), {n, 1, 5, 1})
Paul Masson
@paulmasson
For graph theory I'd suggest D3.js, although I don't use it myself. There is an implementation in SageMath, with JSON assembled in the python and rendered in HTML
Paul Masson
@paulmasson
Don't have a really good answer for automatic height, since it depends on what's in the cell. I generally add half an inch for each input line, plus four inches for 2D or 3D plots. If you know the output is text reduce that to one or two inches.