<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: generating a unique range of numbers</title>
	<atom:link href="http://equivalence.co.uk/archives/719/feed" rel="self" type="application/rss+xml" />
	<link>http://equivalence.co.uk/archives/719</link>
	<description>Technical Blog for Software Developers</description>
	<lastBuildDate>Sat, 17 Mar 2012 10:28:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Interesting Finds: 2009 02.23~02.27 - gOODiDEA.NET</title>
		<link>http://equivalence.co.uk/archives/719/comment-page-1#comment-326</link>
		<dc:creator>Interesting Finds: 2009 02.23~02.27 - gOODiDEA.NET</dc:creator>
		<pubDate>Fri, 27 Feb 2009 02:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=719#comment-326</guid>
		<description>[...] Generating a unique range of numbers    Published Thursday, February 26, 2009 9:26 PM by gOODiDEA Filed under: Interesting Finds, .NET, Javascript, MSMQ, Prototype, jQuery, WinDbg, IIS [...]</description>
		<content:encoded><![CDATA[<p>[...] Generating a unique range of numbers    Published Thursday, February 26, 2009 9:26 PM by gOODiDEA Filed under: Interesting Finds, .NET, Javascript, MSMQ, Prototype, jQuery, WinDbg, IIS [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregg</title>
		<link>http://equivalence.co.uk/archives/719/comment-page-1#comment-324</link>
		<dc:creator>Gregg</dc:creator>
		<pubDate>Thu, 26 Feb 2009 20:02:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=719#comment-324</guid>
		<description>Hi Stephen,

Yes you are right. I have probably never seen a problem with this when  using it because it&#039;s normally executing in a controlled loop where I know exactly how many times I&#039;m calling it and so size_ never gets to 0. I&#039;ll update the code to just do a &#039;&lt;=&#039; in the GetRandomNumber as I think that will do what I expect it to.

I think with set of size 0 thing it could either do as you suggested, or just throw an exception to say 0 is an invalid argument. I will leave this out the code though to make it a little easier to read in the article.

Thanks for the comment though, great spot.

Gregg</description>
		<content:encoded><![CDATA[<p>Hi Stephen,</p>
<p>Yes you are right. I have probably never seen a problem with this when  using it because it&#8217;s normally executing in a controlled loop where I know exactly how many times I&#8217;m calling it and so size_ never gets to 0. I&#8217;ll update the code to just do a &#8216;<=&#8217; in the GetRandomNumber as I think that will do what I expect it to.</p>
<p>I think with set of size 0 thing it could either do as you suggested, or just throw an exception to say 0 is an invalid argument. I will leave this out the code though to make it a little easier to read in the article.</p>
<p>Thanks for the comment though, great spot.</p>
<p>Gregg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Parker</title>
		<link>http://equivalence.co.uk/archives/719/comment-page-1#comment-323</link>
		<dc:creator>Stephen Parker</dc:creator>
		<pubDate>Thu, 26 Feb 2009 19:30:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=719#comment-323</guid>
		<description>I think you&#039;re off-by-one in your range check in GetRandomNumber.  It will allow size_==0 into Delete and allow you to access the -1&#039;th element of the array.  (Alternatively you could consider that if you ask for a set of size 0 then the first random number request will be accepted as being zero or greater.)

s.</description>
		<content:encoded><![CDATA[<p>I think you&#8217;re off-by-one in your range check in GetRandomNumber.  It will allow size_==0 into Delete and allow you to access the -1&#8242;th element of the array.  (Alternatively you could consider that if you ask for a set of size 0 then the first random number request will be accepted as being zero or greater.)</p>
<p>s.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

