<?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>CaptainCodeMonkey.com - All Your Booty Are Belong To Us!</title>
	<atom:link href="http://www.captaincodemonkey.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.captaincodemonkey.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 24 Aug 2010 14:26:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MODX Force SSL On A Specific Page</title>
		<link>http://www.captaincodemonkey.com/blog/2010/08/24/modx-force-ssl-on-a-specific-page/</link>
		<comments>http://www.captaincodemonkey.com/blog/2010/08/24/modx-force-ssl-on-a-specific-page/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 14:16:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/?p=621</guid>
		<description><![CDATA[Add the below as a snippet, and include it BEFORE any output can happen on the page. ?View Code PHP&#60;?php if&#40;$_SERVER&#91;&#34;HTTPS&#34;&#93; != &#34;on&#34;&#41; &#123; header&#40;&#34;HTTP/1.1 301 Moved Permanently&#34;&#41;; header&#40;&#34;Location: https://&#34;.$_SERVER&#91;&#34;SERVER_NAME&#34;&#93;.$_SERVER&#91;&#34;REQUEST_URI&#34;&#93;&#41;; exit&#40;&#41;; &#125; ?&#62;]]></description>
			<content:encoded><![CDATA[<p>Add the below as a snippet, and include it BEFORE any output can happen on the page.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p621code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6212"><td class="code" id="p621code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTPS&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;on&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;HTTP/1.1 301 Moved Permanently&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: https://&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;SERVER_NAME&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REQUEST_URI&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2010/08/24/modx-force-ssl-on-a-specific-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter; Not Your Average Storm App</title>
		<link>http://www.captaincodemonkey.com/blog/2010/05/01/twitter-not-your-average-storm-app/</link>
		<comments>http://www.captaincodemonkey.com/blog/2010/05/01/twitter-not-your-average-storm-app/#comments</comments>
		<pubDate>Sat, 01 May 2010 22:43:01 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Internet - General]]></category>
		<category><![CDATA[Technology - Cell Phones]]></category>
		<category><![CDATA[Technology - General]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/?p=584</guid>
		<description><![CDATA[Last night was a first for me, and I presume a few others. Around 1:00pm, the National Weather Service began issuing Severe Weather Storm warnings throughout my old stomping grounds back in Northeast Arkansas and up into Missouri. Having witnessed many tornadoes growing up in Lake City, Pocahontas and Jonesboro Arkansas, I knew just how [...]]]></description>
			<content:encoded><![CDATA[<p>Last night was a first for me, and I presume a few others.</p>
<p>Around 1:00pm, the National Weather Service began issuing Severe Weather Storm warnings throughout my old stomping grounds back in Northeast Arkansas and up into Missouri.</p>
<p>Having witnessed many tornadoes growing up in Lake City, Pocahontas and Jonesboro Arkansas, I knew just how bad things could get, and fast.</p>
<p>One particular tweet caught my eye:</p>
<blockquote><p> geeksmakemehot: Sirens going off in Pocahontas</p></blockquote>
<p>I responded, asking for clarification. Back during WWII, Air-Raid sirens were installed by the federal government all over the nation, but many local principalities assumed their upkeep after the war and use them to warn the populace of particularly damaging storms. These days, we refer to them as &#8220;Tornado Sirens&#8221; or just &#8220;Sirens&#8221;; everyone knows what they mean: Duck!</p>
<p>It took @geeksmakemehot a bit to update her status, so while I was waiting, I popped over to the weather channel and made a quick search for &#8220;Pocahontas Arkansas&#8221;. Sure enough, a massive storm leading from as far south as Newport and as far north as the state line (and beyond) was slowly marching on my home grounds.</p>
<p>After tweeting as much data as I could, hoping to get updates from my friends back home, I noticed this tweet:</p>
<blockquote><p>merlincam This is what makes twitter special #arwx @cottonr @tsudo</p></blockquote>
<p>Ahh, a hastag! I popped over to twitter search, damning myself for having dumped TweetDeck, which would have automated the search for me, I typed in &#8220;arwx&#8221; and was surprised by the volume of tweets.</p>
<p>Most of the #ARWX tweets up to that point were personal updates:</p>
<blockquote><p>chrislmarsh Good news! #ARwx Trees down on roof in East End area. My in-laws have no power right now. But everyone is OK. Thankfully!! /via @ghidotti</p></blockquote>
<p>And from there, things actually went professional as the local weathermen got into the mix and began updating weather alerts and advisories. With power out over much of the area, some of the folks only had twitter to turn to for sources of information:</p>
<blockquote><p>nick_b_jones Just lost cable on Bryant. Now totally dependent on #arwx on Twitter for weather updates.</p></blockquote>
<p>I called my Mom back home and asked about her, she told me that it was raining, but only a commercial was on TV, so she wasn&#8217;t worried. I told her what I had learned so far and she interrupted me as a Severe Weather Alert began scrolling across the screen. Twitter had actually beaten her local weather team to the punch, for a change!</p>
<p>With lightning and thunder rocking the house, Mom wasn&#8217;t able to stay on the phone, but she promised to stay in touch as much as possible and hung up.</p>
<p>More twitter updates began to filter in, with a few people asking for more information. I quickly jotted back to the Weather Channel&#8217;s page on the storm and began tweeting what I learned, but the quality of my tweets was nothing compared to the concerned weather man @wxmandan, a meterologist out of Little Rock, Arkansas.</p>
<p>@wxmandan, whose real name is Dan Koch, stayed up with us until the wee hours of the morning, keeping us informed and relaying helpful bits of advice. If he said to take cover, you can bet these folks back home were rushing off to their safe places.</p>
<p>As the storm left the immediate area, Mom got in touch with me (via twitter of course) to let me know everyone there was safe. She also mentioned there was a rumor going around that someone in Pocahontas had been struck by lightning.</p>
<p>I asked the folks on the #ARWX feed about it and got this in reply:</p>
<blockquote><p>StanMorris @ShanePLee Just sent a text to Randolph Sheriff Tribble asking him. Will report/tweet if that is the case.</p></blockquote>
<p>A few minutes later:</p>
<blockquote><p>StanMorris Randolph County Sheriff Tribble says no one struck by lightening in Pocahontas&#8230;a barn was struck that did catch fire. #arwx @ShanePLee</p></blockquote>
<p>Not long after, things began settling down and I headed off to bed. With my phone. Keeping up with #ARWX, of course.</p>
<p>At this point, the majority of the incoming tweets were folks saying thanks to everyone for keeping them informed.</p>
<p>Now, in case you think this was all trivial stuff, I would like to point out that, during this time, 3 people were killed and 23 injured by tornadoes in the area. My heart goes out to the families of those who were taken and injured.</p>
<p>My only consolation is that perhaps it could have been worse, except for a wonderful group of people getting together in a social media platform and keeping each other updated on the latest storm data.</p>
<p>I would love to write more about the whole experience, but we are getting new messages in right now, calling for a new batch of storms over the same area. So pop by and experience this amazing expression of human kindness over at the #ARWX feed on twitter!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2010/05/01/twitter-not-your-average-storm-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>mod_rewrite to force www redirect index.php to domain</title>
		<link>http://www.captaincodemonkey.com/blog/2010/02/28/mod_rewrite-to-force-www-redirect-index-php-to-domain/</link>
		<comments>http://www.captaincodemonkey.com/blog/2010/02/28/mod_rewrite-to-force-www-redirect-index-php-to-domain/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 04:18:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming - General]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/?p=436</guid>
		<description><![CDATA[Here is a quick mod_rewrite example that forces www and redirects index.php to / (this fixes two canonicalization issues at one time). ?View Code PHPRewriteEngine on RewriteCond %&#123;HTTP_HOST&#125; !^www.site.com$ RewriteRule ^/&#40;.*&#41;$ http://www.site.com/$1 [R=301] RewriteRule ^/index\.php$ http://www.site.com/ [R=301,L]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick mod_rewrite example that forces www and redirects index.php to / (this fixes two canonicalization issues at one time).</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p436code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4364"><td class="code" id="p436code4"><pre class="php" style="font-family:monospace;">RewriteEngine on
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>HTTP_HOST<span style="color: #009900;">&#125;</span> <span style="color: #339933;">!</span>^www<span style="color: #339933;">.</span>site<span style="color: #339933;">.</span>com$
RewriteRule ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$ http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.site.com/$1 [R=301]</span>
RewriteRule ^<span style="color: #339933;">/</span>index\<span style="color: #339933;">.</span>php$ http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.site.com/ [R=301,L]</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2010/02/28/mod_rewrite-to-force-www-redirect-index-php-to-domain/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Old Lady With Bag On Her Head</title>
		<link>http://www.captaincodemonkey.com/blog/2010/02/21/old-lady-with-bag-on-her-head/</link>
		<comments>http://www.captaincodemonkey.com/blog/2010/02/21/old-lady-with-bag-on-her-head/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 01:03:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/?p=434</guid>
		<description><![CDATA[Old lady with bag on her head&#8230;. The crux of the whole thing is that she has an umbrella in her hand.. so why the bag old lady? Why??!!]]></description>
			<content:encoded><![CDATA[<p>Old lady with bag on her head&#8230;. </p>
<p>The crux of the whole thing is that she has an umbrella in her hand.. so why the bag old lady? Why??!! <a href="http://www.captaincodemonkey.com/blog/wp-content/uploads/2010/02/photo.jpg"><img src="http://www.captaincodemonkey.com/blog/wp-content/uploads/2010/02/photo-300x225.jpg" alt="" title="Old Lady With Bag On Her Head" width="300" height="225" class="alignleft size-medium wp-image-433" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2010/02/21/old-lady-with-bag-on-her-head/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP Code Get Most Recent WordPress Post</title>
		<link>http://www.captaincodemonkey.com/blog/2010/01/24/php-code-get-most-recent-wordpress-post/</link>
		<comments>http://www.captaincodemonkey.com/blog/2010/01/24/php-code-get-most-recent-wordpress-post/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 03:25:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[Programming - General]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/?p=420</guid>
		<description><![CDATA[PHP Code Get Most Recent WordPress Post﻿ This is a quick example using only vanilla PHP.  There are more dynamic ways to do this using RSS classes built into PHP addons, which I won&#8217;t go into detail here.  Instead, we will just use vanilla PHP, and parse the XML by hand. On to the code, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>PHP Code Get Most Recent WordPress Post﻿</strong></p>
<p>This is a quick example using only vanilla PHP.  There are more dynamic ways to do this using RSS classes built into PHP addons, which I won&#8217;t go into detail here.  Instead, we will just use vanilla PHP, and parse the XML by hand.</p>
<p>On to the code, I take 3 arguments here, number of posts to return, the RSS URL, and an optional max number of characters to return.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p420code7'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4207"><td class="code" id="p420code7"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//get most recent rss</span>
<span style="color: #666666; font-style: italic;">//get most recent rss</span>
<span style="color: #000000; font-weight: bold;">function</span> recent_rss<span style="color: #009900;">&#40;</span><span style="color: #000088;">$display</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$url</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$description_limit</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$itemArr</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$doc</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'item'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$display</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//if limit passed in, truncate string</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$description_limit</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$description</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$description_limit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;...&quot;</span><span style="color: #339933;">;</span> 	
	<span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000088;">$itemRSS</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a> <span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'title'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$description</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'link'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'pubdate'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pubDate'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
         <a href="http://www.php.net/array_push"><span style="color: #990000;">array_push</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$itemArr</span><span style="color: #339933;">,</span> <span style="color: #000088;">$itemRSS</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$display</span><span style="color: #339933;">--;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$itemArr</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//example use</span>
<span style="color: #000088;">$recent_post</span> <span style="color: #339933;">=</span> recent_rss<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'http://houseplansblog.nelsondesigngroup.com/index.php/feed/'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/var_dump"><span style="color: #990000;">var_dump</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$recent_post</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now, Here is a quick and dirty XHTML example showing how you might implement this on a page. (Note the use of the preg_replace to get rid of weird characters that get into the RSS sometimes)</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p420code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4208"><td class="code" id="p420code8"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;rss_container&quot;</span> style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width:250px;&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;rss_title&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">'&lt;?php echo $recent_post[0][&quot;link&quot;]; ?&gt;'</span><span style="color: #339933;">&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span>  <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/[^(\x20-\x7F)]*/'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$recent_post</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
		<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;rss_pub_date&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$recent_post</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;pubdate&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;rss_description&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$recent_post</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;description&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2010/01/24/php-code-get-most-recent-wordpress-post/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Letter to Windows 7</title>
		<link>http://www.captaincodemonkey.com/blog/2009/12/17/a-letter-to-windows-7/</link>
		<comments>http://www.captaincodemonkey.com/blog/2009/12/17/a-letter-to-windows-7/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 17:37:10 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/?p=407</guid>
		<description><![CDATA[Dear Windows 7, First, I want to thank you for confirming my hatred for all things that slink out of Redmond, Washington, you have my gratitude. For a few hours there, I really thought I was going to bury the hatched with Microsoft, but then you showed me the truth and for that, I owe [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.captaincodemonkey.com/blog/wp-content/uploads/2009/12/windows-7-logo-150x150.jpg" alt="windows-7-logo" title="windows-7-logo" width="150" height="150" class="aligncenter size-thumbnail wp-image-413" /></p>
<p>Dear Windows 7,</p>
<p>First, I want to thank you for confirming my hatred for all things that slink out of Redmond, Washington, you have my gratitude. For a few hours there, I really thought I was going to bury the hatched with Microsoft, but then you showed me the truth and for that, I owe you one.<br />
<span id="more-407"></span></p>
<p>After you finally installed (and what took so long, were you on the phone with your Grandmother? Sheesh!) I thought I was looking at Vista RC2 with a snappy task bar.</p>
<p>The new taskbar was pretty neat, keeping all the instances together under one icon and letting me &#8220;pin&#8221; it there as a shortcut for the future. But then I realized something horrible; I have no control over this taskbar! My two-year old daughter is easier to control than this taskbar!</p>
<p>Unlike the taskbars in KDE, I can&#8217;t re-size you the way I want, I can&#8217;t center you, I can&#8217;t even figure out how to make you semi-transparent! I would forgive you that, if you could do the snappy things that the Mac&#8217;s taskbar does, but you don&#8217;t even seem to be giving it any effort at all!</p>
<p><img src="http://www.captaincodemonkey.com/blog/wp-content/uploads/2009/12/windows-7-desktop-300x188.jpg" alt="Windows 7" title="windows-7-desktop" width="300" height="188" class="size-medium wp-image-414" /></p>
<p>I&#8217;m not impressed with your Start menu either. Was Vista&#8217;s menu so awesome that you decided to copy it? Sorry, but it&#8217;s not that awesome.</p>
<p>Your &#8220;Search programs and files&#8221; feature looks like a nice way to cut through the clutter of the &#8220;All Programs&#8221; menu, but it&#8217;s not. I deleted the &#8220;Internet Explorer&#8221; icon (cause I really don&#8217;t like viruses, sorry!) and had to find the stupid program manually in the Programs folder in order to use your website to download an update manually. That&#8217;s not helpful at all.</p>
<p>Let&#8217;s talk for a second about the Control Panel. Was it necessary to remove a link to the Control Panel from the Desktop right-click menu? And speaking of the right-click menu, just how is it all that different from Vista?</p>
<p> Now, I know you aren&#8217;t in charge of the whole &#8220;Gadgets&#8221; feature, but who else am I to hold responsible here? You took a wonderful idea (from Mac again!) and cut the legs out from under it.</p>
<p>I mean, I love being able to find third-party gadgets online for free and all, but why couldn&#8217;t you integrate your gadgets with Google&#8217;s gadgets like everyone else? Is that a &#8220;upgrade&#8221; you have planned for later? If so, you should find something else to fix, &#8217;cause I can get Google&#8217;s stuff on my own, thank you very much.</p>
<p>Finally, I am very happy that, unlike your sister Vista, you don&#8217;t ask me a thousand times if the latest app I installed can have access to my computer, my hard drive, my internet connection and my saved passwords file (I only have one password: &#8220;God&#8221;, without the quotes of course).</p>
<p>Instead, you do have one of the most asinine habits I&#8217;ve ever encountered: I installed Hulu Desktop today. It installed fairly quickly with no warnings, but when it started to run, you stopped it and told me that it may not have installed correctly.</p>
<p>You then offered to reinstall it the right way, if I wanted. I did want, and the installation went just as smoothly as before and this time the program ran.</p>
<p>My question to you is this: Why the hell didn&#8217;t you install it correctly the first time instead of making me do it twice?!?</p>
<p>I swear, dealing with you is like trying to keep a brain-damaged monkey from humping a telephone pole; it&#8217;s frustrating and doesn&#8217;t seem to accomplish anything.</p>
<p>In the end, I wish you all the luck, but for now I think I&#8217;ll take my laptop and go see what KDE4 is up to. Bye!</p>
<p>Sincerely Yours,<br />
A Friend (NOT!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2009/12/17/a-letter-to-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ryan Seacrest is Hot!</title>
		<link>http://www.captaincodemonkey.com/blog/2009/12/09/ryan-seacrest-is-hot/</link>
		<comments>http://www.captaincodemonkey.com/blog/2009/12/09/ryan-seacrest-is-hot/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 21:59:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/2009/12/09/ryan-seacrest-is-hot/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.captaincodemonkey.com/blog/wp-content/uploads/2009/12/image_3l.png" alt="image_3l" title="image_3l" width="581" height="494" class="aligncenter size-full wp-image-405" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2009/12/09/ryan-seacrest-is-hot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intel Shows Off 48-Core CPU</title>
		<link>http://www.captaincodemonkey.com/blog/2009/12/03/intel-shows-off-48-core-cpu/</link>
		<comments>http://www.captaincodemonkey.com/blog/2009/12/03/intel-shows-off-48-core-cpu/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 21:05:33 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Computers - General]]></category>
		<category><![CDATA[Internet - General]]></category>
		<category><![CDATA[Programming - General]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Technology - General]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/?p=400</guid>
		<description><![CDATA[Intel shows off their 48-core processor; I get 48-kinds of jealous.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-380" style="float:left; padding-right:5px;" title="intel01" src="http://www.techshout.com/images/intel-logo-big-black.jpg" alt="Intel Black" width="300" height="200" />Justin Rattner, CTO of Intel revealed a brand-new chip design yesterday that he dubbed &#8220;Single-chip Cloud Computing&#8221; or SCC. A 48-core prototype was unveiled, built using Intel&#8217;s 45nm manufacturing process.<span id="more-400"></span></p>
<p>Each of the 48 cores are fully programmable and are connected via a &#8220;2-D mesh&#8221; that is capable of speeds up to 256Gb/s. It is this &#8220;mesh&#8221; that allows Intel to compare the chip to so-called &#8220;Cloud Servers&#8221; which use hardwired networks to share a workload.</p>
<p><img class="alignleft size-medium wp-image-380" style="float:left; padding-right:5px;" title="server_room" src="http://intellicomcommunications.com/SERVER%20ROOM.jpg" alt="Server Room" width="300" height="200" />One of the most important aspects of this experimental chip is the concept of &#8220;islands&#8221; that was introduced. While things get a little complicated here, let&#8217;s just point out that Intel has introduced a new concept of how power and frequency is modulated. The end result is that this chip can function on as little as 25 watts and a maximum of 125 watts at full power.</p>
<p>This can be compared to today&#8217;s dual and quad-core processors, which run at around the same wattage. That is a serious decrease in wattage compared to the increase in computing power!</p>
<p>You may be asking as to why this prototype is more important than the 80-core test chip known as the Terra Core unveiled three years ago. Well, the answer is that this &#8220;prototype&#8221; can actually be used, while the Terra Core was more a proof-of-concept.</p>
<p>The 48-Core example contains fully-functional x86 IA cores that are actually programmable. Yes, for you Linux aficionados out there, you CAN use this prototype to boot a kernel!</p>
<p><img class="alignleft size-medium wp-image-380" style="float:left; padding-right:5px;" title="hexacore" src="http://images.hardware.info/news/gulftown-chip.jpg" alt="Hexa Core" width="300" height="300" />Intel is planning to release a six-core processor next year (codenamed Gulftown), the 48-core prototype is still too expensive to manufacture commercially as yet.</p>
<p>To my friends at Intel: When you guys are done playing with your new toy, can I borrow it for a couple of years? You know, just until I can get my Mom to buy me one?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2009/12/03/intel-shows-off-48-core-cpu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Psystar vs Apple</title>
		<link>http://www.captaincodemonkey.com/blog/2009/12/02/psystar-vs-apple/</link>
		<comments>http://www.captaincodemonkey.com/blog/2009/12/02/psystar-vs-apple/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 03:31:03 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Computers - General]]></category>
		<category><![CDATA[Internet - General]]></category>
		<category><![CDATA[Politics]]></category>
		<category><![CDATA[Programming - General]]></category>
		<category><![CDATA[Rantings]]></category>
		<category><![CDATA[Technology - General]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/?p=396</guid>
		<description><![CDATA[Psystar's profit margin just took a bit hit, but why does it matter?]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-380" style="float:left; padding-right:5px;" title="psystar01" src="http://9to5mac.com/files/image/00000/psystar2_01.png" alt="Psystar Offices" width="300" height="200" />I normally take the side of the underdog. A psychology major might say this is because of an inferiority complex that is temporarily buried each time a small guy wins against the big guy.</p>
<p>The truth is, I&#8217;m a bit of an anarchist, I always have been. I visit Piratebay on a regular basis, and I don&#8217;t pay a monthly Usenet fee for the news articles. However, when it comes to the case of Psystar vs Apple, I&#8217;m all about the big guy: Apple.<span id="more-396"></span></p>
<p>For those of you who have been living on a deserted island for the past couple of years; Psystar is a so-called &#8216;Mac-Clone&#8217; retailer. They sell computers that run the latest Macintosh software.</p>
<p><img class="alignleft size-medium wp-image-380" style="float:left; padding-right:5px;" title="old_mac" src="http://rickyday.net/blog/544px-macintosh.jpg" alt="Mac OS" width="300" height="200" />It all started back in 2005 when Apple decided to start using Intel brand processors. Before this, they had pretty much locked their OS to their hardware and it was next to impossible to get it running on any other machine.</p>
<p>After the Intel switch, downloads for the Mac OS from Apple&#8217;s own download page pretty much went hysterical for a while. With a little tweaking, anyone could have a Mac on the cheap.</p>
<p>At average prices somewhere between 2 to 3 times higher than PCs, Macs have always been one of the most expensive personal and business computing solutions available. After the switch, Apple was able to offer cheaper hardware, but the catch was that their proprietary system was now open for pirating.</p>
<p><img class="alignleft size-medium wp-image-380" style="float:left; padding-right:5px;" title="not_psystar" src="http://www.wired.com/images_blogs/photos/uncategorized/2008/04/16/no_psystar.jpg" alt="Not Psystar" width="300" height="200" />Then came Psystar, they started selling Mac clones straight from their website, believing that they had found a flaw in Apple&#8217;s Terms of Use for the operating system.</p>
<p>It turns out, they really just thought that Apple&#8217;s terms were unenforceable. Their whole legal position was based on the fact that they never thought a judge would side with Apple, based soley on the grammar they used when writing their TOU.</p>
<p><img class="alignleft size-medium wp-image-380" style="float:left; padding-right:5px;" title="steve_jobs" src="http://cache.gizmodo.com/assets/images/4/2008/12/steve-jobs-psystar.jpg" alt="Godfather Steve" width="300" height="200" />Now, we hear that Psystar settled with Apple for the princely sum of $2.7 million (US). If, as they reported, they have to date sold 768 clones, this means that Psystar has promised to pay a little over $3,000 (US) for each unit sold.</p>
<p>Okay, so maybe I don&#8217;t understand the math that Psystar is using to justify themselves to their stockholders, but it looks to me as if they are in serious trouble, financially.</p>
<p>Legally, the settlement came with a clause that says Psystar won&#8217;t be paying anything until all appeals are finished. Which could take several years. In this way, they were able to stop Apple&#8217;s Cease-And-Desist request to the judge and continue to sell their products.</p>
<p>Psystar is now claiming to be selling Mac-Ready PCs, without the OS. Purchasers will be able to download their own copies of the Operating System and install it manually. This of course could never catch on, but then only selling 768 units to begin with is not exactly stellar either.</p>
<p>The good news is that Apple finally seems to be making progress with protecting their property. Technically a hardware company since its inception, Apple has constantly worked to produce an operating system that will take full advantage of the latest hardware available.</p>
<p><img class="alignleft size-medium wp-image-380" style="float:left; padding-right:5px;" title="empty_pockets" src="http://www.schaumburgfreedom.com/wp-content/uploads/2008/11/empty-pockets-full.jpg" alt="Empty Pockets" width="300" height="200" />To take their work, which is basically offered for free to Macintosh owners, and try to make a profit from it is just this side of sleazy. Psystar can tell their shareholders whatever they want, but as of now, they don&#8217;t have a chance in hell of pulling a profit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2009/12/02/psystar-vs-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nokia Sues LCD Manufacturers</title>
		<link>http://www.captaincodemonkey.com/blog/2009/12/01/nokia-sues-lcd-manufacturers/</link>
		<comments>http://www.captaincodemonkey.com/blog/2009/12/01/nokia-sues-lcd-manufacturers/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 13:34:01 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[Computers - General]]></category>
		<category><![CDATA[Internet - General]]></category>
		<category><![CDATA[Technology - Cell Phones]]></category>
		<category><![CDATA[Technology - General]]></category>

		<guid isPermaLink="false">http://www.captaincodemonkey.com/blog/?p=392</guid>
		<description><![CDATA[Nokia has announced a lawsuit against 11 manufacturers of LCD screens, including Samsung, Toshiba, Phillips and LG, claiming that they fixed prices to keep the LCD market higher than normal market demand would have allowed.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-380" style="float:left; padding-right:5px;" title="Nokia_Final" src="http://blogs.guardian.co.uk/technology/nokia-eco-sensor-phone.jpg" alt="Nokia Eco" width="300" height="200" />Nokia has announced a lawsuit against 11 manufacturers of LCD screens, including Samsung, Toshiba, Phillips and LG, claiming that they fixed prices to keep the LCD market higher than normal market demand would have allowed.</p>
<p>In 2006, the electronics world was rocked when US regulators announced a probe into possible price fixing by the world&#8217;s leading LCD manufacturers, a probe that eventually lead to convictions against the companies, who eventually paid large fines for their actions. Several of the companies plead guilty to the crime of price fixing, though Samsung was never charged and cooperated with investigators.<br />
<span id="more-392"></span></p>
<p>Mark Durrant, a spokesman for Nokia, has stated that the company filed the suits here in the US and in the UK, against both LCD and CRT manufacturers. He noted that Nokia hoped to avoid a years-long battle and would settle out of court.</p>
<p>For the hardware manufacturers, this is a turning point in their recovery from the turndown in profits they have suffered since the initial investigation in 2006. Weathering this battle with Nokia is crucial to their continued operations.</p>
<p>Since Nokia is the undisputed champion when it comes to cell phones, this could very well be the worst thing that could happen to these companies for a long time. Even should they manage to settle this battle outside of a courtroom, they have already lost the battle with the guilty pleas in 2006, opening them up for even more lawsuits from other manufacturers in the near future.</p>
<p>Watch for Nokia&#8217;s stock to rise for a few days as copies of the lawsuits finally make it to the desks of the LCD manufacturers, but I predict a major problem for Nokia in the near future. Everyone knows they have been losing market share since the iPhone arrived to blazing angelic trumpets, but this is not the way to regain it.</p>
<p>It is a well-known ploy in the business world: If you can&#8217;t make money from sales, find someone to sue. Unfortunately, companies who sue their own suppliers soon find themselves having a hard time finding contracts with them after the smoke clears. Maybe this is just the first of the death knells from the Finnish giant.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.captaincodemonkey.com/blog/2009/12/01/nokia-sues-lcd-manufacturers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
