Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16429 > unrolled thread

order independent hash?

Started byNeal Becker <ndbecker2@gmail.com>
First post2011-11-30 07:32 -0500
Last post2011-12-03 08:36 -0800
Articles 6 — 4 participants

Back to article view | Back to comp.lang.python


Contents

  order independent hash? Neal Becker <ndbecker2@gmail.com> - 2011-11-30 07:32 -0500
    Re: order independent hash? 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-02 10:18 -0800
    Re: order independent hash? 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-02 10:18 -0800
      Re: order independent hash? Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-02 11:37 -0700
      Re: order independent hash? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-03 01:04 +0000
        Re: order independent hash? 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-03 08:36 -0800

#16429 — order independent hash?

FromNeal Becker <ndbecker2@gmail.com>
Date2011-11-30 07:32 -0500
Subjectorder independent hash?
Message-ID<mailman.3154.1322656374.27778.python-list@python.org>
I like to hash a list of words (actually, the command line args of my program) 
in such a way that different words will create different hash, but not sensitive 
to the order of the words.  Any ideas?

[toc] | [next] | [standalone]


#16560

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-12-02 10:18 -0800
Message-ID<mailman.3232.1322849895.27778.python-list@python.org>
In reply to#16429
On Wednesday, November 30, 2011 8:32:39 PM UTC+8, Neal Becker wrote:
> I like to hash a list of words (actually, the command line args of my program) 
> in such a way that different words will create different hash, but not sensitive 
> to the order of the words.  Any ideas?

For each word of your list as the key, an object of a hash can be used further 
is stored as the value in the hash of the list of words.

Assume that word 1 is the key and the hash stored is a sentence that uses 
the key word 1.

This is very useful to learn vocabularies and writing sentences. 

 

[toc] | [prev] | [next] | [standalone]


#16561

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-12-02 10:18 -0800
Message-ID<14681078.446.1322849892244.JavaMail.geo-discussion-forums@prmw23>
In reply to#16429
On Wednesday, November 30, 2011 8:32:39 PM UTC+8, Neal Becker wrote:
> I like to hash a list of words (actually, the command line args of my program) 
> in such a way that different words will create different hash, but not sensitive 
> to the order of the words.  Any ideas?

For each word of your list as the key, an object of a hash can be used further 
is stored as the value in the hash of the list of words.

Assume that word 1 is the key and the hash stored is a sentence that uses 
the key word 1.

This is very useful to learn vocabularies and writing sentences. 

 

[toc] | [prev] | [next] | [standalone]


#16565

FromIan Kelly <ian.g.kelly@gmail.com>
Date2011-12-02 11:37 -0700
Message-ID<mailman.3234.1322851079.27778.python-list@python.org>
In reply to#16561
On Fri, Dec 2, 2011 at 11:18 AM, 88888 Dihedral
<dihedral88888@googlemail.com> wrote:
> On Wednesday, November 30, 2011 8:32:39 PM UTC+8, Neal Becker wrote:
>> I like to hash a list of words (actually, the command line args of my program)
>> in such a way that different words will create different hash, but not sensitive
>> to the order of the words.  Any ideas?
>
> For each word of your list as the key, an object of a hash can be used further
> is stored as the value in the hash of the list of words.
>
> Assume that word 1 is the key and the hash stored is a sentence that uses
> the key word 1.
>
> This is very useful to learn vocabularies and writing sentences.

The OP is talking about hash functions, not hash tables, and
furthermore he is talking about hashing the entire unordered
collection of words, not hashing individual words or ordered
sentences.

[toc] | [prev] | [next] | [standalone]


#16575

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2011-12-03 01:04 +0000
Message-ID<4ed975b1$0$29988$c3e8da3$5496439d@news.astraweb.com>
In reply to#16561
On Fri, 02 Dec 2011 10:18:12 -0800, 88888 Dihedral wrote:
[...]


Dihedral, EVERY SINGLE ONE of your messages is double posted. You are 
sending to the newsgroup and the mailing list, but they are aliases for 
each other. Please stop double posting.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#16594

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-12-03 08:36 -0800
Message-ID<33348771.70.1322930169970.JavaMail.geo-discussion-forums@prgi20>
In reply to#16575
On Saturday, December 3, 2011 9:04:49 AM UTC+8, Steven D&#39;Aprano wrote:
> On Fri, 02 Dec 2011 10:18:12 -0800, 88888 Dihedral wrote:
> [...]
> 
> 
> Dihedral, EVERY SINGLE ONE of your messages is double posted. You are 
> sending to the newsgroup and the mailing list, but they are aliases for 
> each other. Please stop double posting.
> 
> 
> -- 
> Steven

A list  can replace a hash. I knew that in lisp. 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web