<?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>Level 2D Blog &#187; Programming</title>
	<atom:link href="http://level2b.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://level2b.com</link>
	<description>(2.0)</description>
	<lastBuildDate>Tue, 10 Jan 2012 20:58:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IE Hacking, Again</title>
		<link>http://level2b.com/ie-hacking-again/</link>
		<comments>http://level2b.com/ie-hacking-again/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 03:44:05 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Functionality]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Techniques]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[IE Hacking]]></category>

		<guid isPermaLink="false">http://level2b.com/?p=394</guid>
		<description><![CDATA[I loathe IE, and what developer doesn&#8217;t.  Can I get an amen from the choir!?  Anyway, found another useful hack for IE.  When putting Flash content on a site, sometimes the user is required to click the Flash component to activate it.  Annoying, but easy to fix.  For all of you jQuery lovers, here is [...]]]></description>
			<content:encoded><![CDATA[<p>I loathe IE, and what developer doesn&#8217;t.  Can I get an amen from the choir!?  Anyway, found another useful hack for IE.  When putting Flash content on a site, sometimes the user is required to click the Flash component to activate it.  Annoying, but easy to fix.  For all of you jQuery lovers, here is how to fix it.  (You can laugh under your breath.)</p>
<blockquote><p>$(&#8216;#flashWrapper&#8217;).html( $(&#8216;#flashWrapper&#8217;).html() );</p></blockquote>
<p>So basically you are taking your Flash embed code and adding it back to the div that contains the, you guessed it, your Flash embed code.  Believe me, I laughed when I discovered that this was a fix for this issue as well.  So simple.  So trivial.  But the thing works.</p>
<p>- Blessings</p>
]]></content:encoded>
			<wfw:commentRss>http://level2b.com/ie-hacking-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Level 2 Has An Opening</title>
		<link>http://level2b.com/level-2-has-an-opening/</link>
		<comments>http://level2b.com/level-2-has-an-opening/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 22:24:22 +0000</pubDate>
		<dc:creator>Nate Johnson</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[employment]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[Level 2 Design]]></category>

		<guid isPermaLink="false">http://level2b.com/?p=140</guid>
		<description><![CDATA[Level 2 Design is looking for a web programmer.
The position will start out on a contract basis, with a goal of full time-employment.
 The job requirements are as follows: 
 Expertise: 
PHP/MySQL
HTML
CSS
Javascript (jQuery, Ajax, etc.)
 Familiar with: 
Flash Actionscript/Flex
PHP frameworks (Cake, CodeIgnitor, Zend, etc.)
ASP
Server maintenance
DNS configuration
The job includes building comprehensive websites with complex IA and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.level2d.com/">Level 2 Design</a> is looking for a web programmer.<br />
The position will start out on a contract basis, with a goal of full time-employment.</p>
<p><strong> The job requirements are as follows: </strong></p>
<p><strong> Expertise: </strong><br />
PHP/MySQL<br />
HTML<br />
CSS<br />
Javascript (jQuery, Ajax, etc.)</p>
<p><strong> Familiar with: </strong><br />
Flash Actionscript/Flex<br />
PHP frameworks (Cake, CodeIgnitor, Zend, etc.)<br />
ASP<br />
Server maintenance<br />
DNS configuration</p>
<p>The job includes building comprehensive websites with complex IA and various features for users. You will be working closely with a team of other developers, and designers to create the best possible products for clients.</p>
<p>If you are interested feel free to give us a call at 423.779.7172</p>
]]></content:encoded>
			<wfw:commentRss>http://level2b.com/level-2-has-an-opening/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Options Object</title>
		<link>http://level2b.com/php-options-object/</link>
		<comments>http://level2b.com/php-options-object/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 22:40:01 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://level2b.com/?p=16</guid>
		<description><![CDATA[The wait is over for a way to add the functionality of a Javascript options object to PHP5.
I will forwarn that this post contains mostly code since I explained the benifits of this methodoly in my previous post on javascript option objects.

It is a bit different js options object in that it will only set [...]]]></description>
			<content:encoded><![CDATA[<p>The wait is over for a way to add the functionality of a Javascript options object to PHP5.<br />
I will forwarn that this post contains mostly code since I explained the benifits of this methodoly in my <a title="Javascript Options Objects" href="http://level2b.com/javascript-options-object">previous post</a> on javascript option objects.</p>
<p><span id="more-16"></span><br />
It is a bit different js options object in that it will only set options which had defaults supplied upon creation.</p>
<p>Example:</p>
<pre>class Hello
{
	var $defaultOptions = array('planet' =&gt; 'World', 'punctuation' =&gt; '!');

	function __construct($options = array())
	{
		$this-&gt;options = new OptionsObject($this-&gt;defaultOptions);
		$this-&gt;opts-&gt;setOptions($options);
	}
	function message()
	{
		return 'Hello ' . $this-&gt;opts-&gt;planet . $this-&gt;opts-&gt;punctuation;
	}
}

// outputs 'Hello World!'
$a = new HelloPlanet();
print $a-&gt;message();

// outputs 'Hello Mars!'
$b = new HelloPlanet(array('planet' =&gt; 'Mars'));
print $b-&gt;message();</pre>
<p>OptionsObject Code:</p>
<pre>class OptionsObject
{
	private $options;

	public function __construct($options)
	{
		$this-&gt;options = $options;
	}
	public function isValidOption($name)
	{
		return array_key_exists($name, $this-&gt;options);
	}
	public function setOptions(array $options)
	{
		foreach($options as $key =&gt; $value)
		{
			if($this-&gt;isValidOption($key)) $this-&gt;options[$key] = $value;
		}
	}
	public function __get($option)
	{
		return $this-&gt;options[$option];
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://level2b.com/php-options-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Options Object</title>
		<link>http://level2b.com/javascript-options-object/</link>
		<comments>http://level2b.com/javascript-options-object/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 17:32:18 +0000</pubDate>
		<dc:creator>Philip Brown</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Prototype Library]]></category>

		<guid isPermaLink="false">http://level2b.com/?p=3</guid>
		<description><![CDATA[I don&#8217;t know how many times in the past I have found myself using a class and I want to change only one of the optional parameters but it just so happens to be the last argument.&#160; In order to avoid changing the default value I have to look at the objects source code.&#160; There [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know how many times in the past I have found myself using a class and I want to change only one of the optional parameters but it just so happens to be the last argument.&#160; In order to avoid changing the default value I have to look at the objects source code.&#160; There are two ways to avoid this issue.</p>
</p>
<p> <span id="more-3"></span>The first is to create setter functions for each option.&#160; I have several problems with this solution:
</p>
<ol>
<li>It requires time to create separate functions. </li>
<li>It requires more code and that means larger file size. </li>
<li>Creates more functions to document. </li>
<li>I like formatting my code so that I only have have one function on each line. </li>
<li>If I want to change three default options that means I will now have possibly 3 more lines of code. </li>
</ol>
<p>The second way is to have parameter that allows options to be passed as a JSON object. It uses default options that can be over written just by sending in a JSON object specifying only the settings you want to overwrite.</p>
<p><strong>Example:</strong></p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span>Menu = {</pre>
<pre><span class="lnum">   2:  </span>    initialize: <span class="kwrd">function</span>(button, menuElem, options)</pre>
<pre><span class="lnum">   3:  </span>    {</pre>
<pre><span class="lnum">   4:  </span>        <span class="kwrd">this</span>.button = (button);</pre>
<pre><span class="lnum">   5:  </span>        <span class="kwrd">this</span>.menuElem = (menuElem);</pre>
<pre><span class="lnum">   6:  </span>        <span class="kwrd">this</span>.setOptions(options);</pre>
<pre><span class="lnum">   7:  </span>    },</pre>
<pre><span class="lnum">   8:  </span>    setOptions(options)</pre>
<pre><span class="lnum">   9:  </span>    {</pre>
<pre><span class="lnum">  10:  </span>        <span class="kwrd">this</span>.options =    { align:<span class="str">'center'</span>, hide:<span class="kwrd">true</span>}</pre>
<pre><span class="lnum">  11:  </span>        <span class="rem">// extra {} prevents extending with null</span></pre>
<pre><span class="lnum">  12:  </span>        Object.extend(<span class="kwrd">this</span>.options, options || {});</pre>
<pre><span class="lnum">  13:  </span>    }</pre>
<pre><span class="lnum">  14:  </span>}</pre>
<pre><span class="lnum">  15:  </span>Woo = <span class="kwrd">new</span> Menu(<span class="str">'myButton'</span>, <span class="str">'myMenu'</span>, { hide: <span class="kwrd">false</span> });</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>This way of doing things is not my idea.&#160; Not even close.&#160; jQuery uses it as do many others.&#160; The first place I saw it was two years ago in Rico JavaScript library.</p>
<p>So why am I revisiting this method of option handling? It is because my next post will cover how to port this brilliant methodology to PHP5.</p>
]]></content:encoded>
			<wfw:commentRss>http://level2b.com/javascript-options-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

