Fast 2d brown/pink noise generation?

2005-03-04 Thread Mathias
roach? - Dimensionality is between 20x20 and 100x100 - The spectrum doesn't need to be exactly pink/brown, an approximation is fine. - Implementation in either matlab or scientific python (LAPACK anyway) Thanks a lot for hints, literature, algorithms! Mathias -- http://mail.python.org/mailman/listi

Fast 2d brown/pink noise generation?

2005-03-04 Thread Mathias
roach? - Dimensionality is between 20x20 and 100x100 - The spectrum doesn't need to be exactly pink/brown, an approximation is fine. - Implementation in either matlab or scientific python (LAPACK anyway) Thanks a lot for hints, literature, algorithms! Mathias -- http://mail.python.org/mailman/listi

Parallelization with Python: which, where, how?

2004-12-20 Thread Mathias
oach? Are there examples or documentation? Has someone got experience with stability and efficiency? Thanks a lot, Mathias -- http://mail.python.org/mailman/listinfo/python-list

Q: Scheduling in scipy.cow

2004-12-28 Thread Mathias
Dear NG, can somebody tell me how the work packages are scheduled to the workers? From the code it seems to me like a a static distribution, ie each worker gets the same amount of work, not taking into account if a faster worker already finished all work packages. Thanks, Mathias PS: Is

Segmentation faults using threads

2007-02-13 Thread Mathias
lot, Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: Segmentation faults using threads

2007-02-13 Thread Mathias
ords the function call structure? Does someone have experience with threading in python - are there non-threadsafe functions I should know about? Thanks, Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: Segmentation faults using threads

2007-02-13 Thread Mathias
I'm using os.popen2() to pipe into an ssh session via stdin/stdout. That's probably not the elegant way... Other modules: scipy 0.3.2 (with Numeric 24.2) and python 2.4 Does pickle/cPickle count as part of the marshal module? Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: Segmentation faults using threads

2007-02-13 Thread Mathias
PS: setting sys.setcheckinterval(1) reduces the probablilty of a failure as well, but definetely at a performance cost. -- http://mail.python.org/mailman/listinfo/python-list

Re: Segmentation faults using threads

2007-02-14 Thread Mathias
> > What module are you using for SSH? > > What's in your program that isn't pure Python? > The problem is probably in some non-Python component; you shouldn't > be able to force a memory protection error from within Python code. > It looks like the error could be in scipy/Numeric, when

How to get rid of 3.7.2 (32-bit) in favour of 3.7.2 (64-bit)

2019-01-04 Thread Mathias Feiler
uot; An hint me to this mailinglist if I encounter problems. Well, here I am. Thus my Question are: Does I try to uninstall the wrong way (New to Windows)? Does the Package got some pitfalls stiking back? What can I do to get rid of the "wrong" package? Thank You for Your Answer in a

Listening for a certain keypress in the background

2005-10-22 Thread Mathias Dahl
I have created a Python program that is running on my desktop. How can I make it listen for a certain keypress (say, Windows-key + space) in a controlled fashion even when it is not the program having focus? I need to do this running GNOME under Mandrake GN/Linux 10. /Mathias -- http

Listening for keypress in the background

2005-10-22 Thread Mathias Dahl
I have created a small Python program that is running on my desktop. How can I make it listen for a certain keypress (say, Windows-key + space) in a controlled fashion even when it is not the program having focus? I need to do this running under GNOME in Mandrake GN/Linux 10. /Mathias -- http

Re: Listening for keypress in the background

2005-10-22 Thread Mathias Dahl
Peter Hansen <[EMAIL PROTECTED]> writes: >> How can I make it listen for a certain keypress (say, Windows-key + >> space) in a controlled fashion even when it is not the program having >> focus? >> >> I need to do this running under GNOME in Mandrake GN/Linux 10. > > Search Google for "python key

Re: Listening for keypress in the background

2005-10-22 Thread Mathias Dahl
Mathias Dahl <[EMAIL PROTECTED]> writes: > Peter Hansen <[EMAIL PROTECTED]> writes: > >>> How can I make it listen for a certain keypress (say, Windows-key + >>> space) in a controlled fashion even when it is not the program having >>> focus? >

Re: Connecting to Firebird database using Kinterbasdb+Python

