[sage-support] Why does Sage Math crash instantly? / Running .sage files?

2019-04-08 Thread Adrian Scheuer
Hello. 
First of all, I need to Mention that I am completely new to Sage Math and I 
have no idea what causes my problem(s), like seriousely, no idea. When I 
start SageMath, it instantly crashes, I don't even touch anything. I'm 
running Windows 10 and I downloaded the binaries, a virtual box and this 
sage-8.6.tar.gz file. I am sure that I must be missing something but I 
don't know what. 
Yesterday, I managed to get Sage to work, so in the terminal i could write 
simple commands like sage:4+3 and later, I reinstalled python. Now it does 
not work anymore. 
My original aim was it to have sagetex in Latex, but for some reason 
running the .sage file which is created with every document using sagetex 
doesn't do anything and sage does not compile my document. And yes, I did 
follow the instructions how to make sagetex known to tex. 
I have no idea how to continue, so many problems and i'm desperately trying 
to get things to work. (Feel like I downloaded half the Internet...) 

Thank you very much for any help.

-- 
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] can't run sage in texmacs

2018-08-10 Thread adrian
Which version of TeXmacs and Safe are you using?

Ubuntu?

-- 
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: duplicate legend

2018-02-02 Thread adrian
Still some work must be done in the Sage plugin. In the meantime, the 
following plugin adaptation to the Python's TeXmacs plugin should work in 
Linux. I will try to have the Sage plugin be updated in the coming weeks, 
but in the meantime you can try this one. Just extract itand put into your 
.TeXmacs file inside your plugins directory.

I still need to look into the graphs shown in the plugin.

-A.



On Monday, January 22, 2018 at 8:12:04 AM UTC-6, HG wrote:
>
> Two years ago I made this pic in a texmacs sage session, but 
> unfortunatly sage doesn't work anymore with texmacs, I am reproducing it 
> but I have the legend problem, otherwise I think it should be even nicer 
> with new sage 8 xx . 
>
> Thanks for any help :) 
>
> Henri 
>
>
> Le 22/01/2018 à 14:57, Henri Girard a écrit : 
> > Hi, 
> > 
> > After looking in few old tickets, I can't correct the duplicate legend ? 
> > 
> > c=3e8;h=6.626*(10^-34);k = 1.281*(10^-23) 
> > k1=8*pi*h*c;k2=(h*c)/k 
> > E(l,T)=k1*(l*1e-9)^-5*(1/(exp(k2/((l*1e-9)*T))-1)) 
> > f1=0;f2=E(l,3500);f3=E(l,4000);f4=E(l,4500); 
> > params=dict(figsize=3,axes=False,fontsize=6, 
> > frame=True,gridlines="major", 
> > gridlinesstyle=dict(color="lightgrey", 
> > linestyle="-"), 
> > axes_labels=("$\Lambda[nm]$",\ 
> >  "$E(\\Lambda)[KJ/nm$"), 
> > legend_font_size=6) 
> > f1=0;f2=E(l,3500);f3=E(l,4000);f4=E(l,4500) 
> > b=plot([f2,f3],l,10,4000,legend_label="4000", 
> >fill =[0, [0]], 
> >   fillcolor=['blue','green'], 
> >   fillalpha=1) 
> > p=plot([f1,f2],l,10,4000,legend_label="3000", 
> >fill={1: [0]}, 
> >fillcolor=["red","yellow"], 
> >fillalpha=1) 
> > d=plot([f3,f4],l,10,4000,legend_label="5000", 
> >fill =[1, [0]], 
> >fillcolor=['yellow','red'], 
> >fillalpha=0.5) 
> > v=plot(p+b+d) 
> > v.show(**params) 
> > 
> > Any help ? 
> > 
> > Regards 
> > 
> > Henri 
> > 
>
>

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


adriansage2.tar.gz
Description: Binary data


[sage-support] introduction and help for math calculation online

2015-10-03 Thread Adrian Wielgosik
Hi,

My name is Adrian, I'm new here, and I don't have knowledge about Sage. I 
need somebody who help me understand How can I call to  webservice or 
something similar to calculate maths. Is something like that?, because I 
need solution to my final project for second degree. I'm thinking about web 
service to call to him and asking about solution of calculations. I'm 
preparing my final project in c#/ web app. I think that the bast way could 
be via web service, but If not, maybe some dll or RSS channel. I don't have 
idea about Sage and solutions of Sage. Any idea to help me? Additionally I 
need way to restrict similar calculations e.g. 3+2 and 2+3 . but It's the 
simplest. But if a calculations will be bigger and dificult, I don't have 
Idea to restrict them. Some Idea, languages, dlls, parses from c#. Please, 
help me! I don't have a lot of time now to prepare ma project, so I need 
you help. Thanks for each response.

Best wishes,
Adrian

-- 
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] Re: Sage 4.8 notebook/server error on OSX and Linux

2012-02-16 Thread Adrian
As usually, one tries to find the error source several hours and then, 
after asking for help, one finds it in minutes.

The problem was notebooks files got corrupted after a power outage. I've 
moved the directory to a backup location, recreated it by running Sage and 
then copied the old files from admin/ directory.

All is OK with an empty notebook folder. I'll search the user history to 
see if I can eliminate the error source.

Topic closed.

-- 
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] Sage 4.8 notebook/server error on OSX and Linux

2012-02-16 Thread Adrian
Hi,


I have just tried to move on to v4.8 and I have encountered an error, on both 
precompiled binaries for OSX 10.6 64bit (running on OSX 10.6.8) and on OpenSuse 
Linux 64bit (where Sage was compiled from sources, which went OK).

The error is as following: on any worksheet, if a click "evaluate" under a 
cell, the web browser sends the request to the server, and it waits for it, but 
it never receives one. Instead Sage outputs the same error several times 
(appended in the end). If I "save & close" and then reopen the worksheet I now 
see the result of "evaluate" under that cell which tells me the issue is in 
server's response to requests.


Sage error output (identical on pre-build binaries for OSX and on compiled from 
source sage on Suse Linux), repeated several times for one request:


2012-02-17 00:45:11+0200 [HTTPChannel,13,127.0.0.1] Exception rendering:
2012-02-17 00:45:11+0200 [HTTPChannel,13,127.0.0.1] Unhandled Error
Traceback (most recent call last):
  File 
"/data/sys/bin/sagemath.org/sage-4.8/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py",
 line 625, in gotResult
_deferGenerator(g, deferred)
  File 
"/data/sys/bin/sagemath.org/sage-4.8/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py",
 line 602, in _deferGenerator
deferred.callback(result)
  File 
"/data/sys/bin/sagemath.org/sage-4.8/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py",
 line 238, in callback
self._startRunCallbacks(result)
  File 
"/data/sys/bin/sagemath.org/sage-4.8/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py",
 line 307, in _startRunCallbacks
self._runCallbacks()
---  ---
  File 
"/data/sys/bin/sagemath.org/sage-4.8/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/internet/defer.py",
 line 323, in _runCallbacks
self.result = callback(self.result, *args, **kw)
  File 
"/data/sys/bin/sagemath.org/sage-4.8/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg/twisted/web2/resource.py",
 line 230, in 
).addCallback(lambda res: self.render(request))
  File 
"/data/sys/bin/sagemath.org/sage-4.8/devel/sagenb/sagenb/notebook/twist.py", 
line 1244, in render
notebook.add_to_user_history(H, self.username)
  File 
"/data/sys/bin/sagemath.org/sage-4.8/devel/sagenb/sagenb/notebook/notebook.py", 
line 956, in add_to_user_history
history = self.user_history(username)
  File 
"/data/sys/bin/sagemath.org/sage-4.8/devel/sagenb/sagenb/notebook/notebook.py", 
line 938, in user_history
for hunk in self.__storage.load_user_history(username):
  File 
"/data/sys/bin/sagemath.org/sage-4.8/devel/sagenb/sagenb/storage/filesystem_storage.py",
 line 251, in load_user_history
return self._load(filename)
  File 
"/data/sys/bin/sagemath.org/sage-4.8/devel/sagenb/sagenb/storage/filesystem_storage.py",
 line 134, in _load
return cPickle.load(open(self._abspath(filename)))
exceptions.EOFError: 



Thank you.

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

