Fredrik Lundh wrote:
> Mathias Panzenboeck wrote:
>
>> But the question is: *IS* this derived work? I mean, it's not copied code.
>> It's the same hashing-logic, which I learned by watching pythons code.
>
> given that it's only a few lines of code, and there's hardly any other
> way to write th
Fredrik Lundh wrote:
> Mathias Panzenboeck wrote:
>
>> But the question is: *IS* this derived work? I mean, it's not copied
>> code.
>> It's the same hashing-logic, which I learned by watching pythons code.
>
> given that it's only a few lines of code, and there's hardly any other
> way to writ
Mathias Panzenboeck wrote:
> But the question is: *IS* this derived work? I mean, it's not copied code.
> It's the same hashing-logic, which I learned by watching pythons code.
given that it's only a few lines of code, and there's hardly any other
way to write those lines if you want to implemen
Paul Rubin wrote:
> Mathias Panzenboeck <[EMAIL PROTECTED]> writes:
>> So, can this code be considered as derived and do I have to put my
>> code under the GPL? I'd like to publish it under something less
>> restrictive, like a BSD style license. But if GPL is the only way,
>> then GPL it is. :)
>
Mathias Panzenboeck <[EMAIL PROTECTED]> writes:
> So, can this code be considered as derived and do I have to put my
> code under the GPL? I'd like to publish it under something less
> restrictive, like a BSD style license. But if GPL is the only way,
> then GPL it is. :)
Python is not GPL'd but h
Hi.
I wrote a small hashlib for C. Because I'm new to hashes I looked at pythons
implementation and
reused *some* of the code... or more the mathematical "hash-function", not
really the code.
In particular I looked at pythons hash and lookup functions, so I came up with
this (see the code
un
obel who has done something amazingly
> similar:
>
> http://goanna.cs.rmit.edu.au/~hugh/zhw-ipl.html
>
Same guy, he was a lecturer during my uni days. As far as his surname
that is another issue altogether.
> Searching for "Justin Sobel" did lead me to a Russian website wh
ot;: by coincidence, there's
a Melbourne academic named Justin Zobel who has done something amazingly
similar:
http://goanna.cs.rmit.edu.au/~hugh/zhw-ipl.html
Searching for "Justin Sobel" did lead me to a Russian website which
apart from repeating your typo/reado/whatevero did p
ng one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net
Stefan Behnel wrote:
> Arash Partow wrote:
> > I've ported various hash functions to python if anyone is interested:
> > [snip]
>
> Ok, so if you think
type which wants its
> instances to be hashable defines its own hash method, one that suits the
> type.]
>
> This belief would be based on:
> (a) actual testing by you
> or (b) a refereed academic paper which did such tests on hash functions
> (including the Python "standard
On 17/07/2006 5:52 PM, Arash Partow wrote:
> Hi Paul,
>
> For different data types different hash functions work
> better/worse aka fewer or more collisions.
>
> I believe the more choice people have and also the more
> ways people see how a particular thing can be done,
Arash Partow wrote:
> I've ported various hash functions to python if anyone is interested:
> [snip]
Ok, so if you think they are useful, what about writing up an article for the
Python Cookbook that describes their usage and specific
advantages/disadvantages?
http://aspn.activesta
That is true, but I'm not about to do something
that might potentially prove my point wrong... :)
Arash Partow
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything ab
sh Partow" <[EMAIL PROTECTED]> writes:
> > For different data types different hash functions work
> > better/worse aka fewer or more collisions.
>
> But you give no indication of which of those hashes works best for
> what kind of data. How is the user supposed to f
Arash Partow wrote:
> That said, I believe at least one (most likely more) of
> the hash functions in the group above will most always work
> better (ala less collisions) than the standard default hash
> available in the built-in dict for any random set of strings.
>
> Please
"Arash Partow" <[EMAIL PROTECTED]> writes:
> For different data types different hash functions work
> better/worse aka fewer or more collisions.
But you give no indication of which of those hashes works best for
what kind of data. How is the user supposed to figure o
Hi Paul,
For different data types different hash functions work
better/worse aka fewer or more collisions.
I believe the more choice people have and also the more
ways people see how a particular thing can be done, then
the easier it will be for them to come up with their own
specific efficient
"Arash Partow" <[EMAIL PROTECTED]> writes:
> I've ported various hash functions to python if anyone is interested:
Are these useful for any particular interoperability purposes?
Otherwise I'd say just one such hash is plenty, or maybe don't even
bother,
Hi all,
I've ported various hash functions to python if anyone is interested:
def RSHash(key):
a= 378551
b= 63689
hash = 0
for i in range(len(key)):
hash = hash * a + ord(key[i])
a = a * b
return (hash & 0x7FFF)
def JSHash(key):
Bryan Olson <[EMAIL PROTECTED]> writes:
> The module provides classes and functions. The functions are:
>
> string_to_hex(str): Return a string with two hex digits for
> each byte of str, representing the ord() of the byte. The
> case of the hex digits A-F/a-f is up to Python's buil
Nice. Note that the Sourceforge bug for this issue indicates that
something is already being done about it. It just happens to have
been updated a day or so ago:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1123660&group_id=5470
Note to skeptics: the attacks are pretty seriou
ame here.> Can anyone give me some good tips or hints for writing and using> hash functions in Python?Well, the usual tip for writing them is, don't, unless you need to.
If implement __eq__, then you need to, so it's fairly common to justhash a tuple containing the things that are
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> Do people often use hash() on built-in types?
Only implicitly.
> What do you find it useful for?
Dictionaries :)
> How about on custom classes?
Same here.
> Can anyone give me some good tips or hints for writing and us
Do people often use hash() on built-in types? What do you find it useful
for?
How about on custom classes? Can anyone give me some good tips or hints
for writing and using hash functions in Python?
Thank you,
--
Steven.
--
http://mail.python.org/mailman/listinfo/python-list
24 matches
Mail list logo