On Nov 21, 5:33 pm, sword wrote:
> My colleague asks me an interesting problem about uuid library in
> python. In multicore system with multiprocessing, is it possible to
> get the duplicated uuid with uuid1?
>
> I just check the RFC 4122, and I can't find anything about mul
My colleague asks me an interesting problem about uuid library in
python. In multicore system with multiprocessing, is it possible to
get the duplicated uuid with uuid1?
I just check the RFC 4122, and I can't find anything about multicore
environment. Python's uuid1 method generates the
Victor Subervi wrote:
> I think I finally have an interesting problem for y'all. I need to import a
> script from a lower dir, forcing me to change dirs:
I'm surprised that no one has yet mentioned packages.
Suppose you have the following folder layout and you stick an empty
__i
Victor Subervi wrote:
> Hi;
> I think I finally have an interesting problem for y'all. I need to import a
> script from a lower dir, forcing me to change dirs:
>
> cwd = os.getcwd()
> os.chdir('%s/..' % cwd)
> sys.path.append(os.getcwd())
> from templateFram
James Matthews wrote:
Also as a side point... It's best to anonymize the code as best you can
so people cannot attach your code to your site (IP theft and security risk)
[snip]
Security risk, yes; IP theft, not so much. ;-)
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Jan 20, 2010 at 12:30 PM, Stephen Hansen wrote:
> On Wed, Jan 20, 2010 at 7:19 AM, Victor Subervi
> wrote:
>
>> Hi;
>> I think I finally have an interesting problem for y'all. I need to import
>> a script from a lower dir, forcing me to change dirs:
&
Also as a side point... It's best to anonymize the code as best you can so
people cannot attach your code to your site (IP theft and security risk)
On Wed, Jan 20, 2010 at 8:38 AM, MRAB wrote:
> Victor Subervi wrote:
>
>> Hi;
>> I think I finally have an interesting probl
Victor Subervi wrote:
Hi;
I think I finally have an interesting problem for y'all. I need to
import a script from a lower dir, forcing me to change dirs:
Wait a moment... Your assumption that you need to change directories is
invalid. (And that means everything you do below this
Victor Subervi wrote:
Hi;
I think I finally have an interesting problem for y'all. I need to
import a script from a lower dir, forcing me to change dirs:
cwd = os.getcwd()
os.chdir('%s/..' % cwd)
sys.path.append(os.getcwd())
from templateFrame import top, bottom
os.chdir(cw
On Wed, Jan 20, 2010 at 7:19 AM, Victor Subervi wrote:
> Hi;
> I think I finally have an interesting problem for y'all. I need to import a
> script from a lower dir, forcing me to change dirs:
>
Don't do that. If you must, then the correct way to do it is to adjust your
s
Hi;
I think I finally have an interesting problem for y'all. I need to import a
script from a lower dir, forcing me to change dirs:
cwd = os.getcwd()
os.chdir('%s/..' % cwd)
sys.path.append(os.getcwd())
from templateFrame import top, bottom
os.chdir(cwd)
Because I've fou
On Mon, 11 Jan 2010 18:57:24 +0100, mk wrote:
>> I have two lists of IP addresses:
>>
>> hostips = [ 'a', 'b', 'c', 'd', 'e' ]
>>
>> thread_results = [ 'd', 'b', 'c' ]
>>
>> I need to sort thread_results in the same order as hostips.
>
> P.S. One clarification: those lists are actually more co
mk writes:
> I have two lists of IP addresses:
>
> hostips = [ 'a', 'b', 'c', 'd', 'e' ]
>
> thread_results = [ 'd', 'b', 'c' ]
>
> I need to sort thread_results in the same order as hostips.
Assuming each address in hostips appears just once:
from itertools import izip,count
d = dict(iz
mk wrote:
> mk wrote:
>> Hello everyone,
>>
>> I have two lists of IP addresses:
>>
>> hostips = [ 'a', 'b', 'c', 'd', 'e' ]
>>
>> thread_results = [ 'd', 'b', 'c' ]
>>
>> I need to sort thread_results in the same order as hostips.
>
> P.S. One clarification: those lists are actually more com
mk wrote:
mk wrote:
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
P.S. One clarification: those lists are actually more complicated
(thread_result is a
mk writes:
> Hello everyone,
>
> I have two lists of IP addresses:
>
> hostips = [ 'a', 'b', 'c', 'd', 'e' ]
>
> thread_results = [ 'd', 'b', 'c' ]
>
> I need to sort thread_results in the same order as hostips.
[...solution:]
> hostips_limited = []
> for h in hostips:
> if h in thread_resul
mk wrote:
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
P.S. One clarification: those lists are actually more complicated
(thread_result is a list of tup
mk wrote:
Incidentally, it *seems* that list comprehension preserves order:
hostips_limited = [ h for h in hostips if h in thread_results ]
Empirically speaking it seems to work (I tested it on real ips), but
please correct me if that's wrong.
Regards,
mk
Sounds good to me.
List are *o
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
(Obviously, hostips can contain any valid ip addresses as strings, they
are sorted alphabetically here just f
bearophileh...@lycos.com wrote:
MRAB:
I think I might have cracked it:
...
print n, sums
Nice.
If you don't want to use dynamic programming, then add a @memoize
decoration before the function, using for example my one:
http://code.activestate.com/recipes/466320/
And you will see an inter
MRAB:
> I think I might have cracked it:
> ...
> print n, sums
Nice.
If you don't want to use dynamic programming, then add a @memoize
decoration before the function, using for example my one:
http://code.activestate.com/recipes/466320/
And you will see an interesting speed increase, even if
Trip Technician wrote:
On 21 Apr, 14:46, MRAB wrote:
Trip Technician wrote:
Thank you Dave. This does it but slowly. takes every subset of the
list a ofsquares, and then gets a 'partition' that will work, many
are very inefficient (with lots of 1s).
any hints about how to speed up ?
def subset
On 21 Apr, 14:46, MRAB wrote:
> Trip Technician wrote:
> > Thank you Dave. This does it but slowly. takes every subset of the
> > list a ofsquares, and then gets a 'partition' that will work, many
> > are very inefficient (with lots of 1s).
>
> > any hints about how to speed up ?
>
> > def subset(
Trip Technician wrote:
Thank you Dave. This does it but slowly. takes every subset of the
list a of squares, and then gets a 'partition' that will work, many
are very inefficient (with lots of 1s).
any hints about how to speed up ?
def subset(x):
for z in range(1,2**len(x)):
q=bin(
Thank you Dave. This does it but slowly. takes every subset of the
list a of squares, and then gets a 'partition' that will work, many
are very inefficient (with lots of 1s).
any hints about how to speed up ?
def subset(x):
for z in range(1,2**len(x)):
q=bin(z)
subs=[]
Trip Technician wrote:
although it's not homework (how can i prove that...?) i am still happy
with just hints
+++
we want to express integers as sums of squares. (repeated squares are
allowed)
most numbers have one minimal representation e.g. 24=16+4+4, some have
two or more e.g. 125 = 121+4 =
although it's not homework (how can i prove that...?) i am still happy
with just hints
+++
we want to express integers as sums of squares. (repeated squares are
allowed)
most numbers have one minimal representation e.g. 24=16+4+4, some have
two or more e.g. 125 = 121+4 = 100+25
so far I have cr
hi, Sybren,
thanks for your reply, if use CSS:
texttexttext
optimise to:
texttexttext
what i need is the METHOD to do optimization, in fact, i have ready
write a program to analyse the syntax of CSS, to make it works with all
situation
--
http://mail.python.org/mailman/listinfo/python-list
DENG enlightened us with:
> i use SGMLParser to process HTML files, in order to do some
> optimizations,
>
> something like this:
>
>TEXT1TEXT2
>
> optimise to
>
>TEXT1TEXT2
Why not optimize it to:
TEXT1
TEXT2?
> [ snipped stuff about tags ]
If you're serious about using HTML, I suggest you re
I know very well Tidy, sir
Tidy do a nice job but it is writen in Java, and have Python ported
my aim is to learn Python, learn how to program
I know many people write "hello the world" in 2005, why I can not write
this program in 2005?
you are french, right? peut etre we can talk about it in e
hi all,
i use SGMLParser to process HTML files, in order to do some
optimizations,
something like this:
TEXT1TEXT2
optimise to
TEXT1TEXT2
at the very beginning, i was thinking of analysing each text-block, to
know their color, size, if is bold or italic, but i found it was too
complicated.
Jeffrey Maitland wrote:
>when running scripts they seem to work fine on ia-32 but I get
>segfault on ia-64 what the heck should I be looking for?
>
>I did notice that it seems to work ok only for certain scripts but any
>script that imports MySQLdb or glob seems to make this occur.
>
>Thanks Jeff
when running scripts they seem to work fine on ia-32 but I get
segfault on ia-64 what the heck should I be looking for?
I did notice that it seems to work ok only for certain scripts but any
script that imports MySQLdb or glob seems to make this occur.
Thanks Jeff
--
http://mail.python.org/mailm
33 matches
Mail list logo