Favourite blogs for George Riches: Complaints from a middle aged layabout

Bookmarks » All entries

June 20, 2011

The one where I fail to go on any exciting expeditions

Writing about web page http://www.gooutdoors.co.uk/thermarest-prolite-small-p147594

So, in the spirit of previous product reviews, this should have been an entry that described various recent feats of derring-do, and casually slipped in a plug for the latest bit of camping equipment that I’ve been sent to review. Unfortunately, the last few weeks have been characterised by some especially foul weather. Last week’s planned camping trip to do the Torq rough ride was abandoned, in favour of an early morning drive down on sunday, followed by three-and-a-half hours of squelching round the “short” route in driving rain.
Then tonight’s Second Annual Summer-Solstice-Mountain-Bike-Bivi-Trip was abandoned when it became apparent that the chances of a scenic sunrise were pretty much zero, whereas the chance of a night in a plastic bag in the rain on a hill were looking close to 100%.

All of which means that my shiny new toy has so far not seen much action outside of the back garden. But it seems churlish not to write something about it; so here goes. It’s a sleeping mat specifically a Thermarest Pro-Lite. Mats might seem like a pretty mundane item, but if you’re trying to travel light, either running or on a bike, then they’re a tricky thing to get right. Too minimalist and you don’t get any sleep, then you feel like crap the next morning. Too heavy, and they start to make a serious contribution to your pack weight, which matters a lot if you’re having to run up a hill or ride down one.
For a long time, my preferred option was a cut-down foam karrimat, which was a reasonable compromise, but suffered from being a bit on the bulky side, and also not terribly warm. I have an old thermarest as well, which is fabulously comfy – great for winter camping, but far too bulky for fast & light summer trips.

There will be some pics here, when it stops raining for long enough… for now, here’s a stock photo…

So, the pro-lite: Point 1; I got the small one; it’s very small. (note the artful perspective on the photo!) If you want something that will reach alll the way down to your toes (or even your knees) this isn’t it; buy the large size. I don’t mind this, though; in the summertime I’m happy with something that just reaches from head-to-thigh. Equally, it’s quite slim. My shoulders are fairly scrawny, and this just-about reaches from one to the other. If you’ve been spending longer in the gym (or the cake shop) than on the track or the turbo, then you might want a bigger size.

Point 2: It is just unbelievably compact. Really. It rolls up into something about the size of a 750ml drink bottle. Foam karimats can’t come near to this. This makes more of a difference than you might think, because it means you can get away with a pack that’s 5L or so smaller (and therefore lighter), and still fit the mat inside (keeping your mat inside your pack is a winning plan, because you can keep it dry). It’s also great if you’re backpacking on a bike, because the smaller your pack, the less it affects the bike’s handling.

Point 3: It’s as light as a foam mat. Unlike my old thermarest, there’s not a lot inside this mat, so it’s super-lightweight. Mine weighed in at a smidge over 300g according to the kitchen scales.

Point 4: Back-garden tests strongly suggest that it’s a lot more comfy than my old foam mat. I’ll report back once it’s stopped raining long enough to try it out for real!

Update #1 : Still not had the chance to take this backpacking, but a car-camping trip confirms that it’s very comfortable indeed – just as good as my old thermarest, though in a big tent you have to be careful not to roll off it in the night!


June 16, 2011

Partial and Curried Functions

On with the scala show! Partially-applied functions and curried functions took me a while to get my head around, but really they’re quite simple, and partials at least are super-useful.

Partially-applied functions are just functions where you pre-bind one of the parameters. e.g.

scala> val message:(String,String,String)=>String = "Dear " + _ +", " + _ + " from " + _
message: (String, String, String) => String = <function3>

scala> message("Alice","hello","Bob")
res24: String = Dear Alice, hello from Bob

scala> val helloMessage=message(_:String,"hello",_:String)
helloMessage: (String, String) => String = <function2>

scala> helloMessage("Alice","Bob")
res25: String = Dear Alice, hello from Bob

scala> val aliceToBobMessage=message("Alice",_:String,"Bob")
aliceToBobMessage: (String) => String = <function1>

scala> aliceToBobMessage("greetings")
res27: String = Dear Alice, greetings from Bob

What’s happening here is reasonably self-explanatory. We create a function “message” which takes 3 parameters, then we create two more functions, “helloMessage” and “aliceToBobMessage” which just are just aliases to the “message” function with some of the parameters pre-filled.

Since functions are first-class objects that you can pass around just like anything else, this means you can do stuff like

scala> val times:(Int,Int)=>Int = _*_
times: (Int, Int) => Int = <function2>

scala> val times2=times(2,_:Int)
times2: (Int) => Int = <function1>

scala> (1 to 10) map times2
res38: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 4, 6, 8, 10, 12, 14, 16, 18, 20)

Currying is, at first sight, just a different (more complicated) way to achieve the same thing:

scala> val message:(String)=>(String)=>(String)=>String = (to:String)=>(message:String)=>(from:String)=>{ "Dear " + to +", " + message + " from " + from}
message: (String) => (String) => (String) => String = <function1>

scala> message("Alice")("Hello")("Bob")
res28: String = Dear Alice, Hello from Bob

scala> val aliceToBobMessage=message("Alice")(_:String)("Bob")aliceToBobMessage: (String) => String = <function1>

scala> aliceToBobMessage("greetings")res29: String = Dear Alice, greetings from Bob

What that giant line of verbiage at the start is doing, is creating a function which takes one string and returns a function that takes another string, which returns a function that takes another string, which returns a string. Phew.
This mapping from a function that takes n parameters, to a chain of n functions that each take 1 parameter, is known as “currying” (After Haskell Curry). Why on earth would you want to do this, rather than the much simpler partial application example above?
Several of the core scala API methods use curried functions – for example foldLeft in the collections classes

def foldLeft[B](z: B)(op: (B, A) => B): B = 
        foldl(0, length, z, op)

- here we’re exposing a curried function, and then proxying on to a non-curried implementation. Why do it like this?

It turns out that curried functions have an advantage (see update below) that partial ones dont. If I curry a function, and then bind some variables to form what is effectively the same as a partial function, I can also modify the type of the remaining unbound parameters. Example required!

scala> val listMunger:(String)=>(List[Any])=>String = (prefix:String)=>(contents:List[Any])=>prefix + (contents.reduce(_.toString +_.toString))
listMunger: (String) => (List[Any]) => String = <function1>

scala> val ints = List(1,2,3)
ints: List[Int] = List(1, 2, 3)

scala> listMunger("ints")(ints)
res31: String = ints123

scala> val strings = List("a","b","c")
strings: List[java.lang.String] = List(a, b, c)

scala> listMunger("strings")(strings)
res32: String = stringsabc

scala> val stringListMunger=listMunger("strings")(_:List[String])
stringListMunger: (List[String]) => String = <function1>

scala> stringListMunger(strings)
res33: String = stringsabc

scala> stringListMunger(ints)
<console>:11: error: type mismatch;
 found   : List[Int]
 required: List[String]
       stringListMunger(ints)

That last error is the important bit. We’ve specialized the parameter type for the unbound parameter in stringListMunger so it won’t accept a list of anything other than Strings. Note that you can’t arbitrarily re-assign the type; it has to be a subtype of the original (otherwise the implementation might fail).
OK; so now all I have to do is think of a real-world example where this would be useful…

Update Gah, I was wrong. You can do exactly the same type-specialization with a partial:

scala> val x:(Int,List[Any])=>Int = (_,_)=>1
x: (Int, List[Any]) => Int = <function2>

scala> val y:(List[Int])=>Int = x(1,_)
y: (List[Int]) => Int = <function1>

