<?xml version="1.0"?>
<rss version="2.0.">
  <channel>
    <title>Advogato blog for aleix</title>
    <link>http://www.advogato.org/person/aleix/</link>
    <description>Advogato blog for aleix</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Fri, 16 May 2008 14:30:33 GMT</pubDate>
    <item>
      <pubDate>Mon, 17 Mar 2008 19:09:41 GMT</pubDate>
      <title>Handling external dependencies with Mercurial</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=47</link>
      <guid>http://axelio.wordpress.com/2008/03/17/handling-external-dependencies-with-mercurial/</guid>
      <description>&lt;div class='snap_preview'&gt;&lt;br /&gt;&lt;p&gt;In order to add external repository dependencies in &lt;a href="http://www.selenic.com/mercurial/" &gt;Mercurial&lt;/a&gt;, I have created an &lt;a href="http://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions" &gt;extension&lt;/a&gt; similar to the &lt;a href="http://www.gnu.org/software/gnu-arch/tutorial-old/multi-tree-projects.html" &gt;multi-project management&lt;/a&gt; feature of &lt;a href="http://www.gnu.org/software/gnu-arch/" &gt;GNU arch&lt;/a&gt;. This can be probably done with other existent extensions, but I have not been able to found one that exactly met my needs (the &lt;a href="http://www.selenic.com/mercurial/wiki/index.cgi/ForestExtension" &gt;Forest extension&lt;/a&gt; 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 &lt;a href="http://www.hlod-wig.org" &gt;Llu&#xED;s&lt;/a&gt; gave me the idea to also handle non-Mercurial dependencies, so thanks from here!&lt;/p&gt;
&lt;p&gt;To download it just type:&lt;/p&gt;
&lt;pre&gt;
hg clone http://hg.hacks-galore.org/aleix/hgdeps/
&lt;/pre&gt;
&lt;p&gt;You can also browse it &lt;a href="http://hg.hacks-galore.org/aleix/hgdeps/" &gt;online&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The extension consists of two commands: &lt;em&gt;deps&lt;/em&gt; and &lt;em&gt;depsclone&lt;/em&gt;. Below, I am pasting the help of the &lt;em&gt;deps&lt;/em&gt; command.&lt;/p&gt;
&lt;p&gt;This extension is useful when a repository might depend on some external dependencies: other repositories (Mercurial, &lt;a href="http://www.nongnu.org/cvs/" &gt;CVS&lt;/a&gt;, &lt;a href="http://subversion.tigris.org/" &gt;Subversion&lt;/a&gt;&amp;#8230;), files not handled by a SCM tool or some other dependencies.&lt;/p&gt;
&lt;p&gt;To enable this extension, add this to your global .hgrc file (or to your repository .hg/hgrc file):&lt;/p&gt;
&lt;pre&gt;
[extensions]
hgext.deps =
# or, if deps.py is not in the hgext dir:
# deps = /path/to/deps.py
&lt;/pre&gt;
&lt;p&gt;In order to define these external dependencies, you need to add a section [deps] in your repository .hg/hgrc file (or in the global .hgrc) where you will define how to find them. As an example, let&amp;#8217;s say that our repository depends on two external libraries managed by different &lt;a href="http://en.wikipedia.org/wiki/Revision_control" &gt;SCM&lt;/a&gt; tools: &amp;#8216;libfoo&amp;#8217; managed by Mercurial and &amp;#8216;libbar&amp;#8217; managed by CVS.&lt;/p&gt;
&lt;pre&gt;
[deps]
aliases = libfoo, libbar
alias.libfoo = /path/to/libfoo
alias.libbar = :pserver:anonymous@cvs.server.org:/sources/bar
alias.libbar.command = cvs -z3 -d$source co -r $rev -d $dest bar
&lt;/pre&gt;
&lt;p&gt;Two aliases have been defined, one for each library, and also the sources where the libraries can be obtained. &amp;#8216;libbar&amp;#8217; has two options: the library location and the CVS command to use in order to get the library. For &amp;#8216;libfoo&amp;#8217; only a path to the Mercurial repository has been specified. $rev, $source, and $dest are substitution placeholders and will be explained later.&lt;/p&gt;
&lt;p&gt;Once the location of the depedencies have been defined, dependency lists can be created. A depedency list has an associated name. Following the example above, two depedency lists will be created, one for version 0.9.1 of our repository and another for version 1.0. 0.9.1 and 1.0 will be used as the name of the lists.&lt;/p&gt;
&lt;pre&gt;
[1.0]
f24139319bdb    libfoo    lib/foo
v0r8_0          libbar    lib/bar

[0.9.1]
3a9b061bada1    libfoo    lib/foo
v0r7_8          libbar    lib/bar
&lt;/pre&gt;
&lt;p&gt;A dependency is defined by three fields: a revision name, the alias of the external dependency and a destination directory. The alias must be one of the aliases defined in the [deps] section (see above). The revision name will be substituted for the placeholder $rev also seen before. For Mercurial, the revision name will just be a Mercurial revision of the external repository. Finally, the destination directory will be substituted for $dest.&lt;/p&gt;
&lt;p&gt;To facilitate version control, distribution, and merging of dependencies, they are stored as a file named &amp;#8216;.hgdeps&amp;#8217; which is managed similarly to other project files and can be hand-edited if necessary.&lt;/p&gt;
&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/41/" /&gt; &lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/41/" /&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/41/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/41/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/41/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/41/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/41/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/41/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/41/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/41/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/41/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/41/" /&gt;&lt;/a&gt; &lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&amp;blog=531926&amp;post=41&amp;subd=axelio&amp;ref=&amp;feed=1" /&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 31 Jan 2008 14:09:26 GMT</pubDate>
      <title>From GNU Arch to Mercurial</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=46</link>
      <guid>http://axelio.wordpress.com/2008/01/31/from-gnu-arch-to-mercurial/</guid>
      <description>&lt;div&gt;&lt;br&gt;&lt;p&gt;&lt;a href="http://www.gnu.org/software/gnu-arch/" &gt;&lt;img src="http://axelio.files.wordpress.com/2008/01/gnuarch.png?w=75&amp;h=66" alt="gnuarch.png" border="0" width="75" height="66" align="left" hspace="10" vspace="10"&gt;&lt;/a&gt;Over the last two&#xD;
and a half years we (at work) have been using &lt;a href="http://bazaar-vcs.org/Baz1x" &gt;baz&lt;/a&gt; as our&#xD;
distributed &lt;a href="http://en.wikipedia.org/wiki/Revision_control" &gt;version&#xD;
control system&lt;/a&gt;. Baz is based on tla, the original &lt;a href="http://www.gnu.org/software/gnu-arch/" &gt;GNU arch&lt;/a&gt;&#xD;
implementation by &lt;a href="http://regexps.srparish.net/www/" &gt;Tom Lord&lt;/a&gt;. After&#xD;
all this time we have applied more than two thousand patches&#xD;
(distributed in various projects). &lt;a href="http://www.gnuarch.org/gnuarchwiki/xtla" &gt;&lt;img src="http://axelio.files.wordpress.com/2008/01/xtla.png?w=75&amp;h=56" alt="xtla.png" border="0" width="75" height="56" align="right" hspace="10" vspace="10"&gt;&lt;/a&gt;We also have been&#xD;
using &lt;a href="http://www.gnuarch.org/gnuarchwiki/xtla" &gt;Xtla&lt;/a&gt; (a&#xD;
wonderful &lt;a href="http://www.gnu.org/software/emacs/" &gt;Emacs&lt;/a&gt;&#xD;
front-end to GNU Arch) and lately &lt;a href="http://download.gna.org/dvc/" &gt;DVC&lt;/a&gt; (its successor,&#xD;
which handles GNU Arch, &lt;a href="http://bazaar-vcs.org/" &gt;Bazaar&lt;/a&gt;, &lt;a href="http://git.or.cz/" &gt;git&lt;/a&gt;, &lt;a href="http://www.selenic.com/mercurial/" &gt;Mercurial&lt;/a&gt; and&#xD;
&lt;a href="http://www.monotone.ca/" &gt;Monotone&lt;/a&gt;). After some&#xD;
months thinking about it, I decided that it was time for a&#xD;
change, baz was too slow working with this magnitude of&#xD;
patches and even slower in my &lt;a href="http://en.wikipedia.org/wiki/PowerBook_G4#Aluminum_PowerBook_G4" &gt;PowerBook&lt;/a&gt;.&#xD;
I also wanted a fast web interface and &lt;a href="http://migo.sixbit.org/software/archzoom/" &gt;ArchZoom&lt;/a&gt;&#xD;
was not an option as it took ages to show changes between&#xD;
two revisions and mostly in any operation. So, I watched the&#xD;
Mercurial &lt;a href="http://video.google.com/videoplay?docid=-7724296011317502612" &gt;Google&#xD;
TechTalk&lt;/a&gt; and I also read some blog entries about git and&#xD;
Bazaar. &lt;a href="http://download.gna.org/dvc/" &gt;&lt;img src="http://axelio.files.wordpress.com/2008/01/dvc.png" alt="dvc.png" border="0" width="71" height="72" align="left" hspace="10" vspace="10"&gt;&lt;/a&gt; I decided to give Mercurial a&#xD;
try as it also had complete DVC support and a great web&#xD;
interface (like the &lt;a href="http://darcs.net/" &gt;darcs&lt;/a&gt;&#xD;
one).&#xD;
&lt;p&gt;&#xD;
One of the things I needed was a tool to convert our baz&#xD;
repositories to Mercurial. As far as I knew, there was no&#xD;
such a tool, so I thought I could use &lt;a href="http://darcs.complete.org/arch2darcs/README" &gt;arch2darcs&lt;/a&gt;&#xD;
to convert the repositories to darcs and then use the&#xD;
Mercurial &lt;a href="http://www.selenic.com/mercurial/wiki/index.cgi/ConvertExtension" &gt;convert&#xD;
extension&lt;/a&gt; to convert them to Mercurial. I tried it but&#xD;
it didn&amp;#8217;t work. The Mercurial convert extension worked&#xD;
really well with darcs for my personal projects, so, why not&#xD;
write a GNU Arch converter?&#xD;
&#xD;
&lt;p&gt;&#xD;
After some days trying it, I have posted an &lt;a href="http://www.selenic.com/mercurial/bts/issue959" &gt;issue&lt;/a&gt;&#xD;
to Mercurial &lt;a href="http://www.selenic.com/mercurial/bts/issue959" &gt;BTS&lt;/a&gt;&#xD;
with a GNU Arch converter. It currently does not support&#xD;
directory renaming, but all other things I have tried work&#xD;
well. &lt;a href="http://www.selenic.com/mercurial/" &gt;&lt;img src="http://axelio.files.wordpress.com/2008/03/mercurial.png&amp;w=60&amp;h=72" alt="mercurial.png" align="right" border="0" height="72" hspace="10" vspace="10" width="60"&gt;&lt;/a&gt; The converter is&#xD;
slow as I didn&amp;#8217;t know how to compute a complete&#xD;
&lt;em&gt;changeset&lt;/em&gt; between patches easily (any help?). The&#xD;
log files might not provide all the information needed&#xD;
(added, removed, modified files), so I decided to use the&#xD;
&lt;em&gt;delta&lt;/em&gt; command which computes all this information,&#xD;
and this takes a bit of time.&#xD;
&#xD;
&lt;p&gt;&#xD;
To use the converter (in 0.9.5) copy it to the convert&#xD;
extension directory (&lt;em&gt;hgext/convert&lt;/em&gt;) and edit the&#xD;
__init__.py file following, for example, the darcs converter&#xD;
(you&amp;#8217;ll easily see how to add it). Use the converter&#xD;
&lt;strong&gt;at your own risk&lt;/strong&gt;, as I am sure it needs&#xD;
more work. I would appreciate any comments and bug reports&#xD;
until it is included in Mercurial (if ever).&#xD;
&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/38/"&gt; &lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/38/"&gt; &lt;a href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/38/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/38/"&gt;&lt;/a&gt; &lt;a href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/38/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/38/"&gt;&lt;/a&gt; &lt;a href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/38/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/38/"&gt;&lt;/a&gt; &lt;a href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/38/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/38/"&gt;&lt;/a&gt; &lt;a href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/38/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/38/"&gt;&lt;/a&gt; &lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&amp;blog=531926&amp;post=38&amp;subd=axelio&amp;ref=&amp;feed=1"&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 3 Jan 2008 14:07:14 GMT</pubDate>
      <title>Baz 1.4.2 in Fink</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=45</link>
      <guid>http://axelio.wordpress.com/2008/01/03/baz-142-in-fink/</guid>
      <description>&lt;div class='snap_preview'&gt;&lt;br /&gt;&lt;p&gt;Yes, &lt;a href="http://bazaar-vcs.org/Baz1x/" &gt;Baz&lt;/a&gt; is deprecated, but we are still using it at work, so to make my life easier I have created the &lt;a href="http://www.finkproject.org/" &gt;Fink&lt;/a&gt; package for the latest version (probably there won&amp;#8217;t be more). Download this &lt;a href="http://hacks-galore.org/aleix/files/macosx/baz-1.4.2-fink.tar.gz" &gt;file&lt;/a&gt; and, as usual, type:&lt;/p&gt;
&lt;pre&gt;
$ 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
&lt;/pre&gt;
&lt;p&gt;Baz depends on some cryptographic libraries (&lt;a href="http://www.gnupg.org/gpgme.html" &gt;gpgme&lt;/a&gt;, &lt;a href="http://www.gnupg.org/" &gt;libgcrypt&lt;/a&gt; and &lt;a href="http://www.gnupg.org/related_software/libgpg-error/" &gt;libgpg-error&lt;/a&gt;). The updated packages are also included (until updated in Fink) in the provided file.&lt;/p&gt;
&lt;p&gt;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/).&lt;/p&gt;
&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/31/" /&gt; &lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/31/" /&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/31/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/31/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/31/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/31/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/31/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/31/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/31/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/31/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/31/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/31/" /&gt;&lt;/a&gt; &lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&amp;blog=531926&amp;post=31&amp;subd=axelio&amp;ref=&amp;feed=1" /&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 3 Jan 2008 08:05:54 GMT</pubDate>
      <title>ECL 0.9j in Fink</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=44</link>
      <guid>http://axelio.wordpress.com/2008/01/03/ecl-09j-in-fink/</guid>
      <description>&lt;div class='snap_preview'&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://ecls.sourceforge.net/" &gt;ECL&lt;/a&gt; has a new release, and thus a new &lt;a href="http://www.finkproject.org/" &gt;Fink&lt;/a&gt; package update. It is still under validation, so until it is committed you can use this &lt;a href="http://hacks-galore.org/aleix/files/macosx/ecl-0.9j-fink.tar.gz" &gt;file&lt;/a&gt;. To install it, just type:&lt;/p&gt;
&lt;pre&gt;
$ 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
&lt;/pre&gt;
&lt;p&gt;Please, note that when the official ECL Fink package is updated you will have to remove your local copy (from &lt;em&gt;/sw/fink/dists/local/main/finkinfo/&lt;/em&gt;).&lt;/p&gt;
&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/axelio.wordpress.com/30/" /&gt; &lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/axelio.wordpress.com/30/" /&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/axelio.wordpress.com/30/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/axelio.wordpress.com/30/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/axelio.wordpress.com/30/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/axelio.wordpress.com/30/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/axelio.wordpress.com/30/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/axelio.wordpress.com/30/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/axelio.wordpress.com/30/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/axelio.wordpress.com/30/" /&gt;&lt;/a&gt; &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/axelio.wordpress.com/30/" &gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/axelio.wordpress.com/30/" /&gt;&lt;/a&gt; &lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=axelio.wordpress.com&amp;blog=531926&amp;post=30&amp;subd=axelio&amp;ref=&amp;feed=1" /&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 12 Dec 2007 11:16:30 GMT</pubDate>
      <title>Screen Sharing with Mac OS X and GNU/Linux</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=43</link>
      <guid>http://axelio.wordpress.com/2007/12/12/screen-sharing-with-mac-os-x-and-gnulinux/</guid>
      <description>&lt;div class='snap_preview'&gt;&lt;p&gt;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&amp;#8217;m posting it here as I did a search and I didn&amp;#8217;t find how to do it.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;div style="text-align:center;"&gt;&lt;a href="http://axelio.files.wordpress.com/2007/12/preferences1.png" &gt;&lt;img src="http://axelio.files.wordpress.com/2007/12/preferences1-small.png?w=375&amp;h=315" alt="preferences1_small.png" border="0" width="375" height="315" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Before establishing the connection you need to setup a password. This is done in the &amp;#8220;Computer settings&amp;#8230;&amp;#8221; button, just like this:&lt;/p&gt;
&lt;p&gt;&lt;div style="text-align:center;"&gt;&lt;a href="http://axelio.files.wordpress.com/2007/12/preferences2.png" &gt;&lt;img src="http://axelio.files.wordpress.com/2007/12/preferences2-small.png?w=366&amp;h=104" alt="preferences2_small.png" border="0" width="366" height="104" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;Do not avoid the password step, if you do it the connection will not be established.&lt;/p&gt;
&lt;p&gt;Finally, you only need a &lt;a href="http://en.wikipedia.org/wiki/VNC" &gt;VNC&lt;/a&gt; client in your GNU/Linux box. Not all the clients work, one that it does is the &lt;a href="http://www.tightvnc.com/" &gt;TightVNC&lt;/a&gt; viewer. In Debian, you can just type:&lt;/p&gt;
&lt;pre&gt;
apt-get install xtightvncviewer
&lt;/pre&gt;
&lt;p&gt;Once installed, you only need to run it and supply the IP address of your Mac OS X box and the password you configured.&lt;/p&gt;
&lt;p&gt;&lt;div style="text-align:center;"&gt;&lt;a href="http://axelio.files.wordpress.com/2007/12/screensharing.png" &gt;&lt;img src="http://axelio.files.wordpress.com/2007/12/screensharing-small.png?w=384&amp;h=307" alt="screensharing_small.png" border="0" width="384" height="307" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;Enjoy it!&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 11 Dec 2007 12:09:30 GMT</pubDate>
      <title>Erlang R12B-0 in Fink</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=42</link>
      <guid>http://axelio.wordpress.com/2007/12/11/erlang-r12b-0-in-fink/</guid>
      <description>&lt;div class='snap_preview'&gt;&lt;p&gt;&lt;a href="http://www.erlang.org" &gt;Erlang&lt;/a&gt; has a new release, and thus a new &lt;a href="http://www.finkproject.org/" &gt;Fink&lt;/a&gt; package update. It is still under validation, so until it is committed you can use this &lt;a href="http://hacks-galore.org/aleix/files/macosx/erlang-otp-R12B-0-fink.tar.gz" &gt;file&lt;/a&gt;. To install it, just type:&lt;/p&gt;
&lt;pre&gt;
$ tar zxvf erlang-otp-R12B-0-fink.tar.gz
$ sudo cp erlang-otp-R12B-0-fink/*
          /sw/fink/dists/unstable/main/finkinfo/languages
$ fink index; fink rebuild erlang-otp; fink install erlang-otp
&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 2 Oct 2007 20:09:46 GMT</pubDate>
      <title>Building applications for ERC32</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=41</link>
      <guid>http://axelio.wordpress.com/2007/10/02/building-applications-for-erc32/</guid>
      <description>&lt;div class='snap_preview'&gt;&lt;p&gt;A while ago, I answered a message, in the &lt;a href="http://www.rtems.org" &gt;RTEMS&lt;/a&gt; users mailing list, about how to build raw applications for the &lt;a href="http://microelectronics.esa.int/erc32/" &gt;ERC32&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;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&amp;#8217;t need to install RTEMS itself, but you will need the source code. This &lt;a href="http://www.thoughtwave.com/rtemsdemo.html" &gt;video&lt;/a&gt; shows, step by step, how to download and build these tools for the i386 &lt;a href="http://en.wikipedia.org/wiki/Board_support_package" &gt;BSP&lt;/a&gt;, which should be almost identical for ERC32.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not sure if what I&amp;#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.&lt;/p&gt;
&lt;p&gt;1. You need to get the following source files from the ERC32 BSP and copy them to your application&amp;#8217;s directory:&lt;/p&gt;
&lt;pre&gt;
    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
&lt;/pre&gt;
&lt;p&gt;2. Modify &lt;em&gt;start.S&lt;/em&gt; so it does not call any RTEMS code, that is, commenting these lines:&lt;/p&gt;
&lt;pre&gt;
/*
    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
*/
&lt;/pre&gt;
&lt;p&gt;3. Compile &lt;em&gt;start.S, window.S and syscall.S&lt;/em&gt;. You can remove many things from the header files, but that&amp;#8217;s up to you.&lt;/p&gt;
&lt;pre&gt;
sparc-rtems4.6.1-gcc -DASM -c -o start.o start.S
&lt;/pre&gt;
&lt;p&gt;4. Compile your C files (e.g. &lt;em&gt;test.c&lt;/em&gt;).&lt;/p&gt;
&lt;pre&gt;
sparc-rtems4.6.1-gcc -O4 -Wall -mcpu=cypress -c -o test.o test.c
&lt;/pre&gt;
&lt;p&gt;5. Link your program. It will not work right now, as you need to generate two final files, &lt;em&gt;my_bsp_specs&lt;/em&gt; and &lt;em&gt;linkcmds&lt;/em&gt;.&lt;/p&gt;
&lt;pre&gt;
sparc-rtems4.6.1-gcc -mcpu=cypress -Betc -specs my_bsp_specs -o test
window.o syscall.o test.o
&lt;/pre&gt;
&lt;p&gt;Note the arguments &lt;em&gt;-B&lt;/em&gt; and &lt;em&gt;-specs&lt;/em&gt;. &lt;em&gt;-specs&lt;/em&gt; is used to specify a file with options to override the default switches passed to cc1, cc1plus, as, ld&amp;#8230; By default, RTEMS uses the file &lt;em&gt;bsp_specs&lt;/em&gt; (found in &lt;em&gt;c/src/lib/libbsp/sparc/erc32&lt;/em&gt;). You can edit it and see that it automaticaly links with the RTEMS libraries and adds its own start.S object file. The &lt;em&gt;-B&lt;/em&gt; flag specifies where to find the executables, libraries, include files, and data files of the compiler itself. I have used an &lt;em&gt;etc&lt;/em&gt; directory where I have stored &lt;em&gt;my_bsp_specs&lt;/em&gt;. If any of the needed files is not found by the compiler it will automatically search its own paths.&lt;/p&gt;
&lt;p&gt;So, what we need to do is to create our own file, &lt;em&gt;my_bsp_specs&lt;/em&gt;, which will not use any RTEMS library and which will point to our compiled start.S object file.&lt;/p&gt;
&lt;p&gt;Basically,&lt;/p&gt;
&lt;pre&gt;
*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
&lt;/pre&gt;
&lt;p&gt;The &lt;em&gt;%s&lt;/em&gt; indicates to search the file in the compiler specific directories. I have removed the &lt;em&gt;%s&lt;/em&gt; from start.o so it will search for it in the current directory.&lt;/p&gt;
&lt;p&gt;Another important thing to note in this file is the &lt;em&gt;-T linkcmds&lt;/em&gt; option. This indicates the &lt;a href="http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_chapter/ld_3.html%23SEC6" &gt;linker script&lt;/a&gt;, which describes where the code and data for the application will reside in memory, to be used by the &lt;a href="http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_chapter/ld_toc.html" &gt;GNU linker&lt;/a&gt;. Fortunately, we can use the one that comes with RTEMS (found in &lt;em&gt;c/src/lib/libbsp/sparc/erc32/startup&lt;/em&gt;), so copy it to the &lt;em&gt;etc&lt;/em&gt; directory.&lt;/p&gt;
&lt;p&gt;Finally, note that when linking, we have not specified the &lt;em&gt;start.o&lt;/em&gt; file as it is already done in the &lt;em&gt;my_bsp_specs&lt;/em&gt; file.&lt;/p&gt;
&lt;p&gt;You might also find more information in the &lt;a href="http://www.rtems.org/onlinedocs/releases/rtemsdocs-4.6.1/share/rtems/html/bsp_howto/index.html" &gt;RTEMS BSP and Device Driver Development Guide&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Fri, 28 Sep 2007 09:08:14 GMT</pubDate>
      <title>Code size optimizations</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=40</link>
      <guid>http://axelio.wordpress.com/2007/09/28/code-size-optimizations/</guid>
      <description>&lt;div class='snap_preview'&gt;&lt;p&gt;During the last two years I have had the opportunity to write embedded software for the &lt;a href="http://www.sparc.org/" &gt;SPARC&lt;/a&gt; &lt;a href="http://microelectronics.esa.int/erc32/" &gt;ERC32&lt;/a&gt; architecture. The first piece of software we have written is an application that needs to fit in a 64 Kbytes &lt;a href="http://en.wikipedia.org/wiki/Read-only_memory" &gt;PROM&lt;/a&gt; with a minimal running system that can execute periodic tasks, send packets over a network, load another application stored in an &lt;a href="http://en.wikipedia.org/wiki/EEPROM" &gt;EEPROM&lt;/a&gt; that can be remotely patched and many other things. Before starting to write it from scratch we tried to fit &lt;a href="http://www.rtems.org/" &gt;RTEMS&lt;/a&gt; (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).&lt;/p&gt;
&lt;p&gt;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 &lt;a href="http://gcc.gnu.org/" &gt;gcc&lt;/a&gt; has been used.&lt;/p&gt;
&lt;p&gt;I would really appreciate if you can share your tricks and I will be glad to include them in the list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Compress application code&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As the application is stored in a PROM, you will normally have a minimal code to perform some initializations and checks (e.g. &lt;a href="http://en.wikipedia.org/wiki/RAM" &gt;RAM&lt;/a&gt; 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 &lt;a href="http://en.wikipedia.org/wiki/Lempel-Ziv-Storer-Szymanski" &gt;LZSS&lt;/a&gt;, uncompress the application to RAM and run it. The decompression algorithm will be obviously uncompressed.&lt;/p&gt;
&lt;p&gt;If you are working with an ERC32 processor check the &lt;a href="http://hacks-galore.org/aleix/mkprom-erc32/" &gt;MKPROM-ERC32&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Use inline functions judiciously&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As it is well-known, performance issues should not be treated while developing. So, writing a lot of &lt;a href="http://en.wikipedia.org/wiki/Inline_function" &gt;inline functions&lt;/a&gt; might not have great performance effects, but could have big size penalties if you don&amp;#8217;t use them judiciously.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Compiler optimization flags&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;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 &lt;em&gt;-Os&lt;/em&gt; option to decrease the executable size. We reduced 5 Kbytes.&lt;/p&gt;
&lt;p&gt;Note, that this will avoid inline functions optimization, but you can still tell gcc to include them passing the &lt;em&gt;-finline-functions&lt;/em&gt; option.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Split functions into separate files&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;There is one way to avoid this (I haven&amp;#8217;t tried it) with gcc using the &lt;em&gt;-ffunction-sections&lt;/em&gt; option. This creates a separate section for every function. The linker can then use the &lt;em&gt;&amp;#8211;gc-sections&lt;/em&gt; option to discard unused sections.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Separate debug and release code&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Do not use packed structures extensibly&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By definition, &lt;a href="http://sig9.com/articles/gcc-packed-structures" &gt;packed structures&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;Another reason for not using packed structures is portability.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enumerations vs. constant objects&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As described in this &lt;a href="http://www.embedded.com/story/OEG20011129S0065" &gt;article&lt;/a&gt;, constant objects, such as:&lt;/p&gt;
&lt;p&gt;unsigned int const ITEM_ID = 0&amp;#215;01200020;&lt;/p&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;p&gt;enum { ITEM_ID = 0&amp;#215;01200020 };&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 20 Sep 2007 16:08:55 GMT</pubDate>
      <title>Bomb Practical Common Lisp</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=39</link>
      <guid>http://axelio.wordpress.com/2007/09/20/bomb-practical-common-lisp/</guid>
      <description>&lt;div class='snap_preview'&gt;&lt;p&gt;&lt;a href="http://www.amazon.com/Practical-Common-Lisp-Peter-Seibel/dp/1590592395/ref=pd_bbs_sr_1/104-9324648-9628704?ie=UTF8&amp;amp;s=books&amp;amp;qid=1190301709&amp;amp;sr=8-1" &gt;&lt;img src="http://g-ec2.images-amazon.com/images/I/21VElAQ7spL._AA115_.jpg" align="right" hspace="10" vspace="0"&gt;&lt;/a&gt;&lt;br /&gt;
I started reading &lt;a href="http://www.amazon.com/Practical-Common-Lisp-Peter-Seibel/dp/1590592395/ref=pd_bbs_sr_1/104-9324648-9628704?ie=UTF8&amp;amp;s=books&amp;amp;qid=1190301709&amp;amp;sr=8-1" &gt;PCL&lt;/a&gt; some time ago (only time for 10 chapters). This is my first Common Lisp book, and by now I&amp;#8217;m not ready to write a great article about Common Lisp details, but if you are looking for a &lt;a href="http://www.gigamonkeys.com/book/" &gt;Common Lisp tutorial&lt;/a&gt;, this could be one.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.gigamonkeys.com/blog/2007/09/19/bomb-me.html" &gt;Bomb it!&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <pubDate>Sun, 16 Sep 2007 18:12:41 GMT</pubDate>
      <title>Integer comparisons</title>
      <link>http://www.advogato.org/person/aleix/diary.html?start=38</link>
      <guid>http://axelio.wordpress.com/2007/09/16/integer-comparisons/</guid>
      <description>&lt;div class='snap_preview'&gt;&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;When comparing signed and unsigned expressions of the same size, the compiler produces what it might be unexpected results. Suppose you have this code:&lt;/p&gt;
&lt;pre&gt;
#include &amp;lt;stdio.h&amp;gt;

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

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

  return 0;
}
&lt;/pre&gt;
&lt;p&gt;Here, you would probably expect an &amp;#8220;&lt;em&gt;OK&lt;/em&gt;&amp;#8221; output, but surprisingly you get &amp;#8220;&lt;em&gt;failed&lt;/em&gt;&amp;#8220;. Why is this? If you know about integer promotion, you may skip to the end if you don&amp;#8217;t want to follow all the process.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.amazon.com/C-Programming-Language-2nd/dp/0131103628/ref=pd_bbs_2/102-6103299-9922550?ie=UTF8&amp;amp;s=books&amp;amp;qid=1189707105&amp;amp;sr=8-2" &gt;&lt;img src="http://ec1.images-amazon.com/images/I/21PAWH8TXBL._AA115_.jpg" hspace="10" vspace="0" align="right"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Fortunately, I received a copy of &lt;a href="http://www.amazon.com/C-Programming-Language-2nd/dp/0131103628/ref=pd_bbs_2/102-6103299-9922550?ie=UTF8&amp;amp;s=books&amp;amp;qid=1189707105&amp;amp;sr=8-2" &gt;K&amp;amp;R&lt;/a&gt; last week, so I started digging into the issue to try to understand why this was happening.&lt;/p&gt;
&lt;p&gt;About equality operators, K&amp;amp;R section A7.10 reads&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
&lt;cite&gt;The equality operators follow the same rules as the relational operators&amp;#8230;&lt;/cite&gt;
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Section A7.9, about relational operator, reads&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
&lt;cite&gt;The usual arithmetic conversions are performed on arithmetic operands&amp;#8230;&lt;/cite&gt;
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;So, how these arithmetic conversions work?&lt;/p&gt;
&lt;p&gt;This is also clearly explained in K&amp;amp;R section A6.5 (the same rules apply to the &lt;a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf" &gt;C99 standard&lt;/a&gt;, 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&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
&lt;cite&gt;Otherwise, the integer promotions are performed on both operands&amp;#8230;&lt;/cite&gt;
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;So, before performing the comparison of our operands, both undergo integer promotion. Integer promotion (K&amp;amp;R, section A6.2) says that&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
&lt;cite&gt;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.&lt;/cite&gt;
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;An &lt;em&gt;int&lt;/em&gt; can represent all the values of our operands, so after the integer promotion is performed, both operands have &lt;em&gt;int&lt;/em&gt; type. Having a look back to our operands, we know that the &lt;em&gt;a&lt;/em&gt; variable holds the value &lt;em&gt;0xFFF4&lt;/em&gt;, and after applying the integer promotion, it maintains the value. The same happens with variable &lt;em&gt;b&lt;/em&gt;, that holds &lt;em&gt;0xFFFFFFF4&lt;/em&gt; to represent &lt;em&gt;-12&lt;/em&gt;. Clearly, both values are different and the check fails.&lt;/p&gt;
&lt;p&gt;At the end of K&amp;amp;R section A6.5 this is explicitly explained&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
&lt;cite&gt;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.&lt;/cite&gt;
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Note, that this issue does not occur with 32-bit values, as both operands would be &amp;#8220;0xFFFFFFF4&amp;#8243;.&lt;/p&gt;
&lt;p&gt;So, be careful when comparing unsigned and signed types.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
