On Mon, 22 Mar 2010 22:05:40 -0700, Paul Rubin wrote:
> Antoine Pitrou writes:
>> "Orders of magnitude worse", in any case, sounds very exaggerated.
>
> The worst case can lose orders of magnitude if a lot of values hash to
> the same bucket.
Well, perhaps one order of magnitude.
>>> for i i
En Mon, 22 Mar 2010 15:20:39 -0300, Pascal Chambon
escribió:
Allright, here is more concretely the problem :
ERROR:root:An error
Traceback (most recent call last):
File "C:/Users/Pakal/Desktop/aaa.py", line 7, in c
return d()
File "C:/Users/Pakal/Desktop/aaa.py", line 11, in d
def
Antoine Pitrou writes:
> "Orders of magnitude worse", in any case, sounds very exaggerated.
The worst case can lose orders of magnitude if a lot of values hash
to the same bucket.
--
http://mail.python.org/mailman/listinfo/python-list
Omer Ihsan wrote:
>
>i have installed pyusb now and run the sample usbenum.pyi have 3
>usb ports on my PC but the results show 6 outputs to
>dev.filename..they are numbers like 001 or 005 etc and they
>changed when i plugged in devices...(i am no good with the usb
>standards)i just wan
On Monday 22 March 2010 17:23:27 Thufir wrote:
> On Mar 20, 3:12 am, Steven D'Aprano
> cybersource.com.au> wrote:
> > On Sat, 20 Mar 2010 09:17:14 +, Thufir wrote:
> > > I'd like to acquire a token, as below, but from Java:
> > Perhaps you should be asking a Java discussion group? This group
In Steven D'Aprano
writes:
>On Mon, 22 Mar 2010 22:19:57 +, kj wrote:
>In any case, the once-off cost of creating or importing a function is
>usually quite cheap. As usual, the best advise is not to worry about
>optimization until you have profiled the code and learned where the
>actual
Le Mon, 22 Mar 2010 23:40:16 +, tan a écrit :
>
>>Remember that the original use case was to load a dictionary from a text
>>file. For this use case, a trie can be very wasteful in terms of memory
>>and rather CPU cache unfriendly on traversal, whereas hash values are a)
>>rather fast to calcu
On Mon, 22 Mar 2010 22:19:57 +, kj wrote:
> In Tim Golden
> writes:
>
>>On 22/03/2010 18:30, kj wrote:
>>> Thanks! I'm glad to know that one can get the short circuiting using
>>> a map-type idiom. (I prefer map over comprehensions when I don't need
>>> to define a function just for the p
Vlastimil Brom wrote:
Hi all,
I just tried to find some information about the unicodedata database
and the possibilities of updating it to the latest version of the
unicode standards (currently 5.2, while python supports 5.1 in the
latest versions).
An option to update this database individually
On Mar 20, 3:12 am, Steven D'Aprano wrote:
> On Sat, 20 Mar 2010 09:17:14 +, Thufir wrote:
> > I'd like to acquire a token, as below, but from Java:
>
> Perhaps you should be asking a Java discussion group? This group is for
> discussing Python.
>
> --
> Steven
What I meant to ask is, how is
Hi all,
I just tried to find some information about the unicodedata database
and the possibilities of updating it to the latest version of the
unicode standards (currently 5.2, while python supports 5.1 in the
latest versions).
An option to update this database individually might be useful as the
u
In article , Stefan
Behnel wrote:
>Lawrence D'Oliveiro, 22.03.2010 00:36:
>> Terry Reedy wrote:
>>> No one has discovered a setting
>>> of the internal tuning parameters for which there are no bad patterns
>>> and I suspect there are not any such. This does not negate Xavier's
>>> suggestion that
Luis M. González wrote:
> On Feb 21, 6:40 pm, Mensanator wrote:
>> On Feb 21, 12:14 pm, Paul Boddie wrote:
>>
>>
>>
>>
>>
>>> On 21 Feb, 17:32, Mensanator wrote:
On Feb 21, 10:30 am, Mensanator wrote:
> What versions of Python does it suuport?
What OS are supported?
>>> From the W
In Tim Golden
writes:
>On 22/03/2010 18:30, kj wrote:
>> Thanks! I'm glad to know that one can get the short circuiting
>> using a map-type idiom. (I prefer map over comprehensions when I
>> don't need to define a function just for the purpose of passing it
>> to it.)
>In what way does "map"
In <4ba79040$0$22397$426a7...@news.free.fr> Bruno Desthuilliers
writes:
>kj a écrit :
>> PS: BTW, this is not the first time that attempting to set an
>> attribute (in a class written by me even) blows up on me. It's
>> situations like these that rattle my grasp of attributes, hence my
>> origi
On Mon, Mar 22, 2010 at 2:07 AM, Steven D'Aprano
wrote:
>
> Perhaps you should have said that it was a wrapper around deque giving
> richer functionality, rather than giving the impression that it was a
> brand new data structure invented by you. People are naturally going to
> be more skeptical a
Hi, I've recently begun experimenting with embedding python and i got
a small problem.
This is my current testing code (basically all from python docs):
> int main(int argc, char *argv[])
>
> {
>
> PyObject *pModuleName, *pTestModule, *pTestFunc, *pTestResult, *pTestArgs;
>
> PyImport_AppendInitta
Gabriel Genellina a écrit :
En Wed, 17 Mar 2010 09:42:06 -0300, Pascal Chambon
escribió:
traceback functions indeed allow the manipulation of exception
tracebacks,
but the root problem is that anyway, since that traceback is incomplete,
your "traceback.format_exc().splitlines()" will only
On 22/03/2010 18:30, kj wrote:
Thanks! I'm glad to know that one can get the short circuiting
using a map-type idiom. (I prefer map over comprehensions when I
don't need to define a function just for the purpose of passing it
to it.)
In what way does "map" over "comprehensions" save you defin
In <291d82b7-b13b-4f49-901c-8194f3e07...@e7g2000yqf.googlegroups.com> nn
writes:
>If you are in Python 3 "any(map(is_invalid, L))" should short circuit.
>If you are in Python 2 use "from itertools import imap;
>any(imap(is_invalid, L))"
Thanks! I'm glad to know that one can get the short circu
On Mar 22, 7:45 am, kj wrote:
> I have a list of items L, and a test function is_invalid that checks
> the validity of each item. To check that there are no invalid
> items in L, I could check the value of any(map(is_invalid, L)).
> But this approach is suboptimal in the sense that, no matter wha
On Feb 21, 6:40 pm, Mensanator wrote:
> On Feb 21, 12:14 pm, Paul Boddie wrote:
>
>
>
>
>
> > On 21 Feb, 17:32, Mensanator wrote:
>
> > > On Feb 21, 10:30 am, Mensanator wrote:
>
> > > > What versions of Python does it suuport?
>
> > > What OS are supported?
>
> > From the Web site referenced i
On 3/22/2010 11:44 AM, Bruno Desthuilliers wrote:
Another (better IMHO) solution is to use a plain property, and store the
computed value as an implementation attribute :
@property
def foo(self):
cached = self.__dict__.get('_foo_cache')
if cached is None:
self._foo_cache = cached = self._some
kj a écrit :
In Dennis Lee Bieber
writes:
On Sun, 21 Mar 2010 16:57:40 + (UTC), kj
declaimed the following in gmane.comp.python.general:
Regarding properties, is there a built-in way to memoize them? For
example, suppose that the value of a property is obtained by parsing
the content
On 2010-03-21 05:11 AM, Jah_Alarm wrote:
I've got a vector length n of integers (some of them are repeating),
I recommend reducing it down to unique integers first.
and I got a selection probability vector of the same length. How will
I sample with replacement k (<=n) values with the probabil
kj wrote:
> I have a list of items L, and a test function is_invalid that checks
> the validity of each item. To check that there are no invalid
> items in L, I could check the value of any(map(is_invalid, L)).
> But this approach is suboptimal in the sense that, no matter what
> L is, is_invali
On Mon, 2010-03-22 at 14:45 +, kj wrote:
> I have a list of items L, and a test function is_invalid that checks
> the validity of each item. To check that there are no invalid
> items in L, I could check the value of any(map(is_invalid, L)).
> But this approach is suboptimal in the sense that,
kj wrote:
I have a list of items L, and a test function is_invalid that checks
the validity of each item. To check that there are no invalid
items in L, I could check the value of any(map(is_invalid, L)).
But this approach is suboptimal in the sense that, no matter what
L is, is_invalid will be
On 22/03/2010 14:45, kj wrote:
I have a list of items L, and a test function is_invalid that checks
the validity of each item. To check that there are no invalid
items in L, I could check the value of any(map(is_invalid, L)).
But this approach is suboptimal in the sense that, no matter what
L is
Ben Finney writes:
> twenty questions writes:
>
>> add an entry to http://
>
> Don't spam groups with your off-topic begging for a closed database silo
> (please)
Don't repeat spam
--
John Bokma j3b
Hacking & Hiking in Mexico - h
I have a list of items L, and a test function is_invalid that checks
the validity of each item. To check that there are no invalid
items in L, I could check the value of any(map(is_invalid, L)).
But this approach is suboptimal in the sense that, no matter what
L is, is_invalid will be executed
* kj:
In Dennis Lee Bieber
writes:
On Sun, 21 Mar 2010 16:57:40 + (UTC), kj
declaimed the following in gmane.comp.python.general:
Regarding properties, is there a built-in way to memoize them? For
example, suppose that the value of a property is obtained by parsing
the contents of a
In Dennis Lee Bieber
writes:
>On Sun, 21 Mar 2010 16:57:40 + (UTC), kj
>declaimed the following in gmane.comp.python.general:
>> Regarding properties, is there a built-in way to memoize them? For
>> example, suppose that the value of a property is obtained by parsing
>> the contents of a
* newton10471:
Hi,
I'm trying to use subprocess.Popen() to do a Linux chroot to a mount
point passed in as a parameter to the following function:
def getInstalledKernelVersion(mountPoint):
linuxFsRoot = mountPoint + "/root"
print "type of linuxFsRoot is %s" % type(linuxFsRoot)
insta
In article <56597268-3472-4fd9-a829-6d9cf51cf...@e7g2000yqf.googlegroups.com>,
Joel Pendery wrote:
>So I am trying to write a bit of code and a simple numerical
>subtraction
>
>y_diff = y_diff-H
>
>is giving me the error
>
>Syntaxerror: Non-ASCII character '\x96' in file on line 70, but no
>encod
Hi,
I'm trying to use subprocess.Popen() to do a Linux chroot to a mount
point passed in as a parameter to the following function:
def getInstalledKernelVersion(mountPoint):
linuxFsRoot = mountPoint + "/root"
print "type of linuxFsRoot is %s" % type(linuxFsRoot)
installedKernelVersion
In message , Gabriel
Genellina wrote:
> I fail to see how is this relevant to Python...
Well, so many of the questions in this noisegroup seem to be about Windows
problems, not Python ones... :)
--
http://mail.python.org/mailman/listinfo/python-list
News123 wrote:
Hi,
I wondered about the best way, that a module's function could determine
the existance and value of variables in the __main__ module.
What I came up with is:
### main.py ##
import mod
A = 4
if __name__ == "__main__": mod.f()
### mod.py ##
def
Spencer Pearson wrote:
Hi!
This might be more of a personal-preference question than anything,
but here goes: when is it appropriate for a function to take a list or
tuple as input, and when should it allow a varying number of
arguments? It seems as though the two are always interchangeable. For
actually using the -i param in the command to subprocess doesn't seem to
work as well as setting PS1 to some garbage, it starts a new interactive
shell therein kicking me out of python. :/
Thank you,
-Alex Goretoy
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 21 Mar 2010 23:09:46 -0600, Zooko O'Whielacronx wrote:
> But the use case that I am talking about is where you need to accumulate
> new incoming strings into your buffer while alternately processing
> leading prefixes of the buffer.
[...]
> Below are the abbreviated results of the benchmar
for the broken pipe error, perhaps theres a different way I can get shell
output other than using subprocess? I need the output of alias command into
a string and output of declare command into a string as well, I would like
to also avoid creating of a single liner script to make this happen if at
Lawrence D'Oliveiro, 22.03.2010 00:36:
Terry Reedy wrote:
No one has discovered a setting
of the internal tuning parameters for which there are no bad patterns
and I suspect there are not any such. This does not negate Xavier's
suggestion that a code change might also solve your problem.
Could
I do have a problem however that I don't know how to solve. My application
dies abruptly at random times because of this and I get this output error in
the terminal:
bash: line 0: declare: write error: Broken pipe
and sometimes it crashes and I get this output error; this one maybe gtk
related, y
On 22 мар, 01:27, Peter Otten <__pete...@web.de> wrote:
> Jah_Alarm wrote:
> > I've got a vector length n of integers (some of them are repeating),
> > and I got a selection probability vector of the same length. How will
> > I sample with replacement k (<=n) values with the probabilty vector.
> >
On 22 мар, 01:28, "Alf P. Steinbach" wrote:
> * Alf P. Steinbach:
>
>
>
> > * Jah_Alarm:
> >> I've got a vector length n of integers (some of them are repeating),
> >> and I got a selection probability vector of the same length. How will
> >> I sample with replacement k (<=n) values with the proba
46 matches
Mail list logo