<?xml version="1.0"?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Operations and other mysteries</title>
    <link>http://blogs.operationaldynamics.com/andrew/</link>
    <description>A blog by Andrew Cowie</description>
    <language>en</language>
    <copyright>© 2009 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>Operations and other mysteries</title>
      <link>http://blogs.operationaldynamics.com/andrew/</link>
      <width>80</width>
      <height>86</height>
    </image>

    <lastBuildDate>Wed, 17 Mar 2010 08:30 GMT</lastBuildDate>

    <atom:link href="http://blogs.operationaldynamics.com/andrew/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>java-gnome 4.0.15 released!</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/java-gnome/java-gnome-4.0.15-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> from Bazaar.</em></p>

<hr />

<h1>java-gnome 4.0.15 (16 Mar 2010)</h1>

<p><em>Radio things</em></p>

<p>This has mostly been a bug fix cycle with numerous internal quality
improvements being made. A few developer visible API additions have been made,
summarized below.</p>

<h2>Unified radio handling</h2>

<p>There are a number of controls in GTK that exhibit the &#8220;radio&#8221; behaviour of
being in a group of which only one can be selected: <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/RadioButton.html">RadioButton</a>,
<a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/RadioMenuItem.html">RadioMenuItem</a>, <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/RadioToolButton.html">RadioToolButton</a> and <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/RadioAction.html">RadioAction</a>. We originally had a class
called RadioButtonGroup which was used when constructing RadioButtons to
indicate which group they were a member of. In introducing overage of the
other radio types, Guillaume Mazoyer implemented a generic grouping class
called <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/RadioGroup.html">RadioGroup</a> which is now used for all the radio types.</p>

<h2>XDG utility functions</h2>

<p>A number of utility functions (aka static methods) were added to <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/glib/Glib.html">Glib</a> allowing
you to access the various user and systems directories as specified by the XDG
specification. These are <code>Glib.getUserConfigDir()</code>, <code>Glib.getUserDataDir()</code>
and friends.</p>

<h2>Miscellaneous improvements</h2>

<p>Better control of positioning when popping up context menus; you can specify
co-ordinates when calling Menu&#8217;s <code>popup()</code>.</p>

<p>The no-arg &#8220;convenience&#8221; packing methods we invented for <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/HBox.html">HBox</a> and <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/VBox.html">VBox</a> were
causing more trouble than they were worth because people we not understanding
the implications of the &#8220;default&#8221; packing values. So these are deprecated; the
full four-argument <code>packStart()</code> and <code>packEnd()</code> have been present for a long
time and are to be used in preference.</p>

<p>Serkan Kaba spent a bit of time working with the text version of the <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/ComboBox.html">ComboBox</a>
API. Apparently no one had needed <code>removeText()</code> so he added that.</p>

<p>A number of improvements to the coverage of GDK&#8217;s event masks were merged.
This is work originally by Vreixo Formoso necessary to support the
<a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Widget.MotionNotifyEvent.html"><code>Widget.MotionNotifyEvent</code></a> signal, though it has use in other applications.
Widget now has <code>addEvents()</code> and <code>setEvents()</code> to this end.</p>

<p>Finally, Guillaume needed to handle selections in <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/IconView.html">IconView</a>s. The API is
similiar to that in <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/TreeView.html">TreeView</a>, but doesn&#8217;t use the same <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/TreeSelection.html">TreeSelection</a> helper
class; the methods are directly on IconView. Boo for asymmetry. Anyway, we&#8217;ve
exposed <code>isSelected()</code> on both TreeSelection and IconView so you can find out if
a given <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/TreePath.html">TreePath</a> is currently selected.</p>

<h2>Better initialization checking</h2>

<p>Logic checking that the library has been properly initialized has been
refactored, making it harder to accidentally misuse java-gnome when getting
started [or when starting a new program after you&#8217;ve been using the library
for years and forgotten the basics <code>:)</code>].</p>

<p>Last but not least, a number of bug fixes; one in <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/freedesktop/enchant/Enchant.html">Enchant</a> was developer-visible; 
<code>Enchant.requestDictionary()</code> now returns <code>null</code> like it claimed to if you
request an unknown dictionary. Nice catch, Serkan.</p>

<p>All the source files have the full (ie traditional) GPL v2 header text now;
the files comprising the library as used at run-time have GPL headers text +
the Classpath Exception text. Needed to be done. Makes for a large diff this
release, but makes the
<a href="http://www.ohloh.net/p/java-gnome/analyses/latest">Ohloh</a>&#8216;s page for
java-gnome happy too <code>:)</code>.</p>

<hr />

<p><em>You can download java-gnome&#8217;s sources 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>:</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><em>though if you&#8217;re going to do that you&#8217;re best off following the instructions in the</em> <a href="http://java-gnome.sourceforge.net/4.0/HACKING.html"><code>HACKING</code></a> <em>guidelines.</em></p>