So now I still have no idea when you’d want to curry a function, rather than just leaving it with multiple arguments and partially applying when required. This blog entry suggests that it really exists to support languages like OCaml or Haskel that only allow one parameter per function – so maybe it’s only in scala to allow people to use that style if they like it. But then what’s it doing in the APIs ?


June 11, 2011

Further Scala: Implicit conversions

My attempts to learn scala continue…

Implicit conversions are a cool, if slightly unsettling (from a java programmers POV) scala feature. If I have an instance of one class, and I try and call a method on it which is defined in a different class, then if there’s an “implicit” method in scope which will convert between the two, scala will silently use it.
e.g.

scala> var x = 12
x: Int = 12

scala> x.substring(1,2)
<console>:9: error: value substring is not a member of Int
       x.substring(1,2)

scala> implicit def foo(i:Int):String={i.toString}
foo: (i: Int)String

scala> 12.substring(1,2)
res10: java.lang.String = 2

WITCHCRAFT! BURN THE COMPILER!

This lends itself to a very very useful trick; the ability to enhance classes with additional methods. Say you had a java Map class, and you wanted the ability to merge it with another Map according to some sort of merge function on the values. You’d probably do it like this:

class MergeableMap implements Map{

public MergeableMap(Map delegate){
 this.delegate = delegate
}

public Map merge(Map otherMap, ValueMergingFunction mergeFunction){
 ....
}

... delegate implementations of all Map methods here...
}

Trouble is, (a) writing all the delegate methods is tedious, and(b) every time you want to use it, you’ve got to do

MergeableMap m = new MergeableMap(myMapVariable)
m.merge(myOtherMap,...)

Implicits in scala make this a lot easier:

class MergeableMap[A, B](self: Map[A, B]) {
  def merge(m1, merger): Map[A, B] = {
... implementation here...
  }
}

implicit def map2mergeableMap[A,B](m:Map[A,B]):MergeableMap[A,B] = new MergeableMap(m)

myMap.merge(myOtherMap, myMergeFunction)
myMap.get(...)

there’s no need to implement the other delegate methods, since we can just call them on the original Map class – but when we call merge() compiler-based voodoo works out that we want a mergeable map, and swaps it in for us. Magical.


June 09, 2011

Long Ranges in Scala

So, following on from yesterday’s prime-factoring annoyance; a more basic requirement: How to iterate from 1 to ~10^17? (i.e. close to the limit of Long)

A Range won’t cut it…

scala> val big_long=12345678901234567L
big_long: Long = 12345678901234567

scala> (1L to big_long)
java.lang.IllegalArgumentException: 1 to 12345678901234567 by 1: seqs cannot contain more than Int.MaxValue elements.

How about a BigIntRange?

scala> (BigInt(1) to BigInt(big_long))
java.lang.IllegalArgumentException: 1 to 12345678901234567 by 1: seqs cannot contain more than Int.MaxValue elements.
    at scala.collection.immutable.NumericRange$.count(NumericRange.scala:229)
    

OK, how about a stream?

scala>  lazy val naturals: Stream[Long] = Stream.cons(1, naturals.map(_ + 1))
naturals: Stream[Long] = <lazy>
scala>  naturals.takeWhile(_<big_long).find(_ == -1L)
Exception in thread "Poller SunPKCS11-Darwin" java.lang.OutOfMemoryError: Java heap space

hmm… running out of options a bit now. Maybe if I could construct a Stream without using the map() call (since I suspect that’s what’s eating up the heap), or use for-comprehension with an efficient generator?
Or…hang on…

scala> var i=0L
i: Long = 0
scala> while (i < big_long){i = i+1L}
{...time passes...exceptions are not thrown...}

So, it turns out that “the java way” works. Which, I guess, is the benefit of a mixed language; you can always fall back to the tried-and-tested solutions if the clever bits fail. And of course, you can hide the clunkiness pretty well:

 object LongIter extends Iterator[Long]{
    var l:Long = 0
    def hasNext:Boolean={true}
    def next:Long={
      l=l+1L
      l
    }
  }
  object LongIterable extends Iterable[Long]{
    val iter = LongIter
    def iterator = {iter}
  }

//ugliness ends, now we can pretend that LongIterable was there all along...

   LongIterable.find(_ == 12345678901234567L)

I suspect that this doesn’t really conform to the iterator/iterable contract (obviously, hasNext isn’t implemented), but it does appear to work tolerably well. Well enough, in fact, that I’m surprised I’ve not yet found a more idiomatic syntax for creating an iterator whose next() function is some arbitrary function on the previous value.

...reads source of Iterator ...

  Iterator.iterate(0L)(_+1L).find(_ == 123456701234567L)

phew. Finally.


June 08, 2011

Learning Scala, a step at a time

So, I have decided to make a more serious effort to learn scala . It fits almost all of my ‘ideal language’ features; it’s object-oriented and it’s statically typed (like java), it’s reasonably terse (unlike java) and it has good support for a more functional style of programming, without forcing you to use it all the time. It also runs on the JVM, which is a good thing if you care about observability, manageability, and all the other stuff that ops people care about.

The downsides, as far as I’ve found so far, are that (a) the tooling is nothing like as good as it is for java. The Eclipse Scala plugin appears to be the best the current bunch, but even there, support for things like refactoring (which is kind of the point of a statically-typed language) is pretty sketchy. And (b) it’s a bit of an unknown quantity in production. Yes, there are some big, high-scale users (Twitter spring to mind), but they’re the kind that can afford to have the best engineers in the world. They could make anything scale. Maybe scala will scale just as well in a more “average” operational environment, but there doesn’t seem to be a huge amount of evidence one way or another at the moment, which may make it a hard sell to a more conservative operations group.

On with the show. The best resources I’ve found so far for learning the language are:

- Daniel Spiewak’s series Scala for Java Refugees . Absolutely brilliant series of articles that do exactly what they say on the tin – put scala firmly into the domain of existing java programmers. Which brings me to….

- Tony Morris’ Scala Exercises for beginners. I had a hard time with these, not so much because they were difficult, but because coming from a non-comp-sci background, I found it hard to motivate myself to complete exercises as dry as “implement add(x: Int, y: Int) without using the ’+’ operator”. I also found the slightly evangelical tone of some of the other blog entries (TL;DR:”All you java proles are dumb”) a bit annoying. But working through the exercises undoubtedly improved my understanding of Scala’s support for FP, so it was worth it. On the Intermediate exercises though, I don’t even know where to start

- Akka Akka is an actor framework for scala and java, so it’s not really a scala resource per se but, it does such a great job of explaining actor-based concurrency that it’s worth reading though and playing with, because you’ll come away with a much clearer idea of how to use either Akka or Scala’s own Actors.

- Project Euler – A series of maths-based programming challenges – find the prime factors of a number, sum the even fibonaci numbers less than a million, and so on. Being maths-ish, they’re a good match for a functional style of programming, so I find it helpful to start by just hacking together a java-ish solution, and then seeing how much smaller and more elegant I can make it. It’s a great way to explore both the syntax, and the Collections APIs, which are at the heart of most of scala’s FP support. It’s also a nice way to learn ScalaTest (the unit testing framework for scala), since my hack-and-refactor approach is reliant on having a reasonable set of tests to catch my misunderstandings.
It’s also exposed some of my concerns about the operational readiness of scala. I came up with what I thought was a fairly neat implementation of a prime-factoring function; obtain the lowest factor of a number (ipso facto prime), divide the original by that number, and repeat until you can’t factor any further:

 lazy val naturals: Stream[Long] = Stream.cons(1, naturals.map(_ + 1))

  def highestFactor(compound: Long): Long = {
   naturals.drop(1).takeWhile(_ < compound/ 2).find(
        (compound % _ == 0)).map(
            highestFactor(compound/_)).getOrElse(compound)
  }

