<?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>Michael Barrett &#187; Work</title>
	<atom:link href="http://abouthalf.com/category/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://abouthalf.com</link>
	<description>@ Abouthalf.com</description>
	<lastBuildDate>Mon, 21 Jun 2010 02:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Setting up PHP in Mac OS X 10.6 Snow Leopard</title>
		<link>http://abouthalf.com/2009/08/29/php-in-snow-leopard/</link>
		<comments>http://abouthalf.com/2009/08/29/php-in-snow-leopard/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 22:07:52 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=243</guid>
		<description><![CDATA[I updated my Mac with OS X 10.6 last night and the process went very smoothly without any problems. Apple does a good job with OS upgrades and installs, and they almost always go very smoothly. Most users can just pop in the disk, click the button, restart and go. In my case, I use [...]]]></description>
			<content:encoded><![CDATA[<p>I updated my Mac with OS X 10.6 last night and the process went very smoothly without any problems. Apple does a good job with OS upgrades and installs, and they almost always go very smoothly. Most users can just pop in the disk, click the button, restart and go.</p>
<p>In my case, I use my Mac for web development in PHP so I had a couple of extra tasks to perform.</p>
<p>I prefer to use the internal Apache 2 web server provided by Apple &#8211; mostly because it can be enabled and disabled with a click on a System Preference panel and the built in system log browser (Console.app) reports errors in Apache and PHP. Handy.</p>
<p>In the past I used pre-built and packaged PHP module from <a href="http://www.entropy.ch/software/macosx/php/">Mark Liyanage</a> &#8211; his package is the defacto standard for PHP development on a Mac, it&#8217;s linked from the <a href="http://www.php.net/downloads.php">PHP.net</a> site directly. Mark&#8217;s packages always work very well and have anything and everything you could want in a PHP binary. His packages are intended to work with the built in apache web server.</p>
<p>But Mark is only one man, and he can&#8217;t be expected to crank out a PHP package the same day a new operating system is released. Man&#8217;s got to eat.</p>
<p>Apple has bundled PHP (along with Ruby, Java, Python, and other developer tools) with Mac OS X from the beginning. However Apple&#8217;s versions of PHP are not always the most current, or may be missing features. Fore example, in OS X 10.5 Apple didn&#8217;t include PDO drivers for MySQL &#8211; which is a weird thing to leave out &#8211; but there you go. Thus most developers either compile their own versions of PHP (and ruby, and python, etc) or rely on a prepackaged binary.</p>
<p>However this time around, Apple&#8217;s included version of PHP is up to date and full featured (enough to be useful).</p>
<p>PHP 5.3 is included in Mac OS X 10.6 by default and this time they didn&#8217;t forget the PDO drivers for MySQL. Whee! Here is the configure command from the built in PHP on my system:</p>
<pre>'/var/tmp/apache_mod_php/apache_mod_php-53~1/php/configure'
'--prefix=/usr'
'--mandir=/usr/share/man'
'--infodir=/usr/share/info'
'--disable-dependency-tracking'
'--sysconfdir=/private/etc'
'--with-apxs2=/usr/sbin/apxs'
'--enable-cli'
'--with-config-file-path=/etc'
'--with-libxml-dir=/usr'
'--with-openssl=/usr'
'--with-kerberos=/usr'
'--with-zlib=/usr'
'--enable-bcmath'
'--with-bz2=/usr'
'--enable-calendar'
'--with-curl=/usr'
'--enable-exif'
'--enable-ftp'
'--with-gd'
'--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-53~1/Root/usr/local'
'--with-png-dir=/BinaryCache/apache_mod_php/apache_mod_php-53~1/Root/usr/local'
'--enable-gd-native-ttf'
'--with-ldap=/usr'
'--with-ldap-sasl=/usr'
'--enable-mbstring'
'--enable-mbregex'
'--with-mysql=mysqlnd'
'--with-mysqli=mysqlnd'
'--with-pdo-mysql=mysqlnd'
'--with-mysql-sock=/var/mysql/mysql.sock'
'--with-iodbc=/usr'
'--enable-shmop'
'--with-snmp=/usr'
'--enable-soap'
'--enable-sockets'
'--enable-sysvmsg'
'--enable-sysvsem'
'--enable-sysvshm'
'--with-xmlrpc'
'--with-iconv-dir=/usr'
'--with-xsl=/usr'
'--with-pcre-regex=/usr'</pre>
<p>Look at all those goodies. This has everything I need for my current development needs, so I didn&#8217;t bother with building my own PHP.</p>
<p>Before I began the upgrade process I made a copy of my apache configuration files. By default, apache on OS X creates a configuration file for each user account on the computer. These configuration files can be found in /etc/apache2/users/ and are named with your short user name, followed by &#8220;.conf&#8221; e.g. &#8220;username.conf&#8221;</p>
<p>I keep all of my apache development configurations in my user configuration file, so I just made a copy of that file and stashed it on my desktop.</p>
<p>While I&#8217;m comfortable mucking about in the command line, I&#8217;m a visual person and I prefer to see what I&#8217;m doing. Mac OS X typically hides the unix system files in the Finder &#8211; this prevents horrible accidents &#8211; but you can still use the Finder to dig around in the hidden file system.</p>
<p>In the Finder (i.e. click the desktop) select the &#8220;Go&#8221; menu at the top of the screen, look for the &#8220;Go to folder…&#8221; option.</p>
<p><img class="alignnone size-full wp-image-246" title="go-to-folder" src="/wp-content/uploads/2009/08/go-to-folder.png" alt="go-to-folder" width="335" height="360" /></p>
<p>This will bring up the following screen, where you can type the file path you want. You can even tab-complete path names.</p>
<p><img class="alignnone size-full wp-image-248" title="Go" src="/wp-content/uploads/2009/08/go-screen.png" alt="Go" width="509" height="229" /></p>
<p>Now you can browse all those sneaky hidden files, right-click them and edit them in TextMate</p>
<p><img class="alignnone size-full wp-image-249" title="Apache2 folder" src="/wp-content/uploads/2009/08/apache2_folder.png" alt="Apache2 folder" width="625" height="454" /></p>
<p>From here I could just drag the httpd.conf file to my desktop, and then dig into the users directory find my configuration file, and drag that to the desktop.</p>
<p>Next I made a back up of my MySQL databases by opening Terminal and typing:</p>
<p>
<pre><code>mysqldump -u root -p<em>password</em> --all-databases &gt; mysql_backup.sql</code></pre>
</p>
<p>Naturally you should use your own MySQL root password and not &#8220;password&#8221;. Naturally. This backup includes user tables as well as your databases, allowing you to reimport the whole kielbasa.</p>
<p>I ran a manual TimeMachine backup one more time to make sure I got everything backed up and then I ran the OS X 10.6 installer. Point. Click. Wait. Restart. Restart. Done. Easy.</p>
<p>After the update was done, I downloaded a new 64 bit intel installer for MySQL 5.0 here: http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg &#8211; the site indicates OS X 10.5 but it works fine in 10.6</p>
<p>I reinstalled MySQL, the StartupItem, and the System Preference panel. From the command line I ran the following to reimport all of my data and users:</p>
<p>
<pre><code>mysql --user=root --password=<em>password</em> &lt; mysql_backup.sql</code></pre>
</p>
<p>The 10.6 installer honored my existing apache configuration files, so I didn&#8217;t actually have to replace those. But if you have never enabled PHP, simply go to /etc/apache2/ and edit httpd.conf in TextMate (TextMate will ask for your administrator password to save the file). Look for the line which reads:</p>
<p>
<pre><code>#LoadModule php5_module        libexec/apache2/libphp5.so</code></pre>
</p>
<p>Remove the pound sign (#) and save the file.</p>
<p>The default PHP installation on Mac OS X does not ship with a php.ini file. You&#8217;ll need to create one in order to configure PHP to find MySQL.</p>
<p>Go to /etc using the &#8220;Go&#8221; menu as indicated above. You should see a file entitled php.ini.default. Open this file in TextMate and save as &#8220;php.ini&#8221;</p>
<p>Set the server time zone by searching for &#8220;date.timezone&#8221; and setting the appropriate time zone ID from the lists here: <a href="http://us2.php.net/manual/en/timezones.php">http://us2.php.net/manual/en/timezones.php</a></p>
<p>I&#8217;m on the west coast, so I use <code>date.timezone = America/Los_Angeles</code></p>
<p>Note that there are no quotes around the time zone ID.</p>
<p>Next, you&#8217;ll need to point PHP to the mysql.sock file. The default values are incorrect. Search for &#8220;mysql.sock&#8221; and change each configuration to point to /tmp/mysql.sock &#8211; you should find three instances to change.</p>
<p>
<pre>pdo_mysql.default_socket=/tmp/mysql.sock</pre>
<pre>mysql.default_socket = /tmp/mysql.sock</pre>
<pre>mysqli.default_socket = /tmp/mysql.sock</pre>
</p>
<p>(In previous versions, Mac OS X kept the mysql.sock file at /var/mysql/mysql.sock &#8211; the new location is more standard)</p>
<p>If you are a seasoned PHP developer you may wish to make other configuration changes at this time. If not, leave the rest alone.</p>
<p>Save and close the file.</p>
<p>All that is left to do now is to open System Preferences, launch the MySQL system preference and start the server. Show All, select &#8220;Sharing&#8221; and check the box next to &#8220;Web Sharing&#8221; from the list of options.</p>
<p>To verify everything works &#8211; create a text file in your Sites directory called php_info.php and include the following:</p>
<p><code>&lt;?php phpinfo() ?&gt;</code></p>
<p>Load this file up in your browser at http://localhost/~username/php_info.php (replacing &#8216;username&#8217; with your user name) and you should see a nicely formatted list of all your PHP configurations.</p>
<p>Enjoy.</p>
<p>UPDATE: Rob Allen has some instructions up which include configuring Xdebug &#8211; very handy: <a href="http://akrabat.com/2009/10/05/setting-up-php-mysql-on-os-x-10-6-snow-leopard/">http://akrabat.com/2009/10/05/setting-up-php-mysql-on-os-x-10-6-snow-leopard/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2009/08/29/php-in-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Weekend Round-up</title>
		<link>http://abouthalf.com/2008/07/06/weekend-round-up/</link>
		<comments>http://abouthalf.com/2008/07/06/weekend-round-up/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 18:47:49 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Play]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://abouthalf.com/?p=150</guid>
		<description><![CDATA[Just when I thought &#8220;A List Apart&#8221; had become a useless dried up husk of RoR wankers, they turn around and publish this gem of an article: Getting Out of Binding Situations in JavaScript I&#8217;ve read various descriptions of &#8216;binding&#8217; in JavaScript before, but this is probably the most clear explanation I&#8217;ve seen. As a [...]]]></description>
			<content:encoded><![CDATA[<p>Just when I thought &#8220;A List Apart&#8221; had become a useless dried up husk of RoR wankers, they turn around and publish this gem of an article: <a href="http://www.alistapart.com/articles/getoutbindingsituations">Getting Out of Binding Situations in JavaScript</a></p>
<p>I&#8217;ve read various descriptions of &#8216;binding&#8217; in JavaScript before, but this is probably the most clear explanation I&#8217;ve seen. As a bonus, someone in the comments linked to this fine, incredibly thorough, advanced discussion of binding: <a href="http://www.brockman.se/writing/method-references.html.utf8">Object-Oriented Event Listening through Partial Application in JavaScript</a>.</p>
<p>You can tell by the title that this article is not for the faint of heart. (hint: start with the ALA article)</p>
<hr />
<p><a href="http://37signals.blogs.com/products/2008/07/basecamp-phasin.html">37 Signlas</a> is dropping support for Internet Explorer 6. It must be nice to fire your customers from time to time.</p>
<hr />
<p><img src="http://abouthalf.com/wp-content/uploads/2008/07/me-and-she-at-the-beach.jpg" alt="Me and She at the beach" title="me-and-she-at-the-beach" width="350" height="262" class="alignnone size-full wp-image-151" /></p>
<p>The missus and spent a lovely Saturday at Cannon Beach, OR. We had it all. Blankets, towels, trashy magazines to read, hot dogs, marshmallows. Except Ketchup. And Sunscreen. Ouch.</p>
<hr />
<p>The first anniversary is fast approaching. We&#8217;re taking the train up to Seattle to stay in a kitschy old <a href="http://www.moorehotel.com/">hotel</a> and eat at a swanky tucked away <a href="http://www.thepinkdoor.net/">restaurant</a> rumored to have a trapeze act and a burlesque show. Ooh La La.</p>
<hr />
<p><img src="http://abouthalf.com/wp-content/uploads/2008/07/independence-day-with-a-dutchman.jpg" alt="Independence Day with a Dutchman" title="independence-day-with-a-dutchman" width="350" height="262" class="alignnone size-full wp-image-152" /></p>
<p>I spent part of the Fourth in a friend&#8217;s back yard grilling various things and eating fancy cheese. We had a Dutchman (pictured) and a Brit in attendance (along with various liberal Portlandy types). Viva La Independencia.</p>
<hr />
<p>I&#8217;ve caved into the pressure and signed up on the <a href="http://www.facebook.com/profile.php?id=1327749623">Facebook</a>. And while I&#8217;m at it, I&#8217;m on the <a href="http://www.linkedin.com/in/abouthalf">LinkedIn</a> too. Damn kids. And their internets.</p>
<p>I&#8217;ve been using the <a href="http://twitter.com/device55">Twitter</a> lately also. I&#8217;m not sure how I feel about it. Like any good RoR app: it&#8217;s horribly unreliable; it&#8217;s purpose is rather unclear; and all the cool kids are doing it. Twitter claims to be a &#8220;micro blogging&#8221; application, but people use it as an ad-hoc messaging system or bulletin board. It is useful for keeping up with prolific bloggers. The <a href="http://twitter.com/MarsPhoenix">Mars Phoenix program</a> has been posting updates as well, which is fairly neato. However, <em>I&#8217;m</em> not convinced it&#8217;s worth <em>my</em> time to post anything.</p>
]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2008/07/06/weekend-round-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Update(s)</title>
		<link>http://abouthalf.com/2007/09/09/software-updates/</link>
		<comments>http://abouthalf.com/2007/09/09/software-updates/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 00:42:38 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.abouthalf.com/2007/09/09/software-updates/</guid>
		<description><![CDATA[So I made the switch-a-roo and dumped MS Office of my system (safely archived on the original install CDs). Above you see a sliver of the Terminal, Activity Monitor (&#8216;cuz it&#8217;s neat), Coda, Numbers, Pages, and NeoOffice. NeoOffice is there to do &#8220;heavy lifting&#8221; in case I run across some Office-y type function I can [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.abouthalf.com/wp-content/uploads/2007/09/dock1.jpg' alt='On the dock at the bay' /></p>
<p>So I made the switch-a-roo and dumped MS Office of my system (safely archived on the original install CDs).</p>
<p>Above you see a sliver of the Terminal, Activity Monitor (&#8216;cuz it&#8217;s neat), Coda, Numbers, Pages, and NeoOffice.</p>
<p>NeoOffice is there to do &#8220;heavy lifting&#8221; in case I run across some Office-y type function I can handle with Numbers or Pages. You know serious things like printing one mailing label in the middle of a sheet. You know. <em>Hard core</em> functionality.</p>
<p>I&#8217;ve also moved Abouthalf to WordPress.</p>
<p>I&#8217;ve been using <a href="http://wordpress.org">WordPress</a> on <a href="http://www.blueplatebachelor.com/">BluePlate Bachelor</a> for quite a while and I finally decided to make the switch.</p>
<p>WordPress has two big pluses over <a href="http://www.realmacsoftware.com/rapidweaver/">RapidWeaver</a>.</p>
<ol>
<li>It&#8217;s not platform specific</li>
<li>It imports <em>and</em> exports a variety of formats.</li>
<li>One can edit a theme <em>inline and on-the-fly</em></li>
<li>It doesn&#8217;t bug me to upgrade every time I launch it
</li>
</ol>
<p>Four. Four big pluses.</p>
<p>I am using the nifty <a href="http://www.informationarchitects.jp/the-ideal-website">&#8220;Ideal Website Theme&#8221;</a> from <a href="http://www.informationarchitects.jp/the-ideal-website">InformationArchitects.jp</a>.</p>
<p>I like the clean simplicity of the design, I like the placement of archives as links at the bottom and other features. I figure this was a nice palette cleanser while I figure out how I want Abouthalf to work in the future.</p>
<p>WordPress is a nice product for an end-user to work with. As a developer, I look at some of the plug-in code and shudder. WordPress is a very typical PHP application, and all that that implies. This is not relevant though. The blogging/writing interface is nice and clean, and I can export my data, or dig it out of my database however I want, meaning I can change my little mind any time I want.</p>
<p>Speaking of horrible PHP code, I&#8217;ve been working with the <a href="http://framework.zend.org/">Zend Framework</a> over the past few days, writing a &#8216;back office&#8217; for a shopping cart.</p>
<p>It&#8217;s very nice. No really. It de-crappifies a lot of the problems with PHP application writing. The framework is PHP 5 only, which some my deride, I applaud. </p>
<p>The framework has a lot of the features that you mind find in Cake or Ruby On Rails. A Object-Relational-Data  system, a controller object with view objects, a &#8220;Front Controller&#8221; class if you want to implement a full application.</p>
<p>I tried noodling around with CakePHP a few times. Went through the docs, tried the blog tutorial, tried it again. I always found it very counter-intuitive, and counter PHP.</p>
<p>One problem I find with CakePHP is that while it&#8217;s powerful, you can&#8217;t leverage any piece of the framework by itself easily. For example. Say you&#8217;ve got an existing web site&#8230;and you want to add on one simple data entry form. Cake wants you to build a whole app. While you hypothetically <em>could</em> extract its implementation of ActiveRecord, it wouldn&#8217;t be <em>easy</em>.</p>
<p>With Zend Framework you have the option of using only bits of the framework in a decoupled fashion.</p>
<p>So, for example, if your data-entry form only has one view, and one action, and it&#8217;s the only form you&#8217;re making, then you can just use the Zend_Db and Zend_Table classes and be done with it. If it gets slightly more complex, you could &#8211; at any time &#8211; <em>add in</em> a controller object &#8211; and then <em>add in</em> add in a view object when and <em>if</em> you need to. <strong>Nice.</strong></p>
<p>In the past week I&#8217;ve found it to be easy to under stand and work with. The documentation on the individual components is pretty solid&#8230;however you may need to hunt for a good &#8220;putting it all together&#8221; tutorial. I&#8217;ve found two good ones by the same guy:</p>
<ul>
<li><a href="http://akrabat.com/zend-framework-tutorial/">http://akrabat.com/zend-framework-tutorial/</a></li>
<li><a href="http://akrabat.com/zend-auth-tutorial/">http://akrabat.com/zend-auth-tutorial/</a></li>
</ul>
<p>Coming soon I&#8217;ll detail how I used the Zend_View class in coordination with the Zend_Mail class to send notification emails from within a controller action method.</p>
]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2007/09/09/software-updates/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Work Perk</title>
		<link>http://abouthalf.com/2007/06/11/work-perk/</link>
		<comments>http://abouthalf.com/2007/06/11/work-perk/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 05:42:39 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.abouthalf.com/?p=7</guid>
		<description><![CDATA[One of the fun parts of working for a company which manufactures trucks, is seeing great big trucks The new Cascadia]]></description>
			<content:encoded><![CDATA[<p>One of the fun parts of working for a company which manufactures trucks, is seeing great big trucks</p>
<p style="text-align:center;" ><img class="imageStyle" alt="Mud Flap" src="http://www.abouthalf.com/files//CascadiaMudFlap.jpg"width="400" height="300"/></p>
<p><img class="imageStyle" alt="Wheel Well" src="http://www.abouthalf.com/files//CascadiaWheelWell.jpg"width="400" height="300"/></p>
<p><img class="imageStyle" alt="grill" src="http://www.abouthalf.com/files//CascadiaGrill.jpg"width="300" height="400"/></p>
<p>The new <a href="http://www.drivecascadia.com" rel="self">Cascadia</a></p>
]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2007/06/11/work-perk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New View</title>
		<link>http://abouthalf.com/2007/01/27/new-view/</link>
		<comments>http://abouthalf.com/2007/01/27/new-view/#comments</comments>
		<pubDate>Sat, 27 Jan 2007 18:23:16 +0000</pubDate>
		<dc:creator>MB</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.abouthalf.com/?p=39</guid>
		<description><![CDATA[View from new desk.]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;" ><img class="imageStyle" alt="unknown" src="http://www.abouthalf.com/files//page0_blog_entry45_1.jpg"width="288" height="352"/><br />View from new desk.</p>
]]></content:encoded>
			<wfw:commentRss>http://abouthalf.com/2007/01/27/new-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.706 seconds -->
