Re: [sage-support] customization of sage docker

2022-03-30 Thread Wai Yan Pong
Thanks Dima. I followed the tutorial and was able to save the changes to a
new docker image.

On Mon, Mar 28, 2022 at 6:54 AM Dima Pasechnik  wrote:

> On Sun, Mar 27, 2022 at 5:12 PM pong  wrote:
> >
> > I am switching to running sage docker image since the latest binaries
> for linux is no longer available. But can I make any customization, say in
> init.sage survive the quitting of docker?
>
> This isn't Sage-specific; yes, you can modify docker images and save
> ("commit", in dockerspeak) modifications. See e.g.
> https://phoenixnap.com/kb/how-to-commit-changes-to-docker-image
>
> HTH
> Dima
>
> > If yes, may I get some help on how?
> >
> > --
> > 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/57dfc20c-daa3-4bc3-bcdd-f9c076153869n%40googlegroups.com
> .
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-support/Igtr6SZO5wc/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAAWYfq2XyE1AVp-%3Dsb-HMkMaiUhOnyXRYVzej_ep_bzXgYG2Wg%40mail.gmail.com
> .
>

-- 
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/CAE7ST_8jER%2BXO2A4y7oJk1OKd%2BpWEdCoG0J_zfNyCVRPtaty%2Bw%40mail.gmail.com.


[sage-support] customization of sage docker

2022-03-27 Thread pong
I am switching to running sage docker image since the latest binaries for 
linux is no longer available. But can I make any customization, say in 
init.sage survive the quitting of docker?
If yes, may I get some help on how?

-- 
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/57dfc20c-daa3-4bc3-bcdd-f9c076153869n%40googlegroups.com.


[sage-support] Re: Adding new attribute to Poset

2020-09-28 Thread pong
Thanks Eric. It works!

I figured out the FinitePoset part after reading the manual. But I know 
test that it works for X = FinitePoset(...) 
I didn't think of trying it with X = Poset(...).

On Monday, September 28, 2020 at 11:38:15 AM UTC-7 egourg...@gmail.com 
wrote:

> Poset is a function, which constructs a finite poset, not the poset class, 
> as you can check:
> sage: type(Poset)
> 
> You can also check it by having a look at the source code:
> sage: Poset??
>
> So when you write
> Poset.upper_bounds = upper_bounds
> you are attaching upper_bounds to the function, not to the class of 
> posets. The latter is FinitePoset (actually a subclass of it, name 
> FinitePoset_with_category, which is constructed dynamically via Sage 
> category mechanism). So you should do
>
> sage: from sage.combinat.posets.posets import FinitePoset
> sage: FinitePoset.upper_bounds = upper_bounds
>
> Then
> sage: X = Poset(...)
> sage: X.upper_bounds(...)
> shoud work.
>
>
> Le lundi 28 septembre 2020 à 18:29:43 UTC+2, pong a écrit :
>
>> For convenient, I would like to add an attribute, upper_bounds, to Poset 
>> objects
>>
>> However, after writing the method and issue
>> Poset.upper_bounds = upper_bounds
>>
>> X.upper_bounds(S) complains 
>>
>> 'FinitePoset_with_category' object has no attribute 'upper_bounds'
>>
>> When I try 
>> FinitePoset_with_category.upper_bounds = upper_bounds
>>
>> I got 
>> name 'FinitePoset_with_category' is not defined
>>
>> So how can one add an attribute to FinitePoset_with_category? 
>>
>

-- 
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/3b134e30-a1a5-4e63-afd3-3a14380df654n%40googlegroups.com.


[sage-support] Adding new attribute to Poset

2020-09-28 Thread pong
For convenient, I would like to add an attribute, upper_bounds, to Poset 
objects

However, after writing the method and issue
Poset.upper_bounds = upper_bounds

X.upper_bounds(S) complains 

'FinitePoset_with_category' object has no attribute 'upper_bounds'

When I try 
FinitePoset_with_category.upper_bounds = upper_bounds

I got 
name 'FinitePoset_with_category' is not defined

So how can one add an attribute to FinitePoset_with_category? 

-- 
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/d4c4a7b3-4f77-4cce-9174-accec70011a5n%40googlegroups.com.


Re: [sage-support] fails to get graph_editor() to work

2020-09-01 Thread pong
Downgraded to ipycancas 0.4.7.

It works for me now. Many thanks to both of you.

On Monday, August 31, 2020 at 7:15:14 AM UTC-7 Jean-Florent Raymond wrote:

> Actually the problem came from ipycanvas
> (https://github.com/martinRenou/ipycanvas/issues/117 ) and not sage.
> Downgrading to version 0.4.7 ( sage -pip install ipycanvas==0.4.7 )
> solved the problem.
>
> Le 31/08/2020 à 09:50, Dima Pasechnik a écrit :
> > On Mon, 31 Aug 2020, 08:29 Jean-Florent Raymond, 
> > wrote:
> > 
> >> Thanks for reporting this.
> >> On my machine it works with the version of sage I was using at the
> >> beginning of summer (version 9.2.beta1, release date: 2020-06-13) but
> >> fails when I compile the latest version from develop.
> >> I will investigate and try to fix this problem.
> >>
> > 
> > a bunch of Jupyter-related packages has been updated since.
> > 
> >>
> >>
> >> Le 31/08/2020 à 00:15, pong a écrit :
> >>> Thanks, sage --python setup.py install works for me as well!
> >>>
> >>> However, when I try the code in the README
> >>>
> >>> from phitigra import EditableGraph
> >>> eg = EditableGraph(graphs.RandomGNP(10, 0.5))
> >>> eg.show()
> >>>
> >>> It gives a static picture of a graph. But I can't click to create new
> >> nodes
> >>> nor drag any node with a mouse.
> >>> On Sunday, August 30, 2020 at 2:13:55 PM UTC-7 dim...@gmail.com wrote:
> >>>
> >>>> On Sun, Aug 30, 2020 at 10:03 PM pong  wrote:
> >>>>>
> >>>>> Hi Jean-Florent,
> >>>>>
> >>>>> I did exactly just that (see attachment) but it complains about the
> >> need
> >>>> of at least one requirement to install.
> >>>>> Please advise.
> >>>>
> >>>> how about just doing
> >>>>
> >>>> sage --python setup.py install
> >>>>
> >>>> in the root directory of phitigra ?
> >>>> it works for me.
> >>>>>
> >>>>> On Sunday, August 30, 2020 at 12:25:11 AM UTC-7 Jean-Florent Raymond
> >>>> wrote:
> >>>>>>
> >>>>>> Hello,
> >>>>>>
> >>>>>> Yes, the directory where to run
> >>>>>> sage -pip install --upgrade --no-index -v .
> >>>>>> is the directory of the just cloned project (default: phitigra).
> >>>>>> There is no need to add 'phitigra' to the command line: pip will 
> guess
> >>>>>> alone what to install from this directory.
> >>>>>>
> >>>>>> Jean-Florent.
> >>>>>>
> >>>>>> Le 30/08/2020 à 02:35, pong a écrit :
> >>>>>>> Thanks you. I clone the project but confused what to do next. In 
> the
> >>>>>>> README, it saids
> >>>>>>>
> >>>>>>> Change to the root directory and run:
> >>>>>>> $ sage -pip install --upgrade --no-index -v .
> >>>>>>>
> >>>>>>> which root directory are we talking about? the phitigra directory?
> >>>>>>> Also should it be sage -pip install phitigra --upgrade -no-index 
> -v?
> >>>>>>>
> >>>>>>> In any case, I couldn't get it install so I must be doing something
> >>>> wrong.
> >>>>>>> Please help.
> >>>>>>>
> >>>>>>> On Saturday, August 29, 2020 at 2:11:12 AM UTC-7 Jean-Florent
> >> Raymond
> >>>> wrote:
> >>>>>>>
> >>>>>>>> Hello,
> >>>>>>>>
> >>>>>>>> I recently started developing a replacement to graph_editor for 
> the
> >>>>>>>> jupyter notebook, using ipywidgets and ipycanvas.
> >>>>>>>> You can find it at the following address :
> >>>>>>>> https://gitlab.limos.fr/jfraymon/phitigra
> >>>>>>>>
> >>>>>>>> This is still work in progress but the basic editor (adding 
> removing
> >>>>>>>> vertices and edges, displaying the graph, etc.) works.
> >>>>>>>> One feature that this editor will have is that changes made to the
> >>>> graph
> >>>>>>>> ou

Re: [sage-support] fails to get graph_editor() to work

2020-08-30 Thread pong
Thanks, sage --python setup.py install works for me as well!

However, when I try the code in the README

from phitigra import EditableGraph 
eg = EditableGraph(graphs.RandomGNP(10, 0.5)) 
eg.show()

It gives a static picture of a graph. But I can't click to create new nodes 
nor drag any node with a mouse.
On Sunday, August 30, 2020 at 2:13:55 PM UTC-7 dim...@gmail.com wrote:

> On Sun, Aug 30, 2020 at 10:03 PM pong  wrote:
> >
> > Hi Jean-Florent,
> >
> > I did exactly just that (see attachment) but it complains about the need 
> of at least one requirement to install.
> > Please advise.
>
> how about just doing
>
> sage --python setup.py install
>
> in the root directory of phitigra ?
> it works for me.
> >
> > On Sunday, August 30, 2020 at 12:25:11 AM UTC-7 Jean-Florent Raymond 
> wrote:
> >>
> >> Hello,
> >>
> >> Yes, the directory where to run
> >> sage -pip install --upgrade --no-index -v .
> >> is the directory of the just cloned project (default: phitigra).
> >> There is no need to add 'phitigra' to the command line: pip will guess
> >> alone what to install from this directory.
> >>
> >> Jean-Florent.
> >>
> >> Le 30/08/2020 à 02:35, pong a écrit :
> >> > Thanks you. I clone the project but confused what to do next. In the
> >> > README, it saids
> >> >
> >> > Change to the root directory and run:
> >> > $ sage -pip install --upgrade --no-index -v .
> >> >
> >> > which root directory are we talking about? the phitigra directory?
> >> > Also should it be sage -pip install phitigra --upgrade -no-index -v?
> >> >
> >> > In any case, I couldn't get it install so I must be doing something 
> wrong.
> >> > Please help.
> >> >
> >> > On Saturday, August 29, 2020 at 2:11:12 AM UTC-7 Jean-Florent Raymond 
> wrote:
> >> >
> >> >> Hello,
> >> >>
> >> >> I recently started developing a replacement to graph_editor for the
> >> >> jupyter notebook, using ipywidgets and ipycanvas.
> >> >> You can find it at the following address :
> >> >> https://gitlab.limos.fr/jfraymon/phitigra
> >> >>
> >> >> This is still work in progress but the basic editor (adding removing
> >> >> vertices and edges, displaying the graph, etc.) works.
> >> >> One feature that this editor will have is that changes made to the 
> graph
> >> >> outside of the editor will be automatically updated in the editor. 
> This
> >> >> will for instance allow to display step by step the computation done 
> by
> >> >> a function (for teaching, or debugging, or ...).
> >> >>
> >> >> Any feedback is welcome.
> >> >>
> >> >> Jean-Florent.
> >> >>
> >> >> Le 29/08/2020 à 08:27, pong a écrit :
> >> >>> I see. Is there a substitute for graph_editor()? It's fairly 
> convenient.
> >> >>>
> >> >>> On Thursday, August 27, 2020 at 8:48:32 AM UTC-7 dim...@gmail.com 
> wrote:
> >> >>>
> >> >>>> On Thu, Aug 27, 2020 at 4:45 PM pong  wrote:
> >> >>>>
> >> >>>>>
> >> >>>>> Running sagemath 9.1 from a jupyter notebook
> >> >>>>>
> >> >>>>> When calling graph_editor() got the following error message.
> >> >>>>> How can I make the module 'sagenb' works again?
> >> >>>>>
> >> >>>>
> >> >>>> sagenb does not work with Python 3. You'd need Sage 9.1 (or 
> earlier)
> >> >> built
> >> >>>> with Python2 in order to be able to use sagenb.
> >> >>>>
> >> >>>> And sagenb will be definitely gone in 9.2, which won't support 
> Python 2.
> >> >>>>
> >> >>>> HTH
> >> >>>> Dima
> >> >>>>
> >> >>>>>
> >> >>>>> [image: ge.png]
> >> >>>>>
> >> >>>>> --
> >> >>>>> 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 view this discussion on the web visit
> >> >>>>>
> >> >> 
> https://groups.google.com/d/msgid/sage-support/772c9f8f-e27f-4485-8add-ca97d51290bbn%40googlegroups.com
> >> >>>>> <
> >> >> 
> https://groups.google.com/d/msgid/sage-support/772c9f8f-e27f-4485-8add-ca97d51290bbn%40googlegroups.com?utm_medium=email_source=footer
> >> >>>
> >> >>>>> .
> >> >>>>>
> >> >>>>
> >> >>>
> >> >>
> >> >
> >
> > --
> > 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/6a7f10e2-83c7-470d-91c2-4cd3d9f7bd6cn%40googlegroups.com
> .
>

-- 
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/4fbac570-106a-4bee-99ee-8b53b4d09dc5n%40googlegroups.com.


Re: [sage-support] fails to get graph_editor() to work

2020-08-29 Thread pong
Thanks you. I clone the project but confused what to do next. In the 
README, it saids

Change to the root directory and run:
$ sage -pip install --upgrade --no-index -v .

which root directory are we talking about? the phitigra directory?
Also should it be sage -pip install phitigra --upgrade -no-index -v?

In any case, I couldn't get it install so I must be doing something wrong. 
Please help.

On Saturday, August 29, 2020 at 2:11:12 AM UTC-7 Jean-Florent Raymond wrote:

