[sage-support] Re: Question re : ./sage -upgrade

2008-10-20 Thread Simon King

Dear William,

On Oct 20, 5:47 am, William Stein [EMAIL PROTECTED] wrote:
 Just do sage -upgrade again.

Should this work already? Wasn't there some posts on Sage devel that
for some reason upgrade to 3.1.3 or 3.1.4 was a problem?

I tried a minute ago, and an upgrade (starting with 3.1.2) failed,
since make claimed that there is nothing to do.

Cheers
  Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: german keybord in vmware image

2008-10-20 Thread Martin Rubey

mabshoff [EMAIL PROTECTED] writes:

 On Oct 16, 7:33 pm, Burcin Erocal [EMAIL PROTECTED] wrote:
  On 16 Oct 2008 20:21:55 +0200
 
 Hi Martin,
 
  Martin Rubey [EMAIL PROTECTED] wrote:
 
   Some of my students complain that the vmware image of sage seems to
   use english keyboard.  Is there a way to configure this?
 
   (I do not own a windows machine, so I cannot try it...)
 
 The VMware image does run on any platform where there is a VMWare
 player, i.e. Linux and OSX would be a possible test bed for you in
 case you want to play with the VMWare image.
 
  As far as I know the vmware image runs ubuntu, so one can just follow
  the instructions on the ubuntu community website:
 
  https://help.ubuntu.com/community/LocaleConf
  (scroll down for Keyboard configuration - console)
 
 Exactly. This has come up before and does solve the problem.

OK, I tried it on three windows boxes - but it does not work.  I did

manage

sudo su

dpkg-reconfigure console-data

select quertz, german

exit, reboot.

Curiously, after reboot, the keyboard is still english, but

dpkg-reconfigure console-data

thinks we have a german keyboard...

UPDATE: 

using

dpkg-reconfigure console-setup works.

Martin


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: german keybord in vmware image

2008-10-20 Thread William Stein

On Mon, Oct 20, 2008 at 6:08 AM, Martin Rubey [EMAIL PROTECTED] wrote:

 mabshoff [EMAIL PROTECTED] writes:

 On Oct 16, 7:33 pm, Burcin Erocal [EMAIL PROTECTED] wrote:
  On 16 Oct 2008 20:21:55 +0200

 Hi Martin,

  Martin Rubey [EMAIL PROTECTED] wrote:
 
   Some of my students complain that the vmware image of sage seems to
   use english keyboard.  Is there a way to configure this?
 
   (I do not own a windows machine, so I cannot try it...)

 The VMware image does run on any platform where there is a VMWare
 player, i.e. Linux and OSX would be a possible test bed for you in
 case you want to play with the VMWare image.

  As far as I know the vmware image runs ubuntu, so one can just follow
  the instructions on the ubuntu community website:
 
  https://help.ubuntu.com/community/LocaleConf
  (scroll down for Keyboard configuration - console)

 Exactly. This has come up before and does solve the problem.

 OK, I tried it on three windows boxes - but it does not work.  I did

 manage

 sudo su

 dpkg-reconfigure console-data

 select quertz, german

 exit, reboot.

 Curiously, after reboot, the keyboard is still english, but

 dpkg-reconfigure console-data

 thinks we have a german keyboard...

 UPDATE:

 using

 dpkg-reconfigure console-setup works.

What *precisely* works?  Where would be the most useful place
to add this information?  In the README file that comes in the
sage vmware zip?

Thanks!

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: german keybord in vmware image

2008-10-20 Thread Martin Rubey

William Stein [EMAIL PROTECTED] writes:

  UPDATE:
 
  using
 
  dpkg-reconfigure console-setup works.
 
 What *precisely* works?  

That the key z prints a z and not a y in the console, and all the other
keys seem to be in the right place, too.

 Where would be the most useful place to add this information?  In the README
 file that comes in the sage vmware zip?

Sorry, I have no idea.  Maybe one could add the keyboard configuration as an
extra menu item (parallel to sage, manage, etc.)

I hate these MS Windows troubles.  I spent a lot of time building FriCAS on MS
Windows.  Meanwhile this works more or less out of the box (I prepared Cygwin
binaries, and the make process is also easy), but the first time was a
nightmare.

Martin


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] display 3d graphics in TeXmacs sage plugin

2008-10-20 Thread DJDANG

