pyhon 2.5.1 build fails

2007-06-04 Thread Robin Becker
ata.o so I guess it's not being built for some reason. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: pyhon 2.5.1 build fails

2007-06-04 Thread Robin Becker
Robin Becker wrote: > I am getting an error while building python-2.5.1 on a freebsd 6.1 machine as > a > normal user > > ./configure --prefix=/home/me/mypython --enable-unicode=ucs2 > > seems to work fine, but make install fails whilst running > > Compiling > /

safe cgi parameter

2007-06-04 Thread Robin Becker
_ a<&>b ie always wrap the value, but access to the original is possible via __raw__. However, if you do anything like x.strip() the original is lost. I'm not sure that's a bad thing, but I thought I would ask what others do for this problem. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Baffled on Windows.

2007-06-07 Thread Robin Becker
s shadowed so then we start having to recur and we'll have names like my_my_new.py my_my_list.py .. my_my_my_new.py . I leave as an exercise the algorithm which chooses the appropriate version of new/list to use :) -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs

2007-06-18 Thread Robin Becker
t they go very deep. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

avoid script running twice

2007-06-18 Thread Robin Becker
work(). Is there a smart way to avoid running simultaneously. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: avoid script running twice

2007-06-18 Thread Robin Becker
(or whether to do some of the > remaining work, etc.). > that might work, but this runs on someone's java solaris box with possible many connections going on. I doubt I'd be able to guarantee a particular port. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: avoid script running twice

2007-06-18 Thread Robin Becker
Wildemar Wildenburger wrote: > Robin Becker wrote: > > Well I can think of a dumb way: create a temporary file during the > transaction and have your script check for that before running its main > body. > > > I think thats the most hassle free way of doing

Re: avoid script running twice

2007-06-19 Thread Robin Becker
.errno != EAGAIN: > raise > print >>sys.stderr, "exiting, another copy currently running" > > import time > time.sleep(2) > > (I tested it on linux only!) > many interesting suggestions, unfortunately I'm not exactly sure about the filesystem to be used. I think it might be some kind of NFS which might impact some of these solutions. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: simplifying algebraic expressions

2007-06-26 Thread Robin Becker
mework. The implication is that you know better than the overall fitness requirement. The additional expressions and redundancies allow for extra mutation and combination possibilities which is a good thing for the whole population. If you must, add the requirement to the target ie gi

16bit hash

2007-06-27 Thread Robin Becker
Is the any way to get an efficient 16bit hash in python? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: 16bit hash

2007-06-27 Thread Robin Becker
Josiah Carlson wrote: > Robin Becker wrote: >> Is the any way to get an efficient 16bit hash in python? > > hash(obj)&65535 > > - Josiah yes I thought of that, but cannot figure out if the internal hash really distributes the bits evenly. Particularly since it seems

Re: 16bit hash

2007-06-28 Thread Robin Becker
do the latter so I hoped to pursue a python based approach which has a low probability of busting. Originally I thought the range was a 16bit number which is why I started with 16bit hashes. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: 16bit hash

2007-06-28 Thread Robin Becker
Thomas Jollans wrote: > Robin Becker wrote: ... >> I'm not sure my postscript is really good enough to do the latter so I >> hoped to pursue a python based approach which has a low probability of >> busting. Originally I thought the range was a 16bit number which is w

Re: 16bit hash

2007-06-28 Thread Robin Becker
ent and then I need a fairly robust way to generate reasonable candidates. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

deliberate versus os socket timeout

2007-07-05 Thread Robin Becker
elif hasattr(e, 'code'): return 1, escape('The server couldn\'t fulfill the request.\nError code: '+str(e.code)) else: # everything is fine h = self.headers = {} return 0,.. finally: socket.setdefaulttimeout(oto) -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: deliberate versus os socket timeout

2007-07-06 Thread Robin Becker
ng its own timeout seems to make the socket defaulttimeout irrelevant since I can have no per socket control over it. I think this came up before and I just forgot about it mumble mumble -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

[no subject]

2007-05-15 Thread Robin Dunn
base control, added in wxPython 2.7.1.1. Update to latest FloatCanvas from Chris Barker. The pywxrc tool now properly supports generating classes for menus and menubars, and also creating attributes for menus, menubars and menu items. -- Robin Dunn Software Craftsman http://wxPython.org Java give

ANN: wxPython 2.8.4.0

