<?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>Andrew Elkins</title>
	<atom:link href="http://andrewelkins.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewelkins.com</link>
	<description>Website home of Andrew Elkins - Software Engineer</description>
	<lastBuildDate>Mon, 14 May 2012 19:28:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>JS logging</title>
		<link>http://andrewelkins.com/programming/js-logging/</link>
		<comments>http://andrewelkins.com/programming/js-logging/#comments</comments>
		<pubDate>Mon, 14 May 2012 19:27:36 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://andrewelkins.com/?p=127</guid>
		<description><![CDATA[I&#8217;ve been doing a fair about of js development lately and console.log has been my friend. However, writing console.log() is a bit heavy. So instead I&#8217;ve been adding this to my files as  a quick way to log in javascipt. &#8230; <a href="http://andrewelkins.com/programming/js-logging/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a fair about of js development lately and console.log has been my friend. However, writing console.log() is a bit heavy. So instead I&#8217;ve been adding this to my files as  a quick way to log in javascipt.</p>
<blockquote><p>function log() {<br />
if (window.console &amp;&amp; console.log)<br />
console.log(&#8216;{product or sitename} ::  &#8217; + Array.prototype.join.call(arguments,&#8217; &#8216;));<br />
}</p>
<p>&nbsp;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/programming/js-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove empty values from an array.</title>
		<link>http://andrewelkins.com/programming/remove-empty-values-from-an-array/</link>
		<comments>http://andrewelkins.com/programming/remove-empty-values-from-an-array/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 16:01:01 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://andrewelkins.com/?p=125</guid>
		<description><![CDATA[I developed this little one liner to remove empty values from an array in php. $tags = array( &#8216;testtag&#8217;, &#8216;testtag2&#8242;, &#8216; &#8216; ); $tagsCleaned = array_filter( array_map( &#8216;trim&#8217;, $tags ), create_function( &#8216;$a&#8217;, &#8216;return $a!=&#8221;";&#8217; ) ); Breaking that down inside out. &#8230; <a href="http://andrewelkins.com/programming/remove-empty-values-from-an-array/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I developed this little one liner to remove empty values from an array in php.</p>
<blockquote><p>$tags = array( &#8216;testtag&#8217;, &#8216;testtag2&#8242;, &#8216; &#8216; );</p>
<p>$tagsCleaned = array_filter( array_map( &#8216;trim&#8217;, $tags ),<br />
create_function( &#8216;$a&#8217;, &#8216;return $a!=&#8221;";&#8217; ) );</p></blockquote>
<p>Breaking that down inside out.</p>
<blockquote><p>array_map( &#8216;trim&#8217;, $tags )</p></blockquote>
<p><a href="http://www.php.net/manual/en/function.array-map.php" target="_blank">Array map</a> the trim function to all of the values within the array, removing removing pre/post spaces. In this case it removes the space in the third item.</p>
<blockquote><p>array_filter( array_map( &#8216;trim&#8217;, $tags ),<br />
create_function( &#8216;$a&#8217;, &#8216;return $a!=&#8221;";&#8217; ) )</p></blockquote>
<p><a href="http://php.net/manual/en/function.array-filter.php" target="_blank">Array filter</a> allows us to remove the elements that do not match the function. In this case, I&#8217;ve created a function to test if the value is an empty string. If it is, the function returns true if it is not blank and false if it is. The false return removes the value from the array.</p>
<p>The result will be an array of two items.</p>
<blockquote><p>$tags = array( &#8216;testtag&#8217;, &#8216;testtag2&#8242;, &#8216; &#8216; );<br />
$tagsCleaned = array_filter( array_map( &#8216;trim&#8217;, $tags ), create_function( &#8216;$a&#8217;, &#8216;return $a!=&#8221;";&#8217; ) );<br />
print_r($tagsCleaned);</p>
<p>&nbsp;</p>
<p>Array<br />
(<br />
[0] =&gt; testtag<br />
[1] =&gt; testtag2<br />
)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/programming/remove-empty-values-from-an-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the + sign to merge arrays in php</title>
		<link>http://andrewelkins.com/programming/using-the-sign-to-merge-arrays-in-php/</link>
		<comments>http://andrewelkins.com/programming/using-the-sign-to-merge-arrays-in-php/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 01:15:02 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://andrewelkins.com/?p=120</guid>
		<description><![CDATA[Today came across code that used the + sign to merge two associative php arrays. At first I thought it was broken but turns out you can indeed merge two arrays with the + sign. $album = array( &#8216;title&#8217; =&#62; &#8216;King of &#8230; <a href="http://andrewelkins.com/programming/using-the-sign-to-merge-arrays-in-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today came across code that used the + sign to merge two associative php arrays. At first I thought it was broken but turns out you can indeed merge two arrays with the + sign.</p>
<blockquote><p>$album = array(<br />
&#8216;title&#8217; =&gt; &#8216;King of Limbs&#8217;,<br />
&#8216;band&#8217; =&gt; &#8216;Radiohead&#8217;,<br />
);<br />
$album_meta_data = array(<br />
&#8216;upc&#8217; =&gt; &#8217;486898161589&#8242;,<br />
&#8216;price&#8217; = &#8217;11.98&#8242;<br />
);</p>
<p>$output = $album + $album_meta_data;</p>
<p>&#8212;&#8212;&#8211;OUTPUT&#8212;&#8212;&#8211;<br />
array(<br />
&#8216;title&#8217; =&gt; &#8216;King of Limbs&#8217;,<br />
&#8216;band&#8217; =&gt; &#8216;Radiohead&#8217;,<br />
&#8216;upc&#8217; =&gt; &#8217;486898161589&#8242;,<br />
&#8216;price&#8217; = &#8217;11.98&#8242;<br />
)</p></blockquote>
<p>Another way to use it would be to add the album meta data directly to the album array.</p>
<blockquote><p>$album = array(<br />
&#8216;title&#8217; =&gt; &#8216;King of Limbs&#8217;,<br />
&#8216;band&#8217; =&gt; &#8216;Radiohead&#8217;,<br />
);<br />
$album_meta_data = array(<br />
&#8216;upc&#8217; =&gt; &#8217;486898161589&#8242;,<br />
&#8216;price&#8217; = &#8217;11.98&#8242;<br />
);</p>
<p>$album += $album_meta_data;</p>
<p>&#8212;&#8212;&#8211;OUTPUT&#8212;&#8212;&#8211;<br />
array(<br />
&#8216;title&#8217; =&gt; &#8216;King of Limbs&#8217;,<br />
&#8216;band&#8217; =&gt; &#8216;Radiohead&#8217;,<br />
&#8216;upc&#8217; =&gt; &#8217;486898161589&#8242;,<br />
&#8216;price&#8217; = &#8217;11.98&#8242;<br />
)</p></blockquote>
<p>If the key exists in both arrays then the first if used and the second is discarded, same as with <a href="http://php.net/manual/en/function.array-merge.php" target="_blank">array_merge</a>.</p>
<blockquote><p>$album = array(<br />
&#8216;title&#8217; =&gt; &#8216;King of Limbs&#8217;,<br />
&#8216;band&#8217; =&gt; &#8216;Radiohead&#8217;,<br />
);<br />
$album_meta_data = array(<br />
&#8216;title&#8217; =&gt; &#8216;Coldplay&#8217;,<br />
&#8216;upc&#8217; =&gt; &#8217;486898161589&#8242;,<br />
&#8216;price&#8217; = &#8217;11.98&#8242;<br />
);</p>
<p>$album += $album_meta_data;</p>
<p>&#8212;&#8212;&#8211;OUTPUT&#8212;&#8212;&#8211;<br />
array(<br />
&#8216;title&#8217; =&gt; &#8216;King of Limbs&#8217;,<br />
&#8216;band&#8217; =&gt; &#8216;Radiohead&#8217;,<br />
&#8216;upc&#8217; =&gt; &#8217;486898161589&#8242;,<br />
&#8216;price&#8217; = &#8217;11.98&#8242;<br />
)</p></blockquote>
<p>the reverse</p>
<blockquote><p>$album = array(<br />
&#8216;title&#8217; =&gt; &#8216;King of Limbs&#8217;,<br />
&#8216;band&#8217; =&gt; &#8216;Radiohead&#8217;,<br />
);<br />
$album_meta_data = array(<br />
&#8216;title&#8217; =&gt; &#8216;Coldplay&#8217;,<br />
&#8216;upc&#8217; =&gt; &#8217;486898161589&#8242;,<br />
&#8216;price&#8217; = &#8217;11.98&#8242;<br />
);</p>
<p>$album_meta_data += $album;</p>
<p>&#8212;&#8212;&#8211;OUTPUT&#8212;&#8212;&#8211;<br />
array(<br />
&#8216;title&#8217; =&gt; &#8216;King of Limbs&#8217;,<br />
&#8216;band&#8217; =&gt; &#8216;Coldplay&#8217;,<br />
&#8216;upc&#8217; =&gt; &#8217;486898161589&#8242;,<br />
&#8216;price&#8217; = &#8217;11.98&#8242;<br />
)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/programming/using-the-sign-to-merge-arrays-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare Fusion 4 &#8211; Set static IP address</title>
		<link>http://andrewelkins.com/linux/vmware-fusion-4-set-static-ip-address/</link>
		<comments>http://andrewelkins.com/linux/vmware-fusion-4-set-static-ip-address/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 03:12:30 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://andrewelkins.com/?p=118</guid>
		<description><![CDATA[In vmware Fusion 4 there is no boot.sh that is found in previous versions sudo &#8220;/Library/Application Support/VMware Fusion/boot.sh&#8221; &#8211;restart So if you make a change to the network settings like setting a static ip address you&#8217;ll need to restart your &#8230; <a href="http://andrewelkins.com/linux/vmware-fusion-4-set-static-ip-address/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In vmware Fusion 4 there is <a href="kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=1004023" target="_blank">no boot.sh </a>that is found in previous versions</p>
<blockquote><p>sudo &#8220;/Library/Application Support/VMware Fusion/boot.sh&#8221; &#8211;restart</p></blockquote>
<p>So if you make a change to the network settings like setting a static ip address you&#8217;ll need to restart your computer for the settings to take effect.</p>
<p>To set a static ip in VMWare Fusion 4 do the following:</p>
<p>First on your vm in terminal run</p>
<blockquote><p>ifconfig</p></blockquote>
<p>Then copy the HWaddr</p>
<blockquote><p>Link encap:Ethernet  HWaddr 00:0c:29:f4:13:e4</p></blockquote>
<p>Next copy the dhcp.conf file on your mac</p>
<blockquote><p>sudo vim /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf</p></blockquote>
<p>After the</p>
<blockquote><p>####### VMNET DHCP Configuration. End of &#8220;DO NOT MODIFY SECTION&#8221; #######</p></blockquote>
<p>Add your new configuration, replace &#8220;vmnamehere&#8221; with the name of your vm.</p>
<blockquote><p>host vmnamehere {<br />
hardware ethernet 00:0c:22:f6:11:e8;<br />
fixed-address 192.168.115.50;<br />
}</p></blockquote>
<p>Now reboot your Mac.</p>
<p>Your vm&#8217;s ip address should be what you set.</p>
<p>If that doesn&#8217;t work, you may need to remove the network adapter and then re-add it. Make sure that your network adapter is connected to the virtual machine by removing and re-adding it. <a href="http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&amp;externalId=1016466" target="_blank">See Step 12</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/linux/vmware-fusion-4-set-static-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursively remove svn directories from a directory</title>
		<link>http://andrewelkins.com/linux/recursively-remove-svn-directories-from-a-directory/</link>
		<comments>http://andrewelkins.com/linux/recursively-remove-svn-directories-from-a-directory/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 19:47:27 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://andrewelkins.com/?p=106</guid>
		<description><![CDATA[Removing all .svn directories from a file structure in linux is as simple as running a one liner. find . -name .svn -print0 &#124; xargs -0 rm -rf]]></description>
			<content:encoded><![CDATA[<p>Removing all .svn directories from a file structure in linux is as simple as running a one liner.</p>
<blockquote><p>find . -name .svn -print0 | xargs -0 rm -rf</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/linux/recursively-remove-svn-directories-from-a-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add git to an amazon ami ec2 instance</title>
		<link>http://andrewelkins.com/linux/how-to-add-git-to-an-amazon-ami-ec2-instance/</link>
		<comments>http://andrewelkins.com/linux/how-to-add-git-to-an-amazon-ami-ec2-instance/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 19:58:06 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://andrewelkins.com/?p=104</guid>
		<description><![CDATA[To install git on amazon ami is really simple. Make sure you have sudo and then run yum to install it. sudo yum install git That&#8217;s it. The output should be something like: $ sudo yum install git Loaded plugins: fastestmirror, &#8230; <a href="http://andrewelkins.com/linux/how-to-add-git-to-an-amazon-ami-ec2-instance/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To install git on amazon ami is really simple. Make sure you have sudo and then run yum to install it.</p>
<blockquote><p>sudo yum install git</p></blockquote>
<p>That&#8217;s it. The output should be something like:</p>
<blockquote><p>$ sudo yum install git<br />
Loaded plugins: fastestmirror, priorities, security<br />
Determining fastest mirrors<br />
amzn-main | 2.1 kB 00:00<br />
amzn-main/primary_db | 1.6 MB 00:00<br />
amzn-updates | 2.3 kB 00:00<br />
amzn-updates/primary_db | 233 kB 00:00<br />
Setting up Install Process<br />
Resolving Dependencies<br />
&#8211;&gt; Running transaction check<br />
&#8211;&gt; Processing Dependency: git = 1.7.2.5-1.16.amzn1 for package: perl-Git-1.7.2.5-1.16.amzn1.i686<br />
&#8212;&gt; Package git.i686 0:1.7.4.5-1.21.amzn1 set to be updated<br />
&#8211;&gt; Running transaction check<br />
&#8212;&gt; Package perl-Git.i686 0:1.7.4.5-1.21.amzn1 set to be updated<br />
&#8211;&gt; Finished Dependency Resolution</p>
<p>Dependencies Resolved</p>
<p>==============================================================================================================================<br />
Package Arch Version Repository Size<br />
==============================================================================================================================<br />
Updating:<br />
git i686 1.7.4.5-1.21.amzn1 amzn-main 4.4 M<br />
Updating for dependencies:<br />
perl-Git i686 1.7.4.5-1.21.amzn1 amzn-main 16 k</p>
<p>Transaction Summary<br />
==============================================================================================================================<br />
Install 0 Package(s)<br />
Upgrade 2 Package(s)</p>
<p>Total download size: 4.4 M<br />
Is this ok [y/N]: y<br />
Downloading Packages:<br />
(1/2): git-1.7.4.5-1.21.amzn1.i686.rpm | 4.4 MB 00:00<br />
(2/2): perl-Git-1.7.4.5-1.21.amzn1.i686.rpm | 16 kB 00:00<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Total 7.9 MB/s | 4.4 MB 00:00<br />
Running rpm_check_debug<br />
Running Transaction Test<br />
Transaction Test Succeeded<br />
Running Transaction<br />
Updating : git-1.7.4.5-1.21.amzn1.i686 1/4<br />
Updating : perl-Git-1.7.4.5-1.21.amzn1.i686 2/4<br />
Cleanup : git-1.7.2.5-1.16.amzn1.i686 3/4<br />
Cleanup : perl-Git-1.7.2.5-1.16.amzn1.i686 4/4</p>
<p>Updated:<br />
git.i686 0:1.7.4.5-1.21.amzn1</p>
<p>Dependency Updated:<br />
perl-Git.i686 0:1.7.4.5-1.21.amzn1</p>
<p>Complete!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/linux/how-to-add-git-to-an-amazon-ami-ec2-instance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find loaded modules in Apache 2.x</title>
		<link>http://andrewelkins.com/linux/find-loaded-modules-in-apache-2-x/</link>
		<comments>http://andrewelkins.com/linux/find-loaded-modules-in-apache-2-x/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 06:07:50 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://andrewelkins.com/?p=102</guid>
		<description><![CDATA[I was trying to figure out how to find the loaded modules in Apache and came across this nice command. httpd -M Used like: $ httpd -M Loaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) authn_file_module (shared) authn_default_module &#8230; <a href="http://andrewelkins.com/linux/find-loaded-modules-in-apache-2-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was trying to figure out how to find the loaded modules in Apache and came across this nice command.</p>
<blockquote><p>httpd -M</p></blockquote>
<p>Used like:</p>
<blockquote><p>$ httpd -M<br />
Loaded Modules:<br />
core_module (static)<br />
mpm_prefork_module (static)<br />
http_module (static)<br />
so_module (static)<br />
authn_file_module (shared)<br />
authn_default_module (shared)</p>
<p>&#8230;&#8230;</p>
<p>rewrite_module (shared)<br />
php5_module (shared)<br />
extract_forwarded_module (shared)<br />
geoip_module (shared)<br />
Syntax OK</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/linux/find-loaded-modules-in-apache-2-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display phpinfo from the command line</title>
		<link>http://andrewelkins.com/linux/display-phpinfo-from-the-command-line/</link>
		<comments>http://andrewelkins.com/linux/display-phpinfo-from-the-command-line/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 19:37:41 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://andrewelkins.com/?p=93</guid>
		<description><![CDATA[This afternoon I was wanting to get a couple things from phpinfo but didn&#8217;t want to do the typical make a php file, put phpinfo, run it from a browser or command prompt. There&#8217;s a better, quicker way if you &#8230; <a href="http://andrewelkins.com/linux/display-phpinfo-from-the-command-line/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This afternoon I was wanting to get a couple things from phpinfo but didn&#8217;t want to do the typical make a php file, put phpinfo, run it from a browser or command prompt. There&#8217;s a better, quicker way if you know what you want. One will output it to a file for review:</p>
<blockquote><p>echo &#8220;&lt;?php phpinfo(); ?&gt;&#8221; | php &gt; phpinfo.txt</p></blockquote>
<p>Second is the quickest. It output the info and the grep for the information you need:</p>
<blockquote><p>php -i | grep &#8216;version&#8217;</p></blockquote>
<p>Replace version with your own search query.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/linux/display-phpinfo-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scaling PHP Applications with Redis</title>
		<link>http://andrewelkins.com/zendcon/scaling-php-applications-with-redis/</link>
		<comments>http://andrewelkins.com/zendcon/scaling-php-applications-with-redis/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 20:00:35 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[ZendCon]]></category>

		<guid isPermaLink="false">http://localhost/andrewelkins/?p=62</guid>
		<description><![CDATA[Redis is an important technology when dealing with caching. This was one of the talks that I really wanted to attend at ZendCon. It was given by Josh Butts of Vertive LLC. Redis is a NoSQL technology that rides a &#8230; <a href="http://andrewelkins.com/zendcon/scaling-php-applications-with-redis/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Redis is an important technology when dealing with caching. This was one of the talks that I really wanted to attend at ZendCon. It was given by <a href="http://twitter.com/#!/jimbojsb" target="_blank">Josh Butts</a> of Vertive LLC.</p>
<blockquote><p>Redis is a NoSQL technology that rides a fine line between database and in-memory cache. Redis also offers &#8220;remote data structures&#8221;, which gives it a significant advantage over other in-memory databases. This session will cover several PHP clients for Redis, and how to use them for caching, data modeling and generally improving application throughput.</p></blockquote>
<p><a href="http://redis.io/" target="_blank">Redis</a> is an open source in memory key value store with optional persistance. The current version is 2.4.2 as of this writing. The latest stable version is 2.2.15 which what Josh recommended as the minimum version you would want to use. He noted that 2.4 was pretty stable in it&#8217;s own right. Hoever, I have notice that since 2.4.0 release 10 days ago they have already release 2 patches (now at 2.4.2). Thus, personally, unless a feature of 2.4 is necessary I&#8217;d say go with 2.2 latest or 2.3 latest.</p>
<p>Once Redis is installed how to connect to it becomes an issue. According to Josh, there&#8217;s not a good GUI tool to use with Redis. Instead it&#8217;s best to use the command line interface.</p>
<p>On the actual functioning of Redis, it functions on hash keys. Think of it like associative arrays in PHP. However, there&#8217;s a huge difference. There is NO nesting. The array is only one level deep.</p>
<p>As far as connecting PHP to Redis there&#8217;s two options that Josh mentioned. Rediska and Predis.</p>
<p><a href="http://rediska.geometria-lab.net/" target="_blank">Rediska</a> is compatible with PHP 5.2+ and Zend Framework 1.x. A huge feature is the profiler. It allows you to understand how your application is using Redis and optimize it from there. Another positive is Rediska has native session handling.</p>
<p><a href="https://github.com/nrk/predis/wiki" target="_blank">Predis</a> is built for PHP 5.3+ giving it  the ability to being developed for the future and not being locked in to older technology. It has profiling and lazy connections to the redis server.</p>
<p>Josh&#8217;s recommendation between the two was use Predis if you have 5.3 available to you, but Rediska was okay too. It seemed that one of his main reason behind this was Predis has been seeing more recent activity and was thus more likely to be maintained in the future.</p>
<p>My take, at the moment, is also to go with Predis since it seems like a more active project. It also looks as if it is looking forward and being developed for feature redis improvements. I haven&#8217;t had an opportunity to actively  test between the two, so my decision is temporary until I have the opportunity to factually compare instead of going on hunches.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/zendcon/scaling-php-applications-with-redis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 WebSockets &#8211; Presented by Scott Mattocks</title>
		<link>http://andrewelkins.com/zendcon/html5-websockets-presented-by-scott-mattocks/</link>
		<comments>http://andrewelkins.com/zendcon/html5-websockets-presented-by-scott-mattocks/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 06:19:51 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[ZendCon]]></category>

		<guid isPermaLink="false">http://localhost/andrewelkins/?p=50</guid>
		<description><![CDATA[This was the first talk I went to at ZendCon. The provided description: The emergence of HTML 5 and related technologies opens up a new world of possibilities for web applications. Among those new technologies are WebSockets, which allow for &#8230; <a href="http://andrewelkins.com/zendcon/html5-websockets-presented-by-scott-mattocks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This was the first talk I went to at ZendCon. The provided description:</p>
<blockquote><p>The emergence of HTML 5 and related technologies opens up a new world of possibilities for web applications. Among those new technologies are WebSockets, which allow for bi-directional communication between the browser and the server. This session will introduce WebSockets by exploring a few practical applications before diving into the JavaScript API and the WebSocket communication protocol.</p></blockquote>
<p>What I gained most from the talk was when he talked about websockets. In a gross generalization, they can be used to replace some common applications of ajax communication between the server and the client. Instead of using long polling in a web application, which has unnecessary overhead when sending small bits of data, using a web socket connection for the communication is a better solution.</p>
<p>Web socket communication requires work on both the server side and client side to enable the two way communication.</p>
<p>On the client side, like ajax, it relies heavily on javascript. Processes information in a similar fashion to AJAX. Web sockets at it&#8217;s heart is about the communication of data between the server and client. There&#8217;s some work on the client side to allow the setting up and maintaining of the connection, but really less than with a long polling ajax setup.</p>
<p>On the server side it&#8217;s a little bit more work. The original request for a connection is sent over the standard http port for the site. Then the web socket server will respond with the port to set the connection up with the web socket server.</p>
<p>&nbsp;</p>
<p>More Information:</p>
<ul>
<li><a href="http://websocket.org/echo.html" target="_blank">Web Socket Browser Test</a></li>
<li><a href="http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/" target="_blank">Web Socket Tutorial </a></li>
<li><a href="https://github.com/remy/html5demos/tree/master/server/" target="_blank">Nodejs Websocket Server Test</a></li>
<li><a href="http://spoutserver.com/talks/websockets.html#slide1" target="_blank">Slides</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://andrewelkins.com/zendcon/html5-websockets-presented-by-scott-mattocks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

