<?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>Aaron Brazell<title>&#187; Code</title>
</title>
	<atom:link href="http://aaronbrazell.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://aaronbrazell.com</link>
	<description>Unplugged.</description>
	<lastBuildDate>Tue, 01 Jun 2010 16:27:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Fun With Programming Languages</title>
		<link>http://aaronbrazell.com/2009/02/26/fun-with-programming-languages/</link>
		<comments>http://aaronbrazell.com/2009/02/26/fun-with-programming-languages/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 05:03:55 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://aaronbrazell.com/?p=164</guid>
		<description><![CDATA[Tonight, a Facebook thread got a little out of control after I posted a status update that I was &#8220;mentally bankrupt.&#8221; It was a long day working on client work &#8211; a project that is just about done but past due. After some commentary by Facebook friends, we got to writing little scripts that would [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight, a Facebook thread got a little out of control after I posted a status update that I was &#8220;mentally bankrupt.&#8221; It was a long day working on client work &#8211; a project that is just about done but past due.</p>
<p>After some commentary by Facebook friends, we got to writing little scripts that would take a random selection from a group of adjectives and adverbs and put similar phrases together randomly.</p>
<p>What came of this exercise was a fun little jaunt into a variety of programming languages.</p>
<p><strong>PHP</strong><br />
[cc lang="php"]<?php<br />
$adverbs = array(<br />
	'mentally',<br />
	'morally',<br />
	'emotionally',<br />
	'socially',<br />
	'psychologically'<br />
);</p>
<p>$adjectives = array(<br />
	'devoid',<br />
	'bankrupt',<br />
	'empty',<br />
	'hollow',<br />
	'vacant',<br />
	'sleeping with fishes',<br />
	'taking a dirt nap',<br />
	'shallow'<br />
);</p>
<p>echo $adverbs[array_rand( $adverbs )] . ' '<br />
	. $adjectives[array_rand( $adjectives )];<br />
?>[/cc]<br />
<strong>Ruby</strong><br />
[cc lang="ruby"]<br />
adj = [ "mentally", "morally",<br />
	"emotionally", "socially",<br />
	"psychologically" ]</p>
<p>adv = [ "devoid","bankrupt",<br />
	"empty", "hollow","vacant",<br />
	"sleeping with fishes",<br />
	"taking a dirt nap","shallow" ]</p>
<p>print adj[rand(adj.length)] + &#8221; &#8221;<br />
	+ adv[rand(adv.length)] + &#8220;\n&#8221;<br />
[/cc]</p>
<p><strong>Python</strong><br />
[cc lang="python"]<br />
import random</p>
<p>def popchoice(seq):<br />
    return seq.pop(random.randrange(len(seq)))</p>
<p>adj = [ 'mentally', 'morally',<br />
	'emotionally', 'socially',<br />
	'psychologically' ]</p>
<p>adv = [ 'devoid','bankrupt','empty',<br />
	'hollow','vacant','sleeping with fishes',<br />
	'taking a dirt nap','shallow' ]</p>
<p>print popchoice(adj) + &#8221; &#8221;<br />
	+ popchoice(adv)<br />
[/cc]</p>
<p><strong>SQL</strong><br />
[cc lang="sql"]CREATE TEMPORARY TABLE adjectives (<br />
    adjective VARCHAR (30) NOT NULL<br />
    );</p>
<p>CREATE TEMPORARY TABLE adverbs (<br />
    adverb VARCHAR (30) NOT NULL<br />
    );</p>
<p>INSERT INTO adjectives (adjective)<br />
    VALUES<br />
    (&#8216;mentally&#8217;),<br />
    (&#8216;morally&#8217;),<br />
    (&#8216;emotionally&#8217;),<br />
    (&#8216;socially&#8217;),<br />
    (&#8216;psychologically&#8217;);</p>
<p>INSERT INTO adverbs (adverb)<br />
    VALUES<br />
    (&#8216;devoid&#8217;),<br />
    (&#8216;bankrupt&#8217;),<br />
    (&#8216;empty&#8217;),<br />
    (&#8216;hollow&#8217;),<br />
    (&#8216;vacant&#8217;),<br />
    (&#8216;sleeping with fishes&#8217;),<br />
    (&#8216;taking a dirt nap&#8217;),<br />
    (&#8216;shallow&#8217;);</p>
<p>SELECT CONCAT_WS(<br />
    &#8216; &#8216;,<br />
        ( SELECT adjective FROM adjectives ORDER BY RAND() LIMIT 1 ),<br />
        ( SELECT adverb FROM adverbs ORDER BY RAND() LIMIT 1 ) )<br />
    as RandomStuff;<br />
[/cc]</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Faaronbrazell.com%2F2009%2F02%2F26%2Ffun-with-programming-languages%2F';
  addthis_title  = 'Fun+With+Programming+Languages';
  addthis_pub    = 'technosailor';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://aaronbrazell.com/2009/02/26/fun-with-programming-languages/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Maintaining WordPress on SVN: Adding Plugins</title>
		<link>http://aaronbrazell.com/2008/01/31/maintaining-wordpress-on-svn-adding-plugins/</link>
		<comments>http://aaronbrazell.com/2008/01/31/maintaining-wordpress-on-svn-adding-plugins/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 03:36:51 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[externals]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://aaronbrazell.com/?p=28</guid>
		<description><![CDATA[Thank you for joining me again for this series on maintaing WordPress from subversion. We talked previously about creating an SVN repository and then about importing WordPress into the SVN repository. Today, we get into customizations. It does us no good to have an SVN repository with WordPress if we don&#8217;t change it to be [...]]]></description>
			<content:encoded><![CDATA[<p>Thank you for joining me again for this series on maintaing WordPress from subversion. We talked previously about <a href="http://aaronbrazell.com/2008/01/29/maintaining-wordpress-on-svn-create-your-repository/">creating an SVN repository</a> and then about <a href="http://aaronbrazell.com/2008/01/30/maintaining-wordpress-on-svn-import-wordpress-into-your-repository/">importing WordPress into the SVN repository</a>.</p>
<p>Today, we get into customizations. It does us no good to have an SVN repository with WordPress if we don&#8217;t change it to be something other than what it is. In this episode I talk about adding plugins (and you can add any file, really) by adding it to the working copy folder and then checking it in.</p>
<p>I also touched quickly on svn:externals, although I note that I goofed in the screencast and typed <code>svn propedit svn:external .</code> instead of using the correct <code>svn propedit svn:externals .</code> (note the plural externals).</p>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="788" height="735"><param name="movie" value="http://content.screencast.com/bootstrap.swf"></param><param name="quality" value="high"></param><param name="bgcolor" value="#FFFFFF"></param><param name="flashVars" value="thumb=http://content.screencast.com/media/76729dc3-96ed-494f-b44d-58c25c74ab59_9475b6bd-5a39-4f9b-b8e2-9df7982f7aad_static_0_0_Thumbnail.gif&#038;content=http://content.screencast.com/media/93bd1378-dcc4-499d-b5ef-351985b1521d_9475b6bd-5a39-4f9b-b8e2-9df7982f7aad_static_0_0_00000010.swf&#038;width=788&#038;height=735"></param><param name="allowFullScreen" value="true"></param><param name="scale" value="showall"></param><param name="allowScriptAccess" value="always"></param>  <embed src="http://content.screencast.com/bootstrap.swf" quality="high" bgcolor="#FFFFFF" width="788" height="735" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/media/76729dc3-96ed-494f-b44d-58c25c74ab59_9475b6bd-5a39-4f9b-b8e2-9df7982f7aad_static_0_0_Thumbnail.gif&#038;content=http://content.screencast.com/media/93bd1378-dcc4-499d-b5ef-351985b1521d_9475b6bd-5a39-4f9b-b8e2-9df7982f7aad_static_0_0_00000010.swf&#038;width=788&#038;height=735" allowFullScreen="true" scale="showall"></embed></object></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Faaronbrazell.com%2F2008%2F01%2F31%2Fmaintaining-wordpress-on-svn-adding-plugins%2F';
  addthis_title  = 'Maintaining+WordPress+on+SVN%3A+Adding+Plugins';
  addthis_pub    = 'technosailor';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://aaronbrazell.com/2008/01/31/maintaining-wordpress-on-svn-adding-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maintaining WordPress on SVN: Import WordPress into Your Repository</title>
		<link>http://aaronbrazell.com/2008/01/30/maintaining-wordpress-on-svn-import-wordpress-into-your-repository/</link>
		<comments>http://aaronbrazell.com/2008/01/30/maintaining-wordpress-on-svn-import-wordpress-into-your-repository/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 15:04:33 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://aaronbrazell.com/?p=26</guid>
		<description><![CDATA[Last time, I talked to you a bit about setting up a clean subversion repository for your WordPress build. Today, I want to take that a step farther and help you bring WordPress into working copy and commit it into your repo. addthis_url = 'http%3A%2F%2Faaronbrazell.com%2F2008%2F01%2F30%2Fmaintaining-wordpress-on-svn-import-wordpress-into-your-repository%2F'; addthis_title = 'Maintaining+WordPress+on+SVN%3A+Import+WordPress+into+Your+Repository'; addthis_pub = 'technosailor';]]></description>
			<content:encoded><![CDATA[<p><a href="http://aaronbrazell.com/2008/01/29/maintaining-wordpress-on-svn-create-your-repository/">Last time</a>, I talked to you a bit about setting up a clean subversion repository for your WordPress build. Today, I want to take that a step farther and help you bring WordPress into working copy and commit it into your repo.</p>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="516" height="394"><param name="movie" value="http://content.screencast.com/bootstrap.swf"></param><param name="quality" value="high"></param><param name="bgcolor" value="#FFFFFF"></param><param name="flashVars" value="thumb=http://content.screencast.com/media/6e3ed1f4-19b1-41aa-a292-d16b45d1b061_9475b6bd-5a39-4f9b-b8e2-9df7982f7aad_static_0_0_Thumbnail.gif&#038;content=http://content.screencast.com/media/0e6f4b5b-e84d-464e-a946-70ef462d187c_9475b6bd-5a39-4f9b-b8e2-9df7982f7aad_static_0_0_00000008.swf&#038;width=516&#038;height=394"></param><param name="allowFullScreen" value="true"></param><param name="scale" value="showall"></param><param name="allowScriptAccess" value="always"></param>  <embed src="http://content.screencast.com/bootstrap.swf" quality="high" bgcolor="#FFFFFF" width="516" height="394" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/media/6e3ed1f4-19b1-41aa-a292-d16b45d1b061_9475b6bd-5a39-4f9b-b8e2-9df7982f7aad_static_0_0_Thumbnail.gif&#038;content=http://content.screencast.com/media/0e6f4b5b-e84d-464e-a946-70ef462d187c_9475b6bd-5a39-4f9b-b8e2-9df7982f7aad_static_0_0_00000008.swf&#038;width=516&#038;height=394" allowFullScreen="true" scale="showall"></embed></object></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Faaronbrazell.com%2F2008%2F01%2F30%2Fmaintaining-wordpress-on-svn-import-wordpress-into-your-repository%2F';
  addthis_title  = 'Maintaining+WordPress+on+SVN%3A+Import+WordPress+into+Your+Repository';
  addthis_pub    = 'technosailor';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://aaronbrazell.com/2008/01/30/maintaining-wordpress-on-svn-import-wordpress-into-your-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expression Engine WXR Export Class</title>
		<link>http://aaronbrazell.com/2008/01/26/expression-engine-wxr-export-class/</link>
		<comments>http://aaronbrazell.com/2008/01/26/expression-engine-wxr-export-class/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 04:36:56 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[expression engine]]></category>
		<category><![CDATA[wxr]]></category>

		<guid isPermaLink="false">http://aaronbrazell.com/?p=18</guid>
		<description><![CDATA[Earlier, I shared with you a new base class I&#8217;m releasing into the wild. While that was a conceptually nice piece of code, and potentially useful, it didn&#8217;t really translate in usefulness without some actual code. As mentioned, I just moved Shai to WordPress from Expression Engine and it required writing a custom export routine. [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier, I shared with you a new base class I&#8217;m releasing into the wild. While that was a conceptually nice piece of code, and potentially useful, it didn&#8217;t really <em>translate</em> in usefulness without some actual code.</p>
<p>As mentioned, I just moved <a href="http://www.shaicoggins.com">Shai</a> to WordPress from <a href="http://www.expressionengine.com">Expression Engine</a> and it required writing a custom export routine. Instead, I wrote the base class in conjunction with this <em>extension</em> class.</p>
<p>This could very well be a very good example for someone wanting to write their own routine. While it is custom to Expression Engine and would look different for other platforms, the bottom line is that the methods in the <a href="http://aaronbrazell.com/2008/01/26/wordpress-wxr-class/">base class</a> have to be fed certain data.</p>
<p>As with the base class, this is meant for <em>advanced WordPress hackery</em> and is <strong>not</strong> a plugin nor for rookies. I don&#8217;t mean to sound condescending, but it took me years to wrap my head around object oriented PHP and so please don&#8217;t ask me. :-)</p>
<p>I can say that if you dive into this code, you will find the roadmap to your own importer. This is fully functional. It works. It&#8217;s for Expression Engine, but it works. Your methods should return similar data.</p>
<p>One day I&#8217;ll get around to documenting it, but my mind is mush after working on this all weekend. :-)</p>
<p><strong>Update:</strong> Oops, forgot where you can download. Subversion it is again:</p>
<p><code>svn co http://svn.aaronbrazell.com/wpwxr/tags/expression-engine/ expression-engine</code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Faaronbrazell.com%2F2008%2F01%2F26%2Fexpression-engine-wxr-export-class%2F';
  addthis_title  = 'Expression+Engine+WXR+Export+Class';
  addthis_pub    = 'technosailor';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://aaronbrazell.com/2008/01/26/expression-engine-wxr-export-class/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (enhanced)
Database Caching 9/29 queries in 0.060 seconds using memcached
Content Delivery Network via aaronbrazell.wpengine.netdna-cdn.com

Served from: aaronbrazell.com @ 2010-09-09 17:57:14 -->