Ask Your Question

Petr's profile - activity

2020-06-13 16:52:41 +0100 received badge  Famous Question (source)
2019-11-15 08:29:19 +0100 received badge  Popular Question (source)
2019-11-15 08:29:19 +0100 received badge  Famous Question (source)
2019-11-15 08:29:19 +0100 received badge  Notable Question (source)
2017-10-21 16:50:07 +0100 received badge  Notable Question (source)
2017-04-21 21:10:07 +0100 received badge  Notable Question (source)
2016-05-18 15:58:25 +0100 received badge  Popular Question (source)
2016-04-05 21:18:38 +0100 received badge  Popular Question (source)
2015-03-19 16:07:34 +0100 received badge  Supporter (source)
2015-03-18 21:17:43 +0100 received badge  Good Question (source)
2015-03-18 15:35:43 +0100 received badge  Nice Question (source)
2015-03-18 13:51:45 +0100 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 12:31:19 +0100 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 16:13:46 +0100 received badge  Student (source)
2015-03-12 13:03:00 +0100 received badge  Editor (source)
2015-03-12 13:02:07 +0100 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 12:51:58 +0100 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?