> Hello,
>
> I recently started developing a replacement to graph_editor for the
> jupyter notebook, using ipywidgets and ipycanvas.
> You can find it at the following address :
> https://gitlab.limos.fr/jfraymon/phitigra
>
> This is still work in progress but the basic editor (adding removing
> vertices and edges, displaying the graph, etc.) works.
> One feature that this editor will have is that changes made to the graph
> outside of the editor will be automatically updated in the editor. This
> will for instance allow to display step by step the computation done by
> a function (for teaching, or debugging, or ...).
>
> Any feedback is welcome.
>
> Jean-Florent.
>
> Le 29/08/2020 à 08:27, pong a écrit :
> > I see. Is there a substitute for graph_editor()? It's fairly convenient.
> > 
> > On Thursday, August 27, 2020 at 8:48:32 AM UTC-7 dim...@gmail.com wrote:
> > 
> >> On Thu, Aug 27, 2020 at 4:45 PM pong  wrote:
> >>
> >>>
> >>> Running sagemath 9.1 from a jupyter notebook
> >>>
> >>> When calling graph_editor() got the following error message.
> >>> How can I make the module 'sagenb' works again?
> >>>
> >>
> >> sagenb does not work with Python 3. You'd need Sage 9.1 (or earlier) 
> built 
> >> with Python2 in order to be able to use sagenb.
> >>
> >> And sagenb will be definitely gone in 9.2, which won't support Python 2.
> >>
> >> HTH
> >> Dima
> >>
> >>>
> >>> [image: ge.png]
> >>>
> >>> -- 
> >>> 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 view this discussion on the web visit 
> >>> 
> https://groups.google.com/d/msgid/sage-support/772c9f8f-e27f-4485-8add-ca97d51290bbn%40googlegroups.com
>  
> >>> <
> https://groups.google.com/d/msgid/sage-support/772c9f8f-e27f-4485-8add-ca97d51290bbn%40googlegroups.com?utm_medium=email_source=footer
> >
> >>> .
> >>>
> >>
> > 
>

-- 
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/8f70e0c4-4f69-4824-a1c1-85b35a4dccc0n%40googlegroups.com.


Re: [sage-support] fails to get graph_editor() to work

2020-08-29 Thread pong
I see. Is there a substitute for graph_editor()? It's fairly convenient.

On Thursday, August 27, 2020 at 8:48:32 AM UTC-7 dim...@gmail.com wrote:

> On Thu, Aug 27, 2020 at 4:45 PM pong  wrote:
>
>>
>> Running sagemath 9.1 from a jupyter notebook
>>
>> When calling graph_editor() got the following error message.
>> How can I make the module 'sagenb' works again?
>>
>
> sagenb does not work with Python 3. You'd need Sage 9.1 (or earlier) built 
> with Python2 in order to be able to use sagenb.
>
> And sagenb will be definitely gone in 9.2, which won't support Python 2.
>
> HTH
> Dima
>
>>
>> [image: ge.png]
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-support/772c9f8f-e27f-4485-8add-ca97d51290bbn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/sage-support/772c9f8f-e27f-4485-8add-ca97d51290bbn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/eb007bc8-427d-4728-a0a1-f916dbeeb09an%40googlegroups.com.


[sage-support] fails to get graph_editor() to work

2020-08-27 Thread pong

Running sagemath 9.1 from a jupyter notebook

When calling graph_editor() got the following error message.
How can I make the module 'sagenb' works again?

[image: ge.png]

-- 
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/772c9f8f-e27f-4485-8add-ca97d51290bbn%40googlegroups.com.


Re: [sage-support] Sage 9.1 Debian 9 (Buster) binaries not available?

2020-05-30 Thread pong
Just want to add here that I get sage 9.1 for now by installing the binary 
for Debian 8 (Jessie) on a Debian 9 system (in fact on a Devuan ASCII which 
is based on Debian 9).
Besides some deprecated warnings in the first run, things seem to be fine 
so far. 

I tried to install the binaries for Debian 10 but got errors for not having 
a version of libc6 that is recent enough. (which is not surprising).

I do hope the binaries for Debian 9 and one for Ubuntu 20.04 will be 
available soon.

On Friday, May 29, 2020 at 10:48:54 AM UTC-7, Dima Pasechnik wrote:
>
> On Fri, May 29, 2020 at 6:07 PM pong > 
> wrote: 
> > 
> > I am looking for the binaries of Sage 9.1 for Debian Buster but it's 
> notably missing from the download list. Will it be there any time soon? 
>
> they are there - note that Buster is Debian 10: 
> e.g. I see 
>
>
> http://www.mirrorservice.org/sites/www.sagemath.org/linux/64bit/sage-9.1-Debian_GNU_Linux_10-x86_64.tar.bz2
>  
>
> HTH 
> Dima 
> > 
> > Thanks 
> > 
> > -- 
> > 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-s...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/0401f6d9-bab7-49a8-8b17-2cd9dd0a2e32%40googlegroups.com.
>  
>
>

-- 
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/afadba6d-f61b-4bd7-9138-17d1187b9c6b%40googlegroups.com.


Re: [sage-support] Sage 9.1 Debian 9 (Buster) binaries not available?

2020-05-29 Thread Wai Yan Pong
 Thanks for the reply. Sorry for the mix up on the codename.

I am looking sage 9.1 binaries for Debian 9 (Stretch).The latest that I can
see is for sage 9.0.

On Fri, May 29, 2020 at 10:48 AM Dima Pasechnik  wrote:

> On Fri, May 29, 2020 at 6:07 PM pong  wrote:
> >
> > I am looking for the binaries of Sage 9.1 for Debian Buster but it's
> notably missing from the download list. Will it be there any time soon?
>
> they are there - note that Buster is Debian 10:
> e.g. I see
>
>
> http://www.mirrorservice.org/sites/www.sagemath.org/linux/64bit/sage-9.1-Debian_GNU_Linux_10-x86_64.tar.bz2
>
> HTH
> Dima
> >
> > Thanks
> >
> > --
> > 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/0401f6d9-bab7-49a8-8b17-2cd9dd0a2e32%40googlegroups.com
> .
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-support/a_P0NIiM8jA/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAAWYfq19POrsqMqm8cng8XrrrfVpKD-XgEQ7Hwsfu2CYJsRxVw%40mail.gmail.com
> .
>

-- 
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/CAE7ST__9q_W4g5U4V%2BARuo4Oa-csnjCfUbq-Kv16Ag9rXCwm%2Bw%40mail.gmail.com.


[sage-support] Sage 9.1 Debian 9 (Buster) binaries not available?

2020-05-29 Thread pong
I am looking for the binaries of Sage 9.1 for Debian Buster but it's 
notably missing from the download list. Will it be there any time soon?

Thanks

-- 
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/0401f6d9-bab7-49a8-8b17-2cd9dd0a2e32%40googlegroups.com.


Re: [sage-support] How to go from .sage to .pyc?

2019-10-16 Thread pong
That's exactly what I want (hiding sources codes from users). 

I'm teaching a class where the students need to implement some algorithms 
on graphs but I would like to distribute those functions in advance so that 
they can play with it and see what's the expected output before writing 
their owns. 

So how can I save those pyc files generated by sage separately and have 
them run inside a session?
Thanks in advance


On Wednesday, October 16, 2019 at 12:02:00 PM UTC-7, Dima Pasechnik wrote:
>
> On Wed, Oct 16, 2019 at 6:18 PM pong > 
> wrote: 
> > 
> > I have a bunch of old scripts in .sage files. They were compiled into 
> .pyc files years ago. 
>
> *.sage files are preparsed by sage preparser, and converted into *.py 
> files. 
> Conversion into *.pyc files is done automatically, as *.py files are 
> loaded into Sage's Python interpreter. 
>
> One cannot load() or attach() *.pyc files, as far as I know - but why 
> would you need this? 
> (unless you want to hide the source of your *.sage scripts from the user) 
>
> HTH 
> Dima 
>
> > 
> > Unfortunately, I only remember that I ran sage --preparse on the .sage 
> files and got them into .py files but forgot what next. 
> > 
> > I tried import py_compile in sage then ran py_compile.compile('xxx.py') 
> which gave me a .pyc file but I couldn't load it or attach it to sage. 
> > 
> > I understand one can change the file extension to .spyx and have sage to 
> compile it by loading it into a session but I would like the pyc files by 
> themselves. 
> > 
> > Can I get some help on this? 
> > 
> > -- 
> > 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-s...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/f28af744-043a-4100-b965-ce5642887512%40googlegroups.com.
>  
>
>

-- 
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/50e388e8-49e4-41f7-b042-708700c3e653%40googlegroups.com.


[sage-support] How to go from .sage to .pyc?

2019-10-16 Thread pong
I have a bunch of old scripts in .sage files. They were compiled into .pyc 
files years ago.

Unfortunately, I only remember that I ran sage --preparse on the .sage 
files and got them into .py files but forgot what next.

I tried import py_compile in sage then ran py_compile.compile('xxx.py') 
which gave me a .pyc file but I couldn't load it or attach it to sage.

I understand one can change the file extension to .spyx and have sage to 
compile it by loading it into a session but I would like the pyc files by 
themselves. 

Can I get some help on this? 

-- 
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/f28af744-043a-4100-b965-ce5642887512%40googlegroups.com.


[sage-support] Complete Graph on two vertices

2018-08-13 Thread pong
On SAGE 8.2

graphs.CompleteGraph(2).show() 

returns a diagram of two isolated points. Anyone can reproduce the same 
issue?

Yet, graphs.CompleteGraph(2).edges() does return [(0, 1, None)]

-- 
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] Re: sag-7.2 fails to build on Arch linux

2016-06-27 Thread pong
Now I think it is related to the LinBox header but I don't know enough to 
understand the hint given by leif in this post 
<https://groups.google.com/d/msg/sage-release/h-Sk_2q8YSg/gKV3HBymBgAJ>:

"So far I've successfully built Sage 7.2 with GCC 6.1 and the above 
changes, except for some Sage library modules which include LinBox 
headers, and hence have to be built with '-std=gnu++98', too." 

How do I build those headers with '-std=gnu++98'?


On Monday, June 27, 2016 at 6:57:09 AM UTC-7, pong wrote:
>
> I aware of the problem of Singular and set CXXFLAGS to -std=gnu++98. The 
> compliation got pass Singular all the way to almost the end, but giving me 
> the follow. I'm not even sure which package(s) it is complaning (sagelib?). 
> And it doesn't indicate a log file to look at... 
> Any help? 
>
>
> /home/pong/sage-7.2/src/build/cythonized/sage/matrix/matrix_modn_dense_double.cpp:
>  
> In function ‘PyObject* 
> __pyx_f_4sage_6matrix_24matrix_modn_dense_double_linbox_charpoly(__pyx_t_4sage_6matrix_24matrix_modn_dense_double_celement,
>  
> Py_ssize_t, __pyx_t_4sage_6matrix_24matrix_modn_dense_double_celement*)’:
> /home/pong/sage-7.2/src/build/cythonized/sage/matrix/matrix_modn_dense_double.cpp:5465:35:
>  
> warning: comparison between
> signed and unsigned integer expressions [-Wsign-compare]
>  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
>  ~~^~~
> make[2]: *** [Makefile:953: sagelib] Error 2
> make[2]: Leaving directory '/home/pong/sage-7.2/build/make'
> make[1]: *** [Makefile:826: all] Error 2
> make[1]: Leaving directory '/home/pong/sage-7.2/build/make'
>
> real147m20.451s
> user140m41.229s
> sys 5m47.893s
> ***
> Error building Sage.
>
> The following package(s) may have failed to build (not necessarily
> during this run of 'make all'):
>
> The build directory may contain configuration files and other potentially
> helpful information. WARNING: if you now run 'make' again, the build
> directory will, by default, be deleted. Set the environment variable
> SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.
>
> make: *** [Makefile:18: all] 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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] sag-7.2 fails to build on Arch linux

2016-06-27 Thread pong
I aware of the problem of Singular and set CXXFLAGS to -std=gnu++98. The 
compliation got pass Singular all the way to almost the end, but giving me 
the follow. I'm not even sure which package(s) it is complaning (sagelib?). 
And it doesn't indicate a log file to look at... 
Any help? 


/home/pong/sage-7.2/src/build/cythonized/sage/matrix/matrix_modn_dense_double.cpp:
 
In function ‘PyObject* 
__pyx_f_4sage_6matrix_24matrix_modn_dense_double_linbox_charpoly(__pyx_t_4sage_6matrix_24matrix_modn_dense_double_celement,
 
Py_ssize_t, __pyx_t_4sage_6matrix_24matrix_modn_dense_double_celement*)’:
/home/pong/sage-7.2/src/build/cythonized/sage/matrix/matrix_modn_dense_double.cpp:5465:35:
 
warning: comparison between
signed and unsigned integer expressions [-Wsign-compare]
 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
 ~~^~~
make[2]: *** [Makefile:953: sagelib] Error 2
make[2]: Leaving directory '/home/pong/sage-7.2/build/make'
make[1]: *** [Makefile:826: all] Error 2
make[1]: Leaving directory '/home/pong/sage-7.2/build/make'

real147m20.451s
user140m41.229s
sys 5m47.893s
***
Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make all'):

The build directory may contain configuration files and other potentially
helpful information. WARNING: if you now run 'make' again, the build
directory will, by default, be deleted. Set the environment variable
SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.

make: *** [Makefile:18: all] 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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Sage Crash Report

2015-01-11 Thread pong
Thanks. I was using the pre-complied version from an Arch linux repository. 
I noticed the different in the last upgrade. 
Perhaps the issue has been fixed but I have not tried that since I decided 
to download the source files and complied sage on my system. 
It works for me that way.

On Wednesday, January 7, 2015 at 2:44:35 AM UTC-8, Jeroen Demeyer wrote:

 On 2015-01-07 00:32, Wai Yan Pong wrote: 
  Hello, 
  
   I'm unable to have Sage 6.4.1 running. My ipython2 seems running 
  fine. Attached is the Crash Report. 

 It seems that you're trying to run Sage with your system Python/IPython 
 installation. This isn't really supported. 

 How did you download/compile/run 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/d/optout.


[sage-support] Sage Crash Report

2015-01-06 Thread Wai Yan Pong
Hello,

I'm unable to have Sage 6.4.1 running. My ipython2 seems running fine.
Attached is the Crash Report.

Thanks in advance,
Pong

-- 
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/d/optout.
***

IPython post-mortem report