(source)
– which works beautifully for int-sized numbers, but give it a prime towards the upper bounds of a Long and it runs out of heap space in the initial takeWhile (before it’s even had a chance to start recursively calling itself). It seems that Stream.takeWhile doesn’t permit the taken elements to be garbage-collected, which is counter-intuitive. I wouldn’t be at all surprised to find that I’m Doing It Wrong, but then again, shouldn’t the language be trying hard to stop me?


Java String.substring() heap leaks

Here’s an interesting little feature that we ran into a short while ago…

Suppose I have something like a Map which will exist for a long time (say, an in-memory cache), and a large, but short-lived String. I want to extract a small piece of text from that long string, and use it as a key in my map

Map<String,Integer> longLivedMap = ...
String veryLongString = ...
String shortString = veryLongString.subString(5,3);
longLivedMap.put(shortString,123);

Question: How much heap space have we just consumed by adding “abc”=>123 into our map? You might think that it would be just a handful of bytes – the 3-character String, the Integer, plus the overhead for the types. But you would be entirely wrong. Java Strings are backed by char arrays, and whilst the String.subString() method returns a new String, it is backed by the same char array as the originating String. So now the entire veryLongString char[] has a long-lived reference and can’t be garbage collected, even though only 3 chars of it are actually accessible. Rapid heap-exhaustion, coming right up!

The solution is pretty straightforward; if you want to hold a long-lived reference to a string, call new String(string) first. Something like

String shortString = veryLongString.subString(5,3);
longLivedMap.put(new String(shortString),123);

It would be counter-productive to do this on every substring, since most of the time the substring and the original source will go out of scope at the same time, so sharing the underlying char[] is a sensible way to reduce overhead.

Since you (hopefully) won’t have many separate places in your code where you’re storing long-lived references like this (just cache implementations of one sort or another), you can create the new strings inside the implementation of those classes instead. Now your caches are all light, and your heap is all right. Good Night.


May 30, 2011

One month on…

Writing about web page http://purposed.org.uk/

Coming away from Sheffield I found my headed circling, swimming with ideas and enriched by listening to other peoples perspectives. But, apart from extending the twitter aspect of my PLN, what next?

Action One

Keep in touch with event participants via facebook group and twitter

Action Two

Create space for discussion and debate inviting participation from wide range of people from all walks of life. I've selected one of my sporting online communities to spark a debate :o)

Action Three

Closer to home I've had some really useful discussions with my nephew, who it would be fair to say was not a fan of formal education. He is however really getting into work life and has an interesting perspective now that he sits alongside graduates on management training courses. Nephew is interested in sharing his experiences at any future #purposed events.

Action Four

Purposed posters are on the office door and book available for loan.

In summary, I like to ask why, what, how, when, where questions and think this campaign has potential ;-)


May 15, 2011

Circus 157 Prologue

Family, each of us grow up supported by a collective of people who we discover along the way may or may not be directly related to us. In my world direct blood relations exist in low numbers... but lucky for me they are all amazing :o)

Going back a generation, as a child my fabulous grandparents, Dad's parents, had a massive positive impact on my life and twenty years on from their death I still miss them :(

Mum's parent's were absent from my life and figured very little in Mum's life...

I'm not sure at which point the small child that was me figured out that the older generation on Mum's side were Grandparents rather than parents to Mum. My sister and I always knew them as Nan & Pop rather than Grandma & Grandpa, but then using different names saved confusion, didn't it?

Curiosity is something I'm not short of... so I hope I wasn't too persistent in my childish "why?" type questions because the facts were a little low on the ground. In brief Mum was born during WWII. Her father, a spitfire pilot, went missing and was presumed dead months before she was born. Some time after the war Mum's Mum remarried and emigrated leaving Mum to be brought up by her Grandparents.

This sort of sets the scene for September 2010, inspired by watching BBC history programmes with extended narratives on WWII spitfire pilots, I sat with my laptop and started to frame searches based on the few known facts available on the life of my long lost grandfather.

Name: Karel Pavlik

Nationality: Czech

Occupation: Spitfire Pilot, Czech free airforce attached somehow to RAF and based in Essex early 1942, missing presumed dead spring 1942.

Not much to go on... but the web is a powerful thing if you know how to go about searching!

At school, my history teachers knew nothing of Czech pilots in RAF, leaving me disillusioned, I dropped history at earliest possibility. Hopefully teachers in this digital age have a broader knowledge of WWIIcombatants!?

To be continued...


May 14, 2011

Moving to a new home…

Writing about web page http://www.rumsby.org.uk/blog

I got out of the blogging habit a little while ago, and despite several attempts I never quite managed to get things going again here. As a final attempt to get back into it I’ve set up a new Wordpress blog over here. Maybe having my own will be enough inspiration to keep going? There’s only one way to find out!

Anyway, the current plan is that there will be no more new content here. Please go and browse the new blog instead. A small amount of the content from here has been migrated over, when new articles reference old ones, but this blog will stay here as an archive for the foreseeable future.


April 30, 2011

Purpos/ed Summit for Instigators – 30 April 2011

Writing about web page http://purposed.org.uk/events/purposed-psi-1/

Debate: What is the purpose of education?Love an event that kicks off with Monty Python, provides free cake and has sufficient draw to pull 50 delegates indoors on a sunny Saturday afternoon! :o)

What is Purpos/ed?

Purpos/ed is a non-partisan platform for discussion and debate about the purpose(s) of education.

Purpos/ed kick started a debate in February 2011 that started with campaigns including encouraging people to contribute 500 words(February/March 2011) on their own blogs and these make excellent reading. People were then further encouraged to use quotes from the 500 word contributions 3×5 Flickr quotation mashups(April 2011).

The event of 30 April 2011 brought together people from across the country to discuss, debate and present their views on the purpose of education and ideas for moving the debate forwards and outwards. There was a strong feeling amongst some that this had to be beyond the boundaries of formal education.


Purpos/ed Summit for Instigators - 30 April 2011

So what next?

Well that is really over to all you people out there. This debate is open to all and has a serious need to hear more voices from all backgrounds.

What do YOU think the purpose of education is?


April 25, 2011

BMW R100GS Paris–Dakar refurbishment and redesign – latest progress

Some recent updates by top expert Andrew Sexton. Including:

  • Oil sump extension;
  • New oil cooler;
  • Oil cooler relocation;
  • Oil cooler thermostat.

The parts were bought from http://www.boxxerparts.de

Andrew has also professionally rewired the electrics, making a neat job out of the Acewell speedo and a replacement rear led light. It all now seems to work perfectly. Finally, he found that it had been suffering from low oil pressure, due to a missing o-ring in the oil filter assembly (a common mistake made by a non-specialist technician). The big-end bearings had signs of damage, so were replaced. Andrew also re-seated the exhaust valves. Less smoke and more MPG have resulted.

I've added an MRA Vario screen from Motorworks, adjustable to give perfectly non-turbulent air flow. There's also a Garmin Zumo sat nav to go with the Midland BT 02 bluetooth intercom.

I've ditched the metal panniers (Ted Simon's advice). They've been replaced by a pair of Ortlieb waterproof panniers (a single pannier can carry all of my camping gear), a Hein Gericke tail bad, and a small cool bag.

Some photos:

Bike 1

Bike 2

Bike 3


April 12, 2011

Alexander playing cosmic basketball

Lawrence thought it would be amusing, so he made this image....

Basketball


April 09, 2011

Time to do some Spring cleaning

Haven't been on the old Warwick blog for a while and looks like spammers have been having a field day! Time to do some Spring cleaning.


