[sage-support] Re: trouble displaying 3D graphics

2021-11-08 Thread rickhg12hs
After
```
sage.misc.viewer.viewer.browser('firefox')
```
... do you experience the same behavior?

On Monday, November 8, 2021 at 12:25:24 PM UTC+1 John Cremona wrote:

> I don't often use 3D graphics, but when I run implicitplot3d() I get
> a file permissions error (on ubuntu 20.04):
>
> # example from the docstring
> sage: var('x,y,z')
> (x, y, z)
> sage: implicit_plot3d(x^2+y^2+z^2==4, (x,-3,3), (y,-3,3), (z,-3,3))
> Launched html viewer for Graphics3d Object
>
> Over in my browser (chromium-browser) I see the error message "Access
> to the file was deniedThe file at
> file:///home/john/.sage/temp/john-Latitude-E5470/2250012/tmp_x5e1jfy0.html
> is not readable. It may have been removed, moved or file permissions
> may be preventing access." I changed the permissions on .sage and
> everything under it to a+rx and reloaded, with no change. I deleted
> all of ~/.sage and restarted sage and reran the commands, but the same
> happened.
>
> I can view other html files in my home directory using the browser.
>
> What should I do?
>
> John
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/a1f134eb-76b2-41b3-8715-2021a5323349n%40googlegroups.com.


[sage-support] Re: sage-9.3 and sage from github both fail to compile

2021-07-15 Thread rickhg12hs
Perhaps just install sage-9.3-2 from the Fedora 34 repo with `sudo dnf 
install sagemath`.

On Wednesday, July 14, 2021 at 9:23:24 PM UTC+2 bluf...@gmail.com wrote:

> Both sage-9.3 and sage from github both fail to compile on Fedora 34 [= 
> up-to-date].
> The error message seems to indicate that whatever is wrong can easily be
> fixed, but I do not know how to do it.  Here is the error message:
>
> [gfortran-9.2.0] cp ../../src/gcc/gcc-ar.c gcc-nm.c
> [gfortran-9.2.0] make[7]: cp: Permission denied
> [gfortran-9.2.0] make[7]: *** [Makefile:2139: gcc-nm.c] Error 127
> [gfortran-9.2.0] make[6]: *** [Makefile:4300: all-gcc] Error 2
> [gfortran-9.2.0] make[5]: *** [Makefile:937: all] Error 2
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/8edb7faa-a931-4532-95eb-5ef997e8bf05n%40googlegroups.com.


[sage-support] Re: RSA code

2021-05-03 Thread rickhg12hs
How are you manually entering the `Ciphertext` for decryption?

Ciphertext, cipher = ['㓔', '\U000107ee', '퇫', '뺸']

On Monday, May 3, 2021 at 10:10:58 AM UTC+2 samu@gmail.com wrote:

> ''' I have the RSA code,  code works when we give input to encryption and 
> take decryption output (plaintext and output are same),  but when we 
> encrypt plaintext separately and take its output and give it to decryption 
> code as input separately, the output,  is not the same as encryption input 
> (plaintext and output are not same). Can someone please explain why is this 
> happening? '''
>
>
> # code begins
>
> import sympy
> from datetime import datetime
> from sage.all import ZZ, GF
> start_time = datetime.now()
> print("RSA Encryption and Decryption")
> print("Values of 'p' AND 'q' are as follows:")
> p = sympy.randprime(2, 100)   #Input Prime Number
> print ("p = ", p)
> q = sympy.randprime(2, 100)   #Input Prime Number
> print ("q = ", q)
> s = sympy.randprime(2, 100)   #Input Prime Number
> print ("s = ", s)
>
> n = p * q * s
> print("")
> print ("RSA Modulus,n = ",n)   #RSA Modulus
> r = (p-1)*(q-1)*(s-1) #Eulers Toitent
> e = ZZ.random_element(r)
> while gcd(e, r) != 1: #GCD
> e = ZZ.random_element(r)  #e Value Calculation
> print("")
> print ("Public Key = ", e)
> bezout = xgcd(e, r);
> d = Integer(mod(bezout[1], r));   #d, Private Key
> print("")
> print ("d =", d)
> print("")
> text = 'samu'
> print("")
> print ("Message, m = ", text)
> m = [ord(c) for c in text]
> c = [power_mod(i, e, n) for i in m]#Encryption
> print(c)
> cipher = [chr(a) for a in c]
> print ("Ciphertext, cipher =", cipher)
>
> print('')
> '''
>
> cipher = input("Enter Cipher text to be decrypted")   #cipher input
> print('Cipher text to be decrypted :', cipher) '''
> c = [ord(a) for a in cipher]#conversion of cipher text to the list of 
> ascii values c
>
> print('c =',c)
>
> d = [power_mod(j, d, n) for j in c]#Decryption
> print('d =',d)
>
> characters = [chr(ascii) for ascii in d]
> print("")
> print ("Decrypted text, d = ", ''.join(characters))
> print("")
> print ("Plaintext/ Message,  m = ", text)
> print ("Decrypted Message,   d = ", ''.join(characters))
> if(text == ''.join(characters)):
> print ("Thus we encrypted and decrypted text using RSA algorithm")
> else:
> print("Not sucessfull")
>
>
> end_time = datetime.now()
> print('Time taken for execution of the program: {} '.format(end_time - 
> start_time))
>
> # code ends
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/42553a1e-7e98-4ab2-8c1a-6eb80ff1d8c6n%40googlegroups.com.


[sage-support] Re: A root systems short algorithm : "ValueError: too many values to unpack"

2020-08-19 Thread rickhg12hs
> [proja1, proja2, proja3, proja4, proja5] = myLel

Here you are setting a list of 5 variables to a tuple of 8 elements?

Did you want to call your `proj` function before this?

On Wednesday, August 19, 2020 at 2:15:56 PM UTC+2 Sarah DIJOLS wrote:

>
> Hello,
> I am running the following code (part of an ongoing math project):
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *e = RootSystem(['E',6]).ambient_space()Roots = e.roots() a1 = 
> vector((1/2, -1/2, -1/2, -1/2, -1/2, -1/2, -1/2, 1/2))a2 = vector((1, 1, 0, 
> 0, 0, 0, 0, 0))a3 = vector((-1, 1, 0, 0, 0, 0, 0, 0))a4 = vector((0, -1, 1, 
> 0, 0, 0, 0, 0))a5 = vector((0, 0, -1, 1, 0, 0, 0, 0))a6 = vector((0, 0, 0, 
> -1, 1, 0, 0, 0))Lini = [a1, a2, a3, a4, a5]def proj(t, ai):myLone = 
> vector(ai)result= t - myLone.dot_product(t) / 
> (ai.dot_product(ai))*myLonereturn resultmyP = [proj(x, a6) for x in 
> Lini][proja1, proja2, proja3, proja4, proja5] = myPmyR = [vector(v) for v 
> in Roots]myL = [proj(x, a6) for x in myR]len(myL)*
>
>
>
>
>
>
> * # produce all combinaisons of five vectors  with 2 vectors in myL and 3 
> in myPmyPlist1= Combinations(myP, 3).list()myLlist1= Combinations(myL, 
> 2).list() *
>
> *#Alternatively I would have like to use 5 vectors combinaisons in another 
> function of mine but again it seems the error of "too many values" unable 
> me to do so :*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *#myLlist= Combinations(myL, 5).list()def letsapply(listg, alist):for 
> listel in listg:myPset1= set(tuple(v) for v in listel)
> print(myPset1)for listel2 in alist:myLset1= set(tuple(v) for v 
> in listel2)print(myLset1)myLset1= 
> myLset1.union(myPset1)if len(myLset1) >= 5:
> print(myLset1, "myLset1")if len(myLset1) >= 5:for myLel 
> in myLset1:[proja1, proja2, proja3, proja4, proja5] = 
> myLelprint(myLel)print(letsapply(myPlist1,myLlist1))*
>
> Is there a way to handle this "capacity" issue? I am quite new to SAGE, I 
> have been using it on cocalc and with Jupyter. Thanks a lot for your help.
> Best,
> Sarah Dijols (Math postdoc in Tsinghua University)
>
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/55cba056-5e54-4bd4-8bbf-b07ceb8c3180n%40googlegroups.com.


