Re: [sage-devel] Use system R with sage?

2017-10-20 Thread François Bissey


> On 21/10/2017, at 10:37, Michael Orlitzky  wrote:
> 
> On 10/20/2017 11:30 AM, Nils Bruin wrote:
>> Do we actually get real benefit from packaging R with sage? It seems to
>> me R is a very popular, very mature piece of software. Isn't it easy to
>> install R on any of the platforms supported by sage? If that is the
>> case, wouldn't it be much easier to let sage just work with the
>> system-wide R if that is available?
> 
> 
> No, yes, yes.


Of course we had those conversations before. sage interfaces with R in two
ways:
* directly with the R command line through the pexpect interface
* through rpy 

The first way can happily use system wide R.
The second is more complicated. We have to build sage’s rpy and rpy
links directly to libR and that’s where the potential madness comes in,
libR links to blas/lapack. So there is a potential clash between
system blas/lapack and sage blas/lapack in rpy.
This may (or not) be dealt with by being careful in building rpy in sage.

François

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


Re: [sage-devel] Use system R with sage?

2017-10-20 Thread Michael Orlitzky
On 10/20/2017 11:30 AM, Nils Bruin wrote:
> Do we actually get real benefit from packaging R with sage? It seems to
> me R is a very popular, very mature piece of software. Isn't it easy to
> install R on any of the platforms supported by sage? If that is the
> case, wouldn't it be much easier to let sage just work with the
> system-wide R if that is available?


No, yes, yes.

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


Re: [sage-devel] Live documentation with Thebe reloaded

2017-10-20 Thread Nicolas M. Thiery
On Fri, Oct 20, 2017 at 05:09:06PM +0200, Jeroen Demeyer wrote:
> This seems suspicious:
> SyntaxError: missing : after property id thebelab@0.0.5:30745:13

Yup: we have been hacking on Thebelab, sage-package and friends for a
good chunk of the last two days, which caused some broken transient
states. It should work now, with a more stable api in the future.

Thanks for the report though!

The good news is that the Sage documentation could now be made to need
no more than 10 lines of configuration for Thebe to work, with no need
to ship anymore thebe.js or our former 150 lines of custom code. Thebe
itself is a mere 400 lines of code on top of jupyterlab.

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

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


Re: [sage-devel] Use system R with sage?

2017-10-20 Thread Jan Groenewald
On 20 October 2017 at 18:27, Dima Pasechnik  wrote:

> That is what I said a couple of times too.
>
> In particular, IMHO most R users use an IDE called R-studio, so for them
> the Sage's one is not very useful.
>
>
True, but I wouldn't rule out a growing market share for jupyter notebooks
for R just yet.

Regards,
Jan


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

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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Dima Pasechnik
In fact, John pointed out that I am wrong; while openssl is supported by 
Xcode binaries, there are no headers available!
(it used to be the case that they were present in some hidden directories, 
but this seems to be not true any more)

On Friday, October 20, 2017 at 7:20:17 PM UTC+1, kcrisman wrote:
>
>
>
> On Thursday, October 19, 2017 at 6:29:46 PM UTC-4, John H Palmieri wrote:
>>
>>
>>
>> On Thursday, October 19, 2017 at 2:17:10 PM UTC-7, Dima Pasechnik wrote:
>>>
>>> the 1-click openssl install image for OSX is called Xcode, and one can 
>>> go for a long lunch while waiting for it to finish, even on a fast 
>>> network...
>>
>>
> Oh, but that's not the same thing as "it's sitting on your screen". 
>  Asking people to install all of Xcode does seem a bit excessive, given 
> that we currently don't ask people to even install the developer tools 
> unless they want to do developing (or Cython, probably).
>  
>
>> Apple should pick up the bill for these lunches, and much more, I fully 
>>> agree.
>>>
>>
>>  
> True.
>  
>
>> But I don't think that Xcode includes the openssl headers. At least I've 
>> never been able to find them. Plus perhaps their installed versions of 
>> libssl are outdated? That's what I've heard about their reasons for not 
>> including the header files.
>>
>>
>  And just having headers isn't the same as "it just works" unless they go 
> in the right place, I suppose.
>

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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread kcrisman


