Re: Best practices for dynamically loading plugins at startup

2005-09-26 Thread Jack Diederich
On Sun, Sep 25, 2005 at 11:24:04PM +0200, Christoph Haas wrote: > Dear coders... > > I'm working on an application that is supposed to support "plugins". > The idea is to use the plugins as packages like this: > > Plugins/ > __init__.py > Plugin1.py > Plugin2.py > Plugin3.py > > When the

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 09:23:09PM +0300, Stelios Xanthakis wrote: > The explanation is this: hash > and comparison of objects depends on the state of the memory > allocator. A sample case is this: > > class A: pass > dummy0=47 # comment this to get a different result for min >

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 01:55:48PM -0400, Bill Mill wrote: > Bill Mill wrote: > > > > Pentium M 1.8 GHz Windows 2k. Here's the top of the profile results > > for fast and slow on my machine (these won't look decent except in a > > fixed-width font): > > > > > > > Interestingly, the test.py:36 li

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 01:35:04PM -0400, Bill Mill wrote: > On 8/25/05, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > Mark Dickinson wrote: > > > > > Questions: > > > > > > (1) Can anyone else reproduce this behaviour, or is it just some quirk > > > of my setup? > > > (2) Any possible expla

Re: Speed quirk: redundant line gives six-fold speedup

2005-08-25 Thread Jack Diederich
On Thu, Aug 25, 2005 at 04:44:24PM +, Mark Dickinson wrote: > I have a simple 192-line Python script that begins with the line: > > dummy0 = 47 > > The script runs in less than 2.5 seconds. The variable dummy0 is never > referenced again, directly or indirectly, by the rest of the script. >

Re: Permutation Generator

2005-08-14 Thread Jack Diederich
On Fri, Aug 12, 2005 at 03:48:38PM -0400, Michael J. Fromberger wrote: > In article <[EMAIL PROTECTED]>, > Talin <[EMAIL PROTECTED]> wrote: > > > I'm sure I am not the first person to do this, but I wanted to share > > this: a generator which returns all permutations of a list: > > You're right

Re: Module Extension C/CPI Question

