[sage-support] Re: Number of operands in an expression

2009-03-21 Thread Craig Citro

 That works well, but what about when the expression is multivariate,
 such as:

 expand((1+x+1/y)^10)

 It would be nice to have a general command to count the number of
 summands in such an expression.


Yep, I agree. Here is a *terrible* way to do it:

sage: var('x,y')
(x, y)
sage: f = x+y + 1
sage: len(expand(f._maxima_()))
3
sage: len(expand((f**4)._maxima_()))
15

Someone should file an enhancement ticket to do this in a more
sensible way. I also have no idea whether or not it works with
anything more complicated than rational functions -- do you want to
use just rational functions? It might be better to just work with
polynomial rings and their fraction fields ...

-cc

--~--~-~--~~~---~--~~
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: Disabled person using SAGE

2009-03-21 Thread Thierry Dumont
meitnik a écrit :
 Hi all,

 I am legally blind, legally deaf, some limited finger mobility, and
 some learning disabilities too (all from Rubella). I enjoy mathematics
 and programming but due to my limited income Mathematica is just out
 of my reach even for the Home edition. A friend told me about SAGE.
 Cool!

 Andrew

 --~--~-~--~--
Andrew (and the others),

There is a group of people in my University who would like to integrate 
in Sage the possibility to produce output in braille maths.
It seems that it would be possible to use the braille transcriptor NAT
(see: http://natbraille.free.fr or http://liris.cnrs.fr/nat) The main 
author is Bruno Mascret (he will receive this e-mail, too).
I try to translate what B. Mascret wrote to me:

This would give to braille user students at last the possibility to use 
a tool allowing them to be autonomous in their work.

If there are people interested, please contact B. Mascret 
(bmasc...@free.fr) or me.

Yours
Thierry.



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---

begin:vcard
fn:Thierry  Dumont
n:Dumont;Thierry 
org;quoted-printable;quoted-printable:Universit=C3=A9 Lyon 1  CNRS.;Institut Camille Jordan -- Math=C3=A9matiques / Mathematics.
adr:;;43 Bd du 11 Novembre.;Villeurbanne;;69621;France
email;internet:tdum...@math.univ-lyon1.fr
title;quoted-printable:Ing=C3=A9nieur de Recherche / Research Engineer.
tel;work:04 72 44 85 23.
tel;fax:04 72 44 80 53
x-mozilla-html:FALSE
url:http://math.univ-lyon1.fr/~tdumont
version:2.1
end:vcard



[sage-support] Re: Number of operands in an expression

2009-03-21 Thread ma...@mendelu.cz


On 21 Bře, 07:05, Craig Citro craigci...@gmail.com wrote:
  That works well, but what about when the expression is multivariate,
  such as:

  expand((1+x+1/y)^10)

  It would be nice to have a general command to count the number of
  summands in such an expression.

 Yep, I agree. Here is a *terrible* way to do it:

 sage: var('x,y')
 (x, y)
 sage: f = x+y + 1
 sage: len(expand(f._maxima_()))
 3
 sage: len(expand((f**4)._maxima_()))
 15

I think that better way is to use maxima commands op, args, length,
atomp

Robert Marik
--~--~-~--~~~---~--~~
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] Unexpected behavior of remove

2009-03-21 Thread Rolandb

Hi, I didn't expect that whole M would be effected.

M=[[0..9]]*3
print M[0]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

M[1].remove(9)
print M
[[0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2,
3,
4, 5, 6, 7, 8]]

Rolandb
--~--~-~--~~~---~--~~
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: Unexpected behavior of remove

2009-03-21 Thread Robert Bradshaw

On Mar 21, 2009, at 1:31 AM, Rolandb wrote:

 Hi, I didn't expect that whole M would be effected.

 M=[[0..9]]*3
 print M[0]
 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

 M[1].remove(9)
 print M
 [[0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2,
 3,
 4, 5, 6, 7, 8]]

This is due to how Python behaves with references--it doesn't  
actually copy the entire list three times, it simply makes three  
references to the same original list. To see that they are actually  
the same underlying list

sage: M[0] is M[1]
True

To get three copies of the same thing, you can do

sage: M = [[0..9] for a in range(3)]
sage: M[1].remove(9)
sage: print M
[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1,  
2, 3, 4, 5, 6, 7, 8, 9]]

Sage tries to avoid this pitfall by making most objects immutable.  
(An exception is vectors and matrices, where storage considerations  
make copying expensive, and even they can be made immutable.) There  
is talk about trying to implement copy-on-write semantics in some  
cases, but that's easier said than done.

- 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: Number of operands in an expression

2009-03-21 Thread Craig Citro

 I think that better way is to use maxima commands op, args, length,
 atomp


I think that for objects which come from Maxima, this is the right
thing to do. However, not all symbolic objects in Sage are wrappers
for Maxima objects -- in the case of expressions using pynac, the code
above actually moves them over to Maxima (via strings and pexpect) and
then ask for their length there (which probably ultimately uses the
commands you mention). This is less than desirable, hence my claim
that it was a terrible way to calculate the length. :)

I think a first step might be to introduce a __len__ method for
symbolic objects, but then, I'm not always sure what it should return.
For instance, what's the length of sin(x^2-y+3)? I could see
reasonable arguments for 1 or 4, or maybe even 3. Probably the
semantics should be decided by the people who actually use the
symbolics a lot, which isn't me ... which is why I haven't filed a
trac ticket -- I have no idea what to suggest such a method should do.

-cc

--~--~-~--~~~---~--~~
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: Number of operands in an expression

2009-03-21 Thread Robert Bradshaw

On Mar 21, 2009, at 2:01 AM, Craig Citro wrote:

 I think that better way is to use maxima commands op, args, length,
 atomp


 I think that for objects which come from Maxima, this is the right
 thing to do. However, not all symbolic objects in Sage are wrappers
 for Maxima objects -- in the case of expressions using pynac, the code
 above actually moves them over to Maxima (via strings and pexpect) and
 then ask for their length there (which probably ultimately uses the
 commands you mention). This is less than desirable, hence my claim
 that it was a terrible way to calculate the length. :)

 I think a first step might be to introduce a __len__ method for
 symbolic objects, but then, I'm not always sure what it should return.

I would argue that this is a good reason not to implement it :).  
Something like nops would be trivial to implement though, and  
probably a good idea.

- Robert

 For instance, what's the length of sin(x^2-y+3)? I could see
 reasonable arguments for 1 or 4, or maybe even 3. Probably the
 semantics should be decided by the people who actually use the
 symbolics a lot, which isn't me ... which is why I haven't filed a
 trac ticket -- I have no idea what to suggest such a method should do.

 -cc

 


--~--~-~--~~~---~--~~
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] scipy.constants

2009-03-21 Thread Hernan

Hello,

Is there any way to use scipy.constants in sage?

Thanks,

Hernan

--~--~-~--~~~---~--~~
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: Disabled person using SAGE

2009-03-21 Thread meitnik

nope that code snippet failed to work too in a worksheet. see my
comment in above posting of mine.
I am surprised its this hard to suck out all the keywords/functions
with their docstring stuff. How was the PDF produced? Cant that code
be shared so I can hack it to get just what I need.

