[sage-support] Output processing and formatting delay in Notebook

2012-01-09 Thread Eugene Goldberg
Hello!

This code in Sage Notebook:

for i in range(7):
html('scriptalert(Text %g);/script' % i)
time.sleep(1)

gives no alert messages before cell completely calculated? Is there
any way to force immediate output processing?

P.S. Sorry for duplicating question, it has already posted at asksage
(http://ask.sagemath.org/question/1039/html-processing-delay), but
because of someone may not be familiar with asksage I'd like to repost
it here.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Unicode characters in axes labels?

2011-12-05 Thread Eugene Goldberg
Hello!



I am trying to use unicode characters in axes labels and it fails with
exception:

P = plot_step_function([(i,prime_pi(i)) for i in
range(20)],thickness=2,color='black')
P.show(axes=False,frame=True,axes_labels=('текс','x'))

Traceback (most recent call last):
  File stdin, line 1, in module
  File _sage_input_28.py, line 10, in module
exec compile(u'open(___code___.py,w).write(# -*- coding:
utf-8 -*-\\n +
_support_.preparse_worksheet_cell(base64.b64decode(UC5zaG93KGF4ZXM9RmFsc2UsZnJhbWU9VHJ1ZSxheGVzX2xhYmVscz0oJ9GC0LXQutGBJywneCcpKQ==),globals())
+\\n); execfile(os.path.abspath(___code___.py))
  File , line 1, in module

  File /tmp/tmpzOkGkv/___code___.py, line 2, in module
exec
compile(uP.show(axes=False,frame=True,axes_labels=('\u0442\u0435\u043a
\u0441','x')) + '\n', '', 'single')
  File , line 1, in module

  File /home/sage/sage/local/lib/python2.6/site-packages/sage/misc/
decorators.py, line 456, in wrapper
return func(*args, **kwds)
  File /home/sage/sage/local/lib/python2.6/site-packages/sage/plot/
plot.py, line 1750, in show
self.save(**kwds)
  File /home/sage/sage/local/lib/python2.6/site-packages/sage/misc/
decorators.py, line 456, in wrapper
return func(*args, **kwds)
  File /home/sage/sage/local/lib/python2.6/site-packages/sage/plot/
plot.py, line 2484, in save
transparent=transparent)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
figure.py, line 1084, in savefig
self.canvas.print_figure(*args, **kwargs)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
backend_bases.py, line 1889, in print_figure
**kwargs)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
backends/backend_agg.py, line 438, in print_png
FigureCanvasAgg.draw(self)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
backends/backend_agg.py, line 394, in draw
self.figure.draw(self.renderer)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
artist.py, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
figure.py, line 798, in draw
func(*args)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
artist.py, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
axes.py, line 1946, in draw
a.draw(renderer)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
artist.py, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
axis.py, line 1032, in draw
self.label.draw(renderer)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
artist.py, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
text.py, line 526, in draw
bbox, info = self._get_layout(renderer)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
text.py, line 305, in _get_layout
clean_line, ismath = self.is_math_text(line)
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
text.py, line 989, in is_math_text
if cbook.is_math_text(s):
  File /home/sage/sage/local/lib/python2.6/site-packages/matplotlib/
cbook.py, line 1793, in is_math_text
s = unicode(s)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position
0: ordinal not in range(128)

I found this topic:
https://groups.google.com/group/sage-support/browse_thread/thread/9908f1869c7d7f45/1cc9473c667c162c?hl=enlnk=gstq=unicode+axes+labels#1cc9473c667c162c
No responses :(

Could anyone please suggest me something to workaround this problem?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Notebook data cache

2011-05-09 Thread Eugene Goldberg
My temporary solution - removing all *.sobj, *.gif, *.png, *.zip files
and all snapshots directories. Now .sage direcotory is 13 Mb only!

Also, I have found for myself important tip: while using DATA
directory manually for saving objects (*.sobj files) no one will
manage it content for you, and if later you will not need saved
objects, they will still exists in filesystem.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Notebook data cache

2011-05-09 Thread Eugene Goldberg
P.S. It is also ok to remove dap directory content.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Notebook data cache

2011-05-07 Thread Eugene Goldberg
Hello!

I am using Sage with Notebooks for some time, and my .sage directory
now is 129 Mb. I believe it is impossible for me to write so much code
(text), that means most of this space comes from notebook cache
(images, for example). Is there some easy way to remove cache?

Best regards.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Additional functions

2010-11-20 Thread Eugene Goldberg
Hi all!

I am using sage from time to time for a year in education.
Unfortunately, I couldn't find default functions to do some
operations, so I wrote my own functions. For now here are just a few
functions, but I believe in time I'll describe them all.

I've placed them in Google Code project page, my be someone will find
them useful for his purpose.

http://code.google.com/p/libradiosage/

Everything described in wiki page:

http://code.google.com/p/libradiosage/wiki/Introduction



By the way, I'd like to say thank you to all developers of sage and
internal components. You are doing a great job!

Best regards, Eugene.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Why save method calls show?

2010-11-14 Thread Eugene Goldberg
Hi!

I want to save my plot using notebook:

plot(sin,0,4).save('foo.png')

this code saves my plot, but also calls show method (or something like
that) and I have plot in output. Is it possible only to save plot,
without any output at all?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] How to add grid lines to plot?

2010-05-06 Thread Eugene Goldberg
Hello!

There is plot:
p=plot(sin,0,2*pi)
How to add grid lines to this plot?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Difference between sage and pyhton calculations

2010-04-05 Thread Eugene Goldberg
Hello!

Here is my pyhtons results:

python
Python 2.6.5 (r265:79063, Mar 23 2010, 04:49:54)
[GCC 4.4.3] on linux2
Type help, copyright, credits or license for more information.
 1+1
2
 6e-6 % 10e-6
6.0002e-06


and here is sage:

./
sage
Sage Version 4.3.5, Release Date:
2010-03-28
sage: 1+1
2
sage: 6e-6 % 10e-6
-4.00e-6

I'm sure sage is wrong.. :(

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

To unsubscribe, reply using remove me as the subject.


[sage-support] Re: Difference between sage and pyhton calculations

2010-04-05 Thread Eugene Goldberg
P.S. I've also got wrong result at http://sagenb.kaist.ac.kr/ server.

On Apr 6, 3:56 am, Eugene Goldberg omegat...@gmail.com wrote:
 Hello!

 Here is my pyhtons results:

 python
 Python 2.6.5 (r265:79063, Mar 23 2010, 04:49:54)
 [GCC 4.4.3] on linux2
 Type help, copyright, credits or license for more information. 1+1
 2
  6e-6 % 10e-6

 6.0002e-06



 and here is sage:

 ./
 sage
 Sage Version 4.3.5, Release Date:
 2010-03-28
 sage: 1+1
 2
 sage: 6e-6 % 10e-6
 -4.00e-6

 I'm sure sage is wrong.. :(

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

To unsubscribe, reply using remove me as the subject.


[sage-support] Print only outputs?

2010-04-01 Thread Eugene Goldberg
Hi!

Is it possible to print only output content of worksheet?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

To unsubscribe, reply using remove me as the subject.


[sage-support] An easy way to plot 2d array?

2010-02-15 Thread Eugene Goldberg
Could you suggest one?

I've seen this, but i think it's not a good solution..

contour_plot(lambda x,y: data[int(x)][int(y)],(x,0,len(data)-1),(y,
0,len(data[0])-1))

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] How to contour_plot piecewise defined function?

2010-02-02 Thread Eugene Goldberg
Hi!

I've got a few functions like this:

f1(x,y)=sin(x)+cos(y)
f2(x,y)=sin(y)+cos(x)

and I need to plot counter graphics like:

contour_plot(lambda x,y:f1(x,y),(x,0,3),(y,0,14))+contour_plot(lambda
x,y:f2(x,y),(x,3,6),(y,0,14))

can i do this easily using piecewise function?

g=Piecewise([ [(0,3),f1], [(3,6),f2] ])

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Problem installing sage on ArchLinux.

2010-01-03 Thread Eugene Goldberg
Hello,

I've got two computers with archlinux (i686 and x86_64 versions) and
on both machines there is same problem installing sage:

$make

  File /home/ajunta/Binary/sage-4.3-linux-Ubuntu_9.10-x86_64-Linux/
local/lib/python2.6/site-packages/sage/interfaces/gap.py, line 362,
in _start
raise RuntimeError, msg
RuntimeError: Unable to start gap

could you please advice what is wrong with it?

Best regards,
Eugene.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Problem installing sage on ArchLinux.

2010-01-03 Thread Eugene Goldberg
Thanks for the advice, I had some problems building previous version
of sage, and like that one - it solved by building sage from source. I
guess building from source is the best way to avoid many problems.

On Jan 3, 9:47 am, Alex Ghitza aghi...@gmail.com wrote:
 On Sun, 3 Jan 2010 01:09:00 -0800 (PST), Eugene Goldberg 
 omegat...@gmail.com wrote:
  I've got two computers with archlinux (i686 and x86_64 versions) and
  on both machines there is same problem installing sage:

  $make
  
    File /home/ajunta/Binary/sage-4.3-linux-Ubuntu_9.10-x86_64-Linux/
  local/lib/python2.6/site-packages/sage/interfaces/gap.py, line 362,
  in _start
      raise RuntimeError, msg
  RuntimeError: Unable to start gap

  could you please advice what is wrong with it?

 Hi,

 It looks like you're trying to install from the binaries for Ubuntu, is
 that correct?  I have never tried that, but I wouldn't be suprised if it
 didn't work, since archlinux and ubuntu aren't really that close.

 One of these days I will find out how to make binaries and I'll produce
 32 and 64 bit binaries for archlinux.  Until then, I suggest you
 download the source code for Sage and build it yourself.  It is a bit on
 the long side (a few hours), but it should work pretty well.  After you
 download sage-4.3.tar, untar it and look at the README.txt file.  It's
 not quite up to date, but it's pretty good.  In particular, Arch Linux
 is listed as unsupported, but several people have been building Sage on
 it for a while and it works fine.

 Before you start the build, make sure you have the prerequisites -- to
 those listed in README.txt, you have to add gcc-fortran.  You also need
 to set the environment variables SAGE_FORTRAN and SAGE_FORTRAN_LIB as
 described in README.txt.

 Good luck, and let us know if you have any more problems.

 PS: After writing the above, I noticed that Sage 4.3 is actually
 packaged in AUR, both as source (sage-mathematics) and as binary
 (sage-mathematics-bin).  So that could be another option.  (But I still
 think that the easiest and most robust way is to build from source.)

 Best,
 Alex

 --
 Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
 -- Australia --http://www.ms.unimelb.edu.au/~aghitza/

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Integration of piecewise function

2009-12-13 Thread Eugene Goldberg
So... There is no solution?

On Dec 9, 6:03 pm, Sand Wraith omegat...@gmail.com wrote:
 Does anyone know is this issue only for newest version? (may be I
 should use older version of sage)

 On 8 дек, 21:47, David Joyner wdjoy...@gmail.com wrote:

  Unfortunately, the piecewise class was written before the symbolic
  expressions class and has not kept pace.

  The obvious solution produced this:

  sage: signal = Piecewise([[(0,1),  cos(2*pi*1*x)], [(-1, 0), 0*x]])
  sage: signal.integral(definite=True)
  ---
  TypeError                                 Traceback (most recent call last)

  /Users/wdj/.sage/temp/jeeves.home/2806/_Users_wdj__sage_init_sage_0.py
  in module()

  /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/functions/piecewise.pyc
  in integral(self, x, a, b, definite)
      787                 fun_integrated = fun.integral(x, end, x)
      788             else:
  -- 789                 fun_integrated = fun.integral(x, start, x) + area
      790                 if definite or end != infinity:
      791                     area += fun.integral(x, start, end)

  /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/symbolic/expression.so
  in sage.symbolic.expression.Expression.integral
  (sage/symbolic/expression.cpp:25344)()

  /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/calculus/calculus.pyc
  in integral(expression, v, a, b, algorithm)
      635         else:
      636             try:
  -- 637                 result = expression._maxima_().integrate(v, a, b)
      638             except TypeError, error:
      639                 s = str(error)

  /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/maxima.pyc
  in integral(self, var, min, max)
     2023             if max is None:
     2024                 raise ValueError, neither or both of min/max
  must be specified.
  - 2025             return I(var, min, max)
     2026
     2027     integrate = integral

  /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
  in __call__(self, *args, **kwds)
     1402
     1403     def __call__(self, *args, **kwds):
  - 1404         return self._obj.parent().function_call(self._name,
  [self._obj] + list(args), kwds)
     1405
     1406     def help(self):

  /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
  in function_call(self, function, args, kwds)
     1310                                        [s.name() for s in args],
     1311
  ['%s=%s'%(key,value.name()) for key, value in kwds.items()])
  - 1312         return self.new(s)
     1313
     1314     def _function_call_string(self, function, args, kwds):

  /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
  in new(self, code)
     1094
     1095     def new(self, code):
  - 1096         return self(code)
     1097
     1098     
  ###

  /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
  in __call__(self, x, name)
     1029
     1030         if isinstance(x, basestring):
  - 1031             return cls(self, x, name=name)
     1032         try:
     1033             return self._coerce_from_special_method(x)

  /Users/wdj/sagefiles/sage-4.2.1/local/lib/python2.6/site-packages/sage/interfaces/expect.pyc
  in __init__(self, parent, value, is_name, name)
     1445             except (TypeError, KeyboardInterrupt,
  RuntimeError, ValueError), x:
     1446                 self._session_number = -1
  - 1447                 raise TypeError, x
     1448         self._session_number = parent._session_number
     1449

  TypeError: Computation failed since Maxima requested additional
  constraints (try the command 'assume(x0)' before integral or limit
  evaluation, for example):
  Is  x  positive, negative, or zero?

  On Tue, Dec 8, 2009 at 4:28 PM, Sand Wraith omegat...@gmail.com wrote:
   Hello,

   there is signal function:
   signal = Piecewise([
   [(0,5),  cos(2*pi*1*x) ],
   [(5,10), cos(2*pi*2.5*x) ],
   ])

   And window function:
   window = Piecewise([[(-1,1),1]])

   And the result function:
   r=window*signal

   How can I integrate it now? I'am trying:
   r.integral(definite=True)

   but it leads to error: TypeError: integral() takes no arguments (3
   given)

   --
   To post to this group, send email to sage-support@googlegroups.com
   To unsubscribe from this group, send email to 
   sage-support+unsubscr...@googlegroups.com
   For more options, visit this group 
   athttp://groups.google.com/group/sage-support
   URL:http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group 

[sage-support] How to plot tree-dimensional array?

2009-12-09 Thread Eugene Goldberg
Hello,

Could you please advice the way to plot three-dimensional array?
Something like plot3d or counter_plot, but in case the data are
already calculated in array and there is no way to call f(x,y).

Best regards,
Eugene.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: How to plot tree-dimensional array?

2009-12-09 Thread Eugene Goldberg
Thank you both!  Your examples  and suggestions are very useful and it
solved my problem.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org