April 07, 2011

31 Films In 31 Days

So I decided to watch 31 films in March. Deciding to this on the 5th meant I had to cram them in at various points, so I would advise if you do do this to either start on the 1st of the month, or pick a shorter month like February, June or Glovember. Oh, and don’t watch five Almodovar films in two days, it really messes with your perception of reality.

The films:

The Philadelphia Story (1940)
Dr Strangelove (1964)
Dark Star (1974)
Warriors (1979)
Pepe Luci Bom (1980)
Dark Habits (1983)
Blood Simple (1984)
Tie Me Up Tie Me Down (1990)
Desperado (1995)
Live Flesh (1997)
Taxi (1998)
Bend It Like Beckham (2002)
Hero (2002)
Sky Blue (2003)
Lost In Translation (2003)
Appleseed (2004)
Saving Face (2004)
Metal: A Headbanger’s Journey (2005)
Helvetica (2007)
Elite Squad (2007)
The Duchess (2008)
Gomarrah (2008)
Wall E (2008)
Sunshine Cleaning (2008)
A Prophet (2009)
Sherlock Holmes (2009)
Inglorious Basterds (2009)
Up (2009)
The Infidel (2010)
RED (2010)
Submarine (2011)

31 films, 31 days, ten conclusions.

1. European crime films are much harder hitting than American ones, but American ones have more guns.
2. Pixar make amazingly beautiful films with excellent plots.
3. Amazingly beautiful Japanese/Korean animations usually have a pile of fluffy sci fi bollocks where the plot should be.
4. Katharine Hepburn is amazing.
5. Helen Mirren + machine gun = good times.
6. Eleven of the films were subtitled, three were partially subtitled, Dark Star was so mumbly it should have had subtitles, and Wall E showed dialogue wasn’t entirely necessary anyway.
7. Documentaries about typefaces can be fun.
8. Keira Knightley isn’t that irritating when she’s allowed to be sassy.
9. Three of the films featured directors acting, although I would never voluntarily watch a film directed by Eli Roth.
10. Submarine has the best mullet ever in it.


March 27, 2011

Alexander Prospero O'Toole

Alexander

Magical baby.


March 16, 2011

Bone Marrow IV – The Five Year Gap

Sign up to donate marrow here – www.anthonynolan.org/

Later in 2006

The razor sharp amongst you might have noticed that much of this story so far took place in 2006. Signing up, getting told I was a partial match, and giving test samples of blood all took place over a relatively short period five years ago. And then… nothing.

I didn’t donate marrow in 2006.

After the samples were sent off I waited and waited, albeit in a very passive sort of way. As so often in the process I simply shoved it to the back of my mind, although it crept forward occasionally. Each step forward was harder to shake, harder to ignore. Signing up to a register is ultimately a very impersonal act, but getting tested to see if you’re a match to another person, there’s nothing abstract about that. Somewhere out there is a person who is sick, and though I don’t know them, I’m not so totally incapable of empathy that I can’t appreciate that theirs is a desperate state to be in.

No one I am close to has, to my knowledge, had leukaemia. People have had other cancers. It’s shit, shit and unfair, and strikes people who don’t deserve it, don’t need the pain and the danger. But I don’t need to tell you that. You know. It makes people very very ill, and both the treatment and the disease itself are harsh and painful.

And so it was that when I got the letter, I assumed the worst.

I was never officially told I was the match. There was no phone call or piece of paper saying “Congratulations, your jelly is just the flavour our party requires”. Or perhaps there was and I managed to miss it. The tendency of students to move around constantly, have a new address every few months means post is often lost or left on the floor of a house you used to live in, whilst the incumbents walk past it daily, each time promising they’ll sort it out tomorrow. I don’t know. I do know I got the follow up letter.

The follow up letter was addressed to a match. It was addressed to me and presumed I knew I was the match, that I knew I was the one with the marrow that offered the most. But it wasn’t telling me to get ready or to start preparing to produce stem cells or any of that. It was a relatively short letter which seemed to speak of a tragedy I was only peripherally aware of. It informed me that the transplant recipient was too ill to have the transplant.

Everyone I have ever told this story to reacts in the same way at this point. There’s something in those words which strikes a chord with people. The great unspoken between the lines. If you are ill enough to require a life-saving transplant, then you are really ill. If you are too ill to have a life-saving transplant, then things must be even worse than that. Without the bone marrow, went my thought process, this person will die, but they cannot have the bone marrow. Not unreasonably I assumed they had died.

Three people a day die in the UK because they need a transplant and the organs (not just bone marrow) aren’t available. It’s a statistic used in drives for organ donation because it says nothing of the personal tragedies behind the stat, but it doesn’t need to. It’s a lot of people, and some of them may well have lived long lives if they’d had a chance.

It didn’t feel good to have that letter. Neither myself nor the people at Anthony Nolan had done anything wrong, hell, no one had done anything wrong. The enemy was that blasted disease, and it seemed it had outpaced us all.

March 2011

I sometimes tell the story of the bone marrow donation which wasn’t. Ok, I tell a lot of stories, I talk a lot. But that one is one I tell because I kind of hope it might have a positive impact. It’s not particularly funny and it had a sad ending. It won’t get people into a partying mood, or raise spirits, or make good dinner conversation. But it sometimes felt right to tell it because they need those men and those non-whites to sign up. If my experience was anything to go by they need white girls too.

I told the story again in the middle of February 2011. Just another recital. Nothing too serious. Then on the evening of 28th February my phone decided to play silly buggers and refused to receive any calls. I didn’t know this until I got home from work to find it hadn’t rung and someone who had then left a message. The message started somewhat unexpectedly, “Hello, this is a message for Holly Cruise, this is [name] from the Anthony Nolan register, the bone marrow register, can you please give me a call on [number] tomorrow, thank you”.

Twice? The white girl no one wanted was needed again? For another person? Was I a really good match cos Celtic women were particularly prone to leukaemia or was it coincidence?

Naturally the next day couldn’t come soon enough, I needed to know what was going on. So I rang back and spoke to the lady from Anthony Nolan. I was needed. I was a match in 2006 (which I’d worked out) and I was needed because the patient was sick again and needed the transplant this time.

Wait. The patient was sick again. The girl (I think I heard them referred to as “she” during the conversation) had been too ill for a transplant five years earlier, but was now in need? Had she been that critically ill for five years, too sick for a transplant the whole time? Had she recovered suddenly to the point of not needing the marrow but had now slid back into a bad state? I wouldn’t wish either on anyone, although I hoped it was the latter. Five years of being critically ill is a nightmare no one deserves.

It wasn’t even a question really when the lady asked if I was still willing to go through with it. Of course I was! I thought this girl was dead. I didn’t even know her and I was delighted she wasn’t. I would definitely help out. Definitely give what I could, which in this case was more than just platitudes and wishes, it was actual, useful jelly. Was I willing to help? Yes/ Was my health still good? Yes. Was I aware of what it would involve? Yes (stabbity stabbity).

The lady said it was up to the surgeon now to set the dates. I would receive more information in time. She emailed me the information leaflet. I read it, then panicked that I’d made a mistake and that the liver ‘condition’ I was diagnosed with in 2008 might be a problem. Yeah, I’m a teetotalitarian with a liver condition. Said condition is Gilbert’s which has virtually no symptoms and rarely impacts on the lives of those who have it, but I was worried it might impact here. I needn’t have worried, it wasn’t a problem.

So now I’m just waiting for dates. I keep thinking maybe I should tell them when I’m on holiday, or that if illness on my part will cause problems that we need to avoid September/October, the months which take quite a toll on those who work at universities, as the students come from all over the world bringing as many versions of the cold/flu as they can muster. I even decided to write about it, here, because I thought it might be interesting.

