<?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 M. Whalen &#187; How-To</title>
	<atom:link href="http://amwhalen.com/archives/tag/howto/feed" rel="self" type="application/rss+xml" />
	<link>http://amwhalen.com</link>
	<description>Thoughts on the web, programming and other nerdery by Andrew M. Whalen.</description>
	<lastBuildDate>Thu, 29 Dec 2011 14:13:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Editing Songbird Add-ons</title>
		<link>http://amwhalen.com/archives/2009/04/08/editing-songbird-add-ons</link>
		<comments>http://amwhalen.com/archives/2009/04/08/editing-songbird-add-ons#comments</comments>
		<pubDate>Wed, 08 Apr 2009 19:35:58 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[add-on]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[songbird]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://amwhalen.com/blog/?p=594</guid>
		<description><![CDATA[The <a href="http://addons.songbirdnest.com/addon/1301">Notify Me</a> add-on allows you to get <a href="http://growl.info/">Growl</a> notifications when the song changes. Unfortunately, the add-on hadn't been updated in 4 months. Here's how I made it work with the latest version of Songbird.]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t seen it yet, <a href="http://getsongbird.com/">Songbird</a> is a Mozilla-based open-source music player. I&#8217;ve been using for some time now and it&#8217;s amazing.</p>
<p>Just like Firefox, it has a system of add-ons. The <a href="http://addons.songbirdnest.com/addon/1301">Notify Me</a> add-on allows you to get <a href="http://growl.info/">Growl</a> notifications when the song changes. Unfortunately, the add-on hasn&#8217;t been updated in 4 months. Here&#8217;s how I made it work with the latest version of Songbird.</p>
<p>Download the add-on from the <a href="http://addons.songbirdnest.com">Songbird Add-ons</a> page. The .xpi file is just a zip file, and we have to unzip it to modify the contents. In Terminal, change to the directory where the .xpi file is (mine was on my desktop). Make a temporary folder to put the add-on files into when they&#8217;re unzipped. Put the .xpi into that folder and unzip it, then move the .xpi file out of there. Here&#8217;s the process in Terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Desktop
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> notifyme
<span style="color: #c20cb9; font-weight: bold;">mv</span> notifyme-osx-1.1.0.xpi notifyme<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> notifyme
<span style="color: #c20cb9; font-weight: bold;">unzip</span> notifyme-osx-1.1.0.xpi
<span style="color: #c20cb9; font-weight: bold;">mv</span> notifyme-osx-1.1.0.xpi ..<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Once unzipped you&#8217;ll find a file named <code>install.rdf</code>. Open that up in a plain-text editor (Not MS Word) and change the <code>maxVersion</code> variable to whatever version you want. I&#8217;m changing it from 1.1.0rc1 to 1.2.0a.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;em:maxVersion<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.1.0rc1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/em:maxVersion<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Save <code>install.rdf</code> and zip the add-on back up (notice I changed the file name):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">zip</span> <span style="color: #660033;">-r</span> ..<span style="color: #000000; font-weight: bold;">/</span>notifyme-osx-1.2.0a-unofficial.xpi .</pre></div></div>

<p>You can then go to Tools -> Add-ons&#8230; in Songbird, click Install&#8230; and find the .xpi file you just zipped. It shouldn&#8217;t warn you about the version being incompatible anymore.</p>
<p>Although I just detailed how to do this and it worked for this add-on, I don&#8217;t recommended it. The max version is there for a reason. There may have been changes to Songbird that make an add-on incompatible with a higher version. Don&#8217;t blame me if you try this and your computer catches fire.</p>
<p><strong>Here&#8217;s the finished product:</strong> <a href="http://amwhalen.com/blog/wp-content/uploads/2009/04/notifyme-osx-120a-unofficial.xpi" onClick="javascript:pageTracker._trackPageview('/downloads/notifyme-osx-120a-unofficial.xpi');" class="download">notifyme-osx-120a-unofficial.xpi</a></p>
]]></content:encoded>
			<wfw:commentRss>http://amwhalen.com/archives/2009/04/08/editing-songbird-add-ons/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Finding Frequency Counts With SQL</title>
		<link>http://amwhalen.com/archives/2008/01/11/finding-frequency-counts-with-sql</link>
		<comments>http://amwhalen.com/archives/2008/01/11/finding-frequency-counts-with-sql#comments</comments>
		<pubDate>Fri, 11 Jan 2008 17:50:01 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[tagging]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://amwhalen.com/blog/archives/2008/01/11/finding-frequency-counts-with-sql/</guid>
		<description><![CDATA[Finding the frequency of items in a database table is something I find myself needing to do a lot. Though for some reason when I need to do this, I always forget how, so here it is. Let's say you have a table of tag data with two columns and a bunch of rows. Let's say the table is a simple adjacency list of tags for posts on a blog.]]></description>
			<content:encoded><![CDATA[<p>Finding the frequency of items in a database table is something I find myself needing to do a lot. Though for some reason when I need to do this, I always forget how, so here it is. Let&#8217;s say you have a table of tag data with two columns and a bunch of rows. Let&#8217;s say the table is a simple adjacency list of tags for posts on a blog. Here&#8217;s an example of what it could look like:</p>
<table>
<tr>
<th>id of tagged post</th>
<th>tag</th>
</tr>
<tr>
<td>1</td>
<td>sql</td>
</tr>
<tr>
<td>2</td>
<td>blogs</td>
</tr>
<tr>
<td>3</td>
<td>robots</td>
</tr>
<tr>
<td>3</td>
<td>llamas</td>
</tr>
<tr>
<td>4</td>
<td>sql</td>
</tr>
<tr>
<td>5</td>
<td>trees</td>
</tr>
<tr>
<td>5</td>
<td>blogs</td>
</tr>
<tr>
<td>6</td>
<td>llamas</td>
</tr>
<tr>
<td>3</td>
<td>blogs</td>
</tr>
</table>
<p>Now let&#8217;s say you want to find out how many times each tag is used. This can be done with one easy SQL statement:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> tag<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> total <span style="color: #993333; font-weight: bold;">FROM</span> tags <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> tag</pre></div></div>

<p>This will give you output like this:</p>
<table>
<tr>
<th>tag</th>
<th>total</th>
</tr>
<tr>
<td>robots</td>
<td>1</td>
</tr>
<tr>
<td>trees</td>
<td>1</td>
</tr>
<tr>
<td>llamas</td>
<td>2</td>
</tr>
<tr>
<td>sql</td>
<td>2</td>
</tr>
<tr>
<td>blogs</td>
<td>3</td>
</tr>
</table>
<p>This is a very useful statement for tag clouds, general statistics, and lots of other things.</p>
]]></content:encoded>
			<wfw:commentRss>http://amwhalen.com/archives/2008/01/11/finding-frequency-counts-with-sql/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Changing File Extensions</title>
		<link>http://amwhalen.com/archives/2007/04/20/changing-file-extensions</link>
		<comments>http://amwhalen.com/archives/2007/04/20/changing-file-extensions#comments</comments>
		<pubDate>Fri, 20 Apr 2007 15:28:52 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://amwhalen.com/blog/archives/2007/04/20/changing-file-extensions/</guid>
		<description><![CDATA[Today at work I needed to change a whole directory (with many sub-directories and sub-sub-directories and&#8230; etc.) of .php files to the .html file extension. Since the files were on a Unix server, I wrote a quick Bash shell script to take care of this for me. #!/bin/bash &#160; function change_extension_recursive &#123; &#160; #change all [...]]]></description>
			<content:encoded><![CDATA[<p>Today at work I needed to change a whole directory (with many sub-directories and sub-sub-directories and&#8230; etc.) of .php files to the .html file extension. Since the files were on a Unix server, I wrote a quick Bash shell script to take care of this for me.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> change_extension_recursive <span style="color: #7a0874; font-weight: bold;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">#change all .php to .html</span>
	<span style="color: #000000; font-weight: bold;">for</span> f <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">/*</span>.php; <span style="color: #000000; font-weight: bold;">do</span>
		<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$f</span> <span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">/`</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #007800;">$f</span> .php<span style="color: #000000; font-weight: bold;">`</span>.html;
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$f</span>;
	<span style="color: #000000; font-weight: bold;">done</span>;
&nbsp;
	<span style="color: #666666; font-style: italic;"># recurse on any directories</span>
	<span style="color: #000000; font-weight: bold;">for</span> d <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">/*</span>; <span style="color: #000000; font-weight: bold;">do</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$d</span>; <span style="color: #000000; font-weight: bold;">then</span>
			change_extension_recursive <span style="color: #007800;">$d</span>;
		<span style="color: #000000; font-weight: bold;">fi</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">done</span>;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #007800;">dir</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">pwd</span><span style="color: #000000; font-weight: bold;">`</span>;
&nbsp;
change_extension_recursive <span style="color: #007800;">$dir</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://amwhalen.com/archives/2007/04/20/changing-file-extensions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

