Where communities thrive


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

    axkr on master

    #415 avoid java.lang.ClassCastE… (compare)

  • 00:55

    axkr on master

    #415 check if option args are c… (compare)

  • 00:41
    axkr edited #415
  • 00:39
    axkr opened #415
  • Jan 26 18:10

    axkr on master

    JSXGraph v1.4.1 - https://gith… (compare)

  • Jan 26 17:58

    axkr on master

    #414 6*^-1 should return 3/5 (compare)

  • Jan 26 17:58
    axkr opened #414
  • Jan 26 10:23
    HannesWell opened #413
  • Jan 26 05:53

    axkr on master

    #412 ReplacePart - negative pos… (compare)

  • Jan 25 23:12

    axkr on master

    #412 ReplacePart - negative pos… Dot markdown - error example (compare)

  • Jan 23 16:02

    axkr on master

    #412 improvement for case b) As… (compare)

  • Jan 23 15:36
    axkr edited #412
  • Jan 23 15:11

    axkr on master

    Fix quantity example (compare)

  • Jan 23 14:58

    axkr on master

    Remove toggle QUANTITY, FINANCE… (compare)

  • Jan 23 13:39
    axkr edited #412
  • Jan 23 13:37
    axkr edited #412
  • Jan 23 13:37
    axkr opened #412
  • Jan 22 16:39
    axkr commented #13
  • Jan 22 16:37

    axkr on master

    #411 print experimental message… (compare)

  • Jan 22 16:23
    axkr labeled #411
by adding a line
ctx.setCleanupAtExit(false);
TiMauzi
@TiMauzi
Okay, give me a second
Just a question, you mean in my own code, right?
Because I don't have any ApfloatContext object there
Since it's implicitly created by ExprEvaluator
Axel Kramer
@axkr
Oh, I'd thought you already used a modified Symja version?
TiMauzi
@TiMauzi
No, not at all
Axel Kramer
@axkr
Ok then lets add in your code this test:
ApfloatContext ctx = ApfloatContext.getContext();
      ctx.setNumberOfProcessors(1);
      ctx.setCleanupAtExit(false);
TiMauzi
@TiMauzi
Alright, I'll be back in a moment
Axel Kramer
@axkr
if possible after the initialization of ExprEvaluator
TiMauzi
@TiMauzi
Okay, at the moment I'm trying it before the ExprEvaluator. I'll try the other version after that
Axel Kramer
@axkr
I'll be away for some minutes
TiMauzi
@TiMauzi
Take your time :)
First result after placing the test before the ExprEvaluator initialization:
[2021-05-14T18:23:42,388][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [TIM] fatal error in thread [elasticsearch[TIM][search][T#1]], exiting
java.lang.ExceptionInInitializerError: null
        at org.elasticsearch.index.search.CommutingQuantumScorer$1.run(CommutingQuantumScorer.java:93) ~[?:?]
        at java.security.AccessController.doPrivileged(AccessController.java:312) ~[?:?]
        at org.elasticsearch.index.search.CommutingQuantumScorer.score(CommutingQuantumScorer.java:90) ~[?:?]
...
Caused by: org.apfloat.ApfloatConfigurationException: Error setting property "cleanupAtExit" to value "true"
        at org.apfloat.ApfloatContext.setProperty(ApfloatContext.java:1025) ~[?:?]
        at org.apfloat.ApfloatContext.setProperties(ApfloatContext.java:1270) ~[?:?]
        at org.apfloat.ApfloatContext.<init>(ApfloatContext.java:331) ~[?:?]
        at org.apfloat.ApfloatContext.<clinit>(ApfloatContext.java:1388) ~[?:?]
        ... 26 more
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "shutdownHooks")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:?]
        at java.security.AccessController.checkPermission(AccessController.java:1036) ~[?:?]
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:408) ~[?:?]
        at java.lang.Runtime.addShutdownHook(Runtime.java:212) ~[?:?]
        at org.apfloat.ApfloatContext.setCleanupAtExit(ApfloatContext.java:901) ~[?:?]
        at org.apfloat.ApfloatContext.setProperty(ApfloatContext.java:1016) ~[?:?]
        at org.apfloat.ApfloatContext.setProperties(ApfloatContext.java:1270) ~[?:?]
        at org.apfloat.ApfloatContext.<init>(ApfloatContext.java:331) ~[?:?]
        at org.apfloat.ApfloatContext.<clinit>(ApfloatContext.java:1388) ~[?:?]
        ... 26 more