I don’t know if I will get as far as donating this time. I hope so if only because I don’t want this mystery person to die. It could be months before anything happens, I’m sorry I have no more narrative than this to give you at this time. But if anything more comes up I will write about it. There might even be pictures this time, or at least pictures of the actual process rather than the slightly random ones I’ve used so far. I might use the word “stabbity” a bit more as it has proven strangely popular. Or I might not. It might go no further once more. But in any case, I want at least one of you reading this to sign up to the register. Please.

It’s the least we could all do.


March 10, 2011

QCon day 1

A lot of good stuff today, but I’m just going to jot down a couple of my favourite points:

Craig Larman talked about massive-scale Scrum-based projects. I don’t suppose I’m going
to be running (or even part of) at 1500-person dev team very much, but some of his points
are applicable at any scale:
  • The only job title on the team is “Team Member”. There might be people with specialist skills,
    but no-one can say “it’s not my job to fix that”
  • If you don’t align your dev. teams’ organisation with your customers, then Conway’s law means your
    architecture will not align with your customers either, and you won’t be able to react when their needs
    change
  • Don’t have management-led tranfoormation projects. How will you know when they’re done? Instead,
    management’s role is just to remove impediments that the dev team runs up against – the “servant-leader”
    model
Dan North spoke about how he moved from what he thought was a pretty cutting edge, agile environment
Thoughtworks, consulting to large organisations starting to become leaner/more agile) to a really agile
environment (DRW, releasing trading software 10s of times per day), and how if you have a team that
is technically strong, empowered, and embedded in the domain (i.e. really close to the users), you can do
away with many of the traditional rules of Agile. A couple that really struck me were:
  • Assume your code has a half-life. Don’t be afraid to just rewrite it, or bin it The stuff that stays in
    can get better over time, but it doesn’t have to be perfect from day 1
  • Don’t get emotionally attached to the software you create. Get attached to the capabilities you enable
    for your users
  • Remeber, anything is better than nothing.
Juergen Hoeller talked about what’s new in Spring 3.1. No amazing surprises here, but some nice stuff:
  • Environment-specific beans – avoid having to munge together different config files for system-test vs.
    pre-production vs. live, have a single context with everything defined in it (Even nicer, arguably, when you
    do it via Java Config and the @environment annotation)
  • c: namespace for constructor args. Tasty syntactic sugar for your XML, and the hackery they had to go through
    to get it to work is impressive (and explains why it wasn’t there from the start)
  • @cacheable annotation, with bindings for EHCache and GemFire (not for memcached yet, which is a bit of a surprise)
Liz Keogh talked about perverse incentives. Any time you have a gap between the perceived value that a metric
measures, and the actual value that you want to create, you make an environment where arbitrage can occur. People can’t
help but take advantage of the gap, even when they know at some level that they’re doing the “wrong thing”.
  • Focus on the best-performing parts of the organisation as well as the worst-performing. Don’t just say “This
    project failed; what went wrong”; make sure you also say “This project succeeded better than all the others; what went right?”
  • Don’t try and create solutions to organisation problems, or you’ll inevitably make perverse incentives. Instead, make
    make Systems (Systems-thinking, not computer programs) that allow those solutions to arise.
Chris Read and Dan North talked about Agile operations. Surprisingly for me, there wasn’t a great deal of novel stuff
here, but there were a couple of interesting points:
  • Apply an XP-ish approach to your organisational/process issues: Pick the single biggest drag on you delivering value and
    do the simplest thing to fix it. Then iterate.
  • Fast, reliable deploys are a big force multiplier for development. If you can deploy really fast, with low risk,
    then you’ll do it more often, get feedback faster, allow more experimentation, and generally waste less. The stuff that Dan
    and Chris work on (trading data) gets deployed straight from dev workstations to production in seconds; automated testing
    happens post-deploy

Yoav Landman talked about Module repositories. Alas, this was not the session I had hoped for; I was hoping for some
takeaways that we could apply to make our own build processes better, but this was really just a big plug for Artifactory,
which looks quite nice but really seems to solve a bunch of problems that I don’t run into on a daily basis. I’ve never needed
to care about providing fine-grained LDAP authorisation to our binary repo, nor to track exactly which version of hibernate was
used to build my app 2 years ago. The one problem I do have in this space (find every app which uses httpclient v3.0,
upgrade, and test it) is made somewhat easier by a tool like Artifactory, but that problem very rarely crops up, so it
doesn’t seem worth the effort of installing a repo manager to solve it. Also it doesn’t integrate with any SCM except Subversion,
which makes it pretty useless for us.


March 09, 2011

Bone Marrow III – The Big Needle

Need I include the disclaimer that I don’t normally write about my real life? Well, I don’t, but I don’t normally let people take my internal organs out for use elsewhere…

Sign up to the registerhttp://www.anthonynolan.org/

2006, summer and 2011, March

People are fascinated by the Big Needle. The Big Needle is a symbol. The Big Needle is a celebrity. The Big Needle is only part of the bone marrow donation process anyone seems to know about. Both in 2006 and now in 2011 it’s what I hear most often from people when I tell them what I am doing.

“Doesn’t that involve a Big Needle?”
“I hear it hurts when they use the Big Needle.”
“Wow, I wouldn’t do that, not with that Big Needle.”


Stabbity.

The Big Needle appears to be the iconic element of the process, a sharp, stabby certainty, headed straight for the hip bone of those willing to give. I knew about the Big Needle when I signed up for the process, but like all the unpleasant elements of donation I blithely ignored it because I really didn’t think I would ever be called upon to donate and thus worrying about the specifics wasn’t worth it. I do a similar thing with my legs – I have one leg longer than the other and my hips are out of alignment. A doctor once told me there was a good chance I might need a hip replacement at a relatively young age (40s?!) but they weren’t sure. They could be right, but there’s no point fretting about it if it’s not certain. And merely being on the bone marrow list wasn’t a guarantee that Big Needle would be part of my life so I ignored it.

And when I couldn’t ignore it anymore, I discovered that as with so many icons, the Big Needle had lost relevance in recent years.

Ever had tuberculous cervical lymphadenitis? Probably not, it’s more commonly known as scrofula, and is the sort of disease which modern historians get to read about and modern doctors don’t get to treat very often. When it does pop up it gets beaten down with antibiotics. In the old days the cure was more elaborate, the monarch of the day was required to touch the sufferers. Scientific advances ensure that we don’t need Elizabeth II to high five the contagious, and funnily enough scientific advances have resulted in the Big Needle losing some influence in the world of bone marrow extraction.


“I cannot believe I have to touch you scrubbers. Helen Mirren wouldn’t stand for this shit.”

I found this out courtesy of the booklet Anthony Nolan sent me. It was full of happy smiling pictures of donors and recipients. How can anyone refuse a process where the outcome is glossy smiling photos, complete with inspirational captions? Ok, I’m being flippant, but these booklets will have been market tested and designed to perfection, they are precision tooled to make the donor feel less apprehensive about the process, to banish Big Needle.

There are two ways of donating.

I didn’t know this. The other way was even presented as the preferred method. Above Big Needle. The fearsome beast wasn’t even first choice, it was sat on the medical substitute’s bench, kicking its heels and periodically running up and down the side of the hospital, waiting to be called on. A plan B.