2007-05-15 Thread Robin Dunn
base control, added in wxPython 2.7.1.1. Update to latest FloatCanvas from Chris Barker. The pywxrc tool now properly supports generating classes for menus and menubars, and also creating attributes for menus, menubars and menu items. -- Robin Dunn Software Craftsman http://wxPython.org Java give

Re: calldll for Python 2.5

2007-05-16 Thread Robin Becker
acement with ctypes? > > > Thomas > I just tried and the latest calldll compiles pretty much out of the box and so I sent him the pyd. Just more legacy code; eventually calldll won't compile and then the conversion will be forced anyhow. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Call for Ruby Champion !!

2007-05-30 Thread Robin Becker
ite me back ! > > Really appreciable for a word of mouth with our friends !!! > > Cheers, > Srini > Boy have you got the wrong vampire ;) -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

non standard path characters

2007-05-31 Thread Robin Becker
these path string conversions? Paths appear to come from all sorts of places and given the increasing use of zip file packaging it doesn't seem appropriate to rely on the current platform as a single choice for the default encoding. -- Robin Becker -- http://mail.python.org/mailman/lis

Re: non standard path characters

2007-05-31 Thread Robin Becker
Tijs wrote: > Robin Becker wrote: ... > Zip files contain a bit flag for the character encoding (cp430 or utf-8), > see the ZipInfo object in module zipfile and the link (on that page) to the > file format description. > But I think some zip programs just put the path in the z

Re: about negative polar plots not defined in python not even matlab

2007-08-14 Thread Robin Becker
rresponds to -infinity. In practice, I think your radiation pattern plot might correspond to gain (or attenuation). Just relabel your plot and change the values to positive. If you do that and the plots look familiar then you have an answer. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

sys.setdefaultencoding

2007-08-28 Thread Robin Becker
specify that unicode-->str should use 'utf8' rather than 'ascii' in all non-specific cases? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting strings containing special characters (german 'Umlaute')

2007-03-02 Thread Robin Becker
ork sorry for long line and possible bad translation to Python #coding: cp1252 def _deSpell(a): u = a.decode('cp1252') return u.replace(u'\u00C4','Ae').replace(u'\u00e4','ae').replace(u'\u00D6','OE').replace(u'\u00f6','oe').replace(u'\u00DC','Ue').replace(u'\u00fc','ue').replace(u'\u00C5','Ao').replace(u'\u00e5','ao') def deSort(a,b): return cmp(_deSpell(a),_deSpell(b)) l = ["Aber", "Ärger", "Beere"] l.sort(deSort) print l -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting strings containing special characters (german 'Umlaute')

2007-03-02 Thread Robin Becker
;o~') //o umlaut .replace(/\u00DC/g,'U~') //U umlaut .replace(/\u00fc/g,'u~') //u umlaut .replace(/\u00C5/g,'A~~') //A ring .replace(/\u00e5/g,'a~~'); //a ring does this actually make sense? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommended FastCGI module?

2007-03-07 Thread Robin Becker
John Nagle wrote: >What's the recommended FastCGI module for Python. There are at least five: > > The Robin Dunn / Total Control Software version: > http://alldunn.com/python/fcgi.py > Last revised in 1998. ... we are using a slightly mod

mySQLdb versus platform problem

2007-03-16 Thread Robin Becker
s it's either the underlying libraries or the compiled extension or python that causes these differences, but which? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: mySQLdb versus platform problem

2007-03-16 Thread Robin Becker
abase has tables with different encodings. Does MySQLdb ignore the table encoding? That would be a bit lame. Also it still doesn't explain the different behaviours between unix & win32 (or perhaps different defaults are somehow magically decided upon). -things were so much easier when bytes were bytes-ly yrs- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

detect suprocess interaction

2007-03-23 Thread Robin Becker
he exceptional case is it possible to detect that input is required and only in that case issue the current contents of stdout (presumably a request for a password)? Clearly I need to supply some kind of input filelike object, but is this sort of thing possible. -- Robin Becker -- http://mai

ANN: wxPython 2.8.3.0

2007-03-23 Thread Robin Dunn
, using MiniFrame for properties panel, the panel is restored together with the main window. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! -- http://mail.python.org/mailman/listinfo/python-list

Re: detect suprocess interaction

2007-03-26 Thread Robin Becker
Nick Craig-Wood wrote: > Robin Becker <[EMAIL PROTECTED]> wrote: >> I'm using subprocess to carry out svn commands (probably should use the svn >> api . >> >> Clearly I need to supply some kind of input filelike object, but is this >>