2005-07-04 Thread Mathias Waack
able to connect. If you start it on a different machine, you are not able to connect without giving a hostname? Whats wrong with offering the the name (or IP-address) of your MacOS-box instead of 'localhost' to the script? Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: Connecting to Firebird database using Kinterbasdb+Python

2005-07-04 Thread Mathias Waack
#x27;re running the classic server you can simply follow Grig's advice and connect "directly" to the db files. Mathias -- http://mail.python.org/mailman/listinfo/python-list

Web-Forms

2005-07-21 Thread Mathias Waack
s not directly accessible by URL and so on. All that nice stuff used to make a web site more professional;) But now the question: how can this be solved by using Python? Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: Web-Forms

2005-07-25 Thread Mathias Waack
Michele Simionato wrote: > Use twill:http://www.idyll.org/~t/www-tools/twill.html I'll do so. Twill is great, anyway thanks for all other responses too. Mathias -- http://mail.python.org/mailman/listinfo/python-list

Invoking GUI for app running in background with a keypress

2005-08-15 Thread Mathias Dahl
and understand that it probably involves a lot of "low-level" stuff in X which feels a bit "scary" :). Any clues of doing this "easily" in Python + some module? /Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: Invoking GUI for app running in background with a keypress

2005-08-15 Thread Mathias Dahl
evdev.py", line 91, in __init__ self.fd = os.open(filename, os.O_RDWR | os.O_NONBLOCK) OSError: [Errno 13] Permission denied: '/dev/input/event0' Loggin in (su:ing) as root solves that problem but I'm not sure I want to require the user being root to be able to run my progr

64 bit Python

2005-02-14 Thread Mathias Waack
t didn't. I was able to create only 2 GB of python objects. The application occupied approximately 2.2 GB of memory. After that, python failed with a memory error. Is there any internal restriction on the size of the heap? Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: 64 bit Python

2005-02-14 Thread Mathias Waack
Ivan Voras wrote: > Mathias Waack wrote: >> amounts of data. I figured out that a 32 bit application on HP-UX >> cannot address more than 1 GB of memory. In fact (I think due to >> the overhead of memory management done by python) a python >> application cannot use muc

Re: 64 bit Python

2005-02-15 Thread Mathias Waack
Mike C. Fletcher wrote: > Mathias Waack wrote: > ... > >>My python script allocates a bunch of strings each of 1024 >>characters and writes it in a cStringIO. And it fails after writing >>512K of strings. Don't know how python restricts the heap size - >>but

Re: StringIO objects sharing a buffer

2005-02-15 Thread Mathias Waack
g > in there.) I'm not sure if I understand the problem right, but there is a rule of thumb: Prefer delegation to inheritance. If you can use delegation, avoid inheritance. Esp. on python, where (from the point of view of usage) there is no distinction between delegation or inheritance

Re: Multiple initialization methods?

2005-02-16 Thread Mathias Waack
ef __setup1(self, arg1): print "setup1" def __setup2(self, arg1, arg2): print "setup2" Or for different parameter lists which may have the same length my suggestion would be: def __init__(self, **kw): self.__dict__.update(kw) Mathias PS: anyone wo

Re: How to wrap a class's methods?

2005-02-17 Thread Mathias Waack
f1 = getattr(self.__wrapped, attr) s,r = f1(args) if s != 'OK': raise NotOk((s,r)) return r return f # raise some exception here imap = Wrapper(imaplib.IMAP4_SSL) If you wrap all methods you can ignore the if-test. Instead of the class object you can pa

Re: Start new process by function ?

2005-03-10 Thread Mathias Waack
t; def foo(): pass > os.spawn(foo) Just starting is easy: def spawn(f): if os.fork() == 0: f() sys.exit(0) But I'd expect you would like to get some return values from f... Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: What Next After Python Basics

2014-07-19 Thread mathias . moe
em for some criteria, and while I'm given tools to do it, I try to make my own tools to get the job done. That is to say, if there's something in your day that you use in some way, and it's fairly simple, or its essential functionality can be copied, then that's someth

Re: How to test if object is an integer?

2011-10-17 Thread Mathias Lafeldt
quot;Catch errors rather than avoiding them to avoid cluttering your code with special cases" -Mathias -- http://mail.python.org/mailman/listinfo/python-list