On Thursday, October 19, 2017 at 6:29:46 PM UTC-4, John H Palmieri wrote:
>
>
>
> On Thursday, October 19, 2017 at 2:17:10 PM UTC-7, Dima Pasechnik wrote:
>>
>> the 1-click openssl install image for OSX is called Xcode, and one can go 
>> for a long lunch while waiting for it to finish, even on a fast network...
>
>
Oh, but that's not the same thing as "it's sitting on your screen".  Asking 
people to install all of Xcode does seem a bit excessive, given that we 
currently don't ask people to even install the developer tools unless they 
want to do developing (or Cython, probably).
 

> Apple should pick up the bill for these lunches, and much more, I fully 
>> agree.
>>
>
>  
True.
 

> But I don't think that Xcode includes the openssl headers. At least I've 
> never been able to find them. Plus perhaps their installed versions of 
> libssl are outdated? That's what I've heard about their reasons for not 
> including the header files.
>
>
 And just having headers isn't the same as "it just works" unless they go 
in the right place, I suppose.

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


Re: [sage-devel] Re: Sage 8.0 Build Error on MacOS, [mpir-3.0.0.p0] Error building MPIR.

2017-10-20 Thread Dima Pasechnik
The Sage way is to create a patch in build/pkgs/mpir/patches
which removes said file(s). 

You can also untar the tarball in upstream/, remove files, tar it up again, 
run
./sage --package fix-checksum

And then rebuild the package with 
./sage -f mpir

Please feel free to open a trac ticket on this.


On Friday, October 20, 2017 at 7:01:03 PM UTC+1, Andrew wrote:
>
> What is the recommended way to delete these three files? I have tried 
> deleting these files from 
> $SAGE_ROOT/local/var/tmp/sage/build/mpir-3.0.0.p0/src/mpn/x86_64w/skylake/avx 
> eitehr after a make, and then remaking, or during the build from the 
> makefile but I never get mpir to build. It would be nice to have a working 
> version of sage again...
>
> Andrew
>
> On Wednesday, 13 September 2017 22:28:29 UTC+2, Robert Jacobson wrote:
>>
>> I'm having the same issue. To get MPIR to compile I had to remove all 
>> three of
>>
>> mpn/x86_64/skylake/avx/addmul_1.asm
>> mpn/x86_64/skylake/avx/mul_basecase.asm
>> mpn/x86_64/skylake/avx/sqr_basecase.asm
>>
>>
>> Thanks for working on this, Bill.
>>
>> Best,
>>
>> Robert
>>
>>
>> On Wednesday, 6 September 2017 21:44:21 UTC-4, Bill Hart wrote:
>>>
>>> That's right. For now that is the only workaround. We know what the 
>>> problem is now, but don't have a working patch to fix it. It's the JMPENT 
>>> macro in mpn/x86_64/x86_64-defs.m4 that doesn't work on 64 bit OSX.
>>>
>>> Details of the issue can be found here, I believe [1].
>>>
>>> Bill.
>>>
>>> [1] https://gmplib.org/list-archives/gmp-bugs/2012-December/002836.html
>>>
>>> On Tuesday, 22 August 2017 19:37:50 UTC+2, Alex J Best wrote:

 As the problem is skylake I assume mpn/x86_64/skylake/avx/addmul_1.asm 
 is the one to patch out.

 On Monday, August 21, 2017 at 11:51:28 AM UTC-4, Dima Pasechnik wrote:
>
>
>
> On Monday, August 21, 2017 at 4:15:29 PM UTC+1, Michael Frey wrote:
>>
>> What is the best way to do this?  The file is extracted from the 
>> mpir-3.0.0.tar.bz2 every time make is run.
>>
>
> the standard way would be to add the patch removing  this file (which 
> one exactly, there are few files named so?)
> build/pkgs/mpir/patches/
>
>
>
>> On Wednesday, August 2, 2017 at 5:41:01 PM UTC-4, Bill Hart wrote:
>>>
>>> The only workaround I'm currently aware of is to remove the 
>>> offending addmul_1.asm file. It is to do with our use of jump tables.
>>>
>>>
>
>

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