2011-01-18 Thread adrian
In the following I expected the line $y=x$ in red for q;  and the line
$y=-x$ in yellow for p.  The plot for p is as desired, but the plot
for q contains also the line $y=-x$.  This is using sage 4.6.1

#Is this a bug?
x,y=var('x y')
q=implicit_plot((x-y)/(x+y)==0,(x,-2,2),(y,-2,2),color='red')
p=implicit_plot((x+y)/(x-y)==0,(x,-2,2),(y,-2,2),color='yellow')
show(q)
show(p)
show(p+q)

-- 
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] the experimental wxpython package

2010-11-21 Thread adrian
I am using an asus EEE1000 (Intel atom), 32 bit with Ubuntu 110.10,
Maverick Meercat

I edited the file
/media/sage/sage-4.6-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/
pkgconfig/libpng.pc

since SAGE_ROOT was defined twice and while installing it complained
about that.

I installed the packages
libglu1-mesa-dev
libgl1-mesa-dev
libgtk2.0-dev
libwxgtk2.8-dev

and their dependencies.

But after compiling for a while it gave the error message:
In file included from ../include/wx/gsocket.h:179,
 from ../src/gtk/gsockgtk.cpp:21:
../include/wx/unix/gsockunx.h:40: error: using typedef-name ‘GSocket’
after ‘class’
/usr/include/glib-2.0/gio/giotypes.h:132: error: ‘GSocket’ has a
previous declaration here
../src/gtk/gsockgtk.cpp: In function ‘void _GSocket_GDK_Input(void*,
gint, GdkInputCondition)’:
../src/gtk/gsockgtk.cpp:34: error: ‘struct _GSocket’ has no member
named ‘Detected_Read’

Any ideas how to make the experimental package compile or have sage
use the wxpython that I have in my system?

-- 
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: sage console in ubuntu 10.10 and jmol

2010-11-11 Thread adrian
Solved!
I did sage -sh and then i tried jmol.  It said that it could not find
the main class because it could not find a directory related to open
jvm.  I had installed sun-java6, but I checked for the directory.  I
guess sage found the directory and assumed that I had openjava.  The
whole thing got solved once I went to Synaptic (not software center)
and completely remove all the open java packages as well as the iced
tea ones.

This did the trick.


On Oct 28, 2:57 pm, adrian  wrote:
> I installed the sage 4.5.3 binary in my little netbook, and when I
> type
> sphere()
> or show(sphere()=
>
> nothing happens.  I have the package sun-java6-bin sun-java6-jre and
> sun-java6-plugin installed.  All works in the notebook.
>
> Is this intended?
>
> I do the same in an ubuntu 10.04 and I do get the jmol window, unlike
> with 10.10.
> Thanks.
>
> -Adrián.

-- 
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] sage console in ubuntu 10.10 and jmol

2010-10-28 Thread adrian
I installed the sage 4.5.3 binary in my little netbook, and when I
type
sphere()
or show(sphere()=

nothing happens.  I have the package sun-java6-bin sun-java6-jre and
sun-java6-plugin installed.  All works in the notebook.

Is this intended?

I do the same in an ubuntu 10.04 and I do get the jmol window, unlike
with 10.10.
Thanks.

-Adrián.

-- 
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: sage 4.3.4 or 4.3.5 on solaris sparc

2010-04-19 Thread adrian
IT WORKED!!!

I just heard from the systems administrator, and the problem was,
indeed, the path to the gcc libraries.  Everything works so far.

Thank you very much for your patience and prompt answer.

-Adrian.
On Apr 2, 1:58 pm, "Dr. David Kirkby"  wrote:
> adrian wrote:
> > We did not compile sage, but used the one that was pre-compiled.  The
> > error is
> > ---
> > ImportError: ld.so.1: python: fatal: relocation error: file /opt/local/
> > src/sage-4.3.4-Solaris-sun4u-SunOS/local/lib//libntl.so: symbol
> > _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i:
> > referenced symbol not found
> > WARNING: Failure executing code: 'import sage.misc.preparser_ipython;
> > sage.misc.preparser_ipython.magma_colon_equals=True'
> > ---
>
> > We did put the paths for some libraries, and tried to make it work.
> > Interestingly, it can compute 1+2, but not much more than that.
>
> > This is what the output says:
>
> A few thoughts on this.
>
> 1) What version of 'tar' is first in your path? If it is the Sun version of 
> tar,
> it is incapable of extracting the tar file correctly.
>
> If so, try this, which will use a GNU version of tar.
>
> $ /usr/sfw/bin/gtar xfz sage-4.3.4-Solaris-sun4u-SunOS.tar.gz
>
> 2) Can you try
>
> $ rm -rf $HOME/.sage
>
> which will clear out any debris which might be left from previous failed
>
> When you try to run sage for the first time, you should get a message about
> rebuilding parts of sage,
>
> The Sage install tree may have moved.
> Regenerating Python.pyo and .pyc files that hardcode the install PATH
> (please wait at most a few minutes)...
> Do not interrupt this.
>
> and I believe it calls 'ranlib', 'ar' or similar. If /usr/ccs/bin is not in 
> the
> path, it will not find them which might result in a corrupted installation.
>
> If these are not found, it would be sensible that we report an error and exit,
> but I don't think that happens.
>
> 3) If that does not work, can you try the binary from this URL - use p7zip to
> decompress it, which is standard with recent releases of Solaris 10, though a
> patch (only available with a contract), is needed for older updates of 
> Solaris 10.
>
> http://boxen.math.washington.edu/home/kirkby/Solaris-binaries/sage-4
>
> It was built a Sun Blade 1000 and has been used on a Sun T5240 too.
>
> Dave

-- 
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: sage 4.3.4 or 4.3.5 on solaris sparc

2010-04-02 Thread adrian


[hilbert/export/grad/soto]> gcc -v
Reading specs from /opt/csw/gcc3/lib/gcc/sparc-sun-solaris2.8/3.4.6/
specs
Configured with: ../sources/gcc-3.4.6/configure --prefix=/opt/csw/gcc3
--with-local-prefix=/opt/csw --without-gnu-as --with-as=/usr/ccs/bin/
as --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-threads=posix --
enable-shared --enable-multilib --enable-nls --with-included-gettext --
with-libiconv-prefix=/opt/csw --with-x --enable-java-awt=xlib --enable-
languages=all
Thread model: posix
gcc version 3.4.6


On Apr 2, 3:42 am, "Dr. David Kirkby"  wrote:
> adrian wrote:
> > Hi,  in the math department here at Montana State, we were trying to
> > install sage on Sparc.  There are some reports that sage 4.3.4 could
> > be installed on Solaris/Sparc, and we got a binary following the
> > thread
>
> >http://groups.google.com/group/sage-support/browse_thread/thread/62a9...
>
> > Unfortunately, it seems that that binary of sage is not finding the
> > libraries in the places it thinks they are.  Is there a way to tell
> > sage where they are?
>
> > Thanks.
> > -Adrian.
>
> Can you be more specific about the libraries and post the error message? You
> probably need LD_LIBRARY_PATH to include the location of the gcc's libraries
> libgcc_s, libgfortran & libstdc++.
>
> Can you also post the output of gcc -v that was used to compile sage?
>
> Sage 4.3.4 has been built several times on Solaris and it passes all the
> selftests. It's been built on both sun4u and sun4v processor families, which
> includes anything capable of running Solaris 10.
>
> dave

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

To unsubscribe, reply using "remove me" as the subject.


[sage-support] sage 4.3.4 or 4.3.5 on solaris sparc

2010-04-01 Thread adrian
Hi,  in the math department here at Montana State, we were trying to
install sage on Sparc.  There are some reports that sage 4.3.4 could
be installed on Solaris/Sparc, and we got a binary following the
thread

http://groups.google.com/group/sage-support/browse_thread/thread/62a920bf860e9e82

Unfortunately, it seems that that binary of sage is not finding the
libraries in the places it thinks they are.  Is there a way to tell
sage where they are?

Thanks.
-Adrian.

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

To unsubscribe, reply using "remove me" as the subject.


[sage-support] Re: matrix restrict only works with row vectors.

2009-12-03 Thread adrian
Sorry; the function I wrote is wrong:

def restrict_right(M,W):
 return (M.transpose().restrict(W)).transpose()

