Hi,

so I got back to it again, thanks for all the support I got here and
thanks William for the patches. Here are my replies:

On Wed, Feb 11, 2009 at 10:22 PM, Dan Drake <dr...@kaist.edu> wrote:
> On Wed, 11 Feb 2009 at 07:54AM -0800, Ondrej Certik wrote:
>> I am not there yet, but I created this howto:
>>
>> http://wiki.sagemath.org/SageVirtualBox
>
> I mentioned this on IRC, but so that anyone who is looking through list
> archives knows, I wrote a similar guide:
>
> http://wiki.sagemath.org/DanDrake/JustEnoughSageServer

Thanks, I added a link to your wiki to:

http://wiki.sagemath.org/SageVirtualBox




On Wed, Feb 11, 2009 at 10:41 AM, William Stein <wst...@gmail.com> wrote:
>
> On Wed, Feb 11, 2009 at 10:18 AM, Ondrej Certik <ond...@certik.cz> wrote:
>> Btw, I am behind a university firewall that doesn't allow me to use
>> IRC. Does anyone remember the iptables or route rules to forward the
>> IRC connection through my server? I know I can setup ssh port
>> forwarding, but then I would have to log to localhost and fiddle with
>> the IRC client, so I'd prefer to forward all outgoing connections to
>> the IRC port via my own external server. Don't loose time with this, I
>> can figure it out after I study it, but maybe you know it immediately.
>
> I just ssh to sage.math and type irssi.

That works like a charm, I am now using it too. Thanks!




On Wed, Feb 11, 2009 at 9:36 AM, mabshoff <mabsh...@googlemail.com> wrote:
>
>
>
> On Feb 11, 9:22 am, Ondrej Certik <ond...@certik.cz> wrote:
>> On Wed, Feb 11, 2009 at 9:15 AM, William Stein <wst...@gmail.com> wrote:
>
> <SNIP>
>
>> > That is not how the notebook works.    By default the notebook
>> > listens *only* on localhost, which means nobody else.  This is a very
>> > important security feature.  If you want the notebook to listen to the
>> > outside world, just do
>>
>> >  sage: notebook(address="")
>>
>> > and the notebook will listen for connections on all interfaces.
>>
>> Oops, you are right, I forgot about this. Now everything works, I
>> updated the howto:
>>
>> http://wiki.sagemath.org/SageVirtualBox
>
> But do you get that oddity with the token? Because that if you can
> reproducibly hit that problem you are the first one who has a chance
> to debug this as someone we know with a technical understanding of
> Python.

Unfortunately I stopped getting it. Well, it's fortunate for me that
it works, unfortunate that I can't debug it easily.

>>> Slide to the bottom of the page to see the image. However, I noticed
>>> with this approach, that if I update the plotting commands and
>>> regenerate the .png image, the result gets messed up sometimes and I
>>> had to stop the worksheet, restart it and reevaluate all cells again,
>>> then it works. Is this a known problem? What is the workaround?
>>
>> In sage mode, I've never seen problems like this.  Weird.   It should
>> just work.   Maybe this is a problem with using python mode, and the
>> directory
>> not being properly changed or something.  What happens if you make
>> sure all the images have *different* filenames (say something random)?
>
>
> Is this problem characterized by:
>
> 1. Create a plot in a cell
>
> 2. change the plotting code, evaluate the cell. Then maybe delete the
> cell.  Save the worksheet and come back to it later.
>
> 3. Run a different plotting comand, or update a cell.  When you evaluate
> the first time, the graphics are old graphics from other cells.
> Evaluate All refreshes the graphics, though.
>
> or something like the above?  It seems like the root problem is
> something like #5177, where the old image stays around for longer than
> it should.

Thanks for all this help. I think it was my fault.  Here is how to reproduce it:

1) create a new worksheet (no matter which mode), for example at sagenb.org

2)

import pylab
pylab.plot([1, 2, 3], [1, 2, 1])
pylab.savefig("a.png")

# it plots a plot, all a-ok

3) go back and change [1, 2, 1] to [1, 2, 3], reevaluate, it will
produce this messed up plot:

http://www.sagenb.org/home/pub/281/


And here is how to fix it:

1) add pylab.cla() right after "import pylab" and rerun it.

So it's a matplotlib feature. Sorry about the confusion.


>> 1) how can I change what gets imported by default in an empty
>> worksheet? I use Python mode, but sage still gets imported and it
>> polutes the namespace. :)
>
> Hmmm... First, this can definitely be fixed.
> [takes 10 minutes]
> OK, I wrote a small patch that modifies the sage notebook so that it
> starts up all worksheet processes in Pure Python mode without
> importing the sage library.  It's a 2-line modification to
> notebook/worksheet.py.  See attached.  After applying this the
> individual worksheets will actually startup a lot faster and be more
> lightweight, but of course no specific sage functionality is available
> unless one does  "import sage.all".  Tab completion and introspection
> still works fine though without importing sage.all.
> gh

Thanks William for the patch, it does exactly what I wanted. I updated
my server, now I have a better address:

http://nb.hpfem.org/

If yo go there, you can see that I customized it a bit --- when I find
more time, I'll probably change colors or something to make it more
different, so that people don't confuse my local modifications with
the default sage notebook.

Is it ok with you if I rename it from Sage notebook to Hermes notebook
and only leave a link to sagemath.org at the front page and in the
help? Well, I know it's opensource, so I could do that, but I meant if
you have some long term strategy how you would like people to use &
install the modified sage notebooks.


Some other things I have been doing with the notebook:

Since my research topis is electronic structure calculations, I took
the most famous electronic structure program abinit.org, which is in
fortran, I replaced their build system with cmake, installed it into
Sage, wrote Python wrappers that produce input files and read output
files from it, installed it to Sage and here is how it looks like:

http://nb.hpfem.org/home/pub/7/

Now I need to play with graphics, e.g. create plots from all the
programs that I am interested in and then it will start to rock. Then
I'll try to interface all the other programs too.

I am surprised noone did that before (I mean except Sage for some math
programs), but it's so obvious thing to do. I want all my programs and
everything I use to be easily available in the notebook, so that I can
play with it whenever I am and show it live during
teaching/presentations. And also invite other people to play with it
too, if it's just a few mouse clicks. Well, I just wasn't thinking
this way before either, but now it's clear to me that this is the way
to go.

Ondrej

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

Reply via email to