On Mar 21, 12:31 am, Robert Bradshaw rober...@math.washington.edu
wrote:
 On Mar 20, 2009, at 9:21 PM, Marshall Hampton wrote:



  There might be a better way of doing this, but one way to get the
  docstrings that show up with ? is:

  q = globals().keys()
  q.sort()
  docstrings = [eval(x).__doc__ for x in q]

  It really depends on what exactly you want to do though - it may be
  more helpful to use a dictionary where the keys are the keys in  
  globals
  () and the values are the docstrings.

 This would be

 sage: all_docs = [(name, f.__doc__) for name, f in globals().items()]

  On Mar 20, 8:17 pm, meitnik meit...@gmail.com wrote:
  Cool, very helpful. Thank you!
  Ok I get 1555. I can list them if you want. Whats missing then??

 --
 | Sage Version 3.4, Release Date: 2009-03-11                         |
 | Type notebook() for the GUI, and license() for information.        |
 --
 sage: len(globals().keys())
 1611

 I guess I had been using that session for a while.

  Next, how do I get the '?' info for each function in a loop in a
  worksheet?
  I guess I need a py script to scrap out the docstrings from each
  modules (so I can sort/arrange the functions correctly)?

 This really is just the tip of the iceberg in terms of what is  
 available--most functionality is methods on objects (otherwise the  
 namespace would be cluttered with tens of thousands of functions.

 - 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: Disabled person using SAGE

2009-03-21 Thread meitnik

Nope, worksheet barfed trying this. I suspect the huge text info was
just too much. Cant this be rerouted to a text file while its loops
through. If so, how?

On Mar 21, 12:21 am, Marshall Hampton hampto...@gmail.com wrote:
 There might be a better way of doing this, but one way to get the
 docstrings that show up with ? is:

 q = globals().keys()
 q.sort()
 docstrings = [eval(x).__doc__ for x in q]

 It really depends on what exactly you want to do though - it may be
 more helpful to use a dictionary where the keys are the keys in globals
 () and the values are the docstrings.

 Hope that helps,
 M. Hampton

 On Mar 20, 8:17 pm, meitnik meit...@gmail.com wrote:

  Cool, very helpful. Thank you!
  Ok I get 1555. I can list them if you want. Whats missing then??
  Next, how do I get the '?' info for each function in a loop in a
  worksheet?
  I guess I need a py script to scrap out the docstrings from each
  modules (so I can sort/arrange the functions correctly)?
  Again, thank you.

  On Mar 20, 8:18 pm, Robert Bradshaw rober...@math.washington.edu
  wrote:

   On Mar 20, 2009, at 1:43 PM, meitnik wrote:

Another quick option: is there a way to get a listing of all the
commands/functions/keywords used in SAGE (the top level not at the
source code level)? Can that listing be done within context of topical
arrangement?? Inside SAGE in a cell or exported as a text file?
Thanks.

   Try

   sage: globals().keys()

   This will give a long list of everything defined at the top level.

   sage: [name for name, func in globals().items() if callable(func)]

   Will give all the functions. Note

   sage: len(globals().keys()) # 3.4
   1712

   - 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: Disabled person using SAGE

2009-03-21 Thread meitnik

I  hate to ask the obvious. Why was the gui front end not created in
Python in the first place or replaced by a Py make over?? Surely,
Someone with advanced Javascript skills can come up with something
better? I dont mean to step on toes but Gui is often everything to me
to use software well.


--~--~-~--~~~---~--~~
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: OS X Clickable application

2009-03-21 Thread adam

You can use AppleScript to create a launcher for Sage:
Here is the AppleScript code:

tell application Terminal
do script /Applications/sage/sage
end tell

Note: It assumes that Sage is located in the Applications
folder.

If you would like I can email you my  Sage launcher for
which I created an Sage icon.

Adam


On Mar 18, 9:43 pm, Byungchul Cha cha3...@gmail.com wrote:
 I remember reading something about making a clickable sage application
 for mac os X. Can I now do such a thing with sage 3.4? If so, where I
 can find the instruction?

 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] How do I deal with this message.

2009-03-21 Thread nerak99

Having played with Sage on a desktop PC I wanted to set it up as a
school wide service. I set it up on a server but got this message.

sage-3.4-linux-Fedora_release_10_Cambridge-x86_64-Linux#

./sage
--
| Sage Version 3.4, Release Date: 2009-03-11 |
| Type notebook() for the GUI, and license() for information.|
--

**
WARNING!  This Sage install was built on a machine that supports
instructions that are not available on this computer.  Sage will
likely fail with ILLEGAL INSTRUCTION errors! The following processor
flags were on the build machine but are not on this computer:

sse4_1

Email http://groups.google.com/group/sage-support for help.
To remove this warning and make Sage start, just delete
 /opt/sage-3.4-linux-Fedora_release_10_Cambridge-x86_64-Linux/
local/lib/sage-flags.txt
**

These are the details of the OS and below are processor details.
Should/Can I compile from source and would that work?




Operating systemUbuntu Linux 8.04.1
Webmin version  1.460
Time on system  Fri Mar 20 16:39:16 2009
Kernel and CPU  Linux 2.6.24-16-server on x86_64
System uptime   205 days, 4 hours, 9 minutes
CPU load averages   0.00 (1 min) 0.17 (5 mins) 0.13 (15 mins)
Real memory 7.81 GB total, 864.90 MB used

Virtual memory  5.58 GB total, 200 kB used

Local disk space130.04 GB total, 69.98 GB used

 cpuinfo
bash: cpuinfo: command not found
 cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 15
model   : 4
model name  : Intel(R) Xeon(TM) CPU 3.00GHz
stepping: 1
cpu MHz : 3002.167
cache size  : 1024 KB
physical id : 0
siblings: 2
core id : 0
cpu cores   : 1
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 5
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor
ds_cpl cid cx16 xtpr
bogomips: 5947.39

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 15
model   : 4
model name  : Intel(R) Xeon(TM) CPU 3.00GHz
stepping: 1
cpu MHz : 3002.167
cache size  : 1024 KB
physical id : 0
siblings: 2
core id : 0
cpu cores   : 1
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 5
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor
ds_cpl cid cx16 xtpr
bogomips: 5996.54

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 15
model   : 4
model name  : Intel(R) Xeon(TM) CPU 3.00GHz
stepping: 1
cpu MHz : 3002.167
cache size  : 1024 KB
physical id : 3
siblings: 2
core id : 3
cpu cores   : 1
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 5
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor
ds_cpl cid cx16 xtpr
bogomips: 5996.54

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 15
model   : 4
model name  : Intel(R) Xeon(TM) CPU 3.00GHz
stepping: 1
cpu MHz : 3002.167
cache size  : 1024 KB
physical id : 3
siblings: 2
core id : 3
cpu cores   : 1
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 5
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor
ds_cpl cid cx16 xtpr
bogomips: 5996.54


--~--~-~--~~~---~--~~
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: showing graphs with multiple edges

2009-03-21 Thread Robert Miller

  sage: G = DiGraph({1:{2: 2}, 2:{1:1}})
  sage: G.show()

 I'm surprised by the output of this.  There are clearly two edges in the
 graph: 1-2 and 2-1, but only one edge is shown.