On Dec 3, 11:23 pm, adrian  wrote:
> The following code breakes with
> ArithmeticError: subspace is not invariant under matrix
>
> since sage assumes that vectors are left vectors.  However there is no
> restrict_right nor restrict_left methods.
>
> V=VectorSpace(QQ,3)
> W=V.subspace_with_basis([[0,1,0],[1,1,0]])
> M=matrix(ZZ,3,3,[1,0,1,1,0,0,0,0,1])
> show(W)
> show(M)
> show(M.restrict(W))
>
> The fix is simple
> def restrict_right(W):
>      return (W.transpose().restrict(W)).transpose()
>
> I guess the same assumptions are made for restrict_domain and
> restrict_codomain
>
> V=VectorSpace(QQ,3)
> W=V.subspace_with_basis([[0,1,0],[1,1,0]])
> M=matrix(ZZ,3,3,[1,0,1,1,0,0,0,0,1])
>
> show(W)
> show(M)
> show(M.restrict(W))

-- 
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] matrix restrict only works with row vectors.

2009-12-03 Thread adrian
The following code breakes with
ArithmeticError: subspace is not invariant under matrix

since sage assumes that vectors are left vectors.  However there is no
restrict_right nor restrict_left methods.

V=VectorSpace(QQ,3)
W=V.subspace_with_basis([[0,1,0],[1,1,0]])
M=matrix(ZZ,3,3,[1,0,1,1,0,0,0,0,1])
show(W)
show(M)
show(M.restrict(W))


The fix is simple
def restrict_right(W):
 return (W.transpose().restrict(W)).transpose()


I guess the same assumptions are made for restrict_domain and
restrict_codomain

V=VectorSpace(QQ,3)
W=V.subspace_with_basis([[0,1,0],[1,1,0]])
M=matrix(ZZ,3,3,[1,0,1,1,0,0,0,0,1])

show(W)
show(M)
show(M.restrict(W))

-- 
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: forgot sagenb password

2009-09-30 Thread adrian

That works.

Thanks!!
On Sep 30, 12:30 pm, William Stein  wrote:
> On Wed, Sep 30, 2009 at 10:03 AM, adrian  wrote:
>
> > My login is adrianmatematico and I changed my password some time ago,
> > and I cannot remember it.  Is there a way to reset  or recover it?
>
> That's not easy for me to do yet.  However, what I can do trivially is make
>
> http://sage.math.washington.edu/home/wstein/tmp/adrianmatematico.tar.bz2
>
> which is an archive that has files
> adrianmatematico/number/worksheet.txt which are your worksheets.  I
> can probably change your password later but you would have to wait.
> In the meantime perhaps you can make a new account.
>
> 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] forgot sagenb password

2009-09-30 Thread adrian

My login is adrianmatematico and I changed my password some time ago,
and I cannot remember it.  Is there a way to reset  or recover it?

Thank you.
-Adrián.
--~--~-~--~~~---~--~~
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] Adding the need for the ttf-jsmath package in the FAQ

2009-08-28 Thread adrian

I use ubuntu Jaunty in an eee-pc 1000, and had a hard time making the
notebook look right.  I was aware that doing

sudo apt-get install jsmath

would solve the problem, but it didn't, since the equations were not
properly display.  I also had the package jsmath-fonts installed, but
it did not make the equations look right.

doing

sudo apt-get install ttf-jsmath

did solve the problem.  This is somewhere in the net, but I think it
should go in the FAQ.

Thank you.
-Adrian.
--~--~-~--~~~---~--~~
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: Printing a worksheet with plots does not work

2009-04-07 Thread adrian

I was reading some newsgroops and apparently it happens for a second
user, not for the regular user.  I switched to opera and now
everything works.  Sage is not at fault.

Plus, the jmol applet now works in ubuntu64!

I ran sage with
export SAGE_BROWSER=opera

I can print now.  Even pages with plots.

-Adrian


On Apr 5, 2:32 am, adrian  wrote:
> I think the problem is myfirefox:  I could not even print the google
> page; same problem happened.  I have no idea why; I could print some
> pages with graphics, but not others.  The problem is not sage, for
> sure.
>
> I am sorry about the post.
>
> Sage is innocent.
>
> Adrian.
>
> On Apr 5, 2:18 am, adrian  wrote:
>
>
>
> > I did click in the print icon in the middle of the worksheet, and then
> >firefoxopened a page where everything looks fine.
>
> > But when I try to print this latter one -from thefirefoxmenu- either
> > to a file or directly the plots don't show.
>
> > I use ubuntu64 hardy heron.  I ran the notebook with
> > sage -notebook -directory="/home/soto/Dropbox/sagestuff"
>
> > The problem also happens if I run sage online, so probably the problem
> > is infirefox, not in sage.  Is there a way to know?
>
> > I don't have this problem in my desktop (ubuntu32 intrepid running the
> > program in the normal mode).
>
> > This is a mystery to me.
>
> > Thanks.
> > -Adrian.
>
> > On Apr 4, 11:38 am, William Stein  wrote:
>
> > > On Sat, Apr 4, 2009 at 9:59 AM, adrian  
> > > wrote:
>
> > > > Hi,
>
> > > > I don't know if I am doing something wrong, but if a worksheet has a
> > > > command like
>
> > > > show(plot(cos(x),x,-3,3))
>
> > > > And then I try to print (say to a file), the output shows nothing
> > > > starting at the plot.
>
> > > *Precisely* how are you "trying to print"?  Do you click on the Print
> > > icon at the top middle of the sage worksheet first?
>
> > > > Any ideas?
> > > > Am I the only one?
>
> > > > Peace.
> > > > -Adrian.
>
> > > --
> > > 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Printing a worksheet with plots does not work

2009-04-05 Thread adrian

I think the problem is my firefox:  I could not even print the google
page; same problem happened.  I have no idea why; I could print some
pages with graphics, but not others.  The problem is not sage, for
sure.

I am sorry about the post.

Sage is innocent.

Adrian.

On Apr 5, 2:18 am, adrian  wrote:
> I did click in the print icon in the middle of the worksheet, and then
> firefox opened a page where everything looks fine.
>
> But when I try to print this latter one -from the firefox menu- either
> to a file or directly the plots don't show.
>
> I use ubuntu64 hardy heron.  I ran the notebook with
> sage -notebook -directory="/home/soto/Dropbox/sagestuff"
>
> The problem also happens if I run sage online, so probably the problem
> is in firefox, not in sage.  Is there a way to know?
>
> I don't have this problem in my desktop (ubuntu32 intrepid running the
> program in the normal mode).
>
> This is a mystery to me.
>
> Thanks.
> -Adrian.
>
> On Apr 4, 11:38 am, William Stein  wrote:
>
> > On Sat, Apr 4, 2009 at 9:59 AM, adrian  wrote:
>
> > > Hi,
>
> > > I don't know if I am doing something wrong, but if a worksheet has a
> > > command like
>
> > > show(plot(cos(x),x,-3,3))
>
> > > And then I try to print (say to a file), the output shows nothing
> > > starting at the plot.
>
> > *Precisely* how are you "trying to print"?  Do you click on the Print
> > icon at the top middle of the sage worksheet first?
>
> > > Any ideas?
> > > Am I the only one?
>
> > > Peace.
> > > -Adrian.
>
> > --
> > 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Printing a worksheet with plots does not work

2009-04-05 Thread adrian

I did click in the print icon in the middle of the worksheet, and then
firefox opened a page where everything looks fine.

But when I try to print this latter one -from the firefox menu- either
to a file or directly the plots don't show.

I use ubuntu64 hardy heron.  I ran the notebook with
sage -notebook -directory="/home/soto/Dropbox/sagestuff"

The problem also happens if I run sage online, so probably the problem
is in firefox, not in sage.  Is there a way to know?

I don't have this problem in my desktop (ubuntu32 intrepid running the
program in the normal mode).

This is a mystery to me.

Thanks.
-Adrian.

On Apr 4, 11:38 am, William Stein  wrote:
> On Sat, Apr 4, 2009 at 9:59 AM, adrian  wrote:
>
> > Hi,
>
> > I don't know if I am doing something wrong, but if a worksheet has a
> > command like
>
> > show(plot(cos(x),x,-3,3))
>
> > And then I try to print (say to a file), the output shows nothing
> > starting at the plot.
>
> *Precisely* how are you "trying to print"?  Do you click on the Print
> icon at the top middle of the sage worksheet first?
>
>
>
> > Any ideas?
> > Am I the only one?
>
> > Peace.
> > -Adrian.
>
> --
> 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Printing a worksheet with plots does not work

