aleph.sagemath.org

70 views
Skip to first unread message

Jason Grout

unread,
Feb 9, 2012, 3:06:58 PM2/9/12
to sage-...@googlegroups.com
We just finished a pretty big upgrade of our experimental beta
aleph.sagemath.org sage cell server. Now it is running Sage 5.0beta3
with the new jmol 12.x from the new notebook. If anyone sees any
problems with aleph, please let us know.

Thanks,

Jason

Jason Grout

unread,
Feb 9, 2012, 6:24:08 PM2/9/12
to sage-devel, John Travis, Rob Beezer

We put in some backwards-compatible shims so that existing code works,
but we highly encourage several changes for people that are embedding
aleph into their webpages:

1. The script tags to add are now:

<script type="text/javascript"
src="http://aleph.sagemath.org/static/jquery.min.js"></script>
<script type="text/javascript"
src="http://aleph.sagemath.org/embedded_sagecell.js"></script>


(notice that jquery doesn't have a version number anymore, and
'singlecell' was replaced with 'sagecell')

2. The singlecell.makeSinglecell function becomes sagecell.makeSagecell

3. The singlecell.init function becomes sagecell.init

We'll probably remove the compatibility shims when we release 1.0. I'm
not sure when that will be (we've been real close for a long time, but
we've also been really busy with the semester and the new sage
notebook). But it won't hurt to update your code soon.

Thanks,

Jason

kcrisman

unread,
Feb 9, 2012, 8:58:36 PM2/9/12
to sage-devel


On Feb 9, 6:24 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
> On 2/9/12 2:06 PM, Jason Grout wrote:
>
> > We just finished a pretty big upgrade of our experimental beta
> > aleph.sagemath.org sage cell server. Now it is running Sage 5.0beta3
> > with the new jmol 12.x from the new notebook. If anyone sees any
> > problems with aleph, please let us know.
>
> We put in some backwards-compatible shims so that existing code works,
> but we highly encourage several changes for people that are embedding
> aleph into their webpages:
>
> 1. The script tags to add are now:
>
>   <script type="text/javascript"
> src="http://aleph.sagemath.org/static/jquery.min.js"></script>
>   <script type="text/javascript"
> src="http://aleph.sagemath.org/embedded_sagecell.js"></script>
>
> (notice that jquery doesn't have a version number anymore, and
> 'singlecell' was replaced with 'sagecell')
>
> 2. The singlecell.makeSinglecell function becomes sagecell.makeSagecell
>
> 3. The singlecell.init function becomes sagecell.init

Do things also change to

inputLocation: "#sagecell-test",

then?

Alex Kramer

unread,
Feb 9, 2012, 9:41:32 PM2/9/12
to sage-...@googlegroups.com
On Thu, Feb 9, 2012 at 8:58 PM, kcrisman <kcri...@gmail.com> wrote:
> Do things also change to
>
>          inputLocation: "#sagecell-test",
>
> then?

Not necessarily, the inputLocation/outputLocation fields for embedding
should be able to be set to anything as long as it is a valid jQuery
selector that corresponds to a single, unique element on the page.

kcrisman

unread,
Feb 9, 2012, 10:21:15 PM2/9/12
to sage-devel


On Feb 9, 9:41 pm, Alex Kramer <kramer.alex.kra...@gmail.com> wrote:
> On Thu, Feb 9, 2012 at 8:58 PM, kcrisman <kcris...@gmail.com> wrote:
> > Do things also change to
>
> >          inputLocation: "#sagecell-test",
>
> > then?
>
> Not necessarily, the inputLocation/outputLocation fields for embedding
> should be able to be set to anything as long as it is a valid jQuery
> selector that corresponds to a single, unique element on the page.

Oh, of course. So that is not a Sagecell internal thing, but just a
normal div reference or something. Sorry for the confusion.

Rob Beezer

unread,
Feb 10, 2012, 11:49:31 PM2/10/12
to sage-devel
Thanks, Jason. Nice work. I added an implicit 3-D plot example as a
third example on my personal home page, and it seems to load and run
quite quickly. Looking at the page source there (plus a few CSS items
in buzzard.css to hide some of the debugging output) might be helpful
for those who want to do something similar.

http://buzzard.ups.edu/home.html

Rob

Jason Grout

unread,
Feb 11, 2012, 12:00:50 AM2/11/12
to sage-...@googlegroups.com
On 2/10/12 10:49 PM, Rob Beezer wrote:
> Thanks, Jason. Nice work. I added an implicit 3-D plot example as a
> third example on my personal home page, and it seems to load and run
> quite quickly. Looking at the page source there (plus a few CSS items
> in buzzard.css to hide some of the debugging output) might be helpful
> for those who want to do something similar.
>
> http://buzzard.ups.edu/home.html

