<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>axelio</title>
	<atom:link href="http://axelio.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://axelio.wordpress.com</link>
	<description>... and the art of debugging a blank sheet of paper.</description>
	<lastBuildDate>Mon, 28 Apr 2008 20:59:47 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/357401a1e7e9dffca4fdb541f7fdf04b?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>axelio</title>
		<link>http://axelio.wordpress.com</link>
	</image>
			<item>
		<title>Handling external dependencies with Mercurial</title>
		<link>http://axelio.wordpress.com/2008/03/17/handling-external-dependencies-with-mercurial/</link>
		<comments>http://axelio.wordpress.com/2008/03/17/handling-external-dependencies-with-mercurial/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 18:08:51 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/?p=41</guid>
		<description><![CDATA[In order to add external repository dependencies in Mercurial, I have created an extension similar to the multi-project management feature of GNU arch. This can be probably done with other existent extensions, but I have not been able to found one that exactly met my needs (the Forest extension can be used for non-versioned Mercurial [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=41&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In order to add external repository dependencies in <a href="http://www.selenic.com/mercurial/">Mercurial</a>, I have created an <a href="http://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions">extension</a> similar to the <a href="http://www.gnu.org/software/gnu-arch/tutorial-old/multi-tree-projects.html">multi-project management</a> feature of <a href="http://www.gnu.org/software/gnu-arch/">GNU arch</a>. This can be probably done with other existent extensions, but I have not been able to found one that exactly met my needs (the <a href="http://www.selenic.com/mercurial/wiki/index.cgi/ForestExtension">Forest extension</a> can be used for non-versioned Mercurial dependencies, and, in fact, they could be used together, but it is not exactly the same). So please, if anyone knows similar extensions, I would happy to know it. My friend <a href="http://www.hlod-wig.org">Lluís</a> gave me the idea to also handle non-Mercurial dependencies, so thanks from here!</p>
<p>If interested, check the <a href="http://www.selenic.com/mercurial/wiki/index.cgi/DepsExtension">Deps extension</a>.</p>
<p><b>Update 2008/04/28:</b> I have removed the extension help from this entry and added a <a href="http://www.selenic.com/mercurial/wiki/index.cgi/DepsExtension">Deps extension</a> page to Mercurial&#8217;s wiki.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=41&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2008/03/17/handling-external-dependencies-with-mercurial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>
	</item>
		<item>
		<title>From GNU Arch to Mercurial</title>
		<link>http://axelio.wordpress.com/2008/01/31/from-gnu-arch-to-mercurial/</link>
		<comments>http://axelio.wordpress.com/2008/01/31/from-gnu-arch-to-mercurial/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 13:51:31 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/?p=38</guid>
		<description><![CDATA[Over the last two and a half years we (at work) have been using baz as our distributed version control system. Baz is based on tla, the original GNU arch implementation by Tom Lord. After all this time we have applied more than two thousand patches (distributed in various projects). We also have been using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=38&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.gnu.org/software/gnu-arch/"><img src="http://axelio.files.wordpress.com/2008/01/gnuarch.png?w=75&#038;h=66" alt="gnuarch.png" align="left" border="0" height="66" hspace="10" vspace="10" width="75" /></a>Over the last two and a half years we (at work) have been using <a href="http://bazaar-vcs.org/Baz1x">baz</a> as our distributed <a href="http://en.wikipedia.org/wiki/Revision_control">version control system</a>. Baz is based on tla, the original <a href="http://www.gnu.org/software/gnu-arch/">GNU arch</a> implementation by <a href="http://regexps.srparish.net/www/">Tom Lord</a>. After all this time we have applied more than two thousand patches (distributed in various projects). <a href="http://www.gnuarch.org/gnuarchwiki/xtla"><img src="http://axelio.files.wordpress.com/2008/01/xtla.png?w=75&#038;h=56" alt="xtla.png" align="right" border="0" height="56" hspace="10" vspace="10" width="75" /></a>We also have been using <a href="http://www.gnuarch.org/gnuarchwiki/xtla">Xtla</a> (a wonderful <a href="http://www.gnu.org/software/emacs/">Emacs</a> front-end to GNU Arch) and lately <a href="http://download.gna.org/dvc/">DVC</a> (its successor, which handles GNU Arch, <a href="http://bazaar-vcs.org/">Bazaar</a>, <a href="http://git.or.cz/">git</a>, <a href="http://www.selenic.com/mercurial/">Mercurial</a> and <a href="http://www.monotone.ca/">Monotone</a>). After some months thinking about it, I decided that it was time for a change, baz was too slow working with this magnitude of patches and even slower in my <a href="http://en.wikipedia.org/wiki/PowerBook_G4#Aluminum_PowerBook_G4">PowerBook</a>. I also wanted a fast web interface and <a href="http://migo.sixbit.org/software/archzoom/">ArchZoom</a> was not an option as it took ages to show changes between two revisions and mostly in any operation. So, I watched the Mercurial <a href="http://video.google.com/videoplay?docid=-7724296011317502612">Google TechTalk</a> and I also read some blog entries about git and Bazaar. <a href="http://download.gna.org/dvc/"><img src="http://axelio.files.wordpress.com/2008/01/dvc.png?w=71&#038;h=72" alt="dvc.png" align="left" border="0" height="72" hspace="10" vspace="10" width="71" /></a> I decided to give Mercurial a try as it also had complete DVC support and a great web interface (like the <a href="http://darcs.net/">darcs</a> one).</p>
<p>One of the things I needed was a tool to convert our baz repositories to Mercurial. As far as I knew, there was no such a tool, so I thought I could use <a href="http://darcs.complete.org/arch2darcs/README">arch2darcs</a> to convert the repositories to darcs and then use the Mercurial <a href="http://www.selenic.com/mercurial/wiki/index.cgi/ConvertExtension">convert extension</a> to convert them to Mercurial. I tried it but it didn&#8217;t work. The Mercurial convert extension worked really well with darcs for my personal projects, so, why not write a GNU Arch converter?</p>
<p>After some days trying it, I have posted an <a href="http://www.selenic.com/mercurial/bts/issue959">issue</a> to Mercurial <a href="http://www.selenic.com/mercurial/bts/">BTS</a> with a GNU Arch converter. It currently does not support directory renaming (fixed, see updates), but all other things I have tried work well. <a href="http://www.selenic.com/mercurial/"><img src="http://axelio.files.wordpress.com/2008/03/mercurial.png?w=60&#038;h=72" alt="mercurial.png" align="right" border="0" height="72" hspace="10" vspace="10" width="60" /></a> The converter is slow as I didn&#8217;t know how to compute a complete <i>changeset</i> between patches easily (any help?&#8230; solved, see updates). The log files might not provide all the information needed (added, removed, modified files), so I decided to use the <i>delta</i> command which computes all this information, and this takes a bit of time.</p>
<p>To use the converter (in 0.9.5) copy it to the convert extension directory (<i>hgext/convert</i>) and edit the __init__.py file following, for example, the darcs converter (you&#8217;ll easily see how to add it). Use the converter <b>at your own risk</b>, as I am sure it needs more work. I would appreciate any comments and bug reports until it is included in Mercurial (if ever).</p>
<p><b>Update 2008/04/28</b>: The GNU Arch converter is available since Mercurial 1.0.</p>
<p><b>Update 2008/02/09</b>: The converter does not use the <i>delta</i> command anymore to compute a changeset (the <i>replay</i> command used to merge already does it). This has increased speed drastically (in the order of hours).</p>
<p><b>Update 2008/02/06</b>: The GNU Arch converter has been added to Mercurial development branch. Thanks!</p>
<p><b>Update 2008/02/04</b>: Directory renaming is now supported. A bug related to link modifications has been fixed. The &#8216;&#8211;rev&#8217; option is also supported. You will need to download and install the development branch (<i>hg clone http://hg.intevation.org/mercurial/crew</i>) and apply the patch provided <a href="http://www.selenic.com/mercurial/bts/issue959">here</a>.</p>
<p><b>Update 2008/02/01</b>: Yesterday, I found this <a href="http://www.selenic.com/mercurial/wiki/index.cgi/ArchConversion">page</a> (weird, as I didn&#8217;t see it some days ago) which talks about GNU Arch conversions to Mercurial. None of the converters uses the convert extension, but I guess it would had been easier to reuse them.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=38&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2008/01/31/from-gnu-arch-to-mercurial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>

		<media:content url="http://axelio.files.wordpress.com/2008/01/gnuarch.png" medium="image">
			<media:title type="html">gnuarch.png</media:title>
		</media:content>

		<media:content url="http://axelio.files.wordpress.com/2008/01/xtla.png" medium="image">
			<media:title type="html">xtla.png</media:title>
		</media:content>

		<media:content url="http://axelio.files.wordpress.com/2008/01/dvc.png" medium="image">
			<media:title type="html">dvc.png</media:title>
		</media:content>

		<media:content url="http://axelio.files.wordpress.com/2008/03/mercurial.png" medium="image">
			<media:title type="html">mercurial.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Baz 1.4.2 in Fink</title>
		<link>http://axelio.wordpress.com/2008/01/03/baz-142-in-fink/</link>
		<comments>http://axelio.wordpress.com/2008/01/03/baz-142-in-fink/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 14:03:50 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[Fink]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/2008/01/03/baz-142-in-fink/</guid>
		<description><![CDATA[Yes, Baz is deprecated, but we are still using it at work, so to make my life easier I have created the Fink package for the latest version (probably there won&#8217;t be more). Download this file and, as usual, type:

$ tar zxvf baz-1.4.2-fink.tar.gz
$ sudo cp baz-1.4.2-fink/*
          [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=31&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Yes, <a href="http://bazaar-vcs.org/Baz1x/">Baz</a> is deprecated, but we are still using it at work, so to make my life easier I have created the <a href="http://www.finkproject.org/">Fink</a> package for the latest version (probably there won&#8217;t be more). Download this <a href="http://hacks-galore.org/aleix/files/macosx/baz-1.4.2-fink.tar.gz">file</a> and, as usual, type:</p>
<pre>
$ tar zxvf baz-1.4.2-fink.tar.gz
$ sudo cp baz-1.4.2-fink/*
          /sw/fink/dists/local/main/finkinfo/
$ fink index; fink rebuild baz; fink install baz
</pre>
<p>Baz depends on some cryptographic libraries (<a href="http://www.gnupg.org/gpgme.html">gpgme</a>, <a href="http://www.gnupg.org/">libgcrypt</a> and <a href="http://www.gnupg.org/related_software/libgpg-error/">libgpg-error</a>). The updated packages are also included (until updated in Fink) in the provided file.</p>
<p>Please, note that when the official Baz Fink package is updated you will have to remove your local copy (from /sw/fink/dists/local/main/finkinfo/).</p>
<p><b>Update 2008/04/28:</b> All cryptographic library dependencies are now in Fink, so now this package only contains Baz files.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=31&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2008/01/03/baz-142-in-fink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>
	</item>
		<item>
		<title>ECL 0.9j in Fink</title>
		<link>http://axelio.wordpress.com/2008/01/03/ecl-09j-in-fink/</link>
		<comments>http://axelio.wordpress.com/2008/01/03/ecl-09j-in-fink/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 07:27:50 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[Fink]]></category>
		<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/2008/01/03/ecl-09j-in-fink/</guid>
		<description><![CDATA[ECL has a new release, and thus a new Fink package update. It is still under validation, so until it is committed you can use this file. To install it, just type:

$ tar zxvf ecl-0.9j-fink.tar.gz
$ sudo cp ecl-0.9j-fink/*
          /sw/fink/dists/local/main/finkinfo/
$ fink index; fink rebuild ecl; fink install [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=30&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://ecls.sourceforge.net/">ECL</a> has a new release, and thus a new <a href="http://www.finkproject.org/">Fink</a> package update. It is still under validation, so until it is committed you can use this <a href="http://hacks-galore.org/aleix/files/macosx/ecl-0.9j-fink.tar.gz">file</a>. To install it, just type:</p>
<pre>
$ tar zxvf ecl-0.9j-fink.tar.gz
$ sudo cp ecl-0.9j-fink/*
          /sw/fink/dists/local/main/finkinfo/
$ fink index; fink rebuild ecl; fink install ecl
</pre>
<p>Please, note that when the official ECL Fink package is updated you will have to remove your local copy (from <em>/sw/fink/dists/local/main/finkinfo/</em>).</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=30&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2008/01/03/ecl-09j-in-fink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>
	</item>
		<item>
		<title>Screen Sharing with Mac OS X and GNU/Linux</title>
		<link>http://axelio.wordpress.com/2007/12/12/screen-sharing-with-mac-os-x-and-gnulinux/</link>
		<comments>http://axelio.wordpress.com/2007/12/12/screen-sharing-with-mac-os-x-and-gnulinux/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 10:24:08 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/2007/12/12/screen-sharing-with-mac-os-x-and-gnulinux/</guid>
		<description><![CDATA[Today, I discovered how to share my Mac OS X (Leopard) screen with another non-Mac OS X computer. Not a big deal, as it is almost automatic, but I&#8217;m posting it here as I did a search and I didn&#8217;t find how to do it.
What you need to do in your Mac OS X box [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=29&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today, I discovered how to share my Mac OS X (Leopard) screen with another non-Mac OS X computer. Not a big deal, as it is almost automatic, but I&#8217;m posting it here as I did a search and I didn&#8217;t find how to do it.</p>
<p>What you need to do in your Mac OS X box is enabling the Screen Sharing service from the Sharing options in the System Preferences.</p>
<div style="text-align:center;"><a href="http://axelio.files.wordpress.com/2007/12/preferences1.png"><img src="http://axelio.files.wordpress.com/2007/12/preferences1-small.png?w=375&#038;h=315" alt="preferences1_small.png" border="0" width="375" height="315" /></a></div>
<p>Before establishing the connection you need to setup a password. This is done in the &#8220;Computer Settings&#8230;&#8221; button, just like this:</p>
<p><div style="text-align:center;"><a href="http://axelio.files.wordpress.com/2007/12/preferences2.png"><img src="http://axelio.files.wordpress.com/2007/12/preferences2-small.png?w=366&#038;h=104" alt="preferences2_small.png" border="0" width="366" height="104" /></a></div>
</p>
<p>Do not avoid the password step, if you do it the connection will not be established.</p>
<p>Finally, you only need a <a href="http://en.wikipedia.org/wiki/VNC">VNC</a> client in your GNU/Linux box. Not all the clients work, one that it does is the <a href="http://www.tightvnc.com/">TightVNC</a> viewer. In Debian, you can just type:</p>
<pre>
apt-get install xtightvncviewer
</pre>
<p>Once installed, you only need to run it and supply the IP address of your Mac OS X box and the password you configured.</p>
<p><div style="text-align:center;"><a href="http://axelio.files.wordpress.com/2007/12/screensharing.png"><img src="http://axelio.files.wordpress.com/2007/12/screensharing-small.png?w=384&#038;h=307" alt="screensharing_small.png" border="0" width="384" height="307" /></a></div>
</p>
<p>Enjoy it!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=29&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2007/12/12/screen-sharing-with-mac-os-x-and-gnulinux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>

		<media:content url="http://axelio.files.wordpress.com/2007/12/preferences1-small.png" medium="image">
			<media:title type="html">preferences1_small.png</media:title>
		</media:content>

		<media:content url="http://axelio.files.wordpress.com/2007/12/preferences2-small.png" medium="image">
			<media:title type="html">preferences2_small.png</media:title>
		</media:content>

		<media:content url="http://axelio.files.wordpress.com/2007/12/screensharing-small.png" medium="image">
			<media:title type="html">screensharing_small.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Erlang R12B-0 in Fink</title>
		<link>http://axelio.wordpress.com/2007/12/11/erlang-r12b-0-in-fink/</link>
		<comments>http://axelio.wordpress.com/2007/12/11/erlang-r12b-0-in-fink/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 11:45:36 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Fink]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/2007/12/11/erlang-r12b-0-in-fink/</guid>
		<description><![CDATA[Erlang has a new release, and thus a new Fink package update. It is still under validation, so until it is committed you can use this file. To install it, just type:

$ tar zxvf erlang-otp-R12B-0-fink.tar.gz
$ sudo cp erlang-otp-R12B-0-fink/*
          /sw/fink/dists/local/main/finkinfo/
$ fink index; fink rebuild erlang-otp; fink install [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=20&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.erlang.org">Erlang</a> has a new release, and thus a new <a href="http://www.finkproject.org/">Fink</a> package update. It is still under validation, so until it is committed you can use this <a href="http://hacks-galore.org/aleix/files/macosx/erlang-otp-R12B-0-fink.tar.gz">file</a>. To install it, just type:</p>
<pre>
$ tar zxvf erlang-otp-R12B-0-fink.tar.gz
$ sudo cp erlang-otp-R12B-0-fink/*
          /sw/fink/dists/local/main/finkinfo/
$ fink index; fink rebuild erlang-otp; fink install erlang-otp
</pre>
<p>Please, note that when the official Erlang Fink package is updated you will have to remove your local copy (from <em>/sw/fink/dists/local/main/finkinfo/</em>).</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=20&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2007/12/11/erlang-r12b-0-in-fink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>
	</item>
		<item>
		<title>Building applications for ERC32</title>
		<link>http://axelio.wordpress.com/2007/10/02/building-applications-for-erc32/</link>
		<comments>http://axelio.wordpress.com/2007/10/02/building-applications-for-erc32/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 19:36:01 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Embedded]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/2007/10/02/building-applications-for-erc32/</guid>
		<description><![CDATA[A while ago, I answered a message, in the RTEMS users mailing list, about how to build raw applications for the ERC32 architecture. With raw applications I mean applications that are not dependent of RTEMS, which is the usual RTOS for this architecture. I am now writing about it just to make it easier for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=19&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A while ago, I answered a message, in the <a href="http://www.rtems.org">RTEMS</a> users mailing list, about how to build raw applications for the <a href="http://microelectronics.esa.int/erc32/">ERC32</a> architecture. With raw applications I mean applications that are not dependent of RTEMS, which is the usual RTOS for this architecture. I am now writing about it just to make it easier for people to find it and to add some information to the explanation.</p>
<p>Before starting with the process, you need to get and build the RTEMS toolchain in order to compile your future applications (I used RTEMS 4.6.1). This is because the specific toolchain for ERC32 non-RTEMS applications is no longer maintained. Note, that you don&#8217;t need to install RTEMS itself, but you will need the source code. This <a href="http://www.thoughtwave.com/rtemsdemo.html">video</a> shows, step by step, how to download and build these tools for the i386 <a href="http://en.wikipedia.org/wiki/Board_support_package">BSP</a>, which should be almost identical for ERC32.</p>
<p>I&#8217;m not sure if what I&#8217;m going to explain is the best way to do it, but it has worked for me, and I have ran programs generated this way in a real board for a long time. I also think this may be useful for other architectures as well.</p>
<p>1. You need to get the following source files from the ERC32 BSP and copy them to your application&#8217;s directory:</p>
<pre>
    cpukit/score/cpu/sparc/asm.h
    cpukit/score/cpu/sparc/rtems/score/sparc.h
    cpukit/score/cpu/sparc/rtems/score/cpu.h
    c/src/lib/libbsp/sparc/shared/start.S
    c/src/lib/libcpu/sparc/reg_win/window.S
    c/src/lib/libcpu/sparc/syscall/syscall.S
</pre>
<p>2. Modify <em>start.S</em> so it does not call any RTEMS code, that is, commenting these lines:</p>
<pre>
/*
    call    __bsp_board_init
    nop

    set     (SYM(rdb_start)), %g6   ! End of work-space area
    st      %sp, [%g6]

    set     (SYM(Configuration)), %l1
    ld      [%l1+4], %l3            ! work_space_size
    sub     %sp, %l3, %sp           ! set %sp to area below work_space
    andn    %sp, 0x0f, %sp          ! align stack on 16-byte boundary
*/
</pre>
<p>3. Compile <em>start.S, window.S and syscall.S</em>. You can remove many things from the header files, but that&#8217;s up to you.</p>
<pre>
sparc-rtems4.6.1-gcc -DASM -c -o start.o start.S
</pre>
<p>4. Compile your C files (e.g. <em>test.c</em>).</p>
<pre>
sparc-rtems4.6.1-gcc -O4 -Wall -mcpu=cypress -c -o test.o test.c
</pre>
<p>5. Link your program. It will not work right now, as you need to generate two final files, <em>my_bsp_specs</em> and <em>linkcmds</em>.</p>
<pre>
sparc-rtems4.6.1-gcc -mcpu=cypress -Betc -specs my_bsp_specs -o test
window.o syscall.o test.o
</pre>
<p>Note the arguments <em>-B</em> and <em>-specs</em>. <em>-specs</em> is used to specify a file with options to override the default switches passed to cc1, cc1plus, as, ld&#8230; By default, RTEMS uses the file <em>bsp_specs</em> (found in <em>c/src/lib/libbsp/sparc/erc32</em>). You can edit it and see that it automaticaly links with the RTEMS libraries and adds its own start.S object file. The <em>-B</em> flag specifies where to find the executables, libraries, include files, and data files of the compiler itself. I have used an <em>etc</em> directory where I have stored <em>my_bsp_specs</em>. If any of the needed files is not found by the compiler it will automatically search its own paths.</p>
<p>So, what we need to do is to create our own file, <em>my_bsp_specs</em>, which will not use any RTEMS library and which will point to our compiled start.S object file.</p>
<p>Basically,</p>
<pre>
*endfile:
crtend.o%s crtn.o%s

*lib:
-T linkcmds

*startfile:
start.o crti.o%s crtbegin.o%s

*link:
-dc -dp -N -e start
</pre>
<p>The <em>%s</em> indicates to search the file in the compiler specific directories. I have removed the <em>%s</em> from start.o so it will search for it in the current directory.</p>
<p>Another important thing to note in this file is the <em>-T linkcmds</em> option. This indicates the <a href="http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_chapter/ld_3.html%23SEC6">linker script</a>, which describes where the code and data for the application will reside in memory, to be used by the <a href="http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_chapter/ld_toc.html">GNU linker</a>. Fortunately, we can use the one that comes with RTEMS (found in <em>c/src/lib/libbsp/sparc/erc32/startup</em>), so copy it to the <em>etc</em> directory.</p>
<p>Finally, note that when linking, we have not specified the <em>start.o</em> file as it is already done in the <em>my_bsp_specs</em> file.</p>
<p>You might also find more information in the <a href="http://www.rtems.org/onlinedocs/releases/rtemsdocs-4.6.1/share/rtems/html/bsp_howto/index.html">RTEMS BSP and Device Driver Development Guide</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=19&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2007/10/02/building-applications-for-erc32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>
	</item>
		<item>
		<title>Code size optimizations</title>
		<link>http://axelio.wordpress.com/2007/09/28/code-size-optimizations/</link>
		<comments>http://axelio.wordpress.com/2007/09/28/code-size-optimizations/#comments</comments>
		<pubDate>Fri, 28 Sep 2007 09:04:40 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Embedded]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/2007/09/28/code-size-optimizations/</guid>
		<description><![CDATA[During the last two years I have had the opportunity to write embedded software for the SPARC ERC32 architecture. The first piece of software we have written is an application that needs to fit in a 64 Kbytes PROM with a minimal running system that can execute periodic tasks, send packets over a network, load [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=18&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>During the last two years I have had the opportunity to write embedded software for the <a href="http://www.sparc.org/">SPARC</a> <a href="http://microelectronics.esa.int/erc32/">ERC32</a> architecture. The first piece of software we have written is an application that needs to fit in a 64 Kbytes <a href="http://en.wikipedia.org/wiki/Read-only_memory">PROM</a> with a minimal running system that can execute periodic tasks, send packets over a network, load another application stored in an <a href="http://en.wikipedia.org/wiki/EEPROM">EEPROM</a> that can be remotely patched and many other things. Before starting to write it from scratch we tried to fit <a href="http://www.rtems.org/">RTEMS</a> (a Real-Time Operating System) in the 64 Kbytes. We achieved a running RTEMS in 55 Kbytes, but there was only 10 Kbytes left (note that modern versions of RTEMS are smaller).</p>
<p>The following tips are the ones I have found useful to decrease my application size (they might not work in all architectures). Note that all the tips are C oriented and that <a href="http://gcc.gnu.org/">gcc</a> has been used.</p>
<p>I would really appreciate if you can share your tricks and I will be glad to include them in the list.</p>
<p><strong>Compress application code</strong></p>
<p>As the application is stored in a PROM, you will normally have a minimal code to perform some initializations and checks (e.g. <a href="http://en.wikipedia.org/wiki/RAM">RAM</a> tests), and the rest of the code for the application itself. The main application will run from RAM, so you could compress the application using a simple compression algorithm such as <a href="http://en.wikipedia.org/wiki/Lempel-Ziv-Storer-Szymanski">LZSS</a>, uncompress the application to RAM and run it. The decompression algorithm will be obviously uncompressed.</p>
<p>If you are working with an ERC32 processor check the <a href="http://hacks-galore.org/aleix/mkprom-erc32/">mkprom-erc32</a> tool.</p>
<p><strong>Use inline functions judiciously</strong></p>
<p>As it is well-known, performance issues should not be treated while developing. So, writing a lot of <a href="http://en.wikipedia.org/wiki/Inline_function">inline functions</a> might not have great performance effects, but could have big size penalties if you don&#8217;t use them judiciously.</p>
<p><strong>Compiler optimization flags</strong></p>
<p>If performance is not important in your application (i.e. you have no hard real-time requirement), you can use the size optimization options provided by your compiler. For example, in gcc, you can use the <em>-Os</em> option to decrease the executable size. We reduced 5 Kbytes.</p>
<p>Note, that this will avoid inline functions optimization, but you can still tell gcc to include them passing the <em>-finline-functions</em> option.</p>
<p><strong>Split functions into separate files</strong></p>
<p>If you are developing different applications that might share most of the code, you may think on writing an static library. The point is that having a reusable library might affect the executable size. This is because, probably, not all the functions compiled will be used in all the applications. When gcc compiles a source file, all the functions in it will be linked in the final binary even if your code does not use them. Of course, if non of the functions of the source file is being used, they will not be linked. Splitting functions into separate files might solve the problem.</p>
<p>There is one way to avoid this (I haven&#8217;t tried it) with gcc using the <em>-ffunction-sections</em> option. This creates a separate section for every function. The linker can then use the <em>&#8211;gc-sections</em> option to discard unused sections.</p>
<p><strong>Separate debug and release code</strong></p>
<p>While writing embedded software you may need to have debug and release code. Clear examples are the printing or logging functions that might not be necessary in production code. If this is the case, separate the debug and release code. In C, you could have a serial port printing function in debug and an empty macro in release. This can be achieved via a building system, separating the definitions in different files (which I recommend), or using macros.</p>
<p><strong>Do not use packed structures extensibly</strong></p>
<p>By definition, <a href="http://sig9.com/articles/gcc-packed-structures">packed structures</a> are not aligned, this means that, depending on the architecture, the compiler needs to generate extra code to get members of structures. So, using packed structures extensibly may increase your application size and may decrease the performance.</p>
<p>Another reason for not using packed structures is portability.</p>
<p><strong>Enumerations vs. constant objects</strong></p>
<p>As described in this <a href="http://www.embedded.com/story/OEG20011129S0065">article</a>, constant objects, such as:</p>
<p>unsigned int const ITEM_ID = 0&#215;01200020;</p>
<p>may increase your application size. So, if you really have a few bytes left, you might be interested in changing the definition by using an enumeration:</p>
<p>enum { ITEM_ID = 0&#215;01200020 };</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=18&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2007/09/28/code-size-optimizations/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>
	</item>
		<item>
		<title>Bomb Practical Common Lisp</title>
		<link>http://axelio.wordpress.com/2007/09/20/bomb-practical-common-lisp/</link>
		<comments>http://axelio.wordpress.com/2007/09/20/bomb-practical-common-lisp/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 15:27:59 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[Lisp]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/2007/09/20/bomb-practical-common-lisp/</guid>
		<description><![CDATA[
I started reading PCL some time ago (only time for 10 chapters). This is my first Common Lisp book, and by now I&#8217;m not ready to write a great article about Common Lisp details, but if you are looking for a Common Lisp tutorial, this could be one.
Bomb it!
       [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=17&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.amazon.com/Practical-Common-Lisp-Peter-Seibel/dp/1590592395/ref=pd_bbs_sr_1/104-9324648-9628704?ie=UTF8&amp;s=books&amp;qid=1190301709&amp;sr=8-1"><img src="http://g-ec2.images-amazon.com/images/I/21VElAQ7spL._AA115_.jpg" align="right" hspace="10" vspace="0"></a><br />
I started reading <a href="http://www.amazon.com/Practical-Common-Lisp-Peter-Seibel/dp/1590592395/ref=pd_bbs_sr_1/104-9324648-9628704?ie=UTF8&amp;s=books&amp;qid=1190301709&amp;sr=8-1">PCL</a> some time ago (only time for 10 chapters). This is my first Common Lisp book, and by now I&#8217;m not ready to write a great article about Common Lisp details, but if you are looking for a <a href="http://www.gigamonkeys.com/book/">Common Lisp tutorial</a>, this could be one.</p>
<p><a href="http://www.gigamonkeys.com/blog/2007/09/19/bomb-me.html">Bomb it!</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=17&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2007/09/20/bomb-practical-common-lisp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>

		<media:content url="http://g-ec2.images-amazon.com/images/I/21VElAQ7spL._AA115_.jpg" medium="image" />
	</item>
		<item>
		<title>Integer promotion: comparisons</title>
		<link>http://axelio.wordpress.com/2007/09/16/integer-comparisons/</link>
		<comments>http://axelio.wordpress.com/2007/09/16/integer-comparisons/#comments</comments>
		<pubDate>Sun, 16 Sep 2007 17:33:32 +0000</pubDate>
		<dc:creator>aleix</dc:creator>
				<category><![CDATA[C]]></category>

		<guid isPermaLink="false">http://axelio.wordpress.com/2007/09/16/integer-comparisons/</guid>
		<description><![CDATA[This may be something basic, but I lost a bit of time last week trying to find a bug at work, so I thought it was worth mentioning it.
When comparing signed and unsigned expressions of the same size, the compiler produces what it might be unexpected results. Suppose you have this code:

#include &#60;stdio.h&#62;

int
main (void)
{
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=16&subd=axelio&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This may be something basic, but I lost a bit of time last week trying to find a bug at work, so I thought it was worth mentioning it.</p>
<p>When comparing signed and unsigned expressions of the same size, the compiler produces what it might be unexpected results. Suppose you have this code:</p>
<pre>
#include &lt;stdio.h&gt;

int
main (void)
{
  unsigned short int a = -12;
  signed short int b = -12;

  printf ("%s\n", (a == b) ? "OK" : "failed");

  return 0;
}
</pre>
<p>Here, you would probably expect an &#8220;<em>OK</em>&#8221; output, but surprisingly you get &#8220;<em>failed</em>&#8220;. Why is this? If you know about integer promotion, you may skip to the end if you don&#8217;t want to follow all the process.</p>
<p><a href="http://www.amazon.com/C-Programming-Language-2nd/dp/0131103628/ref=pd_bbs_2/102-6103299-9922550?ie=UTF8&amp;s=books&amp;qid=1189707105&amp;sr=8-2"><img src="http://ec1.images-amazon.com/images/I/21PAWH8TXBL._AA115_.jpg" hspace="10" vspace="0" align="right"></a></p>
<p>Fortunately, I received a copy of <a href="http://www.amazon.com/C-Programming-Language-2nd/dp/0131103628/ref=pd_bbs_2/102-6103299-9922550?ie=UTF8&amp;s=books&amp;qid=1189707105&amp;sr=8-2">K&amp;R</a> last week, so I started digging into the issue to try to understand why this was happening.</p>
<p>About equality operators, K&amp;R section A7.10 reads</p>
<blockquote><p>
<cite>The equality operators follow the same rules as the relational operators&#8230;</cite>
</p></blockquote>
<p>Section A7.9, about relational operator, reads</p>
<blockquote><p>
<cite>The usual arithmetic conversions are performed on arithmetic operands&#8230;</cite>
</p></blockquote>
<p>So, how these arithmetic conversions work?</p>
<p>This is also clearly explained in K&amp;R section A6.5 (the same rules apply to the <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf">C99 standard</a>, section 6.3.1.8, Usual arithmetic conversions). The part that interests us is after having evaluated all the real type conversions, when it says</p>
<blockquote><p>
<cite>Otherwise, the integer promotions are performed on both operands&#8230;</cite>
</p></blockquote>
<p>So, before performing the comparison of our operands, both undergo integer promotion. Integer promotion (K&amp;R, section A6.2) says that</p>
<blockquote><p>
<cite>If an int can represent all the values of the original type, then the value is converted to int; otherwise the value is converted to unsigned int.</cite>
</p></blockquote>
<p>An <em>int</em> can represent all the values of our operands, so after the integer promotion is performed, both operands have <em>int</em> type. Having a look back to our operands, we know that the <em>a</em> variable holds the value <em>0xFFF4</em>, and after applying the integer promotion, it maintains the value. The same happens with variable <em>b</em>, that holds <em>0xFFFFFFF4</em> to represent <em>-12</em>. Clearly, both values are different and the check fails.</p>
<p>At the end of K&amp;R section A6.5 this is explicitly explained</p>
<blockquote><p>
<cite>The new rules are slightly more complicated, but reduce somewhat the suprises that may occur when an unsigned quantity meets signed. Unexpected results may still occur whan an unsigned expression is compared to a signed expression of the same size.</cite>
</p></blockquote>
<p>Basically, what&#8217;s going on here, is that both variables undergo integer promotion. <em>b</em> is signed, and it is sign-extended. This sign-extension is maintained due to the integer promotion.</p>
<p>Note, that this issue does not occur with 32-bit values, as both operands would be &#8220;0xFFFFFFF4&#8243;.</p>
<p>So, be careful when comparing unsigned and signed types.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&blog=531926&post=16&subd=axelio&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://axelio.wordpress.com/2007/09/16/integer-comparisons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b7f33cf385adab602c156205e7291e7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aleix</media:title>
		</media:content>

		<media:content url="http://ec1.images-amazon.com/images/I/21PAWH8TXBL._AA115_.jpg" medium="image" />
	</item>
	</channel>
</rss>