comp.lang.python - 26 new messages in 13 topics - digest
comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en
comp.lang.python@googlegroups.com
Today's topics:
* python and vc numbers - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/27bad644d0880ee1?hl=en
* Number of distinct substrings of a string [continuation] - 8 messages, 2
authors
http://groups.google.com/group/comp.lang.python/t/899c042280f9737f?hl=en
* slightly OT: Python BootCamp - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/2474285d1be9afd5?hl=en
* Feature request: String-inferred names - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/2f5674a1f451b12f?hl=en
* Simple greatest common factor script - 3 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/f621b76e8517a1e1?hl=en
* Cheap Wholesale Nike Air Max <www.brandshoes08.com> paypal payment - 1
messages, 1 author
http://groups.google.com/group/comp.lang.python/t/76cd1a8e0dcee95e?hl=en
* debugger on system with Python 2 and 3 - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/e5b391b05d7e48b9?hl=en
* cheaper nike shoes g-satr kidrobot hoodies ed hardy star red monkey gino
green global true religion ed-hardy kidrobot jeans hoodies china supplier
wholesaler exporters,manufacture - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/157cd1344c1dd8b0?hl=en
* mysqldb cursor returning type along with result ? - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/33c6e12d5c1d33b9?hl=en
* * for generic unpacking and not just for arguments? - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/317b730e12e214d6?hl=en
* python setup.py build 32-bits on x86_64 machine - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/5d9e0d5d2b5032e1?hl=en
* string payload expected: <type 'list'> error - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/583a16e03a8589bc?hl=en
* xmlrpc idea for getting around the GIL - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/9f84e7aa634de4f5?hl=en
==============================================================================
TOPIC: python and vc numbers
http://groups.google.com/group/comp.lang.python/t/27bad644d0880ee1?hl=en
==============================================================================
== 1 of 1 ==
Date: Sat, Nov 28 2009 11:55 pm
From: Daniel Dalton
Hi,
I have a very simple problem, but I can't work out the answer. How do I
return the current tty number in python? eg. what function/module should
I use to figure out what tty my program was invoked from?
Thanks
--
Cheers,
Dan
http://members.iinet.net.au/~ddalton/
==============================================================================
TOPIC: Number of distinct substrings of a string [continuation]
http://groups.google.com/group/comp.lang.python/t/899c042280f9737f?hl=en
==============================================================================
== 1 of 8 ==
Date: Sun, Nov 29 2009 12:52 am
From: n00m
http://www.spoj.pl/problems/DISUBSTR/
Got accepted both in C++(0.03s) and Python(0.12s).
Don't know exactly how they benchmark solutions but
my home tests proved Python is a fellow fast beast of C++.
Quite unexpected (I expected Py would be by ~10 times slower).
PS
Both my codes are identical in their algorithms.
Borland
compiler
(bcc32.exe) Python 2.5 + Psyco
================================
1 1
2 2
13 13
5 5
9 9
59078 59078
1000 1000
321000 321000
=============================
0.016 0.0150001049042 <--- exec times
=============================
----------------------------------------------------
My test input file:
----------------------------------------------------
8
a aa
abbaz
CCCCC ABABA
fgjtjdjjdjdjjryyryryududdisisisidfjfjnfnfgngnnghhhhhhhdeggrgtfgjtjdjjdjdjjryyryryududdisisisidfjfjnfnfgngnnghhhhhhhdeggrgtfgjtjdjjdjdjjryyryryududdisisisidfjfjnfnfgngnnghhhhhhhdeggrgtfgjtjdjjdjdjjryyryryududdisisisidfjfjnfnfgngnnghhhhhhhdeggrgtfgjtjdjjdjdjjryyryryududdisisisidfjfjnfnfgngnnghhhhhhhdeggrgtfgjtjdjjdjdjjryyryryududdisisisidfjfjnfnfgngnnghhhhhhhdeggrgtfgjtjdjjdjdjjryyryryududdisisisidfjfjnfnfgngnnghhhhhhhdeggrgtfgjtjdjjdjdjjryyryryududdisisisidfjfjnfnfgngnnghhhhhhhdeggrgtfgjtjdjjdjdjjryyryryududdisisisidfjfjnfnfgngnnghhhhhhhdeggrgtfgjt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ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
== 2 of 8 ==
Date: Sun, Nov 29 2009 12:56 am
From: n00m
My Py solution:
=====================================================
import psyco
psyco.full()
def foo(s):
n = len(s)
s = s + ' '
a = [[] for i in xrange(128)]
ans = 0
for i in xrange(n - 1, -1, -1):
lev = 0
for st in xrange(len(a[ord(s[i])]) - 1, -1, -1):
j = a[ord(s[i])][st]
if (n - j <= lev):
break
if (s[j + lev] != s[i + lev]):
continue
if (s[j + lev / 2] != s[i + lev / 2]):
continue
k = 0
while (s[j + k] == s[i + k]):
k += 1
if (k > lev):
lev = k
a[ord(s[i])] += [i]
ans += n - i - lev
return ans
from time import time
t = time()
import sys
sys.stdin = open('D:/88.txt', 'rt')
f = sys.stdin.read().split()
sys.stdin.close()
z = open('D:/99.txt', 'wt')
for tc in range(int(f[0])):
s = f[tc + 1]
print >> z, foo(s)
print >> z, time() - t
z.close()
========================================================
== 3 of 8 ==
Date: Sun, Nov 29 2009 1:26 am
From: n00m
This worked out in 5.28s
Imo it's not that *much* slower
(of course, Psyco can't help here)
===================================
import itertools
def subs(s):
return len(set(itertools.chain(
s[i:j]
for i in xrange(len(s))
for j in xrange(i, len(s)+1)))) - 1
from time import time
t = time()
import sys
sys.stdin = open('D:/88.txt', 'rt')
f = sys.stdin.read().split()
sys.stdin.close()
z = open('D:/99.txt', 'wt')
for tc in range(int(f[0])):
s = f[tc + 1]
print >> z, subs(s)
print >> z, time() - t
z.close()
==================================================
== 4 of 8 ==
Date: Sun, Nov 29 2009 5:07 am
From: Bearophile
n00m:
> This worked out in 5.28s
> Imo it's not that *much* slower
> (of course, Psyco can't help here)
There's no need of a chain here, so you can rewrite this:
import itertools
def subs(s):
return len(set(itertools.chain(
s[i:j]
for i in xrange(len(s))
for j in xrange(i, len(s)+1)))) - 1
as:
def subs(s):
return len(set(s[i:j] for i in xrange(len(s))
for j in xrange(i, len(s)+1))) - 1
Psyco helps a little (about 10% on my PC) if you use it like this:
from time import time
import psyco; psyco.full()
def main():
t = time()
fin = open("input.txt")
fout = open("output.txt", "w")
fin.next()
for line in fin:
r = set()
s = line.rstrip()
len_s = len(s)
for i in xrange(len_s):
for j in xrange(i, len_s + 1):
r.add(s[i : j])
print >> fout, len(r) - 1
fout.close()
print time() - t
main()
Bye,
bearophile
== 5 of 8 ==
Date: Sun, Nov 29 2009 5:12 am
From: Bearophile
n00m:
> My Py solution:
> ...
Cute. You can replace:
a[ord(s[i])] += [i]
With:
a[ord(s[i])].append(i)
If you want to micro-optimize this with Psyco may be a little faster:
(lev >> 1)
Than:
lev // 2
But to increase speed it's usually better to reduce memory
allocations. So you can try to find a way to pull this out of the
function:
a = [[] for i in xrange(128)]
And to avoid a true append:
a[ord(s[i])] += [i]
(There are many ways to avoid an append. One of them is to have an
already allocated list/array and just bump forward an index variable
that starts from 0. This is worth doing especially when you use
Psyco).
Bye,
bearophile
== 6 of 8 ==
Date: Sun, Nov 29 2009 5:15 am
From: Bearophile
n00m:
> my home tests proved Python is a fellow fast beast of C++.
> Quite unexpected (I expected Py would be by ~10 times slower).
> PS
> Both my codes are identical in their algorithms.
> =============================
> 0.016 0.0150001049042 <--- exec times
Maybe in your C++ code there's something that can be improved, this is
a 1:1 translation to D (V.1) language (using dlibs) and it's about 2.2
times faster than the Psyco version:
http://codepad.org/MQLj0ydB
Using a smarter usage of memory (that is avoiding all or most memory
allocations inside all loops), the performance difference will surely
grow.
Bye,
bearophile
== 7 of 8 ==
Date: Sun, Nov 29 2009 6:10 am
From: n00m
On Nov 29, 3:15 pm, Bearophile <bearophileH...@lycos.com> wrote:
> Maybe in your C++ code there's something that can be improved, this is
> a 1:1 translation to D (V.1) language (using dlibs) and it's about 2.2
> times faster than the Psyco version:http://codepad.org/MQLj0ydB
> Using a smarter usage of memory (that is avoiding all or most memory
> allocations inside all loops), the performance difference will surely
> grow.
Very interesting. Thanks.
D code looks pretty neat. Btw D lang is among accepted langs there.
Even if Py by 4x *slower* -- it's still a perfect Ok for it (C# will
be
much (much) slower than Python).
Micro-optimizations.
Of course, the best optimization would be to implement Suffix Tree:
http://en.wikipedia.org/wiki/Trie
Currently I hardly understand/know/read/etc its core idea. My algo is
plainly stupid as soldier muddy boots.
My C++ code:
<BEGIN>
#include <stdlib.h>
#include <stdio.h>
//#include <string.h>
//#include <ctype.h>
//#include <math.h>
#include <time.h>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
clock_t start_time = clock();
freopen("88.txt", "rt", stdin);
freopen("99.txt", "wt", stdout);
int tcs;
string s;
cin >> tcs;
while (tcs-- > 0) {
cin >> s;
int n = s.size();
s = s + ' ';
vector< vector<int> > a(128);
int ans = 0;
for (int i = n - 1; i >= 0; --i) {
int lev = 0;
for (int st = (int)a[s[i]].size() - 1; st >= 0; --st) {
int j = a[s[i]][st];
if (n - j <= lev) break;
if (s[j + lev] != s[i + lev]) continue;
if (s[j + lev / 2] != s[i + lev / 2]) continue;
int k = 0;
while (s[j + k] == s[i + k]) ++k;
if (k > lev) lev = k;
}
a[s[i]].push_back(i);
ans += n - i - lev;
}
cout << ans << endl;
}
cout << (clock() - start_time) / CLOCKS_PER_SEC << endl;
return 0;
}
<END>
== 8 of 8 ==
Date: Sun, Nov 29 2009 6:13 am
From: n00m
http://en.wikipedia.org/wiki/Suffix_tree
Looks not very friendly appealing :-)
==============================================================================
TOPIC: slightly OT: Python BootCamp
http://groups.google.com/group/comp.lang.python/t/2474285d1be9afd5?hl=en
==============================================================================
== 1 of 2 ==
Date: Sun, Nov 29 2009 12:57 am
From: Carl Banks
On Nov 28, 6:15 pm, J <dreadpiratej...@gmail.com> wrote:
> Ok... so I've been re-teaching myself python, as it's been several
> years since I last really used it. And in the midst of this, my
> contracting company came up to me on Friday and asked if I'd be
> interested in filling a last minute vacancy in this:
>
> http://www.otg-nc.com/python-bootcamp
>
> It's a week long Python Bootcamp.
I'm surprised they're able to fill out 5 days with intensive training
on Python.
:)
Carl Banks
== 2 of 2 ==
Date: Sun, Nov 29 2009 1:23 am
From: J
On Sun, Nov 29, 2009 at 03:57, Carl Banks <pavlovevidence@gmail.com> wrote:
> On Nov 28, 6:15 pm, J <dreadpiratej...@gmail.com> wrote:
>> http://www.otg-nc.com/python-bootcamp
>>
>> It's a week long Python Bootcamp.
>
>
> I'm surprised they're able to fill out 5 days with intensive training
> on Python.
>
> :)
Well, if it's anything like other similar courses I've taken over the
years, the 10 minute break ever 2 hours will be more like 20 minutes,
the hour lunch more like 1.5 hours, and the 8:30 to 4:00 times will be
more like 8:45 to 3:15
;)
but on a serious note, your comment was why I was asking... I was
trying to figure out just how much python you could teach in an
assumed 40 hours... but it's also supposed to be probably 80%
(arbitrary semi-educated guess) hands on coding, and if that's the
case, each 30 minute project could well be 45 minutes to an hour
depending on how fast people type, how familiar they are with actually
properly formatting code, etc...
--
Pablo Picasso - "Computers are useless. They can only give you
answers." - http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html
==============================================================================
TOPIC: Feature request: String-inferred names
http://groups.google.com/group/comp.lang.python/t/2f5674a1f451b12f?hl=en
==============================================================================
== 1 of 2 ==
Date: Sun, Nov 29 2009 2:15 am
From: The Music Guy
Okay, I'm having a really hard time telling which messages are getting
on to the list and which ones aren't. Some of the messages I send show
up in the comp.lang.python mirror in Google Groups, and some aren't.
Others show up on the Groups mirror, but don't show up in Gmail, or
show up in a different order. It seems the only way I can guarantee
anything showing up on Groups is to post on Groups, but that makes it
difficult because I can't see the messages in the thread that only
appear in my inbox. Is there a quick fix for this, because it's
getting pretty aggravating trying to figure out who heard what. I
don't like mailing lists. :P
== 2 of 2 ==
Date: Sun, Nov 29 2009 6:58 am
From: David Robinow
On Sun, Nov 29, 2009 at 6:58 AM, inhahe <inhahe@gmail.com> wrote:
> Did you say you were using gmail to post? I think mailing lists tend to
> have issues with gmail because it puts html in the message or something like
> that. Btw I recently set up this mailing list to send me a message back
> when I successfully posted something. oddly enough, i only remember getting
> one such message, so maybe none of my other messages got through. :P
> i think there's a way to disable html when sending a gmail message, but
> don't quote me on that.
I wasn't aware it was possible to Enable html but apparently it is.
Let me know if you see any html in this post.
==============================================================================
TOPIC: Simple greatest common factor script
http://groups.google.com/group/comp.lang.python/t/f621b76e8517a1e1?hl=en
==============================================================================
== 1 of 3 ==
Date: Sun, Nov 29 2009 2:56 am
From: fejky
Simple script that calculates greatest common factor using euclid's
theorem.
a = int(input("Enter a: "))
b = int(input("Enter b: "))
m = 1
while True:
if m != 0:
if b > a:
n = b/a
m = b % a
print b, " : ", a, " = ", n, " i ost ", m
b = m
if a > b:
n = a/b # line 13
m = a % b
print a, " : ", b, " = ", n, " i ost ", m
a = m
if a == b:
print "NZM(", a, ",", b, ") = ", a
m = 0
else: break
but when i run this script:
Enter a: 12345
Enter b: 54321
54321 : 12345 = 4 i ost 4941
12345 : 4941 = 2 i ost 2463
4941 : 2463 = 2 i ost 15
2463 : 15 = 164 i ost 3
15 : 3 = 5 i ost 0
Traceback (most recent call last):
File "D:\Programing\Python_2.6\math\NZM.py", line 13, in <module>
n = a/b
ZeroDivisionError: integer division or modulo by zero
I don't see how this script is able to divide by zero. If a and b
switch places everything works ok.
Thanks
== 2 of 3 ==
Date: Sun, Nov 29 2009 3:18 am
From: Patrick Sabin
> I don't see how this script is able to divide by zero. If a and b
> switch places everything works ok.
Have a look at your if-statements. It is possible, that both your if's
are executed in one loop iteration (you can check this using pdb). You
may want to try elif instead.
- Patrick
== 3 of 3 ==
Date: Sun, Nov 29 2009 3:23 am
From: fejky
I have no idea how i missed that.
Thanks!
==============================================================================
TOPIC: Cheap Wholesale Nike Air Max <www.brandshoes08.com> paypal payment
http://groups.google.com/group/comp.lang.python/t/76cd1a8e0dcee95e?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 29 2009 4:25 am
From: wholesale shoes clothes handbag watch by paypal
Nike Air Max
Cheap Wholesale Nike Air Max 87 <www.brandshoes08.com> paypal payment
Cheap Wholesale Nike Air Max 89 <www.brandshoes08.com> paypal payment
Cheap Wholesale Nike Air Max 90 <www.brandshoes08.com> paypal payment
Cheap Wholesale Nike Air Max 91 <www.brandshoes08.com> paypal payment
Cheap Wholesale Nike Air Max 92 Man <www.brandshoes08.com> paypal
payment
Cheap Wholesale Nike Air Max 93 <www.brandshoes08.com> paypal payment
Cheap Wholesale Nike Air Max 95 <www.brandshoes08.com> paypal payment
Cheap Wholesale Nike Air Max 97 <www.brandshoes08.com> paypal payment
Cheap Wholesale Nike Air Max 180 Man <www.brandshoes08.com> paypal
payment
Cheap Wholesale Nike Air Max 2006 <www.brandshoes08.com> paypal
payment
Cheap Wholesale Nike Air Max 2009 <www.brandshoes08.com> paypal
payment
Cheap Wholesale Nike Air Max Clssic BW <www.brandshoes08.com> paypal
payment
Cheap Wholesale Nike Air Max LTD <www.brandshoes08.com> paypal
payment
Cheap Wholesale Nike Air Max Skyline <www.brandshoes08.com> paypal
payment
Cheap Wholesale Nike Air Max STAB <www.brandshoes08.com> paypal
payment
Cheap Wholesale Nike Air Max Tailwind <www.brandshoes08.com> paypal
payment
Cheap Wholesale Nike Air Max TN <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox NZ <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox OZ <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox R2 <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox R3 <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox R3+R4 <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox R4 <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox R5 <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox Reverie lover
Cheap Wholesale Shox RZ <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox TL <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox Torch <www.brandshoes08.com> paypal payment
Cheap Wholesale Shox TZ <www.brandshoes08.com> paypal payment
Air Force one <www.brandshoes08.com> paypal payment
Cheap Wholesale Air Force One Man <www.brandshoes08.com> paypal
payment
Cheap Wholesale Air Force One Women <www.brandshoes08.com> paypal
payment
Cheap Wholesale Air Force One M&W <www.brandshoes08.com> paypal
payment
Cheap Wholesale Air Force one 25 Man <www.brandshoes08.com> paypal
payment
Cheap Wholesale Air Force One 25 Women <www.brandshoes08.com> paypal
payment
Cheap Wholesale Air Force One Kid <www.brandshoes08.com> paypal
payment
Cheap Wholesale Air Force one Mid Man <www.brandshoes08.com> paypal
payment
Cheap Wholesale Air Force one Mid Women <www.brandshoes08.com> paypal
payment
Cheap Wholesale Air Force one Hight Women <www.brandshoes08.com>
paypal
payment
Cheap Wholesale Nike shoes <www.brandshoes08.com> paypal payment
Cheap Wholesale Nike Dunk SB <www.brandshoes08.com> paypal payment
Cheap Wholesale Nike RLFT <www.brandshoes08.com> paypal payment
paypal wholesale d&g shoes (paypal payment)( www.brandshoes08.com)
paypal wholesale gucci shoes (paypal payment)( www.brandshoes08.com)
paypal wholesale lv shoes (paypal payment)( www.brandshoes08.com)
paypal wholesale NBA shoes (paypal payment)( www.brandshoes08.com )
paypal wholesale nike (paypal payment)( www.brandshoes08.com )
paypal wholesale adidas shoes (paypal payment)
( www.brandshoes08.com)
paypal wholesale UGG shoes (paypal payment)( www.brandshoes08.com )
paypal wholesale bape hoody (paypal payment)( www.brandshoes08.com)
paypal wholesale antick jeans (paypal payment)
( www.brandshoes08.com )
paypal wholesale diesel jeans (paypal payment)
( www.brandshoes08.com)
paypal wholesale artful dudger (paypal payment)
( www.brandshoes08.com)
paypal wholesale bag(lv gucci coach chanel d&g dior ed fendi )
(paypal payment)( www.brandshoes08.com)
paypal wholesale clothing (paypal payment)( www.brandshoes08.com )
paypal wholesale lrg,jeans,hoody, (paypal payment)
( www.brandshoes08.com)
paypal wholesale evisu jeans,hoody,shirt (paypal payment)
( www.brandshoes08.com)
paypal wholesale Prada (paypal payment)( www.brandshoes08.com)
paypal wholesale Puma (paypal payment)( www.brandshoes08.com)
paypal wholesale Sand (paypal payment)( www.brandshoes08.com)
paypal wholesale Shox (paypal payment)( www.brandshoes08.com )
paypal wholesale soccer (paypal payment)( www.brandshoes08.com )
paypal wholesale UGG (paypal payment)( www.brandshoes08.com)
paypal wholesale Versace (paypal payment)( www.brandshoes08.com )
paypal wholesale Women (paypal payment)( www.brandshoes08.com)
paypal wholesale Y-3 (paypal payment)( www.brandshoes08.com )
==============================================================================
TOPIC: debugger on system with Python 2 and 3
http://groups.google.com/group/comp.lang.python/t/e5b391b05d7e48b9?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 29 2009 4:29 am
From: Yo Sato
Thanx Alan,
I am using Fedora Core 11. I wanted to use emacs, rather than the
full-blown IDE or entirely gui-based debugger, and that's why I was
drawn to pydb in the first instance.
If there's no other choice I don't mind using winpdb, but it is
installed (through Yum) under Python2 library and invokes Py2 at
default... Don't quite know how to adapt it to Py3 or install the
right version under the right directory, yet. It seems as if some
environmental variable change is necessary. On the whole it doesn't
seem that there's much support in the third-party debuggers in general
as yet...
In the meantime I might ask if it is possible to adapt pydb (or
perhaps, IDLE) for Py3. Might be just a change in a env variable or
two...
Yo
On Fri, 27 Nov 2009 19:03:10 +0000, Alan Franzoni wrote:
> On 11/27/09 6:17 PM, Yo Sato wrote:
>> Hi,
>>
>> I am a relative newcomer to the Python language, and only write Python
>> 3. Now I would very much like to a more-than-basic debugger. However it
>> seems as if the fact that I have both Python 2 and 3 on the system
>> complicates the matter...
>
> You haven't told OS which OS you're using, and what are your exact
> problems, BTW I think two good debuggers for Python are winpdb/rpdb2
> (work on any platform, despite the name) and the one you get in
> Eclipse+Pydev.
>
> You should be able to pick your platform, even though I've never tested
> them in Python 3.
==============================================================================
TOPIC: cheaper nike shoes g-satr kidrobot hoodies ed hardy star red monkey
gino green global true religion ed-hardy kidrobot jeans hoodies china supplier
wholesaler exporters,manufacture
http://groups.google.com/group/comp.lang.python/t/157cd1344c1dd8b0?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 29 2009 4:50 am
From: "woainiljx01@163.com"
Get Nike Shoes at Super Cheap Prices
Discount Ed hardy tshirt (www.withadream.com)
Discount Ed hardy jean (www.withadream.com)
Discount Ed hardy shoes (www.withadream.com)
Discount Ed hardy handbag (www.withadream.com)
Discount Ed hardy other porduct (www.withadream.com)
Discount Nike air jordans (www.withadream.com)
Discount Nike Air Max 90 Sneakers (www.withadream.com)
Discount Nike Air Max 91 Supplier (www.withadream.com)
Discount Nike Air Max 95 Shoes Supplier (www.withadream.com)
Discount Nike Air Max 97 Trainers (www.withadream.com)
Discount Nike Air Max 2003 Wholesale (www.withadream.com)
Discount Nike Air Max 2004 Shoes Wholesale
(www.withadream.com)
Discount Nike Air Max 2005 Shop (www.withadream.com)
Discount Nike Air Max 2006 Shoes Shop (www.withadream.com)
Discount Nike Air Max 360 Catalogs (www.withadream.com)
Discount Nike Air Max Ltd Shoes Catalogs (www.withadream.com)
Discount Nike Air Max Tn Men's Shoes (www.withadream.com)
Discount Nike Air Max Tn 2 Women's Shoes (www.withadream.com)
Discount Nike Air Max Tn 3 Customize (www.withadream.com)
Discount Nike Air Max Tn 4 Shoes Customize
( www.withadream.com)
Discount Nike Air Max Tn 6 Supply (www.withadream.com)
Discount Nike Shox NZ Shoes Supply (www.withadream.com)
Discount Nike Shox OZ Sale (www.withadream.com)
Discount Nike Shox TL Store (www.withadream.com)
Discount Nike Shox TL 2 Shoes Store (www.withadream.com)
Discount Nike Shox TL 3 Distributor (www.withadream.com)
Discount Nike Shox Bmw Shoes Distributor (www.withadream.com)
Discount Nike Shox Elite Shoes Manufacturer
(www.withadream.com)
Discount Nike Shox Monster Manufacturer (www.withadream.com)
Discount Nike Shox R4 Running Shoes (www.withadream.com)
Discount Nike Shox R5 Mens Shoes (www.withadream.com)
Discount Nike Shox Ride Womens Shoes (www.withadream.com)
Discount Nike Shox Rival Shoes Wholesaler (www.withadream.com)
Discount Nike Shox Energia Wholesaler (www.withadream.com)
Discount Nike Shox LV Sneaker (www.withadream.com)
Discount Nike Shox Turbo Suppliers (www.withadream.com)
Discount Nike Shox Classic Shoes Suppliers
(www.withadream.com)
Discount Nike Shox Dendara Trainer (www.withadream.com)
Discount Nike Air Jordan 1 Seller (www.withadream.com)
Discount Nike Air Jordan 2 Shoes Seller (www.withadream.com)
Discount Nike Air Jordan 3 Collection (www.withadream.com)
Discount Nike Air Jordan 4 Shoes Collection
(www.withadream.com)
Discount Nike Air Jordan 5 Chaussure Shoes
(www.withadream.com)
Discount Nike Air Jordan 6 Catalog (www.withadream.com)
Discount Nike Air Jordan 7 Shoes Catalog (www.withadream.com)
Discount Nike Air Jordan 8 Customized (www.withadream.com)
Discount Nike Air Jordan 9 Shoes Customized
(www.withadream.com)
Discount Nike Air Jordan 10 Wholesalers (www.withadream.com)
Discount Nike Jordan 11 Shoes Wholesalers (www.withadream.com)
Discount Nike Air Jordan 12 Factory (www.withadream.com)
Discount Nike Air Jordan 13 Shoes Factory (www.withadream.com)
Discount Nike Air Jordan 14 Shoes Sell (www.withadream.com)
Discount Nike Air Jordan 16 Exporter (www.withadream.com)
Discount Nike Air Jordan 17 Shoes Exporter
(www.withadream.com)
Discount Nike Air Jordan 18 Offer (www.withadream.com)
Discount Nike Air Jordan 19 Shoes Offer (www.withadream.com)
Discount Nike Air Jordan 20 Manufacture (www.withadream.com)
Discount Nike Jordan 21 Shoes Manufacture (www.withadream.com)
GMAIL:ALLTHEDREAM@MSN.COM
MSN :ALLTHEDREAM@MSN.COM
we are specialized in all kinds of brand name sport shoes AAA grade,
like NIKE SHOES, ADIDAS SHOES, JORDAN AIR MAX, SHOX, PUMA, DUNK, BAPE,
TIMBERLAND, AF1, GUCCI,LV,PRADA,LEISURE SHOES ,BBC nike suppliers in
china, nike, nike dunk, dunk, nike af1, af1, nike rift, rift, nike max
95, max95, nike max 90, max 90, nike max 91, max 91, nike max 95, max
95, nike max 97, max97, nike max180, nike max360, max 360, max 180,
nike max ltd, nike max tn, nike max 2003, max 2003, nike max 2006, max
2006, nike max 2004, max 2004, air force 1, air force one, nike af1,
af1, nike air force 1, nike shox, nike max, nike shox nz, shox nz, nz,
nike shox oz, shox oz, oz, nike shox r3, shox r3, r3, nike shox r4,
shox r4, r4, nike shox r5, shox r5, r5, nike shox tl1, shox tl1, tl1,
nike shox tl2, tl2, nike shox tl3, LRG, GGG, RMC, ArtfulDodger, D&G,
Rockjeans, A&F, EVS, seven, t-shirts, LV, AF1, max, shox, converse,
timberland boots, NBAstars, james, kobe, garnett, carter, macgrady,
pippen, sandals, hogan, adidas, nikeshoes, dunk, puma, prada, bape,
gucci, jordan, BBC, jacket, DS, hoody, ED hardy, CLH, kidrobot,
sweater, kidclothes, jersey, swimmingwear, ranbansunglass, coach,
chanel, armani, burberry, watch, fendi handbags, belts, wallet,
jewellery, umbrella, hats, mobile phone..., bape, bbc, evisu, lrg, ed-
hardy, lacoste hoody, polo, red monkey, NFL abercrombie, Clothing,
hoody, jacket, coat, jeans, suit, t-shirt, sweater, jerseys BAPE,
BBC,EVISU HOODIES POLO LACOSATE t-shirt, jeans like ED EVISU BBC RMC;
LV, CHANEL GUCCI PRADA HANDBAGS, IPOD MP3,,MP4 PS3 PSP; HATS;
SUNGLASSES; BELTS; and so on, our products have been exported to South
America, north merica,Australia, Europe, Italy,France,Spain,Greece;
and getting warmly welcome from these customers by its stable quality,
competitive prices and safe delivery. We are insisting on our company
principle Best Service and Highest Quality, and willing to build
mutual benefits and long term business relationships with all
customers. SAVE HUNDREDS OF DOLLARS ON DESIGNER SHOES!!!
==============================================================================
TOPIC: mysqldb cursor returning type along with result ?
http://groups.google.com/group/comp.lang.python/t/33c6e12d5c1d33b9?hl=en
==============================================================================
== 1 of 2 ==
Date: Sun, Nov 29 2009 5:14 am
From: "Paul O'Sullivan"
Just taken to Python (2.5)and started to look at some DB cursor stuff
using MySQL. Anyway, after creating a query that in MySQL that has a
result set of decimals I find that the cursor in python after a
fetchall() returns a tuple that contains the following ::
((Decimal("101.10"),), (Decimal("99.32"),), (Decimal("97.95"),),
(Decimal("98.45"),), (Decimal("97.39"),), (Decimal("97.91"),), (Decimal
("98.08"),), (Decimal("97.73"),))
as such :
sum(result)
fails with "TypeError: unsupported operand type(s) for +: 'int' and
'tuple'"
How do I either get the resultset back as 'float' or convert the
returned tuple to 'floats'.?
Thanks, Newb.
== 2 of 2 ==
Date: Sun, Nov 29 2009 5:54 am
From: Tim Chase
> ((Decimal("101.10"),), (Decimal("99.32"),), (Decimal("97.95"),),
> (Decimal("98.45"),), (Decimal("97.39"),), (Decimal("97.91"),), (Decimal
> ("98.08"),), (Decimal("97.73"),))
>
> as such :
> sum(result)
> fails with "TypeError: unsupported operand type(s) for +: 'int' and
> 'tuple'"
>
> How do I either get the resultset back as 'float' or convert the
> returned tuple to 'floats'.?
Well, what you have is a tuple-of-tuples-of-decimals, and Sum can
handle Decimal types just fine. You simply have to extract the
first (only) item in each row:
sum(row[0] for row in result)
or
sum(value for (value,) in result)
whichever makes more sense to you.
-tkc
==============================================================================
TOPIC: * for generic unpacking and not just for arguments?
http://groups.google.com/group/comp.lang.python/t/317b730e12e214d6?hl=en
==============================================================================
== 1 of 2 ==
Date: Sun, Nov 29 2009 6:25 am
From: Russell Warren
Is there a reason that this is fine:
>>> def f(a,b,c):
... return a+b+c
...
>>> f(1, *(2,3))
6
but the code below is not?
>>> x = (3, 4)
>>> (1, 2, *x) == (1, 2, 3, 4)
Traceback (most recent call last):
File "<string>", line 1, in <fragment>
invalid syntax: <string>, line 1, pos 8
Why does it only work when unpacking arguments for a function? Is it
because the code below is preferred, and more readable?
>>> x = (3, 4)
>>> (1, 2) + x == (1, 2, 3, 4)
True
I've rooted around to see if there is an answer already and found some
threads going way back to 1998 (!!), but can't find a concise answer
as to why it is limited to args.
I don't have a burning desire for this to work, but I just tried it
unsuccessfully when building up a tuple and was mildly surprised that
it didn't work, so I'm curious why.
Maybe it's just that * is strictly for arguments, and trying it for
generic tuple unpacking is abuse (which is down the corridor in 12A).
== 2 of 2 ==
Date: Sun, Nov 29 2009 7:40 am
From: Mel
Russell Warren wrote:
> Maybe it's just that * is strictly for arguments, and trying it for
> generic tuple unpacking is abuse (which is down the corridor in 12A).
I'd agree with that. It's a feature of function calls, not a feature of
sequence types, so that you can handle a set of function arguments as a
bunch, and apply them when you want.
The other function call feature that sequence types don't do is
a, b, c = **{'b':3, 'c':a, 'a':c}
Mel.
==============================================================================
TOPIC: python setup.py build 32-bits on x86_64 machine
http://groups.google.com/group/comp.lang.python/t/5d9e0d5d2b5032e1?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 29 2009 7:52 am
From: aahz@pythoncraft.com (Aahz)
In article <4b08d6e9$0$28097$a729d347@news.telepac.pt>,
=?UTF-8?B?U8Opcmdpbw==?= Monteiro Basto <sergiomb@sapo.pt> wrote:
>
>I am in x86_64 arch , but I need
>compile things on 32 bits.
>python setup.py build
Googling for "linux force 32-bit build" and similar phrases should find
some useful results.
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/
The best way to get information on Usenet is not to ask a question, but
to post the wrong information.
==============================================================================
TOPIC: string payload expected: <type 'list'> error
http://groups.google.com/group/comp.lang.python/t/583a16e03a8589bc?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 29 2009 7:55 am
From: Lie Ryan
On 11/27/2009 8:43 PM, Ramdas wrote:
> I tried with MIMEBASE but it still fails...... I changed it to
> MIMEText, hoping that might trick __handletext to think its a string
> Anyway that also doesn't work.
>
just pass the string directly to MIMEBase.set_payload:
fp = open('...')
msg1 = MIMEBase(maintype, subtype)
msg1.set_payload(fp.read())
either that or use a more specialized subclass of MIMEBase (e.g. MIMEText).
==============================================================================
TOPIC: xmlrpc idea for getting around the GIL
http://groups.google.com/group/comp.lang.python/t/9f84e7aa634de4f5?hl=en
==============================================================================
== 1 of 1 ==
Date: Sun, Nov 29 2009 7:57 am
From: aahz@pythoncraft.com (Aahz)
In article <4b0b07a1$0$22159$9b622d9e@news.freenet.de>,
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <martin@v.loewis.de> wrote:
>
>In any case, I don't think you'll need a multi-process solution; a
>single-process multi-threading approach will do fine. Just create
>*another* thread, that runs at a low priority and is allowed to block.
>Run the Python interpreter in that thread (create multiple of these if
>you need them). Then, use some queuing producer-consumer communication
>between the high-priority thread and the low priority thread. Have the
>high priority threads put requests into the queue, and the low priority
>thread take them from the queue, dispatching them to Python. Make sure
>you use non-blocking synchronization on the queue, or else priority
>inheritance if you can get permission to do so.
This is close to what I would recommend, but I would suggest that the
low-priority thread make calls out to an external Python process; that
way, you can have a Python worker pool of processes. Based on what I've
seen posted over the years, I generally recommend against instantiating
multiple interpreter instances (although I've seen some success stories,
I've seen more people butting their heads against the brick wall).
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/
The best way to get information on Usenet is not to ask a question, but
to post the wrong information.
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en
To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home