[sage-devel] building a non-buggy python+numpy+scipy on FreeBSD?

2017-10-20 Thread Dima Pasechnik
On https://trac.sagemath.org/ticket/22679 I've reached the state where I 
have to trace down
a bug in Sage that triggers a Python segfault with the following lines of 
Python:

>>> import numpy as np
>>> points = np.array([[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2],[2, 
0], [2, 1], [2, 2]])
>>> from scipy.spatial import Voronoi
>>> Voronoi(points)

Voronoi() is used in the new Riemann surface code, that's how I came to 
this point.
It still works with Scipy 0.17.1, but not with (Sage's current) 0.19.1 or 
Scipy mater.

It is a bug in Sage, and not in Scipy or Numpy, as the system Python (also 
2.7.14) has no trouble with these lines!
That's what I'd call depressing...




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


Re: [sage-devel] Giac fails to build

2017-10-20 Thread Timo Kaufmann
I am essentially building like this:

```
autoreconf --install --force --verbose
./configure --disable-dependency-tracking --prefix=${out}
make -j4 -l4 SHELL="$(which bash)"
```

And yes, in the failing builds texlive was present (in an minimal 
configuration). Do you think texlives presence also triggered the hevea 
dependency?

My only changes to the giac build is the patch I posted before (changing 
hardcoded cp paths and adding the necessary argument to yylex).

sagemath is running now, but the directory it is installed to ("${out}") is 
not self contained. It still needs the "build" directory from the source. 
Is that normal? How is the final result supposed to look after sage is 
installed?

- /usr/local/ has the compilation result
- /usr/build/ has the build dir? That seems weird to me.
- /usr/ is $SAGE_ROOT

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


[sage-devel] Use system R with sage?

2017-10-20 Thread Dima Pasechnik
That is what I said a couple of times too. 

In particular, IMHO most R users use an IDE called R-studio, so for them the 
Sage's one is not very useful.

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


[sage-devel] Use system R with sage?

2017-10-20 Thread Nils Bruin
Do we actually get real benefit from packaging R with sage? It seems to me 
R is a very popular, very mature piece of software. Isn't it easy to 
install R on any of the platforms supported by sage? If that is the case, 
wouldn't it be much easier to let sage just work with the system-wide R if 
that is available? The whole OpenSSL issue would still bite people who have 
to rely on installing R within sage, but if we can just use a system-wide R 
in most cases, that would be a much smaller (empty?) set of people.

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


Re: [sage-devel] Live documentation with Thebe reloaded

2017-10-20 Thread Jeroen Demeyer

On 2017-10-19 20:56, Nicolas M. Thiery wrote:

Forgot to mention: if you open the javascript console (shift-ctrl-K on
Firefox/linux), you can trace what's going on with the connection to
binder.


This seems suspicious:

SyntaxError: missing : after property id thebelab@0.0.5:30745:13

I know very little about JavaScript, but it seems to be pointing here:

function renderAllCells(
  {
selector = "[data-executable]",
  } = {}
)

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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Maarten Derickx


On Wednesday, 18 October 2017 18:23:53 UTC+2, Thierry 
(sage-googlesucks@xxx) wrote:
>
> Hi, 
>
> the dichotomy of the vote is not clear to me. 
>
> I am -1 to make openssl a stantard package (hence shipped with the source 
> tarball), not only regarding licensing issues but also for security 
> reasons: our "package manager" is such that packages can not be updated 
> unless Sage itself is updated (because the package version is hardcoded). 
> Hence, when a security issue is found and fixed in openssl, the user who 
> installed it from Sage won't get it until the user upgrades Sage (while 
> every decent distro will provide a hotfix). 
>
> However, i am +1 that we should do our best to let the user have an 
> openssl-enabled version of Sage (for pip, R, some cryptographic hash,...), 
> an acceptable workflow could be: 
>
> - check if libssl-dev (or similar) is installed on the OS 
>   - yes: 
> - use it 
>   - no: 
> - strongly complain about it, provide documentation on how to do it 
>   (possibly provide a doc that depends on the system), 
> - propose 3 options: 
> - "i will install openssl from the distro, and come back later 
>   (recommended)" 
> - "i want Sage to install openssl optional package, i know that 
>   there will be security issues" 
> - "i do not want openssl support, i know that i will not be able 
>   to install any R or Python package from the web" 
>
>
+1 for this.
 