2009-04-04 Thread adrian

Hi,

I don't know if I am doing something wrong, but if a worksheet has a
command like

show(plot(cos(x),x,-3,3))

And then I try to print (say to a file), the output shows nothing
starting at the plot.

Any ideas?
Am I the only one?

Peace.
-Adrian.
--~--~-~--~~~---~--~~
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: maximum recursion depth exceeded in cmp

2009-03-26 Thread adrian

This is a dirty solution, but it might be interesting:

It is possible to implement "tail recursion"; this would solve the
problem for certain kinds of recursion; but will fail if the call is
not a tail call, and I think this code won't work, but some variations
would...

I toss it as an idea:

The code is taken from http://code.activestate.com/recipes/474088

import sys

class TailRecurseException:
  def __init__(self, args, kwargs):
self.args = args
self.kwargs = kwargs

def tail_call_optimized(g):
  """
  This function decorates a function with tail call
  optimization. It does this by throwing an exception
  if it is it's own grandparent, and catching such
  exceptions to fake the tail call optimization.

  This function fails if the decorated
  function recurses in a non-tail context.
  """
  def func(*args, **kwargs):
f = sys._getframe()
if f.f_back and f.f_back.f_back \
and f.f_back.f_back.f_code == f.f_code:
  raise TailRecurseException(args, kwargs)
else:
  while 1:
try:
  return g(*args, **kwargs)
except TailRecurseException, e:
  args = e.args
  kwargs = e.kwargs
  func.__doc__ = g.__doc__
  return func

@tail_call_optimized
def factorial(n, acc=1):
  "calculate a factorial"
  if n == 0:
return acc
  return factorial(n-1, n*acc)

 print factorial(1)
 prints a big, big number,
 but doesn't hit the recursion limit.

@tail_call_optimized
def fib(i, current = 0, next = 1):
  if i == 0:
return current
  else:
return fib(i - 1, next, current + next)

print fib(1)

also prints a big number,
but doesn't hit the recursion limit.

@tail_call_optimized
def say(something):
  print something
  say(something)
say('hello')

If I remember correctly, this code breaks and hangs the computer if
the tail is not a tail call; but there seems to be other solutions in
http://code.activestate.com/recipes/474088 that solve this problem

I would love if sage included a similar decorator; but am not sure of
the implications.

Another alternative is rewriting your code... to use iterations
instead of recursion whenever possible.

Peace.
-Adri'an.


On Mar 26, 6:24 am, agi  wrote:
> Hi,
> I have a recursive algorithm that works well if it doesn't need more
> than 5637 iterations.
> In the case of more than 5637 iterations the error message is:
> RuntimeError: maximum recursion depth exceeded in cmp
>
> Is there a way to make SAGE execute it for more than 5637 iterations?
--~--~-~--~~~---~--~~
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: Bug in plot?

2009-03-18 Thread adrian

Yes, that solved it.

I don't understand what happened.

After saving, quitting and doing it again, all problems were solved.

Thanks.

On Mar 18, 2:11 pm, "ma...@mendelu.cz"  wrote:
> On 18 Bře, 20:23, adrian  wrote:
>
> > If i try to do
> > plot(cos(x),(x,-3,3))
>
> This command works in Internet versionwww.sagenb.org
> The same for sphere()
>
> Maybe something hangs from previous computation? Did the restart of
> worksheet not help?
>
> Robert
>
> > in sage 3.4 (through the internet version)
> > it brakes with the message
> > TypeError: a float is required
>
> > The command worked in sage 3.3
>
> > Also, in the notebook
>
> > sphere()
>
> > produces nothing; but
> > (sphere()).show()
> > launches the jmol applet as desired.
>
> > I don't know if that is the desired behaviour (It wasn't like that in
> > sage 3.3)
--~--~-~--~~~---~--~~
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 plot?

2009-03-18 Thread adrian

If i try to do
plot(cos(x),(x,-3,3))
in sage 3.4 (through the internet version)
it brakes with the message
TypeError: a float is required

The command worked in sage 3.3

Also, in the notebook

sphere()

produces nothing; but
(sphere()).show()
launches the jmol applet as desired.

I don't know if that is the desired behaviour (It wasn't like that in
sage 3.3)
--~--~-~--~~~---~--~~
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: 3D plots side by side

2009-03-13 Thread adrian

I don't know about the plots.  To have interact evaluate when you say
so, just add auto_update=False as in the example below:

@interact
def f(a='G',b=(1,2,.1),c=True,u = text_control
(value='cow'),d=xsrange(1,50),auto_update=False,f=range(5),g=range
(20),h=matrix(ZZ,2,2,[1,2,3,4]),i=3):
pass


On Mar 13, 4:32 am, Mani chandra  wrote:
> Hi,
>
>     How can I get 3D plots side by side? Also when using interact for
> sliders, how do I make it such that the evaluation is done after maybe I
> press some button instead of it being evaluated immediately after I
> change a value on the slider?
>
> Thanks
> Mani chandra
--~--~-~--~~~---~--~~
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: attach works in command line but not in notebook

2009-02-07 Thread adrian

I am sorry, I read it wrong; you are indeed giving the full path.
Something I was thinking is that it could be related to what happens,
in addition to what others have commented is:

1) The error is "Syntax error" not "File not found", so maybe the
quotes arround the path would work.

2) The file is in /media/...   Does it work with other files in other
directories?  With .sage files?

3)  Can you attach a file in ~/.sage?

Well, I hope this is fixed.   Or just changing the extension, as
Marshal suggested, should work.  This would explain the Syntax Error.

-Adrian.

