On 08/02/2015 01:58 PM, Joonas Liik wrote:
I have this feeling that you would get a lot more useful anwsers if
you were to describe your actual problem in stead of what you think
the solution is. There might be other, better solutions but since we
know so little about what you are doing we will l
On 02/08/2015 21:58, Joonas Liik wrote:
I have this feeling that you would get a lot more useful anwsers if
you were to describe your actual problem in stead of what you think
the solution is. There might be other, better solutions but since we
know so little about what you are doing we will like
I have this feeling that you would get a lot more useful anwsers if
you were to describe your actual problem in stead of what you think
the solution is. There might be other, better solutions but since we
know so little about what you are doing we will likely never find them
by just guessing..
--
On 08/01/2015 01:34 PM, Lukas Barth wrote:
Hi!
I have a list of numbers that I treat as "circular", i.e. [1,2,3] and [2,3,1]
should be the same. Now I want to rotate these to a well defined status, so that I can
can compare them.
If all elements are unique, the solution is easy: find the mini
On 2015-08-01 13:34, Lukas Barth wrote:
> I have a list of numbers that I treat as "circular", i.e. [1,2,3]
> and [2,3,1] should be the same. Now I want to rotate these to a
> well defined status, so that I can can compare them.
>
> If all elements are unique, the solution is easy: find the minimu
On Saturday, August 1, 2015 at 1:34:44 PM UTC-7, Lukas Barth wrote:
> Hi!
>
> I have a list of numbers that I treat as "circular", i.e. [1,2,3] and [2,3,1]
> should be the same. Now I want to rotate these to a well defined status, so
> that I can can compare them.
>
> If all elements are unique
On Sun, 2 Aug 2015 08:51 am, Lukas Barth wrote:
> On Saturday, August 1, 2015 at 11:37:48 PM UTC+2, Emile van Sebille wrote:
>> Well, it looks to me that I don't know what a 'canonical rotation' is --
>
> That's because it is not defined. ;)
>
> I need a way to rotate one of these lists in a way
Lukas Barth :
> On Saturday, August 1, 2015 at 10:57:19 PM UTC+2, Marko Rauhamaa wrote:
>>
>> def circularly_equal(l1, l2):
>> length = len(l1)
>> if length != len(l2):
>> return False
>> twice = l1 + l1
>
Paul Rubin writes:
> H([b-a, c-b, d-c, a-d])
> where H is your favorite hash function on a list of that element type.
I wrote that up unclearly. H is supposed to be a hash on one element,
and then you combine H(b-a), H(c-b), etc. in a commutative way, such as
by adding them. Still not sure if
Lukas Barth writes:
>> [Concatenated Hashes]
> Also, that still doesn't compute that one "canonical ordering"...
It was intended to get rid of the need. What is the actual application?
How does this sound? To circularly hash [a,b,c,d] use:
H([b-a, c-b, d-c, a-d])
where H is your favorite h
On 01Aug2015 15:55, Lukas Barth wrote:
On Sunday, August 2, 2015 at 12:32:25 AM UTC+2, Cameron Simpson wrote:
Fine. This also eliminates any solution which just computes a hash.
Exactly.
Might I suggest instead simply starting with the leftmost element in the first
list; call this elem0. T
Am Samstag, 1. August 2015 22:34:44 UTC+2 schrieb Lukas Barth:
> Hi!
>
> I have a list of numbers that I treat as "circular", i.e. [1,2,3] and [2,3,1]
> should be the same. Now I want to rotate these to a well defined status, so
> that I can can compare them.
>
> If all elements are unique, the
On Saturday, August 1, 2015 at 3:52:25 PM UTC-7, Lukas Barth wrote:
> On Saturday, August 1, 2015 at 11:37:48 PM UTC+2, Emile van Sebille wrote:
> > Well, it looks to me that I don't know what a 'canonical rotation' is --
>
> That's because it is not defined. ;)
>
> I need a way to rotate one of
On Sunday, August 2, 2015 at 1:05:32 AM UTC+2, Oscar Benjamin wrote:
> Do you really need the canonical rotation or just a hash that is invariant
> under rotations?
Having that canonical rotation would make the code simpler and faster,
probably, but a rotationally invariant hash is a good start.
On Sun, 2 Aug 2015 00:05 Oscar Benjamin wrote:
On Sat, 1 Aug 2015 22:06 Lukas Barth wrote:
Nice idea! But I actually really need those "canonic rotations", since I'm
hashing them somewhere.
Do you really need the canonical rotation or just a hash that is invariant
under rotations?
I don't
On Sat, 1 Aug 2015 22:06 Lukas Barth wrote:
Nice idea! But I actually really need those "canonic rotations", since I'm
hashing them somewhere.
Do you really need the canonical rotation or just a hash that is invariant
under rotations?
I don't know of a solution to the former that is better
On Sunday, August 2, 2015 at 12:32:25 AM UTC+2, Cameron Simpson wrote:
> Fine. This also eliminates any solution which just computes a hash.
Exactly.
> Might I suggest instead simply starting with the leftmost element in the
> first
> list; call this elem0. Then walk the second list from 0 to
On Sat, Aug 1, 2015 at 6:51 PM, Lukas Barth wrote:
> On Saturday, August 1, 2015 at 11:37:48 PM UTC+2, Emile van Sebille wrote:
>> Well, it looks to me that I don't know what a 'canonical rotation' is --
>
> That's because it is not defined. ;)
>
> I need a way to rotate one of these lists in a wa
On Saturday, August 1, 2015 at 11:43:28 PM UTC+2, Paul Rubin wrote:
> How large are these lists supposed to be?
Potentially large. Not so large though that iterating them (multiple times)
should be a problem.
> [Concatenated Hashes]
>
> If the lists are very large that doesn't sound so great d
On Saturday, August 1, 2015 at 11:37:48 PM UTC+2, Emile van Sebille wrote:
> Well, it looks to me that I don't know what a 'canonical rotation' is --
That's because it is not defined. ;)
I need a way to rotate one of these lists in a way so that it will produce the
same output every time, regar
On 01Aug2015 14:24, Lukas Barth wrote:
Perhaps I should clarify a bit:
- I definitely need a "canonical rotation" - just a comparison result is not
enough
Fine. This also eliminates any solution which just computes a hash.
- It does not matter what that rotation is. Starting with the smalle
Lukas Barth writes:
> - It does not matter what that rotation is. Starting with the smallest
> element was just an idea by me, any rotation that can easily produced
> will do.
How large are these lists supposed to be? If they're (say) 5 elements,
you could make the hash code consist of the conca
On 8/1/2015 2:24 PM, Lukas Barth wrote:
Perhaps I should clarify a bit:
- I definitely need a "canonical rotation" - just a comparison result is not
enough
Well, it looks to me that I don't know what a 'canonical rotation' is --
there's no wikipedia article and googling yields all sorts of
On 8/1/2015 2:12 PM, Lukas Barth wrote:
On Saturday, August 1, 2015 at 10:51:03 PM UTC+2, Emile van Sebille wrote:
Is the problem to determine if one list of circular numbers 'matches'
another one despite rotation status? If so, I'd do something like:
Well.. no. I actually really need this "c
Perhaps I should clarify a bit:
- I definitely need a "canonical rotation" - just a comparison result is not
enough
- It does not matter what that rotation is. Starting with the smallest element
was just an idea by me, any rotation that can easily produced will do.
--
https://mail.python.org/m
On Saturday, August 1, 2015 at 10:51:03 PM UTC+2, Emile van Sebille wrote:
> Is the problem to determine if one list of circular numbers 'matches'
> another one despite rotation status? If so, I'd do something like:
Well.. no. I actually really need this "canonical" rotation, since I'm hashing
On Saturday, August 1, 2015 at 10:57:19 PM UTC+2, Marko Rauhamaa wrote:
>
> def circularly_equal(l1, l2):
> length = len(l1)
> if length != len(l2):
> return False
> twice = l1 + l1
> for i in range(len
Lukas Barth :
> I have a list of numbers that I treat as "circular", i.e. [1,2,3] and
> [2,3,1] should be the same. Now I want to rotate these to a well defined
> status, so that I can can compare them.
>
> If all elements are unique, the solution is easy: find the minimum
> element, find its inde
On 8/1/2015 1:34 PM, Lukas Barth wrote:
Hi!
I have a list of numbers that I treat as "circular", i.e. [1,2,3] and [2,3,1]
should be the same. Now I want to rotate these to a well defined status, so that I can
can compare them.
If all elements are unique, the solution is easy: find the minimum
29 matches
Mail list logo