ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 18 Dec 2019 13:45:19 +0100Does sage offer API?https://ask.sagemath.org/question/49066/does-sage-offer-api/ Hello, I am currently using sage for calculations on elliptic curves in my semestral project and I want to build a sort of a "wrap GUI" in JavaFX, which would generate input for Sage and then will format the output from it. I was wondering if Sage offers some kind of API? I am well aware of using Processbuilder class in java to create and manage different processes, but this method inevitably has some caveats, so I'm just interested, is Sage offering some kind of API?JanoutVWed, 18 Dec 2019 13:45:19 +0100https://ask.sagemath.org/question/49066/Calling Sage from Javahttps://ask.sagemath.org/question/44853/calling-sage-from-java/Hello,
I am looking for a way to call Sage functions, such as constructing Polyhedra, from Java (on Windows).
In more detail, I want to do the following:
1. Input to Sage from Java: P1 = Polyhedron(vertices = [[0,2], [-1,0], [1,0], [0,0]])
2. Retrieve in Java the Sage output: P1.Hrepresentation()
It would be optimal if I could call Sage directly somehow, but if it's necessary, I think a python wrapper could also work. It would be very kind if somebody could point me in the right direction, maybe with code snippets, as I am very new to the Sage Environment.
Thank you.CupOfCoffeeThu, 03 Jan 2019 03:11:12 +0100https://ask.sagemath.org/question/44853/Run Java in Sagemath! AWESOME! But i got errors/comment/warning!https://ask.sagemath.org/question/40994/run-java-in-sagemath-awesome-but-i-got-errorscommentwarning/Hi im a running this:
https://cocalc.com/share/8668c880-b850-4069-87b0-9bc2c0f28cf6/java/Aufg1.java?viewer=share
But I get this error/comment/warning:
Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/home/user/tmp/ -Xms64m
Is there a way to enable the edditor to recognise java use some highlights, or like this?thethaTue, 06 Feb 2018 11:46:00 +0100https://ask.sagemath.org/question/40994/Sage on Mac unable to use plot3d due to Java/jmol issueshttps://ask.sagemath.org/question/39422/sage-on-mac-unable-to-use-plot3d-due-to-javajmol-issues/Hi,
I am a relative newbie to the Mac and Sage on the Mac. I tried to run the following code from the Sage tutorial on my Mac in the console mode of sage:
> sage: x, y = var('x,y')
>
> sage: plot3d(x^2 + y^2, (x,-2,2), (y,-2,2))
The error message I get is
> --------------------------------------------------------------------------- RuntimeError
> Traceback (most recent call last)
> <ipython-input-2-878191366deb> in
> <module>()
> ----> 1 plot3d(x**Integer(2) + y**Integer(2),
> (x,-Integer(2),Integer(2)),
> (y,-Integer(2),Integer(2)))
>
> /Applications/SageMath/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in __call__(self, result)
> 244 self.start_displayhook()
> 245 self.write_output_prompt()
> --> 246 format_dict, md_dict =
> self.compute_format_data(result)
> 247 self.update_user_ns(result)
> 248 self.fill_exec_result(result)
>
> /Applications/SageMath/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in compute_format_data(self, result)
> 148
> 149 """
> --> 150 return self.shell.display_formatter.format(result)
> 151
> 152 # This can be set to True by the write_output_prompt method in a
> subclass
>
> /Applications/SageMath/local/lib/python2.7/site-packages/sage/repl/display/formatter.pyc
> in format(self, obj, include, exclude)
> 158 # First, use Sage rich output if there is any
> 159 PLAIN_TEXT = u'text/plain'
> --> 160 sage_format, sage_metadata =
> self.dm.displayhook(obj)
> 161 assert PLAIN_TEXT in sage_format, 'plain text is always
> present'
> 162 if sage_format.keys() != [PLAIN_TEXT]:
>
> /Applications/SageMath/local/lib/python2.7/site-packages/sage/repl/rich_output/display_manager.pyc
> in displayhook(self, obj)
> 806 self._backend.set_underscore_variable(obj)
> 807 plain_text, rich_output =
> self._rich_output_formatter(obj,
> dict())
> --> 808 return self._backend.displayhook(plain_text,
> rich_output)
> 809
> 810 def display_immediately(self, obj,
> **rich_repr_kwds):
>
> /Applications/SageMath/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_ipython.pyc
> in displayhook(self, plain_text,
> rich_output)
> 264 return ({u'text/plain': msg}, {})
> 265 elif isinstance(rich_output,
> OutputSceneJmol):
> --> 266 msg = self.launch_jmol(rich_output,
> plain_text.text.get_unicode())
> 267 return ({u'text/plain': msg}, {})
> 268 elif isinstance(rich_output,
> OutputSceneWavefront):
>
> /Applications/SageMath/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_ipython.pyc
> in launch_jmol(self, output_jmol,
> plain_text)
> 367 jdata = JmolData()
> 368 if not jdata.is_jvm_available() and not
> DOCTEST_MODE:
> --> 369 raise RuntimeError('jmol cannot run, no
> suitable java version found')
> 370 launch_script = output_jmol.launch_script_filename()
> 371 from sage.env import SAGE_LOCAL
>
> RuntimeError: jmol cannot run, no
> suitable java version found
I believe I have the latest version of Java installed:
> $ java --version
> java 9.0.1
> Java(TM) SE Runtime Environment (build 9.0.1+11)
> Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
Sage version
> $ sage --version
> SageMath version 8.0, Release Date: 2017-07-21
I would appreciate any inputs and advice about how to fix this issue. Thanks in advance!toricwebTue, 07 Nov 2017 17:29:46 +0100https://ask.sagemath.org/question/39422/Jmol applet in Sage 6.3 cannot loadhttps://ask.sagemath.org/question/25374/jmol-applet-in-sage-63-cannot-load/ Hi,
I am going trough the Tutorial using Notebook. Under 3D plotting, I am trying to run the first example. The static 3D plot is generated but when I click "Make it Interactive", the Jmol applet fails to load. The error message says JmolApplet#0 has trouble loading, will try again. However, it fails loading. This is the Sage screen output I get:
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
This application does not specify a Codebase in its manifest. Please verify with the applet's vendor. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details.
Application title was not found in manifest. Check with application vendor
Application title was not found in manifest. Check with application vendor
script ERROR: script ERROR: io error reading http://localhost:8080/home/_sage_/30/cells/14/cells/14/sage0-size500-473909326.jmol.zip|SCRIPT: java.io.FileNotFoundException: http://localhost:8080/home/_sage_/30/cells/14/cells/14/sage0-size500-473909326.jmol.zip
I have Open JDK 7 and IcedTea installed on Ubuntu 14.04 (64-bit). If I go to the Jmol website www.jmol.org, I can run their demo and the Jmol applet IcedTea loads just fine in Firefox, it only doesn't work in the Sage Notebook.
Thanks for your help,
Istvan
ikolFri, 02 Jan 2015 06:56:49 +0100https://ask.sagemath.org/question/25374/problem with javahttps://ask.sagemath.org/question/24825/problem-with-java/ Hi. I have a problem when I run a java code on the server. the error is:
SEVERE: vmlinuz.old
java.io.FileNotFoundException: /vmlinuz.old (Permission denied). what is the vmlinuz?h_eftekhariMon, 10 Nov 2014 09:07:05 +0100https://ask.sagemath.org/question/24825/How to setup Java and Safari for interactive 3D plots under Maverickshttps://ask.sagemath.org/question/23703/how-to-setup-java-and-safari-for-interactive-3d-plots-under-mavericks/ Hi all,
What is the best way to configure Java and Safari for interactive 3D plots under Mavericks using the JMole Applet?
Regards,
Adam Hausknecht
Department of Mathematics
UMass DartmouthahausknechtWed, 06 Aug 2014 19:02:24 +0200https://ask.sagemath.org/question/23703/Safari update breaking Java in Sage?https://ask.sagemath.org/question/10053/safari-update-breaking-java-in-sage/Today none of my Mac-using students could get Jmol stuff to display in class---and when I tried to use the notebook I'd written for class, it would no longer display for me, either! We all got the error "You do not have Java applets enabled in your web browser, or your browser is blocking this applet.
Check the warning message from your browser and/or enable Java applets in
your web browser preferences, or install the Java Runtime Environment from www.java.com"
Of course,
(1) I do have Java applets enabled in Safari (yes, I double-checked) and
(2) I do have the most recent JRE installed (yes, I double-checked).
Everything was working fine last week after the latest JRE update... and the only thing that has changed since then is that Safari updated to 6.0.4. I'm wondering whether the new Java handling (case-by-case) is not being triggered by Sage and that's why we're not able to get Jmol to work.
Or, am I missing something else that will get Java to work?
smbelcasMon, 22 Apr 2013 21:06:51 +0200https://ask.sagemath.org/question/10053/Sage 5.5 + OS Mountain Lion + Chrome or Firefox or Safari -> interactive 3d plotting failhttps://ask.sagemath.org/question/9697/sage-55-os-mountain-lion-chrome-or-firefox-or-safari-interactive-3d-plotting-fail/Hi all, i'm running Sage 5.5 with Apple OS Mountain Lion. Running a Sage notebook on Chrome, Firefox, or Safari, i can't get Jmol to make my 3d plots interactive. When i click the 'make interactive' button, i get a 'missing plug-in' error link which refers me to [this Java page](http://www.java.com/en/download/mac_download.jsp) to download Java 7. Do i really need Java 7 to make 3d plots interactive? I ask, because the java download page has this warning:
If you download Java 7, you will not be able to run Java content in Chrome and will need to use a
64-bit browser (such as Safari or Firefox) to run Java content within a browser. Additionally,
installing Java 7 will disable the ability to use Apple Java 6 on your system.
By the way, i did not have this problem with Sage 5.4 and Apple OS Lion.araichevTue, 08 Jan 2013 15:55:34 +0100https://ask.sagemath.org/question/9697/