{'codename': 'An Afternoon Hack',
 'commit_hash': '7c2ea3a',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': 
'/usr/lib/python2.7/site-packages/ipython-1.1.0-py2.7.egg/IPython',
 'ipython_version': '1.1.0',
 'os_name': 'posix',
 'platform': 'Linux-3.17.6-1-ARCH-x86_64-with-glibc2.2.5',
 'sys_executable': '/usr/bin/python2',
 'sys_platform': 'linux2',
 'sys_version': '2.7.9 (default, Dec 11 2014, 04:42:00) \n[GCC 4.9.2]'}

***



***

Crash traceback:

---
ImportError  Python 2.7.9: /usr/bin/python2
   Tue Jan  6 15:31:22 2015
A problem occured executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/usr/bin/sage-ipython in module()
  1 #!/usr/bin/env python2
  2 # -*- coding: utf-8 -*-
  3 
  4 Sage IPython startup script.
  5 
  6 from sage.repl.interpreter import SageTerminalApp
  7 
  8 # installs the extra readline commands before the IPython 
initialization begins.
  9 from sage.repl.readline_extra_commands import *
 10 
 11 app = SageTerminalApp.instance()
--- 12 app.initialize()
global app.initialize = bound method SageTerminalApp.initialize of 
sage.repl.interpreter.SageTerminalApp object at 0x7fbe1a342610
 13 app.start()

/usr/lib/python2.7/site-packages/ipython-1.1.0-py2.7.egg/IPython/terminal/ipapp.pyc
 in initialize(self=sage.repl.interpreter.SageTerminalApp object, argv=None)

/usr/lib/python2.7/site-packages/ipython-1.1.0-py2.7.egg/IPython/config/application.pyc
 in catch_config_error(method=function initialize, 
app=sage.repl.interpreter.SageTerminalApp object, *args=(None,), **kwargs={})
 74 
 75 
#-
 76 # Application class
 77 
#-
 78 
 79 @decorator
 80 def catch_config_error(method, app, *args, **kwargs):
 81 Method decorator for catching invalid config 
(Trait/ArgumentErrors) during init.
 82 
 83 On a TraitError (generally caused by bad config), this will print 
the trait's
 84 message, and exit the app.
 85 
 86 For use on init methods, to prevent invoking excepthook on invalid 
input.
 87 
 88 try:
--- 89 return method(app, *args, **kwargs)
method = function initialize at 0x7fbe1a32f230
app = sage.repl.interpreter.SageTerminalApp object at 0x7fbe1a342610
args = (None,)
kwargs = {}
 90 except (TraitError, ArgumentError) as e:
 91 app.print_help()
 92 app.log.fatal(Bad config encountered during initialization:)
 93 app.log.fatal(str(e))
 94 app.log.debug(Config at the time: %s, app.config)
 95 app.exit(1)
 96 
 97 
 98 class ApplicationError(Exception):
 99 pass
100 
101 class LevelFormatter(logging.Formatter):
102 Formatter with additional `highlevel` record
103 
104 This field is empty if log level is less than highlevel_limit,

/usr/lib/python2.7/site-packages/ipython-1.1.0-py2.7.egg/IPython/terminal/ipapp.pyc
 in initialize(self=sage.repl.interpreter.SageTerminalApp object, argv=None)
308 
309 @catch_config_error
310 def initialize(self, argv=None):
311 Do actions after construct, but before starting the app.
312 super(TerminalIPythonApp, self).initialize(argv)
313 if self.subapp is not None:
314 # don't bother initializing further, starting subapp
315 return
316 if not self.ignore_old_config:
317 check_for_old_config(self.ipython_dir)
318 # print self.extra_args
319 if self.extra_args and not self.something_to_run:
320 self.file_to_run = self.extra_args[0]
321 self.init_path()
322 # create the shell

[sage-support] Span of Matrices

2014-04-04 Thread pong
I want to form the span of a finite sequence of matrices (in the matrix 
space).

I tried:
M = MatrixSpace(QQ,4)
span([M(range(16)), M(range(2,18))])

But sage returns:


TypeError: The base_ring (= [ 2  3  4  5]
[ 6  7  8  9]
[10 11 12 13]
[14 15 16 17]) must be a principal ideal domain.

What should be the correct way to generate the span in this case?

-- 
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/d/optout.


Re: [sage-support] Re: sageplot seems broken with sage 5.12

2013-11-12 Thread Wai Yan Pong
Thank you for all the replies. I tried saving some plots as pdf on my
system Matplotlib (1.3.1), it seems to work. If, as William said, it's a
problem of Matplotlib, can someone reproduce that error? And report the bug
upstream? I know very little about Matplotlib to be honest.

Meanwhile, is there any work around? I'm in the middle of writing a graph
theory test... many of you can imagine how frustrated if sageplot does not
work.


On Mon, Nov 11, 2013 at 7:06 PM, William Stein wst...@gmail.com wrote:

 On Mon, Nov 11, 2013 at 5:25 PM, kcrisman kcris...@gmail.com wrote:
  Hi Pong,
 
  Huh, that is weird.I wonder if perhaps the syntax/meaning of graph
  plotting changed somewhat recently? At any rate I can confirm the same
  problem.  It does seem to work at the command line.

 No it doesn't.  This is just a straight bug in Sage (more precisely,
 in Matplotlib I think) which sagetex reveals.  As Pong points out, it
 has nothing to do with sagetex itself.  Try this:

 L = {0:[1,2,5,6], 1:[2,4,6], 3:[2,4,5,6], 4:[2,5], 5:[6]};
 G = Graph(L)
 p = G.plot()
 p.save('a.pdf')

 # BOOM!

  -- william

 
 
  On Monday, November 11, 2013 3:34:40 PM UTC-5, pong wrote:
 
  I have just re-run on an old latex file which uses sageplot. It seems to
  be broken.
 
  However, the exact same codes (which I attached) work with sage 5.9 on
  another machine.
 
  The problem does not seem to be coming from sagetex.sty since they are
  exactly the same on both machines.
 
  Any fix or get around to the problem?
 
 
 
 -
  Processing Sage code for testplot.tex...
  Code block begin...end
  Initializing plots directory
  Plot 0
   Error in Sage code on line 10 of testplot.tex! Traceback follows.
  Traceback (most recent call last):
File testplot.sagetex.py, line 15, in module
  _st_.plot(_sage_const_0 , format='notprovided',
  _p_=G.plot(),figsize=[_sage_const_3 ,_sage_const_3 ])
File /opt/sage/local/lib/python2.7/site-packages/sagetex.py, line
 252,
  in plot
  _p_.save(filename=plotfilename, **kwargs)
File
  /opt/sage/local/lib/python2.7/site-packages/sage/misc/decorators.py,
 line
  458, in wrapper
  return func(*args, **kwds)
File
  /opt/sage/local/lib/python2.7/site-packages/sage/plot/graphics.py,
 line
  2732, in save
  transparent=transparent)
File
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/figure.py,
  line 1370, in savefig
  self.canvas.print_figure(*args, **kwargs)
File
 
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/backend_bases.py,
  line 2055, in print_figure
  **kwargs)
File
 
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/backend_bases.py,
  line 1848, in print_pdf
  return pdf.print_pdf(*args, **kwargs)
File
 
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py,
  line 2301, in print_pdf
  self.figure.draw(renderer)
File
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/artist.py,
  line 54, in draw_wrapper
  draw(artist, renderer, *args, **kwargs)
File
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/figure.py,
  line 1006, in draw
  func(*args)
File
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/artist.py,
  line 54, in draw_wrapper
  draw(artist, renderer, *args, **kwargs)
File /opt/sage/local/lib/python2.7/site-packages/matplotlib/axes.py,
  line 2086, in draw
  a.draw(renderer)
File
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/artist.py,
  line 54, in draw_wrapper
  draw(artist, renderer, *args, **kwargs)
File
  /opt/sage/local/lib/python2.7/site-packages/matplotlib/collections.py,
  line 695, in draw
  return Collection.draw(self, renderer)
File
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/artist.py,
  line 54, in draw_wrapper
  draw(artist, renderer, *args, **kwargs)
File
  /opt/sage/local/lib/python2.7/site-packages/matplotlib/collections.py,
  line 259, in draw
  self._offset_position)
File
 
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py,
  line 1548, in draw_path_collection
  output(*self.gc.pop())
File
 
 /opt/sage/local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py,
  line 2093, in pop
  assert self.parent is not None
  AssertionError
   Running Sage on testplot.sage failed! Fix testplot.tex and try
 again.
 
  --
  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] sageplot seems broken with sage 5.12

2013-11-11 Thread pong
I have just re-run on an old latex file which uses sageplot. It seems to be 
broken.

However, the exact same codes (which I attached) work with sage 5.9 on 
another machine.

The problem does not seem to be coming from sagetex.sty since they are 
exactly the same on both machines.

Any fix or get around to the problem?

-
Processing Sage code for testplot.tex...
Code block begin...end
Initializing plots directory
Plot 0
 Error in Sage code on line 10 of testplot.tex! Traceback follows.
Traceback (most recent call last):
  File testplot.sagetex.py, line 15, in module
_st_.plot(_sage_const_0 , format='notprovided', 
_p_=G.plot(),figsize=[_sage_const_3 ,_sage_const_3 ])
  File /opt/sage/local/lib/python2.7/site-packages/sagetex.py, line 252, 
in plot
_p_.save(filename=plotfilename, **kwargs)
  File 
/opt/sage/local/lib/python2.7/site-packages/sage/misc/decorators.py, line 
458, in wrapper
return func(*args, **kwds)
  File /opt/sage/local/lib/python2.7/site-packages/sage/plot/graphics.py, 
line 2732, in save
transparent=transparent)
  File /opt/sage/local/lib/python2.7/site-packages/matplotlib/figure.py, 
line 1370, in savefig
self.canvas.print_figure(*args, **kwargs)
  File 
/opt/sage/local/lib/python2.7/site-packages/matplotlib/backend_bases.py, 
line 2055, in print_figure
**kwargs)
  File 
/opt/sage/local/lib/python2.7/site-packages/matplotlib/backend_bases.py, 
line 1848, in print_pdf
return pdf.print_pdf(*args, **kwargs)
  File 
/opt/sage/local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py,
 
line 2301, in print_pdf
self.figure.draw(renderer)
  File /opt/sage/local/lib/python2.7/site-packages/matplotlib/artist.py, 
line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File /opt/sage/local/lib/python2.7/site-packages/matplotlib/figure.py, 
line 1006, in draw
func(*args)
  File /opt/sage/local/lib/python2.7/site-packages/matplotlib/artist.py, 
line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File /opt/sage/local/lib/python2.7/site-packages/matplotlib/axes.py, 
line 2086, in draw
a.draw(renderer)
  File /opt/sage/local/lib/python2.7/site-packages/matplotlib/artist.py, 
line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
/opt/sage/local/lib/python2.7/site-packages/matplotlib/collections.py, 
line 695, in draw
return Collection.draw(self, renderer)
  File /opt/sage/local/lib/python2.7/site-packages/matplotlib/artist.py, 
line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File 
/opt/sage/local/lib/python2.7/site-packages/matplotlib/collections.py, 
line 259, in draw
self._offset_position)
  File 
/opt/sage/local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py,
 
line 1548, in draw_path_collection
output(*self.gc.pop())
  File 
/opt/sage/local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py,
 
line 2093, in pop
assert self.parent is not None
AssertionError
 Running Sage on testplot.sage failed! Fix testplot.tex and try again.

-- 
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.
\documentclass{article}
\usepackage{sagetex}
\begin{document}
\begin{sagesilent}
  L = {0:[1,2,5,6], 1:[2,4,6], 3:[2,4,5,6], 4:[2,5], 5:[6]};
  G = Graph(L)
\end{sagesilent}

\[
  \sageplot{G.plot(),figsize=[3,3]}
\]
\end{document}


[sage-support] lower case alphabetic strings

2013-05-30 Thread pong
I would like to generate a list of alphabets much like what 
AlphabeticStrings() does but in lower case. 
What would be the fastest way to achieve that in 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] problems with mpir in upgrading to Sage 5.9

2013-05-05 Thread pong


On Sunday, May 5, 2013 1:46:12 PM UTC-7, Jeroen Demeyer wrote:

 Try removing the existing compilers from Sage: 

 $ cd $SAGE_ROOT/local/bin 
 $ rm gcc g++ gfortran 

 and try again. 


Thanks for the suggestion. Well, I need a working copy of sage for the next 
week or so. I probably will come back to this afterwards.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] problems with mpir in upgrading to Sage 5.9

2013-05-04 Thread pong
Sage complains with when building the package mpir-2.6.0.p2. I broswed 
through the logs and it looks like complains about the complier which the 
one my sage using is gcc-4.6.3 (I think). 

I think it might be a similar to the one that I had in upgrading to sage 
5.7: 
http://trac.sagemath.org/sage_trac/ticket/14201 

So I tried sage -f gcc-4.7.2.p1.spkg. 

Resulted also in an error:
checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: in 
`/home/pong/sage-current/spkg/build/gcc-4.7.2.p1/gcc-build':
configure: error: C compiler cannot create executables
See `config.log' for more details.

Looks like I can't fix this again, so hopefully someone can help me out 
here.
I attached the two log files. 

Thanks in advance

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




gcc-4.7.2.p1.log
Description: Binary data


mpir-2.6.0.p2.log
Description: Binary data


[sage-support] Re: Potential Bug in show() for graphs.

2013-04-01 Thread pong
Hum... G is bipartite but its complement H is not... 


On Monday, April 1, 2013 2:26:12 AM UTC-7, Jason Grout wrote:

 On 3/31/13 9:29 PM, pong wrote: 
  G = graphs.CompleteBipartiteGraph(3,3); H=G.complement(); H.show() 

 The problem here is that the CompleteBipartiteGraph has a specific 
 layout that makes the edges of the complement overlap.  When you do 
 H.show, specify a layout that will separate those edges: 

 H.show(layout='circular') 

 Thanks, 

 Jason 




-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Potential Bug in show() for graphs.

2013-03-31 Thread pong
Sage 5.8

G = graphs.CompleteBipartiteGraph(3,3); H=G.complement(); H.show()

instead of two triangles, one sees two chains each of length 2. However, 
H.edges() shows

[(0, 1, None), (0, 2, None), (1, 2, None), (3, 4, None), (3, 5, None),
(4, 5, None)]