Plan A was much more futuristic. The donor would be injected with human growth hormone to make their marrow overproduce stem cells. The spongy mass of the marrow is less important than the tiny parts of marrow yet to come. After a few days the recipient would travel to a hospital where they would be hooked up to a machine, one tiny needle in each arm, with blood drawn out via one tube, filtered through a machine to remove the stem cells, before being put back into the donor’s body via the second tube in the other arm. I may or may not have made this up, but I came away convinced the process involved a centrifuge, with the prospect that my blood would be spun around, with stem cells flying out of it into the collection point, before being returned. The idea that my vital fluids might enjoy a ride as part of the process sounded fun.

The Big Needle was for when this didn’t work. No problem, I thought, if it happens I’ll just produce lots of stem cells. I’ll sit at home, producing really hard. In 2006 I figured I could study in the library, but produce stem cells at the same time. Essays and stem cells. Not a problem, and you don’t even have to footnote the stem cells. Now, in 2011, I’ll produce them while I work, or while I stand outside as the fire alarms go off, a strangely frequent event at work right now.

And hey, even if the Big Needle was needed, there was general anaesthetic for that.

stabbyneedle
Actually, the Big Needle is pretty big when you put it like that…

Knowing the procedures made them less scary. Is this what my ancestors felt the first time they found a dead boa constrictor and thought “Wow, I know it’s eaten half the tribe, but look, it’s just a tube with a silly face, that’s not scary”. Mind you, my ancestors ended up in Ireland, one of only two countries worldwide with no native snake species, so perhaps that’s a bad example.

Whatever, even if it did involve the Big Needle the equation was simple: stabby needle-induced hip pain for a week is less painful than dying of leukaemia. There is no other way to look at this. If I was a match I would do it, no matter what the short term pain. The person who needed marrow needed it more than I needed a pain free week.

But I would probably whine about the pain anyway. I’m not a saint.

And in the ebbing days of summer 2006, the last really good summer I remember us having in Britain, I waited to see if that one-in-four chance was going to come in. Was I the match? Would I meet the Big Needle or have to sit in the library producing stem cells?


March 08, 2011

"Designing Software, Drawing Pictures

Not a huge amount of new stuff in this session, but a couple of useful things:

The goal of architecture: in particular up-front architecture, is first and foremost to communicate the vision for the system, and secondly to reduce the risk of poor design decisions having expensive consequences.

The Context->Container->Component diagram hierarchy:

The Context diagram shows a system, and the other systems with which it interacts (i.e. the context in which the system operates). It makes no attempt to detail the internal structure of any of the systems, and does not specify any particular technologies. It may contain high-level information about the interfaces or contracts between systems, if
appropriate.

The Container diagram introduces a new abstraction, the Container, which is a logical unit that might correspond to an application server, (J)VM, databases, or other well-isolated element of a system. The container diagram shows the containers within the system, as well as those immediately outside it (from the context diagram), and details the
communication paths, data flows, and dependencies between them.

The Component diagram looks within each container at the individual components, and outlines the responsibilties of each. At the component
level, techniques such as state/activity diagrams start to become useful
in exploring the dynamic behaviour of the system.

(There’s a fourth level of decomposition, the class diagram, at which we start to look at the high-level classes that make up a component, but I’m not sure I really regard this as an architectural concern)

The rule-of-thumb for what is and what isn’t architecture:

All architecture is design, but design is only architecture if it’s costly to change, poorly understood, or high risk. Of course, this means that “the architecture” is a moving target; if we can reduce the cost of change, develop a better understanding, and reduce the risk of an element then it can cease to be architecture any more and simply become part of the design.


March 07, 2011

Five things to take away from Nat Pryce and Steve Freeman's "TDD at the system scale" talk

  • When you run your system tests, build as much as possible of the environment from scratch.
    At the very least, build and deploy the app, and clear out the database before each run
  • For testing assemblies that include an asynchronous component, you want to wrap
    your assertions in a function that will repeatedly “probe” for the state you want
    until either it finds it, or it times out. Something like this
       doSomethingAsync();
       probe(interval,timeout,aMatcher,anotherMatcher...);    

    Wrap the probe() function into a separate class that has access to the objects you
    want to probe to simplify things.

  • Don’t use the logging APIs directly for anything except low-level debug() messages, and maybe
    not even then. Instead, have a “Monitoring” topic, and push structured messages/objects onto
    that queue. Then you can separate out production of the messages from routing, handling, and
    persisting them. You can also have your system tests hook into these messages to detect hard-to-observe state changes
  • For system tests, build a “System Driver” that can act as a facade to the real system, giving
    test classes easy access to a properly-initialised test environment – managing the creation and
    cleanup of test data, access to monitoring queues, wrappers for probes, etc.
  • We really need to start using a proper queueing provider

Bone Marrow II – Twelve Small Pots

Once again I must protest that I’m not keen on blogging about my actual life but after the first of these posts it turned out a friend had made it to this stage too, so maybe it’s more common than I first thought. I dunno, it’s never been the topic of any polite dinner party conversation I’ve been part of to talk about marrow donation, although I’ve been to about two polite dinner parties in my life (once by mistake) so it could be common.

Do not lose sight of the importance of this linkhttp://www.anthonynolan.org/

2006, a few weeks later

I’m scared of donating blood. Yes, I know this is about the other donation, the one with the HUGE needles, and I know donating blood involves small needles. I have no issue with needles. I wasn’t the kid in my secondary school who reacted to their BCG jab by turning green and passing out. I used to watch the injections as they went into my arm, fascinated by the vanishing liquid. No, it’s not the mechanics of blood donation which bother me.

No one knows what causes migraines for sure. Like all migraine sufferers I know roughly what triggers them, but how extreme stress or not-so-extreme food deprivation translate into blindness, splitting headaches and projectile vomiting is a mystery. All a doctor has ever been able to say to me is that it might be related to chemical levels in the blood.

So far, despite my massive clumsiness I’ve never lost a significant amount of blood in any incident. Even the time I sliced my thumb in half (yes, I am an idiot, I know this) it wasn’t a bloody as it could have been. Well, it didn’t cause my blood-phobic housemate to pass out, so it can’t have been too bad. It wasn’t Ichi The Killer levels. The upshot of this rambling is to say that I’ve never donated blood because I’m worried it might set off migraines. It’s irrational, it probably won’t, but I don’t know. Perhaps once I’ve given marrow I should make it a target to give blood within six months to prove it. Who knows.

