Sunday, 29 July 2012

Happy Birthday (3) To Me

This Little Blog is Three

Three years behind the masthead. Macro blogging is officially dead, social media in the ascendancy, and still I won't roll down the shutters and scarper. What the hell is wrong with me!


I can only think it must be love. So then, how's my blogging frequency been holding up? At the 2009 outset, declared goals were:
  • two posts per week, on average;
  • half of those technical, half not;
  • half of the technical posts to be security related.
Once again, the answer is: not bad, could do a little better. Having just escaped Facebook on the second attempt, I can look back and see how some of minor comments I've made there, for example last year's broken links to toasted cheese or mismatched shoes, might otherwise have grown into short blog posts. So the Zuckster must accept at least part of the blame for those.

Unpopularity Analytic

About 1,500 page views per month, last time I checked. Low enough to avoid most comment spammers, but just high enough to retain my interest.

As for the blog's original motivation, namely the introduction of security related software development, that's been superseded by the formation of something called a SCARB group in our (new, extended, all-inclusive and thoroughly democratic) Development Department. When the Security subcommittee (that's me and my pals, the "S" of the group moniker) enters a less dormant phase, this little blog will be one of the first to know.

Happy Birthday To Me
Happy Birthday (2) To Me
Birthday candles courtesy of Wikipedia.

Thursday, 26 July 2012

RIP Free Cellular Web Access

And A Mystery Solved Thanks To XKCD

My original Amazon Kindle, with its free global access to 3G networks and its experimental browser, was a Christmas gift from my wife, having been inspired by my apparent inability to organise my dead tree storage. This browser uses the same connection that all 3G-equipped Kindles use to download books via Amazon's Whispernet, and until recently, it offered access to as much of the world wide web as you could take. Usually, that wasn't much. The browser renders like treacle, while pages don't look terrific on the monochrome, electronic ink display.

But it was functional, and quite useful on continental holidays and other occasions when we found ourselves temporarily without WiFi access. Just as recently as, well, earlier this very month, I had cause to be grateful for Linda's decisions (-; in both cases, against my better judgement ;-) to buy me (a) a Kindle, (b) with 3G connectivity. Sitting in the garden outside our French gîte, I reached the end of my chosen holiday read (a pulpwood edition of The Hunger Games) and wanted immediately to download its sequels, whilst simultaneously checking out a few blog updates.

That was then. Today, as I read on El Reg, Amazon have started exercising their reserved, small-print right, to throttle this free 3G access at just 50MB per month. Obviously having learned from both the Sony experience and their own previous missteps, they are following this course in preference to just switching off free 3G access altogether.


There still remains a mystery in the detail. This post on the MobileRead forum reports the cutoff message, followed by another:
I got a second message saying that I'd have 24 hours of grace to continue to use 3G for Web browsing, but that after that I could use 3G only for visiting, Wikipedia, and the Kindle Store.
Certainly, retaining free access to both Amazon and the Kindle Store makes commercial sense. But why should Wikipedia be particularly exempted?

That's when I remembered the above XKCD cartoon, from 3½ years ago. Click through for the full version. Although the answer isn't in the printed cartoon itself, it's in Randall Munroe's floating text that appears when you hover over it:
I'm happy with my Kindle 2 so far, but if they cut off the free Wikipedia browsing, I plan to show up drunk on Jeff Bezos's lawn and refuse to leave.

Wednesday, 25 July 2012

Book Review: Liars & Outliers

Enabling the Trust that Society Needs to Thrive

A favourite blog was noticeably subdued of late, while the inestimable Bruce Schneier put his finishing touches to his latest tome. No sooner was he done, however, than all of my favourite blogs burst out with news, reviews, and other expositions about it. Resolved to buy a copy, maybe on Kindle, I nevertheless put in a book request to my manager, and was in due course pleasantly surprised by the hardback landing on my desk.

Surprised? Well, I was unsure whether it would qualify for purchase. It's not a technical book, although it does cover many technical issues we have to deal with in daily business. It's not about programming, or not exclusively so. What it is, is a thorough investigation into the nature of trust within society. Or in other words, into the nature of of civilisation: how it works, and why it doesn't. How indispensable and deeply reaching is trust. How, why, when and where we depend upon it. How our essential systems can be designed to guarantee it. As ever, Bruce's approach to each little corner of the subject matter is almost rigorously scientific, being relatively free from hand waving and equivocation, and as evidence-based as he can diligently achieve.

After an overview, declaring the primary aims of the book, and containing an excellent diagram of the formal terms used (societal dilemma being a central one) and their relationships, the remainder of the book consists of four main sections.

Part I: The Science of Trust

This deals with the various research fields comprising the "background" sciences of the book: experimental and evolutionary psychology, biology, neuroscience, economics, the mathematics of game theory, computer security, and so on. Chapter three will be particularly familiar territory if you've ever studied evolutionary perspectives on behaviour, such as sociobiology. This is followed by a historical view of sociology and societal scaling, then by a return to game theory for an examination of societal dilemmas and the nature of conflict.

Part II: A Model of Trust

This is the most intensely argued and analytically comprehensive section of the book, and it might take more than one reading here and there to follow the workings of the "Model" presented. Clearly this is an exposition of the central concept that inspired the whole work. Various pressures are considered both in isolation and in concert: moral and institutional stresses, considerations of reputation, and the limits imposed by security systems. Schneier's goal is to get you to hold all of these simultaneously in your conception, tracing the interconnections and interplay between them.

In chapter 9, Institutional Pressures, Schneier examines the threats facing modern society. Acknowledging that one of the biggest perceived threats is terrorism, he astutely reminds us we can never ensure perfect security against this. Arguing that America's TSA budget should be measured in the millions, not billions of dollars, he observes that talk of terrorism as an "existential threat" to society is complete rubbish. While terrorism remains sufficiently rare, which it is; and while the vast majority of people survive, which they do; society itself will continue to survive. Yet while this observation remains unarguable, politically it is impossible for our leaders to speak it.

Part III: The Real World

In the second half of the book Schneier describes real world Organisations, Corporations and Institutions, illustrating how the competing interests of these bodies lead to evolution and resolution in certain real world situations. A recurring theme is fishing, which at all levels has rules and quotas adhered to by the majority, but offering considerable profits and a low risk of getting caught to the minority of cheats.

Part IV: Conclusions

To be frank, you could say that there are very few actual conclusions in the book itself. In the chapter on Technology, Schneier proposes a set of design principles for effective societal pressures, one of the key points of the book. But more often, he provides us rather with information, with the background to understand and make sense of that information, and with the grounding in a refreshing number of academic and scientific disciplines that we can exploit to build confidence in our own conclusions, which we are encouraged to reach independently.

In so doing, you're certain find the scope of input presented here quite breathtaking.

Bruce Schneier
Liars and Outliers: Enabling the Trust That Society Needs to Thrive
John Wiley & Sons
17 Feb 2012
ISBN-10: 1118143302
ISBN-13: 978-1118143308

Thursday, 19 July 2012

Displaying File Sizes

Readability by Approximation

When it comes to displaying "rough" file sizes (1.2 KB, 34.5 MB, etc), and none of the online solutions offer exactly what you want, then you write your own struct:
public struct ByteCount
 public long Value { get; set; }

 public ByteCount(long value) : this() { Value = value; }

 public static ByteCount operator + (ByteCount x) { return x; }
 public static ByteCount operator - (ByteCount x) { return new ByteCount(-x.Value); }

 public static ByteCount operator + (ByteCount x, ByteCount y) { return x + y.Value; }
 public static ByteCount operator + (ByteCount x, long y) { return new ByteCount(x.Value + y); }
 public static ByteCount operator + (long x, ByteCount y) { return y + x; }

 public static ByteCount operator - (ByteCount x, ByteCount y) { return x + -y; }
 public static ByteCount operator - (ByteCount x, long y) { return x + -y; }
 public static ByteCount operator - (long x, ByteCount y) { return x + -y; }

 public override string ToString()
  const string units = "EPTGMK";
  var unitSize = 1L << 10 * units.Length;
  foreach (var unit in units)
   if (Value >= unitSize)
    var value = decimal.Divide(Value, unitSize);
    return string.Format(
      "{{0:{0}}} {{1}}B",
      value >= 100 ? "#" : value >= 10 ? "#.#" : "#.##"),
     value, unit);
   unitSize >>= 10;
  return string.Format("{0} Bytes", Value);
