<?xml version='1.0' encoding='ISO-8859-1'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-5144379</id><updated>2010-02-20T00:20:47.521Z</updated><title type='text'>Peter Brett's Blog</title><subtitle type='html'>Peter Brett's website news, random thoughts and articles on space technology...</subtitle><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default?start-index=26&amp;max-results=25'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://peter-b.co.uk/blog/atom.xml'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>219</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5144379.post-4373117081599280978</id><published>2010-02-20T00:20:00.001Z</published><updated>2010-02-20T00:20:47.638Z</updated><title type='text'>GTK+ no longer supports Windows, apparently</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;


&lt;p&gt;When writing computer programs, I try to ensure that they are
  portable enough to run on as many different platforms as possible
  without modifying the source code.  This becomes tricky when I'm
  writing in C and I want to provide a vaguely-modern-feeling user
  interface.  Since about 2006, I've relied
  on &lt;a href='http://www.gtk.org/'&gt;GTK+&lt;/a&gt;, the basis of
  the &lt;a href='http://www.gnome.org/'&gt;GNOME&lt;/a&gt; desktop environment,
  as my GUI library of choice. A good example of a piece of GTK+-based
  software for which I'm a member of the development team is
  the &lt;a href='http://www.gpleda.org/'&gt;gEDA project&lt;/a&gt;, a collection
  of tools for electronics design.&lt;/p&gt;

&lt;p&gt;One of the attractions of GTK+ for me has always been its ability
  to be used on both X Window System-based operating systems
  (e.g. Linux and BSD) and on Microsoft Windows. Unfortunately, it
  seems that Windows support has now been discontinued.&lt;/p&gt;

&lt;p&gt;Back in September, GTK+ 2.18 was released.  Unfortunately, it
  contained
  &lt;a href='https://bugzilla.gnome.org/show_bug.cgi?id=598299'&gt;a large
  regression&lt;/a&gt; which has caused some headaches for people working
  with GTK+ on the Windows platform (essentially, GTK+ applications
  would be completely unusable in some cases). Furthermore, a rewrite
  of some core GTK+ code inbetween 2.16 and 2.18 left the GTK+ on
  Windows infested with a host of other minor but annoying bugs.&lt;/p&gt;

&lt;p&gt;Now, what normally happens when an Open Source program upon which
  literally thousands of applications and millions of users depend has
  a major stable release containing a large regression on one of the
  major supported platforms?  Well, in &lt;em&gt;most&lt;/em&gt; such cases, the
  software's developers figure out a workaround as quickly as possible
  and make sure that those affected know about it, and then make haste
  to track down the source of the bug, fix it, test the fix, and issue
  a point release or set of patches with which their users can obtain
  a working version.&lt;/p&gt;

&lt;p&gt;Apparently not so in the case of GTK+.  Four months later, GTK+
  2.18.x is still pretty much unusable on Windows, and the general
  consensus is to use 2.16.x. Dominic Lachowicz, a GTK+ developer,
  has is still warning people not to use 2.18.x on Windows:&lt;/p&gt;

&lt;blockquote&gt;Look before you leap. GTK 2.18 on Windows is very
  buggy.&lt;/blockquote&gt;

&lt;p&gt;The attitude of the maintainer of the Windows port, Tor Lillqvist,
  has been quite alarming. In comments on the GNOME bugtracker, he
  gave no impression of any intention of resolving the issues himself,
  saying:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;You want ot use some new API present only in 2.18?
    Please then consider helping in actually debugging and fixing the
    problems in GTK+ 2.18 on Windows.&lt;/p&gt;
  &lt;p&gt;... perhaps you should just use the version of software as it was
    before the "introduction" of the bug? I mean, nobody promised you
    there would be any updates of Windows-specific functionality, or
    otherwise, in GTK+, right? So just use GTK+ as it was before
    "somebody broke it".&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;It's becoming distressingly clear that there is no-one in the
  current GTK+ development team with any particular commitment to
  keeping the Windows support in working order. Furthermore, it seems
  clear to me that the hostile and confrontational attitude of
  people like Tor will tend to drive away any new developers
  interested in taking the work on. It's already hard enough to get
  patches into GTK+ as it is -- even complete and tested patches tend
  to hang around in the GNOME bugtracker for weeks or months before
  being dealt with.&lt;/p&gt;

&lt;p&gt;Going forward, I think that I'll need to find an alternative set of
  libraries that I can use for cross-platform GUI programming and get
  a well-integrated 'look and feel' with.
  The &lt;a href='http://qt.nokia.com/'&gt;Qt&lt;/a&gt; toolkit has a good
  reputation for documentation and support, but doesn't seem to
  support applications written in C.  Are there any other alternatives
  I've missed?&lt;/p&gt;

    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-4373117081599280978?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=4373117081599280978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4373117081599280978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4373117081599280978'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2010/02/gtk-no-longer-supports-windows.html' title='GTK+ no longer supports Windows, apparently'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-7314998164631008527</id><published>2010-02-01T08:49:00.005Z</published><updated>2010-02-01T09:04:08.794Z</updated><title type='text'>Project Postcard</title><content type='html'>&lt;p&gt;I recently wrote a blog posting for the Pirate Party UK website about my latest publicity initiative: &lt;a href="http://www.pirateparty.org.uk/blog/2010/jan/29/project-postcard/"&gt;Project Postcard&lt;/a&gt;!&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The election is fast approaching, and the time has come to really press on with raising our profile.  All our members need to be doing their part if we're going to make an impact on the UK political landscape. I personally have been aiming to do something meaningful &amp; constructive for the party every day -- and I recommend to you all to make a similar commitment. Even little things can make a real difference.&lt;/p&gt;
&lt;p&gt;One way you might be able to help is to get involved with my 'Project Postcard' initiative. I'm shortly going to be ordering a few thousand professionally-produced postcard-like flyers, printed with information on who we are and what we stand for, as well as details of how to find out more.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Read &lt;a href="http://www.pirateparty.org.uk/blog/2010/jan/29/project-postcard/"&gt;the full article on the PPUK blog&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-7314998164631008527?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=7314998164631008527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/7314998164631008527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/7314998164631008527'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2010/02/project-postcard.html' title='Project Postcard'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-721186074571242901</id><published>2009-11-10T07:41:00.003Z</published><updated>2009-11-10T08:04:31.404Z</updated><title type='text'>From the ridiculous to the... even more ridiculous?</title><content type='html'>&lt;p&gt;I've been following the progress of &lt;em&gt;In Re Bilski&lt;/em&gt; before the US Supreme Court, because it's got the potential to set the rules for business method (and thus software) patents for the next few years.&lt;/p&gt;

&lt;p&gt;Unfortunately, it seems that lawyers' view of what constitutes a "good" patent has hit a new and hilarious low. Take this extract from the oral arguments (&lt;a href="http://www.groklaw.net/article.php?story=20091109191422928"&gt;thanks to Groklaw for pointing it out&lt;/a&gt;):&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;JUSTICE KENNEDY: But it would be different, it seems to me, than what you are -- let's assume you can't patent an alphabet. I assume that is true. And you can take an alphabet to make beautiful words, and -- and so forth. You -- you want to say that these -- these electronic signals can be used in a way just like the alphabet can be used. And many of the scientific briefs say that their process is different, that they are taking electronic signals and turning them into some other sort of signal. But that's not what you are doing.&lt;/p&gt;

&lt;p&gt;MR. JAKES: That may be, but those signals could also be transmitted. On -- on your question about the alphabet you said look at the Morse claim 5, which was an alphabet to Morse Code. That's exactly what it was.&lt;/p&gt;

&lt;p&gt;CHIEF JUSTICE ROBERTS: So you reject -- you reject the substitute. You think you can patent an alphabet because it is a process of forming words.&lt;/p&gt;

&lt;p&gt;MR. JAKES: It could be, yes. &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;In what world does this seem like a sane and reasonable way for patentability rules to evolve?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-721186074571242901?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=721186074571242901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/721186074571242901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/721186074571242901'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/11/from-ridiculous-to-even-more-ridiculous.html' title='From the ridiculous to the... even more ridiculous?'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-3214632574227438666</id><published>2009-11-05T12:23:00.002Z</published><updated>2009-11-05T12:36:59.019Z</updated><title type='text'>ACTA: write to them!</title><content type='html'>&lt;p&gt;I've now written to both the Green MEP in my region, Caroline Lucas, and my MP, Humfrey Malins.&lt;/p&gt;

&lt;p&gt;My e-mail to Caroline Lucas was fairly straightforward to write. Firstly, she's an MEP, and thus European-level matters are more directly relevant to her interests. Additionally, the Commission have been ignoring direct calls, by MEPs, lead by the Green Party, for more transparency in ACTA, so I know that she already agrees that there's a problem.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Dear Dr. Lucas,&lt;/p&gt;

&lt;p&gt;In December 2008, lead by the Green Party, the European Parliament adopted
a resolution regarding ACTA which:&lt;/p&gt;

&lt;blockquote&gt;"... Calls on the Commission and the Member States to negotiate ACTA under
conditions of the utmost transparency towards EU citizens, especially with
regard to the definitions of the terms "counterfeiting" and "piracy" and
the criminal sanction measures foreseen; takes the view that the social
impact of the agreement as well as the impact on civil liberties must be
assessed; supports the establishment of a task force to examine the
implementation of the agreement, by promoting this subject in dialogue
between the European Union and third countries and as part of cooperation
measures with those countries..." [P6_TA(2008)0634]&lt;/blockquote&gt;

&lt;p&gt;Furthermore, in March 2009, the Parliament and Council adopted a Regulation
that required that:&lt;/p&gt;

&lt;blockquote&gt;"In accordance with Article 255(1) of the EC Treaty, the Commission should
immediately make all documents related to the ongoing international
negotiations on the Anti-Counterfeiting Trade Agreement (ACTA) publicly
available. [Am 109]" [P6_TA-PROV(2009)0114]&lt;/blockquote&gt;

