Re: 5 queens

2007-12-22 Thread Terry Reedy
"John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | It's *91* distinct solutions to what appears to be *exactly* your | problem: | | """ | Dudeney (1970, pp. 95-96) also gave the following results for the | number of distinct arrangements N_u(k,n) of k queens attacking or

Re: Performance on local constants?

2007-12-22 Thread Terry Reedy
"John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Dec 23, 5:38 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: | > 'Most flexible' in a different way is | > | > def searcher(rex): | > crex = re.compile(rex) | > def _(txt): | > return crex.search(txt) | >

Re: 5 queens

2007-12-22 Thread subeen
Hi, The problem you are trying to solve is a very famous and common problem which can be solved by backtracking. Please try google with 8 queens problem or n queens problem. > > I designed in JavaScript a small program on my website called 5 > queens. > (http://www.cf29.com/design/dame5_eng.php)

Element bug?(ElementTree)

2007-12-22 Thread limodou
I don't know if it's a bug? Try below code: >>> from elementtree.ElementTree import Element >>> a = Element('a') >>> if a: ... print '' ... >>> a.__len__() 0 You can see if I test a, the result will be False. I don't know if it's an expected result, but this thing has beaten me som

Re: 5 queens

2007-12-22 Thread Grant Edwards
On 2007-12-23, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-12-22, cf29 <[EMAIL PROTECTED]> wrote: > >> The goal is to control all the chess board with five queens that do >> not attack each other. > [...] >> My problem starts now. How can I find the next solution and >> append it to the lis

Modify arguments between __new__ and __init__

2007-12-22 Thread Steven D'Aprano
When you call a new-style class, the __new__ method is called with the user-supplied arguments, followed by the __init__ method with the same arguments. I would like to modify the arguments after the __new__ method is called but before the __init__ method, somewhat like this: >>> class Spam(o

Re: It's ok to __slots__ for what they were intended

2007-12-22 Thread John Nagle
Fredrik Lundh wrote: > John Nagle wrote: > >> I'd like to hear more about what kind of performance gain can be >> obtained from "__slots__". I'm looking into ways of speeding up >> HTML parsing via BeautifulSoup. If a significant speedup can be >> obtained when navigating large trees of sma

MI5-Persecution: Browse the Website (13792)

2007-12-22 Thread MI5-Victim
MI5 Persecution Update: Friday 25 March, 1999 If You Intend To Reply, Please Read This Please keep your response to one page if you can!. Faxes over a page or two will be deleted without being read. The Usual Words The persecutors-who-wont-admit-theyre-MI5 have been active again this week.

Re: Modify arguments between __new__ and __init__

2007-12-22 Thread [EMAIL PROTECTED]
On Dec 22, 11:03 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > When you call a new-style class, the __new__ method is called with the > user-supplied arguments, followed by the __init__ method with the same > arguments. > Only if __new__ returns an object of the type passed i

Re: How to get Python to default to UTF8

2007-12-22 Thread weheh
Hi Fredrik, Thanks again for your feedback. I am much obliged. Indeed, I am forced to be exteremely rigorous about decoding on the way in and encoding on the way out everywhere in my program, just as you say. Your advice is excellent and concurs with other sources of unicode expertise. Followi

Re: Modify arguments between __new__ and __init__

2007-12-22 Thread Steven Bethard
Steven D'Aprano wrote: > When you call a new-style class, the __new__ method is called with the > user-supplied arguments, followed by the __init__ method with the same > arguments. > > I would like to modify the arguments after the __new__ method is called > but before the __init__ method, som

Re: wxPython FileDialog, select folder

2007-12-22 Thread Tim Roberts
SMALLp <[EMAIL PROTECTED]> wrote: > >Thanks! I've already figured it out from first reply. Now i get selected >directory and i want to get all directories from thin directory. I found >os.listdir but it oly gets names of files and i nedd output with >permisions e.g. -rw-r--r-- 1 pofuk pofuk 10

Re: Performance on local constants?

2007-12-22 Thread John Machin
On Dec 23, 2:39 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "John Machin" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | On Dec 23, 5:38 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > | > 'Most flexible' in a different way is > | > > | > def searcher(rex): > | > crex = r

<    1   2