No, the format for multiple edges in a dict of dicts is {u : {v :
[label1, label2]} }. Since you don't have the innermost list, the
graph is assumed to have one edge 1 -- 2 labeled by 2.


--~--~-~--~~~---~--~~
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: showing graphs with multiple edges

2009-03-21 Thread Robert Miller

 No, the format for multiple edges in a dict of dicts is {u : {v :
 [label1, label2]} }. Since you don't have the innermost list, the
 graph is assumed to have one edge 1 -- 2 labeled by 2.

My bad, I misread your complaint. That's definitely a bug.
--~--~-~--~~~---~--~~
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] Coercion problem

2009-03-21 Thread Jason Bandlow

Hi all,

Is the following missing coercion known?  I couldn't find anything on
trac, but there's a lot there related to coercion, so I may have missed it.

sage: a = float(1.0)
sage: QQ(a)
TypeError: Unable to coerce 1.0 (type 'float') to Rational

Note that the following works:

sage: a = float(1.0)
sage: QQ(RR(a))
1

I'm happy to open a ticket if that's the right thing to do here.

Thanks,
Jason Bandlow


--~--~-~--~~~---~--~~
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] The preparser and nested loads

2009-03-21 Thread Jason Bandlow

Hi all,

I ran into the following unexpected behavior, which I assume is because
the preparser does not work with nested loads.  I have two files,
foo.sage and bar.sage.  Their contents are as follows:

foo.sage

def foo():
  return (-1)**(-1)


bar.sage

load foo.sage


The following sage session works as expected:
sage: load foo.sage
sage: type(foo())
type 'sage.rings.rational.Rational'

The following session does not:
sage: load bar.sage
sage: type(foo())
type 'float'

I'm guessing that in the second session the file foo.sage is not getting
preparsed (and so foo() returns a Python object and not a Sage object).
 Is this correct? If so, is there a way to force it to be preparsed?  I
like to have lots of little files with different functions, and then a
file which loads whichever of these happen to be working/relevant at the
moment.  That way I only have to load one file at the start of my session.

Any advice is much appreciated!

Thanks,
Jason Bandlow


--~--~-~--~~~---~--~~
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: How do I deal with this message.

2009-03-21 Thread Rob Beezer

The thread linked to below begins the same way.  Maybe it has the
answer you need.

http://groups.google.com/group/sage-support/browse_thread/thread/6fc59581c9ed1af1


On Mar 21, 8:14 am, nerak99 t10...@gmail.com wrote:
 Having played with Sage on a desktop PC I wanted to set it up as a
 school wide service. I set it up on a server but got this message.

 sage-3.4-linux-Fedora_release_10_Cambridge-x86_64-Linux#

 ./sage
 --
 | Sage Version 3.4, Release Date: 2009-03-11                         |
 | Type notebook() for the GUI, and license() for information.        |
 --

 **
 WARNING!  This Sage install was built on a machine that supports
 instructions that are not available on this computer.  Sage will
 likely fail with ILLEGAL INSTRUCTION errors! The following processor
 flags were on the build machine but are not on this computer:

 sse4_1

 Emailhttp://groups.google.com/group/sage-supportfor help.
 To remove this warning and make Sage start, just delete
      /opt/sage-3.4-linux-Fedora_release_10_Cambridge-x86_64-Linux/
 local/lib/sage-flags.txt
 **

 These are the details of the OS and below are processor details.
 Should/Can I compile from source and would that work?

 Operating system        Ubuntu Linux 8.04.1
 Webmin version  1.460
 Time on system  Fri Mar 20 16:39:16 2009
 Kernel and CPU  Linux 2.6.24-16-server on x86_64
 System uptime   205 days, 4 hours, 9 minutes
 CPU load averages       0.00 (1 min) 0.17 (5 mins) 0.13 (15 mins)
 Real memory     7.81 GB total, 864.90 MB used

 Virtual memory  5.58 GB total, 200 kB used

 Local disk space        130.04 GB total, 69.98 GB used

  cpuinfo

 bash: cpuinfo: command not found cat /proc/cpuinfo

 processor       : 0
 vendor_id       : GenuineIntel
 cpu family      : 15
 model           : 4
 model name      : Intel(R) Xeon(TM) CPU 3.00GHz
 stepping        : 1
 cpu MHz         : 3002.167
 cache size      : 1024 KB
 physical id     : 0
 siblings        : 2
 core id         : 0
 cpu cores       : 1
 fdiv_bug        : no
 hlt_bug         : no
 f00f_bug        : no
 coma_bug        : no
 fpu             : yes
 fpu_exception   : yes
 cpuid level     : 5
 wp              : yes
 flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov 
 pat
 pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor
 ds_cpl cid cx16 xtpr
 bogomips        : 5947.39

 processor       : 1
 vendor_id       : GenuineIntel
 cpu family      : 15
 model           : 4
 model name      : Intel(R) Xeon(TM) CPU 3.00GHz
 stepping        : 1
 cpu MHz         : 3002.167
 cache size      : 1024 KB
 physical id     : 0
 siblings        : 2
 core id         : 0
 cpu cores       : 1
 fdiv_bug        : no
 hlt_bug         : no
 f00f_bug        : no
 coma_bug        : no
 fpu             : yes
 fpu_exception   : yes
 cpuid level     : 5
 wp              : yes
 flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov 
 pat
 pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor
 ds_cpl cid cx16 xtpr
 bogomips        : 5996.54

 processor       : 2
 vendor_id       : GenuineIntel
 cpu family      : 15
 model           : 4
 model name      : Intel(R) Xeon(TM) CPU 3.00GHz
 stepping        : 1
 cpu MHz         : 3002.167
 cache size      : 1024 KB
 physical id     : 3
 siblings        : 2
 core id         : 3
 cpu cores       : 1
 fdiv_bug        : no
 hlt_bug         : no
 f00f_bug        : no
 coma_bug        : no
 fpu             : yes
 fpu_exception   : yes
 cpuid level     : 5
 wp              : yes
 flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov 
 pat
 pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor
 ds_cpl cid cx16 xtpr
 bogomips        : 5996.54

 processor       : 3
 vendor_id       : GenuineIntel
 cpu family      : 15
 model           : 4
 model name      : Intel(R) Xeon(TM) CPU 3.00GHz
 stepping        : 1
 cpu MHz         : 3002.167
 cache size      : 1024 KB
 physical id     : 3
 siblings        : 2
 core id         : 3
 cpu cores       : 1
 fdiv_bug        : no
 hlt_bug         : no
 f00f_bug        : no
 coma_bug        : no
 fpu             : yes
 fpu_exception   : yes
 cpuid level     : 5
 wp              : yes
 flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov 
 pat
 pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor
 ds_cpl cid cx16 xtpr
 bogomips        : 5996.54
--~--~-~--~~~---~--~~
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: 

[sage-support] Bad patch for unicode chars in TinyMCE?

2009-03-21 Thread ma...@mendelu.cz

Hello, this is related to the thread at
http://groups.google.cz/group/sage-support/browse_thread/thread/2a699360a3847bab

I think that installation of
http://trac.sagemath.org/sage_trac/attachment/ticket/5564/trac_5564-2.patch
causes that TinyMCE cannot be used to edit mathematical formulas

