<?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>Adam Gotterer</title>
	<atom:link href="http://www.adamgotterer.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adamgotterer.com</link>
	<description>Find the secrets to infinite income, and automate it!</description>
	<lastBuildDate>Wed, 21 Jul 2010 02:44:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Startups Hiring</title>
		<link>http://www.adamgotterer.com/2010/07/20/startups-hiring/</link>
		<comments>http://www.adamgotterer.com/2010/07/20/startups-hiring/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 02:42:36 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[careers]]></category>
		<category><![CDATA[companies]]></category>
		<category><![CDATA[hiring]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/?p=204</guid>
		<description><![CDATA[I recently launched a startup job aggregator called Startups Hiring. It collects jobs from funded startups career pages. All links go directly to the job description on their site. There’s no recruiters to contact or pointless accounts on jobs boards to create.
If you have a startup that you want added feel free to send me [...]]]></description>
			<content:encoded><![CDATA[<p>I recently launched a startup <a href="http://www.startupshiring.com">job aggregator</a> called <a href="http://www.startupshiring.com">Startups Hiring</a>. It collects jobs from funded startups career pages. All links go directly to the job description on their site. There’s no recruiters to contact or pointless accounts on jobs boards to create.</p>
<p>If you have a startup that you want added feel free to send me a message or fill out the company <a href="http://www.startupshiring.com/add">request form</a>.</p>
<p>Check it out, tell your friends!</p>
<p><a href="http://www.startupshiring.com"><img class="size-full wp-image-208  alignleft" title="tumblr_l5vz1jtCLx1qz9yvfo1_500" src="http://www.adamgotterer.com/wp-content/uploads/2010/07/tumblr_l5vz1jtCLx1qz9yvfo1_500.png" alt="tumblr_l5vz1jtCLx1qz9yvfo1_500" width="500" height="449" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2010/07/20/startups-hiring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building an Object Collection Manager with the Standard PHP Library (SPL)</title>
		<link>http://www.adamgotterer.com/2009/10/23/building-a-php-object-collection-manager-with-spl/</link>
		<comments>http://www.adamgotterer.com/2009/10/23/building-a-php-object-collection-manager-with-spl/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 14:00:59 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Standard PHP Library]]></category>
		<category><![CDATA[ArrayAccess]]></category>
		<category><![CDATA[Collection]]></category>
		<category><![CDATA[Countable]]></category>
		<category><![CDATA[Iterator]]></category>
		<category><![CDATA[SPL]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/?p=165</guid>
		<description><![CDATA[Introduction
The purpose of a collection is to store objects in an organized manner with specific access rules. We are going to build a collection class using the Standard PHP Library (SPL). Our final product will be capable of iterating, counting and access to objects via array. If you are not familiar with SPL you can [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>The purpose of a collection is to store objects in an organized manner with specific access rules. We are going to build a collection class using the Standard PHP Library (SPL). Our final product will be capable of iterating, counting and access to objects via array. If you are not familiar with SPL you can find some additional information on the <a href="http://php.net/manual/en/book.spl.php">PHP SPL manual</a> site. Unfortunately the manual is somewhat lacking. Here is a more detailed list of <a href="http://www.php.net/~helly/php/ext/spl/">SPL classes</a>.</p>
<p>We will call our class &#8220;Collection&#8221; (original, I know). This class will eventually implement the SPL classes: ArrayAccess, Countable and Iterator. If you are unfamiliar with SPL your first reaction may be that you don&#8217;t have any of these classes in your project. The beauty of SPL is that the classes are built into PHP (compiled by default). Once you implement a class you are exposed to a series of abstract function which you must implement. Once implemented the result is the ability to manipulate objects and create functionality you wouldn&#8217;t normally be able to code.</p>
<p>First we are going to do a quick introduction to the interfaces we will be using. After that we will jump right into code and examples. Please keep in mind that the collection class we are going to build is more about demonstrating the capabilities of these particular SPL interfaces then actual practical use, although you could easily turn this into a useful class.</p>
<p><strong>ArrayAccess</strong><br />
ArrayAccess is an interface that lets you override array access of objects. Basically it lets you use an object as an array and use keys to access values stored within the class.<br />
<br />
<span style="text-decoration: underline;">Abstract Functions</span></p>
<pre>
<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">offsetExists($offset)<br />
offsetGet($offset)<br />
offsetSet($offset, $value)<br />
offsetUnset($offset)</div></div>
</pre>
<p></p>
<p><strong>Countable</strong><br />
Countable lets you hook into the global count function and override it. We are going to use it to count the number of objects in our collection.<br />
<br />
<span style="text-decoration: underline;">Abstract Functions</span></p>
<pre>
<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">count()</div></div>
</pre>
<p></p>
<p><strong>Iterator</strong><br />
Iterator allows you to iterator over an object. In our example you will be able to directly loop over a collection and return the objects that are stored.<br />
<br />
<span style="text-decoration: underline;">Abstract Functions</span></p>
<pre>
<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">current()<br />
key()<br />
next()<br />
rewind()<br />
valid()</div></div>
</pre>
<h2>Implementation</h2>
<p>The first thing we need to do is define our class. It should look something like this:</p>
<pre>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><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 />
<span style="color: #000000; font-weight: bold;">class</span> collection <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
</pre>
<p></p>
<p>Next we will define a constructor and a private variable called $object that will store the objects we pass into this collection. The constructor will be one way to populate the collection.</p>
<pre>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><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;">class</span> collection <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$objects</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; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$objects</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 />
<span style="color: #009900;">&#125;</span></div></div>
</pre>
<p></p>
<p>At this point our class doesn&#8217;t do much but take an array of objects and store then in the class. Next we will implement the SPL classes we discussed earlier.</p>
<p><strong>Implement ArrayAccess</strong></p>
<pre>
<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;">class</span> collection implements ArrayAccess <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$objects</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; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #339933;">...</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/** ABSTRACT SPL ArrayAcess **/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> final <span style="color: #000000; font-weight: bold;">function</span> offsetExists<span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</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 />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> final <span style="color: #000000; font-weight: bold;">function</span> offsetGet<span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> final <span style="color: #000000; font-weight: bold;">function</span> offsetSet<span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</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 />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> final <span style="color: #000000; font-weight: bold;">function</span> offsetUnset<span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// End ArrayAccess Abstraction</span><br />
<span style="color: #009900;">&#125;</span></div></div>
</pre>
<p></p>
<p><strong>Implement Countable</strong><br />
Countable is really simple to implement and only requires one function. There is an interesting note in the code comment that you should make note of.</p>
<pre>
<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;">class</span> collection implements ArrayAccess<span style="color: #339933;">,</span> Countable <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$objects</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 />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #339933;">...</span> <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/** ABSTRACT SPL ArrayAcess **/</span><br />
&nbsp; &nbsp; <span style="color: #339933;">...</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// End ArrayAccess Abstraction</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/** ABSTRACT SPL Countable **/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Note from PHP manual: If var is not an array or an object with </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// implemented Countable interface, 1 will be returned.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Not sure why it returns one, but we need to make sure our </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// count is right and returns zero when there are no objects</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</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; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// End Countable Abstraction</span></div></div>
</pre>
<p></p>
<p><strong>Implement Iterator</strong></p>
<pre>
<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;">class</span> collection implements ArrayAccess<span style="color: #339933;">,</span> Countable<span style="color: #339933;">,</span> Iterator <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$objects</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; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #339933;">...</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/** ABSTRACT SPL ArrayAcess **/</span><br />
&nbsp; &nbsp; <span style="color: #339933;">...</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// End ArrayAccess Abstraction</span><br />
<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/** ABSTRACT SPL Countable **/</span><br />
&nbsp; &nbsp; <span style="color: #339933;">...</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// End Countable Abstraction</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/** ABSTRACT SPL Iterator **/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">current</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">current</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</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; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">next</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</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: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">rewind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">reset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</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: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> valid<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">current</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// END Iterator Abstraction</span><br />
<span style="color: #009900;">&#125;</span></div></div>
</pre>
<h2>Final Collection</h2>
<p>Our completed class isnt all that complicated. But its extremely powerful if used the right way. Hopefully you were able to follow along and understand what we have built. The final code is posted below as well as a test case in the next section. I recommend running the test to really see what the class is capable of doing.</p>
<pre>
<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: #000000; font-weight: bold;">class</span> collection implements ArrayAccess<span style="color: #339933;">,</span> Countable<span style="color: #339933;">,</span> Iterator <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$objects</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; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$objects</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 />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/** ABSTRACT SPL ArrayAcess **/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> final <span style="color: #000000; font-weight: bold;">function</span> offsetExists<span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</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 />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> final <span style="color: #000000; font-weight: bold;">function</span> offsetGet<span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> final <span style="color: #000000; font-weight: bold;">function</span> offsetSet<span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</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 />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> final <span style="color: #000000; font-weight: bold;">function</span> offsetUnset<span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// End ArrayAccess Abstraction</span><br />
<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/** ABSTRACT SPL Countable **/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Note from PHP manual: If var is not an array or an object with </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// implemented Countable interface, 1 will be returned.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Not sure why it returns one, but we need to make sure our </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// count is right and returns zero when there are no objects</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</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; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// End Countable Abstraction</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/** ABSTRACT SPL Iterator **/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">current</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">current</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</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; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">next</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</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: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">rewind</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #990000;">reset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</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: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> valid<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">current</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">objects</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// END Iterator Abstraction</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
</pre>
<p></p>
<h2>Testing and Demonstration</h2>
<p><strong>Test Code</strong></p>
<pre>
<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: #009933; font-style: italic;">/** FOO CLASS USED TO POPULATE OUR TEST COLLECTION */</span><br />
<span style="color: #000000; font-weight: bold;">class</span> Foo <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">value</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #009933; font-style: italic;">/** DEMONSTRATION **/</span><br />
<span style="color: #000088;">$objects</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 />
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$x</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> <span style="color: #000088;">$x</span> <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$objects</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Foo<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000088;">$collection</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Collection<span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// offsetExists</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$collection</span><span style="color: #009900;">&#91;</span>3<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Offset 3 exists<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Offset 3 doesnt exist<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: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// offsetGet</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Value of offset 1: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$collection</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">value</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 />
<br />
<span style="color: #666666; font-style: italic;">// offsetSet</span><br />
<span style="color: #000088;">$collection</span><span style="color: #009900;">&#91;</span>3<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Foo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'A'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Offset 3 has been changed, the object value is now: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$collection</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">value</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 />
<br />
<span style="color: #666666; font-style: italic;">// offsetUnset</span><br />
<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$collection</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Offset 2 has been removed. &quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$collection</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Offset 2 exists<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Offset 2 doesnt exist<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: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #666666; font-style: italic;">// Countable</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;This collection has &quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$collection</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; objects<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 />
<br />
<br />
<span style="color: #666666; font-style: italic;">// Iterating</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Looping through our collection:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$collection</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$object</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Index &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; = &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$object</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">value</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
</pre>
<p><strong>Test Output</strong></p>
<pre>
<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">Offset 3 exists<br />
Value of offset 1: 1<br />
Offset 3 has been changed, the object value is now: A<br />
Offset 2 has been removed. Offset 2 doesnt exist<br />
<br />
This collection has 4 objects<br />
<br />
Looping through our collection:<br />
Index 0 = 0<br />
Index 1 = 1<br />
Index 3 = A<br />
Index 4 = 4</div></div>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2009/10/23/building-a-php-object-collection-manager-with-spl/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Android is going to beat the iPhone</title>
		<link>http://www.adamgotterer.com/2009/10/22/android-is-going-to-beat-the-iphone/</link>
		<comments>http://www.adamgotterer.com/2009/10/22/android-is-going-to-beat-the-iphone/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 15:00:06 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[AT&T]]></category>
		<category><![CDATA[Mobile Device]]></category>
		<category><![CDATA[Mobile Platform]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/?p=159</guid>
		<description><![CDATA[There is little argument that the iPhone is the best smartphone on the market. With 85,000 application available at the AppStore, there is significantly more interest in this mobile platform then any other. The iPhone has fundamentally changed how users interact with their mobile devices. The last year has seen explosive growth. Right now, the [...]]]></description>
			<content:encoded><![CDATA[<p>There is little argument that the iPhone is the best smartphone on the market. With <a href="http://www.apple.com/pr/library/2009/09/28appstore.html">85,000 application</a> available at the AppStore, there is significantly more interest in this mobile platform then any other. The iPhone has fundamentally changed how users interact with their mobile devices. The last year has seen explosive growth. Right now, the iPhone is the phone to beat. But I don&#8217;t think it will last…</p>
<p>1) My first point will represent my weakest. AT&#038;T sucks. Period. The service is abysmal. I&#8217;ve heard numbers that say 30% of New York calls end in a drop. My NY experience has likely been around there, not to mention all the text/voicemail delays and straight up service outages. The point is AT&#038;T cant handle its current subscribers, let alone continuous growth. In their defense, no one could have predicted that iPhone users would consume six times more data than typical mobile users and eat up all the bandwidth. This doesn&#8217;t only affect iPhone users, all AT&#038;T subscribers suffer.</p>
<p>Apparently AT&#038;T is spending $17 billion dollars this year to upgrade their infrastructure. This sounds impressive, except last year they spent something like $20 billion and every other year they spend a ton of money as well. So don&#8217;t be fooled by this large sum. Whats interesting is that AT&#038;T is always playing catch up. Years ago when the GSM network was released, a ton of their subscribers jumped ship because of the poor service. It took them years before they get things sorted out. Now it&#8217;s happening all over again. If they don&#8217;t get their act together I think you will start seeing subscribers run to the exit signs. Keep in mind all second generation iPhone users are still under a two year contract till at least June. It will be interesting to see what happens as contracts start to expire and the market starts to offers iPhone alternatives.</p>
<p>2) Apple appears to not be learning from their mistakes. I&#8217;m talking about the PC wars from back in the 80&#8217;s. Long story short, Apple lost because they wanted to control everything. You are seeing the same thing happen with the iPhone. They don&#8217;t want to give up control and open up the platform. I&#8217;m not even talking open source. But developers and users don&#8217;t feel like they have control of their devices. Apple just doesn&#8217;t trust it&#8217;s users. Because of Apple and AT&#038;T we may never see the full potential of the device because they hamper innovation so much. To be fair its not just AT&#038;T, nothing is worse for innovation then mobile network providers.</p>
<p>There hasn&#8217;t yet been a back lash from the developer community yet. But you can clearly hear there frustration. The reason people are putting up with it is because there is no where else to go. Right now if you want to build mobile apps, you go where the people are. And the people are on the iPhone. Plus no other platform has an equal equivalent to the AppStore. But the AppStore isn&#8217;t what iTunes is to music, it can be reproduced and potentially successful.</p>
<p>3) Some predictions say Android will be the most popular mobile OS within 5 years. Most popular aside, I predict there will be more Android devices then iPhone devices within two years. Android took 5% of the smartphone market share 3 months after launch. As far as I&#8217;m concerned the g1 was Googles way of tasting the market. Now that there is interest, I foresee an outbreak of Android devices… There are over 15 <a href="(http://www.techcrunch.com/2009/10/19/android-galore-a-complete-list-of-the-android-phones-and-their-specs-droid-best/)">announced and rumored Android devices</a> coming out in the next 6 &#8211; 12 months.</p>
<p>I&#8217;m not predicting that any one handset will out perform the iPhone, although I&#8217;m super excited for the Motorola Droid. I am predicting that Android devices as a whole will eventually consume more market share then the iPhone. More devices + more carriers + more countries = more potential customers. If things continue as they are, I think Android is positioned to eventually rival Nokia as the default smartphone OS. Once developers realize theres is or will be more Android users. You will start to see significant more development and innovation for the Android OS. The only way I see the iPhone fighting for a contending spot is by dropping their bad habits. Learn from your mistakes and stop being an over protected parent that doesn&#8217;t trust its kids. And for gods sake get on some other networks, stat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2009/10/22/android-is-going-to-beat-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CollegeHumor is hiring a PHP Engineer</title>
		<link>http://www.adamgotterer.com/2009/10/14/collegehumor-is-hiring-a-php-engineer/</link>
		<comments>http://www.adamgotterer.com/2009/10/14/collegehumor-is-hiring-a-php-engineer/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 22:46:47 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[BustedTees]]></category>
		<category><![CDATA[CollegeHumor]]></category>
		<category><![CDATA[Connected Ventures]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/?p=157</guid>
		<description><![CDATA[Connected Ventures is seeking an ambitious, well-rounded PHP engineer. You will work closely with our team of developers on a number of large and high profile websites. The Connected Ventures properties include: CollegeHumor, Bustedtees, TodaysBIGthing and SportsPickle. Collectively our sites reach over 12 million worldwide unique monthly users. Connected Ventures is part of InterActiveCorp (IAC), [...]]]></description>
			<content:encoded><![CDATA[<p>Connected Ventures is seeking an ambitious, well-rounded PHP engineer. You will work closely with our team of developers on a number of large and high profile websites. The Connected Ventures properties include: CollegeHumor, Bustedtees, TodaysBIGthing and SportsPickle. Collectively our sites reach over 12 million worldwide unique monthly users. Connected Ventures is part of InterActiveCorp (IAC), a leading internet company with more than 50 fast-growing web properties.</p>
<p>We&#8217;re searching for someone who has:</p>
<p>* Fluency in PHP 5 and the LAMP stack<br />
* MySQL with performance tuning and scalability<br />
* Strong understanding of Object Oriented Programming<br />
* Hands on experience with MVC Frameworks<br />
* Caching / Scaling (Memcached, APC, etc.)<br />
* Thorough understanding of HTML, Javascript, CSS and XML<br />
* An understanding of the issues surrounding large-volume websites and scalability<br />
* A preoccupation with staying on top of industry trends and technologies</p>
<p>Bonus Points:</p>
<p>* Experience with SPL a major plus<br />
* e-commerce, credit card authorizations, and billing feature experience<br />
* Linux or Solaris<br />
* jQuery or Prototype<br />
* Content Delivery Networks<br />
* Version Control Systems (we use Subversion)<br />
* Experience building scalable frameworks</p>
<p>Responsibilities:</p>
<p>* Implement major new features and feature improvements<br />
* Track and squash bugs<br />
* Optimize code and queries for better performance<br />
* Database Architecting<br />
* Work hard and play hard!</p>
<p>This is an on site, full time position at our office in Union Square, New York City. Please email your resume and code samples to techjobs@connectedventures.com. Please no recruiters or development shops. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2009/10/14/collegehumor-is-hiring-a-php-engineer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forcing files to download from Amazon S3</title>
		<link>http://www.adamgotterer.com/2009/09/23/forcing-files-to-download-from-amazon-s3/</link>
		<comments>http://www.adamgotterer.com/2009/09/23/forcing-files-to-download-from-amazon-s3/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 05:39:11 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[S3]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/2009/09/23/forcing-files-to-download-from-amazon-s3/</guid>
		<description><![CDATA[I have been messing around with Amazon S3 for hosting files the last few days. One of the things I wanted to do was force a file to download instead of the browser attempting to open it (jpgs, txt, mp3, etc.). A quick Google search didn&#8217;t return anything useful. There is a whole bunch of [...]]]></description>
			<content:encoded><![CDATA[<p>I have been messing around with Amazon S3 for hosting files the last few days. One of the things I wanted to do was force a file to download instead of the browser attempting to open it (jpgs, txt, mp3, etc.). A quick Google search didn&#8217;t return anything useful. There is a whole bunch of people trying to use PHP headers and read in the file from Amazon. This is a horrible idea. It requires your server to download the file first, then deliver it to the client. Double work, bad solution.</p>
<p>There is a much easier way&#8230; S3 allows you to set request headers on a per object basis. In order to force a file download dialog you just need to set the &#8220;Content-Disposition&#8221; header.</p>
<p>Here&#8217;s an example using the <a href="http://undesigned.org.za/2007/10/22/amazon-s3-php-class">Undesigned Amazon S3 PHP class</a> (highly recommended). This header should easily integrate into whatever system you are using to interact with the S3 API. If you need additional information take a look at the <a href="http://docs.amazonwebservices.com/AmazonS3/latest/index.html?RESTObjectGET.html">S3 documentation</a>.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">S3<span style="color: #339933;">::</span><span style="color: #004000;">putObject</span><span style="color: #009900;">&#40;</span>S3<span style="color: #339933;">::</span><span style="color: #004000;">inputFile</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$FILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bucket</span><span style="color: #339933;">,</span> <span style="color: #000088;">$uri</span><span style="color: #339933;">,</span> S3<span style="color: #339933;">::</span><span style="color: #004000;">ACL_PUBLIC_READ</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> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Disposition'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment; filename='</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$filename</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2009/09/23/forcing-files-to-download-from-amazon-s3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to destory a Subversion repository in one line</title>
		<link>http://www.adamgotterer.com/2009/09/18/how-to-destory-a-subversion-repository-in-one-line/</link>
		<comments>http://www.adamgotterer.com/2009/09/18/how-to-destory-a-subversion-repository-in-one-line/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 04:41:12 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/2009/09/18/how-to-destory-a-subversion-repository-in-one-line/</guid>
		<description><![CDATA[One of our developers recently taught us how to hose a subversion repository. I wasn&#8217;t even aware you could actually cause this much damage. He accidentally ran this &#8220;svn remove &#8211;force .&#8220;. At first glance I made the assumption that this would delete everything in his working copy. That much was true, but it went [...]]]></description>
			<content:encoded><![CDATA[<p>One of our developers recently taught us how to hose a subversion repository. I wasn&#8217;t even aware you could actually cause this much damage. He accidentally ran this &#8220;<strong>svn remove &#8211;force .</strong>&#8220;. At first glance I made the assumption that this would delete everything in his working copy. That much was true, but it went as far up as the repo trunk. It deleted everything, we weren&#8217;t even able to do a roll back. When I ran an &#8220;svn update&#8221; in my working copy is said the repository didn&#8217;t exist. We had to create a whole new repository and import all the settings, tickets and commit data by hand. My advise: never run that command. I&#8217;m also surprised Subversion allows for such a command without better validation or permission control.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2009/09/18/how-to-destory-a-subversion-repository-in-one-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Flash 10 64bit plugin for Firefox on Ubuntu</title>
		<link>http://www.adamgotterer.com/2009/09/05/installing-flash-10-64bit-plugin-for-firefox-on-ubuntu/</link>
		<comments>http://www.adamgotterer.com/2009/09/05/installing-flash-10-64bit-plugin-for-firefox-on-ubuntu/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 15:50:39 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/2009/09/05/installing-flash-10-64bit-plugin-for-firefox-on-ubuntu/</guid>
		<description><![CDATA[I recently setup Ubuntu 9.04 on my 64bit AMD machine. The biggest headache aside from the ATI driver issues was getting Flash 10 to work in Firefox. At the time of this writing Flash 10 64bit for Firefox 64bit is still in Alpha.
1) Remove all pre existing flash installations and files
sudo apt-get purge flashplugin-nonfree gnash [...]]]></description>
			<content:encoded><![CDATA[<p>I recently setup Ubuntu 9.04 on my 64bit AMD machine. The biggest headache aside from the ATI driver issues was getting Flash 10 to work in Firefox. At the time of this writing Flash 10 64bit for Firefox 64bit is still in Alpha.</p>
<p>1) Remove all pre existing flash installations and files</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash nspluginwrapper swfdec-mozilla</div></div>
<p>2) Go to <a href="http://labs.adobe.com/downloads/flashplayer10.html">http://labs.adobe.com/downloads/flashplayer10.html</a> and find the most up to date release. (http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz)</p>
<p>3) Download and extract it</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.macromedia.com<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>labs<span style="color: #000000; font-weight: bold;">/</span>flashplayer10<span style="color: #000000; font-weight: bold;">/</span>libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz</div></div>
<p>4) Move the plugin file</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> libflashplayer.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mozilla<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>libflashplayer.so</div></div>
<p>5) Restart Firefox and browse to &#8220;about:plugins&#8221; to confirm that it installed correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2009/09/05/installing-flash-10-64bit-plugin-for-firefox-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extension Development Survey</title>
		<link>http://www.adamgotterer.com/2009/07/07/extension-development-survey/</link>
		<comments>http://www.adamgotterer.com/2009/07/07/extension-development-survey/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 03:48:51 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[FireFox Extension]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/2009/07/07/extension-development-survey/</guid>
		<description><![CDATA[I was recently asked to participate in a Mozilla extension development survey being conducted by professor Amrit Tiwana at the Iowa State University. You can download the preliminary results here. The final results will be released in the fall. If your an extension developer its worth the read. The results are released under the Creative [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked to participate in a Mozilla extension development survey being conducted by professor Amrit Tiwana at the Iowa State University. You can download the preliminary results <a href="http://www.adamgotterer.com/wp-content/uploads/2009/07/2009-preliminary-report-for-key-developers-extension-study-tiwana.pdf">here</a>. The final results will be released in the fall. If your an extension developer its worth the read. The results are released under the <a href="http://creativecommons.org/licenses/by-nd/3.0/us/">Creative Commons</a> license, so feel free to share.</p>
<p><strong>A few fun findings</strong></p>
<ul>
<li>59% of developers are unlikely to port to competing commercial browsers, while less than half will consider porting to competing open-source browsers.</li>
<li>85% of extensions in the study were open source</li>
<li>Most (66%) extensions have an intermediate degree of modularity with the browser; only one in three have<br />
high modularity.</li>
<li>Major extension upgrades rarely trigger integration and browser stability problems.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2009/07/07/extension-development-survey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CollegeHumor is hiring!</title>
		<link>http://www.adamgotterer.com/2009/06/30/collegehumor-is-hiring-2/</link>
		<comments>http://www.adamgotterer.com/2009/06/30/collegehumor-is-hiring-2/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 23:29:12 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/2009/06/30/collegehumor-is-hiring-2/</guid>
		<description><![CDATA[We are looking for an exceptional PHP developer to join our talented team here at Connected Ventures. You will be working across our network of sites which include; CollegeHumor, Bustedtees and TodaysBIGthing. Combined they do over 5 million page views a day and reach over 500,000 visitors. This is an on site, full time position [...]]]></description>
			<content:encoded><![CDATA[<p>We are looking for an exceptional PHP developer to join our talented team here at Connected Ventures. You will be working across our network of sites which include; CollegeHumor, Bustedtees and TodaysBIGthing. Combined they do over 5 million page views a day and reach over 500,000 visitors. This is an on site, full time position at our office in Union Square, New York City. Email your resume and PHP code samples to techjobs@connectedventures.com. Please no recruiters or development shops.</p>
<p>Requirements:<br />
* PHP<br />
* MySQL<br />
* Strong understanding of Object Oriented Programming<br />
* MVC Frameworks<br />
* Caching / Scaling (Memcached, APC)<br />
* Subversion<br />
* E-commerce<br />
* Javascript, HTML/CSS, XML<br />
* Linux or Solaris experience a plus</p>
<p>What&#8217;s it like to work here?<br />
It&#8217;s confusing when you can&#8217;t tell the difference between &#8220;work&#8221; and &#8220;play;&#8221; &#8220;friends and co-workers;&#8221; &#8220;office&#8221; and &#8220;cool place to hang out.&#8221; Confusing is about as bad as it gets here at Connected Ventures, where Nerf-gun fights happen, &#8216;casual Friday&#8217; starts Monday at 10 and ends Friday at 6, and &#8220;work&#8221; means collaborating with your buddy at the dual screen computer next to yours. Now, don&#8217;t assume, however, that it&#8217;s all just fun and games here: the CollegeHumor family labors diligently all the time, they just happen to enjoy their business more than most people.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2009/06/30/collegehumor-is-hiring-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PriceAdvance Upgrades</title>
		<link>http://www.adamgotterer.com/2009/04/24/priceadvance-upgrades/</link>
		<comments>http://www.adamgotterer.com/2009/04/24/priceadvance-upgrades/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 21:05:07 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Media Next]]></category>
		<category><![CDATA[Priceadvance]]></category>

		<guid isPermaLink="false">http://www.adamgotterer.com/2009/04/24/priceadvance-upgrades/</guid>
		<description><![CDATA[
We launched some major changes to PriceAdvance yesterday. We improved merchant coverage from 15 websites to over 150 (full list), added support for shipping price, stock availability and rebate offers. Download it for Firefox (or IE) and leave a review!
]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.adamgotterer.com/wp-content/uploads/2009/04/screenshot.gif' alt='PriceAdvance Screenshot' /></p>
<p>We launched some major changes to <a href="http://www.priceadvance.com">PriceAdvance</a> yesterday. We improved merchant coverage from 15 websites to over 150 (<a href="http://www.priceadvance.com/demo#merchant_anchor">full list</a>), added support for shipping price, stock availability and rebate offers. Download it for <a href="https://addons.mozilla.org/en-US/firefox/addon/6089">Firefox</a> (or <a href="http://www.priceadvance.com">IE</a>) and leave a review!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamgotterer.com/2009/04/24/priceadvance-upgrades/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