Re: PyPy 1.0: JIT compilers for free and more

2007-03-29 Thread Robin Becker
chmarks at 33425.6 pystones/second C:\Python\devel\pypy-1.0.0>.\pypy-c.exe \python\lib\test\pystone.py Pystone(1.1) time for 5 passes = 2.16123e-005 This machine benchmarks at 2.3135e+009 pystones/second :) not -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: An error of matrix inversion using NumPy

2007-04-04 Thread Robin Becker
ersion. If the largest eigenvalue is 10**100 and the smallest 10**-200 I probably have an ill determined problem; surprisingly easy to achieve :( -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: An error of matrix inversion using NumPy

2007-04-04 Thread Robin Becker
Robin Becker wrote: > lancered wrote: h. If > your matrix is symmetric then you should certainly be using a qr decomposition I meant to say :) -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: An error of matrix inversion using NumPy

2007-04-04 Thread Robin Becker
tage of the earth wire by mistake :). Some problems naturally have a zero at the origin. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3K or Python 2.9?

2007-09-17 Thread Robin Becker
18 | 14.06 | 14.4050 | 0.800278 | ssh:app5:1258 62 | 48.44 | 30.0170 | 0.484145 | all local 128 |100.00 | 101.8940 | 0.796047 | total Time elapsed since scheduler creation 15.203687 Real average time 0.118773438036 #

Re: can Python be useful as functional?

2007-09-18 Thread Robin Becker
ed that fact, and are now > merely haggling about the price". > allegedly G B Shaw (http://findarticles.com/p/articles/mi_qn4158/is_19980925/ai_n14182408) -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Odd files; just left behind?

2007-09-19 Thread Robin Becker
I see a folder .python-eggs in my home directory on one of our servers with various .so files ~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so are these just left behind from some install process? -- Robin Becker -- http://mail.python.org/mailman/listinfo

Re: super() doesn't get superclass

2007-09-19 Thread Robin Becker
mro__ for the base class A immediately preceding B and then invokes the descriptor with the call: A.__dict__['m'].__get__(obj, A). " -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd files; just left behind?

2007-09-19 Thread Robin Becker
John J. Lee wrote: > Robin Becker <[EMAIL PROTECTED]> writes: > >> I see a folder .python-eggs in my home directory on one of our servers >> with various .so files >> >> ~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so >&g

Re: Odd files; just left behind?

2007-09-21 Thread Robin Becker
Bruno Desthuilliers wrote: > Robin Becker a écrit : >> John J. Lee wrote: >> >>> Robin Becker <[EMAIL PROTECTED]> writes: >>> >>>> I see a folder .python-eggs in my home directory on one of our servers >>>> with various .so file

Re: Odd files; just left behind?

2007-09-21 Thread Robin Becker
of not reading the FineManual(tm) ? well I didn't write the installer or the associated egg setup. The egg things are supposed to do the right thing, but perhaps they're too difficult for the egg layers. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd files; just left behind?

2007-09-22 Thread Robin Becker
ll is wrong and may not even be possible. It also allows for the carefully crafted binary extensions to be substituted by anyone with write permission to the cache folder. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: wxPython 2.8.6.0

2007-09-27 Thread Robin Dunn
styles, this style replaces wx.BORDER_DOUBLE. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! -- http://mail.python.org/mailman/listinfo/python-list

recipient validation with smtplib

2007-09-28 Thread Robin Becker
mtp setups do enforce recipient validation, but it doesn't seem terribly easy to do this with sendmail. I wondered if there were some way to do this in python? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: recipient validation with smtplib

2007-09-28 Thread Robin Becker
Tim Williams wrote: > On 28/09/2007, Robin Becker <[EMAIL PROTECTED]> wrote: >> Is there a way to use smtplib to get recipient validation. I can use smtplib >> quite happily to send emails using the locahost's sendmail, but sendmail is >> just >> fire and f

Re: Create a string array of all comments in a html file...

2007-09-30 Thread Robin Becker
nks. > You should probably eat beautiful soup at http://www.crummy.com/software/BeautifulSoup/documentation.html which helps with this sort of task. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: WebBased Vector 2D Graphics

2007-10-05 Thread Robin Becker
e job has been done. A javascript timeout periodically performed the query request and used the response to update the ticker. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: NUCULAR fielded text searchable indexing

