Ask Your Question

Alex Kramer's profile - activity

2012-09-23 06:45:03 -0600 answered a question What broke?

The problem (which is definitely a regression on our end), is stemming from FigureSize using a generator for a list.

For now, if you change the relevant portion to:

FigureSize =  slider([i +1 for i in xrange(20)], default = 9, label="figure size")

the code works as expected. I've opened a bug report here: https://github.com/sagemath/sagecell/...

2012-07-31 10:30:35 -0600 answered a question Sagecell kwargs no longer works

I thinkthis is an issue related to a change we made regarding how defining controls in the interact decorator works. I've opened an issue about that behavior here: https://github.com/sagemath/sagecell/...

In the meantime, since t is being defined in the function globals, you can access it from there (or just by the variable t). One thing you might want to do for now to ensure consistent behavior with local variables and kwargs for the function is to either define all interacted variables in the interact decorator or define all interacted variables in the function itself until the issue is resolved.

2012-06-28 11:38:48 -0600 received badge  Editor (source)
2012-06-28 11:38:32 -0600 answered a question Sage cell server - do I really need so many makeSagecell invocations?

Here's a quick example of some HTML+javascript that automatically makes all elements with a given class into sagecells: http://sage.math.washington.edu/home/alexkramer/sagecell_test.html (view source to see the JS) ... However, it looks like right now there's some sort of CSS bug that's preventing a lot of debugging-type printing from being dynamically hidden. But it at least shows that what you want is certainly possible to do.

2012-05-29 12:44:03 -0600 received badge  Good Answer (source)
2012-05-01 16:27:51 -0600 received badge  Supporter (source)
2012-04-30 17:01:30 -0600 received badge  Nice Answer (source)
2012-04-30 11:37:03 -0600 answered a question arrange sage interact input elements

You should be able to accomplish this with the layout parameter to @interact. Here's one sample from the interact documentation:

@interact(layout={'top': [['a', 'b']], 'left': [['c']], 'bottom': [['d']]})
def _(a=x^2, b=(0..20), c=100, d=x+1): print a+b+c+d

Nested lists allow specification of both distinct rows of interact controls and distinct elements within each row, which is what I think you're asking about.

2012-03-22 05:48:05 -0600 commented answer Sage cell server install

Hi, I'm one of the developers of the project. We're currently working on simplifying the install process quite a bit and eliminating some of the dependency requirements. For now, you can always embed the sage cell into any webpage you want, though. EDIT: Here's the embedding documentation: https://github.com/sagemath/sagecell/blob/master/doc/embedding.rst, there's a fairly simple example at the bottom of the page.

2012-02-21 08:06:19 -0600 received badge  Good Answer (source)
2012-02-20 03:19:08 -0600 received badge  Nice Answer (source)
2012-02-19 17:56:42 -0600 received badge  Teacher (source)
2012-02-19 16:57:03 -0600 answered a question Is sage supported with javascript?

If what you want to do is 'embed' Sage-specific Python code on a website, execute that code, and have the output of that code displayed, the Sage Cell Server (demo at aleph.sagemath.org) exists for just this purpose. The current repository is located at github.com/sagemath/sagecell/ and instructions for embedding into arbitrary HTML files are located at github.com/sagemath/sagecell/blob/master/doc/embedding.rst. The example at the very bottom of that page is probably the easiest way to get started.