<?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: My 18 Random Friends</title>
	<link>http://leahculver.com/2007/08/05/my-18-random-friends/</link>
	<description>leahculver.com</description>
	<pubDate>Tue, 06 Jan 2009 06:09:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: Guilherme</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-698</link>
		<dc:creator>Guilherme</dc:creator>
		<pubDate>Fri, 17 Aug 2007 20:37:57 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-698</guid>
		<description>I don't think I like the Idea of random friends. Maybe you should use other criteria, like in Orkut (which is very popular here in Brazil), it lists the friends with the most recent login (at least I think that's how they do). Other idea would be to rank your friends by number of interactions, those who leaves more messages, or something like that.

Great work!

Still waiting for my invitation ;)</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think I like the Idea of random friends. Maybe you should use other criteria, like in Orkut (which is very popular here in Brazil), it lists the friends with the most recent login (at least I think that&#8217;s how they do). Other idea would be to rank your friends by number of interactions, those who leaves more messages, or something like that.</p>
<p>Great work!</p>
<p>Still waiting for my invitation <img src='http://leahculver.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zelnox</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-697</link>
		<dc:creator>Zelnox</dc:creator>
		<pubDate>Fri, 17 Aug 2007 17:39:42 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-697</guid>
		<description>That's a nice font for code. What is it called?</description>
		<content:encoded><![CDATA[<p>That&#8217;s a nice font for code. What is it called?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wes</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-696</link>
		<dc:creator>wes</dc:creator>
		<pubDate>Mon, 13 Aug 2007 15:50:52 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-696</guid>
		<description>Leah -- as of yesterday, it appears that anyone with less than 18 friends isn't having their friends list show up at all.  Just an FYI!  :)</description>
		<content:encoded><![CDATA[<p>Leah &#8212; as of yesterday, it appears that anyone with less than 18 friends isn&#8217;t having their friends list show up at all.  Just an FYI!  <img src='http://leahculver.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Malone</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-695</link>
		<dc:creator>Mike Malone</dc:creator>
		<pubDate>Sat, 11 Aug 2007 04:28:00 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-695</guid>
		<description>"If you want to sort randomly, you can also use this in mysql: SELECT … FROM … ORDER BY rand() LIMIT 18;"

Bad idea if you have a large dataset. Doing an order by rand() in MySQL will force the SQL engine to generate a random number for ever item in your result set, then do a sort based on those numbers... which is fine if you have a small result set, but gets very icky when you get into thousands of rows (or hundreds of thousands).</description>
		<content:encoded><![CDATA[<p>&#8220;If you want to sort randomly, you can also use this in mysql: SELECT … FROM … ORDER BY rand() LIMIT 18;&#8221;</p>
<p>Bad idea if you have a large dataset. Doing an order by rand() in MySQL will force the SQL engine to generate a random number for ever item in your result set, then do a sort based on those numbers&#8230; which is fine if you have a small result set, but gets very icky when you get into thousands of rows (or hundreds of thousands).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Stump</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-694</link>
		<dc:creator>Joe Stump</dc:creator>
		<pubDate>Fri, 10 Aug 2007 06:33:55 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-694</guid>
		<description>Just wanted to echo the "SELECT * FROM foo WHERE userID = 5 ORDER BY RAND LIMIT 0,18" statement. Since you're doing a (presumably) primary key lookup on userID it'll be highly optimized so, considering most users have less than a few hundred friends, ordering by RAND() isn't horrible.

That all being said, ordering by RAND() is normally not a good thing because MySQL selects out the entire set and then randomly selects rows until your LIMIT is fulfilled.</description>
		<content:encoded><![CDATA[<p>Just wanted to echo the &#8220;SELECT * FROM foo WHERE userID = 5 ORDER BY RAND LIMIT 0,18&#8243; statement. Since you&#8217;re doing a (presumably) primary key lookup on userID it&#8217;ll be highly optimized so, considering most users have less than a few hundred friends, ordering by RAND() isn&#8217;t horrible.</p>
<p>That all being said, ordering by RAND() is normally not a good thing because MySQL selects out the entire set and then randomly selects rows until your LIMIT is fulfilled.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leah Culver</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-693</link>
		<dc:creator>Leah Culver</dc:creator>
		<pubDate>Thu, 09 Aug 2007 21:47:49 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-693</guid>
		<description>Matt - I love dpaste, however it deletes stuff after 30 days if not viewed by anyone.

Sorry about the images. I'm pretty lazy.</description>
		<content:encoded><![CDATA[<p>Matt - I love dpaste, however it deletes stuff after 30 days if not viewed by anyone.</p>
<p>Sorry about the images. I&#8217;m pretty lazy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matt</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-692</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Thu, 09 Aug 2007 17:18:36 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-692</guid>
		<description>When you post Django code could you post a link to dpaste (http://dpaste.com) so we (I...) don't have have to retype everything?  Thanks.  Later.</description>
		<content:encoded><![CDATA[<p>When you post Django code could you post a link to dpaste (http://dpaste.com) so we (I&#8230;) don&#8217;t have have to retype everything?  Thanks.  Later.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cameron</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-691</link>
		<dc:creator>Cameron</dc:creator>
		<pubDate>Wed, 08 Aug 2007 22:31:57 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-691</guid>
		<description>Leah,

I know you don't like Ruby, so I had to show you a nice solution...

m.friends.values_at(*(0..m.length-1).to_a.sort_by{rand}[0..17])

This generates 18 random indices and selects those friends.</description>
		<content:encoded><![CDATA[<p>Leah,</p>
<p>I know you don&#8217;t like Ruby, so I had to show you a nice solution&#8230;</p>
<p>m.friends.values_at(*(0..m.length-1).to_a.sort_by{rand}[0..17])</p>
<p>This generates 18 random indices and selects those friends.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: qubitz</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-690</link>
		<dc:creator>qubitz</dc:creator>
		<pubDate>Wed, 08 Aug 2007 22:07:54 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-690</guid>
		<description>m.friends.sort_by{rand}[1..18]</description>
		<content:encoded><![CDATA[<p>m.friends.sort_by{rand}[1..18]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emad</title>
		<link>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-689</link>
		<dc:creator>emad</dc:creator>
		<pubDate>Tue, 07 Aug 2007 18:10:36 +0000</pubDate>
		<guid>http://leahculver.com/2007/08/05/my-18-random-friends/#comment-689</guid>
		<description>Leah,

At YellowBot, we sort based on when your friends were last logged in...a way for you to know that activity (i.e. they wrote a review or tagged a location) may have just happened with those you want to keep track of.

If you want to sort randomly, you can also use this in mysql: SELECT ... FROM ... ORDER BY rand() LIMIT 18;

:-)</description>
		<content:encoded><![CDATA[<p>Leah,</p>
<p>At YellowBot, we sort based on when your friends were last logged in&#8230;a way for you to know that activity (i.e. they wrote a review or tagged a location) may have just happened with those you want to keep track of.</p>
<p>If you want to sort randomly, you can also use this in mysql: SELECT &#8230; FROM &#8230; ORDER BY rand() LIMIT 18;<br />
 <img src='http://leahculver.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