2007-10-09 Thread Robin Becker
ht it was funny. Can't I make fun of > politicians in my open source projects? Besides there is > a great tradition of tounge-in-cheek package names, like > "Cold fusion", for example. >... I think it's an excellent name :) -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Plugins / Modularity

2007-10-10 Thread Robin Kåveland
Hi there. I'm basically in the process of writing my first substantial application in Python, and I've made a couple of (I'd like to say) design decisions so it won't just be a jumble. So, I've divided my program into three sub-packages, core, plugins and utilities. The core will be needed for the

Re: Plugins / Modularity

2007-10-10 Thread Robin Kåveland
On Oct 10, 8:38 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Oct 10, 12:30 pm, Robin Kåveland <[EMAIL PROTECTED]> wrote: > > > > > Hi there. I'm basically in the process of writing my first substantial > > application in Python, and

Re: Last iteration?

2007-10-13 Thread Robin Kåveland
On Oct 12, 12:58 pm, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > can I determine somehow if the iteration on a list of values is the last > iteration? > > Example: > > for i in [1, 2, 3]: >if last_iteration: > print i*i >else: > print i > > that would print > > 1 > 2 >

deepcopy debugging

2007-10-19 Thread Robin Becker
254, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Python\lib\copy.py", line 189, in deepcopy y = _reconstruct(x, rv, 1, memo) File "C:\Python\lib\copy.py", line 322, in _reconstruct y = callable(*args) File "C:\Python\lib\copy_reg.py", line 92, in __newobj__ return cls.__new__(cls, *args) TypeError: object.__new__(_hashlib.HASH) is not safe, use _hashlib.HASH.__new__() -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: vote for Python - PLEASE

2007-10-20 Thread Robin Becker
thon+mysql; I dispute the value of "kicking our butts" though. When I voted python was running at 39.8% about equal to java+php (41.4%). -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: wxPython 2.8.6.1

2007-10-28 Thread Robin Dunn
the frozen one in Z-order to paint through, and also mouse events clicking through to the lower window. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! -- http://mail.python.org/mailman/listinfo/python-list

Re: why did these companies choose Tcl over Python

2007-10-31 Thread Robin Becker
embedded language. Of course the embedding was the final application as the controlling computers were really puny eg pdp8/9/11. At that time the concept of free software hadn't even arisen. I believe forth was proprietary, but it was widely available to academics and many machine tools

Re: ReportLab - Frames - Images

2007-01-15 Thread Robin Becker
uot;, thickness=3, width="100%")) > > > pdf.build(doc,bill) change(2) pdf.build(doc) > > run() > *** CUT *** > I also had to change the name of the image to one on my system. Hope this helps -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

2.3-2.5 what improved?

2007-01-17 Thread Robin Becker
g made about 2.5 being 10% faster than 2.4/2.3 etc etc. Can anyone say where the speedups were? Presumably we have a lot of old cruft that could be improved in some way eg moving loops into comprehensions, using iterator methods etc. Are those sort of things what we should look at? -- Robin

Re: 2.3-2.5 what improved?

2007-01-17 Thread Robin Becker
[EMAIL PROTECTED] wrote: > Robin> I sort of remember claims being made about 2.5 being 10% faster > Robin> than 2.4/2.3 etc etc. Can anyone say where the speedups were? > > What's New might be enlightening: > > http://www.google.com/search?q=what%27s+ne

Re: 2.3-2.5 what improved?

2007-01-17 Thread Robin Becker
[EMAIL PROTECTED] wrote: > Robin Becker a écrit : > > > AFAIK, most of the speedup comes from optimization of the builtin dict > type, which is the central > data structure in Python. But anyway, as Robert pointed out, using CGI > means lauching > a new Python pr

[ANN] wxPython 2.8.1.1

2007-01-21 Thread Robin Dunn
memory leaks in GetPartialTextExtents. More fixes for the native wx.ListCtrl on Mac. Added wx.aui.AuiNotebook.GetAuiManager(). Added wx.aui.AuiMDIParentFrame and wx.aui.AuiMDIChildFrame, which essentially implement the MDI interface using a normal wx.Frame and a wx.aui.AuiNotebook. -- Robin

Re: Python 2.5 Quick Reference

2007-02-03 Thread Robin Becker
Dick Moores wrote: > <http://rgruet.free.fr/PQR25/PQR2.5.html> > Is this reliable? (Looks good to me, but...) > . I really like these for a good overview -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

ctypes.com.IUnknown

2007-02-03 Thread Robin Becker
too old to bother with. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes.com.IUnknown