Thumb and Blade
The aftermath of my thumb slicing incident. Blood all cleaned (except the stuff we couldn’t clean so we put furniture over it so the landlord wouldn’t notice.

But my other worry is I don’t have enough blood. And this is where I find myself back in the summer of 2006.

When people need bone marrow donations their family is screened first. It makes sense, you’re more likely to find a match with close relatives than random strangers* like us names bobbling around on the Anthony Nolan register. But sometimes it doesn’t work out and then it’s pot luck. To the register. To sign up we gave small pots of blood, not enough to run more than a couple of tests. So when a person in need of a transplant comes to the register they tend to test a few partially matching people more closely to find the best match.

It had been only a few months since I had left the students’ union after signing up. I’d already put it to the back of my mind and can you blame me? I was a white female. They didn’t need white females, they’d said so. Had there been any men or any non-white people I would have been sent away. I’d have gone home to Leamington and wondered why I still had no feeling in my thumb (the sliced in half one, the feeling still isn’t more than 40% today, five years later). I’d have watched TV, done my essay, eaten. I wouldn’t have been one of the four people on the register that were a rough match to an ill person somewhere in Britain.

I laughed when I found out I was a partial match. “They said I wasn’t needed!” I told blood-phobic housemate, “And here I am, a partial match”. It was a one in four chance I might be the best match, which are good odds if you’re betting on horses and bad odds if you’re betting on football (yeah, I worked in a bookies for a while).


Like these but twelve of them.

To find the best match involves tests. Tests require blood. I was sent a box of twelve small pots, like the first small pot from signing up day. Only this time there was twelve of them. I took my box of goodies to the doctor’s clinic to be filled and the nurse laid them out. They had different coloured tops. They looked like pieces from a strange boardgame which only served to make it even more surreal as the nurse put a needle in my arm and filled them one by one until all were fu… no, wait. The last three or so weren’t full. We couldn’t fill them. She prodded my arm once or twice but for the last three (look away squeamish folk) my blood merely dripped in, rather than leaping forward with enthusiastic abandon as it had done initially. The nurse smiled and assured me it was normal, and maybe it was. Maybe twelve pots is a lot to ask. But my irrational side was in its element, “Look! You can’t possibly donate blood, you don’t have enough for yourself! How could someone as pale as you possibly have enough blood”. I am very pale it’s true. Even other Irish people think I’m pale. I tried to ignore the irrational voice, especially as the nice, rational nurse said it was quite normal not to fill all twelve pots.

My blood was posted to London to be prodded and probed. I didn’t have a migraine. I didn’t feel any change at all, which at least reassured me that no one was performing any voodoo on my platelets which was nice of them. So I went back to work. It was summer and time to work my arse off because that’s the lot of many students these days. Work work work whilst they bleed you dry. At least I’d been bled (slightly) dry for a slightly better cause.

And now it was time to wait and see who was the best match…

*Reading about family matches and donations I found the fascinating case of Karen Keegan, an American who needed a kidney transplant. When her children were tested to see if they were matches the results said they weren’t even her children. It turned out she’s a chimera, one person with two sets of DNA made when two fraternal twins fuse in the womb to grow as one person. Her womb and her blood were produced from different embryos but lived in one body. Biology is interesting.


March 04, 2011

Ideas For New Bank Holidays

Writing about web page http://www.bbc.co.uk/news/uk-12640636

The government wants to move the May Day bank to either St George’s day a week or so before, or to ‘Trafalgar Day’ in October. Now there are some who might suggest that targeting the May Day holiday, a strongly socialist and pagan linked date, rather than the other May bank holiday is a bit ideological. Perhaps it isn’t. but it ignores one simple and undisputable fact – we don’t get enough days off compared to the rest of Western Europe.

The TUC have complained about this for years, saying in 2001 that with a European average of 10.8, Britain still only had 8, a number which would have been part of the European average, thus dragging it down.

So why not let us have another bank holiday without ditching an existing one? Some suggestions:

Pankhurst Day, 14th or 15th July

“Votes for my homegirls or else!”

Emmeline Pankhurst’s birthday. Why not pick a suffragette? Was her struggle, and those of the 50% of the population she fought alongside and for, any less significant than that of Nelson at Trafalgar? The uncertainty of her birth date means we can choose, shall we synchronise with France or strike out on our own? Plus mid-July is a good bet for some half decent weather.

Armada Day, 18th August

“Michel Pez said the weather would be lovely, what an idiot!”

Why Trafalgar Day? Why not another battle? Most WWI and WWII events were over longer periods of time, or are rather more international in flavour, so why not pick a military event which really sums Britain up – the Spanish Armada whose defeat was a combination of British blood mindedness and the weather. Mostly the weather. 18th August is the New Calendar date of Elizabeth I’s “heart and stomach of a king” speech, which is one of the best in British history. The downside is it would be quite close to the existing August holiday.

Reform Act Day, 7th June

George Cruickshank’s depiction of the Peterloo Massacre, a significant event in the history of democracy in Britain (and a possible contender for a bank holiday in its own right).

We don’t really do revolution in Britain, do we? The one time we did, overthrowing Charles I and the ructions that lead to Cromwell taking over, it was reversed within a few decades. Britain has long been the country of incremental changes, so why not celebrate one of the most major incremental changes? The Reform Act 1832 wasn’t perfect, it left a lot of people still disenfranchised (women and poor people mostly), but it was a significant step away from the still borderline feudal world we lived in, towards a slightly more democratic future. We could celebrate the day by going to Old Sarum and pelting effigies of crooked politicians with eggs.

First Association Football International Day, 30th November

Scotland’s 1872 team, great moustaches.

If we want major events that happened in the last three months of the year, currently underserved by bank holidays, forget Guy Fawkes Day (might upset Catholics), Halloween (might upset non-pagans/people who hate costumes and having their houses egged), or my birthday (apparently I am not significant enough, humph). What we need is something which celebrates Britain’s biggest cultural contribution to the world. Which celebrates British innovation and ability to apply rules to anything, even something which essentially used to be an excuse for a fight. Which celebrates the way England and Scotland just love to get one over on each other. The first ever official football international match, a 0-0 draw between England and Scotland. Considering the game involved men with amazing names like Cuthbert Ottaway and Reginald de Courtenay Welch, it seems rude not to celebrate it. (Wales and Northern Ireland can have a day off on the day of the first Wales vs Northern Ireland match).

Any other similarly genius/insane suggestions?


March 03, 2011

Bone Marrow I – Signing That Register

I don’t normally blog about my personal life for the simple reason that my personal life is really rather dull. But at the moment it isn’t. It’s not extraordinary, but it’s not dull, and I think it needs to be told because what I’m currently doing could and should be done by others. Maybe even you.

This is the (sort of) diary of a (potential) bone marrow donor.

These are the people you need: http://www.anthonynolan.org/

2006, one afternoon

Campus universities are a great source of bodily fluids it would seem. No, get your mind out of the gutter; I am referring to substances like blood and marrow. At one stage during my time at the University of Warwick it was a weekly occurrence to see the blood donation lorry parked in the grounds waiting for passing students to drop in. A worthy cause, it almost seemed a shame that they would come on Tuesdays as many of the sports teams played on Wednesdays and I knew of more than one sporty student who wanted to donate but didn’t want to do so on a Tuesday – “I can’t be weak for the match!”. You would sometimes also see members of Warwick Pride protesting at the ban on blood donations by men who have had sex with men, often accompanied by a groups of lesbians who would go and give their blood, whilst commenting loudly that their male friends couldn’t. It was a good way to protest.


From www.warwick.ac.uk

It wasn’t just the blood people who came to visit. Anthony Nolan would come too.

Anthony Nolan is a charity that supports research into leukaemia, and which runs a register for bone marrow donors. As with all such charities it relies on volunteers to join its register and be matched up with sufferers of leukaemia and other blood disease who are in need of a transplant. Interestingly, in light of what I observed about the blood donation truck at Warwick, Anthony Nolan allow gay men to join the register and donate with the same restrictions as heterosexuals. As one Anthony Nolan representative said “If they are practising safe sex with a trusted partner then we are more than happy to accept them.”

And so it was one afternoon that Anthony Nolan nurses took over a couple of rooms in the students’ union at Warwick.

Students make a great target market for such drives. One could flatter the altruistic nature of students by saying their increased social awareness and tendency towards idealism makes it likely that they’d sign up for this sort of thing, to positively intervene in the lives of others. One could also point out that they have a lot of free time and a tendency to be distracted by anything which looks vaguely interesting and unusual, like a queue with some nurses at the end of it. For me, it was a combination of the two.

su
Warwick Students’ Union, image from Wikipedia

There was a queue of people in the students’ union building. I was on a free afternoon (in the sense that I probably should have been in the library somewhere, reading something important and relevant and historical) and with mates. A queue leading to a room which wasn’t usually occupied was an invitation to go and join it. Is there any act more British than joining a queue just because it’s there? Who knows, I’m only half British so maybe I should have only half joined it.

It turned out to be a queue to sign up for the Anthony Nolan bone marrow register. At this point we could have wandered off again, in search of queues with less bloodletting at the end of them. But we didn’t. Call it that student conscience or whatever, but we decided a bit of queuing, form filling and blood sample giving was a good use of our time.

By this stage it was late in the afternoon, and the nurses were anxious that they would have to leave soon. One stuck her head out of the door to the room and announced to the queue that they were finishing soon, and that they would be prioritising certain groups of people.

Men and ethnic minorities.

She explained briefly that there weren’t enough of either on the register, and that they were wanted for this reason. From their website I later discovered the following:

It is a priority for us to recruit more male donors because men can generally provide greater volumes of blood stem cells than female donors. This helps faster engraftment and the reconstitution of the immune system post-transplant. If there is a choice of donor for a patient in most cases a male donor will be preferred.

Ethnic origin is important when matching donors and patients. The ‘markers’ that are tested when searching for a suitable stem cell donor are genetically inherited and often unique to a particular race. A patient in need of a transplant is more likely to discover a suitable donor amongst groups of people who share a similar genetic history to them. In practice this means that an African-Caribbean patient, for example, has the greatest opportunity of finding a donor within his or her own ethnic community. There are still too many patients in the UK from black and ethnic minority communities for whom we are unable to find a compatible donor.

The nurse looked up and down the queue. A queue made up entirely of white females. Resigned to the fact she couldn’t get any more of the rarer groups that day she indicated for the next girl to come into the room. Jokingly I turned to my mate and wondered if being Celtic (as in I have three Irish grandparents, not that I am a football team) was enough of an ethnic minority to make a difference. Probably not we concluded. There’s so many British people with an Irish grandparent that it must be pretty common. How else do you explain the 1994 Irish World Cup squad?


Ray Houghton scores for Ireland against Italy at 1994 World Cup. He was born in Scotland. Watch the glorious video here.

The rest of the process was speedy. In we trooped, one by one, to give a small sample of blood and fill in some forms to say we weren’t injecting heroin into our eyes and having unsafe sex with as many hookers as we could (even though the University of Warwick is located in Coventry, it’s hardly close to any particularly mean streets). And we left. It didn’t feel particularly significant. The whisperings about how they get marrow (“a HUGE needle”) didn’t really seem that pressing. The lady had said they weren’t really looking for white females and we were all white females. They wouldn’t need us, surely?

Surely?


February 28, 2011

February and something is…

Writing about web page http://purposed.org.uk/2011/02/lets-get-this-party-started/

...well it seems a debate is about to kick off!

What’s the purpose of education?

Wordle: Purpos/ed

Introductory blog post from Prof. Keri Facer of Manchester Metropolitan University (and formerly of Futurelab)

In the hope that these ideas might be achieved, I’d like to suggest some questions that contributors to the site could explore:

  1. What is your vision for the good society? 
  2. What is the part that education can play in achieving that and what is the part that others need to play? Who are these others? What is/what should be their relationship to education? 
  3. What are the building blocks we have in our schools and universities already that could move them towards that role?
  4. What are the building blocks outside formal education? 
  5. What are the impediments to change and what causes them? And are there good reasons for these?
  6. What can I see of merit in the ideas of those who disagree with me? 
  7. Do the ideas I suggest draw on the expertise and insight of others?
  8. Do the ideas I suggest offer enough benefit to outweight the disruption that they would cause in their realisation? how would we get there?

Really looking forward to watching this space... hope to get brave and dive in for a bit of active participation... call for action!


February 24, 2011

Solaris IGB driver LSO latency.

Yes, it’s another google-bait entry, because I found it really difficult to find any useful information about this online. Hopefully it’ll help someone else find a solution faster than I did.

We migrated one of our applications from an old Sun V40z server, to a newer X4270. The migration went very smoothly, and the app (which is CPU-bound) was noticeably faster on the shiny new server. All good.

Except, that when I checked nagios, to see what the performance improvement looked like, I saw that every request to the server was taking exactly 3.4 seconds. Pingdom said the same thing, but a simple “time curl …” for the same URL came back in about 20 milliseconds. What gives?
More curiously still, if I changed the URL to one that didn’t return very much content, then the delay went away. Only a page that had more than a few KBs worth of HTML would reveal the problem

Running “strace” on the nagios check_http command line showed the client receiving all of the data, but then just hanging for a while on the last read(). The apache log showed the request completing in 0 seconds (and the log line was printed as soon as the command was executed).
A wireshark trace, though, showed a 3-second gap between packets at the end of the conversation:

23    0.028612    137.205.194.43    137.205.243.76    TCP    46690 > http [ACK] Seq=121 Ack=13033 Win=31936 Len=0 TSV=176390626 TSER=899836429
24    3.412081    137.205.243.76    137.205.194.43    TCP    [TCP segment of a reassembled PDU]
25    3.412177    137.205.194.43    137.205.243.76    TCP    46690 > http [ACK] Seq=121 Ack=14481 Win=34816 Len=0 TSV=176391472 TSER=899836768
26    3.412746    137.205.243.76    137.205.194.43    HTTP    HTTP/1.1 200 OK  (text/html)
27    3.412891    137.205.194.43    137.205.243.76    TCP    46690 > http [FIN, ACK] Seq=121 Ack=15517 Win=37696 Len=0 TSV=176391472 TSER=899836768

For comparison, here’s the equivalent packets from a “curl” request for the same URL (which didn’t suffer from any lag)

46    2.056284    137.205.194.43    137.205.243.76    TCP    49927 > http [ACK] Seq=159 Ack=15497 Win=37696 Len=0 TSV=172412227 TSER=898245102
47    2.073105    137.205.194.43    137.205.243.76    TCP    49927 > http [FIN, ACK] Seq=159 Ack=15497 Win=37696 Len=0 TSV=172412231 TSER=898245102
48    2.073361    137.205.243.76    137.205.194.43    TCP    http > 49927 [ACK] Seq=15497 Ack=160 Win=49232 Len=0 TSV=898245104 TSER=172412231
49    2.073414    137.205.243.76    137.205.194.43    TCP    http > 49927 [FIN, ACK] Seq=15497 Ack=160 Win=49232 Len=0 TSV=898245104 TSER=172412231

And now, it’s much more obvious what the problem is. Curl is counting the bytes received from the server, and when it’s got as many as the content-length header said it should expect, the client is closing the connection (packet 47, sending FIN). Nagios, meanwhile, isn’t smart enough to count bytes, so it waits for the server to send a FIN (packet 27), which is delayed by 3-and-a-bit seconds. Apache sends that FIN immediately, but for some reason it doesn’t make it to the client.

Armed with this information, a bit more googling picked up this mailing list entry from a year ago. This describes exactly the same set of symptoms. Apache sends the FIN packet, but it’s caught and buffered by the LSO driver. After a few seconds, the LSO buffer is flushed, the client gets the FIN packet, and everything closes down.
Because LSO is only used for large segments, requesting a page with only a small amount of content doesn’t trigger this behaviour, and we get the FIN immediately.

How to fix? The simplest workaround is to disable LSO:

#  ndd -set /dev/ip ip_lso_outbound 0

(n.b. I’m not sure whether that persists over reboots – it probably needs adding to a file in /kernel/drv somewhere). LSO is beneficial on network-bound servers, but ours isn’t so we’re OK there.

An alternative is to modify the application code to set the TCP PSH flag when closing the connection, but (a) I’m not about to start hacking with apache’s TCP code, (b) it’s not clear to me that this is the right solution, anyway.

A third option, specific to HTTP, is just to use an HTTP client that does it right. Neither nagios nor (it seems) pingdom appear to know how to count bytes and close the connection themselves, but curl does, and so does every browser I’ve tested. So you might just conclude that there’s no need to fix the server itself.