<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>project-2501.net</title>
	<atom:link href="http://project-2501.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://project-2501.net</link>
	<description>The net is vast and infinite.</description>
	<lastBuildDate>Mon, 14 May 2012 07:10:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PCRE and newlines (in PHP)</title>
		<link>http://project-2501.net/index.php/2012/05/pcre-and-newlines-in-php/</link>
		<comments>http://project-2501.net/index.php/2012/05/pcre-and-newlines-in-php/#comments</comments>
		<pubDate>Mon, 14 May 2012 07:09:47 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=440</guid>
		<description><![CDATA[I just wasted far too much time trying to work out why a regex would work for my example test cases but not with real data. Turns out &#8220;.&#8221;, DOT_ALL, and newlines are more complicated than I realised. My problem essentially came down to not knowing that the imap messages I was working with used [...]]]></description>
			<content:encoded><![CDATA[<p>I just wasted far too much time trying to work out why a regex would work for my example test cases but not with real data.  Turns out &#8220;.&#8221;, DOT_ALL, and newlines are more complicated than I realised.</p>
<p>My problem essentially came down to not knowing that the imap messages I was working with used CRLF and that my OS/shell/applications were silently converting text to LF when I was constructing my test cases.</p>
<p><a href="http://nikic.github.com/"><strong>nikic</strong></a> has a good post covering many details with <A href="http://nikic.github.com/2011/12/10/PCRE-and-newlines.html">PCRE and newlines</a></p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2012/05/pcre-and-newlines-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guildwars 2 BWE Impressions</title>
		<link>http://project-2501.net/index.php/2012/04/guildwars-2-bwe-impressions/</link>
		<comments>http://project-2501.net/index.php/2012/04/guildwars-2-bwe-impressions/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 11:44:53 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=426</guid>
		<description><![CDATA[The BWE is now over. I thought I&#8217;d record some of my thoughts (good and bad) from my play through this weekend. Overall I played ~25 hours split over two characters, a level 14 char Elementalist and a level 21 Norn Guardian. Note: I&#8217;ve been following GW2 for a while now, and while getting hyped [...]]]></description>
			<content:encoded><![CDATA[<p>The BWE is now over.  I thought I&#8217;d record some of my thoughts (good and bad) from my play through this weekend.  Overall I played ~25 hours split over two characters, a level 14 char Elementalist and a level 21 Norn Guardian.</p>
<p>Note:  I&#8217;ve been following GW2 for a while now, and while getting hyped up, I still knew what to expect for the most part..  With that, I had high hopes and I think they were almost all met. </p>
<p>Being in Australia the latency wasn&#8217;t great.  Not horrible, but there was a delay on using all my abilities that made the game feel a little sluggish.  I got used to it in PvE, but it might affect PvP a lot more.</p>
<p><a href="http://project-2501.net/gallery/guildwars2/20120429_gw001.jpg"><img src="http://project-2501.net/gallery/guildwars2/thumb/20120429_gw001.jpg"></a></p>
<p>Graphical the game looked great, and for a GW player getting to see familiar places was pretty awesome  (e.g. Temple of Ages, and the Wizards tower off the coast of the Kessex Hills).</p>
<p>Performance was pretty poor on my system  (laptop with a GTX-485), but this is widely reported and being worked on.</p>
<p>I&#8217;m still not 100% sold on skills being tied to weapons.  Some combinations seem very situational and others seem very balanced with no real need to weapon swap at all  (e.g. Greatsword with the Guardian).  I wonder if getting rid of the auto-attack for another skill would help even out some of the weapon sets (while moving the auto-attack to an innate ability).  The  Elementalist however was great with it&#8217;s wide selection of skills regardless of weapon.</p>
<p><a href="http://project-2501.net/gallery/guildwars2/20120429_gw002.jpg"><img src="http://project-2501.net/gallery/guildwars2/thumb/20120429_gw002.jpg"></a></p>
<p>I was surprised at the personal stories, I was expecting a separate story for each race will little flavour quests based on your character questions, but while levelling with another Norn we had completely different stories through out the BWE (last quest was level 18).</p>
<p>However, the pacing of the personal stories seemed a little odd, it was very hard to keep up in level if you just stayed in your races zones  (even if you did ever heart/event/POI/etc).  Going to another zone for a while was a simple solution but not really intuitive.  I wonder if it would be better if their personal quests made you explore (or at least travel) to other zones?</p>
<p><a href="http://project-2501.net/gallery/guildwars2/20120429_gw003.jpg"><img src="http://project-2501.net/gallery/guildwars2/thumb/20120429_gw003.jpg"></a></p>
<p>I enjoyed most hearts and events (the swamp event was pretty damn awesome).  Though with many people they turned into zergs, I think 3-6 people was the most enjoyable.</p>
<p>Overflow&#8230; Overflow and parties&#8230; I&#8217;m told it will be fixed by release.  I certainly hope so.</p>
<p>In general I thought the UI was OK.  It wasn&#8217;t very intuitive but it was functional.  I would like to see a better skill selection system, an explanation to exactly what the core stats do, and a guild panel that makes sense  (I&#8217;m still not sure if you invite a character or an account).</p>
<p><a href="http://project-2501.net/gallery/guildwars2/20120429_gw005.jpg"><img src="http://project-2501.net/gallery/guildwars2/thumb/20120429_gw005.jpg"></a></p>
<p>Not sold on the Gem store either.  Most things in there I didn&#8217;t mind, but some of the boosts and things like bag slots irked me a little.  Maybe with the Gold → Gem conversion is won&#8217;t be that bad.</p>
<p>Crafting was way too complicated, I can see what they were going for, but there&#8217;s just too many intermediate items and crafting materials.</p>
<p>That&#8217;s it for now, I&#8217;m sure I&#8217;ll update as more things come to mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2012/04/guildwars-2-bwe-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guild Wars Hall of Monuments</title>
		<link>http://project-2501.net/index.php/2012/02/guild-wars-hall-of-monuments/</link>
		<comments>http://project-2501.net/index.php/2012/02/guild-wars-hall-of-monuments/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 10:05:31 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=417</guid>
		<description><![CDATA[Today, over six years after I first played Guild Wars I&#8217;ve achieved 30/50 points in the Hall of Monuments. Monument Collection (Text)]]></description>
			<content:encoded><![CDATA[<p>Today, over six years after I first played <a href="http://en.wikipedia.org/wiki/Guild_Wars">Guild Wars</a> I&#8217;ve achieved 30/50 points in the <a href="http://hom.guildwars2.com">Hall of Monuments</a>.</p>
<p><a href="http://project-2501.net/gallery/games/gw_hom_20120212_all.jpeg"><img src="http://project-2501.net/gallery/games/gw_hom_20120212_thumb.jpeg"></a></p>
<p><a href="http://project-2501.net/gallery/games/gw_hom_20120212_collection.png">Monument Collection (Text)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2012/02/guild-wars-hall-of-monuments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Post-Increment Variable Bug</title>
		<link>http://project-2501.net/index.php/2011/11/post-increment-variable-bug/</link>
		<comments>http://project-2501.net/index.php/2011/11/post-increment-variable-bug/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 10:38:06 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=404</guid>
		<description><![CDATA[Found this little bug today in some old (untested code). I was amused that the code would have worked using pre-increment operator (and yet, still been wrong). # Simplified example, in the original code this was 3 lines long # Assume use_record_map = false; record_id = &#40;use_record_map&#41; ? lookup_record_id&#40;foo&#41; : record_id++; Pythons lack of ++ [...]]]></description>
			<content:encoded><![CDATA[<p>Found this little bug today in some old (untested code).  I was amused that the code would have worked using pre-increment operator (and yet, still been wrong).</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># Simplified example, in the original code this was 3 lines long</span><br />
<span style="color: #808080; font-style: italic;"># Assume use_record_map = false;</span><br />
record_id <span style="color: #66cc66;">=</span> <span style="color: black;">&#40;</span>use_record_map<span style="color: black;">&#41;</span> ? lookup_record_id<span style="color: black;">&#40;</span>foo<span style="color: black;">&#41;</span> : record_id++<span style="color: #66cc66;">;</span></div></div>
<p>Pythons lack of ++ / &#8212; operators makes a little more sense now (one extra character in exchange for removing several type of bugs.  Even if they are rather obvious bugs).</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2011/11/post-increment-variable-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Car :)</title>
		<link>http://project-2501.net/index.php/2011/10/new-car/</link>
		<comments>http://project-2501.net/index.php/2011/10/new-car/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 11:27:21 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=405</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://project-2501.net/gallery/other/falcon-xt.jpeg"><img src="http://project-2501.net/gallery/.thumbs/gallery_other_falcon-xt.jpeg.jpeg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2011/10/new-car/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guild Wars: E/Me Vaettir Farm</title>
		<link>http://project-2501.net/index.php/2011/10/guild-wars-eme-vaettir-farm/</link>
		<comments>http://project-2501.net/index.php/2011/10/guild-wars-eme-vaettir-farm/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 03:14:28 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=397</guid>
		<description><![CDATA[E/Me Obsidian Flesh Vaettir Farm (HM) Skills OgVFI7QIlMPkLo0n2wXlBgMwSgWF Elemental Lord (Optional) Glyph of Swiftness Obsidian Flesh Stoneflesh Aura Mantra of Earth Wastrel&#8217;s Worry Arcane Echo Storm Djinn&#8217;s Haste (Optional) Attributes 12 + 3 + 1 Earth Magic 3 + 1 Energy Storage 4 Air Magic 4 Inspiration Magic 11 Domination Weapon +20% Enchantment length Armor [...]]]></description>
			<content:encoded><![CDATA[<p><object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/ygLy1Ebh-7s?version=3&#038;feature=oembed"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ygLy1Ebh-7s?version=3&#038;feature=oembed" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<blockquote><p>
E/Me Obsidian Flesh Vaettir Farm (HM)</p>
<p><strong>Skills</strong></p>
<p>OgVFI7QIlMPkLo0n2wXlBgMwSgWF</p>
<p>Elemental Lord (Optional)<br />
Glyph of Swiftness<br />
Obsidian Flesh<br />
Stoneflesh Aura<br />
Mantra of Earth<br />
Wastrel&#8217;s Worry<br />
Arcane Echo<br />
Storm Djinn&#8217;s Haste (Optional)</p>
<p><strong>Attributes</strong></p>
<p>12 + 3 + 1 Earth Magic<br />
3 + 1 Energy Storage<br />
4 Air Magic<br />
4 Inspiration Magic<br />
11 Domination</p>
<p><strong>Weapon</strong></p>
<p>+20% Enchantment length</p>
<p><strong>Armor</strong></p>
<p>5x Geomancer Runes (I think you can get away with a +10 earth shield instead)<br />
Sup Earth Magic<br />
Minor Energy Storage</p>
<p><strong>Notes</strong></p>
<ul>
<li>If you get attacked by the Wurm in Bjora Marches, just put up Obsidian Flesh right away and you&#8217;ll be fine</li>
<li>When you have all 60 mobs drag them in between the building + wall to stop them scattering</li>
<li>Be careful not to let them body block you</li>
<li>Elemental Lord isn&#8217;t required, and only gives you an extra 1s on Obsidian flesh.</li>
<li>A faster, nicer A/Me run can be found here: <a href="http://www.youtube.com/watch?v=zZ1h2GoOpag">http://www.youtube.com/watch?v=zZ1h2GoOpag</a></li>
</ul>
<p>Recorded 2011-10-12
</p></blockquote>
<p>In other news, currently at <a href="http://hom.guildwars2.com/en/#page=main&#038;details=kMEAA8%2F%2F%2F%2FDAgQAAAgHAAAAAAAIAAAAAYGEQAAAAAAA&#038;todo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA">29/50 points in the Hall of Monuments</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2011/10/guild-wars-eme-vaettir-farm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Guild Wars: Capturing a Black Widow spider</title>
		<link>http://project-2501.net/index.php/2011/09/guild-wars-capturing-a-black-widow-spider/</link>
		<comments>http://project-2501.net/index.php/2011/09/guild-wars-capturing-a-black-widow-spider/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 12:18:37 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=392</guid>
		<description><![CDATA[Some more random Fraps footage this time from Guild Wars. Been busy getting points in the Hall of Monuments. Nothing impressive, but I had never done much end-game content, and maybe it will help save someone else some gold after seeing how easy it is. I took 6 heros: Three Discordway Necros, Prot Monk, Panic [...]]]></description>
			<content:encoded><![CDATA[<p>Some more random Fraps footage this time from Guild Wars.  Been busy getting points in the <a href="http://hom.guildwars2.com/en/#page=main&#038;details=AIEAA8%2F%2F%2F%2FDAgQAAAgHAAAAAAAIAAAAAOGEQAAAAAAA&#038;todo=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA">Hall of Monuments.</a></p>
<p><object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/fWgBXKqAp84?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/fWgBXKqAp84?version=3" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<blockquote>
<p>
Nothing impressive, but I had never done much end-game content, and maybe it will help save someone else some gold after seeing how easy it is.
</p>
<p>
I took 6 heros: Three Discordway Necros, Prot Monk, Panic Mesmer and a SoS Ritulist. Ump came with me on his Barrage Ranger, and I had some stupid Ele/R spec (with unspent points&#8230;).
</p>
<p>
The entire run took less than 30 minutes and I&#8217;m sure if you had a real build and knew where you were going, it would be very fast.
</p>
<p><strong>Walk-through:</strong></p>
<ul>
<li>Clear out the spawn area without accepting any quests</li>
<li>Take the Clear the Chamber quest from the spawn area and clear out the new mobs</li>
<li>Head north/west and take out all the mobs on the way</li>
<li>Talk to the Reaper of the Labyrinth and take the quest Restoring Grenth&#8217;s Monuments</li>
<li>Head south until you reach the Reaper of the Forgotten Vale </li>
<li>Clear out any nearby Coldfire Nights to the north</li>
<li>Take the quest Wrathful Spirits and kill all the Wrathful Spirits (Making sure not to let the Mayor die)</li>
<li>Hand in the quest and capture your spider (remember to flag the Heros well away from you, or they&#8217;ll kill the spider as you start to charm it)</li>
</ul>
<p>
Recorded 2011-09-20
</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2011/09/guild-wars-capturing-a-black-widow-spider/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Diablo 2 Fun</title>
		<link>http://project-2501.net/index.php/2011/08/diablo-2-fun/</link>
		<comments>http://project-2501.net/index.php/2011/08/diablo-2-fun/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 14:40:06 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=380</guid>
		<description><![CDATA[Just some fraps footage I had on my HDD taking up space I follow Umpa around as he kills Lilith, Uber Izual, Uber Duriel, Uber Mephisto, Uber Baal and finally Pandemonium Diablo. Recorded 2nd July 2011 US West Ladder My Character]]></description>
			<content:encoded><![CDATA[<p>Just some fraps footage I had on my HDD taking up space <img src='http://project-2501.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/N0xCwZpN45Q?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/N0xCwZpN45Q?version=3" type="application/x-shockwave-flash" width="560" height="340" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<blockquote><p>I follow Umpa around as he kills Lilith, Uber Izual, Uber Duriel, Uber Mephisto, Uber Baal and finally Pandemonium Diablo.</p>
<p>Recorded 2nd July 2011</p>
<p>US West Ladder</p>
<p><a href="http://project-2501.net/gallery/games/diablo2%20hammerdin%2020110827.png">My Character</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2011/08/diablo-2-fun/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Roman Numerals</title>
		<link>http://project-2501.net/index.php/2011/08/roman-numerals/</link>
		<comments>http://project-2501.net/index.php/2011/08/roman-numerals/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 10:00:13 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=363</guid>
		<description><![CDATA[From reddit.com/r/programingchallenges: I googled this and I haven&#8217;t found a similar challenge, so I&#8217;d like to pose this question to you all! Let&#8217;s say I give you a range from 1 to 2000. Within this range, find the number that yields the most characters. I asked a friend of mine and he worked out that [...]]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://www.reddit.com/r/programingchallenges/comments/i1m62/challenge_find_the_number_in_a_given_range_that/">reddit.com/r/programingchallenges</a>:</p>
<blockquote><p> I googled this and I haven&#8217;t found a similar challenge, so I&#8217;d like to pose this question to you all!<br />
Let&#8217;s say I give you a range from 1 to 2000. Within this range, find the number that yields the most characters. I asked a friend of mine and he worked out that 1888 has a lot of characters (MDCCCLXXXVIII).</p></blockquote>
<p><Strong>Solution</strong></p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span><br />
<br />
SYMBOLS <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'M'</span><span style="color: #66cc66;">,</span> &nbsp; <span style="color: #ff4500;">1000</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'CM'</span><span style="color: #66cc66;">,</span> &nbsp;<span style="color: #ff4500;">900</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'D'</span><span style="color: #66cc66;">,</span> &nbsp; <span style="color: #ff4500;">500</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'CD'</span><span style="color: #66cc66;">,</span> &nbsp;<span style="color: #ff4500;">400</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'C'</span><span style="color: #66cc66;">,</span> &nbsp; <span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'XC'</span><span style="color: #66cc66;">,</span> &nbsp;<span style="color: #ff4500;">90</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'L'</span><span style="color: #66cc66;">,</span> &nbsp; <span style="color: #ff4500;">50</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'XL'</span><span style="color: #66cc66;">,</span> &nbsp;<span style="color: #ff4500;">40</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'X'</span><span style="color: #66cc66;">,</span> &nbsp; <span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'IX'</span><span style="color: #66cc66;">,</span> &nbsp;<span style="color: #ff4500;">9</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'V'</span><span style="color: #66cc66;">,</span> &nbsp; <span style="color: #ff4500;">5</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'IV'</span><span style="color: #66cc66;">,</span> &nbsp;<span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: #483d8b;">'I'</span><span style="color: #66cc66;">,</span> &nbsp; <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> roman_numeral<span style="color: black;">&#40;</span>number<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; roman_number <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">symbol</span><span style="color: #66cc66;">,</span> value<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">in</span> SYMBOLS:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">while</span> value <span style="color: #66cc66;">&lt;=</span> number:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; roman_number.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">symbol</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; number -<span style="color: #66cc66;">=</span> value<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">''</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>roman_number<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span><br />
<br />
<br />
start <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span><br />
<br />
pairs <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#40;</span>i<span style="color: #66cc66;">,</span> roman_numeral<span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff4500;">2000</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><br />
pairs.<span style="color: black;">sort</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> a<span style="color: #66cc66;">,</span>b: <span style="color: #008000;">cmp</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>b<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Longest roman numeral for numbers 1-2000 = %d -&gt; %s'</span> % &nbsp;\<br />
&nbsp; &nbsp; <span style="color: black;">&#40;</span>pairs<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span> pairs<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Took: %.2fsec'</span> % <span style="color: black;">&#40;</span><span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> - start<span style="color: #66cc66;">,</span><span style="color: black;">&#41;</span></div></div>
<p><strong>Output</strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Longest roman numeral for numbers 1-2000 = 1888 -&gt; MDCCCLXXXVIII<br />
Took: 0.14sec</div></div>
<p><strong>Notes</strong><br />
Turns out historically there wasn&#8217;t a strict set of rules for Roman numerals, for example IV and IIII are both valid representations of the number 4.  Only recent rules have added limits on the number of repeated characters and what values can be subtracted from other values. <a href="http://en.wikipedia.org/wiki/Roman_numerals#Reading Roman numerals">Reference</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2011/08/roman-numerals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IP Address Range PHP Class</title>
		<link>http://project-2501.net/index.php/2011/07/ip-address-range-php-class/</link>
		<comments>http://project-2501.net/index.php/2011/07/ip-address-range-php-class/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 12:00:10 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=349</guid>
		<description><![CDATA[I&#8217;m not sure how useful this piece of code really is, but it gave me the chance to write some funky PHP code (have a look at the next() method). Example usage &#60;?php // Single host: foreach&#40;new IpRange&#40;'10.10.10.10'&#41; as $ip&#41; &#123; &#160; &#160; echo $ip . &#34;\n&#34; &#125; // &#62;&#62;&#62; 10.10.10.10 // All hosts on [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure how useful this piece of code really is, but it gave me the chance to write some funky PHP code (have a look at the next() method).</p>
<h3>Example usage</h3>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Single host:</span><br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> IpRange<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'10.10.10.10'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$ip</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 10.10.10.10</span><br />
<br />
<br />
<span style="color: #666666; font-style: italic;">// All hosts on a private network:</span><br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> IpRange<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'192.168.0.1-255'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$ip</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 192.168.0.1</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 192.168.0.2</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; ...</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 192.168.0.254</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 192.168.0.255</span><br />
<br />
<br />
<span style="color: #666666; font-style: italic;">// All normal (not broadcast, or multicast) IP addresses:</span><br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> IpRange<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1-232.0-255.0-255.0-255'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$k</span> =&gt; <span style="color: #006699; font-weight: bold;">$v</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 0 =&gt; 1.0.0.0</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 1 =&gt; 1.0.0.1</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 2 =&gt; 1.0.0.2</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; ...</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 7315795 =&gt; 1.111.161.83</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; 7315796 =&gt; 1.111.161.84</span><br />
<span style="color: #666666; font-style: italic;">// &gt;&gt;&gt; etc</span><br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<h3>Source</h3>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/*<br />
<br />
&nbsp; &nbsp; Copyright (c) 2011, Matthew Davey &lt;matthewd@project-2501.net&gt;<br />
&nbsp; &nbsp; All rights reserved.<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Redistribution and use in source and binary forms, with or without<br />
&nbsp; &nbsp; modification, are permitted provided that the following conditions are met:<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Redistributions of source code must retain the above copyright notice,<br />
&nbsp; &nbsp; &nbsp; &nbsp; this list of conditions and the following disclaimer.<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Redistributions in binary form must reproduce the above copyright<br />
&nbsp; &nbsp; &nbsp; &nbsp; notice, this list of conditions and the following disclaimer in the<br />
&nbsp; &nbsp; &nbsp; &nbsp; documentation and/or other materials provided with the distribution.<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;<br />
&nbsp; &nbsp; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br />
&nbsp; &nbsp; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br />
&nbsp; &nbsp; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE<br />
&nbsp; &nbsp; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br />
&nbsp; &nbsp; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br />
&nbsp; &nbsp; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br />
&nbsp; &nbsp; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br />
&nbsp; &nbsp; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br />
&nbsp; &nbsp; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br />
&nbsp; &nbsp; POSSIBILITY OF SUCH DAMAGE.<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; */</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/*<br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; IpRange Class<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Given an IP address where each octet can either be a number between 0 and<br />
&nbsp; &nbsp; 255, or a range i.e. 100-200. &nbsp;Return an iterable object that returns all<br />
&nbsp; &nbsp; IP addresses in between.<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Examples<br />
&nbsp; &nbsp; --------<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Single host:<br />
&nbsp; &nbsp; &nbsp; &nbsp; foreach(new IpRange('10.10.10.10') as $ip)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $ip . &quot;\n&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 10.10.10.10<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; All hosts on a private network:<br />
&nbsp; &nbsp; &nbsp; &nbsp; foreach(new IpRange('192.168.0.1-255') as $ip)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $ip . &quot;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 192.168.0.1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 192.168.0.2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; ...<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 192.168.0.254<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 192.168.0.255<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; All normal (not broadcast, or multicast) IP addresses:<br />
&nbsp; &nbsp; &nbsp; &nbsp; foreach(new IpRange('1-232.0-255.0-255.0-255') as $key =&gt; $value)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;$key =&gt; $value\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 0 =&gt; 1.0.0.0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 1 =&gt; 1.0.0.1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 2 =&gt; 1.0.0.2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; ...<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 7315795 =&gt; 1.111.161.83<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; 7315796 =&gt; 1.111.161.84<br />
&nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt;&gt; etc<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; */</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">class</span> IpRange implements Iterator<br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$count</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Current position, used as the key</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$a</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// ranges for each octet, l =&gt; low, h =&gt; high</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$b</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$c</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Most significant to least is aaa.bbb.ccc.ddd</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$d</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$ca</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// current value of a</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$cb</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// current value of b</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$cc</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// current value of c</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$cd</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// current value of d</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$isValid</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// flag set when next() is call at end of ranges</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#^(\d+|\d+-\d+)\.(\d+|\d+-\d+)\.(\d+|\d+-\d+)\.(\d+|\d+-\d+)$#'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> InvalidArgumentException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Invalid format. &nbsp;Each octet should either be a number between 0 and 255, or a range &quot;40-120&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Parse each octet and find the low/high values (high === low if there is no range specified)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$position</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$range</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$range</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'-'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$low</span><span style="color: #339933;">,</span> <span style="color: #000088;">$high</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$range</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$low</span><span style="color: #339933;">,</span> <span style="color: #000088;">$high</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$range</span><span style="color: #339933;">,</span> <span style="color: #000088;">$range</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Check the IP address is at least mostly valid. &nbsp;We don't need to check for &lt;0 as our regex will reject it first.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$high</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> InvalidArgumentException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Invalid IP address. &nbsp;The octet '<span style="color: #006699; font-weight: bold;">$high</span>' cannot be greater than 255&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// If given a range like 255-0, flip the high/low value over</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$low</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$high</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$high</span><span style="color: #339933;">,</span> <span style="color: #000088;">$low</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$low</span><span style="color: #339933;">,</span> <span style="color: #000088;">$high</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$position</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'l'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$low</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'h'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$high</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #990000;">rewind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">current</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$this-&gt;ca}</span>.<span style="color: #006699; font-weight: bold;">{$this-&gt;cb}</span>.<span style="color: #006699; font-weight: bold;">{$this-&gt;cc}</span>.<span style="color: #006699; font-weight: bold;">{$this-&gt;cd}</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #990000;">count</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">rewind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ca</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'l'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cb</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">b</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'l'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cc</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">c</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'l'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cd</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">d</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'l'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #990000;">count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isValid</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> valid<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isValid</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #990000;">count</span><span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Least significant to most. &nbsp;Null is our guard.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$position</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Check if unable to generate the next IP address</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$position</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isValid</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Check if the value is less than the maximum for this </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// position, if so increment the value and stop. &nbsp;Otherwise set</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// this position to its lowest value, and continue onto the next</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// highest position.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;c<span style="color: #006699; font-weight: bold;">$position</span>&quot;</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$position</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'h'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;c<span style="color: #006699; font-weight: bold;">$position</span>&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;c<span style="color: #006699; font-weight: bold;">$position</span>&quot;</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$position</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'l'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2011/07/ip-address-range-php-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (Requested URI is rejected)
Database Caching using disk
Object Caching 829/829 objects using disk

Served from: project-2501.net @ 2012-05-20 05:47:03 -->
