<feed xmlns="http://www.w3.org/2005/Atom" xmlns:foaf="http://xmlns.com/foaf/0.1/"><title>norman.walsh.name: Comments on /2004/08/26/goodMorning</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/08/26/goodMorning"/><id>http://norman.walsh.name/2004/08/26/goodMorning/comments.atom</id><updated>2012-02-13T08:56:54.733626Z</updated><entry><title>Comment 1 on /2004/08/26/goodMorning</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/08/26/goodMorning#comment0001"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0001</id><published>2004-08-26T18:02:50Z</published><updated>2004-08-26T18:02:50Z</updated><author><name>Sjoerd Visscher</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>There are 5 places to put the o.
Then there are 4 places left to put the r.
Then there are 3 places left to put the i.
The remaining 2 places are filled with n.</p>
<p>5 x 4 x 3 = 60</p>
  </div></content></entry><entry><title>Comment 2 on /2004/08/26/goodMorning</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/08/26/goodMorning#comment0002"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0002</id><published>2004-08-26T23:14:52Z</published><updated>2004-08-26T23:14:52Z</updated><author><name>Giulio Piancastelli</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>There's a recipe [1] in the online Python Cookbook to calculate permutations and combinations of elements in a list, using Python's generators. You'll need to remove duplicates from the results, since the two n's are perceived as different tokens; but you'll eventually end up with 60 possibilities.</p>
<p>[1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465</p>
  </div></content></entry><entry><title>Comment 3 on /2004/08/26/goodMorning</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/08/26/goodMorning#comment0003"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0003</id><published>2004-08-26T23:36:59Z</published><updated>2004-08-26T23:36:59Z</updated><author><name>Jay Hannah</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>Sjoerd: All mathmatical formulas must be proven with long, inefficient, brute force Perl algorithms. -grin-</p>
  </div></content></entry><entry><title>Comment 4 on /2004/08/26/goodMorning</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/08/26/goodMorning#comment0004"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0004</id><published>2004-08-27T01:32:09Z</published><updated>2004-08-27T01:32:09Z</updated><author><name>martin english</name></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>See http://www.oreillynet.com/pub/wlg/5492 for brian d foy's generic solution.</p>
  </div></content></entry><entry><title>Comment 5 on /2004/08/26/goodMorning</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2004/08/26/goodMorning#comment0005"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0005</id><published>2004-08-28T22:14:23Z</published><updated>2004-08-28T22:14:23Z</updated><author><name>Tony Bowden</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>No need to reinvent the wheel:</p>
<pre>use Algorithm::FastPermute ('permute');
my @letters = qw/o r n i n/;
my %seen;
permute {
my $word = join "", "m", @letters, "g";
print "$word\n" unless $seen{$word}++;
} @letters;</pre>
</div></content></entry></feed>