> If the last point (compiling Sage without openssl support) requires a lot 
> of work, i am OK to remove it (i am not sure if this is the point of the 
> vote). 
>
> Note that that there is no chicken-and-eggs issue since the way our 
> "package manager" works allows to install an optional package without 
> having to rely on openssl (no https), we only rely on the computation of 
> sha1 which python-hashlib offers even if it is build without openssl 
> support. 
>
> By the way, Sage is not GPL-3+ but GPL-2+. 
>
>  
>
> Mac fans claim that paying a computer 1.5 the price of a random PC with 
> similar charateristics if justified by the fact that OSX is s 
> user-friendly, perhaps didn't they find the openssl one-click installer 
> right in the middle of the screen yet. 
>
> Proposal: require Apple a grant, corresponding to the huge amount of time 
> Sage developpers waste in porting Sage components (not only openssl, just 
> have a look at trac, sage-devel and ask timelines) on their broken and 
> constantly changing OS. This is not our job to help Apple pretend their 
> system is user-friendly, we are losing a lot of energy which could be 
> spent in much more interesting parts of Sage (e.g. mathematics). 
>
>  
>
> Ciao, 
> Thierry 
>
>
>
>
> On Mon, Oct 16, 2017 at 03:08:51AM -0700, Emmanuel Charpentier wrote: 
> > [ The first post started too fast... Sorry for the interruption ! ] 
> > 
> > Following numerous discussions on this list and various Trac tickets*, 
> the 
> > issue of maintaining Sage-specific patches to various components of Sage 
> > emerged again about the proposed upgrade 
> >  of R to 3.4.2 (discussed here 
> > ). 
> William 
> > again raises 
> >  
> the 
> > issue of security. 
> > 
> > Since Trac#22189 , installation 
> of 
> > a systemwide opennssl is recommended (may be too strongly 
> > , in the taste of some 
> respectable 
> > Sage developers...). The ongoing relicensing of OpenSSL should lift the 
> > last barriers to its inclusion in sage. A discussed here 
> > ,, the 
> > probability of a legal problem related to the incusion of this library 
> in 
> > Sage seems infinitesimal. 
> > 
> > It has beeen furthermore suggested 
> >  
> to 
> > add to our licensing (an adaptatin of) the following language, used in 
> Gnu 
> > Wget License (GPL) : 
> > 
> > "Additional permission under GNU GPL version 3 section 7 
> > 
> > If you modify this program, or any covered work, by linking or combining 
> it 
> > with the OpenSSL project's OpenSSL library (or a modified version of 
> that 
> > library), containing parts covered by the terms of the OpenSSL or SSLeay 
> > licenses, the Free Software Foundation grants you additional permission 
> to 
> > convey the resulting work. Corresponding Source for a non-source form of 
> > such a combination shall include the source code for the parts of 
> OpenSSL 
> > used as well as that of the covered work." 
> > 
> > 
> > The proposed inclusion would entail : 
> > 
> >- Deprecation of our OpenSSL-avidance patches 
> >- Standardization of SSL communications on OpenSSL 
> >- At compilation, research 

Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Luca De Feo
> That is totally not what I said. We don't care about collision resistance,
> but we still need preimage resistance. That is still fine for SHA1 (even MD5
> as far as I know).

If that's your point, an attacker can produce two colliding packages:
a perfectly sound mathematical package and a malicious one. He gets
the mathematical package accepted by SageMath, then uses the malicious
one to perform the attack.

I'm not saying that's easy to do. The perfectly sound mathematical
package would still have to contain some weird octets, but a package
that looks like, e.g., a database of polynomials, could conceivably
evade detection.

I'm saying all this to satisfy the applied cryptographer in you. There
are certainly easier ways to insert malicious code into Sage (just
create a ticket and have a buddy positive review it), but that's not a
good reason to keep using SHA1.

Luca

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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Dima Pasechnik