[sage-support] Re: Solve this Equation for H: 5260862 = M*H^y % 20876441; know variables y and M.

2020-05-14 Thread rickhg12hs
H = (Mod(20192834, 20876441)^-1 * 5260862).nth_root(17)

On Thursday, May 14, 2020 at 3:26:09 PM UTC+2, Madison Adams wrote:
>
> Solve this Equation for H: 5260862 = M*H^y % 20876441
>
> Does anyone happen to know the steps to solve for h:
> Equation: 5260862 = M*Hy % 20876441
>
> Where y = 17, and M = 20192834? My H value is wrong from my previous tries.
>
> I think my order of op. is wrong. Function for code would be helpful. 
> Already familiar with mod_inverse
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/deaf0f9a-746c-4e41-816e-0365a8a2b0aa%40googlegroups.com.


[sage-support] What do the different `make ****clean` targets do?

2018-02-11 Thread rickhg12hs
I've built from source to get a performance boost (I hope) and I'd like to 
know when I should use the different levels of `make clean`.  In the 
top-level make file I see, "misc-clean, bdist-clean, clean, distclean, 
build-clean, bootstrap-clean, maintainer-clean, sagelib-clean" as either 
targets or dependencies of targets.

For example, on a drive-space challenged system, which `clean` target will 
... 1) delete everything but leave sage fully functionally?  ...or perhaps, 
...  2) delete everything but leave enough for a "fairly quick" re-build if 
desired?

Is there a "make clean guide" for those who don't know the entire sage 
build tree/process/etc.?

-- 
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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Does `sage -upgrade` upgrade the packages as well?

2017-05-13 Thread rickhg12hs
Does `sage -upgrade` upgrade the packages as well?

If not, what's the most efficient way to upgrade all packages to the latest 
release?


Is this bullet from Sage Docs 
 still 
acuurate?


   - --upgrade [url] – download, build and install standard packages from 
   given url. If url not given, automatically selects a suitable mirror. If 
   url=’ask’, it lets you select the mirror.

-- 
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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] sage-6.0: Error installing 4ti2 package

2014-01-15 Thread rickhg12hs
Was there there something from the original Sage install (compiled from 
source) that produced the different CXXFLAGS?

Strange that only the Sage config.log had #define 
_4ti2_HAVE_MPZ_INT64_CONVERSION 1.

On Sunday, January 12, 2014 5:15:34 PM UTC-5, rickhg12hs wrote:

 FYI, building 4ti2 independently of Sage on my system completes without 
 error.  In addition, all make check tests pass.

 The config.log files are largely the same, but there are differences. 
  Here's a few that may be significant.

 [diff -d working/config.log sage/config.log]
 ...
 2228c2064
  CFLAGS='-O3 -fomit-frame-pointer -malign-double -fstrict-aliasing 
 -ffast-math -march=pentiumpro -Wall -march=pentiumpro'
 ---
  CFLAGS='-O3 -fomit-frame-pointer -malign-double -fstrict-aliasing 
 -ffast-math -march=pentiumpro -Wall'
 2234c2070
  CXXFLAGS='-O3 -fomit-frame-pointer -malign-double -fstrict-aliasing 
 -ffast-math -Wall -std=c++0x'
 ---
  CXXFLAGS=' -Wall -std=c++0x'
 ...
 2600a2437
  #define _4ti2_HAVE_MPZ_INT64_CONVERSION 1


 On Sunday, January 12, 2014 2:16:49 PM UTC-5, rickhg12hs wrote:

 Unfortunately, the recipe generated the same error.

 /bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
 -I../../src -I../../src/4ti2  -D_4ti2_INT64_   -I./.. 
  -D__STDC_LIMIT_MACROS -DNDEBUG -Wall -std=c++0x -MT 
 lib4ti2int64_la-VectorArrayAPI.lo -MD -MP -MF 
 .deps/lib4ti2int64_la-VectorArrayAPI.Tpo -c -o 
 lib4ti2int64_la-VectorArrayAPI.lo `test -f 'VectorArrayAPI.cpp' || echo 
 './'`VectorArrayAPI.cpp
 libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src/4ti2 
 -D_4ti2_INT64_ -I./.. -D__STDC_LIMIT_MACROS -DNDEBUG -Wall -std=c++0x -MT 
 lib4ti2int64_la-VectorArrayAPI.lo -MD -MP -MF 
 .deps/lib4ti2int64_la-VectorArrayAPI.Tpo -c VectorArrayAPI.cpp -o 
 lib4ti2int64_la-VectorArrayAPI.o
 In file included from VectorArrayAPI.cpp:26:0:
 ../../src/groebner/VectorArrayAPI.h: In instantiation of 'static void 
 _4ti2_::VectorArrayAPI::convert(const T1, T2) [with T1 = 
 __gmp_expr__mpz_struct [1], __mpz_struct [1]; T2 = long long int]':
 VectorArrayAPI.cpp:99:30:   required from here
 ../../src/groebner/VectorArrayAPI.h:67:8: error: cannot convert 'const 
 __gmp_expr__mpz_struct [1], __mpz_struct [1]' to 'long long int' in 
 assignment
  v2 = v1;
 ^
 make[3]: *** [lib4ti2int64_la-VectorArrayAPI.lo] Error 1
 make[3]: Leaving directory `/tmp/4ti2-1.6/src/groebner'


 On Sunday, January 12, 2014 12:45:49 PM UTC-5, William wrote:

 On Sun, Jan 12, 2014 at 8:36 AM, rickhg12hs rickh...@gmail.com wrote: 
  Trying to install 4ti2 package generates an error.  How can this be 
 fixed? 
  

 Here's my recipe (for SageMathCloud) for building 4ti2: 

 # 4ti2 into sage: until the optional spkg gets fixed: 


 ./sage -sh 
 cd /tmp; wget http://www.4ti2.de/version_1.6/4ti2-1.6.tar.gz  
 tar xf 4ti2-1.6.tar.gz  cd 4ti2-1.6 ; ./configure 
 --prefix=/usr/local/sage/current/local/; time make -j16 
 make install  # this *must* be a separate step!! 
 rm -rf /tmp/4ti2* 



  [from log file] 
  ... 
   
  Host system: 
  Linux steelers.net 3.12.6-200.fc19.i686.PAE #1 SMP Mon Dec 23 
 16:58:40 UTC 
  2013 
  i686 i686 i386 GNU/Linux 
   
  --- 
  In file included from VectorArrayAPI.cpp:26:0: 
  ../../src/groebner/VectorArrayAPI.h: In instantiation of 'static void 
  _4ti2_::VectorArrayAPI::convert(const T1, T2) [with T1 = 
  __gmp_expr__mpz_struct [1], __mpz_struct [1]; T2 = long long int]': 
  VectorArrayAPI.cpp:99:30:   required from here 
  ../../src/groebner/VectorArrayAPI.h:67:8: error: cannot convert 'const 
  __gmp_expr__mpz_struct [1], __mpz_struct [1]' to 'long long int' in 
  assignment 
   v2 = v1; 
  ^ 
  make[2]: *** [lib4ti2int64_la-VectorArrayAPI.lo] Error 1 
  
  -- 
  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. 
  To post to this group, send email to sage-s...@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.


[sage-support] sage-6.0: Error installing 4ti2 package

2014-01-12 Thread rickhg12hs
Trying to install 4ti2 package generates an error.  How can this be fixed?

[from log file]
...

Host system:
Linux steelers.net 3.12.6-200.fc19.i686.PAE #1 SMP Mon Dec 23 16:58:40 UTC 
2013 
i686 i686 i386 GNU/Linux

---
In file included from VectorArrayAPI.cpp:26:0:
../../src/groebner/VectorArrayAPI.h: In instantiation of 'static void 
_4ti2_::VectorArrayAPI::convert(const T1, T2) [with T1 = 
__gmp_expr__mpz_struct [1], __mpz_struct [1]; T2 = long long int]':
VectorArrayAPI.cpp:99:30:   required from here
../../src/groebner/VectorArrayAPI.h:67:8: error: cannot convert 'const 
__gmp_expr__mpz_struct [1], __mpz_struct [1]' to 'long long int' in 
assignment
 v2 = v1;
^
make[2]: *** [lib4ti2int64_la-VectorArrayAPI.lo] Error 1

-- 
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] sage-6.0: Error installing 4ti2 package

2014-01-12 Thread rickhg12hs
Unfortunately, the recipe generated the same error.

/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
-I../../src -I../../src/4ti2  -D_4ti2_INT64_   -I./.. 
 -D__STDC_LIMIT_MACROS -DNDEBUG -Wall -std=c++0x -MT 
lib4ti2int64_la-VectorArrayAPI.lo -MD -MP -MF 
.deps/lib4ti2int64_la-VectorArrayAPI.Tpo -c -o 
lib4ti2int64_la-VectorArrayAPI.lo `test -f 'VectorArrayAPI.cpp' || echo 
'./'`VectorArrayAPI.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src/4ti2 
-D_4ti2_INT64_ -I./.. -D__STDC_LIMIT_MACROS -DNDEBUG -Wall -std=c++0x -MT 
lib4ti2int64_la-VectorArrayAPI.lo -MD -MP -MF 
.deps/lib4ti2int64_la-VectorArrayAPI.Tpo -c VectorArrayAPI.cpp -o 
lib4ti2int64_la-VectorArrayAPI.o
In file included from VectorArrayAPI.cpp:26:0:
../../src/groebner/VectorArrayAPI.h: In instantiation of 'static void 
_4ti2_::VectorArrayAPI::convert(const T1, T2) [with T1 = 
__gmp_expr__mpz_struct [1], __mpz_struct [1]; T2 = long long int]':
VectorArrayAPI.cpp:99:30:   required from here
../../src/groebner/VectorArrayAPI.h:67:8: error: cannot convert 'const 
__gmp_expr__mpz_struct [1], __mpz_struct [1]' to 'long long int' in 
assignment
 v2 = v1;
^
make[3]: *** [lib4ti2int64_la-VectorArrayAPI.lo] Error 1
make[3]: Leaving directory `/tmp/4ti2-1.6/src/groebner'


