<?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>Adam DiCarlo&#039;s Blog</title>
	<atom:link href="http://adamdicarlo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://adamdicarlo.com</link>
	<description>Programming, Linux, music, woodworking....</description>
	<lastBuildDate>Thu, 12 Nov 2009 21:26:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Canvas/JavaScript scrolling tile-map demo</title>
		<link>http://adamdicarlo.com/2009/11/12/canvas-javascript-scrolling-tile-map-demo/</link>
		<comments>http://adamdicarlo.com/2009/11/12/canvas-javascript-scrolling-tile-map-demo/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 21:18:27 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[canvas tag]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tilemap]]></category>
		<category><![CDATA[web game programming]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=195</guid>
		<description><![CDATA[
$(document).ready(function () { init(); })


      canvas { border: 2px solid black; }

Here&#8217;s something I did for fun in May as a proof of concept. It uses JavaScript and the canvas tag to render a Super Mario Brothers style tile-map with background. Try it in Firefox 3.5+, Safari 4+, or Chrome/Chromium.
Do [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript" src="http://bikko.org/practice/canvas/d/canvas.text.js"></script><script type="text/javascript" src="http://bikko.org/practice/canvas/d/game.js"></script><script type="text/javascript" src="http://adamdicarlo.com/js/jquery-1.3.2.js"></script><script type="text/javascript">
$(document).ready(function () { init(); })
</script></p>
<style type="text/css">
      canvas { border: 2px solid black; }
</style>
<p>Here&#8217;s something I did for fun in May as a proof of concept. It uses JavaScript and the canvas tag to render a Super Mario Brothers style tile-map with background. Try it in Firefox 3.5+, Safari 4+, or Chrome/Chromium.<br />
<canvas id="my_canvas" width="0" height="0"></canvas><br /><button onclick="toggleScroll();">Do Some Scrolling!</button> or arrow keys to move view<br /><a href="javascript:viewSmall();">small</a> | <a href="javascript:viewMedium();">medium</a> | <a href="javascript:viewLarge();">large</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/11/12/canvas-javascript-scrolling-tile-map-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expression Engine, Redux</title>
		<link>http://adamdicarlo.com/2009/11/05/expression-engine-redux/</link>
		<comments>http://adamdicarlo.com/2009/11/05/expression-engine-redux/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 16:00:41 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=185</guid>
		<description><![CDATA[Not too long after my recent unease when trying Expression Engine, I got called on to code a redesign of an Expression Engine site for a client.
The original site was very well-coded; good markup, good uses of CSS. While I still don&#8217;t find EE to be much of a user&#8217;s CMS (and nowhere near as [...]]]></description>
			<content:encoded><![CDATA[<p>Not too long after my recent <a href="http://adamdicarlo.com/2009/09/18/tried-out-expression-engine-1-6-8/">unease when trying Expression Engine</a>, I got called on to code a redesign of an Expression Engine site for a client.</p>
<p>The original site was very well-coded; good markup, good uses of CSS. While I still don&#8217;t find EE to be much of a user&#8217;s CMS (and nowhere near as general-purpose as Drupal), making CSS and HTML changes was very straightforward. (I used FTP to upload the new images and to update one CSS file which, oddly, wasn&#8217;t controlled by EE&#8230;)</p>
<p>I thought of EE as an HTML/CSS management system before; I can see it really is. It&#8217;s a good way to be able to edit all the HTML that goes into each section of your pages without having to write PHP. So it&#8217;s probably great for designers used to making HTML-based sites who hate having duplicated HTML in every file.</p>
<p>There is a trade-off, though. You&#8217;ve got to use EE&#8217;s templating syntax to do any logic necessary in your HTML partials. It might be worth learning, though, for those wanting to avoid PHP at all costs.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/11/05/expression-engine-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal Pitfall: @import-ing CSS</title>
		<link>http://adamdicarlo.com/2009/11/04/drupal-pitfall-import-ing-css/</link>
		<comments>http://adamdicarlo.com/2009/11/04/drupal-pitfall-import-ing-css/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 01:00:35 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=189</guid>
		<description><![CDATA[Pitfall:
/* local.css */
@import &#34;menu-styles.css&#34;
@import &#34;foobarbaz.css&#34;
This pitfall causes style breakage when enabling Drupal&#8217;s CSS aggregation/caching.
Symptom
Some parts of the page (e.g., the primary links menu) look completely different after enabling caching.
Cause
Drupal&#8217;s CSS caching aggregates all your theme&#8217;s and your modules&#8217; CSS files into one file (to minimize HTTP requests). But it doesn&#8217;t look for @import statements in [...]]]></description>
			<content:encoded><![CDATA[<p>Pitfall:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/* local.css */<br />
@import &quot;menu-styles.css&quot;<br />
@import &quot;foobarbaz.css&quot;</div></div>
<p>This pitfall causes style breakage when enabling Drupal&#8217;s CSS aggregation/caching.</p>
<h3>Symptom</h3>
<p>Some parts of the page (e.g., the primary links menu) look completely different after enabling caching.</p>
<h3>Cause</h3>
<p>Drupal&#8217;s CSS caching aggregates all your theme&#8217;s and your modules&#8217; CSS files into one file (to minimize HTTP requests). <strong>But it doesn&#8217;t look for @import statements in CSS when doing so.</strong></p>
<h3>Solution</h3>
<p>Declare <em>all</em> your CSS files in your theme&#8217;s .info file:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># mytheme.info<br />
stylesheets[all][] = menu-styles.css<br />
stylesheets[all][] = foobarbaz.css</div></div>
<p>and remove your CSS @import statements. (And as always, rebuild the theme registry for the changes to take effect.)</p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/11/04/drupal-pitfall-import-ing-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal Pitfalls</title>
		<link>http://adamdicarlo.com/2009/11/04/drupal-pitfalls/</link>
		<comments>http://adamdicarlo.com/2009/11/04/drupal-pitfalls/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 21:35:14 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=178</guid>
		<description><![CDATA[Forgetting to put
&#60;?php print $closure; ?&#62;
in your theme&#8217;s page.tpl.php.
Forgetting the closure prevents modules like Google Analytics from being able to put JavaScript at the end of the page body. Without that JavaScript, not much analytics&#8230;izing gets done.
This is a fairly common mistake, in my experience as a Drupal maintenance programmer.
]]></description>
			<content:encoded><![CDATA[<p><strong>Forgetting to put</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;?php print $closure; ?&gt;</div></div>
<p>in your theme&#8217;s page.tpl.php.</strong></p>
<p>Forgetting the closure prevents modules like <a href="http://drupal.org/project/google_analytics">Google Analytics</a> from being able to put JavaScript at the end of the page body. Without that JavaScript, not much analytics&#8230;izing gets done.</p>
<p>This is a fairly common mistake, in my experience as a Drupal maintenance programmer.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/11/04/drupal-pitfalls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tried out Expression Engine 1.6.8</title>
		<link>http://adamdicarlo.com/2009/09/18/tried-out-expression-engine-1-6-8/</link>
		<comments>http://adamdicarlo.com/2009/09/18/tried-out-expression-engine-1-6-8/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 16:00:14 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=167</guid>
		<description><![CDATA[I tried the Expression Engine (freely-downloadable Core edition) CMS. I didn&#8217;t much care for it; though it might be useful if you want to store many different (complete) HTML pages in a database and have an interface to edit them with. That&#8217;s not however exactly what I think a &#8220;content management system&#8221; should be; that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I tried the <a href="http://expressionengine.com">Expression Engine</a> (freely-downloadable Core edition) CMS. I didn&#8217;t much care for it; though it might be useful if you want to store many different (complete) HTML pages in a database and have an interface to edit them with. That&#8217;s not however exactly what I think a &#8220;content management system&#8221; should be; that&#8217;s more of a markup management system.</p>
<p>I just didn&#8217;t find the system inspiring; as a user, it&#8217;s hard to pinpoint why, specifically, beyond saying that the administrative interface seemed unintuitive. As a developer and systems administrator I was also pretty disturbed when I looked at the source of the installation script: 4168 lines of PHP, nearly all global-scope code, with MySQL queries, HTML, and CSS interspersed along the way.</p>
<p>Generally, I don&#8217;t trust software that I would hate to have to maintain. It goes beyond code simply looking pretty; readability is important. Given <a href="http://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_or_Minus_Two">The Magical Number Seven, Plus or Minus Two</a> concept, it&#8217;s easy to see why 20 line functions with a handful of local variables are much easier to maintain and debug&mdash;and to <em>proactively</em> spot bugs in&mdash;than something that is essentially a 4000 line function.</p>
<p>The system&#8217;s core code looks to be written more modularly, but it&#8217;s obviously not as flexible as Drupal. It doesn&#8217;t appear to have much database abstraction (it only supports MySQL), nor a form API. Beyond the fact that you can edit the HTML of pages (but not blog entries?) on your site directly in the administrative interface, I&#8217;m not sure why this system claims to be the most flexible thing ever.</p>
<p>I told the installer to use no table prefix, but it still prefixed the tables with &#8220;exp_&#8221;. Apparently it didn&#8217;t like a blank prefix, but it didn&#8217;t complain, either. There is code to let the system work with a different table prefix, but it&#8217;s a dirty hack that involves at least one regular expression to be run for every query. From Expression Engine&#8217;s database query function (<em>system/core/db/db.mysql.php</em>):</p>
<div class="codecolorer-container php " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// Verify table prefix and replace if necessary.</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exp_prefix</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/(\W)&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exp_prefix</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;(\S+?)/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>1&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>2&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// If the custom prefix includes 'exp_' the above can sometimes cause partial doubling.</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// This is a quick fix to prevent this from causing errors in 1.x.</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strncmp"><span style="color: #990000;">strncmp</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'exp_'</span><span style="color: #339933;">,</span> 4<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> 0<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span><span style="color: #339933;">.</span><a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exp_'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prefix</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>I&#8217;m quite curious whether that regex substitution will break database fields with names like &#8220;exp_points.&#8221;</p>
<p>And, come to think of it, that <code class="codecolorer text "><span class="text">strncmp()</span></code> call could be a bug; the comment says &#8220;if the prefix includes&#8221; but <code class="codecolorer text "><span class="text">strncmp()</span></code> only checks the beginning of the string. Shouldn&#8217;t it be a call to <code class="codecolorer text "><span class="text">strpos()</span></code> instead?</p>
<p>On a more positive note, looking under the hood of other systems, like this one, helps me appreciate Drupal even more. Drupal really sets a high standard; once you&#8217;ve worked with it, especially if you&#8217;ve looked under the hood or done any module coding, it&#8217;s hard not to appreciate its well-thought out design and engineering. The <a href="http://api.drupal.org/api/group/form_api/6">FormAPI</a> has particularly spoiled me rotten.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/09/18/tried-out-expression-engine-1-6-8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing the PEAR/PECL uploadprogress extension for Drupal 7</title>
		<link>http://adamdicarlo.com/2009/09/16/installing-the-pearpecl-uploadprogress-extension-for-drupal-7/</link>
		<comments>http://adamdicarlo.com/2009/09/16/installing-the-pearpecl-uploadprogress-extension-for-drupal-7/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 06:43:06 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[System administration]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[pear]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=152</guid>
		<description><![CDATA[Trying out the latest development snapshot of Drupal 7, I noticed it supports the uploadprogress PEAR/PECL extension, which apparently lets you see the actual progress (with some kind of Ajaxy widget) while uploading files. Sounds cool to me.
First, I installed PEAR (on my Ubuntu testing server):
$ sudo aptitude install php-pear
and then tried to use PEAR [...]]]></description>
			<content:encoded><![CDATA[<p>Trying out the latest development snapshot of Drupal 7, I noticed it supports the <a href="http://pecl.php.net/package/uploadprogress">uploadprogress</a> PEAR/PECL extension, which apparently lets you see the actual progress (with some kind of Ajaxy widget) while uploading files. Sounds cool to me.</p>
<p>First, I installed <a href="http://pear.php.net/">PEAR</a> (on my Ubuntu testing server):</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo aptitude install php-pear</div></div>
<p>and then tried to use PEAR to install uploadprogress:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo pear install pecl/uploadprogress<br />
downloading uploadprogress-1.0.1.tgz ...<br />
Starting to download uploadprogress-1.0.1.tgz (8,536 bytes)<br />
.....done: 8,536 bytes<br />
4 source files, building<br />
running: phpize<br />
sh: phpize: not found<br />
ERROR: `phpize' failed</div></div>
<p>PHPize? What&#8217;s that? There&#8217;s no phpize package; <strong>aptitude search phpize</strong> gives nothing.</p>
<p>A bit of digging and I found that PHPize is part of the <strong>php5-dev</strong> package! After installing that, pecl can install a module just fine:</p>
<h3>Solution</h3>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo apt-get install php5-dev<br />
$ sudo pear install pecl/uploadprogress</div></div>
<p>After lots of output, PEAR left a final clue:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">configuration option &quot;php_ini&quot; is not set to php.ini location<br />
You should add &quot;extension=uploadprogress.so&quot; to php.ini</div></div>
<p>So I created /etc/php/conf.d/uploadprogress.ini, containing just this line:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">extension=uploadprogress.so</div></div>
<p>I restarted Apache and now Drupal 7 reports &#8220;UPLOAD PROGRESS: Enabled&#8221;. Now to try it out&#8230;.!</p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/09/16/installing-the-pearpecl-uploadprogress-extension-for-drupal-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing the mysql Ruby gem</title>
		<link>http://adamdicarlo.com/2009/08/01/installing-the-mysql-ruby-gem/</link>
		<comments>http://adamdicarlo.com/2009/08/01/installing-the-mysql-ruby-gem/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 20:18:22 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[System administration]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=132</guid>
		<description><![CDATA[While trying to install this gem on Ubuntu 8.04.3 (Hardy) to run a rails app (Redmine), I encountered the following error:
$ sudo gem install mysql
Building native extensions. &#160;This could take a while...
ERROR: &#160;Error installing mysql:
&#160; &#160; &#160; &#160; ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>While trying to install this gem on Ubuntu 8.04.3 (Hardy) to run a rails app (<a href="http://redmine.org">Redmine</a>), I encountered the following error:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo gem install mysql<br />
Building native extensions. &nbsp;This could take a while...<br />
ERROR: &nbsp;Error installing mysql:<br />
&nbsp; &nbsp; &nbsp; &nbsp; ERROR: Failed to build gem native extension.<br />
<br />
/usr/bin/ruby1.8 extconf.rb<br />
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)<br />
&nbsp; &nbsp; &nbsp; &nbsp; from extconf.rb:1</div></div>
<p>There are a bunch of common errors when installing the mysql gem, so Googling for the solution wasn&#8217;t instant. Luckily I found <a href="http://www.searchmarked.com/ubuntu/how-to-get-past-the-require-no-such-file-to-load-mkmf-loaderror-when-installing-the-mysql-gem.php">this post</a> which showed the missing package: ruby1.8-dev.</p>
<h3>Solution</h3>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install ruby1.8-dev</div></div>
<p>and the MySQL gem installed fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/08/01/installing-the-mysql-ruby-gem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gem won&#8217;t install Ruby gems on VPS&#8230;</title>
		<link>http://adamdicarlo.com/2009/07/28/gem-wont-install-ruby-gems-on-vps/</link>
		<comments>http://adamdicarlo.com/2009/07/28/gem-wont-install-ruby-gems-on-vps/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 07:47:21 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[System administration]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=119</guid>
		<description><![CDATA[Having trouble installing Ruby gems on your VPS? Gem was hanging on my Slicehost slice (running Ubuntu Hardy with 256MB of RAM) at &#8220;Bulk updating [...]&#8220;:
$ gem update
Updating installed gems...
Bulk updating Gem source index for: http://gems.rubyforge.org
It was also gobbling up CPU and memory.
Why does gem hang?
The distro package for Gem is very old, and this [...]]]></description>
			<content:encoded><![CDATA[<p>Having trouble installing Ruby gems on your VPS? Gem was hanging on my Slicehost slice (running Ubuntu Hardy with 256MB of RAM) at &#8220;Bulk updating [...]&#8220;:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ gem update<br />
Updating installed gems...<br />
Bulk updating Gem source index for: http://gems.rubyforge.org</div></div>
<p>It was also gobbling up CPU and memory.</p>
<h3>Why does gem hang?</h3>
<p>The distro package for Gem is very old, and this old version uses a lot of memory, causing lots of disk thrashing. Since hard disks are, ahem, a bit slower than RAM, this increases gem&#8217;s run time by probably a few orders of magnitude.</p>
<h3>Solution</h3>
<p>Update gem manually:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span>57642<span style="color: #000000; font-weight: bold;">/</span>rubygems-update-1.3.4.gem<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rubygems-update-1.3.4.gem<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>update_rubygems<br />
Installing RubyGems 1.3.4<br />
Installing RubyGems<br />
Installing gem executable<br />
Removing old source_cache files<br />
Removing old RubyGems RDoc and ri<br />
Installing rubygems-1.3.4 ri into <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>rubygems-1.3.4<span style="color: #000000; font-weight: bold;">/</span>ri<br />
Installing rubygems-1.3.4 rdoc into <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>rubygems-1.3.4<span style="color: #000000; font-weight: bold;">/</span>rdoc<br />
<br />
RubyGems installed the following executables:<br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem1.8</div></div>
<p>Looks like everything&#8217;s OK, but gem didn&#8217;t work anymore:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> haml<br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem:<span style="color: #000000;">10</span>: undefined method <span style="color: #000000; font-weight: bold;">`</span>manage_gems<span style="color: #ff0000;">' for Gem:Module (NoMethodError)</span></div></div>
<p>What gives? Notice the path, /usr/bin/gem. Is that still the old version?</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-lah</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem<span style="color: #000000; font-weight: bold;">*</span><br />
<span style="color: #660033;">-rwxr-xr-x</span> 1 root root 701 Nov 19 &nbsp;2007 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem<br />
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> root root <span style="color: #000000;">545</span> Jul <span style="color: #000000;">28</span> 00:<span style="color: #000000;">15</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem1.8</div></div>
<p>Yes. This is what we get for upgrading gem without using Ubuntu&#8217;s package system. Well, in for a penny, in for a pound:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:475px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem1.8 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem</div></div>
<p>Done. Now to install Haml and Sass&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/07/28/gem-wont-install-ruby-gems-on-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bed frame for a Sleep Number bed</title>
		<link>http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/</link>
		<comments>http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 21:47:17 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Woodworking]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=74</guid>
		<description><![CDATA[I designed and built this bed frame for a Select Comfort Sleep Number queen bed. It uses 2&#215;6s, 1&#215;6s, 1&#215;4s, and a lot of screws and brackets.
I was inspired by:

 A bed frame at IKEA which housed useful drawers underneath—it was pretty but it cost $300 and was flimsy.
Lack of Sleep Number bed frame plans [...]]]></description>
			<content:encoded><![CDATA[<p>I designed and built this bed frame for a Select Comfort Sleep Number queen bed. It uses 2&#215;6s, 1&#215;6s, 1&#215;4s, and a lot of screws and brackets.</p>

<a href='http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/img_3736/' title='Basic frame'><img width="150" height="150" src="http://adamdicarlo.com/wp/wp-content/uploads/2009/07/IMG_3736-150x150.jpg" class="attachment-thumbnail" alt="Basic frame" title="Basic frame" /></a>
<a href='http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/img_3737/' title='Putting on the slats'><img width="150" height="150" src="http://adamdicarlo.com/wp/wp-content/uploads/2009/07/IMG_3737-150x150.jpg" class="attachment-thumbnail" alt="Putting on the slats" title="Putting on the slats" /></a>
<a href='http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/img_3741/' title='Underside of frame'><img width="150" height="150" src="http://adamdicarlo.com/wp/wp-content/uploads/2009/07/IMG_3741-150x150.jpg" class="attachment-thumbnail" alt="Underside of frame" title="Underside of frame" /></a>
<a href='http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/img_3806/' title='Air pump compartment with hatch off'><img width="150" height="150" src="http://adamdicarlo.com/wp/wp-content/uploads/2009/07/IMG_3806-150x150.jpg" class="attachment-thumbnail" alt="Air pump compartment with hatch off" title="Air pump compartment with hatch off" /></a>
<a href='http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/img_3805/' title='Hatch fits snugly, muffles air pump sound'><img width="150" height="150" src="http://adamdicarlo.com/wp/wp-content/uploads/2009/07/IMG_3805-150x150.jpg" class="attachment-thumbnail" alt="Hatch fits snugly, muffles air pump sound" title="Hatch fits snugly, muffles air pump sound" /></a>
<a href='http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/img_3804/' title='Finished bed frame'><img width="150" height="150" src="http://adamdicarlo.com/wp/wp-content/uploads/2009/07/IMG_3804-150x150.jpg" class="attachment-thumbnail" alt="Finished bed frame" title="Finished bed frame" /></a>
<a href='http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/img_3812/' title='Head of bed'><img width="150" height="150" src="http://adamdicarlo.com/wp/wp-content/uploads/2009/07/IMG_3812-150x150.jpg" class="attachment-thumbnail" alt="Head of bed" title="Head of bed" /></a>
<a href='http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/img_3815/' title='Hoses and cords come out a hole near head of bed'><img width="150" height="150" src="http://adamdicarlo.com/wp/wp-content/uploads/2009/07/IMG_3815-150x150.jpg" class="attachment-thumbnail" alt="Hoses and cords come out a hole near head of bed" title="Hoses and cords come out a hole near head of bed" /></a>
<a href='http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/img_3811/' title='A bed on a frame!'><img width="150" height="150" src="http://adamdicarlo.com/wp/wp-content/uploads/2009/07/IMG_3811-150x150.jpg" class="attachment-thumbnail" alt="A bed on a frame!" title="A bed on a frame!" /></a>

<p>I was inspired by:</p>
<ul>
<li> A bed frame at IKEA which housed useful drawers underneath—it was pretty but it cost $300 and was flimsy.</li>
<li>Lack of Sleep Number bed frame plans on the Internet<em>—my eyes! The Googles do nothing!</em></li>
</ul>
<p>My frame has a special area to house the bed&#8217;s noisy air pump. This gets the pump out of the way and quiets it significantly.</p>
<p>If you&#8217;re wondering why there are two pieces of wood per slat, it&#8217;s because the extra 1&#215;4s I had lying around weren&#8217;t quite long enough. Sure glad I was able to make them useful!</p>
<h3>Future work</h3>
<p>Put in some nice drawers on wheels—I might buy the drawers from IKEA—and if the frame&#8217;s too short for them, add some legs and a bottom for the air pump compartment.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/07/08/bed-frame-for-a-sleep-number-bed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secret (Tiny) Message Encoder</title>
		<link>http://adamdicarlo.com/2009/05/22/secret-message-encoder/</link>
		<comments>http://adamdicarlo.com/2009/05/22/secret-message-encoder/#comments</comments>
		<pubDate>Fri, 22 May 2009 08:40:02 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[canvas tag]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://adamdicarlo.com/?p=47</guid>
		<description><![CDATA[Having seen the smallest readable bitmap typeface (3&#215;3 pixels per character), I decided to hack up a small JavaScript/canvas web app for fun so people could try it without having to install a TTF file.

Source: Wikipedia, under the GNU Free Documentation license.
Then, the &#8220;secret message&#8221; idea struck, so I made the &#8220;secret&#8221; message encoder. (Warning: [...]]]></description>
			<content:encoded><![CDATA[<p>Having seen the smallest readable bitmap typeface (3&#215;3 pixels per character), I decided to hack up a <a href="http://bikko.org/practice/3x3/index.php">small JavaScript/canvas web app</a> for fun so people could try it without having to install a TTF file.</p>
<p><img src="http://bikko.org/practice/3x3/3x3.gif" alt="Smallest readable typeface (3x3 pixels per character)" /><br />
<span class="caption">Source: <a href="http://en.wikipedia.org/wiki/File:3x3.gif">Wikipedia</a>, under the GNU Free Documentation license.</span></p>
<p>Then, the &#8220;secret message&#8221; idea struck, so I made the <a href="http://bikko.org/practice/3x3/encode.php">&#8220;secret&#8221; message encoder</a>. (Warning: Only tested with Firefox 3. It also requires the canvas tag and doesn&#8217;t yet work in Safari.)</p>
<p>You type in a message and it will give you a link you can send to someone to view their <span class="tooltip" title="Not really.">super-encrypted</span> message.</p>
<p>Always great to find an excuse to play around with &lt;canvas&gt;!</p>
]]></content:encoded>
			<wfw:commentRss>http://adamdicarlo.com/2009/05/22/secret-message-encoder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