On Friday, October 20, 2017 at 10:13:54 AM UTC+1, Jeroen Demeyer wrote:
>
> On 2017-10-20 10:54, Dima Pasechnik wrote: 
> > Once upon a time, http was not universally supported, one needed to use 
> > ftp instead. 
>
> You misunderstood my point. It is not about http vs. https. 
>
> What bothers me is that "downloading packages from CRAN" is considered 
> so important by R that it refuses to build when that functionality is 
> not available. 


It is a good reason for stopping shipping R with  Sage, provided that we 
can still have the
needed interfaces  up and  running. Otherwise it seems not too meaningful 
to complain about R here.


Regardless of how important pip is to Python, it is still 
> possible to run Python without pip. And it should be like this: the core 
> functionality should be separated from the package manager. 
>

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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Jeroen Demeyer

On 2017-10-20 11:32, Luca De Feo wrote:

So according to your point checking the SHA1 is useless, because
attackers are not able to get malicious source tarballs accepted by
SageMath.


That is totally not what I said. We don't care about collision 
resistance, but we still need preimage resistance. That is still fine 
for SHA1 (even MD5 as far as I know).


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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-20 Thread Jeroen Demeyer
If you say that something does not work, it would be good to show a 
simple example of what you did. It is impossible for me to understand 
why your code doesn't work without seeing your code.


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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Luca De Feo
>> There you go for something crippled!  https://shattered.io/
>
>
> I don't think that this is actually relevant. This attack would only work if
> an attacker is able to provide a specially manufactured source tarball and
> get it accepted by SageMath. At that point, the attacker could instead just
> insert arbitrary code in the source tarball.

So according to your point checking the SHA1 is useless, because
attackers are not able to get malicious source tarballs accepted by
SageMath.

Anyway, we're digressing. The move to SHA256 needs to be addressed in
another topic, and it is so elementary that we may as well open a
ticket and continue the discussion there.

Luca

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


Re: [sage-devel] How do I overwrite comparison for modules?

2017-10-20 Thread Simon Brandhorst
/home/simon/sage/src/sage/structure/richcmp.pyx in 
sage.structure.richcmp.richcmp_by_eq_and_lt.richcmp 
(build/cythonized/sage/structure/richcmp.c:2172)()
317 if equal_types:
318 other_eq = getattr(other, eq_attr)
--> 319 if other_eq(self):
320 return rich_to_bool(op, 0)
321 if op == Py_EQ:

TypeError: unbound method _eq_() must be called with 
FreeModule_ambient_field_with_category instance as first argument (got 
FreeModule_submodule_field_with_category instance instead)

probably there should be 
319if other.other_eq(self)
or maybe
319other.__eq__(self)

Also when having many different subclasses which have to compare this 
lt_by_eq_and_lt does not work. As it gives the comparison to the other 
element all the time. But I think that is really something that the user 
should decide in his code if he wants it. This does too much.
For me this resulted in circular references etc... so it was a pain to get 
it work.

if not equal_types:
try:
other_eq = getattr(other, eq_attr)
other_lt = getattr(other, lt_attr)


