[sage-support] Re: Converting a Singular list to a Sage list

2011-06-06 Thread Simon King
Hi Francisco,

On 5 Jun., 08:26, Simon King simon.k...@uni-jena.de wrote:
 Anyway, IMHO it *should* work to do
 sage: P*[p.sage_poly(P) for p in I]  # not implemented

My fault: Singular has an optional parameter, determining whether a
short or a long polynomial representation is used. So, I should have
done:

sage: singular.eval('ring R')
'ring R;'
sage: singular.eval('short=0') # That's what I forgot to do
'short=0;'
sage: RS = singular('basering')
sage: br = GF(*repr(RS.charstr()).split(','))
sage: br
Finite Field of size 32003
sage: vars = [repr(singular.var(i)) for i in range(1,RS.nvars()+1)]
sage: vars
['x', 'y', 'z']
sage: P = br[tuple(vars)]
sage: I = singular.ideal(['x^2','y*z','z+x'])
sage: I  # now it is a long representation: x^2, not x2
x^2,
y*z,
x+z
sage: P*[p.sage_poly(P) for p in I]
Ideal (x^2, y*z, x + z) of Multivariate Polynomial Ring in x, y, z
over Finite Field of size 32003

I think the procedure above should be automated (but the term order
should be taken care of as well, I suppose). I'll open a ticket.

Cheers,
Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Confusion and question about secure switch to Sage notebook.

2011-06-06 Thread Nils Bruin
On Jun 4, 10:37 pm, Chris Seberino cseber...@gmail.com wrote:
 Notebook documentation mentions a boolean switch called secure for
 SSL.

 When I try to turn it on my notebook server, I get an error about a
 domain Sage needs.

 How exactly does this switch work and how does Sage want to do SSL?

If you turn it on for the first time, sage make its own SSL
certificate. The domain name on which the notebook is served (the
domain name that the client browser needs to connect to!) is part of
that certificate, so that is why Sage asks for the domain.

You then just connect to https://...

If you already have a certificate that you want Sage to use, hopefully
the manual will tell you how to point Sage to the pre-existing cert.

 In my limited experience, when I want SSL protection, I set up an
 Apache proxy (mod_proxy) in front of my app running on localhost.
 Obviously, if Sage's SSL worked that way then Sage would need more
 info that just toggling a boolean called secure so it must be doing
 things differently.

That is probably possible too, but then you should let Apache take
care of the SSL and run the notebook with secure=false behind it.
The proxying for connections that are already SSL end-to-end must be
very limited, since at that point your Apache proxy is basically a man-
in-the-middle.

-- 
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: Converting a Singular list to a Sage list

2011-06-06 Thread Simon King
Hi Francisco and all other potential reviewers,

On 6 Jun., 08:10, Simon King simon.k...@uni-jena.de wrote:
 I think the procedure above should be automated (but the term order
 should be taken care of as well, I suppose). I'll open a ticket.

It is #11431, and it seems ready for review. One can convert quite
complicated things with the patch. For example:

sage: singular.eval('ring r10 = (9,a), (x,y,z),lp')
'ring r10 = (9,a), (x,y,z),lp;'
sage: Q = singular('std(ideal(x^2,x+y^2+z^3))',
type='qring')
sage: Q.sage()
Quotient of Multivariate Polynomial Ring in x, y, z over
Finite Field in a of size 3^2 by the ideal (y^4 - y^2*z^3 + z^6, x +
y^2 + z^3)
sage: singular('x^2+y').sage()
x^2 + y
sage: singular('x^2+y').sage().parent()
Quotient of Multivariate Polynomial Ring in x, y, z over
Finite Field in a of size 3^2 by the ideal (y^4 - y^2*z^3 + z^6, x +
y^2 + z^3)

Cheers,
Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Binding Python to HTML/CSS/Javascript

2011-06-06 Thread Owen
I have a friend who'd like to do as Sage has done: create a Python
based service available through web pages.

Is there any documentation as to how Sage builds web interfaces driven
by a Python backend?

FYI The work to be ported is: http://matterandinteractions.org/

Thanks!

   -- Owen

-- 
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: Binding Python to HTML/CSS/Javascript

2011-06-06 Thread Jason Grout

On 6/6/11 10:20 AM, Owen wrote:

I have a friend who'd like to do as Sage has done: create a Python
based service available through web pages.

Is there any documentation as to how Sage builds web interfaces driven
by a Python backend?




You can look at the sagenb source code and documentation:

http://code.google.com/p/sagenb/

You can also look at a simpler project, a python-backed single cell 
server.  This is a work-in-progress, and is in its very early stages:


https://github.com/jasongrout/simple-python-db-compute

Also, there is an html notebook frontend in the in-progress ipython 
0.11.  Check the ipython github for the work so far.