which is the correct graph so perhaps something wrong with show()? If 
someone can confirm that, I will open a ticket.


-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: the way of displaying complex numbers in SAGE

2013-01-24 Thread pong


On Tuesday, January 22, 2013 9:28:25 PM UTC-8, pong wrote:

 I have two simply questions about displaying complex numbers in sage:

 1) Is there a good reason why the imaginary part of a complex number comes 
 before its real part in sage?
 e.g. sage: 1+i
I+1

 2) Is there a simple way to force the real part to appear before the 
 imaginary part?



Well, there is a function complex that will force a complex number to 
appear as real+imag*j, e.g. complex(1+2i) will give (1+2j). I wouldn't say 
this is exactly a simple way to solve qu 2, perhaps someone can tell us 
how to achieve that without typing complex all the time. Certainly, it is 
fine writing the imaginary part first (just like writing (y,x) for (x,y)) 
but it is not so nice when one is teaching a class where the students have 
seen complex numbers in their standard forn before. Afterall, if they are 
equivalent so why not adhere to the custom?

-- 
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] the way of displaying complex numbers in SAGE

2013-01-22 Thread pong
I have two simply questions about displaying complex numbers in sage:

1) Is there a good reason why the imaginary part of a complex number comes 
before its real part in sage?
e.g. sage: 1+i
   I+1

2) Is there a simple way to force the real part to appear before the 
imaginary part?


-- 
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] Re: sagetex difficulty

2012-12-16 Thread pong

@Dan, thanks a lot! That solves my problem.

On Saturday, December 15, 2012 1:05:49 PM UTC-8, Dan Drake wrote:

 On Sat, 15 Dec 2012 at 10:55AM -0800, pong wrote: 
  Hi Dan my intention is to generate tests using sagetex and sage. So I 
 will 
  have something like 
  
  m = 'undefined' if denom==0 else (y2-y1)/(x2-x1) 
  
  . 
  
  then print out m at some point. So $\sage{m}$ does not work is denom==0 
  but \sagestr{m} doesn't seem to work if denom0. 
  Any suggestion? 

 You'll have to push the use $ or not decision to the Sage level. Try 
 something like this: 


 \begin{sagesilent} 
   def f(x, y): 
   if y == 0: 
   return 'undefined' 
   else: 
   return '${0}$'.format(latex(x/y)) 
 \end{sagesilent} 

 abc \sagestr{f(1, 2)} def \sagestr{f(1, 0)} ghi 

 That may be a little unsatisfying, but it should work. You could also 
 make your typing a little easier with something like 

 \newcommand{\foo}[2]{\sagestr{f(#1,#2)}} 

 (With foo and f changed to something meaningful.) Then you do 
 \foo{1}{2} in your document and it's easier to understand. 

 Dan 

 -- 
 ---  Dan Drake 
 -  http://math.pugetsound.edu/~ddrake 
 --- 


-- 
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: sagetex difficulty

2012-12-15 Thread pong
I am having the same trouble as John. Would you expand a little bit on your 
solution:

for example
$\sage{'Hello'}$
causes an error. Where should I put the 'r' as suggested in your post (I 
think stands for raw string)? I tried several combination but nothing seems 
to work.
Btw, 'text' in sage take two arguments and is for 2D plot, isn't it?

On Sunday, June 24, 2012 1:46:28 AM UTC-7, Slumberland wrote:

 Your output looks different than mine when this happens, but I think it's 
 the same:

 there is still a Python text parser operating on your strings before Latex 
 can get to them.
   \nabla will give you \n newline, \tau will give you \t, etc.

 if you type an r before the quotes surrounding the string, e.g.
  text(r' now you may $\backslash$ until you can $\backslash$ no 
 more... uh... forever' )
 the line is read without escape codes.

 I found this information buried at the bottom of a documentation page, but 
 I think the real problem is that it is unnatural.  SAGE should not read 
 Python escape codes inside $'s.  As you've noticed from the error message, 
 SAGE doesn't even know it's still doing it. It thinks it's parsing LaTeX.

 Unless that's not what's happening to you!




-- 
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] Re: sagetex difficulty

2012-12-15 Thread pong

Hi Dan my intention is to generate tests using sagetex and sage. So I will 
have something like

m = 'undefined' if denom==0 else (y2-y1)/(x2-x1)

.

then print out m at some point. So $\sage{m}$ does not work is denom==0 but 
\sagestr{m} doesn't seem to work if denom0.
Any suggestion?

On Saturday, December 15, 2012 10:09:20 AM UTC-8, Dan Drake wrote:

 On Sat, 15 Dec 2012 at 02:45AM -0800, pong wrote: 
  I am having the same trouble as John. Would you expand a little bit on 
 your 
  solution: 
  
  for example 
  $\sage{'Hello'}$ 
  causes an error. Where should I put the 'r' as suggested in your post (I 
  think stands for raw string)? I tried several combination but nothing 
 seems 
  to work. 

 It causes an error because the \sage{} macro runs Sage's latex() 
 function on its argument, which in this case produces \verb|Hello|. 
 Then TeX gets unhappy because of the verbatim text inside a math 
 environment. 

 If you just want the string 'Hello' inserted into your document, use 
 \sagestr{}. Or, don't surround \sage{} with dollar signs. 

   SAGE should not read Python escape codes inside $'s. As you've 
   noticed from the error message, SAGE doesn't even know it's still 
   doing it. It thinks it's parsing LaTeX. 

 There is no (easy/reasonable) way for SageTeX to detect whether \sage{} 
 was called within a math environment, and in any case, altering Sage's 
 behavior with respect to Python string conventions would require a lot 
 of work in the preparser that (1) would be difficult, and (2) represent 
 a large deviation from standard Python behavior that almost no one would 
 think is reasonable. (That's what I think, at any rate...) 

 Also, as was pointed out, you can use raw strings to avoid that 
 behavior. TeX is completely oblivious to the difference between 
 \sage{r\nabla} and \sage{\nabla}, so you can always use the former 
 to get your intended behavior. 

 Dan 

 -- 
 ---  Dan Drake 
 -  http://math.pugetsound.edu/~ddrake 
 --- 


-- 
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] problem using sagetex with caption

2012-03-02 Thread pong
\begin{sagesilent}
  f = (x-1)^2/2 -1
\end{sagesilent}
\begin{figure}[h]
\[
\sageplot{plot(f, (x,-1,2), figsize=(3,3))}
\]
\caption{The graph of $\sage{f}$}
\end{figure}

produced ERROR: Argument of \@caption has an extra }.

Could it be a bug? Anyway to get around it?

-- 
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] error in upgrading SAGE to version 4.8

2012-02-28 Thread pong
I am trying to upgrade SAGE from 4.7.2 to 4.8 in my dept server by
simply running

./sage --upgrade

but ran into the following error:

---
sage/matrix/matrix_cyclo_dense.pyx -- /opt/sage-current/local/lib/
python2.6/site-packages//sage/matrix/matrix_cyclo_dense.pyx
python `which cython`  --disable-function-redefinition --embed-
positions --directive
cdivision=True,autotestdict=False,fast_getattr=True -I/opt/sage-
current/devel/sage-main -o sage/matrix/matrix_dense.c sage/matrix/
matrix_dense.pyx

Error compiling Cython file:

...
# allow lambda functions

if self._nrows==0 or self._ncols==0:
return self.__copy__()
v = [z.derivative(var) for z in self.list()]
if R is None:
^


sage/matrix/matrix_dense.pyx:428:13: local variable 'R' referenced
before assignment
Error running command, failed with status 256.
sage: There was an error installing modified sage library code.

There is a bunch of warnings about variables being referenced before
assignment earlier but did not cause a crash.

Any idea on how to fix this?

-- 
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] Jmol on Android tablet

2011-11-26 Thread pong
Two days ago during Thanksgiving dinner, I tried showing SAGE notebook
to my cousin who has an Android tablet. Well... I then realized that
Jmol (or rather Java runtime environment) is not supported on android
(at least not out of the box)

My questions are:

1) Has someone successfully run Jmol on an Android browser?

   There is a youtube clip showing Jmol 12.3 is working on Android:
   http://www.youtube.com/watch?v=og-lXFnDU-w


2) If so, what's the best way to make that happen?

Thanks in advance

-- 
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: Jmol on Android tablet

2011-11-26 Thread pong

Thanks for the tips, but I would like to have live 3D-plots (ones
that one can spin and drag around).

On Nov 26, 6:56 pm, A. Jorge Garcia calcp...@aol.com wrote:
 pong wypon...@gmail.com wrote:

 Two days ago during Thanksgiving dinner, I tried showing SAGE notebook
 to my cousin who has an Android tablet. Well... I then realized that
 Jmol (or rather Java runtime environment) is not supported on android
 (at least not out of the box)

 My questions are:

 1) Has someone successfully run Jmol on an Android browser?

 There is a youtube clip showing Jmol 12.3 is working on 
 Android:http://www.youtube.com/watch?v=og-lXFnDU-w

 2) If so, what's the best way to make that happen?

 Thanks in advance

 --
 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 
 athttp://groups.google.com/group/sage-support
 URL:http://www.sagemath.org

 On my android phone, I use show(viewer=tachyon) instead of jmol.
 HTH,
 A. Jorge Garcia
 Applied Math and 
 CompScihttp://shadowfaxrant.blogspot.comhttp://www.youtube.com/calcpage2009
 Sent via DROID on Verizon Wireless

-- 
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: LaTeX angle symbol in notebook

2011-08-30 Thread pong
Thanks. So the question is how to enable that? I followed instruction
in the link but still couldn't make it work. More specifically, I did

1) I believe the notebook version that I'm running is 0.8.19. How can
I make sure that's true?
2) I move the msam10 folder to SAGE_ROOT/local/lib/python2.6/sites-
packages/sagenb-0.8.19-py2.6.egg/sagenb/data/jsmath/fonts/
3) I then edited easy/load.js to load the fonts: loadFonts:
[msam10]
4) restarted notebook.

Does SAGE uses load.js for loading jsMath fonts? I think maybe both 2)
and 3) are wrong. Please help.

On Aug 26, 7:56 pm, kcrisman kcris...@gmail.com wrote:
 On Aug 26, 10:32 pm, pong wypon...@gmail.com wrote:

  In notebook

  %latex

  \angle ABC

  display the angle symbol correctly. Any ways to get that work with the
  TinyMCE editor? (as of now, it just gives by \angle instead of the
  symbol).

 I don't think we enabled this jsmath extension.  ?

 http://www.math.union.edu/~dpvc/jsMath/symbols/AMSsymbols.html

 Also, you may want to note that it doesn't always display right in the
 browser in the cells, either.  
 Seehttp://trac.sagemath.org/sage_trac/ticket/9623#comment:30,
 about halfway through the comment I think I found that Firefox seems
 to work but not Safari.

 - 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] strange issue with 3d plots/Jmol

2011-08-28 Thread pong
I encountered a pretty strange issue with Jmol.

In each notebook worksheet, I can have Jmol to display only two 3d
plots! From the third 3d plots onwards, it just giving me black
screens...
It must be some problems on the installation since if I transfer the
same worksheet to another server, it display all the plots.

Any idea on where the problem could be and how to fix that?

I'm using SAGE 4.7.1

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


[sage-support] Re: strange issue with 3d plots/Jmol

2011-08-28 Thread pong
Well after reading this post:

http://ask.sagemath.org/question/711/jmol-in-notebook

I start suspecting it's an issue with the browser and how Java is
implemented. Surely enough, it works fine with Safari on Mac (but
nothing else, not chrome, not firefox...)
On Windows Jmol works with firefox.

I still have a similar problem on Linux with icedtea for Java

On Aug 28, 1:12 am, pong wypon...@gmail.com wrote:
 I encountered a pretty strange issue with Jmol.

 In each notebook worksheet, I can have Jmol to display only two 3d
 plots! From the third 3d plots onwards, it just giving me black
 screens...
 It must be some problems on the installation since if I transfer the
 same worksheet to another server, it display all the plots.

 Any idea on where the problem could be and how to fix that?

 I'm using SAGE 4.7.1

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


[sage-support] Re: TinyMCE don't recognize user-define LaTeX Macros

2011-08-28 Thread pong
Hum... what do you mean by text mode?
Just realized that the effect of using $\newcommand...$ in a TinyMCE
cell persists throughout the whole worksheet.
This solves my original problem


On Aug 28, 8:47 am, ksk...@gmail.com ksk...@gmail.com wrote:
 Related question: if I understand correctly, TinyMCE only looks for
 LaTeX code within dollar signs. Is there some way to force a LaTeX
 evaluation (e.g., of \newcommand) within text mode?

 Kiran

 On Aug 27, 10:49 pm, pong wypon...@gmail.com wrote:







  Is there a way to make TinyMCE recognize user-define macros?

  from sage.misc.latex import *

  latex.add_macro(\\newcommand{\\Rr}{\mathbb{R}})

  %latex
  $\Rr$

  returns the blackboard face R.

  However, $\Rr$ in the TinyMCE editor produces Unknown control sequence
  '\Rr'

  Need 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] TinyMCE don't recognize user-define LaTeX Macros

2011-08-27 Thread pong
Is there a way to make TinyMCE recognize user-define macros?

from sage.misc.latex import *

latex.add_macro(\\newcommand{\\Rr}{\mathbb{R}})

%latex
$\Rr$

returns the blackboard face R.

However, $\Rr$ in the TinyMCE editor produces Unknown control sequence
'\Rr'

Need 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] Bug in the implementation of the Chinese remainder theorem with non-coprime moduli

2011-08-26 Thread pong
sage: mod(452,60), mod(452,90), mod(452,150)
(32, 2, 2)

But

sage: CRT([32,2,2],[60,90,150])


Traceback (click to the left of this block for traceback)
...
ValueError: No solution to crt problem since gcd(5400,150) does not
divide 92-2

It looks like a bug to me, isn't it? At least SAGE shouldn't report
that there is no solution.

-- 
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] LaTeX angle symbol in notebook

2011-08-26 Thread pong
In notebook

%latex

\angle ABC

display the angle symbol correctly. Any ways to get that work with the
TinyMCE editor? (as of now, it just gives by \angle instead of the
symbol).

Thanks

-- 
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] question about radical