If I enter $\int x dx$ in TinyMCE and exit the editor, I can see the
picture representation for this formula formated by jsmath

If I invoke TinyMCE again, i do not see TeX representation for the
formula and hence, I cannot edit this formula. Can somebody confirm
this bug, please? Thank you.

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: The preparser and nested loads

2009-03-21 Thread William Stein

On Sat, Mar 21, 2009 at 9:06 AM, Jason Bandlow jband...@gmail.com wrote:

 Hi all,

 I ran into the following unexpected behavior, which I assume is because
 the preparser does not work with nested loads.  I have two files,
 foo.sage and bar.sage.  Their contents are as follows:

 foo.sage
 
 def foo():
  return (-1)**(-1)


 bar.sage
 
 load foo.sage


 The following sage session works as expected:
        sage: load foo.sage
        sage: type(foo())
        type 'sage.rings.rational.Rational'

 The following session does not:
        sage: load bar.sage
        sage: type(foo())
        type 'float'

 I'm guessing that in the second session the file foo.sage is not getting
 preparsed (and so foo() returns a Python object and not a Sage object).
  Is this correct? If so, is there a way to force it to be preparsed?  I
 like to have lots of little files with different functions, and then a
 file which loads whichever of these happen to be working/relevant at the
 moment.  That way I only have to load one file at the start of my session.

 Any advice is much appreciated!

 Thanks,
 Jason Bandlow

I an confirm this bug.  It is now

 http://trac.sagemath.org/sage_trac/ticket/5580.

 -- 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] Re: Disabled person using SAGE

2009-03-21 Thread William Stein

On Sat, Mar 21, 2009 at 7:56 AM, meitnik meit...@gmail.com wrote:

 I  hate to ask the obvious. Why was the gui front end not created in
 Python in the first place or replaced by a Py make over??

Despite being obvious, I don't understand the question.  The GUI front
end is written in Python and Javascript, which is the canonical choice
for writing an AJAX interface to a Python program.

 Surely,
 Someone with advanced Javascript skills can come up with something
 better?
 I dont mean to step on toes but Gui is often everything to me
 to use software well.

I'm sorry that you find the Sage GUI to not be optimal.  Many thanks
for your feedback.

 -- 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] Re: Number of operands in an expression

2009-03-21 Thread Burcin Erocal

On Sat, 21 Mar 2009 03:02:57 -0700
Robert Bradshaw rober...@math.washington.edu wrote:

 
 On Mar 21, 2009, at 2:01 AM, Craig Citro wrote:
 
  I think that better way is to use maxima commands op, args, length,
  atomp
 
 
  I think that for objects which come from Maxima, this is the right
  thing to do. However, not all symbolic objects in Sage are wrappers
  for Maxima objects -- in the case of expressions using pynac, the
  code above actually moves them over to Maxima (via strings and
  pexpect) and then ask for their length there (which probably
  ultimately uses the commands you mention). This is less than
  desirable, hence my claim that it was a terrible way to calculate
  the length. :)
 
  I think a first step might be to introduce a __len__ method for
  symbolic objects, but then, I'm not always sure what it should
  return.
 
 I would argue that this is a good reason not to implement it :).  
 Something like nops would be trivial to implement though, and  
 probably a good idea.
 
It's in pynac already:

sage: var('x,y',ns=1)
(x, y)
sage: f = expand((1+x+1/y)^10) 
sage: f.nargs()
66

I could hook this up to __len__ as well, since __getitem__ lets you
access parts of the expression. E.g.,

sage: f[0]
x^10
sage: f[1]
10*x^9


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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: scipy.constants

2009-03-21 Thread Jason Grout

Hernan wrote:
 Hello,
 
 Is there any way to use scipy.constants in sage?
 

When was it made part of scipy?  We may have a version in Sage that is 
too old:

sage: import scipy
sage: scipy.__version__
'0.6.0'
sage: import scipy.constants
---
ImportError   Traceback (most recent call last)

/home/jason/.sage/temp/littleone/10165/_home_jason__sage_init_sage_0.py 
in module()

ImportError: No module named constants

(we actually have a SVN release, not 0.6.0, though).


You can always just install scipy in Sage, just like you would install 
it from the command line, though.

The scipy package in Sage should really be upgraded.

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] Re: Coercion problem

2009-03-21 Thread Robert Bradshaw

On Mar 21, 2009, at 9:06 AM, Jason Bandlow wrote:


 Hi all,

 Is the following missing coercion known?  I couldn't find anything on
 trac, but there's a lot there related to coercion, so I may have  
 missed it.

   sage: a = float(1.0)
   sage: QQ(a)
   TypeError: Unable to coerce 1.0 (type 'float') to Rational

 Note that the following works:

   sage: a = float(1.0)
   sage: QQ(RR(a))
   1

 I'm happy to open a ticket if that's the right thing to do here.

Yes, this conversion is missing. It should be easy to implement.

- 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: Coercion problem

2009-03-21 Thread Jason Bandlow

Robert Bradshaw wrote:
 On Mar 21, 2009, at 9:06 AM, Jason Bandlow wrote:
 
 Hi all,

 Is the following missing coercion known?  I couldn't find anything on
 trac, but there's a lot there related to coercion, so I may have  
 missed it.

  sage: a = float(1.0)
  sage: QQ(a)
  TypeError: Unable to coerce 1.0 (type 'float') to Rational

 Note that the following works:

  sage: a = float(1.0)
  sage: QQ(RR(a))
  1

 I'm happy to open a ticket if that's the right thing to do here.
 
 Yes, this conversion is missing. It should be easy to implement.
 
 - Robert

This is now:   http://sagetrac.org/sage_trac/ticket/5582

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] Re: Disabled person using SAGE

2009-03-21 Thread William Stein

On Sat, Mar 21, 2009 at 3:47 PM, meitnik meit...@gmail.com wrote:

 Sorry for my confusion and misunderstanding. Thought the whole Gui was
 all in Javascript.

The client part, which runs in the web browser, is written in
javascript.  The server part is a Python program (a web server).

 Thanks for explaining.
 Please, is there a document that explains well how the Gui front end
 works.

No.

 I really would like to try to get help and add to the gui for my
 needs.

Cool.

 Is there an RTF version of the Ref guide for starters?

I don't think so.  Mike is there a way to generate rtf from ReST/Sphinx?

 Will it be hard for any experienced Javascript/python programmer to
 help me bolt on a way to point/click input?

What precisely do you mean by that?  Are you not able to use a
keyboard at all or?

What do you want to compute?

 Sometimes we disabled folk need to point out the missing curb cuts.

 And thanks for hearing me out and putting up with a determined guy.




 On Mar 21, 1:18 pm, William Stein wst...@gmail.com wrote:
 On Sat, Mar 21, 2009 at 7:56 AM, meitnik meit...@gmail.com wrote:

  I  hate to ask the obvious. Why was the gui front end not created in
  Python in the first place or replaced by a Py make over??

 Despite being obvious, I don't understand the question.  The GUI front
 end is written in Python and Javascript, which is the canonical choice
 for writing an AJAX interface to a Python program.

  Surely,
  Someone with advanced Javascript skills can come up with something
  better?
  I dont mean to step on toes but Gui is often everything to me
  to use software well.

 I'm sorry that you find the Sage GUI to not be optimal.  Many thanks
 for your feedback.

  -- William
 