Hi everyone, I'm having trouble trying to display 3D graphic objects
made with sage on TeXmacs. Everytime I try to plot any kind of 3D
object, it just says Graphics3D Object and that's it, nothing else
show up.
Please anyone who knows how this works give some advise or some other
option to use.
Thanks in advance,
Daniel

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: displaying documentation

2008-10-20 Thread Serge Salamanka

Well, Stan has initiated the discussion about tab functionality.
I've got a question to developers and may be a suggestion.

When the cell comes to the end of browser window and one wants to look 
for available commands with tab option it shows options below the cell 
itself and below the end of the browser window.
Basically to my unconvenience I always have to use mouse to scroll the 
window down.

Could it be changed or improved somehow ?


Thank you
Serge

Stan Schymanski пишет:
 Dear all,
 
 I can't display the documentation from the sage command line any more.
 Here is what happens:
 
 --
 | SAGE Version 3.1.3.rc0, Release Date: 2008-10-12   |
 | Type notebook() for the GUI, and license() for information.|
 --
 
 sage: notebook?
 Display all 1748 possibilities? (y or n)
 
 
 It seems to only see the question mark but not the command before it.
 If I type y, it just shows all possible commands I could use.
 
 I get the same behaviour with 3.1.2 (Intel Mac with OSX 10.4.11).
 
 Everything else works fine. Hope someone can help.
 
 Thanks a lot,
 Stan
  
 

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Question re : ./sage -upgrade

2008-10-20 Thread John H Palmieri

On Oct 20, 12:57 am, Simon King [EMAIL PROTECTED] wrote:
 Dear William,

 On Oct 20, 5:47 am, William Stein [EMAIL PROTECTED] wrote:

  Just do sage -upgrade again.

 Should this work already? Wasn't there some posts on Sage devel that
 for some reason upgrade to 3.1.3 or 3.1.4 was a problem?

 I tried a minute ago, and an upgrade (starting with 3.1.2) failed,
 since make claimed that there is nothing to do.


In fact I recently tried this with 3.1.3, and it tried to upgrade to
3.1.2.

  John


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: display 3d graphics in TeXmacs sage plugin

2008-10-20 Thread Justin C. Walker

Hi, Daniel,

On Oct 20, 2008, at 06:26 , DJDANG wrote:

 Hi everyone, I'm having trouble trying to display 3D graphic objects
 made with sage on TeXmacs. Everytime I try to plot any kind of 3D
 object, it just says Graphics3D Object and that's it, nothing else
 show up.

It's hard for anyone to guess what the problem is without knowing what  
it is you are doing.  Can you post a minimal Sage example that shows  
the problem?

Thanks.

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds

If you're not confused,
You're not paying attention





--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: german keybord in vmware image

2008-10-20 Thread William Stein

On Mon, Oct 20, 2008 at 6:20 AM, Martin Rubey [EMAIL PROTECTED] wrote:

 William Stein [EMAIL PROTECTED] writes:

  UPDATE:
 
  using
 
  dpkg-reconfigure console-setup works.

 What *precisely* works?

 That the key z prints a z and not a y in the console, and all the other
 keys seem to be in the right place, too.

Sorry, I meant, of all the things you tried was
just typing

   dpkg-reconfigure console-setup

the one and only thing you did, and that it worked?



 Where would be the most useful place to add this information?  In the README
 file that comes in the sage vmware zip?

 Sorry, I have no idea.  Maybe one could add the keyboard configuration as an
 extra menu item (parallel to sage, manage, etc.)

 I hate these MS Windows troubles.  I spent a lot of time building FriCAS on MS
 Windows.  Meanwhile this works more or less out of the box (I prepared Cygwin
 binaries, and the make process is also easy), but the first time was a
 nightmare.

 Martin


 




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

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Question re : ./sage -upgrade

2008-10-20 Thread William Stein

On Mon, Oct 20, 2008 at 7:27 AM, John H Palmieri [EMAIL PROTECTED] wrote:

 On Oct 20, 12:57 am, Simon King [EMAIL PROTECTED] wrote:
 Dear William,

 On Oct 20, 5:47 am, William Stein [EMAIL PROTECTED] wrote:

  Just do sage -upgrade again.

 Should this work already? Wasn't there some posts on Sage devel that
 for some reason upgrade to 3.1.3 or 3.1.4 was a problem?

 I tried a minute ago, and an upgrade (starting with 3.1.2) failed,
 since make claimed that there is nothing to do.


 In fact I recently tried this with 3.1.3, and it tried to upgrade to
 3.1.2.


