<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Geoff Ford's Blog</title>
	<atom:link href="http://geoffford.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://geoffford.wordpress.com</link>
	<description>Just another developers view</description>
	<lastBuildDate>Tue, 20 Jan 2009 13:07:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='geoffford.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Geoff Ford's Blog</title>
		<link>http://geoffford.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://geoffford.wordpress.com/osd.xml" title="Geoff Ford&#039;s Blog" />
	<atom:link rel='hub' href='http://geoffford.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Python REPL Enhancement</title>
		<link>http://geoffford.wordpress.com/2009/01/20/python-repl-enhancement/</link>
		<comments>http://geoffford.wordpress.com/2009/01/20/python-repl-enhancement/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 13:07:52 +0000</pubDate>
		<dc:creator>geoffford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://geoffford.wordpress.com/?p=27</guid>
		<description><![CDATA[This tip comes from here. You can get tab completion and command history similar to that available in bash itself by creating registering a start up script for python. Create the following as ~/.pythonstartup Then add the following to you ~/.bash_profile export PYTHONSTARTUP=~/.pythonstartup Now you can use tab to autocomplete and use tab-tab to show [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geoffford.wordpress.com&amp;blog=6117417&amp;post=27&amp;subd=geoffford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This tip comes from <a href="http://crncosta.wordpress.com/2009/01/20/customizando-o-prompt-do-python/">here</a>.</p>
<p>You can get tab completion and command history similar to that available in bash itself by creating registering a  start up script for python.  Create the following as <code>~/.pythonstartup</code></p>
<p><pre class="brush: python;">
# python startup file
import readline
import rlcompleter
import atexit
import os

# tab completion
readline.parse_and_bind('tab: complete')
# history file
histfile = os.path.join(os.environ['HOME'], '.pythonhistory')
try:
	readline.read_history_file(histfile)
except IOError:
	pass
atexit.register(readline.write_history_file, histfile)
del os, histfile, readline, rlcompleter
</pre></p>
<p>Then add the following to you <code>~/.bash_profile</code></p>
<pre>export PYTHONSTARTUP=~/.pythonstartup</pre>
<p>Now you can use tab to autocomplete and use tab-tab to show suggestions:</p>
<pre>geoffs-mac:~ geoff$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import pygame
&gt;&gt;&gt; pygame.display. &lt;-- I pressed tab here after pyg and the after .dis, but you can't see it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
pygame.display.Info               pygame.display.get_caption
pygame.display._PYGAME_C_API      pygame.display.get_driver
pygame.display.__PYGAMEinit__     pygame.display.get_init
... and more ...
</pre>
<p>You can also use the up and down arrows to cycle through previous commands, including those from previous sessions.  </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geoffford.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geoffford.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geoffford.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geoffford.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geoffford.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geoffford.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geoffford.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geoffford.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geoffford.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geoffford.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geoffford.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geoffford.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geoffford.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geoffford.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geoffford.wordpress.com&amp;blog=6117417&amp;post=27&amp;subd=geoffford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geoffford.wordpress.com/2009/01/20/python-repl-enhancement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bac515a62c6b44cf4d797068e9db9732?s=96&#38;d=monsterid&#38;r=PG" medium="image">
			<media:title type="html">geoffford</media:title>
		</media:content>
	</item>
		<item>
		<title>Pygame on OS X Leopard</title>
		<link>http://geoffford.wordpress.com/2009/01/20/pygame-on-os-x-leopard/</link>
		<comments>http://geoffford.wordpress.com/2009/01/20/pygame-on-os-x-leopard/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 11:53:13 +0000</pubDate>
		<dc:creator>geoffford</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[pygame]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://geoffford.wordpress.com/?p=11</guid>
		<description><![CDATA[Skip to successful instructions Tonight I wanted to start a new Pygame project to learn basic game development. I thought this would be rather easy, but apparently I&#8217;m not the only one who has had trouble. Attempt 1 &#8211; Macports Reading the Pygame download page I notice that it mentioned Macports. So I fired up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geoffford.wordpress.com&amp;blog=6117417&amp;post=11&amp;subd=geoffford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="#bullets">Skip to successful instructions</a></p>
<p>Tonight I wanted to start a new Pygame project to learn basic game development.  I thought this would be rather easy, but apparently I&#8217;m not the <a href="http://bradmontgomery.blogspot.com/2007/09/pygame-on-os-x-with-python-25.html">only one</a> who has had <a href="http://twitter.com/jessenoller/status/1113518831">trouble</a>. </p>
<h4>Attempt 1 &#8211; Macports </h4>
<p>Reading the <a href="http://www.pygame.org/download.shtml">Pygame download</a> page I notice that it mentioned Macports.  So I fired up Terminal, typed in <code>sudo port install py-game</code> and then waited about 5 mins for it to download and build everything.</p>
<p>Time to try it out.<br />
<code>
<pre>geoffs-mac:~ geoff$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import pygame
Traceback (most recent call last):
  File "", line 1, in
ImportError: No module named pygame
</pre>
<p></code></p>
<p>Not cool.  A little bit of searching and I found that for some reason Macports installed pygame under <code>/opt/local/lib/python2.4/site-packages/pygame</code>.  This might be good if you use the Macports python but clearly not suitable for the default pre-installed Python 2.5.</p>
<p>As a last ditch effort to use the Macport Pygame I tried copying the <code>/opt/local/lib/python2.4/site-packages/pygame</code> into <code>/Library/Python/2.5/site-packages</code> which resulted in a whole heap of   Python C API version mismatch warnings. </p>
<p>Oh well, <code> rm -rf /Library/Python/2.5/site-packages/pygame</code></p>
<h2>Attempt 2</h2>
<p>Ok, time to try the pre-compiled installers.  </p>
<p>I downloaded the OS X 10.5 installer from the Pygame downloads.  However when I ran it, on the select destination screen it kept telling me that my startup volume was not acceptable as &#8220;System Python 2.5 is required&#8221;.  Yet python was clearly running <code>Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)</code></p>
<p>I installed the <a href="http://pythonmac.org/packages/py25-fat/dmg/python-2.5-macosx.dmg">Python package</a> linked to on <a href="http://wiki.python.org/moin/MacPython/Leopard">this page</a>.  I&#8217;m not sure what the package does that the default Python didn&#8217;t, but <a href="http://bradmontgomery.blogspot.com/2007/09/pygame-on-os-x-with-python-25.html">others</a> were <a href="http://www.pygame.org/wiki/MacCompile">recommending</a> it worked for me as well.</p>
<p>Then I ran the Pygame installer again and all was good.  That is, until I tried importing pygame again.</p>
<p><code>
<pre>geoffs-mac:~ geoff$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import pygame
Traceback (most recent call last):
  File "", line 1, in
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pygame/__init__.py", line 37, in
    _check_darwin()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pygame/__init__.py", line 34, in _check_darwin
    raise ImportError("PyObjC 1.2 or later is required to use pygame on Mac OS X. http://pygame.org/wiki/PyObjC")
ImportError: PyObjC 1.2 or later is required to use pygame on Mac OS X. http://pygame.org/wiki/PyObjC
&gt;&gt;&gt;
</pre>
<p></code></p>
<p>So back to the Pygame downloads page to grab <a href="http://www.pygame.org/ftp/pyobjc-1.4-py2.5-macosx10.4.mpkg.zip">pyobjc-1.4-py2.5-macosx10.4.mpkg.zip</a>.  Don&#8217;t be put of by the 10.4 in the filename &#8211; this is the one you want. The installer completed without troubles, and I could finally import pygame properly.  </p>
<p><a name="bullets"></a></p>
<h2>The Instructions</h2>
<p>Without the waffle.</p>
<ol>
<li>Download and install <a href="http://pythonmac.org/packages/py25-fat/dmg/python-2.5-macosx.dmg">python-2.5-macosx.dmg</a></li>
<li>Download and install <a href="http://www.pygame.org/ftp/pyobjc-1.4-py2.5-macosx10.4.mpkg.zip">pyobjc-1.4-py2.5-macosx10.4.mpkg.zip</a></li>
<li>Download and install <a href="http://www.pygame.org/ftp/pygame-1.8.1release-py2.5-macosx10.5.zip">pygame-1.8.1release-py2.5-macosx10.5.zip</a></li>
<li>Test it in Terminal:<br />
<code>
<pre>geoffs-mac:~ geoff$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import pygame
&gt;&gt;&gt;
</pre>
<p></code></li>
</ol>
<p>What should have been five minutes, was more than 30 minutes of hassle. Now, time to start writing my game.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geoffford.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geoffford.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geoffford.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geoffford.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geoffford.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geoffford.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geoffford.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geoffford.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geoffford.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geoffford.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geoffford.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geoffford.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geoffford.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geoffford.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geoffford.wordpress.com&amp;blog=6117417&amp;post=11&amp;subd=geoffford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geoffford.wordpress.com/2009/01/20/pygame-on-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bac515a62c6b44cf4d797068e9db9732?s=96&#38;d=monsterid&#38;r=PG" medium="image">
			<media:title type="html">geoffford</media:title>
		</media:content>
	</item>
		<item>
		<title>Git on OS X</title>
		<link>http://geoffford.wordpress.com/2009/01/10/git-on-os-x/</link>
		<comments>http://geoffford.wordpress.com/2009/01/10/git-on-os-x/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 06:40:39 +0000</pubDate>
		<dc:creator>geoffford</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[osx git macports]]></category>

		<guid isPermaLink="false">http://geoffford.wordpress.com/?p=3</guid>
		<description><![CDATA[Git is a fantastic DVCS with a flexible approach to workflow. Today I went through the process of installing it on OS X Leopard using Macports.  I know that there is an OS X installer available, but I love apt-get on Ubuntu and the simple way it lets you manage your packages.  Macports has a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geoffford.wordpress.com&amp;blog=6117417&amp;post=3&amp;subd=geoffford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Git is a fantastic <a href="http://en.wikipedia.org/wiki/Distributed_revision_control">DVCS</a> with a flexible approach to workflow.</p>
<p>Today I went through the process of installing it on OS X Leopard using <a title="Macports" href="http://www.macports.org/">Macports</a>.  I know that there is an OS X installer available, but I love apt-get on Ubuntu and the simple way it lets you manage your packages.  Macports has a similar approach to package management.</p>
<h2>Getting Macports.</h2>
<p><a href="http://www.macports.org/install.php#pkg">Download the latest Macports</a> binary installer.  After running the install run:<br />
<code>sudo port -v selfupdate</code><br />
This will ensure that Macports has updated itself and all its dowwnload and package sources.</p>
<h2>Getting Git</h2>
<p>Simply run<br />
<code>sudo port install git-core</code><br />
For most people this should be all that is needed.  Simply sit back and wait a good few minutes, and then you can start gitting.</p>
<p>However I ran into a small issue with the following error:<br />
<code>
<pre>Error: Target org.macports.activate returned: Image error:
/opt/local/lib/perl5/5.8.9/darwin-2level/auto/List/Util/Util.bs is being used by the
active perl5.8 port.  Please deactivate this port first, or use the -f flag to force the
activation.</pre>
<p></code><br />
It appears that both the Perl 5.8 installation and the p5-scalar-list-utils package are both wanting to use the same file.</p>
<p>The solution is to deactivate the Perl package, install the p5 package, and then force reactivate the Perl package, using the -f flag.</p>
<p><code>
<pre>geoffs-mac:~ geoff$ sudo port deactivate perl5.8
---&gt;  Deactivating perl5.8
geoffs-mac:~ geoff$ sudo port install p5-scalar-list-utils
---&gt;  Activating p5-scalar-list-utils @1.19_1
---&gt;  Cleaning p5-scalar-list-utils
geoffs-mac:~ geoff$ sudo port activate -f perl5.8
---&gt;  Activating perl5.8
Warning: File /opt/local/lib/perl5/5.8.9/darwin-2level/auto/List/Util/Util.bs already exists.
... a number of other warnings ...
geoffs-mac:~ geoff$ sudo port install git-core
...
---&gt;  Activating git-core @1.6.1_1+doc
---&gt;  Cleaning git-core
geoffs-mac:~ geoff$
</pre>
<p></code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geoffford.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geoffford.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geoffford.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geoffford.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geoffford.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geoffford.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geoffford.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geoffford.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geoffford.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geoffford.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geoffford.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geoffford.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geoffford.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geoffford.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geoffford.wordpress.com&amp;blog=6117417&amp;post=3&amp;subd=geoffford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geoffford.wordpress.com/2009/01/10/git-on-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bac515a62c6b44cf4d797068e9db9732?s=96&#38;d=monsterid&#38;r=PG" medium="image">
			<media:title type="html">geoffford</media:title>
		</media:content>
	</item>
	</channel>
</rss>