On Sunday, January 12, 2014 12:45:49 PM UTC-5, William wrote:

 On Sun, Jan 12, 2014 at 8:36 AM, rickhg12hs rickh...@gmail.comjavascript: 
 wrote: 
  Trying to install 4ti2 package generates an error.  How can this be 
 fixed? 
  

 Here's my recipe (for SageMathCloud) for building 4ti2: 

 # 4ti2 into sage: until the optional spkg gets fixed: 


 ./sage -sh 
 cd /tmp; wget http://www.4ti2.de/version_1.6/4ti2-1.6.tar.gz  
 tar xf 4ti2-1.6.tar.gz  cd 4ti2-1.6 ; ./configure 
 --prefix=/usr/local/sage/current/local/; time make -j16 
 make install  # this *must* be a separate step!! 
 rm -rf /tmp/4ti2* 



  [from log file] 
  ... 
   
  Host system: 
  Linux steelers.net 3.12.6-200.fc19.i686.PAE #1 SMP Mon Dec 23 16:58:40 
 UTC 
  2013 
  i686 i686 i386 GNU/Linux 
   
  --- 
  In file included from VectorArrayAPI.cpp:26:0: 
  ../../src/groebner/VectorArrayAPI.h: In instantiation of 'static void 
  _4ti2_::VectorArrayAPI::convert(const T1, T2) [with T1 = 
  __gmp_expr__mpz_struct [1], __mpz_struct [1]; T2 = long long int]': 
  VectorArrayAPI.cpp:99:30:   required from here 
  ../../src/groebner/VectorArrayAPI.h:67:8: error: cannot convert 'const 
  __gmp_expr__mpz_struct [1], __mpz_struct [1]' to 'long long int' in 
  assignment 
   v2 = v1; 
  ^ 
  make[2]: *** [lib4ti2int64_la-VectorArrayAPI.lo] Error 1 
  
  -- 
  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.


Re: [sage-support] sage-6.0: Error installing 4ti2 package

2014-01-12 Thread rickhg12hs
FYI, building 4ti2 independently of Sage on my system completes without 
error.  In addition, all make check tests pass.

The config.log files are largely the same, but there are differences. 
 Here's a few that may be significant.

[diff -d working/config.log sage/config.log]
...
2228c2064
 CFLAGS='-O3 -fomit-frame-pointer -malign-double -fstrict-aliasing 
-ffast-math -march=pentiumpro -Wall -march=pentiumpro'
---
 CFLAGS='-O3 -fomit-frame-pointer -malign-double -fstrict-aliasing 
-ffast-math -march=pentiumpro -Wall'
2234c2070
 CXXFLAGS='-O3 -fomit-frame-pointer -malign-double -fstrict-aliasing 
-ffast-math -Wall -std=c++0x'
---
 CXXFLAGS=' -Wall -std=c++0x'
...
2600a2437
 #define _4ti2_HAVE_MPZ_INT64_CONVERSION 1


