<?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>rexmere.com &#187; Macintosh</title>
	<atom:link href="http://rexmere.com/category/macintosh/feed/" rel="self" type="application/rss+xml" />
	<link>http://rexmere.com</link>
	<description>Technical Arcana, Software Ephemera and Miscellaneous Bits. Keith R. Fieldhouse proprietor.</description>
	<lastBuildDate>Wed, 18 Mar 2009 00:36:18 +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>Installing different Python environments on Mac OS Leopard</title>
		<link>http://rexmere.com/2009/03/17/installing-different-python-environments-on-mac-os-leopard/</link>
		<comments>http://rexmere.com/2009/03/17/installing-different-python-environments-on-mac-os-leopard/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 00:36:17 +0000</pubDate>
		<dc:creator>Keith Fieldhouse</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://rexmere.com/?p=86</guid>
		<description><![CDATA[This link at jessenoller.com is an excellent reference on setting up multiple Python installs on Mac OS Leopard and using virtualenv to create bespoke working environments for various Python packages:
jessenoller.com - So you want to use python on the mac?
]]></description>
			<content:encoded><![CDATA[<p>This link at <a href="http://jessenoller.com/">jessenoller.com</a> is an excellent reference on setting up multiple Python installs on Mac OS Leopard and using <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> to create bespoke working environments for various Python packages:</p>
<p><a href="http://jessenoller.com/2009/03/16/so-you-want-to-use-python-on-the-mac/">jessenoller.com - So you want to use python on the mac?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rexmere.com/2009/03/17/installing-different-python-environments-on-mac-os-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cappuccino and CherryPy</title>
		<link>http://rexmere.com/2008/12/20/cappuccino-and-cherrypy/</link>
		<comments>http://rexmere.com/2008/12/20/cappuccino-and-cherrypy/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 23:54:10 +0000</pubDate>
		<dc:creator>Keith Fieldhouse</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[development python cherrypy cappuccino]]></category>

		<guid isPermaLink="false">http://rexmere.com/?p=72</guid>
		<description><![CDATA[Cappuccino is a JavaScript toolkit for building application like experiences on the web.  It's developed (and used) by the folks who produced 280 Slides, a rather amazing presentation package for the web.
I've been doing a fair bit of of Mac development and have come to appreciate the syntax of Objective-C.  One of the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cappuccino.org/">Cappuccino</a> is a JavaScript toolkit for building application like experiences on the web.  It's developed (and used) by the folks who produced <a href="http://280slides.com/">280 Slides</a>, a rather amazing presentation package for the web.</p>
<p>I've been doing a fair bit of of Mac development and have come to appreciate the syntax of Objective-C.  One of the more interesting aspects of Cappuccino is that it has created a new dialect of JavaScript that they call Objective-J.  <a href="http://cappuccino.org/discuss/2008/12/08/on-leaky-abstractions-and-objective-j/">This blog post</a> explains some of the motivations they had for doing this.  In any event, I decided that I'd like to give Cappuccino a spin.</p>
<p>My "go to" language for server back ends is <a href="http://www.python.org">Python</a>.   I also like <a href="http://www.cherrypy.org/">CherryPy</a>, a Python server framework that makes it easy to attach Python code to web requests.  Since Cappuccino is designed to make it easy to build an application inside a browser window, the back end mostly needs to be able to serve up <a href="http://www.json.org/">JSON</a> data for the Cappuccino application to present.  CherryPy makes this fairly easy.</p>
<p>To get started, I downloaded the the Cappuccino "<a href="http://cappuccino.org/download/">Starter Package</a>".  Inside that zip file is a "NewApplication" directory.  I copied that directory as a directory called "static" in the my Application directory.  If you open the supplied index.html, you are presented with a very basic "Hello World" application written in Cappuccino.  In order to to build the application I have in mind though, I want that index.html to come from my CherryPy server so that the Cappuccino application can easily request information.  </p>
<p>To do this, I configured my CherryPy application to server the contents of my Application/static directory.   This is readily accomplished by creating a CherryPy configuration file cherrycappuccino.ini:</p>
<pre class="ini">&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>global<span style="">&#93;</span></span>
tools.staticdir.<span style="color: #000099;">root </span>= <span style="color: #933;">&quot;/Users/keith/Projects/CherryCappuccino/Application&quot;</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>/<span style="">&#93;</span></span>
tools.staticdir.<span style="color: #000099;">on </span>=<span style="color: #660066;"> True</span>
tools.staticdir.<span style="color: #000099;">dir </span>= <span style="color: #933;">&quot;static&quot;</span>
&nbsp;</pre>
<p>This tells CherryPy to server the contents of my "static" directory statically.  </p>
<p>What remains is the Python code that builds the CherryPy application.    At this point it's quite simple.  We create one object that's mounted on the root of the CherryPy server.   It's index method simply returns the contents of the index.html file in the static directory (there might be other ways to accomplish this but this was expedient.  Here's the Python code from cherrycappuccino.py in my Application directory:</p>
<pre class="python">&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> cherrypy
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> CherryCappuccino:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">indexText</span> = <span style="color: #008000;">None</span>
&nbsp;
    @cherrypy.<span style="color: black;">expose</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> index<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">self</span>.<span style="color: black;">indexText</span>:
            indexFileName = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span>,<span style="color: #483d8b;">&quot;static&quot;</span>,<span style="color: #483d8b;">&quot;index.html&quot;</span><span style="color: black;">&#41;</span>
            indexFile = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>indexFileName<span style="color: black;">&#41;</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">indexText</span> = indexFile.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">indexText</span>
&nbsp;
cherrypy.<span style="color: black;">quickstart</span><span style="color: black;">&#40;</span>CherryCappuccino<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>,<span style="color: #483d8b;">'/'</span>,<span style="color: #483d8b;">&quot;cherrycappuccino.ini&quot;</span><span style="color: black;">&#41;</span>
&nbsp;</pre>
<p>This reads the cherrycappuccino.ini file to configure the application and starts the server with our single application object.    Starting the server with "python cherrycappuccino.py" sets up the server that can be browsed to at http://localhost:8080.</p>
<p>In a future post, I'll show how to configure the Cappuccino view based on data returned from the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://rexmere.com/2008/12/20/cappuccino-and-cherrypy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Mercurial for Mac OS X Development</title>
		<link>http://rexmere.com/2008/08/05/using-mercurial-for-mac-os-x-development/</link>
		<comments>http://rexmere.com/2008/08/05/using-mercurial-for-mac-os-x-development/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 00:12:46 +0000</pubDate>
		<dc:creator>Keith Fieldhouse</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Macintosh]]></category>

		<guid isPermaLink="false">http://rexmere.com/2008/08/05/using-mercurial-for-mac-os-x-development/</guid>
		<description><![CDATA[As a budding Mac developer, one of the things that I've had to sort out is which source code version control system I want to use.  I first started using version control with RCS some 25 years ago.  I've introduced version control or better version control at several of the jobs I've had. [...]]]></description>
			<content:encoded><![CDATA[<p>As a budding Mac developer, one of the things that I've had to sort out is which source code version control system I want to use.  I first started using version control with <a href="http://www.gnu.org/software/rcs/">RCS</a> some 25 years ago.  I've introduced version control or better version control at several of the jobs I've had.  Heck, I've even published an <a href="http://www.linux.com/articles/45381">article</a> on using version control.  Most recently I've used <a href="http://www.perforce.com/">Perforce</a> at an installation with a few thousand fellow developers.</p>
<p>Which is to say that while my eyes will still glaze over during a discussion of the relative merits of different delta storage mechanisms, I know enough to know why the latest crop of distributed version control (DVCS) systems are interesting and that I wanted to use one of the "big three" (<a href="http://git.or.cz/">Git</a>,  <a href="http://www.selenic.com/mercurial/wiki/">Mercurial</a>, <a href="http://bazaar-vcs.org/">Bazaar</a>).</p>
<p>I didn't bother trying Git.  Mostly because cross platform support (especially Windows support) didn't seem to be "job 1" (or "job 2" or even "job 3 or 4") with the developers (understandable given Git's history but not as useful to me -- sooner or later all projects cross platforms it seems).  Besides, both Mercurial and Bazaar are largely written in Python which I use extensively and that made them interesting to me.  Given that all three are used extensively for large projects, whimsical winnowing criteria like this feel safe enough.</p>
<p>I started out with Bazaar, largely because at the time it was easier to find a non-Fink, non-MacPorts installer for it.  It was pretty easy to set up and use and the benefits of it's distributed nature were readily apparent -- my favorite productivity trick is to take my laptop somewhere without a net connection and trivially easy branching and versioning while offline were a breath of fresh air to a Perforce expatriot.</p>
<p>But.  I've switched to Mercurial.   Mercurial now has a non-Fink, non-MacPorts installer as well (maybe it always has).  And it has "hg serve".    The "hg serve" command starts an ad-hoc web server that you can browse to locally or over a network to get a quick graphical view of your repository.  It comes built-in with  Mercurial and it works anywhere Mercurial works.   Nothing else to install,  no half baked GUI clients, just a good, easy to use GUI.  It's not a particularly functional UI (you don't use it to check things in for example) but it provides the thing I want most from a VCS UI: the ability to quickly and easy browse through my repository and look at differences between revisions of code.  I keep my own code and any third party code I use under source control and the ability to easily look at revisions (color hilighted, full context etc.) is an important aspect of code archeology.   Life's too damn short to spend it looking at raw diffs in a terminal window.</p>
<p>So that's why I decided to give Mercurial a try.   I wound up sticking with it (at least so far) becuase it was relatively easy to find information (mostly on the Mercurial wiki) on how to use Mercurial on a Mac, in particular it turned out to be very easy to confgure Mercurial to use FileMerge for diffs and, more importantly, merges  (I've never been very good at textual merges with the "&gt;&gt;&gt;&gt;" token markers).</p>
<p>Beyond that, using "bzr" or "hg" commands is largely the same with some minor translation required.  In the end, though, it was just easier to make Mercurial dovetail with my Mac and my style quickly and with very little fuss.</p>
<p>The rest of this post will describe how I've set up Mercurial.  It's quite possible that all of the following can be done with Bazaar and Git just as easily.  I'm putting it here so that it will hopefully will save some one who wants to try Mercurial on the Mac some time.</p>
<p>Once you've installed the <a href="http://mercurial.berkwood.com/">lastest version of Mercurial </a>on your Mac you'll want to configure it.  You'll do this by creating and editing an ~/.hgrc file.  Here are the contents of mine:</p>
<blockquote><p>[ui]<br />
username = Keith Fieldhouse &lt;keith@rex...&gt;</p>
<p>[extensions]<br />
hgext.extdiff =</p>
<p>[extdiff]<br />
cmd.opendiff = opendiff-w</p>
<p>[merge-tools]<br />
filemerge.executable = opendiff-w<br />
filemerge.args = $local $other -ancestor $base -merge $output</p></blockquote>
<p>The "username" in the [ui] section simply provides a nice username to label changes in your repository with.  the "hgext.extdiff =" line simply turns on the "External Diff" extension.  While it's labeled an "extension", it comes as part of the Mercurial distribution.  The "cmd.opendiff" line tells Mercurial to run the opendiff-w script (see below) when the "hg opendiff" command is used.   Simillarly, the commands under [merge-tools] tells Mercurial how to run the same opendiff-w script when it wants to allow you to do a merge.</p>
<p>The opendiff-w script simply runs opendiff (the command line command that starts FileMerge) through a pipe so that it will wait until FileMerge has exited before returning from the command which is the behavior that Mercurial expects from the diff and merge tools.   My copy of opendiff-w is kept in /usr/local/bin and looks like this:</p>
<blockquote><p>#!/bin/sh<br />
opendiff "$@" | cat</p></blockquote>
<p>Note that all of the above works after installing the Mac OS X version of Mercurial.  No further software is required (well, beyond the Mac developer tools themselves).  Most of this information can be found at the Mercurial Wiki.  <a href="http://www.selenic.com/mercurial/wiki/index.cgi/ExtdiffExtension?highlight=%28FileMerge%29">This page</a> and <a href="http://www.selenic.com/mercurial/wiki/index.cgi/MergeProgram?highlight=%28FileMerge%29">this page</a> describe using FileMerge as a diff tool and a merge tool respectively.</p>
<p><strong>Update</strong>:  For completeness, here is the ".hgignore" file that I typically use:</p>
<blockquote><p>syntax: glob</p>
<p>.DS_Store<br />
*.swp<br />
*~.nib</p>
<p>build</p>
<p>*.pbxuser<br />
*.perspective<br />
*.perspectivev3</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://rexmere.com/2008/08/05/using-mercurial-for-mac-os-x-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Parallels and VMWare Fusion</title>
		<link>http://rexmere.com/2007/07/17/parallels-and-vmware-fusion/</link>
		<comments>http://rexmere.com/2007/07/17/parallels-and-vmware-fusion/#comments</comments>
		<pubDate>Tue, 17 Jul 2007 18:06:03 +0000</pubDate>
		<dc:creator>Keith Fieldhouse</dc:creator>
				<category><![CDATA[Macintosh]]></category>

		<guid isPermaLink="false">http://rexmere.com/2007/07/17/parallels-and-vmware-fusion/</guid>
		<description><![CDATA[One of the reasons that I bought a MacBook was the prospect of running any OS that was likely to come up in my work could be run on the laptop.  At the time, I assumed that I'd use Parallels for this purpose and in fact bought a copy of Parallels the same night [...]]]></description>
			<content:encoded><![CDATA[<p>One of the reasons that I bought a MacBook was the prospect of running any OS that was likely to come up in my work could be run on the laptop.  At the time, I assumed that I'd use Parallels for this purpose and in fact bought a copy of Parallels the same night that I bought the Mac.    I've been using Parallels since then and while it has worked, the experience, especially with Ubuntu Linux 7.04 was less than seamless.  Installing was a fussy process and I could never get the display working to my satisfaction in full screen mode.  Also, I was unable to dedicate more than 512M of memory to the Ubuntu instance.</p>
<p>Then, I gave the VMWare Fusion beta a try.    This was the seamless operation I was looking for.  The install went without a hitch, after installing the VMWare tools the Ubuntu display automatically adjusted to the size of the MacBook display in full screen mode.   It's also quite responsive, I can dedicate a decent amount of memory to the instance and copy and paste works.  This is very cool.   I  took advantage of the low price ($39.00) during the beta period and chalked up the $79 I paid for Parallels to experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://rexmere.com/2007/07/17/parallels-and-vmware-fusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More on PyObjC</title>
		<link>http://rexmere.com/2007/07/02/more-on-pyobjc/</link>
		<comments>http://rexmere.com/2007/07/02/more-on-pyobjc/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 00:55:20 +0000</pubDate>
		<dc:creator>Keith Fieldhouse</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://rexmere.com/2007/07/02/more-on-pyobjc/</guid>
		<description><![CDATA[Related to my last post.  This web page at developer.apple.com details the steps to take to work with PyObjC and XCode.  It's also a bit of an endorsement of Python development for the Mac.
]]></description>
			<content:encoded><![CDATA[<p>Related to my last post.  This <a href="http://developer.apple.com/cocoa/pyobjc.html">web page</a> at developer.apple.com details the steps to take to work with <a href="http://pyobjc.sourceforge.net/">PyObjC</a> and XCode.  It's also a bit of an endorsement of Python development for the Mac.</p>
]]></content:encoded>
			<wfw:commentRss>http://rexmere.com/2007/07/02/more-on-pyobjc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac Development with Python</title>
		<link>http://rexmere.com/2007/06/22/mac-development-with-python/</link>
		<comments>http://rexmere.com/2007/06/22/mac-development-with-python/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 15:11:31 +0000</pubDate>
		<dc:creator>Keith Fieldhouse</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://rexmere.com/2007/06/22/mac-development-with-python/</guid>
		<description><![CDATA[Now that I have a MacBook, naturally enough my attention turns to developing for it.  My language of choice these days is Python for a variety of reasons I won't go into now.  I'm interested to see that there's fairly broad support for developing Cocoa based applications with python using PyObjC as a [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I have a MacBook, naturally enough my attention turns to developing for it.  My language of choice these days is Python for a variety of reasons I won't go into now.  I'm interested to see that there's fairly broad support for developing Cocoa based applications with python using <a href="http://pyobjc.sourceforge.net/">PyObjC</a> as a bridge.  This <a href="http://developer.apple.com/business/macmarket/checkout.html">article</a> seems to suggest that it's possible to build commercial quality apps with these tools.This will deserve some exploration...</p>
]]></content:encoded>
			<wfw:commentRss>http://rexmere.com/2007/06/22/mac-development-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