&lt;p&gt;Nevertheless, many months later, the ACTA text under discussion is still
being discussed behind closed doors, without the opportunity for review or
discussion by those whom it will affect if adopted. I would greatly
appreciate an explanation as to why this is, and what the Parliament, the
Green Party and you yourself are currently doing to address this.&lt;/p&gt;

&lt;p&gt;Yours sincerely,

&lt;p&gt;Peter Brett&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Writing to Humfrey Malins was more challenging. Firstly, European Commission-level negotiations aren't something that the Commons has any real direct influence on. However, the fact that the Baroness of Uphallow is the European Commissioner for Trade provided a way to demonstrate the ACTA negotiations' direct relevance.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Dear Humfrey Malins,&lt;/p&gt;

&lt;p&gt;The UK, as part of the European Commission, is currently in the process
of negotiating the plurilateral Anti-Counterfeiting Trade Agreement.&lt;/p&gt;

&lt;p&gt;This process has been concealed behind a veil of utmost secrecy,
despite repeated demands by the European Parliament and Council for
greater transparency (see: P6_TA(2008)0634 and P6_TA-PROV(2009)0114).
Only a rough outline of the structure of the proposed treaty is
available to the billions of people who will be affected by its
provisions.  I do not believe that, in the case of a trade treaty, such
secrecy serves the public interest. The quality and fairness of the
results of the process can only be improved by allowing the people in
whose name the treaty is being negotiated to see and discuss the actual
provisions being suggested.&lt;/p&gt;

&lt;p&gt;I have already written to my MEPs, but the Commission has made it quite
clear that they intend to continue to ignore the European Parliament's
position on this issue.  Catherine Ashton is the UK Commissioner and
holder of the Commission's Trade portfolio, and as such is responsible
for the Commission's role in the ACTA negotiations. (It is interesting
to note that the Baroness of Upholland has no background in trade
issues and has never been elected to public office.)&lt;/p&gt;

&lt;p&gt;Would you be willing to ask the Prime Minister to direct Baroness
Ashton to encourage the EU ACTA delegation to open the process to
public scrutiny, please?  It seems to me this would greatly serve the
public interest.&lt;/p&gt;

&lt;p&gt;Yours sincerely,&lt;/p&gt;

&lt;p&gt;Peter Brett&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Hopefully I'll get some useful and timely replies. We'll see!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-3214632574227438666?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=3214632574227438666' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3214632574227438666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3214632574227438666'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/11/acta-write-to-them.html' title='ACTA: write to them!'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-1595001359298689236</id><published>2009-11-05T07:06:00.004Z</published><updated>2009-11-05T12:59:36.521Z</updated><title type='text'>ACTA: what lurks in the shadows?</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;


&lt;p&gt;Over the last two years, a number of countries and multi-national
  blocs have been negotiating a new treaty called
  the &lt;a href='http://en.wikipedia.org/wiki/Anti-Counterfeiting_Trade_Agreement'&gt;Anti-Counterfeiting
  Trade Agreement&lt;/a&gt; (ACTA). The UK Intellectual Property Office, for
  example, claim that:&lt;/p&gt;

&lt;blockquote&gt;The Anti-Counterfeiting Trade Agreement (ACTA) seeks to coordinate
international cooperation on IPR enforcement practices, to tackle
effectively counterfeit and pirated goods.&lt;/blockquote&gt;

&lt;p&gt;Whether or not you feel that the premises on which the proposed
  treaty is founded are benign (the
  &lt;a href='http://www.pirateparty.org.uk/'&gt;Pirate Party UK&lt;/a&gt;, of
  which I am a member, opposes it in principle), the most disturbing
  thing about this treaty is the veil of total secrecy behind which
  all of the negotiations and details of the proposed treaty
  provisions have been concealed. (Recall that, in most countries,
  international treaties which have been ratified by the government
  have the force of law).&lt;/p&gt;

&lt;p&gt;Indeed, the public was not even aware of what, exactly, the
  proposed agreement would cover until a discussion paper was
  &lt;a href='http://wikileaks.org/w/index.php?title=Proposed_US_ACTA_multi-lateral_intellectual_property_trade_agreement_%282007%29&amp;amp;oldid=29522'&gt;leaked&lt;/a&gt;
  in May 2008.&lt;/p&gt;

&lt;p&gt;On the EU side, the negotiations are being carried out by the
  European Commission, which has routinely denied or stalled all
  attempts to give transparency to the process.  They have even ignored
  &lt;em&gt;repeated&lt;/em&gt; demands from the European Parliament for drafts
  and documentation of the process. In December 2008, for example, the
  European Parliament
  adopted &lt;a href='http://www.europarl.europa.eu/sides/getDoc.do?pubRef=-//EP//TEXT+TA+P6-TA-2008-0634+0+DOC+XML+V0//EN'&gt;a
  resolution&lt;/a&gt; which:&lt;/p&gt;

&lt;blockquote&gt;Calls on the Commission and the Member States to negotiate ACTA under
conditions of the utmost transparency towards EU citizens, especially with
regard to the definitions of the terms "counterfeiting" and "piracy" and
the criminal sanction measures foreseen; takes the view that the social
impact of the agreement as well as the impact on civil liberties must be
assessed; supports the establishment of a task force to examine the
implementation of the agreement, by promoting this subject in dialogue
between the European Union and third countries and as part of cooperation
measures with those countries.&lt;/blockquote&gt;

&lt;p&gt;The Commission failed to comply. Several months later, in March
  2009, the European Parliament and Council
  adopted &lt;a href='http://www.europarl.europa.eu/sides/getDoc.do?pubRef=-//EP//TEXT+TA+P6-TA-2009-0114+0+DOC+XML+V0//EN'&gt;new
  regulations&lt;/a&gt; on transparency in government, and as part of this
  they specifically singled out the ACTA negotiations as an area in
  which transparency was sorely needed.&lt;/p&gt;

&lt;blockquote&gt;In accordance with Article 255(1) of the EC Treaty, the Commission should
immediately make all documents related to the ongoing international
negotiations on the Anti-Counterfeiting Trade Agreement (ACTA) publicly
available.&lt;/blockquote&gt;

&lt;p&gt;Nevertheless, these documents are &lt;em&gt;still&lt;/em&gt; not
  available. Although there are judicial procedures by which the
  Parliament can compel the Commission to act, these take a long time,
  long enough that the details of ACTA might not be made available
  until the negotiations are concluded and the treaty's provisions
  presented as a &lt;em&gt;fait accompli&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It's therefore been recommended that citizens of EU countries
  pressure our individual governments to make the process more
  transparent. For example, I have recently
  filed &lt;a href='http://www.whatdotheyknow.com/request/anti_counterfeiting_trade_agreem'&gt;a
  request under the Freedom of Information Act&lt;/a&gt; for details of the
  UK's part in the ACTA negotiations and, specifically, for draft
  documents, and I'll be writing to my MP later today to ask him
  whether he feels that such secrecy in negotiations of
  a &lt;em&gt;trade&lt;/em&gt; treaty is really in the public interest.&lt;/p&gt;

&lt;p&gt;Watch this space.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I've made additional FOI requests of the &lt;a href="http://www.whatdotheyknow.com/request/anti_counterfeiting_trade_agreem_2"&gt;Department for Business, Innovation and Skills&lt;/a&gt;, and the &lt;a href="http://www.whatdotheyknow.com/request/anti_counterfeiting_trade_agreem_3"&gt;Foreign and Commonwealth Office&lt;/a&gt;.

&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt; &lt;a href="http://www.whatdotheyknow.com/request/anti_counterfeiting_trade_agreem_2#incoming-53954"&gt;BIS say that I should contact UKIPO&lt;/a&gt;. How fortunate that I already have done so!&lt;/p&gt;
    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-1595001359298689236?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=1595001359298689236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/1595001359298689236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/1595001359298689236'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/11/acta-what-lurks-in-shadows.html' title='ACTA: what lurks in the shadows?'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-5290354478577385465</id><published>2009-08-20T00:38:00.003+01:00</published><updated>2009-08-20T06:28:32.573+01:00</updated><title type='text'>Perception of reality</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;


&lt;p&gt;In late 2005, shortly after arriving at Girton College to begin my
undergraduate course in Engineering, I met a young lady who would
change my life forever.  She was tall; she was slender; she was a
stunning brunette; she was intelligent; she was witty.  She was the
most wonderful woman I had ever met.&lt;/p&gt;

&lt;p&gt;She was also quite shy, which meant it took a long time --
months -- for me to win her trust.  We chatted online most days
of the Christmas vacation, and in the Lent term we drank late night
cocoa together while commiserating about the length and difficulty of
our examples papers.  Just after Easter in our first year at
Cambridge, we began going out.  It was the 17th April 2006, and it was
the happiest day of my life.&lt;/p&gt;

&lt;p&gt;We had a wonderful time together.  I remember one evening in June
2006, after finishing our exams, we packed a dinner of boiled eggs,
rocket, cheshire cheese and crusty brown bread, cycled into the fens
to the north of Cambridge and enjoyed a relaxing picnic on the verge
outside the Queensholme Bloodstock Stables near Willingham.  I
remember her laughing as she snapped a photograph of a big green
caterpillar crawling around in the grass near her lap.&lt;/p&gt;

&lt;p&gt;I remember my 21st birthday, at her house in the Alps, with a
delicious carrot cake and beautiful, hot continental weather to travel
up a funicular railway and enjoy a meal overlooking the mountain
lakes.&lt;/p&gt;