On Feb 7, 6:37 am, ricardomayerb  wrote:
> Thank you, Adrian.
>
> But I think I gave the full path when I used the command:
>
> attach /media/disk/thesiswork/thesis2009/sage/src/sympy_files/
> thesis_sympy_2009.py
>
> but it did not worked in notebook mode (but happens to work perfectly
> in command-line mode, I just tried it)
>
> Maybe the way to go, for now, is your suggestion of invoking sage with
> this -notebook directory option
>
> Best,
> R
>
> On Feb 6, 3:52 pm, adrian  wrote:
>
> > You need to give the full path if you are in the notebook.
> > If you strongly need to not to give the full path you could run the
> > command
> > $mkdir (where your files are)/sagenotebook
> > $sage -notebook directory="Where your files are/sagenotebook"
>
> > The disadvantage is that this will create another server, and you
> > won't be able to see the worksheets you had in .sage/notebook
>
> > this was the discussion 
> > inhttp://groups.google.com/group/sage-support/browse_thread/thread/3779...
>
> > This kind of behaviour is the reason for the ticket 
> > inhttp://trac.sagemath.org/sage_trac/ticket/5169
>
> > Hope this helps
>
> > -Adrian.
>
> > On Feb 6, 10:40 am, ricardomayerb  wrote:
>
> > > Dear all,
>
> > >   I'm trying to attach a python script. I'm probably doing somethign
> > > wrong, but the weird thing is that what I do works for the command
> > > line but not from the notebook. Let me show you.
>
> > > This works:
> > > --
> > > | Sage Version 3.2.3, Release Date: 2009-01-05                       |
> > > | Type notebook() for the GUI, and license() for information.        |
> > > --
> > > sage: os.getcwd()
> > > '/home/ricardo/sage-3.2.2'
> > > sage: os.chdir('/media/disk/thesiswork/thesis2009/sage/src/
> > > sympy_files')
> > > sage: os.getcwd
> > > ()
> > > '/media/disk/thesiswork/thesis2009/sage/src/sympy_files'
> > > sage: attach thesis_sympy_2009.py
>
> > > So no problem there.
>
> > > but this doesn't:
>
> > > sage: notebook()
> > > The notebook files are stored in: /home/ricardo/.sage//sage_notebook
>
> > > os.chdir('/media/disk/thesiswork/thesis2009/sage/src/sympy_files')
>
> > > attach thesis_sympy_2009.py
> > > --->Error attaching /home/ricardo/.sage/thesis_sympy_2009.py -- file
> > > not
> > > found
>
> > > os.getcwd()
> > > --->'/home/ricardo/.sage/sage_notebook/worksheets/admin/4/cells/3'
>
> > > ...so obviously os.chdir didn't change the dir where the notebook
> > > looks for files (mybe is not supposed to...). Thus, I tried using an
> > > absolute path instead:
>
> > > attach /media/disk/thesiswork/thesis2009/sage/src/sympy_files/
> > > thesis_sympy_2009.py
> > > ---> Syntax Error:
> > > attach
> > > /media/disk/thesiswork/thesis2009/sage/src/sympy_files/
> > > thesis_sympy_2009\
> > > .py
>
> > > how could I use absolute paths with attach inside a notebook? Is there
> > > a workaround?
>
> > > I also tried setting the variable DIR to /media/disk/thesiswork/
> > > thesis2009/sage/src/sympy_files/ and then using attach
> > > thesis_sympy_2009.py but it didn't work either
>
> > > thanks in advance for your help
>
> > > Ricardo
--~--~-~--~~~---~--~~
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: attach works in command line but not in notebook

2009-02-06 Thread adrian

You need to give the full path if you are in the notebook.
If you strongly need to not to give the full path you could run the
command
$mkdir (where your files are)/sagenotebook
$sage -notebook directory="Where your files are/sagenotebook"

The disadvantage is that this will create another server, and you
won't be able to see the worksheets you had in .sage/notebook

this was the discussion in
http://groups.google.com/group/sage-support/browse_thread/thread/37795251481402a1/552ac0654c85f4ec?lnk=gst&q=attach#552ac0654c85f4ec

This kind of behaviour is the reason for the ticket in
http://trac.sagemath.org/sage_trac/ticket/5169

Hope this helps

-Adrian.

On Feb 6, 10:40 am, ricardomayerb  wrote:
> Dear all,
>
>   I'm trying to attach a python script. I'm probably doing somethign
> wrong, but the weird thing is that what I do works for the command
> line but not from the notebook. Let me show you.
>
> This works:
> --
> | Sage Version 3.2.3, Release Date: 2009-01-05                       |
> | Type notebook() for the GUI, and license() for information.        |
> --
> sage: os.getcwd()
> '/home/ricardo/sage-3.2.2'
> sage: os.chdir('/media/disk/thesiswork/thesis2009/sage/src/
> sympy_files')
> sage: os.getcwd
> ()
> '/media/disk/thesiswork/thesis2009/sage/src/sympy_files'
> sage: attach thesis_sympy_2009.py
>
> So no problem there.
>
> but this doesn't:
>
> sage: notebook()
> The notebook files are stored in: /home/ricardo/.sage//sage_notebook
>
> os.chdir('/media/disk/thesiswork/thesis2009/sage/src/sympy_files')
>
> attach thesis_sympy_2009.py
> --->Error attaching /home/ricardo/.sage/thesis_sympy_2009.py -- file
> not
> found
>
> os.getcwd()
> --->'/home/ricardo/.sage/sage_notebook/worksheets/admin/4/cells/3'
>
> ...so obviously os.chdir didn't change the dir where the notebook
> looks for files (mybe is not supposed to...). Thus, I tried using an
> absolute path instead:
>
> attach /media/disk/thesiswork/thesis2009/sage/src/sympy_files/
> thesis_sympy_2009.py
> ---> Syntax Error:
> attach
> /media/disk/thesiswork/thesis2009/sage/src/sympy_files/
> thesis_sympy_2009\
> .py
>
> how could I use absolute paths with attach inside a notebook? Is there
> a workaround?
>
> I also tried setting the variable DIR to /media/disk/thesiswork/
> thesis2009/sage/src/sympy_files/ and then using attach
> thesis_sympy_2009.py but it didn't work either
>
> thanks in advance for your help
>
> Ricardo
--~--~-~--~~~---~--~~
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] showing the answer of solve in the notebook.

2009-02-04 Thread adrian

If, in the notebook one writes:
a,b,c,d,n=var('a b c d n')
solve([a*d-b*c==1,a*d/(a*d - b*c) - c*(a*n + b)/(a*d - b*c)==1,c*d/
(a*d - b*c) - c*(c*n + d)/(a*d - b*c)==0, a*(c*n + d)/(a*d - b*c) -b*c/
(a*d - b*c)==1],a,b,c,d)

sage does not return anything.

if one does, instead
a,b,c,d,n=var('a b c d n')
r=solve([a*d-b*c==1,a*d/(a*d - b*c) - c*(a*n + b)/(a*d - b*c)==1,c*d/
(a*d - b*c) - c*(c*n + d)/(a*d - b*c)==0, a*(c*n + d)/(a*d - b*c) -b*c/
(a*d - b*c)==1],a,b,c,d)
print(r) #show(r) also works

Then sage does return
[
[a == 1/r14, b == r13, c == 0, d == r14]
]
(The answer has two degrees of freedom...)

This behavior is different than

solve([a*x+b*n==c,c*x+d*n==e],x,n)

which does display the answer without first assigning and then showing
the answer.

In the console, sage has no problem in giving the answer for both.

Thanks, and I think SAGE is a wonderful program.

-Adrian.

--~--~-~--~~~---~--~~
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: attaching files that attach other files in the notebook

2009-02-03 Thread adrian

Thanks!

I tried also to make a folder .sage inside of PROGRAMS, and, inside of
sage session:

notebook(directory=PROGRAMS/.sage)

this way I can attach files inside of programs just by doing attach
file.sage.  The problem, as you mentioned above is that it cannot see
the other worksheets inside of ~/.sage, and one sets another
password...

The proposal in the ticket would certainly solve this.

Thanks a bunch.
-Adrian.

On Feb 3, 4:30 pm, William Stein  wrote:
> On Tue, Feb 3, 2009 at 3:12 PM, adrian  wrote:
>
> > I just changed all to absolute paths, and called the file using an
> > absolute path.  It works now.  So I guess I made a mistake earlier.
> > So, I guess there are no bugs in attach.
>
> > Still, this is not a good solution to me, since that would force me to
> > modify all the files if I move the directory around, or change from
> > one computer to a different one. The best solution I did was to do the
> > symlinks to .sage.
>
> > I still don't understand what happens if I change the DIR variable.
>
> > Thanks.  I guess my wish is to be able to change the working
> > directory, at least for files that are attached.
>
> > Thanks a bunch.
>
> I made a ticket that I think would accomplish this:
>
> http://trac.sagemath.org/sage_trac/ticket/5169
--~--~-~--~~~---~--~~
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: attaching files that attach other files in the notebook

2009-02-03 Thread adrian

I just changed all to absolute paths, and called the file using an
absolute path.  It works now.  So I guess I made a mistake earlier.
So, I guess there are no bugs in attach.

Still, this is not a good solution to me, since that would force me to
modify all the files if I move the directory around, or change from
one computer to a different one. The best solution I did was to do the
symlinks to .sage.

I still don't understand what happens if I change the DIR variable.

Thanks.  I guess my wish is to be able to change the working
directory, at least for files that are attached.

Thanks a bunch.

On Feb 3, 3:25 pm, William Stein  wrote:
> On Tue, Feb 3, 2009 at 12:28 PM, Nathan Carter  
> wrote:
>
> > Does the directory argument to notebook() do what you want?  (See
> > notebook? for more info.)
>
> That makes a completely separate sage notebook server whose local files
> are stored in the given directory.
>
> Michael Abshoff:
>
> > This sounds like a bug in attach to me, i.e. attach with an absolute
> > path should not prepend $DOT_SAGE. Should be easy enough to fix.
>
> I agree that this sounds like a bug in attach.
>
> 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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] attaching files that attach other files in the notebook

2009-02-03 Thread adrian

I have a folder PROGRAMS where I have two files:  substitutions.sage
and morphisms.sage
The first line in substitutions.sage is
attach morphisms.sage

This works well if I cd into PROGRAMS and then run sage.  This way I
can do
sage: attach substitution.sage

and everything works as expected.  This is my prefered way to edit
files (I edit in Emacs, and everything works fine), and I can move the
directory around.

However, If I want to use the notebook, it uses by default the
directory ~/.sage, and I don't know of a way to change that.