Sorry, my answer above was from an airport via my iphone,
and I didn't realize that Michael hadn't put the new 3.1.4 spkg's
up yet.  I've posted them, so now sage -upgrade upgrades
one to sage-3.1.4.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: display 3d graphics in TeXmacs sage plugin

2008-10-20 Thread William Stein

On Mon, Oct 20, 2008 at 6:26 AM, DJDANG [EMAIL PROTECTED] wrote:

 Hi everyone, I'm having trouble trying to display 3D graphic objects
 made with sage on TeXmacs. Everytime I try to plot any kind of 3D
 object, it just says Graphics3D Object and that's it, nothing else
 show up.
 Please anyone who knows how this works give some advise or some other
 option to use.

The texmacs/sage interface was written by Mike Hansen before
Sage had any 3D plotting, so I suspect it doesn't at all support
it.  That said, two questions:
   (1) does 2D plotting work?
   (2) What happens if you do
sage: var('x,y')
sage: plot3d(sin(x*y),(x,-1,1),(y,-1,1)).show()
   (3) What if you do
sage: var('x,y')
sage: plot3d(sin(x*y),(x,-1,1),(y,-1,1)).show(viewer='tachyon')

 Thanks in advance,
 Daniel

 




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

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Publishing from localhost

2008-10-20 Thread Graham

Hi all,

I've been working on Sage from the version I recently downloaded to my
mac. I have no problems opening up notebooks and working in my
localhost location through my web browser. However, I wasn't able to
publish these notebooks externally; they only come up as, e.g.,
http://localhost:8000/home/pub/1,; which I was unable to access just
from a web browser. Any help would be appreciated.


Thanks,
Graham

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Publishing from localhost

2008-10-20 Thread William Stein

On Mon, Oct 20, 2008 at 8:41 AM, Graham [EMAIL PROTECTED] wrote:

 Hi all,

 I've been working on Sage from the version I recently downloaded to my
 mac. I have no problems opening up notebooks and working in my
 localhost location through my web browser. However, I wasn't able to
 publish these notebooks externally; they only come up as, e.g.,
 http://localhost:8000/home/pub/1,; which I was unable to access just
 from a web browser. Any help would be appreciated.


Unfortunately, there is no support for publishing from a local
Sage install.  I'm actually not quite sure what that would mean
even.  Probably your best bet is to use t Download button,
download the worksheet, then post a link to the sws file
somewhere on your website.

When (not if) the public sage notebook server is back (sagenb.org)
then you could upload the sws file to your account there and
click on publish.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: german keybord in vmware image

2008-10-20 Thread Martin Rubey

William Stein [EMAIL PROTECTED] writes:

 On Mon, Oct 20, 2008 at 6:20 AM, Martin Rubey [EMAIL PROTECTED] wrote:
 
  William Stein [EMAIL PROTECTED] writes:
 
   UPDATE:
  
   using
  
   dpkg-reconfigure console-setup works.
 
  What *precisely* works?
 
  That the key z prints a z and not a y in the console, and all the 
  other
  keys seem to be in the right place, too.
 
 Sorry, I meant, of all the things you tried was
 just typing
 
dpkg-reconfigure console-setup
 
 the one and only thing you did, and that it worked?

Nearly: you will then be asked some simple questions which are obvious to
answer if you do not have an english keyboard.

Martin


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Upgrade failed in Givaro

2008-10-20 Thread mabshoff



On Oct 20, 9:01 am, Simon King [EMAIL PROTECTED] wrote:
 Dear Team,

 after William's recent post that an upgrade to 3.1.4 should now be
 possible.

 I tried, but it failed.

 Strange: There was no new install.log (AFAIK, an upgrade should
 produce a new one).

 Last words on the screen:
 /home/king/SAGE/devel/sage-3.1.1/local/lib/../lib/libstdc++.so: could
 not read symbols: File in wrong format

This looks like a problem with your toolchain since we don't ship any
libstdc++.so since it is provided by the C++ compiler.

SNIP

 I tried to remove the givaro spkg and do upgrade again, but the same
 problem occured.

 What can I do?

 Cheers
      Simon

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Upgrade failed in Givaro

2008-10-20 Thread Simon King

Dear Team,

after William's recent post that an upgrade to 3.1.4 should now be
possible.