Codepad also has a python backing:

http://codepad.org/

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


Re: [sage-support] Re: Trouble with sage installation on Ubuntu 11.04

2011-06-06 Thread Bill
I noticed this thread on crypt after compiling sage 4.7 on Mint 11.04 and 
failing due to this error.  I tried compiling the same  sage4.7.tar file on 
Ubuntu 11.04 and was successful.

I was wondering.  Since Mint is built on top of Ubuntu 11.04, is the fix in 
sage 4.7  hard coded to recognize Ubuntu 11.04?  Could the same fix be 
expanded so that compiling would succeed on Mint as well?

Bill Odefey

-- 
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: segmentation fault with SVD

2011-06-06 Thread kcrisman

 sage: m = random_matrix(RDF, 1000)
 sage: sage: %time U,s,Vh = m.SVD()

 Program received signal SIGSEGV, Segmentation fault.
 0x7fffec39318d in ATL_dJIK40x40x40TN40x40x0_a1_b1 () from /home/
 mate/sage/local/lib/libatlas.so

 I run Ubuntu
 mate@ubuntu:~$ uname -a
 Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC
 2011 x86_64 x86_64 x86_64 GNU/Linux
 mate@ubuntu:~/sage$ ./sage -version
 | Sage Version 4.7, Release Date: 2011-05-23

Hmm, I don't get this on several systems I just tried, including Mac
Intel, Mac PPC, and a notebook server I have access to running

sage: os.uname()
'Linux', 'ws6', '2.6.32-28-generic-pae', '#55-Ubuntu SMP Mon Jan 10
22:34:08 UTC 2011', 'i686'

Can someone see if they can replicate this error?

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


Re: [sage-support] Re: Trouble with sage installation on Ubuntu 11.04

2011-06-06 Thread Jan Groenewald
Hi Bill,

On Mon, Jun 06, 2011 at 09:18:41AM -0700, Bill wrote:
I noticed this thread on crypt after compiling sage 4.7 on Mint 11.04 and
failing due to this error.  I tried compiling the same  sage4.7.tar file
on Ubuntu 11.04 and was successful.
 
I was wondering.  Since Mint is built on top of Ubuntu 11.04, is the fix
in sage 4.7  hard coded to recognize Ubuntu 11.04?  Could the same fix be
expanded so that compiling would succeed on Mint as well?

Please type this in a terminal:

cat /etc/issue  mint-issue.txt

And post the file mint-issue.txt back as an attachment.
(To get the tabs and spaces just right a text attachment
is better.)

Regards,
Jan



-- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 

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


Re: [sage-support] Re: Trouble with sage installation on Ubuntu 11.04

2011-06-06 Thread William Odefey
I typed it and nothing hapeened.  I guess I do not understand what I am to
expect.

On Mon, Jun 6, 2011 at 12:00 PM, Jan Groenewald j...@aims.ac.za wrote:

 Hi Bill,

 On Mon, Jun 06, 2011 at 09:18:41AM -0700, Bill wrote:
 I noticed this thread on crypt after compiling sage 4.7 on Mint 11.04
 and
 failing due to this error.  I tried compiling the same  sage4.7.tar
 file
 on Ubuntu 11.04 and was successful.
 
 I was wondering.  Since Mint is built on top of Ubuntu 11.04, is the
 fix
 in sage 4.7  hard coded to recognize Ubuntu 11.04?  Could the same fix
 be
 expanded so that compiling would succeed on Mint as well?

 Please type this in a terminal:

 cat /etc/issue  mint-issue.txt

 And post the file mint-issue.txt back as an attachment.
 (To get the tabs and spaces just right a text attachment
 is better.)

 Regards,
 Jan



 --
   .~.
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^

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


-- 
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] Strange error using R pexpect interface?

2011-06-06 Thread kcrisman
I'm using R matrices to use an R program and then do things with it in
Sage.  For some reason Sage doesn't get the right answer for
matrices above a certain size.

The first one is right (it gives the space that is in the returned
string) while the second one makes no sense; ZZ='' is what actually
comes back.  But there is no real reason for this - what's special
about the length? - and doing these in Sage's r_console() gives normal
results for the matrix.

So I feel like pexpect must be doing something naughty.  Does anyone
have any ideas what might be going on so I can use more data?

Thanks,
- kcrisman