I tried changing the value of DIR with no success.
I tried giving the complete path, but it always prepends ~/.sage/ to
the file morphism.sage.
Giving the full path in morphism.sage does not work either, since it
prepends ~/.sage/ to the path.
I tried changing it  using ../../ but this breaks the behavior I want
to edit files using a text editor and the console.

I guess I can do a symlink into .sage, but I guess there should be a
nicer solution.

Any ideas?

Thanks.

-Adrian.
--~--~-~--~~~---~--~~
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 jmol without the java applet in a worksheet.

2009-01-23 Thread adrian

That did it!!!

Thanks!!
-Adrian.

On Jan 23, 2:49 pm, Robert Bradshaw 
wrote:
> On Jan 23, 2009, at 11:06 AM, adrian wrote:
>
> > Is there a way in a worksheet to display a 3d plot using jmol without
> > the applet; i.e.,  not embedded, but using the usual java; as it does
> > if one used the terminal.
>
> You can set sage.plot.plot.EMBEDDED_MODE = False, but that might have  
> other side effect too. Note this only works if you're runnign the  
> server locally.
>
> - Robert
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Using jmol without the java applet in a worksheet.

2009-01-23 Thread adrian

Is there a way in a worksheet to display a 3d plot using jmol without
the applet; i.e.,  not embedded, but using the usual java; as it does
if one used the terminal.


--~--~-~--~~~---~--~~
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: The image of a matrix

2008-12-14 Thread adrian

I think the following is also a source of frustration:

v=vector([1,2,3])
rm=matrix(v)#This will be a row matrix
cm=v.transpose()#This will be a column matrix.

What would the convention be for this one?  This came up in another
discussion:

http://groups.google.com/group/sage-support/browse_thread/thread/24fa62276520b799/2ba996a4f9d18545?hl=en&lnk=gst&q=vector+to+matrix#2ba996a4f9d18545

Keep the good work.




On Dec 14, 3:48 am, mabshoff  wrote:
> On Dec 14, 2:44 am, daveloeffler  wrote:
>
>
>
> > That
>
> > On Dec 13, 6:50 pm, Jason Grout  wrote:
>
> > > That sounds the best way.  We'll make kernel_left/right (along with
> > > left/right_kernel) the global functions, and people can do
>
> > > kernel = left_kernel
>
> > > in their init.sage or at the beginning of their session, if they want.
>
> > \begin{devils-advocate}
> > That's inviting people to write code which will then silently and
> > mysteriously not work as soon as they pass it on to someone else.
> > \end{devils-advocate}
>
> > David
>
> Yes, people will do dumb things if they are given a chance, but at
> least it will not be code in the Sage library that causes any more
> trouble. I guess someone has to get burned a couple times to realize
> that customization can be evil. If this happens a lot it won't be long
> before we ask bug submitters to provide their init.sage along with the
> code in question that causes trouble.
>
> 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: How do I create a matrix whose elements are functions of the row & column indices?

2008-12-10 Thread adrian

 I think the order of the i and j is transposed (assuming row i and
column j):
sage: M = matrix(5,5,[[1/(i+j%2) for j in range(1,6)] for i in range
(1,6)])
sage: M

[1/2   1 1/2   1 1/2]
[1/3 1/2 1/3 1/2 1/3]
[1/4 1/3 1/4 1/3 1/4]
[1/5 1/4 1/5 1/4 1/5]
[1/6 1/5 1/6 1/5 1/6]
s
M = matrix(5,5,[[1/(i+j%2) for j in range(1,6)] for i in range(1,6)])

On Dec 10, 4:24 pm, "David Joyner" <[EMAIL PROTECTED]> wrote:
> One way to do it (for a 10x10):
>
> sage: n = 10
> sage: M = Matrix(n,n,[[1/(i+j) for i in range(1,11)] for j in range(1,11)])
> sage: M
>
> [ 1/2  1/3  1/4  1/5  1/6  1/7  1/8  1/9 1/10 1/11]
> [ 1/3  1/4  1/5  1/6  1/7  1/8  1/9 1/10 1/11 1/12]
> [ 1/4  1/5  1/6  1/7  1/8  1/9 1/10 1/11 1/12 1/13]
> [ 1/5  1/6  1/7  1/8  1/9 1/10 1/11 1/12 1/13 1/14]
> [ 1/6  1/7  1/8  1/9 1/10 1/11 1/12 1/13 1/14 1/15]
> [ 1/7  1/8  1/9 1/10 1/11 1/12 1/13 1/14 1/15 1/16]
> [ 1/8  1/9 1/10 1/11 1/12 1/13 1/14 1/15 1/16 1/17]
> [ 1/9 1/10 1/11 1/12 1/13 1/14 1/15 1/16 1/17 1/18]
> [1/10 1/11 1/12 1/13 1/14 1/15 1/16 1/17 1/18 1/19]
> [1/11 1/12 1/13 1/14 1/15 1/16 1/17 1/18 1/19 1/20]
>
> On Wed, Dec 10, 2008 at 5:19 PM, Alasdair <[EMAIL PROTECTED]> wrote:
>
> > The title pretty much says it all - for example, how would I create a
> > 4x4 matrix whose (i,j)-th element is 1/(i+j)?
>
> > Thanks,
> > Alasdair
--~--~-~--~~~---~--~~
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] A limit question.

2008-12-03 Thread adrian

sage: limit(x*0,x=oo)
0
sage: limit(x*oo,x=0)
0

This seems wrong to me; and probably the problem is that x*oo should
not be allowed to begin with...

-Adrian.
--~--~-~--~~~---~--~~
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] questions about types.

2008-12-03 Thread adrian

In the following code:
sage: x=CC['x'].gen()
sage: type(x)

sage: f(x)=sin(x)
sage: type(x)


Is this intended?

--~--~-~--~~~---~--~~
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: Error when launching Sage

2008-12-03 Thread adrian

I got the same problem.  In ubuntu amd 64 hardy, I got the following
missing:

pebs ssse3 pge clflush sep syscall vme tsc est vmx xtpr nx
constant_tsc pat bts lm msr fpu fxsr tm pae arch_perfmon acpi cx8 mce
de mca pse rep_good ht apic dca monitor lahf_lm tm2 ss ds_cpl pbe cx16
pse36 mtrr dts

shall I do something?

-Adrian.
On Nov 28, 12:57 pm, Jeffrey Straszheim <[EMAIL PROTECTED]>
wrote:
> That appears to have worked.
>
> Thank you.
>
>
>
> > You have hit a bug introduce by accident via #3761.
>
> > Edit the file $SAGE_ROOT/local/lib/sage-flags.txt and remove the "nx"
> > and "up" flag.
> > Cheers,
>
> > Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: sage and tkinter?

2008-12-03 Thread adrian

I came accross the same thing a while ago.  In the post "GUI for sage"
http://groups.google.com/group/sage-support/browse_thread/thread/6cea70d6be0436fa/582b7f836eee9816?lnk=gst&q=tk#582b7f836eee9816
, William Stein suggested the following:

(1) Make sure you've installed the tk devel package.it's called
 tk8.4-dev under Ubuntu.(Make sure the tk version is at least
8.3.)

(2) Make sure SAGE's Python has Tk support included.   It will
if you built Python yourself and already had tk8.0-dev installed.
Otherwise, you'll have to rebuild the Python interpreter included in
SAGE:
  sage -i sage -f python-2.5.1.p3
Here I got the version number as the latest Python package
listed at SAGE_ROOT/spkg/installed.  One could also look at
  http://sagemath.org/packages/standard/

I think the order of the  last command is wrong, though, it should be:
sage -f -i python-2.5.2.p8

(at least with the latest version of the packages)

Hope this helps.

-Adrian
On Dec 3, 9:11 am, Jaap Spies <[EMAIL PROTECTED]> wrote:
> David Joyner wrote:
> > System wide, it works fine:
>
> For me it works:
>
> --
> | Sage Version 3.2.1, Release Date: 2008-12-01   |
> | Type notebook() for the GUI, and license() for information.|
> --
>
> sage: import Tkinter
>
> sage: import _tkinter
>
> sage:
>
> Jaap
--~--~-~--~~~---~--~~
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: java plugin for ubuntu 8.04 on amd64

2008-11-10 Thread adrian