I tried, but it failed.

Strange: There was no new install.log (AFAIK, an upgrade should
produce a new one).

Last words on the screen:
/home/king/SAGE/devel/sage-3.1.1/local/lib/../lib/libstdc++.so: could
not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[3]: *** [libgivaro.la] Fehler 1
make[3]: Leaving directory `/home/king/SAGE/devel/sage-3.1.1/spkg/
build/givaro-3.2.13rc2/src/src'
make[2]: *** [install-recursive] Fehler 1
make[2]: Leaving directory `/home/king/SAGE/devel/sage-3.1.1/spkg/
build/givaro-3.2.13rc2/src/src'
make[1]: *** [install-recursive] Fehler 1
make[1]: Leaving directory `/home/king/SAGE/devel/sage-3.1.1/spkg/
build/givaro-3.2.13rc2/src'
Error installing givaro

I tried to remove the givaro spkg and do upgrade again, but the same
problem occured.

What can I do?

Cheers
 Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: german keybord in vmware image

2008-10-20 Thread William Stein

On Mon, Oct 20, 2008 at 8:52 AM, Martin Rubey [EMAIL PROTECTED] wrote:

 William Stein [EMAIL PROTECTED] writes:

 On Mon, Oct 20, 2008 at 6:20 AM, Martin Rubey [EMAIL PROTECTED] wrote:
 
  William Stein [EMAIL PROTECTED] writes:
 
   UPDATE:
  
   using
  
   dpkg-reconfigure console-setup works.
 
  What *precisely* works?
 
  That the key z prints a z and not a y in the console, and all the 
  other
  keys seem to be in the right place, too.

 Sorry, I meant, of all the things you tried was
 just typing

dpkg-reconfigure console-setup

 the one and only thing you did, and that it worked?

 Nearly: you will then be asked some simple questions which are obvious to
 answer if you do not have an english keyboard.


Excellent, thanks. See http://trac.sagemath.org/sage_trac/ticket/4331

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Upgrade failed in Givaro

2008-10-20 Thread Simon King

Hi Michael,

On Oct 20, 6:09 pm, mabshoff [EMAIL PROTECTED]
dortmund.de wrote:
 This looks like a problem with your toolchain since we don't ship any
 libstdc++.so since it is provided by the C++ compiler.

Ok. I have two versions of gcc on my machine, but the problem occurs
in both cases.

I think it'll be better to try from scratch (i.e., from sources).

Yours
Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Question re : ./sage -upgrade

2008-10-20 Thread John H Palmieri

On Oct 20, 7:50 am, William Stein [EMAIL PROTECTED] wrote:

 Sorry, my answer above was from an airport via my iphone,

Now you're just showing off...

  John

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Upgrade failed in Givaro

2008-10-20 Thread Simon King

Dear Michael,

On Oct 20, 7:05 pm, Simon King [EMAIL PROTECTED] wrote:
 I think it'll be better to try from scratch (i.e., from sources).

... and that worked.

However, is it normal that the attempt to upgrade did *not* result in
an install.log?

Yours
 Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Upgrade failed in Givaro

2008-10-20 Thread mabshoff



On Oct 20, 2:01 pm, Simon King [EMAIL PROTECTED] wrote:
 Dear Michael,

 On Oct 20, 7:05 pm, Simon King [EMAIL PROTECTED] wrote:

  I think it'll be better to try from scratch (i.e., from sources).

 ... and that worked.

As long as you copy libstc++.so into $SAGE_LOCAL/lib Sage will likely
break on upgrade unless you use the same gcc you build Sage with. That
means setting PATH as well as LD_LIBRARY_PATH correctly.

 However, is it normal that the attempt to upgrade did *not* result in
 an install.log?

I have no clue what is going on with your build, but something is
FUBAR. I get an updated install.log every time I do an upgrade on one
of my test installs.

 Yours
      Simon

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: multiply a list by a constant

2008-10-20 Thread pong

Thanks Marshall. I have thought about that as well.
Since I want to optimize time. I want to see if your method is faster
then a for loop. However, I run into something puzzling:

vector( [k for k in range(10)]) results in an error. Sage compliant
about

TypeError: unable to find a common ring for all elements

But if you check each element of the list, I got type 'int'

So why SAGE is complaining?

On Oct 19, 7:27 am, Marshall Hampton [EMAIL PROTECTED] wrote:
 Another option is to convert your list to a vector, and then convert
 it back.  This is more awkward for a single operation but if you are
 doing lots of vector addition and scalar multiplication it can be the
 way to go.
 I.e. you can do:

 sage: a = [3,4]
 sage: a = list(2*vector(a))
 sage: a
 [6, 8]

 -M. Hampton

 On Oct 19, 1:15 am, Robert Bradshaw [EMAIL PROTECTED]
 wrote:

  On Oct 18, 2008, at 10:14 PM, Alex Ghitza wrote:

   Hmmm.  As far as I know you can use _ as a placeholder for a
   variable, and it's meant for this kind of use (where you don't
   really want to introduce a new variable name).  It's strange that
   it doesn't work for you.  Can you post the error message that you get?

  Actually, _ is an actual variable, though personally I find it a bit
  harder to read than a normal letter. The one special thing about it
  (in ipython at least) is that it constantly gets reassigned to the
  last returned value, e.g.

  sage: 1+2
  3
  sage: _
  3

  - Robert
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: multiply a list by a constant

2008-10-20 Thread William Stein

On Mon, Oct 20, 2008 at 2:06 PM, pong [EMAIL PROTECTED] wrote:

 Thanks Marshall. I have thought about that as well.
 Since I want to optimize time. I want to see if your method is faster
 then a for loop. However, I run into something puzzling:

 vector( [k for k in range(10)]) results in an error. Sage compliant
 about

 TypeError: unable to find a common ring for all elements

I get

sage: vector( [k for k in range(10)])
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

Are you sure that's what you typed?


 But if you check each element of the list, I got type 'int'

 So why SAGE is complaining?

 On Oct 19, 7:27 am, Marshall Hampton [EMAIL PROTECTED] wrote:
 Another option is to convert your list to a vector, and then convert
 it back.  This is more awkward for a single operation but if you are
 doing lots of vector addition and scalar multiplication it can be the
 way to go.
 I.e. you can do:

 sage: a = [3,4]
 sage: a = list(2*vector(a))
 sage: a
 [6, 8]

 -M. Hampton

 On Oct 19, 1:15 am, Robert Bradshaw [EMAIL PROTECTED]
 wrote:

  On Oct 18, 2008, at 10:14 PM, Alex Ghitza wrote:

   Hmmm.  As far as I know you can use _ as a placeholder for a
   variable, and it's meant for this kind of use (where you don't
   really want to introduce a new variable name).  It's strange that
   it doesn't work for you.  Can you post the error message that you get?

  Actually, _ is an actual variable, though personally I find it a bit
  harder to read than a normal letter. The one special thing about it
  (in ipython at least) is that it constantly gets reassigned to the
  last returned value, e.g.

  sage: 1+2
  3
  sage: _
  3

  - Robert
 




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

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: multiply a list by a constant

2008-10-20 Thread pong

Yes, that's what I got. Maybe because I'm only using SAGE 3.1.1 or
there is something wrong with the installation.

sage: vector([k for k in range(10)])
---
TypeError Traceback (most recent call
last)

/home/pong/sage/ipython console in module()

/home/pong/sage/free_module_element.pyx in
sage.modules.free_module_element.vector (sage/modules/
free_module_element.c:2376)()

/home/pong/sage/free_module_element.pyx in
sage.modules.free_module_element.prepare (sage/modules/
free_module_element.c:2622)()

TypeError: unable to find a common ring for all elements


On Oct 20, 2:09 pm, William Stein [EMAIL PROTECTED] wrote:
 On Mon, Oct 20, 2008 at 2:06 PM, pong [EMAIL PROTECTED] wrote:

  Thanks Marshall. I have thought about that as well.
  Since I want to optimize time. I want to see if your method is faster
  then a for loop. However, I run into something puzzling:

  vector( [k for k in range(10)]) results in an error. Sage compliant
  about

  TypeError: unable to find a common ring for all elements

 I get

 sage: vector( [k for k in range(10)])
 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

 Are you sure that's what you typed?





  But if you check each element of the list, I got type 'int'

  So why SAGE is complaining?

  On Oct 19, 7:27 am, Marshall Hampton [EMAIL PROTECTED] wrote:
  Another option is to convert your list to a vector, and then convert
  it back.  This is more awkward for a single operation but if you are
  doing lots of vector addition and scalar multiplication it can be the
  way to go.
  I.e. you can do:

  sage: a = [3,4]
  sage: a = list(2*vector(a))
  sage: a
  [6, 8]

  -M. Hampton

  On Oct 19, 1:15 am, Robert Bradshaw [EMAIL PROTECTED]
  wrote:

   On Oct 18, 2008, at 10:14 PM, Alex Ghitza wrote:

Hmmm.  As far as I know you can use _ as a placeholder for a
variable, and it's meant for this kind of use (where you don't
really want to introduce a new variable name).  It's strange that
it doesn't work for you.  Can you post the error message that you get?

   Actually, _ is an actual variable, though personally I find it a bit
   harder to read than a normal letter. The one special thing about it
   (in ipython at least) is that it constantly gets reassigned to the
   last returned value, e.g.

   sage: 1+2
   3
   sage: _
   3

   - Robert

 --
 William Stein
 Associate Professor of Mathematics
 University of Washingtonhttp://wstein.org
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: multiply a list by a constant

2008-10-20 Thread William Stein

On Mon, Oct 20, 2008 at 2:24 PM, pong [EMAIL PROTECTED] wrote:

 Yes, that's what I got. Maybe because I'm only using SAGE 3.1.1 or
 there is something wrong with the installation.

I bet that's the case.  You should maybe upgrade.  We'll be posting
binaries soon.

William


 sage: vector([k for k in range(10)])
 ---
 TypeError Traceback (most recent call
 last)

 /home/pong/sage/ipython console in module()

 /home/pong/sage/free_module_element.pyx in
 sage.modules.free_module_element.vector (sage/modules/
 free_module_element.c:2376)()

 /home/pong/sage/free_module_element.pyx in
 sage.modules.free_module_element.prepare (sage/modules/
 free_module_element.c:2622)()

 TypeError: unable to find a common ring for all elements


 On Oct 20, 2:09 pm, William Stein [EMAIL PROTECTED] wrote:
 On Mon, Oct 20, 2008 at 2:06 PM, pong [EMAIL PROTECTED] wrote:

  Thanks Marshall. I have thought about that as well.
  Since I want to optimize time. I want to see if your method is faster
  then a for loop. However, I run into something puzzling:

  vector( [k for k in range(10)]) results in an error. Sage compliant
  about

  TypeError: unable to find a common ring for all elements

 I get

 sage: vector( [k for k in range(10)])
 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

 Are you sure that's what you typed?





  But if you check each element of the list, I got type 'int'

  So why SAGE is complaining?

  On Oct 19, 7:27 am, Marshall Hampton [EMAIL PROTECTED] wrote:
  Another option is to convert your list to a vector, and then convert
  it back.  This is more awkward for a single operation but if you are
  doing lots of vector addition and scalar multiplication it can be the
  way to go.
  I.e. you can do:

  sage: a = [3,4]
  sage: a = list(2*vector(a))
  sage: a
  [6, 8]

  -M. Hampton

  On Oct 19, 1:15 am, Robert Bradshaw [EMAIL PROTECTED]
  wrote:

   On Oct 18, 2008, at 10:14 PM, Alex Ghitza wrote:

Hmmm.  As far as I know you can use _ as a placeholder for a
variable, and it's meant for this kind of use (where you don't
really want to introduce a new variable name).  It's strange that
it doesn't work for you.  Can you post the error message that you get?

   Actually, _ is an actual variable, though personally I find it a bit
   harder to read than a normal letter. The one special thing about it
   (in ipython at least) is that it constantly gets reassigned to the
   last returned value, e.g.

   sage: 1+2
   3
   sage: _
   3

   - Robert

 --
 William Stein
 Associate Professor of Mathematics
 University of Washingtonhttp://wstein.org
 




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

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: multiply a list by a constant

2008-10-20 Thread Jason Grout

William Stein wrote:
 On Mon, Oct 20, 2008 at 2:06 PM, pong [EMAIL PROTECTED] wrote:
 Thanks Marshall. I have thought about that as well.
 Since I want to optimize time. I want to see if your method is faster
 then a for loop. However, I run into something puzzling:

 vector( [k for k in range(10)]) results in an error. Sage compliant
 about

 TypeError: unable to find a common ring for all elements
 
 I get
 
 sage: vector( [k for k in range(10)])
 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
 
 Are you sure that's what you typed?


It seems like this error was fixed recently.  Pong, what version of Sage 
are you running?

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---