On Friday, October 20, 2017 at 3:59:17 AM UTC+2, Simon Brandhorst wrote:
>
> Well richcmp allows you to define just one method. But it does not save 
> you any work at all if the order is partial. 
> Because then you have to distinguish the cases op = op_LE , op_GE, op_LT 
> ... etc.  so all that you save is documentation and everything is more 
> obscure.
>
> I also tried the richcmp_by_eq_and_lt in principle it is a nice idea and 
> exactly what I need.
> In practice it does not work. Well I could get it to work and all doctests 
> in the free_module.py and free_quadratic_module.py passed. But when testing 
> the whole module folder everything exploded.
> With commit b59062520b9b8e99e8ee126cbf209feb241a596a
>
> TypeError: _eq_() takes exactly 2 arguments (1 given)
> TypeError: unbound method _eq_() must be called with 
> FreeModule_submodule_pid_with_category instance as first argument (got 
> FreeModule_submodule_with_basis_pid_with_category instance instead)
> TypeError: unbound method _eq_() must be called with 
> FreeModule_submodule_field_with_category instance as first argument (got 
> FreeModule_submodule_with_basis_field_with_category instance instead)
> etc. etc. 
>
> So my solution was to remove the @richcmp decorator and the richcmp_by_eq 
> method. Then implement __neq__, __geq__ __leq__ by hand. 
> You can see it in #23978.
>
> It needs review :).
>
> So I expect that the richcmp_by_eq_and_lt does not work properly?
> Also lt is harder to implement they le. That would be nice to have too?
>
> On Tuesday, October 17, 2017 at 8:13:59 PM UTC+2, Travis Scrimshaw wrote:
>>
>>
>>
>> On Tuesday, October 17, 2017 at 9:55:25 AM UTC-5, Simon Brandhorst wrote:
>>>
>>> I got that now. But at the time I thought __richcmp__ was just a fancy 
>>> new name for the old __cmp__ in python in order to make it python 3 
>>> compatible. 
>>>
>>> Anyways. It would be nice to say something like that in the 
>>> documentation. (Maybe I have just missed it and it is there already.)
>>> "
>>> @richcmp_method simply allows to define just 
>>> one comparison method __richcmp__ instead of six __eq__, __lt__, ... "
>>> "
>>> and add a reference to some working example somewhere in the sage 
>>> library.
>>> As many people will come across that file who are not programmers and do 
>>> not speak cython.
>>> And in future they will also not know about the __cmp__ method of python 
>>> 2.7
>>>
>>> In Python, those are called rich comparisons and returning 
>> NotImplemented is a Python thing for rich comparisons, including in things 
>> like __eq__. So it doesn't have to do with speaking Cython. IMO, anytime 
>> you want to find an example in the Sage library, grep is your friend and is 
>> more robust than in some place in the documentation that could (quickly) go 
>> out of date. However, I agree with you that the documentation could be 
>> improved by stating about returning NotImplemented and having a more 
>> complete example.
>>
>> Best,
>> Travis
>>
>>  
>>
>

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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Jeroen Demeyer

On 2017-10-20 10:54, Dima Pasechnik wrote:

Once upon a time, http was not universally supported, one needed to use
ftp instead.


You misunderstood my point. It is not about http vs. https.

What bothers me is that "downloading packages from CRAN" is considered 
so important by R that it refuses to build when that functionality is 
not available. Regardless of how important pip is to Python, it is still 
possible to run Python without pip. And it should be like this: the core 
functionality should be separated from the package manager.


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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Jeroen Demeyer

On 2017-10-19 20:07, Luca De Feo wrote:

There you go for something crippled!  https://shattered.io/


I don't think that this is actually relevant. This attack would only 
work if an attacker is able to provide a specially manufactured source 
tarball and get it accepted by SageMath. At that point, the attacker 
could instead just insert arbitrary code in the source tarball.


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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Dima Pasechnik


On Friday, October 20, 2017 at 9:51:17 AM UTC+1, Jeroen Demeyer wrote:
>
> On 2017-10-19 17:19, Emmanuel Charpentier wrote: 
> > Again : R is not only a software package but also an ecosystem. 
>
> But why? One could say the same for Python, but you can still install 
> Python without OpenSSL. 
>
> What if I simply want to use R without any external packages? Or what if 
> I want to download/install packages in a different way? 
>

Once upon a time, http was not universally supported, one needed to use ftp 
instead.
Nowadays you often need at least http.
That is to say, this point is moot; if you do not want to use https, you're 
on your own.

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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Jeroen Demeyer

On 2017-10-19 17:19, Emmanuel Charpentier wrote:

Again : R is not only a software package but also an ecosystem.


But why? One could say the same for Python, but you can still install 
Python without OpenSSL.


What if I simply want to use R without any external packages? Or what if 
I want to download/install packages in a different way?


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


Re: [sage-devel] Re: VOTE: inclusion of OpenSSL in Sage

2017-10-20 Thread Jeroen Demeyer

On 2017-10-19 17:24, William Stein wrote:

Good, as well they should.   Like you, they likely feel a responsibility
to their users to do the right thing regarding security.   I really
appreciate the "so much trouble" you are "causing" Emmanuel.