2007-02-04 Thread Robin Becker
Giles Brown wrote: > > > What about downloading the spin-off library? > http://sourceforge.net/projects/comtypes/ > > (I think this was created to move the com stuff out of ctypes?) ... Thanks I didn't know that; I'll give it a whirl. -- Robin Becke

Re: in place-ness of list.append

2007-02-05 Thread Robin Becker
ral than def addnumber(alist,num): return alist+[num] and then ..addnumber(alist,num).. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling J from Python

2007-02-05 Thread Robin Becker
;> >> | Here's a J program to calculate the average of a list of numbers: >> |avg=: +/ % # >> |avg 1 2 3 4 >> | 2.5 >> > That looks like some variation of APL my colleague informs me that it is indeed associated with some of the same people i

Re: ctypes.com.IUnknown

2007-02-05 Thread Robin Becker
Robin Becker wrote: > Giles Brown wrote: >> >> >> What about downloading the spin-off library? >> http://sourceforge.net/projects/comtypes/ >> >> (I think this was created to move the com stuff out of ctypes?) > > > Thanks I didn&

Re: Getting a class name from within main

2007-02-07 Thread Robin Becker
n. > > Thanks, > > Barry. > >>> class A: ... pass ... >>> print A.__name__ A >>> -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-07 Thread Robin Becker
jects: --- 16,28 [compiler] #mysql_root: /usr/local/mysql ! library_dirs: \tmp\mysql-5.0.33\lib_release ! include_dirs: \tmp\mysql-5.0.33\include ! libraries: mysqlclient ! zlib ! wsock32 ! advapi32 ! #msvcrt ! #libcmt #extra_compile_args: ! extra_objects: /NODEFAULTLIB:MSVCRT -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling J from Python

2007-02-08 Thread Robin Becker
Tina I wrote: .. > It's also a village in Norway: http://en.wikipedia.org/wiki/Hell,_Norway In German it's bright -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Formatting milliseconds to certain String

2007-02-12 Thread Robin Becker
ogan how about >>> def millis2str(millis): ... hours, x = divmod(int(millis),360) ... mins, x = divmod(x,6) ... secs, x = divmod(x,1000) ... s = '%02d:%02d:%02d' % (hours, mins,secs) ... if x: s += ',%03d' % x ... return s ... >

Re: ANN: py lib 0.9.0: py.test, distributed execution, microthreads ...

2007-02-15 Thread Robin Becker
') channel = gw.remote_exec('channel.send("Hello From the remote world!")') print channel.receive() and I see C:\tmp>\tmp\tgw.py Hello From the remote world! C:\tmp> -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: BDFL in wikipedia

2007-02-21 Thread Robin Becker
tive is a constantly changing language without any clear goal or endpoint. That's fine for some not for others. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question(file-delete trailing comma)

2007-02-26 Thread Robin Becker
.. I often use sed for such small problems. c:\tmp>cat ex.txt a,b,c,d, a1,b1,c1,d1, a2,b2,c2,d2, c:\tmp>sed -e"s/,$//" ex.txt a,b,c,d a1,b1,c1,d1 a2,b2,c2,d2 c:\tmp> that doesn't involve python of course. I recommend one of the many tutorial introductions to pyt

Re: timing puzzle

2007-11-16 Thread Robin Becker
saved_nodes = [] >for A in active_nodes[:]: > .. > if not cond: > saved_nodes.append(A) > > .. >active_nodes = saved_nodes >. > I like this approach, better than mine. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

timing puzzle

2007-11-16 Thread Robin Becker
are O(n/2) on average. On the other hand we have to keep this list in sorted order. What data structure should I be using? I should add that I tried using a __cmp__ method to assist in doing the sorted insert, but that interfered with the simple active_nodes.remove. -- Robin Becker -- http:

Re: timing puzzle

2007-11-16 Thread Robin Becker
ven faster: > active_nodes = [node for node in active_nodes if node not in > deleted_nodes], where deleted_nodes is a set. > > > Normal micro-optimization techniques apply here too, like looking up > the remove() method ahead of time and so on. >. yes indeed and they'

Re: struct,long on 64-bit machine

2007-11-19 Thread Robin Becker
Neal Becker wrote: > What's wrong with this? > type(struct.unpack('l','\00'*8)[0]) > > > Why I am getting 'int' when I asked for 'long'? > > This is on python-2.5.1-15.fc8.x86_64 > On my AMD 64 I think int is 64 bits $ py