sage: ZZ = r.eval('matrix(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2,
2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 4, 4, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2, 3, 3, 3,
3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 1, 1, 1, 1,
3, 3, 3, 3, 2, 2, 2, 2, 4, 4, 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 1, 1, 1,
1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 3, 3, 3, 3, 1,
1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 2, 2, 2, 2,
3, 3, 3, 3, 2, 2, 2, 2, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 4, 4, 4, 4,
1),ncol=4)'); ZZ[1]
' '
sage: ZZ = r.eval('matrix(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2,
2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 4, 4, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2, 3, 3, 3,
3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 1, 1, 1, 1,
3, 3, 3, 3, 2, 2, 2, 2, 4, 4, 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 1, 1, 1,
1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 3, 3, 3, 3, 1,
1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 2, 2, 2, 2,
3, 3, 3, 3, 2, 2, 2, 2, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 4, 4, 4, 4, 1,
1, 1, 1, 3),ncol=4)'); ZZ[1]

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


Re: [sage-support] Re: Trouble with sage installation on Ubuntu 11.04

2011-06-06 Thread Jan Groenewald
HI

On Mon, Jun 06, 2011 at 12:22:57PM -0500, William Odefey wrote:
I typed it and nothing hapeened.  I guess I do not understand what I am to
expect.

You won't see anything, but you will create the file mint-issue.txt in your 
home folder. Please post that.

Regards,
Jan

-- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 

-- 
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: Strange error using R pexpect interface?

2011-06-06 Thread John H Palmieri


On Monday, June 6, 2011 10:54:57 AM UTC-7, kcrisman wrote:

 I'm using R matrices to use an R program and then do things with it in 
 Sage.  For some reason Sage doesn't get the right answer for 
 matrices above a certain size. 

 The first one is right (it gives the space that is in the returned 
 string) while the second one makes no sense; ZZ='' is what actually 
 comes back.  But there is no real reason for this - what's special 
 about the length? - and doing these in Sage's r_console() gives normal 
 results for the matrix. 

 So I feel like pexpect must be doing something naughty.  Does anyone 
 have any ideas what might be going on so I can use more data? 


I tried this experiment: I added spaces to the first string to be 
evaluated.  When the string has length = 1024, it seems to work, and when 
the string has length  1024, it doesn't.  For example:

sage: s = 'matrix(c(1, 1, 1, 1,' + ' '*987 + '2,2,2,2), ncol=4)'
sage: len(s)
1024
sage: r.eval(s)
' [,1] [,2] [,3] [,4]\n[1,]1122\n[2,]11
22'
sage: s = 'matrix(c(1, 1, 1, 1,' + ' '*988 + '2,2,2,2), ncol=4)'
sage: len(s)
1025
sage: r.eval(s)
''

I don't know why, but maybe that can help you track it down.

-- 
John


-- 
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: Strange error using R pexpect interface?

2011-06-06 Thread kcrisman


  So I feel like pexpect must be doing something naughty.  Does anyone
  have any ideas what might be going on so I can use more data?

 I tried this experiment: I added spaces to the first string to be
 evaluated.  When the string has length = 1024, it seems to work, and when
 the string has length  1024, it doesn't.  For example:

     sage: s = 'matrix(c(1, 1, 1, 1,' + ' '*987 + '2,2,2,2), ncol=4)'
     sage: len(s)
     1024
     sage: r.eval(s)
     '     [,1] [,2] [,3] [,4]\n[1,]    1    1    2    2\n[2,]    1    1    
 2    2'
     sage: s = 'matrix(c(1, 1, 1, 1,' + ' '*988 + '2,2,2,2), ncol=4)'
     sage: len(s)
     1025
     sage: r.eval(s)
     ''

 I don't know why, but maybe that can help you track it down.

Thanks - that definitely helps, since pexpect is actually passing
strings.

At http://pexpect.sourceforge.net/pexpect.html I see
The maxread attribute sets the read buffer size. This is maximum
number
of bytes that Pexpect will try to read from a TTY at one time. Setting
the maxread size to 1 will turn off buffering. Setting the maxread
value higher may help performance in cases where large amounts of
output are read back from the child. 

Can a pexpect expert help me here?  It seems like we have

maxread=10

for R (and most other interfaces), which would seem to be plenty of
bytes for a 1000-character string, if that is what maxread controls.

Doing it in R by hand allows me arbitrarily long things (well, 'by
hand' arbitrary) so that is definitely not the bottleneck.  And I
don't see this problem in Maxima (I am using an older version of Sage
without the library interface for Maxima/ECL, so this is a relevant
data point).

Thanks to anyone!

- kcrisman

-- 
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: Strange error using R pexpect interface?

