Ask Your Question

Petr's profile - activity

2020-06-13 09:52:41 -0600 received badge  Famous Question (source)
2019-11-15 01:29:19 -0600 received badge  Famous Question (source)
2019-11-15 01:29:19 -0600 received badge  Notable Question (source)
2019-11-15 01:29:19 -0600 received badge  Popular Question (source)
2017-10-21 09:50:07 -0600 received badge  Notable Question (source)
2017-04-21 14:10:07 -0600 received badge  Notable Question (source)
2016-05-18 08:58:25 -0600 received badge  Popular Question (source)
2016-04-05 14:18:38 -0600 received badge  Popular Question (source)
2015-03-19 10:07:34 -0600 received badge  Supporter (source)
2015-03-18 15:17:43 -0600 received badge  Good Question (source)
2015-03-18 09:35:43 -0600 received badge  Nice Question (source)
2015-03-18 07:51:45 -0600 asked a question Polar plot like matplotlib out of the box in Sage?

Is there a way to plot something like this: http://matplotlib.org/examples/pylab_... i.e. with these fancy polar axes out of the box in Sage. Or should I invoke matplotlib directly?

2015-03-16 06:31:19 -0600 asked a question sage.numerical.optimize.find_local_minimum or scipy.optimize.fminbound?

Could anyone explain the basic difference between these two functions? Sage's documentation says that find_local_minimum uses fminbound, so... what find_local_minimum does?

Also, is there a performance difference between them?

2015-03-12 10:13:46 -0600 received badge  Student (source)
2015-03-12 07:03:00 -0600 received badge  Editor (source)
2015-03-12 07:02:07 -0600 asked a question UnicodeDecodeError in Notebook Server if Worksheet is set to 'python' instead of 'sage'

Hello!

I have a worksheet with non-ascii characters in the source code (utf-8 comments). If I have 'sage' selected in the combo-box on top of the worksheet then "Save worksheet to a file" works well. But if I change this to 'python' than calling "Save worksheet to a file" leads to a UnicodeDecodeError:

'ascii' codec can't decode byte 0xd0 in position 6: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/sage/sage-6.5/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/sage/sage-6.5/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/sage/sage-6.5/local/lib/python2.7/site-packages/sagenb-0.11.4-py2.7.egg/sagenb/flask_version/decorators.py", line 22, in wrapper
    return f(*args, **kwds)
  File "/home/sage/sage-6.5/local/lib/python2.7/site-packages/sagenb-0.11.4-py2.7.egg/sagenb/flask_version/worksheet.py", line 48, in wrapper
    return f(username, id, **kwds)
  File "/home/sage/sage-6.5/local/lib/python2.7/site-packages/sagenb-0.11.4-py2.7.egg/sagenb/flask_version/worksheet.py", line 137, in wrapper
    return f(*args, **kwds)
  File "/home/sage/sage-6.5/local/lib/python2.7/site-packages/sagenb-0.11.4-py2.7.egg/sagenb/flask_version/worksheet.py", line 938, in worksheet_download
    return unconditional_download(worksheet, title)
  File "/home/sage/sage-6.5/local/lib/python2.7/site-packages/sagenb-0.11.4-py2.7.egg/sagenb/flask_version/worksheet.py", line 950, in unconditional_download
    g.notebook.export_worksheet(worksheet.filename(), filename, title)
  File "/home/sage/sage-6.5/local/lib/python2.7/site-packages/sagenb-0.11.4-py2.7.egg/sagenb/notebook/notebook.py", line 748, in export_worksheet
    S.export_worksheet(username, id_number, output_filename, title=title)
  File "/home/sage/sage-6.5/local/lib/python2.7/site-packages/sagenb-0.11.4-py2.7.egg/sagenb/storage/filesystem_storage.py", line 491, in export_worksheet
    f.write(old_heading + g.read())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 6: ordinal not in range(128)
2015-03-12 06:51:58 -0600 asked a question How to set printing width for 'print' function?

This code:

print 'X' * 140

Shows 2 actual lines with wrap simbol:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I have screen wide enough to handle 140 character so I woul like to have the string intact and see it as one string. How to set printing width to a custom value?