-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://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: python's list comprehension

2009-03-21 Thread Carl Witty

On Mar 20, 5:52 pm, Nils Bruin nbr...@sfu.ca wrote:
 sage: DB = CremonaDatabase()
 sage: L = [ N.str()+c[0] for N in (lambda l: xrange(l[0],l[1]))
 (DB.conductor_range()) for c in DB.allbsd(N).items() if
                  round(RDF(c[1][4]))%81 == 0]
...
  - the whole lambda expression to make the pair output by
 DB.conductor_range() into an iterable. Is there a syntactically more
 pleasing construct in python for that?
 (for instance variables local to expressions. In Magma speak: [a..b]
 where (a,b)=DB.conductor_range())

Note that you're skipping the last conductor in the database, I
think... DB.conductor_range? indicates that the returned values
represent an inclusive range, but range/xrange/etc. take their second
argument as an exclusive bound.  (This is easy to fix with the above
xrange expression, but I don't see how to fix it with the simple *args
syntax.)

Carl

--~--~-~--~~~---~--~~
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: python's list comprehension

2009-03-21 Thread William Stein

On Sat, Mar 21, 2009 at 5:24 PM, Carl Witty carl.wi...@gmail.com wrote:

 On Mar 20, 5:52 pm, Nils Bruin nbr...@sfu.ca wrote:
 sage: DB = CremonaDatabase()
 sage: L = [ N.str()+c[0] for N in (lambda l: xrange(l[0],l[1]))
 (DB.conductor_range()) for c in DB.allbsd(N).items() if
                  round(RDF(c[1][4]))%81 == 0]
 ...
  - the whole lambda expression to make the pair output by
 DB.conductor_range() into an iterable. Is there a syntactically more
 pleasing construct in python for that?
 (for instance variables local to expressions. In Magma speak: [a..b]
 where (a,b)=DB.conductor_range())

 Note that you're skipping the last conductor in the database, I
 think... DB.conductor_range? indicates that the returned values
 represent an inclusive range, but range/xrange/etc. take their second
 argument as an exclusive bound.  (This is easy to fix with the above
 xrange expression, but I don't see how to fix it with the simple *args
 syntax.)

If you're using the large database (up to 13), fortunately there
is no curve with that conductor.
If you use the small one, then conductor_range()'s top bound is ,
and there *is* a curve of that conductor.

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] Re: Number of operands in an expression

2009-03-21 Thread Alasdair

Is pynac still being actively developed?  From its web pages it seems
not; anyway I would have thought that most of its functionality would
have found a better and better-maintained home in Sage.

Anyway, I've just discovered that all of this can be done using
Maxima:

p=expand((1+x+1/y)^10)
maxima.nterms(p)

All somebody needs to do is to rewrite the lisp code for nterms into
python - and there you go!

cheers,
Aladair

On Mar 22, 5:32 am, Burcin Erocal bur...@erocal.org wrote:
 On Sat, 21 Mar 2009 03:02:57 -0700



 Robert Bradshaw rober...@math.washington.edu wrote:

  On Mar 21, 2009, at 2:01 AM, Craig Citro wrote:

   I think that better way is to use maxima commands op, args, length,
   atomp

   I think that for objects which come from Maxima, this is the right
   thing to do. However, not all symbolic objects in Sage are wrappers
   for Maxima objects -- in the case of expressions using pynac, the
   code above actually moves them over to Maxima (via strings and
   pexpect) and then ask for their length there (which probably
   ultimately uses the commands you mention). This is less than
   desirable, hence my claim that it was a terrible way to calculate
   the length. :)

   I think a first step might be to introduce a __len__ method for
   symbolic objects, but then, I'm not always sure what it should
   return.

  I would argue that this is a good reason not to implement it :).  
  Something like nops would be trivial to implement though, and  
  probably a good idea.

 It's in pynac already:

 sage: var('x,y',ns=1)
 (x, y)
 sage: f = expand((1+x+1/y)^10)
 sage: f.nargs()
 66

 I could hook this up to __len__ as well, since __getitem__ lets you
 access parts of the expression. E.g.,

 sage: f[0]
 x^10
 sage: f[1]
 10*x^9

 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Number of operands in an expression

2009-03-21 Thread William Stein

On Sat, Mar 21, 2009 at 5:42 PM, Alasdair amc...@gmail.com wrote:

 Is pynac still being actively developed?

Yes.

  From its web pages it seems
 not; anyway I would have thought that most of its functionality would
 have found a better and better-maintained home in Sage.

Pynac exists only as a part of sage.  Pynac will soon completely
replace Maxima as the backend for symbolic manipulation in Sage.

William

 Anyway, I've just discovered that all of this can be done using
 Maxima:

 p=expand((1+x+1/y)^10)
 maxima.nterms(p)


--~--~-~--~~~---~--~~
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: Disabled person using SAGE

2009-03-21 Thread meitnik

On Mar 21, 7:54 pm, William Stein wst...@gmail.com wrote:
 On Sat, Mar 21, 2009 at 3:47 PM, meitnik meit...@gmail.com wrote:

  Sorry for my confusion and misunderstanding. Thought the whole Gui was
  all in Javascript.

 The client part, which runs in the web browser, is written in
 javascript.  The server part is a Python program (a web server).
-- from some of the docs I have skimed over, there is info on the web
server but cant find much on the client.
My previous question was if had Javascript dev friend look at your
code will he make sense of it enough to help me.


  Is there an RTF version of the Ref guide for starters?
 I don't think so.  Mike is there a way to generate rtf from ReST/Sphinx?
-- thank you. I have been trying to convert via TextEdit the PDF but
its not going well. I hate to have to OCR some 4k pages.


 What precisely do you mean by that?  Are you not able to use a
 keyboard at all or?
-- I can type well for short bursts but not for long periods and not
repeating over and over the same thing; my brain/fingers have great
problems with spelling speicalized vocabulary like math.
I rather focus on the concepts than fighting with my body just
inputing code/math symbols etc.

Let give a bit more about my background.
Since boyhood, I have always noticed and valued visual patterns and
grasped and delighted in abstract relationships well but not expressed
well via writing or manually due to my disabilities. But orally I can
well at a slow pace. The very sentences I write now took about 30
years of hard work and determination to achieve. However doing written
math was often not easy due to rubella. I understood math but did
poorly on timed limited exams.
During high school, my mathematics teacher worked with great
imagination and respect to help me really enjoy math to the point he
noticed I used math more as a conceptual tool in my creative life,
rather than just making it through the next exam. Eventually, he felt
I would make a good math teacher doing some research on the side. But
what I didn't know was most of the college profs where unwilling to
work my disabilities even though often I tutored my fellow math majors
towards better grades. Eventually I dropped the math major. But
promised myself someday I would return to math. I heard about personal
computers coming on for doing mathematics. Perhaps someone would
figure out how to do symbolic math on a PC.
During the early 90s I was introduced to Mathematica at work (I was a
lead software tester/gui designer) and at last I could enjoy math
again due to its gui. But due to personal cost and office politics I
was not to have access to Mathematica. One day I will.
But the price of Mathematica just became higher and higher well beyond
my reach. Focused instead on my graphics design as best I could. But
never made enough to buy Mathematica. I gave up.
Will I create a new proof or solve a long standing problem? Perhaps
not, but I do enjoy the beauty of math and exploring equations.
Then 6 days ago a friend told me about SAGE. Hope.
Enough of me, You have a great back end of a large collection -- and
growing -- of math tools/libraries etc. Perhaps taking some time to
make inputting math functions/keyword/symbols into a cell might be a
win-win for all. I always believed a computer should do the heavy work
and allow me to work smart than hard. If you want I can prototype a
new gui that would help me and email it to you. Again, thanks for
hearing me out.
Andrew
--~--~-~--~~~---~--~~
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: OS X Clickable application