Lots of the credit goes to Alex Kramer.

You don't have to use CSS anymore to hide things. We explicitly support
hiding the Session numbers, etc. See
https://github.com/jasongrout/sagecell/blob/massive-upgrade/doc/embedding.rst

Jason

Andrey Novoseltsev

unread,
Feb 12, 2012, 7:21:33 PM2/12/12
to sage-devel
On Feb 10, 10:00 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
> You don't have to use CSS anymore to hide things.  We explicitly support
> hiding the Session numbers, etc.  Seehttps://github.com/jasongrout/sagecell/blob/massive-upgrade/doc/embed...
>
> Jason

First of all, thanks for awesome work! I've tried to use it for a
couple of my interacts (which work fine in unpatched Sage-4.8):

http://www.math.ualberta.ca/~novoseltsev/2012Winter215R1/test1
http://www.math.ualberta.ca/~novoseltsev/2012Winter215R1/test2

Neither of them work - one does not produce output, another one shows
some error. I have no idea why don't they work and no idea how to
figure it out, so some help/suggestions would be very much
appreciated!

Thank you!
Andrey

Alex Kramer

unread,
Feb 12, 2012, 7:56:46 PM2/12/12
to sage-...@googlegroups.com
On Sun, Feb 12, 2012 at 7:21 PM, Andrey Novoseltsev <novo...@gmail.com> wrote:
> First of all, thanks for awesome work! I've tried to use it for a
> couple of my interacts (which work fine in unpatched Sage-4.8):
>
> http://www.math.ualberta.ca/~novoseltsev/2012Winter215R1/test1
> http://www.math.ualberta.ca/~novoseltsev/2012Winter215R1/test2
>
> Neither of them work - one does not produce output, another one shows
> some error. I have no idea why don't they work and no idea how to
> figure it out, so some help/suggestions would be very much
> appreciated!

I'm still trying to track down the first problem, but the second error
appears to be an issue with a class that attempts to ensure interact
syntax compatibility with the regular sagenb (we re-wrote interacts
for the sage cell). I've opened an issue for that here:
https://github.com/sagemath/sagecell/issues/245

Thanks for reporting the issues!

Alex Kramer

unread,
Feb 12, 2012, 10:52:27 PM2/12/12
to sage-...@googlegroups.com
On Sun, Feb 12, 2012 at 7:21 PM, Andrey Novoseltsev <novo...@gmail.com> wrote:
> First of all, thanks for awesome work! I've tried to use it for a
> couple of my interacts (which work fine in unpatched Sage-4.8):
>
> http://www.math.ualberta.ca/~novoseltsev/2012Winter215R1/test1
> http://www.math.ualberta.ca/~novoseltsev/2012Winter215R1/test2
>
> Neither of them work - one does not produce output, another one shows
> some error. I have no idea why don't they work and no idea how to
> figure it out, so some help/suggestions would be very much
> appreciated!

The issue with the first example results from type coercion with
interact controls not working properly. I've opened an issue here
about it: https://github.com/sagemath/sagecell/issues/246

Until that's fixed (which hopefully should be soon), if you manually
do the type coercion, the first interact appears to work perfectly.
I'm not quite sure about a quick fix for the second interact yet.
Thanks again for the bug reports!

Jason Grout

unread,
Feb 13, 2012, 7:15:45 AM2/13/12
to sage-...@googlegroups.com

Very cool interact (that second one). I fixed the problem. However,
you need to add:

u,v=var('u,v')

at the top before the definition of the interact to get it to work
right. This is a separate problem from the one in the issue above.

Here is a permalink of what I mean: http://tinyurl.com/76tsadv

Alex: it looks like there is another issue with the slider not appearing
in this interact. I think you knew about this one (when we have a
layout with more than one control horizontally). See the above code
example for details.

So I guess this means two more tickets:

1. Why do we have to add u,v=var('u,v') in the sage cell, but not in the
notebook

2. Sliders disappearing when they are first in a row of controls using
the layout option.

Thanks,

Jason

Andrey Novoseltsev

unread,
Feb 13, 2012, 10:31:41 AM2/13/12
to sage-devel
Alex and Jason - thanks for tracking down and fixing problems so
quickly!

I'm using such interacts for in-class demonstrations and publish
worksheets for students, but as I don't have much time to actually
"explain Sage" and not many students ask questions if posted
instructions are unclear, I'd really like just to have web-pages with
interacts.

A couple of other issues that I have noticed:

1. Following the permalink http://tinyurl.com/76tsadv I see "=" under
"y(u, v)", not next to it (Firefox 10 on Win7Pro64, if it is relevant
- notebook version is fine).

