<?xml version="1.0"?>

<rss version="2.0">
  <channel>
    <title>Andrew Cowie</title>
    <link>http://research.operationaldynamics.com/blogs/andrew/software/</link>
    <description>Blog postings by Andrew Cowie about Open Source and Software Development</description>
    <language>en</language>
    <copyright>Copyright (c) 2008 Operational Dynamics Consulting Pty Ltd. All rights reserved. Not for redistribution or attribution without permission in writing.</copyright>

    <image>
      <url>http://research.operationaldynamics.com/images/andrew_Hackergotchi.png</url>
      <title>Operational Dynamics Research</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/</link>
      <width>80</width>
      <height>86</height>
    </image>

    <lastBuildDate>Tue, 18 Nov 2008 01:36:00 GMT</lastBuildDate>

    <item>
      <title>A nice way to wake up</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/love-your-work.html</link>
      <description><![CDATA[<p>I&#8217;m the lead author and maintainer of <code>java-gnome</code>, an Open Source project that enables Java developers to write native GNOME applications using the GTK user interface toolkit. Like any such effort, it&#8217;s a huge amount of work, much of which goes on unseen. So there are few better ways of starting off your morning than finding a message like <a href="http://article.gmane.org/gmane.comp.gnome.bindings.java/1598">this</a> in your Inbox:</p>

<blockquote>
  <p>I just want to thank you for this <a href="http://java-gnome.sourceforge.net/">great API to GTK</a>.</p>
  
  <p>It feels entirely natural in Java, is very comfortable and very 
  approachable. The names and APIs are as you&#8217;d think them up when you&#8217;d 
  draw a widget set API in your mind, thus they are easy to find, too. 
  They also <strong>work</strong> as expected (as least so far, I am still new).&#185;
   The API documentation for each class 
  has a nice prose introduction text, which is very helpful and saves most 
  &#8220;tutorials&#8221;. I also appreciate that it points out just the right level 
  of footangles to be aware of.</p>
  
  <p>All in all a really great piece of work. When you talked about &#8220;quality&#8221; 
  on your website, I was suspect, as that&#8217;s most of the time just words, 
  but you really deliver quality. You show an good example of what quality 
  means in the context of an API.</p>
  
  <p>Sun should take a good example from you and 
  many in the open-source world, too. Such brightness and care is rare.</p>
</blockquote>

<p>Hey, thanks!</p>

<h2>Quality versus Barrier to Entry</h2>

<p>Regardless of the underlying economic circumstances, most Open Source projects are labours of love. But they can go one of two ways.</p>

<p>One tendency is to just accept anything, and hope that &#8220;someone&#8221; will fix it later. This approach has the beneift of a low barrier to entry, making it easy for people to contribute. But it can result in a muddle; code that is not yet up to scratch but whose authors have moved on to other things. The only time that Open Source fails to live up to its promise (as a software development methodology) is when someone starts something and doesn&#8217;t finish it. A situation nobody wants, but it is easy to have this inflicted upon your project if you accept incomplete contributions from other people &#8212;  it can be hard to incent them to come back and finish the job.</p>

<p>The other way is to maintain a high standard, putting emphasis on internal consistency and clarity and asking people to rise to that level. While setting a high bar does put some people off, the contributions from those who invest the effort to rise to the occasion tend to be <em>really</em> good.</p>

<p>I tend to favour the second way. If your initiative is worth working on at all, then it is the kind of thing you work hard at making perfect because it deserves nothing less. You&#8217;re not going to let it down, and you don&#8217;t want anyone else to either.</p>

<p>Anyway, it&#8217;s all a lot of work. Sometimes I hate it. But when you receive a note like this from someone who appreciates the effort you&#8217;ve put in, it really does make your day &#8212; and makes you feel that result of staying clearly focused has been worth it.</p>

<p>AfC</p>

<p>&#185; <span style="font-size:small">I pointed out to him in my reply that there was still plenty of time for him to trip over something :)</span></p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/java-gnome</category>
      <pubDate>Tue, 18 Nov 2008 01:36:00 GMT</pubDate>
      <guid isPermaLink="false">love-your-work</guid>
    </item>

    <item>
      <title>java-gnome 4.0.9 released!</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/java-gnome-4.0.9-release.html</link>
      <description><![CDATA[<p><a href="http://java-gnome.sourceforge.net/">
<center>
<img src="http://java-gnome.sourceforge.net/images/java-gnome_LargeLogo.png" border="0">
</center>
</a></p>

<p><em>This blog post is an extract of the release note from the</em> <code>NEWS</code> <em>file which you can read <a href="http://java-gnome.sourceforge.net/4.0/NEWS.html">online</a> &#8230; or in the
<a href="http://research.operationaldynamics.com/bzr/java-gnome/mainline/NEWS">sources</a>,
of course!</em></p>

<hr/>

<h1>java-gnome 4.0.9 (13 Oct 2008)</h1>

<p><em>The pen is mightier than the sword</em></p>

<h2>New coverage</h2>

<p><img src="http://java-gnome.sourceforge.net/4.0/doc/examples/textview/ExampleInstantMessenger.png" alt=""
style="float: right; text-align: right; padding-left: 15px;" /> </p>

<p>This is the first release with coverage of GTK&#8217;s powerful TextView/TextBuffer
multi-line text display and editing Widget. This has been the result of
several months of careful effort to present a clean and self-consistent API
while remaining faithful to the underlying implementation. This bulk of this
work was done by Stefan Prelle and Andrew Cowie, with contributions from
Kenneth Prugh and testing by many people in the <code>#java-gnome</code> community.</p>

<p>The snapshot at right is from
<a href="http://java-gnome.sourceforge.net/4.0/doc/examples/textview/ExampleInstantMessenger.html"><code>ExampleInstantMessenger</code></a>,
included with the sources. It is a somewhat detailed example showing the use
of TextView, TextBuffer, and related classes.</p>

<h2>Other improvements</h2>

<p>Continuous improvement to various classes, especially in our documentation.
Incremental changes have occurred in a number of places. In the
TreeView/TreeModel APIs, some useful methods for translating TreeIters from
one model to another have been added.</p>

<p>Also thanks to the persistent work of Stefan Prelle, we now have nice coverage of
GTK&#8217;s Assistant (aka druid, wizard, etc), along with better support for doing popup context menus, including some bug fixes. Thanks to Srichand Pendyala for taking care of this and to Owen Taylor for having explained out some of the underlying implementation details.</p>

<p>As usual, incremental improvements to core classes continue. Virtually every class has been touched in one way or another; many changes are cosmetic but they add up to a nice delta overall.</p>

<h2>Reducing memory pressure</h2>

<p>Internally, java-gnome maintains a lookup table so that pointers coming from
the C side can be converted into proxy objects for the case where a proxy has
already been created. In any library there a great number of transient and
temporary objects and structures allocated, and in wrapping native GNOME libraries we are no different. It turned
out that registering these temporary objects was putting pressure on the
lookup table. While these objects <em>were</em> properly weak referenced and being
garbage collected (and thence freed), there were nevertheless an enormous
number of temporary objects being inserted and removed from the lookup table
&#8212; and that sort of thing causes hash tables to grow overly large.</p>

<p>To do something about this we have split the former hierarchy root into two
classes. Only structures which have a persistent identity (which, in practise,
means only GObjects and certain Cairo entities) are registered so they can be
looked up by address later as necessary. The rest of the Java side proxies  <em>aren&#8217;t</em>
registered, essentially eliminating the transient pressure on the lookup
table.</p>

<p>Thanks to Vreixo Formoso for doing the bulk of the leg-work on this one.</p>

<h2>Making it easier to run java-gnome programs</h2>

<p>Because java-gnome is directly binds to underlying system libraries, it has a
native shared library component. This led to the usual development hassle of
having to specify where this library is to be found if it were anywhere other
than <code>/usr</code> and of course the nightmare of ensuring a VM used the right
library in the event you were developing against or hacking on a newer version
of java-gnome; in Java this meant:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ java -classpath /opt/local/share/java/gtk-4.0.jar:. -Djava.library.path=/opt/local/lib com.example.Program
</pre>

<p>No longer!</p>

<p>The native shared library part of java-gnome is now located deterministically
and loaded automatically. You don&#8217;t need to faff about with
<code>java.library.path</code> on the command line or in your IDE any more!</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ java -classpath /opt/local/share/java/gtk-4.0.jar:. com.example.Program
</pre>

<p>Our native component is completely coupled to the specific release you are
using, so sufficient version information is embedded in the <code>.so</code> name to
ensure that the right library (and only the right library) is loaded.</p>

<p>There are no changes if you are simply working against an &#8220;in-place&#8221;
development build of java-gnome, be it from command line, or in an IDE like
Eclipse. Things will Just Work&trade;. Again, no <code>-Djava.library.path</code>.</p>

<p><em>This whole issue turned out to be a real stumbling block for new developers attempting to use the bindings; it&#8217;s not something that many Java programmers have had to deal with, so engineering around this problem to make the native library loading transparent is a big win for us.</em></p>

<h2>Build system improvements</h2>

<p>Serkan Kaba has contributed a number of internal improvements allowing the top
level <code>./configure</code> script to be precise about the versions of various GNOME
dependencies we require.</p>

<p>Thanks to some hard work from Serkan Kaba and new contributor
George McLachlan, java-gnome correctly builds against GTK 2.14 without any
problems due to deprecations.</p>

<p>Note that java-gnome releases do <em>not</em> set <code>GTK_DISABLE_DEPRECATED</code> (this is a
change from 4.0.8); thanks to Mart Raudsepp of the Gentoo Linux desktop team
for pointing out why this would be better. These macros <em>are</em> still enabled
for builds checked out from version control so hackers working on the bindings
so will be able to keep up with ensuring we react to future deprecations (it&#8217;s
always awesome when downstream is a part of the upstream community; Serkan and
Kenneth are also Gentoo packagers, and take care of the java-gnome <code>.ebuild</code>
for us).</p>

<h2>Looking ahead</h2>

<p>We&#8217;re pretty happy with the state of the java-gnome right now. Coverage of the
most important parts of GTK are in place. Our treatment of the underlying
drawing library, Cairo, still has a bit to go, but the basics are there and a
firm foundation to build from. More interesting are the remaining areas; the
more general GNOME utility libraries and other parts of the Free Desktop stack
that might be needed by an end-user application. It&#8217;ll be interesting to see
how these areas evolve in the coming months.</p>

<hr/>

<p><em>You can download java-gnome from</em> <a href="http://ftp.gnome.org/pub/GNOME/sources/java-gnome/4.0/"><code>ftp.gnome.org</code></a> <em>or easily checkout a branch from</em> &#8216;<code>mainline</code>&#8217; <em>using Bazaar:</em></p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr checkout bzr://research.operationaldynamics.com/bzr/java-gnome/mainline java-gnome
</pre>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/java-gnome</category>
      <pubDate>Mon, 13 Oct 2008 11:49:00 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.9-release</guid>
    </item>

    <item>
      <title>HTTP response code nuttiness</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/something-weird-with-sourceforge.html</link>
      <description><![CDATA[<p>The technique of using a 404 error handler to actually render a web page from some underlying source or data is widely used. We use it on the java-gnome website to render prettily marked-up versions of our text meta documents (<a href="http://java-gnome.sourceforge.net/4.0/NEWS.html">NEWS</a>, <a href="http://java-gnome.sourceforge.net/4.0/README.html">README</a>, <a href="http://java-gnome.sourceforge.net/4.0/HACKING.html">HACKING</a>, etc). The document you&#8217;re asking for (&#8220;<code>README.html</code>&#8221;) doesn&#8217;t exist, but a text source (&#8220;<code>README</code>&#8221;) does and so it reads that file in, runs the markup processor, and then serves the result. Yawn.</p>

<p>If you&#8217;re already in an error handler, then the default status code as far as the web server is concerned is, of course, HTTP 404. So you need to change that. In PHP, that&#8217;s as simple as:</p>

<pre><code>&lt;?
    header("HTTP/1.1 200 OK");
?&gt;
</code></pre>

<p>which is actually treated a bit magically to tweak the response code. Too easy. This worked fine on our test site and on the production site for, well, years.</p>

<p>We ran into a weird problem that at some point over the last few weeks that suddenly I was seeing garbage appearing at the beginning and end of documents being so rendered on our SourceForge website. Huh?</p>

<p>I still have no idea what is wrong, and won&#8217;t detail all the diagnostics it took to track down the problem, but I ended up isolating it to the <code>header()</code> call. If I skipped that, then the document would render and serve correctly. But that&#8217;s no good, because then you are serving documents with an HTTP 404 error code, which will inhibit search indexing and caching even if it doesn&#8217;t screw with your browser.</p>

<p>The workaround ended up being this:</p>

<pre><code>&lt;?
    header("HTTP/1.0 200 OK");
?&gt;
</code></pre>

<p>I have no idea why, but with whatever SourceForge has done to their webservers lately, <em>this</em> made it work fine. Go figure.</p>

<p>The real inanity, though, is that using <code>wget</code> to fetch the document while showing HTTP headers the result is this:</p>

<pre style="background: black; color: white; padding: 10px;">
$ wget -x -S http://java-gnome.sourceforge.net/4.0/README.html
--2008-10-13 14:11:28--  http://java-gnome.sourceforge.net/4.0/README.html
Resolving java-gnome.sourceforge.net... 216.34.181.96
Connecting to java-gnome.sourceforge.net|216.34.181.96|:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Server: nginx/0.6.31
  Date: Mon, 13 Oct 2008 03:11:29 GMT
  Content-Type: text/html; charset=UTF-8
  Connection: close
  X-Powered-By: PHP/5.2.6
  Last-Modified: Sun, 12 Oct 2008 14:02:37 GMT
Length: unspecified [text/html]
Saving to: `java-gnome.sourceforge.net/4.0/README.html'

    [    <=>                                ] 16,052      22.3K/s   in 0.7s    

2008-10-13 14:11:30 (22.3 KB/s) - `java-gnome.sourceforge.net/4.0/README.html' saved [16052]
$
</pre>

<p>Their web server sent an HTTP/1.1 response anyway! Talk about adding insult to injury. What a waste of time.</p>

<p>I&#8217;m sure this is just one of those transient conditions that&#8217;ll be gone by this time next week, but it sure as hell frustrated me. If you&#8217;re seeing something weird going on with PHP pages on one of your SourceForge sites, perhaps have a look and see if this workaround helps.</p>

<p><code>{shrug}</code></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/java-gnome</category>
      <pubDate>Mon, 13 Oct 2008 03:24:00 GMT</pubDate>
      <guid isPermaLink="false">something-weird-with-sourceforge</guid>
    </item>

    <item>
      <title>Wine your own business</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/gentoo-linux/wine-locale.html</link>
      <description><![CDATA[<p>The things that drive you crazy&#8230;</p>

<p>There&#8217;s one (and only one) legacy Windows application that we have. We used to run it in VMware, which worked, but that was a pain, looked terrible, and of course was required us to have our copy of Windows 2000 installed there. Decrepit. But far worse, meant we had to <em>use</em> Windows. Yuk. And worst of all to have to keep switching in and out of it. Bah.</p>

<p>Life would be far better if we could run it on Linux under Wine &#8212; then it&#8217;d just be another app on running on the GNOME desktop and under the control of the window manager. We&#8217;d tried seeing if we could get this application to run in Wine a few times over the years; no joy. But somewhere along the line it started noticing list posts from other people reporting positive experiences. So {shrug} I gave it another try this month, and to my intense pleasure it installed cleanly and is running fine. Terrific! The people who hack on Wine are amazing.</p>

<p>So I started working away, only to suddenly realize that the dates were in American <code>mm/dd/yy</code> format. Gah. More searching, but none of the workarounds suggested (mostly to do with manually changing things with Wine&#8217;s <code>regedit</code>) seemed to work. Quote a pain.</p>

<p>I had come across a number of references saying that Wine and in turn the program in question would pick up the locale settings provided by your environment. I&#8217;d checked that, and tried various combinations. Nothing seemed to work.</p>

<p>I mostly run in <code>en_CA</code>, ie:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ echo $LANG
en_CA.UTF-8
$
</pre>

<p>the impact of which you can see by running the <code>locale</code> command:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ locale
LANG=en_CA.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME=en_DK.UTF-8
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER=en_AU.UTF-8
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=
$
</pre>

<p>all as one would expect And yet it had no impact on running the program running under Wine [Setting <code>LC_TIME</code> to <code>en_DK</code> is an old trick for people in <code>en</code> locales to get <a href="http://www.cl.cam.ac.uk/~mgk25/iso-time.html">proper</a> 24-hour time formatting; yes, I tried unsetting <code>LC_TIME</code>; I tried dropping the <code>UTF-8</code> settings; I tried <code>LANG=en_AU</code>. Nothing made any difference].</p>

<p>After a lot more frustration searching around, I finally came across a support <a href="http://www.codeweavers.com/support/tickets/browse/?ticket_id=99183;list=6;ticket_level=3;tscurPos=900">article</a> on CodeWeaver&#8217;s website that mentioned setting the locale environment variables. <em>Yes yes</em>, I thought, but then I looked more closely. They were setting <strong><code>LC_ALL</code></strong>. Wait a minute. <code>LC_ALL</code> is a special variable that &#8220;if  set  to a non-empty string value, override the values of all the other internationalization variables.&#8221; You&#8217;re not supposed to set that&#8230; certainly one doesn&#8217;t set that at login &#8212; that&#8217;s what <code>LANG</code> is for. I didn&#8217;t really expect anything to come of it, but I tried it anyway:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ env LC_ALL=en_CA.UTF-8 WINEPREFIX="/home/andrew/.wine" wine "C:\Premier12\Myobp.exe"
</pre>

<p>and <strong>ta-da</strong> everything worked: I had <code>dd/mm/yy</code> date formatting just like we wanted. Yeay!</p>

<p><em>I immediately closed everything down and went out for a beer. Sometimes we forget to celebrate those brief moments when things actually work.</em></p>

<p>But talk about bitterness. I&#8217;m not sure if this was a Wine behaviour, a Windows behaviour, or just nonsense code in MYOB. I suspect the latter. But either way, I saw so many posts asking &#8220;how can I get the date format to behave under Wine&#8221; that I thought I should write about the workaround that did it for us.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/gentoo-linux</category>
      <pubDate>Mon, 29 Sep 2008 05:24:00 GMT</pubDate>
      <guid isPermaLink="false">wine-locale</guid>
    </item>

    <item>
      <title>Desktop beautification: fix your fonts</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/gentoo-linux/desktop-fonts.html</link>
      <description><![CDATA[<p><em>One of the nice things about Gentoo Linux is that they tend to leave the upstream defaults alone. This applies to file system locations, build configurations, but also things like preferences across the GNOME Desktop. This is good, in that Gentoo users see the raw upstream, but not entirely optimal in cases where those defaults aren&#8217;t as good as they could be or are too generic.</em></p>

<p><em>I was pairing with a colleague the other day and they were impressed with how I had things set up &#8212; and more to the point my rationales for having done so &#8212; and they encouraged me to write about it.</em></p>

<p><em>I don&#8217;t particularly think I have anything original or novel to say, but in so far as some of us have built up configurations over the years that (for ourselves, at least) improve usability and which define our productivity, I think it&#8217;ll be a nice contribution to show others what we&#8217;re using and how we got things that way. If <strong>you</strong> think you know what you&#8217;re doing, then I encourage you to write about your customizations &#8212; and why you made them. People using commercial distros like Ubuntu and Fedora will justly be able to say &#8220;it already looks good&#8221; and so if you&#8217;re happy you can ignore this, but even in such environments we still often tighten things up to individual taste and so I&#8217;m sure you have something to offer.</em></p>

<p><em>Anyway, thus begins an occasional series about things I&#8217;ve done to beautify my GNOME Desktop on our Gentoo Linux systems.</em></p>

<p>A few years back I was enjoying a drink with Carl Worth and Keith Packard (free desktop graphics hackers extraordinaire, for those who haven&#8217;t met them). Later in the evening Keith leaned over, saw my laptop&#8217;s screen, and starting swearing at me: &#8220;You need to fix your fonts!&#8221; (I was using Luxi or something). So, ok, what do you want me to do? They told me to switch to the Bitstream Vera family as being well sculpted, highly professional, and optimized for screen display. Needless to say I take what these gentlemen say extremely seriously, so did what I was told <code>:)</code>.</p>

<p>Like any font or appearances change, for the first day or so it felt a bit odd, but then something shifted and it felt very <em>comfortable</em>. The real give-away that I was on the right track was a few days later when I tried switching back to the old font for the hell of it and recoiled in horror &#8220;Gawd that&#8217;s ugly!&#8221; </p>

<p>Bitstream Vera had done me well for quite some time, but recently I started running into some subtle bugs. One showed up with the weather applet; for whatever reason a few versions ago they changed the string from &#8216;&deg;&#8217; + &#8216;C&#8217; to unicode character <code>0x2103</code>, the symbol for degrees Celsius. I was getting a weird fall back to some horrible looking old bit-mapped font. Yikes (if &deg;C and <span style="font-family:'New Century Schoolbook','Courier 10'">&#8451;</span> don&#8217;t look about the same then you&#8217;ll see what I mean). No big deal, but it was annoying me.</p>

<p>So I was checking around again to see if there was a different font family I should be using, when I came across the <a href="http://dejavu.sourceforge.net/wiki/index.php/Main_Page">DejaVu</a>. It starts from Bitstream Vera (so the base ASCII characters are all the same and mostly untouched) but adds a ton of hinting corrections, bug fixes, and extensions up in the higher unicode sequences needed by European languages and scientific work. There are also a number of additional faces available. And regular releases (always a good sign). And a different name, per the Bitstream licence terms. When I asked about DejaVu in <code>#gnome-hackers</code>, the answer was &#8220;hell yes you should be using it.&#8221; Huh. So I switched!</p>

<p>The DejaVu fonts are available on Gentoo in the <code>media-fonts/dejavu</code> package.</p>

<p>The &#8220;right&#8221; way to change the font globally would be to change the &#8220;Sans&#8221; and &#8220;Serif&#8221; and &#8220;Monospace&#8221; aliases in the fontconfig setup in <code>/etc/fonts</code>. But I generally try to leave those files alone, so instead ran <code>gnome-appearance-properties</code> and from the Font tab changed the system fonts to be what I wanted.</p>

<p><img src="/blogs/andrew/software/gentoo-linux/AppearancePreferences.png" alt="Appearance Preferences" title=""/></p>

<p>Immediately it fixed my glitch with the weather applet (yeay), but I started to notice anything using the higher order mathematical symbols was likewise drastically improved. Hurrah!</p>

<p>With <code>gnome-font-viewer</code>,</p>

<p><img src="/blogs/andrew/software/gentoo-linux/FontViewer_DejaVuSansMono.png" alt="DejaVu Sans Mono, Book" title=""/>
<img src="/blogs/andrew/software/gentoo-linux/FontViewer_DejaVuSerifItalic.png" alt="DejaVu Serif, Italic" title=""/></p>

<p><em>Making screenshots of what they look like on my screen is a bit silly because they won&#8217;t necessarily look the same on your screen. But hey. We do our best.</em></p>

<p>Open Source is about choice, and so I cannot talk about fonts without also mentioning the <a href="https://www.redhat.com/promo/fonts/">Liberation</a> font family. These were obtained by Red Hat and intended as a drop-in replacement for the Microsoft core fonts (Courier New, Arial, etc) which are widely used but not libre. For whatever reason the Liberation fonts don&#8217;t look quite right on my screen (there are red and green hinting glitches around the glyphs; something is obviously misconfigured somewhere) but it&#8217;s a different free font that has been generously made available to the community. They&#8217;re available on Gentoo in the <code>media-fonts/liberation-fonts-ttf</code> package.</p>

<p>AfC</p>

<p>Update:</p>

<ol>
<li>So it turns out that DejaVu <em>is</em> set to be the default on Gentoo, but they&#8217;ve got a bug whereby they&#8217;ve got their ordering wrong: if you also have Bitstream Vera installed it gets picked up for Sans in preference. The folks in <code>#gentoo-desktop</code> say they&#8217;re going to fix that. (This is only relevant if you have the <code>x11-base/xorg-x11</code> meta package installed; it pulls in <code>media-fonts/ttf-bitstream-vera</code>. If you only have the lower level <code>x11-base/xorg-server</code> package installed you can manually install <code>media-fonts/dejavu</code> [only] and then the default aliases will be to DejaVu). Anyway, the real point of this article was about being aware that you can have control of your fonts, so all good.</li>
</ol>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/gentoo-linux</category>
      <pubDate>Thu, 11 Sep 2008 10:01:00 GMT</pubDate>
      <guid isPermaLink="false">desktop-fonts</guid>
    </item>

    <item>
      <title>java-gnome 4.0.8 released!</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/java-gnome-4.0.8-release.html</link>
      <description><![CDATA[<p><a href="http://java-gnome.sourceforge.net/">
<center>
<img src="http://java-gnome.sourceforge.net/images/java-gnome_LargeLogo.png" border="0">
</center>
</a></p>

<p><em>This blog post is an extract of the release note from the</em> <code>NEWS</code> <em>file which you can read <a href="http://java-gnome.sourceforge.net/4.0/NEWS.html">online</a> &#8230; or in the
<a href="http://research.operationaldynamics.com/bzr/java-gnome/mainline/NEWS">sources</a>,
of course!</em></p>

<hr/>

<h1>java-gnome 4.0.8 (15 Aug 2008)</h1>

<p><em>Cleanups and fixups.</em></p>

<p>This release is mostly to push out bug fixes and internal improvements,
setting the stage for some major new feature development. We&#8217;ve also taken the
opportunity to introduce a major change to the way we connect handlers for
signals.</p>

<h2>New coverage and continuing improvement</h2>

<p>With thanks to new contributors Stefan Prelle and Andreas Kuehntopf we have a
number of small improvements to the TreeView/TreeModel APIs. As always, Widget and Window saw a bunch of work, with <code>Window.ConfigureEvent</code> now being available and a number of additional property setters and methods relating to window type. Widgets that scroll around a view of a broader underlying canvas have seen a fair bit of activity related to controlling that scrolling.</p>

<p>New features include refinements and new coverage of methods in a variety of
lower level classes including that further support drawing operations. Bug
fixes, debugging improvements, and defencive enhancements to our thread safety
measures have also featured largely.</p>

<h2>Signal naming change</h2>

<p>The names of the inner interfaces used to specify the prototypes of the
methods which receive signal callbacks have changed to the pattern
<code>Button.Clicked</code>, this being more appropriate to Java type naming conventions
and providing better consistency between the signal name, the method to be
implemented to receive the callback, and the method that can be used to emit
this signal.</p>

<p>API compatibility to previous releases in the 4.0 series has been preserved.
The old signal interfaces and <code>connect()</code> methods are <code>@deprecated</code>.
Developers are encouraged to migrate quickly; new coverage will of course all
follow the new pattern. Making the transition is is easy, especially in an
IDE. Most of the people we&#8217;re aware of using the library have already ported
their code. Just turn assertions on to double check.</p>

<h2>Build changes</h2>

<p>java-gnome now defines C compiler flags like <code>GTK_DISABLE_DEPRECATED</code> to
ensure we are not linking against code that will be unavailable in GTK 3.0.
Many thanks are due to new contributor Kenneth Prugh for having done some
terrific grunt work to prune deprecated classes and methods from our <code>.defs</code>
data so that java-gnome compiles without using these APIs.</p>

<p>The build system internally now ensures that multiple runs don&#8217;t occur
simultaneously, fixing a number of annoyances that cropped up when using IDEs
which tend to like trying to frequently re-run the build even if a previous
one hasn&#8217;t finished.</p>

<h2>Documentation, examples, and testing</h2>

<p>Our <a href="http://java-gnome.sourceforge.net/4.0/doc/api/overview-summary.html">API documentation</a> and the growing set of
<a href="http://java-gnome.sourceforge.net/4.0/doc/examples/START.html">example code</a> have all been updated to reflect the
new signal interface names. Doing so forced us to review a wide swath of the
documentation, and so along the way a huge number of minor improvements were
made. Given how detailed our JavaDoc is, this sort of painstaking work really
makes a genuine contribution to overall quality.</p>

<p>There has been steady growth in our test suite, which is great. When combined
with the snapshots used to illustrate our documentation, the coverage level
is substantial.</p>

<p>Error handling continues to improve. In the (hand written) public API wrapper
layer we do our best to catch  misuses of the library before they get sent to
the native code. But that&#8217;s not always possible, and in 4.0.7 we introduced a
mechanism whereby GLib error messages get translated into Java Exceptions and
thrown. As of 4.0.8, in addition to <code>ERROR</code> and <code>CRITICAL</code>, we also throw
<code>WARNING</code>s as Exceptions. Getting a stack trace this way has proved very
useful in helping developers track down where they are making mistakes in
using the library.</p>

<h2>Conclusion</h2>

<p>You can see the full changes accompanying a release by grabbing a copy of the
sources and running:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr diff -r tag:v4.0.7..tag:v4.0.8
</pre>

<p>Because of the API changes to signal handling this release touches just about
every public class in the library and so isn&#8217;t quite as clean (as a summary)
as in previous releases &#8212; but it does show you everything that changed. <code>:)</code></p>

<h2>Looking ahead</h2>

<p>Most of the contributors to java-gnome are working on branches that didn&#8217;t
reach sufficient maturity to be merged in time for 4.0.8; that&#8217;s the way it
goes sometimes. Major effort continues on implementing coverage of GTK&#8217;s
powerful TextView/TextBuffer APIs, along with further drawing capabilities in
Cairo and Pango. There have also been a surprising level of interest on other
areas of the GNOME stack, with new contributors working on adding support to
java-gnome for Nautilus, GStreamer, and even WebKit. Exciting stuff!</p>

<hr/>

<p><em>You can download java-gnome from</em> <a href="http://ftp.gnome.org/pub/GNOME/sources/java-gnome/4.0/"><code>ftp.gnome.org</code></a> <em>or easily checkout a branch from</em> &#8216;<code>mainline</code>&#8217; <em>using Bazaar:</em></p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr checkout bzr://research.operationaldynamics.com/bzr/java-gnome/mainline java-gnome
</pre>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/java-gnome</category>
      <pubDate>Mon, 18 Aug 2008 23:01:00 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.8-release</guid>
    </item>

    <item>
      <title>Swat!</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/gnome-desktop/gtk-bug-56070.html</link>
      <description><![CDATA[<p>Huge kudos are due to <a href="http://blogs.gnome.org/bratsche/">Cody Russell</a> for having fixed one of the <a href="http://bugzilla.gnome.org/show_bug.cgi?id=56070">longest-standing</a> bugs in GTK. 11 June 2001!</p>

<p>Cody only got involved in this issue recently, but he took the time to really dig into it, examine different hypothesises, and test like crazy. This was remarkable: it&#8217;s not every day you see someone wade into a bug that&#8217;s been open for over half a decade and with over a hundred comments, and then persist for over a year to get it solved.</p>

<p>Way to go!</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/gnome-desktop</category>
      <pubDate>Fri, 01 Aug 2008 05:38:00 GMT</pubDate>
      <guid isPermaLink="false">gtk-bug-56070</guid>
    </item>

    <item>
      <title>Using Eclipse&#8217;s source code formatter from the command line</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/eclipse-code-format-from-command-line.html</link>
      <description><![CDATA[<p>One of the many wonderful capabilities built into the side of Eclipse is a powerful code formatter. Adjusting source code to match one&#8217;s particular preferences is nothing terribly new; what makes Eclipse&#8217;s so excellent is the degree of configurability and the preview of the effect each setting will have.</p>

<p>An Eclipse project has several metadata files:</p>

<pre>
.project
.classpath
.settings/org.eclipse.cdt.core.prefs
.settings/org.eclipse.jdt.core.prefs
<b>.settings/org.eclipse.jdt.ui.prefs</b>
</pre>

<p>Which seems a bit of a mess, but whatever. The <code>.settings/</code> stuff gets written down when you decide to tell a Project to have settings custom that override the user&#8217;s defaults. It goes without saying that for a collaboratively developed project like the Java bindings we have the Eclipse project metadata for compiler warnings tuned, the code formatter settings, how to invoke the build system etc all stored in Bazaar along side the real sources.</p>

<p>Anyway, this&#8217;s all fine and nice for people working on my software in Eclipse, but what about people wishing to use a different editor?</p>

<p>For a few versions now, Eclipse has exposed the the ability to run its code formatter from the command line; the work was done by Ben Konrath, someone I met a few years ago at a java-gnome hackfest. Since I use Eclipse I hadn&#8217;t needed to bother to figure out how to use whatever it was that he&#8217;d done. Since becoming maintainer of java-gnome, though, I&#8217;ve noticed a bit of unnecessary formatting churn in the contributions we receive. We do have a <a href="http://java-gnome.sourceforge.net/4.0/doc/style/">style guide</a>, but it is secondary to the fact that Eclipse just normalizes the code every time I save something (nice). But for people not using Eclipse I thought I might have a look.</p>

<p>A bit of searching around turned up this blog post by one <a href="http://www.peterfriese.de/formatting-your-code-using-the-eclipse-code-formatter/">Peter Friese</a>. It included two important points that are non-trivial. Firstly, that configuration the code formatter from command line will use can be controlled by the pointing it at the <code>.settings/org.eclipse.jdt.ui.prefs</code> file which in turn can be created by the &#8220;Enable project specific settings&#8221; described above (we&#8217;d already done that, so no problem, but how on earth would anyone have guessed this?). Secondly, the command line that one has to incant to make it go is pretty voodoo, so I&#8217;m pretty thankful that he described what he&#8217;d done.</p>

<p>In our environment, this works out to:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ /opt/local/eclipse/<b>eclipse -nosplash
    -application org.eclipse.jdt.core.JavaCodeFormatter
    -verbose
    -config .settings/org.eclipse.jdt.core.prefs</b>
    src/ tests/ doc/examples/
</pre>

<p>Gah!</p>

<p>For a brief moment I wondered if it would be easier just to run the Java class in question. So I interrupted the process and had a look in the process table.</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
/usr/lib/jvm/sun-jdk-1.6/bin/java
    -Dosgi.requiredJavaVersion=1.5
    -client
    -Xms40m
    -Xmx256m
    -jar /opt/local/eclipse/plugins org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
    -os linux
    -ws gtk
    -arch x86
    -launcher /opt/local/eclipse/<b>eclipse</b>
    -name Eclipse
    --launcher.library /opt/local/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.2.R331_v20071019/eclipse_1021.so
    -startup /opt/local/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
    -exitdata 84001b
    <b>-application org.eclipse.jdt.core.JavaCodeFormatter
    -verbose
    -config .settings/org.eclipse.jdt.core.prefs</b>
    src/ tests/ doc/examples/
    -vm /usr/bin/java
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -client
    -Xms40m
    -Xmx256m
    -jar /opt/local/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
</pre>

<p>Good Lord. What the hell is all that? I mean, I know Java environments tend to get a bit unwieldy because there is still no link-to-binary facility, and I know Eclipse is an OSGi framework and what not, but that is pathetic. I guess running the command as described at the top isn&#8217;t such a bad idea after all.</p>

<p>I&#8217;ve got an even better idea: how about a convenience target in our <code>Makefile</code> front end. Yup. So I&#8217;ve added  a <code>format</code> target:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ make format
</pre>

<p>(or</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ ECLIPSE=/opt/local/eclipse/eclipse make format
</pre>

<p>in my case). Running that before committing will do the trick quite nicely.</p>

<p>I agree with the bug mentioned by one <a href="http://www.nirving.com/2007/06/01/batch-code-formatting-using-eclipse-code-formatter-but-without-eclipse/">Nicholas Irving</a> in his post on the topic: it is somewhat asinine that this bit of Eclipse bumps the modification time of every file it formats; it would be nice if it only changed files in which it actually found something it needed to alter. Fortunately our internal build system is actually md5 hash (not Make) based, so it doesn&#8217;t hurt us. </p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/java-gnome</category>
      <pubDate>Sun, 06 Jul 2008 03:23:00 GMT</pubDate>
      <guid isPermaLink="false">eclipse-code-format-from-command-line</guid>
    </item>

    <item>
      <title>A Bazaar branch of GTK</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/version-control/bzr-branch-of-gtk.html</link>
      <description><![CDATA[<p>Converting a project from one version control system to another is always painful. Doing so is a rather momentous change to contemplate. With organizational &amp; community inertia being what it is, not something easily rushed into. Worse is when you attempt to use a modern tool as a better front end for an old one.</p>

<p>One of the neat things about the 3rd generation distributed version control system projects (ie Bazaar, Git, or Mercurial) is their plugins which allow you to continue to work with a Subversion upstream project but use the modern tool as a front end locally. For those of us who have been very productively using DVCS for some time, this is a godsend.</p>

<p>Using one of these plugins to thence evaluate the usability or performance of one of a DVCS is not really the best approach one could take; none of them were built with using Subversion as a peer in mind, and lord knows Subversion is not built to store revisions with such complex relationships. Thus the idea has turned out to be a <em>very</em> challenging problem space for everyone but most have had their tools mature to the point where Subversion is the bottleneck. And despite my misgiving that starting out your experience with a 3rd generation DVCS by first using it to access some legacy project will not show your new shiny tool in its best light, the reality remains that most people need to get on with being productive, and doing a full blown conversion (or starting use with a brand new projects) are less likely to be your circumstance.</p>

<p>Having been using <a href="http://www.bazaar-vcs.org/">Bazaar</a> (known best by the abbreviation <code>bzr</code>) for well over 18 months and overall being very happy with the experience, I would like to encourage other GNOME hackers to try it; likewise I have some patches I&#8217;d like to contribute to GTK so I thought I&#8217;d start by using <code>bzr-svn</code> to get a branch of GTK as a starting point (and to likewise give Bazaar&#8217;s Subversion interface a workout). So I created Bazaar branch of GTK.</p>

<h2>Initial import was very slow</h2>

<p>The first step was to create a Bazaar branch that represents the foreign Subversion repository. This was painful.</p>

<p>I originally attempted to do this while I was at the GTK Hackfest we had in Berlin; that turned out to be a disaster because (as one does at a conference or meeting) we were moving around every few hours connecting and disconnecting from the &#8216;net, and I was busy trying to do this from my laptop rather than a server somewhere. (Unfortunately <code>bzr-svn</code> relies on a memory fix that is not yet in the released version of Subversion, and not every distro has their Subversion patched with it). So that fell flat on its face.</p>

<p>I was able to restart the process a week or two later and leave it running overnight. Along the way I&#8217;d learned a technique for doing a few hundred revisions at a time (do <code>bzr pull -r &#036;i</code> in a loop and increment the variable by a hundred or whatever each cycle) and so was able to cope with the need to disconnect periodically. Which is well, because it took <strong>2 days</strong> to do the import.</p>

<p>While I was at first appalled by this, I really can&#8217;t blame Bazaar. The GTK codebase is, of course, rather large. First preserved commits were in 1997; there are over 15,000 revisions; a working tree (excluding VCS metadata) is 83 MB in size. The bigger problem however, is that Subversion is <em>not</em> fast at accessing historical data (the time taken to process revisions started at over 32 minutes per 100 but eventually dropped to about 9 minutes per 100 as it got to the most recent history; interesting).</p>

<p>Clearly, I could have picked an easier example for my experiments with <code>bzr-svn</code>, but it&#8217;s done now.</p>

<h2>Usage is fine once branch created</h2>

<p>I wasn&#8217;t entirely sure whether the DVCS property that branches are all peers would apply to one that had started life backed by a Subversion repository would hold, but things work just as they are supposed to. Creating a new branch to work on a feature with <code>bzr branch</code>, or use the technique of using a <code>bzr checkout</code> along with <code>bzr switch</code> to do change-in-place, both worked fine. So I&#8217;m all set.</p>

<p>The real point, though, was to encourage more GNOME hackers to give Bazaar a try. If everyone had to put up with a endless import process like mentioned above then no one would touch it. But now that the branch is created (and up to date as of yesterday or so), anyone can use it.</p>

<p>With Olav&#8217;s concurrence, I put my branch on in my GNOME directory, so you can branch from it as follows:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr init-repo --rich-root-pack gtk+
$ cd gtk+/
$ bzr branch http://www.gnome.org/~afcowie/bzr/gtk+/trunk/
</pre>

<p>You do the first step so that you can create a &#8220;shared repository&#8221; (in Bazaar parlance) which will allow that various branches under that directory will share all the revision data for the project. I need to warn you, though. Modern DVCS tools give you the full history of the project, but for a large project that can be pretty big. If you grab the above branch you&#8217;ll be downloading about 180 MB and it takes about 5 minutes. <em>Yes</em> 5 minutes is a long time, but <em>no</em> there&#8217;s no way around it* and in any case 180 MB is not unreasonable for such a mature project. Don&#8217;t be too worried if it seems like it is taking a bit to do the transfer. You only need to do it once, and look on the bright side. It took me 2 days. Just let it run.</p>

<h2>Workin&#8217;</h2>

<p>Personally, I always do my work in a working branch separate from my mirror of upstream, allowing me to easily compare against the last update of upstream that I have done. So:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr branch trunk working
$ cd working/
$ ./autogen.sh
$ make
</pre>

<p>and away we go. Branching takes like 3 seconds. Nice and fast, no problem.</p>

<p>I haven&#8217;t got a script running religiously updating my GTK branch; I do a <code>bzr pull</code> locally once every few days in my copy of <code>'trunk'</code> and have been pushing that up to <code>http://www.gnome.org/~afcowie/gtk+/trunk/</code>. But now that you&#8217;ve got the branch, you don&#8217;t have to rely on me anymore; this whole distributed thing kicks in and you can do it yourself. Assuming you have a <code>svn.gnome.org</code> account, then you can update with:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ cd ../trunk/
$ bzr pull --remember svn+ssh://username@svn.gnome.org/svn/gtk+/trunk
</pre>

<p>(use the <code>--remember</code> argument the first time to change where it updates from by default so you&#8217;re not relying on my branch anymore) and push with:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr push svn+ssh://username@svn.gnome.org/svn/gtk+/trunk
</pre>

<p>The very first time you update from Subversion <code>bzr-svn</code> will have to build some caches and whatnot locally, but it&#8217;ll be pretty fast from there on.</p>

<p>I&#8217;m ignoring the pushing and pulling of revisions between your mirror of &#8216;<code>trunk</code>&#8217; and your local <code>'working'</code> (or whatever) branch; I&#8217;m sure you can figure that part out yourself: but here&#8217;s a hint: do your work, test it, and commit it, all in <code>'working'</code>; repeat; then use, say:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr diff -r ancestor:../trunk/
</pre>

<p>to consider what your current patch looks like, then shuttle it to <code>'trunk'</code> with <code>bzr pull</code> or <code>bzr merge</code> (assuming you run it from <code>'trunk</code>&#8217; and whether you need to merge or not) and then <code>bzr push</code> to <code>svn.gnome.org</code>. Hope it works for you.</p>

<p>If you need help, poke your head into <code>#bzr</code> on FreeNode or write to their mailing list, or ping me and I&#8217;ll try and lend a hand. Make sure you&#8217;re using the latest releases; I doubt it will work otherwise and so recommend that you use <code>bzr &gt;= 1.4.0</code> and <code>bzr-svn &gt;= 0.4.10</code>. Older versions do not contain critical bug fixes. I also encourage you to grab <code>bzr-gtk &gt;= 0.93.0</code> as the <code>visualize</code> command it adds:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr viz
</pre>

<p>is really amazing.</p>

<p>Good luck!</p>

<p>AfC</p>

<p><strong>Update</strong>: <br/>
You need to have PycURL installed (it&#8217;s an optional dependency; used at runtime if detected). There is a <a href="https://bugs.launchpad.net/bugs/229076">bug</a> that will prevent you doing the branch from me if you don&#8217;t. Debian and Ubuntu package <code>python-pycurl</code>; Gentoo <code>USE=curl</code> pulls in package <code>dev-python/pycurl</code>; Fedora package is also <code>python-pycurl</code>.</p>

<div style="font-size: small">
* Interestingly, the Bazaar hackers are working their way towards a &#8220;shallow branch&#8221; capability, which will be really cool; really, we <i>don&#8217;t</i> need 15,000 revisions of history just to tweak some project; we need the last 100 or so so we can branch from it, build, fix something, commit, and then submit the resultant revision upstream. Full history is wonderful and frequently useful, but this will be hand to help reduce the data transfer barrier to casual contribution in cases where bandwidth is at a premium.
</div>

<hr/>

<p><em>This very moment as the GNOME systems administration team is presently working through the consequences of the Debian SSH key vulnerability; they have for the moment very properly <a href="http://mail.gnome.org/archives/devel-announce-list/2008-May/msg00002.html">locked down</a> all access to the services provided to GNOME hackers, and that knocks out access to the Subversion server meaning people can&#8217;t work with their source code properly. If there was ever a clearer demonstration on the inadequacy of old 1st generation centralized version control systems, I cannot think of it.</em></p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/version-control</category>
      <pubDate>Thu, 15 May 2008 05:35:00 GMT</pubDate>
      <guid isPermaLink="false">bzr-branch-of-gtk</guid>
    </item>

    <item>
      <title>java-gnome 4.0.7 released!</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/java-gnome-4.0.7-release.html</link>
      <description><![CDATA[<p><a href="http://java-gnome.sourceforge.net/">
<center>
<img src="http://java-gnome.sourceforge.net/images/java-gnome_LargeLogo.png" border="0">
</center>
</a></p>

<p><em>This blog post is an extract of the release note from the</em> <code>NEWS</code> <em>file which you can read <a href="http://java-gnome.sourceforge.net/4.0/NEWS.html">online</a> &#8230; or in the
<a href="http://research.operationaldynamics.com/bzr/java-gnome/mainline/NEWS">sources</a>,
of course!</em></p>

<hr/>

<h1>java-gnome 4.0.7 (30 Apr 2008)</h1>

<p><em>Draw some.</em></p>

<p>In addition to the usual improvements to our coverage of the GNOME libraries, this
release introduces preliminary coverage of the Cairo Graphics drawing library,
along with the infrastructure to make it work within a GTK program.</p>

<h2>Drawing with Cairo</h2>

<p><img src="http://java-gnome.sourceforge.net/4.0/doc/examples/cairo/ExampleCairoDrawingBlends.png" alt="Example"/></p>

<p>The trusty Cairo context, traditionally declared as a variable named <code>cr</code> in
code, is mapped as class
<a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/freedesktop/cairo/Context.html"><code>Context</code></a>. Various Cairo types
such as different surfaces and patterns are mapped as an abstract base class
(<code>Surface</code>, <code>Pattern</code>) along with various concrete subclasses (<code>ImageSurface</code>,
<code>XlibSurface</code>, and <code>SolidPattern</code>, <code>RadialPattern</code>, etc). Error checking is
implicit: the library status is checked internally after each operation and an
Exception thrown if there is a failure.</p>

<p>Thanks in particular to Carl Worth for having reviewed our API and having
helped test our implementation.</p>

<h2>New coverage and continuing improvement</h2>

<p>The single option choice buttons in GTK are called <code>RadioButton</code>s and have now
been exposed. When using them you need to indicate the other buttons they are
sharing a mutually exclusive relationship with, and this is expressed by
adding them to a <code>RadioButtonGroup</code>.</p>

<p><img src="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/RadioButton.png" alt="RadioButton" title=""/></p>

<p>The usual steady refinements to our coverage of the GtkTreeView API continue.
There&#8217;s a new <code>DataColumn</code> type for Stock icons, and <code>TreeModelSort</code> is now
implemented, along with minor changes to various other miscellaneous classes.</p>

<p>Considerable internal optimizations have been done, especially relating to
ensuring proper memory management, with notable refinements to make use  of
&#8220;caller owns return&#8221; information available in the <code>.defs</code> data. This fixes a
number of bugs. Thanks to Vreixo Formoso for having driven these improvements.</p>

<p>Error handling has been improved for GLib based libraries as well. If an
<code>ERROR</code> or <code>CRITICAL</code> is emitted, our internals will trap this and throw an
exception instead, allowing the developer to see a Java stack trace leading
them to the point in their code where they caused the problem.</p>

<h2>Internationalization support</h2>

<p>java-gnome now has full support for the GNOME translation and localization
infrastructure, including the standard <code>_("Hello")</code> idiom for marking strings
for extraction and translation, but combined with some of the powerful support for positional parameters available from Java&#8217;s <code>MessageFormat</code> as well. There&#8217;s a fairly detailed explanation in the
<a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/freedesktop/bindings/Internationalization.html"><code>Internationalization</code></a>
utility class.</p>

<h2>Build changes</h2>

<p>Note that as was advertised as forthcoming some time ago, Java 1.5 is now the
minimum language level required of your tool chain and Java virtual machine in
order to build and use the java-gnome library.</p>

<p>Thanks to Colin Walters, Manu Mahajan, Thomas Girard, Rob Taylor, and Serkan
Kaba for contributing improvements allowing the library to build in more
environments and for their work on packages for their distributions.</p>

<p>The <a href="http://java-gnome.sourceforge.net/4.0/get/">download</a> page has updated instructions for getting either binary
packages or checking out the source code.</p>

<h2>Documentation, examples, and testing</h2>

<p>Refinements to the API documentation continue across the board, notably
improving consistency. A large number of javadoc warnings have also been
cleaned up.</p>

<p>While not a full blown tutorial, the number of fully explained examples is
growing. There are examples for box packing and signal connection, presenting
tabular data, and basic drawing, among others. See the description page in the
<a href="http://java-gnome.sourceforge.net/4.0/doc/examples/START.html"><code>doc/examples/</code></a> section.</p>

<p>This code, together with the not inconsiderable number of unit tests and the
code for generating snapshots of <code>Widget</code>s and <code>Window</code>s means that a large
portion of the public API is tested within the library itself. The number of
non-trivial applications making use of java-gnome is starting to grow, which
are likewise providing for ongoing validation of the codebase.</p>

<h2>Summary</h2>

<p>You can see the full changes accompanying a release by grabbing a copy of the
sources and running:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr diff -r tag:v4.0.6..tag:v4.0.7
</pre>

<h2>Looking ahead</h2>

<p>It&#8217;s probably unwise to predict what will be in future releases. The challenge
for anyone contributing is that they need to understand <em>what</em> something does,
<em>when</em> to use it (and more to the point, when not to!), and be able to
<em>explain</em> it to others. This needs neither prior experience developing with
GNOME or guru level Java knowledge, but a certain willingness to dig into
details <em>is</em> necessary.</p>

<p>That said, I imagine we&#8217;ll likely see further Cairo improvements as people
start to use it in anger. It shouldn&#8217;t take too long until the bulk of the
functionality needed for most uses is present in java-gnome. In particular,
forthcoming coverage of the Pango text drawing library will round things out
nicely.</p>

<p>There are a number of other major feature improvements we&#8217;d like to see in
java-gnome. Conceptual and design work is ongoing on for bindings of GConf,
GStreamer, and even support for applets. Within GTK, there have been a number
of requests made for various things to be exposed, for example, the powerful
GtkTextView / GtkTextBuffer text display and editing capability. Some of these
have preliminary implementations; whether or not any given piece of work is
acceptable in time for any particular future release will remain to be seen
and depends on the willingness of clients to fund us to review and test such
work.</p>

<p>In the mean time, people are happily <em>using</em> the library to develop rich user
interfaces, which is, of course, the whole point. We&#8217;re always pleased to
welcome new faces to the community around the project. If you want to learn
more, stop by <code>#java-gnome</code> and say hello!</p>

<hr/>

<p><em>You can download java-gnome from</em> <a href="http://ftp.gnome.org/pub/GNOME/sources/java-gnome/4.0/"><code>ftp.gnome.org</code></a> <em>or easily checkout a branch from</em> &#8216;<code>mainline</code>&#8217; <em>using Bazaar:</em></p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr clone bzr://research.operationaldynamics.com/bzr/java-gnome/mainline java-gnome
</pre>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/java-gnome</category>
      <pubDate>Mon, 05 May 2008 08:19:00 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.7-release</guid>
    </item>

    <item>
      <title>Sun&#8217;s secret web server</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/free-java/sun-secret-webserver.html</link>
      <description><![CDATA[<p>For a while now I&#8217;d been looking for something to just run up an HTTP server to answer simple queries. </p>

<p>The Java Servlet APIs are comprehensive, and there are a number of very good implementations (we use <a href="http://www.caucho.com/">Resin</a> in highly loaded environments and it scales like a dream; we recommend it heartily to our clients). Nevertheless, sometimes you&#8217;re working on something small or ad-hoc, and you just want a simple web server that doesn&#8217;t involve application descriptors, XML, configuring an entire service instance, and everything else. Somewhat to everyone&#8217;s long standing annoyance (not to mention the derision of people who work in other languages), there is nothing in the Java standard library to just get on with this.</p>

<p>In their release of Java 1.6, however, Sun quietly included such a server. Apparently it had been around for some time powering internals of various other projects, but in 1.6 they exposed it as a public library, in package <code>com.sun.net.httpserver</code>, and it ships alongside the rest of their Java VM and standard library.</p>

<p>It&#8217;s got a rather nice API. You fire up a server and add one or more handlers:</p>

<pre><code>        addr  = new InetSocketAddress("localhost", 8000);
        server = HttpServer.create(addr, 10);
        server.createContext("/eg", new ExampleHandler());
        server.start();
</code></pre>

<p>the &#8220;contexts&#8221; are paths from root that are handled by different <code>HttpHandler</code> instances; implementing that interface is simply:</p>

<pre><code>    public void handle(HttpExchange t) throws IOException {
        ...
    }
</code></pre>

<p>Once there, you&#8217;ve got a number of really straight forward methods on <code>HttpHandler</code> to get done what needs doing:</p>

<pre><code>        t.getProtocol();
        t.getRequestMethod();
        t.getRequestURI();
        t.getRequestHeaders();
        t.sendResponseHeaders(code, length);
</code></pre>

<p>for the metadata, and an <code>InputStream</code> and an <code>OutputStream</code> from:</p>

<pre><code>        t.getRequestBody();            
        t.getResponseBody();
</code></pre>

<p>respectively. You write the response to the later. Too easy. I did up a modified version of the example they have in the package description file as something that echos back the HTTP request as the response and it was quite straight forward. Java programmers can glance at <a href="/files/andrew/EchoServer.html"><code>EchoServer.java</code></a> if they&#8217;re interested.</p>

<h2>The catch</h2>

<p>Nothing is ever simple. The bytecode for the <code>com.sun.net.httpserver</code> package is bundled in with the <code>rt.jar</code> that comprises the bulk of the standard library, but for whatever reason they didn&#8217;t include the JavaDoc for these classes in the same tree as the rest of the API documentation.&#185; This is a <em>huge</em> pain, because once you&#8217;ve told Eclipse where to look for the docs for a given blob (in this case, for <code>rt.jar</code>) you can&#8217;t then tell it to look somewhere else for a sub part. And if you&#8217;re trying to develop something in a beautiful IDE like Eclipse, the idea of not having inline popup documentation and completion working properly is just a non-starter.</p>

<p>You can point Eclipse at either a JavaDoc tree, or at the raw sources and it&#8217;ll just extract the documentation on the fly. But since the <code>src.zip</code> shipping with Sun&#8217;s proprietary Java 1.6 didn&#8217;t include the classes for this web server code, that didn&#8217;t work either.</p>

<p>So that would have been the writing on the wall for Sun&#8217;s <code>httpserver</code>.</p>

<h2>Open Java to the rescue</h2>

<p>After chatting with some people in <code>#gentoo-java</code> and <code>#classpath</code>, we suddenly realized that the solution was at hand. Source code to Open Java <em>is</em> available.&#178; And even though it&#8217;s <em>still</em> not yet a fully Libre replacement for Sun&#8217;s proprietary Java 1.6 (the size of the binary proprietary plugs you have to drop into it to make it work is staggering), it does contain most of the sources to the Java standard library. So we grabbed a copy of the <code>openjdk 1.6 b08</code> code drop, and just pointed Eclipse at it as the sources for <code>rt.jar</code> for cases where it couldn&#8217;t find the JavaDoc when it was looking something up. And ta-da!</p>

<p>So, amidst considerable astonishment but great pleasure, here was an example of something someone had Open Sourced working in a synergistic way but in a way that they hadn&#8217;t quite expected.  This wouldn&#8217;t have worked if Sun hadn&#8217;t Open Sourced (most of) Java; but because they have we were able to use those sources to solve a problem. Thanks to the heroes at Sun Microsystems who made this possible!</p>

<p>Eclipse users will have to adjust their filters so that <code>com.sun.*</code> <em>isn&#8217;t</em> excluded from Type completions and what not; While we&#8217;ve all loved our <code>com.sun.*</code> excludes, it blots out <code>com.sun.net.httpserver</code>. If you plan on using it, then I suggest switching to excluding <code>com.sun.org.*</code> and <code>com.sun.xml.*</code>, etc. A pain, but that&#8217;s what we get for Sun not having put this into the standard library.</p>

<p>Speaking of which, I doubt we&#8217;ll ever see this as a part of the &#8220;Java&#8221; (wouldn&#8217;t <code>java.net.httpserver</code> just do the trick?) because the marketing side of Sun has a fairly strong fixation on &#8220;Servlets are what you use for everything&#8221;. Oh well. It would be a really pleasant surprise, though. Here&#8217;s hoping.</p>

<h2>But not really</h2>

<p>We would never use this in something we were distributing to anyone outside; after all, they might be using some other VM and <code>com.sun.net.httpserver</code> isn&#8217;t available as a standalone library. And that&#8217;s not to mention scalability; if you need something bulletproof then use the Resin servlet runner. But if you need a quick-and-dirty but easy-to-use HTTP server and you happen to have Sun Java or the future tense Open Java available, then this should do the trick for you. And if you&#8217;re feeling like whipping up something of your own, this really does have a nice API (somewhat a rarity in the Java landscape) and so this might be a good starting point for you. Either way, have a look.</p>

<p>AfC</p>

<p>&#185; As mentioned, the API docs for <code>com.net.sun.httpserver</code> are <em>not</em> in the usual location at <a href="http://java.sun.com/javase/6/docs/api/overview-summary.html"><code>docs/api/</code></a> along with the rest of the standard library but at <a href="http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/overview-summary.html"><code>docs/jre/api/net/httpserver/spec/</code></a> of all places. Who knows what they were smoking that day.</p>

<p>&#178; I am very tired of apologizing to people who have just installed &#8220;Java&#8221; on their Linux boxes that they have to download something else. I&#8217;ve given up trying to explain the difference between a JRE and a JDK to people; even after I do people respond with <em>&#8220;who cares; I just want a working Java that I can use to build your software.&#8221;</em> Sun having attempted to brand their Libre implementation of Java as &#8220;Open JDK&#8221; just perpetuates this nonsense. Not including the compiler classes in something that is already 18 MB big is stupid, and it&#8217;s not like the desktop VM is what you use on a resource limited embedded device. Open Java works just fine as a name, thank you very much, and it is (almost) a Free Java. Almost.</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/free-java</category>
      <pubDate>Thu, 10 Apr 2008 14:27:00 GMT</pubDate>
      <guid isPermaLink="false">sun-secret-webserver</guid>
    </item>

    <item>
      <title>Cairo drawing from java-gnome</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/cairo-drawing.html</link>
      <description><![CDATA[<p>We&#8217;ve added support for the amazing <a href="http://www.cairographics.org/">Cairo Graphics</a> library to the <a href="http://java-gnome.sourceforge.net/4.0/objectives.php">Java bindings for GTK and GNOME</a>.</p>

<p>Adding Cairo is a feature we&#8217;ve been working on for about 6 months now, and so I&#8217;m pretty pleased that during the 4.0.7 development cycle we&#8217;ve been able to land it. Cairo is a huge library, of course, but we&#8217;ve put enough coverage in place to ensure that things are working.</p>

<p>Cairo has lots of convenience functions and tons of obscure uses; no surprise (and no apology) that there&#8217;s still lots that will need doing. If you want to help make sure it has what you need, then
grab &#8216;<code>mainline</code>&#8217; and see <code>org.freedesktop.cairo.</code><a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/freedesktop/cairo/Context.html"><code>Context</code></a> and <a href="http://java-gnome.sourceforge.net/4.0/doc/examples/cairo/ExampleDrawingInExposeEvent.html"><code>ExampleCairoDrawingInExposeEvent</code></a>.</p>

<p>Huge thanks go out to Behdad Esfahbod and Carl Worth; Behdad was really critical in explaining some basic Cairo concepts to get me started when we were working together at the GNOME Summit back in October in Boston, and at the GTK hackfest in Berlin in March, Carl Worth checked our preliminary APIs and helped sort me out as we were working our way through to create some examples. Awesome!</p>

<p><img src="/blogs/andrew/software/java-gnome/ExampleCairoDrawingBlends.png" alt="example" title=""/></p>

<p>java-gnome 4.0.7 should be out in the next week or two, depending on how long it takes to finish up testing, QA, and to do the release engineering.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/java-gnome</category>
      <pubDate>Sat, 05 Apr 2008 23:58:00 GMT</pubDate>
      <guid isPermaLink="false">cairo-drawing</guid>
    </item>

    <item>
      <title>Upgraded!</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/gentoo-linux/gnome-2.22-upgrade.html</link>
      <description><![CDATA[<p><center></p>

<table>
<tr>
<td style="text-align: center;">
<a href="http://www.gnome.org/"><img alt="GNOME logo" src="http://research.operationaldynamics.com/blogs/andrew/software/gnome-desktop/GNOME.png" width="140" height="149" border="0"/></a>
</td>
<td>&nbsp;</td>
<td style="text-align: center;">
<a href="http://www.gentoo.org/"><img alt="Gentoo logo" src="http://upload.wikimedia.org/wikipedia/en/a/a0/Glogo-small.png" width="140" height="149" border="0"/></a>
</td>
</tr>
<tr>
<td style="text-align: center; font-size: x-large; font-family: 'Bitstream Vera Sans Mono', monospaced;">
#gnome-hackers
</td>
<td style="width: 30px;">&nbsp;</td>
<td style="text-align: center; font-size: x-large; font-family: 'Bitstream Vera Sans Mono', monospaced;">
#gentoo-desktop
</td>
</table>

<p></center></p>

<p>The upgrade to GNOME 2.22 went <em>really</em> smoothly. Well done to the Gentoo Linux desktop team for their heroic efforts bumping so many <code>.ebuilds</code>, and congratulations to all the GNOME hackers, testers and translators around the world on what continues to be superb software!</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/gentoo-linux</category>
      <pubDate>Fri, 04 Apr 2008 11:12:00 GMT</pubDate>
      <guid isPermaLink="false">gnome-2.22-upgrade</guid>
    </item>

    <item>
      <title>Get Some</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/research/drepper-on-memory.html</link>
      <description><![CDATA[<p>The other day I was wading through Ulrich Drepper&#8217;s <a href="http://people.redhat.com/drepper/cpumemory.pdf">paper</a> about how memory works these days and what programmers should do as a result.</p>

<p>My wife asked me what I was reading. I showed her the title and when she saw it concerned computer memory, she looked at me with a totally straight face and summed up the 114 page paper by answering &#8220;Yes, you should get some&#8221;.</p>

<p><em>Like most of Ulrich&#8217;s writing, this paper is immense: long on detail and well presented. I must admit that I agreed with many others that after having read the work I was left wondering what action, in practical terms, I should be taking as a result. Clearly most of this knowledge is very important for Kernel hackers and for those doing low level systems programming, but since I do higher level work (ie advising people with large enterprise systems), it is hard to asses the choices I might be making in the terms of what Ulrich describes. I can only hope that the people who work on the parts of the low level libraries that run next to the metal (such as drivers, GLib, and especially the VMs like the Java and Python runtimes) are aware of these issues and making design choices based on these insights.</em></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/research</category>
      <pubDate>Mon, 25 Feb 2008 23:39:00 GMT</pubDate>
      <guid isPermaLink="false">drepper-on-memory</guid>
    </item>

    <item>
      <title>java-gnome 4.0.6 released!</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/java-gnome-4.0.6-release.html</link>
      <description><![CDATA[<p><a href="http://java-gnome.sourceforge.net/">
<center>
<img src="http://java-gnome.sourceforge.net/images/java-gnome_LargeLogo.png" border="0">
</center>
</a></p>

<p><em>This blog post is the release note from the</em> <code>NEWS</code> <em>file which you can read
<a href="http://java-gnome.sourceforge.net/4.0/NEWS.html">online</a> &#8230; or in the
<a href="http://research.operationaldynamics.com/bzr/java-gnome/mainline/NEWS">sources</a>,
of course!</em></p>

<hr/>

<h1>java-gnome 4.0.6 (12 Feb 2008)</h1>

<p><em>Finding the missing methods.</em></p>

<p>Most of our effort recently has simply been fleshing out areas of the
public API. The focus for this work as been getting the coverage needed to
allow us to port some of our in-house applications to java-gnome 4.0. It&#8217;s not
especially glamorous &#8212; if anything it has been tedious as hell &#8212; but the
result has been a large body of improvements to java-gnome as a whole which
we&#8217;re pleased to release as java-gnome 4.0.6</p>

<p>The bulk of this development took place on the &#8216;<code>missing</code>&#8217; branch, so named
because that&#8217;s where I was working on what was missing <code>:)</code>.</p>

<h2>Continuing Improvement</h2>

<p>Notable public changes include coverage additions to enable key stroke and
mouse button handling</p>

<p>Rather than exposing the <code>int</code> keyvals that bubble up out of the X server, we
have wrapped these as  constants of type
<a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gdk/Keyval.html">Keyval</a> (thereby being consistent with the
rest of java-gnome in our working to the strengths of Java as a strongly-typed
language; MouseButton was created for the same reason, helping developers
understand just what on earth mouse button
&#8220;<a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gdk/MouseButton#LEFT">1</a>&#8221; is, anyway). Along with
<a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gdk/ModifierType.html">ModifierType</a>, this gives enough to
deal with the <code>KEY_PRESS_EVENT</code> and <code>KEY_RELEASE_EVENT</code> signals when the
developer wishes to deal with key strokes.</p>

<p>We&#8217;ve finally gotten around to providing proper coverage of the box packing
model which underlies every aspect of how GTK presents user interfaces. To
understand the size-request/size-allocation process, you might start with
Widget&#8217;s
<a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Widget.html#setSizeRequest(int,%20int)"><code>setSizeRequest()</code></a>.</p>

<p>We&#8217;ve also added coverage for SizeGroup, which, when used in concert with
nested VBoxes and HBoxes, can work wonderful magic and is often far better
than messing around with Table when doing complex layouts.</p>

<p>After dithering for several releases, we&#8217;ve settled on how we&#8217;re going to deal
with <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/ComboBox.html">ComboBox</a> and family. The underlying GtkComboBox presents something of a
nightmare as it is really two classes in one with more-or-less incompatible
APIs. So, not surprisingly, we&#8217;ve presented it as two sets of classes, with the
text-only convenience API spliced out of ComboBox and ComboBoxEntry into
TextComboBox and TextComboBoxEntry respectively.</p>

<p>We&#8217;ve added a few new features in our coverage of GTK&#8217;s <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/TreeView.html">TreeView</a> / <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/TreeModel.html">TreeModel</a> API, and many
other classes involved have also seen improvements. The persistent reference to
a row provided by TreeRowReference is now available as is model type
TreeModelFilter.</p>

<p>Support for the actual filtering in <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/TreeModelFilter.html">TreeModelFilter</a> is notable for having been
quite tricky. The underlying C library use a function pointers rather than a
GObject signal emission, and we don&#8217;t have any mechanism to handle that. We
<em>do</em>, however, have a fantastic capability to marshal signals, so we dealt with
the problem by creating a custom signal and then passing a function which emits
it when the TreeModelFilter wants to ask the developer whether to include a row
or not.</p>

<p>The new classes include support for TreeModel columns storing <code>long</code> data as
well as setting properties of that type.</p>

<p>It should also be noted that most of the methods taking a TreeViewColumn have
been converted to taking an argument of type CellLayout (an interface
implemented by TreeViewColumn). This has no change to how you use our TreeView
API, but was necessary to support ComboBox properly.</p>

<p>Finally lots and lots of minor additions to both public APIs and internals
deeper down in the GDK part of the toolkit.</p>

<p>As ever, you can see the full changes accompanying a release by
grabbing a copy of the sources and running:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr diff -r tag:v4.0.5..tag:v4.0.6
</pre>

<h2>Documentation</h2>

<p>We&#8217;ve always had HTML JavaDoc for the current stable release at
<a href="http://java-gnome.sourceforge.net/4.0/doc/api/overview-summary.html"><code>doc/api/</code></a> on the java-gnome website.
We&#8217;re going to change that a bit, though. As fixes to the explanatory
documentation happen quite frequently to classes and methods all over the
place, we&#8217;ve decided to generate the JavaDoc from &#8216;<code>mainline</code>&#8217; periodically and
upload that instead. This means that there will, of course, be descriptions of
some methods which aren&#8217;t yet available in a released version of the library,
but they will clearly identifiable by virtue of having a <code>@since</code> tag showing
a version number greater than the most recent release. We&#8217;ll revert back to
more traditional behaviour once we hit 4.2.0, but in the mean time we can give
people access to the best information we can online.</p>

<p>The idea of having up-to-date illustrations of the various Widgets has proved
popular, and we&#8217;ve continued to update the suite of snapshots. Doing that 
is <em>also</em> tedious, but it does provide a good opportunity to test APIs we are
exposing especially where unit tests are less suitable.</p>

<p><img src="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Statusbar.png" alt="Statusbar" title=""/></p>

<h2>Looking ahead</h2>

<p>Almost as complex as the TreeView / TreeModel API are GTK&#8217;s powerful
TextView / TextModel classes, collectively a Widget used to display and edit
large text documents. Working out the java-gnome coverage for TextView will
take a fair bit of consideration, but TreeView provides a road map, and, as
with the coverage in 4.0.5 and 4.0.6 (which was driven largely by existing
applications we were porting), we have some significant uses of GtkTextView
which will guide us on our way.</p>

<p>The next release will also feature significant work outside of GTK; we should
be in a position to merge our coverage of the excellent Cairo drawing library
soon, and likewise we have tentative work in place letting people store
configuration and settings data in GConf. Both the &#8216;<code>cairo</code>&#8217; and &#8216;<code>gconf</code>&#8217;
branches need more QA and documentation work, but they&#8217;re looking good and will
definitely be featured in java-gnome 4.0.7.</p>

<hr/>

<p><em>You can download java-gnome from</em> <a href="http://ftp.gnome.org/pub/GNOME/sources/java-gnome/4.0/"><code>ftp.gnome.org</code></a> <em>or easily checkout a branch from</em> &#8216;<code>mainline</code>&#8217; <em>using Bazaar:</em></p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr clone bzr://research.operationaldynamics.com/bzr/java-gnome/mainline java-gnome
</pre>

<p><em>Well, now that I have this out of the way, I can finally stop worrying about having so much unreleased code and get back to the business of doing what I do for a living.</em></p>

<hr/>

<p><a href="http://www.operationaldynamics.com/">
<center>
<img src="http://www.operationaldynamics.com/images/logo/logo-60x76.jpg" border="0">
<img src="http://research.operationaldynamics.com/images/andrew_Hackergotchi.png" border="0">
</center>
</a></p>

<p>On a personal note, I mentioned that much of this coverage was driven by one of our legacy apps. About half way though this cycle, however, we decided we would be abandoning that program. Needless to say, it was more than slightly depressing to be putting so much work into writing new coverage for java-gnome in order to port such a large codebase in the certain knowledge that the application was not  going to be resurrected after all, <em>especially</em> as we have not yet managed to raise any revenue to offset our costs in taking on the Java bindings for GNOME.</p>

<p><strong>Cognitive Dissonance.</strong></p>

<p>Nevertheless, I kept at it largely because getting that app to run again represented a good test of the quality and comprehensiveness of the Java bindings. It needed doing, and that has ultimately been the motivation behind all our work re-engineering java-gnome. I gotta say it <em>was</em> wonderful seeing that program come back to life bit by bit as the errors slowly fell away as missing classes and methods were added to the library. That monster running again after almost two years represents the <code>4.0</code> version of java-gnome having surpassed the level of coverage that we used from the old <code>2.</code><em>x</em> version, and that&#8217;s something to be very positive about indeed.</p>

<p>Of course, now all I have to do is to continue to resist the temptation to go back to working on that beast. <code>:)</code> No, better things to be about.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/java-gnome</category>
      <pubDate>Tue, 12 Feb 2008 12:54:00 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.6-release</guid>
    </item>

    <item>
      <title>The arcane secrets of hash-bang</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/build-systems/hash-bang.html</link>
      <description><![CDATA[<p>I&#8217;ve been working for a while now prototyping various different domain specific approaches to modelling software configuration information. Most of these involve putting the configuration data in the body of an executable script. To that end, I&#8217;ve been digging in to how interpreted scripts actually work on Linux and other Unix-like operating systems work.</p>

<h2><code>#!</code> interpreter</h2>

<p>Anyone who has ever written a Shell script, Perl program, or Python program is familiar with <code>#!</code> lines:</p>

<pre><code>    #! /bin/sh
    #
    # A program to do something very special.
    #

    echo "Hello World"
</code></pre>

<p>and</p>

<pre><code>    #! /usr/bin/perl
    #
    # Another program to do something very special.
    #

    while (&lt;&gt;) {
        print "Hello World\n";
    }
</code></pre>

<p>etc. The program mentioned after the magic <code>#!</code> characters is the program that will interpret the script. There are <em>many</em> gotchas with that (notably portability concerns owing to the fact that some idiotic flavours of Unix don&#8217;t put Perl in <code>/usr/bin</code>, that sort of thing)</p>

<p>I always figured that the script file got piped by the OS into the interpreter on <code>stdin</code>. A reasonable guess given the way that most of the tools we use work, but it turns out it is nothing of the sort. Every time I tried to write an interpreter (in C) I got stuck.</p>

<p>What threw me off was that <code>cat</code> works as an &#8220;interpreter&#8221;:</p>

<pre><code>    #! /bin/cat
    This is the script body
    which will happily be sent
    to stdout
</code></pre>

<p>If you put that in a file called <code>script</code> and run that from your terminal, then sure enough,</p>

<pre style="background: black; color: white; padding-left: 15px; padding-top: 10px; padding-bottom: 10px; width: 60%; min-width: 400px;" ><code>$ ./script
#! /bin/cat
This is the script body
which will happily be sent
to stdout
$
</code></pre>

<p>which of course is exactly what would happen if you did:</p>

<pre style="background: black; color: white; padding-left: 15px; padding-top: 10px; padding-bottom: 10px; width: 60%; min-width: 400px;" ><code>$ cat < script
#! /bin/cat
This is the script body
which will happily be sent
to stdout
$
</code></pre>

<p>and that&#8217;s what totally had me on the wrong track. I figured that the interpreter on the <code>#!</code> line was being fed the body of the executing file on <code>stdin</code>. Nope.</p>

<h2>Seek and ye shall find, sort of</h2>

<p>I thought that I might be able to find out what was going on by reading the code of an interpreter program. I started by looking at the sources for <code>/sbin/runscript</code> (which is on the <code>#!</code> line for all of Gentoo Linux&#8217;s RC scripts), expecting that to be quite simple. It was simple. Too simple. All it does is some environment filtering and then fires off <code>bash</code> to run <code>/sbin/runscript.sh</code> (in other words, it&#8217;s largely a workaround for the fact that you can&#8217;t actually make a shell script itself an interpreter). Nothing at all in there about reading <code>stdin</code>. So then I looked at the source code for Perl (Whoa, there&#8217;s a beast). Nothing obvious there either. Lots of stuff about reading from <code>stdin</code> but nothing about that being the origin of the script to be executed. A lot of messing around with argument signatures though.</p>

<p><code>#!</code> is not exactly the easiest term to put into a search engine. I did, however, happen to know that one of the ways <code>#!</code> is pronounced is &#8220;<strong>hash bang</strong>&#8221; (being two common names for the respective characters, though lots of old suspender-snapping sandal-wearing bearded Unix freaks would, I&#8217;m sure, tell you with great passion that it has to be  pronounced some other way). Searching on &#8220;hash bang&#8221; brought up lots of arcana, including something that lead me to an obscure article by one Andries Brouwer on the <a href="http://homepages.cwi.nl/~aeb/std/hashexclam-1.html#ss1.3">parameter signature at invocation</a> wherein I discovered that there is a <em>calling convention</em> for how arguments are passed to the interpreter program being invoked.</p>

<p>It&#8217;s a bit complicated, since you can have command line arguments for both the interpreter and for the script being run. It goes something like this. Let&#8217;s say you have an script that begins with the following:</p>

<pre><code>    #! /path/to/program -v -d
</code></pre>

<p>(with <code>-v</code> perhaps meaning &#8220;verbose&#8221; and <code>-d</code> perhaps meaning &#8220;debug&#8221;) and you have it in a file called <code>./script</code>, then running it will actually cause <code>program</code> to execute. The trick is, <em>with what arguments</em>? Check this out. If you do:</p>

<pre class="terminal"><code>$ ./script -p -r
</code></pre>

<p>(with <code>-r</code> and <code>-p</code>, for the sake of illustration, perhaps having the same meanings as <code>cp</code>, that is &#8220;preserve&#8221; and &#8220;recursive&#8221; respectively) then when our interpreter <code>program</code> is executed, it will be invoked with the following arguments:</p>

<pre><code>/path/to/program -v -d ./script -p -r
</code></pre>

<p>the mapping is a bit obscure. It&#8217;s actually:</p>

<table border="0" cellpadding="5">
<tr>
<td><i>argv0</i></td> <td><i>argi</i></td> <td><i>argn</i></td> <td><i>args&#8230;</i></td> <td></td>
</tr>
<tr>
<td><code>argv[0]</code></td> <td><code>argv[1]</code></td> <td><code>argv[2]</code></td> <td><code>argv[3]</code></td> <td><code>argv[4]</code></td>
</tr>
<tr>
<td><code>/path/to/program</code></td> <td><code>-v -d</code></td> <td><code>./script</code></td> <td><code>-p</code></td> <td><code>-r</code></td>
</tr>
</table>

<p>(to use the terminology in the above link). This all shed a little light on what I&#8217;d seen in <code>runscript.c</code> and <code>perl.c</code>, but still not a single mention of the script being fed in on <code>stdin</code>. So I pondered that for a while longer, until finally the light bulb went off.</p>

<h2>Eureaka &amp; Company</h2>

<p>The reason I couldn&#8217;t find any mention of <code>./script</code> being fed in on <code>stdin</code> is because is is <em>not</em> fed in on <code>stdin</code>. You don&#8217;t need it to be: <strong>you&#8217;ve got the name of the script file</strong> fed to you in your interpreter&#8217;s argument list (from the above example, it&#8217;s in <code>argv[2]</code>, one happy looking string containing &#8220;<code>./script</code>&#8221;). So read it already!</p>

<pre><code>    FILE* body;

    body = fopen(argv[2], "r");
    ...
</code></pre>

<p>and ta da, that&#8217;s where you get your script&#8217;s program body from. Now you can at last get on with parsing your script, and running it.</p>

<p>Most big programs spend lots of time munging the argument list, dealing with the fact that <code>argv[1]</code> could be full of all sorts of stuff jammed into, or nothing, etc. The whole thing goes from elegant to clumsy when you discover that if there are no arguments to the interpreter on the <code>#!</code> line then the script file will be in <code>argv[1]</code>, and it goes to nightmare level when you look at the list of <a href="http://www.in-ulm.de/~mascheck/various/shebang/">variations in behaviour across different operating systems</a>, compiled by one Sven Mascheck. Nonetheless, the interpreter is your program, and presumably you can recognize, parse, and skip over zero, one or more arguments to yourself before deciding you&#8217;ve reached the name of the script. Judicious use of  <code>argv++; argc--;</code> is your friend here, apparently.</p>

<p>Anyway, this all explains why my <code>cat</code> example was working but my own efforts were not. <code>cat</code> is <em>not</em> reading data being fed to it on <code>stdin</code> (which is <code>cat</code>&#8217;s behaviour if you run it <em>without</em> any arguments), it&#8217;s being executed <em>with</em> an argument, namely <code>./script</code> as <code>argv[1]</code>, ie exactly the same as:</p>

<pre style="background: black; color: white; padding-left: 15px; padding-top: 10px; padding-bottom: 10px; width: 60%; min-width: 400px;" ><code>$ cat ./script
#! /bin/cat
This is the script body
which will happily be sent
to stdout
$
</code></pre>

<p>But now that I know what&#8217;s going on, I can write my own <code>interpreter.c</code>:</p>

<pre><code>    #include &lt;stdio.h&gt;
    #define LEN 128

    int main(int argc, char** argv) {
        char buf[LEN];
        FILE* body;

        body = fopen(argv[1], "r");
        while (fgets(buf, LEN, body) != NULL) {
            printf("%s", buf);
        }
        fclose(body);

        return 0;
    }
</code></pre>

<p>and if I compile that to <code>interpreter</code>, then I can write a domain specific language that is interpreted by this program, say:</p>

<pre><code>    #! ./interpreter
    This is a test of the Emergency Broadcast System
</code></pre>

<p>in a file called <code>script</code>, then, at last,</p>

<pre style="background: black; color: white; padding-left: 15px; padding-top: 10px; padding-bottom: 10px; width: 60%; min-width: 400px;" ><code>$ ./script
This is a test of the Emergency Broadcast System
$
</code></pre>

<p>Yeay!</p>

<p>Ok, so that&#8217;s <code>cat</code>, but <code>cat</code> is the Hello World of input/output. <code>:)</code> The real point is that running <code>script</code> caused <code>interpreter</code> to be executed, and <code>interpreter</code> got at the body of the script that was &#8220;run&#8221;, and was able to do something with it. Onwards at last.</p>

<p>AfC</p>

<hr/>

<p><strong>Comments</strong></p>

<p>Julio Merino Vidal wrote in suggesting:</p>

<blockquote>
  <p>Take a look at NetBSD&#8217;s <a href="http://netbsd.gw.com/cgi-bin/man-cgi?script+7+NetBSD-current"><code>script(7)</code></a> manual page for some more details <br/>
  about how that is supposed to work and some things you must consider <br/>
  for portability (such as being able to feed a single argument to the <br/>
  interpreter through the <code>#!</code> line, or the maximum length of it).</p>
</blockquote>

<p><strong>Updates</strong></p>

<p>Quite by accident, I just came across the related information for Linux; see the <a href="man:execve"><code>execve(2)</code></a> man page for
a succinct treatment of both <code>exec()</code>&#8216;ing in general, and the topic of interpreting scripts.</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/build-systems</category>
      <pubDate>Fri, 25 Jan 2008 11:40:00 GMT</pubDate>
      <guid isPermaLink="false">hash-bang</guid>
    </item>

    <item>
      <title>Free Range Software</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/freedom/free-range.html</link>
      <description><![CDATA[<p>Jon Hall <a href="http://www.linuxjournal.com/node/1006102">writes</a> of his experience in a restaurant talking with its owner about &#8220;Free Range Eggs&#8221;:</p>

<blockquote>
  <p>&#8220;&#8230; but we have to charge money for our eggs. People who don&#8217;t acknowledge that just do not want to understand the term &#8216;Free Range&#8217; for what it really means &#8230; better eggs, and changing the term will not help that.&#8221;</p>
</blockquote>

<p>The fact that the discussion started because of maddog&#8217;s suggestion that maybe they should be called &#8220;open range eggs&#8221; to eliminate the confusion is not the point (&#8220;that&#8217;s silly&#8221; the owner said, &#8220;everyone calls them free range eggs&#8221;). The term we use, Free Software, has a bigger problem. Consider the difference between:</p>

<ul>
<li>Free Range Eggs</li>
<li>Free Eggs</li>
</ul>

<p>Clearly, the term is &#8220;Free Range&#8221;, and applies as an adjective to &#8220;Eggs&#8221;, whereas the latter really does mean &#8220;free eggs&#8221;. Now consider this:</p>

<ul>
<li>Free Software</li>
</ul>

<p>There&#8217;s something missing, and so the term free gets connotated as having to do with price.</p>

<p>No, I&#8217;m not about to say that we should call it Free Range Software [and while &#8220;let it run free!&#8221; is a lovely metaphor, I don&#8217;t <em>quite</em> think we want to be associating our work with chicken farming <code>:)</code>]. Perhaps someone will come up with an intermediate word that will do the trick. To be honest, though I&#8217;ve pretty much given up on the term Free Software; I write Open Source software, and the cause I advocate is Software Freedom.</p>

<p>And when people <em>still</em> stare at you blankly, you can say <em>&#8220;you know, like Linux&#8221;</em> and watch as comprehension dawns. To be sure, they probably still don&#8217;t get it, but chances are you&#8217;ve got more important things to talk about, and getting on with it is going to do you &#8212; and logiciel libre &#8212; a lot more good than getting lost because of the insufficiencies of the English language.</p>

<p>AfC</p>

<p><em>Thanks to <a href="http://atulchitnis.net/">Atul Chitnis</a> for having passed on the link.</em></p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/freedom</category>
      <pubDate>Thu, 24 Jan 2008 13:17:00 GMT</pubDate>
      <guid isPermaLink="false">free-range</guid>
    </item>

    <item>
      <title>Reusing Experience</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/freedom/reusing-experience.html</link>
      <description><![CDATA[<p>I came across an interesting comment yesterday:</p>

<blockquote>
  <p>The documentation doesn&#8217;t help you much though. First, it is not sufficient and second (and important) you do not learn much from the documentation.</p>
  
  <p>Thankfully, you have the source code and I really appreciate the source code of Eclipse is open. That&#8217;s because only from source you can learn as much as necessary. And this fact leads me to think more and more that open source is not about <strong>&#8220;reusing software&#8221;</strong> (commercial companies do that as well) but about <strong>&#8220;reusing experience&#8221;</strong> which is hidden inside the source.</p>
  
  <p>I have the strong belief that people who write the software are more important than the software itself and by looking to the source code you can gain at least part of experience of people who wrote it. That&#8217;s the power of open source, that&#8217;s <strong>&#8220;reusing experience&#8221;</strong> concept at work!</p>
</blockquote>

<p>This observation was written a few years ago by one <a href="http://adymo.blogspot.com/2005/08/eclipse-hacking-experience.html">Alexander Dymo</a> who was expressing his amazement at the whole Software Freedom thing, especially the hands-on side of it. And as for his &#8220;people are more important than software&#8221;, well, hey; I couldn&#8217;t agree more. Enlightened organizations that want to preserve their strategic advantage understand that the people who are capable of working with such code <em>are</em> their competitive advantage. They are the ones who can reuse experience and leverage the power of the most wide reaching and enabling social phenomenon we have ever seen: the global openness movement.</p>

<h2>Towards a technical definition of Open Source</h2>

<p>I&#8217;m on a bit of a kick at the moment working to elucidate a practical <em>technical</em> definition of Open Source (ie, complementary to the necessary legal foundation which enables Free Software and the requisite social interaction which is at the heart of global Open Source communities). Comments like the one above are helping refine my thoughts on the topic: yes the interaction of licence and copyright law gives us structure, and yes communication between people distributed the world over is the genesis of the sense of community, belonging, and accomplishment which is the rich social fabric within which our software development takes place, but there is also a pragmatic aspect: can you actually <strong>work</strong> with the source code, get right into it, experiment with it, break it, and do crazy things with it?</p>

<p>That the four GNU freedoms stipulate that this must be &#8220;permitted&#8221; doesn&#8217;t really change the fact that there are practical prerequisites. Can you easily <em>get</em> the sources under development? Do those sources <em>actually build</em>? Is there a clear mechanism for contributing source back to the project and are they actively facilitating such contributions?</p>

<h2>The source tarball as primary release artifact</h2>

<p>The biggest give-away is whether the primary release artifact is source or an opaque binary.&#185; Especially in the Java world but elsewhere as well, there is a surprising amount of activity for which, despite the fact that it may legally be Free Software and its loud proclamations to being Open Source, it remains clear that they just don&#8217;t get it: there are a huge number of projects and products which only do their releases in binary form. Bad sign when you start calling it a &#8220;product&#8221;, I think. In a frustratingly large number of cases, if you try to actually work with their code you will discover that it doesn&#8217;t actually compile! In extreme, there are statements like:</p>

<blockquote>
  <p>We distribute source but never claimed that you can build it out of the box. We don&#8217;t have time for such things.</p>
</blockquote>

<p>I didn&#8217;t believe it when I saw it, but one of the hackers of a supposedly Open Source project actually said that in response to a <a href="http://www.jpox.org/servlet/jira/browse/CORE-2675">bug</a> report. Astonishing.</p>

<p>Being able to duplicate the result is a rigour that goes far beyond software; indeed it has been the bedrock of science &#8212; and human progress &#8212; since the dawn of the age of reason. Back to the present day, it has suddenly become obvious to me that the fundamental technical difference between proprietary Unix from the commercial vendors (not to mention proprietary operating systems from Microsoft and Apple) and Linux is that in our world (taken to mean the entire continuum of FOSS communities) the primary release artifact for all upstream projects is a <strong>source release</strong> (these days it&#8217;s typically in a <code>.tar.bz2</code>, but whether it is that or <code>.zip</code> or whatever else isn&#8217;t terribly relevant) <strong>that you can build</strong>. Not a tarball full of already built <code>.class</code> files and <code>.jar</code> files. Not a &#8220;source <code>.zip</code>&#8221; for Eclipse. Not a self-extractable full of <code>.exe</code>s and <code>.dll</code>s. No. A source release is source code that <em>someone else</em> can build, right out of the tarball. THAT, ladies and gentlemen, is the technical definition of Open Source.</p>

<p>I&#8217;ve started to realize that this area is a big stumbling block. People I collaborate with in (upstream) global projects like <a href="http://www.gnome.org/">GNOME</a>, <a href="http://www.classpath.org/">Free Java</a>, <a href="http://bazaar-vcs.org">Bazaar</a> and elsewhere take the efficacy and primacy of source releases  entirely for granted. But a number of clients that my firm is working with to enable Open Source often just don&#8217;t get why they should be doing source releases &#8212; and resist it.</p>

<p>Whether you buy into Software Freedom or not is a different topic (and your decision, not mine to impose on you), but if you&#8217;ve got a software project for which you&#8217;ve decided to free the source, you want it to be successful, right? Success is a  project that which inspires user enthusiasm, which the major distributions can package and ship without hassle, and around which a vibrant community of developers grows, ultimately fostering new contributions. There are a lot of steps along the way, but a buildable source release is, in our view, the technical bar you&#8217;ve got to reach. Otherwise you&#8217;re not making releases of the software, you&#8217;re abandoning it. And your users.</p>

<p>AfC</p>

<p>&#185;<span style="font-size:small">Note that this is different from a Linux or Unix distro shipping binary packages &#8212; no matter if it was Fedora, Debian, Gentoo, FreeBSD, OpenSolaris or anyone else, they should still have been able to build their package from source. It matters little whether that compilation took place in a build farm somewhere or on the user&#8217;s desktop (which is what happens in the &#8220;binary&#8221; distros when someone wants to work on the package or the project itself) &#8212; the key point remains that we <strong>can</strong> build the software if we want to, and are not forced into relying on someone else&#8217;s proprietary (and more to the point, unavailable) tooling. If you can&#8217;t build it, it&#8217;s not Open Source.</span></p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/freedom</category>
      <pubDate>Wed, 16 Jan 2008 09:38:00 GMT</pubDate>
      <guid isPermaLink="false">reusing-experience</guid>
    </item>

    <item>
      <title>Fascinating thread: FOSS Quality Control</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/free-java/fascinating-classpath-quality-control.html</link>
      <description><![CDATA[<p>A long-time critic of things Open Source showed up on the Classpath project&#8217;s mailing list and asked some rather provoking questions in a thread titled &#8220;Quality control and FOSS rant&#8221;. He at least ended with: &#8220;I suppose this is more of a troll than a criticism, sorry about that.&#8221;</p>

<p>Despite the flame bait, the <a href="http://developer.classpath.org/pipermail/classpath/2008-January/002397.html">thread</a> contained some surprisingly insightful replies. It&#8217;s always great to hear some of the top software developers in the world noting their motivations and why they believe what they do works.</p>

<p>From <a href="http://kennke.org/blog">Roman Kennke</a>: </p>

<blockquote>
  <p>Both approaches (closed and open) apparently tend to produce relatively high
  quality code (or really crappy code, happens in both camps), where with
  the closed approach the developers (or vendors) have to take over 100%
  responsibility (because the end user has no way to interact with the
  development), which usually makes things very formal and slow, where the
  open approach relies very much on the end users reporting problems. In
  most active projects these are fixed really quickly, giving both the
  developers and the end users a warm fuzzy feeling ;-)</p>
</blockquote>

<p>From <a href="http://blog.fuseyism.com/">Andrew John Hughes</a></p>

<blockquote>
  <p>There&#8217;s a lot to be said for feedback and interaction with your users that&#8217;s
  often overlooked.  All the ideas of complicated quality control
  processes in the world is not going to make a user feel as loved as
  seeing someone responding quickly to their bug and fixing it in a
  short space of time.</p>
</blockquote>

<p>From <a href="http://gnu.wildebeest.org/diary">Mark Wielaard</a>, a remark on the complex administrative process used by the project to review contributed code:</p>

<blockquote>
  <p>We do have a flow chart that people have to follow when contributing&#8230; It is all very formal really: <a href="http://gnu.wildebeest.org/~mark/patch.png">http://gnu.wildebeest.org/~mark/patch.png</a></p>
</blockquote>

<p>and from <a href="http://people.freebsd.org/~archie/">Archie Cobbs</a>, a reminder about the track record of a certain formerly proprietary process on solving bug desperately desired by their user community:</p>

<blockquote>
  <p>The number #1 voted <a href="http://bugs.sun.com/view_bug.do?bug_id=4670071">bug</a> in their bug database has been unfixed for over 5 YEARS!</p>
</blockquote>

<p><em>The comments on that bug make for hilarious reading, but the bigger point is this: the identity of the people making the decisions about the relevance of the issue are hidden. That sort of thing doesn&#8217;t inspire much hope for people on the outside. It&#8217;s not like we&#8217;re talking about national security or the future of western democracy; it&#8217;s a bug report that turned into a feature request for a piece of software that many, many people depend on! No one likes to be fed the line that their problem is so</em> <span style="color: red;">Top Secret</span> <em>that they won&#8217;t be told when (or even if) the problem will be addressed. The cloak of anonymity strikes again</em>.</p>

<p>Fascinating thread.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/free-java</category>
      <pubDate>Fri, 11 Jan 2008 02:30:00 GMT</pubDate>
      <guid isPermaLink="false">fascinating-classpath-quality-control</guid>
    </item>

    <item>
      <title>java-gnome 4.0.5 released!</title>
      <link>http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/java-gnome-4.0.5-release.html</link>
      <description><![CDATA[<p><a href="http://java-gnome.sourceforge.net/">
<center>
<img src="http://java-gnome.sourceforge.net/images/java-gnome_LargeLogo.png" border="0">
</center>
</a></p>

<p><em>This blog post is the release note from the</em> <code>NEWS</code> <em>file which you can read
<a href="http://java-gnome.sourceforge.net/4.0/NEWS.html">online</a> &#8230; or in the
<a href="http://research.operationaldynamics.com/bzr/java-gnome/mainline/NEWS">sources</a>,
of course!</em></p>

<hr/>

<h1>java-gnome 4.0.5 (26 Nov 2007)</h1>

<p><em>TreeView is here!</em></p>

<p>It&#8217;s always a great feeling when you bag a milestone, and with this release we
have reached a major goal on our way to having outstanding Java bindings for
the GNOME platform: coverage of GTK&#8217;s powerful yet complex TreeView &amp;
TreeModel API.</p>

<h2>TreeView</h2>

<p>TreeViews are a central part of almost every application. GUIs use lists for
all sorts of things, and so a significant goal was to make coding TreeViews
and their backing TreeModels as straight forward as possible.</p>

<p>The most challenging and complex part was to design the Java side API, which
was no small matter. As a native library, the GtkTreeView API is complex and
very much written with programming in the C language in mind, and as such our
algorithmic mapping of the underlying libraries into Java doesn&#8217;t entirely
fit. Long experience with the TreeViews in the previous bindings had made it
clear just how nasty to use the API could be, and so the hardest part of the
work was to come up with a mapping and a usage pattern that would be both
faithful to GTK <em>and</em> be sensible to use.</p>

<p>The other significant challenge was to document the work effectively. Our Java
side API documentation is a major feature of java-gnome, and merely exposing
classes and methods is not sufficient; they need to be clearly explained in
our JavaDoc as well.</p>

<p>along with numerous test cases in our unit test suite, and several
comprehensively worked <a href="http://research.operationaldynamics.com/bzr/java-gnome/mainline/doc/examples/treeview/ExampleTrailHeads.java">examples</a>.</p>

<p>This was a monster patch, and the culmination of not just three months direct
effort, but also where we&#8217;ve been heading since we first started the
re-engineering of Java bindings for GNOME. Although largely written by Andrew
Cowie, a <em>significant</em> contribution was made by Srichand Pendyala who not only
exhaustively evaluated the design but also threw in some serious chunks of
code. The work benefited from comprehensive input from Peter Miller on the
modelling and design, and the comments of Bryan Clark, Owen Taylor, and Hanna
Wallach were all really positive and helped us know that we&#8217;d gone in the
right direction. Finally, thanks to Behdad Esfahbod and the GNOME Foundation
who made it possible for us to meet in Boston at the GNOME Summit and so
accomplish much of the final pulling together of this branch.</p>

<h2>Continuing Improvement</h2>

<p>Meanwhile, steady work continues on to the fundamental base classes, with a
whack of additional signals and methods on Widget and especially Window, along
with expansion of coverage in numerous other classes.</p>

<p>We&#8217;ve begun to get the basics of image handling in place,</p>

<p>One nice piece of contributed work came from Vreixo Formoso and Thomas Schmitz
with coverage of the Dialog Window functionality in GTK. It took a bit of
doing to map the <code>int</code> response codes used by GTK into something suitably
strongly-typed, but all good.</p>

<p>Finally, minor improvements to all sorts of stuff,
notably from new contributor Mario Torre. Awesome!</p>

<p>For further details you can always grab a copy of the sources and run</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr diff -r tag:v4.0.4..tag:v4.0.5
</pre>

<p>to see the complete code delta.</p>

<h2>Screenshots</h2>

<p><img src="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Window.png" alt="" style="float: right; text-align: right; padding-left: 15px;" /> For fun we built in a capability to
create demonstrations to be captured as screenshots to illustrate various
things. It doesn&#8217;t get more basic than the example on the
<a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Window.html"><code>Window</code></a> documentation page, but it&#8217;s a nice touch. <code>:)</code> We&#8217;ve
screenshots for a number of Dialog classes and one for the TreeView page. I
imagine we&#8217;ll build up a nice library of images in the next few months (yes,
dear contributors, you can add snapshots to the list of things we&#8217;ll be
expecting along with well written documentation and unit tests when submitting
additions to the public API).</p>

<h2>Building and requirements</h2>

<p>The library now depends on GTK >= 2.12. Those packaging java-gnome for their
distributions please take note.</p>

<h2>Looking ahead</h2>

<p>Continuing to expand the coverage levels in the classes already exposed will
continue to dominate our attention; there&#8217;s still a long way to go but we&#8217;re
pleased with the progress we&#8217;ve made so far; you can definitely build real
applications with java-gnome now.</p>

<p>The next release also ought to include preliminary coverage of GConf and
Cairo. Doing each justice will again take a serious amount of work, but will
continue to grow the fun things you can do with java-gnome.</p>

<hr/>

<p><em>You can download java-gnome from</em> <a href="http://ftp.gnome.org/pub/GNOME/sources/java-gnome/4.0/"><code>ftp.gnome.org</code></a> <em>or easily checkout a branch from</em> <code>mainline</code> <em>using Bazaar:</em></p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ bzr clone bzr://research.operationaldynamics.com/bzr/java-gnome/mainline java-gnome
</pre>

<p><em>This release marks a particularly satisfying milestone for me. I have three+ years of work that&#8217;s been waiting to be ported to java-gnome 4.0, but I&#8217;ve needed a new TreeView binding in place before I could do so. So this is a big deal for me. At last I can start thinking about getting back to actually hacking on the applications I actually</em> <strong>want</strong> <em>to be working on, and not spending so much of time on the underlying bindings themselves. There&#8217;s still a lot that needs doing on java-gnome, but it&#8217;s getting closer.</em></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>/andrew/software/java-gnome</category>
      <pubDate>Mon, 26 Nov 2007 12:37:00 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.5-release</guid>
    </item>


  </channel>
</rss>
