Trac #15227: cython debug information directory (patch)

There is no way to specify the location where cython writes its debug
information (`--gdb` option). This is required whenever cython is
executed from a different directory because of other hardwired paths
that cannot be overridden (yet).

URL: http://trac.sagemath.org/15227
Reported by: felixs
Ticket author(s): Felix Salfelder
Reviewer(s): Nathann Cohen
Trac #15447: implement evaluation of PARI closures

It would be nice to be able to call PARI closures from Sage.  Currently,
calling a PARI object assumes that it is a polynomial:
{{{
sage: T = pari('n->n+1')
sage: T.type()
't_CLOSURE'
sage: T(3)
Traceback (most recent call last):
...
PariError: incorrect type in poleval
}}}
With the patch, one gets the expected answer:
{{{
T(3)
4
}}}

URL: http://trac.sagemath.org/15447
Reported by: pbruin
Ticket author(s): Peter Bruin, Jeroen Demeyer
Reviewer(s): Jeroen Demeyer, Peter Bruin
Trac #15161: Parent/Element relation for ChainComplex/Chain

Nothing in `sage.homology` makes use of the Parent/Element framework.
But it would be nice to be able to work with chains and use normal
syntax for addition and multiplication by scalars. The aim of this
ticket is to adapt chain complexes. The analogous project for cell
complexes will be left for a future ticket.

Next to code cleanup, I also added ascii art support:
{{{
sage: C = ChainComplex([matrix(QQ, 3, 1), matrix(ZZ, 4, 3)])
sage: C
Chain complex with at most 3 nonzero terms over Rational Field
sage: %display ascii_art
sage: C
            [0 0 0]
            [0 0 0]       [0]
            [0 0 0]       [0]
            [0 0 0]       [0]
 0 <-- C_2 <-------- C_1 <---- C_0 <-- 0
sage: C.an_element()
   d_2  [  9]  d_1  [-1/2]  d_0        d_-1
0 <---- [ -1] <---- [   1] <---- [-1] <----- 0
        [1/5]       [   1]
        [2/7]
}}}

URL: http://trac.sagemath.org/15161
Reported by: vbraun
Ticket author(s): Volker Braun
Reviewer(s): John Palmieri, Travis Scrimshaw
Trac #14358: Notebook server should run Java for JMol inside temporary directory

When a Sage notebook server needs to create a static 3D image, it runs
JMol server-side to create this image (if Java is available). However,
it does this inside a directory to which the worker process might not
have access to.

'''Apply''' [attachment:14358_java.patch]

----

'''Old report''' (before we diagnosed the problem):

We have been running the sage worksheets as an unprivileged user. The
setup is as follows.

1. A user, say user1, starts the sage server using
{{{
sage -n port=8888 accounts=True interface=''
server_pool=['sagenb@localhost'] openid=True automatic_login=False
port_tries=0 directory=/home/user1/a.sagenb
}}}
2. Because of the server_pool command, any worksheet is opened as an
unprivileged user called ''sagenb''. Here is some more info on how to
set up the environment.
 1. Create user sagenb by doing (as root)
{{{
$ groupadd sagenb
$ useradd -g sagenb -m sagenb
}}}
 2. Create a ssh key for user1
{{{
$ ssh-keygen -t rsa # run as user1 and make it passwordless
}}}
 3. Copy the id_rsa.pub to `~sagenb/.ssh/authorized_keys`.
{{{
$ cp -a ~user1/.ssh/id_rsa.pub /tmp/authorized_keys # Run as user1
$ mkdir ~sagenb/.ssh # Run as sagenb
$ cp /tmp/authorized_keys .ssh # Run as sagenb
}}}
3. With default sage-5.2 there is no problem with this and everything
works.
4. With sage-5.2 + "#13121 without new jmol", jmol works but one needs
to close the worksheet and then reopen the worksheet and then the jmol
pops up.
5. With sage-5.2 + #13121, jmol works partially:
 1. First, the static image can not be created and there is a permission
denied error. See [attachment:permission_error.jpg].
 2. However, once the 3D output is toggled, jmol loads fine. The
permission denied error is still there.
 3. The error obtained is of the form
{{{
script ERROR: script ERROR: io error reading
/home/user1/a.sagenb/home/__store__/0/09/098/098f/te\
st/0/cells/7/sage0-size500-499889951.jmol.zip|SCRIPT:
java.io.FileNotFoundException:
/home/user1/a.sagenb/home/__store__/0/09/098/098f/te\
st/0/cells/7/sage0-size500-499889951.jmol.zip (Permission denied)
Sleeping...Make Interactive
}}}
6. When run locally, i.e., without server_pool, the jmol loads and runs
fine. For instance, this is fine:
{{{
sage -n directory=a.sagenb
}}}

This problem has made it difficult for me to upgrade a server from 5.2
and I think the error is introduced by some change in jmol. The error
itself stems from some java component. A diff of the changes between the
directory `$SAGE_ROOT/devel/sagenb/sagenb/data/sage3d` for sage-5.2 and
sage-5.7.rc0 has not yielded any difference. So, I believe the
difference is really in the jmol spkg introduced in #12299.

I have traced it back and reproduced it in sage-5.2 + new notebook + new
jmol. Although I wrote sage-5.2 above, the error is present in all the
sage versions I have tried - sage-5.4 till sage-5.9.beta0.

URL: http://trac.sagemath.org/14358
Reported by: ppurka
Ticket author(s): Jeroen Demeyer
Reviewer(s): Punarbasu Purkayastha