[sage-support] Integer comparison with string question
python: 1 < 'haha' true sage: 1 < 'haha' false Ok, python and sage do something different. Why? sage: preparse('1 < "haha"') 'Integer(1) < "haha" And here I am stuck. I have looked through the sage reference manual, and tried googling, but no luck. Would a kind person explain why python and sage give different answers? Mariah -- 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] load command bug or feature?
Consider the following files and what sage does with each when they are loaded: foo1.sage -- def add(a,b): return a+b --- foo2.py--- def add(a,b): return a+b # this is a comment - --- foo3.sage--- def add(a,b): return a+b # this is a comment - eno% ./sage -- | Sage Version 4.4.4, Release Date: 2010-06-23 | | Type notebook() for the GUI, and license() for information.| -- sage: load "foo1.sage" sage: load "foo2.py" sage: load "foo3.sage" File "", line 3 # this is a comment ^ SyntaxError: invalid syntax sage: Is the inability to load foo3.sage a bug or a feature? Mariah -- 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] notebook question - "Output truncated"
I have a sage script that generates some graphs and text. When I load the script in a cell of a sage worksheet, I get everything I expect ... plus a message "WARNING: Output truncated" and a link for "full_output.txt". If I "save & quit" the worksheet, then restart the worksheet, now I do NOT see all the text associated with some of my later graphs. I am using sage-4.1. Is there a way to enlarge the size of my worksheet cell so that all my data is saved (and thus not truncated)? -- Mariah --~--~-~--~~~---~--~~ 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] symbolic/expression.pyx documentation patch
Would a sage developer please check in this (very minor) patch to the symbolic/expression.pyx documentation. # HG changeset patch # User Mariah Lenox # Date 1256231140 14400 # Node ID aaf2842929eca5d009d6a580a494e5f728517785 # Parent 5bf36a37cd0c2ce42b6bf42038e84a1968d3ad8b user: Mariah Lenox branch 'default' changed sage/symbolic/expression.pyx diff -r 5bf36a37cd0c -r aaf2842929ec sage/symbolic/expression.pyx --- a/sage/symbolic/expression.pyx Wed Oct 14 14:43:41 2009 -0700 +++ b/sage/symbolic/expression.pyx Thu Oct 22 13:05:40 2009 -0400 @@ -5017,7 +5017,7 @@ .. note:: - Currently, this does just sends the expression to Maxima + Currently, this just sends the expression to Maxima and converts it back to Sage. .. seealso:: -- Mariah --~--~-~--~~~---~--~~ 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: How run file code in Sage notebook?
Thanks! Now I see a plot. Mariah On Oct 8, 4:40 pm, William Stein wrote: > On Thu, Oct 8, 2009 at 1:31 PM, Mariah wrote: > > > When I paste into my Sage notebook cell > > > load "/path/to/my/script.sage" > > > and then click "evaluate", I get no output. > > All that happens is that a new cell comes up. The > > same thing happens when I use "attach" instead of "load". > > > Yet if I paste the code in "/path/to/my/script.sage" > > into my Sage notebook cell and then click "Evaluate", > > then I get the plot that I expect. > > > Have I hit another Sage bug? I am on a networked > > file system if that makes difference. > > Try explicitly showing the plot, e.g., do > > show(plot(sin)) > > instead of just > > plot(sin) > > 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] Re: How run file code in Sage notebook?
When I paste into my Sage notebook cell load "/path/to/my/script.sage" and then click "evaluate", I get no output. All that happens is that a new cell comes up. The same thing happens when I use "attach" instead of "load". Yet if I paste the code in "/path/to/my/script.sage" into my Sage notebook cell and then click "Evaluate", then I get the plot that I expect. Have I hit another Sage bug? I am on a networked file system if that makes difference. Mariah --~--~-~--~~~---~--~~ 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] How run file code in Sage notebook?
I have some Sage code that plots a graph. When I paste this code into a cell of a Sage notebook and evaluate the cell, I get the graph I expect. Now instead of pasting the code into the cell, I want to somehow tell the Sage notebook to execute the Sage code that exists in a file. Is this possible? If so, I am not having any luck figuring how to do it from the Sage reference manual, or any of the tutorials on the Sage Help web page. Would a kind Sage guru please give me a hint? Mariah --~--~-~--~~~---~--~~ 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: sxrange / xsrange possible bug
Minh, > Tutorials, tips and techniques on making and managing patches should > go in the Developers' Guide at > > http://www.sagemath.org/doc/developer/ Aha! This already has the stuff I was going to write up. The reason that I never looked at this is that I do not consider myself a "developer". I found the Sage documentation for sxrange/xsrange confusing, William suggested I write a patch for the documentation, and I tried to do so. The section that you referenced "Producing Patches with Mercurial" is in the second half of the Developers' Guide. I never would have found it without your pointing me at it. I respectfully suggest that this section be split out to a "How to make a Sage patch (for newbies)" ... or at the very least moved to the beginning of the Developers' Guide. Mariah --~--~-~--~~~---~--~~ 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: sxrange / xsrange possible bug
Dan, As you suggested, I took a look at the Mercurial website and quickly found that putting the following in my .hgrc file would make hg use my email address rather than 'mar...@localhost.localdomain' [ui] username = Mariah Lenox > You sound like you're pretty comfortable with the basic diff and patch > utilities ... Actually, I am not. I just followed the directions that Minh gave. Is there a "How to make a Sage patch (for newbies)" page anywhere? If not, there should be. (And yes, if not I volunteer to write a first draft if a Sage developer will suggest where it should go, review, etc.) Mariah --~--~-~--~~~---~--~~ 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] sxrange / xsrange possible bug
Dan, Please start a new thread rather than change the subject line. Thanks! Mariah On Sep 16, 2:33 pm, Dan Aldrich wrote: > I've been using sagenb for a few weeks now and have the hang of most > of the easy things. Is there a way to generate tables of a user > defined function? I'm still switching over to Excel or the TI > calculator to do that. > > Thanks, > -d --~--~-~--~~~---~--~~ 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: sxrange / xsrange possible bug
Minh, Ok, how does the following look? Like what you want? The date looks funny. # HG changeset patch # User mariah.le...@gmail.com # Date 1253110290 14400 # Node ID 299c98688ef9ab55662e33f9b9e074de803de4c4 # Parent 684eea91ff224e5bc6259ca19f1576c4c082b9d3 user: mariah.le...@gmail.com branch 'default' changed sage/misc/misc.py diff -r 684eea91ff22 -r 299c98688ef9 sage/misc/misc.py --- a/sage/misc/misc.py Fri Aug 14 05:37:38 2009 -0700 +++ b/sage/misc/misc.py Wed Sep 16 10:11:30 2009 -0400 @@ -1001,7 +1001,8 @@ .. note:: - This function is called ``xsrange`` to distinguish it from the + ``sxrange`` is an alias for ``xsrange``. The ``s`` in the name + stands for "Sage" and is to distinguish the command from the builtin Python ``xrange`` command. EXAMPLES:: Note that the first time I did "$ hg ci" I had to edit the file that my editor threw up to remove leading "HG" in some lines. When I repeat the command, I now get No username found, using 'mar...@localhost.localdomain' instead I also had to edit the patch to put in my email address. Is there a way (environment variable?) so that hg will pick up my email address? Mariah --~--~-~--~~~---~--~~ 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: sxrange / xsrange possible bug
Second attempt. Embarrassing typo in my first attempt. - --- misc.py.orig 2009-09-15 16:25:22.983553000 -0400 +++ misc.py 2009-09-15 16:28:47.335875000 -0400 @@ -1001,8 +1001,8 @@ .. note:: - This function is called ``xsrange`` to distinguish it from the - builtin Python ``xrange`` command. + ``sxrange`` is an alias for ``xsrange``. The ``x`` in the name is to distinguish it + from the builtin Python ``srange`` command. EXAMPLES:: --- Mariah --~--~-~--~~~---~--~~ 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: sxrange / xsrange possible bug
William, > The file misc.py has this line: > > sxrange = xsrange Ah, yes. I should have looked at the source code. Apologies. > Any chance you could post a patch with a statement that they are > aliases added to the docs? How about: - --- misc.py.orig2009-09-15 16:25:22.983553000 -0400 +++ misc.py 2009-09-15 16:28:47.335875000 -0400 @@ -1001,8 +1001,8 @@ .. note:: - This function is called ``xsrange`` to distinguish it from the - builtin Python ``xrange`` command. + ``sxrange`` is an alias for ``xsrange``. The ``x`` in the name is to distinguish it + from the builtin Python ``xrange`` command. EXAMPLES:: --- What I do not know how to do is to indicate that this is for the file sage-4.1.1/sage/misc/misc.py in spkg/standard/sage-4.1.1.spkg Is there a convention as to how to indicate this? Mariah --~--~-~--~~~---~--~~ 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] sxrange / xsrange possible bug
Perhaps I do not understand sxrange / xsrange correctly. The reference manual entries for them seem to be similar. Is there a difference? (If one is just an alias for the other, it would be best to say so. If they are different, the reference manual needs to emphasize the difference.) Also the reference manual entry for sage.misc.misc.sxrange has the note : This function is called xsrange to distinguish it from the builtin Python xrange command. Should it say "sxrange" rather than "xsrange"? Finally here is my attempt to use sxrange (xsrange gives similar output): e = 1 while true: print Integer(10^e) for i in sxrange(Integer(2),Integer(10^e)): if i == 3: break e += 1 gives 10 100 1000 1 10 100 1000 1 10 100 1000 1 10 100 1000 1 10 100 1000 Traceback (most recent call last): File "zzzbug.py", line 7, in for i in sxrange(Integer(_sage_const_2 ),Integer(_sage_const_10 **e)): File "/home/mariah/sage/sage-4.1.1-x86_64-Linux-core2-fc/local/lib/python2.6/site-packages/sage/misc/misc.py", line 1059, in generic_xsrange for k in xrange(icount): OverflowError: long int too large to convert to int I really want an iterator for the "for i in ..." loop. Is this a bug? Is there a better way to do what I want? -- Mariah --~--~-~--~~~---~--~~ 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: possible Polynomial_integer_dense_flint bug
Sorry, mistyped. Should be A = 2^(2^17+2^15) On Sep 10, 11:51 am, Mariah Lenox wrote: > In sage-4.1.1 > > R. = PolynomialRing(ZZ) > A = 2^(2^17+s^15) > a = A * x^31 > b = (A * x) * x^30 > a == b # prints "False" ??? > > I believe A and 31 are minimal to exhibit the bug. > > Can someone confirm? > > -- > Mariah --~--~-~--~~~---~--~~ 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] possible Polynomial_integer_dense_flint bug
In sage-4.1.1 R. = PolynomialRing(ZZ) A = 2^(2^17+s^15) a = A * x^31 b = (A * x) * x^30 a == b # prints "False" ??? I believe A and 31 are minimal to exhibit the bug. Can someone confirm? -- Mariah --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---