2011-06-06 Thread John H Palmieri
On Monday, June 6, 2011 12:55:49 PM UTC-7, kcrisman wrote:


  
   So I feel like pexpect must be doing something naughty.  Does anyone 
   have any ideas what might be going on so I can use more data? 
  
  I tried this experiment: I added spaces to the first string to be 
  evaluated.  When the string has length = 1024, it seems to work, and 
 when 
  the string has length  1024, it doesn't.  For example: 
  
  sage: s = 'matrix(c(1, 1, 1, 1,' + ' '*987 + '2,2,2,2), ncol=4)' 
  sage: len(s) 
  1024 
  sage: r.eval(s) 
  ' [,1] [,2] [,3] [,4]\n[1,]1122\n[2,]11   
   
  22' 
  sage: s = 'matrix(c(1, 1, 1, 1,' + ' '*988 + '2,2,2,2), ncol=4)' 
  sage: len(s) 
  1025 
  sage: r.eval(s) 
  '' 
  
  I don't know why, but maybe that can help you track it down. 

 Thanks - that definitely helps, since pexpect is actually passing 
 strings. 


Well, searching for 1024 in r.py results in two hits, and I think the 
relevant one is

  # If an input is longer than this number of characters, 
then
  # try to switch to outputting to a file. 
  eval_using_file_cutoff=1024)

If you input a string longer than 1024 characters, it writes it to a file 
and then tries to read that file.  It looks to me as though the method 
_read_in_file_command in r.py isn't doing the right thing: the correct 
string is getting written to the correct file, but then it's not getting 
imported properly.  That is, in expect.py,  it's executing this code:

try:
s = self._eval_line(self._read_in_file_command(tmp_to_use), 
allow_use_file=False)

and it's returning an empty string, even though tmp_to_use is set to the 
correct file name and that file has the correct contents.  I don't know R 
syntax, so I don't know what's going wrong.

-- 
John

-- 
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: Incorrect degree on polynomial after ring change

2011-06-06 Thread Jeff Stroomer
Simon,

You're right, and you pointed the way to an easy solution.  Thanks for
the help.

Jeff


On Jun 5, 11:46 pm, Simon King simon.k...@uni-jena.de wrote:
 Hi Jeff,

 On 6 Jun., 04:33, Jeff Stroomer jstroom...@hotmail.com wrote:

      M = Matrix([
        [ 1,  0,  0,  0],
        [ 0,  1,  1,  1],
        [ 0,  0,  1,  0],
        [ 0,  0,  0,  1],
      ])
      Rt = PolynomialRing(GF(101), order = TermOrder(M), names = 'e, t,
  x, y')
      print Rt(g).degree()

  The first print reports that the degree of g is 7, which is correct,
  but the second reports the degree is 0.

 Both answers are correct. In a matrix order, the first row (resp. the
 first column, AFAIK both conventions appear in the literature) of the
 matrix provides the degrees of the generators. Here, we have

 sage: Rt.e,t,x,y = PolynomialRing(GF(101), order = TermOrder(M))
 sage: e.degree()
 1
 sage: t.degree()
 0
 sage: x.degree()
 0
 sage: y.degree()
 0

 Hence, IN THAT RING, x^5-x*y^6 is indeed of degree zero. In the other
 ring, it is of degree 7.

 Cheers,
 Simon

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Strange error using R pexpect interface?

2011-06-06 Thread kcrisman

   I don't know why, but maybe that can help you track it down.

  Thanks - that definitely helps, since pexpect is actually passing
  strings.

 Well, searching for 1024 in r.py results in two hits, and I think the

I don't know why that didn't occur to me.

 relevant one is

The other one seems to be a dud left over from interfaces/gp.py,
incidentally.


                   # If an input is longer than this number of characters,
 then
                   # try to switch to outputting to a file.
                   eval_using_file_cutoff=1024)

 If you input a string longer than 1024 characters, it writes it to a file
 and then tries to read that file.  It looks to me as though the method
 _read_in_file_command in r.py isn't doing the right thing: the correct
 string is getting written to the correct file, but then it's not getting
 imported properly.  That is, in expect.py,  it's executing this code:

         try:
             s = self._eval_line(self._read_in_file_command(tmp_to_use),
 allow_use_file=False)

 and it's returning an empty string, even though tmp_to_use is set to the
 correct file name and that file has the correct contents.  I don't know R
 syntax, so I don't know what's going wrong.

Yeah, I'm investigating this, and somehow we are using source and file
not quite correctly.  I've been trying a number of variations in the R
command line of Sage, and only can get something if I ask for verbose
output.


 source(file=file(/Users/.../.sage//temp/.../48141//interface//tmp48141,open=r),verbose=TRUE)
'envir' chosen:environment: R_GlobalEnv
-- parsed 1 expressions; now eval(.)ing them:

 eval(expression_nr. 1 )
 =

 c(1, 2, 3)
curr.fun: symbol c
[1] 1 2 3
 .. after ‘expression(c(1, 2, 3))’


Hopefully I can track it down relatively quickly.Thank you very
much for your help on this.

- kcrisman

-- 
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: Strange error using R pexpect interface?

2011-06-06 Thread kcrisman
This is now http://trac.sagemath.org/sage_trac/ticket/11436.

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