[sage-support] Re: Longest Common Subsequence

2013-07-25 Thread Nathann Cohen
Now waiting for a review !

http://trac.sagemath.org/ticket/14969

Nathann


On 17 July 2013 12:29, Nathann Cohen nathann.co...@gmail.com wrote:

 Helloo everybody !!!

 Is there a way to compute the longest common subsequence of two
 (binary) words in Sage ? I can't find how, but it looks like something
 Sage should be able to do :-)

 Thaanks !

 Nathann


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Integration of formal functions

2013-07-25 Thread Victor Miller
In the latest version of sage (at least what cloud.sagemath.org is 
running), there is a problem with substituting constants into the formal 
integrals of formal functions.  See the examples below.

Victor

sage: var('a'); function('f',a)
sage: g = f(a).integrate(a,0,a^2)
sage: g
integrate(f(a),0,a^2)

sage: g.derivative(a)

Error in lines 1-1
Traceback (most recent call last):
  File /mnt/home/lQoU8m2s/.sagemathcloud/sage_server.py, line 498, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
  File , line 1, in module
  File expression.pyx, line 3006, in 
sage.symbolic.expression.Expression.derivative 
(sage/symbolic/expression.cpp:15855)
  File derivative.pyx, line 216, in sage.misc.derivative.multi_derivative 
(sage/misc/derivative.c:2715)
  File expression.pyx, line 3078, in 
sage.symbolic.expression.Expression._derivative 
(sage/symbolic/expression.cpp:16245)
  File 
/usr/local/sage/sage-5.10.rc1/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py,
 line 224, in _tderivative_
- f.subs(x==a)*a.diff(diff_param)
  File element.pyx, line 344, in sage.structure.element.Element.__getattr__ 
(sage/structure/element.c:3871)
  File misc.pyx, line 257, in sage.structure.misc.getattr_from_other_class 
(sage/structure/misc.c:1696)
AttributeError: 'sage.rings.integer.Integer' object has no attribute 'diff'

sage: g1 = f(a).integrate(a)
sage: g1(0)
Error in lines 1-1
Traceback (most recent call last):
  File /mnt/home/lQoU8m2s/.sagemathcloud/sage_server.py, line 498, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
  File , line 1, in module
  File expression.pyx, line 3973, in 
sage.symbolic.expression.Expression.__call__ 
(sage/symbolic/expression.cpp:19900)
  File ring.pyx, line 685, in sage.symbolic.ring.SymbolicRing._call_element_ 
(sage/symbolic/ring.cpp:7672)
  File expression.pyx, line 3824, in 
sage.symbolic.expression.Expression.substitute 
(sage/symbolic/expression.cpp:19177)
  File 
/usr/local/sage/sage-5.10.rc1/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py,
 line 75, in _eval_
if len(x.variables()) == 1:
  File element.pyx, line 344, in sage.structure.element.Element.__getattr__ 
(sage/structure/element.c:3871)
  File misc.pyx, line 257, in sage.structure.misc.getattr_from_other_class 
(sage/structure/misc.c:1696)
AttributeError: 'sage.rings.integer.Integer' object has no attribute 'variables'


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] legends for 3d graphics

2013-07-25 Thread davidp
I am using Sage to plot an arrangement of planes in 3-space.  Each plane 
has its own color, and I would like a legend in the plot that associates 
the equation of each plane with its color.  This experiment seems to 
indicate that legends are not available for 3d graphics:

---
sage: p = plot3d(x^2,(x,-1,1),(y,-1,1),legend_label='0')
sage: q = plot3d(x^2+y^2,(x,-1,1),(y,-1,1),legend_label='1')
sage: c = p+q
sage: c.legend(true)
---
AttributeErrorTraceback (most recent call last)
ipython-input-28-744abb0d6c3b in module()
 1 c.legend(true)

AttributeError: 'Graphics3dGroup' object has no attribute 'legend'
---

As I rotate the 3d-object, I would like for the legend would stay in one 
place.