2011-08-17 Thread pong
Hum...

[radical(k) for k in [1..30]] produces the expected list however

[radical(k) for k in range(1,31)] rises an error

AttributeError: 'int' object has no attribute 'factor'

Wouldn't it be nice if the 2nd comprehension also give the desire
list? Any reason why shouldn't SAGE take that?



-- 
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: Published Worksheets do not get updated

2011-08-02 Thread pong
I'm glad to get the confirmation of the problem. We have upgraded our
school server to the new version of the notebook. We like it and
certainly don't want to go back.


On Aug 2, 2:31 pm, William Stein wst...@gmail.com wrote:
 On Tue, Aug 2, 2011 at 1:55 PM, pong wypon...@gmail.com wrote:
  I have just found out that published worksheets do not get updated
  automatically even with Automatically re-publish when changes are
  made box checked.
  In fact, I can even get an update by clicking the re-publish worksheet
  button.

  I have tested this on both my school site andwww.sagenb.org.

 With sagenb.org it is probably due to some massive rewriting work that
 Mike Hansen and I did at Sage Days 31, which dramatically improved the
 scalability of the notebook (so it is actually usable at all), but may
 have broken something.
 I can confirm seeing the problem you mention.   We really need to fix it.

  It worked flawlessly before. Any idea why?

  --
  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 
  athttp://groups.google.com/group/sage-support
  URL:http://www.sagemath.org

 --
 William Stein
 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 
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: latex_extra_preamble

2011-06-21 Thread pong
Thanks. Yours command work :)

I used

from sage.misc.latex import latex_extra_preamble
latex_extra_preamble()
'\\newcommand{\\floor}[1]{ \\lfloor #1 \\rfloor}'

which I found in the standard documentation. And it does not work.
Perhaps, someone can check whether it is a bug.


On Jun 21, 7:26 am, John H Palmieri jhpalmier...@gmail.com wrote:
 On Monday, June 20, 2011 7:22:32 PM UTC-7, pong wrote:

  Thank you for your tips.

  I use SAGE 4.7
  %latex_debug shows that latex complains about \floor is an undefined
  control sequence (as if the latex_extra_preamble() has no effect)

  ! Undefined control sequence.
  recently read \floor

  l.31 $\floor
              {y}$
  

  What did I miss here?

 How did you set the latex preamble?  I did this; this is the recommended
 way:

 latex.add_to_preamble('\\newcommand{\\floor}[1]{ \\lfloor #1 \\rfloor}')

 --
 John

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


[sage-support] latex_extra_preamble

2011-06-20 Thread pong
In notebook, I want to define \floor{x} as \lfloor x \rfloor so I
tried

from sage.misc.latex import latex_extra_preamble

latex_extra_preamble()
'\\newcommand{\\floor}[1]{ \\lfloor #1 \\rfloor}'

%latex
$\floor{x}, \lfloor x \rfloor$

shows that \floor{x} does not typeset correctly and the system does
recognize both \lfloor and \rfloor

Am I missing something? Any ideas?

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

2011-06-20 Thread pong
Thank you for your tips.

I use SAGE 4.7
%latex_debug shows that latex complains about \floor is an undefined
control sequence (as if the latex_extra_preamble() has no effect)

! Undefined control sequence.
recently read \floor

l.31 $\floor
{y}$


What did I miss here?


On Jun 20, 7:06 pm, John H Palmieri jhpalmier...@gmail.com wrote:
 On Monday, June 20, 2011 6:30:07 PM UTC-7, pong wrote:

  In notebook, I want to define \floor{x} as \lfloor x \rfloor so I
  tried

  from sage.misc.latex import latex_extra_preamble

  latex_extra_preamble()
  '\\newcommand{\\floor}[1]{ \\lfloor #1 \\rfloor}'

  %latex
  $\floor{x}, \lfloor x \rfloor$

  shows that \floor{x} does not typeset correctly and the system does
  recognize both \lfloor and \rfloor

 It works for me, in Sage versions 4.6.2, 4.7, and 4.7.1.alpha2.  What
 version are you using?  Try using

 %latex_debug
 $\floor{x}, \lfloor x \rfloor$

 and see if that tells you anything helpful.

 --
 John

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


[sage-support] Absolute value of matrices

2011-04-04 Thread pong
By that I simply mean a function that on input a real matrix M returns
the matrix N such that n[i][j] = abs(m[i][j]).

This can be achieve by something like:

n = len(M.rows()); m =len(M.columns()); N = matrix(n,m,lambda i,j:
abs(M[i][j]));

However, for a square matrix M, M.abs() returns something which wasn't
what one expected:

B = matrix(2,2,lambda i,j: i-j); B; B.abs()

returns

[ 0 -1]
[ 1  0]

and 1

Is it a bug? Or something that I missed?

-- 
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: Problem in displaying graphs

2011-03-22 Thread pong
The only fiddling that I did was instead of putting axes_pad=0.1
within the scope of plot(), like Graph(d).plot(axes_pad=0.1),
I put it outside as an argument for \sageplot

And yes, I forgot to type } in my previous post, sorry.

On Mar 21, 8:13 am, kcrisman kcris...@gmail.com wrote:
 On Mar 20, 4:14 pm, pong wypon...@gmail.com wrote:

  With some fiddling,

  \sageplot{Graph(d).plot(), axes_pad=0.1)

  works around the problem.

 Can you be more explicit about 'fiddling'?  Does that mean you patched
 SageTeX, or Sage?  Also, is there a } or a ) at the end of the
 command?

 Thanks!  It's true that the fix for this was only about show().  I
 can't remember myself whether this got fixed or not... I think there
 was a 'needs info' involved on the relevant ticket? it looks fine with
 your graph in my 4.6.2, though.

 - kcrisman

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


[sage-support] Re: Problem in displaying graphs

2011-03-20 Thread pong
With some fiddling,

\sageplot{Graph(d).plot(), axes_pad=0.1)

works around the problem.

On Mar 19, 6:50 pm, pong wypon...@gmail.com wrote:
 Sage plots some graphs with vertices partially chopped off.
 For example:

 sage: d={1:[2,3,5], 2:[3], 3:[4,5], 4:[5]}
 sage: Graph(d).plot()

 I thought the bug was fixed, but looks like it still exists.
 There is a work around using something like G.show(axes_pad=0.1).
 However, I couldn't make it works with sagetex because axes_pad seems
 to have no effect on G.plot().

 Any help?
 Thanks in advance

-- 
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] Problem in displaying graphs

2011-03-19 Thread pong
Sage plots some graphs with vertices partially chopped off.
For example:

sage: d={1:[2,3,5], 2:[3], 3:[4,5], 4:[5]}
sage: Graph(d).plot()

I thought the bug was fixed, but looks like it still exists.
There is a work around using something like G.show(axes_pad=0.1).
However, I couldn't make it works with sagetex because axes_pad seems
to have no effect on G.plot().

Any help?
Thanks in advance

-- 
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] sagetex and combinatorial graphs

2011-03-12 Thread pong
A quick question. How to use sagetex to display a graph (edges and
vertices) produced by sage without saving it first manually then
\includegraphics.

I failed to make it work using sageplot.

Thanks in advance

-- 
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] Jmol problem with Chrome on Mac

2011-01-27 Thread pong
I just wonder if any one has any success in getting Jmol to run inside
Chrome on a Mac.
If so, please share how :-)

It's well known that Java is buggy with Chrome (perhaps the new
firefox 4 as well) on Mac. On sagenb.org, for example, when I invoke
anything that calls Jmol, sage simply complains that Java applet is
not enabled. Even though I have already allowed all sites to run
Javascripts.

I know two more things:

1) Chrome (or Chromium rather) does not have this problem on Linux.
2) It appears that Chrome (on Mac) can run Javascripts on some other
sites, for example, I can play Java games with it.

Any idea on how to fix this? Thanks in advance.

-- 
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] implicit_plot3d (potential bug?)

2011-01-06 Thread pong
Here are the code:

M = matrix(3,[1,-1,-1,-1,3,1,-1,1,3]); v=M.eigenvalues(); v

[2, 0.4384471871911698?, 4.561552812808830?]

Q=implicit_plot3d(x^2+y^2+z^2==1/v[1], [x,-3,3], [y,-3,3],[z,-3,3],
opacity=0.5); Q

Jmol shows nothing. However, if I change 1/v[1] to 2.28 (~1/v[1]) then
it shows the sphere.

Any idea why?

-- 
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] problem with integral (Maxima)

2010-11-08 Thread pong
I have encountered a problem in using integral

integral(x * sqrt((-2*cos(x))^2 + (2*sin(x))^2), x, 0, pi)

correctly gives pi^2

but

integral(sin(x) * sqrt((-2*cos(x))^2 + (2*sin(x))^2), x, 0, pi)

results in a complaint that Maxima encountered a Lisp error: 2 is not
of the type LIST.

Why so? Any help?

Thanks in advance

-- 
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: axes labels in 3D plots

2010-11-06 Thread pong
Usually, I got excellent answers to my questions about SAGE here
quickly.

The attribute axes_labels does not seem working 3D plot. Is there a
way to get around without say manually using text3d to add the labels?

Thanks


On Nov 5, 11:45 am, pong wypon...@gmail.com wrote:
 I did a quick search but couldn't find any recent discussion on this
 topic.

 Has axes labels for 3D plots implemented?

 There seems to be a new feature in Jmol 12 for axes labelling.

 What is it? Can we use it in SAGE? If so, how?

 Thanks in advance

-- 
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] axes labels in 3D plots

2010-11-05 Thread pong
I did a quick search but couldn't find any recent discussion on this
topic.

Has axes labels for 3D plots implemented?

There seems to be a new feature in Jmol 12 for axes labelling.

What is it? Can we use it in SAGE? If so, how?

Thanks in advance

-- 
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] Gram-Schmidt process

2010-10-03 Thread pong
Just a quick question: In SAGE, is there a quick way to apply the G-S
Process to a given independent set of vectors to produce a set of
orthogonal vectors with the same span?

Thanks in advance

-- 
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: Gram-Schmidt process

2010-10-03 Thread pong
Sorry, my bad. That's a procedure for matrix: M.gram_schmidt()


On Oct 3, 4:27 pm, pong wypon...@gmail.com wrote:
 Just a quick question: In SAGE, is there a quick way to apply the G-S
 Process to a given independent set of vectors to produce a set of
 orthogonal vectors with the same span?

 Thanks in advance

-- 
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: displaying graphs

2010-02-07 Thread pong
 I've installed the SAGE 4.3.1. Looks like the problem I mentioned
persist.

 I tried to obtain an account to open a ticket about a month ago
but did not get a reply.
 I hope this issue will be addressed some how.

On Jan 6, 12:43 am, Nathann Cohen nathann.co...@gmail.com wrote:
 Hello !!!

 To open a ticket on the TRAC server (http://trac.sagemath.org/sage_trac
 ) you must first have an account.
 *  If you do not, the first page of this website advises you to send a
 email to William Stein to request one : wstein at gmail.com
 *  When you have one, you can go 
 tohttp://trac.sagemath.org/sage_trac/newticket
 and create your ticket. Be sure to file it under the Graph Theory
 section.

 If you have more questions, you can join the irc channel #sage-
 de...@irc.freenode.net or send/read the Google group Sage-devel ( for
 the discussions related to Sage's development ) :-)

 Nathann

 On Jan 6, 8:42 am,pongwypon...@gmail.com wrote:

  I came across a problem with padding around graphs a couple releases
  ago

 http://groups.google.com/group/sage-support/browse_thread/thread/274d...

  for example
  k=graphs.CompleteGraph(6)
  show(k)

  shows K6 but the vertices are partially chopped off.

  The fixes suggested then was
  show(k, axes_pad=.1)

  However, it seems that the same problem is still around.
  I want to open a ticket for this, but not sure how.

  Thanks in advance

-- 
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] Problem in running sage notebook in secure mode on Mac OS X

2009-11-22 Thread pong
I have just upgraded to Sage 4.2.1 and when I tried to run the
notebook server securely by

notebook(secure=True, open_viewer=False)

SAGE complains:


*  *
* Open your web browser to https://localhost:8000  *
*  *

There is an admin account.  If you do not remember the password,
quit the notebook and type notebook(reset=True).
Note: GNUTLS not available.
Traceback (most recent call last):
  File /Applications/sage/local/lib/python2.6/site-packages/twisted/
application/app.py, line 694, in run
runApp(config)

the error message goes on and on. But I'd rather not posting all here.
Any help on this?
Also, 1) the notebook server starts without problem in the non-secure
mode.
 2) I did install guntls via Darwin Port. How can I make it
available for sage (it complaints that gnutls is not available).

Thanks in advance

-- 
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: Problem in running sage notebook in secure mode on Mac OS X

2009-11-22 Thread pong
Sorry, I wasn't very clear, by upgrade I mean I downloaded

sage-4.2.1 sage-4.2.1-osx-10.5-32bit-i386-Darwin.dmg (using metalinks)

then drag-and-drop as usual. But that I got the aforementioned
problem.

Since I couldn't fix the problem. Later, I indeed upgraded sage from
prompt and the problem went away...
however there is another thing puzzling me: After the upgrade, sage is
upgraded just to 4.1.2 however, when I started the notebook, it shows
version 4.2.1.

Why is that, just a typo?



On Nov 22, 11:33 am, William Stein wst...@gmail.com wrote:
 On Sun, Nov 22, 2009 at 9:48 AM, pong wypon...@gmail.com wrote:
  I have just upgraded to Sage 4.2.1 and when I tried to run the
  notebook server securely by

 Instead of upgrading, please download and install sage-4.2.1.

  -- William





  notebook(secure=True, open_viewer=False)

  SAGE complains:

  
  *                                                  *
  * Open your web browser tohttps://localhost:8000 *
  *                                                  *
  
  There is an admin account.  If you do not remember the password,
  quit the notebook and type notebook(reset=True).
  Note: GNUTLS not available.
  Traceback (most recent call last):
   File /Applications/sage/local/lib/python2.6/site-packages/twisted/
  application/app.py, line 694, in run
     runApp(config)

  the error message goes on and on. But I'd rather not posting all here.
  Any help on this?
  Also, 1) the notebook server starts without problem in the non-secure
  mode.
          2) I did install guntls via Darwin Port. How can I make it
  available for sage (it complaints that gnutls is not available).

  Thanks in advance

  --
  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 
  athttp://groups.google.com/group/sage-support
  URL:http://www.sagemath.org

 --
 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 
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] arithmetic in python