2005-08-10 Thread Jack Diederich
On Tue, Aug 09, 2005 at 09:15:17PM -0400, Jeremy Moles wrote: > When using the C API and writing extension modules, how do you normally > pass a structure up into the python module? For instance, if I have a > structure: > > typedef struct Foo { > int x; > int y; > int z; >

Re: Sr. Compiler Engineering Opportunity

2005-07-28 Thread Jack Diederich
Great, Transmeta is hiring. What does this have to do with python? Hmm, Mutliprocessor or Multicore Transmeta chips? Let the rumor mongering begin. On Thu, Jul 28, 2005 at 12:40:13AM -0700, Nathan Sanders wrote: > Hello- > > I'm hoping to network with you and find out if you know anyone who > y

Re: all possible combinations

2005-07-13 Thread Jack Diederich
On Wed, Jul 13, 2005 at 05:07:33PM +0100, Duncan Smith wrote: > rbt wrote: > > On Wed, 2005-07-13 at 11:09 -0400, rbt wrote: > > > >>On Wed, 2005-07-13 at 10:21 -0400, rbt wrote: > >> > >>>Say I have a list that has 3 letters in it: > >>> > >>>['a', 'b', 'c'] > >>> > >>>I want to print all the pos

Re: Efficiency of using long integers to hold bitmaps

2005-07-12 Thread Jack Diederich
On Wed, Jul 13, 2005 at 03:24:48AM +1000, Jeff Melvaine wrote: > Bengt, > > Thanks for your informative reply, further comments interleaved. > > "Bengt Richter" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Mon, 11 Jul 2005 02:37:21 +1000, "Jeff Melvaine" > > <[EMAIL PROT

Re: A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals...

2005-06-21 Thread Jack Diederich
On Tue, Jun 21, 2005 at 11:30:19PM -0400, Jenta wrote: > A World Beyond Capitalism 2005, An Annual International Multiracial > Alliance Building Peace Conference Is Accepting Proposals... > This must be a joke (and please please be a joke like the recent viral website competition[1] that featured

Re: MUD Client and Python Plugin Framework

2005-05-23 Thread Jack Diederich
On Mon, May 23, 2005 at 10:51:47AM -0700, Discipulus wrote: > Hey, > I'm contemplating starting a MUD client in Python, and I would like to > make it so that people can write their own plugins, but I need ideas on > the framework. Any suggestions? Use Lyntin? (http://lyntin.sourceforge.net/) An ex

Re: Is Python suitable for a huge, enterprise size app?

2005-05-18 Thread Jack Diederich
On Wed, May 18, 2005 at 08:37:00AM -0700, john67 wrote: > The company I work for is about to embark on developing a commercial > application that will cost us tens-of-millions to develop. When all is > said and done it will have thousands of business objects/classes, some > of which will have hun

Re: Adding new methods to new-style classes dynamically

2005-05-05 Thread Jack Diederich
On Thu, May 05, 2005 at 01:35:09AM -0700, Max Derkachev wrote: > Good day to all. > > Some time ago I'd been playing with a framework which uses dynamic > class creation havily. Say, I could do: > > #well, try this with the new-style class > class A(object): > pass > > # the new-style __dic

Re: Using Ming on Windows

2005-04-23 Thread Jack Diederich
On Sat, Apr 23, 2005 at 05:13:29PM -0300, Andr? Roberge wrote: > I tried to install Ming > (http://sourceforge.net/projects/ming/) > on Windows to use with Python *but* > I can't [/don't know how to] use "make" to install it. > > Does anyone know where I could find a ready-made compiled > version

Re: Private class?

2005-04-21 Thread Jack Diederich
On Thu, Apr 21, 2005 at 06:13:02AM -0700, codecraig wrote: > Hi, > First, I come from a Java background. > > Ok, so I have this idea that I want to create an EventBus...basically > a central class where objects can register themselves as listeners for > different events. This central class al

Re: some sort of permutations...

2005-04-12 Thread Jack Diederich
On Tue, Apr 12, 2005 at 08:41:15AM -0400, Bill Mill wrote: > On Apr 12, 2005 2:37 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > "Bernard A." wrote: > > > > > i'm looking for a way to have all possible length fixed n-uples from a > > > list, i think generators can help, but was not able to do it

Re: Python extension performance

2005-04-08 Thread Jack Diederich
On Fri, Apr 08, 2005 at 10:14:52PM -0400, David Jones wrote: > I am trying to hunt down the difference in performance between some raw > C++ code and calling the C++ code from Python. My goal is to use Python > to control a bunch of number crunching code, and I need to show that > this will not

Re: Puzzling OO design problem

2005-04-08 Thread Jack Diederich
On Fri, Apr 08, 2005 at 06:40:54PM -0700, George Sakkis wrote: > > Err, you might want to explain what these things do instead of an > > abstract description of how you are doing it. It looks like you are > > using inheritance in the normal way _and_ you are using it to handle > > versioning of so

Re: Puzzling OO design problem

2005-04-08 Thread Jack Diederich
On Fri, Apr 08, 2005 at 04:42:52PM -0700, George Sakkis wrote: > I'm looking for a design to a problem I came across, which goes like > this (no, it's not homework): > > 1. There is a (single inheritance) hierarchy of domain classes, say > A<-B<-..<-Z (arrows point to the parent in the inheritance

Re: Equivalent string.find method for a list of strings

2005-04-08 Thread Jack Diederich
On Fri, Apr 08, 2005 at 02:17:32PM -0400, jeremit0 wrote: > I have read a text file using the command > > lines = myfile.readlines() > > and now I want to seach those lines for a particular string. I was > hoping there was a way to "find" that string in a similar way as > searching simply a si

Re: string goes away

2005-03-31 Thread Jack Diederich
On Thu, Mar 31, 2005 at 08:32:20PM -0800, Andreas Beyer wrote: > Hi: > > If I am getting the docs etc. correctly, the string-module is depricated > and is supposed to be removed with the release of Python 3.0. > I still use the module a lot and there are situations in which I don't > know what t

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread Jack Diederich
On Tue, Mar 29, 2005 at 12:38:42PM +0300, Ville Vainio wrote: > > "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes: > > Raymond> If the experience works out, then all you're left with is > Raymond> the trivial matter of convincing Guido that function > Raymond> attributes

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-28 Thread Jack Diederich
On Mon, Mar 28, 2005 at 10:28:29AM -0700, Steven Bethard wrote: > Jack Diederich wrote: > > > > itertools to iter transition, huh? I slipped that one in, I mentioned > > it to Raymond at PyCon and he didn't flinch. It would be nice not to > > have to sprinkle

Re: Pre-PEP: Dictionary accumulator methods

2005-03-28 Thread Jack Diederich
On Sun, Mar 27, 2005 at 02:20:33PM -0700, Steven Bethard wrote: > Michele Simionato wrote: > >I am surprised nobody suggested we put those two methods into a > >separate module (say dictutils or even UserDict) as functions: > > > >from dictutils import tally, listappend > > > >tally(mydict, key) >

Re: Wishlist item: itertools.flatten

2005-03-11 Thread Jack Diederich
On Sat, Mar 12, 2005 at 12:55:38AM +0200, Christos TZOTZIOY Georgiou wrote: > On 12 Mar 2005 00:44:39 +0200, rumours say that Ville Vainio > <[EMAIL PROTECTED]> might have written: > > >Christos> This is just a personal opinion, but I detest restraints > >Christos> on library (itertools mo

Re: naming convention for scalars, lists, dictionaries ...

2005-02-28 Thread Jack Diederich
On Mon, Feb 28, 2005 at 09:41:37PM +0100, Just wrote: > In article <[EMAIL PROTECTED]>, > Jack Diederich <[EMAIL PROTECTED]> wrote: > > > On Mon, Feb 28, 2005 at 04:02:37PM -0500, Benji York wrote: > > > Jack Diederich wrote: > > > >Ditto for me, p

Re: naming convention for scalars, lists, dictionaries ...

2005-02-28 Thread Jack Diederich
On Mon, Feb 28, 2005 at 04:02:37PM -0500, Benji York wrote: > Jack Diederich wrote: > >Ditto for me, plural implies list and singular implies instance, > >for (contact) in contacts: > > # do something with contact > > May I ask why you place the parenthesis in the

Re: naming convention for scalars, lists, dictionaries ...

2005-02-28 Thread Jack Diederich
On Mon, Feb 28, 2005 at 11:32:22AM -0700, Steven Bethard wrote: > [EMAIL PROTECTED] wrote: > >Since Python does not have declarations, I wonder if people think it is > >good to name function arguments according to the type of data structure > >expected, with names like "xlist" or "xdict". > > In g

Re: Python Online Programming Contest

2005-02-24 Thread Jack Diederich
On Thu, Feb 24, 2005 at 06:18:09PM -0800, Varun wrote: > Hi, > It is open for anyone across the world. All times are local ( GMT > +5:30). The contest will be on Feb 27 (this sunday) and i will ensure > that the times are clearly specified. How long is the contest? ICFP is three days (first 24 ho

Re: iterative lambda construction

2005-02-21 Thread Jack Diederich
On Mon, Feb 21, 2005 at 01:14:00PM -0800, Paul Rubin wrote: > "markscottwright" <[EMAIL PROTECTED]> writes: > > But when I try to do it iteratively, it just hangs when I try to > > evaluate the results (for count > 1): > > > > def repeated2(f, count): > > newfun = f > > for i in range(coun

Re: Help with research

2005-02-18 Thread Jack Diederich
On Thu, Feb 17, 2005 at 07:09:44PM -0500, Jeremy Bowers wrote: > On Thu, 17 Feb 2005 15:51:47 -0800, elena wrote: > > I can go to my friends, however it occurred to me that it might be > > better to post in a newsgroup and get a larger, more diverse, and > > random sample. > > Larger, yes, more d

Re: "perl -p -i -e" trick in Python?

2005-02-15 Thread Jack Diederich
On Wed, Feb 16, 2005 at 04:38:03PM +1000, Stephen Thorne wrote: > On Wed, 16 Feb 2005 15:18:57 +0900, Wonjae Lee <[EMAIL PROTECTED]> wrote: > > I read the comment of > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277753. > > (Title : Find and replace string in all files in a directory)

Re: Can __new__ prevent __init__ from being called?

2005-02-15 Thread Jack Diederich
On Tue, Feb 15, 2005 at 10:30:21PM +0100, Felix Wiemann wrote: > Sometimes (but not always) the __new__ method of one of my classes > returns an *existing* instance of the class. However, when it does > that, the __init__ method of the existing instance is called > nonetheless, so that the instanc

Re: Inheritance error in python 2.3.4???

2005-02-14 Thread Jack Diederich
On Tue, Feb 15, 2005 at 10:56:23AM +1100, Delaney, Timothy C (Timothy) wrote: > [EMAIL PROTECTED] wrote: > > > I guess I could just use one underscore but that means it is > > easier for other people to get at my implementation details (which, > > coming from a C++ background really bothers me

Re: Kill GIL (was Re: multi threading in multi processor (computer))

2005-02-12 Thread Jack Diederich
On Sat, Feb 12, 2005 at 07:13:17PM -0500, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Paul Rubin wrote: > > > >The day is coming when even cheap computers have multiple cpu's. > >See hyperthreading and the coming multi-core P4's, and the finally > >announced Cell pro

Re: [perl-python] combinatorics fun

2005-02-10 Thread Jack Diederich
On Thu, Feb 10, 2005 at 02:51:24PM -0800, Xah Lee wrote: > a year ago i wrote this perl program as part of a larger program. > > as a exercise of fun, let's do a python version. I'll post my version > later today. from probstat import Combination There is something deeply wrong about plugging yo

Re: "Collapsing" a list into a list of changes

2005-02-05 Thread Jack Diederich
On Sat, Feb 05, 2005 at 02:31:08PM +1000, Nick Coghlan wrote: > Jack Diederich wrote: > >Since this is 2.4 you could also return a generator expression. > > > > > >>>>def iter_collapse(myList): > > > >... return (x[0] for (x) in

Re: Persistence design [was: RE: OT: why are LAMP sites slow?]

2005-02-04 Thread Jack Diederich
On Fri, Feb 04, 2005 at 09:09:46PM -0200, Carlos Ribeiro wrote: > On Fri, 4 Feb 2005 17:46:44 -0500, Jack Diederich <[EMAIL PROTECTED]> wrote: > > On Fri, Feb 04, 2005 at 10:31:19AM -0800, Robert Brewer wrote: > > > Jack Diederich wrote: > > > > If there

Re: Persistence design [was: RE: OT: why are LAMP sites slow?]

2005-02-04 Thread Jack Diederich
On Fri, Feb 04, 2005 at 10:31:19AM -0800, Robert Brewer wrote: > Jack Diederich wrote: > > *ding*ding*ding* The biggest mistake I've made most > > frequently is using > > a database in applications. YAGNI. Using a database at all has it's > > own overhe

Re: "Collapsing" a list into a list of changes

2005-02-04 Thread Jack Diederich
On Fri, Feb 04, 2005 at 12:43:37PM -0500, Alan McIntyre wrote: > Hi all, > > I have a list of items that has contiguous repetitions of values, but > the number and location of the repetitions is not important, so I just > need to strip them out. For example, if my original list is > [0,0,1,1,1

Re: OT: why are LAMP sites slow?

2005-02-04 Thread Jack Diederich
On Thu, Feb 03, 2005 at 10:09:49PM -0800, Paul Rubin wrote: > aurora <[EMAIL PROTECTED]> writes: > > I'm lost. So what do you compares against when you said LAMP is slow? > > What is the reference point? Is it just a general observation that > > slashdot is slower than we like it to be? [reordere

Re: limited python virtual machine

2005-01-30 Thread Jack Diederich
On Sun, Jan 30, 2005 at 11:59:39AM +1000, Nick Coghlan wrote: > Alex Martelli wrote: > >It didn't seem to me that Steven's question was so restricted; and since > >he thanked me for my answer (which of course is probably inapplicable to > >some custom interpreter that's not written yet) it appears

Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-26 Thread Jack Diederich
On Wed, Jan 26, 2005 at 10:39:18AM -0800, aurora wrote: > >On Wed, Jan 26, 2005 at 05:18:59PM +0100, Alexander Schremmer wrote: > >>On Tue, 25 Jan 2005 22:08:01 +0100, I wrote: > >> > >> sys.safecall(func, maxcycles=1000) > >>> could enter the safe mode and call the func. > >> > >>This might be

Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-26 Thread Jack Diederich
On Wed, Jan 26, 2005 at 10:23:03AM -0700, Steven Bethard wrote: > Jack Diederich wrote: > >Yes, this comes up every couple months and there is only one answer: > >This is the job of the OS. > >Java largely succeeds at doing sandboxy things because it was written that > >

Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-26 Thread Jack Diederich
On Wed, Jan 26, 2005 at 05:18:59PM +0100, Alexander Schremmer wrote: > On Tue, 25 Jan 2005 22:08:01 +0100, I wrote: > > sys.safecall(func, maxcycles=1000) > > could enter the safe mode and call the func. > > This might be even enhanced like this: > > >>> import sys > >>> sys.safecall(func,

Re: Another scripting language implemented into Python itself?

2005-01-24 Thread Jack Diederich
On Mon, Jan 24, 2005 at 09:17:24PM -0500, Roy Smith wrote: > Rocco Moretti <[EMAIL PROTECTED]> wrote: > > The OP doesn't mention his application, but there is something to be > > said about domain specific scripting languages. A well designed > > domain-specific scripting language(*) with the app

Re: building extensions: ming & python mathlink for win32

2005-01-20 Thread Jack Diederich
On Thu, Jan 20, 2005 at 08:38:35PM +0100, Jelle Feringa // EZCT / Paris wrote: > Have been trying to build python extensions from the C libs ming & mathlink. > Same thing goes for Ming (c lib for compiling flas .swf files), such a pity > no disutils script is included in this very powerful library!

Re: Zen of Python

2005-01-19 Thread Jack Diederich
On Wed, Jan 19, 2005 at 09:28:13PM -0500, Peter Hansen wrote: > Jeff Shannon wrote: > >Timothy Fitz wrote: > >>Which I agree with, and which makes sense. However your "gist" is a > >>different meaning. It's not that "Flat is better than nested" it's > >>that "Too flat is bad and too flat is nested

Re: RuntimeError: dictionary changed size during iteration

2005-01-19 Thread Jack Diederich
On Wed, Jan 19, 2005 at 11:45:15PM +0300, Roman Suzi wrote: > > I think, the behaviour below is misfeature: > > >>> [e for e in vars()] > Traceback (most recent call last): > File "", line 1, in ? > RuntimeError: dictionary changed size during iteration > >>> e = None > >>> [e for e in vars()]

Re: How to list the global functions from a C program

2005-01-14 Thread Jack Diederich
On Fri, Jan 14, 2005 at 04:01:13PM +0100, Francesco Montorsi wrote: > PyObject *list = PyObject_Dir(m_pGlobals); > if (!list || PyList_Check(list) == FALSE) > return; > > for (int i=0,max=PyList_Size(list); i > PyObject *elem = PyList_GetItem(list, i); > if (PyCallable_Check(elem) !=

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-07 Thread Jack Diederich
On Fri, Jan 07, 2005 at 01:35:46PM -0800, aurora wrote: > Hello! > > Just gone though an article via Slashdot titled "The Free Lunch Is Over: A > Fundamental Turn Toward Concurrency in Software" > [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the > continous CPU perfo

Re: ming for python

2004-12-08 Thread Jack Diederich
On Tue, Dec 07, 2004 at 07:55:09PM +0100, titouille wrote: > Hello everybody !! > > anyone has try to build ming0.3beta1 for python 2.3.3 under windows ?? > > Since three days, I try to build it with mingw32, and finally, I am > stopped with C declarations error in src/actioncompiler/swf4compile

<    1   2