Any suggestions?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] legends for 3d graphics

2013-07-25 Thread William Stein
On Thu, Jul 25, 2013 at 9:16 AM, davidp davide...@gmail.com wrote:
 I am using Sage to plot an arrangement of planes in 3-space.  Each plane has
 its own color, and I would like a legend in the plot that associates the
 equation of each plane with its color.  This experiment seems to indicate
 that legends are not available for 3d graphics:

 ---
 sage: p = plot3d(x^2,(x,-1,1),(y,-1,1),legend_label='0')
 sage: q = plot3d(x^2+y^2,(x,-1,1),(y,-1,1),legend_label='1')
 sage: c = p+q
 sage: c.legend(true)
 ---
 AttributeErrorTraceback (most recent call last)
 ipython-input-28-744abb0d6c3b in module()
  1 c.legend(true)

 AttributeError: 'Graphics3dGroup' object has no attribute 'legend'
 ---

 As I rotate the 3d-object, I would like for the legend would stay in one
 place.

 Any suggestions?

This won't help you today, but an REU student -- Renford Alexander --
is working fulltime right now on Three.js-based 3d graphics rendering
for https://cloud.sagemath.com.  He showed me some demos yesterday of
drawing text in 3d, the looked pretty useful.  In particular, he draws
arbitrary text on a 2d html5 canvas, then puts the canvas element in
the 3d scenes as a sprite.This functionality should come to
https://cloud.sagemath.com within a month, hopefully.

 -- William


 Thanks.

 --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.





-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Integration of formal functions

2013-07-25 Thread William Stein
On Thu, Jul 25, 2013 at 9:16 AM, Victor Miller victorsmil...@gmail.com wrote:
 In the latest version of sage (at least what cloud.sagemath.org is running),

... which is sage-5.10, the latest released version.  However, the
same happens with 'Sage Version 5.11.beta2, Release Date: 2013-06-19'.

 there is a problem with substituting constants into the formal integrals of
 formal functions.  See the examples below.

 Victor

 sage: var('a'); function('f',a)
 sage: g = f(a).integrate(a,0,a^2)
 sage: g
 integrate(f(a),0,a^2)

 sage: g.derivative(a)

 Error in lines 1-1
 Traceback (most recent call last):
   File /mnt/home/lQoU8m2s/.sagemathcloud/sage_server.py, line 498, in
 execute
 exec compile(block+'\n', '', 'single') in namespace, locals
   File , line 1, in module
   File expression.pyx, line 3006, in
 sage.symbolic.expression.Expression.derivative
 (sage/symbolic/expression.cpp:15855)
   File derivative.pyx, line 216, in sage.misc.derivative.multi_derivative
 (sage/misc/derivative.c:2715)
   File expression.pyx, line 3078, in
 sage.symbolic.expression.Expression._derivative
 (sage/symbolic/expression.cpp:16245)
   File
 /usr/local/sage/sage-5.10.rc1/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py,
 line 224, in _tderivative_
 - f.subs(x==a)*a.diff(diff_param)
   File element.pyx, line 344, in
 sage.structure.element.Element.__getattr__ (sage/structure/element.c:3871)
   File misc.pyx, line 257, in sage.structure.misc.getattr_from_other_class
 (sage/structure/misc.c:1696)
 AttributeError: 'sage.rings.integer.Integer' object has no attribute 'diff'

 sage: g1 = f(a).integrate(a)
 sage: g1(0)
 Error in lines 1-1
 Traceback (most recent call last):
   File /mnt/home/lQoU8m2s/.sagemathcloud/sage_server.py, line 498, in
 execute
 exec compile(block+'\n', '', 'single') in namespace, locals
   File , line 1, in module
   File expression.pyx, line 3973, in
 sage.symbolic.expression.Expression.__call__
 (sage/symbolic/expression.cpp:19900)
   File ring.pyx, line 685, in
 sage.symbolic.ring.SymbolicRing._call_element_ (sage/symbolic/ring.cpp:7672)
   File expression.pyx, line 3824, in
 sage.symbolic.expression.Expression.substitute
 (sage/symbolic/expression.cpp:19177)
   File
 /usr/local/sage/sage-5.10.rc1/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py,
 line 75, in _eval_
 if len(x.variables()) == 1:
   File element.pyx, line 344, in
 sage.structure.element.Element.__getattr__ (sage/structure/element.c:3871)
   File misc.pyx, line 257, in sage.structure.misc.getattr_from_other_class
 (sage/structure/misc.c:1696)
 AttributeError: 'sage.rings.integer.Integer' object has no attribute
 'variables'


 --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.