On Sunday, January 12, 2014 2:16:49 PM UTC-5, rickhg12hs wrote:

 Unfortunately, the recipe generated the same error.

 /bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
 -I../../src -I../../src/4ti2  -D_4ti2_INT64_   -I./.. 
  -D__STDC_LIMIT_MACROS -DNDEBUG -Wall -std=c++0x -MT 
 lib4ti2int64_la-VectorArrayAPI.lo -MD -MP -MF 
 .deps/lib4ti2int64_la-VectorArrayAPI.Tpo -c -o 
 lib4ti2int64_la-VectorArrayAPI.lo `test -f 'VectorArrayAPI.cpp' || echo 
 './'`VectorArrayAPI.cpp
 libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src/4ti2 
 -D_4ti2_INT64_ -I./.. -D__STDC_LIMIT_MACROS -DNDEBUG -Wall -std=c++0x -MT 
 lib4ti2int64_la-VectorArrayAPI.lo -MD -MP -MF 
 .deps/lib4ti2int64_la-VectorArrayAPI.Tpo -c VectorArrayAPI.cpp -o 
 lib4ti2int64_la-VectorArrayAPI.o
 In file included from VectorArrayAPI.cpp:26:0:
 ../../src/groebner/VectorArrayAPI.h: In instantiation of 'static void 
 _4ti2_::VectorArrayAPI::convert(const T1, T2) [with T1 = 
 __gmp_expr__mpz_struct [1], __mpz_struct [1]; T2 = long long int]':
 VectorArrayAPI.cpp:99:30:   required from here
 ../../src/groebner/VectorArrayAPI.h:67:8: error: cannot convert 'const 
 __gmp_expr__mpz_struct [1], __mpz_struct [1]' to 'long long int' in 
 assignment
  v2 = v1;
 ^
 make[3]: *** [lib4ti2int64_la-VectorArrayAPI.lo] Error 1
 make[3]: Leaving directory `/tmp/4ti2-1.6/src/groebner'


 On Sunday, January 12, 2014 12:45:49 PM UTC-5, William wrote:

 On Sun, Jan 12, 2014 at 8:36 AM, rickhg12hs rickh...@gmail.com wrote: 
  Trying to install 4ti2 package generates an error.  How can this be 
 fixed? 
  

 Here's my recipe (for SageMathCloud) for building 4ti2: 

 # 4ti2 into sage: until the optional spkg gets fixed: 


 ./sage -sh 
 cd /tmp; wget http://www.4ti2.de/version_1.6/4ti2-1.6.tar.gz  
 tar xf 4ti2-1.6.tar.gz  cd 4ti2-1.6 ; ./configure 
 --prefix=/usr/local/sage/current/local/; time make -j16 
 make install  # this *must* be a separate step!! 
 rm -rf /tmp/4ti2* 



  [from log file] 
  ... 
   
  Host system: 
  Linux steelers.net 3.12.6-200.fc19.i686.PAE #1 SMP Mon Dec 23 16:58:40 
 UTC 
  2013 
  i686 i686 i386 GNU/Linux 
   
  --- 
  In file included from VectorArrayAPI.cpp:26:0: 
  ../../src/groebner/VectorArrayAPI.h: In instantiation of 'static void 
  _4ti2_::VectorArrayAPI::convert(const T1, T2) [with T1 = 
  __gmp_expr__mpz_struct [1], __mpz_struct [1]; T2 = long long int]': 
  VectorArrayAPI.cpp:99:30:   required from here 
  ../../src/groebner/VectorArrayAPI.h:67:8: error: cannot convert 'const 
  __gmp_expr__mpz_struct [1], __mpz_struct [1]' to 'long long int' in 
  assignment 
   v2 = v1; 
  ^ 
  make[2]: *** [lib4ti2int64_la-VectorArrayAPI.lo] Error 1 
  
  -- 
  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. 
  To post to this group, send email to sage-s...@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.


[sage-support] Re: Should freetype be updated in Sage?

2013-10-22 Thread rickhg12hs
Hmmm, maybe I was lucky.  The trac fix works for me too.

Should sage have a few/several more SAGE_ORIG_ vars for 
sage-native-execute 
to restore?

On Tuesday, October 22, 2013 2:05:52 AM UTC-4, Nils Bruin wrote:



 On Monday, October 21, 2013 10:39:03 PM UTC-7, rickhg12hs wrote:

 Since Sage depends on the host system's runsnake command, how about 
 letting it have its LD_LIBRARY_PATH to run?  Changing one line in 
 .../sage/misc/dev_tools.py allows it to work on my system.

 Last line of current runsnake definition:

 os.system(/usr/bin/python -E `which runsnake` %s %tmpfile)

 See

 http://trac.sagemath.org/ticket/14414
  
 If you can get away with resetting only LD_LIBRARY_PATH, congratulations, 
 but there are a few more variables that are problematic when you try to run 
 native python programs in the environment that sage sets up.


-- 
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] Re: Should freetype be updated in Sage?

2013-10-21 Thread rickhg12hs
Since Sage depends on the host system's runsnake command, how about letting 
it have its LD_LIBRARY_PATH to run?  Changing one line in 
.../sage/misc/dev_tools.py allows it to work on my system.

Last line of current runsnake definition:

os.system(/usr/bin/python -E `which runsnake` %s %tmpfile)

Proposed change to use host system's LD_LIBRARY_PATH:

os.system(LD_LIBRARY_PATH=${SAGE_ORIG_LD_LIBRARY_PATH} /usr/bin/python 
-E `which runsnake` %s %tmpfile)

This change seems pretty low risk since one can't expect Sage to fix a 
broken runsnake on the local host (i.e., if runsnake doesn't work on the 
host, it's not going to work with Sage, or anything else, either), and 
runsnake only reads the tmpfile generated by Sage without any other 
interaction with Sage (as far as I know).

I don't know why freetype is being held at the current version in Sage, but 
the above change should allow runsnake to work regardless.

On Sunday, October 20, 2013 8:55:25 AM UTC-4, Volker Braun wrote:

 This is just Sage's LD_LIBRARY_PATH hurting us once more, you are pretty 
 much in a world of pain if system libraries don't match the Sage version.


 On Sunday, October 20, 2013 6:45:34 AM UTC+1, rickhg12hs wrote:

 Trying to run `runsnake` from within sage commandline fails on my Fedora 
 19 system.  `runsnake` on my system requires that `libfreetype` define 
 symbol `FT_Face_GetCharVariantIndex` which started in `freetype` version 
 2.3.6.  Currently Sage is distributed with `freetype` version 2.3.5. 
  Fedora 19 is distributed with `freetype` version 2.4.11.

 Perhaps Sage could update its version of freetype and/or use the host 
 system's freetype library?



-- 
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] Should freetype be updated in Sage?

2013-10-19 Thread rickhg12hs
Trying to run `runsnake` from within sage commandline fails on my Fedora 19 
system.  `runsnake` on my system requires that `libfreetype` define symbol 
`FT_Face_GetCharVariantIndex` which started in `freetype` version 2.3.6. 
 Currently Sage is distributed with `freetype` version 2.3.5.  Fedora 19 is 
distributed with `freetype` version 2.4.11.

Perhaps Sage could update its version of freetype and/or use the host 
system's freetype library?

-- 
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] Trouble passing Sage 5.11 pari/gen.pyx doctests

2013-08-20 Thread rickhg12hs
Just fully built Sage 5.11 and there seems to be a problem passing all the 
doctests.

--
sage -t devel/sage/sage/libs/pari/gen.pyx  # 4 doctests failed
--

Here's the test run:

[Rick@steelers sage-5.11]$ ./sage -t devel/sage/sage/libs/pari/gen.pyx
Running doctests with ID 2013-08-20-12-12-21-a002eb2c.
Doctesting 1 file.
sage -t devel/sage/sage/libs/pari/gen.pyx
**
File devel/sage/sage/libs/pari/gen.pyx, line 10340, in 
sage.libs.pari.gen.init_pari_stack
Failed example:
a = pari('2^1')
Exception raised:
Traceback (most recent call last):
  File 
/usr/local/src/sage/sage-5.11/local/lib/python2.7/site-packages/sage/doctest/forker.py,
 
line 486, in _run
self.execute(example, compiled, test.globs)
  File 
/usr/local/src/sage/sage-5.11/local/lib/python2.7/site-packages/sage/doctest/forker.py,
 
line 845, in execute
exec compiled in globs
  File doctest sage.libs.pari.gen.init_pari_stack[1], line 1, in 
module
a = pari('2^1')
  File gen.pyx, line 9733, in 
sage.libs.pari.gen.PariInstance.__call__ (sage/libs/pari/gen.c:51081)
RuntimeError: evaluating PARI string
**
File devel/sage/sage/libs/pari/gen.pyx, line 10343, in 
sage.libs.pari.gen.init_pari_stack
Failed example:
del a
Exception raised:
Traceback (most recent call last):
  File 
/usr/local/src/sage/sage-5.11/local/lib/python2.7/site-packages/sage/doctest/forker.py,
 
line 486, in _run
self.execute(example, compiled, test.globs)
  File 
/usr/local/src/sage/sage-5.11/local/lib/python2.7/site-packages/sage/doctest/forker.py,
 
line 845, in execute
exec compiled in globs
  File doctest sage.libs.pari.gen.init_pari_stack[3], line 1, in 
module
del a
NameError: name 'a' is not defined
**
File devel/sage/sage/libs/pari/gen.pyx, line 10530, in 
sage.libs.pari.gen.__errmessage.errnum
Failed example:
try:
pari('1/0')
except PariError, err:
print err.errnum()
Exception raised:
Traceback (most recent call last):
  File 
/usr/local/src/sage/sage-5.11/local/lib/python2.7/site-packages/sage/doctest/forker.py,
 
line 486, in _run
self.execute(example, compiled, test.globs)
  File 
/usr/local/src/sage/sage-5.11/local/lib/python2.7/site-packages/sage/doctest/forker.py,
 
line 845, in execute
exec compiled in globs
  File doctest sage.libs.pari.gen.__errmessage.errnum[0], line 2, 
in module
pari('1/0')
  File gen.pyx, line 9733, in 
sage.libs.pari.gen.PariInstance.__call__ (sage/libs/pari/gen.c:51081)
RuntimeError: evaluating PARI string
**
File devel/sage/sage/libs/pari/gen.pyx, line 10551, in 
sage.libs.pari.gen.__errmessage.__str__
Failed example:
try:
pari('1/0')
except PariError, err:
print err
Exception raised:
Traceback (most recent call last):
  File 
/usr/local/src/sage/sage-5.11/local/lib/python2.7/site-packages/sage/doctest/forker.py,
 
line 486, in _run
self.execute(example, compiled, test.globs)
  File 
/usr/local/src/sage/sage-5.11/local/lib/python2.7/site-packages/sage/doctest/forker.py,
 
line 845, in execute
exec compiled in globs
  File doctest sage.libs.pari.gen.__errmessage.__str__[0], line 2, 
in module
pari('1/0')
  File gen.pyx, line 9733, in 
sage.libs.pari.gen.PariInstance.__call__ (sage/libs/pari/gen.c:51081)
RuntimeError: evaluating PARI string
**
3 items had failures:
   1 of   2 in sage.libs.pari.gen.__errmessage.__str__
   1 of   2 in sage.libs.pari.gen.__errmessage.errnum
   2 of   8 in sage.libs.pari.gen.init_pari_stack
[1290 tests, 4 failures, 4.63 s]
--
sage -t devel/sage/sage/libs/pari/gen.pyx  # 4 doctests failed
--
Total time for all tests: 5.8 seconds
cpu time: 3.5 seconds
cumulative wall time: 4.6 seconds

-- 
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] Re: Trouble passing Sage 5.11 pari/gen.pyx doctests

2013-08-20 Thread rickhg12hs
Yep, that's it.
32-bit F19.

-- 
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] Re: Partial Fraction Expansion for Polynomials with complex factors

2013-08-01 Thread rickhg12hs
On Thursday, August 1, 2013 1:50:32 AM UTC-4, Rakhi Warriar wrote:

 I have the following function:

 f(x) = 1
  
  x^2 + 4*x + 13

 I need to find its partial fraction expansion. As the factors are complex 
 conjugates, I am not able to do using partial_fraction(). How can I find 
 this?

 Commands:
 x = CC['x'].0
 f = 1/(x^2 + 4*x+ 13)
 f.partial_fraction()
 this gives error:
 Traceback (click to the left of this block for traceback)
 ...
 AttributeError: 'FractionFieldElement_1poly_field' object has no
 attribute 'partial_fraction'

With Sage 5.10:

sage: P.x=CC[]
sage: f=1/(x^2+4*x+13)
sage: f
1.00/(x^2 + 4.00*x + 13.0)
sage: f.partial_fraction_decomposition()
(0,
 [(-0.167*I)/(x + 2.00 - 3.00*I),
  0.167*I/(x + 2.00 + 3.00*I)])
sage: f.partial_fraction_decomposition()[1]
[(-0.167*I)/(x + 2.00 - 3.00*I),
 0.167*I/(x + 2.00 + 3.00*I)]
sage: sum(f.partial_fraction_decomposition()[1])
1.00/(x^2 + 4.00*x + 13.0)
sage: f == sum(f.partial_fraction_decomposition()[1])
True
sage: 
 

-- 
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] Disturbing Equality (from askSAGE)

2013-07-30 Thread rickhg12hs
sage: var('a b')
(a, b)
sage: assume(a, 'real')
sage: assume(b, 'real')
sage: bool( sqrt((a+b)^2) == sqrt(a^2) + sqrt(b^2) )
True
sage:bool( (sqrt((a+b)^2) == sqrt(a^2) + sqrt(b^2)).subs(a=1,b=-1) )
False
sage:

Why the strange equality?

-- 
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] Re: Sage Notebook, Chrome Browser, SELinux Alert

2013-07-30 Thread rickhg12hs
Which log do you mean?

Steps to reproduce:
$ ./sage -notebook

An SELinux alert every time.  Sage notebook still works fine though.

Help request posted to Google Chrome group:  
http://productforums.google.com/forum/#!category-topic/chrome/linux/5Qs_g0yofKk


On Tuesday, July 30, 2013 10:22:16 AM UTC-4, Volker Braun wrote:

 Works on Fedora 19, maybe you can post a part of your log? Steps to 
 reproduce?


 On Monday, July 29, 2013 11:11:48 PM UTC-4, rickhg12hs wrote:

 Sage 5.10 Notebook, Fedora 17 with SELinux set to Enforcing.

 SELinux is preventing /opt/google/chrome/chrome from 'write' accesses 
 on the directory /home/MyHomeDir/.sage.

 Is this expected?  Should I allow write access by creating a local 
 exception for SELinux?



-- 
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] Re: Sage Notebook, Chrome Browser, SELinux Alert

2013-07-30 Thread rickhg12hs
Here is the SELinux Alert Details:

[Details  Start]
SELinux is preventing /opt/google/chrome/chrome from write access on the 
directory /home/rick/.sage.

*  Plugin catchall (100. confidence) suggests 
 ***

If you believe that chrome should be allowed write access on the .sage 
directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep chrome /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context   
 unconfined_u:unconfined_r:chrome_sandbox_t:s0-s0:c
  0.c1023
Target Contextunconfined_u:object_r:user_home_t:s0
Target Objects/home/rick/.sage [ dir ]
Sourcechrome
Source Path   /opt/google/chrome/chrome
Port  Unknown
Host  steelers.net
Source RPM Packages   google-chrome-stable-28.0.1500.71-209842.i386
Target RPM Packages   
Policy RPMselinux-policy-3.10.0-170.fc17.noarch
Selinux Enabled   True
Policy Type   targeted
Enforcing ModeEnforcing
Host Name steelers.net
Platform  Linux steelers.net 3.9.10-100.fc17.i686.PAE 
#1 SMP
  Sun Jul 14 01:34:14 UTC 2013 i686 i686
Alert Count   1
First Seen2013-07-30 13:17:57 EDT
Last Seen 2013-07-30 13:17:57 EDT
Local ID  d984be81-6864-452c-974b-4cecba51149b

Raw Audit Messages
type=AVC msg=audit(1375204677.41:5388): avc:  denied  { write } for 
 pid=12239 comm=chrome name=.sage dev=dm-2 ino=3802163 
scontext=unconfined_u:unconfined_r:chrome_sandbox_t:s0-s0:c0.c1023 
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir


type=SYSCALL msg=audit(1375204677.41:5388): arch=i386 syscall=open 
success=no exit=EACCES a0=b7eb6a5c a1=8441 a2=1b6 a3=b7edeb00 items=0 
ppid=0 pid=12239 auid=1001 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 
egid=1001 sgid=1001 fsgid=1001 ses=694 tty=pts1 comm=chrome 
exe=/opt/google/chrome/chrome 
subj=unconfined_u:unconfined_r:chrome_sandbox_t:s0-s0:c0.c1023 key=(null)

Hash: chrome,chrome_sandbox_t,user_home_t,dir,write

audit2allow

#= chrome_sandbox_t ==
# The source type 'chrome_sandbox_t' can write to a 'dir' of the 
following types:
# home_cert_t, user_home_dir_t, cgroup_t, tmpfs_t, tmp_t, 
user_fonts_cache_t, chrome_sandbox_tmpfs_t, chrome_sandbox_tmp_t

allow chrome_sandbox_t user_home_t:dir write;

audit2allow -R

#= chrome_sandbox_t ==
# The source type 'chrome_sandbox_t' can write to a 'dir' of the 
following types:
# home_cert_t, user_home_dir_t, cgroup_t, tmpfs_t, tmp_t, 
user_fonts_cache_t, chrome_sandbox_tmpfs_t, chrome_sandbox_tmp_t

allow chrome_sandbox_t user_home_t:dir write;
[Details  End]

On Tuesday, July 30, 2013 11:21:13 AM UTC-4, Volker Braun wrote:

 post the actual log message


 On Tuesday, July 30, 2013 10:35:08 AM UTC-4, rickhg12hs wrote:

 Which log do you mean?

 Steps to reproduce:
 $ ./sage -notebook

 An SELinux alert every time.  Sage notebook still works fine though.

 Help request posted to Google Chrome group:  
 http://productforums.google.com/forum/#!category-topic/chrome/linux/5Qs_g0yofKk


 On Tuesday, July 30, 2013 10:22:16 AM UTC-4, Volker Braun wrote:

 Works on Fedora 19, maybe you can post a part of your log? Steps to 
 reproduce?


 On Monday, July 29, 2013 11:11:48 PM UTC-4, rickhg12hs wrote:

 Sage 5.10 Notebook, Fedora 17 with SELinux set to Enforcing.

 SELinux is preventing /opt/google/chrome/chrome from 'write' 
 accesses on the directory /home/MyHomeDir/.sage.

 Is this expected?  Should I allow write access by creating a local 
 exception for SELinux?



-- 
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] Re: Disturbing Equality (from askSAGE)

2013-07-30 Thread rickhg12hs


On Tuesday, July 30, 2013 1:40:29 PM UTC-4, JamesHDavenport wrote:



 On Tuesday, 30 July 2013 15:29:43 UTC+1, rickhg12hs wrote:

 sage: var('a b')
 (a, b)
 sage: assume(a, 'real')
 sage: assume(b, 'real')
 sage: bool( sqrt((a+b)^2) == sqrt(a^2) + sqrt(b^2) )
 True
 sage:bool( (sqrt((a+b)^2) == sqrt(a^2) + sqrt(b^2)).subs(a=1,b=-1) )
 False
 sage:

 Why the strange equality?

  Because square root is multivalued. Consider 
 sqrt(1-z)*sqrt(1+z)=sqrt(1-z^2) and sqrt(z-1)*sqrt(z+1)=sqrt(z^2-1).
 More academically, consider
 Bradford,R.J.  Davenport,J.H.,
 Towards Better Simplification of Elementary Functions.
 Proc. ISSAC 2002 (ed. T. Mora), ACM Press, New York, 2002, pp. 15-22.
  


So you are saying the `True` Bool is the desired behavior? 

-- 
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] Sage Notebook, Chrome Browser, SELinux Alert

2013-07-29 Thread rickhg12hs
Sage 5.10 Notebook, Fedora 17 with SELinux set to Enforcing.

SELinux is preventing /opt/google/chrome/chrome from 'write' accesses 
on the directory /home/MyHomeDir/.sage.

Is this expected?  Should I allow write access by creating a local 
exception for SELinux?

-- 
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] Google Group sage-support Daily Summary Email Bomb

2013-06-30 Thread rickhg12hs
On Thursday, June 27, 2013 1:59:07 PM UTC-4, Niles Johnson wrote:

 According to my email history, the last normal message I got from 
 sage-support was 12/20/2012.  Then I got no email from sage-support until 
 Wed, 
 Jun 26, 2013 at 7:40 PM EDT; this was an abridged summary of 250 messages, 
 many of which date from January 2013.  I've had 4 more 
 such emails, and a 5th one summarizing 238 messages.  Hopefully that means 
 the group is done catching up on all it's email sending since January!


Looks like we're all caught up now and processing the updates correctly. 
Yea!
 

-- 
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] Re: Google Group sage-support Daily Summary Email Bomb

2013-06-27 Thread rickhg12hs
Have now received 5 of these in the last 8 hours.  The first was at Wed, 
Jun 26, 2013 at 7:40 PM EDT.



-- 
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] Google Group sage-support Daily Summary Email Bomb

2013-06-27 Thread rickhg12hs

On Thursday, June 27, 2013 3:21:59 AM UTC-4, Minh Nguyen wrote:

 Hi, 

 On Thu, Jun 27, 2013 at 2:13 PM, rickhg12hs rickh...@gmail.comjavascript: 
 wrote: 
  
  All of a sudden the Google Group sage-support Daily Summary Email is 
 huge 
  ( 350kB) and more often than daily. 
  
  Here's the latest subject: 
  subject: [sage-support] Abridged summary of 
  sage-s...@googlegroups.comjavascript: 
  - 250 Messages in 58 Topics 
  I've received three of these in the last 5 hours (not completely 
  identical, but nearly).  I've verified my settings and they seem fine 
 and 
  unchanged. 
  
  Is this a Google problem or is something wrong/different with this 
 group? 

 I don't see anything wrong with your settings and I don't see anything 
 wrong with the settings for the whole group. 


Am I the only one getting _daily_ abridged summaries every 45-120 minutes?

-- 
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] Google Group sage-support Daily Summary Email Bomb

2013-06-26 Thread rickhg12hs
All of a sudden the Google Group sage-support Daily Summary Email is huge 
( 350kB) and more often than daily.

Here's the latest subject:
subject: [sage-support] Abridged summary of sage-support@googlegroups.com - 
250 Messages in 58 Topics
I've received three of these in the last 5 hours (not completely identical, 
but nearly).  I've verified my settings and they seem fine and unchanged.

Is this a Google problem or is something wrong/different with this group?

-- 
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] R interface performance

2012-09-25 Thread rickhg12hs
Is there a way to use R from Sage to speed things up?  Is there something 
in Sage that could be improved to approach R's speed?

E.g., here's a toy demonstration of how slow R's summary is from Sage.

sage: version()
'Sage Version 5.3, Release Date: 2012-09-08'
sage: %timeit  r.summary(range(1000))
5 loops, best of 3: 17.5 s per loop


Regards.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] R interface performance

2012-09-25 Thread rickhg12hs


On Tuesday, September 25, 2012 4:22:03 PM UTC-4, William wrote:

 On Tue, Sep 25, 2012 at 1:14 PM, William Stein 
 wst...@gmail.comjavascript: 
 wrote: 
  On Tue, Sep 25, 2012 at 1:10 PM, rickhg12hs 
  rickh...@gmail.comjavascript: 
 wrote: 
  Is there a way to use R from Sage to speed things up?  Is there 
 something in 
  Sage that could be improved to approach R's speed? 
  
  E.g., here's a toy demonstration of how slow R's summary is from Sage. 
  
  sage: version() 
  'Sage Version 5.3, Release Date: 2012-09-08' 
  sage: %timeit  r.summary(range(1000)) 
  5 loops, best of 3: 17.5 s per loop 
  
  I don't understand your questions above at all, but want to point out 
  that in your example the time is completely dominated by converting 
  the Python object range(1000) to R.  Consider: 
  
  sage: %timeit  r.summary(range(1000)) 
  5 loops, best of 3: 2.2 s per loop 
  sage: s = r(range(1000)) 
  sage: %timeit  r.summary(s) 
  125 loops, best of 3: 5.26 ms per loop 

 Here is doing something similar (but not identical) in Sage (pure Python): 

 sage: v = range(1000) 
 sage: %timeit [min(v), median(v), mean(v), max(v)] 
 625 loops, best of 3: 121 µs per loop 

 Here's something related: 

 sage: v = stats.TimeSeries(range(1000)) 
 sage: %timeit [v.min(), v.mean(), v.max()] 
 625 loops, best of 3: 3.67 µs per loop 

 I'm sure R's summary is on the order of microseconds as well, and that 
 5.26ms is almost all overhead.  One can use the C interface to R to 
 get much better performance: 

 sage: import rpy2.robjects as robjects 
 sage: v = robjects.r(range(1000)) 
 sage: summary = robjects.r['summary'] 
 sage: %timeit summary(v) 
 625 loops, best of 3: 898 µs per loop 
 sage: print(summary(v)) 
Min. 1st Qu.  MedianMean 3rd Qu.Max. 
 999 999 999 999 999 999 


 So with the C interface it is 898 microseconds, which to me still 
 seems like a lot, given that I feel like I could write something in 
 Cython that does the same thing in about 10 microseconds. 

  -- William 


You're right.  Converting the Python object to R does dominate.

I'm intrigued by your use of  rpy2.robjects and why the summary is 
surprising.

Regards.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] R interface performance

2012-09-25 Thread rickhg12hs



 sage: import rpy2.robjects as robjects 
 sage: v = robjects.r(range(1000)) 
 sage: summary = robjects.r['summary'] 
 sage: %timeit summary(v) 
 625 loops, best of 3: 898 µs per loop 
 sage: print(summary(v)) 
Min. 1st Qu.  MedianMean 3rd Qu.Max. 
 999 999 999 999 999 999 


After changing v assignment to:

v = robjects.IntVector(range(1000))

... everything worked correctly and quickly (for my machine anyway).

sage: %timeit summary(v) 
125 loops, best of 3: 1.59 ms per loop
sage: print(summary(v)) 
   Min. 1st Qu.  MedianMean 3rd Qu.Max. 
0.0   249.8   499.5   499.5   749.2   999.0 


Thanks!
 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Workaround: Sage 5.2 fails to build (mpir-2.4.0.p6) on Fedora 16 32-bit

2012-09-17 Thread rickhg12hs
On Wednesday, September 12, 2012 9:33:56 AM UTC-4, rickhg12hs wrote:

 On Monday, September 10, 2012 2:16:02 PM UTC-4, rickhg12hs wrote:

 After failing an upgrade from Sage v. 4.8, the Sage v. 5.2 source was 
 downloaded (md5sum checked fine) and the build started.  The build 
 failed with mpir-2.4.0.p6 complaining that configure: error: ABI=32 
 is not among the following valid choices: standard. 


 Not done testing yet, and it's not ideal, but this workaround built 
 completely without error.

 $ MPIR_CONFIGURE='ABI=standard' make


Assigning  MPIR_CONFIGURE as above before executing make does seem to be an 
effective workaround.  Everything was built and all the tests (./sage 
-testall) passed.

Perhaps there's a configuration detection problem that requires this 
workaround?

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Sage 5.2 fails to build (mpir-2.4.0.p6) on Fedora 16 32-bit

2012-09-11 Thread rickhg12hs
On Monday, September 10, 2012 2:16:02 PM UTC-4, rickhg12hs wrote:

 After failing an upgrade from Sage v. 4.8, the Sage v. 5.2 source was 
 downloaded (md5sum checked fine) and the build started.  The build 
 failed with mpir-2.4.0.p6 complaining that configure: error: ABI=32 
 is not among the following valid choices: standard. 


I ran make -k just so the build would continue after the mpir failure and 
another problem was encountered.  Something needing Fedora 16's 
openssl-devel failed and after installing it from the normal Fedora repo 
the only build failure now seems to be mpir.  Fedora 16's mpir is several 
versions older than Sage's 5.2 so I'm wondering if there is just another 
dependency I need to successfully build Sage 5.2.

Any thoughts?

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Polyhedron.radius() bug?

2012-02-10 Thread rickhg12hs
   Return the maximal distance from the center to a vertex.

Shouldn't this be translation invariant?  Doesn't seem like any of
these are answers right.


sage: sq=polytopes.n_cube(2)
sage: sq.vertices()
[[1, 1], [-1, 1], [1, -1], [-1, -1]]

sage: sq.radius()
2*sqrt(2)

sage: Polyhedron([[p0+1,p1] for p0,p1 in sq.vertices()]).radius()
2*sqrt(3)
sage: Polyhedron([[p0+10,p1] for p0,p1 in sq.vertices()]).radius()
2*sqrt(102)

-- 
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: How to use R's untar in Sage?

2010-07-13 Thread rickhg12hs
Found the problem was with my system's tar command.  After specifying
tar=internal (meaning that it uses R's builtin tar) everything
worked fine.

Thanks for your consideration though.

On Jul 12, 11:14 pm, kcrisman kcris...@gmail.com wrote:
 On Jul 12, 10:57 pm, rickhg12hs rickhg1...@gmail.com wrote:

  I've tried to use R's untar command a number of different ways from
  Sage's commandline interface and I am having trouble listing the
  contents of a LZMA compressed TAR file. Actually, I don't seem to get
  any desirable output from r.untar so I am thinking I'm not even close
  to using the correct syntax.

 Syntax with R commands is not always obvious for optional keywords.
 Can you give us the *exact* R command (with options) you are trying to
 use?  Note the documentation:  What options are supported will depend
 on the ‘tar’ used.   So it is possible that the R untar in question
 on Sage behaves differently from a 'native' implementation.  But most
 likely it is the use of options that is the problem.  Unfortunately I
 can't remember offhand how I've used them in the past :( but perhaps
 someone else will.

  If I have a LZMA compressed TAR file, how can I list/read it with Sage
  and/or r.untar in Sage?

 If you are just trying to use R from within Sage, without integrating
 it with the rest of Sage, you can also use r_console(), or use %r in
 the notebook, and just do things that way.

 - 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] How to use R's untar in Sage?

2010-07-12 Thread rickhg12hs
I've tried to use R's untar command a number of different ways from
Sage's commandline interface and I am having trouble listing the
contents of a LZMA compressed TAR file. Actually, I don't seem to get
any desirable output from r.untar so I am thinking I'm not even close
to using the correct syntax.

If I have a LZMA compressed TAR file, how can I list/read it with Sage
and/or r.untar in Sage?

Cheers!

-- 
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: Integer.sqrt() memory leak?

2010-05-29 Thread rickhg12hs
The source code for Integer.sqrt() calls some lower level stuff that
I'm not familiar with, otherwise I'd try to fix it. Should I submit a
bug report? Can I even do that?

Thanks,
Richard

On May 27, 12:43 pm, Robert Bradshaw rober...@math.washington.edu
wrote:
 On May 27, 2010, at 9:07 AM, rickhg12hs wrote:

  I noticed that doing sqrt() for large integers seems to continually
  chew up memory.

  For example:

  sage: m = get_memory_usage()
  sage: while True:
     a = ZZ(randint(2^400,2^800)).sqrt()
     print get_memory_usage(m)

  This prints ever increasing memory usage values, but I'm not sure that
  it should.

 Looks like a memory leak to me.

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


[sage-support] Integer.sqrt() memory leak?

2010-05-27 Thread rickhg12hs
I noticed that doing sqrt() for large integers seems to continually
chew up memory.

For example:

sage: m = get_memory_usage()
sage: while True:
a = ZZ(randint(2^400,2^800)).sqrt()
print get_memory_usage(m)

This prints ever increasing memory usage values, but I'm not sure that
it should.

-- 
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: Possible bug in sample standard deviation

2010-05-23 Thread rickhg12hs
Really appreciate/enjoy Sage, but while we're picking on std, why
isn't the docstring returned after ?-return?

sage: std?
Type:   function
Base Class: type 'function'
String Form:function std at 0xae1c87c
Namespace:  Interactive
File:   /home/rick/sage/sage-4.4.2/local/lib/python2.6/site-packages/
sage/stats/basic_stats.py
Definition: std(v, bias=False)

sage:

I wonder if there are other docstrings not being displayed.

-- 
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 an R vector to a list

2010-04-13 Thread rickhg12hs
x.sage() works great too!

On Apr 13, 12:20 pm, ablondin alexandre.blondin.ma...@gmail.com
wrote:
 I answered myself.
 It suffices to call sageobj on it.

 sage: x = r.c([1,2,3])
 sage: x
 [1] 1 2 3
 sage: list(x)
 [[1] 1, [1] 2, [1] 3]
 sage:
 sage:
 sage:
 sage: sageobj(x)
 [1, 2, 3]
 sage: type(sageobj(x))
 type 'list'

 Thanks anyway !

 On 13 avr, 10:23, ablondin alexandre.blondin.ma...@gmail.com wrote:

  Dear Sage community,
  I'm trying to use the R interface (which means I have to learn R as
  well) and it's not going too bad, but I have no idea how I can
  transform an R object (a vector) to get the associated list. For
  instance, if I type
  sage: x = r.c([1,2,3])
  sage: x
  [1] 1 2 3
  sage: list(x)
  [[1] 1, [1] 2, [1] 3]

  I would like the output not to be a list with R objects as its
  elements, but simply a list. Is that possible ?

  Thanks !

  Alex

-- 
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 unsubscribe, reply using remove me as the subject.


[sage-support] Re: ValueError: Unable to solve

2010-01-10 Thread rickhg12hs
The real disappointment is that sage could not solve it.

Aren't there several solutions?

Richard

On Jan 10, 7:01 am, Simon King simon.k...@nuigalway.ie wrote:
 Hi Roland!

 On 10 Jan., 12:56, Rolandb rola...@planet.nl wrote:

  Hi,

  The following message amazes me, because if an equation is unsolvable
  I would assume [] as output.

  ValueError: Unable to solve [x^3 + 3*x^2*y + 3*x*y^2 == 45487, y^3 ==
  549755813888] for (x, y)

 I am not an expert for that part of Sage. But I would expect the
 output [] *only* if it is certain that there is no solution. I
 interprete the ValueError in the sense of sorry, I can't solve this
 equation, and I can't prove the absence of solutions either.

 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] post-solve filtering based on assumptions????

2010-01-10 Thread rickhg12hs
It would be convenient to filter solve output based on assume.  Is
there an easy, generally applicable way to do this?

E.g.,

sage: var('a b t x y')
(a, b, t, x, y)
sage: assume(a0,b0,t0)
sage: assumptions()
[a  0, b  0, t  0]
sage: solve([y==(x^2-1)/2,x==a*t,y==b*t],x,y,t)
[[x == (b + sqrt(a^2 + b^2))/a, y == (b^2 + sqrt(a^2 + b^2)*b)/a^2, t
== (b + sqrt(a^2 + b^2))/a^2], [x == (b - sqrt(a^2 + b^2))/a, y ==
(b^2 - sqrt(a^2 + b^2)*b)/a^2, t == (b - sqrt(a^2 + b^2))/a^2]]
sage: bool((b - sqrt(a^2 + b^2))/a^2  0)  # This shows the 2nd value
for t is not  0
False
sage:

The second solution is not valid based on the assumptions.  How best
to filter it?  ... and in the general case?

Cheers,
Richard
-- 
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: Updating 'line3d' without making a fresh call.

2010-01-10 Thread rickhg12hs
Sorry not to address your query, but ...

Is there a satellite ephemeris propagator for sage? ... or does your
data come from outside sage?

Cheers,
Richard

On Jan 7, 8:19 pm, Stefan stefan.louis.no...@gmail.com wrote:
 Hi all,

 I'm preparing to make a presentation to a few colleagues at work on
 the capabilities of Sage.  In the presentation, I'm doing a
 demonstration of Sage's ability to visualize 3D data via that line3d
 command - in this case, an arbitrary spacecraft ephemeris.  However,
 placing the line3d() call inside of a function that has the interact
 attribute causes undesirable effects in having to reinitialize Jmol
 and losing the viewpoint.  Is there any way to access the data of a
 given Jmol object so that you can dynamically update the data used
 without having to reinitialize the call to Jmol?

 Thanks!

 @interact
 def ephemerisPlot(step=slider(srange(1,len(Data['Time']),1), default =
 0)):
     show(line3d(zip(Data['X'][0:step],Data['Y'][0:step],Data['Z']
 [0:step]), color='red')+line3d(zip(Data['X'],Data['Y'],Data
 ['Z']),opacity=0.1, color='blue')+sphere((Data['X'][step],Data['Y']
 [step],Data['Z'][step]), size=200, color='blue')+sphere((0,0,0),
 size=6378.1, color='white'))
-- 
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] Try cvxopt.solvers.lp (Was Re: MixedIntegerLinearProgram solver)

2009-12-13 Thread rickhg12hs
You could also use the LP solver in cvxopt.

http://www.sagemath.org/doc/numerical_sage/cvxopt.html

For your example problem:

sage: RealNumber=float
sage: Integer=int
sage: from cvxopt.base import matrix as m
sage: from cvxopt import solvers
sage: c = m([-1., -5.])
sage: G = m([[1., 1.5, -1., 0.], [0.2, 3., 0., -1.]])
sage: h = m([4., 4., 0., 0.])
sage: sol = solvers.lp(c,G,h)
sage: print sol['x']
sage: print -c.trans() * sol['x']

HTH!
Rick

On Dec 9, 7:28 am, hassan hsn.zam...@gmail.com wrote:
 Hi all
 I need to solve a LP so I have installed 'csc':

 sage: p.solve(solver='cbc')

 and then copy and paste the example 
 inhttp://www.sagemath.org/doc/reference/sage/numerical/mip.htmthat is:

 sage: p = MixedIntegerLinearProgram(maximization=True)
 sage: x = p.new_variable()
 sage: p.set_objective(x[1] + 5*x[2])
 sage: p.add_constraint(x[1] + 0.2*x[2], max=4)
 sage: p.add_constraint(1.5*x[1] + 3*x[2], max=4)
 sage: p.solve()

 and the result is:

 ---
 AttributeError                            Traceback (most recent call
 last)

 /home/hassan/ipython console in module()

 /home/hassan/Apps/sage-4.2.1/local/lib/python2.6/site-packages/sage/numerical/mip.so
  in sage.numerical.mip.MixedIntegerLinearProgram.solve 
 (sage/numerical/mip.c:5059)()

 /home/hassan/Apps/sage-4.2.1/local/lib/python2.6/site-packages/sage/numerical/mipCoin.so
  in sage.numerical.mipCoin.solveCoin (patch/mipCoin.cpp:595)()

 AttributeError: MixedIntegerLinearProgram instance has no attribute
 '_variables_type'

 Pleas Help!

-- 
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: create a subdiagonal matrix quickly

2009-06-21 Thread rickhg12hs

On Jun 20, 10:18 pm, Robert Bradshaw rober...@math.washington.edu
wrote:
 sage: n = 10
 sage: m = block_matrix([0, zero_matrix(1,1), identity_matrix(n), 0])
 sage: m.subdivide() # get rid of the block divisions
 sage: m
 [0 0 0 0 0 0 0 0 0 0 0]
 [1 0 0 0 0 0 0 0 0 0 0]
 [0 1 0 0 0 0 0 0 0 0 0]
 [0 0 1 0 0 0 0 0 0 0 0]
 [0 0 0 1 0 0 0 0 0 0 0]
 [0 0 0 0 1 0 0 0 0 0 0]
 [0 0 0 0 0 1 0 0 0 0 0]
 [0 0 0 0 0 0 1 0 0 0 0]
 [0 0 0 0 0 0 0 1 0 0 0]
 [0 0 0 0 0 0 0 0 1 0 0]
 [0 0 0 0 0 0 0 0 0 1 0]

 You can also use this to get anything you want on the sub-diagonal  
 (or pretty much anywhere).

 sage: m = block_matrix([0, zero_matrix(1,1), diagonal_matrix([10, 20,  
 30, 40]), 0]); m.subdivide(); m
 [ 0  0  0  0  0]
 [10  0  0  0  0]
 [ 0 20  0  0  0]
 [ 0  0 30  0  0]
 [ 0  0  0 40  0]

Very nice - I didn't know about block_matrix.  In addition, it seems
block_matrix has an optional argument subdivide.

sage: n = 10
sage: m = block_matrix([0, zero_matrix(1,1), identity_matrix(n),
0],subdivide=False)
sage: m
[0 0 0 0 0 0 0 0 0 0 0]
[1 0 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0 0 0]
[0 0 0 0 1 0 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 0 0 1 0]

--~--~-~--~~~---~--~~
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: Apache configure

2009-06-17 Thread rickhg12hs

I would like to serve the Sage notebook running in a VM on a real
machine that is not the Apache server machine.

I am running into similar issues ...

  Unfortunately, in sage the html links are all absolute rather tha
  relative  so I can redirecthttp://myserver/sageto port 8000 but the
  the links go tohttp://myserver/login(say) rather than http://
  myserver/sage/login.


  I think you can use apache to be aproxyandreverseproxy, using re-
  write rules to map the urls both directions (as well as ports). This
  is probably the best bet (correct me if I'm wrong, but doesn't
  sagenb.org work this way?).

In /etc/httpd/conf.d/sage.conf I put:

ProxyPass /sage http://172.16.194.129
ProxyPassReverse /sage http://172.16.194.129

The IP address is what sage reported after starting the notebook in
the VM.  I had to set routes and IP forwarding, and the sage notebook
responds now.

I think the absolute links make my sage.conf insufficient to really
serve the content from the Apache server (there are no graphics, some
links don't work, etc.)


 This is how sagenb.org works.  This is in httpd.conf.  It's maybe even
 more complicated because the computer serving the page isn't even the
 same computer where the notebook server is running.

 VirtualHost *
   RewriteEngine On
   ServerName sagenb.org
   ProxyPass/http://sagenb.org:8000/
   ProxyPassReverse /http://sagenb.org:8000/
   DocumentRoot /
 Location /
DefaultType text/html
 /Location
 /VirtualHost

I want to serve the Sage notebook within the tree structure of an
existing Apache server, but also running in a VM on a different
machine.  I.e., http://existing.apache.server/sage would reverse proxy
the sage notebook running in the VM.  Would a simple modification to
the apache config allow this?

I'm a Sage and Apache newbie so any suggestions you may have will be
gratefully received.

Thank you,
Richard Graham

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