<?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>Pervasive Code &#187; Mac</title>
	<atom:link href="http://www.pervasivecode.com/blog/category/mac/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pervasivecode.com/blog</link>
	<description>Jamie Flournoy's Software Development Blog</description>
	<lastBuildDate>Fri, 19 Mar 2010 05:37:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Making Bundler 0.8.5 install Nokogiri on Leopard with a newish libxml</title>
		<link>http://www.pervasivecode.com/blog/2010/03/17/making-bundler-0-8-5-install-nokogiri-on-leopard-with-a-newish-libxml/</link>
		<comments>http://www.pervasivecode.com/blog/2010/03/17/making-bundler-0-8-5-install-nokogiri-on-leopard-with-a-newish-libxml/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 01:03:34 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/?p=166</guid>
		<description><![CDATA[Nokogiri on a standard installation of Leopard is complain-y about a couple of old libraries:
&#8220;HI.  You&#8217;re using libxml2 version 2.6.16 which is over 4 years old and has plenty of bugs.  We suggest that for maximum HTML/XML parsing pleasure, you upgrade your version of libxml2 and re-install nokogiri.  If you like using [...]]]></description>
			<content:encoded><![CDATA[<p>Nokogiri on a standard installation of Leopard is complain-y about a couple of old libraries:</p>
<p>&#8220;HI.  You&#8217;re using libxml2 version 2.6.16 which is over 4 years old and has plenty of bugs.  We suggest that for maximum HTML/XML parsing pleasure, you upgrade your version of libxml2 and re-install nokogiri.  If you like using libxml2 version 2.6.16, but don&#8217;t like this warning, please define the constant I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2 before requring nokogiri.&#8221;</p>
<p>Aaron Kalin <a href="http://martinisoftware.com/2009/07/31/nokogiri-on-leopard.html">figured out how to fix this if you&#8217;re installing nokogiri as a system gem</a>, but I want to use Bundler and keep my system gems down to the bare minimum. I figured out how to do this under Bundler 0.8.5.<br />
<span id="more-166"></span></p>
<p>The gems I have installed via plain old &#8220;gem install xxx&#8221; are bundler08 -v0.8.5, rake -v0.8.7, and ZenTest -v4.2.1. That&#8217;s it. Everything else is under vendor/bundler. I&#8217;m using <a href="http://rvm.beginrescueend.com/">RVM</a> and REE 1.8.7 2009.10 as described in <a href="http://www.pervasivecode.com/blog/2010/03/16/using-rvm-to-install-ree-1-8-7-2009-10/">my previous post</a>.</p>
<p>Here is a quick summary of Aaron&#8217;s blog post; this will update your libxml and libxslt libraries to reasonably recent versions. (Be my guest if you want to use libxml 2.7.7 and libxslt 1.1.26, which are current as of today, but I didn&#8217;t test those myself.)</p>
<pre>
mkdir -p ~/Downloads/XML
cd ~/Downloads/XML
curl -O ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz
curl -O ftp://xmlsoft.org/libxml2/libxslt-1.1.24.tar.gz
tar xzf libxml2-2.7.3.tar.gz
tar xzf libxslt-1.1.24.tar.gz
cd ~/Downloads/XML/libxml2-2.7.3
./configure
nice make
sudo make install
cd ~/Downloads/XML/libxslt-1.1.24
./configure --with-libxml-prefix=/usr/local --with-libxml-include-prefix=/usr/local/include --with-libxml-libs-prefix=/usr/local/lib
nice make
sudo make install
</pre>
<p>Now make this YAML file and call it bundler_build_options_macosx_leopard.yml and put it in your RAILS_ROOT:</p>
<pre>
nokogiri:
  xml2-include: /usr/local/include/libxml2
  xml2-lib: /usr/local/lib
</pre>
<p>Then, to build nokogiri so that it uses the new libs you just installed:</p>
<pre>
gem bundle --build-options bundler_build_options_macosx_leopard.yml
</pre>
<p>You should now have nokogiri installed under vendor/bundler/ruby/1.8/gems, and when you run your app it should not complain about the version of libxml2 anymore.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2010/03/17/making-bundler-0-8-5-install-nokogiri-on-leopard-with-a-newish-libxml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hiding a CLI-only user account in Mac OS X 10.5 Leopard</title>
		<link>http://www.pervasivecode.com/blog/2008/11/05/hiding-a-cli-only-user-account-in-mac-os-x-105-leopard/</link>
		<comments>http://www.pervasivecode.com/blog/2008/11/05/hiding-a-cli-only-user-account-in-mac-os-x-105-leopard/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 00:06:52 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/?p=83</guid>
		<description><![CDATA[A year and a half ago I installed the excellent PostgreSQL via MacPorts, and had to create a user account manually. Annoyingly, this postgres user shows up in the GUI login screen and Fast User Switching menu under Leopard. I found a fix today.

I dug around a few months ago, and found some options to [...]]]></description>
			<content:encoded><![CDATA[<p>A year and a half ago I installed the excellent PostgreSQL via MacPorts, and had to create a user account manually. Annoyingly, this postgres user shows up in the GUI login screen and Fast User Switching menu under Leopard. I found a fix today.<br />
<span id="more-83"></span><br />
I dug around a few months ago, and found some options to solve this annoyance that I didn&#8217;t like very much. Changing the shell to /usr/bin/false works but then you can&#8217;t su to postgres. Changing the UID to <500 and enabling the plist option to hide <500 UIDs seems like a kludge. I was looking for a minimally invasive tweak, that would just make it not show up in that menu. Breaking the account so I can't use it the same way, or altering systemwide behavior, seemed drastic given that there are several other system accounts that have the desired behavior.</p>
<p>Today I decided to fix this and looked harder at what <code>dscl</code> would tell me about other hidden accounts. The solution that worked and didn't seem icky to me was this:<br />
<code>sudo dscl . append Users/postgres Password '*'</code></p>
<p>That sets the password string to *. This allows me to continue to <code>sudo su -l postgres</code> whenever I feel like it, but it isn't shown as an account in the GUI. Hooray!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/11/05/hiding-a-cli-only-user-account-in-mac-os-x-105-leopard/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Updated .autotest</title>
		<link>http://www.pervasivecode.com/blog/2008/05/17/updated-autotest/</link>
		<comments>http://www.pervasivecode.com/blog/2008/05/17/updated-autotest/#comments</comments>
		<pubDate>Sun, 18 May 2008 05:36:19 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2008/05/17/updated-autotest/</guid>
		<description><![CDATA[I just brought a new project into the world of autotest. I&#8217;m not using the Leopard FSEvents &#8220;fix&#8221; because it&#8217;s not necessary (note the sleep and add_exception calls below). I am using the fun and helpful sound plugin, but not the playlist version of that plugin. Here&#8217;s my .autotest file.


Autotest.add_hook :initialize do &#124;autotest&#124;
   [...]]]></description>
			<content:encoded><![CDATA[<p>I just brought a new project into the world of <a href="http://nubyonrails.com/articles/autotest-rails">autotest</a>. I&#8217;m not using the <a href="http://rails.aizatto.com/category/autotest/">Leopard FSEvents &#8220;fix&#8221;</a> because it&#8217;s not necessary (note the sleep and add_exception calls below). I am using the fun and helpful <a href="http://www.fozworks.com/2007/7/28/autotest-sound-effects">sound plugin</a>, but not the <a href="http://www.metaskills.net/2008/4/6/autotest-playlist-for-red-green-feedback">playlist version of that plugin</a>. Here&#8217;s my .autotest file.<br />
<span id="more-73"></span></p>
<pre>
Autotest.add_hook :initialize do |autotest|
    autotest.sleep=3
    autotest.add_exception(/\\/\.git\\//)
end

require '/Users/jamieflournoy/autotest/sound/sound'
Autotest::Sound.sound_app = '/opt/local/bin/mpg321'
Autotest::Sound.sound_path = "/Users/jamieflournoy/autotest/sound/sound_fx/"
</pre>
<p>Note that the sound plugin needs a patch:</p>
<pre>
29c29
<   [:run, :red, :green, :quit, :run_command, :ran_command].each do |hook|
---
>   [:initialize, :red, :green, :quit, :run_command, :ran_command].each do |hook|
</pre>
<p>You&#8217;ll also need to make sure your sound set has an initialize.mp3 instead of a run.mp3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/05/17/updated-autotest/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MacBook Pro crashes part 3 &#8211; apparently a hardware issue</title>
		<link>http://www.pervasivecode.com/blog/2008/03/03/macbook-pro-crashes-part-3-apparently-a-hardware-issue/</link>
		<comments>http://www.pervasivecode.com/blog/2008/03/03/macbook-pro-crashes-part-3-apparently-a-hardware-issue/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 00:18:37 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2008/03/03/macbook-pro-crashes-part-3-apparently-a-hardware-issue/</guid>
		<description><![CDATA[In frustration I made a backup of my laptop hard disk, and did an erase-and-install with Tiger from the install DVDs that came with the laptop. Mind you, the Apple Hardware diagnostic gives this machine a clean bill of health. With the original 512MB DIMM, with nothing plugged in but the power cord, and with [...]]]></description>
			<content:encoded><![CDATA[<p>In frustration I made a backup of my laptop hard disk, and did an erase-and-install with Tiger from the install DVDs that came with the laptop. Mind you, the Apple Hardware diagnostic gives this machine a clean bill of health. With the original 512MB DIMM, with nothing plugged in but the power cord, and with a fresh Tiger install, even following an <a href="http://docs.info.apple.com/article.html?artnum=303319">SMC reset</a>, I can crash it. So, this is apparently not Leopard&#8217;s fault.<br />
<span id="more-62"></span><br />
It does take about 45 minutes of heavy use to make it crash, though. I made an iDVD project and had that looping in preview mode, opened about a dozen partly transparent terminal windows running <code>top -s 0</code> overlapping that, played a DVD behind all that, and ran the two .qtz movies in <code>/System/Library/Screen Savers</code>.</p>
<p>I also tried a bunch of intermediate stages of downgrading and testing, including 10.5.0, 10.5.1, 10.5.2 without the Leopard Graphics Update, then with it, 10.4.6 (from the DVD), 10.4.11 with all the current stuff, with and without external display, with and without a shim propping up the bottom of the case with a desk fan blowing directly at the underside of the case. No matter what, I can make it crash, but it takes a good half hour or more before it happens.</p>
<p>Plugging in the external display seems to help (it crashes much more quickly with the external display connected). My guess is that the GPU or VRAM is overheating or is just plain faulty, and that increasing the number of pixels they have to drive is what makes them fail faster.</p>
<p>I had suspected that it might be a GPU temperature problem, or even the dreaded Thermal Paste misapplication problem, but using iStat and Bresink&#8217;s Hardware Monitor, I wasn&#8217;t able to find a correlation between GPU temperature and a GUI crash. But, now that I can prove that it isn&#8217;t due to any non-Apple hardware, and that the OS version is irrelevant, this MBP is going back to Apple for repair. Again.</p>
<p>Again? Yes. I had a somewhat similar problem before, but the video artifacts were much more hardware-y in nature. Apple blamed it on 3rd party RAM and told me if I continued to use non-Apple RAM they would charge me for the next logic board, regardless of AppleCare coverage. So I&#8217;ve been using Apple RAM, which costs about twice as much as the Patriot RAM I had bought originally.</p>
<p>However, that problem was visible to the Apple Hardware Diagnostic software. This one is not &#8211; the diagnostics find nothing wrong (even on the extended diagnostics mode), but in real world usage I get about 2-4 hours of uptime before having to restart. Even, as I said before, under a fresh Tiger reinstall with Apple RAM, and nothing but the power cord plugged in.</p>
<p>Hopefully Apple service folks will be able to reproduce this problem, or diagnose it with some kind of fancier tool that runs for long enough to provoke a failure. I apologize to anyone who has followed in my diagnostic footsteps, which now appear to have been off track.</p>
<p><b>Update: It was actually an intermittent hardware problem and Apple has replaced the logic board of this computer.</b></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/03/03/macbook-pro-crashes-part-3-apparently-a-hardware-issue/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Leopard GUI Crashes &#8211; Not Parallels but Canon?</title>
		<link>http://www.pervasivecode.com/blog/2008/02/22/leopard-gui-crashes-not-parallels-but-canon/</link>
		<comments>http://www.pervasivecode.com/blog/2008/02/22/leopard-gui-crashes-not-parallels-but-canon/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 04:05:28 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2008/02/22/leopard-gui-crashes-not-parallels-but-canon/</guid>
		<description><![CDATA[I had some serious  Leopard stability problems recently. I thought I had found the problem but I was wrong then.
This time I&#8217;m pretty sure I&#8217;ve gotten rid of all the badness. I&#8217;ve had almost 2 days of continuous uptime, which may not sound like something to get excited about, but it sure beats the [...]]]></description>
			<content:encoded><![CDATA[<p>I had some <a href="/blog/2008/02/14/leopard-gui-crashes-solved-caused-by-outdated-parallels-kernel-modules/">serious  Leopard stability problems</a> recently. I thought I had found the problem but I was wrong then.</p>
<p>This time I&#8217;m pretty sure I&#8217;ve gotten rid of all the badness. I&#8217;ve had almost 2 days of continuous uptime, which may not sound like something to get excited about, but it sure beats the 4-6 hour average uptime I&#8217;ve had for the past few weeks.</p>
<p>I&#8217;ve spent so much time on this that I&#8217;m not willing to put in the extra 4-8 hours it would take to really truly isolate this issue. But my best guess is that it was the Canon drivers for my recently purchased Canon PIXMA MX310 multifunction printer. Specifically I think it&#8217;s the scanner driver, but I&#8217;m not certain. If so, that would mean that the culprits were <code>BJUSBLoad.kext</code> and <code>BJUSBMP.kext</code> in /System/Library/Extensions.<br />
<span id="more-60"></span><br />
I got fed up a couple of days ago and started using <code>sudo rm -rf</code> on anything that looked suspicious, based on the output of <code>launchctl list</code>. That included completely removing a recently installed copy of VMWare Fusion, and everything that had been installed for my prior printer, which was an HP PSC 1600. I also re-disabled all my fonts, leaving only the required ones (see the prior post for info about that).</p>
<p>The clue came when I had to scan something this past weekend. I had already reinstalled Leopard on an external drive and brought it up to 10.5.2 with the Leopard Graphics Update 1.0, and it was fine. So, I was using the external drive&#8217;s clean Leopard install to get work done. (As a re-cap, Safe Boot mode on the internal hard drive had worked fine also. So I knew it had to be something not installed on the external drive yet, that was loaded only in non-Safe Boot mode.)</p>
<p>In order to scan a document I had to install the Canon drivers for the printer and scanner. A couple of hours after doing so, the system froze up. I hadn&#8217;t yet made the mental association between the Canon drivers and the subsequent crash, so I kept using the system for a while, even though it was crashing and requiring a reboot every few hours. At that point I decided to punt and go back to using my internal drive, since it was no worse now than the reinstall.</p>
<p>So, given that info, and the fact that I had never installed the HP drivers nor VMWare Fusion on the external drive, I&#8217;m pretty sure it was one of the Canon drivers. Otherwise there would have to be something in my user directory (which I copied over from the internal drive) which managed to start up something that was not installed on the active boot disk. That seems unlikely to me, but possible. In the launchd config files I&#8217;ve seen, the paths are hard-coded to where the installer puts things, so even though the internal drive was mounted, those things should have failed to start because the actual installed drivers and daemons are not where they were expected to be.</p>
<p>So, which Canon driver is it? Probably the scanner driver. From what I can tell, the printer driver is more or less an outgoing thing: try and print, and it looks on the USB bus for the printer, and prints to it. However, the scanner driver has to deal with the case where the user presses the &#8220;Scan&#8221; button on the printer&#8217;s control panel. If that happens it launches either Image Capture.app or the &#8220;MP Navigator EX&#8221; application which is Canon&#8217;s multifunction dashboard app. My suspicion is that this is what those two kexts are for.</p>
<p>So, if you get this kind of trouble, try blowing away those two kexts (wouldn&#8217;t it be grand if Canon provided an uninstall feature for their scanner driver?) and rebooting and see if that fixes it. Better yet, delete them one at a time and reboot each time, and see if you can figure out which one is really the problem.</p>
<p><b>Update: It was actually an intermittent hardware problem and Apple has replaced the logic board of this computer.</b></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/02/22/leopard-gui-crashes-not-parallels-but-canon/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Leopard GUI crashes, Part 1</title>
		<link>http://www.pervasivecode.com/blog/2008/02/14/leopard-gui-crashes-solved-caused-by-outdated-parallels-kernel-modules/</link>
		<comments>http://www.pervasivecode.com/blog/2008/02/14/leopard-gui-crashes-solved-caused-by-outdated-parallels-kernel-modules/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 23:56:44 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Parallels]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2008/02/14/leopard-gui-crashes-solved-caused-by-outdated-parallels-kernel-modules/</guid>
		<description><![CDATA[I&#8217;ve had an average uptime over the last couple of months of approximately 48 hours on my MacBook Pro. This has been frustrating and very hard to diagnose, but I think I nailed it today.

Random &#8220;graphics errors&#8221;, for lack of a better term, would appear on the screen from time to time. (See picture.)

These looked [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had an average uptime over the last couple of months of approximately 48 hours on my MacBook Pro. This has been frustrating and very hard to diagnose, but I think I nailed it today.<br />
<span id="more-58"></span><br />
Random &#8220;graphics errors&#8221;, for lack of a better term, would appear on the screen from time to time. (See picture.)<br />
<a href="/images/leopard_video_errors.png"><img src="/images/leopard_video_errors.png" alt="Screen shots you never want to see on your own computer" width="464" height="290" style="border:none" /></a></p>
<p>These looked very software-ish to me, and forcing a window to repaint (resizing it, etc.) would make them go away. Eventually, the entire screen would freeze except for the cursor, which would remain as a pointer or insert bar despite being moved to various parts of the screen. Given that iTunes or a DVD would keep making noise, I guessed that this was not a systemwide freeze, and I discovered that I could ssh in from another machine and run <code>shutdown -h now</code> or <code>reboot</code> as root and usually get a clean shutdown.</p>
<p>I later learned that I could use <code>pmset hibernatemode 1</code> to force hibernation instead of normal sleep mode, so that I could un-freeze the GUI by logging in remotely and forcing it to hibernate using <code>pmset sleepnow</code> and then manually waking it up.</p>
<p>All this time I was still trying to figure out how to trigger a failure on demand, and to read log files to find some clues. I didn&#8217;t find any log file clues, but I did rule out a hardware problem using the Apple Hardware Diagnostic program that came on the installation DVDs with the computer. The recent 10.5.2 update and exciting-sounding &#8220;Leopard Graphics Update 1.0&#8243; didn&#8217;t solve the problem. In fact, after the 10.5.2 update and that graphics update, the time between failures dropped to about 5-6 hours.</p>
<p>I learned that opening ~150 windows and triggering Expose (via F9) repeatedly would quickly freeze the GUI. At this point my question was, is this a generic Leopard quality problem or a problem specific to all the junk I have installed? Or perhaps a hardware issue not detectable by the diagnostic software?</p>
<p><a href="http://docs.info.apple.com/article.html?artnum=107392">Safe boot</a> proved it to be very likely to be a problem with third party software; the problem was gone when Safe Booted. So then it was a matter of selectively disabling various things that Safe Boot disables and booting normally, until the problem goes away.</p>
<p>I wrote a simple script to move all fonts not in the <a href="http://docs.info.apple.com/article.html?artnum=307069">list of fonts installed with Leopard</a> into a folder on my desktop; that didn&#8217;t make the problem go away. According to Font Book&#8217;s validation feature, I have about 2 dozen damaged fonts (including all of the music notation fonts installed by Sibelius, and Adobe&#8217;s Carta font family), but hey, Apple&#8217;s own Helvetica LT MM font fails validation too. In fact, all of the built-in &#8220;MM&#8221; fonts do. It seems that the Font Book validator considers any wacky glyph shapes (like the <a href="http://en.wikipedia.org/wiki/Multiple_master_fonts">Multiple Master</a> fonts that make PDFs possible, or music notation symbols, or dingbats) to be invalid.</p>
<p>My next step was to disable any startup items in <code>/System/Library/StartupItems</code> (which was empty) and <code>/Library/StartupItems</code>. There were some old HP printer and scanner drivers, some M-Audio Firewire audio drivers from my <a href="http://www.m-audio.com/products/en_us/FireWireSolo-main.html">Firewire Solo</a> (no Leopard drivers exist yet), <a href="http://en.wikipedia.org/wiki/Apple_Qmaster">Qmaster</a>, <a href="http://www.dshadow.com/software/unlockupd/">Unlockupd</a>, and <a href="http://www.bresink.com/osx/TemperatureMonitor.html">BRESINKx86Monitoring</a>. All seemed plausible as causes of problems but disabling all of them didn&#8217;t fix the problem. Now that I&#8217;ve looked up what they each do, though, I&#8217;m not going to put them back.</p>
<p>Finally, I disabled the non-Apple stuff in <code>/System/Library/Extensions</code>. There are almost 300 items in there, and most of them sound important. In fact, there&#8217;s even <code>Dont Steal Mac OS X.kext</code> which apparently contains a <a href="http://forums.macnn.com/90/mac-os-x/335611/dont-steal-mac-os-x-kernel/">pretty funny easter egg</a> (see the post by &#8220;kick52&#8243; on that page). I installed a fresh copy of Leopard from my install DVD onto an external drive and used <code>ls -1</code> and <code>diff</code> to compare the directory contents. I also performed my torture test and verified that Leopard 10.5.0 all by itself would not freeze when pushed. OK, so it&#8217;s definitely not hardware, nor is it a problem inherent to Leopard.</p>
<p>I googled the filenames of the <code>.kext</code> bundles in <code>/System/Library/Extensions</code> on my hard disk that weren&#8217;t in the base Leopard install, and found that there were some <a href="http://www.parallels.com/">Parallels</a> kernel extensions in there, from about two years ago when I was using Tiger. Uh oh. So I moved those to another directory. The modules I removed are called <code>helper.kext</code>, <code>hypervisor.kext</code>, <code>Pvsnet.kext</code>, and <code>vmmain.kext</code>. My Parallels.app version is 2.5 v3188, which is pretty old.</p>
<p><strong>UPDATE:</strong> <em>I missed one: <code>ConnectUSB</code>. I found it by running <code>kextstat</code> while ssh&#8217;d in from another machine, after it froze again a day later. It was listed as com.parallels.kext.ConnectUSB, which stood out among all the com.apple stuff. I had used <code>locate parallels</code> and missed the stuff that shows up with <code>locate Parallels</code> &#8211; I didn&#8217;t realize it was case sensitive. Hopefully this is the last bit.</em></p>
<p>The problems seem to be gone now. Woo hoo! I can do my torture test with > 300 finder windows, eight Quicktime movies open and playing, and  DVD Player showing a movie behind a partially transparent Terminal window.</p>
<p><strong>UPDATE #2:</strong><em>I continued to have crash problems after this point. I now believe that the Canon MX310 scanner driver was the problem. <a href="http://www.pervasivecode.com/blog/2008/02/22/leopard-gui-crashes-not-parallels-but-canon/">More details are here</a>.</em></p>
<p>I could have saved myself a lot of pain with <a href="http://docs.info.apple.com/article.html?artnum=107120">Archive and Install</a>, but I think I&#8217;m still coming out ahead due to the time saved by not having to reinstall and relicense dozens of applications. However, for mainstream users (who aren&#8217;t willing or able to go through this amount of troubleshooting effort) I strongly recommend using the Archive and Install when installing Leopard on a machine that currently has Tiger installed.</p>
<p><b>Update #3: It was actually an intermittent hardware problem and Apple has replaced the logic board of this computer.</b></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/02/14/leopard-gui-crashes-solved-caused-by-outdated-parallels-kernel-modules/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Leopard Upgrade Report: Mo&#8217; Features, Mo&#8217; Problems</title>
		<link>http://www.pervasivecode.com/blog/2007/12/27/leopard-upgrade-report-many-new-features-many-new-bugs/</link>
		<comments>http://www.pervasivecode.com/blog/2007/12/27/leopard-upgrade-report-many-new-features-many-new-bugs/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 20:01:40 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/12/27/leopard-upgrade-report-many-new-features-many-new-bugs/</guid>
		<description><![CDATA[(Apologies to The Notorious B.I.G. for the title.)
I upgraded to Mac OS X 10.5 &#8220;Leopard&#8221; recently. In short, it&#8217;s not ready for mainstream use. There are a few nice improvements, but these are balanced by numerous problems that make me wish I had waited until, say, June 2008 or so. If you haven&#8217;t upgraded and [...]]]></description>
			<content:encoded><![CDATA[<p>(Apologies to <a href="http://en.wikipedia.org/wiki/Mo_Money_Mo_Problems">The Notorious B.I.G.</a> for the title.)</p>
<p>I upgraded to Mac OS X 10.5 &#8220;Leopard&#8221; recently. In short, it&#8217;s not ready for mainstream use. There are a few nice improvements, but these are balanced by numerous problems that make me wish I had waited until, say, June 2008 or so. If you haven&#8217;t upgraded and aren&#8217;t sure that you need to, I suggest that you wait a few months, until some of the bugs have been worked out.<br />
<span id="more-53"></span><br />
<b>The Good Stuff:</b></p>
<p>Terminal.app now allows tabbed terminals in one window. Terminal also allows window background transparency, which wouldn&#8217;t normally be a feature I would care about, except that it makes it quite easy to set transparency at about 85-90% and put a DVD window behind it. This setup is more readable than the arrangement that <a href="http://www.translucy.com/">Trans Lucy</a> provides (it overlays a transparent movie window instead). If you&#8217;re like me, sometimes you work better with something busy going on in the background, and this does a good job of leaving text legible while making the movie kinda visible in the background.</p>
<p>Terminal and Safari now allow tabs to be dragged downward off of the tab bar to create a new window for that tab. It looks pretty cool and can be useful at times, mostly in Safari when you&#8217;re browsing a bunch of sites and want to pick one and background-load a bunch of links off of that page.</p>
<p>The new Finder fixes some of the old Finder bugs, though it brings new ones. (More about that below.) Basic problems like window resizing not shrinking to fit only the icons that were there, scroll bars displaying even when they are not needed, etc. are now gone. Desktop icons for volumes remember where you left them instead of being automatically placed every time they are mounted. They also position themselves so as to avoid being under the Dock if hiding is off (they don&#8217;t reposition themselves automatically as soon as the Dock position changes, but they are aware of where the Dock overhangs when they are choosing where to align).</p>
<p>Similarly, the window manager is smarter about being aware of where the Dock is, and will try to avoid resizing or zooming windows in ways that put part of them under the Dock.</p>
<p>Preview.app is a bit nicer: you can open a bunch of windows at once, even in one-window-per-file mode, and it stacks the windows in sorted order based on filename. The previous version (bundled with Mac OS X 10.4) opened them in essentially random order and would only open a maximum of 20 windows at once, forcing photos 20 and up into a single window with an image list in the sidebar. I don&#8217;t know about you but I take a lot more than 20 photos at any given event and it&#8217;s annoying to have to keep track of how many Preview windows I have open in order to keep it from merging the excess ones together into a single window. The new Preview fixes that.</p>
<p>My complex development environment worked fine, with one exception (details below). Ruby on Rails, Mongrel, PostreSQL via <a href="http://www.macports.org/">MacPorts</a>, and autotest all worked fine. That was a big relief.</p>
<p><b>The Bad Stuff:</b></p>
<p>There are some incompatibilities that caused me problems early on. Most notably, Application Enhancer (used by the handy Instant Hijack feature of the excellent <a href="http://rogueamoeba.com/audiohijackpro/">Audio Hijack Pro</a>) causes a blue screen on boot! Here are the <a href="http://docs.info.apple.com/article.html?artnum=306857">removal instructions</a>. Fortunately I did a backup before installing (really it was just my nightly full backup) or I would have been a lot more freaked out about this.</p>
<p>I experienced seriously poor wireless networking performance. By that I mean very erratic ping times and latency even when sitting right next to the base station. <a href="http://discussions.apple.com/thread.jspa?messageID=5938541#5938541">Here are the details and fix</a>; basically it&#8217;s a preferences file problem, which can be fixed by deleting the old 10.4-era preferences file. I&#8217;m not sure how Apple QA missed this one; I&#8217;d think that 100% of Tiger-to-Leopard upgrade cases would experience this problem.</p>
<p>GNU Screen, which I use like crazy, changed somehow, and I can&#8217;t figure out what they changed from the documentation. My super slick Screen running shell script, which sets up my whole development environment like a character mode IDE, broke. PATH somehow gets stomped and reset to the standard login-shell PATH, but no other environment variables get touched. I was not able to figure out why Screen was doing this in Leopard but not in Tiger, and eventually punted and put a hack in my .screenrc to re-set the PATH the way I wanted it in each screen. (Previously I had set it before creating any screens and it was inherited by each of them.)</p>
<p>There are UI issues that make existing applications not work right. <a href="http://www.omnigroup.com/applications/omnigraffle/">OmniGraffle</a>, which is a truly fabulous drawing program, had some strange input problems with mouse clicks that made it display error messages. A small point release fixed the problem, and the new OmniGraffle 5.0 beta releases have no issues. Unfortunately, OmniGraffle 5 is Leopard-only, and has a new file format that causes version 4 to warn you about possible unknown incompatibility upon opening the file. Given my current attitude of &#8220;don&#8217;t upgrade until later&#8221; about Leopard for other people, I don&#8217;t want to trap my drawings in a new Leopard-only format. So I&#8217;m still using 4.2.2 and it&#8217;s fine.</p>
<p>Other applications are not so fine. Microsoft Excel has some input issues that cause the keyboard input to suddenly go into limbo for no apparent reason. Clicking onto another application&#8217;s window and then back onto Excel fixes it; there is no current fix from Microsoft for this. You just have to accept that sometimes your keyboard input goes away and you have to fiddle for a minute to get it back. I think I&#8217;ve figured out that it has something to do with AutoFill and the popup menu of possible completions, so it may be possible to train oneself to not ever do whatever it is that causes the keyboard input to go nuts. But I&#8217;d rather just upgrade to Office 2008 whenever it comes out.</p>
<p>Adobe Photoshop CS3 has input problems as well. Most notably, the little numeric text input boxes for various tools work once and then go dead. For example, try transforming a selection and specifying, say, 66% width. Then do the same thing again &#8211; can&#8217;t do it; the typing goes into nowhere and the resizing never happens. The text is even drawn incorrectly in the little text box. This is a well known problem and <a href="http://www.isights.org/2007/11/leopards-photos.html">according to this guy quoting an Adobe spokesperson, it will be fixed soon</a>. As far as I can tell there is no workaround for this.</p>
<p><a href="http://www.bombich.com/software/ccc.html">Carbon Copy Cloner</a> 3.0.1, which I use for backups, doesn&#8217;t work properly on Leopard. Its only function in my world is to sync my whole hard disk every night to an external hard disk. It doesn&#8217;t do this correctly, unless you run the program and uncheck/recheck the checkbox next to the scheduled task every time you reboot. Supposedly the 3.0.2 update will fix this, so that the scheduled task properly installs itself without user intervention. For now I have a text file that reminds me to do this in my home directory, and I dragged that icon into my account&#8217;s Login Items list in System Preferences so I don&#8217;t forget to do it.</p>
<p>There are some race conditions apparent with opening items from Samba valumes. I have a home server with lots of files on it, and some aliases to folders on that server are on my laptop. So, when I log in, I can just open the folder and it mounts the server volume and goes right there. In Leopard, if I open more than one such folder alias, all of them fail, the volume fails to mount, and a stack of error dialog boxes piles up in the middle of my screen. Upon dismissing the last such error dialog box, the Finder crashes. The workaround is to mount the server volume first, or to open only one server-based folder alias first, and then open the rest.</p>
<p>Worse, if you have aliases to .dmg (disk images) on the server, and you try to mount more than one .dmg from a server at the same time (select more than one and open them simultaneously), all of them will fail and the <code>diskimages-helper</code> processes will all get stuck. At that point you must reboot in order to un-wedge the situation; kill -9 kills the processes but any future disk images will get stuck trying to mount in the same fashion. The workaround is to never try and open more than one alias to a disk image from a server at once. You can keep a bunch mounted, but you have to open and mount each one separately.</p>
<p>There are also a lot of cosmetic problems, mostly with the new Finder. The translucent menu bar makes it hard to read things on the menu bar, and just plain looks sloppy with any background other than a white one. I didn&#8217;t like the stripes in list view in the finder and <a href="http://www.macosxhints.com/article.php?story=20071101062430328">using this hint</a>  turned that display option off with <code>defaults write com.apple.finder FXListViewStripes -bool FALSE</code> at a command line.</p>
<p>The Finder seems to have completely lost its ability to remember what view type (list, icons, or columns) you wanted for each window; I have frequently found that I&#8217;ll set a window to list view and navigate around and when I re-open that folder it&#8217;s in icon view, or vice versa. I&#8217;m pretty good at detecting patterns of UI behavior so I think I would have grasped any new system Apple has devised for deciding what view a window should have. Whatever the new one is, it sucks.</p>
<p>The Finder still has problems displaying image previews in icon mode. That&#8217;s one of my favorite OS X features: the ability to just open a folder full of photos and see previews of all of them at 128&#215;128 pixel size, without using iPhoto or some other photo gallery app. Sadly, the Finder sometimes just stops building previews of the currently displayed set of icons, and you have to scroll around or &#8220;select all&#8221; and then &#8220;select none&#8221; to kick it so it notices that it still has some preview-building work to do. I do wish it would cache previews on disk, too; it&#8217;s silly that almost every time I visit a folder full of photos, it has to rebuild the previews from scratch. It does cache the previews in memory, but I have digital camera photos from ten years ago, and I don&#8217;t understand why the Finder needs to keep rebuilding the previews over and over.</p>
<p>The Finder still resizes the window so that it is partially offscreen when displaying the Toolbar. If you want to search within the current folder, you need to show the Toolbar and enter text in the search box. Okay, but that means that the Sidebar (with all the volumes, on the left side of the window) appears, and for some reason the whole window resizes to preserve the size of the content area, which means that the window grows, substantially. It also preserves the position of the content area, so the window grows on all three sides except the top. If your Finder window was close to being as big as the screen, the new size will be off screen in every direction. You can&#8217;t zoom the window without moving it first so that the zoom button is on screen, because the zoom button is now off the left side of the screen. It&#8217;s really not very slick, and becomes annoying if you use the Finder very much.</p>
<p>Also, when searching in the Finder using the in-window search function, the scope is always reset to &#8220;This Mac&#8221; instead of the current folder. Given that there&#8217;s a separate Find function, that doesn&#8217;t make a lot of sense. Since the search scope controls don&#8217;t appear until after you&#8217;ve started typing a search string, your only option is to start searching the whole computer and then click the scope button you wanted, which responds slowly since the Finder is busily carrying out the global search you didn&#8217;t want. Eventually it throws away the first partially-completed result set and starts over from the current window. Again, it&#8217;s frustrating if you search the current folder and its contents very often.</p>
<p>To be honest, though, a lot of these Finder gripes are new UI annoyances exchanged for old Finder UI annoyances. The new Finder is marginally better, except for all that mounting-multiple-disk-image or opening-multiple-folder stuff.</p>
<p><b>Conclusion:</b></p>
<p>Wait before upgrading, to give Adobe and Microsoft and Apple time to release some updates. I would say maybe March or June would be a good time to check on these things and see if it&#8217;s safe to upgrade. Until then, keep using Tiger; it&#8217;s really quite good and doesn&#8217;t have these issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2007/12/27/leopard-upgrade-report-many-new-features-many-new-bugs/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Journalists, Developers Puzzled by Android SDK&#8217;s License</title>
		<link>http://www.pervasivecode.com/blog/2007/11/21/journalists-developers-puzzled-by-android-sdks-license/</link>
		<comments>http://www.pervasivecode.com/blog/2007/11/21/journalists-developers-puzzled-by-android-sdks-license/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 19:55:08 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[strategy]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/11/21/journalists-developers-puzzled-by-android-sdks-license/</guid>
		<description><![CDATA[The Android mobile phone software platform from Google has some journalists and developers confused due to its license terms. The terms are open source, but not as free as the GNU Public License. That decision has people wondering what Google&#8217;s up to. I have a theory about why they did this.

Android is a full software [...]]]></description>
			<content:encoded><![CDATA[<p>The Android mobile phone software platform from Google has some journalists and developers confused due to its license terms. The terms are open source, but not as free as the GNU Public License. That decision has people wondering what Google&#8217;s up to. I have a theory about why they did this.</p>
<p><span id="more-51"></span></p>
<p>Android is a full software stack made up of many projects that exist separately from Android. The components of this stack are available under a variety of different terms: Linux is GPL&#8217;d; WebKit is LGPL&#8217;d; SQLite is in the public domain; FreeType is available via GPL or its own license. There are probably a dozen more little libraries and components that Android builds upon, all of which have licenses that need to be considered. It&#8217;s not possible for Google to just put a bow on the whole stack and say it all uses license X.</p>
<p>Google has released the Android SDK, which is the top layer, under the Apache license. According to the <a href="http://www.opensource.org/licenses/alphabetical">OSI list of approved open source licenses</a>, this is an open source license. And yet, <a href="http://www.wired.com/techbiz/it/news/2007/11/android_opensource/">the reaction to Android from open source advocates is negative</a>. Why? Well, the concern is that some implementation of Android will add proprietary code and/or remove standard code, fragmenting the platform. Since Google can&#8217;t rewrite the licenses of the underlying components of the stack, we&#8217;re really talking about fragmentation at the top layer of the stack.</p>
<p>The Apache license allows for parties who download the source code to alter it and then keep the altered source code secret, while distributing a derivative work. Contrast this with the &#8220;viral&#8221; GNU Public License, which obligates all parties who modify the source to either keep the modified software completely to themselves, or to distribute the source if they distribute a derivative work. Ignoring the case where a licensee simply keeps the derivative work to themselves, the GPL forces a web of innovation and collective advancement, whereas the Apache license encourages a central publishing model, where innovations are kept private and used for competitive gain.</p>
<p>Thus, Android applications designed to be compatible with Google&#8217;s platform could be made incompatible with a particular device, by a handset vendor who removes core Android APIs and replaces them with their own closed source alternative. This might seem like a paranoid fantasy of a small clan of open source zealots, but it&#8217;s not. This is the same tactic that Apple has successfully used to keep Mac OS X closed. Mac OS X rests upon a large amount of open-source code (some of which is also part of what Android is built upon), while requiring developers to code to Apple&#8217;s proprietary Cocoa APIs in order to make Mac apps. You can install Linux on a Mac, but then you lose the ability to run Mac OS X apps. You can build generic Unix applications on a Mac, but they look quite different from a standard Mac app, and lose a lot of Mac-specific functionality. Apple chose to make this possible, but compare this with the iPhone, which uses much of the same software underneath, but (as of this writing) cannot run a generic Unix app because Apple doesn&#8217;t want you to do this.</p>
<p>This same sort of situation is possible with Android under this license. Company X grabs the Android sources, dumps a few key APIs (maybe the GUI, network, and process management ones) and suddenly they have their own incompatible platform that can run on the same hardware but can&#8217;t share apps with the mainstream. Dump phones on the market (subsidized by monthly fees, as usual) and fund a few key apps (MP3 player, movie player, email/SMS, web browser) and users are stuck with that vendor&#8217;s offering, just like they are now. And this is just how telcos and media companies, both of whom are desperately trying to keep hardware and software platforms closed, think. The more closed a platform is, the more secure they feel about their profits, and the more willing they are to invest in it.</p>
<p>The only charitable explanation I can think of for why Google chose this license is the Apple explanation.</p>
<p>If Google were really pandering to the existing mobile carrier crowd, they could simply have released nothing, because another closed platform to build phones with and to write apps for is pointless. There are plenty of existing <a href="http://www.scripting.com/davenet/2001/07/06/theMicroChannelArchitectur.html">trunks to be locked in</a> already. We don&#8217;t need somebody else to slap together a Linux distro for phones with a closed GUI on it. You can to go LinuxWorld Expo and probably find two dozen companies doing exactly that, and none of them is particularly successful. Google is too smart to add itself to this list of flops. It makes no strategic sense.</p>
<p>More likely, I think, is that Google intends to be Company X in my above scenario, putting themselves in the role of Apple by making an &#8220;Android Plus&#8221; premium platform that they put on the handsets they&#8217;re pushing. In this scenario, you can write your own apps to the reference platform and they&#8217;ll run on Google&#8217;s favored phone, but Google can still reserve the right to put all sorts of funky stuff on their phones without documenting it or giving developers or users any rights to it, and more importantly, without having to open source their special components so that non-Google devices could use them.</p>
<p>Sure, this is a charitable interpretation. They might just have screwed up royally, buying a company (Android) that wasn&#8217;t anything special and releasing something that no one other than journalists will pay attention to. But given that Google is betting $4.6 billion on the 700MHz spectrum auction in the U.S., I&#8217;m reluctant to simply write Android off as a &#8220;hail mary&#8221; acquisition.</p>
<p>There must be a larger strategy here, and I suspect it&#8217;s Google putting itself in the shoes of mobile carrier, handset OS maker, and service provider. Somebody else manufactures the handsets, of course, but Google owns and operates the whole experience from end to end other than that. You buy a Google device, pay a monthly Google subscription fee, your bits travel over a Google global network of wireless towers and a wired backbone, and you run apps on your Google phone that interact with Google back-end services. It&#8217;s a carbon copy of Apple&#8217;s iPhone/iTunes strategy, without AT&#038;T in the picture, and with third party apps allowed on the phone, as long as they work on the already-published Android SDK. All Google has to do is to make a decent looking device and be less customer-hostile than existing U.S. mobile providers, and they&#8217;ll do well.</p>
<p>In this light, the partnering talks with existing mobile carriers is puzzling. It&#8217;s possible that they&#8217;re pitching a strategy that removes the burden of application development from mobile carriers, allowing them to be the billing companies that they really are, and putting Google in the position of being the provider of content and software. The lukewarm responses from these carriers is predictable; for the carriers to be involved as just bandwidth providers and customer billing service providers, there would have to be a careful negotiation of revenue sharing, or else the carriers will simply continue on their current, very lucrative course.</p>
<p>If they are planning to become a carrier themselves, then nothing can actually begin to happen until January, when the 700MHz spectrum auction actually takes place. There&#8217;s a closer <a href="http://arstechnica.com/news.ars/post/20071116-its-official-google-planning-700mhz-bid.html">December 3rd</a> deadline for Google to reveal their plans. At that point we&#8217;ll know what they&#8217;re up to, assuming they&#8217;re actually able to buy the spectrum that would make it possible. Alternatively, this spectrum purchase could be a bargaining chip on Google&#8217;s part, which they do not intend to directly utilize themselves. Google would provide the spectrum, the handsets, the OS, the apps, and the services, and the carrier partners would provide the towers, the maintenance staff, sales, and billing.</p>
<p>Given all this, it makes little sense for Google to GPL the Android platform. They need to own it so that they can assure a prospective carrier partner that they will be the ones whose phones are being used by customers, in order to share revenues. If they were to open up the handset market entirely, the carriers would block any new entrants and Android based phones would be doomed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2007/11/21/journalists-developers-puzzled-by-android-sdks-license/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Impressions of Ruby on Rails from an ex J2EE developer (me)</title>
		<link>http://www.pervasivecode.com/blog/2007/07/05/impressions-of-ruby-on-rails-from-an-ex-j2ee-developer-me/</link>
		<comments>http://www.pervasivecode.com/blog/2007/07/05/impressions-of-ruby-on-rails-from-an-ex-j2ee-developer-me/#comments</comments>
		<pubDate>Fri, 06 Jul 2007 05:20:15 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/07/05/impressions-of-ruby-on-rails-from-an-ex-j2ee-developer-me/</guid>
		<description><![CDATA[A friend who is working primarily in the J2EE technology world (as I was, until early 2006) asked me for a how&#8217;s-it-going with respect to Ruby and Rails.
The short version:
- Ruby is fun to program in, as you&#8217;ve probably heard
- Rails is over-hyped, but it&#8217;s still quite good (definitely not perfect)
- I like the productivity [...]]]></description>
			<content:encoded><![CDATA[<p>A friend who is working primarily in the J2EE technology world (as I was, until early 2006) asked me for a how&#8217;s-it-going with respect to Ruby and Rails.</p>
<p>The short version:<br />
- Ruby is fun to program in, as you&#8217;ve probably heard<br />
- Rails is over-hyped, but it&#8217;s still quite good (definitely not perfect)<br />
- I like the productivity of Ruby on Rails but I wouldn&#8217;t call it a silver bullet by any means<br />
- Ruby performance was bad and is getting less bad, and can even be good if you do what the experts say<br />
- The real gem (har har) in the Ruby and Rails space is the community itself<br />
<span id="more-32"></span><br />
Now for the longer version:</p>
<p>It&#8217;s hard for me to be objective since I only started programming in Ruby in February and started using Rails in April, but the language and framework don&#8217;t strike me as tedious or kludgy at all. I&#8217;m definitely enjoying Ruby and making use of its fancier language features, all of which seem to actually work as advertised without any hideous gotchas when you actually try to do something slick.</p>
<p>I particularly enjoy the way Ruby&#8217;s collections allow you to write in the style of a functional language; have a look at the <a href="http://www.ruby-doc.org/core/classes/Array.html">Array</a>, <a href="http://www.ruby-doc.org/core/classes/Enumerable.html">Enumerable</a>, and <a href="http://www.ruby-doc.org/core/classes/Hash.html">Hash</a> classes to see what I mean. It&#8217;s possible to write extremely compact code that morphs a collection into something very different, but without the inscrutability of Perl.</p>
<p>Compared to my experience with mainstream Java and J2EE, I certainly don&#8217;t miss Tomcat, Ant, Struts, or JSP Expression Language. (Instead I&#8217;m using Mongrel, Rake, Rails, and ERB.) That&#8217;s not Java&#8217;s fault, and could be alleviated by just picking better tools and frameworks at the start of a project. I don&#8217;t miss Hibernate but I don&#8217;t have any gripes about it either.</p>
<p>There are features in Java 1.5 that are helpful in alleviating some of the annoyances of programming in Java, but because these are new features, the vast majority of library code in the wild doesn&#8217;t use them (similar to the problems with OO being bolted onto Perl and PHP). Also there are political and business deployment roadblocks to using the latest technology: just because you can download an official release of something and it works perfectly for your code, that doesn&#8217;t mean that you necessarily have permission to deploy that technology stack onto production servers. Big organizations take years to officially support new releases, so you may be stuck developing against 3 year old products and APIs.</p>
<p>I&#8217;m not trying to troll for Java vs Ruby comment flames here. My point is just that Ruby has had features for a relatively long time that Java is just recently adopting (or simulating), and that&#8217;s important for more than just petty bragging rights; a feature that&#8217;s unavailable to you for your own org&#8217;s political or financial reasons might as well not be there at all. (Or maybe it&#8217;s worse, if it makes you bitter about your own work environment: &#8220;I have to write all this ugly stupid code because Bob is afraid to upgrade the server&#8230; grr.&#8221;)</p>
<p>I can remember quite a few times when I painted myself into a corner in Java and had to write lots of type casting / checking / converting code, or had to try and work around single inheritance using composition and lots of boilerplate proxy methods, or really wished java.lang.String weren&#8217;t final so I could subclass it, etc. Ruby feels a lot more like Perl or JavaScript than Java when it comes to being able to do whatever you want when you&#8217;re sure you know what you&#8217;re doing, and being able to write weird fancy code that magically makes everything that calls it become dead simple.</p>
<p>I used to be horrified at the idea of messing with somebody else&#8217;s classes (as is done by <a href="http://require.errtheblog.com/plugins/changeset/221">Hash.slice</a> from will_paginate, which I swiped all by itself since I don&#8217;t really need will_paginate), but I&#8217;m finding that the apocalypse I feared just isn&#8217;t there. If you do something wacky, like add a new method to String, the world doesn&#8217;t collapse. Or maybe it does, and you decide not to do it that particular way; just do something else. ActiveSupport adds all kinds of stuff to base classes like String, and it&#8217;s OK. Example: <a href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html">ActiveSupport::CoreExtensions::String::Inflections</a>.</p>
<p>I&#8217;m still adjusting to using a dynamic language: not uber-checking arguments and state all the way down a method call stack (oh no! is it nil?), not locking down everything so it can only work the way I planned, etc.  In most cases, the Ruby equivalent of a NullPointerException is fine. I think this is because the built-in error message includes the type and method you were trying to call, so you can usually just read that and see what you did wrong. The only time you&#8217;d want to prevent that is if you bury that error deep in your own code, so that the caller would have no idea of what they did that led to it. I&#8217;m finding that I&#8217;m OK with writing less paranoid code, because the failure will still happen, and be suitably clear in its cause, without my explicitly checking for it.</p>
<p>An issue with Ruby and Rails is that the official documentation is limited. It&#8217;s imperative to have 2 or 3 books on hand at all times, in addition to the RDoc Rails documentation. I own three of the Pragmatic Programmer books: <a href="http://www.pragmaticprogrammer.com/titles/ruby/">Programming Ruby</a> (the &#8220;pickaxe book&#8221;), <a href="http://www.pragmaticprogrammer.com/titles/rails2/index.html">Agile Web Development with Rails, <b>2nd Edition</b></a>, and <a href="http://www.pragmaticprogrammer.com/titles/fr_rr/index.html">Rails Recipes</a>. Just looking at generated API documentation won&#8217;t tell you how you&#8217;re supposed to use libraries.</p>
<p>The reverse way of looking at that need for documentation is symbol lookup. Rails does some pre-including of library and framework files before loading the application file you&#8217;re working on, so unlike Java, you don&#8217;t have a mandatory list of imports at the top that tell you where every class you&#8217;re working with came from. There are some symbols and functions you can call from instances of particular classes, and they came from somewhere but it&#8217;s not obvious where, at least when you&#8217;re starting. A good IDE with &#8220;find declaration&#8221; could fix this, but initially it&#8217;s daunting: &#8220;what are *all* the options for this method?&#8221; &#8220;Where is this method defined, even?&#8221; etc. This is where the books are less useful and API documentation can help.</p>
<p>I&#8217;ve also subscribed to a couple dozen RSS feeds that help me keep up with what the really slick Ruby and Rails people are using, writing, struggling with, etc. Chief among them is probably <a href="http://errtheblog.com/">Err the Blog</a>. The <a href="http://podcast.rubyonrails.org/">Ruby on Rails podcast</a> is helpful also.</p>
<p>As for productivity, here are 4 specific time-savers I&#8217;ve found:</p>
<p>1) TextMate, which is very slick. There are Windows equivalents, though from what I&#8217;ve heard, they&#8217;re not 100% as good. Point is, a text editor that understands Ruby is critical, and if it helps you jump around in a big tree of files, that&#8217;s very helpful.</p>
<p>I&#8217;m an Emacs devotee, and TextMate is far better for Ruby and Rails. It&#8217;s hard to explain, but let&#8217;s just say that TextMate is much deeper and more featureful than it appears at first glance.</p>
<p>I looked at NetBeans which is pretty close to being a very smart Ruby &#038; Rails IDE, but it was still suffering an identity crisis (am I a Java IDE? or a multi-language thing?) that cluttered the UI badly. This is a hot area of innovation right now so any week now TextMate might be eclipsed (or Eclipsed, har har) by something more full-featured. There are a few other options but I didn&#8217;t see anything that led me to believe a multi-hour or multi-day eval would be worth it.</p>
<p>2) Locomotive. It&#8217;s like MAMP or WAMP or any of those all-in-one application stack installers, except it gives you a working Rails environment. I set up PostgreSQL separately thru MacPorts (a cousin of the FreeBSD ports project), which was somewhat tedious but decently documented.</p>
<p>Getting all the Ruby and Rails stuff compiled from source is no picnic, and frankly unnecessary. On Ubuntu there&#8217;s a gotcha: the Ubuntu people and the RubyGems people can&#8217;t agree on a file layout, so Ubuntu&#8217;s rubygems package sucks. It&#8217;s better to install Ruby using apt-get and then install gems manually from the tarball.</p>
<p>3) Rails Plugins. There&#8217;s a lot of stuff being built on top of Rails and then improved day by day, and svn-over-WebDAV is the popular sync protocol. There&#8217;s a tool called Piston that helps you manage this. Anyway there&#8217;s a lot of stuff that is hard to do and commonly needed which is available in plugin form.</p>
<p>4) ZenTest, and more specifically, Autotest. It watches your source tree and runs only the tests in your test suite that need to be run based on what has changed; it&#8217;s the dynamic-language version of the incremental compilation that&#8217;s present in any good Java IDE.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2007/07/05/impressions-of-ruby-on-rails-from-an-ex-j2ee-developer-me/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>GNU Screen and my screenrc</title>
		<link>http://www.pervasivecode.com/blog/2007/06/12/gnu-screen-and-my-screenrc/</link>
		<comments>http://www.pervasivecode.com/blog/2007/06/12/gnu-screen-and-my-screenrc/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 04:20:05 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2007/06/12/gnu-screen-and-my-screenrc/</guid>
		<description><![CDATA[GNU Screen is a remote terminal multiplexer, described welll elsewhere. 
I use it to eliminate the too-many-Terminal-windows problem on my laptop. I also use it to help me achieve some level of continuity on remote hosts, by leaving half-completed sysadmin tasks as-is until hours or days later even if I get interrupted or if the [...]]]></description>
			<content:encoded><![CDATA[<p>GNU Screen is a remote terminal multiplexer, described welll <a href="http://en.wikipedia.org/wiki/GNU_Screen">elsewhere</a>. </p>
<p>I use it to eliminate the too-many-Terminal-windows problem on my laptop. I also use it to help me achieve some level of continuity on remote hosts, by leaving half-completed sysadmin tasks as-is until hours or days later even if I get interrupted or if the task is really long-running and I need to roam around with my laptop.</p>
<p>Today I decided to invest some time in making my command-line development environment launch with a single script. Here are the details.<br />
<span id="more-27"></span></p>
<p>Since Screen can preserve context and state only until the host it&#8217;s running on is rebooted, I use a text todo list to make sure the big tasks don&#8217;t get forgotten or done out of order. On remote hosts I keep this todo list open in a screen by itself, and make other screens for individual steps like &#8220;apt-get update&#8221; etc. Usually I can go away and come back a couple of days later and pick up where I left off, but if there&#8217;s a reboot (which happens occasionally with a VPS I don&#8217;t control fully) the todo list is still there as a backup means of remembering where I was.</p>
<p>Locally, though, my todo list is a text file managed in a GUI editor, which lately is TextMate. So all that has to happen throug Screen is the command-line stuff itself.</p>
<p>I used to set things up manually when starting a development session (which could last hours or days, depending on <a href="http://www.apple.com/macosx/upgrade/softwareupdates.html">Software Update</a>, travel, etc.). That took a couple of minutes because I had to launch <a href="http://locomotive.raaum.org/">Locomotive</a>, use it to open a Terminal window with the right shell environment,  then run <code>screen -e^oo</code> and manually open a bunch of screens, then manually change their titles, then manually run a few tools and stuff.</p>
<p>Now I have all that automated. There&#8217;s a shell script that sets the environment up (it&#8217;s just the same script that Locomotive makes, but copied out of /tmp into a stable place, since the contents are stable and don&#8217;t need to change for each new session). That calls <code>screen -c jamie_screenrc</code> whose contents are below (sanitized a bit):</p>
<pre>
escape ^oo

screen -t 'Rails project root' 0

# I like to have SVN running at the root of the whole project
# (including specs, notes, etc. with source code changesets)
chdir "../../.."
screen -t svn 1
chdir "Site/trunk/myproject"

# screen/stuff are separated so that when you exit the stuff-ed program,
#  you drop back to the bash shell for that screen instead of immediately
# exiting that screen. This is useful for "^c, up-arrow, enter" restarting of commands

screen -t psql 2
stuff "/opt/local/lib/postgresql82/bin/psql -U myprojectdev\\012"

screen -t autotest 3
stuff "autotest\\012"

screen -t mongrel 4
stuff "./script/server\\012"

screen -t script/console 5
stuff "./script/console\\012"

select 0
</pre>
<p>It&#8217;s &#8220;jamie_screenrc&#8221; and not ~/.screenrc so I can develop with the same setup on another host just by checking out the code (including this screenrc file) and running screen there. I don&#8217;t want this to be my default screen setup every time I run it anyway.</p>
<p>This is &#8220;mildly convenient&#8221; to quote <a href="http://en.wikipedia.org/wiki/Professor_Frink">Professor Frink</a>. But it&#8217;s a big deal to me because now the barrier to starting and stopping work is very, very low; if I have a spare couple of minutes and I&#8217;m not set up to develop, I can get going in seconds. Likewise I don&#8217;t have to put off other things since I know I can stop and do anything else and get right back into flow very quickly.</p>
<p>The next step will probably be to create a <a href="http://rubyosa.rubyforge.org/">RubyOSA</a> script (or maybe just a shell script, if it&#8217;s sufficient) to get Firefox and TextMate and OmniGraffle up and running too with the right documents open just where and how I want them. Then I&#8217;d be able to run a single script (or click a single icon, in the Dock perhaps) and wait a minute or less and be completely ready to start coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2007/06/12/gnu-screen-and-my-screenrc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