I also agree here. The only options should be "use https" or "don't 
download anything". That's exactly what pip does.


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


Re: [sage-devel] Giac fails to build

2017-10-20 Thread Vincent Delecroix

On 20/10/2017 05:38, Timo Kaufmann wrote:

After adding one more depencency (hevea) the compilation succeeds. Thank
you for your help.

It needs quite some dependencies that are not mentioned on the README's
instructions though (like hevea and texlive). Are those just undocumented
or does it depend on some build options?


texlive is a build dependency for the documentation only. It would not 
hurt to specify it in the README. (hevea is likely to be the same)


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


[sage-devel] Re: Segfault while multiplying polynomial and symbolic expression

2017-10-20 Thread Dima Pasechnik


On Friday, October 20, 2017 at 8:19:55 AM UTC+1, Bruno Grenet wrote:
>
> As reported on Ask 
> <
> https://ask.sagemath.org/question/39204/segmentation-fault-when-multiplying-by-variable/>,
>  
>
> the following computation causes a segmentation fault: 
>
> sage: P. = GF(3)['x'] 
> sage: var('a') 
> sage: sigma = 2*x+ 1 
> sage: a * sigma 
>
> According to my tests, the problem occurs when one multiplies a symbolic 
> expression by a non monic polynomial over a finite field, having at 
> least two terms. Note that converting the polynomial to SR beforehand 
> does not change anything. 
>

The latter is the cause - certainly it should not be possible to perform 
such a conversion; as it seemingly succeeds, the
coersion system things it can do the multiplication...
 

>
> I did not succeed in finding the origin of this bug, so help is welcome. 
> I've opened ticket #24072  for 
> this. 
>
> Best, 
> Bruno 
>

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


Re: [sage-devel] Giac fails to build

2017-10-20 Thread Dima Pasechnik


On Friday, October 20, 2017 at 4:38:57 AM UTC+1, Timo Kaufmann wrote:
>
> After adding one more depencency (hevea) the compilation succeeds. Thank 
> you for your help.
>
> It needs quite some dependencies that are not mentioned on the README's 
> instructions though (like hevea and texlive). Are those just undocumented 
> or does it depend on some build options?
>

TeXLive is not a dependence; if it is completely absent Sage can be built 
(using its standard build procedure) and run.
I would not be 100% surprised, however, if a missing texlive part might be 
a problem.
The only checks w.r.t. (La)TeX are done in src/sage/misc/latex.py, where 
various executables (like latex) are
checked for presence.

In a modified build, like in your case, certainly, all bets are off.   Do 
you build giac using the same options as in build/pkgs/giac/spkg-install ?

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


[sage-devel] Segfault while multiplying polynomial and symbolic expression

2017-10-20 Thread Bruno Grenet
As reported on Ask 
, 
the following computation causes a segmentation fault:


sage: P. = GF(3)['x']
sage: var('a')
sage: sigma = 2*x+ 1
sage: a * sigma

According to my tests, the problem occurs when one multiplies a symbolic 
expression by a non monic polynomial over a finite field, having at 
least two terms. Note that converting the polynomial to SR beforehand 
does not change anything.


I did not succeed in finding the origin of this bug, so help is welcome. 
I've opened ticket #24072  for this.


Best,
Bruno

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


[sage-devel] Re: rst2ipynb: tarball does not exist on mirror network

2017-10-20 Thread Volker Braun
fixed

On Thursday, October 19, 2017 at 10:26:58 PM UTC+2, vdelecroix wrote:
>
> Error downloading rst2ipynb-0.2.2.tar.gz 
>

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


[sage-devel] Re: Bug? Sympy, Fricas & Giac can solve this simple integral, why not Maxima?

2017-10-20 Thread Ralf Stephan
The immediate reason is that maxima returns:
Principal Value
(%o4)  2

and Sage since #7377 (7 years ago) catches "Principal Value" and makes it 
divergent.
See https://trac.sagemath.org/ticket/7377 for reasons this was introduced.
There are tickets that urge to fix this:

https://trac.sagemath.org/ticket/13511
https://trac.sagemath.org/ticket/17608

So it's a Sage bug in the Maxima interface.

Regards,

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