Ask Your Question

twch's profile - activity

2024-04-14 16:03:34 +0200 received badge  Popular Question (source)
2024-04-14 16:03:34 +0200 received badge  Notable Question (source)
2024-02-23 22:06:27 +0200 received badge  Notable Question (source)
2024-02-23 22:06:27 +0200 received badge  Popular Question (source)
2022-03-26 22:49:38 +0200 received badge  Good Question (source)
2021-02-01 19:33:42 +0200 received badge  Popular Question (source)
2020-04-24 04:10:06 +0200 received badge  Famous Question (source)
2020-02-07 19:08:33 +0200 received badge  Good Answer (source)
2020-01-15 22:35:41 +0200 received badge  Nice Question (source)
2018-06-12 23:00:26 +0200 received badge  Popular Question (source)
2018-06-12 23:00:26 +0200 received badge  Notable Question (source)
2018-06-07 16:50:35 +0200 received badge  Nice Question (source)
2017-10-09 16:06:48 +0200 received badge  Good Answer (source)
2017-08-01 12:15:03 +0200 received badge  Notable Question (source)
2015-12-22 04:41:22 +0200 received badge  Famous Question (source)
2015-11-28 22:12:33 +0200 received badge  Taxonomist
2015-10-25 07:32:28 +0200 received badge  Famous Question (source)
2015-05-22 20:53:22 +0200 received badge  Popular Question (source)
2014-11-27 13:49:57 +0200 received badge  Notable Question (source)
2014-08-29 11:23:04 +0200 received badge  Popular Question (source)
2014-06-29 03:15:51 +0200 marked best answer Accessing cloud via ssh

Hi,

is it possible to log in to the home folder of a cloud-project via ssh? I found this in the FAQ of cloud.sagemath but it didn't help me very much :(

What I really would like to do is to sync a folder with some sage scripts on my PC with the cloud so I'm looking for something like:

rsync --delete -avze ssh ~/Sync/ user@cloud.sagemath.com:~/Sync/

So if ssh login is not possible also other possibilities to sync folders are welcome.

2014-06-29 03:15:49 +0200 marked best answer Working with pre-releases

Hi,

it has been recommended (here) to post patches based on and test them against the most recent pre-release. As they come quite frequently I wanted to know what's the best way to install and work with them:

Do you regularly rebuild them and always work with the current pre-release?

Do you only use them for developing and have an additional stable release for your ordinary work?

What do you do with the older versions? Can one just delete them?

...

2014-06-29 03:15:43 +0200 marked best answer What tests are useful while reviewing a patch if the patchbot report is already positive?

Hi,

the sage developer guide lists several tests that should be performed manually during the review process, like a complete doctest, building the documentation and checking coverage. Are all these test necessary and useful, if the patch bot already reported, that the patch has been positively tested against the latest pre-release? Or can some be simply skipped because they are already checked by the bot? What does the bot actually check?

2014-06-29 03:15:37 +0200 marked best answer load animation

Hi, I have the following problem:

I'd like to present some calculations in a sage notebook. At one point I'd like to show an animation, but unfortunately it takes some time until the .show() command plots it. I also do not like to have the animation wiggling araound while I'm presenting the other things before. Hiding the output also doesn't help because I want that it really starts from the beginning on my click and not soemwhere in between.

Is there a possibility to load a saved gif animation? Otherwise is is still possible to open the animation in new window, but it would be neat to have the animation inside the notebook.

2014-06-29 03:15:13 +0200 marked best answer How to add path on sage startup

Hi,

Is there a possibility to add a user defined path to the standard sage paths? I can add the path by typing

sage: import sys

sage: sys.path.append('mypath')

and everything works fine. But I don't like to do it all the times by hand but rather have the path added as standard.

I thougth about writing a bash wrapper skript but

export PATH=$PATH:mypath

seems to have no effect and be overwritten after sage startup.

2014-06-29 03:14:58 +0200 marked best answer check whether object is matrix

Hi,

I would like to check whether an object is a sage matrix. I thought that "isinstance" might help, however isinstance is a little bit too sensitive for my purpose as the following example shows:

m1=matrix([1.])
print type(m1)
print isinstance(m1, sage.matrix.matrix_generic_dense.Matrix_generic_dense)
m1=matrix([1])
print type(m1)
isinstance(m1, sage.matrix.matrix_generic_dense.Matrix_generic_dense)

returns

<type 'sage.matrix.matrix_generic_dense.Matrix_generic_dense'>
True
<type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'>
False

I would however like to obtain a function which recognizes a matrix regardless to the types of its entries.

isinstance(m1,matrix)

doesn't work either but gives the error: "isinstance() arg 2 must be a class, type, or tuple of classes and types"

So what else can I do?

Thanks for your answers, Tobias

2014-05-07 21:27:34 +0200 received badge  Nice Question (source)
2013-12-06 18:56:03 +0200 received badge  Enthusiast
2013-11-26 00:18:27 +0200 marked best answer Accessing cloud via ssh

You currently can't ssh into projects on cloud.sagemath, except by setting up a reverse ssh tunnel (see, e.g., http://www.howtoforge.com/reverse-ssh...). This requires having another server that you control that you can ssh to (and enable ssh reverse tunneling on).

The way I typically solve the problem "sync a folder with some sage scripts on my PC with the cloud" is to put those files under revision control using git, then make a public (or private) github project and push the files there. Then you can push/pull all the files between your cloud.sagemath project, github, and your PC. This has some advantages over using rsync like you suggest in your question above: (1) now there are 3 copies of your scripts, so it is less likely that you'll loose something, (2) you'll never get confused about which version is which, and if you make changes to scripts both in cloud and on your PC, git will automatically merge those changes, (3) it's more secure, e.g., if your cloud.sagemath account were hacked, then only your github project(s) are compromised, rather than your home PC, and vice versa.

As an example, this github repo is actually tied to a cloud project: https://github.com/williamstein/581f-...

-- William

2013-11-11 14:44:51 +0200 commented question Is there a way to store and sync the files from sage cloud on local hard drive?

I had a similar question(http://ask.sagemath.org/question/3098/accessing-cloud-via-ssh) and Wiliams answer about syncing via github coud be of interest for you, though I would really love to sync directly via ssh or something similar.

2013-11-07 07:18:23 +0200 received badge  Critic (source)
2013-11-03 11:23:21 +0200 commented question How to input data in SAGE and deal with them

Maybe also the answers in this (http://ask.sagemath.org/question/1842/how-to-plot-data-from-a-file#2705) related questions are helpful.

2013-11-01 09:36:13 +0200 answered a question Why Sage cannot pass a value of variable from one function to another nested function?

You can avoid this problem if you don't use a symbolic function but define a python function:

sage: var('n')
sage: def g(x,k):
sage:    return sum((2/n)*(sin(n*x)*(-1)^(n+1)), n, 1, k)
sage: print g(x,2)
-sin(2*x) + 2*sin(x)
2013-11-01 09:26:21 +0200 received badge  Commentator
2013-11-01 09:26:21 +0200 commented answer Why Sage cannot pass a value of variable from one function to another nested function?

I agree with kcrisman that at first sight the result seems to be ok and only be presented in a different form. But as the example sage: g(x)=(2/n)*(sin(n*x)*(-1)^(n+1)) sage: f(x,k) = sum((2/n)*(sin(n*x)*(-1)^(n+1)), n, 1, k) sage: (f(x,2)-sum(g, n, 1, 2)).full_simplify() doesn't return zero I would call this a bug.