Thursday, August 20, 2009

Perception of reality

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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 too devoted, too trusting?

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 she didn't tell me. And that would mean that, for more than a year and half of my life, the reality I perceived did not exist. I was living in a dream world.

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 this.

My days are swifter than a weaver's shuttle, and are spent without hope.

--Job 7:6

Friday, August 14, 2009

US NEO detection programme not on schedule

In space-related news:

According to a new interim report from the US National Research Council, NASA's current near-Earth object 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.

What a surprise! Underfunded science programmes have difficulty meeting targets! In addition to complaining about funding, the full report (which is free to download) has some interesting information on the current technology and facilities used for detecting near-Earth objects.

Another of the report's findings was that:

The Arecibo Observatory 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.

I find this particularly interesting in the light of concerted efforts in recent years to shut the Arecibo facility down "to save money."

Congress should make up their minds: they can mandate and fund public research, or do neither.

Thursday, August 13, 2009

Response to illicit filesharing legislation consultation

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 rather lengthy response on my website.

I hereby disclaim all responsibility for permanent brain damage caused by extreme boredom induced by reading the document linked above.

Sunday, August 09, 2009

gEDA build system redesign

One of the items on the gEDA "Todos" list 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.

Why?

The advantages of this strategy were seen as follows:

  1. The system would be less confusing for new testers or "power" users who want to try out the latest changes in git.
  2. The whole suite could be built and tested before installing any files. In the past, it's been necessary to install the libgeda and symbols packages before any of the other packages could be built.
  3. It would reduce the labour involved in keeping the version numbers, ChangeLogs, 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.
  4. 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 Fedora Electronic Lab distribution, Chitlesh Goorah) to maintain a single SPEC file, rather than nine.
  5. It would simplify building using parallel make (see the -j option to make), which can significantly speed up compiling gEDA on machines with multiple or multi-core processors.
  6. It would improve detection of targets requiring rebuilding. This is particularly important for working on libgeda; 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.

Approach

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.

  • One idea that crossed my mind extremely briefly 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.
  • I had recently been looking at the configure.ac file for DTN2 (the reference implementation for the Delay Tolerant Networking Bundling Protocol), 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 configure.ac files are often very confusing to a newcomer, and this method offered the potential to make it much, much clearer.

Problems encountered

There were two major problems encountered while carrying out the work.

Firstly, internationalisation of desktop integration files (.desktop files to appear in menus etc., and MIME-type info files to make file browsers show the right icon. In previous releases, intltool 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 libgeda, gschem and gattrib).

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 desktop-i18n. Although enormously hacky, it works remarkably effectively!

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 libgeda used to call exit(-1) if it couldn't find the gEDA font, even in gnetlist 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.

Results

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!

Sunday, July 26, 2009

Double-chocolate brownies

While CURA were at Bisley for the Imperial Meeting this year, I made the team some of these brownies. They were very much enjoyed by all!

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).

  • 275 g plain chocolate (50% cocoa solids)
  • 220 g unsalted butter
  • 85 g walnut pieces
  • 170 g milk chocolate (cut into chunks)
  • 225 g plain flour
  • 1 tsp baking powder
  • 4 large eggs, lightly beaten
  • 1 tsp vanilla essence
  • 325 g caster sugar

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 as well.

Melt the plain 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.

Sieve the flour and baking powder into the mixture, and fold in. Fold in the nuts and chocolate chunks.

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.

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).

Update: Avoid oil-based chocolate and/or HFCS-based chocolate for this recipe. It won't work.

Simple unit tests in Scheme

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.

A few days ago, I needed to write some simple unit tests for some Scheme code I was in the process of developing. The Guile 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:

(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))

Note that this effectively adds a keyword (begin-test) 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:

(begin-test 'SuccessfulTest
  (assert-true #t)
  (assert-true (equal? 1 1)))
(begin-test 'FailTest
  (assert-true (equal? #t "string")))
(report-tests)

The framework is completed with the addition a few more assert- functions (left as an exercise to the reader). This code will form part of a future release of gEDA.

(In case you want to use this code in your own project, it is licensed under the GNU LGPL v3 or later). But there are probably better unit test systems for Scheme out there!

Saturday, July 18, 2009

Enchiladas

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.

Enchilada sauce

  • 400 g can of chopped tomatoes
  • 1 clove garlic, chopped
  • Fresh chilis, chopped
  • 1 tbsp olive oil

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.

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.

This can easily be made in advance, and freezes well.

Fried chicken filling

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.

  • 300 g chicken breast, cut into strips
  • 10 g fresh ginger, grated
  • Dried paprika
  • Salt & pepper
  • Half a medium cooking onion, coarsely chopped.
  • 1 tbsp olive oil

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.

Like the sauce, this can easily be made in advance.

Putting it all together

  • 4 corn tortilla wraps
  • 150 g grated cheese (cheddar works okay)

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.

Bake in the oven for 15-20 minutes, and serve with green salad and spring onions.

Friday, July 17, 2009

This will seem like bragging...

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:

  • Emily Davies Scholarship (twice)
  • Henry Tompkinson Scholarship
  • Beatrice Mills Prize
  • Rosalind, Lady Carlisle Prize
  • Raemakers Prize
  • Accenture Second Year Computing Prize
  • i2 Ltd. Third Year Computer-Based Project Prize

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)!

Edit: 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 "social engineering" than actual engineering!

Wednesday, July 01, 2009

Starting my PhD!

As I mentioned in January, 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!

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 compilation-mode?)

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.

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!

Update: I managed to persuade the computing folks to give me second PC running Linux and a USB KVM switch. So that's alright, then.

Chorizo and tomato pasta

Another chorizo recipe that I made to use up what was left over from the previous one. Note that I use Spanish chorizo, not Mexican (as most commonly found in the USA).

Ingredients (serves 3-4):

  • 150 g dried chorizo sausage, diced finely
  • 1 medium cooking onion, coarsely chopped
  • 1 clove garlic, chopped
  • 100 g mushrooms, sliced
  • 400 g can chopped tomatoes
  • Olive oil
  • Balsamic vinegar
  • Dried tarragon
  • 2 small bay leaves
  • Black pepper

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.

Serve with pasta and fresh green salad.