2009-03-21 Thread meitnik

Hey, I would like that script too, thanks. btw, can you have it do a
notebook too?
andrew

On Mar 21, 11:17 am, adam ahauskne...@umassd.edu wrote:
 You can use AppleScript to create a launcher for Sage:
 Here is the AppleScript code:

 tell application Terminal
         do script /Applications/sage/sage
 end tell

 Note: It assumes that Sage is located in the Applications
 folder.

 If you would like I can email you my  Sage launcher for
 which I created an Sage icon.

 Adam

 On Mar 18, 9:43 pm, Byungchul Cha cha3...@gmail.com wrote:

  I remember reading something about making a clickable sage application
  for mac os X. Can I now do such a thing with sage 3.4? If so, where I
  can find the instruction?

  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: Bad patch for unicode chars in TinyMCE?

2009-03-21 Thread Rob Beezer

Robert,

I'm not having this problem.  3.4 and Firefox 3.0.5 (ubuntu).

When I double-click to get back into TinyMCE, I do get a small grey
box with int x dx (no quotes, no dollar signs) and a small square
that closes the box, overlaid on the editor.  I've not not seen that
before, but it goes away politely and I can edit some more.

Rob

On Mar 21, 9:55 am, ma...@mendelu.cz ma...@mendelu.cz wrote:
 Hello, this is related to the thread 
 athttp://groups.google.cz/group/sage-support/browse_thread/thread/2a699...

 I think that installation 
 ofhttp://trac.sagemath.org/sage_trac/attachment/ticket/5564/trac_5564-2...
 causes that TinyMCE cannot be used to edit mathematical formulas

 If I enter $\int x dx$ in TinyMCE and exit the editor, I can see the
 picture representation for this formula formated by jsmath

 If I invoke TinyMCE again, i do not see TeX representation for the
 formula and hence, I cannot edit this formula. Can somebody confirm
 this bug, please? Thank you.

 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: Number of operands in an expression

2009-03-21 Thread Robert Bradshaw

On Mar 21, 2009, at 6:05 PM, William Stein wrote:


 On Sat, Mar 21, 2009 at 5:42 PM, Alasdair amc...@gmail.com wrote:

 Is pynac still being actively developed?

 Yes.

  From its web pages it seems
 not; anyway I would have thought that most of its functionality would
 have found a better and better-maintained home in Sage.

 Pynac exists only as a part of sage.  Pynac will soon completely
 replace Maxima as the backend for symbolic manipulation in Sage.

Perhaps you were looking at http://sourceforge.net/projects/pynac/ ,  
which is pretty dead. The project that is part of sage is http:// 
pynac.sagemath.org/ , which admittedly doesn't have much of a web  
page yet (but is being actively worked on).

- 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] ImportError starting Sage 3.4 in Mac OS X 10.4.11

2009-03-21 Thread John G

I just downloaded Sage 3.4 for Mac OSX (sage-3.4-Intel-OSX10.5-i386-
Darwin.dmg).  I installed it without trouble, but trying to run it I
get the errors below.  I'm running Mac OS X 10.4.11 on an Intel Core
Duo Mac Mini. What am I doing wrong?  Is there a different version of
Sage specifically for 10.4?

--
| Sage Version 3.4, Release Date: 2009-03-11 |
| Type notebook() for the GUI, and license() for information.|
--
The SAGE install tree may have moved.
Regenerating Python.pyo and .pyc files that hardcode the install PATH
(please wait at
most a few minutes)...
Do not interrupt this.
---
ImportError   Traceback (most recent call
last)

/Applications/sage/local/bin/string in module()

/Applications/sage/local/lib/python2.5/site-packages/sage/misc/
preparser_ipython.py in module()
  6
###
  7
 8 import sage.misc.interpreter
  9
 10 import preparser

/Applications/sage/local/lib/python2.5/site-packages/sage/misc/
interpreter.py in module()
100
101 import os
-- 102 import log
103
104 import remote_file

/Applications/sage/local/lib/python2.5/site-packages/sage/misc/log.py
in module()
 63
 64 import interpreter
--- 65 import latex
 66 import misc
 67

/Applications/sage/local/lib/python2.5/site-packages/sage/misc/
latex.py in module()
 41 import random
 42
--- 43 from misc import tmp_dir
 44 import sage_eval
 45 from sage.misc.misc import SAGE_DOC

/Applications/sage/local/lib/python2.5/site-packages/sage/misc/misc.py
in module()
 26
 27 import operator, os, stat, socket, sys, signal, time, weakref,
resource, math
--- 28 import sage.misc.prandom as random
 29
 30 from banner import version, banner

/Applications/sage/local/lib/python2.5/site-packages/sage/misc/
prandom.py in module()
 54 # setting seeds should only be done through
sage.misc.randstate .
 55
--- 56 from sage.misc.randstate import current_randstate
 57
 58 def _pyrand():

ImportError: dlopen(/Applications/sage/local/lib/python2.5/site-
packages/sage/misc/randstate.so, 2): Symbol not found: _close$UNIX2003
  Referenced from: /Applications/sage/local/lib//libpari-gmp.dylib
  Expected in: flat namespace

WARNING: Failure executing code: 'import sage.misc.preparser_ipython;
sage.misc.preparser_ipython.magma_colon_equals=True'
---
ImportError   Traceback (most recent call
last)

/Applications/sage/local/lib/python2.5/site-packages/IPython/
ipmaker.py in force_import(modname)
 64 reload(sys.modules[modname])
 65 else:
--- 66 __import__(modname)
 67
 68

/Applications/sage/local/bin/ipy_profile_sage.py in module()
  1 import os
  2 if 'SAGE_CLEAN' not in os.environ:
 3 import sage.misc.misc
  4 from sage.misc.interpreter import preparser, _ip
  5 preparser(True)

/Applications/sage/local/lib/python2.5/site-packages/sage/misc/misc.py
in module()
 26
 27 import operator, os, stat, socket, sys, signal, time, weakref,
resource, math
--- 28 import sage.misc.prandom as random
 29
 30 from banner import version, banner

/Applications/sage/local/lib/python2.5/site-packages/sage/misc/
prandom.py in module()
 54 # setting seeds should only be done through
sage.misc.randstate .
 55
--- 56 from sage.misc.randstate import current_randstate
 57
 58 def _pyrand():

