[sage-support] Re: (x-3)/2--Maxima
I figured it out. Put the denom and num into varibles, then expanded the expression with 1/denom times the num. On Jan 15, 1:46 pm, Mikie wrote: > Is there anyway to get Maxima to do (x-3)/2 to produce 1/2x-3/2? > Thanx -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] (x-3)/2--Maxima
Is there anyway to get Maxima to do (x-3)/2 to produce 1/2x-3/2? Thanx -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Moodle, Stack question, Twisted server, math grant money
Is anyone interested in collaborating for some of the math education grant money? I have already create the following online math learning system. Check out the demo movies. Eduscape’s online math learning system Features • Thousands of pages of content(html) • Quizzes – Using the Stack Question(Maxima CAS – based) 1. Many forms of the correct answer 2. Gives partial credit(rubrics) 3. Worked solutions 4. Random questions 5. Multiple part questions on the same page(step by step progress) • Math learning movies (Camtasia) • Moodle (learning management system) • Twisted math server (allows students to get interactive math help). The following servers are ready – Algebra, Calculus, Differential Equations, and Statistics. Demo movie (Moodle) (link -- http://www.pirsqrt.com/Movies/EduLearningDemo1a/StackDemo1b.html) Demo movie (Stack Question) (link -- http://www.pirsqrt.com/Movies/StackDemo2a/StackDemo2a.html) Demo movie (Algebra Server) (link -- http://www.pirsqrt.com/Movies/AlgebraServer/Demo1a/TSDemo1b.html) Eduscape (www.emathlearning.com) is interested in helping students learn mathematics. We would like to get involved in acquiring grants with educational institutions. Our courses (algebra, calculus, basic math, statistics, linear algebra, trigonometry, etc.) will be available online in the near future. -- If you are insterested e-mail -- rthomas...@msn.com -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: latex binary and dvips binary
I am using the latex in Moodle and I had Moodle's latex filter turned on. I removed it and the fonts are great. Before it was creating an image. On Dec 18, 2:22 am, "ma...@mendelu.cz" wrote: > I think that better is to use scalable fonts. this should be default > in modern distribution. What exactly you have installed? texlive? from > where, from texlive homepage or from centos repository? > > Try to compile you ps into PDF (using ps2pdf), open PDF document, go > to the document - properties and you should see the fonts used in the > PDf file. Check that there are only scalable fonts. There shoud be no > Type3 font! > > Or put the ps or pdf file somewhere and post link. > > Robert > > On 18 pro, 09:42, Dima Pasechnik wrote: > > > > > Are you talking about the postscript files produced by dvips? > > You probably only installed a small subset of fonts, and scaling them > > produces substandard results. It can also be that dvips is set up to > > create 300 DPI (dots per inch) docs - this is easy to fix then (but > > depends upon a particular setup). > > You can try using -D option of dvips (with value 600, say) > > HTH, > > Dmitrii > > > 2009/12/18 Mikie : > > > > It took about hour and a half. The fonts are a little fuzzy. Is > > > there anyway to fix this? > > > > On Dec 17, 11:38 am, Mikie wrote: > > >> Robert, great stuff. I am installing now. How long does it take? > > > >> On Dec 17, 1:33 am, "ma...@mendelu.cz" wrote: > > > >> > I think that rpm cannot be used to install into home directory, since > > >> > the install patch is hardwired in the rpm. Ask at the forum specific > > >> > to your distribution. > > > >> > You can also try to install from sources or texlive. I think that both > > >> > can be installed to home directory without root priviledges. But you > > >> > have to make this installation accessible to all users (or at least > > >> > the users which run sage). System wide installation under root > > >> > priviledges is better, of course. > > > >> > Robert > > > >> > On 16 pro, 14:39, Mikie wrote: > > > >> > > I have to do it in my home directory. I have the two files -- tet- > > >> > > latex 3.0-33.8.el5.ie386.rpm and tet-dvips 3.0-33.8.el5.ie386.rpm. > > >> > > This for Centos 5.3. Now what do I do. > > > >> > > On Dec 16, 5:55 am, Dima Pasechnik wrote: > > > >> > > > you can install tex in your home directory. > > > >> > > > You would not need root permissions for this > > >> > > > (but make sure you have enough disk space - I imagine such > > >> > > > providers > > >> > > > have disk quotas; a reasonable installation of tex can easily take > > >> > > > 250Mb or so -- you get get away with much less, but this would > > >> > > > require > > >> > > > some work) > > > >> > > > 2009/12/16 Mikie : > > > >> > > > > BlueHost is my webhost. I have talked to support and they won't > > >> > > > > install latex binary or dvips binary. > > > >> > > > > On Dec 15, 11:25 am, Jaap Spies wrote: > > >> > > > >> Mikie wrote: > > >> > > > >> > I tried yum install textlive and it gave me the following > > >> > > > >> > error--"error accessing file for config file ///etc/yum.conf. > > >> > > > >> > I can't get to the Package Manager. It is on BlueHost. > > > >> > > > >> What is "BlueHost"? OK:http://www.bluehost.com/ > > > >> > > > >> Maybe you can ask support from this provider? > > > >> > > > >> Cheers, > > > >> > > > >> Jaap > > > >> > > > > -- > > >> > > > > To post to this group, send email to > > >> > > > > sage-support@googlegroups.com > > >> > > > > To unsubscribe from this group, send email to > > >> > > > > sage-support+unsubscr...@googlegroups.com > > >> > > > > For more options, visit this group > > >> > > > > athttp://groups.google.com/group/sage-support > > >> > > > > URL:http://www.sagemath.org > > > >> > &g
[sage-support] Re: latex binary and dvips binary
It took about hour and a half. The fonts are a little fuzzy. Is there anyway to fix this? On Dec 17, 11:38 am, Mikie wrote: > Robert, great stuff. I am installing now. How long does it take? > > On Dec 17, 1:33 am, "ma...@mendelu.cz" wrote: > > > > > I think that rpm cannot be used to install into home directory, since > > the install patch is hardwired in the rpm. Ask at the forum specific > > to your distribution. > > > You can also try to install from sources or texlive. I think that both > > can be installed to home directory without root priviledges. But you > > have to make this installation accessible to all users (or at least > > the users which run sage). System wide installation under root > > priviledges is better, of course. > > > Robert > > > On 16 pro, 14:39, Mikie wrote: > > > > I have to do it in my home directory. I have the two files -- tet- > > > latex 3.0-33.8.el5.ie386.rpm and tet-dvips 3.0-33.8.el5.ie386.rpm. > > > This for Centos 5.3. Now what do I do. > > > > On Dec 16, 5:55 am, Dima Pasechnik wrote: > > > > > you can install tex in your home directory. > > > > > You would not need root permissions for this > > > > (but make sure you have enough disk space - I imagine such providers > > > > have disk quotas; a reasonable installation of tex can easily take > > > > 250Mb or so -- you get get away with much less, but this would require > > > > some work) > > > > > 2009/12/16 Mikie : > > > > > > BlueHost is my webhost. I have talked to support and they won't > > > > > install latex binary or dvips binary. > > > > > > On Dec 15, 11:25 am, Jaap Spies wrote: > > > > >> Mikie wrote: > > > > >> > I tried yum install textlive and it gave me the following > > > > >> > error--"error accessing file for config file ///etc/yum.conf. > > > > >> > I can't get to the Package Manager. It is on BlueHost. > > > > > >> What is "BlueHost"? OK:http://www.bluehost.com/ > > > > > >> Maybe you can ask support from this provider? > > > > > >> Cheers, > > > > > >> Jaap > > > > > > -- > > > > > To post to this group, send email to sage-support@googlegroups.com > > > > > To unsubscribe from this group, send email to > > > > > sage-support+unsubscr...@googlegroups.com > > > > > For more options, visit this group > > > > > athttp://groups.google.com/group/sage-support > > > > > URL:http://www.sagemath.org > > > > > -- > > > > Dmitrii Pasechnik > > > > - > > > > DISCLAIMER: Any text following this sentence does not constitute a > > > > part of this message, and was added automatically during transmission.- > > > > Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: latex binary and dvips binary
Robert, great stuff. I am installing now. How long does it take? On Dec 17, 1:33 am, "ma...@mendelu.cz" wrote: > I think that rpm cannot be used to install into home directory, since > the install patch is hardwired in the rpm. Ask at the forum specific > to your distribution. > > You can also try to install from sources or texlive. I think that both > can be installed to home directory without root priviledges. But you > have to make this installation accessible to all users (or at least > the users which run sage). System wide installation under root > priviledges is better, of course. > > Robert > > On 16 pro, 14:39, Mikie wrote: > > > > > I have to do it in my home directory. I have the two files -- tet- > > latex 3.0-33.8.el5.ie386.rpm and tet-dvips 3.0-33.8.el5.ie386.rpm. > > This for Centos 5.3. Now what do I do. > > > On Dec 16, 5:55 am, Dima Pasechnik wrote: > > > > you can install tex in your home directory. > > > > You would not need root permissions for this > > > (but make sure you have enough disk space - I imagine such providers > > > have disk quotas; a reasonable installation of tex can easily take > > > 250Mb or so -- you get get away with much less, but this would require > > > some work) > > > > 2009/12/16 Mikie : > > > > > BlueHost is my webhost. I have talked to support and they won't > > > > install latex binary or dvips binary. > > > > > On Dec 15, 11:25 am, Jaap Spies wrote: > > > >> Mikie wrote: > > > >> > I tried yum install textlive and it gave me the following > > > >> > error--"error accessing file for config file ///etc/yum.conf. > > > >> > I can't get to the Package Manager. It is on BlueHost. > > > > >> What is "BlueHost"? OK:http://www.bluehost.com/ > > > > >> Maybe you can ask support from this provider? > > > > >> Cheers, > > > > >> Jaap > > > > > -- > > > > To post to this group, send email to sage-support@googlegroups.com > > > > To unsubscribe from this group, send email to > > > > sage-support+unsubscr...@googlegroups.com > > > > For more options, visit this group > > > > athttp://groups.google.com/group/sage-support > > > > URL:http://www.sagemath.org > > > > -- > > > Dmitrii Pasechnik > > > - > > > DISCLAIMER: Any text following this sentence does not constitute a > > > part of this message, and was added automatically during transmission.- > > > Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: latex binary and dvips binary
I have to do it in my home directory. I have the two files -- tet- latex 3.0-33.8.el5.ie386.rpm and tet-dvips 3.0-33.8.el5.ie386.rpm. This for Centos 5.3. Now what do I do. On Dec 16, 5:55 am, Dima Pasechnik wrote: > you can install tex in your home directory. > > You would not need root permissions for this > (but make sure you have enough disk space - I imagine such providers > have disk quotas; a reasonable installation of tex can easily take > 250Mb or so -- you get get away with much less, but this would require > some work) > > 2009/12/16 Mikie : > > > > > > > BlueHost is my webhost. I have talked to support and they won't > > install latex binary or dvips binary. > > > On Dec 15, 11:25 am, Jaap Spies wrote: > >> Mikie wrote: > >> > I tried yum install textlive and it gave me the following > >> > error--"error accessing file for config file ///etc/yum.conf. > >> > I can't get to the Package Manager. It is on BlueHost. > > >> What is "BlueHost"? OK:http://www.bluehost.com/ > > >> Maybe you can ask support from this provider? > > >> Cheers, > > >> Jaap > > > -- > > To post to this group, send email to sage-support@googlegroups.com > > To unsubscribe from this group, send email to > > sage-support+unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/sage-support > > URL:http://www.sagemath.org > > -- > Dmitrii Pasechnik > - > DISCLAIMER: Any text following this sentence does not constitute a > part of this message, and was added automatically during transmission.- Hide > quoted text - > > - Show quoted text - -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: latex binary and dvips binary
BlueHost is my webhost. I have talked to support and they won't install latex binary or dvips binary. On Dec 15, 11:25 am, Jaap Spies wrote: > Mikie wrote: > > I tried yum install textlive and it gave me the following > > error--"error accessing file for config file ///etc/yum.conf. > > I can't get to the Package Manager. It is on BlueHost. > > What is "BlueHost"? OK:http://www.bluehost.com/ > > Maybe you can ask support from this provider? > > Cheers, > > Jaap -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: latex binary and dvips binary
I tried yum install textlive and it gave me the following error--"error accessing file for config file ///etc/yum.conf. I can't get to the Package Manager. It is on BlueHost. On Dec 15, 10:18 am, Minh Nguyen wrote: > Hi Mikie, > > On Wed, Dec 16, 2009 at 4:14 AM, Mikie wrote: > > Centos 5.3 on BlueHost. > > You should use the package manager for your operating system. For > CentOS, Fedora and Red Hat, a package manager to use is "yum". For > example, you could install LaTeX as follows: > > yum install texlive > > -- > Regards > Minh Van Nguyen -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: latex binary and dvips binary
Centos 5.3 on BlueHost. On Dec 15, 9:52 am, Jaap Spies wrote: > Mikie wrote: > > I need latex binary and dvips binary. My Linux is poor. Where do I > > get it and how to install. > > What OS are you on? Linux, but which distribution? > > Jaap -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: latex binary and dvips binary
I need latex binary and dvips binary. My Linux is poor. Where do I get it and how to install. On Dec 14, 4:30 pm, Minh Nguyen wrote: > Hi Mikie, > > On Tue, Dec 15, 2009 at 10:04 AM, Mikie wrote: > > Is the latex and dvips binary installed in the Sage directory? If so > > where? > > If you're asking whether or not LaTeX is distributed with Sage, the > answer is no. If you're asking whether or not dvips is distributed > with Sage, the answer is again no. The README.txt for Sage 4.2.1 > contains this section: > > 10. OPTIONAL: It is recommended that you have both LaTeX > and the ImageMagick tools (e.g., the "convert" command) installed > since some plotting functionality benefits from it. > > You don't need to have LaTeX or a LaTeX distribution installed on your > system in order to install/use Sage. However, if you want to build the > PDF version of the Sage standard documentation, then you definitely > need to have LaTeX. > > -- > Regards > Minh Van Nguyen -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] latex binary and dvips binary
Is the latex and dvips binary installed in the Sage directory? If so where? Thanx -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: maxima-great stats
Hi Harald, No I don't have R. I did convert the list(str) to a real list and did a trap on that and it did work. How do I get R into Sage? Thanx On Nov 17, 2:58 pm, Harald Schilly wrote: > On Nov 17, 10:10 pm, Mikie wrote: > > > student tTest > > Hi, do you know that there is R inside Sage? An example right from > sagenb.org: > > import rpy2.robjects as robjects > data = robjects.IntVector([44,55,56,14*2]) > ttest = robjects.r['t.test'] > print ttest(data) > > gives: > > One Sample t-test > > data: c(44L, 55L, 56L, 28L) > t = 7.0263, df = 3, p-value = 0.005922 > alternative hypothesis: true mean is not equal to 0 > 95 percent confidence interval: > 25.02843 66.47157 > sample estimates: > mean of x > 45.75 -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] maxima-great stats
I am using the stats package in Maxima. Works great. Don't have to use "eval". I developing a function for the student tTest. take a list for the data. I put some bad data in the list --example- [44,55,55/0,14*2]. Maxima takes the list in and finds the divide by 0. By the way the "14*2" works also. If I put the try-exception on the input from the html page. The server hings up. Where do I put it? My function is below def tTest(self,data1,conf,alt,mean_):#this works maxima.load("stats") dat =data1;con="conflevel="+str(conf);alt1a="alternative="+str (alt) me_="mean="+str(mean_) a1=maxima.test_mean(dat,con,alt1a,me_) a2=str(a1) str1="Student tTest" return str1,a2 --- Thanx -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] maxima stats
Just looking at the stats package in Maxima. Not bad. Is there anyway to take out parts of the calculations? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: just Maxima
Robert, Can one load just Maxima using a Python script? Something like import maxima I sent you an e-mail. Your work with calculaus is great. My tutoring servers are getting better with time. Thanx On Nov 12, 3:32 pm, "ma...@mendelu.cz" wrote: > On 12 lis, 23:24, Erik Lane wrote: > > > Both work for me, as well, even though I have a hard time > > understanding the first one... :) > > Ooops, english version is > athttp://user.mendelu.cz/marik/maw/index.php?lang=en&form=main --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: just Maxima
Robert, Bad link. On Nov 12, 11:36 am, "ma...@mendelu.cz" wrote: > Do you mean MAW athttp://user.mendelu.cz/marik/maw/? There are some > forms which take input, run through maxima and show output. Sources > are at sourceforge. Nothing special, since I am not programmer and > cannot write more than simple and primitive scripts. > > I think that if you want to run maxima commands, it is better not to > start Sage but use tools like Maxima PHP (source also available) > athttp://www.my-tool.com/mathematics/maximaphp/ > > Robert > > On 12 lis, 16:58, kcrisman wrote: > > > > > I know that Robert Marik has set something like this up (just Maxima, > > no Sage at all) at his home institution, so perhaps he will comment on > > this. > > > - kcrisman- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] just Maxima
I have developed a Twisted server(Python) for tutoring students. Is it possible to use just Maxima for the functions? My first line is from twisted.web import static,server,http from sage.all import* from twisted.internet import stdio, reactor, protocol from twisted.spread import pb from twisted.internet.protocol import Protocol, Factory import sage.server.notebook.notebook from twisted.web.resource import Resource from twisted.web.static import File from twisted.web.server import Site import math import re import sys Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Sage upgrade
Marshall, It 8 hours to do the initial install from the source. I would like to evade this. Mikie On Nov 10, 2:54 pm, Marshall Hampton wrote: > do: > > sage -upgrade > > from a shell and after downloading some information you will have to > respond "Y" to whether you want to continue. If sage isn't installed > into your path then you would do "/path/to/sage/sage -upgrade" where / > path/to/sage/ is whatever the sage install directory is. > > But I think doing a source upgrade from 3.2 won't be too different > from just compiling 4.2 directly, which might be a better option. > > -Marshall Hampton > > On Nov 10, 3:27 pm, Mikie wrote: > > > > > Simon, > > > No, I haven't any upgrade. > > Could you tell explicitly what to do for the upgrade? > > > On Nov 10, 1:33 pm, Simon King wrote: > > > > Hi Mikie > > > > On 10 Nov., 16:42, Mikie wrote: > > > > > I would like to upgrade from 3.2 to 4.??. The computer is a P4 in my > > > > network. When I did 3.2 I tried the binaries and they didn't work. > > > > Something about didn't work on this computer. Thus I used the source > > > > and 8 hours later it finished. > > > > So, you did build 3.2 from source, and it worked. But then, > > > sage -upgrade > > > should work as well. Did you try it already? > > > > Cheers, > > > Simon- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Sage upgrade
Simon, No, I haven't any upgrade. Could you tell explicitly what to do for the upgrade? On Nov 10, 1:33 pm, Simon King wrote: > Hi Mikie > > On 10 Nov., 16:42, Mikie wrote: > > > I would like to upgrade from 3.2 to 4.??. The computer is a P4 in my > > network. When I did 3.2 I tried the binaries and they didn't work. > > Something about didn't work on this computer. Thus I used the source > > and 8 hours later it finished. > > So, you did build 3.2 from source, and it worked. But then, > sage -upgrade > should work as well. Did you try it already? > > Cheers, > Simon --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Sage upgrade
I would like to upgrade from 3.2 to 4.??. The computer is a P4 in my network. When I did 3.2 I tried the binaries and they didn't work. Something about didn't work on this computer. Thus I used the source and 8 hours later it finished. If I use the binaries for 4.?? will they now work. Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: maxima
Willian, I found it. In /local/bin/ On Nov 4, 9:26 am, William Stein wrote: > On Wed, Nov 4, 2009 at 8:24 AM, Mikie wrote: > > > Willian, Thanks, I found it. How do I start it. > > Type > > ./sage -maxima > > from the root of your Sage install. > > -- william > > > > > > > > > On Nov 4, 8:35 am, William Stein wrote: > >> On Wed, Nov 4, 2009 at 7:22 AM, Mikie wrote: > > >> > Is the Maxima that Sage uses a full version? > > >> Yes > > >> > Where is Maxima in the > >> > Sage directory? Can I load Maxima and do some command line work? > > >> sage -maxima > > >> > Thanx > > >> -- > >> William Stein > >> Associate Professor of Mathematics > >> University of Washingtonhttp://wstein.org > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: maxima
Willian, Thanks, I found it. How do I start it. On Nov 4, 8:35 am, William Stein wrote: > On Wed, Nov 4, 2009 at 7:22 AM, Mikie wrote: > > > Is the Maxima that Sage uses a full version? > > Yes > > > Where is Maxima in the > > Sage directory? Can I load Maxima and do some command line work? > > sage -maxima > > > Thanx > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] maxima
Is the Maxima that Sage uses a full version? Where is Maxima in the Sage directory? Can I load Maxima and do some command line work? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] maxima to sage
Is there anyway to convert a maxima expression ('sage.interfaces.maxima.MaximaElement') to ('sage.calculus.SymbolicArithmetic')? I need to use Sage's factor instead of Maxima's. Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: maxima to sage
Yes, David, thanks. I fixed it with repr and SR. On Nov 3, 1:38 pm, David Joyner wrote: > Does this help? > > sage: f = maxima("x^2-1") > sage: type(f) > > sage: ff = f.sage() > sage: type(ff) > > sage: ff.factor() > (x - 1)*(x + 1) > > > > On Tue, Nov 3, 2009 at 3:28 PM, Mikie wrote: > > > Is there anyway to convert a maxima expression > > ('sage.interfaces.maxima.MaximaElement') to > > ('sage.calculus.SymbolicArithmetic')? > > > I need to use Sage's factor instead of Maxima's. > > Thanx- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: maxima's '
Simon, The reason I don't like \over is because I am using Asciimath for the pretty print output on my servers. I couldn't get sMath to work. When I use SR on an integral it calculates the integral. I do have a Python book and have read it. It is too bad Sage doesn't have a hold function. It doesn't look like what I want is doable. Thanks for your help (William and Simon). On Oct 28, 3:05 am, Simon King wrote: > Mikie, > > On 28 Okt., 08:36, Simon King wrote: > > > On 27 Okt., 23:48, Mikie wrote: > > > > I have it kind of working. When I do the latex on the integral or > > > answer if their is fraction I get an \over. I get to get \frac{?} > > > {?}. Is there anyway to do this? > > > Did you read the post to which you answered? > > Or perhaps I did not properly read (but honestly, I find it often > enough very difficult to understand what your real concern is). Sorry. > > Say, you came as far as in my example session > sage: x=sage.calculus.calculus.maxima('x') > sage: f = getattr(x,"'integrate")(x) > sage: g = SR(f) > sage: latex(f) > \int {x}{\;dx} > sage: latex(g) > \int x\,{d x} > > Do I understand correctly that one of these latex typesettings for the > integral suites you? > > As you see, MaximaElement (the type of f) has a different latex > typesetting than Expression (the type of g). > > Let's evaluate the integral: > sage: r = sage_eval(str(g),globals()) > sage: type(r) > > This is because of the above re-definition of x as a MaximaElement in > the global namespace. > > And again, there are different typesettings available for different > data types: > > sage: latex(r) > {{x^2}\over{2}} > > I understand that you don't like it. So, why not try this: > sage: latex(SR(r)) > \frac{1}{2} \, x^{2} > > Cheers, > Simon --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: maxima's '
I have it kind of working. When I do the latex on the integral or answer if their is fraction I get an \over. I get to get \frac{?} {?}. Is there anyway to do this? I also need this to work in function in a Python script. On Oct 27, 4:33 pm, Simon King wrote: > Hi! > > On 27 Okt., 23:19, Mikie wrote: > > > When I get to > > latex(g) > > I get > > {{x^2}\over{2}} no integral. > > I am using Sage V3.4. Could this be causing the problem? > > Probably. The whole "symbolics" stuff has changed since then. A > complete session with version 4.2: > sage: x=sage.calculus.calculus.maxima('x') > sage: f = getattr(x,"'integrate")(x) > sage: latex (f) > \int {x}{\;dx} > sage: g = SR(f) > sage: latex (g) > \int x\,{d x} > > Simon --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: maxima's '
When I get to latex(g) I get {{x^2}\over{2}} no integral. I am using Sage V3.4. Could this be causing the problem? On Oct 27, 3:03 pm, William Stein wrote: > On Tue, Oct 27, 2009 at 1:49 PM, Mikie wrote: > > > If one enters in Maxima (The windows version). 'integrate(x,x) it > > produces the integral x dx. Does not calculate. So, what I am asking > > how do I do this in Sage? I have tried maxima.'integrate(x,x) and > > many other combinations but they all produce a syntax error. How do I > > do it in Sage? > > You might find this example session in some way helpful: > > sage: f = sage.calculus.calculus.maxima("'integrate(x,x)") > sage: f > 'integrate(x,x) > sage: g = SR(f); g > integrate(x, x) > sage: latex(g) > \int x\,{d x} > sage: sage_eval(str(g), globals()) > 1/2*x^2 > > > > > On Oct 27, 1:48 pm, William Stein wrote: > >> On Tue, Oct 27, 2009 at 12:06 PM, Mikie wrote: > > >> > Is there anyway to use maxima's -- '--- in the version of Maxiam in > >> > Sage? > > >> I don't understand what you're asking. However, I can say with > >> certainty that the answer is "yes". > > >> William > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: maxima's '
If one enters in Maxima (The windows version). 'integrate(x,x) it produces the integral x dx. Does not calculate. So, what I am asking how do I do this in Sage? I have tried maxima.'integrate(x,x) and many other combinations but they all produce a syntax error. How do I do it in Sage? On Oct 27, 1:48 pm, William Stein wrote: > On Tue, Oct 27, 2009 at 12:06 PM, Mikie wrote: > > > Is there anyway to use maxima's -- '--- in the version of Maxiam in > > Sage? > > I don't understand what you're asking. However, I can say with > certainty that the answer is "yes". > > William --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] maxima's '
Is there anyway to use maxima's -- '--- in the version of Maxiam in Sage? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] hold function
Does anyone have a Sage hold frunction? Look at the code below - def LikeSimplify1a(ex1,ex2,ex3,ex4): eq1=str(ex1)+"+"+"("+str(ex2)+")"+"+"+"("+str(ex3)+")"+"+"+"("+str (ex4)+")" n1=SR(ex1);n2=SR(ex2);n3=SR(ex3);n4=SR(ex4) eq2=maxima.ratsimp(n1+n2+n3+n4) return eq1,eq2 Input a1=LikeSimplify1a('-2*(-x-2*x^2-x)','-sqrt(12)-x','-2*(4-10)','10');a1 [0];a1[1];#a1[2] --- Output --- '-2*(-x-2*x^2-x)+(-sqrt(12)-x)+(-2*(4-10))+(10)' 4*x^2+3*x-2*sqrt(3)+22 This is in the notebook and is about what I want. When I use it on my server the -sqrt(12) becomes -2sqrt(3). I don't want this. Can anyone help me with a hold function that works in a Python script? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: sqrt(16)
Thanks, Burcin. I tried using a string rep, but it still evaluates in my Python script. On Oct 23, 1:12 am, Burcin Erocal wrote: > On Thu, 22 Oct 2009 15:16:32 -0700 (PDT) > > Mikie wrote: > > I want to take the expression sqrt(16) from a function parameter and > > return the sqrt(16) not 4. Is this possible? > > Not right now, sorry. > > I have an idea how to "hold" symbolic expressions so they are not > evaluated automatically, but it will be at least a week before I can > test it and submit a patch. > > Cheers, > Burcin --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] sqrt(16)
I want to take the expression sqrt(16) from a function parameter and return the sqrt(16) not 4. Is this possible? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: slope function
Thanks, either suggestion worked. I was doing this in my definite integral function. Robert, someone hacked my e-mail. I just sent you a new e-mail this morning. I would really like to collaborate with you on the server, if you are interested. We are doing very similar things. Do you have time? Where are you (CZ)? On Oct 16, 2:43 pm, "ma...@mendelu.cz" wrote: > On 16 říj, 21:32, Laurent wrote: > > > a = 1 > > b = 2 > > c = 3 > > d = 8 > > print "\\frac{",a,"-",b,"}{",c,"-",d,"}=",(a-b)/(c-d) > > perhaps print "\\frac{",a,"-(",b,")}{",c,"-",d,"}=",(a-b)/(c-d) if > b<0 > > Robert --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] slope function
I am trying to create a simple slope of a line function that shows all the steps in calculating a slope. It takes four numeric values. In the first step I would like the user to see m =(1-2)/(3+8). Pretty print. Using latex? I would then do some simplifying and show m= (-1/11). I have tried several approaches with not success. Is there anyway to do this? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: plot(from server)
OK, I create a function that takes the expression from my form and then it does the plot which creates the png file. Then I display the image(plot) in the html page. The image has been saved on the server. When the session is over the image will still be on the server. I would like the image to be removed after the session. On Oct 15, 10:19 am, William Stein wrote: > On Thu, Oct 15, 2009 at 8:58 AM, Jason Grout > > wrote: > > > Mikie wrote: > >> When my users create a plot and their graphing session is finished how > >> do I remove the png file? > > > Did you try googling for the answer? > > I think his question is sufficiently vague that your answer might not > be what he's asking. > > Mikie -- I find your question too ambiguous/vague. Can you please be > more precise? > > > > > > > > > I typed "python remove files" into google and the first result was the > > documentation for the relevant python commands, and the second result > > contained the equivalent question (how do I remove a file) and had an > > answer with a 2-line example. > > > Thanks, > > > Jason > > > -- > > Jason Grout > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: plot(from server)
When my users create a plot and their graphing session is finished how do I remove the png file? On Oct 14, 3:54 pm, Jason Grout wrote: > Mikie wrote: > > Jason, > > > Looks too easy. > > I am doing this all in a Python script. > > From your answer, it sounds like you figured it out then. Great! > > Jason > > > > > On Oct 14, 2:59 pm, Jason Grout wrote: > >> Mikie wrote: > >>> I want to include a simple plotting form in my server. I noticed in > >>> the notebook the plotting function creates an image. It must save it > >>> to the server then display it. > >>> My output page displays strings > >>> request.write("%s" % part1) > >>> Is there anyway to get it to display an image? > >> Save the image to a file and then use the tag to display that file. > > >> sage: plot(x^2,(x,0,1)).save('test.png') > > >> Now use > > >> Jason- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: plot(from server)
Jason, Looks too easy. I am doing this all in a Python script. On Oct 14, 2:59 pm, Jason Grout wrote: > Mikie wrote: > > I want to include a simple plotting form in my server. I noticed in > > the notebook the plotting function creates an image. It must save it > > to the server then display it. > > > My output page displays strings > > request.write("%s" % part1) > > > Is there anyway to get it to display an image? > > Save the image to a file and then use the tag to display that file. > > sage: plot(x^2,(x,0,1)).save('test.png') > > Now use > > Jason --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] plot(from server)
I want to include a simple plotting form in my server. I noticed in the notebook the plotting function creates an image. It must save it to the server then display it. My output page displays strings request.write("%s" % part1) Is there anyway to get it to display an image? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] import
My Python script is getting very large. The html pages I am creating are all class defs. Can I save the defs in a text file then import them? If so where do I put them. Isn't Sage just one large bounce of Python files? Please, excuse my lack of Python/Sage knowledge. Six months ago I couldn't spell Sage, Linux, Python. Try my server (no error trapping.) http://pirsqr.com:7316 or http://pirsqr.com:2713 Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: latex
Robert, thanks the R3=maxima.rhs(R1).sage() worked. --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: latex
Here is the example that is the problem. Your last suggestion did solve the problem with maxima.solve. But now how do I stop the other \over. --- def CSquare(r1): eq11=r1;y=b*1 w1=maxima.subst(eq11,b,y) w2 = latex(eq11); w5 = "$"+w2+"=0"+"$" V1=p/2;RHalf=maxima.coeff(V1,p,1);#this is 1/2 LSide1a=maxima.lhs(w1) L1= maxima.coeff(LSide1a,x,1)#coef of linear term L2= maxima.coeff(LSide1a,x,0)#constant L3= maxima.coeff(LSide1a,x**2,1)#constant eq2=factor(w1) eq4=(1/L3)*LSide1a#mult by coef of quad eq10=expand(eq4)#div out the constant #print eq10 R2 = latex(eq10);R3="$"+R2+"$" M1=maxima.args(eq10);L10=len(M1) Cof1=maxima.args(eq10);Cof1a=Cof1[1];Cof1b=Cof1[2] Const = Cof1[2] #constant Half2=maxima.coeff(Cof1a,x,1); val2=(RHalf*(Half2))**2 #Addon Addon=maxima.ev(val2*val2) eq5=M1[0]+M1[1]+val2 Rside = -Cof1b+val2 eq22=eq5;z=b*1==Cof1b w3=maxima.subst(eq5,b,z) eq6=factor(eq5) w4=maxima.subst(eq6,b,z) LeftS=maxima.lhs(eq6+Rside) eq7=Cof1a eq8=Rside Soln=solve(w1) return w5,R3,eq5,eq22,eq6,Rside,Soln - Here is the output '${x}^{2} - x - \\frac{3}{2}=0$' '$x^2-x-{{3}\\over{2}}$'<<<<<<<<< the problem x^2-x+1/4 x^2-x+1/4 (2*x-1)^2/4 7/4 [x=-(sqrt(7)-1)/2,x=(sqrt(7)+1)/2] -- Input --val1=CSquare(x^2-x-3/2);val1[0];val1[1];val1[2];val1[3];val1 [4];val1[5];val1[6] On Oct 6, 3:51 pm, "ma...@mendelu.cz" wrote: > This \over is from Maxima. > try > > a1=maxima.solve(x^2-x-3,x) > R1=a1[0] > R3=maxima.rhs(R1).sage() > latex(R3) > > R. > > On 6 říj, 22:25, Mikie wrote: > > > > > Yes, your right. I am latexing a value from maxima.solve(x^2-x-3,x). > > Then maxima.rhs(). Then latexing the value. It still gives me the > > \over. I am using 3.4. > > When I assign it to a variable it works as below. If you would try > > a1=maxima.solve(x^2-x-3,x) > > R1=a1[0] > > R3=maxima.rhs[R1] > > latex(R3) > > produces -- {{1-\sqrt{13}}\over{2}} > > not good > > > On Oct 6, 1:46 pm, "ma...@mendelu.cz" wrote: > > > > Hm, this is my Sage 4.1.1 > > > > a1=-(sqrt(13)-1)/2 > > > latex(a1) > > > > output is -\frac{1}{2} \, \sqrt{13} + \frac{1}{2} > > > > You may have old version of Sage > > > > latex(-{{\sqrt[13]-1\over[2}}) produces error > > > > Robert Marik > > > > On 6 říj, 21:10, Mikie wrote: > > > > > If I have this a1=-(sqrt(13)-1)/2 in a variable, then latex(a1) it > > > > produces -{{\sqrt[13]-1\over[2}}. > > > > If I do latex(-{{\sqrt[13]-1\over[2}}) get \frac{1-\sqrt{13}}{2}, > > > > which is what I want. > > > > > This is in a function. I need the latter. The \over does not do the > > > > pretty print. > > > > Is there a work around? > > > > Thanx > > > > > > > > > def Solver2a(exp1,exp2): > > > > eq11=exp1;w=b*1==0 > > > > w1=maxima.subst(eq11,b,w) > > > > R1 = maxima.solve(exp1,exp2); > > > > w2 = latex(eq11); w3 = "$"+w2+"$" > > > > R2 = latex(R1);R3="$"+R2+"$" > > > > R4 = R1[0];R5=maxima.rhs(R4);R6=latex(R5); > > > > str1="Calculate the symbolic solutions for the following > > > > equation." > > > > str2="And here is the solution :" > > > > return str1,w3,str2,R1,R6,R5 > > > > -- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: 1-dim display(notebook)
I figured out the problem. I was building the quad using coefficients (numeric). I am now taking in a normal quad. Maxima has no effect. On Oct 7, 9:57 am, Mikie wrote: > I have a 2-dim equation. Maxima did it and I don't see anyway to do > it without Maxima. Can this 2-dim equation be converted to 1-dim? > > On Oct 7, 8:37 am, Mikie wrote: > > > > > Version 3.4. The problem I am having is "\over". Maxima is causing > > it, thus I am using Sage-solve. When I Latex the answer I get > > "\frac". It is what I want. > > Thanx > > > On Oct 7, 7:45 am, William Stein wrote: > > > > On Wed, Oct 7, 2009 at 6:41 AM, Mike Hansen wrote: > > > > > Hello, > > > > > On Wed, Oct 7, 2009 at 8:39 PM, Mikie > > > > wrote: > > > > > > Is there anyway to have output in the notebook be 1-dim like input? > > > > > This is the default for the notebook. Do you have the "Typeset" box > > > > checked? > > > > Also, what version of Sage are you using? > > > > version() > > > > William- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: 1-dim display(notebook)
I have a 2-dim equation. Maxima did it and I don't see anyway to do it without Maxima. Can this 2-dim equation be converted to 1-dim? On Oct 7, 8:37 am, Mikie wrote: > Version 3.4. The problem I am having is "\over". Maxima is causing > it, thus I am using Sage-solve. When I Latex the answer I get > "\frac". It is what I want. > Thanx > > On Oct 7, 7:45 am, William Stein wrote: > > > > > On Wed, Oct 7, 2009 at 6:41 AM, Mike Hansen wrote: > > > > Hello, > > > > On Wed, Oct 7, 2009 at 8:39 PM, Mikie wrote: > > > > > Is there anyway to have output in the notebook be 1-dim like input? > > > > This is the default for the notebook. Do you have the "Typeset" box > > > checked? > > > Also, what version of Sage are you using? > > > version() > > > William- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: 1-dim display(notebook)
Version 3.4. The problem I am having is "\over". Maxima is causing it, thus I am using Sage-solve. When I Latex the answer I get "\frac". It is what I want. Thanx On Oct 7, 7:45 am, William Stein wrote: > On Wed, Oct 7, 2009 at 6:41 AM, Mike Hansen wrote: > > > Hello, > > > On Wed, Oct 7, 2009 at 8:39 PM, Mikie wrote: > > > > Is there anyway to have output in the notebook be 1-dim like input? > > > This is the default for the notebook. Do you have the "Typeset" box > > checked? > > Also, what version of Sage are you using? > > version() > > William --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] 1-dim display(notebook)
Is there anyway to have output in the notebook be 1-dim like input? expand((x-2)^2) would produce x^2-4*x+4, not the 2-dim output or pretty print. It seems like I have done it before. Maybe SR(). I would like to copy the output and use as input. Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: latex
Yes, your right. I am latexing a value from maxima.solve(x^2-x-3,x). Then maxima.rhs(). Then latexing the value. It still gives me the \over. I am using 3.4. When I assign it to a variable it works as below. If you would try a1=maxima.solve(x^2-x-3,x) R1=a1[0] R3=maxima.rhs[R1] latex(R3) produces -- {{1-\sqrt{13}}\over{2}} not good On Oct 6, 1:46 pm, "ma...@mendelu.cz" wrote: > Hm, this is my Sage 4.1.1 > > a1=-(sqrt(13)-1)/2 > latex(a1) > > output is -\frac{1}{2} \, \sqrt{13} + \frac{1}{2} > > You may have old version of Sage > > latex(-{{\sqrt[13]-1\over[2}}) produces error > > Robert Marik > > On 6 říj, 21:10, Mikie wrote: > > > > > If I have this a1=-(sqrt(13)-1)/2 in a variable, then latex(a1) it > > produces -{{\sqrt[13]-1\over[2}}. > > If I do latex(-{{\sqrt[13]-1\over[2}}) get \frac{1-\sqrt{13}}{2}, > > which is what I want. > > > This is in a function. I need the latter. The \over does not do the > > pretty print. > > Is there a work around? > > Thanx > > > > > def Solver2a(exp1,exp2): > > eq11=exp1;w=b*1==0 > > w1=maxima.subst(eq11,b,w) > > R1 = maxima.solve(exp1,exp2); > > w2 = latex(eq11); w3 = "$"+w2+"$" > > R2 = latex(R1);R3="$"+R2+"$" > > R4 = R1[0];R5=maxima.rhs(R4);R6=latex(R5); > > str1="Calculate the symbolic solutions for the following > > equation." > > str2="And here is the solution :" > > return str1,w3,str2,R1,R6,R5 > > -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] latex
If I have this a1=-(sqrt(13)-1)/2 in a variable, then latex(a1) it produces -{{\sqrt[13]-1\over[2}}. If I do latex(-{{\sqrt[13]-1\over[2}}) get \frac{1-\sqrt{13}}{2}, which is what I want. This is in a function. I need the latter. The \over does not do the pretty print. Is there a work around? Thanx def Solver2a(exp1,exp2): eq11=exp1;w=b*1==0 w1=maxima.subst(eq11,b,w) R1 = maxima.solve(exp1,exp2); w2 = latex(eq11); w3 = "$"+w2+"$" R2 = latex(R1);R3="$"+R2+"$" R4 = R1[0];R5=maxima.rhs(R4);R6=latex(R5); str1="Calculate the symbolic solutions for the following equation." str2="And here is the solution :" return str1,w3,str2,R1,R6,R5 - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: twisted server
Alex, just sent you an e-mail with code. On Oct 2, 1:29 pm, Alex Clemesha wrote: > On Fri, Oct 2, 2009 at 12:24 PM, Mikie wrote: > > > Alex, you lost me. > > Here is the start of my code for the render > > - > > #This new html page for the calculation > > class rwrite(Resource): > > def render(self,request): > > request.setResponseCode(402) > > request.write(""" > > > > > > > > Equation solver > > How about trying to replace "render" with "render_GET", > and then remove the request.write and instead just return the > html string. Also, you probably dont want/need the > "request.setResponseCode(402)", > as that was just part of the examples you got it from, but not needed > for what you are doing. > > If things still aren't working, maybe post your code in full > somewhere like here:http://pastie.org/and I can take a look. > > -Alex > > > > > > > --- > > I have a request.finish() at the end. > > It works OK in IE8. > > I get a "request.finish" done twice warning. I load it in FireFox > > and it kind of works. At times it displays html code and I refresh > > the screen and the apage shows. > > > On Oct 2, 1:52 pm, Alex Clemesha wrote: > >> On Fri, Oct 2, 2009 at 10:12 AM, Mikie wrote: > > >> > Alex, try > >> >http://pirsqr.com:2713/ > >> > and do the integral calculation. I had to use "request.write" in the > >> > posthandler and it produces the "Request did not return a string". I > >> > can't use "return", because the html page is in parts. > > >> The following should solved this problem: > > >> #do this import: > >> from twisted.web import server > > >> #now in your "render" method, do this: > > >> def render(self, request): > >> ... > >> d = some_method_that_returns_a_deferred(...) > >> d.addCallback(self.my_success_callback, request) > >> return server.NOT_DONE_YET > > >> def my_success_callback(self, request): > >> request.write(...) > >> request.finish() > > >> So that should be it. > > >> -Alex > > >> > On Oct 2, 6:27 am, "Dr. David Kirkby" wrote: > >> >> Alex Clemesha wrote: > >> >> >> root = Resource() > >> >> >> root.putChild("foo", File("/tmp")) > >> >> >> root.putChild("bar", File("/lost+found")) > >> >> >> root.putChild("baz", File("/opt")) > >> >> >> root.putChild("varr", File("/var")) > >> >> >> root.putChild("buy", PaymentRequired()) > >> >> >> root.putChild("men", menu()) > >> >> >> factory = Site(root) > >> >> >> reactor.listenTCP(, factory) > >> >> >> reactor.run() > >> >> >> -- > >> >> >> It will not load the second page. > > >> >> > Do you mean that it will not load the page that > >> >> > shows the contents of "/lost+found"? Maybe there > >> >> > is a problem accessing that directory in the filesystem? > >> >> > Apologies if this is not the question you are asking. > > >> >> > -Alex > > >> >> lost+found would need root access in order to see the contents. It is > >> >> the place where files go when the file system gets in a mess, and as > >> >> such can contain other peoples files. > > >> >> dave- Hide quoted text - > > >> >> - Show quoted text - > > >> -- > >> Alex Clemesha > >> clemesha.org > > -- > Alex Clemesha > clemesha.org- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: twisted server
Alex, you lost me. Here is the start of my code for the render - #This new html page for the calculation class rwrite(Resource): def render(self,request): request.setResponseCode(402) request.write(""" Equation solver --- I have a request.finish() at the end. It works OK in IE8. I get a "request.finish" done twice warning. I load it in FireFox and it kind of works. At times it displays html code and I refresh the screen and the apage shows. On Oct 2, 1:52 pm, Alex Clemesha wrote: > On Fri, Oct 2, 2009 at 10:12 AM, Mikie wrote: > > > Alex, try > >http://pirsqr.com:2713/ > > and do the integral calculation. I had to use "request.write" in the > > posthandler and it produces the "Request did not return a string". I > > can't use "return", because the html page is in parts. > > The following should solved this problem: > > #do this import: > from twisted.web import server > > #now in your "render" method, do this: > > def render(self, request): > ... > d = some_method_that_returns_a_deferred(...) > d.addCallback(self.my_success_callback, request) > return server.NOT_DONE_YET > > def my_success_callback(self, request): > request.write(...) > request.finish() > > So that should be it. > > -Alex > > > > > > > On Oct 2, 6:27 am, "Dr. David Kirkby" wrote: > >> Alex Clemesha wrote: > >> >> root = Resource() > >> >> root.putChild("foo", File("/tmp")) > >> >> root.putChild("bar", File("/lost+found")) > >> >> root.putChild("baz", File("/opt")) > >> >> root.putChild("varr", File("/var")) > >> >> root.putChild("buy", PaymentRequired()) > >> >> root.putChild("men", menu()) > >> >> factory = Site(root) > >> >> reactor.listenTCP(, factory) > >> >> reactor.run() > >> >> -- > >> >> It will not load the second page. > > >> > Do you mean that it will not load the page that > >> > shows the contents of "/lost+found"? Maybe there > >> > is a problem accessing that directory in the filesystem? > >> > Apologies if this is not the question you are asking. > > >> > -Alex > > >> lost+found would need root access in order to see the contents. It is > >> the place where files go when the file system gets in a mess, and as > >> such can contain other peoples files. > > >> dave- Hide quoted text - > > >> - Show quoted text - > > -- > Alex Clemesha > clemesha.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: twisted server
Alex, try http://pirsqr.com:2713/ and do the integral calculation. I had to use "request.write" in the posthandler and it produces the "Request did not return a string". I can't use "return", because the html page is in parts. On Oct 2, 6:27 am, "Dr. David Kirkby" wrote: > Alex Clemesha wrote: > >> root = Resource() > >> root.putChild("foo", File("/tmp")) > >> root.putChild("bar", File("/lost+found")) > >> root.putChild("baz", File("/opt")) > >> root.putChild("varr", File("/var")) > >> root.putChild("buy", PaymentRequired()) > >> root.putChild("men", menu()) > >> factory = Site(root) > >> reactor.listenTCP(, factory) > >> reactor.run() > >> -- > >> It will not load the second page. > > > Do you mean that it will not load the page that > > shows the contents of "/lost+found"? Maybe there > > is a problem accessing that directory in the filesystem? > > Apologies if this is not the question you are asking. > > > -Alex > > lost+found would need root access in order to see the contents. It is > the place where files go when the file system gets in a mess, and as > such can contain other peoples files. > > dave- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: class problem
Minh, thanks so much. Have a good one. On Oct 1, 8:43 am, Minh Nguyen wrote: > On Fri, Oct 2, 2009 at 12:35 AM, Tim Joseph Dumol wrote: > > > All instance functions of a class must take `self` as its first argument. It > > is implicitly passed. > > Also, see the following tutorial for further explanation on why you > need to have "self" when defining methods. > > http://www.freenetpages.co.uk/hp/alan.gauld/tutclass.htm > > -- > Regards > Minh Van Nguyen --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] class problem
I have a class with a lot of def functions. It says 2 args. Right. It says I am passing 3. I am not a Python wizard. Thanx Calling it with val31a=SR(request.args['Expression2'][0]) val30a = SR(request.args['Var2'][0]) s = Rfuncs() ans=s.Integrate3a(val31a,val30a) class Rfuncs: def Integrate3a(exp1,exp2): eq11=exp1;w=b*1 #just an expression w1=maxima.subst(eq11,b,w) R1 = integral(exp1,exp2) w2 = latex(eq11); w3 = "$"+w2+"$" R2 = latex(R1);R3="$"+R2+"$"+"+ Constant" Beq1="$\int" + w2 + "dx$" #print Beq1 str1="Calculate the following integral. \ The default example is an expression you will need to do partial \ fraction decomposition, then integrate each of the parts. \ Try the ParFrac function then try it on your own." str2="The integral is :" return str1,Beq1,str2,R3 --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: twisted server
Alex, yes that worked. Here is my final product. I tried request.write and I it is called twice. Then used return "" with not problem. Is return "??" as good as request.write? from twisted.web.server import Site from twisted.web.resource import Resource from twisted.internet import reactor from twisted.web.static import File class PaymentRequired(Resource): def render(self, request): request.setResponseCode(402) return "Please swipe your credit card." class menu(Resource): def render_GET(self, request): request.setResponseCode(402) return """ Here is some text in menu. """ class HomePage(Resource): def render(self, request): request.setResponseCode(402) return """ Colors Homepage Main What's here: This is the buy page This is the menu This is using request write. """ class rwrite(Resource): def render(self, request): request.setResponseCode(402) return""" Colors index page And a little text. """ root = Resource() root.putChild('', HomePage()) root.putChild("foo", File("/tmp")) root.putChild("bar", File("/lost+found")) root.putChild("baz", File("/opt")) root.putChild("varr", File("/var")) root.putChild("buy", PaymentRequired()) root.putChild("men", menu()) root.putChild("rim", rwrite()) factory = Site(root) reactor.listenTCP(, factory) reactor.run() - On Sep 30, 1:02 pm, Alex Clemesha wrote: > On Wed, Sep 30, 2009 at 11:53 AM, Mikie wrote: > > > No, Alex. It will not access the paymentRequired page. > > Make this change and it should work: > > class menu(Resource): > def render_GET(self, request): > request.setResponseCode(402) > return "Integrater" > > Note the " href='/buy'". > > Does this work for you now? > -Alex > > > > > > > > > On Sep 30, 11:28 am, Alex Clemesha wrote: > >> > root = Resource() > >> > root.putChild("foo", File("/tmp")) > >> > root.putChild("bar", File("/lost+found")) > >> > root.putChild("baz", File("/opt")) > >> > root.putChild("varr", File("/var")) > >> > root.putChild("buy", PaymentRequired()) > >> > root.putChild("men", menu()) > >> > factory = Site(root) > >> > reactor.listenTCP(, factory) > >> > reactor.run() > >> > -- > >> > It will not load the second page. > > >> Do you mean that it will not load the page that > >> shows the contents of "/lost+found"? Maybe there > >> is a problem accessing that directory in the filesystem? > >> Apologies if this is not the question you are asking. > > >> -Alex > > >> > On Sep 29, 8:55 pm, William Stein wrote: > >> >> On Tue, Sep 29, 2009 at 5:12 PM, Alex Clemesha > >> >> wrote: > > >> >> > On Tue, Sep 29, 2009 at 4:42 PM, William Stein > >> >> > wrote: > > >> >> >> On Tue, Sep 29, 2009 at 4:41 PM, Alex Clemesha > >> >> >> wrote: > > >> >> >>> On Tue, Sep 29, 2009 at 8:26 AM, Mikie > >> >> >>> wrote: > > >> >> >>>> Does anyone have an example of a twisted server that loads 2 html > >> >> >>>> pages from a url? > >> >> >>>> --www.twisted.com:8000/page1/,www.twisted.com:8000/page2/ > >> >> >>>> Same port. > >> >> >>> Here are some very nice Twisted web tutorials: > >> >> >>>http://jcalderone.livejournal.com/tag/sixty+seconds > > >> >> >>> You'll be able to figure out you above question, and more, > >> >> >>> pretty easily from them. Send another email if you're still having > >> >> >>> trouble after checking those out. > > >> >> >>> -Alex > > >> >> >> Alex, how hard is it to
[sage-support] Re: twisted server
No, Alex. It will not access the paymentRequired page. On Sep 30, 11:28 am, Alex Clemesha wrote: > > root = Resource() > > root.putChild("foo", File("/tmp")) > > root.putChild("bar", File("/lost+found")) > > root.putChild("baz", File("/opt")) > > root.putChild("varr", File("/var")) > > root.putChild("buy", PaymentRequired()) > > root.putChild("men", menu()) > > factory = Site(root) > > reactor.listenTCP(, factory) > > reactor.run() > > -- > > It will not load the second page. > > Do you mean that it will not load the page that > shows the contents of "/lost+found"? Maybe there > is a problem accessing that directory in the filesystem? > Apologies if this is not the question you are asking. > > -Alex > > > > > > > > > On Sep 29, 8:55 pm, William Stein wrote: > >> On Tue, Sep 29, 2009 at 5:12 PM, Alex Clemesha wrote: > > >> > On Tue, Sep 29, 2009 at 4:42 PM, William Stein wrote: > > >> >> On Tue, Sep 29, 2009 at 4:41 PM, Alex Clemesha > >> >> wrote: > > >> >>> On Tue, Sep 29, 2009 at 8:26 AM, Mikie > >> >>> wrote: > > >> >>>> Does anyone have an example of a twisted server that loads 2 html > >> >>>> pages from a url? > >> >>>> --www.twisted.com:8000/page1/,www.twisted.com:8000/page2/ > >> >>>> Same port. > >> >>> Here are some very nice Twisted web tutorials: > >> >>>http://jcalderone.livejournal.com/tag/sixty+seconds > > >> >>> You'll be able to figure out you above question, and more, > >> >>> pretty easily from them. Send another email if you're still having > >> >>> trouble after checking those out. > > >> >>> -Alex > > >> >> Alex, how hard is it to migrate from "Twisted.web2" which is used in > >> >> Sage back to "Twisted.web"? > >> > Pretty easily actually... the Resource object is pretty similar, the > >> > main difference is that the Web2 Resource object has the "locateChild" > >> > method, > >> > where as the Web Resource has "getChild" - and even those are pretty > >> > similar. > > >> > Also, there's some subtle differences in the way you doing > >> > "rendering"... i.e. with Web2 you subclass Resource/PostableResource and > >> > then > >> > you use the "render" method, where are with Web you just subclass > >> > Resource > >> > and implemented either "render_GET" or "render_POST". > > >> > Probably just looking through the examples here: > >> >http://jcalderone.livejournal.com/tag/sixty+seconds > >> > would be good enough to do the switch. > > >> > The Web code is being actively maintained and improved... One > >> > major improvement that will being going into Twisted 9.0 (due tomorrow on > >> > the Twisted trac actually), is the nice WSGI support (for running > >> > Django, etc). > >> > In Codenode we use the trunk Web code, but in just a couple of days we > >> > will be able to remove all that code, and very cleanly run Django off a > >> > standard install of Twisted, which is extremely convenient. > > >> Thanks. That was incredibly helpful and greatly appreciated. > > >> William- Hide quoted text - > > >> - Show quoted text - > > -- > Alex Clemesha > clemesha.org- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: twisted server
Alex, Works great. But I need a link from the first page to load another page. Here is my code -- from twisted.web.server import Site from twisted.web.resource import Resource from twisted.internet import reactor from twisted.web.static import File class PaymentRequired(Resource): def render_GET(self, request): request.setResponseCode(402) return "Please swipe your credit card." class menu(Resource): def render_GET(self, request): request.setResponseCode(402) return "http://192.168.1.101:/buy/ >Integrater" root = Resource() root.putChild("foo", File("/tmp")) root.putChild("bar", File("/lost+found")) root.putChild("baz", File("/opt")) root.putChild("varr", File("/var")) root.putChild("buy", PaymentRequired()) root.putChild("men", menu()) factory = Site(root) reactor.listenTCP(, factory) reactor.run() -- It will not load the second page. On Sep 29, 8:55 pm, William Stein wrote: > On Tue, Sep 29, 2009 at 5:12 PM, Alex Clemesha wrote: > > > On Tue, Sep 29, 2009 at 4:42 PM, William Stein wrote: > > >> On Tue, Sep 29, 2009 at 4:41 PM, Alex Clemesha wrote: > > >>> On Tue, Sep 29, 2009 at 8:26 AM, Mikie wrote: > > >>>> Does anyone have an example of a twisted server that loads 2 html > >>>> pages from a url? > >>>> --www.twisted.com:8000/page1/,www.twisted.com:8000/page2/ > >>>> Same port. > >>> Here are some very nice Twisted web tutorials: > >>>http://jcalderone.livejournal.com/tag/sixty+seconds > > >>> You'll be able to figure out you above question, and more, > >>> pretty easily from them. Send another email if you're still having > >>> trouble after checking those out. > > >>> -Alex > > >> Alex, how hard is it to migrate from "Twisted.web2" which is used in > >> Sage back to "Twisted.web"? > > Pretty easily actually... the Resource object is pretty similar, the > > main difference is that the Web2 Resource object has the "locateChild" > > method, > > where as the Web Resource has "getChild" - and even those are pretty > > similar. > > > Also, there's some subtle differences in the way you doing > > "rendering"... i.e. with Web2 you subclass Resource/PostableResource and > > then > > you use the "render" method, where are with Web you just subclass Resource > > and implemented either "render_GET" or "render_POST". > > > Probably just looking through the examples here: > >http://jcalderone.livejournal.com/tag/sixty+seconds > > would be good enough to do the switch. > > > The Web code is being actively maintained and improved... One > > major improvement that will being going into Twisted 9.0 (due tomorrow on > > the Twisted trac actually), is the nice WSGI support (for running > > Django, etc). > > In Codenode we use the trunk Web code, but in just a couple of days we > > will be able to remove all that code, and very cleanly run Django off a > > standard install of Twisted, which is extremely convenient. > > Thanks. That was incredibly helpful and greatly appreciated. > > William- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: statistics in sage
There is a nice stats package in Scipy with Numpy. On Sep 26, 1:34 am, Robert Bradshaw wrote: > Yes, there's some stuff in the finance.time_series for doing simple > stats over the reals. (This really needs to be put somewhere more > obvious, along with histogram, etc.) > > sage: sage.finance.time_series.TimeSeries([1,2,5]) > [1., 2., 5.] > sage: t = sage.finance.time_series.TimeSeries([1,2,5]) > sage: t.[tab] > t.abs t.fft t.prod > t.add_entries t.histogram t.randomize > t.add_scalar t.hurst_exponent > t.range_statistic > t.autocorrelation t.ifft t.reversed > t.autocovariance t.list t.scale > t.autoregressive_fit t.log t.scale_time > t.autoregressive_forecast t.max t.show > t.central_moment t.mean > t.simple_moving_average > t.clip_remove t.min > t.standard_deviation > t.correlation t.moment t.sum > t.covariance t.numpy t.sums > t.diffs t.plot t.variance > t.exp t.plot_candlestick t.vector > t.exponential_moving_average t.plot_histogram > t.extend t.pow > > For more complicated things, we also ship R, though the interface > could be greatly improved. > > On Sep 25, 2009, at 11:56 PM, ablondin wrote: > > > > > > > Hello, everybody ! > > Do you know how we can compute standard statistics on lists in sage ? > > For instance, if I have a list of 100 reals, how can I compute the > > mean of this list, the standard deviation, the variance, the median, > > the mode, etc. Are there predefined functions in sage or do I need to > > write them ? > > Thank you ! > > Alexandre Blondin Massé- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: jsMath working on server
Changed to AsciiMath. Working great. I have pretty print all over the server. Most of the functions have pretty print. Works great with FireFox even from a Linux box. If you use IE8 or 7 you will need to install MathPlayer. Try the text2speech function. Really nice. Right click on the math expression. The major problem was to get pretty in output. If anyone would like this setup on their server let me know. I have it working with a basic web service. Thanks for all the help with Sage and Python(Robert and Willian). I am using a Twisted server. Try http://www.pirsqr.com:2713/ On Sep 23, 10:35 am, Mikie wrote: > Finally I have jsMath working on my server. > > Tryhttp://pirsqr.com:1843/ > > Really strange works great on IE8, but not quit as good with FireFox. > > The integrator has all the pretty print. Put "int" in the type and > take a look at the pretty print output. > > I would like some feedback on how FireFox does with the pretty print. > Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] jsMath working on server
Finally I have jsMath working on my server. Try http://pirsqr.com:1843/ Really strange works great on IE8, but not quit as good with FireFox. The integrator has all the pretty print. Put "int" in the type and take a look at the pretty print output. I would like some feedback on how FireFox does with the pretty print. Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: latex/jsmath error
Can I do --- gcc (with C++ support) make--out m4-- out per-- out ranlib--out tar--out latex -- just this -- On Sep 14, 6:36 pm, William Stein wrote: > On Mon, Sep 14, 2009 at 1:21 PM, Mikie wrote: > > > This is from debug > > cd "/root/.sage/temp/Ralph/5161/dir_1"&& sage-native-execute latex > > \\nonstopmode \\input{sage8.tex} && sage-native-execute dvips > > sage8.dvi > > && sage-native-execute convert -density 130x130 -trim sage8.ps > > sage8.png > > > /var/www/html/sage/local/bin/sage-native-execute: line 8: latex: > > command > > not found > > You need to install latex. > > William --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Completing the square
Try my completing the square function http://pirsqrt.com:1843 Robert, thanks for all your help. A lot of work to get the "=" in the output. Maxima really helped. I think I traped most of the bad input. Did not use "eval" any place in the Python scipt. --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: eval(string)
Can't get [4]*(1<<30)] to work with sage: s = "1,2,3,4,100" sage: [ZZ(x) for x in s.split(',')] [1, 2, 3, 4, 100] I am using a try/exception on the input from the field in the form. If one puts any strange string it shows an error. Robert did you see my post for help with my API? On Sep 14, 7:59 pm, Robert Bradshaw wrote: > On Sep 14, 2009, at 12:09 PM, Mikie wrote: > > > Robert, > > > Can I use your technique above to input this string? The "[5]*3" > > gives me a problem > > > L1="[3,10,15,23,25,30,3,[5]*3]" > > You can, but here you're getting to the point where you're allowing > arbitrary input, not just a list of integers. What about "[1, 2, 3, > [4]*(1<<30)]"? How much memory do you have on your machine? > > - Robert > > > > > > > On Sep 10, 1:56 pm, Robert Bradshaw > > wrote: > >> On Sep 10, 2009, at 12:24 PM, Robert Bradshaw wrote: > > >>> On Sep 9, 2009, at 9:01 AM, Tim Dumol wrote: > > >>>> `eval(the_string, globals = {"__builtins__":None}, locals = {})` > >>>> should do it. This removes access from all functions. Add any > >>>> functions that are needed by adding them to the "locals" > >>>> dictionary. > > >>>> As stated in:http://stackoverflow.com/questions/661084/security-of- > >>>> pythons-eval-on-untrusted-strings > >>>> andhttp://lybniz2.sourceforge.net/safeeval.html > > >>> Wow, this works, though for much deeper reasons than those given > >>> above. > > >>> sage: [].__class__.__subclasses__() > >>> [2].is_mutable.__func__.__globals__ > >>> ['__builtins__'] > >>> {'ArithmeticError': , > >>> ... > >>> 'zip': } > > >>> sage: eval("[].__class__.__subclasses__() > >>> [2].is_mutable.__func__.__globals__['__builtins__']", > >>> {"__builtins__":None}, {}) > >>> > >>> Traceback (most recent call last): > >>> File "", line 1, in > >>> File "", line 1, in > >>> RuntimeError: restricted attribute > > >>> Even > > >>> sage: eval("[].__class__.__subclasses__()[2]([]).save('foo.txt')", > >>> {"__builtins__": None}, {}) > >>> > >>> Traceback (most recent call last): > >>> File "", line 1, in > >>> File "", line 1, in > >>> File "sage_object.pyx", line 150, in > >>> sage.structure.sage_object.SageObject.save (sage/structure/ > >>> sage_object.c:1894) > >>> IOError: file() constructor not accessible in restricted mode > > >>> In short, if globals()['__builtins__'] != __builtins__ it runs in > >>> "Restricted mode" which disallows certain introspections and other > >>> operations. I don't know that it's bullet proof, but it looks pretty > >>> solid. > > >> A little googling yielded > > >>http://www.dalkescientific.com/writings/diary/archive/2008/03/03/ > >> restricted_python.html > > >> which is one (of who knows how many) holes in restricted mode. > > >> - Robert- Hide quoted text - > > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Access to restricted URI denied
I am trying again to get jsMath to work on my API server. I am loading load.js in my Python script and it seems to load. However, tex2math that is in the plugins directory and gives me "Access to restricted URI denied". I will give anyone a copy of my API for help on solving this problem. --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: latex/jsmath error
This is from debug cd "/root/.sage/temp/Ralph/5161/dir_1"&& sage-native-execute latex \\nonstopmode \\input{sage8.tex} && sage-native-execute dvips sage8.dvi && sage-native-execute convert -density 130x130 -trim sage8.ps sage8.png /var/www/html/sage/local/bin/sage-native-execute: line 8: latex: command not found An error occured. Error latexing slide. Using Firefox. Sage Version 3.2. On Sep 14, 2:02 pm, John H Palmieri wrote: > On Sep 14, 12:38 pm, Mikie wrote: > > > Put > > from sage.misc.latex import JSMath > > Why? This is imported into the notebook by default, so you don't need > to do this. > > > into the notebook. Then > > > > %latex > > $x^2-x$ > > > > Then I get the following error > > An error occured. > > Error latexing slide. > > I don't get an error -- I get nicely typeset latex output (on my Mac > with Safari or Firefox, on an ubuntu box with Firefox, and on > sagenb.org). What version of Sage, what OS, what browser are you > using? > > You could also try > > %latex_debug > $x^2-x$ > > Maybe it's a problem with your LaTeX installation, and "%latex_debug" > will print extra debugging information. --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] latex/jsmath error
Put from sage.misc.latex import JSMath into the notebook. Then %latex $x^2-x$ Then I get the following error An error occured. Error latexing slide. It is possible to do Latex in Sage? --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: eval(string)
Robert, Can I use your technique above to input this string? The "[5]*3" gives me a problem L1="[3,10,15,23,25,30,3,[5]*3]" On Sep 10, 1:56 pm, Robert Bradshaw wrote: > On Sep 10, 2009, at 12:24 PM, Robert Bradshaw wrote: > > > > > > > > > On Sep 9, 2009, at 9:01 AM, Tim Dumol wrote: > > >> `eval(the_string, globals = {"__builtins__":None}, locals = {})` > >> should do it. This removes access from all functions. Add any > >> functions that are needed by adding them to the "locals" dictionary. > > >> As stated in:http://stackoverflow.com/questions/661084/security-of- > >> pythons-eval-on-untrusted-strings > >> andhttp://lybniz2.sourceforge.net/safeeval.html > > > Wow, this works, though for much deeper reasons than those given > > above. > > > sage: [].__class__.__subclasses__()[2].is_mutable.__func__.__globals__ > > ['__builtins__'] > > {'ArithmeticError': , > > ... > > 'zip': } > > > sage: eval("[].__class__.__subclasses__() > > [2].is_mutable.__func__.__globals__['__builtins__']", > > {"__builtins__":None}, {}) > > > > Traceback (most recent call last): > > File "", line 1, in > > File "", line 1, in > > RuntimeError: restricted attribute > > > Even > > > sage: eval("[].__class__.__subclasses__()[2]([]).save('foo.txt')", > > {"__builtins__": None}, {}) > > > > Traceback (most recent call last): > > File "", line 1, in > > File "", line 1, in > > File "sage_object.pyx", line 150, in > > sage.structure.sage_object.SageObject.save (sage/structure/ > > sage_object.c:1894) > > IOError: file() constructor not accessible in restricted mode > > > In short, if globals()['__builtins__'] != __builtins__ it runs in > > "Restricted mode" which disallows certain introspections and other > > operations. I don't know that it's bullet proof, but it looks pretty > > solid. > > A little googling yielded > > http://www.dalkescientific.com/writings/diary/archive/2008/03/03/ > restricted_python.html > > which is one (of who knows how many) holes in restricted mode. > > - Robert- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Display but don't calc
Is there anyway to display an expression in the notebook, but not have it calculate? Such sqrt(4)+sqrt(12). Don't simplify. Or integral (x^2,x) Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Maple
In the thread on Mathematica, is it possible to use it in the notebook. I would also need to work in a Python script. On Sep 10, 9:22 am, William Stein wrote: > On Thu, Sep 10, 2009 at 8:04 AM, Mikie wrote: > > > Is it possible to use Maple(V?) in the notebook? > > Thanx > > I don't know because I don't have access to Maple V. You probably > aren't asking unless you *do*, in which case wouldn't you already know > the answer? Which I hope you could share. > > For the record, Sage uses a tty to interface with external programs, > rather than a client/server interface or library interface, so > (possibly with some tweaking) can communicate with any program that > has a command line interface. So any version > of Maple could be made to work. > > William > > > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: eval(string)
I need to be able to input a string like this --- L1="[3,10,15,23,25,30,3,[5]*3]" Need the repeated values for the 5. If I don't have repeated values your code works. I have done some error traping for "eval". Users can not put something like "rm". On Sep 8, 2:38 pm, Robert Bradshaw wrote: > On Sep 8, 2009, at 11:28 AM, Mikie wrote: > > > Here is the function > > --- > > def BasicStats1a(exp1): > > v = exp1 > > v1 = eval(v);Count_=len(v1) > > sort_v1=sorted(v1) > > M1 =stats.mode(v1); v3=eval(str(M1[0])); v4=eval(str(M1[1])) > > R1 = stats.mean(v1);R2 = stats.median(v1) > > R3 = stats.std(v1) > > var_=R3**2 > > return R1,R2,R3,Count_,sort_v1,var_,v3,v4 > > > > You can see the eval's. Is there a security problem with sage_eval? > > Yes. > > > The string comes from a form. > > You should look up string processing in Python, I think that would > help a lot in much of what you're trying to do here. For example, > > sage: s = "1,2,3,4,100" > sage: [ZZ(x) for x in s.split(',')] > [1, 2, 3, 4, 100] > > This is fast, safe, and more clear than the above. > > - Robert --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: eval(string)
Here is the function --- def BasicStats1a(exp1): v = exp1 v1 = eval(v);Count_=len(v1) sort_v1=sorted(v1) M1 =stats.mode(v1); v3=eval(str(M1[0])); v4=eval(str(M1[1])) R1 = stats.mean(v1);R2 = stats.median(v1) R3 = stats.std(v1) var_=R3**2 return R1,R2,R3,Count_,sort_v1,var_,v3,v4 You can see the eval's. Is there a security problem with sage_eval? The string comes from a form. On Sep 8, 11:29 am, Harald Schilly wrote: > Can you please elaborate, what kind of list it is? Post an example, > tell us what web form it is (if necessary) and what do you want to do > with it? Besides eval, there is also sage_eval. > > H > > On Sep 8, 7:01 pm, Mikie wrote: > > > > > I am taking a string that is a list. It is coming from a html form. > > Is there anyway other than eval to get the value from the list? When > > I take a single value from the form I use SR and it works, but no luck > > with the list. > > Thanx- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] eval(string)
I am taking a string that is a list. It is coming from a html form. Is there anyway other than eval to get the value from the list? When I take a single value from the form I use SR and it works, but no luck with the list. Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Completing the square
Here is the finished product for CS. -- def CSquare(co1,co2,co3): eq1=co1*x^2+co2*x+co3 eq3=eq1==0 eq2=factor(eq1) eq4=(1/co1)*eq2 eq10=expand(eq4) M1=maxima.args(eq10);L1=len(M1) Cof1=maxima.args(eq10);Cof1a=Cof1[2]; val2=((1/2)*(maxima.coeff(eq10,x,1))) Addon=maxima.ev(val2^2) eq5=maxima.ev(val2^2)+M1[0]+M1[1]#this gets value from Maxima eq6=factor(eq5); eq7=-M1[2]+Addon; Str1="This is added to both sides of the quad-- " Soln=maxima.solve(eq1) return eq3,eq2,eq10,eq6,Str1,eq7,Soln --- The line that solve the problem was Addon=maxima.ev(val2^2) I now get a real number, that finishes the CS. Willian, I need Maxima to write this function. Here is some output. - the call ---val1=CSquare(2,-1,-2);val1[0];val1[1];val1[2];val1[3];val1 [4],val1[5];val1[6] 2*x^2 - x - 2 == 0 2*(x^2 - x/2 - 1) x^2 - x/2 - 1 (4*x-1)^2/16 ('This is added to both sides of the quad-- ', 17/16) [x=-(sqrt(17)-1)/4,x=(sqrt(17)+1)/4] - the call--val1=CSquare(2,-1,-3);val1[0];val1[1];val1[2];val1[3];val1 [4],val1[5];val1[6] 2*x^2 - x - 3 == 0 2*(x - 3/2)*(x + 1) x^2 - x/2 - 3/2 (4*x-1)^2/16 ('This is added to both sides of the quad-- ', 25/16) [x=3/2,x=-1] --- Now to get it work on my server. When I finish I will give the link. Current version at http://pirsqrt.com:1843/ Wolfram Alpha eat your hart out. Still looking for help with pretty print output. (JSmath) On Sep 2, 6:51 pm, Robert Bradshaw wrote: > On Wed, 2 Sep 2009, calcp...@aol.com wrote: > > That's a good question! I've written functions in MATLAB (well Octave > > actually) no problem. But I get confused where Python leaves off and Sage > > kicks in when witting functions here. > > The way to think about this is that Sage is just a huge Python library, > and writing a function in Sage (in the programming sense, not the > mathematical sense) is exactly the same as writing a function in Python. > > From the command line/notebook, there is some preparsing that goes on, but > it's stuff like 5 -> Integer(5) so that 1/5 doesn't become 0. > > > > > Could someone please give me a barebones example, soup to nuts, of a > > Python vs. Sage vs. Other (Maxima and such) function that does, say, > > Newton's > > Method for finding Roots? > > > 1) what does the function look like > > 2) how do you invoke it > > 3) what's the input > > 3) where's the output > > 4) etc > > > TIA, > > A. Jorge Garcia > > _http://calcpage.tripod.com_(http://calcpage.tripod.com/) > > > Teacher & Professor > > Applied Mathematics, Physics & Computer Science > > Baldwin Senior High School & Nassau Community College > > > In a message dated 9/2/2009 5:57:37 P.M. Eastern Daylight Time, > > thephantom6...@hotmail.com writes: > > > No. The call is CSquare(2,3,4). Just trying to setup a random quad. > > Could this function be done with just Sage? I need coeficients, each > > term, sides of the equation, etc.- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Maxima Solve sys
JSmath is basically a bunch of javacript routines that takes latex created from sage and displays in the html file. The html is generated in my Python script(server,html). When I call JSmath the first routine is loaded. In the first script it calls another and this is where the problem occurs. One of the problems is that I am calling the JSmath from a server. It is a path problem. I can insert images in the html file. On Sep 2, 11:10 am, Robert Bradshaw wrote: > On Wed, 2 Sep 2009, Mikie wrote: > > > Didn't you create the API using the notebook? > > Yes, I created the simple server, but you can think of that more as > reaching under the html/javascript/jsmath layer and exposing the raw > computatinal elements themsleves, rather than building on top of that nice > GUI. > > - Robert > > > > > > > On Sep 1, 10:02 pm, Robert Bradshaw > > wrote: > >> On Sep 1, 2009, at 12:16 PM, Mikie wrote: > > >>> I took out the eval and for some reason it is working. > >>> Robert, this is function in my API (AlgCalc) > >>>http://pirsqrt.com:1843/ > >>> If I would give it to you would you show me how to get JSmath to > >>> work? I have talked to you before. You said you were too busy. I > >>> have loaded load.js, but when it goes for another .js file it cannot > >>> find. > > >> You're probably thinking about another Robert--I don't know anything > >> about jsmath. What I would do is look for instructions on their site. > > >> - Robert (Bradshaw) > > >>> On Sep 1, 12:37 pm, Mikie wrote: > >>>> Yes, Robert eval is doing the rounding. How do I fix it? > > >>>> On Sep 1, 12:31 pm, Mikie wrote: > > >>>>> I have tried SR. I get a malformed value. Yes, I understand the > >>>>> problem with eval. Do you have any suggestions on how to get the > >>>>> right value into maxima.solve? > > >>>>> On Sep 1, 11:32 am, Robert Bradshaw > >>>>> wrote: > > >>>>>> On Tue, 1 Sep 2009, Mikie wrote: > > >>>>>>> When I run the server with the function above and the following > >>>>>>> string > >>>>>>> from a text box I get > >>>>>>> [y=-1,x=0]. The string is "[3*x-y-1,x+(1/3)*y]" > > >>>>>>> It is changing the input value to [3*x-y-1,x] > > >>>>>> 1/3 = 0 in Python. Also, I hope you realize how dangerous > > >>>>>> eval("random string someone gave you from the web") is! > > >>>>>> - Robert > > >>>>>>> On Sep 1, 10:38 am, Mikie wrote: > >>>>>>>> Sorry, wrong function > > >>>>>>>> def MSolveSys(syss): > >>>>>>>> eqns=eval(syss) > >>>>>>>> solns=maxima.solve(eqns) > >>>>>>>> return solns > > >>>>>>>> On Sep 1, 10:31 am, Jason Grout > >>>>>>>> wrote: > > >>>>>>>>> Robert Bradshaw wrote: > >>>>>>>>>> On Sep 1, 2009, at 9:17 AM, Mikie wrote: > > >>>>>>>>>>> Here is function I am using to solve systems of linear > >>>>>>>>>>> equations. > > >>>>>>>>>>> def MSolveSys(syss): > >>>>>>>>>>> eqns=eval(syss) > >>>>>>>>>>> solns=maxima.solve(syss) > >>>>>>>>>>> return solns > > >>>>>>>>>>> Works great in the notebook, but when I put it in a Python > >>>>>>>>>>> script it > >>>>>>>>>>> rounds the coeficients of the variables and thus produces bad > >>>>>>>>>>> solutions. > > >>>>>>>>>> Perhaps eval here is the culprit. You might have to parse it > >>>>>>>>>> a bit > >>>>>>>>>> yourself. SR("...") will parse expressions. > > >>>>>>>>> Mikie effectively isn't using "eval", right? That line (and > >>>>>>>>> the "eqns" > >>>>>>>>> variable) is not being used. > > >>>>>>>>> Jason > > >>>>>>>>> -- > >>>>>>>>> Jason Grout- Hide quoted text - > > >>>>>>>>> - Show quoted text -- Hide quoted text - > > >>>>>>>> - Show quoted text -- Hide quoted text - > > >>>>>> - Show quoted text -- Hide quoted text - > > >>>>> - Show quoted text -- Hide quoted text - > > >>>> - Show quoted text -- Hide quoted text - > > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Completing the square
No. The call is CSquare(2,3,4). Just trying to setup a random quad. Could this function be done with just Sage? I need coeficients, each term, sides of the equation, etc. On Sep 2, 1:01 pm, William Stein wrote: > On Wed, Sep 2, 2009 at 10:48 AM, kcrisman wrote: > > > On Sep 2, 1:32 pm, Mikie wrote: > > > Here is my start using Sage and Maxima. > > > > > > def CSquare(co1,co2,co3): > > > eq1=co1*x^2+co2*x+co3 > > > eq3=eq1==0 > > > eq2=factor(eq1) > > > eq4=(1/co1)*eq2 > > > Cof1=maxima.args(eq4);Cof1a=Cof1[2]; > > > val2=real(((1/2)*(maxima.coeff(eq4,x,1 > > > val1=val2^2 > > > eq5=eq4+val1 > > > return eq3,eq2,eq4,eq5,val1 > > Why in the heck are you using Maxima at all? > > William > > > > > > > > -- > > > > The val1 does produce 9/16. This is good, but when I add it to the > > > lhs I get (here is my output) > > > - > > > > 2*x^2 + 3*x + 4 == 0 > > > 2*(x^2 + 3*x/2 + 2) > > > x^2 + 3*x/2 + 2 > > > x^2 + 3*x/2 + sage261 + 2 > > > 9/16 > > > > > > Why the "sage261"? > > > Looks like a Maxima or Sage session id. That can happen when Sage > > gives Maxima something it doesn't understand. Does your input include > > any functions? > > > - kcrisman > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org- Hide quoted text - > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Completing the square
Here is my start using Sage and Maxima. def CSquare(co1,co2,co3): eq1=co1*x^2+co2*x+co3 eq3=eq1==0 eq2=factor(eq1) eq4=(1/co1)*eq2 Cof1=maxima.args(eq4);Cof1a=Cof1[2]; val2=real(((1/2)*(maxima.coeff(eq4,x,1 val1=val2^2 eq5=eq4+val1 return eq3,eq2,eq4,eq5,val1 -- The val1 does produce 9/16. This is good, but when I add it to the lhs I get (here is my output) - 2*x^2 + 3*x + 4 == 0 2*(x^2 + 3*x/2 + 2) x^2 + 3*x/2 + 2 x^2 + 3*x/2 + sage261 + 2 9/16 Why the "sage261"? On Sep 2, 11:09 am, Robert Bradshaw wrote: > On Wed, 2 Sep 2009, Mikie wrote: > > > Here is a proc(Mupad) I wrote for showing the steps in completing the > > square for a quad > > > > //Completing the Square Method of solving quadratic equation > > quad:= proc(co1,co2,co3) > > local a,b,c,eq1,q1,Lcoef,half2,eq2,eq3,op1,op2,op3, > > eq1a,eq1b,eq1c,eq4,eq5,eq6,r1,sol1,sol2; > > begin; > > eq1:=co1*x^2+co2*x+co3=0; > > eq2:=(eq1/co1); > > q1:=[coeff(lhs(eq2))]; > > Lcoef:=q1[2]; > > op1:= op(lhs(eq2)); op2:=op(op1,3); > > eq1a := subs(R1 + R2 = R3, R1=op(op1,1), > > R2 =op(op1,2),R3 = -op2, Unsimplified); > > half2:=(Lcoef/2)^2; > > a := lhs(eq1a); b:=rhs(eq1a); > > eq1b:= subs(R4 + R5 + R6 = R7 + R8, R4 =op(a,1), > > R5 = op(a,2), R6 = half2, R7=b,R8 = half2,Unsimplified); > > eq3:=eq2-q1[3]; > > eq4:=eq3+half2; > > eq5:= (x+Lcoef/2)^2=rhs(eq4); > > eq6:= x+Lcoef/2=sqrt(rhs(eq5)); > > eq6a:= x+Lcoef/2=-sqrt(rhs(eq5)); > > sol1:=eq6-Lcoef/2;sol2:=x=rhs(-eq6-Lcoef/2); > > -- > > I need rhs, lhs, op, coef, subs, etc. Are any of these functions in > > Sage or Maxima? > > Thanx > > I bet they all are, but to know you'd have to find out what they mean. > > - Robert- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Maxima Solve sys
Didn't you create the API using the notebook? On Sep 1, 10:02 pm, Robert Bradshaw wrote: > On Sep 1, 2009, at 12:16 PM, Mikie wrote: > > > I took out the eval and for some reason it is working. > > Robert, this is function in my API (AlgCalc) > >http://pirsqrt.com:1843/ > > If I would give it to you would you show me how to get JSmath to > > work? I have talked to you before. You said you were too busy. I > > have loaded load.js, but when it goes for another .js file it cannot > > find. > > You're probably thinking about another Robert--I don't know anything > about jsmath. What I would do is look for instructions on their site. > > - Robert (Bradshaw) > > > > > > > On Sep 1, 12:37 pm, Mikie wrote: > >> Yes, Robert eval is doing the rounding. How do I fix it? > > >> On Sep 1, 12:31 pm, Mikie wrote: > > >>> I have tried SR. I get a malformed value. Yes, I understand the > >>> problem with eval. Do you have any suggestions on how to get the > >>> right value into maxima.solve? > > >>> On Sep 1, 11:32 am, Robert Bradshaw > >>> wrote: > > >>>> On Tue, 1 Sep 2009, Mikie wrote: > > >>>>> When I run the server with the function above and the following > >>>>> string > >>>>> from a text box I get > >>>>> [y=-1,x=0]. The string is "[3*x-y-1,x+(1/3)*y]" > > >>>>> It is changing the input value to [3*x-y-1,x] > > >>>> 1/3 = 0 in Python. Also, I hope you realize how dangerous > > >>>> eval("random string someone gave you from the web") is! > > >>>> - Robert > > >>>>> On Sep 1, 10:38 am, Mikie wrote: > >>>>>> Sorry, wrong function > > >>>>>> def MSolveSys(syss): > >>>>>> eqns=eval(syss) > >>>>>> solns=maxima.solve(eqns) > >>>>>> return solns > > >>>>>> On Sep 1, 10:31 am, Jason Grout > >>>>>> wrote: > > >>>>>>> Robert Bradshaw wrote: > >>>>>>>> On Sep 1, 2009, at 9:17 AM, Mikie wrote: > > >>>>>>>>> Here is function I am using to solve systems of linear > >>>>>>>>> equations. > > >>>>>>>>> def MSolveSys(syss): > >>>>>>>>> eqns=eval(syss) > >>>>>>>>> solns=maxima.solve(syss) > >>>>>>>>> return solns > > >>>>>>>>> Works great in the notebook, but when I put it in a Python > >>>>>>>>> script it > >>>>>>>>> rounds the coeficients of the variables and thus produces bad > >>>>>>>>> solutions. > > >>>>>>>> Perhaps eval here is the culprit. You might have to parse it > >>>>>>>> a bit > >>>>>>>> yourself. SR("...") will parse expressions. > > >>>>>>> Mikie effectively isn't using "eval", right? That line (and > >>>>>>> the "eqns" > >>>>>>> variable) is not being used. > > >>>>>>> Jason > > >>>>>>> -- > >>>>>>> Jason Grout- Hide quoted text - > > >>>>>>> - Show quoted text -- Hide quoted text - > > >>>>>> - Show quoted text -- Hide quoted text - > > >>>> - Show quoted text -- Hide quoted text - > > >>> - Show quoted text -- Hide quoted text - > > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Completing the square
Here is a proc(Mupad) I wrote for showing the steps in completing the square for a quad //Completing the Square Method of solving quadratic equation quad:= proc(co1,co2,co3) local a,b,c,eq1,q1,Lcoef,half2,eq2,eq3,op1,op2,op3, eq1a,eq1b,eq1c,eq4,eq5,eq6,r1,sol1,sol2; begin; eq1:=co1*x^2+co2*x+co3=0; eq2:=(eq1/co1); q1:=[coeff(lhs(eq2))]; Lcoef:=q1[2]; op1:= op(lhs(eq2)); op2:=op(op1,3); eq1a := subs(R1 + R2 = R3, R1=op(op1,1), R2 =op(op1,2),R3 = -op2, Unsimplified); half2:=(Lcoef/2)^2; a := lhs(eq1a); b:=rhs(eq1a); eq1b:= subs(R4 + R5 + R6 = R7 + R8, R4 =op(a,1), R5 = op(a,2), R6 = half2, R7=b,R8 = half2,Unsimplified); eq3:=eq2-q1[3]; eq4:=eq3+half2; eq5:= (x+Lcoef/2)^2=rhs(eq4); eq6:= x+Lcoef/2=sqrt(rhs(eq5)); eq6a:= x+Lcoef/2=-sqrt(rhs(eq5)); sol1:=eq6-Lcoef/2;sol2:=x=rhs(-eq6-Lcoef/2); -- I need rhs, lhs, op, coef, subs, etc. Are any of these functions in Sage or Maxima? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Maxima Solve sys
I took out the eval and for some reason it is working. Robert, this is function in my API (AlgCalc) http://pirsqrt.com:1843/ If I would give it to you would you show me how to get JSmath to work? I have talked to you before. You said you were too busy. I have loaded load.js, but when it goes for another .js file it cannot find. On Sep 1, 12:37 pm, Mikie wrote: > Yes, Robert eval is doing the rounding. How do I fix it? > > On Sep 1, 12:31 pm, Mikie wrote: > > > > > I have tried SR. I get a malformed value. Yes, I understand the > > problem with eval. Do you have any suggestions on how to get the > > right value into maxima.solve? > > > On Sep 1, 11:32 am, Robert Bradshaw > > wrote: > > > > On Tue, 1 Sep 2009, Mikie wrote: > > > > > When I run the server with the function above and the following string > > > > from a text box I get > > > > [y=-1,x=0]. The string is "[3*x-y-1,x+(1/3)*y]" > > > > > It is changing the input value to [3*x-y-1,x] > > > > 1/3 = 0 in Python. Also, I hope you realize how dangerous > > > > eval("random string someone gave you from the web") is! > > > > - Robert > > > > > On Sep 1, 10:38 am, Mikie wrote: > > > >> Sorry, wrong function > > > > >> def MSolveSys(syss): > > > >> eqns=eval(syss) > > > >> solns=maxima.solve(eqns) > > > >> return solns > > > > >> On Sep 1, 10:31 am, Jason Grout wrote: > > > > >>> Robert Bradshaw wrote: > > > >>>> On Sep 1, 2009, at 9:17 AM, Mikie wrote: > > > > >>>>> Here is function I am using to solve systems of linear equations. > > > > >>>>> def MSolveSys(syss): > > > >>>>> eqns=eval(syss) > > > >>>>> solns=maxima.solve(syss) > > > >>>>> return solns > > > > >>>>> Works great in the notebook, but when I put it in a Python script it > > > >>>>> rounds the coeficients of the variables and thus produces bad > > > >>>>> solutions. > > > > >>>> Perhaps eval here is the culprit. You might have to parse it a bit > > > >>>> yourself. SR("...") will parse expressions. > > > > >>> Mikie effectively isn't using "eval", right? That line (and the > > > >>> "eqns" > > > >>> variable) is not being used. > > > > >>> Jason > > > > >>> -- > > > >>> Jason Grout- Hide quoted text - > > > > >>> - Show quoted text -- Hide quoted text - > > > > >> - Show quoted text -- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Maxima Solve sys
Yes, Robert eval is doing the rounding. How do I fix it? On Sep 1, 12:31 pm, Mikie wrote: > I have tried SR. I get a malformed value. Yes, I understand the > problem with eval. Do you have any suggestions on how to get the > right value into maxima.solve? > > On Sep 1, 11:32 am, Robert Bradshaw > wrote: > > > > > On Tue, 1 Sep 2009, Mikie wrote: > > > > When I run the server with the function above and the following string > > > from a text box I get > > > [y=-1,x=0]. The string is "[3*x-y-1,x+(1/3)*y]" > > > > It is changing the input value to [3*x-y-1,x] > > > 1/3 = 0 in Python. Also, I hope you realize how dangerous > > > eval("random string someone gave you from the web") is! > > > - Robert > > > > On Sep 1, 10:38 am, Mikie wrote: > > >> Sorry, wrong function > > > >> def MSolveSys(syss): > > >> eqns=eval(syss) > > >> solns=maxima.solve(eqns) > > >> return solns > > > >> On Sep 1, 10:31 am, Jason Grout wrote: > > > >>> Robert Bradshaw wrote: > > >>>> On Sep 1, 2009, at 9:17 AM, Mikie wrote: > > > >>>>> Here is function I am using to solve systems of linear equations. > > > >>>>> def MSolveSys(syss): > > >>>>> eqns=eval(syss) > > >>>>> solns=maxima.solve(syss) > > >>>>> return solns > > > >>>>> Works great in the notebook, but when I put it in a Python script it > > >>>>> rounds the coeficients of the variables and thus produces bad > > >>>>> solutions. > > > >>>> Perhaps eval here is the culprit. You might have to parse it a bit > > >>>> yourself. SR("...") will parse expressions. > > > >>> Mikie effectively isn't using "eval", right? That line (and the "eqns" > > >>> variable) is not being used. > > > >>> Jason > > > >>> -- > > >>> Jason Grout- Hide quoted text - > > > >>> - Show quoted text -- Hide quoted text - > > > >> - Show quoted text -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Maxima Solve sys
I have tried SR. I get a malformed value. Yes, I understand the problem with eval. Do you have any suggestions on how to get the right value into maxima.solve? On Sep 1, 11:32 am, Robert Bradshaw wrote: > On Tue, 1 Sep 2009, Mikie wrote: > > > When I run the server with the function above and the following string > > from a text box I get > > [y=-1,x=0]. The string is "[3*x-y-1,x+(1/3)*y]" > > > It is changing the input value to [3*x-y-1,x] > > 1/3 = 0 in Python. Also, I hope you realize how dangerous > > eval("random string someone gave you from the web") is! > > - Robert > > > > > > > On Sep 1, 10:38 am, Mikie wrote: > >> Sorry, wrong function > > >> def MSolveSys(syss): > >> eqns=eval(syss) > >> solns=maxima.solve(eqns) > >> return solns > > >> On Sep 1, 10:31 am, Jason Grout wrote: > > >>> Robert Bradshaw wrote: > >>>> On Sep 1, 2009, at 9:17 AM, Mikie wrote: > > >>>>> Here is function I am using to solve systems of linear equations. > > >>>>> def MSolveSys(syss): > >>>>> eqns=eval(syss) > >>>>> solns=maxima.solve(syss) > >>>>> return solns > > >>>>> Works great in the notebook, but when I put it in a Python script it > >>>>> rounds the coeficients of the variables and thus produces bad > >>>>> solutions. > > >>>> Perhaps eval here is the culprit. You might have to parse it a bit > >>>> yourself. SR("...") will parse expressions. > > >>> Mikie effectively isn't using "eval", right? That line (and the "eqns" > >>> variable) is not being used. > > >>> Jason > > >>> -- > >>> Jason Grout- Hide quoted text - > > >>> - Show quoted text -- Hide quoted text - > > >> - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Maxima Solve sys
When I run the server with the function above and the following string from a text box I get [y=-1,x=0]. The string is "[3*x-y-1,x+(1/3)*y]" It is changing the input value to [3*x-y-1,x] On Sep 1, 10:38 am, Mikie wrote: > Sorry, wrong function > > def MSolveSys(syss): > eqns=eval(syss) > solns=maxima.solve(eqns) > return solns > > On Sep 1, 10:31 am, Jason Grout wrote: > > > > > Robert Bradshaw wrote: > > > On Sep 1, 2009, at 9:17 AM, Mikie wrote: > > > >> Here is function I am using to solve systems of linear equations. > > > >> def MSolveSys(syss): > > >> eqns=eval(syss) > > >> solns=maxima.solve(syss) > > >> return solns > > > >> Works great in the notebook, but when I put it in a Python script it > > >> rounds the coeficients of the variables and thus produces bad > > >> solutions. > > > > Perhaps eval here is the culprit. You might have to parse it a bit > > > yourself. SR("...") will parse expressions. > > > Mikie effectively isn't using "eval", right? That line (and the "eqns" > > variable) is not being used. > > > Jason > > > -- > > Jason Grout- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Maxima Solve sys
Sorry, wrong function def MSolveSys(syss): eqns=eval(syss) solns=maxima.solve(eqns) return solns On Sep 1, 10:31 am, Jason Grout wrote: > Robert Bradshaw wrote: > > On Sep 1, 2009, at 9:17 AM, Mikie wrote: > > >> Here is function I am using to solve systems of linear equations. > > >> def MSolveSys(syss): > >> eqns=eval(syss) > >> solns=maxima.solve(syss) > >> return solns > > >> Works great in the notebook, but when I put it in a Python script it > >> rounds the coeficients of the variables and thus produces bad > >> solutions. > > > Perhaps eval here is the culprit. You might have to parse it a bit > > yourself. SR("...") will parse expressions. > > Mikie effectively isn't using "eval", right? That line (and the "eqns" > variable) is not being used. > > Jason > > -- > Jason Grout- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Maxima Solve sys
Here is function I am using to solve systems of linear equations. def MSolveSys(syss): eqns=eval(syss) solns=maxima.solve(syss) return solns Works great in the notebook, but when I put it in a Python script it rounds the coeficients of the variables and thus produces bad solutions. Is it possible to fix it? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Malformed expression
I figured it out. I wasn't converting the value from maxima.solve() back to string. Thanks for looking at the code. On Aug 31, 2:54 pm, Jason Grout wrote: > Mikie wrote: > > Using this function in a Python script > > > def MSolveSys(syss): > > eqns=eval(syss) > > solns=maxima.solve(eqns) > > return solns > > > I am getting "Malformed expression". > > > When I use it the notebook no problem > > Can you post a complete example (with the equations you are using and > the call to MSolveSys) that we can paste into our sage session to see > this error? > > Thanks, > > Jason --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Malformed expression
Using this function in a Python script def MSolveSys(syss): eqns=eval(syss) solns=maxima.solve(eqns) return solns I am getting "Malformed expression". When I use it the notebook no problem Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] output in 3.4 and 4.0
When I print the results of a calculation from my twisted server in Sage 3.4 and 4.0, 4.0 messes up the output. Try http://thwaite.phys.ualberta.ca:/ (This 4.0, try the Laplace function) http://pirsqrt.com:1843/(This is 3.4) Use the codes at the top of the html page to select the function. If you get a blank screen, use the browsers back arrow and enter the values correctly. Try to break my server. Can anyone explain this problem? Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Load Maxima
Thanks, for the help. Here are the functions I created and they work. I needed one that solved equations for a floating pt. solution and a definite integral and work in a Python script. -- def MaxIntegrate(x,y,beg,end_): y1=maxima(x);x1=maxima(y) a5=maxima.integrate(x,y,beg,end_);a6=maxima.float(a5); return a6 --- def MSolve(r1,val1): a1=maxima.solve(r1,val1);a3=maxima.float(a1) return a3 --- On Aug 18, 5:47 pm, Simon King wrote: > Hi William, hi Mikie, > > On 19 Aug., 01:27, William Stein wrote: > > > > > > > On Tue, Aug 18, 2009 at 2:30 PM, Mikie wrote: > > > > Yes, that works. > > > However, I am trying to create a function that has Maxima functions in > > > it and I can't seem to pass values to it. I am using a Python > > > function. > > > > Something like this > > > --- > > > def Subs(x,y): > > > y1=maxima("float(x);");y1 > > > maxima("p1:y1;");print maxima("p1;") > > > a1=maxima("s3:x*y;"); > > > return a1 > > > - > > > Is it possible to pass the variables into Maxima function? > > > If you do > > > maxima.eval("foo") > > > it is exactly like typing foo at the command line in Maxima. You can > > do anything with that. E.g., above do > > > maxima.eval("p1:y1") > > I am not sure if this is what Mikie had in mind. It seems like he > wants a python function that has an argument x, and he wants to pass > *this argument* (not just the string 'x') to maxima. > > Certainly I am not a maxima expert. But extrapolating from other > interfaces, you could try to transform the argument x into maxima by > xm = maxima(x) > Of course, it depends both on the input and on the quality of the > maxima interface whether this transformation works. In bad cases, you > need to pre-process x before passing it to maxima. > > If you want to do computations with the maxima version xm of x, you > could do it in a python way > xm.method_name(arguments) > or you could directly talk with maxima, by passing strings, as William > explained above. Note that xm is known to maxima by the name xm.name > (). > So, again extrapolating from other interfaces, I think youcould do > maxima.eval('p1:%s'%(xm.name())) > whatever this means. > > Cheers, > Simon- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Load Maxima
Yes, that works. However, I am trying to create a function that has Maxima functions in it and I can't seem to pass values to it. I am using a Python function. Something like this --- def Subs(x,y): y1=maxima("float(x);");y1 maxima("p1:y1;");print maxima("p1;") a1=maxima("s3:x*y;"); return a1 - Is it possible to pass the variables into Maxima function? On Aug 18, 5:30 am, Minh Nguyen wrote: > Hi Mikie, > > On Tue, Aug 18, 2009 at 7:16 AM, Mikie wrote: > > > How do I load Maxima? I using a Python script. > > If you want to access the Sage library from your Python script, you > need to run that script using the version of Python that comes with > Sage. The command "sage -python /path/to/my/python/script.py" should > do the trick. To access the functionalities of Maxima from that > script, you can pass all Maxima commands to the function maxima(). For > example, say I have a Python script as follows and Sage is in my PATH: > > [mv...@sage mvngu]$ which sage > /usr/local/bin/sage > [mv...@sage mvngu]$ pwd > /scratch/mvngu > [mv...@sage mvngu]$ cat demo.py > from sage.all import * > > print maxima("2 + 3;") > > I would then run the Python script "demo.py" as follows: > > [mv...@sage mvngu]$ sage -python demo.py > 5 > > and the answer 5 is the output of the version of Maxima that's bundled > with Sage. > > -- > Regards > Minh Van Nguyen --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Load Maxima
How do I load Maxima? I using a Python script. Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] textarea output
I have created a API for student math interaction using Sage. My version of Sage on the server is 3.4. The output is in a textarea and it looks good. Not as good as pretty print(jsmath). When I use my server on 4.0 the output looks bad. All on one line. What has happened to 4.0? Is there any fix that will work with both versions? Try this link http://thwaite.phys.ualberta.ca:/ On the stats server there is no ratio expressions. Thanx --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] floating point solve
I need some help with a solve function that gives fp solutions to all types of equations. Possibly allowing an interval. I have tried def FPSolver2a(val1,val2,val3): var('val1,val2,val3') a2=SR(val1) q1=find_root(xy,p,q) return q1 I need to put it into a python script, so no pre-parser. Thanks --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: correlation coefficient
Yes, thanks Giovanni. Numpy worked. On Jul 21, 1:51 am, "giovanni.marche...@ds.unifi.it" wrote: > I read in the listing of the function > > warnings.warn("""\ > scipy.stats.corrcoef is deprecated; please update your code to use > numpy.corrcoef. > Please note that: > - numpy.corrcoef rowvar argument defaults to true, not false > - numpy.corrcoef bias argument defaults to false, not true > """, DeprecationWarning) > if y is not None: > x = np.transpose([x,y]) > y = None > c = cov(x, y, rowvar=rowvar, bias=bias) > d = np.diag(c) > return c/np.sqrt(np.multiply.outer(d,d)) > > Anyway > bias is used only for the covariance computation. > In this case if bias = True the denominator is set to > n-1. > > As the correlation coefficient is cov(x,y)/ sqrt( cov(x,x)* cov(y,y)) > the denominator choice is irrelevant as it cancels out. > > -- Giovanni Marchetti --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] correlation coefficient
Still working on my Stats server. Is there a function in Scipy that will calculate the correlation coef.? I have found something that looks good, but I do not understand the parameters. scipy.stats.corrcoef(x,y,rowvar, bias) x,y represents the independent, dependent variables, rows, I don't understand what to use for bias. Any help would be appreciated. --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: sort a list
Carlos, just what I needed. I have looked in scipy, but no Quartiles. On Jul 15, 1:26 pm, Carlos Córdoba wrote: > This is not about RTFM, because L1.sort() doesn't produce any result. It > just modifies the original list in place. > > I think that Mikie wants to assign the sorted list to another list. In that > case what you need is the sorted command: > > sage: L1 = [56,2,4,10] > sage: sort_L1 = sorted(L1) > sage: sort_L1 > [2,4,10,56] > > On Wed, Jul 15, 2009 at 2:19 PM, Justin C. Walker wrote: > > > > > > > On Jul 15, 2009, at 12:14 , Mikie wrote: > > > > How does one sort a list in Sage? I have tried > > > > L1=[56,2,4,10] > > > Sort_ = L1.sort() > > > > and nothing is produced. > > > As the saying goes, RTFM :-} > > > sage: L1=[56,2,4,10] > > sage: L1.sort? > > Type: builtin_function_or_method > > Base Class: > > String Form: > > Namespace: Interactive > > Docstring: > > L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN > > PLACE*; > > cmp(x, y) -> -1, 0, 1 > > Class Docstring: > > > > > sage: L1 > > [2, 4, 10, 56] > > > HTH > > > Justin > > > -- > > Justin C. Walker, Curmudgeon at Large > > Institute for the Absorption of Federal Funds > > --- > > If it weren't for carbon-14, I wouldn't date at all. > > Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] sort a list
How does one sort a list in Sage? I have tried L1=[56,2,4,10] Sort_ = L1.sort() and nothing is produced. I need it to calculate Quartiles. Is there a Quatile function in any of the modules? Thanks --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] adding cells
I have several worksheets in my file list. Just created new notebook and I can only add about 7 cells. Why is this? Is there some kind of limit? Thanks --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: scipy binomial pmf
If it works don't fix. I like 3.2.2 because of the output in a textarea is nicer than 4.0. I will leave it along. On Jul 10, 10:19 am, Robert Bradshaw wrote: > On Jul 10, 2009, at 9:13 AM, Mikie wrote: > > > I am using 3.2.2 sage. Will this fix work? > > No idea, but it might. You can try it out. > > > The work around is > > working for me and I would like not to damage the 40 stat functions I > > have created. > > Are you talking about modifications to the library itself? I would > recommend creating a patch and trying to get it into Sage proper > (there has been discussion about the lack of easy-to-use stats > support). A lot has changed since 3.2.2. > > > > > > > On Jul 10, 3:10 am, Robert Bradshaw > > wrote: > >> On Jul 9, 2009, at 1:57 PM, Kevin Horton wrote: > > >>> On 9 Jul 2009, at 15:02, William Stein wrote: > > >>>> On Thu, Jul 9, 2009 at 11:31 AM, Mikie > >>>> wrote: > > >>>>> Robert, how do I update my sage installation when you create a > >>>>> patch. Do I have to reinstall Sage? > >>>>> Thanx > > >>>> I just did > > >>>> sage: hg_sage.apply('http://trac.sagemath.org/sage_trac/attachment/ > >>>> ticket/5081/5081-numpy-types.patch') > > >>>> sage: quit > > >>>> sage -br > > >>>> ... > > >>>> sage: import numpy > >>>> sage: numpy.array([1,2,3]).dtype > >>>> dtype('int64') > > >>>> w00t! > > >>> Wow! I tried it, and it solves all the problems I was having with > >>> sage <-> numpy. I am very impressed. > > >> Well, I figured it's about time someone did it :). I thought I was > >> going to have to patch the numpy c sources myself, but shortly after > >> diving into them I saw the much simpler solution. > > >>> Kudos and thanks to Robert > >>> Bradshaw. If I ever meet you, I'd be happy to buy you a beer, or > >>> other beverage of your liking. > > >>> Will this change make it in sage 4.1, or will it slip to 4.1.1? > > >> Looks like 4.1 is already "out," so 4.1.1. Also, http:// > >> trac.sagemath.org/sage_trac/ticket/6506 is up. > > >> - Robert- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: scipy binomial pmf
I am using 3.2.2 sage. Will this fix work? The work around is working for me and I would like not to damage the 40 stat functions I have created. Thanks On Jul 10, 3:10 am, Robert Bradshaw wrote: > On Jul 9, 2009, at 1:57 PM, Kevin Horton wrote: > > > > > > > On 9 Jul 2009, at 15:02, William Stein wrote: > > >> On Thu, Jul 9, 2009 at 11:31 AM, Mikie > >> wrote: > > >>> Robert, how do I update my sage installation when you create a > >>> patch. Do I have to reinstall Sage? > >>> Thanx > > >> I just did > > >> sage: hg_sage.apply('http://trac.sagemath.org/sage_trac/attachment/ > >> ticket/5081/5081-numpy-types.patch') > > >> sage: quit > > >> sage -br > > >> ... > > >> sage: import numpy > >> sage: numpy.array([1,2,3]).dtype > >> dtype('int64') > > >> w00t! > > > Wow! I tried it, and it solves all the problems I was having with > > sage <-> numpy. I am very impressed. > > Well, I figured it's about time someone did it :). I thought I was > going to have to patch the numpy c sources myself, but shortly after > diving into them I saw the much simpler solution. > > > Kudos and thanks to Robert > > Bradshaw. If I ever meet you, I'd be happy to buy you a beer, or > > other beverage of your liking. > > > Will this change make it in sage 4.1, or will it slip to 4.1.1? > > Looks like 4.1 is already "out," so 4.1.1. Also, http:// > trac.sagemath.org/sage_trac/ticket/6506 is up. > > - Robert --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: scipy binomial pmf
Robert, how do I update my sage installation when you create a patch. Do I have to reinstall Sage? Thanx On Jul 9, 5:37 am, Ahmed Fasih wrote: > Jason, Robert, I'm trying to understand the patch, but it looks like > this is a fix for *all* Numpy/Scipy-Sage type issues? If so---oh happy > day! > > On Jul 9, 5:53 am, Jason Grout wrote: > > > > > Ahmed Fasih wrote: > > > Writing your own is a good way to understand the implementation issues > > > that we sometimes unthinkingly rely on, but for production code, it's > > > always a good idea to default to the pre-packaged implementation. > > > > In this case, I think it's the standard issue with Scipy not > > > understanding Sage types. This problem is described in > > >http://wiki.sagemath.org/faq#Typeissuesusingscipy.2Ccvxoptornumpyfrom... > > > > sage: import scipy.stats as stats > > > sage: stats.binom.pmf(1,10,.56,0) > > > --- > > > TypeError Traceback (most recent call > > > last) > > > > > > TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and > > > 'numpy.bool_' > > > > There are numerous fixes to this problem, one of which is: > > > > sage: stats.binom.pmf(1r,10r,.56r,0r) > > > 0.0034614823012532187 > > > Robert Bradshaw just posted a patch to #5081 that makes this work: > > > sage: from scipy import stats > > sage: stats.binom.pmf(1,10,.56,0) > > 0.0034614823012532187 > > > (no preparser magic or anything; it just works). > > > And there was much rejoicing in the land! > > > Jason- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---