2009-11-14 Thread pong

I apologize in advance that this is essentially a question about
python instead of sage.

When I type 0.6**2 in python, it returns
0.35999

When I do the same in SAGE
0.360

It gives the correct answer. Why so? And can I make python gives the
correct answer as well?

--~--~-~--~~~---~--~~
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: arithmetic in python

2009-11-14 Thread pong

Thanks for the suggestion. I understand it now.

Just curious, so what exactly does SAGE do when I type 0.6**2 then?
I tried a quick search with SAGE tutorial this time, but didn't seem
to find what I'm looking for.

Thanks in advance

On Nov 14, 10:06 am, William Stein wst...@gmail.com wrote:
 On Sat, Nov 14, 2009 at 9:17 AM, pong wypon...@gmail.com wrote:

  I apologize in advance that this is essentially a question about
  python instead of sage.

  When I type 0.6**2 in python, it returns
  0.35999

  When I do the same in SAGE
  0.360

  It gives the correct answer. Why so? And can I make python gives the
  correct answer as well?

 I highly recommend that you read

      http://docs.python.org/tutorial/floatingpoint.html

 to understand why Python does what it does.

 William
--~--~-~--~~~---~--~~
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: problem in displaying graphs

2009-10-23 Thread pong

Hi Jason,

 Setting axes_pad=.1 does work. Thanks! However, I tried your
codes in the previous email. The resulting graph has nodes clump
together. I guess the problem is with the value 1.5. When I changed
that to a smaller value say .05 then things work just fine. Even
though, sqrt(area/pi) is the radius...  I'm not sure what's the
problem of your originally codes.


On Oct 22, 11:03 pm, Jason Grout jason-s...@creativetrax.com wrote:
 William Stein wrote:
  On Thu, Oct 22, 2009 at 10:09 PM, pong wypon...@gmail.com wrote:
  I am using SAGE 4.1.2 notebook on firefox on a Mac.

  k=graphs.CompleteGraph(6)
  show(k)

  displays K_6 but the vertices got truncated. I don't have this problem
  on a linux machine running SAGE 4.1.1 notebook on firefox.

  Any help?
  I would like to include the pic but I don't see how on using this
  discussion group.

  That's definitely an annoying bug.  The only workaround I could easily
  find (without just fixing the bug) is:

  k=graphs.CompleteGraph(6)
  k.plot(graph_border=1)

 A work-around is to pad the graphic:

 k=graphs.CompleteGraph(6)
 show(k,axes_pad=.1)

 This adds 10% of the width to both the left and right (so the figure is
 120% its original width) and 10% of the height to the top and bottom (so
 the figure is 120% of the original height).

 See my other message for a better fix that uses the vertex size to
 figure out how much to pad the graphic.

 Thanks,

 Jason

 --
 Jason Grout
--~--~-~--~~~---~--~~
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] problem in displaying graphs

2009-10-22 Thread pong

I am using SAGE 4.1.2 notebook on firefox on a Mac.

k=graphs.CompleteGraph(6)
show(k)

displays K_6 but the vertices got truncated. I don't have this problem
on a linux machine running SAGE 4.1.1 notebook on firefox.

Any help?
I would like to include the pic but I don't see how on using this
discussion group.
Thanks in advance
--~--~-~--~~~---~--~~
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: problem in displaying graphs

2009-10-22 Thread pong

Thanks for the reply.

Is it a bug of SAGE 4.1.2 or just the Mac distribution? I guess my
question is if I upgrade SAGE to the latest version on my linux
machine, will I get the same problem?


On Oct 22, 10:22 pm, William Stein wst...@gmail.com wrote:
 On Thu, Oct 22, 2009 at 10:09 PM, pong wypon...@gmail.com wrote:

  I am using SAGE 4.1.2 notebook on firefox on a Mac.

  k=graphs.CompleteGraph(6)
  show(k)

  displays K_6 but the vertices got truncated. I don't have this problem
  on a linux machine running SAGE 4.1.1 notebook on firefox.

  Any help?
  I would like to include the pic but I don't see how on using this
  discussion group.

 That's definitely an annoying bug.  The only workaround I could easily
 find (without just fixing the bug) is:

 k=graphs.CompleteGraph(6)
 k.plot(graph_border=1)

 William
--~--~-~--~~~---~--~~
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] control on user accounts

2009-09-04 Thread pong

I wonder if there is a way to control who can create an account on
SAGE.

We have a small server and would like provide SAGE (in form of the
notebook) for the students. However, it maybe a bit
risky (especially, we have no experts to manage it) to open it up to
everyone. So we would like to have some kind of account approval
procedure. Can that be done, if so how?

Thx in advance

--~--~-~--~~~---~--~~
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: Problem of using firefox to view notebook

2009-07-02 Thread Pong

Oops. I have just figured out how to manually add an exception.

I'm using Firefox on a Mac.
1) Click on Preferences (under the Firefox tab)
2) Select Advanced-- Encryption-- View Certificates-- Add
Exception
3) Type the address that you want e.g. localhost:8000 after https://
4) Click on Get Certificate and then Permanently store this
exception

I apologize for posting the question before digging a little bit
further.

On Jul 2, 10:33 pm, pong wypon...@gmail.com wrote:
 I have upgraded to SAGE 4.0.2 and try using Firefox to view the
 notebook started by notebook(secure=True)

 When I pointed my browser tohttps://localhost:8000

 It compliant:

 localhost:8000 uses an invalid security certificate.

 The certificate is not trusted because it is self signed
 (Error code: sec_error_ca_cert_invalid)

 and gave me a blank page. I remember it used to be the case that I can
 add an exception but somehow firefox does not prompt me this time.

 Any help for me to get around this? I apologize in advance since it's
 more about my ignorant of firefox than SAGE since I can view the
 notebook for example using Safari.
--~--~-~--~~~---~--~~
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] GCC for Mac OS X

2009-04-12 Thread pong

I wrote couple sage scripts and would like to compile them in Mac OS
10.5. Looks like I need GCC. How can I install one? A quick search on
the internet seems to suggest that I need to sign up as an Apple
Developer to get a copy which I don't feel comfortable to.

Thanks in advance
--~--~-~--~~~---~--~~
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] Problem in re-login to notebook using Mac

2009-04-03 Thread pong

I have just installed SAGE-3.4 on a Macbook (OS X 10.5.6), everything
seems fine except when I log out from a sage notebook session and try
relogin from the same page then I get an error. I'm pretty sure that
the password is correct cos I've just created it the first time I ran
notebook(). I even did notebook(reset=True) to reset the password but
it didn't help.

The username is admin and when I enter the password it brings me to
http://localhost:8000/login with a blank page instead of the
notebooks.

Any help?
I did a quick search with MAC OS X notebook in this group and didn't
find the answer of my question. Sorry if that has been asked before.

--~--~-~--~~~---~--~~
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] 3D animation

2009-02-24 Thread pong

A colleague of mine would like to produce some 3D animation (an
illustration involving cones and spheres). He looked into SAGE and
said it will be difficult compare to Mathematica and so he decided to
use the latter.

By reading this group, I understand one can render the images via
tachyon then produce the animation by imagemagick. I just wonder if
there is any update (easier way) to do this.

Also it looks like some of the older correspondence in this group is
not available (can see the title) but not the content, can someone
tell me why?

Thanks in advance
--~--~-~--~~~---~--~~
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] bug in random_matrix?

2009-02-20 Thread pong

I expect to get a 3 x 2 integer matrix with entries between -10 to 10
by typing

sage: A =random_matrix(ZZ,3,2, x in [-10..10])
sage: A

but what I got is

[16  1]
[-2  2]
[ 0  0]

so why 16 appears? It is a bug? if it's just a misunderstanding of the
command from me, sorry.


--~--~-~--~~~---~--~~
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] using xgap in sage

2009-01-24 Thread pong

I want to use XGAP (a graphical interface for GAP). Since GAP comes
with SAGE, I wonder if one can make use of that somehow instead of
installing GAP separately on the machine.
--~--~-~--~~~---~--~~
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: using xgap in sage

2009-01-24 Thread pong


Sorry, but I don't quite understand what mean by the Sage tree. You
mean under the SAGE directory? There is a gap/ directory under
my .sage/ directory should I try installing XGAP there?
And when you say check the instruction what instruction are you
talking about?

I have just switched to linux from Windows so many things are new to
me.


On Jan 24, 9:26 am, mabshoff michael.absh...@mathematik.uni-
dortmund.de wrote:
 On Jan 24, 9:21 am, pong wypon...@gmail.com wrote:

 Hi,

  I want to use XGAP (a graphical interface for GAP). Since GAP comes
  with SAGE, I wonder if one can make use of that somehow instead of
  installing GAP separately on the machine.

 Did you try installing XGAP into the Sage tree? I check the
 instructions and I guess it wouldn't be too hard.

 Another possibility: touch spkg/installed/gap-4.4.10.p10 before
 building GAP in Sage and it will pick up the global one. Note that
 this is not a supported configuration, so if things go bad even with
 unrelated changes you ought to tell us in that case that you are using
 an external GAP.

 Cheers,

 Michael
--~--~-~--~~~---~--~~
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: trouble in compiling .spyx files

2009-01-23 Thread pong

Thanks, the problem is solved after installing libstdc++x-x.x-dev (in
my case x-x.x is 6-4.3) and related packages. (the installer knows the
dependence).
I include that here for others linux newbies who may encounter the
same problem.

On Jan 22, 10:55 pm, mabshoff michael.absh...@mathematik.uni-
dortmund.de wrote:
 On Jan 22, 9:14 pm, pong wypon...@gmail.com wrote:

 Hi,

  I have a .spyx file which compiles and runs fine on my dept machine
  (running sage-3.2.1) but I couldn't compile it on my laptop (running
  sage-3.2.3 on linux). It complaints about

  Compiling spec.spyx...
  Error compiling cython file:
  Error compiling spec.spyx:
  ...

  /usr/bin/ld: cannot find -lstdc++
  collect2: ld returned 1 exit status
  error: command 'gcc' failed with exit status 1

 You don't have libstdc++. so installed, which seems strange since it
 is the default C++ runtime. Does g++ compile a sample hello world C++
 program?

  I wonder if it's because sage isn't communicating with other programs,
  like gcc, on my machine or I missed something when I install gcc or
  both...

  Also I should mentioned that I install sage using the binaries instead
  of compiling it from the source... I wonder if that could be an issue
  as well..

 I don't think there is a direct cause here.

  thanks in advance

 Cheers,

 Michael
--~--~-~--~~~---~--~~
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] trouble in compiling .spyx files

2009-01-22 Thread pong

I have a .spyx file which compiles and runs fine on my dept machine
(running sage-3.2.1) but I couldn't compile it on my laptop (running
sage-3.2.3 on linux). It complaints about

Compiling spec.spyx...
Error compiling cython file:
Error compiling spec.spyx:
...

/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

I wonder if it's because sage isn't communicating with other programs,
like gcc, on my machine or I missed something when I install gcc or
both...

Also I should mentioned that I install sage using the binaries instead
of compiling it from the source... I wonder if that could be an issue
as well..

thanks in advance
--~--~-~--~~~---~--~~
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] problem in running sage example.sage

2008-12-21 Thread pong

I have recently switch to running SAGE on a linux system

I tried to see if sagetex work by running latex on the example.tex
(come with the current distribution sage-3.2.2)

However when I then run sage example.sage, it compliants:

Plot 6
Code block begin...
 Error in Sage code on line 158 of example.tex! Traceback follows.
Traceback (most recent call last):
  File example.py, line 181, in module
matrixprogram = matrix_plot(M,cmap='Greys')
  File /home/pong/sage-3.2.2/local/lib/python2.5/site-packages/sage/
plot/misc.py, line 285, in wrapper
return func(*args, **options)
  File /home/pong/sage-3.2.2/local/lib/python2.5/site-packages/sage/
plot/matrix_plot.py, line 151, in matrix_plot
raise ValueError, can not convert array entries to floating point
numbers
ValueError: can not convert array entries to floating point numbers

 Running Sage on example.sage failed! Fix example.tex and try
again.

Am I missing packages, I have no clue how to fix it. Please 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problem in running sage example.sage

2008-12-21 Thread pong

I see. Thanks
Well, I hope my post at least let people aware of this if they do a
search of sagetex in sage-support.


On Dec 21, 5:56 pm, Mike Hansen mhan...@gmail.com wrote:
 Hi,



 On Sun, Dec 21, 2008 at 5:47 PM, pong wypon...@gmail.com wrote:

  I have recently switch to running SAGE on a linux system

  I tried to see if sagetex work by running latex on the example.tex
  (come with the current distribution sage-3.2.2)

  However when I then run sage example.sage, it compliants:

  Plot 6
  Code block begin...
   Error in Sage code on line 158 of example.tex! Traceback follows.
  Traceback (most recent call last):
   File example.py, line 181, in module
     matrixprogram = matrix_plot(M,cmap='Greys')
   File /home/pong/sage-3.2.2/local/lib/python2.5/site-packages/sage/
  plot/misc.py, line 285, in wrapper
     return func(*args, **options)
   File /home/pong/sage-3.2.2/local/lib/python2.5/site-packages/sage/
  plot/matrix_plot.py, line 151, in matrix_plot
     raise ValueError, can not convert array entries to floating point
  numbers
  ValueError: can not convert array entries to floating point numbers

   Running Sage on example.sage failed! Fix example.tex and try
  again.

 This is a known issue (http://trac.sagemath.org/sage_trac/ticket/4812
 ) and should be fixed in the next release.  Note that it is specific
 to that particular example, and the rest of sagetex should be fine.

 --Mike
--~--~-~--~~~---~--~~
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: LaTeX problem

2008-12-08 Thread pong


This may work for you