2. A different font is used for mathematics - is it how it is supposed
to be? In notebook things look like I would expect in LaTeX. In
singlecell it is something else - looks fine, but not what I expect.

3. This is a problem with notebook as well: I like making labels like
"$y(u, v) = $" for input boxes. But in this case the space on the
right of "=" is bigger than on the left and it does not look pretty,
so I insert "\hskip{-1ex}" to fix it, but it is annoying. While minor,
it looks even worse when a bunch of boxes are used as coefficients in
an equation (e.g. https://sage.math.ualberta.ca:8015/home/pub/2/ ).
Also, when there are several boxes in a row, the label of the right
box is closer to the left input box than the label of this left input
box! So it is necessary to add commas/space in the beginning of the
right label to avoid confusion.

Once again - thanks a lot for your work!
Andrey

Jason Grout

unread,
Feb 13, 2012, 1:20:12 PM2/13/12
to sage-...@googlegroups.com
On 2/13/12 9:31 AM, Andrey Novoseltsev wrote:
> Alex and Jason - thanks for tracking down and fixing problems so
> quickly!
>
> I'm using such interacts for in-class demonstrations and publish
> worksheets for students, but as I don't have much time to actually
> "explain Sage" and not many students ask questions if posted
> instructions are unclear, I'd really like just to have web-pages with
> interacts.

I feel the same way. I think having free registration on sagenb.org
opens up our "market" quite a bit. Having widgets you can embed on a
webpage opens us up to at least an order of magnitude more people.


>
> A couple of other issues that I have noticed:
>
> 1. Following the permalink http://tinyurl.com/76tsadv I see "=" under
> "y(u, v)", not next to it (Firefox 10 on Win7Pro64, if it is relevant
> - notebook version is fine).

This is probably just an issue with the sizing of tables. Thanks for
pointing this out; we'll see about fixing it.

>
> 2. A different font is used for mathematics - is it how it is supposed
> to be? In notebook things look like I would expect in LaTeX. In
> singlecell it is something else - looks fine, but not what I expect.

The sage cell server uses mathjax, while the notebook uses jsmath (the
predecessor to mathjax) currently. We will be switching the notebook to
mathjax really soon, as it really is much better than jsmath in many ways.

>
> 3. This is a problem with notebook as well: I like making labels like
> "$y(u, v) = $" for input boxes. But in this case the space on the
> right of "=" is bigger than on the left and it does not look pretty,
> so I insert "\hskip{-1ex}" to fix it, but it is annoying. While minor,
> it looks even worse when a bunch of boxes are used as coefficients in
> an equation (e.g. https://sage.math.ualberta.ca:8015/home/pub/2/ ).
> Also, when there are several boxes in a row, the label of the right
> box is closer to the left input box than the label of this left input
> box! So it is necessary to add commas/space in the beginning of the
> right label to avoid confusion.

Yes, the layout issues are some of issues we haven't settled completely.
We'd like to add an HTML layout option that lets you just use
arbitrary HTML code to style your controls. Then you can do whatever
you want with them.

Jason

Andrey Novoseltsev

unread,
Feb 15, 2012, 1:22:22 AM2/15/12
to sage-devel
On Feb 13, 5:15 am, Jason Grout <jason-s...@creativetrax.com> wrote:
> Very cool interact (that second one).  I fixed the problem.  However,
> you need to add:
>
> u,v=var('u,v')
>
> at the top before the definition of the interact to get it to work
> right.  This is a separate problem from the one in the issue above.

Maybe this is not quite a bug. It seems that using SR.var instead of
just var works inside the interac function. In principle, as I
understand it, using var inside of functions is discouraged as there
can be some problems with the scopes where names are injected. I had a
similar problem some time ago but don't recall the details.

Thank you!
Andrey

Jason Grout

unread,
Feb 15, 2012, 2:46:05 AM2/15/12
to sage-...@googlegroups.com

Good point. The part that bothers me is that someone said these
interacts worked in the notebook (I haven't checked though; do they?),
so there is something of a backwards compatibility thing going on.

Jason

Andrey Novoseltsev

unread,
Feb 15, 2012, 10:15:19 AM2/15/12
to sage-devel
Yes, they do work for me in Sage-4.8. Is the any difference in the
scope where notebook and single cell servers execute interacts?

Andrey

Jason Grout

unread,
Feb 15, 2012, 10:19:32 AM2/15/12
to sage-...@googlegroups.com

Interacts were completely rewritten from scratch for the sage cell
server, so likely there is such a difference.

Jason


Reply all
Reply to author
Forward
0 new messages