protect logger from shutdown syslogd

2013-02-24 Thread Mathias Kőrber
Hi I have a script which calls getLogger to set up a logging service. The standard logger description used both the consoleHandler and the syslogHandler. It seems that if syslogd is shut down, getLogger fails, and the script won't be able to log at all. is there a way to make it immune against t

encoding for colon-separated hex?

2013-03-21 Thread Mathias Kőrber
is there a built-in encoding (for encode/decode methods) that as colon-separated hex (01:02:03:04...)? 'hex' seems to encode as '01020304' and while one can postprocess that to insert the colons, if a single operation exists, I'd rather use that. -- http://mail.python.org/mailman/listinfo/python-

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Mathias Waack
ata (list of tables, list of columns, list of indexes aso...) in system tables which can be queried in the same manner as common tables or view. Just read your database handbook... HTH Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-06 Thread Mathias Waack
ocument in a sax-like manner and expands only selected sub-trees. > Any suggestions on what that something else is? Is it hard to convert > the code from DOM to SAX? Assuming a good design of course not. Esp. if you only need some selected parts of the document SAX should be your choice.

Illegal instruction or undefined symbol from import

2006-07-04 Thread Mathias Waack
piler error (http://mail.python.org/pipermail/python-dev/2003-May/035386.html). But I'm not able to verify this error with gcc 4.1.2. Google finds some postings describing the same error - but it looks like nobody ever got an answer:( Would be nice to have more success... Regards Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: Illegal instruction or undefined symbol from import

2006-07-05 Thread Mathias Waack
Continuing my monologe;) Mathias Waack wrote: > I've embedded python into a legacy application. It works - most of the > time. In some special situations the app crashes executing the "import > random". There are two different situations: > > 1. the sources comp

Re: Illegal instruction or undefined symbol from import

2006-07-05 Thread Mathias Waack
Richard Brodie wrote: > "Mathias Waack" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> BTW, does anybody know why the c-lib offers both log and log1p? > > So you can get a sensible answer computing log(1 + 10 ^ -30). Ok, that make

a few extensions for the itertools

2006-11-19 Thread Mathias Panzenboeck
I wrote a few functions which IMHO are missing in python(s itertools). You can download them here: http://sourceforge.net/project/showfiles.php?group_id=165721&package_id=212104 A short description to all the functions: icmp(iterable1, iterable2) -> integer Return negative if iterable1 <

my small hashlib - using pythons hash-functions

2006-11-25 Thread Mathias Panzenboeck
Hi. I wrote a small hashlib for C. Because I'm new to hashes I looked at pythons implementation and reused *some* of the code... or more the mathematical "hash-function", not really the code. In particular I looked at pythons hash and lookup functions, so I came up with this (see the code un

Re: my small hashlib - using pythons hash-functions

2006-11-25 Thread Mathias Panzenboeck
Paul Rubin wrote: > Mathias Panzenboeck <[EMAIL PROTECTED]> writes: >> So, can this code be considered as derived and do I have to put my >> code under the GPL? I'd like to publish it under something less >> restrictive, like a BSD style license. But if GPL is

Re: my small hashlib - using pythons hash-functions

2006-11-25 Thread Mathias Panzenboeck
Fredrik Lundh wrote: > Mathias Panzenboeck wrote: > >> But the question is: *IS* this derived work? I mean, it's not copied >> code. >> It's the same hashing-logic, which I learned by watching pythons code. > > given that it's only a few lines of

Re: Generator question

2006-11-26 Thread Mathias Panzenboeck
Robert Kern wrote: > Timothy Wu wrote: >> Hi, >> >> Using generator recursively is not doing what I expect: >> >> def test_gen(x): >> yield x >> x = x - 1 >> if x != 0: >> test_gen(x) > > The only thing that the last line does is *create* a new generator object. You > need to a

Re: type(foo) == function ?

2006-12-01 Thread Mathias Panzenboeck
Chris Mellon wrote: > On 11/29/06, Tom Plunket <[EMAIL PROTECTED]> wrote: >> I'd like to figure out if a given parameter is a function or not. >> >> E.g. >> >> >>> type(1) >> >> >>> type(1) == int >> True >> >> implies: >> >> >>> def foo(): >> ... pass >> ... >> >>> type(foo) >> >> >>> type(foo

