<?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>DeShong.net &#187; PHP</title>
	<atom:link href="http://www.deshong.net/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deshong.net</link>
	<description></description>
	<lastBuildDate>Mon, 29 Mar 2010 21:12:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-RC1-15022</generator>
		<item>
		<title>Technical New Year&#8217;s Resolutions 2010</title>
		<link>http://www.deshong.net/2009/12/technical-new-years-resolutions-2010/</link>
		<comments>http://www.deshong.net/2009/12/technical-new-years-resolutions-2010/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 03:43:52 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=445</guid>
		<description><![CDATA[I try to do this every year by New Year&#8217;s Eve, but I&#8217;m a little late this year! Reflecting on my 2009 PHP/technical New Year&#8217;s resolutions, I ended up doing pretty well despite some unexpected challenges. Zend_Log_Writer_Mail made it into the standard library, so that takes care of my Zend Framework line item to some [...]]]></description>
			<content:encoded><![CDATA[<p>I try to do this every year by New Year&#8217;s Eve, but I&#8217;m a little late this year!  Reflecting on my <a href="http://www.deshong.net/2008/12/phptechnical-new-years-resolutions-2009/">2009 PHP/technical New Year&#8217;s resolutions</a>, I ended up doing pretty well despite some unexpected challenges.</p>
<p><a href="http://framework.zend.com/manual/en/zend.log.writers.html#zend.log.writers.mail">Zend_Log_Writer_Mail made it into the standard library</a>, so that takes care of my Zend Framework line item to some extent.  I didn&#8217;t propose anything new, though, but at least it&#8217;s something!</p>
<p>My goal to <a href="http://phparch.com/magazine/index/108">write for php|architect</a> was realized in October with the <a href="http://www.deshong.net/2009/11/publish-or-perish/">publication</a> of &#8220;Make It Mobile with PHP and Open Source Tools.&#8221;</p>
<p>I spoke at <a href="http://mobilecampatlanta.org/">iPhone/Mobile Camp Atlanta 2009</a> with a modified version of <a href="http://www.deshong.net/2008/09/slides-zendcon-2008-rickroll-to-go/">“Rickroll To Go With WURFL, PHP, and Other Open Source Tools”</a>, which was a great, low-stress speaking engagement.  Hopefully it will take place again in 2010, because I&#8217;d love to participate again!</p>
<p>It&#8217;s been a busy but productive year for work-related technical projects as I helped lead a team to re-launch a medium-scale B2B marketing site for a large cable television network.  That went over with a great degree of success.  In 2009, my project roles tended to lean more towards non-development leadership roles, such as Solutions Architect.  Late in the year, I&#8217;ve been acting as the technical lead and a developer, which has been nice.  It looks like I may get to do more architecture and development work in 2010, so that will be a nice shift in gears.</p>
<p>In June, <a href="http://www.flickr.com/photos/bdeshong/sets/72157619246941218/">our daughter, Madeline</a>, was born, which was definitely the highlight of the year.  Then in September, we were affected by the <a href="http://en.wikipedia.org/wiki/2009_Georgia_%28U.S._state%29_floods">2009 Georgia floods</a> when <a href="http://www.flickr.com/photos/bdeshong/sets/72157622428758762/">our house in Austell, GA was flooded</a>.  Then came the <a href="http://www.flickr.com/photos/bdeshong/sets/72157622679374552/">reconstruction</a> and all of the headaches that came with that.  So, the last half of 2009 was a wash&#8230;no pun intended.  <img src='http://www.deshong.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But, the horrible year of 2009 is now over!  Looking forward to 2010, I&#8217;ve got a few things I want to tackle:</p>
<ul>
<li><strong>Get back on the conference circuit:</strong> I avoided travel in the first half of 2009 due to Madeline&#8217;s arrival.  I had planned to pick things back up in the last half of the year, but the flood kind of complicated those plans.  Hence, I wasn&#8217;t seen at <a href="http://zendcon.com/">ZendCon</a> or <a href="http://www.phparch.com/">php|works</a>.  I want to get back on the conference and speaking circuits in 2010 &#8212; I need to write some new abstracts and manage to speak a few times.  I&#8217;ll be starting in May at <a href="http://atlantaphp.org/">Atlanta PHP</a>, tentatively talking on profiling and optimizing PHP applications with <a href="http://jakarta.apache.org/jmeter/">JMeter</a> and <a href="http://xdebug.org">Xdebug</a>.</li>
<li><strong>Write another article:</strong> I&#8217;d like to maybe write another article, either for <a href="http://phparch.com/">php|architect</a> or some other development- or systems administration-centric magazine.  Writing an article is relatively simple, and gratification comes much sooner than with, say, a large book.  I enjoy using my learnings from the real world to help impart knowledge on the masses, even if it only helps a single person.</li>
<li><strong>Branch out; learn a new language(s):</strong> I consider myself an advanced-to-expert PHP developer.  I&#8217;ve focused on LAMP/<a href="http://blogs.oracle.com/opal/">OPAL</a> development for eight years now.  I&#8217;d love to dabble in other languages such as Java, Ruby, Python, and so on.  I&#8217;m also very rusty with C and C++, and my Objective-C/Cocoa skills could use some more refinement.  I need to set a goal to build a specific, simple application, and build it in as many languages as possible.  The challenge with this is time &#8212; I only have so much of it with work- and family-related commitments, but that&#8217;s what late weekend nights are for, right?  Right?</li>
<li><strong>Release an iPhone app in the App Store:</strong> I&#8217;ve got at least a half a dozen iPhone apps at various stages of completion in my personal SVN repository.  They&#8217;re in need of more thorough ideas, or design, or a little bit of both.  Once I hit a brickwall, I tend to lose momentum.  This year, I need to barrel through those brickwalls and get something released to the public.  I don&#8217;t want to get rich; I just want to be able to take an app from start to finish.  I dropped the ball on this in 2009, so it&#8217;s time to commit to it and get serious.  I may start off slow with a desktop app idea that needs to see the light of day.</li>
</ul>
<p>So, here I am once again: starting a new year with a new set of resolutions.  I can safely say that 2009 has been the most difficult year of my life, but I&#8217;m glad to see that it&#8217;s over, even though it&#8217;s been bittersweet.</p>
<p>With all of this behind me, I&#8217;m re-energized and looking forward to the new challenges that 2010 has in store.  As long as they don&#8217;t involve any natural disasters, I think I can get through this year.</p>
<p>Happy New Year to everyone!  Thank you again for the support you have shown during the ups and downs of 2009, too.  See you all in 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2009/12/technical-new-years-resolutions-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Publish or perish&#8221;</title>
		<link>http://www.deshong.net/2009/11/publish-or-perish/</link>
		<comments>http://www.deshong.net/2009/11/publish-or-perish/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 01:33:40 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=424</guid>
		<description><![CDATA[&#8220;&#8216;Publish or perish&#8217; refers to the pressure to publish work constantly to further or sustain a career in academia.&#8221; Many years ago, my old boss at Community Connect Inc. (now Interactive One), Michael Montero, was having an article published in the September 2002 issue of Sysadmin Magazine. Around that time before the article was published, [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<a href="http://en.wikipedia.org/wiki/Publish_or_perish">&#8216;Publish or perish&#8217;</a> refers to the pressure to publish work constantly to further or sustain a career in academia.&#8221;</p>
<p>Many years ago, my old boss at Community Connect Inc. (now <a href="http://www.interactiveone.com/">Interactive One</a>), Michael Montero, was having <a href="http://portal.acm.org/citation.cfm?id=766723.766733">an article</a> published in the <a href="http://portal.acm.org/toc.cfm?id=766723&#038;type=issue">September 2002 issue of Sysadmin Magazine</a>.  Around that time before the article was published, Mike enlightened all of us software developers on the &#8220;publish or perish&#8221; idea &#8212; write articles, speak at conferences, etc. in order to enhance your development career.</p>
<p>I always took that advice to heart.  It made sense to me.  If you&#8217;re good at something, you use your communication skills to better yourself and make yourself known.  Whether it&#8217;s writing an article, writing a book, or speaking at a conference, it&#8217;s important to share your experiences and impart your knowledge to others.</p>
<p>So, that was one of my big goals for the year.  I&#8217;ve done the conference thing for a while now, so <a href="http://www.deshong.net/2008/12/phptechnical-new-years-resolutions-2009/">I wanted to make 2009 the year of writing</a>.  By writing, I mean writing code, and writing an article.  So, by the time this is posted, my <a href="http://phparch.com/">php|architect</a> article, &#8220;Make It Mobile with PHP and Open Source Tools&#8221;</a> will have been published.</p>
<p>I started it early in the year and finished it in mid-April, many months ahead of the deadline.  It&#8217;s basically my &#8220;Rickroll To Go&#8230;&#8221; conference talk, but in a written form.</p>
<p>It&#8217;s not some huge triumph of an article&#8230;it&#8217;s not going to win any awards&#8230;but it&#8217;s representative of a goal I set out to accomplish and succeeded at.</p>
<p>So, if you&#8217;re reading the issue, enjoy!  If you&#8217;re not, <a href="http://phparch.com/magazine/subscribe">go subscribe to php|architect</a>!</p>
<p>Also, special thanks <a href="http://naramore.net/blog/">to</a> <a href="http://www.treelinedesign.com/">my</a> <a href="http://phparch.com/">php|architect</a> <a href="http://mtabini.blogspot.com/">crew</a> for giving me this great opportunity.</p>
<p>I&#8217;d like to do some more writing in 2010 (maybe some non-PHP writing, too?), so maybe you&#8217;ll see me in print again next year.  Thanks for reading!  Please send along any comments, questions or feedback via <a href="mailto:brianNOSPAMFORMEATdeshongDOTnet">email</a> or <a href="http://twitter.com/bdeshong">Twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2009/11/publish-or-perish/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>&#8220;Rickroll To Go&#8230;&#8221; ZendCon Session audio posted!</title>
		<link>http://www.deshong.net/2009/07/rickroll-zendcon-session/</link>
		<comments>http://www.deshong.net/2009/07/rickroll-zendcon-session/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 20:23:38 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scalability]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=239</guid>
		<description><![CDATA[My ZendCon 2008 talk, “Rickroll To Go With WURFL, PHP, and Other Open Source Tools”, was just released at Zend DevZone as ZendCon Sessions episode #23! If you&#8217;re just now finding my blog from there, welcome! And thanks to Eli White, Community Relations Manager for Zend, for selecting it for posting. You can get all [...]]]></description>
			<content:encoded><![CDATA[<p>My ZendCon 2008 talk, <a href="http://www.deshong.net/2008/09/slides-zendcon-2008-rickroll-to-go/">“Rickroll To Go With WURFL, PHP, and Other Open Source Tools”</a>, was just released at <a href="http://devzone.zend.com/public/view">Zend DevZone</a> as <a href="http://devzone.zend.com/article/4871-The-ZendCon-Sessions-Episode-23-Rickroll-To-Go-With-PHP-WURFL-and-Other-Open-Source-Tools">ZendCon Sessions episode #23</a>!</p>
<p>If you&#8217;re just now finding my blog from there, welcome!  And thanks to <a href="http://eliw.com/">Eli White</a>, Community Relations Manager for <a href="http://zend.com/">Zend</a>, for selecting it for posting.</p>
<p>You can get all of the relevant info using the links below:</p>
<p><a href="http://www.deshong.net/2008/09/slides-zendcon-2008-rickroll-to-go/" target="_new">Slides and videos of the presentation materials</a><br />
<a href="http://devzone.zend.com/article/4871-The-ZendCon-Sessions-Episode-23-Rickroll-To-Go-With-PHP-WURFL-and-Other-Open-Source-Tools" target="_new">ZendCon Sessions page with audio</a><br />
<a href="http://devzone.zend.com/content/audio/zendcon_sessions/zendcon_sessions_podcast_023.mp3" target="_new">MP3 audio of the presentation</a><br />
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=310085132" target="_new">iTunes DevZone podcast</a></p>
<p>Enjoy, and thanks for listening!  Find me on <a href="http://twitter.com/bdeshong">Twitter</a> or <a href="mailto:brianNOSPAM@deshong.net">email me</a> if you&#8217;d like to discuss the materials.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2009/07/rickroll-zendcon-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://devzone.zend.com/content/audio/zendcon_sessions/zendcon_sessions_podcast_023.mp3" length="43557296" type="audio/mpeg" />
		</item>
		<item>
		<title>MySQL replication and the sync_binlog option</title>
		<link>http://www.deshong.net/2009/05/mysql-sync-binlog/</link>
		<comments>http://www.deshong.net/2009/05/mysql-sync-binlog/#comments</comments>
		<pubDate>Thu, 28 May 2009 01:16:13 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scalability]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=217</guid>
		<description><![CDATA[Recently I&#8217;ve been focusing on MySQL replication for a project at work. On this particular project, I&#8217;m acting in a Solutions Architect role and have been since about September of 2008. Because of my background in systems administration, I tend to get myself into situations where I become the Schematic-side sys admin on projects. This [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been focusing on MySQL replication for a project at <a href="http://www.schematic.com/">work</a>.  On this particular project, I&#8217;m acting in a <a href="http://en.wikipedia.org/wiki/Solutions_Architect">Solutions Architect</a> role and have been since about September of 2008.</p>
<p>Because of my background in systems administration, I tend to get myself into situations where I become the Schematic-side sys admin on projects.  This involves things like deployment processes, getting development, staging, and production environments setup, and now, setting up <a href="http://dev.mysql.com/doc/refman/5.0/en/replication.html">MySQL replication</a>.  This is probably because a) I&#8217;m probably bad at delegating these things to others, b) I&#8217;m kinda&#8217; good at it, and c) let&#8217;s be honest, I&#8217;m a control freak, so I like knowing the servers hosting my apps are setup in a meticulous manner.</p>
<p>In short, we&#8217;re running MySQL 5.0.45 on RedHat Enterprise Linux 5 (I know, I know&#8230;RedHat and MySQL 5.0&#8230;boo&#8230;but it&#8217;s okay).  We&#8217;re required to replicate our production database to a secondary machine for backup purposes.  This way, if our production server dies, we can manually failover to the slave (once we enable writes to it, of course), then swap the two back once the production server is back up.</p>
<p>All in all, this site is rather low-traffic at around 20,000 dynamic page views per day.  Factoring in US-based users in an 11 hour time period, that&#8217;s about 1,800 request per hour, or right around 0.5 page views per second.  We&#8217;ve got a single server in production that&#8217;s acting as our webserver and database server; it&#8217;s got a RAID array in it that was all setup by the group hosting the application (so I don&#8217;t know tons about it, but it&#8217;s new, quality hardware).</p>
<p>I&#8217;m using my master database for reads and writes in Production.  Again, the slave is really only required for live backup-type purposes.</p>
<p>Now, I&#8217;m no expert on MySQL replication, but I&#8217;ve learned a lot these past few weeks.  So I&#8217;m going to share one big caveat here.  Please correct me as you see fit!</p>
<p>MySQL&#8217;s got a <a href="http://dev.mysql.com/doc/refman/5.0/en/replication-options-binary-log.html#sysvar_sync_binlog">sync_binlog</a> configuration option.  You typically set it in my.cnf, and its value is an integer from 0-n.  This value determines how many <a href="http://dev.mysql.com/doc/refman/5.0/en/binary-log.html">binary log</a> writes need to occur before its contents are flushed out of the buffer and onto disk.  With it set to zero, your operating system just determines when the buffer is flushed to disk.</p>
<p>I have a database migration process that copies table structures and their data from PostgreSQL into MySQL, then basically migrates that data into the appropriate tables in the new MySQL instance.  It involves the transformation of a lot of data.  It&#8217;s a sizable, complete data set for 8+ year old system that&#8217;s not the prettiest, best normalized data model in the world.</p>
<p>Per recommendations in <a href="http://www.amazon.com/High-Performance-MySQL-Jeremy-Zawodny/dp/0596003064/ref=sr_1_2?ie=UTF8&#038;s=books&#038;qid=1243472126&#038;sr=8-2">High Performance MySQL</a>, <strong>I had my <code>sync_binlog</code> value set to 1 in Production</strong>.</p>
<p><strong>When I was performing a test migration to Production recently, the process took about 3 hours.</strong>  Wow.  Thanks, MySQL!  It normally takes about 90 minutes in Staging, if that.</p>
<p>In digging around Google and MySQL.com, I found that a non-zero value for <code>sync_binlog</code> causes more disk seeks to flush the binary log to disk.  The benefit of having it set to <code>1</code> is so that every transaction can be written to the binary log, which is then flushed to disk upon commit.  Then, if your server happens to die, the last completed transaction will always be present in the binary log on disk, so you never have to worry about, say, missing a transaction replay on your slaves.  However, this results in a lot more disk activity on your master.</p>
<p>I set <code>sync_binlog</code> to <code>0</code> and re-ran my migration.  It ran in 90 minutes &#8212; <strong>that&#8217;s a 50% performance gain</strong>!  Now, if you do the math, this makes sense.  It&#8217;s one less disk seek and write per-transaction, so this result totally makes sense.  Hooray for numbers, right?</p>
<p>I&#8217;m willing to gamble the integrity of data on my slave for the 50% performance increase.  <small>(remind me of this post in 6 months when I&#8217;m kicking myself over this for some reason, okay?)</small></p>
<p>With no binary logging enabled (i.e. in our dev environment), this process takes about 20 minutes.  This makes sense &#8212; far less disk writes during the process.</p>
<p>Another way to workaround this would be to keep your binary logs on a physically separate disk.  However, I don&#8217;t have that luxury at this point, so that&#8217;s not an option for me.  If I had my druthers, this is how I&#8217;d handle the problem, but&#8230;no dice for now.</p>
<p>Anyways, my main point: if you are willing to gamble with every single transaction being replicated to your slave in the event of a crash, perhaps you can set <code>sync_binlog</code> to <code>0</code>.  If you&#8217;ve got a separate disk to devote to your binary log, by all means, set it to <code>1</code>!  There are other concerns around this are related to battery-backed disk cache, which you can read a bit more about in <a href="http://www.mysqlperformanceblog.com/2006/05/27/jeremy-cole-on-mysql-replication/">Jeremy Cole&#8217;s post</a> on MySQL replication.  You can also see some handy <a href="http://www.mysqlperformanceblog.com/2006/05/19/group-commit-and-xa/">benchmarks</a> that compare MySQL with and without binary logging.</p>
<p>Finally, I&#8217;ll admit this is a bit of a knee-jerk reaction post.  I&#8217;ve done a bunch of research on this, but it&#8217;s not all quite fleshed out in my mind yet.  I get the whole cause and effect in theory, but I haven&#8217;t dug into MySQL source or other materials to <em>really</em> understand what&#8217;s going on behind the scenes.</p>
<p>MySQL replication is a tricky thing.  It&#8217;s great when it works, but understand that there are overhead tradeoffs in using it!  I&#8217;m sure I&#8217;ll learn more in the weeks and months following our launch, so I look forward to sharing more of my successes and/or pains on this.  Comments, feedback, and flames such as &#8220;OMG, you&#8217;re so wrong Brian!&#8221; and &#8220;Brian is a n00b!&#8221; are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2009/05/mysql-sync-binlog/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>&#8220;Rickroll&#8230;&#8221; goes to print with php&#124;architect!</title>
		<link>http://www.deshong.net/2009/01/rickroll-goes-to-print-with-phparchitect/</link>
		<comments>http://www.deshong.net/2009/01/rickroll-goes-to-print-with-phparchitect/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 03:23:14 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=180</guid>
		<description><![CDATA[One of my accomplishments during 2008 was preparing and presenting a new talk, &#8220;Rickroll To Go With WURFL, PHP, and Other Open Source Tools&#8221;. This talk focused on some of the challenges with delivering content to mobile device users, such as limited bandwidth, limited resources on the device, and varying device support for video and [...]]]></description>
			<content:encoded><![CDATA[<p>One of my accomplishments during 2008 was preparing and presenting a new talk, <a href="http://www.deshong.net/2008/09/slides-zendcon-2008-rickroll-to-go/">&#8220;Rickroll To Go With WURFL, PHP, and Other Open Source Tools&#8221;</a>.  This talk focused on some of the challenges with delivering content to mobile device users, such as limited bandwidth, limited resources on the device, and varying device support for video and audio formats.  It illustrated how to use tools such as the <a href="http://pecl.php.net/imagick/">imagick extension</a> and <a href="http://ffmpeg.org/">FFmpeg</a> to deliver content and an experience that was optimized for mobile devices.
</p>
<p>
Or, another way to refer to it: if you were ever at a PHP conference and heard of some dude Rickrolling a group during his talk, that was me.
</p>
<p>I gave this talk at <a href="http://atlantaphp.org/">Atlanta PHP</a>, <a href="http://www.zendcon.com/ZendCon08/public/schedule/detail/123">ZendCon 2008</a> and <a href="http://phpappalachia.org/">PHP Appalachia</a>, and received positive reception and feedback in all cases.
</p>
<p>
Now, in trying to knock out my <a href="http://www.deshong.net/2008/12/phptechnical-new-years-resolutions-2009/">New Year&#8217;s resolutions</a>, I am adapting this talk into an article for <a href="http://phparch.com/">php|architect</a>, which will be published around October 2009.
</p>
<p>
I&#8217;ve only got 3,000 words to work with, so I may not be able to address all three major content areas &#8212; images, video, and audio &#8212; but I&#8217;ll do what I can.  The <a href="http://www.phparch.com/c/phpa/magazine/about/authors,editorial_calendar">focus of the issue</a> will be &#8220;graphic manipulation,&#8221; so focusing on the image portion may end up making the most sense given the word limitations.  You don&#8217;t want to read more than 3,000 words worth of my ramblings anyway.
</p>
<p>
So, keep your eyes open for that issue later in the year!  Also, special thanks to <a href="http://naramore.net/blog/">Elizabeth Naramore</a>, <a href="http://www.treelinedesign.com/">Beth</a> <a href="http://twitter.com/e3BethT">Tucker Long</a>, and <a href="http://mtabini.blogspot.com/">Marco Tabini</a> for the opportunity to grace the pages of their fantastic publication with my words, ideas, and experience.
</p>
<p>
Also, another special thanks to my co-workers JP Crevoiserat and <a href="http://www.josephjorgensen.com/">Joseph Jorgensen</a> who worked with me on a project that inspired the talk and this article.  And as always, a special thanks for <a href="http://schematic.com/">Schematic</a> for always supporting the community-related efforts of its employees.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2009/01/rickroll-goes-to-print-with-phparchitect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Factory Method pattern; ATLPHP tonight!</title>
		<link>http://www.deshong.net/2009/01/factory-method-pattern-atlphp-tonight/</link>
		<comments>http://www.deshong.net/2009/01/factory-method-pattern-atlphp-tonight/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 21:59:51 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=169</guid>
		<description><![CDATA[I&#8217;ll be giving a &#8220;mini-talk&#8221; on the Factory Method pattern at Atlanta PHP this evening. Who doesn&#8217;t love the Factory Method pattern, right? Good stuff. A link to a PDF of the slides is below. I struggled to come up with a cool example, but an one related to cars was the best that I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be giving a &#8220;mini-talk&#8221; on the <a href="http://en.wikipedia.org/wiki/Factory_method_pattern">Factory Method pattern</a> at <a href="http://atlantaphp.org/">Atlanta PHP</a> this evening.
</p>
<p>
Who doesn&#8217;t love the Factory Method pattern, right?  Good stuff.  A link to a PDF of the slides is below.  I struggled to come up with a cool example, but an one related to cars was the best that I could do.  You&#8217;ll find some PHP-specific example code in the slides, too.
</p>
<p>
<a href="http://brian.deshong.net/talks/2009/atlphp/factory_method_pattern/factory_method_pattern.pdf">Grab the slides (PDF)</a>
</p>
<p>
For further reading on the Factory Method pattern and other classic design patterns, you can always grab a copy of <a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1231451809&#038;sr=8-1">Design Patterns: Elements of Reusable Object-Oriented Software</a>.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2009/01/factory-method-pattern-atlphp-tonight/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Seven Things</title>
		<link>http://www.deshong.net/2009/01/seven-things/</link>
		<comments>http://www.deshong.net/2009/01/seven-things/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 06:06:24 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=145</guid>
		<description><![CDATA[I&#8217;m getting in on this &#8220;Seven Things&#8221; deal by way of being &#8220;tagged&#8221; by Ben Ramsey. And yes, Ben, while I am technically your &#8220;boss,&#8221; we&#8217;re all still on vacation, so&#8230;that doesn&#8217;t count now. Or something. Cut it out. So, here are my seven things, which have been rolling around my head all day. Here [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;m getting in on this &#8220;Seven Things&#8221; deal by way of being &#8220;tagged&#8221; by <a href="http://benramsey.com/archives/seven-things/">Ben Ramsey</a>.  And yes, Ben, while I am technically your &#8220;boss,&#8221; we&#8217;re all still on vacation, so&#8230;that doesn&#8217;t count now.  Or something.  Cut it out.
</p>
<p>
So, here are my seven things, which have been rolling around my head all day.  Here we go:
</p>
<ul>
<li>I&#8217;m a triplet.  My other two brothers, <a href="http://flickr.com/photos/bdeshong/2826026702">Brad and Brent</a>, live in Baltimore and Kansas City respectively.  We were born one-minute apart.  Brad is also in the IT industry working for the government, while Brent is working for my Dad at <a href="http://midwesttowers.com/">Midwest Towers</a> in estimating, sales, repairs, etc. for <a href="http://en.wikipedia.org/wiki/Cooling_tower">cooling towers</a>.
<li>I started coding in BASIC on an Apple IIe around 4th or 5th grade.  I later expanded into GWBASIC on DOS, and took Pascal and other programming classes in high school.  Around age 14, I released various shareware applications written (and compiled!) in QuickBASIC under the name <em>Untitled Software</em>.  I received a handful of registrations for my &#8220;most popular&#8221; product, &#8220;Master Menu III,&#8221; which was a DOS-based application launcher (complete with VGA mode screensavers!).  My most distant registration was from the Netherlands, so I just gave him a free license in order to not deal with currency exchange stuff.</li>
<li>While working at <a href="http://bestbuy.com/">Best Buy</a> from Summer 1997 to December 1998, I had the <a href="http://flickr.com/photos/bdeshong/2374952865/">opportunity to wear the Idea Box costume</a> during a holiday season.  You can&#8217;t see them, but I&#8217;m wearing blue and yellow elf shoe covers over my shoes.  I also couldn&#8217;t talk, would just have to wave and shake hands with people.  My friends would come in the store, so I&#8217;d see them outside the mesh on the &#8220;B&#8221; in &#8220;Best&#8221; and break the no-talking rule.  Occasionally I&#8217;d roam around the store being goofy, while trying to not knock things over.  It was a great time!  Normally, I worked in the Media Department, which sold music, movies, and software.  Loved that job!</li>
<li>I moved from the suburbs of Kansas City, MO to New York City at the ripe old age of 19.  I was offered a job with <a href="http://benefitscheckup.org/">VitalAging (now BenefitsCheckUp.org)</a> as a Systems Administrator.  I had nothing to lose, so&#8230;why not?  Then I stayed there seven years before moving to Atlanta.  Brooklyn, represent!</li>
<li>After moving to the NYC area, I continued and completed my undergraduate education at <a href="http://www.baruch.cuny.edu/">Baruch College, CUNY</a> by going to school in the mornings and evenings, while still working full-time.  It was tough, but worth it.  I got my degree in Computer Information Systems (more business-, accounting-, and management-focused), which has turned out to be very practical.  I wish I had algorithms, compilers, and all of those other low-level Computer Science courses, but the practical things have served me very well.</li>
<li>I met my <a href="http://flickr.com/photos/bdeshong/3088101112/">wife</a>, found my job at <a href="http://schematic.com/">Schematic</a>, and my last Brooklyn apartment on <a href="http://newyork.craigslist.org/">Craigslist (NYC)</a>.
<li>I have a long family history of being a huge fan of <a href="http://hooters.com/">Hooters</a> (the restaurant).  I&#8217;ve been going there since I was pretty young.  Whenever we&#8217;d travel as a family, we&#8217;d stop at locations during our trip.  My Dad actually collects the menus for all of the ones be visits &#8212; he must have 50 to 60 at this point.  I once drove from Boston to NYC via Rhode Island just to be the first DeShong to visit a location in that state.  And yes, I took a menu and mailed it to my Dad.  I go for the food, though &#8212; I&#8217;ll even get takeout (when my wife refuses to go), which proves my devotion to the food.</li>
</ul>
<p>
And here are my lucky seven!
</p>
<ul>
<li><a href="http://robertswarthout.com/">Robert Swarthout</a> because I want to see if he&#8217;ll actually step up and write this blog post&#8230;and because he&#8217;s a co-worker of mine and a fellow Atlantan</li>
<li><a href="http://iamgraham.net/">Graham Christensen</a>, one of the youngest dudes in PHP, for having just visited Georgia, the state I now call home</li>
<li><a href="http://www.shawnstratton.info/">Shawn Stratton</a> for being another fellow Atlantan, and for that time we randomly bumped into each other at the Envelope Building downtown</li>
<li><a href="http://brian.moonspot.net/">Brian Moon</a> for being my PHP Appalachia 2008 &#8220;Team Haystacks&#8221; teammate, and a fellow southerner</li>
<li><a href="http://blog.casey-sweat.us/">Jason Sweat</a> for attending my talk(s) at php|tek 2008, and having some awesome feedback.  And for having an awesome last name?</li>
<li><a href="http://usrportage.de/">Lars Strojny</a> for proving some comments and feedback on my Zend_Log_Writer_Mail proposal</li>
<li><a href="http://debuggable.com/">Nate Abele</a> for being the CakePHP and OmniTI dude, and for that time a handful of us went drinking and to the Comedy Cellar in NYC</li>
</ul>
<p>
And, of course, the rules:</p>
<ul>
<li>Link your original tagger(s), and list these rules on your blog.</li>
<li>Share seven facts about yourself in the post &#8211; some random, some weird.</li>
<li>Tag seven people at the end of your post by leaving their names and the links to their blogs.</li>
<li>Let them know they&#8217;ve been tagged by leaving a comment on their blogs and/or Twitter.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2009/01/seven-things/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Converting lowercase_with_underscores to camelCase</title>
		<link>http://www.deshong.net/2008/12/converting-lowercase_with_underscores-to-camelcase/</link>
		<comments>http://www.deshong.net/2008/12/converting-lowercase_with_underscores-to-camelcase/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 05:34:10 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=135</guid>
		<description><![CDATA[I have a case where I&#8217;m retrieving an array of associative arrays from a database as shown below: Array ( [0] => Array ( [id] => 1 [some_id] => 100001 [some_company_name] => Foo [name] => Bar [created] => 2008-12-25 21:13:58 [last_updated] => 2008-12-30 23:32:43 ) ) &#8230;but I need to represent this structure in XML. [...]]]></description>
			<content:encoded><![CDATA[<p>I have a case where I&#8217;m retrieving an array of associative arrays from a database as shown below:</p>
<pre>
Array
(
    [0] => Array
        (
            [id] => 1
            [some_id] => 100001
            [some_company_name] => Foo
            [name] => Bar
            [created] => 2008-12-25 21:13:58
            [last_updated] => 2008-12-30 23:32:43
        )

)
</pre>
<p>&#8230;but I need to represent this structure in XML.  I have a pre-defined standard in my XML request/response that the element names are to be <a href="http://en.wikipedia.org/wiki/CamelCase">camel cased</a>.</p>
<p>Aliasing the field names at the query level is just&#8230;a hack.  So, I needed a way to convert &#8220;foo_bar_baz&#8221; to &#8220;fooBarBaz&#8221; before adding the XML element.</p>
<p>To do this, you can use <a href="http://php.net/preg_replace_callback">preg_replace_callback()</a> as shown below, which uses a callback function on every match found.</p>
<pre>
class FooController
{
    public function barAction()
    {
        $dao = new Some_Dao();
        $rows = $dao->getWhateverRows();

        foreach ($rows as $row) {
            foreach ($row as $key => $value) {
                // $key is "foo_bar_baz"
                $key = preg_replace_callback(
                    '/_(\w)/',
                    array($this, '_convertToCamelCase'),
                    $key);

            // $key is now "fooBarBaz"
            }
        }
    }

    private function _convertToCamelCase(array $matches)
    {
         return ucfirst($matches[1]);
    }
}
</pre>
<p>There is an <code>e</code> modifier that can be used with <a href="http://php.net/preg_replace">preg_replace()</a>, but that requires the replacement string to be a valid string of PHP code.  This forces the interpreter to parse the replacement string into PHP on each iteration, which can be quite inefficient.  Instead, the <code>preg_replace_callback()</code> uses a callback function, which only needs to be parsed once.</p>
<p>I suppose you could easily do the reverse, though I haven&#8217;t had a need to write that code yet.  <img src='http://www.deshong.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   But&#8230;there you go!  A little end-of-year tip from myself and the <a href="http://php.net/preg_replace">preg_replace() examples</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2008/12/converting-lowercase_with_underscores-to-camelcase/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend_Log_Writer_Mail: approved for Standard Incubator!</title>
		<link>http://www.deshong.net/2008/12/zend_log_writer_mail-approved-for-standard-incubator/</link>
		<comments>http://www.deshong.net/2008/12/zend_log_writer_mail-approved-for-standard-incubator/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 00:07:20 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=130</guid>
		<description><![CDATA[As a follow-up to my recent post, my Zend_Log_Writer_Mail proposal has been accepted as-is into the Zend Framework Standard Incubator! Thanks to Matthew Weier O&#8217;Phinney, my Zend Liasion, and everyone else that commented on it, reviewed it, and weighed in during the review process. Truth be told, it&#8217;s a really simple, silly component, but based [...]]]></description>
			<content:encoded><![CDATA[<p>As a follow-up to my <a href="http://www.deshong.net/?p=111">recent post</a>, my <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Log_Writer_Mail">Zend_Log_Writer_Mail proposal</a> has been accepted as-is into the <a href="http://framework.zend.com/">Zend Framework</a> Standard Incubator!</p>
<p>Thanks to <a href="http://weierophinney.net/matthew/">Matthew Weier O&#8217;Phinney</a>, my Zend Liasion</a>, and everyone else that commented on it, reviewed it, and weighed in during the review process.</p>
<p>Truth be told, it&#8217;s a really simple, silly component, but based on some feedback received, a handful of people should find it useful.</p>
<p>I&#8217;ve now got to write some unit tests and documentation, but I&#8217;m hoping to get it into the repository by January 4th or so.  I&#8217;ve got a bit more work to do, but&#8230;hooray!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2008/12/zend_log_writer_mail-approved-for-standard-incubator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP/technical New Year&#8217;s resolutions &#8211; 2009</title>
		<link>http://www.deshong.net/2008/12/phptechnical-new-years-resolutions-2009/</link>
		<comments>http://www.deshong.net/2008/12/phptechnical-new-years-resolutions-2009/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 13:59:56 +0000</pubDate>
		<dc:creator>Brian DeShong</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.deshong.net/?p=117</guid>
		<description><![CDATA[Reflecting on my 2008 New Year&#8217;s resolutions, I didn&#8217;t accomplish all of them. The only one I really even began to tackle was contributing to Zend Framework. I participated in PHP TestFest, and my tests ended up making their way into CVS, so that was a nice surprise. I did manage to speak at both [...]]]></description>
			<content:encoded><![CDATA[<p>Reflecting on my <a href="http://www.deshong.net/?p=66">2008 New Year&#8217;s resolutions</a>, I didn&#8217;t accomplish all of them.  The only one I really even began to tackle was <a href="http://www.deshong.net/?p=111">contributing to Zend Framework</a>.</p>
<p>I participated in <a href="http://testfest.php.net/">PHP TestFest</a>, and <a href="">my tests ended up making their way into CVS</a>, so that was a nice surprise.  I did manage to speak at both <a href="http://tek.mtacon.com/">php|tek 2008</a> and <a href="http://zendcon.com/">ZendCon 2008</a>, so that was good&#8230;though not really a resolution of mine.</p>
<p>Regardless, it&#8217;s been a good year for accomplishing some of my technical- and PHP-related goals.  But what about 2009?</p>
<p>Well, since it&#8217;s public knowledge now, my wife and I are expecting our first child in June 2009 (woohoo!), so I&#8217;m going to be taking a bit of time off of the conference circuit.  I specifically didn&#8217;t propose anything for <a href="http://tek.mtacon.com/">php|tek 2009</a>, because it&#8217;s due to take place just a few weeks before the kid&#8217;s due date, so I don&#8217;t want to be away from home at such an important time.  Maybe I&#8217;ll supplement that with more talks at <a href="http://atlantaphp.org/">Atlanta PHP</a>?</p>
<p>So, since I&#8217;ll be stepping back from conferences a bit, what <em>will</em> I be focusing on?  Here are some of my PHP/technical resolutions for 2009:</p>
<ul>
<li><b>Continue contributing to <a href="http://framework.zend.com/">Zend Framework</a>: </b> With my first proposal now in the state of &#8220;Pending Recommendation,&#8221; I&#8217;d like to start drafting a proposal for a Zend_Cache_Profiler of sorts, ala <a href="http://framework.zend.com/manual/en/zend.db.profiler.html">Zend_Db_Profiler</a>.  I&#8217;ll be looking to write up and submit that proposal within Q1 2009, I think.</li>
<li><b>Contribute to <a href="http://phparch.com/">php|architect</a>:</b> The <a href="http://www.phparch.com/c/phpa/magazine/about/authors,editorial_calendar">2009 Editorial Calendar</a> for php|architect has been released.  There are at least two topics in there that I&#8217;d love to write on.  Specifically, I want to attempt to adapt my <a href="http://www.deshong.net/?p=77">&#8220;Rickroll To Go With PHP, WURFL, and Other Open Source Tools&#8221;</a> presentation into an article format.  That should prove to be an interesting, entertaining challenge.</li>
<li><b>Catch up on my list of technical books I want to read:</b> My Amazon Wish List is filled with <a href="http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/ref=wl_it_dp?ie=UTF8&#038;coliid=I2PDN20689MQFP&#038;colid=3SZHWKE2IYIQR">all</a> <a href="http://www.amazon.com/Code-Craft-Practice-Writing-Excellent/dp/1593271190/ref=wl_it_dp?ie=UTF8&#038;coliid=IOK9X0JLWRANW&#038;colid=3SZHWKE2IYIQR">kinds</a> <a href="http://www.amazon.com/Career-Programmer-Guerilla-Tactics-Imperfect/dp/1590596242/ref=wl_it_dp?ie=UTF8&#038;coliid=I349YLUZR2LN01&#038;colid=3SZHWKE2IYIQR">of</a> <a href="http://www.amazon.com/Perfect-Software-Other-Illusions-Testing/dp/0932633692/ref=wl_it_dp?ie=UTF8&#038;coliid=I7KZT5HB2YJ5D&#038;colid=3SZHWKE2IYIQR">books</a> that I want to read, so I&#8217;m really hoping to get through a handful of them this year.</li>
<li><b>Finish my iPhone game</b>: It&#8217;s a super top secret idea, of course, but the gameplay is largely done and works well.  I&#8217;ve got to work on scoring, how leveling works, preferences, and finally, graphic design.  So&#8230;I&#8217;ve got a long way to go on that.  It&#8217;s been a great exercise in learning UIKit/Objective-C!</li>
<li><b>Write an OS X Memcached GUI monitoring/profiling client?:</b> I&#8217;ve wanted to build a little OS X desktop app for monitoring the performance of Memcached servers for a while now &#8212; think cool graphs of gets, puts, evictions, bytes used, etc.  Something that, if you managed a pool of many Memcached servers, that it&#8217;d come in really handy at giving you a snapshot of performance and potential areas of improvement.  This would be another great exercise at learning more about Cocoa/Objective-C, too.  Desktop software development just feels a bit more legitimate sometimes, ya&#8217; know?  Or maybe that&#8217;s just me.</li>
</ul>
<p>So, I think that&#8217;s it for now.  We&#8217;ll see how I do this year.</p>
<p>Happy holidays to everyone!  See you in 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deshong.net/2008/12/phptechnical-new-years-resolutions-2009/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
