<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Random (and Readable) String Generation</title>
	<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/</link>
	<description>leahculver.com</description>
	<pubDate>Sat, 17 May 2008 02:28:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: nick</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1013</link>
		<dc:creator>nick</dc:creator>
		<pubDate>Sat, 19 Jan 2008 19:36:56 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1013</guid>
		<description>@Matt Wilson:

no, because metal kids have friends with punk kids and mods and shit (see 'SLC Punk'). You're thinking in some ideal dream world, that probabily only exists in SFV. It's called mapreduce anyway... or you can distribute the content using BTree or something for faster lookup.</description>
		<content:encoded><![CDATA[<p>@Matt Wilson:</p>
<p>no, because metal kids have friends with punk kids and mods and shit (see &#8216;SLC Punk&#8217;). You&#8217;re thinking in some ideal dream world, that probabily only exists in SFV. It&#8217;s called mapreduce anyway&#8230; or you can distribute the content using BTree or something for faster lookup.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bjorn Tipling</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1011</link>
		<dc:creator>Bjorn Tipling</dc:creator>
		<pubDate>Fri, 18 Jan 2008 22:50:02 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1011</guid>
		<description>That's awesome, thanks for sharing it looks pretty handy. That uncov idiot should just shut up. I think you should get a gag order on him for libel or harrassment or something. His attitude is just uncalled for.</description>
		<content:encoded><![CDATA[<p>That&#8217;s awesome, thanks for sharing it looks pretty handy. That uncov idiot should just shut up. I think you should get a gag order on him for libel or harrassment or something. His attitude is just uncalled for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ShyWolf</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1010</link>
		<dc:creator>ShyWolf</dc:creator>
		<pubDate>Fri, 18 Jan 2008 14:15:33 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1010</guid>
		<description>I don't think that such a library exists already for Python.
The "easy to remember but fairly secure" is a subject on which the point of view does differ so much that it's hard to make a good tradeoff.

Explaining better: password/shared keys generated that way sound too easily breakable to me (well, mostly because I could look at the code too), and probably will look too hard to memorize to my boss.

He'd resort to copy/paste for that anyway, and at that point it wouldn't make much difference if they're readable or not.

Honestly, beside UIDs and temporary passwords, I don't see much use for automatic string generation. To achieve what you want (shared feeds, for example) there are other ways that are probably more sane and secure.

Also, I have many "moarl" issues in using things lambda and yeld. I mean it happened to me to use them, but I somehow always end up having guilt complexes about it.
Somewhere in my past, and I don't remember when or where, I was nagged about having a single return point for functions (yeld) and for what regards lamba well, it's basically a "I don't feel like typing def myfunction()" kinda construct.

Disclaimer: I'm an engineer as formation, so that might explain a lot, including my raging paranoia.
I'm happy not to be a JS programmer.
As a little diclaimer</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think that such a library exists already for Python.<br />
The &#8220;easy to remember but fairly secure&#8221; is a subject on which the point of view does differ so much that it&#8217;s hard to make a good tradeoff.</p>
<p>Explaining better: password/shared keys generated that way sound too easily breakable to me (well, mostly because I could look at the code too), and probably will look too hard to memorize to my boss.</p>
<p>He&#8217;d resort to copy/paste for that anyway, and at that point it wouldn&#8217;t make much difference if they&#8217;re readable or not.</p>
<p>Honestly, beside UIDs and temporary passwords, I don&#8217;t see much use for automatic string generation. To achieve what you want (shared feeds, for example) there are other ways that are probably more sane and secure.</p>
<p>Also, I have many &#8220;moarl&#8221; issues in using things lambda and yeld. I mean it happened to me to use them, but I somehow always end up having guilt complexes about it.<br />
Somewhere in my past, and I don&#8217;t remember when or where, I was nagged about having a single return point for functions (yeld) and for what regards lamba well, it&#8217;s basically a &#8220;I don&#8217;t feel like typing def myfunction()&#8221; kinda construct.</p>
<p>Disclaimer: I&#8217;m an engineer as formation, so that might explain a lot, including my raging paranoia.<br />
I&#8217;m happy not to be a JS programmer.<br />
As a little diclaimer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wilson</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1008</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Thu, 10 Jan 2008 03:00:30 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1008</guid>
		<description>I have a hard time imagining the content of BANNED_PHRASES.  Is it an instance where two tame words turn evil when combined, like dog and walk are OK, but dogwalk is bad?

What about this instead of the try...pass stuff.

   if s in BANNED_WORDS: return None

Maybe make BANNED_WORDS into a dictionary or a set or something with a faster lookup.  Maybe it already is.

Anyhow, saw your slides about "be nice to the database" on pownce.  If the database is the bottleneck, would it be possible to slice up the site into lots of different servers, each with their different database?   You would have to partition each database so that everybody's friends are on that database.

For example, maybe the metal kids are all one box and all the punk rock kids are on a different one.  Since they never talk to each other, then it's OK.

Finally, our ancestors died to give us the right to put docstrings on our functions.  We should honor their sacrifice :)</description>
		<content:encoded><![CDATA[<p>I have a hard time imagining the content of BANNED_PHRASES.  Is it an instance where two tame words turn evil when combined, like dog and walk are OK, but dogwalk is bad?</p>
<p>What about this instead of the try&#8230;pass stuff.</p>
<p>   if s in BANNED_WORDS: return None</p>
<p>Maybe make BANNED_WORDS into a dictionary or a set or something with a faster lookup.  Maybe it already is.</p>
<p>Anyhow, saw your slides about &#8220;be nice to the database&#8221; on pownce.  If the database is the bottleneck, would it be possible to slice up the site into lots of different servers, each with their different database?   You would have to partition each database so that everybody&#8217;s friends are on that database.</p>
<p>For example, maybe the metal kids are all one box and all the punk rock kids are on a different one.  Since they never talk to each other, then it&#8217;s OK.</p>
<p>Finally, our ancestors died to give us the right to put docstrings on our functions.  We should honor their sacrifice <img src='http://leahculver.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kiltak</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1007</link>
		<dc:creator>Kiltak</dc:creator>
		<pubDate>Wed, 09 Jan 2008 20:04:52 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1007</guid>
		<description>Hey Leah,

You should allow you blog to display more than 1 post on the front page.. and where are the previous / next page links? :)

Also, the blog looks fine in Firefox, but your title is cut in half (horizontally) in IE 7.. (Have to use it at work, please don't stone me :) )</description>
		<content:encoded><![CDATA[<p>Hey Leah,</p>
<p>You should allow you blog to display more than 1 post on the front page.. and where are the previous / next page links? <img src='http://leahculver.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Also, the blog looks fine in Firefox, but your title is cut in half (horizontally) in IE 7.. (Have to use it at work, please don&#8217;t stone me <img src='http://leahculver.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Isaac</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1006</link>
		<dc:creator>Isaac</dc:creator>
		<pubDate>Wed, 09 Jan 2008 18:44:22 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1006</guid>
		<description>I'd just like to point out that it's possible that generate_random_string() will effectively never return. It is theoretically guaranteed that at some point you will run into a sequence of many BANNED_WORDS being generated one after the other. At any rate, predicting the execution time of this function is basically impossible.

I would just remove all vowels from your generation pool as well as the number 0, and skip the is_valid_string() check. It's pretty much impossible to generate a "naughty" word without vowels.

Use of lambdas to do this kind of thing also strikes me as rather... inefficient? I guess I'm not sure if python is smart enough to optimize this into a simple loop, but I sure hope so. If not, it might be better to just use a simple for loop.</description>
		<content:encoded><![CDATA[<p>I&#8217;d just like to point out that it&#8217;s possible that generate_random_string() will effectively never return. It is theoretically guaranteed that at some point you will run into a sequence of many BANNED_WORDS being generated one after the other. At any rate, predicting the execution time of this function is basically impossible.</p>
<p>I would just remove all vowels from your generation pool as well as the number 0, and skip the is_valid_string() check. It&#8217;s pretty much impossible to generate a &#8220;naughty&#8221; word without vowels.</p>
<p>Use of lambdas to do this kind of thing also strikes me as rather&#8230; inefficient? I guess I&#8217;m not sure if python is smart enough to optimize this into a simple loop, but I sure hope so. If not, it might be better to just use a simple for loop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David, biologeek</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1005</link>
		<dc:creator>David, biologeek</dc:creator>
		<pubDate>Wed, 09 Jan 2008 17:52:08 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1005</guid>
		<description>You can find django.contrib.auth.UserManager.make_random_password userful. Or not.</description>
		<content:encoded><![CDATA[<p>You can find django.contrib.auth.UserManager.make_random_password userful. Or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zylox</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1004</link>
		<dc:creator>zylox</dc:creator>
		<pubDate>Wed, 09 Jan 2008 15:26:11 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1004</guid>
		<description>On the shell I like to use APG ( http://www.adel.nursat.kz/apg/ ).  It has a nice feature called "pronounceable password generation" which will give you a list like this:

Shucowuzil
fojWinur
foHolbAg
citpoytsut
ThoorfimJi
siefyawJen

You can also compare the generated to a dictionary file. Anyway, not really Python, but it could be implemented.</description>
		<content:encoded><![CDATA[<p>On the shell I like to use APG ( <a href="http://www.adel.nursat.kz/apg/" rel="nofollow">http://www.adel.nursat.kz/apg/</a> ).  It has a nice feature called &#8220;pronounceable password generation&#8221; which will give you a list like this:</p>
<p>Shucowuzil<br />
fojWinur<br />
foHolbAg<br />
citpoytsut<br />
ThoorfimJi<br />
siefyawJen</p>
<p>You can also compare the generated to a dictionary file. Anyway, not really Python, but it could be implemented.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mason</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1003</link>
		<dc:creator>Mason</dc:creator>
		<pubDate>Wed, 09 Jan 2008 03:53:47 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1003</guid>
		<description>Similar... don't know if it's as "nice":

http://zopelabs.com/cookbook/1059673251/txt_src</description>
		<content:encoded><![CDATA[<p>Similar&#8230; don&#8217;t know if it&#8217;s as &#8220;nice&#8221;:</p>
<p><a href="http://zopelabs.com/cookbook/1059673251/txt_src" rel="nofollow">http://zopelabs.com/cookbook/1059673251/txt_src</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikeal</title>
		<link>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1002</link>
		<dc:creator>mikeal</dc:creator>
		<pubDate>Wed, 09 Jan 2008 03:06:07 +0000</pubDate>
		<guid>http://leahculver.com/2008/01/08/random-and-readable-string-generation/#comment-1002</guid>
		<description>import uuid
def randomness(characters=6):
    return str(uuid.uuid1()).replace('-','')[:characters]</description>
		<content:encoded><![CDATA[<p>import uuid<br />
def randomness(characters=6):<br />
    return str(uuid.uuid1()).replace(&#8217;-',&#8221;)[:characters]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