&lt;p&gt;I remember a second year in Cambridge, living next door to each
other on a corridor of our friends at Girton's Wolfson Court.  I
remember fondue evenings followed by games of Mario Kart 64 in my
room, with people sitting on the bed and huddled on the floor to
gather round and watch.  She always won, no matter how hard we tried!
I remember visiting her home again -- this time at the New Year
-- and travelling far into the highest mountains to find a resort
with ski-able snow.  I remember carrying her new kayak to the river on
her 20th birthday in the pouring rain, and watching the fireworks with
her at the First and Third Trinity May Ball.&lt;/p&gt;

&lt;p&gt;I asked her to marry me, and she said, "Yes."  We went to a
jeweller together, and together we decided to have a beautiful ring
made to order: a sapphire flanked by two smaller diamonds.  It was the
second happiest day of my life.&lt;/p&gt;

&lt;p&gt;At College again in our third year, we lived next door to each
other again.  I remember my happiness and her joy as I watched her win
all of her kayaking varsity events, and I remember her endless months
of struggling with mountains of horrendous maths problems.  I remember
punting on the Cam, our finals behind us, and not a care in the world.
I remember her graduation, and looked forward to her being there at
mine.&lt;/p&gt;

&lt;p&gt;But then things changed.  In September 2008 she went to York, to do
a PGCE in secondary mathematics, while I remained in Cambridge,
plugging away at the final year of my MEng.  And suddenly it was not
"we" who told the story any more, it was "she" and "I."  I dutifully
dragged her bicycle and her clothes and her books up to York on the
train, longing to spend as much time as I could with the one I love.
She seemed unwilling to make the time to come down from York to visit
me, and when she came seemed to wish she hadn't.  When I was there, it
was as if she resented my presence, as if I was intruding into her
privacy.  Something had changed, and I was bewildered and
confused.&lt;/p&gt;

&lt;p&gt;She spoke to me less and less on the telephone, and never seemed to
want to chat with me online.  I was distraught.  "What is going
wrong?"  I wondered.  "Was it something I have done?  Was it something
I didn't do?"  Yet I loved her still, with all my heart, and arranged
a surprise visit to her in York.  It was a cold night in March, but
she was icy.  It seemed like the relationship I cherished as much as
life itself was hanging by a tenterhook.&lt;/p&gt;

&lt;p&gt;The final examinations of my MEng began on the 17th April 2009, and
it was on the 19th April I received the letter that I had expected but
which I hoped would never come.  Just over three years after our
relationship had begun, it was over.  It was the worst day of my
life.&lt;/p&gt;

&lt;p&gt;That was four months ago, and now she is with a new man, or at
least, that is what her Facebook status says.  Four devastating
months, in which my life has crumbled to pieces around my ears as if
struck by a tsunami; not only my future, but my past as well.&lt;/p&gt;

&lt;p&gt;I looked forward to marrying her, starting a household together and
eventually starting a family together, and now that will never happen.
All my hopes, all my dreams are the wreckage of jagged splinters left
after the box of Christmas baubles is hurled down the stairs.  My
heart is a broken mess of mingled sorrow, love, jealousy and
anger.&lt;/p&gt;

&lt;p&gt;But worse, I find myself doubting whether the way I saw things was
in fact the way they really were.  Towards the end of the
relationship, I was fooling myself when I told myself that she loved
me and that this was just a hiccough that could be put right by
showing her that I loved her.  But for how long?  How long did she
hide the way she felt about me?  Did she do it out of some misplaced
wish to avoid "hurting my feelings," or because she was afraid of how
I might react?  What did I do, or not do, or what about me was it that
drove her away from me?  Is the truth of the matter that I
was &lt;em&gt;too&lt;/em&gt; devoted, &lt;em&gt;too&lt;/em&gt; trusting?&lt;/p&gt;

&lt;p&gt;I fear -- I so dreadfully fear -- that even when our
friends were sending us cards to congratulate us on our engagement,
even then she was doubting whether I was the man for her, and &lt;em&gt;she
didn't tell me&lt;/em&gt;.  And that would mean that, for more than a year
and half of my life, the reality I perceived &lt;em&gt;did not exist&lt;/em&gt;.
I was living in a dream world.&lt;/p&gt;

&lt;p&gt;How I wish, how I so terribly desire for that dream world to be
real.  Because, at the same time as I continue to love her wholly, I
know now that we will never -- can never -- be together
again.  She has changed my life forever; but I hadn't expected it to
be like &lt;em&gt;this&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;My days are swifter than a weaver's shuttle, and are spent without
hope.&lt;/p&gt;
&lt;p class='attribution'&gt;--Job 7:6&lt;/p&gt;
&lt;/blockquote&gt;

    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-5290354478577385465?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=5290354478577385465' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/5290354478577385465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/5290354478577385465'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/08/perception-of-reality.html' title='Perception of reality'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-5879273396120675905</id><published>2009-08-14T08:37:00.003+01:00</published><updated>2009-08-14T08:51:46.009+01:00</updated><title type='text'>US NEO detection programme not on schedule</title><content type='html'>&lt;p&gt;In space-related news:&lt;/p&gt;

&lt;blockquote&gt;According to a new interim report from the &lt;a href="http://en.wikipedia.org/wiki/United_States_National_Research_Council"&gt;US National Research Council&lt;/a&gt;, NASA's current &lt;a href="http://en.wikipedia.org/wiki/Near_earth_object"&gt;near-Earth object&lt;/a&gt; surveys will not meet the congressionally mandated goal of discovering 90 percent of all objects over 140 meters in diameter by 2020. Funding for near-Earth object activities at NASA has been constrained, with most costs being met by funds from other programs.&lt;/blockquote&gt;

&lt;p&gt;What a surprise! Underfunded science programmes have difficulty meeting targets! In addition to complaining about funding, the &lt;a href="http://www.nap.edu/catalog.php?record_id=12738"&gt;full report&lt;/a&gt; (which is free to download) has some interesting information on the current technology and facilities used for detecting near-Earth objects.&lt;/p&gt;

&lt;p&gt;Another of the report's findings was that:&lt;/p&gt;

&lt;blockquote&gt;The &lt;a href="http://en.wikipedia.org/wiki/Arecibo_Observatory"&gt;Arecibo Observatory&lt;/a&gt; telescope continues to play a unique role in characterization of NEOs, providing unmatched precision and accuracy in orbit determination and insight into size, shape, surface structure, multiplicity, and other physical properties for objects within its declination coverage and detection range.&lt;/blockquote&gt;

&lt;p&gt;I find this particularly interesting in the light of concerted efforts in recent years to shut the Arecibo facility down &amp;quot;to save money.&amp;quot;&lt;/p&gt;

&lt;p&gt;Congress should make up their minds: they can mandate &lt;em&gt;and fund&lt;/em&gt; public research, or do neither.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-5879273396120675905?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=5879273396120675905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/5879273396120675905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/5879273396120675905'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/08/us-neo-detection-programme-not-on.html' title='US NEO detection programme not on schedule'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-4203032342478124591</id><published>2009-08-13T19:03:00.001+01:00</published><updated>2009-08-13T19:03:26.138+01:00</updated><title type='text'>Response to illicit filesharing legislation consultation</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;In the wake of the recently-release Digital Britain report, the
Department for Business, Innovation and Skills recently opened a
consultation on proposed legislation to combat illicit peer-to-peer
filesharing. I have published
my &lt;a href='http://peter-b.co.uk/rants/p2p-consultation.html'&gt;rather
lengthy response&lt;/a&gt; on my website.&lt;/p&gt;

&lt;p&gt;I hereby disclaim all responsibility for permanent brain damage
caused by extreme boredom induced by reading the document linked
above.&lt;/p&gt;
    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-4203032342478124591?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=4203032342478124591' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4203032342478124591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4203032342478124591'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/08/response-to-illicit-filesharing.html' title='Response to illicit filesharing legislation consultation'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-4299453159198584356</id><published>2009-08-09T00:05:00.001+01:00</published><updated>2009-08-09T00:05:45.334+01:00</updated><title type='text'>gEDA build system redesign</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;


&lt;p&gt;One of the items on &lt;a href='http://geda.seul.org/wiki/geda:todos'&gt;the gEDA
"Todos" list&lt;/a&gt; as a prerequisite for the 1.6.0 release
has been a refactor of the gEDA build system.  Instead of using
several distributed source archives (one for each major component),
it was decided to distribute the gaf suite as a single archive, with
one unified build system.&lt;/p&gt;

&lt;h4&gt;Why?&lt;/h4&gt;

&lt;p&gt;The advantages of this strategy were seen as follows:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;The system would be less confusing for new testers or
  "power" users who want to try out the latest changes in
  git.&lt;/li&gt;
  &lt;li&gt;The whole suite could be built and tested before installing any
  files.  In the past, it's been necessary to install
  the &lt;tt&gt;libgeda&lt;/tt&gt; and &lt;tt&gt;symbols&lt;/tt&gt; packages before any of the
  other packages could be built.&lt;/li&gt;
  &lt;li&gt;It would reduce the labour involved in keeping the version
  numbers, &lt;tt&gt;ChangeLogs&lt;/tt&gt;, and required dependency checks
  up-to-date.  Maintaining multiple configure scripts in parallel is
  labour intensive, and there is the ever-present risk of missing
  one.&lt;/li&gt;
  &lt;li&gt;It would simplify the job of distribution packagers. In the RPM
  case, it would only be necessary for a packager (like the maintainer
  of the &lt;a href='http://chitlesh.fedorapeople.org/FEL/'&gt;Fedora
  Electronic Lab&lt;/a&gt; distribution, Chitlesh Goorah) to maintain a
  single SPEC file, rather than nine.&lt;/li&gt;
  &lt;li&gt;It would simplify building using parallel make (see the &lt;tt&gt;-j&lt;/tt&gt;
  option to &lt;tt&gt;make&lt;/tt&gt;), which can significantly speed up compiling
  gEDA on machines with multiple or multi-core processors.&lt;/li&gt;
  &lt;li&gt;It would improve detection of targets requiring rebuilding.
  This is particularly important for working on &lt;tt&gt;libgeda&lt;/tt&gt;;
  only changes which affect the public interface require a rebuild of
  the applications, but it's often hard to keep track of what's
  changed.  What often happens with the 1.4.x build system is that
  people end recompiling the applications completely just to make
  sure, at a cost of time and energy.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Approach&lt;/h4&gt;