ImportError: dlopen(/Applications/sage/local/lib/python2.5/site-
packages/sage/misc/randstate.so, 2): Symbol not found: _close$UNIX2003
  Referenced from: /Applications/sage/local/lib//libpari-gmp.dylib
  Expected in: flat namespace

Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.

WARNING: Readline services not available on this platform.
WARNING: The auto-indent feature requires the readline library
ERROR: name 'sage_prompt' is not defined


--~--~-~--~~~---~--~~
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: ImportError starting Sage 3.4 in Mac OS X 10.4.11

2009-03-21 Thread Robert Bradshaw

On Mar 21, 2009, at 7:28 PM, John G wrote:

 I just downloaded Sage 3.4 for Mac OSX (sage-3.4-Intel-OSX10.5-i386-
 Darwin.dmg).  I installed it without trouble, but trying to run it I
 get the errors below.  I'm running Mac OS X 10.4.11 on an Intel Core
 Duo Mac Mini. What am I doing wrong?  Is there a different version of
 Sage specifically for 10.4?

Yes, there is. I put a copy at http://sage.math.washington.edu/home/ 
robertwb/sage-3.4-Intel-OSX10.4-i386-Darwin.dmg (I put one in the bin  
directory like normal, but it doesn't show up on the download page  
like it used to...)


 --
 | Sage Version 3.4, Release Date: 2009-03-11 |
 | Type notebook() for the GUI, and license() for information.|
 --
 The SAGE install tree may have moved.
 Regenerating Python.pyo and .pyc files that hardcode the install PATH
 (please wait at
 most a few minutes)...
 Do not interrupt this.
 -- 
 -
 ImportError   Traceback (most recent call
 last)

 /Applications/sage/local/bin/string in module()

 /Applications/sage/local/lib/python2.5/site-packages/sage/misc/
 preparser_ipython.py in module()
   6
 ## 
 #
   7
  8 import sage.misc.interpreter
   9
  10 import preparser

 /Applications/sage/local/lib/python2.5/site-packages/sage/misc/
 interpreter.py in module()
 100
 101 import os
 -- 102 import log
 103
 104 import remote_file

 /Applications/sage/local/lib/python2.5/site-packages/sage/misc/log.py
 in module()
  63
  64 import interpreter
 --- 65 import latex
  66 import misc
  67

 /Applications/sage/local/lib/python2.5/site-packages/sage/misc/
 latex.py in module()
  41 import random
  42
 --- 43 from misc import tmp_dir
  44 import sage_eval
  45 from sage.misc.misc import SAGE_DOC

 /Applications/sage/local/lib/python2.5/site-packages/sage/misc/misc.py
 in module()
  26
  27 import operator, os, stat, socket, sys, signal, time, weakref,
 resource, math
 --- 28 import sage.misc.prandom as random
  29
  30 from banner import version, banner

 /Applications/sage/local/lib/python2.5/site-packages/sage/misc/
 prandom.py in module()
  54 # setting seeds should only be done through
 sage.misc.randstate .
  55
 --- 56 from sage.misc.randstate import current_randstate
  57
  58 def _pyrand():

 ImportError: dlopen(/Applications/sage/local/lib/python2.5/site-
 packages/sage/misc/randstate.so, 2): Symbol not found: _close$UNIX2003
   Referenced from: /Applications/sage/local/lib//libpari-gmp.dylib
   Expected in: flat namespace

 WARNING: Failure executing code: 'import sage.misc.preparser_ipython;
 sage.misc.preparser_ipython.magma_colon_equals=True'
 -- 
 -
 ImportError   Traceback (most recent call
 last)

 /Applications/sage/local/lib/python2.5/site-packages/IPython/
 ipmaker.py in force_import(modname)
  64 reload(sys.modules[modname])
  65 else:
 --- 66 __import__(modname)
  67
  68

 /Applications/sage/local/bin/ipy_profile_sage.py in module()
   1 import os
   2 if 'SAGE_CLEAN' not in os.environ:
  3 import sage.misc.misc
   4 from sage.misc.interpreter import preparser, _ip
   5 preparser(True)

 /Applications/sage/local/lib/python2.5/site-packages/sage/misc/misc.py
 in module()
  26
  27 import operator, os, stat, socket, sys, signal, time, weakref,
 resource, math
 --- 28 import sage.misc.prandom as random
  29
  30 from banner import version, banner

 /Applications/sage/local/lib/python2.5/site-packages/sage/misc/
 prandom.py in module()
  54 # setting seeds should only be done through
 sage.misc.randstate .
  55
 --- 56 from sage.misc.randstate import current_randstate
  57
  58 def _pyrand():

 ImportError: dlopen(/Applications/sage/local/lib/python2.5/site-
 packages/sage/misc/randstate.so, 2): Symbol not found: _close$UNIX2003
   Referenced from: /Applications/sage/local/lib//libpari-gmp.dylib
   Expected in: flat namespace

 Error importing ipy_profile_sage - perhaps you should run %upgrade?
 WARNING: Loading of ipy_profile_sage failed.

 WARNING: Readline services not available on this platform.
 WARNING: The auto-indent feature requires the readline library
 ERROR: name 'sage_prompt' is not defined


 


--~--~-~--~~~---~--~~
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 

[sage-support] Re: ImportError starting Sage 3.4 in Mac OS X 10.4.11

2009-03-21 Thread Minh Nguyen

Hi John,

On Sun, Mar 22, 2009 at 2:28 AM, John G gourl...@umich.edu wrote:

 I just downloaded Sage 3.4 for Mac OSX (sage-3.4-Intel-OSX10.5-i386-
 Darwin.dmg).  I installed it without trouble, but trying to run it I
 get the errors below.  I'm running Mac OS X 10.4.11 on an Intel Core
 Duo Mac Mini. What am I doing wrong?  Is there a different version of
 Sage specifically for 10.4?

 --
 | Sage Version 3.4, Release Date: 2009-03-11 |
 | Type notebook() for the GUI, and license() for information.|
 --
 The SAGE install tree may have moved.
 Regenerating Python.pyo and .pyc files that hardcode the install PATH
 (please wait at
 most a few minutes)...
 Do not interrupt this.
 ---
 ImportError   Traceback (most recent call
 last)

SNIP

There's been some bug reports about .dmg for Mac OS X. But I very much
doubt it that you've done anything wrong. Anyway, you might want to
consider building your own .dmg from the Sage 3.4 source distribution.
Instructions on doing so can be found at

http://mvngu.wordpress.com/2009/03/22/clickable-mac-os-x-app-for-sage-34/

-- 
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] Re: OS X Clickable application

2009-03-21 Thread Minh Nguyen

Hi,

On Thu, Mar 19, 2009 at 1:46 PM, Byungchul Cha cha3...@gmail.com wrote:


 I must misunderstand something very trivial. I followed the steps
 described at the release tour of Sage 3.3, except that I replaced 3.3
 with 3.4, since I thought I was compiling sage-3.4. Compiling was
 successful and when I did ./sage -bdist 3.4, I saw that this generated
 a directory SAGE_ROOT/dist. But, in the directory I have a dmg file
 and one subdirectory sage-3.4-i386-Darwin, which just looks like
 another copy of SAGE_ROOT. I don't see any clickable Mac OS X app
 anywhere, including in the disk image from the dmg file.

 What am I missing?

 Oh, btw, I'm using OS X 10.5.6. Thanks in advance.

