remote evaluation of Python code typed in html webpage frame

2010-01-15 Thread dmitrey
hi all, what's the simplest way to create a webpage with a frame for Python code to be typed in (as a plain text, or, better, as a highlighted text or something like scite or any other easy python IDE, capable of automatic indentations), and then pressing a button to evaluate it using a remote serv

Re: remote evaluation of Python code typed in html webpage frame

2010-01-15 Thread dmitrey
16:41, "Diez B. Roggisch" wrote: > Am 15.01.10 15:16, schrieb dmitrey: > > > hi all, > > what's the simplest way to create a webpage with a frame for Python > > code to be typed in (as a plain text, or, better, as a highlighted > > text or something l

Solving System of Linear Equation (SLE) - FuncDesigner example

2009-10-25 Thread dmitrey
Hi all, I would like to introduce a couple examples of easy & convenient modelling and solving System of Linear Equation (SLE) by FuncDesigner (a python-written tool, BSD license). It doesn't require to construct matrices A and b (Ax = b) by user, they are created automatically. See here for detail

[ANN] OpenOpt 0.28, FuncDesigner 0.18, DerApproximator 0.18

2010-03-15 Thread dmitrey
Hi all, I'm glad to inform you about new release of our free (BSD-licensed) soft OpenOpt 0.28 (numerical optimization), FuncDesigner 0.18 (CAS with automatic differentiation), DerApproximator 0.18 (finite- differeces derivatives approximation). More details here: http://forum.openopt.org/viewtopic

New OpenOpt/FuncDesigner release 0.32

2010-12-15 Thread dmitrey
Hi all, I'm glad to inform you about new quarterly OpenOpt/FuncDesigner release (0.32): OpenOpt: * New class: LCP (and related solver) * New QP solver: qlcp * New NLP solver: sqlcp * New large-scale NSP (nonsmooth) solver gsubg. Currently it still requires lots of improvements (especially for cons

PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread dmitrey
hi all, I have th PEP (I'm not sure something like that hadn't been proposed although): very often in a Python file header the following lines are present, like: from MyModule1 import myFunc1 import MyModule2 as mm2 from MyModule3 import myFunc3 as mf3 etc and after several pages of code they are

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread dmitrey
Yes, I know, still usually it is placed in file header On Jan 6, 5:57 pm, Tim Harig wrote: > Python doesn't require imports to be at the top of a file.  They can be > imported at any time. > > > import MyModule > > (...lots of code...) > > r = MyModule.myFunc(...) > > (...lots of code...) > impor

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread dmitrey
On Jan 6, 8:43 pm, Erwin Mueller wrote: > > Why you have several pages of code in the first place? Don't you know that you > can split your code in files? Just a suggestion. > > -- > Erwin Mueller, dev...@deventm.orghttp://www.global-scaling-institute.de/ Erwin, take a look at Python language dev

[ANN] New package: SpaceFuncs (2D, 3D, ND geometric modeling, optimization, solving)

2011-02-16 Thread dmitrey
lcome Regards, Dmitrey. -- http://mail.python.org/mailman/listinfo/python-list

Bug in Python set

2010-05-02 Thread dmitrey
Python 2.6.5 r265:79063 >>>set().update(set()) is None True while I expect result of update to be set. Also, result of set().add(None) is None while I expect it to be set with element None (or, maybe, it should be empty set?) Regards, D. -- http://mail.python.org/mailman/listinfo/python-list

[ANN] OpenOpt 0.29, FuncDesigner 0.19, DerApproximator 0.19

2010-06-16 Thread dmitrey
http://forum.openopt.org/viewtopic.php?id=252 Regards, Dmitrey. -- http://mail.python.org/mailman/listinfo/python-list

hasattr + __getattr__: I think this is Python bug