-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] legends for 3d graphics

2013-07-25 Thread davidp
Cool!

On Thursday, July 25, 2013 10:58:56 AM UTC-7, William wrote:

 On Thu, Jul 25, 2013 at 9:16 AM, davidp davi...@gmail.com javascript: 
 wrote: 
  I am using Sage to plot an arrangement of planes in 3-space.  Each plane 
 has 
  its own color, and I would like a legend in the plot that associates the 
  equation of each plane with its color.  This experiment seems to 
 indicate 
  that legends are not available for 3d graphics: 
  
  
 --- 
  sage: p = plot3d(x^2,(x,-1,1),(y,-1,1),legend_label='0') 
  sage: q = plot3d(x^2+y^2,(x,-1,1),(y,-1,1),legend_label='1') 
  sage: c = p+q 
  sage: c.legend(true) 
  
 --- 
  AttributeErrorTraceback (most recent call 
 last) 
  ipython-input-28-744abb0d6c3b in module() 
   1 c.legend(true) 
  
  AttributeError: 'Graphics3dGroup' object has no attribute 'legend' 
  
 --- 
  
  As I rotate the 3d-object, I would like for the legend would stay in one 
  place. 
  
  Any suggestions? 

 This won't help you today, but an REU student -- Renford Alexander -- 
 is working fulltime right now on Three.js-based 3d graphics rendering 
 for https://cloud.sagemath.com.  He showed me some demos yesterday of 
 drawing text in 3d, the looked pretty useful.  In particular, he draws 
 arbitrary text on a 2d html5 canvas, then puts the canvas element in 
 the 3d scenes as a sprite.This functionality should come to 
 https://cloud.sagemath.com within a month, hopefully. 

  -- William 

  
  Thanks. 
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  sage-support group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to sage-support...@googlegroups.com javascript:. 
  To post to this group, send email to 
  sage-s...@googlegroups.comjavascript:. 

  Visit this group at http://groups.google.com/group/sage-support. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  



 -- 
 William Stein 
 Professor of Mathematics 
 University of Washington 
 http://wstein.org 


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] 3d graphics display problem

2013-07-25 Thread davidp
In the following, I expect p+s to be a picture of a plane with the word 
'hello' embedded at its center.  Instead, I get the word 'hello' in the 
corner of the frame (where the number -1) might be expected.  Further, it 
prints a number 2 way outside of the frame, and the axes labels are all in 
the wrong order.  It is as if there is an off-by-one error in some labeling 
code somewhere.  When I print p+s+t, I get 'hello' embedded in the center 
as expected, and 'goodbye' is shifted to the corner of the frame now.

---
sage: var('x y')
(x, y)
sage: p = plot3d(1,(x,-1,1),(y,-1,1))
sage: s = text3d('hello',(0,0,1))  # hello appears in the wrong place
sage: p + s

sage: t = text3d('goodbye',(0,0,1))  # same coordinates as s
sage: p + s + t   # hello now appears in the right place, but goodbye does 
not


I am running sage-5.10 under Ubuntu 13.04 on a laptop.  The *same* setup on 
my desktop does not produce this error.  I tried re-installing sage, 
removing my old .sage, .jmol, and .java directories.  Same problem. 
 Further, when I try the same code after logging in as guest on my laptop, 
the code runs with no problem.  Any suggestions would be appreciated.

Thanks.



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.