Thanks a lot.

-Adrian

On Nov 7, 3:19 am, Pablo Angulo <[EMAIL PROTECTED]> wrote:
> > Hm  I can give it a try.  As a work around, is it possible to have
> > the behaviour of jmol so that instead of being embeded in the webpage
> > as an applet it launches it as it normally would?
>
> In Intrepid, the icedtea plugin does not work either. I've heard you can
> install the sun java plugin if you install a 32bit firefox:
>
> http://ubuntuforums.org/showthread.php?p=1174435
>
> However, if you use the TeXmacs session, and write for example:
>
> g=sphere()
> show(g)
>
> a jmol window pops up and works ok with the openjdk.
>
> Regards
> Pablo
--~--~-~--~~~---~--~~
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: java plugin for ubuntu 8.04 on amd64

2008-11-06 Thread adrian

Hm  I can give it a try.  As a work around, is it possible to have
the behaviour of jmol so that instead of being embeded in the webpage
as an applet it launches it as it normally would?

Thanks.
-Adrian.

On Nov 6, 7:13 pm, Dan Drake <[EMAIL PROTECTED]> wrote:
> On Thu, 06 Nov 2008 at 04:42PM -0800, adrian wrote:
> > I have tried to find the plugin, and apparently the only one available
> > is the iced tea one, but the jmol applet does not work with it.
>
> There may not be any solution except to install the Intrepid version,
> which I think does work -- the problem, I think, is that the plugin
> doesn't support "LiveConnect". Looking at LP207064 [1], you might want
> to try loading this applet:
>
>  http://developer.apple.com/internet/safari/samples/ColorBlockApplet.html
>
> if LiveConnect is the problem, I'm guessing that won't work. The bug
> report has some suggestions for new versions to try installing.
>
> Dan
>
>   1.https://bugs.launchpad.net/ubuntu/+source/icedtea-gcjwebplugin/+bug/2...
> --
> ---  Dan Drake <[EMAIL PROTECTED]>
> -  KAIST Department of Mathematical Sciences
> ---  http://mathsci.kaist.ac.kr/~drake
>
>  signature.asc
> < 1KViewDownload
--~--~-~--~~~---~--~~
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] java plugin for ubuntu 8.04 on amd64

2008-11-06 Thread adrian

I have tried to find the plugin, and apparently the only one available
is the iced tea one, but the jmol applet does not work with it.

Any ideas?


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



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

2008-10-21 Thread adrian

sage: var('x,y')
sage: plot3d(sin(x*y),(x,-1,1),(y,-1,1)).show()

This launches jmol, and one is able to rotate the shape.  One can also
save the image and then import the saved image into Texmacs

sage: var('x,y')
sage: plot3d(sin(x*y),(x,-1,1),(y,-1,1)).show(viewer='tachyon')

launches a viewer (eog) of a file in format png. one can also save and
then import.

However, the behaviour for 2d plots is nice in that it immediatly
includes it in the text.

On Oct 21, 7:45 pm, DJDANG <[EMAIL PROTECTED]> wrote:
> TeXmacs allows to plot 2D graphics but when I try to plot any 3D
> object it just shows "Graphics3D Object", so I gess TeXmacs doesn't
> support sage 3D plotting.
> Anyway thanks for the help.
>
> On 20 oct, 09:55, "William Stein" <[EMAIL PROTECTED]> wrote:
>
> > On Mon, Oct 20, 2008 at 6:26 AM, DJDANG <[EMAIL PROTECTED]> wrote:
>
> > > Hi everyone, I'm having trouble trying to display 3D graphic objects
> > > made with sage onTeXmacs. Everytime I try to plot any kind of 3D
> > > object, it just says "Graphics3D Object" and that's it, nothing else
> > > show up.
> > > Please anyone who knows how this works give some advise or some other
> > > option to use.
>
> > Thetexmacs/sage interface was written by Mike Hansen before
> > Sage had any 3D plotting, so I suspect it doesn't at all support
> > it.  That said, two questions:
> >    (1) does 2D plotting work?
> >    (2) What happens if you do
> > sage: var('x,y')
> > sage: plot3d(sin(x*y),(x,-1,1),(y,-1,1)).show()
> >    (3) What if you do
> > sage: var('x,y')
> > sage: plot3d(sin(x*y),(x,-1,1),(y,-1,1)).show(viewer='tachyon')
>
> > > Thanks in advance,
> > > Daniel
>
> > --
> > William Stein
> > Associate Professor of Mathematics
> > University of 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: Memoizing methods.

2008-09-03 Thread adrian

That is exactly what I wanted.

Thanks!!!

-Adrian.

On Sep 3, 7:31 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
> Hi Adrian,
>
> I wrote some code to do this a few releases ago.  It's the
> cached_method decorator in Sage.  Here's your example:
>
> sage: class dog():
> :     def __init__(self, bark='guau'):
> :         self._bark = bark
> :     @cached_method
> :     def bark(self):
> :         sleep(5)
> :         return (self._bark + " ")*3
> :
> sage: sparky = dog()
> sage: sparky.bark()  #5 seconds
> 'guau guau guau '
> sage: sparky.bark()  #instant
> 'guau guau guau '
>
> If you're curious, you can find the code in sage/misc/cachefunc.py
>
> --Mike
--~--~-~--~~~---~--~~
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] Memoizing methods.

2008-09-03 Thread adrian

I guess this is more like a Python question, but I guess it would be
very useful for speeding up some computations in sage.  I took the
definition for the Memoize class from the net, but does not quite work
as I want for methods.

Consider the following:

class Memoize:
   """Memoize(fn) - an instance which acts like fn but memoizes its
arguments
  Will only work on functions with non-mutable arguments; since it
uses
  the arguments as keys for a dictionary, and hence the keys need
to be
  hashable.
   """
   def __init__(self, fn):
   self.fn = fn
   self.memo = {}
   def __call__(self, *args):
   if args not in self.memo:
   self.memo[args] = self.fn(*args)
   return self.memo[args]


class dog():
def __init__(self,bark='guau'):
self.bark=bark
@Memoize
def bark(self):
sleep (5)
return bark+' '+bark+' '+bark

sparky=dog()

The only way to run the above example is sparky.bark(sparky) or
dog.bark(sparky), since sparky.bark() does not work.  Removing the
decorator, sparky.bark() works but takes 5 seconds everytime, unlike
the Memoized version.

Is there a way to have a version of Memoize that behaves nicely with
methods?  A redirection to the appropriate page or documentation is
also ok.

Thanks.
Peace.
-Adrian.
--~--~-~--~~~---~--~~
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: Bugs in DiGraph ?

2008-08-25 Thread adrian

I don't have a track account.  Maybe some day I'll take a look at the
code...

Thanks.

-Adrian.