Re: merits of Lisp vs Python

2006-12-08 Thread Mathias Panzenboeck
Mark Tarver wrote: > How do you compare Python to Lisp? What specific advantages do you > think that one has over the other? > > Note I'm not a Python person and I have no axes to grind here. This is > just a question for my general education. > > Mark > I do not know much about Lisp. What I

Re: merits of Lisp vs Python

2006-12-09 Thread Mathias Panzenboeck
Rob Thorpe wrote: > Mathias Panzenboeck wrote: >> Mark Tarver wrote: >>> How do you compare Python to Lisp? What specific advantages do you >>> think that one has over the other? >>> >>> Note I'm not a Python person and I have no axes to grind

Re: call of __del__ non-deterministic in python 2.4 (cpython)?

2006-12-13 Thread Mathias Panzenboeck
Anthony Baxter wrote: > On 12/13/06, Holger Joukl <[EMAIL PROTECTED]> wrote: >> I did read this but didn't think it applied to my situation. I'm quite >> sure that the refcount of the local variable is 1 before the local scope >> is left. >> So let me rephrase the question: Even if I can make sure

Re: merits of Lisp vs Python

2006-12-14 Thread Mathias Panzenboeck
Bruno Desthuilliers wrote: > Mathias Panzenboeck a écrit : >> Rob Thorpe wrote: >> >>> Mathias Panzenboeck wrote: >>> >>>> Mark Tarver wrote: >>>> >>>>> How do you compare Python to Lisp? What specific advantages do you &g

Re: Quake 3 and the Python interpreter

2006-12-15 Thread Mathias Panzenboeck
Neil Toronto wrote: > > 2) Is there any way to restrict Python modules from accessing files > outside of a sandbox? > As far as I heard, there is no really working way. But maybe that has changed in python 2.5? Or it will in 3.0? I dunno. -- http://mail.python.org/mailman/listinfo/python-list

Re: Wow, Python much faster than MatLab

2006-12-30 Thread Mathias Panzenboeck
A other great thing: With rpy you have R bindings for python. So you have the power of R and the easy syntax and big standard lib of python! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Yield

2007-01-09 Thread Mathias Panzenboeck
Fredrik Lundh schrieb: > Danny Colligan wrote: > >> Carsten mentioned that generators are more memory-efficient to use when >> dealing with large numbers of objects. Is this the main advantage of >> using generators? Also, in what other novel ways are generators used >> that are clearly superior

Re: Bragging about Python

2007-06-07 Thread Mathias Panzenboeck
Steve Howell schrieb: > --- "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: > >> Is there a resource somewhere on the net that can be >> used to quickly >> and effectively show Python's strengths to >> non-Python programmers? >> Small examples that will make them go "Wow, that >> _is_ neat"? >> >

Running Python with XAMPP

2007-07-18 Thread Mathias K.
pythonDebug On [/code] But when i type "http://localhost/python/python.py"; it won't execute! My browser just shows me the source code. :-( Please, can anyone tell me what i have to do? Thanks in advance! ~ Mathias -- http://mail.python.org/mailman/listinfo/python-list

Compiling python extension on amd64 for 32 bit

2007-05-25 Thread Mathias Waack
tmp ./a.out 4 32 Ok, thats fine. So why is python complaining? Or even more interesting, what do I have to do to compile the code? Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling python extension on amd64 for 32 bit

2007-05-26 Thread Mathias Waack
Andrew MacIntyre wrote: > Mathias Waack wrote: >> After switching my development environment to 64 bit I've got a >> problem with a python extension for a 32 bit application. > > {...} > >> Ok, thats fine. So why is python complaining? Or even more >

optparse option prefix

2007-04-04 Thread Mathias Waack
from the commandline with a parameter list containing options prefixed by '-' or '--' signs. Thats not a major problem, but it prevents us from using th optparse module. Is there a way to change to prefix, so one could use a '+' (for instance) to mark command line optio

Re: optparse option prefix

2007-04-04 Thread Mathias Waack
ork on a passed argument > list. No need to alter sys.argv. Sounds nice, I'll do so. Thanks! Mathias -- http://mail.python.org/mailman/listinfo/python-list