&lt;p&gt;The rework had been on the "Todos" list for several
months when I started looking into it at the beginning of June 2009
(just after handing in my MEng project), and some ideas came to
mind about how the current structure of the build system could be
improved.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;One idea that crossed my mind &lt;em&gt;extremely briefly&lt;/em&gt; was not to
  use GNU Autoconf and Automake, but to adopt another build
  infrastructure.  Autotools was retained, because not only is it well
  known by current gEDA developers, but it has worked well enough for
  us in the past, and it doesn't require developers or users to
  install yet another tool in order to be able to compile and install
  gEDA.&lt;/li&gt;
  &lt;li&gt;I had recently been looking at the &lt;tt&gt;configure.ac&lt;/tt&gt; file
  for &lt;a href='http://sourceforge.net/projects/dtn2'&gt;DTN2 (the
  reference implementation for the Delay Tolerant Networking Bundling
  Protocol)&lt;/a&gt;, and I noticed that they used a very minimalist,
  clearly-laid-out configure script will almost all of the configure
  checks being described in separate m4 files, as self-contained
  Autoconf macros. This appealed to me, because &lt;tt&gt;configure.ac&lt;/tt&gt;
  files are often very confusing to a newcomer, and this method
  offered the potential to make it much, much clearer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Problems encountered&lt;/h4&gt;