html(r'span class=math\tan^{-1} x/span') or simply html(r'$\tan^
{-1} x$')

the r before ' stands for raw string.


On Dec 8, 9:55 pm, acardh [EMAIL PROTECTED] wrote:
 I am working in the Sage Notebook, I can reproduce the Taylor Series
 example as is. The LaTeX works fine there.

 I took the next line from the Sage reference book, from the Latex
 printing support section:

 htmlspan class=math\tan^{-1} x/span/html

 The problem is that when I put it in the Notebook cell I get an error:

 SyntaxError:invalidsyntax
--~--~-~--~~~---~--~~
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] divisors sorted

2008-12-04 Thread pong

In SAGE 3.2.1 , the docstring of divisors says:

Definition: divisors(n)
Docstring:

Returns a list of all positive integer divisors
of the nonzero integer n.

A second parameter may be passed to surpress sorting
of the list (as ordering the list can be more time
consuming then creating it).

INPUT:
n -- the element
sorted -- whether or not to sort the output (default True)

My question is how to get an unsorted output?

I tried divisors(300, sorted=False) but SAGE complaints that divisors
only takes 1 argument. In fact, the source codes seem to suggest that
it will always return a sorted list.


--~--~-~--~~~---~--~~
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: divisors sorted

2008-12-04 Thread pong

Robert, thanks for clearing that up for me.

However, I think it's still desirable to leave unsorted as an
option, even though as you said now sorting doesn't take up the
majority of the time. For example, it will be a waste of computing
time if divisors is followed by some operations that may screw up the
order but then one does want a sorted result at the end.



On Dec 4, 10:06 pm, Robert Bradshaw [EMAIL PROTECTED]
wrote:
 On Dec 4, 2008, at 9:35 PM, pong wrote:



  In SAGE 3.2.1 , the docstring of divisors says:

  Definition:        divisors(n)
  Docstring:

          Returns a list of all positive integer divisors
          of the nonzero integer n.

          A second parameter may be passed to surpress sorting
          of the list (as ordering the list can be more time
          consuming then creating it).

          INPUT:
              n -- the element
              sorted -- whether or not to sort the output (default True)

  My question is how to get an unsorted output?

  I tried divisors(300, sorted=False) but SAGE complaints that divisors
  only takes 1 argument. In fact, the source codes seem to suggest that
  it will always return a sorted list.

 You are correct, now the divisors are always returned sorted (as we  
 have resolved the issue of sorting taking the majority of the time).  
 The documentation needs to be fixed.

 http://trac.sagemath.org/sage_trac/ticket/4710

 - 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] hardware factors that affects the speed of running SAGE

2008-11-29 Thread pong

Hi,

 I wonder if SAGE is optimized for multi-core CUPs (people told me
that many programs don't). Also, does it matter (in term of speed)
that SAGE is running on a 64-bit OS vs 32-bit? In general, what would
have to most significant impact on the speed of running SAGE, # of
cores, OS or simply the clock-rate of the CUP?

 I know very little about computer hardware, so I apologize if my
questions doesn't quite make sense.

--~--~-~--~~~---~--~~
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: hardware factors that affects the speed of running SAGE

2008-11-29 Thread pong

 Thanks for the information. Yes, indeed I'm thinking of buying a
machine and most likely the OS will be linux.

 All I can tell is that running SAGE on a Windows machine (via
VMware Player) is pretty slow. The CPU on my laptop is an Intel Core 2
Duo U7600 and

timeit('factorial(10^6)') shows that it takes 11.3s to run... (compare
to William's Xeon machine, 2s). I almost thought the system hanged
(took a min to run timeit).

On Nov 29, 12:09 pm, Robert Bradshaw [EMAIL PROTECTED]
wrote:
 On Nov 29, 2008, at 11:47 AM, mabshoff wrote:



  On Nov 29, 11:37 am, Robert Bradshaw [EMAIL PROTECTED]
  wrote:
  On Nov 29, 2008, at 07:35 , pong wrote:

  Hi,

      I wonder if SAGE is optimized for multi-core CUPs (people  
  told me
  that many programs don't).

  This is not an easy question to answer.  Sage is built from many
  components that were not specifically designed with Sage or
  multiprocessor issues in mind.

  Most programmers and algorithm designers, even today, don't think in
  terms of a tight-coupled multiprocessor implementation.  Some do
  think of loose coupling.  The distinction is the amount of  
  information
  needed to be shared between the cooperating processes.  For  
  example,
  Michael and a host of others worked hard to get the Sage build to  
  take
  advantage of multiple processors.  This was not easy, because the
  components come from many sources, and their build process was not
  designed to take advantage of these systems, but it was feasible
  because the different components need very little information  
  from the
  other components (basically, 'make' has to know what the  
  dependencies
  are, so it can find independent builds to run at the same time).

  The software that makes up Sage is another matter entirely.  Code  
  does
  not automatically work optimally on a multiprocessor system (whether
  multi-core or multiple single-core chips).  That effort takes a  
  lot of
  work.

  One important component of Sage, ATLAS, does take advantage of
  multiple processors, which is directly taken advantage of in all the
  linear algebra (numeric and exact).

  No, it doesn't per default in Sage on non-OSX since we only build a
  single threaded ATLAS there. Due to the Accelerate Framework on OSX
  large problems that employ BLAS do use multiple cores automatically.
  The Accelerate Framework contains code derived from ATLAS for the BLAS
  portion, but that code was never given back by Apple.

 I stand corrected--most of my experience is on OSX where it is easy  
 to see both cores being utilized. I didn't know this wasn't the case  
 elsewhere (yet).

  I have build Sage versions with a multi CPU ATLAS per default, but
  that code never made it into upstream. I have been contemplating what
  to do and I do have the following BLAS plan:

 [...]

  Thoughts?

 Sounds good to me, but I have not experience in the area.

 - 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: need helps in optimizing speed

2008-11-24 Thread pong

I see that the ticket

http://trac.sagemath.org/sage_trac/ticket/4533

has been closed. Thank you for the effort, now divisors in SAGE is
much faster!! However, the one that packed in SAGE 3.2 is still about
3 times slower than that in PARI. I wonder if all the improvements
have been implemented in 3.2. or we need to wait for 3.2.1?

PARI/GP (on a really old machine)

for(i=1,1000, divisors(3293479734242732472))
time = 1,433 ms.

SAGE (on the same machine)
sage: %timeit divisors(3293479734242732472)
100 loops, best of 3: 4.93 ms per loop

Thanks!




On Nov 16, 12:26 am, Robert Bradshaw [EMAIL PROTECTED]
wrote:
 On Nov 15, 2008, at 11:57 PM, pong wrote:

  I was a bit reluctant to post this question here since support
  shouldn't mean teaching me how to write programs. But Jason Grout
  suggested me to post it here anyway.

 Short snippets of code (like the one below) are very useful. It's  
 hard to give a good answer without something concrete to go on. I am  
 also curious what kind of input you're giving it. (Highly composite I  
 suppose?)

  Here is a very short script that I want to maximize the speed

  def lspec(n):
        return sorted([k if k^2  2*n else 2*n/k for k indivisors
  (odd_part(n))])

  At first, I think I can make it faster by avoiding computing k^2 in
  the for loop by replacing k^2  2*n  by
  k  r where r = sqrt(RDF(2*n)) is computed once outside the for loop.
  However, it looks like comparing two entities of different types is
  veryslowin SAGE so I ended up with a slower script if a do that.

 Try setting r = (2*n).isqrt(), which is an integer. You can also  
 write 2*n//k which will do exact division (since you know the result  
 is an integer). After making these two changes it seems to run in  
 exactly the time it takes to computedivisors(odd_part(n)). The  
 divisorsfunction looks horribly inefficient, it's probably only ever  
 been used for small inputs. I've made a ticket

 http://trac.sagemath.org/sage_trac/ticket/4533

  Also I tried to replace k by 2*n/k only for those k indivisors
  (odd_part(n)) whose squares are  2*n (instead of doing a list
  comprehension) but the resulting script is not any faster.

  Thanks in advance

  P.S. I implemented the algorithm using PARI/GP, the result is almost
  200 times faster.

 That is quite the difference. Hopefully this gives us a good goal as  
 to how fast we can list thedivisorsof a number.

 - 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: need helps in optimizing speed

2008-11-24 Thread pong

Oh really.
Now I realized why I had in my mind that SAGE was much slower---the
test what based on a more complicated function instead of just
divisors.

Looking forward to SAGE 3.2.1 then.


On Nov 24, 11:05 pm, William Stein [EMAIL PROTECTED] wrote:
 On Mon, Nov 24, 2008 at 10:43 PM, pong [EMAIL PROTECTED] wrote:

  I see that the ticket

 http://trac.sagemath.org/sage_trac/ticket/4533

  has been closed. Thank you for the effort, now divisors in SAGE is
  much faster!! However, the one that packed in SAGE 3.2 is still about
  3 times slower than that in PARI. I wonder if all the improvements
  have been implemented in 3.2. or we need to wait for 3.2.1?

  PARI/GP (on a really old machine)

  for(i=1,1000, divisors(3293479734242732472))
  time = 1,433 ms.

  SAGE (on the same machine)
  sage: %timeit divisors(3293479734242732472)
  100 loops, best of 3: 4.93 ms per loop

 Quick remarks --  In pari, the runtime here is dominated by
 the call to factor.  E.g., in pari you'll get the same
 time if you replace divisors by factor.

 Second: #4533 is *not* merged into sage-3.2.  It's only
 going to appear in 3.2.1 -- that's why Michael wrote
 Merged the edited patch in Sage 3.2.1.alpha0 at the
 bottom of the ticket. I think 3.2 just has the old code.
 In 3.2.1 pari is about 0.61s for me on that benchmark and
 sage is about 0.90s (for 1000 iterations).

 I think the actual divisor enumeration code is faster in Sage, but
 there is overhead doing the factorization, which is the reason
 Sage is a tiny bit slower.

 William



  Thanks!

  On Nov 16, 12:26 am, Robert Bradshaw [EMAIL PROTECTED]
  wrote:
  On Nov 15, 2008, at 11:57 PM, pong wrote:

   I was a bit reluctant to post this question here since support
   shouldn't mean teaching me how to write programs. But Jason Grout
   suggested me to post it here anyway.

  Short snippets of code (like the one below) are very useful. It's
  hard to give a good answer without something concrete to go on. I am
  also curious what kind of input you're giving it. (Highly composite I
  suppose?)

   Here is a very short script that I want to maximize the speed

   def lspec(n):
         return sorted([k if k^2  2*n else 2*n/k for k indivisors
   (odd_part(n))])

   At first, I think I can make it faster by avoiding computing k^2 in
   the for loop by replacing k^2  2*n  by
   k  r where r = sqrt(RDF(2*n)) is computed once outside the for loop.
   However, it looks like comparing two entities of different types is
   veryslowin SAGE so I ended up with a slower script if a do that.

  Try setting r = (2*n).isqrt(), which is an integer. You can also
  write 2*n//k which will do exact division (since you know the result
  is an integer). After making these two changes it seems to run in
  exactly the time it takes to computedivisors(odd_part(n)). The  
  divisorsfunction looks horribly inefficient, it's probably only ever
  been used for small inputs. I've made a ticket

 http://trac.sagemath.org/sage_trac/ticket/4533

   Also I tried to replace k by 2*n/k only for those k indivisors
   (odd_part(n)) whose squares are  2*n (instead of doing a list
   comprehension) but the resulting script is not any faster.

   Thanks in advance

   P.S. I implemented the algorithm using PARI/GP, the result is almost
   200 times faster.

  That is quite the difference. Hopefully this gives us a good goal as
  to how fast we can list thedivisorsof a number.

  - 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: bug in integral?

2008-11-20 Thread pong

Yes, integral does not handle abs correctly.

sage: integral(abs(x),x)
integrate(abs(x), x)

sage: integral(max(x,-x),x)
x^2/2

If that's for sure a bug coming from maxima, I hope someone it can be
reported to their bug list.
I can see that it has been reported by David to the maxima-user list,
but somehow it does not show up in either the user or the bug list of
maxima. Isn't that strange?


On Nov 19, 9:33 am, David Joyner [EMAIL PROTECTED] wrote:
 Thanks for reporting this. I emailed the maxima users list.

 On Wed, Nov 19, 2008 at 11:50 AM, pong [EMAIL PROTECTED] wrote:

  Maybe someone has reported this already... but looks like there is a
  bug in integral

  sage: integral(x*abs(9-x^2), x, -6, 0)
  162

  The integrand is negative on (-6,0)
--~--~-~--~~~---~--~~
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] bug in integral?

2008-11-19 Thread pong

Maybe someone has reported this already... but looks like there is a
bug in integral

sage: integral(x*abs(9-x^2), x, -6, 0)
162

The integrand is negative on (-6,0)
--~--~-~--~~~---~--~~
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] fast arithmetic

2008-11-15 Thread pong


I have turned some codes that I have from PARI/GP into SAGE script but
I find that they are order of magnitude slower than the original
codes. Both types of codes are complied (i.e. I have .run in PARI and
spyx files for SAGE) and running on the same machine.

I am sure that's because I don't know enough of SAGE/Python to make
them fast (e.g. log(RDF(2)) seems to be faster than log(float(2))). In
general, if I want to do some simply arithmetic operations fast,
what's the way to go with SAGE? Is sage.ext.arith the module that I
should use?

I couldn't find help on using fast_arith  from the SAGE documentation
so any examples and pointers are appreciated.
--~--~-~--~~~---~--~~
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] question about .extend

2008-11-15 Thread pong

According to diveintopython .extend should be faster than + since the
former does not return a value.
I was curious and tried

%timeit [ ]+[2]
100 loops, best of 3: 741 ns per loop
and

%timeit [ ].extend([2])
100 loops, best of 3: 870 ns per loop

so + actually beats .extend slightly.

I got the same result when I tried that on sage online. (however
%timeit only tried 625 loops instead of 10^7 loops, why?)

Another puzzling thing is that
b=[ ]
%timeit b.extend([2])
100 loops, best of 3: 801 ns per loop

type(b)
type 'list'

but then when I run

%timeit b+[2]
10 loops, best of 3: 88.9 ms per loop

That's much slower, in fact if you simple type b and hit enter... SAGE
hangs.

why?




--~--~-~--~~~---~--~~
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] need helps in optimizing speed

2008-11-15 Thread pong