weakrefs and bound methods

2007-10-07 Thread Mathias Panzenboeck
Hi. I have a problem with weak refs and bound methods. The best explanation for the problem is a short bit of code. I have the three classes Wrapper, Foo and Bar: import weakref class Wrapper(object): def __init__(self,x): self.x = weakref.ref(x) def __call__(sel

Re: weakrefs and bound methods

2007-10-07 Thread Mathias Panzenboeck
When I change the class Wrapper to following, the class Foo works: class Wrapper(object): def __init__(self,x): self.func_name = x.func_name self.x = weakref.ref(x.im_self) def __call__(self,*args,**kwargs): x = self.x()

Re: weakrefs and bound methods

2007-10-07 Thread Mathias Panzenboeck
Marc 'BlackJack' Rintsch wrote: > On Sun, 07 Oct 2007 16:51:33 +0200, Mathias Panzenboeck wrote: > >> import weakref >> >> class Wrapper(object): >> def __init__(self,x): >> self.x = weakref.ref(x) >> >> def

Re: weakrefs and bound methods

2007-10-07 Thread Mathias Panzenboeck
Marc 'BlackJack' Rintsch wrote: > ``del b`` just deletes the name `b`. It does not delete the object. > There's still the name `_` bound to it in the interactive interpreter. > `_` stays bound to the last non-`None` result in the interpreter. > Actually I have the opposite problem. The referen

Re: weakrefs and bound methods

2007-10-07 Thread Mathias Panzenboeck
Alex Martelli wrote: > Mathias Panzenboeck <[EMAIL PROTECTED]> wrote: > >> Marc 'BlackJack' Rintsch wrote: >>> ``del b`` just deletes the name `b`. It does not delete the object. >>> There's still the name `_` bound to it in the interactive int

Re: weakrefs and bound methods

2007-10-11 Thread Mathias Panzenboeck
Bruno Desthuilliers wrote: > Mathias Panzenboeck a écrit : > > About the lost weakref problem: in Python, methods are just tiny > wrappers around the object, class and function created at lookup time > (yes, on *each* lookup) (and WWAI, they are by the function object > itself

Re: wxPython and Tkinter

2007-11-29 Thread Mathias Uebelacker
Hello, take a look here [1]. I think its a got place to start. br Mathias [1] http://sebsauvage.net/python/gui/#import 2007/11/29, whatazor <[EMAIL PROTECTED]>: > > Hi all, > I migrate some code from tkinter to wxpython. I need the equivalent > Tkinter method Tkinter.Tk.a

Re: Process Id

2007-12-03 Thread Mathias Uebelacker
Which OS Windows or Linux? br Mathias 2007/12/3, Navid Parvini <[EMAIL PROTECTED]>: > > Dear All, > > Would you please help me to find a way to get the list of all processes id > on the machine along with their parent processes. >

SIGILL importing random

2006-05-19 Thread Mathias Waack
) (Debian 4.0.2-10)] on linux2 Everything out of the box from Debian unstable. Anybody with any idea about this? Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: Append a new value to dict

2008-10-13 Thread Mathias Frey
r.setdefault('B',0) + 1 And this works with lists/arrays as well. When there's no list yet setdefault will create an empty list and append the first value. Otherwise it will just append. Greetings from Vienna, mathias -- http://mail.python.org/mailman/listinfo/python-list

Getting stdout using ctypes.

2008-08-14 Thread Mathias Lorente
g box or so). I've looked for some help into the mailing list history and found nothing useful (until now). Do someone has any suggestion? Mathias -- http://mail.python.org/mailman/listinfo/python-list

Re: AJAX Widget Framework

2009-10-03 Thread Mathias Waack
nd server is simple done by exchanging json strings (its ajax based of course, but this stuff works silently in the background). On the server side there are many python toolkits, I prefer cherrypy, others are django and web.py. Hope this helps you. Mathias -- http://mail.python.org/mailman/listinfo/python-list

Extension type inherit from Python int

2020-01-16 Thread Mathias Enzensberger via Python-list
yLongObject. Has anyone already done something like that? Is there some trick to work around that issue, or is it simply not possible to inherit from PyLongObject? Thank you, Mathias -- https://mail.python.org/mailman/listinfo/python-list