This outputs a consistent three significant figures, with the exception of cases 1000..1023 Bytes, which are output as-is. The supplied set of overloaded operators sufficed for the immediate requirements of my app, which involved only accumulating and subtracting totals, but can obviously be extended easily to include comparisons, multiplication, implicit conversions, etc. Notice the nested calls to string.Format() using escaped {{i.e., doubled-up}} braces, as previously illustrated under C# String Format Run Time Field Width.

Wednesday, 18 July 2012

Barenboim's WEDO Beethoven Cycle

Looks Like I Picked the Wrong Month to Quit Sky+

The historic week of Proms with Daniel Barenboim and his West-Eastern Divan Orchestra, led by Daniel's son Michael, is almost here.
His dynamic West–Eastern Divan Orchestra – famously bringing together Arab and Israeli players to form less 'an orchestra for peace' than 'an orchestra against ignorance' – goes far beyond the symbolic in its goal of building bridges through music. (BBC)
They'll be performing the entire cycle of nine Beethoven symphonies, starting this Friday July 20, logically enough with the First and Second, and finishing next Friday with the almighty Ninth - which incidentally hands over to the Opening Ceremony of the Olympic Games.

Why is it such a historic cycle? The last time this was done within a single Proms season, was exactly 70 years ago, by Sir Henry Wood himself. Well, not just himself... come on, you know what I mean.

At the risk of receiving a BBC cease-and-desist, I need to put this little table just here: (╯°□°)╯︵ ┻━┻

Prom #
Performance Date/Time
Broadcast Date/Time
Beethoven - Symphony No. 1 in C (25 min)
Boulez - Dérive 2 (45 min)
Beethoven - Symphony No. 2 in D (35 min)
BBC Four
Beethoven - Symphony No. 4 in Bb (35 min)
Boulez - Dialogue de l'ombre double (20 min)
Beethoven - Symphony No. 3 in Eb 'Eroica' (50 min)
Sat 21 at 8pm
BBC Four
Beethoven - Symphony No. 6 in F 'Pastoral' (40 min)
Boulez - Mémoriale ('…explosante-fixe…' Originel) (8 min)
Boulez - Messagesquisse (8 min)
Beethoven - Symphony No. 5 in Cm (30 min)
Thu 26 at 7.30pm
BBC Four
Beethoven - Symphony No. 8 in F (25 min)
Boulez - Anthèmes 2 (25 min)
Beethoven - Symphony No. 7 in A (35 min)
Fri 27 at 7.30pm
BBC Four
Beethoven - Symphony No. 9 in Dm 'Choral' (77 min)
Sat 28 at 8pm

Daniel Barenboim photo courtesy of Wikipedia.

Sunday, 1 July 2012

Tweets - June 2010