&lt;p&gt;There were two major problems encountered while carrying out the
work.&lt;/p&gt;
&lt;p&gt;Firstly, internationalisation of desktop integration files
(&lt;tt&gt;.desktop&lt;/tt&gt; files to appear in menus etc., and MIME-type info
files to make file browsers show the right icon.  In previous
releases, &lt;a href='http://www.freedesktop.org/wiki/Software/intltool'&gt;intltool&lt;/a&gt;
has been used to do this, but intltool suffers from a major flaw: it
doesn't support more than one gettext domain in a single package, and
we would need to use at least three (one each for &lt;tt&gt;libgeda&lt;/tt&gt;,
&lt;tt&gt;gschem&lt;/tt&gt; and &lt;tt&gt;gattrib&lt;/tt&gt;).&lt;/p&gt;
&lt;p&gt;I was very surprised to find that there wasn't an existing solution
to this problem in widespread use.  In the end, I had to actually
write my own tool from scratch to carry out this task, a 550-line
shell script called &lt;a href='http://git.gpleda.org/?p=gaf.git;a=blob;f=build-tools/desktop-i18n;hb=HEAD'&gt;&lt;tt&gt;desktop-i18n&lt;/tt&gt;&lt;/a&gt;.
Although enormously hacky, it works remarkably effectively!&lt;/p&gt;

&lt;p&gt;The second major problem was in getting the testsuite to pass
without gEDA being installed.  The number of issues encountered was
innumerable (one of my "favourite" examples was the way that
&lt;tt&gt;libgeda&lt;/tt&gt; used to call &lt;tt&gt;exit(-1)&lt;/tt&gt; if it couldn't find
the gEDA font, even in &lt;tt&gt;gnetlist&lt;/tt&gt; which doesn't need to display
any text objects anyway).  By a combination of actually fixing bugs
(few) and horrible nasty hacks (many), I eventually surmounted this
issue too.  With this, there were more than a few occasions where I
felt like I was banging my head against a brick wall.&lt;/p&gt;

&lt;h4&gt;Results&lt;/h4&gt;

&lt;p&gt;On Friday 7th August I merged the "build-system" branch
into the main git repository, and the new build system seems to be a
genuine and successful enhancement (despite a few minor issues).
However, I can hardly believe how much work it took to do!&lt;/p&gt;


    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-4299453159198584356?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=4299453159198584356' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4299453159198584356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4299453159198584356'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/08/geda-build-system-redesign.html' title='gEDA build system redesign'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-7817990754469270509</id><published>2009-07-26T20:16:00.002+01:00</published><updated>2009-07-26T20:32:52.448+01:00</updated><title type='text'>Double-chocolate brownies</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;While &lt;a href='http://www.srcf.ucam.org/cura/cura/'&gt;CURA&lt;/a&gt; were
  at &lt;a href='http://www.nsc-bisley.co.uk/'&gt;Bisley&lt;/a&gt; for the
  Imperial Meeting this year, I made the team some of these
  brownies. They were very much enjoyed by all!&lt;/p&gt;
&lt;p&gt;This recipe is designed to make quite firm brownies that travel
  easily (e.g. on the back of my bike). If you like your brownies nice
  and squidgy, put less flour in (175 g instead of 225 g).&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;275 g plain chocolate (50% cocoa solids)&lt;/li&gt;
  &lt;li&gt;220 g unsalted butter&lt;/li&gt;
  &lt;li&gt;85 g walnut pieces&lt;/li&gt;
  &lt;li&gt;170 g milk chocolate (cut into chunks)&lt;/li&gt;
  &lt;li&gt;225 g plain flour&lt;/li&gt;
  &lt;li&gt;1 tsp baking powder&lt;/li&gt;
  &lt;li&gt;4 large eggs, lightly beaten&lt;/li&gt;
  &lt;li&gt;1 tsp vanilla essence&lt;/li&gt;
  &lt;li&gt;325 g caster sugar&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pre-heat oven to 170°C (155°C if you've got a fan
  oven). Line a 30x20x3.5 cm cake tin with lightly buttered
  greaseproof paper. I find that it makes the brownie easier to
  extract from the tin if you butter the base of the tin &lt;em&gt;as
  well&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Melt the chocolate and butter in a large (preferably metal) mixing
  bowl over a pan of simmering water. Remove the pan from the heat and
  stir in the sugar, followed by the eggs and vanilla essence.&lt;/p&gt;
&lt;p&gt;Sieve the flour and baking powder into the mixture, and fold in.
  Fold in the nuts and chocolate.&lt;/p&gt;
&lt;p&gt;Pour the mixture into the cake tin, place in the oven and cook for
  20-25 mins.  The corners will cook fastest; do not allow them to
  burn!  When cooked, a skewer inserted into the centre of the brownie
  should come out mostly clean, but it's no big deal if you get a
  squidgy middle.&lt;/p&gt;
&lt;p&gt;Allow to cool in the tin. When cool, remove the brownie from the
  tin and cut into squares (you should be able to get 24 good-sized
  pieces from this recipe).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Avoid oil-based chocolate and/or HFCS-based
chocolate for this recipe. It won't work.&lt;/p&gt;

    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-7817990754469270509?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=7817990754469270509' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/7817990754469270509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/7817990754469270509'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/07/double-chocolate-brownies.html' title='Double-chocolate brownies'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-2772793228691297915</id><published>2009-07-26T00:58:00.001+01:00</published><updated>2009-07-26T00:58:35.225+01:00</updated><title type='text'>Simple unit tests in Scheme</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;One nice feature of the Scheme programming is the ridiculous, over-the-top power of
  its "hygienic" macro system, which allows a programmer to
  effectively redefine the language to suit the task at hand.&lt;/p&gt;
&lt;p&gt;A few days ago, I needed to write some simple unit tests for some
  Scheme code I was in the process of developing.
  The &lt;a href='http://www.gnu.org/software/guile/'&gt;Guile&lt;/a&gt; Scheme
  implementation doesn't come with a library for unit testing by
  default, so it was necessary to create one of my own. This is
  it:&lt;/p&gt;
&lt;pre&gt;
(define *failed-tests* '())
(define *passed-tests* '())

(define (assert-true result)
  (if (not result)
      (throw 'test-failed-exception
             (with-output-to-string
              (lambda ()
                (display "  assert-true: ")
                (display "got: ")
                (write result))))))

(define (%begin-test name test-thunk)
  (let ((test-success #t)
        (test-fail-msg #f))
    (display name) (display "... ")

    (catch #t test-thunk
           (lambda (key . args)
             (set! test-success #f)
             (set! test-fail-msg
             (if (eqv? key 'test-failed-exception)
                 (car args)
                 (with-output-to-string
                  (lambda ()
                    (display "  unexpected exception: ")
                    (write (cons key args))))))))

    (if test-success
        (begin
          (display "passed")
          (set! *passed-tests* (cons name *passed-tests*)))
        (begin
          (display "failed")
          (if test-fail-msg
              (begin
                (newline)
                (display test-fail-msg)))
          (set! *failed-tests* (cons name *failed-tests*))))
    (newline)))

(define-syntax begin-test
    (syntax-rules ()
      ((_ name . test-forms)
       (%begin-test name (lambda () . test-forms)))))

(define (report-tests)
  (display "Test summary")(newline)
  (display "Passed: ") (display (length *passed-tests*)) (newline)
  (display "Failed: ") (display (length *failed-tests*)) (newline))
&lt;/pre&gt;

&lt;p&gt;Note that this effectively adds a keyword (&lt;tt&gt;begin-test&lt;/tt&gt;) to
  the Scheme language, and this very simple macro has a massive effect
  on the readability of the resulting testcase code. For example, a
  trivial unit test using this minimalistic framework might look
  like:&lt;/p&gt;

&lt;pre&gt;
(begin-test 'SuccessfulTest
  (assert-true #t)
  (assert-true (equal? 1 1)))
(begin-test 'FailTest
  (assert-true (equal? #t "string")))
(report-tests)
&lt;/pre&gt;

&lt;p&gt;The framework is completed with the addition a few
  more &lt;tt&gt;assert-&lt;/tt&gt; functions (left as an exercise to the reader).
  This code will form part of a future release
  of &lt;a href='http://www.gpleda.org/'&gt;gEDA&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;(In case you want to use this code in your own project, it is
  licensed under
  the &lt;a href='http://www.gnu.org/licenses/lgpl-3.0-standalone.html'&gt;GNU
  LGPL v3&lt;/a&gt; or later).  But there are probably better unit test
  systems for Scheme out there!&lt;/p&gt;
    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-2772793228691297915?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=2772793228691297915' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/2772793228691297915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/2772793228691297915'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/07/simple-unit-tests-in-scheme.html' title='Simple unit tests in Scheme'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-4060061436469045809</id><published>2009-07-18T12:24:00.002+01:00</published><updated>2009-07-18T12:36:44.128+01:00</updated><title type='text'>Enchiladas</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;While I'm on a roll with the recipes, here's my recipe for chicken
  enchiladas. It's probably not particularly authentic, but I enjoy
  them! This recipe serves 2 moderately hungry people.&lt;/p&gt;

&lt;h4&gt;Enchilada sauce&lt;/h4&gt;
  &lt;ul&gt;
    &lt;li&gt;400 g can of chopped tomatoes&lt;/li&gt;
    &lt;li&gt;1 clove garlic, chopped&lt;/li&gt;
    &lt;li&gt;Fresh chilis, chopped&lt;/li&gt;
    &lt;li&gt;1 tbsp olive oil&lt;/li&gt;
  &lt;/ul&gt;
&lt;p&gt;I usually use 2-3 of the normal chilis sold in Tesco or Sainsbury's
  (with the seeds left in), but I like my echiladas nice and spicy!
  With those chilis, I find them a bit impotent with the seeds left
  out.&lt;/p&gt;
&lt;p&gt;Fry the chilis and garlic in the olive oil for 2-3 minutes over a
  medium heat. Add the chopped
  tomatoes and simmer for 20-30 minutes until most of the excess
  liquid has evaporated leaving a thick, spicy tomato sauce.&lt;/p&gt;
&lt;p&gt;This can easily be made in advance, and freezes well.&lt;/p&gt;

&lt;h4&gt;Fried chicken filling&lt;/h4&gt;
&lt;p&gt;This is a very simple filling -- use your imagination and come up
  with your own!  Try other meats, fried peppers or mushrooms,
  seafood, cheese... Also consider marinating the chicken with spices
  before frying.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;300 g chicken breast, cut into strips&lt;/li&gt;
  &lt;li&gt;10 g fresh ginger, grated&lt;/li&gt;
  &lt;li&gt;Dried paprika&lt;/li&gt;
  &lt;li&gt;Salt &amp;amp; pepper&lt;/li&gt;
  &lt;li&gt;Half a medium cooking onion, coarsely chopped.&lt;/li&gt;
  &lt;li&gt;1 tbsp olive oil&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Heat the oil over a high heat in a wide-based frying pan. Add the
  onion, chicken, ginger, and paprika, and season the chicken to
  taste. Fry until the chicken is cooked through, then set aside.&lt;/p&gt;
&lt;p&gt;Like the sauce, this can easily be made in advance.&lt;/p&gt;

&lt;h4&gt;Putting it all together&lt;/h4&gt;
&lt;ul&gt;
  &lt;li&gt;4 corn tortilla wraps&lt;/li&gt;
  &lt;li&gt;150 g grated cheese (cheddar works okay)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pre-heat the oven to 150°C. Microwave the tortilla wraps for 15-20
  seconds until they are warm and flexible. Divide the filling between
  them, roll them up, and place them together in a small roasting
  tin. Spread the enchilada sauce generously over the tortillas
  (making sure to coat them all over). Top with the cheese and salt
  and pepper to taste.&lt;/p&gt;
&lt;p&gt;Bake in the oven for 15-20 minutes, and serve with green salad and
  spring onions.&lt;/p&gt;

    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-4060061436469045809?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=4060061436469045809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4060061436469045809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4060061436469045809'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/07/enchiladas.html' title='Enchiladas'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-2182043004041557937</id><published>2009-07-17T17:09:00.002+01:00</published><updated>2009-07-17T17:22:18.849+01:00</updated><title type='text'>This will seem like bragging...</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;This will seem like bragging, but in retrospect I really did rather
  well at Cambridge. These are the prizes and scholarships I was
  awarded over my four years:&lt;ul&gt;
    &lt;li&gt;Emily Davies Scholarship (twice)&lt;/li&gt;
    &lt;li&gt;Henry Tompkinson Scholarship&lt;/li&gt;
    &lt;li&gt;Beatrice Mills Prize&lt;/li&gt;
    &lt;li&gt;Rosalind, Lady Carlisle Prize&lt;/li&gt;
    &lt;li&gt;Raemakers Prize&lt;/li&gt;
    &lt;li&gt;Accenture Second Year Computing Prize&lt;/li&gt;
    &lt;li&gt;i2 Ltd. Third Year Computer-Based Project Prize&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;

&lt;p&gt;Of course, those successes paled into insignificance alongside the
  accomplishments of some of my peers at certain prestigious
  inner-city colleges, but I think I did okay for a hick from the
  sticks (i.e. a Girtonian)!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I forgot to mention that I also blagged a
  (large) award from the academic funds for a plane ticket to a
  conference at MIT. But that was more of a success in terms of &amp;quot;social
  engineering&amp;quot; than actual engineering!&lt;/p&gt;

    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-2182043004041557937?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=2182043004041557937' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/2182043004041557937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/2182043004041557937'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/07/this-will-seem-like-bragging.html' title='This will seem like bragging...'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-3189589816511988682</id><published>2009-07-01T21:20:00.002+01:00</published><updated>2009-07-17T17:15:34.708+01:00</updated><title type='text'>Starting my PhD!</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;


&lt;p&gt;&lt;a href='http://www.peter-b.co.uk/blog/2009/01/phd-studentship-at-ssc.html'&gt;As
  I mentioned in January&lt;/a&gt;, I was awarded a PhD studentship at
  Surrey Space Centre. I graduated from Cambridge last Friday, with I
  Class honours in my BA and a Distinction in my MEng, moved down to
  south-west Woking at the weekend, and started at SSC today!&lt;/p&gt;

&lt;p&gt;I'm having to fight a bit to get a Linux workstation -- other
  groups in the same building (and serviced by the same IT staff!) use
  Fedora on their desktops, but SSC has historically been an
  all-Windows environment. In a corporate setting, I might put up with
  Windows -- there, at least, there is often a reasonably well-staffed
  IT services department to take care of the innumerable things that
  go wrong -- but in my experience, PhD students don't get quite that
  level of support. If I'm going to be solving my own problems, I want
  to do it with more powerful tools. (Also, Emacs on Windows isn't
  nearly as much fun. How can I possibly survive without a
  properly-functioning &lt;tt&gt;compilation-mode&lt;/tt&gt;?)&lt;/p&gt;

&lt;p&gt;Nevertheless, I think I'm eventually going to win the battle.  In
  the meantime, it looks like I'll have to make do with Cygwin.&lt;/p&gt;

&lt;p&gt;As far as the research is concerned, I've barely start to dip my
  big toe into the scalding bathtub of things I don't know, and it
  feels like I've got a long, long way to go before I get to the
  things no-one else knows either!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I managed to persuade the computing folks
  to give me second PC running Linux and a USB KVM switch. So that's
  alright, then.&lt;/p&gt;
    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-3189589816511988682?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=3189589816511988682' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3189589816511988682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3189589816511988682'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/07/starting-my-phd.html' title='Starting my PhD!'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-3173550787125219875</id><published>2009-07-01T20:04:00.001+01:00</published><updated>2009-07-01T20:04:31.705+01:00</updated><title type='text'>Chorizo and tomato pasta</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;Another chorizo recipe that I made to use up what was left over
  from &lt;a href='http://www.peter-b.co.uk/blog/2009/06/baked-pork-chops-with-chorizo.html'&gt;the
  previous one&lt;/a&gt;. Note that I use Spanish chorizo, not Mexican (as
  most commonly found in the USA).&lt;/p&gt;

&lt;p&gt;Ingredients (serves 3-4):&lt;ul&gt;
    &lt;li&gt;150 g dried chorizo sausage, diced finely&lt;/li&gt;
    &lt;li&gt;1 medium cooking onion, coarsely chopped&lt;/li&gt;
    &lt;li&gt;1 clove garlic, chopped&lt;/li&gt;
    &lt;li&gt;100 g mushrooms, sliced&lt;/li&gt;
    &lt;li&gt;400 g can chopped tomatoes&lt;/li&gt;
    &lt;li&gt;Olive oil&lt;/li&gt;
    &lt;li&gt;Balsamic vinegar&lt;/li&gt;
    &lt;li&gt;Dried tarragon&lt;/li&gt;
    &lt;li&gt;2 small bay leaves&lt;/li&gt;
    &lt;li&gt;Black pepper&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;

&lt;p&gt;In a wide-based saucepan, heat a tablespoon of olive oil, and fry
  the onion and chorizo for 2-3 minutes (or until the onion is
  translucent). Add the mushrooms and garlic, and continue to fry
  until the mushrooms begin to darken and shrink. Add the tomatoes,
  and stir in the dried tarragon, bay leaves, black pepper, and about
  a tablespoon of balsamic vinegar. Cover and simmer gently for 20-30
  minutes.&lt;/p&gt;

&lt;p&gt;Serve with pasta and fresh green salad.&lt;/p&gt;

    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-3173550787125219875?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=3173550787125219875' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3173550787125219875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3173550787125219875'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/07/chorizo-and-tomato-pasta.html' title='Chorizo and tomato pasta'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-8590659229330470191</id><published>2009-06-29T18:42:00.001+01:00</published><updated>2009-06-29T18:42:04.371+01:00</updated><title type='text'>Baked pork chops with chorizo</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;Here's a simple but delicious recipe I adapted from a dish served
  at Girton's cafeteria sometime in early 2009.&lt;/p&gt;
&lt;p&gt;Ingredients (serves 2):&lt;ul&gt;
    &lt;li&gt;2 pork chops&lt;/li&gt;
    &lt;li&gt;60 g dried chorizo sausage, diced finely&lt;/li&gt;
    &lt;li&gt;1 medium cooking onion, coarsely chopped&lt;/li&gt;
    &lt;li&gt;1 clove garlic, chopped&lt;/li&gt;
    &lt;li&gt;Salt and pepper&lt;/li&gt;
  &lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;Pre-heat the oven to 180°C (fanless oven 200°C). Sprinkle
  both sides of the chops with salt, and place in a small roasting
  tin. Pile garlic, onion and chorizo on and around the meat. Add
  pepper on top. Cover the roasting tin with tin foil and bake in the
  oven until the meat is cooked (usually between 45 mins and one
  hour).&lt;/p&gt;
&lt;p&gt;Serve with boiled potatoes and fresh cabbage.&lt;/p&gt;

    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-8590659229330470191?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=8590659229330470191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/8590659229330470191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/8590659229330470191'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/06/baked-pork-chops-with-chorizo.html' title='Baked pork chops with chorizo'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-6959360242753490948</id><published>2009-01-24T22:44:00.001Z</published><updated>2009-01-24T22:44:22.970Z</updated><title type='text'>PhD studentship at SSC</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;I've been accepted for a PhD studentship
  at &lt;a href='http://www.ee.surrey.ac.uk/SSC/'&gt;Surrey Space
  Centre&lt;/a&gt;, working on applications of
  satellite-based &lt;a href='http://en.wikipedia.org/wiki/Synthetic_aperture_radar'&gt;Synthetic
  Aperture Radar&lt;/a&gt; (SAR). Even better, I've been awarded a Doctoral
  Training Grant by the EPSRC, so as long as I pass my MEng I'm going
  to be going exactly where I've wanted to go for the last couple of
  years, doing (more or less) exactly what I want to do!&lt;/p&gt;

    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-6959360242753490948?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=6959360242753490948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/6959360242753490948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/6959360242753490948'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/01/phd-studentship-at-ssc.html' title='PhD studentship at SSC'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-6656925585025073359</id><published>2009-01-24T22:39:00.001Z</published><updated>2009-01-24T22:39:55.910Z</updated><title type='text'>gschem, log files and X selections</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;Just over a week ago, I posted a series of &lt;tt&gt;[RFC]&lt;/tt&gt; posts to
  the gEDA-user mailing list suggesting six reasonably non-trivial
  changes to libgeda and gschem. Although the discussions they started
  off weren't quite as productive as I was hoping, they did attract
  quite a bit of interest.&lt;/p&gt;
&lt;p&gt;I haven't been afraid to put my money where my mouth is. Since
  then, I've implemented two of the changes I suggested: a
  modification of the way gEDA apps create logfiles, and support for
  copying and pasting bits of schematics between gschem windows. I
  thought I'd post here to explain the amount of careful design work
  that goes into even relatively minor changes to the gEDA suite.&lt;/p&gt;

&lt;h4&gt;Logging&lt;/h4&gt;
&lt;p&gt;Historically, gschem (and the other gEDA apps) have created
  logfiles in the current working directory when they were
  launched. This behaviour quickly resulted in a user's home directory
  becoming littered with the files, &lt;tt&gt;gschem.log&lt;/tt&gt; files
  especially.&lt;/p&gt;
&lt;p&gt;My initial suggestion was to just not create log files by default,
  and require users to specifically enable them. However, it was
  quickly pointed out that since one of the most common reasons for
  gschem failing to start was that a new user had made a mistake in
  their configuration file, and that it would be best to carry on
  with generating logfiles as the default behaviour.&lt;/p&gt;
&lt;p&gt;Instead, it was suggested that the logfiles should be put in a
  centralised, out-of-the-way location, and &lt;tt&gt;~/.gEDA/logs/&lt;/tt&gt; was
  suggested, with the caveat that it would be necessary to make sure
  that multiple copies of gschem accessing the directory would have
  to be supported safely, even on different machines, but also that a
  user could quickly easily find the most recent log file -- so just
  adding a random suffix with &lt;tt&gt;mktemp&lt;/tt&gt; wouldn't work either!&lt;/p&gt;
&lt;p&gt;Having worked out a way of doing this (a secure algorithm for
  generating sequentially numbered, dated log files), I then realised
  that on some operating systems, such as Microsoft
  Windows, &lt;tt&gt;$HOME&lt;/tt&gt; might not even be defined, and that there
  might be platform-specific differences in the standardised place to
  keep configuration data.  Since the gEDA applications had no
  existing way of handling these variations, I ended up abstracting
  out the methods for locating the system and user data and
  configuration files, and updating all of the gEDA apps to use
  them.&lt;/p&gt;
&lt;p&gt;All in all, changing the location where log files are stored used
  up at least eight hours of development time.&lt;/p&gt;

&lt;h4&gt;Clipboard copy, cut and paste&lt;/h4&gt;
&lt;p&gt;For a long time, gschem has supported copying and pasting schematic
  data between pages and windows in the same gschem process, but it
  was never made clear to users that this mechanism didn't use the X
  clipboard, and thus sometimes copying and pasting didn't work when
  it would have made sense for it to.&lt;/p&gt;
&lt;p&gt;X Window System selections are complicated. There are two
  selections normally used by X applications: the PRIMARY selection
  and the CLIPBOARD selection. Traditionally, the PRIMARY selection is
  contains the most recent piece of text selected by the user with the
  mouse, and can be pasted by clicking the middle mouse butten, while
  the CLIPBOARD selection is accessed via "copy" and "paste" actions
  explicitly invoked by the user. In order to match up with other
  applications (and because nothing like the PRIMARY selection is
  available on Microsoft Windows or OS X), we decided to use the
  CLIPBOARD.&lt;/p&gt;
&lt;p&gt;For the same portability reasons (and also because the raw X API is
  horrendously complicated), we decided to use the GTK Clipboard API
  to manage the clipboard.&lt;/p&gt;
&lt;p&gt;A neat feature of clipboards (and X selections in particular) is
  that it's possible for the source application to provide the data in
  different forms, depending on what the "pasting" application
  wants. We needed a format for transferring between gschem instances,
  so we decided to use the gEDA schematic format
  (&lt;tt&gt;application/x-geda-schematic&lt;/tt&gt;). Fortunately, as part of my
  rewrite of the symbol library back in mid 2007, I'd made
  libgeda &lt;a href='http://git.gpleda.org/?p=gaf.git;a=commit;h=022421c35c53cbfe4ea936cc1d31b192cfd34ab7'&gt;able
  to "load" and "save" schematics from memory buffers&lt;/a&gt;, so I simply
  hooked the clipboard code into that and things started working!&lt;/p&gt;
&lt;p&gt;I then, of course, had to work through the boilerplate required to
  update the GUI to support it. This took as long as implementing the
  actual feature.&lt;/p&gt;

&lt;p&gt;I've also been working on some other features, using some code that
  I've had floating around for a long time. But more of that another
  time!&lt;/p&gt;
    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-6656925585025073359?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=6656925585025073359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/6656925585025073359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/6656925585025073359'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2009/01/gschem-log-files-and-x-selections.html' title='gschem, log files and X selections'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-4195316456756393287</id><published>2008-09-21T18:17:00.002+01:00</published><updated>2008-09-26T16:38:41.614+01:00</updated><title type='text'>More cooking escapades</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;I tried out two recipes yesterday, with lots of success (well, I
  thought so, anyway).&lt;/p&gt;

&lt;p&gt;First was nice and simple recipe
  for &lt;a href='http://www.bbcgoodfood.com/recipes/4942/lemon-drizzle-cake'&gt;lemon
  drizzle cake&lt;/a&gt; from the BBC Good Food website -- I used it as a
  fallback plan when I failed to obtain a copy of my mother's
  legendary and delicious recipe.&lt;/p&gt;
&lt;p&gt;I made it in a 20 cm spring-form tin instead of a loaf tin as
  the recipe suggests (I don't have a loaf tin at the moment). This
  meant it only took around 40 minutes rather than the 45 to 50
  suggested, due to the cake being somewhat wider and flatter.&lt;/p&gt;
&lt;p&gt;The cake was delicious, but a little dense; next time I will try
  adding an extra teaspoon of baking powder to try and lighten it
  slightly.&lt;/p&gt;

&lt;p&gt;The second was a Thai-style dish
  called &lt;em&gt;&lt;a href='http://en.wikibooks.org/wiki/index.php?title=Cookbook:Khao_Pad_Gai&amp;amp;oldid=632580'&gt;khao
  pad gai&lt;/a&gt;&lt;/em&gt; from a WikiBooks Cookbook recipe. Due to the
  limited contents of my food cupboard and my unwillingness to buy
  lots of unusual and seldom-to-be-used foodstuffs, my version of the
  ingredients (to feed two) looked more like:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Olive oil&lt;/li&gt;
  &lt;li&gt;225 g chicken breast, in strips&lt;/li&gt;
  &lt;li&gt;2 medium eggs&lt;/li&gt;
  &lt;li&gt;'Some' cooked, cold Basmati rice&lt;/li&gt;
  &lt;li&gt;1 medium cooking onion, half-ringed&lt;/li&gt;
  &lt;li&gt;2 small tomatoes, seeds removed and julienned&lt;/li&gt;
  &lt;li&gt;2 spring onions, thinly sliced&lt;/li&gt;
  &lt;li&gt;3/4 cup coriander, coarsely chopped&lt;/li&gt;
  &lt;li&gt;Dark soy sauce&lt;/li&gt;
  &lt;li&gt;'Normal' granulated sugar&lt;/li&gt;
  &lt;li&gt;Salt&lt;/li&gt;
  &lt;li&gt;2 cloves fried garlic&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We didn't bother with the garnish, the &lt;em&gt;nam pla&lt;/em&gt; or the Thai
  chili sauce, but nevertheless the taste came out okay (we were quite
  pleasantly surprised by how good it was after how awful it looked
  just after the egg was added). Note that although the recipe
  specifies a wok, we cooked it quite successfully in a large,
  flat-bottomed non-stick saucepan.&lt;/p&gt;

    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-4195316456756393287?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=4195316456756393287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4195316456756393287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/4195316456756393287'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2008/09/more-cooking-escapades.html' title='More cooking escapades'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-1940635004164709314</id><published>2008-06-25T19:05:00.001+01:00</published><updated>2008-06-25T19:05:36.742+01:00</updated><title type='text'>Emacs word counting and tab completion</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;I've been doing a lot of work that's required me to keep an eye on
word counts recently, so I've needed a decent word count function in
Emacs. The easiest way to implement this was to use the &lt;tt&gt;wc&lt;/tt&gt;
command from CNU coreutils.&lt;/p&gt;

&lt;pre&gt;
(defun word-count nil "Count words in buffer" (interactive)
  (let ((start (if mark-active (point) (point-min)))
        (end (if mark-active (mark) (point-max))))
    (shell-command-on-region start end "wc -w")))
&lt;/pre&gt;

&lt;p&gt;If the the mark is active, it counts the number of words marked,
otherwise counts the entire buffer. I have this bound to C-c C-w.&lt;/p&gt;

&lt;p&gt;I also extended tab completion with &lt;tt&gt;dabbrev-expand&lt;/tt&gt; to all
file buffers, so I can use it in MATLAB, Bash, Python, etc. This was
inspired by doing lots of MATLAB programming recently at my newly
started summer job at &lt;a href='http://www.csr.com/'&gt;Cambridge Silicon
Radio&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;
(defun indent-or-complete ()
  "Complete if point is at end of a word, otherwise indent line."
  (interactive)
  (if (looking-at "\\&amp;gt;")
      (dabbrev-expand nil)
    (indent-for-tab-command)))
(add-hook 'find-file-hook
          (function (lambda ()
                      (local-set-key (kbd "&amp;lt;tab&amp;gt;") 'indent-or-complete))))
&lt;/pre&gt;

    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-1940635004164709314?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=1940635004164709314' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/1940635004164709314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/1940635004164709314'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2008/06/emacs-word-counting-and-tab-completion.html' title='Emacs word counting and tab completion'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-3944953829824915917</id><published>2007-12-25T18:26:00.000Z</published><updated>2007-12-28T20:40:27.072Z</updated><title type='text'>Christmas</title><content type='html'>&lt;p&gt;Having been horribly ill for what feels like most of December, Christmas is now here!  I'm spending Christmas with my parents and all of my siblings, and it seems like I've been running around like a mad things for the last few days getting everything clean, tidy and ready for Christmas.  On Christmas Eve my mother and I were at the butchers' shop at half past six in the morning to get the turkey and other bits we needed!  This was most certainly a better option than waiting in the hour-long queue that had formed by the time I returned to the town centre later in the morning to do some other shopping.&lt;/p&gt;
&lt;p&gt;Although being miserably ill put a big damper on my plans to do vast amounts of gEDA development during December, I've nevertheless managed to get some useful stuff done, further based on the &lt;tt&gt;libgeda&lt;/tt&gt; error reporting issues discussed in my last couple of posts.&lt;/p&gt;
&lt;p&gt;Firstly, I improved the way in which errors in Scheme files were reported.  Messages reporting errors in gEDA rc files often reported the error as occurring in the wrong file, and claimed every error was a parenthesis mismatch (often when they were nothing of the sort).  The error messages were also sent directly to the console rather than to the gEDA logging mechanism.  Using deep dark Guile debugging magic, any errors encountered while reading in rc files now logs a backtrace, and tries to report the actual file and line on which the error occurred.&lt;/p&gt;
&lt;p&gt;Secondly, and more importantly, I added internationalisation support to &lt;tt&gt;libgeda&lt;/tt&gt; using &lt;tt&gt;gettext&lt;/tt&gt;.  As there are many international users of gEDA, and many important messages generated by libgeda, I feel that this is a very important development.&lt;/p&gt;
&lt;p&gt;I'm hoping that we can use the web translation tools offered by &lt;a href="https://launchpad.net/"&gt;Launchpad&lt;/a&gt; to make translating gEDA easier for users, and thus increase the quality and number of translations.&lt;/p&gt;
&lt;p&gt;Peter Clifton and I have also been working hard on getting gEDA ready for a new release, squishing as many serious bugs as possible.  Peter Clifton has particularly excelled himself, creating stunning icons for all the main file types used by gEDA.&lt;/p&gt;
&lt;p&gt;In the next development cycle, I hope to substantially increase the flexibility of the component library.  In particular, I hope to make it possible to have truly independent library setups, so that it is possible to have schematics from different projects with different libraries open in the same gschem session without any conflicts.  I also hope to generalise the library infrastructure so that the same basic code can be used for the component library, hierarchy source library and any other library of reusable resources which might need to be added in the future.&lt;/p&gt;
&lt;p&gt;As a first step along the route to the Ultimate Resource Library, however, the way that the Scheme extension API works needs to be rationalised, and once Christmas starts to wind down, I hope to deal with this.  It will involve &lt;a href="http://www.gnu.org/software/guile/manual/html_node/Fluids-and-Dynamic-States.html#Fluids-and-Dynamic-States"&gt;fluids&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: My blood test results have arrived, and it turns out that I have &lt;a href="http://en.wikipedia.org/wiki/Glandular_Fever"&gt;glandular fever&lt;/a&gt;. Absolutely fantastic.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-3944953829824915917?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=3944953829824915917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3944953829824915917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3944953829824915917'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2007/12/christmas.html' title='Christmas'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-1911844716285650013</id><published>2007-12-07T23:06:00.001Z</published><updated>2007-12-07T23:06:51.648Z</updated><title type='text'>Error-reporting progress</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;Further to
my &lt;a href='http://www.peter-b.co.uk/blog/2007/11/error-reporting-handling-in-libgeda.html'&gt;previous
blog post&lt;/a&gt; on error-reporting in libgeda, I've made some pretty
good progress on implementing the ideas that I described.  In
  particular:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;The file opening functions (&lt;tt&gt;f_open()&lt;/tt&gt;
    and &lt;tt&gt;f_open_flags&lt;/tt&gt;) now use &lt;tt&gt;GError&lt;/tt&gt; to return error
    messages rather than just spewing them to the console.&lt;/li&gt;
  &lt;li&gt;gschem now shows an informative dialog box when it fails to load
    a file.&lt;/li&gt;
  &lt;li&gt;All programs now actually tell you the real reason for failing to
    load a file (e.g. "Permission denied" or "File does
    not exist") rather than just giving a generic "Could not
    open file" message.&lt;/li&gt;
  &lt;li&gt;The libgeda logging mechanism now handles most levels of GLib
    log message rather than just the "message" level (seeing
    as the log is most useful when some sort of error has occurred, this
    seems sensible).&lt;/li&gt;
  &lt;li&gt;gschem now highlights warnings and errors in the log
    window.&lt;/li&gt;
  &lt;li&gt;Lots of ways in which libgeda could randomly kill your program
    have been eradicated.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These changes are not yet in the unstable branch, but barring
  someone objecting to my changes I'll push them upstream tomorrow
  sometime.&lt;/p&gt;
&lt;p&gt;The next (probably thankless) task is to work through libgeda
  converting all calls to directly output debugging/error-reporting
  information to the console to use the GLib logging functions
  instead, and to make log messages be sent at appropriate levels
  rather than all at the "message" level (this will allow
  filtering of log messages in the gschem log window, for
  instance).&lt;/p&gt;
&lt;p&gt;I'm still of two minds about the best way to do this.  Currently,
  libgeda defines a macro &lt;tt&gt;s_log_message()&lt;/tt&gt; which is equivalent
  to GLib's &lt;tt&gt;g_message()&lt;/tt&gt;.  For adding logging at multiple
  levels, the two options are:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Get rid of &lt;tt&gt;s_log_message&lt;/tt&gt; entirely, and just use the
    GLib logging macros directly.&lt;/li&gt;
  &lt;li&gt;Define &lt;tt&gt;s_log_debug&lt;/tt&gt;, &lt;tt&gt;s_log_warning&lt;/tt&gt; etc so that
  the exact implementation could be easily modified at a later date
  (e.g. for the purpose of making libgeda always log in the
  "libgeda" log domain).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I'm currently leaning towards the latter, but haven't as yet made
  up my mind about exactly which will be the best way to go.&lt;/p&gt;

    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-1911844716285650013?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=1911844716285650013' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/1911844716285650013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/1911844716285650013'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2007/12/error-reporting-progress.html' title='Error-reporting progress'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-3738011513328158292</id><published>2007-11-27T23:22:00.001Z</published><updated>2007-11-27T23:22:32.481Z</updated><title type='text'>Error reporting &amp; handling in libgeda</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;Apparently some people do read my blog: Peter Clifton and I met up
  for a drink at Borders in town this evening, and he recommended that
  I write more often.  So here's this evening's contribution, on a
  slight refactor of libgeda error reporting.&lt;/p&gt;

&lt;p&gt;It's been a while since I last blogged about gEDA development, and
  since then I've had the good fortune to be able to travel to
  Cambridge, MA and meet several of the other developers based around
  there.  In the last couple of days I've started ramping up my
  involvement in preparation for having some time for serious
  development over the Christmas vacation.&lt;/p&gt;

&lt;p&gt;So, to begin: in general, libgeda kills the process without warning far too
  often. This is a bad thing for a library to do; in particular, it's
  very bad to do it just because someone passed some bad data in.  The
  libgeda doesn't make any attempt to hide how the data structures are
  organised, and thus we have to assume that user code will make use
  of this knowledge to try and hack them directly.&lt;/p&gt;

&lt;p&gt;My pondering of this problem over the last couple of days has lead
  me to think up four basic rules to consider when working out how to
  handle errors occuring in libgeda code:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;em&gt;If possible, succeed.&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;If failure is inevitable, fail gracefully.&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;If normal operation may result in failure,
  use &lt;tt&gt;&lt;a href='http://library.gnome.org/devel/glib/stable/glib-Error-Reporting.html'&gt;GError&lt;/a&gt;&lt;/tt&gt;.&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;Assume that libgeda works.&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Of course, some of these need a little explanation as to their
  interpretation and why they make sense.&lt;/p&gt;
&lt;p&gt;Firstly, "If possible, succeed." This seems obvious, but
  actually has some subtlety.  What I mean here is that if there's a
  sensible, clean way of carrying on despite a problem, you should do
  so.  This only really applies to user-facing code, as code which
  can't be called from outside libgeda really should have had its
  inputs checked by the calling function already.  However,
  since &lt;em&gt;all&lt;/em&gt; of libgeda's code is user-facing -- we don't have
  any private headers or the like -- this point is rather moot.  In
  addition, "succeeding" doesn't preclude printing messages
  to the effect of, "Someone's playing silly buggers but I'm
  going to try my best anyway." &lt;tt&gt;g_critical()&lt;/tt&gt; should be
  used for this.  One example would be when an unknown object type is
  encountered; at the moment, libgeda often kills the program by
  calling &lt;tt&gt;g_assert_not_reached()&lt;/tt&gt;, when often it would be
  valid to continue by logging a critical message and then skipping
  over the offending object.&lt;/p&gt;
&lt;p&gt;Secondly, "If failure is inevitable, fail gracefully."
  Failing gracefully requires no dangerous side-effects from the
  failure.  If possible, the system should be returned to its prior
  state.  This often requires that user data needs to be
  checked &lt;em&gt;before&lt;/em&gt; doing anything destructive, possibly at the
  expense of some CPU time.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;GError&lt;/tt&gt; is a nice mechanism in that it allows errors to be
  ignored if necessary.  A good example of when it should be used
  would be in code which reads and writes files; because GLib's file
  access code already uses GError extensively, this would not be hard
  to implement.&lt;/p&gt;
&lt;p&gt;Finally, "Assume that libgeda works."  Similarly to rule
  #1, what is meant here is that libgeda functions should check their
  own behaviour.  If they do so, there is no need for libgeda
  functions which call them to check again -- it's a waste of CPU
  time and developer effort.&lt;/p&gt;
&lt;p&gt;So, given the above points, when is it appropriate to
  use &lt;tt&gt;g_assert()&lt;/tt&gt;?  It would not be appropriate to use it to
  check the arguments passed to a function, but it would be valid to
  use it to check that the function has successfully done what it is
  supposed to before returning a result.  For instance, when a complex
  algorithm is in use, putting some assertions in to make sure that
  the algorithm actually does what you think it does might be a very
  good idea.&lt;/p&gt;
&lt;p&gt;Of course, this has lead to a number of action items in terms of
  libgeda refactoring:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Cleaning up uses of &lt;tt&gt;g_assert()&lt;/tt&gt; in libgeda, and replacing
    them with &lt;tt&gt;g_critical()&lt;/tt&gt; logging and graceful failure where
    possible.  I've already made a start on this.&lt;/li&gt;
  &lt;li&gt;Moving all of the file handling code to use &lt;tt&gt;GError&lt;/tt&gt;.
    This will allow gschem to show a message dialog when a file
    operation fails, rather than forcing the user to look at the log
    window or at the console.&lt;/li&gt;
  &lt;li&gt;In the medium term, moving all of libgeda to use the GLib
    logging API (of which &lt;tt&gt;g_critical()&lt;/tt&gt; is part) will allow
    the development of a shiny new gschem log window which allows
    logging at different levels with colour coding of criticality.
    This would be nice.&lt;/li&gt;
  &lt;li&gt;Ideally, the error messages used for &lt;tt&gt;GError&lt;/tt&gt;s emitted
    from libgeda should be translated.  This means libgeda will need
    to use gettext.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As usual, I'd be interested to hear peoples' thoughts on this.
  Please let me know on the -dev list or by e-mail.&lt;/p&gt;

    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-3738011513328158292?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=3738011513328158292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3738011513328158292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/3738011513328158292'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2007/11/error-reporting-handling-in-libgeda.html' title='Error reporting &amp;amp; handling in libgeda'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-310835385305455939</id><published>2007-07-23T18:12:00.001+01:00</published><updated>2007-07-23T18:12:17.891+01:00</updated><title type='text'>Taking time out</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;
&lt;p&gt;Much of my work on gEDA recently has met with rather mixed
  responses, many not particularly positive.  Most of the things that
  bug me are fixed, so between the lukewarm reception that seems to
  meet my changes and the absence of any particular itch to scratch,
  I'm taking a little time out from gEDA hacking.  This will also
  (hopefully) help with my RSI, which is slightly more aggravating
  than usual at the moment.  No doubt I'll still troll the mailing
  lists telling users to RTFM (or possibly write it).&lt;/p&gt;

&lt;p&gt;My current contract is both interesting and hard; I'm doing an
  electronic systems redesign for a laboratory automation robot to be
  used by the Sanger Institute, at the Wellcome Trust site near
  Cambridge.  This is rather involved, with a very broad scope for the
  work.  I've had to learn a lot different types of electric motor (in
  particular stepper motors and brushless DC motors), as well as
  needing to keep a very careful eye on issues such as inductive load
  dump and EMI filtering.  Sometimes digging around to find out the
  design rationale for parts of the current design can get a little
  tedious; I hope that my attempts to put everything in one place will
  be useful for future engineers working on the same system!&lt;/p&gt;

&lt;p&gt;One thing that has recently struck me while working on this project
  is the lack of a consistent lightweight symbol library for gEDA
  suitable for drawing circuit diagrams to be used in documents such
  as datasheets or academic papers.  I've made a rough start on
  creating one, but have got a little stuck on exactly what symbols
  are within the scope; and more stuck on finding a sensible way to
  name all of the different types of diode available.&lt;/p&gt;

    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-310835385305455939?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=310835385305455939' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/310835385305455939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/310835385305455939'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2007/07/taking-time-out.html' title='Taking time out'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5144379.post-1308010033700875820</id><published>2007-06-30T14:59:00.001+01:00</published><updated>2007-06-30T14:59:31.667+01:00</updated><title type='text'>Making embedding more useful</title><content type='html'>
    &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;

&lt;p&gt;One of the trickiest problems electronic engineers have is with
  keeping their symbol libraries up-to-date while not breaking old
  schematics (e.g. with changing pin positions).&lt;/p&gt;

&lt;p&gt;Currently, most people use one of two approaches to managing the
  problem:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;gEDA has the ability to embed symbol data in the schematic file,
  making the schematic independent of changing symbol libraries, and
  some people choose to embed all their symbols.  However, a full copy
  of the symbol is embedded for each time it's instantiated in the
  schematic, making the file size bloat enormously.  In addition, not
  only is neither possible to check whether any of the symbols have
  updated versions available in the library nor to update all symbols
  of a given type together, it is also impossible to make sure that
  all symbols of the same type are embedded from the same version of
  that symbol.&lt;/li&gt;

  &lt;li&gt;gEDA also has the ability to use a project-specific
  configuration file which lives in the same directory as the
  schematics.  This can be used to implement a project-specific
  component library where all symbols used by the project live.
  Although this solves the problem of keeping all symbols in the
  project in sync with each other, it is quite high maintenance to
  keep the project library in sync with a "master" library.
  It is also still impossible to automatically check for newer
  versions and update them.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;My solution to this would be to add the missing features to the
  embedding functionality (presupposing
  that &lt;a href='http://sourceforge.net/tracker/index.php?func=detail&amp;amp;aid=1692626&amp;amp;group_id=161080&amp;amp;atid=818426'&gt;these
  embedding bugs [1692626]&lt;/a&gt; are also fixed).&lt;/p&gt;

&lt;p&gt;By default, each symbol used would automatically have a single copy
  embedded in the schematic, which instances of that symbol would
  reference.  This would mean that all instances of a given symbol
  would be upgraded in lockstep, eliminating inconsistencies.&lt;/p&gt;

&lt;p&gt;A hash algorithm would be used to compare the embedded version of a
  symbol with the latest library version.  If they differ, an icon
  would be shown in a new component manager (derived from the current
  component selector) and users would be able to update symbols from
  there, either all symbols at once or one symbol at a time.&lt;/p&gt;

&lt;p&gt;I have yet to work out whether it should be possible to edit
  symbols which do not exist in the local library, but it should
  certainly be possible to open them for read-only viewing or export
  them to discrete symbol files.&lt;/p&gt;

&lt;p&gt;I believe this solution would eliminate most of the current
  deficiencies of gEDA and gschem for keeping archived schematics
  safe and keeping current schematics in sync with libraries.&lt;/p&gt;
    &lt;/div&gt;
  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5144379-1308010033700875820?l=www.peter-b.co.uk%2Fblog%2Findex.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5144379&amp;postID=1308010033700875820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/1308010033700875820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5144379/posts/default/1308010033700875820'/><link rel='alternate' type='text/html' href='http://www.peter-b.co.uk/blog/2007/06/making-embedding-more-useful.html' title='Making embedding more useful'/><author><name>Peter</name><uri>http://www.blogger.com/profile/13507691713687465296</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09676549050832670391'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>