Sorry about this late reply, but I've updated the instructions for
building a clickable app. The new instructions can be found at

http://mvngu.wordpress.com/2009/03/22/clickable-mac-os-x-app-for-sage-34/

-- 
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] Re: Bad patch for unicode chars in TinyMCE?

2009-03-21 Thread Jason Grout

ma...@mendelu.cz wrote:
 Hello, this is related to the thread at
 http://groups.google.cz/group/sage-support/browse_thread/thread/2a699360a3847bab
 
 I think that installation of
 http://trac.sagemath.org/sage_trac/attachment/ticket/5564/trac_5564-2.patch
 causes that TinyMCE cannot be used to edit mathematical formulas
 
 If I enter $\int x dx$ in TinyMCE and exit the editor, I can see the
 picture representation for this formula formated by jsmath
 
 If I invoke TinyMCE again, i do not see TeX representation for the
 formula and hence, I cannot edit this formula. Can somebody confirm
 this bug, please? Thank you.



Yes, it appears that something is very broken for me too with those two 
patches.  I see the same problem as you.

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] Re: Bad patch for unicode chars in TinyMCE?

2009-03-21 Thread Jason Grout

ma...@mendelu.cz wrote:
 Hello, this is related to the thread at
 http://groups.google.cz/group/sage-support/browse_thread/thread/2a699360a3847bab
 
 I think that installation of
 http://trac.sagemath.org/sage_trac/attachment/ticket/5564/trac_5564-2.patch
 causes that TinyMCE cannot be used to edit mathematical formulas
 
 If I enter $\int x dx$ in TinyMCE and exit the editor, I can see the
 picture representation for this formula formated by jsmath
 
 If I invoke TinyMCE again, i do not see TeX representation for the
 formula and hence, I cannot edit this formula. Can somebody confirm
 this bug, please? Thank you.


As a hint to whoever wants to hunt this down if they get to it before 
me: the original text of the cell is stored in a parameter passed to 
tinymce when tinymce is initialized.  This is passed in the data 
attribute in the following code from cell.py (after the two patches are 
applied).

 if JEDITABLE_TINYMCE and 
hasattr(self.worksheet(),'is_published') and no
t self.worksheet().is_published():
 s += 
script$(#cell_text_%s).unbind('dblclick').editable(funct
ion(value,settings) {
evaluate_text_cell_input(%s,value,settings);
return(value);
}, {
   tooltip   : ,
   placeholder : ,
//  type   : 'textarea',
   type   : 'mce',
   onblur : 'ignore',
   select : false,
   submit : 'Save changes',
   cancel : 'Cancel changes',
   event  : dblclick,
   style  : inherit,
   data   : %r
   });
/script%(self.__id,self.__id,self.__text)


My guess is that something is wrong with this data parameter being 
passed to the tinymce instance.  If the data parameter is not passed, 
then TinyMCE will use instead the html that is actually in the notebook, 
which would be the formatted jsmath version, which is what the symptoms 
indicate.

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] Re: python's list comprehension

2009-03-21 Thread Craig Citro

 Note that you're skipping the last conductor in the database, I
 think... DB.conductor_range? indicates that the returned values
 represent an inclusive range, but range/xrange/etc. take their second
 argument as an exclusive bound.  (This is easy to fix with the above
 xrange expression, but I don't see how to fix it with the simple *args
 syntax.)


Touche. I can find *a* way to fix it, but only at the cost of making
it significantly uglier and more fragile than the original use of an
anonymous lambda:

sage: t = (1,10)
sage: srange(*(list(t) + [1,ZZ,False,True]))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Clearly that's not the way to go in general ... I think the lambda is
much nicer in this case. (To be fair, Scheme is still the language
closest to my heart, so I may be biased.)

-cc

--~--~-~--~~~---~--~~
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] 3-D plots of affine varieties

2009-03-21 Thread Minh Nguyen

Hi folk,

I may be missing something here, but when I tried to plot 0 = x^2 +
y^2 - z^2 I received an error:

*** begin Sage session ***

sage: var(x,y,z);
sage: f = x^2 + y^2 - z^2
sage: plot3d(f == 0, (x,-4,4), (y,-4,4), (z,-4,4));
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (4, 0))

---
TypeError Traceback (most recent call last)

/home/mvngu/.sage/temp/sage.math.washington.edu/32198/_home_mvngu__sage_init_sage_0.py
in module()

/usr/local/sage/local/lib/python2.5/site-packages/sage/plot/plot3d/plot3d.pyc
in plot3d(f, urange, vrange, adaptive, **kwds)
191
192 if adaptive:
-- 193 P = plot3d_adaptive(f, urange, vrange, **kwds)
194 else:
195 P = parametric_plot3d.parametric_plot3d(w, urange,
vrange, **kwds)

/usr/local/sage/local/lib/python2.5/site-packages/sage/plot/plot3d/plot3d.pyc
in plot3d_adaptive(f, x_range, y_range, color, grad_f, max_bend,
max_depth, initial_depth, num_colors, **kwds)
284 plot = TrianglePlot(factory, g, (xmin, xmax), (ymin,
ymax), g = grad_f,
285 min_depth=initial_depth, max_depth=max_depth,
-- 286 max_bend=max_bend, num_colors = None)
287
288 P = IndexFaceSet(plot._objects)

/usr/local/sage/local/lib/python2.5/site-packages/sage/plot/tri_plot.pyc
in __init__(self, triangle_factory, f, (min_x, max_x), (min_y, max_y),
g, min_depth, max_depth, num_colors, max_bend)
133 mid_x = (min_x + max_x)/2
134 mid_y = (min_y + max_y)/2
-- 135 sw_z = fcn(min_x,min_y)
136 nw_z = fcn(min_x,max_y)
137 se_z = fcn(max_x,min_y)

/usr/local/sage/local/lib/python2.5/site-packages/sage/plot/tri_plot.pyc
in fcn(x, y)
122 if g is None:
123 def fcn(x,y):
-- 124 return [self._f(x,y)]
125 else:
126 def fcn(x,y):

/usr/local/sage/local/lib/python2.5/site-packages/sage/plot/plot3d/plot3d.pyc
in g(xx, yy)
247 y, ymin, ymax = y_range
248 def g(xx,yy):
-- 249 return float(f.subs({x:xx, y:yy}))
250
251 else:

TypeError: float() argument must be a string or a number

*** end Sage session ***


What I'm trying to do is generate various 3-D plots of some affine
varieties. As a start, I have no idea how to plot the equation:

x^2 + y^2 - z^2 = 0

But for the equation

z^3 - zx^2 + y^2 = 0

I know that it describes three cones meeting at a common point.

-- 
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] Re: 3-D plots of affine varieties

2009-03-21 Thread Mike Hansen

Hello,

On Mar 21, 10:13 pm, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi folk,

 I may be missing something here, but when I tried to plot 0 = x^2 +
 y^2 - z^2 I received an error:

What you want is implicit 3d plotting which is not in Sage (yet).  See
http://trac.sagemath.org/sage_trac/ticket/5249 for preliminary work by
Carl Witty and Bill Cauchois.

--Mike
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---