I was a bit reluctant to post this question here since support
shouldn't mean teaching me how to write programs. But Jason Grout
suggested me to post it here anyway.

Here is a very short script that I want to maximize the speed

def lspec(n):
  return sorted([k if k^2  2*n else 2*n/k for k in divisors
(odd_part(n))])

At first, I think I can make it faster by avoiding computing k^2 in
the for loop by replacing k^2  2*n  by
k  r where r = sqrt(RDF(2*n)) is computed once outside the for loop.
However, it looks like comparing two entities of different types is
very slow in SAGE so I ended up with a slower script if a do that.

Also I tried to replace k by 2*n/k only for those k in divisors
(odd_part(n)) whose squares are  2*n (instead of doing a list
comprehension) but the resulting script is not any faster.

Thanks in advance

P.S. I implemented the algorithm using PARI/GP, the result is almost
200 times faster.

--~--~-~--~~~---~--~~
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: When to use fast_float

2008-11-13 Thread pong

Thanks.

Where can I find out more about fast_float?
Even after importing fast_float, fast_float? does not show any
useful information.

Is it related to fast_arith?



On Nov 12, 7:56 pm, Robert Bradshaw [EMAIL PROTECTED]
wrote:
 On Nov 12, 2008, at 5:52 PM, kcrisman wrote:

  put those three lines in where indicated and it will be orders of
  magnitude faster for most cases, plus will handle constants, lambda
  functions, etc., automatically.

  fast_float is one of Sage's coolest secrets.

 Thanks :)



  That brings up a question I've had for a while.  When is it good to
  use fast_float (I've seen a lot of code over the last few months which
  replaces other calls with it) and when is it not good, or for instance
  when might RR be better, or just nothing?  E.g. William's examples on
  the interact wiki use it, but the others don't.  Given the limitations
  of our Sage server, something like that could really help things if it
  really speeded it up.  Unfortunately, as a non-CS type the
  documentation just doesn't compute for me, and just seeing a couple of
  examples where it is good to use it and where it isn't would be very
  helpful.

  For instance, should it only be used in .py files, or is it worthwhile
  in the command line or notebook?  Is it worth using if something is
  evaluated fewer than (say) 100 times?  Can it be interspersed with ZZ
  (I assume not) or RR(n), say RR(1000) (I have no idea)?  Thanks for
  any examples, especially from non-high-performance situations where it
  still might speed things up considerably (or do something bad).

 The fast_float functionality is mostly for internal use, and is  
 useful when one wants to evaluate an expression to double floating-
 point (i.e. 53-bits using the machine's native arithmetic) lots of  
 times. Lots depends on the application, but is probably in the  
 neighborhood of 10-100+, depending on the complexity of the equation  
 and whether or not it has any symbolic values like pi (which slow  
 down normal evaluation via maxima a huge amount). Thus it is suited  
 to things like plotting or numerical integration. However, most such  
 functions internally construct fast_float objects, so there usually  
 is no need for the user to do so.

 That being said, there are plenty of use cases for it for end users.  
 On the interact wiki (looking at the calculus page) it seems that  
 fast_float is used when the function is evaluated a lot, and not when  
 it is just passed off to something else (e.g. to contour_plot which  
 (should) use the fast_float internally). The usage in Coordinate  
 Transformations is probably redundant, as parametric_plot should be  
 calling fast_float itself.

 Not sure it completely answers your question, but hopefully it helps.

 - 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: When to use fast_float

2008-11-13 Thread pong


While working with fast_float, I find something extremely puzzling!
It's hard to explain but let me try:

0) I define shade_are_plot
1) I run shade_area_plot( f1,g1, a1, b1, c1, d1)
2) I restart the worksheet
3) I run the definition cell again
4) I run shade_area_plot(f2, g2, a2, b2, c2, d2)

SAGE shows me the first plot (i.e. in the plot produced in (1)), if I
run step (4) again, SAGE will then show me the shaded area between f2
and g2. In general, if I restart the worksheet again and run
shade_area_plot on another two graphs, SAGE will show me the first 2
plots before show me the plot that I want.

Why?



On Nov 13, 1:59 pm, Robert Bradshaw [EMAIL PROTECTED]
wrote:
 On Nov 13, 2008, at 1:22 PM, pong wrote:



  Thanks.

  Where can I find out more about fast_float?
  Even after importing fast_float, fast_float? does not show any
  useful information.

 Try typing sage.ext.fast_eval?

  Is it related to fast_arith?

 No, completely orthogonal despite the name.



  On Nov 12, 7:56 pm, Robert Bradshaw [EMAIL PROTECTED]
  wrote:
  On Nov 12, 2008, at 5:52 PM, kcrisman wrote:

  put those three lines in where indicated and it will be orders of
  magnitude faster for most cases, plus will handle constants, lambda
  functions, etc., automatically.

  fast_float is one of Sage's coolest secrets.

  Thanks :)

  That brings up a question I've had for a while.  When is it good to
  use fast_float (I've seen a lot of code over the last few months  
  which
  replaces other calls with it) and when is it not good, or for  
  instance
  when might RR be better, or just nothing?  E.g. William's  
  examples on
  the interact wiki use it, but the others don't.  Given the  
  limitations
  of our Sage server, something like that could really help things  
  if it
  really speeded it up.  Unfortunately, as a non-CS type the
  documentation just doesn't compute for me, and just seeing a  
  couple of
  examples where it is good to use it and where it isn't would be very
  helpful.

  For instance, should it only be used in .py files, or is it  
  worthwhile
  in the command line or notebook?  Is it worth using if something is
  evaluated fewer than (say) 100 times?  Can it be interspersed  
  with ZZ
  (I assume not) or RR(n), say RR(1000) (I have no idea)?  Thanks for
  any examples, especially from non-high-performance situations  
  where it
  still might speed things up considerably (or do something bad).

  The fast_float functionality is mostly for internal use, and is
  useful when one wants to evaluate an expression to double floating-
  point (i.e. 53-bits using the machine's native arithmetic) lots of
  times. Lots depends on the application, but is probably in the
  neighborhood of 10-100+, depending on the complexity of the equation
  and whether or not it has any symbolic values like pi (which slow
  down normal evaluation via maxima a huge amount). Thus it is suited
  to things like plotting or numerical integration. However, most such
  functions internally construct fast_float objects, so there usually
  is no need for the user to do so.

  That being said, there are plenty of use cases for it for end users.
  On the interact wiki (looking at the calculus page) it seems that
  fast_float is used when the function is evaluated a lot, and not when
  it is just passed off to something else (e.g. to contour_plot which
  (should) use the fast_float internally). The usage in Coordinate
  Transformations is probably redundant, as parametric_plot should be
  calling fast_float itself.

  Not sure it completely answers your question, but hopefully it helps.

  - 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: When to use fast_float

2008-11-13 Thread pong

Also, let me apologize in advance if that's because some bugs in my
script. But I hope someone can tell me why that's happening.

On Nov 13, 11:10 pm, pong [EMAIL PROTECTED] wrote:
 While working with fast_float, I find something extremely puzzling!
 It's hard to explain but let me try:

 0) I define shade_are_plot
 1) I run shade_area_plot( f1,g1, a1, b1, c1, d1)
 2) I restart the worksheet
 3) I run the definition cell again
 4) I run shade_area_plot(f2, g2, a2, b2, c2, d2)

 SAGE shows me the first plot (i.e. in the plot produced in (1)), if I
 run step (4) again, SAGE will then show me the shaded area between f2
 and g2. In general, if I restart the worksheet again and run
 shade_area_plot on another two graphs, SAGE will show me the first 2
 plots before show me the plot that I want.

 Why?

 On Nov 13, 1:59 pm, Robert Bradshaw [EMAIL PROTECTED]
 wrote:

  On Nov 13, 2008, at 1:22 PM, pong wrote:

   Thanks.

   Where can I find out more about fast_float?
   Even after importing fast_float, fast_float? does not show any
   useful information.

  Try typing sage.ext.fast_eval?

   Is it related to fast_arith?

  No, completely orthogonal despite the name.

   On Nov 12, 7:56 pm, Robert Bradshaw [EMAIL PROTECTED]
   wrote:
   On Nov 12, 2008, at 5:52 PM, kcrisman wrote:

   put those three lines in where indicated and it will be orders of
   magnitude faster for most cases, plus will handle constants, lambda
   functions, etc., automatically.

   fast_float is one of Sage's coolest secrets.

   Thanks :)

   That brings up a question I've had for a while.  When is it good to
   use fast_float (I've seen a lot of code over the last few months  
   which
   replaces other calls with it) and when is it not good, or for  
   instance
   when might RR be better, or just nothing?  E.g. William's  
   examples on
   the interact wiki use it, but the others don't.  Given the  
   limitations
   of our Sage server, something like that could really help things  
   if it
   really speeded it up.  Unfortunately, as a non-CS type the
   documentation just doesn't compute for me, and just seeing a  
   couple of
   examples where it is good to use it and where it isn't would be very
   helpful.

   For instance, should it only be used in .py files, or is it  
   worthwhile
   in the command line or notebook?  Is it worth using if something is
   evaluated fewer than (say) 100 times?  Can it be interspersed  
   with ZZ
   (I assume not) or RR(n), say RR(1000) (I have no idea)?  Thanks for
   any examples, especially from non-high-performance situations  
   where it
   still might speed things up considerably (or do something bad).

   The fast_float functionality is mostly for internal use, and is
   useful when one wants to evaluate an expression to double floating-
   point (i.e. 53-bits using the machine's native arithmetic) lots of
   times. Lots depends on the application, but is probably in the
   neighborhood of 10-100+, depending on the complexity of the equation
   and whether or not it has any symbolic values like pi (which slow
   down normal evaluation via maxima a huge amount). Thus it is suited
   to things like plotting or numerical integration. However, most such
   functions internally construct fast_float objects, so there usually
   is no need for the user to do so.

   That being said, there are plenty of use cases for it for end users.
   On the interact wiki (looking at the calculus page) it seems that
   fast_float is used when the function is evaluated a lot, and not when
   it is just passed off to something else (e.g. to contour_plot which
   (should) use the fast_float internally). The usage in Coordinate
   Transformations is probably redundant, as parametric_plot should be
   calling fast_float itself.

   Not sure it completely answers your question, but hopefully it helps.

   - 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] taking functions as arguments

2008-11-12 Thread pong

I defined a function which show the shaded area between the graphs of
two functions over an interval (maybe such function already exist?).
For example,

plot_shaded_area(sin(x), cos(x), 1,2)

show the shaded area between sine and cosine over [1,2]. Well, my
script doesn't work if I change cos(x) to 0. The reason is 0 is an
integer but not a function. I get around that by

plot_shaded_area(sin(x), lambda x:0, 1,2)

but I would like a more natural syntax as I don't want to scare my
students off from using SAGE.
Any help? Thanks.




--~--~-~--~~~---~--~~
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: taking functions as arguments

2008-11-12 Thread pong

Here is my script

def shaded_area_plot(f,g,c,d,a,b):
step = 0.01
vf = [(x,f(x)) for x in srange(a, (b+step), step)]
vg = [(x,g(x)) for x in srange(b, (a-step), -step)]
sha = polygon(vf + vg, rgbcolor='grey')
return(plot(f, (c,d)) + plot(g, (c,d), rgbcolor='red') + sha)

Most likely that's not well-written but I hope that's at least clear.

for example, then shaded_area_plot(sin(x), lambda x:0, 0, pi, 1, 2)
give me the shaded area between the sine curve and the x-axis over
[0,pi]

I hope there is a better solution to my problem.



On Nov 12, 9:22 am, Jason Grout [EMAIL PROTECTED] wrote:
 pong wrote:
  I defined a function which show the shaded area between the graphs of
  two functions over an interval (maybe such function already exist?).
  For example,

  plot_shaded_area(sin(x), cos(x), 1,2)

  show the shaded area between sine and cosine over [1,2]. Well, my
  script doesn't work if I change cos(x) to 0. The reason is 0 is an
  integer but not a function. I get around that by

  plot_shaded_area(sin(x), lambda x:0, 1,2)

  but I would like a more natural syntax as I don't want to scare my
  students off from using SAGE.
  Any help? Thanks.

 Actually, could you post your script?  There might an easier way to
 handle this.

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



[sage-support] Couldn't find published notebook

2008-11-10 Thread pong


I have published a  worksheet title Demo when server 2 was available.
However, I can no longer find it on the published worksheet list from
SAGE online. Any help?

Thanks in advance
--~--~-~--~~~---~--~~
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: simple question about \frac

2008-10-31 Thread pong

It works. Thanks.


On Oct 31, 1:15 am, Burcin Erocal [EMAIL PROTECTED] wrote:
 On Thu, 30 Oct 2008 20:49:33 -0700 (PDT)



 pong [EMAIL PROTECTED] wrote:

  I plot both ln(|x|) and 1/x on the same graph and try to label them by

  t1=text('$\frac{1}{x}$', (1,4), fontsize=14, rgbcolor='red');
  t2=text('$\ln(|x|)$', (1,5), fontsize=14)

  While SAGE understand perfectly what to do with \ln, it doesn't seem
  to know what to do with \frac:
  it complaints

  Traceback (click to the left for traceback)
  ...
  $ rac{1}{x}$ (at char 0), (line:1, col:1)

  why? it looks like \f means something...

 \f is a formfeed character, see here:

 http://www.python.org/doc/2.5.2/ref/strings.html

 putting an r before the quotes will give you a raw string, as
 described at the end of that document. This should work:

 t1=text(r'$\frac{1}{x}$', (1,4), fontsize=14, rgbcolor='red')

 Cheers,

 Burcin
--~--~-~--~~~---~--~~
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] simple question about \frac

2008-10-30 Thread pong


I plot both ln(|x|) and 1/x on the same graph and try to label them by

t1=text('$\frac{1}{x}$', (1,4), fontsize=14, rgbcolor='red');
t2=text('$\ln(|x|)$', (1,5), fontsize=14)

While SAGE understand perfectly what to do with \ln, it doesn't seem
to know what to do with \frac:
it complaints

Traceback (click to the left for traceback)
...
$ rac{1}{x}$ (at char 0), (line:1, col:1)

why? it looks like \f means something...

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



  1   2   >