fatal error in thread [elasticsearch[TIM][search][T#1]], exiting
...
TiMauzi
@TiMauzi
And a similar error if I place it after ExprEvaluator calcEvaluator = new ExprEvaluator(false, (short) 100);:
[2021-05-14T18:30:37,109][WARN ][stderr                   ] [TIM] java.lang.ExceptionInInitializerError
[2021-05-14T18:30:37,109][WARN ][stderr                   ] [TIM]       at org.matheclipse.core.expression.F.<clinit>(F.java:599)
[2021-05-14T18:30:37,110][WARN ][stderr                   ] [TIM]       at org.matheclipse.core.eval.ExprEvaluator.<clinit>(ExprEvaluator.java:133)
...
[2021-05-14T18:30:37,120][WARN ][stderr                   ] [TIM] Caused by: org.apfloat.ApfloatConfigurationException: Error setting property "cleanupAtExit" to value "true"
[2021-05-14T18:30:37,120][WARN ][stderr                   ] [TIM]       at org.apfloat.ApfloatContext.setProperty(ApfloatContext.java:1025)
...
[2021-05-14T18:30:37,122][WARN ][stderr                   ] [TIM] Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "shutdownHooks")
...
[2021-05-14T18:30:37,124][WARN ][stderr                   ] [TIM]       ... 31 more
[2021-05-14T18:30:37,133][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [TIM] fatal error in thread [elasticsearch[TIM][search][T#1]], exiting
java.lang.NoClassDefFoundError: Could not initialize class org.apfloat.ApfloatContext
        at org.elasticsearch.index.search.CommutingQuantumScorer$1.run(CommutingQuantumScorer.java:95) ~[?:?]
        at java.security.AccessController.doPrivileged(AccessController.java:312) ~[?:?]
...
@axkr So there is not much of a difference whether I place the ApfloatContext test before or after ExprEvaluator
Axel Kramer
@axkr
This seems to come from the apfloat library:
Can you open an issue where and ask how to set the properties to avoid that error, because I don't find a properties file in the apfloat's JAR itself.
TiMauzi
@TiMauzi
@axkr Although I'd like to take your advice and creating a modification of Symja meanwhile... Though, it would be more elegant of course if I could use an original version at some point :)
Axel Kramer
@axkr
Yes of course. You can contribute your changes back with a pull request to Symja if you create a fork on github.
TiMauzi
@TiMauzi
Mhm that might be a good idea... Although I usually use my university's gitlab, I can of course create my symja fork on github :)
TiMauzi
@TiMauzi
@axkr Added you to my fork :)
TiMauzi
@TiMauzi
@axkr The creator of apfloat answered btw :)
TiMauzi
@TiMauzi
@axkr I tried his 4th option, adding the line implementation "org.apfloat:apfloat-applet:1.9.1" to my build.gradle. I think it changed something, but I got a new Symja-related error:
[2021-05-15T01:57:51,755][WARN ][stderr                   ] [TIM] java.lang.NoClassDefFoundError: org/codehaus/commons/compiler/CompileException
[2021-05-15T01:57:51,755][WARN ][stderr                   ] [TIM]       at org.matheclipse.core.builtin.CompilerFunctions$Initializer.init(CompilerFunctions.java:76)
[2021-05-15T01:57:51,756][WARN ][stderr                   ] [TIM]       at org.matheclipse.core.builtin.CompilerFunctions$Initializer.access$200(CompilerFunctions.java:72)
[2021-05-15T01:57:51,756][WARN ][stderr                   ] [TIM]       at org.matheclipse.core.builtin.CompilerFunctions.initialize(CompilerFunctions.java:84)
[2021-05-15T01:57:51,757][WARN ][stderr                   ] [TIM]       at org.matheclipse.core.expression.F.<clinit>(F.java:910)
[2021-05-15T01:57:51,757][WARN ][stderr                   ] [TIM]       at org.matheclipse.core.eval.ExprEvaluator.<clinit>(ExprEvaluator.java:133)
...
[2021-05-15T01:57:51,769][WARN ][stderr                   ] [TIM] Caused by: java.lang.ClassNotFoundException: org.codehaus.commons.compiler.CompileException
...
TiMauzi
@TiMauzi
But I'm checking the class imports at the moment, because I'm feeling suspicious that it has something to do with that
that is part of the Janino compiler
TiMauzi
@TiMauzi
Yes, I found that out, too. Funny thing: Janino is imported perfectly. It's just the "commons" part that doesn't work. I'm at the moment trying if it works when I add this particular artifact
I think it's an Elasticsearch thing with transitive imports again, that just the parent library is importet but not the libraries called by the parent
TiMauzi
@TiMauzi
Yes baby!
[2021-05-15T02:35:13,743][INFO ][stdout                   ] [TIM] doToQuery()
[2021-05-15T02:35:13,745][INFO ][stdout                   ] [TIM] transcribe()
[2021-05-15T02:35:13,745][INFO ][stdout                   ] [TIM] transcribe()
[2021-05-15T02:35:13,746][INFO ][stdout                   ] [TIM] (matchquery$$fuchs&&(matchquery$$schaf||(!matchquery$$schaf&&matchquery$$huhn)))||(!matchquery$$matchquery$$fuchs&&matchquery$$schaf&&matchquery$$wolf)
[2021-05-15T02:35:13,776][INFO ][stdout                   ] [TIM] CommutingQuantumQuery
[2021-05-15T02:35:13,788][INFO ][stdout                   ] [TIM] CommutingQuantumWeight
[2021-05-15T02:35:13,790][INFO ][stdout                   ] [TIM] CommutingQuantumScorer
[2021-05-15T02:35:13,791][INFO ][stdout                   ] [TIM] score()
... no class errors here anymore! :tada:
[2021-05-15T02:35:14,733][INFO ][stdout                   ] [TIM] Index 1 out of bounds for length 1
[2021-05-15T02:35:14,742][WARN ][r.suppressed             ] [TIM] path: /fables/_search, params: {index=fables}
org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
        at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:661) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
...
Caused by: java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Float (java.lang.Integer and java.lang.Float are in module java.base of loader 'bootstrap')
        at org.elasticsearch.index.search.CommutingQuantumScorer.score(CommutingQuantumScorer.java:91) ~[?:?]
...
Just my own programming mistakes for now
And yes, using the janino commons-compiler artifact worked :)
@axkr So that means, that I actually can use your original Symja (if nothing unexpected happens anymore) :)
Axel Kramer
@axkr
@TiMauzi go ahead ;-)
Axel Kramer
@axkr
@TiMauzi bumped version to 2.0.0-SNAPSHOT because of other Maven module partition:
https://github.com/axkr/symja_android_library#license
TiMauzi
@TiMauzi
@axkr There might be a problem with the new version. I upgraded it in my build.gradle and suddenly, the following doesn't evaluate anymore:
Variables(termquery$$fuchs*(termquery$$huhn*(1-termquery$$schaf)+termquery$$schaf)+(1-termquery$$fuchs)*termquery$$schaf*termquery$$wolf)
Of course, it should output {termquery$$fuchs,termquery$$huhn,termquery$$schaf,termquery$$wolf} which works here: http://matheclipse.org/
TiMauzi
@TiMauzi
I had to go back to 1.0.0-SNAPSHOT for now, because there everything works flawlessly
While in 1.0.0-SNAPSHOT, the line IExpr varsExpr = calcEvaluator.eval("Variables(" + calc + ")"); evaluates to {termquery$$fuchs,termquery$$huhn,termquery$$schaf,termquery$$wolf}, the same code in 2.0.0-SNAPSHOT evaluates to just Variables(termquery$$fuchs*(termquery$$huhn*(1-termquery$$schaf)+termquery$$schaf)+(1-termquery$$fuchs)*termquery$$schaf*termquery$$wolf)
(calc is of course my test string "termquery$$fuchs*(termquery$$huhn*(1-termquery$$schaf)+termquery$$schaf)+(1-termquery$$fuchs)*termquery$$schaf*termquery$$wolf" in the examples above)
Axel Kramer
@axkr
@TiMauzi in this JUnit test I cannot reproduce the problem:
Can you create a minimal example which reproduces the error?
And set Config.DEBUG=true at the beginning?