On Aug 25, 10:39 pm, adrian <[EMAIL PROTECTED]> wrote:
> The example they gave would be enough:
>
> For a digraph with multiple edges and labels, one must provide a list
> within the dictionary:
>
> sage: G=DiGraph({1:{1:['hola','hi'], 2:['two','dos']},2:{1:['one']}},
> loops=True, multiedges=True)
> sage: G.edges()
> [(1, 1, 'hi'), (1, 1, 'hola'), (1, 2, 'dos'), (1, 2, 'two'), (2, 1,
> 'one')]
>
> This would be enough, but I think that somewhere in the code there
> would be something like:
> for i in l:
>
> and the code assumes that l is a list.  But if someone does what I did
> and passes a string, the code still works, but has the behavior I
> saw.  It would be good to do a checkup like
>
> If type(l)<>list:  print "please type a list"; raise "error"...
>
> But I am happy if it gets into the documentation, which is where I
> would look for.
>
> Thank you.
>
> -Adrian.
>
> On Aug 25, 8:46 am, Jason Grout <[EMAIL PROTECTED]> wrote:
>
> > adrian wrote:
> > > I now get it, when I said {1:{1:'hola'}... it understood {1:
> > > {1:list('hola')  and hence treated hola as a list.
>
> > > I don't recall reading that one should input as a list if one selects
> > > multiedges, at least I don't recall seeing an example with that
> > > notation.  This is, I think a little bit of a tricky thing, since the
> > > notation works for regular graphs.
>
> > > At least I know what to do now.  But I don't know if the behavior here
> > > is intended.  Probably it works like that to have a short way of
> > > entering several edges with one level.  Or the authors did not intend
> > > it to work that way, in which case it could be fixed.
>
> > > One example with that behavior in the documentation would be great.
>
> > > Thanks a bunch.
> > > -Adrian.
>
> > Do you have a trac account?  Would you like to post an example you think
> > makes the documentation clearer?  If you don't have a trac account, you
> > can get one by emailing mabshoff (see the instructions 
> > onhttp://wiki.sagemath.org/TracGuidelines) or you can just reply here and
> > give the input and output of a command to go into the EXAMPLES section
> > of the documentation.  You can precede that command with an explanation,
> > too.
>
> > Thanks,
>
> > 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] Re: Bugs in DiGraph ?

2008-08-25 Thread adrian

The example they gave would be enough:

For a digraph with multiple edges and labels, one must provide a list
within the dictionary:

sage: G=DiGraph({1:{1:['hola','hi'], 2:['two','dos']},2:{1:['one']}},
loops=True, multiedges=True)
sage: G.edges()
[(1, 1, 'hi'), (1, 1, 'hola'), (1, 2, 'dos'), (1, 2, 'two'), (2, 1,
'one')]

This would be enough, but I think that somewhere in the code there
would be something like:
for i in l:

and the code assumes that l is a list.  But if someone does what I did
and passes a string, the code still works, but has the behavior I
saw.  It would be good to do a checkup like

If type(l)<>list:  print "please type a list"; raise "error"...

But I am happy if it gets into the documentation, which is where I
would look for.

Thank you.

-Adrian.


On Aug 25, 8:46 am, Jason Grout <[EMAIL PROTECTED]> wrote:
> adrian wrote:
> > I now get it, when I said {1:{1:'hola'}... it understood {1:
> > {1:list('hola')  and hence treated hola as a list.
>
> > I don't recall reading that one should input as a list if one selects
> > multiedges, at least I don't recall seeing an example with that
> > notation.  This is, I think a little bit of a tricky thing, since the
> > notation works for regular graphs.
>
> > At least I know what to do now.  But I don't know if the behavior here
> > is intended.  Probably it works like that to have a short way of
> > entering several edges with one level.  Or the authors did not intend
> > it to work that way, in which case it could be fixed.
>
> > One example with that behavior in the documentation would be great.
>
> > Thanks a bunch.
> > -Adrian.
>
> Do you have a trac account?  Would you like to post an example you think
> makes the documentation clearer?  If you don't have a trac account, you
> can get one by emailing mabshoff (see the instructions 
> onhttp://wiki.sagemath.org/TracGuidelines) or you can just reply here and
> give the input and output of a command to go into the EXAMPLES section
> of the documentation.  You can precede that command with an explanation,
> too.
>
> Thanks,
>
> 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] Re: Bugs in DiGraph ?

2008-08-23 Thread adrian

I now get it, when I said {1:{1:'hola'}... it understood {1:
{1:list('hola')  and hence treated hola as a list.

I don't recall reading that one should input as a list if one selects
multiedges, at least I don't recall seeing an example with that
notation.  This is, I think a little bit of a tricky thing, since the
notation works for regular graphs.

At least I know what to do now.  But I don't know if the behavior here
is intended.  Probably it works like that to have a short way of
entering several edges with one level.  Or the authors did not intend
it to work that way, in which case it could be fixed.

One example with that behavior in the documentation would be great.

Thanks a bunch.
-Adrian.

On Aug 22, 9:55 pm, Jason Grout <[EMAIL PROTECTED]> wrote:
> Jason Grout wrote:
> > adrian wrote:
> >> Now, there is another problem:
>
> >> Say, I want to define a multigraph with selfloops, and edge labels..
> >> One way to do this is:
>
> >> import networkx
> >> G=networkx.XDiGraph(selfloops=True,multiedges=True)
> >> for i in range(3): G.add_node(i)
> >> for i in [(1,1,'hola'),(1,1,'hi'),(1,2,'two'),(1,2,'dos'),
> >> (2,1,'one')]: G.add_edge(i)
> >> G=DiGraph(G)
>
> >> Now, I would be tempted to just do the following:
> >> G=DiGraph({1:{1:'hola',1:'hi',2:'two',2:'dos'},2:{1:'one'}},
> >> loops=True, multiedges=True)
>
> >> or trying
>
> >> import networkx
> >> G=networkx.XDiGraph({1:{1:'hola',1:'hi',2:'two',2:'dos'},2:{1:'one'}},
> >> selfloops=True, multiedges=True)
>
> >> But in each case  I get:
>
> >> G.edges()
>
> >> (1, 1, 'h'), (1, 1, 'i'), (1, 2, 'd'), (1, 2, 'o'), (1, 2, 's'), (2,
> >> 1,
> >> 'o'), (2, 1, 'n'), (2, 1, 'e')]
>
> >> Which is not as intended for two reasons:  One is that the labels are
> >> wrong, and the other one is that it created three edges from 1 to 2.
>
> >> Any help?
>
> > It looks like it is creating an edge for every character in every other
> > label, which I think is a bug.  I've created a ticket to track the
> > status of this bug:http://trac.sagemath.org/sage_trac/ticket/3928
>
> > Thanks for reporting it.
>
> As Robert Miller noted on the ticket, there is nothing wrong going on
> here.  The correct way to create the graph that you want is:
>
> sage: G=DiGraph({1:{1:['hola','hi'], 2:['two','dos']},2:{1:['one']}},
> loops=True, multiedges=True)
> sage: G.edges()
> [(1, 1, 'hi'), (1, 1, 'hola'), (1, 2, 'dos'), (1, 2, 'two'), (2, 1, 'one')]
>
> Thanks,
>
> 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] Bugs in DiGraph ?

2008-08-21 Thread adrian

The following  works nice:
G=Graph({0:[1,2],1:[2,3],2:[4]})
G.show()

But the following produces a wrong drawing
H=DiGraph({0:[1,2],1:[2,3],2:[4]})
H.show()

However, H.show3d() works fine

Now, there is another problem:

Say, I want to define a multigraph with selfloops, and edge labels..
One way to do this is:

import networkx
G=networkx.XDiGraph(selfloops=True,multiedges=True)
for i in range(3): G.add_node(i)
for i in [(1,1,'hola'),(1,1,'hi'),(1,2,'two'),(1,2,'dos'),
(2,1,'one')]: G.add_edge(i)
G=DiGraph(G)

Now, I would be tempted to just do the following:
G=DiGraph({1:{1:'hola',1:'hi',2:'two',2:'dos'},2:{1:'one'}},
loops=True, multiedges=True)

or trying

import networkx
G=networkx.XDiGraph({1:{1:'hola',1:'hi',2:'two',2:'dos'},2:{1:'one'}},
selfloops=True, multiedges=True)

But in each case  I get:

G.edges()

(1, 1, 'h'), (1, 1, 'i'), (1, 2, 'd'), (1, 2, 'o'), (1, 2, 's'), (2,
1,
'o'), (2, 1, 'n'), (2, 1, 'e')]


Which is not as intended for two reasons:  One is that the labels are
wrong, and the other one is that it created three edges from 1 to 2.

Any help?


--~--~-~--~~~---~--~~
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: online sage and vista.

2008-07-07 Thread adrian

Never mind.  It works now.



On Jul 5, 7:52 pm, adrian <[EMAIL PROTECTED]> wrote:
> I don't know if this problem is common one:
>
> I was working in vista.  It logged in into sage via the sage website.
>
> I had two 3d graphs of a sphere.
>
> Then java correctly showed me the one I was looking.
>
> But the second jmol appeared black.  And it said:  "script
> terminated".
>
> Any ideas?
>
> Has the issue of jmol in ubuntu-hardy resolved by the way?
>
> Thanks a lot.
>
> -Adrian.
--~--~-~--~~~---~--~~
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] online sage and vista.

2008-07-05 Thread adrian

I don't know if this problem is common one:

I was working in vista.  It logged in into sage via the sage website.

I had two 3d graphs of a sphere.

Then java correctly showed me the one I was looking.

But the second jmol appeared black.  And it said:  "script
terminated".

Any ideas?

Has the issue of jmol in ubuntu-hardy resolved by the way?

Thanks a lot.

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