? What
if the encoded data happens to have the magic byte values for something
else?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
something esoteric and strange on the terminal but I was just
having trouble logging in. End of dream.
Anyone ever have a wierd engineering dream sometime in thier career?
The Eternal Squire
Just sit still while the men in white come to pick you up :)
--
Lasse Vågsæther Karlsen
http
of just one.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
to do this using Windows Explorer. I was under
the assumption the OP wanted to know how he could automate it since that
is what you typically want to do with applications you write.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
David Schwartz wrote:
Lasse Vågsæther Karlsen wrote:
David Schwartz wrote:
Burger King won't let you sell Whoppers or buy their burger
patties wholesale no matter what you want to call your store unless
you take the whole franchise deal. It's an all-or-nothing package.
With very few
with starting a task and
waiting for it to complete, and continuing if it fails to complete in a
given timeframe, typically also aborting the task at the same time (ie.
executing a database query, connecting to a server, waiting for an
event/lock, etc.).
--
Lasse Vågsæther Karlsen
http
Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
.
Any help or pointers would be most welcome.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
Lasse Vågsæther Karlsen [EMAIL PROTECTED] writes:
I have a list of items and a rule for ordering them.
Unfortunately, the rule is not complete so it won't define the correct
order for any two items in that list.
In other words, if I pick two random items from the list I may
Lasse Vågsæther Karlsen wrote:
Paul Rubin wrote:
Lasse Vågsæther Karlsen [EMAIL PROTECTED] writes:
I have a list of items and a rule for ordering them.
snip
Ok, managed to implement the algorithm. Might not be the optimal
solution (memory and speed-wise) but it worked and doesn't take too
, that's different.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Porsgrunn and sell
machines with only Linux installed.
I think Microsoft would be allowed to say No, you can't do that.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
, is the criminal act of which you speak?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
David Schwartz wrote:
Lasse Vågsæther Karlsen wrote:
I would think that if I set up a shop and wanted to have the word
Microsoft as part of the shop name, there would be some rules
dictating what products I could and could not sell, yes. Wether those
rules are set forth in a law somewhere
How about:
list.sort(key=lambda x: x[3])
Does that work?
--
http://mail.python.org/mailman/listinfo/python-list
than it intends to solve
So until a good implementation exists, there shouldn't be any point in
actually discussing the motives of the programmers who wishes to use the
feature.
snip
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
Bengt Richter wrote:
snip
tmp = 0
def execute():
... global tmp, execute
... tmp = cellvar = tmp + 1
... def execute():
... return cellvar
... return tmp
snip
On man did this put my head into a spin :P
--
Lasse Vågsæther Karlsen
http
is a good time for you to terminate.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
snip
Diez
[1] http://xahlee.org/PageTwo_dir/Personal_dir/mi_pixra.html
Oh man... Talk about ... bummer.
Seriously, who do we call to get someone with a straightjacket to show
up at his home?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL
, but that crowd probably needs to be limited
in one way or another, like only 2 rotten fruits per person or similar.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
to allow the user to input both some basic
format for your program and convert it to a regular expression as well
as input a full pattern, because then the user can have words that have
a U or a E in the second letter, simply because he doesn't know which
one is right yet.
--
Lasse Vågsæther
of sorting and its implementation aspects are completely
belied.
belied how?
It's interesting to note that these fact posts of yours are nothing
bud badly worded opinions.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http
]
if I know beforehand how many items iterable would possibly yield, would
a construct like this be faster and use less memory?
s = [0] * len(iterable)
for i in xrange(len(iterable)):
s[i] = iterable.next()
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED
:
iterables.sort(comparison, key=lambda x: x[0],
reverse=True)
except StopIteration:
iterables.pop(-1)
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
: comparison = cmp
# rest of function here
and thus ignoring the wrong parameter names?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Max M wrote:
Lasse Vågsæther Karlsen wrote:
I must be missing something but what is the proper way to do a
function using such arguments ?
- ability to take an unspecified number of positional arguments
You should probably pass a sequence to the method instead. You can do
Lasse Vågsæther Karlsen wrote:
snip
Another idea for this method would be that in some cases I noticed that
it was useful to know which source each element would come from as well,
as well as removing duplicates from the results.
snip
The removing duplicates problem would probably
George Sakkis wrote:
Lasse Vågsæther Karlsen [EMAIL PROTECTED] wrote:
snip
I think I'll re-write to use a list instead
Actually in most cases you don't need to assume it's a list; any
iterable is usually good enough. You can always turn it into a list (or
a tuple or a set
you :)
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
to add
minor functions and things to that program.
Nowadays a lot of the scripting languages have turned programming
languages so I think the difference is small.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http
that can find blue hats in an image and
recognize people?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
to consider fibonacci(50) and fibonacci(idx =
50) as the same call and thus retrieve the second one from the cache.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
if possible
if key in cache:
return cache[key]
# Work out new value, cache it and return it
result = fn(*args, **kwargs)
cache[key] = result
return result
# Return wrapper function
return cached_result
--
Lasse Vågsæther Karlsen
http
has the problem that dictionaries can't be used as
dictionary keys, but that can be easily solved. I think I can simplify
my solution with some of yours.
The parameter names can be gotten by doing a inspect.getargspec(fn)[0]
so that can be done by the decorator function.
--
Lasse Vågsæther
Lasse Vågsæther Karlsen wrote:
Sam Pointon wrote:
What about not storing args at all? Something like this:
snip
Ok, here's my updated version:
class cache(object):
def __init__(self, timeout=0):
self.timeout = timeout
self.cache = {}
def __call__(self, fn
Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
and
pointers from others in this thread.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
be a big difference if I have a lot of sources though as I
bet the overhead in doing a sort of N items gets higher than doing a
manipulation of a heap to place an item in the right spot, but with 4-5
or a few more sources might not make an impact at all.
--
Lasse Vågsæther Karlsen
http
code solutions that I could use.
For instance, there's this thing I've heard of called the wheel.
:)
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
matey.
Nice try though.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
Lasse Vågsæther Karlsen wrote:
Don't think so matey.
oh, come on. a site run by some random guy in North Carolina has to be
safer, faster and more reliable than a distributed communication system that
has been around since that guy was born...
Yes, of course, my
Leave Xah Lee alone, he's a troll, he got no interested in doing
anything but to provoke people on usenet.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
to keep your email world into a pure text-based
no-formatting-whatsoever world, that's a fantasy bubble that is bound to
burst, sooner rather than later.
Deal with it.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http
:)
In other words, what is the difference between a scripting language
and a programming language.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Ok, that one looks more sleak than what I came up with.
Couple of things I learn from your solution, please correct me if I
misunderstood something:
1. list containing other lists will sort itself based on first element
on lists inside ?
2. sort(), pop() is not costly operations
Other than that
Thanks, that looks like Mike's solution except that it uses the
built-in heapq module.
While this one contains less code than Mike's solution it seems to lack
the ability to control the comparison operation, which means it won't
work in my case. I need to both be able to sort on an arbitrary
Lasse Vågsæther Karlsen wrote:
I need to merge several sources of values into one stream of values. All
of the sources are sorted already and I need to retrieve the values from
snip
Ok, after working through the various sources and solutions, here's what
I finally ended up with:
def
perhaps?
Clearly Python is superior because it doesn't need any code at all to do
fractals.
Surely you can see that? :)
I question the timings though, 2+ minutes to execute nothing doesn't
seem very pythonesque.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED
in a third), a simple 2-source method
isn't enough but if it's better than what I do for 2 sources then I can
make a wrapper for it, since that's what I do anyway.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org
or Pythonwin, so it might be
what you need. I think the name was something like MSVCRT71.DLL but
don't think I got it 100% right just there... :P
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo
The specific error in your code, is that when cnto == len(ttllst), then
doing ttllst[cnto] will give you that error.
The list is indexed from 0 to len-1, which means that doing
list[len(list)] will give that error.
--
http://mail.python.org/mailman/listinfo/python-list
While Microsoft and other big software vendors might have a roadmap
that ties you very tightly in with their budget, and also changes that
roadmap from time to time which breaks your current software, a lot of
open source projects have no roadmap at all.
This means that a .x.y.2 upgrade might
Ok, when re-reading my post it seems that I'm saying that Python has no
roadmap. That was not my intent. I meant projects other than Python,
even though the problems I got with 2.4.2 is real, I suspect there's
something in Komodo that is the problem since I can run all my python
programs with
assume that since there is some magic involved in invoking
python.exe here, stdin gets munged on the way.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Lasse Vågsæther Karlsen wrote:
I got a loop like this:
snip
Ok, I've found some information. I don't like the answer but it doesn't
seem to be any good way to do this without hacking it one way or the other.
If someone has a brilliant answer that isn't in google yet, please let
me know
to
that definition.
I've tried finding an example in the lib code installed with Python but
can't seem to track down anything that is documented like that.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo
the module.
Is there a trick to this? Do I have to store my own modules beneath
C:\Python24\Lib? or can I use the organization I've tried just with some
minor fixes to make python locate my modules?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID
is, is there a way to get __doc__ support for
properties, in effect, use the xxx syntax for documenting properties.
Is the preferred way to use xxx or # to document ?
Whatever is preferred, what's the upside/downsides of the two beyond
what I just explained?
--
Lasse Vågsæther Karlsen
http
59 matches
Mail list logo