2010-07-20 Thread dmitrey
hi all, I have a class (FuncDesigner oofun) that has no attribute "size", but it is overloaded in __getattr__, so if someone invokes "myObject.size", it is generated (as another oofun) and connected to myObject as attribute. So, when I invoke in other code part "hasattr(myObject, 'size')", instead

Re: hasattr + __getattr__: I think this is Python bug

2010-07-20 Thread dmitrey
On Jul 20, 1:37 pm, Chris Rebert wrote: > On Tue, Jul 20, 2010 at 3:10 AM, dmitrey wrote: > > hi all, > > I have a class (FuncDesigner oofun) that has no attribute "size", but > > it is overloaded in __getattr__, so if someone invokes > > "myObject.siz

Re: hasattr + __getattr__: I think this is Python bug

2010-07-20 Thread dmitrey
On 20 июл, 15:00, Jean-Michel Pichavant wrote: > dmitrey wrote: > > hi all, > > I have a class (FuncDesigner oofun) that has no attribute "size", but > > it is overloaded in __getattr__, so if someone invokes > > "myObject.size", it is generated (as

Re: hasattr + __getattr__: I think this is Python bug

2010-07-20 Thread dmitrey
> e.g. one that just looks in the object's dictionary so as to avoid returning > true for properties or other such fancy attributes. So can anyone explain me how to look into object's dict? As I have wrote, "something in dir(...)" requires O(numOfFields) while I would like to use o(log(n)) >How

Re: hasattr + __getattr__: I think this is Python bug

2010-07-20 Thread dmitrey
On 20 июл, 18:39, Neil Cerutti wrote: > On 2010-07-20, dmitrey wrote: > > > This doesn't stack with the following issue: sometimes user can > > write in code "myObject.size = (some integer value)" and then > > it will be involved in future calculatio

Create child class of Python dict with modified values

2010-08-09 Thread dmitrey
, Dmitrey. -- http://mail.python.org/mailman/listinfo/python-list

Re: Create child class of Python dict with modified values

2010-08-09 Thread dmitrey
On Aug 9, 1:38 pm, Peter Otten <__pete...@web.de> wrote: > dmitrey wrote: > > hi all, > > suppose I have defined a child class of Python dict, currently it > > constructor looks like that: > >     def __init__(self, *args, **kwargs): > >    

easiest way to check python version?

2009-06-10 Thread dmitrey
hi all, what is easiest way to check python version (to obtain values like 2.4, 2.5, 2.6, 3.0 etc) from Python env? I don't mean "python -V" from command prompt. Thank you in advance, D. -- http://mail.python.org/mailman/listinfo/python-list

ANN: openopt 0.24 - free numerical optimization framework

2009-06-15 Thread dmitrey
Hi all, OpenOpt 0.24, a free Python-written numerical optimization framework with some own solvers and connections to tens of 3rd party ones, has been released. BSD license allows to use it in both free opensource and commercial closed-code software. Currently we have ~80 unique visitors daily, 1

how to overload operator "< <" (a < x < b)?

2009-08-07 Thread dmitrey
hi all, is it possible to overload operator "< <"? (And other like this one, eg "<= <=", "> >", ">= >=") Any URL/example? Thank you in advance, D. -- http://mail.python.org/mailman/listinfo/python-list

is it possible to overload operator "^"?

2009-08-08 Thread dmitrey
hi all, is it possible to overload operator "^"? (AFAIK __pow__ overloads ** instead of ^) Thank you in advance, D. -- http://mail.python.org/mailman/listinfo/python-list

Re: is it possible to overload operator "^"?

2009-08-08 Thread dmitrey
> the operator precedence will seem wrong So, are there any ways to change operator precedence (for my class)? To Diez: yes, but I haven't paid attention to xor. BTW the url is currently unavailable (Network Timeout. The server at docs.python.org is taking too long to respond.). On Aug 8, 12:06 p

for key, value in dict.() - how to get? (which func)

2009-08-11 Thread dmitrey
hi all, which method should I use to get iterator over (key, value) pairs for Python dict, Python v 2.6 and above? Of course I could use for key in myDict.keys(): value = myDict.values() # do something with the pair key, value but searching each time for the value take some cputime that

Re: for key, value in dict.() - how to get? (which func)

2009-08-11 Thread dmitrey
Yes, thank you, items() is the correct approach, on the other hand I have already get rid of the cycle. Regards, D. On Aug 11, 10:26 pm, "Rami Chowdhury" wrote: > Hi Dmitrey, > > I think what you're looking for is myDict.items(), or myDict.iteritems(). > > Cheers,

"for" cycle with assigning index

2009-08-15 Thread dmitrey
Hi all, could you inform me how to do it properly? I have the cycle for i in xrange(len(Funcs2)): # Funcs2 is Python dict Funcs.append(lambda *args, **kwargs: (Funcs2[i](*args, **kwargs) [IndDict[left_arr_indexes[i]]])) So, all the Funcs are initialized with i = last index = len(Funcs2) Wh

Re: "for" cycle with assigning index

2009-08-15 Thread dmitrey
Thanks all, especially Dennis for your detailed answer. left_arr_indexes is list of nonnegative integers, eg [0,0,0,1,1,4] IndDict is a dict like {0: [1,2], 3: [0,1], 10:[0,2,3]}, so that's why I don't use python list instead. The code is taken from OpenOpt framework that I develop. Currently I hav

simplest way to visit 3 subdirectories with a command?

2009-08-18 Thread dmitrey
hi all, could you inform how to compose a py-file (for soft installation), that will visit 3 subdirectories (eg subdir1, subdir2, subdir3) and invoke a command "python setup.py install" in each subdirectory? I know there should be a simple solution available in Python documentation, but I have an a

ANN: OpenOpt 0.25 - free Python-written numerical optimization framework with automatic differentiation

2009-09-15 Thread dmitrey
OpenOpt is cross-platform (Windows, Linux, Mac OS etc) Python-written framework. If you have a model written in FuncDesigner (http:// openopt.org/FuncDesigner), you can get 1st derivatives via automatic differentiation (http://en.wikipedia.org/wiki/ Automatic_differentiation) (some examples here: h

ANN: FuncDesigner 0.15 - free Python-written framework with automatic differentiation

2009-09-15 Thread dmitrey
FuncDesigner is cross-platform (Windows, Linux, Mac OS etc) Python- written framework with automatic differentiation (http:// en.wikipedia.org/wiki/Automatic_differentiation). License BSD allows to use it in both open- and closed-code soft. It has been extracted from OpenOpt framework as a stand-al

ANN: OpenOpt 0.31, FuncDesigner 0.21, DerApproximator 0.21

2010-09-15 Thread dmitrey
mator 0.21 (finite-differences derivatives approximation). For release details see http://forum.openopt.org/viewtopic.php?id=299 or visit our homepage http://openopt.org Regards, Dmitrey -- http://mail.python.org/mailman/listinfo/python-list

namespace issue, Python vs numpy min/max problem

2010-11-13 Thread dmitrey
hi all, I have the following problem: I have overloaded "max" function in my module (FuncDesigner); it works like following: if some data in arguments is of type "oofun" then my function works, elseware numpy.max() is used. Now the problem: suppose someone writes from FuncDesigner import * ... a =

Re: namespace issue, Python vs numpy min/max problem

2010-11-13 Thread dmitrey
Well, I think I have found an appropriate solution. Regards, D. -- http://mail.python.org/mailman/listinfo/python-list

lambda-funcs problem

2007-09-19 Thread dmitrey . kroshko
hi all, I need to create a Python list of lambda-funcs that are dependent on the number of the ones, for example F = [] for i in xrange(N): F.append(lambda x: x + i) however, the example don't work - since i in end is N-1 it yields x+ (N-1) for any func. So what's the best way to make it val

<    1   2