The Power Of The Test Case

Thanks to Tim Waugh, before we even started, we knew one of the stumbling
blocks for this terminal services thing was going to be VNC’s ZRLE encoding.
You see, in order to make the hot-desking thing work you need to be able
to transfer a VNC client between two VNC servers without the client knowing
about it.

What makes the ZRLE encoding difficult is that it compresses the pixel
stream using zlib and this introduces state into the VNC stream. A rectangle
of encoded pixel data now depends on the pixels that went before. So when,
you transfer a client between servers, the new server either needs to know
the state of the zlib stream or you need to allow the new server to start
with a clean slate somehow.

A glance at the zlib docs
and the Z_FULL_FLUSH/Z_FINISH deflate() flags jumped out
of me. Sweet, this is going to be trivial, says he. Like a good engineer,
I started writing a
test case
to prove the idea. The solution wasn’t as obvious as I’d hoped,
though, and I found myself knee deep in docs, rfcs and the inflate()/
deflate() code. Unfortunately, I had to actually understand
what the hell was going on. The horror!

Plugged the code into Xvnc and tried it out. Broken. Dramatically broken. Debug,
tweak, test. Still broken. And on it went. Eventually, hours later, I went back
to my test case and discovered that it actually wasn’t working. It was sneakily
pretending to be working. But it wasn’t. Trivial fix and all is well.

You can save so much time by figuring stuff out in a small test case rather
than trying to figure it out in the context of a huge mass of code with a million
and one other things happening. I know this to be true, and as time goes on
I’m learning just how true it is. But you still find yourself launching headlong
into problems thinking “it looks trivial, in the same time I’d write a test case
I’ll have the thing fixed” and only hours and hours later do you get a clue
and start writing a test case. I get the feeling Owen always reaches straight
for a test case. Maybe that’s his secret 🙂

Anyway, I’ve moved on to adding TLS/SSL support Xvnc and vncviewer now. And,
yes, I’m going to go through all this “state flushing” pain again. Fun
all the way, I tell ya … Now, where’s my test case?

On the plus side, I’ve had to take loads of breaks from this stuff today,
and I’ve been cooking. Had a gorgeous
ratatouille for lunch
and some chilli
is bubbling away as I type.

Blaa

I knew of Wikipedia‘s existence, and
I knew what it was, but I’d never really spent any amount of time looking at
it. Seth was babbling happily about
it at one point while I was in Westford so I went and took a good look. What
really strikes you is not only the sheer size of the thing, but the quality
of the content. Very impressive.

Anyway, I added my own drop to the fountain of knowledge – an entry on the
famous Waterford Blaa.

Threaded bugzilla mail

Woo! As, Jeremy points
out, dkl has enabled
threading
in Red Hat’s bugzilla mail. Now I can stop filtering my mail
through “fixup-threading.sh” 🙂

Red Hat developers are soon going to wonder how they ever survived without
this. We GNOME hackers have been spoilt for far too long …

He Calls Himself an Irishman?

He Calls Himself an Irishman?

So, Glynn‘s a posh
D4 Dubliner. Don’t mind him. Most of us Waterford knackers with
a bit of national pride think Ireland’s
Call
is an abomination and that Ireland is losing some of
its national identity by not using Amhrán na
bhFiann
for rugby.

It has one great side effect, though. Everyone can now actually
understand what they’re singing! You won’t find many irishmen
who are fluent enough in their national language enough to be
able to translate this:

     Sinne Fianna Fáil
     A tá fé gheall ag Éirinn,
     buion dár slua
     Thar toinn do ráinig chugainn,
     Fé mhóid bheith saor.
     Sean tír ár sinsir feasta
     Ní fhagfar fé'n tiorán ná fé'n tráil
     Anocht a théam sa bhearna bhaoil,
     Le gean ar Ghaeil chun báis nó saoil
     Le guna screach fé lámhach na bpiléar
     Seo libh canaídh Amhrán na bhFiann.

Watch closely next time you see an Irish sports team during
their national anthem. Count with your fingers how many of
the players are actually singing rather than humming, swaying
from side to side and generally looking embarrassed. You
won’t need your other hand …

Terminal Services Prototype

After a couple of weeks work Caolan
and I have gotten together a prototype for a VNC based terminal services system which
also supports hotdesking. More details

here
.

This is all part of a bigger plan to use VNC for the four different “remote desktop”
uses cases I think we have in GNOME:

  • Terminals (a.k.a. thin clients) which display your desktop running on a
    terminal server
  • Remote administration – allowing sysadmins to remotely help a user having
    difficulties with their desktop
  • Remote access – you’re at home and you need to do something on your machine
    in work like save a document you’d forgotten to save or something.
  • Collaboration – a colleague in another office is working on a CAD drawing and
    he wants to demonstrate some of his ideas while talking to you on the phone
    about it

I’ll post more of the technical details of how this should all work. Right now,
though, I need to go for a few pints and get away from this stuff 🙂

2004-05-27: Thursday

  • Up early; chewed mail;
  • Amazing lack of listening on the xdg list from Michael along the lines
    of: “let me fix my problems right now with the least amount of pain to
    me. I don’t mind if its a big hack which everyone else will copy”. The
    encouraging thing from this is I suppose that in the past I would have
    taken this (IMHO fairly nonsensical/incomprehensible stalling position)
    as cast-iron proof of Michael just not listening; however, one can only
    conclude from this discussion that there is some sort of unhelpful,
    underlying ignoring the
    point
    going on … nice to have this insight.

😛

Home Again

I’m back home again from Boston. Maybe I’ll start getting some work
done again now 🙂

I’ve put up some photos from the trip
here.

Crackrock

Okay, Havoc needs his pot leaf
head re-instanted. That
film
has to be the most atrocious piece of work I’ve seen in a
long time … “So bad it was good”? Yeah, right.

Someone else has been smoking some goodness:

Corporate Whores

Looks like hadess,
mjcox,
gary
and dwmw2
have all taken a big overdose of the Red Hat drugs. So have I.

This Red Hat company meeting thing was a weird experience for
me. Realizing just how deeply rooted open source is in the Red Hat
culture. Realizing that what I’m hearing isn’t just the lip service to
open source that I heard in Sun. Seeing a real understanding of and
commitment to open source from each of the 600ish people
attending. Its like coming home or something. Man, I’m so psyched
after the whole thing.

Well, I’m pretty exhausted too 🙂