<p><em>Enjoy!</em></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/java-gnome</category>
      <pubDate>Wed, 17 Mar 2010 08:30 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.15-release</guid>
    </item>

    <item>
      <title>Lovely Inconsolata</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/inconsolata-loveliness.html</link>
      <description><![CDATA[<p>Federico <a href="http://www.gnome.org/~federico/news-2009-12.html#18">writes</a> that he&#8217;s recently discovered Raph Levien&#8217;s <a href="http://www.levien.com/type/myfonts/inconsolata.html">Inconsolata</a> font and really liking it.</p>

<p>I likewise discovered Inconsolata not too long ago (it was <a href="http://packages.gentoo.org/package/media-fonts/inconsolata">packaged</a> in Gentoo and I was really pleased to discover it also <a href="http://packages.debian.org/sid/ttf-inconsolata">available</a> in Debian), and have been using it as the constant-width font in Quill and Parchment for program listings in technical writing.</p>

<p><img src="http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/Example_Evince_Screenshot.png" alt="Parchment output showing Inconsolata font used for program code" title="" /></p>

<p>We all tend to get obsessive about things we like, and so of course I tried it as a terminal console font. Interestingly, after a brief consideration, I decided <strong>not</strong> to use it for terminals and gedit and such. Deja Vu Sans Mono is still the king for that, especially if you&#8217;re <a href="http://blogs.operationaldynamics.com/andrew/software/gentoo-linux/desktop-fonts.html">using Deja Vu</a> Sans and Deja Vu Serif for the rest of your UI; it means that the visual consistency across your desktop is <em>really</em> awesome.</p>

<p><img src="http://blogs.operationaldynamics.com/andrew/software/gentoo-linux/AppearancePreferences.png" alt="gnome-apperance-properties Fonts tab, picking Deja Vu fonts" title="" /></p>

<p>Inconsolata doesn&#8217;t have anything even remotely close to the kind of Unicode coverage you need in your full-time constant-width font, and when fontconfig does a fallback it looks awful because Inconsolata&#8217;s metrics are so different from others. That&#8217;s all ok; Inconsolata is meant for program listings, and looks <em>incredible</em> on paper.</p>

<p>Anyway, Federico noted that bold didn&#8217;t work when specified as a <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/pango/FontDescription.html#FontDescription&#40;java.lang.String&#41;">FontDescription</a>, it doesn&#8217;t come up bold me either when I tried to do so via a <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/pango/Weight.html">bold PangoAttribute</a>. But if you use Wouter&#8217;s <a href="https://launchpad.net/gnome-specimen">Specimen</a>, it shows up fine (on an Ubuntu box, anyway):</p>

<p><img src="http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/Inconsolata_GnomeSpecimen_Screeshot.png" alt="gnome-specimen showing Inconsolata font medium and bold" title="" /></p>

<p>So there&#8217;s a bug in our stack somewhere.</p>

<p>AfC</p>

<p><strong>Update</strong></p>

<p>Or not. I just reread the JavaDoc for the FontDescription constructor, and lo and behold relearned what I wrote there in the first place. To get bold Inconsolata you just need to use a <code>','</code> in the right place:</p>

<pre><code>    desc = new FontDescription("Inconsolata, Bold 8.0");
    ...
</code></pre>

<p>and my Cairo drawing code <em>on screen</em> in a XlibSurface shows bold. Great.</p>

<p>But nothing is ever simple. I ran the same drawing code out through to a PdfSurface, and no bold. What the hell? There&#8217;s a bug in our stack somewhere. <code>{sigh}</code></p>

<p><em>In my original post, I misattributed Specimen&#8230; it&#8217;s written by our very excellent Wouter Bolsterlee,</em> <code>uws</code> <em>on IRC. Sorry!</em></p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/gnome-desktop</category>
      <pubDate>Sat, 19 Dec 2009 06:37 GMT</pubDate>
      <guid isPermaLink="false">inconsolata-loveliness</guid>
    </item>

    <item>
      <title>java-gnome 4.0.14 released!</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/java-gnome/java-gnome-4.0.14-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> from Bazaar.</em></p>

<hr />

<h1>java-gnome 4.0.14 (16 Dec 2009)</h1>

<p><em>You have to compose in order to enchant</em></p>

<h2>Access to Enchant spell checking API</h2>

<p>Coverage of the Enchant spell checking facade (which was already an implicit
dependency arising from our GtkSpell coverage) is now included in java-gnome.
It&#8217;s a lovely library with a simple to use API which in turn fronts for
various back end spelling providers.</p>

<h2>More detailed input handling</h2>

<p>GTK&#8217;s handling of complex input methods is extraordinarily powerful, and of
course present by default in the Entry and TextView text entry Widgets. If
you&#8217;re doing your own text based work, however, you might need to capture the
results of an input method being used to compose characters or words.
<code>InputMethod.Commit</code> is where the result of a compose sequence is captured and
delivered to the application.</p>

<p>We&#8217;ve also made numerous improvements down in GDK where events are processed;
as a Java library we represent many naked low-level native entities with
strongly-typed classes, and have improved our coverage here, notably with new
Cursor constants representing the common use cases of changing the pointer.</p>

<h2>Improved text rendering</h2>

<p>Other minor improvements are present across the text rendering stack, notably
with the ability to introspect where a Pango Layout has made its line breaks
when wrapping via LayoutLine&#8217;s <code>getStartIndex()</code> and <code>getLength()</code> methods.</p>

<p>Guillaume Mazoyer finished up a work by Serkan Kaba resulting in us having
coverage of the special LinkButton subclass of Button which can be used to
present clickable URLs.</p>

<p>You can now create custom PaperSize objects, which is handy if you need to use
Cairo to output PDF documents with a non-standard paper format.</p>

<h2>Other changes</h2>

<p>You can now use gdk-pixbuf to query an image on disk for its dimensions via
Pixbuf <code>getFileInfo()</code> function calls.</p>

<p>There were of course miscellaneous improvements to various long established
core classes, mostly fixing typos.</p>

<p>We now have the methods necessary to have ImageMenuItems actually show images
(there&#8217;s a GNOME bug whereby suddenly icons are not showing in menus. So you
need to either explicitly tell an ImageMenuItem that it should always show its
image, or use the global Settings to say that Menus and Buttons should always
have their icons showing).</p>

<p>The internal initialization sequence has been tweaked to ensure that GLib&#8217;s
threads are initialized before anything else. This means java-gnome apps will
work if <code>glib 2.22.3</code> is installed; this is a workaround for bug
<a href="https://bugzilla.gnome.org/show_bug.cgi?id=603774">603774</a>.</p>

<h2>Headless testing</h2>

<p>For a long time we&#8217;ve had to be careful in our test suite not to do anything
that would cause a Window to appear or otherwise popup while the tests were
running. But some for some test cases this is unavoidable, especially if the
main loop needs to cycle. We now run the java-gnome test suite within a virtual
X server (ie <code>Xvfb</code>), and as a result distros packaging the library can run the
test suite on their headless build servers if they wish. There&#8217;s a new base
class for java-gnome TestCases needing to run in this environment.</p>

<h2>Looking ahead</h2>

<p>What&#8217;s ahead for java-gnome? That&#8217;s always a good question. At this point
java-gnome provides a comprehensive API for development of user interfaces
suitable for the GNOME desktop, and it&#8217;s incredibly rewarding to see people
using the library for their own programs.</p>

<p>Development of java-gnome has continued pretty steadily, driven by people
finding they need additional features from some of the underlying GNOME and
FreeDesktop libraries we already expose. As a community we also work to
fine-tune the performance and quality of the library through continuous
improvement of the code base and its algorithms. There are also people quietly working on experimental coverage of more unusual libraries such as GStreamer and Clutter which is pretty exciting to see.</p>

<p>Anyone using java-gnome are always welcome to join us in <code>#java-gnome</code> to ask
questions or just hang out! So happy hacking, and see you soon.</p>

<hr />

<p><em>You can download java-gnome&#8217;s sources 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>:</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><em>though if you&#8217;re going to do that you&#8217;re best off following the instructions in the</em> <a href="http://java-gnome.sourceforge.net/4.0/HACKING.html"><code>HACKING</code></a> <em>guidelines.</em></p>

<p><em>Enjoy!</em></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/java-gnome</category>
      <pubDate>Wed, 16 Dec 2009 00:48 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.14-release</guid>
    </item>

    <item>
      <title>Get your icons back</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/where-did-all-the-icons-go.html</link>
      <description><![CDATA[<p>We recently upgraded a number of systems, and after a few days the (previously happy GNOME users) started to notice the dialog buttons were all lacking their icons. How did that break? At first I assumed it was a bug in Canonical&#8217;s then pending Linux release, &#8220;Karmic&#8221;. But the problem didn&#8217;t go away, and suddenly I noticed a fair bit of email and bug traffic about the issue.</p>

<p>It turns out that someone removed the icons on purpose!</p>

<p>It didn&#8217;t attract that much attention at the time, but this setting was changed by the small group who maintain GNOME Control Center. They claimed that text-only interfaces were better. Hm. That doesn&#8217;t seem right, but interesting choice on their part. Fine. So you start hunting around in System -> Preferences to find the place where you can return your GNOME desktop to normal.</p>

<p>There isn&#8217;t one.</p>

<h2>The usability of icons</h2>

<p>In the GNOME community, we&#8217;ve gone to immense effort over the years to get people to use the proper stock GTK icons in menus and buttons so that the user experience is consistent across applications. They&#8217;re a significant cue that aids navigation. Meanwhile non-GNOME applications poorly ported from other platforms often violate this consistency (Eclipse {cough}). So suddenly lacking icons the entire desktop looked ghetto.</p>

<p>The <a href="http://mail.gnome.org/archives/desktop-devel-list/2009-November/msg00093.html">whole</a> <a href="https://bugzilla.gnome.org/show_bug.cgi?id=557469">debate</a> about what the user experience should be was an interesting one, but it seems a user experience change of this magnitude qualifies as just the sort of thing we <em>don&#8217;t</em> do to the huge communities of people using our Desktop during a stable release series. We have GTK 3.0 and &#8220;GNOME 3.0&#8221; coming up, and surely those would have been the appropriate contexts to propose such change, and the right place to trial landing it.</p>

<p>The part that really puzzles me, though, is that after the people who made this change were (politely) asked if they could point to the usability research that makes them think that text only menus are better, they (politely) replied with reference to a respected source in HMI design, <a href="http://www.uie.com/brainsparks/2009/06/28/old-news-about-icons">Jared Spool</a>. Reading that page it indeed says that text only is better than icon only. But right before that, however, he indicates that <strong>the combination of icons-and-text is more usable than text-only</strong>, with the further emphasis being that consistent positioning (ordering in menus) of those illustrative aides being what really what matters. Which seems to make it strange that text-only was just rammed down users&#8217; throats.</p>

<h2>Find out what&#8217;s broken and fix it</h2>

<p>That they changed something is NOT the issue; at the end of  the day it&#8217;s the people who do the work and write the software who set the agenda. But something this widespread seems like it ought to have been discussed on the usability and accessibility lists. And that&#8217;s the problem; there&#8217;s no mechanism requiring that.</p>

<p>It&#8217;s not the GNOME Control Center hacker&#8217;s fault that this became such a sore point for the rest of us; they were in a position to change something they wanted to change and so they did so. That&#8217;s just another day in Open Source land. But in GNOME there&#8217;s nothing that enforces the GNOME Human Interface Guidelnes. If a change like this had been proposed as a change to the HIG <strong>and if following the HIG was mandatory</strong> then clearly people would have had a good focused discussion about user experience, we could have come to a consensus (or &#8220;Usability Team&#8221; could have made a decision), the HIG documents would have been patched as a part of that, and then we could all get with the program.</p>

<p>The GNOME &#8220;Release Team&#8221; puts new module proposals through hell to be accepted as a part of GNOME, with endless discussions about what the user experience will be. Libraries underneath the desktop work incredibly hard to maintain API and ABI compatibility across releases. We try to remember that corporate IT departments just want gentle improvement between <em>their</em> upgrade decisions, rather than having to deal with a wrecking ball every six months. So we all know the importance of not screwing the user around.</p>

<p>But unless we find a way to apply the same rigour to maintaining UI standards like we do to managing the internal technical aspects of our platform, it seems we&#8217;re doomed to keep breaking the consistency of our users&#8217; experience (and more to the point, jerking the chain of all the people who work hard to install and support the systems that our users run). How to do that while still enabling people to innovate is the hard part, but surely requiring people to follow the HIG and making that document the heart of user experience debate would be a step in the right direction.</p>

<p>Meanwhile, lets fix your desktop:</p>

<h2>Workaround: users</h2>

<p>The Control Center hackers removed the &#8220;Interface&#8221; tab from <code>gnome-appearance-properties</code> which is a shame since it would have been a lovely place for the user to say whether or not they wish icons in their menus and buttons.</p>

<p>It was pointed out that this is all still controllable by the user&#8230; by changing GConf settings. I think most of us would agree that is the very definition of what normal users aren&#8217;t expected to be doing.</p>

<p>The GConf keys are:</p>

<pre><code>/desktop/gnome/interface/buttons_have_icons
</code></pre>

<p>and</p>

<pre><code>/desktop/gnome/interface/menus_have_icons
</code></pre>

<p>So to fix your desktop to be consistent with previous GNOME releases, you need to run:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ gconftool-2 --type bool --set /desktop/gnome/interface/buttons_have_icons true
$ gconftool-2 --type bool --set /desktop/gnome/interface/menus_have_icons true
</pre>

<p>You&#8217;ll definitely need to repair your system like this if you&#8217;re working in applications such as Inkscape that have huge numbers of items in their menus; they become really difficult to tell apart if you don&#8217;t have the pictorial aides to help you identify the action you&#8217;re looking for.</p>

<h2>Workaround: code</h2>

<p>It turns out <a href="http://library.gnome.org/devel/gtk/stable/GtkImageMenuItem.html">GtkImageMenuItem</a> has a new property <code>"</code><a href="http://library.gnome.org/devel/gtk/stable/GtkImageMenuItem.html#GtkImageMenuItem--always-show-image"><code>always-show-image</code></a><code>"</code> for really important icons, ie where &#8220;the menu item would be useless or hard to use without it&#8221;. The idea is that application programmers using GTK manually need to call this for all the menu items where the icons is <em>really important</em> and you actually want the icon shown in the menu item (Given that you have to go some trouble to construct a GtkImageMenuItem rather than just a normal GtkMenuItem, I would have thought that that emphasis would have been a given. Alas).
I just added a setter to java-gnome:</p>

<pre><code>    quit = new ImageMenuItem(Stock.QUIT);
    quit.setAlwaysShowImage(true);
</code></pre>

<p>There are also GtkSettings  <code>"</code><a href="http://library.gnome.org/devel/gtk/stable/GtkSettings.html#GtkSettings--gtk-menu-images"><code>gtk-menu-images</code></a><code>"</code> and <code>"</code><a href="http://library.gnome.org/devel/gtk/stable/GtkSettings.html#GtkSettings--gtk-button-images"><code>gtk-button-images</code></a><code>"</code> which can be used to set the property globally in an application programatically or via <code>.gtkrc</code>:</p>

<pre><code>    settings.setMenuImages(true);
    settings.setButtonImages(true);
</code></pre>

<p>Judging by the howls of protest, not too many people had noticed the importance of these properties, and so no one was setting it in their code. Assuming that the new default is likely to stand in the GNOME <code>&gt;=</code> 2.28 era, then indeed we&#8217;ll all have to be doing this a lot.</p>

<h2>Setting defaults</h2>

<p>Thinking about this from the perspective of a bindings hacker and sometimes application developer, it all makes me realize the importance of exposing setters for properties, <em>and calling setters even when the value you are setting is the default</em>. It&#8217;s tempting to think &#8220;oh, I don&#8217;t need to call that method, it&#8217;s set by default&#8221;, but as episodes like this demonstrate, relying on defaults isn&#8217;t very reliable.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/gnome-desktop</category>
      <pubDate>Fri, 11 Dec 2009 12:26 GMT</pubDate>
      <guid isPermaLink="false">where-did-all-the-icons-go</guid>
    </item>

    <item>
      <title>Getting a core dump</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/free-java/get-java-to-coredump.html</link>
      <description><![CDATA[<p>Sometimes things crash. This is the normal order of things, even if we like to pretend that Linux is so much better than its proprietary competitors. When a native library crashes underneath a java-gnome program, however, this isn&#8217;t so much fun, because the actual process which crashed is a Java Virtual Machine.</p>

<p>Usually I see with crashes because of something I&#8217;ve done wrong in binding an underlying GNOME library from java-gnome. So I bisect &amp; <code>printf()</code> my way down until I can find the thing that causes it, read the docs, and hopefully figure it out.</p>

<p>Recently, however, I&#8217;ve been getting crashes somewhere deep in <code>libpangoft</code> when my the app is first loading or worse just sitting there and I&#8217;m not doing anything more onerous than moving the cursor around a TextView. This is <em>still</em> likely due to something I&#8217;ve done wrong in my code or in the bindings layer, but when it&#8217;s not happening deterministically or on demand it&#8217;s hard to even begin to analyze the problem.</p>

<p>The OpenJDK HotSpot VM (formerly the Sun HotSpot VM) has a pretty good SIGSEGV handler; it does its best to show you what the C library call was that died, and what the Java and C call stacks were leading up to the crash. You may have seen them around as <code>hs_err_pid10733.log</code> and such [I wish it would just spew that out to stderr instead of troubling to write a file, but anyway].</p>

<p>Strangely, the only line I&#8217;m getting when reading the crash report is:</p>

<pre><code>C  [libpangoft2-1.0.so.0+0x17687]
</code></pre>

<p>no other stack frames. Which is a bit strange, and decidedly unhelpful. So I&#8217;m going to need to try a bit harder to get a backtrace, it seems.</p>

<h2>Getting a native C stack trace of a Java program with GDB</h2>

<p>Much as I otherwise feel GDB is the most horrendous user interface in the history of civilization (ok, maybe second only to GPG&#8217;s command line interface), it does do one thing extraordinarily well and that&#8217;s stack backtraces of crashed programs. These days one normally runs one&#8217;s program in <code>gdb</code>, induces it to crash, and then runs <code>bt</code>:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ gdb ./program
(gdb) run
SIGSEGV caught
(gdb) bt
</pre>

<p>And you get your stack trace.</p>

<p>That&#8217;s a bit of a pain with a Java &#8220;program&#8221; because as mentioned the process running is a Java Virtual Machine (and because invoking <code>java</code> is &#8230; almost as bad as GPG&#8217;s command line interface):</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ java ... gobbledygook ... package.Class arguments
</pre>

<p>Usually people put their invocation line in a shell script along with various environment setup and so on:¹</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ ./script arguments
</pre>

<p>and off they go. The complication is that&#8217;s not really easy to use with GDB, since you need to invoke <code>gdb</code> on the binary executable (the JVM) and then, once GDB is finally up, tell it to &#8220;<code>run</code>&#8221; that executable with a bunch of arguments. Which means you&#8217;re back to the gory mess:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ gdb java
(gdb) run ... gobbledygook ... package.Class arguments
SIGSEGV caught
(gdb) thread apply all bt
</pre>

<p>which is incredibly tedious for casual use.</p>

<p>But the old fashioned 1980s way of using a debugger is to get a &#8220;core dump&#8221; of memory into a file called <code>core</code> and to run GDB on that. Just set your shell to core dump, then go back to running your program as normal:</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ ulimit -c unlimted
$ ./script arguments
Aborted (core dumped)
$ gdb java core
(gdb) thread apply all bt
</pre>

<p>and our stack traces will spill out in great gory detail. Hooray!</p>

<p>Incidentally, if you want to play with GDB and see what a HotSpot JVM is up to, then you need to induce it to crash; one way to do this is to send it a signal, say <code>SIGSEGV</code> or <code>SIGBUS</code>:²</p>

<pre style="background: black; color: white; margin: 10px; padding: 12px;">
$ kill -11 10733
</pre>

<h2>Yeay, Open</h2>

<p>The real point here is that with Sun having open sourced Java and it&#8217;s HotSpot VM implementation, we can now build Java ourselves <em>and include debugging symbols</em> [on Debian Linux, for example, install package <code>openjdk-6-dbg</code> along with the symbols for the various libraries in the GNOME stack, <code>libgtk2.0-0-dbg</code> and so on]. This means, at long last, we can actually run Java under GDB &#8212; something we weren&#8217;t able to do when Java was proprietary &#8212; and get lovely backtraces when it thunders in.</p>

<p>Yeay for crashes.</p>

<p>AfC</p>

<p>¹ Which is why people put this invocation into a  shell script, which makes it even harder to debug because you&#8217;ve got to run <code>ps axww</code> or whatever to try and get the full command line used to run the program. <code>{sigh}</code>, but fixing this will have to wait for another day.</p>

<p>² Bernd Eckenfels <a href="http://stackoverflow.com/questions/65200/how-do-you-crash-a-jvm/74867#74867">suggests</a> avoiding <code>SIGSEGV</code> as apparently he believes this is caught in some places and rethrown as NullPointerException. I&#8217;ve never observed that, but I thought I&#8217;d mention his advice to use <code>SIGBUS</code> instead.</p>

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

<ul>
<li><p><a href="http://joshtriplett.org/">Josh Triplett</a> wrote mentioning that he likes to use <code>SIGQUIT</code> to get his C applications to core dump, since you can trivially generate that signal from the console with <code>Ctrl+\</code>. What he didn&#8217;t know was that Sun&#8217;s Java VM has always had a handler for <code>SIGQUIT</code> which prints a stack trace for each currently running Java thread (which is useful when trying to debug deadlock issues, but it&#8217;s the Java-side call stack only, not the native frames).</p></li>
<li><p><a href="http://gnu.wildebeest.org/diary/">Mark Wielaard</a> mentioned a nice trick to attach to a crashing hotspot JVM to work around any core file limitations:</p>

<p><code>java -XX:OnError="gdb - %p" &lt;arguments&gt;</code></p></li>
<li><p>He and <a href="http://blogs.gnome.org/jamesh/">James Henstridge</a> also note that having the &#8220;live, but almost dead program&#8221; around sometimes makes things a little easier on the debugger (as opposed to relying on a core dump). James suggests computers are fast, and just running all your [problem child] programs in <code>gdb</code> all the time. Fair enough, although in my case with such a hard to reproduce crash, I think I&#8217;ll wait on a core dump.</p></li>
<li><p>Mark let me know that on Fedora you can get debug symbols for any package you are trying to inspect. If you do <code>debuginfo-install java-1.6.0-openjdk</code> (in this case) it will pull in every dependent debuginfo package also! He also notes that this crash in question <em>might</em> actually be a Pango problem, and cites this Fedora <a href="https://bugzilla.redhat.com/show_bug.cgi?id=540962#c3">bug</a>.</p></li>
</ul>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/free-java</category>
      <pubDate>Thu, 26 Nov 2009 04:37 GMT</pubDate>
      <guid isPermaLink="false">get-java-to-coredump</guid>
    </item>

    <item>
      <title>java-gnome 4.0.13 released!</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/java-gnome/java-gnome-4.0.13-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.13 (27 Aug 2009)</h1>

<p><em>Unicode. It&#8217;s bigger than you think.</em></p>

<p>This is a bug fix release to address a serious weakness in Java&#8217;s handling of
Unicode characters.</p>

<h2>Unicode handling</h2>

<p>It turns out that Java&#8217;s chars are <strong>not</strong> pure Unicode codepoints. Most
people know that Java String objects are arrays of Java chars, but in
aggregate they are encoded in UTF-16 in order to deal with the fact that there
are Unicode characters whose index is higher than <code>0xFFFF</code> and which need more
than two bytes to identify them. It&#8217;s a problem that an application developer
has to deal with if they&#8217;re using high-range &#8220;supplementary&#8221; Unicode
characters, but wasn&#8217;t something that would break java-gnome&#8230;</p>

<p>Except it turns out that the Java VM does not do UTF-8 translation properly.
It has a hard wired limitation preventing it from writing out UTF-8 sequences
longer than 3 bytes. Who knows what crack they were smoking when they decided
that one. But things like TextView / TextBuffer work in characters, so we need
characters. (actually, they work in UTF-8 bytes, but the offsets in our public
API are the characters variants).</p>

<p>Luckily, we can get at the raw UTF-16 arrays backing Strings, and so in
combination with GLib&#8217;s character set conversion functions, we&#8217;ve been able to
redo our string handling internally so as to have correct treatment of Unicode
codepoints. Lots of testing.</p>

<p>This surgery was almost entirely internal; Strings returned by java-gnome
methods are of course still Java String objects.</p>

<h2>New coverage</h2>

<p><img src="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Entry.png" alt="" style="float: right;
text-align: right; padding-left: 15px;" /> This release also features the work
of Guillaume Mazoyer exposing some of the new features available in Entry
Widgets, including displaying icons and showing progress bars in the
background. This compliments other minor enhancements to various miscellaneous
classes.</p>

<p>With this release, java-gnome now requires GTK <code>2.16</code> or newer.</p>

<hr />

<p><em>This release is already packaged for
<a href="http://packages.gentoo.org/package/dev-java/java-gnome">Gentoo</a> and
<a href="https://launchpad.net/~respawneral/+archive/ppa/">Ubuntu</a>, which is sweet.</em></p>

<p><em>You can download java-gnome&#8217;s sources 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>:</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><em>though if you&#8217;re going to do that you&#8217;re best off following the instructions in the</em> <a href="http://java-gnome.sourceforge.net/4.0/HACKING.html"><code>HACKING</code></a> <em>guidelines.</em></p>

<p><em>Enjoy!</em></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/java-gnome</category>
      <pubDate>Mon, 31 Aug 2009 03:28 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.13-release</guid>
    </item>

    <item>
      <title>Where the weather is fine</title>
      <link>http://blogs.operationaldynamics.com/andrew/travel/australia/crystal-ball-weather-bureau.html</link>
      <description><![CDATA[<p>One of the strange things about being a stranger here is trying to figure out what the weather forecasts mean.</p>

<p>For one thing, they usually say it&#8217;s going to be:</p>

<blockquote>
  <p>&#8220;Fine.&#8221;</p>
</blockquote>

<p>Fine?</p>

<p>To me, that implies &#8220;hardly a cloud in the sky, bright and sunny, and warm. Head for the beach, yo!&#8221;. But it doesn&#8217;t seem to mean that here.</p>

<p>My Dad in Toronto a specialist in amateur weather data gathering. Yes, that means what you think, but he&#8217;s also a volunteer team coordinator in the provincial emergency management and disaster response organization, so I don&#8217;t mind him getting all excited about dark and stormy clouds. But Dad, could you maybe please just keep your eyes on the road instead of looking for the tornado anvils? Thanks dude! You&#8217;re a star. Now get me to the airport. I&#8217;ve got a plane to catch. Preferably before the tornado gets here.</p>

<p>So I&#8217;m always getting messages like &#8220;Good morning Andrew! According to <code>crystal-ball-forecasting.com</code> here, it&#8217;s a fine day for you today!&#8221; Well, thanks for checking, but he means &#8220;nice&#8221; and no, it&#8217;s not nice today, actually.</p>

<p>Since Dad is a weather nut, I&#8217;ve been paying closer than normal attention to the forecasts here. And there&#8217;s something strange going on: the weather forecasts don&#8217;t ever seem to have anything to do with the weather. I think the problem is that Crystal Ball Forecasting Inc get their data from the Australian Government&#8217;s <a href="http://www.bom.gov.au/weather/nsw/">Bureau of Meteorology</a>, who appropriately enough seem to use a crystal ball for their weather forecasting. Don&#8217;t believe me? I shall now demonstrate.</p>

<p><em>The quoted portions are from the Bureau of Meteorology&#8217;s morning forecast on the day given, usually leaving out the part about what the wind was expected to be. Copyright © 2008-2009 Commonwealth of Australia in right of Her Majesty the Queen. The comments are from my emails conveying the weather forecast to my Dad on those days.</em></p>

<h2>23 Sep 2008</h2>

<p>Forecast for Wednesday:</p>

<blockquote>
  <p>&#8220;Cloudy. Isolated showers or drizzle but fine for the most part.&#8221;</p>
</blockquote>

<p>What the hell is that supposed to mean? &#8220;Fine&#8221;? What are they smoking?</p>

<h2>1 Nov 2008</h2>

<p>How&#8217;s this for a weather forecast for Saturday night:</p>

<blockquote>
  <p>&#8220;Overcast with the chance of a shower, otherwise fine.&#8221;</p>
</blockquote>

<p>So do I need a rain jacket or not?</p>

<h2>10 Mar 2009</h2>

<blockquote>
  <p>&#8220;Chance of a shower or two, more likely during the morning and then
  again at night. A cloudy morning, but sunny breaks developing during
  the day.&#8221;</p>
</blockquote>

<p>Of course, it was bright and sunny all day.</p>

<h2>3 May 2009</h2>

<p>The forecast today:</p>

<blockquote>
  <p>Partly cloudy near the coast with a few showers, clearing later. Mostly fine with lengthy sunny periods in the west.</p>
</blockquote>

<p>I would have taken that to mean it&#8217;s raining out west, except that would imply it was raining over the city&#8217;s water supply catchment area, which never happens. So they were probably right about it not raining there after all.</p>

<h2>26 May 2009</h2>

<p>The weather:</p>

<blockquote>
  <p>&#8220;Fine and mostly sunny until a shower or two develops&#8221;</p>
</blockquote>

<p><em>really</em>.</p>

<h2>2 Jun 2009</h2>

<p>As at 07:30, the forecast for the day is:</p>

<blockquote>
  <p>&#8220;Cloudy with a few showers, and periods of light rain developing.&#8221;</p>
</blockquote>

<p>I&#8217;m glad you clarified that.</p>

<h2>19 Jun 2009</h2>

<blockquote>
  <p>&#8220;A few showers. Cloudy periods. Morning fog patches.&#8221;</p>
</blockquote>

<p>Since it is nice and sunny out, I think I&#8217;ll go out for a coffee in the
park now.</p>

<h2>15 Jul 2009</h2>

<blockquote>
  <p>&#8220;Cloud increasing and a shower or two developing in the afternoon with
  the chance of a thunderstorm and small hail.&#8221;</p>
</blockquote>

<p>Which is clearly why it is sunny out right now at the cafe where I&#8217;m sitting.</p>

<p>I gave them the benefit of the doubt, though: it does &#8220;<a href="http://blogs.operationaldynamics.com/andrew/travel/australia/and-then-change.html">change</a>&#8221; here sometimes, so I most certainly brought my raincoat with me this afternoon when I went a wandering. Nothing to do with the Bureau of Meteorology; that&#8217;s simply a Murphy&#8217;s Law thing.</p>

<h2>That evening</h2>

<blockquote>
  <p>&#8220;A shower or two, with a chance of <a href="http://blogs.operationaldynamics.com/andrew/engineering/oceanic/tsunami-dart-data.html">tsunami</a>. Light to moderate south to southwest wind.&#8221;</p>
</blockquote>

<p>Which admittedly is nothing to joke about, but given their track record&#8230;</p>

<h2>4 Jul 2009</h2>

<p>For once the official forecast was quite dull. So I improvised:</p>

<blockquote>
  <p>&#8220;Lengthy sunny periods, except for heavy morning showers, afternoon fog patches, chance of an evening thunderstorm. Possible snow overnight.&#8221;</p>
</blockquote>

<p>Dad missed my note saying that I was joking; he simply commented &#8220;seems par for the course&#8221;.</p>

<h2>Fine</h2>

<p>There is a happy ending to this story, though: I finally found out what &#8220;fine&#8221; meant!</p>

<p>Apparently they&#8217;re trying to say:</p>

<blockquote>
  <p>&#8220;It won&#8217;t rain today&#8221;.</p>
</blockquote>

<p>Pardon me for being underwhelmed.</p>

<p>AfC</p>

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

<p><span style="font-size: small;">
James Andrewartha wrote in suggesting a page of <a href="http://www.bom.gov.au/info/wwords/">terms</a> used by BOM, including &#8220;fine&#8221;. Thanks! Doesn&#8217;t excuse the fact they&#8217;re still using the word differently than the rest of the English speaking world, though <code>:)</code>
</span></p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>travel/australia</category>
      <pubDate>Tue, 11 Aug 2009 01:15 GMT</pubDate>
      <guid isPermaLink="false">crystal-ball-weather-bureau</guid>
    </item>

    <item>
      <title>Complexity</title>
      <link>http://blogs.operationaldynamics.com/andrew/engineering/railways/newcastle-station-tracks.html</link>
      <description><![CDATA[<p>Newcastle railway station, circa 1960:</p>

<p><img src="http://www.architecture.com/HowWeBuiltBritain/Images/Victorian/comingOfRailways/Newcastle%20railway%20station_530x803.jpg" alt="newcastle station" title="" /></p>

<p><em>From an online <a href="http://www.architecture.com/HowWeBuiltBritain/HistoricalPeriods/Victorian/RailwayArchitecture/EastEndOfNewcastleStation.aspx">exhibition</a> sponsored by the Royal Institute of British Architects</em>.</p>

<p>And you think you&#8217;re having trouble keeping your life straight.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>engineering/railways</category>
      <pubDate>Thu, 06 Aug 2009 05:49 GMT</pubDate>
      <guid isPermaLink="false">newcastle-station-tracks</guid>
    </item>

    <item>
      <title>One year and more</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/freedom/one-year-and-more.html</link>
      <description><![CDATA[<p>One of the things that saddens me is just how long it takes to write good code.</p>

<p>Havoc Pennington wrote a classic essay almost a decade ago about <a href="http://ometer.com/hacking.html">working on open source</a> software. A lot has changed in 10 years, but his advice has surprising endurance:</p>

<blockquote>
  <p>Don&#8217;t start by launching your own project&#8230; it&#8217;s more educational to read and learn from other people&#8217;s code.</p>
  
  <p>If you haven&#8217;t lurked and participated in a free software project, you won&#8217;t know how things are done and you&#8217;ll have an awful time trying to run your own&#8230;</p>
  
  <p>If you do start a project, the all-important thing is to write code. You have to code enough to make the app useful pretty much by yourself; this can be months or years of lonely work&#8230;</p>
  
  <p>When it comes down to it, writing a free application is a huge amount of work. If you&#8217;re writing your own, schedule 10-20 hours per week, at least&#8230; And schedule those 10-20 hours every week, for the foreseeable future. If you can&#8217;t commit this much time &#8212; don&#8217;t even bother starting the project. If you can&#8217;t write code, ditto.</p>
</blockquote>

<h2>It takes about a year</h2>

<p>It takes about a year to write a serious application. A year! Sure, it&#8217;s easy to knock off a proof-of-concept or a mockup, but once you get down to the business of making all the internals actually work, ensuring it is well tested, and making it build for other people it all just becomes a long grind.</p>

<p>And frankly, that year is <em>just</em> to get far enough to know whether the thing is going to fly or not. It takes somewhere between two and three years to get a serious application to the point where it&#8217;s polished and well-rounded enough where other people are able to use it.</p>

<p>And as Havoc points out, <em>then</em> if your app becomes widely adopted you&#8217;re in for years and years of continued involvement.</p>

<p>Why on earth do we do it?</p>

<h2>Writing software, writing poetry</h2>

<p>This week a friend introduced me to <a href="http://jacketmagazine.com/37/index.shtml">Jacket Magazine</a>, a poetry and literature periodical. Tons of cool &amp; eclectic stuff. It&#8217;s published entirely online, and is clearly a labour of love. Early on the founder &amp; editor, John Tranter, wrote an <a href="http://jacketmagazine.com/00/about.shtml#lefthand">essay</a> for the <code>about</code> page. The piece mostly focuses on the economics of periodical production and how the internet has opened revolutionary possibilities for the distribution of literature. Hot topics today, right? Not bad for a piece written in 1999.</p>

<p>The best part, though, was when he tried to describe his motivation:</p>

<blockquote>
  <p>The main cost is my time; which means I don’t get much poetry written these days. &#8230; it takes up most of my waking life. Why do I do it?
  Jacket is hard work, and I like hard work. I enjoy editing the poems and articles and taking photos of people and designing the pages, and I even enjoy writing the HTML that underlies the pages. Jacket exercises all my various talents - and it’s fun.</p>
  
  <p>It has also enlarged my circle of friends by a factor of about ten. And I feel I’ve enabled a lot of writers to find a wider international audience for their work, especially younger poets. I received a lot of generous support and assistance when I was a young writer, and it’s good to be able to give something back.</p>
</blockquote>

<p>10 years later, he and his contributors are still at it. Beautiful.</p>

<p>I&#8217;m not a poet, but the compulsive dedication that he talks about resonates.</p>

<p>I am ashamed to admit that of the five or so major software projects I have initiated since I returned to writing open source in 2002, only two of them have made it past the &#8220;1 year&#8221; proof-of-concept point, and only one of them has reached the &#8220;usable by real people&#8221; stage &#8212; indeed it has taken over 3 years, and that project is a library, not even an end-user application!</p>

<p>This emphasizes a point that the agile development community have been making for a while now &#8212; you have to get to the point of your app being usable by {you, your customer, whoever} as unbelievably fast as you can. If you&#8217;re not able to enjoy the fruits of your hard work, then you&#8217;ll likely reach the point where you&#8217;ve put tons of effort in and it&#8217;s still a demo harness that you can&#8217;t actually use for what you wanted to use it for. Live and learn.</p>

<p>Or maybe not <code>:)</code></p>

<p>I&#8217;m at it again; I&#8217;ve got another one brewing, and it&#8217;s passed the 1 year mark. The competing pressures are almost overwhelming. One the one hand is the excitement that it&#8217;s starting to come together, and that drives me forward. But at other times there is intense frustration when I discover yet <em>another</em> bug and when it feels that the thing is no closer to being usable (by me, let alone anyone else) than it was months and months ago. Sometimes you just want to let it all go.</p>

<p>And I have no doubt that it will be <em>at least</em> two more years before it reaches the level of polish and general usefulness that is merely the <em>starting</em> point for other people to consider using this program.</p>

<p>What in God&#8217;s name am I doing spending time on this?</p>

<h2>The demon that drives us</h2>

<p>I was trying to explain all this to someone in a bar a few weeks back, and she asked that very same question.</p>

<blockquote>
  <p>Are you doing it to make money?</p>
  
  <p>Well, no.</p>
  
  <p>Then why are you doing it?</p>
  
  <p>Well, the coding I do has paid off, at least sort of. Most of my software architecture work is consulting to large companies, but all the experimentation and new ideas that drive those engagements comes from my open source work. And some of my clients have found me through my public hacking.</p>
  
  <p>Oh, so, it&#8217;s a promotional activity?</p>
  
  <p>Well, I suppose it ends up that way, but that&#8217;s not why I&#8217;m doing it. It takes too much time to justify that way. Perhaps in the long term people will use my software and think well of me for having written it. Probably not, though; likely they&#8217;ll just bitch about how it doesn&#8217;t do this or that that they think it should. Doesn&#8217;t matter, I&#8217;m not really doing it for them.</p>
  
  <p>Who are you doing it for?</p>
  
  <p>Me.</p>
  
  <p>For three years!</p>
  
  <p>Hm, yeah, probably longer.</p>
  
  <p>So you&#8217;re not going to make any money out of this, you aren&#8217;t building your reputation with people who hire you, and you may not ever finish it. Why are you doing it?</p>
</blockquote>

<p>and I finally found an answer that made sense. The right answer:</p>

<blockquote>
  <p><strong>Because it needs doing</strong>.</p>
</blockquote>

<p>Needless to say that was pretty much the end of that flirtation. Apparently non-materialism isn&#8217;t sexy. <code>:)</code></p>

<p>Doesn&#8217;t change the fact that it really is the reason we do it. It needs doing.</p>

<p>As for the thing I&#8217;m working on? The feeling of accomplishment that comes when I show people screenshots of my work is undeniable. The code inside&#8217;s not bad, not bad at all. And I&#8217;m actually dogfooding with it now (ok, ok, <em>almost</em>). I think this one is going to fly.</p>

<p>At last.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/freedom</category>
      <pubDate>Sun, 02 Aug 2009 15:12 GMT</pubDate>
      <guid isPermaLink="false">one-year-and-more</guid>
    </item>

    <item>
      <title>java-gnome 4.0.12 released!</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/java-gnome/java-gnome-4.0.12-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.12 (24 Jul 2009)</h1>

<p><em>Being Uniquely Notified while Spelling the Sources you are Viewing is good
for the soul.</em></p>

<p>In addition to ongoing improvement in our coverage of the GTK widget toolkit,
the next release of java-gnome begins to realize our vision to offer
coverage of the broad suite of libraries making up the GNOME desktop.</p>

<h2>New Coverage</h2>

<p>The TextView text editing Widget has received two significant capability
boosts. With the work of Stefan Schweizer, we now have coverage of the
powerful <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/sourceview/SourceView.html">GtkSourceView</a> library with its impressive built-in multi
[programming] language source highlighting features.</p>

<p>And with the contribution of <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/Spell.html">GtkSpell</a> coverage by Serkan Kaba, we can now
offer spell checking in TextViews as well.</p>

<p>Two other GNOME libraries feature in this release. Serkan also contributed
excellent coverage of <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/notify/Notification.html">LibNotify</a>, enabling an application to create and send
popups to be displayed by the desktop notification mechanism.</p>

<p>And, we expose LibUnique, which offers DBus-powered machinery enabling a
developer to ensure only one instance of their application is running.</p>

<h2>Continuing improvement</h2>

<p>Lots of minor changes and enhancements throughout the core GTK libraries.
Highlights include improved mouse button handling, filtering when choosing
files, and further refinement to Pixbuf. Thanks to Peter Mossveld, Kenneth
Prugh, Vreixo Formoso, Serkan Kaba.</p>

<p>Finally, thanks to Guillaume Mazoyer we now have coverage of <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gtk/EntryCompletion.html">EntryCompletion</a>,
the feature of Entry Widgets whereby available possible completions are
offered to the based on characters the user has typed so far.</p>

<h2>Looking ahead</h2>

<p>There are a number of people working on various branches &#8212; some small feature
extensions, and some major coverage additions that add signifant capabilies &#8212;
but which haven&#8217;t quite made it to the point where they can be merged into
java-gnome. We&#8217;ll see how these pieces of work fare in the coming months, but
nevertheless the Java bindings for GNOME have reached a significant level of
maturity and we are pleased to see people starting to use them for serious
application work.</p>

<hr />

<p><em>This release is already packaged for <a href="http://packages.gentoo.org/package/dev-java/java-gnome">Gentoo</a> and <a href="https://launchpad.net/~respawneral/+archive/ppa/">Ubuntu</a>, which is sweet.</em></p>

<p><em>You can download java-gnome&#8217;s sources 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>:</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><em>though if you&#8217;re going to do that you&#8217;re best off following the instructions in the</em> <a href="http://java-gnome.sourceforge.net/4.0/HACKING.html"><code>HACKING</code></a> <em>guidelines.</em></p>

<p><em>Enjoy!</em></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/java-gnome</category>
      <pubDate>Tue, 28 Jul 2009 07:48 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.12-release</guid>
    </item>

    <item>
      <title>DART data</title>
      <link>http://blogs.operationaldynamics.com/andrew/engineering/oceanic/tsunami-dart-data.html</link>
      <description><![CDATA[<p>A couple weeks ago an earthquake in south-western South Island, New Zealand, triggered a tsunami. The alert text put out by the Australian Bureau of Meteorology was:</p>

<pre><code>    An undersea earthquake of magnitude 7.9 at Latitude 45.960S
    Longitude 166.470E occurred at 07:22 pm EST on Wednesday 15 July
    2009 near OFF W. COAST OF S. ISLAND, N.Z.. Sea level
    observations have confirmed a tsunami has been generated.
</code></pre>

<p>&#8220;Alert&#8221; is actually a bit of a misnomer; it was in the <em>weather forecast</em>. I only accidentally noticed the warning when I happened to check GNOME&#8217;s trusty little <code>weather-applet</code> wondering whether it was likely to be sunny the next day. So it&#8217;s great that I saw the alert there, but, if there&#8217;s a warning then I think gnome-applets needs to freak out a little to get the user&#8217;s attention. Maybe a different current-weather icon in the panel? Or better yet, a libnotify popup (&#8220;run for the hills&#8221; is a little more important than &#8220;your battery is low&#8221;)?</p>

<p>Anyway, as all this was going on, I was curious about the obvious question: &#8220;how do you detect such a thing a tsunami wave in the deep ocean?&#8221; One of the things about such energy is that although real tsunami become disasterous (ie huge) when they hit shallow water, out in the deep ocean they are not much more than a tiny ripple. Hard to notice amongst swell and chop.</p>

<p>Various national agencies have tsunami detection instruments floating around out on the high seas. These graphs show the data as gathered from buoy 55015 on the evening of 15 July:</p>

<p><img src="/andrew/engineering/oceanic/dart-55015-15s.png" alt="day" title="" /></p>

<p>which doesn&#8217;t appear to mean much, until you realize that the monitoring systems switch to transmitting high-resolution data when they detect an event; the longer time base data around the event above looked as follows, and suddenly it becomes clear that they noticed something abnormal:</p>

<p><img src="/andrew/engineering/oceanic/dart-55015.png" alt="day" title="" /> <br />
<em>Snapshots taken from the National Data Buoy Centre <a href="http://www.ndbc.noaa.gov/station_page.php?station=55015">real time</a> data page as presented on 15 July 2009; if you dig around you can find historical data there too.</em></p>

<p>It would appear that general sinusoidal trend line on the above is normal variation; sure enough if you look at today&#8217;s 15-minute data,</p>

<p><img src="http://www.ndbc.noaa.gov/plot_dart.php?station=55015&amp;uom=M&amp;width=400&amp;height=220&amp;start=20090723000000&amp;end=20090727235959" alt="today" title="" /></p>

<p>it&#8217;s pretty clear that normal measurement is tidal variation. Huh.</p>

<h2>Column height</h2>

<p>Anyone who has spent time out on the water knows full well that the surface is insanely variable; that got me wondering how they measure the waves going by (more to the point, how do they notice a tsunami wave a couple centimetres in size out amongst the randomness of wind driven chop and ocean swell?).</p>

<p>Well, it turns out that these at-sea buoys are not taking soundings from the surface as they bob around. The instruments are placed on the sea floor (!) and measure the hight of the water column as inferred by the water pressure.</p>

<p><a href="http://www.ndbc.noaa.gov/dart/dart.shtml"><img src="http://www.ndbc.noaa.gov/dart/dart_mooring.jpg" border="0"/></a> <br />
<em>Image from the NOAA National Data Buoy Centre page about DART buoys</em>.</p>

<p>Note to super-tanker drivers: please don&#8217;t hit these. Thanks.</p>

<h2>Never cry wolf</h2>

<p>Thankfully, this earthquake and the associated ocean wave it generated did not result in a destructive tsunami when it reached the coastlines in the region. The fact that the authorities raised a high-profile alert for what turned out to be a non-event, however, raises the risk that the next time there is a tsunami wave detected the warning will be ignored by the news media.</p>

<p>The essential message remains, though: detecting waves is one thing (and impressive!). Forecasting destructive potential is another, and that part is still a very grey area. Hopefully people will accept this.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>engineering/oceanic</category>
      <pubDate>Mon, 27 Jul 2009 11:05 GMT</pubDate>
      <guid isPermaLink="false">tsunami-dart-data</guid>
    </item>

    <item>
      <title>Roman Numerals</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/libraries/unicode-roman-numerals.html</link>
      <description><![CDATA[<p>Some things about Unicode are really impressive. And some things just make you wonder.</p>

<p>Why are there unicode characters for roman numerals? ie, Why is U+2167 &#39;Ⅷ&#39; better than VIII? And, whoa, thank God that there&#8217;s U+216F &#39;Ⅿ&#39; there, because otherwise I&#8217;d have to use the letter &#39;M&#39; to write ©MMIX.</p>

<p>As we were chatting about this in <code>#gnome-hackers</code>, Xan Lopez found a wikipedia <a href="http://en.wikipedia.org/wiki/Roman_numerals#Unicode">entry</a> about it which seems to say &#8220;Only for compatibility&#8221; &amp; &#8220;do not use&#8221;. I can handle that.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/libraries</category>
      <pubDate>Tue, 12 May 2009 06:46 GMT</pubDate>
      <guid isPermaLink="false">unicode-roman-numerals</guid>
    </item>

    <item>
      <title>java-gnome 4.0.11 released!</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/java-gnome/java-gnome-4.0.11-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.11 (1 May 2009)</h1>

<p>This is a bug fix release.</p>

<p>We made a few mistakes in our handling of the PangoAttribute structures&#8217;
memory which resulted in VM crashes [unfortunately, the normal GNOME way of
debugging things is to <code>SIGSEGV</code>. That&#8217;s fine for a C program but Bad™ for
your average Java Virtual Machine as it takes out the entire process. We
therefore work rather hard to avoid &#8212; or at least trap &#8212; this sort of
thing]. Releasing corrections for these bugs was a priority.</p>

<p>Concurrently a significant internal improvement in our handling of
accumulating Attributes into AttributeLists was made. While this is not user
visible <em>per se</em>, we were able to drop the requirement that the text you were
formatting already be in the Pango Layout before assigning the range that the
Attribute would cover. You also no longer need to pass that Layout to
<code>setIndices()</code> when building up Attributes.  This makes things a great deal
easier if you are simultaneously aggregating the text and assigning markup.</p>

<p>Martin Garton contributed some documentation quality improvements and new
coverage. Serkan Kaba made some minor fixes to ensure the unit tests run in a
Turkish locale. And as ever there are small incremental improvements to
various classes, including a number of additional properties exposed care of
the work of new contributor Thijs Leibbrand.</p>

<h2>Looking ahead</h2>

<p>This was a brief cycle; as noted we&#8217;re mostly pushing some bug fixes.
Meanwhile there are a number of significant branches underway by various
hackers; which, hopefully, will feature prominently in the next release.</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>&#8216; <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><em>though if you&#8217;re going to do that you&#8217;d best follow the</em> <a href="http://java-gnome.sourceforge.net/4.0/HACKING.html"><code>HACKING</code></a> <em>guidelines.</em></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/java-gnome</category>
      <pubDate>Sun, 03 May 2009 09:10 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.11-release</guid>
    </item>

    <item>
      <title>Changed blog engines</title>
      <link>http://blogs.operationaldynamics.com/andrew/meta/pyblosxom/switched-to-pyblosxom.html</link>
      <description><![CDATA[<p>We switched from our long standing [the original Perl] blosxom installation and are now using <a href="http://pyblosxom.sourceforge.net/">pyblosxom</a> instead [same idea, just in Python, a bit more up to date, and a nicer plugin architecture]. Appropriate redirects are in place, so hopefully no one will notice. My blog&#8217;s RSS 2.0 feed URL is now <a href="http://blogs.operationaldynamics.com/andrew/index.xml"><code>http://blogs.operationaldynamics.com/andrew/index.xml</code></a></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>meta/pyblosxom</category>
      <pubDate>Sun, 03 May 2009 02:21 GMT</pubDate>
      <guid isPermaLink="false">switched-to-pyblosxom</guid>
    </item>

    <item>
      <title>Risk analysis</title>
      <link>http://blogs.operationaldynamics.com/andrew/operations/enterprise/overcoming-fear.html</link>
      <description><![CDATA[<p>I&#8217;ve got a client who needs to get a critical production system upgraded. Frankly, the risks involved &#8212; and indeed the plans one prepares &#8212; don&#8217;t really change from site to site; but each event is still unique and takes careful investigation to make sure you&#8217;ve figured out all the interactions you need to look after.</p>

<p>Anyway, one of the pieces of this system is MQ (which, in case you&#8217;ve not heard of it, is a very widely adopted &#8212; if somewhat cumbersome and archaic [not to mention proprietary and commercial] &#8212; enterprise message queue platform; no, you&#8217;re not missing much, and yes, there are open source alternatives). So the other day I was quietly investigating the sequence involved in doing an upgrade of an existing MQ installation. Along the way I came across a <a href="http://mqseries.net/phpBB/viewtopic.php?t=48743">forum</a> posting by someone asking a similar question to what I had in mind:</p>

<blockquote>
  <p>Q: Is is possible to move directly from MQ V5.3 to V7.0???</p>
</blockquote>

<p>ie, skipping MQ 6.0. A reasonable thing to ask (even if they did overdo the question marks); these things are not always obvious and sometimes you have to go through an intermediate step. An experienced individual quickly replied:</p>

<blockquote>
  <p>A: Yes.</p>
</blockquote>

<p>Which was terrific. An enlightening answer; to the point, authoritative, direct, and concise. Very helpful. Well done, and much appreciated.</p>

<p>I was certainly well satisfied at that point, pleased to be able to benefit from the shared wisdom of the global village. Our erstwhile original poster, however, under the mistaken assumption that the internet is a place where you can go to get people to do your job for you for free, continued on with a degree of persistent sticktoitiveness that one can only admire:</p>

<blockquote>
  <p>Q: What kind of challenges do we need to face during this process??</p>
</blockquote>

<p>The answer wasn&#8217;t long coming:</p>

<blockquote>
  <p>A: Overcoming any fear of reading the documentation.</p>
</blockquote>

<p><code>:)</code></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>operations/enterprise</category>
      <pubDate>Tue, 28 Apr 2009 02:52 GMT</pubDate>
      <guid isPermaLink="false">overcoming-fear</guid>
    </item>

    <item>
      <title>No typing day</title>
      <link>http://blogs.operationaldynamics.com/andrew/travel/canada/no-typing-day.html</link>
      <description><![CDATA[<p>An old friend popped into an IRC channel and said:</p>

<blockquote>
  <p>&#8220;Sorry I&#8217;ve been out of touch; I&#8217;ve been away travelling on business.&#8221;</p>
</blockquote>

<p>Interesting contrast. When I&#8217;m on business travel I tend to be <em>more</em> in contact.</p>

<p>Or, perhaps it&#8217;s just that I&#8217;m just more conscious of it, since one has to go to extra trouble to get email in airports, retrieve messages from hotel rooms, and find ways to make affordable phone calls (instead of succumbing to the temptation to just using your mobile at the cost of having to sacrifice a major organ to pay the roaming fees), etc.</p>

<p>I&#8217;ve noticed that it actually takes me going off trekking to get away from the curse of modern communications. Being up in the mountains is about as uplifting an experience as you get, but I&#8217;m sad to say that at least part of it must be the freedom from not having to check your email.</p>

<p><a href="http://www.flickr.com/photos/afcowie/3439702363/" ><img alt="Pine trees on Grotto Mountains, Banff" src="http://farm4.static.flickr.com/3341/3439702363_c5a2424c95.jpg" border="0" /></a><br>
<i>Half way up Grotto Mountain near Banff, Alberta, Canada.</i></p>

<p>Even harder &#8212; but essential &#8212; is that once in a while you need to have a <strong>no typing day</strong>. It&#8217;s should be easy to just decide not to do any typing tomorrow, but it&#8217;s astoundingly difficult to actually schedule such a day &#8212; especially when you&#8217;re an Open Source hacker and all you want to do with your spare time is work on the things you love.</p>

<p>But just as serious athletes need to take rest days to prevent over-use injuries, so does anyone who spends huge numbers of hours in front of a computer need to take a day off once in a while. We all need to give the tendons and fine motor muscles in our fingers, wrists, and forearms a rest. I&#8217;m not talking about &#8220;typing breaks&#8221; periodically though the day (I mean, jeesh, just get up and go for a glass of water), but an entire day with no keyboard, no mouse, and no being hunched over starting at the screen.</p>

<p>If you can, take a no typing day once every two weeks. It may not seem like much, but makes a wonderful difference to well-being. And since you&#8217;re not sitting at your computer, you might as well head up into the mountains instead. <code>:)</code></p>

<p><em>That I had to type this is an irony that does not escape me.</em></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>travel/canada</category>
      <pubDate>Tue, 14 Apr 2009 02:50 GMT</pubDate>
      <guid isPermaLink="false">no-typing-day</guid>
    </item>

    <item>
      <title>3 mobile broadband on Linux</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/e160g-and-networkmanager.html</link>
      <description><![CDATA[<p>I had to get a mobile broadband gizmo this week. It&#8217;s something I&#8217;ve been avoiding (not having internet access while sitting at a cafe by the beach is a feature, not a bug), but I need it for a current client. After advice from one of my colleagues that &#8220;<a href="http://www.three.com.au/">3</a>&#8221; (one of the carriers here and the first that did 3G digital phones in Australia) was reliable and, more importantly, that their device worked with Linux, I went and picked one up along with a prepay SIM.</p>

<p>3&#8217;s offering has two devices at the same price right now; the Huawei E160G and the ZTE MF627.
I thought my friend had the latter and so bought that one. Big mistake.</p>

<table align="center">
<tr align="center">
<td width="200px"><b>E160G</b><br>Bit older<br>works great</td>
<td width="200px"><b>MF627</b><br>Brand new<br><span style="color: red">doesn&#8217;t work</span></td>
</tr>
<tr align="center">
<td><img style="padding-left:0px" src="http://www.compare3gmobilebroadband.co.uk/images/3g_routers/usb/3-e156-usb-modem.jpg"></td>
<td><img style="padding-left:10px" src="http://www.compare3gmobilebroadband.co.uk/images/3g_routers/usb/three-zte-mf627-3g-modem.jpg"></td>
</tr>
</table>

<p><strong>Do not get the ZTE MF627 device if running Linux.</strong> Stay away from it. Even after trying the <code>usb_modeswitch</code> hassles, it still does not present as the device as a GSM modem like it is supposed to. Tried it on two separate laptops; one running Gentoo, the other with Ubuntu&#8217;s &#8220;J&#8221; version on it. Spent the better part of a day researching and debugging the issue, but no joy on either. One person in London claims to have a similar device working, but comparing their <code>lsusb</code> and <code>dmesg</code> output, I&#8217;m not convinced the electronics in the one available here were the same; after doing a mode switch the miniSD adapter presents, but not the modem. Anyway, sure, maybe someday someone will figure out how to make it work here, but that&#8217;s not right now.</p>

<p><em>Even worse, people writing in places like Whirlpool cite chronic quality problems with ZTE devices. Clearly this is something to avoid.</em></p>

<p>I took the thing back to the store the next day and finally managed to get a refund which I promptly used to buy their other device (why they couldn&#8217;t just do an exchange was as puzzling to the poor guy in the store as it was to me. Whatever; they kept him on the phone for almost an hour while the corporate drones he had to call for permission made up their minds that it was ok to give me my money back).</p>

<p>So home I went with a Huawei E160G (which <em>is</em> what Peter had) and it worked perfectly, right out of the box, literally. Plugged it in, device properly recognized by USB subsystem and, after adding a &#8220;mobile broadband&#8221; connection with NetworkManager <code>0.7</code>, it immediately started working. Pretty amazing.</p>

<p>You need to have the PPP stack built into your kernel and <code>pppd</code> installed (once upon a time we all had that, but most of us haven&#8217;t needed to do point-to-point over a dialup modem for years, so if you&#8217;re running a modern system with a custom Linux kernel you might not have it). The relevant kernel modules are &#8220;<code>ppp_async</code>&#8220;, &#8220;<code>usbserial</code>&#8220;, and &#8220;<code>option</code>&#8220;.</p>

<p>So a big hooray to the NetworkManager team and all the people working on the drivers that made this magic work. That NetworkManager seamlessly handles all the PPP configuration and dialing is brilliant.</p>

<p><img src="http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/mobile-broadband.png" alt="mobile broadband connection in NetworkManager" title="" /> <br />
<em>Neat connection active icon.</em></p>

<p>And as for the lovely staff in the store, don&#8217;t let them tell you that their service doesn&#8217;t work on Linux &#8212; but do get a device that does.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/gnome-desktop</category>
      <pubDate>Sat, 07 Mar 2009 06:03 GMT</pubDate>
      <guid isPermaLink="false">e160g-and-networkmanager</guid>
    </item>

    <item>
      <title>java-gnome 4.0.10 released!</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/java-gnome/java-gnome-4.0.10-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.10 (5 Mar 2009)</h1>

<p><em>Sculptures made of letters</em></p>

<p>This release is a landmark, because it features coverage of the Pango text
rendering library and so, along with our coverage of Cairo, brings us to a
complete solution for drawing graphics with text &#8212; be they custom Widgets,
PDF documents, or beautiful vector illustrations.</p>

<p>In addition to merging Pango work from numerous contributors, we have made
massive improvements to our Cairo coverage, support for writing PDFs, and
better access to the system Clipboard.</p>

<h2>Drawing API improvements</h2>

<p>We&#8217;ve done a huge amount of refinement to our APIs for the ever fabulous Cairo
Graphics drawing library, including full coverage of matrix translations,
rotations, and scaling and more integrated ways of setting the source pattern
to be used in stroke, paint, and fill operations. <img
src="http://java-gnome.sourceforge.net/4.0/doc/api/org/freedesktop/cairo/Matrix-translate.png" alt="" style="float:
right; text-align: right; padding-left: 15px;" /> Thanks to Kenneth Prugh for
having seen this through and having done the lion&#8217;s share of the testing. <img
src="http://java-gnome.sourceforge.net/4.0/doc/api/org/freedesktop/cairo/Context-arcNegative.png" alt=""
style="float: right; text-align: right; padding-left: 15px; clear: right;" /></p>

<p>We&#8217;ve also had a number of improvements in the lower levels of GTK relating to
image rendering. The gdk-pixbuf library contains a capable image parser and we
can now feed it directly from a Pixbuf constructor. Thanks to new contributor
Martin Garton for his hard work getting that tested and accepted.</p>

<p>Drawing graphics often also requires drawing text. This release features
coverage of Pango, GNOME&#8217;s powerful text rendering library. Pango is not just
about drawing mere glyphs; it also includes a sophisticated paragraph layout
engine which gives us a capable solution for drawing text onto Cairo Surfaces.</p>

<p>Thanks are due to Serkan Kaba and Kenneth Prugh have both been really helpful
testing; it was Vreixo Formoso who did the original leg work in April that
identified Layout as the key class that we needed to concentrate on and
cleaned up much of the underlying infrastructure.</p>

<p>As we were working on this we had occasion to continue the polish in and
around the TextView / TextBuffer APIs, including a number of convenience
methods for inserting text while simultaneously applying multiple TextTags,
and supporting changing default fonts.</p>

<p>We&#8217;ve also modelled &#8220;notify signals&#8221; for when a property changes; see the
<code>TextBuffer.NotifyCursorPosition</code> signal for this in action.</p>

<p>Finally, thanks to contributions from Zak Fenton and Kamil Szymala we have
support for applications running in composited window managers to have
transparent backgrounds &#8212; which is an exceptionally cool effect, even if it
doesn&#8217;t have much to do with creating HIG compliant usable applications <code>:)</code>.</p>

<h2>Handling cut & paste</h2>

<p>The GTK clipboard APIs are fairly complex, in no small part because the
underlying implementations in X are really rather complex. Our coverage here
in java-gnome is still fairly basic relative to that, but it&#8217;s been enough for
people working on applications like text editors to write text to the system
clipboard, get notification when the clipboard changes, and read text back out
again.</p>

<h2>Printed document support</h2>

<p><img src="http://java-gnome.sourceforge.net/4.0/doc/examples/cairo/ExampleLinedPaper.png" alt="" 
style="float: right; text-align: right; padding-left: 15px; clear: right;" />
The work on Pango noted above represented the essential machinery necessary to
make effective use of Cairo&#8217;s PDF backend, and this has started us down the
road of covering the GNOME printing APIs.  You can now generate <code>.pdf</code>
documents with java-gnome, and we&#8217;ve included an fun
<a href="http://java-gnome.sourceforge.net/4.0/doc/examples/START.html#ExampleLinedPaper">example</a> showing this in action.</p>

<p>Thanks to Nathan Strum for permission to use one of his sketches in the
example (you might find reading the <a href="http://www.atariage.com/forums/index.php?automodule=blog&amp;blogid=118&amp;showentry=5460">blog</a> where we found this
interesting &#8212; it&#8217;s a fascinating expos&eacute; of a graphic artist in action).</p>

<h2>Continuing improvement</h2>

<p>Thanks to new contributor Stefan Schweizer we now have better coverage of
signals relating to Notebook style Containers, and to new contributors Miloud
Bel and Bruno Dusausoy for numerous small improvements in and around
ProgressBar.</p>

<p>Miscellaneous documentation improvements and minor feature improvements always
feature in our releases, with minor changes having accrued in many classes.</p>

<p>Just as important as new coverage is getting rid of cruft that we don&#8217;t need.
Libraries like GTK and GDK are, like any other mature project, full of
deprecated, obsolete, and unnecessary code &#8212; not to mention things that we
just plain don&#8217;t need in a Java binding of these underlying native libraries.
We&#8217;re already pretty good about not generating translation Java or JNI C code
for such things; this release continues our refinements in this area with a
considerable refinement of the <code>.jar</code> and <code>.so</code> which is ultimately what we
ship.</p>

<p>Finally, it&#8217;s worth noting that java-gnome&#8217;s test suite is now 40 unit test
classes with 186 individual test fixtures. Combined with over 30 screenshot
generating programs and 17 example programs, we actually have surprisingly
good test coverage of our library. It&#8217;s high time they &#8212; and more to the
point the people who work hard to create such tests &#8212; got as much credit as
the visible public APIs do.</p>

<p>Anyone can run the tests (and anyone wanting to submit a patch had <em>better</em>
run the tests!); they&#8217;ve been accumulating since java-gnome 4.0.0; it&#8217;s just:</p>

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

<p>and</p>

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

<p>If you&#8217;re working in Eclipse launch class <code>UnitTests</code> as a JUnit test suite.</p>

<h2>Build improvements</h2>

<p>We have some fixes from new contributor Przemysław Grzegorczyk ensuring we
include the correct headers in a few corner cases. This came to us via work on
a GNOME Love bug, which is a first for us. Thanks!</p>

<p>Meanwhile, the ever industrious Serkan Kaba has added some changes to ensure
that our magically locating the native shared library component of java-gnome
works properly even under strange and unusual conditions.</p>

<p>Configuration and prerequisite detection on Open Solaris is improved thanks to
reports from new contributor Kamil Szymala.</p>

<p>Instructions for how to optimally lay out your branches when working with
java-gnome have been moved to the <code>HACKING</code> file. People
intending to hack on the bindings from Eclipse are <em>really</em> urged to set
things up this way as it will make their lives much easier. Also, using the
latest release of Bazaar (ie <code>bzr &gt;= 1.12</code>) is definitely recommended &#8212; it&#8217;s
getting really fast. We&#8217;ve upgraded our public branches, so you will need
<code>1.9</code> at a minimum.</p>

<p>Note to those creating packages for distributions: java-gnome now depends on
the current stable GTK (ie <code>gtk+ &gt;= 2.14</code>).</p>

<h2>Looking ahead</h2>

<p>Coverage of Poppler, GNOME&#8217;s PDF rendering library is well along, but didn&#8217;t
quite make it in time for this release. It could very likely feature in the
next version of java-gnome, as might coverage of GConf, GNOME&#8217;s simple store
for application configuration options. People are also known to be working on
coverage of GtkSourceView, libwnck, and librsvg. We&#8217;ll see what gets
contributed!</p>

<p>The most exciting part about java-gnome at the moment, though, is the number
of people working hard on applications using it. It takes a <strong>long</strong> time to
write a mature, well rounded, robust end-user program, but there are some
pretty cool projects ticking away out there, and it has been terrific to see
the authors of these projects joining our community.</p>

<p>Happy developing,</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>&#8216; <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><em>though if you&#8217;re going to do that you&#8217;d best follow the</em> <a href="http://java-gnome.sourceforge.net/4.0/HACKING.html"><code>HACKING</code></a> <em>guidelines.</em></p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/java-gnome</category>
      <pubDate>Fri, 06 Mar 2009 21:58 GMT</pubDate>
      <guid isPermaLink="false">java-gnome-4.0.10-release</guid>
    </item>

    <item>
      <title>Miraculous</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/laptop-boom.html</link>
      <description><![CDATA[<p>While at <a href="http://www.marchsouth.org/">linux.conf.au</a> a few weeks ago, my laptop decided to blow. It had been twitchy with suspend and resume for about a day, and then Tuesday, not 48 hours until I was scheduled to give the GTK &amp; GNOME tutorial, the thing quite petulantly decided to stop booting. No POST. Nothing. <strong>Zap</strong>.</p>

<p>Eeek!</p>

<p>Now, laptops breaking are nothing special, and I do keep fairly regular backups. So I wasn&#8217;t that concerned about data loss. But in so far as the live-action style tutorials I give are less about formal presentation slides (though I do have lots of those as backdrop) and instead more <em>&#8220;everyone gather around and watch Andrew play in his happy place&#8221;</em>, suddenly losing my development meant that actually coding live in front of people was looking to be a bit of a problem.</p>

<p>My current laptop is from ASUS, and I&#8217;ve been very happy with it. That it fried, ok, fine whatever. But as we were now in Hobart, Tasmania I had a real problem. I needed a mainboard replacement. Fast. ASUS has service centres in Perth, Brisbane, Sydney, and Melbourne. But not Hobart.</p>

<p>Several people offered to lend me a laptop &#8220;for the presentation&#8221; which was lovely of them, but given that it wasn&#8217;t just me playing a slide deck but rather me needing my full development stack on board such a machine &#8212; and more to the point, me needing my system so I could get back to real work during and after the conference &#8212; my option space was very limited.  Indeed, it took me all of about 3 seconds to realize that I was going to be on a flight (to Melbourne, probably) in about 90 minutes. Sure I could have couriered it and had it back in a &#8220;few days&#8221; but I patently did not have that kind of time.</p>

<h2>Steve to the rescue</h2>

<p>I was in the process of booking my flight out when <a href="http://www.nerdvana.org.au/steve/">Steve Walsh</a> suggested that he might have a system I could use. At first it was borrowing one of the desktop machines they had around (yup, would have worked), but then he realized he might be able to lend me &#8220;the conference laptop&#8221;, which was a computer that Hewlett-Packard had donated to linux.conf.au a year or so ago. Josh wasn&#8217;t using it anymore, and Ben agreed I could use it. You guys are awesome.</p>

<p>As I was thinking about what I&#8217;d have to do to bootstrap and restore off of my closest available backup (on an SD card, but that&#8217;s a story for another day), I saw one of these lying on the table</p>

<p><img src="http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/usb-enclosure.jpg" alt="usb hard drive enclosure" title="" /></p>

<p>and we suddenly had a very bright idea. Why not pop the hard drive out of my laptop and put it in that thing?</p>

<p>I had already considered putting my hard drive into the new laptop, but only for a brief moment. Even assuming it fit, I happen to have a very tightly tuned kernel and I knew was unlikely to have enough drivers to get booted on foreign hardware. Besides, the Linux installation on the new laptop was already running great.</p>

<p>But why not try putting my drive into Steve&#8217;s external USB enclosure? Would that even be possible?</p>

<p>Steve cracked his enclosure open and carefully extracted his drive. Then we started removing endless screws from my system and found our way down to the harddisk compartment and pulled my drive out:</p>

<p><img src="http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/drive-out.jpg" alt="laptop with drive extracted" title="" /></p>

<p>To be honest, I would never have attempted such a thing, but Steve knew what he was doing (and more importantly, had all his tools handy). So, having taken the cradle off of my drive, we even more delecately then attached the enclosure&#8217;s logic board to my drive.</p>

<ul>
<li>Miracle #1: <strong>the connector from my drive fit the one in the enclosure.</strong></li>
</ul>

<p>(I gather that these things are &#8220;standardized&#8221; but still. The hardware you find in your average laptop is always wacky and weird. So I was pretty excited) With that done, we plugged it into the new system:</p>

<p><img src="http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/naked-drive.jpg" alt="my drive in enclosure attached to foreign laptop" title="" /></p>

<p>and to my supreme happiness,</p>

<ul>
<li>Miracle #2: <strong>the drive&#8217;s filesystems mounted to <code>/media/disk</code></strong></li>
</ul>

<p>Hooray for the Linux kernel, HAL, the GNOME automounter, Nautilus, and everything else that made that work.</p>

<p>And then, even better,</p>

<ul>
<li>Miracle #3: <strong>whatever it was that took out my laptop&#8217;s mainboard did not zorch my hard drive.</strong></li>
</ul>

<p>Hooray! My data was all ok!</p>

<p>A little fiddling about to make sure there was now a user <code>andrew</code> with a matching UID on the Ubuntu system, and then, very simply:</p>

<pre style="background: black; color: white; padding: 10px;">
$ rsync -av... /media/disk /home/andrew
</pre>

<p>Outstanding.</p>

<p>So thanks to the help of Steve and the others, I had my <code>/home</code> on this new system. And one of the magic things about the GNOME Desktop for the last few years has been them safely writing down everything you need to run, so pretty much instantly I had my happy place back.</p>

<p>The data, at least.</p>

<h2>Comparing distros; comparing laptops</h2>

<p>The one problem I still faced was that the system in hand was not configured as a development machine. I had to work out what the appropriate packages were for all the different bits and pieces I was accustomed to having.</p>

<p>One thing I really like about Gentoo is that they clued in long ago that disk space is cheap and that things like <code>.h</code> files don&#8217;t take up that much room. So when you install a package on Gentoo you get development tools, header files, debug symbols [if so configured], compilers, documentation, the works. I had forgotten that Debian and Debian derived systems like Ubuntu do not install all the development libraries and tools. So I proceeded to tear my hair out for over a day wading through endless package lists trying to find what I would need to get development headers and the various tools necessary to build software (the morning of the tutorial I discovered the laptop didn&#8217;t have any man pages. What the hell?)</p>

<p>Granted, such things are essentially trivialities, and I accept that they were the sort of thing that one runs into when working on a new system. No big deal. 
Sure I could easily have built a Gentoo system in less time, but it&#8217;s not my machine and in any case I was enjoying the learning experience.</p>

<p>Far more interesting was living on a new distro for a few weeks. It was nice to experience all this &#8220;polish&#8221; that I&#8217;ve heard people going on about, and I was indeed duly impressed. After a while, though, I started to notice all kinds of little changes that Canonical has made to the Desktop that are really cool, but which have not been contributed back upstream to GNOME. That bothers me a little bit, but I&#8217;m hopeful that in time this sort of practise will fade in favour of them working more closely with the upstream projects they are using.</p>

<p>Meanwhile I also got to trial a new laptop brand. I gotta say I was really impressed with the build quality, robustness, and power efficiency of the HP corporate laptop line. This one is a couple model-years old, but I was able to have a few good chats with <a href="http://www.gag.com/~bdale/">Bdale Garbee</a> about it and he walked me through their current line up. After this experience I can definitely say that we will be getting HP laptops in the future.</p>

<p><em>Drove me nuts having a different keyboard layout to deal with for a few weeks. And having just about spent enough time on it to get it in my fingers, now my laptop is repaired and I&#8217;m once again mistyping everything&#8230;</em> <code>:)</code></p>

<p>Again, thanks to Steve who totally saved the day. And thanks to everyone anywhere who ever contributed to all the wonderful software that made the transfer from one system to another miraculous &#8212; and easy.</p>

<h2>What about next time?</h2>

<p>So what I have I learned?</p>

<p>I travel a huge amount, and having my laptop blow up is clearly something I need to be more prepared for. Remote backups are still necessary, of course, and the SD card I carry around with more or less continues snapshots of my critical files is also clearly going to continue.</p>

<p>But it&#8217;s kinda obvious to me now that it would be a good idea to carry around an external USB enclosure with a hard drive big enough to back up my <em>entire</em> system &#8212; nice encrypted partition and all set, just <code>rsync</code> the whole damn thing. Disk space is cheap. Along with a boot partition holding a nice generic runs-everywhere kernel, that would be enough to not only recover from, but also boot from live the next time my computer fries.</p>

<p>AfC</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/gnome-desktop</category>
      <pubDate>Mon, 02 Feb 2009 13:16 GMT</pubDate>
      <guid isPermaLink="false">laptop-boom</guid>
    </item>

    <item>
      <title>Positive Y</title>
      <link>http://blogs.operationaldynamics.com/andrew/software/java-gnome/cairo-arcs.html</link>
      <description><![CDATA[<p>The excellent <a href="http://www.cairographics.org/">Cairo</a> graphics library has a simple function to draw arcs; in C it&#8217;s <code>cairo_arc()</code>; from java-gnome it&#8217;s Context&#8217;s <code>arc()</code> method, etc.</p>

<p>Quite unsurprisingly they define increasing angles as going from the positive <em>x</em> axis on toward the positive <em>y</em> axis. Nothing unusual about that. The only thing that was surprising is that they even mention this in their documentation.</p>

<p>I should know better.</p>

<p>What I totally missed was the <em>implication</em> of this. I didn&#8217;t quite clue in that the positive <em>y</em> direction in screen positioning and page drawing is <strong>down</strong>, and so increasing angles go <strong>clockwise</strong>. Using <code>cr.arc()</code> to go from <code>0</code> to say <span style="font-family:'Times New Roman','Liberation Serif'; font-size:12pt;">&pi;</span>/3 radians does <em>not</em> give a rise of 60&deg; like I expected; it gives this:</p>

<p><img src="http://java-gnome.sourceforge.net/4.0/doc/api/org/freedesktop/cairo/Context-arc.png" alt="cairo arc positive" title="" /></p>

<p>Whoa. This is not the counter-clockwise increasing <span style="font-family:'Times New Roman','Liberation Serif'; font-size:12pt;">&#952;</span> like we&#8217;re all used to seeing in normal Cartesian or Polar co-ordinates. But it <em>is</em> indeed increasing toward the positive <em>y</em> axis. Oops. Oh well <code>:)</code></p>

<p>So I made this illustration and added it to the documentation for Context&#8217;s <a href="http://java-gnome.sourceforge.net/4.0/doc/api/org/freedesktop/cairo/Context.html#arc" title="double,%20double,%20double,%20double,%20double"><code>arc()</code></a> method. Really it&#8217;s mostly about pointing out which direction positive <em>y</em> is, but when I&#8217;ve learned something like this the hard way, I do my best to try and incorporate that knowledge into our public API. With any luck others can be spared my folly.</p>

<p><em>Drawn with Cairo, of course!</em></p>

<p>AfC</p>

<p>Update: Some people have pointed out that you can use a transformation matrix, and if you happen to (say) mirror across the horizontal axis then the clockwise notion would no longer apply. Fair enough; but if you have forgotten that +<em>y</em> starts out going down, then you&#8217;re not going to think to do such a flip in the first place.</p>
]]></description>
      <author>andrew@operationaldynamics.com (Andrew Cowie)</author>
      <category>software/java-gnome</category>
      <pubDate>Sun, 21 Dec 2008 15:47 GMT</pubDate>
      <guid isPermaLink="false">cairo-arcs</guid>
    </item>

  </channel>
</rss>
