Ask Your Question

mandrake's profile - activity

2017-12-22 18:06:49 -0500 received badge  Popular Question (source)
2015-12-22 11:13:42 -0500 received badge  Good Question (source)
2015-11-09 14:21:14 -0500 received badge  Famous Question (source)
2013-11-07 18:16:40 -0500 received badge  Good Answer (source)
2013-10-16 05:52:05 -0500 received badge  Notable Question (source)
2013-09-22 23:22:45 -0500 received badge  Notable Question (source)
2012-10-01 08:48:52 -0500 received badge  Taxonomist
2012-07-25 08:21:07 -0500 received badge  Popular Question (source)
2012-01-03 18:19:36 -0500 received badge  Popular Question (source)
2011-02-23 20:25:16 -0500 marked best answer No legend when plotting list of points

This works and is much simpler:

sage: points([(i, gauss(0,1)) for i in range(100)], legend_label='My points',ymax=10)

(the ymax is in there to make room for the legend).

It appears when plot takes in a list of things to plot, it may not pass the legend_label argument down to each thing it is plotting. I've made this trac #10514

2011-02-23 20:25:16 -0500 received badge  Scholar (source)
2010-12-16 21:52:20 -0500 received badge  Nice Question (source)
2010-12-16 21:52:18 -0500 received badge  Nice Answer (source)
2010-12-15 18:47:55 -0500 commented answer What's the vector equivalent to Pythons list addition? `[1,2]+[3,4]=[1,2,3,4]`

That, I beliveve, I would never have found myself :) Thanks

2010-12-10 06:03:18 -0500 received badge  Self-Learner (source)
2010-12-10 06:03:16 -0500 received badge  Student (source)
2010-12-09 22:56:37 -0500 answered a question What's the vector equivalent to Pythons list addition? `[1,2]+[3,4]=[1,2,3,4]`

I'll start off with the hugely ugly create lists from vectors, append and create vector again.

>>> v1 = vector([1,2])
>>> v2 = vector([3,4])
>>> vector( list(v1) + list(v2) )
(1,2,3,4)
2010-12-09 22:53:16 -0500 asked a question What's the vector equivalent to Pythons list addition? `[1,2]+[3,4]=[1,2,3,4]`

What's the best way of appending vectors in sage? I'm after the equivalent of Python list addition [1,2]+[3,4]=[1,2,3,4]

2010-12-09 21:24:22 -0500 answered a question When is 0^0 NaN in Sage?

As an input: Matlab computes 0^0 to 1.

>> version
ans =
7.9.0.529 (R2009b)
>> 0^0
ans =
     1
2010-12-09 20:48:01 -0500 commented question Can Notebooks Call Other Notebooks?

I'm in a position where I'd like to share code between notebooks. In my case I have a lot of regular Python code in a notebook that implements a target tracker, which I would like to be able to reuse in other notebooks.

2010-12-07 02:39:33 -0500 commented question When does notebook save worksheets persistently?

I should also point out that snapshots are still being saved in my version, at some unknown interval or something else.

2010-12-07 02:36:55 -0500 commented answer When does notebook save worksheets persistently?

I'm not the one who's writing files to disk, Sage's notebook is. But that's something I wish to find out.

2010-12-07 02:33:35 -0500 commented question When does notebook save worksheets persistently?

I wasn't clear enough with my question: The browser does not cause a crash or anything. But if a crash or something else cause an improper shutdown of the VM or notebook I've experienced that changes after a save is lost.

2010-12-06 23:50:07 -0500 asked a question When does notebook save worksheets persistently?

It's not clear to me when worksheets are saved in a persistant state (in a file).

I've lost changes I've made to worksheets many times after properly "save and quit"-ing. Later if either the VMware, notebook or windows crashes, or is not shutdown properly. The only way to restore data is to cross your fingers and hope that snapshots have been made (when are those made? can their creation be triggered manually?).

What's the proper way of shutting down notebook so that this issue can be avoided?

I'm using the VMware image with SAGE 4.6.

2010-12-06 22:22:41 -0500 commented answer What is broken on this site

I tried repeating the steps in IE (my clean browser since I never use it) and it was repeatable. I.e. clicking unanswered and then page two lost the search state. I also tried copy pasting the link in IE and it worked after that! That's kind of wierd :)

2010-12-06 19:45:24 -0500 commented answer What is broken on this site

I've updated my 'answer', with info why it doesn't work as a session var as well. And I wonder why scope is in the url if it's actually stored in session. And why use a session var in this case?

2010-12-06 03:27:34 -0500 answered a question What is broken on this site

The scope argument is lost and is not in use when moving from page 1 to page N

When for example I only wish to view unanswered questions (clicking unanswered), the url is http://ask.sagemath.org/questions/?sc.... When I click the link to e.g. page 2 the url to that page is http://ask.sagemath.org/questions/?so....

Edit: Note that the answers on page 2 in my example is not only unanswered questions - indicating that if the scope variable is stored in session it doesn't work. If I manually edit the url to go to http://ask.sagemath.org/questions/?sc...&page=2 the scope is used and works correctly.

Moreover, the questions listed on page 2 are not sorted by number of answers. Note, for example, that the question find-f2py_f2cmap-file-from-notebook shows up on page 2, even though all the unanswered questions are listed on page 1.

2010-12-03 01:17:32 -0500 asked a question No legend when plotting list of points

When I plot points using Sage 4.6 the legend is not drawn.

Running this in notebook:

pts = [point((i, gauss(0,1)),) for i in range(100)]
plot(pts, legend_label='My points').show() #No legend
plot(cos(x), legend_label='cos(x)').show() #This works!

The cos(x) plot works, but not for points, how's that?

Is is a bug, or is it some other library than matplotlib used when plotting points?

2010-11-29 08:47:43 -0500 received badge  Teacher (source)
2010-11-29 08:47:43 -0500 received badge  Supporter
2010-11-29 08:47:43 -0500 received badge  Editor (source)
2010-11-23 02:54:39 -0500 commented answer legend overlaps plot

Which version does that work in? I tried copy&pasting your code in notebook and in sage prompt, and it doesn't work for me in 4.5.3. I get a RuntimeError in line(), illegal option `legend_label`. Are you using some other plot lib? Can you complete your example with the necessary import ... in that case?

2010-11-22 02:27:20 -0500 answered a question UnpicklingError when trying to run notebook()

This might or might not work for you. When I had problems with unpickling this worked for me.

Make notebook start again

If you have valuable information in your /home/sage/.sage/sage_notebook.sagenb/ folder, try to just erasing/renaming:

  • /home/sage/.sage/sage_notebook.sagenb/conf.pickle
  • /home/sage/.sage/sage_notebook.sagenb/user.pickle

Recover worksheet

If you lost information, look for snapshots of your worksheet in: /home/sage/.sage/sage_notebook.sagenb/user.pickle/home/<user>/<worksheet id>/snapshots/

  • Unpack latest snapshot
  • Copy contents of file
  • Edit worksheet in browser in plain text mode
  • Paste the contents.
  • Press save

Maybe there's an easier way, but I haven't found it yet..