Re: Create thumbnail image (jpg/png) of PDF file using Python

2007-11-20 Thread Robin Becker
too exotic, but otherwise it works quite well. If that sounds OK I can send you a script that I use. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Research-oriented Python mailing list?

2007-11-22 Thread Robin Becker
! > > Cheers!!! > Albert-Jan > > Cheers! > Albert-Jan I guess that depends on what you want to research. If you're into developing python I'd start lurking on the python dev list; if you're into compilers and basic blocks then the pypy list is just the thing et

png transparency with PIL

2007-11-23 Thread Robin Becker
of the way png does transparency. I'm guessing I need the alpha channel, but is there a way to get hold of it? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: png transparency with PIL

2007-11-23 Thread Robin Becker
Bjoern Schliessmann wrote: > Robin Becker wrote: > >> I'm trying to determine the transparency information for a png . >> guessing I need the alpha channel, but is there a way to get hold >> of it? > > For accessing the alpha channel, there is an R

Re: Should proxy objects lie about their class name?

2007-11-27 Thread Robin Becker
ass thus turning all my modules into instances of class_war :) -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

PIL image.getcolors

2007-11-29 Thread Robin Becker
t;>>> im0.getcolors() > [(55367, (255, 1, 25, 255)), (24104, (24, 79, 235, 255)), (46529, (0, 0, 0, > 0))] >>>> im1 = Image.open('400px-Wiki_letter_w.svg.png') >>>> im1.mode > 'RGBA' >>>> im1.getcolors() >>>> im1.getcolors() is None > True >>>> -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

ANN: wxPython 2.8.7.1

2007-11-30 Thread Robin Dunn
ed GetDirItemData to wx.GenericDirCtrl, which returns a reference to the data object associated with an item in the control. (Patch #1836326) -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Robin Becker
3100 for PyxAggregateTailMerge C:\code\users\robin> -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils & OS X universal binaries

2007-12-08 Thread Robin Becker
27;t define the gcc macros the we seem to get the wrong result. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

distutils & OS X universal binaries

2007-12-08 Thread Robin Becker
4 different binaries are being squashed together in these universal binaries. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils & OS X universal binaries

2007-12-08 Thread Robin Becker
splays a known bug when run on a ppc. >> Have you reported the problem at http://bugs.python.org/? A minimal >> example could help us to fix the problem. > > At first, I also thought that Robin suggested that there is a problem > with Python. Upon re-reading, I now believe he ra

Re: distutils & OS X universal binaries

2007-12-08 Thread Robin Becker
undef WORDS_BIGENDIAN # endif # define WORDS_BIGENDIAN 1 # else # ifdef __LITTLE_ENDIAN__ # ifdef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #

Re: distutils & OS X universal binaries

2007-12-08 Thread Robin Becker
sing WORDS_BIGENDIAN so fewer changes need to be made to the code. It just makes resynching with the upstream code easier. If neither are defined we get to use the definition from setup.py if it's needed. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils & OS X universal binaries

2007-12-09 Thread Robin Becker
error if the variable isn't defined, but that is cleaner thanks for the assistance -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils & OS X universal binaries

2007-12-10 Thread Robin Becker
Robin Becker wrote: >> Ok. Still, I would write it as >> >> #if defined(__LITTLE_ENDIAN__) >> #undef WORDS_BIGENDIAN >> #elif defined(__BIG_ENDIAN__) >> #undef WORDS_BIGENDIAN >> #define WORDS_BIGENDIAN 1 >> #endif >> >> Re

simplejson setup problem

2007-12-11 Thread Robin Becker
s to be creating an egg and that bit is failing. Is there some easy way to avoid this broken egg syndrome and just use ordinary distutils? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Any Python lullabies?

2006-04-18 Thread Robin Becker
Not a lullaby, but appropriate near easter(s) while 1: life.side.bright.look() -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

self modifying code

2006-04-29 Thread Robin Becker
) It could be replaced by data = somethingcomplexandcostly() def func(a): return simple(data,a) but this always calculates data. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: self modifying code

2006-04-29 Thread Robin Becker
does it is overwritten. As pointed out it won't work as simply in a class. Memoisation could improve the performance of the normal case form of the function ie def func(a): return simple(data,a) but I guess that would depend on whether simple(data,a) is relatively expens

Re: opposite function to split?

2006-04-29 Thread Robin Becker
','.join(['a','b','c']) == 'a,b,c' -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

<    2   3   4   5   6   7   8   9   >