Start of something big

Xilinx S6-SP601 board
Xilinx S6-SP601 board (Photo credit: Wikipedia)

I am about to start work on what will, if I succeed, be the most difficult and complex software project I’ve ever undertaken – and that means, at the moment, I am wandering around rather lost, reading various online white papers and data sheets, consulting old text books (like this) and procrastinating through writing blogs.

The task is to write paging code for a more or less bare metal Microblaze FPGA system (or rather a Microblaze system hosted on an OVP simulator). With only a very limited semi-hosting version of Newlib available for system call type support, it is all very daunting.

Lessons from the Scottish referendum

It is just over a month since the people of Scotland made their decision to stay in the United Kingdom.

The final result was – in referendum terms – something close to a landslide, with “No” finishing 10.7% ahead. Perhaps that was not as big a victory as had been hoped for even two months earlier, but it was enough to encourage many to say they had known all along Scotland would indeed, to use David Bowie’s words, “stay with us”.

From the point of view of some commentators and businesses the outcome may have seemed obvious from the start. Splitting the world’s most successful single market, injecting massive currency, regulatory and political uncertainty and pegging your future to the value of the rapidly diminishing North Sea Oil reserves seemed so ridiculous that many thought it unnecessary to speak out.

Yet in the end many did join the debate and they did so not because they thought they were backing a winning proposition in opposing the UK’s break up, but because they were worried they were about to end up on the losing side without having said a word.

Understanding why that was, and why the “Yes” campaign propelled what many regarded as, at best, an eccentric idea to the point where their opponents seemed to be in the midst of a frenzied panic, is what I want to look at here – because I think the Scottish referendum campaign tells us a lot about the contours of public policy debate in the future: and much of it is far from good news.

I have four, related, propositions to make.

Firstly, in the future, all stories, even the made up ones, will be famous for 15 minutes. It is not that long ago that I remember celebrating the way that the Internet had broken down the people’s deference to the professional closed shops that denied them choice and autonomy. The classic case was the medical profession, where doctors were confronted with patients newly armed with self-diagnoses informed not by old wives’ tales, but credible websites.

In the referendum, though, this questioning of existing authority became something much uglier – a lack of respect for the very idea of any authority. In short, any rumour or conspiracy theory could be treated as fact and believed by many.

Since the referendum result was declared this has manifested itself in a belief that the whole poll was rigged – as though Alex Salmond was all along an agent of Unionism.

Before polling day the focus was on oil – with members of the Scottish parliament putting their names on leaflets claiming there were secret reserves of oil off the coast of Ayrshire or endorsing bizarre theories that the Prime Minister was actively engaged in a conspiracy to hush up details of a massive new oil field found to the West of the Shetlands.

These ideas did not just circulate on social media – the BBC felt compelled to treat the latter story as though it had merit and asked people about it.

The whacko world of 9/11 “truthers” and “birtherism” came to Britain and played a real part in deciding the biggest issue facing the country since the end of the Second World War.

Secondly, on the Internet, all ideas are created equally. Lots of voters, but especially “Yes” voters, prided themselves on the “research” they undertook before deciding how to vote. And, truly, many Scots did treat this momentous question with the seriousness it deserved.

But, when asked to research a question, what is the first thing you do today? It is not to go to the library or to ask an acknowledged expert, but to fire up your favourite browser and type a search term into Google.

What comes next is crucial. If you are a school student researching, say, Pythagoras’s Theorem, you’ll get a Wikipedia article and links to some quite good graphics illustrating the sum of squares rule. But type a term that relates to an ongoing political controversy and you are in the lap of the gods – or rather you are standing downwind of who can shout loudest. And in the Scottish case the loudest shouters were very much the Yes campaign.

As just one example, towards the very end of the campaign, Ipsos Mori published the results of a focus group into why people were switching from No to Yes – and sure enough one person was quoted as saying their “online research” had convinced them that “Westminster” had declared the waters off the coast of Fife (in central Scotland) to be English and they were going to vote against that.

Of course, there is no such declaration. What he plainly had seen was a claim by a Yes conspiracist about some secret plan. But, on the Internet, there is nothing much to tell you whether any particular idea is barmy or rational.

Thirdly, if you don’t like these facts, why not make your own? French postmodern theorists resisted the idea of objective facts, claiming that all ideas are merely “narratives” promoted by elites. And Yes campaigners in the Scottish referendum proved to be excellent pupils of Lyotard and Baudrillard by simply creating their own narratives through a small number of very high profile blogs.

These sites – particularly Wings over Scotland, Newsnet Scotland and Bella Caledonia – grew to be huge and well-funded, via crowd-sourcing, operations. Feeding and feeding-off the obvious anger of many Yes campaigners, they proved to be both the exo-skeleton of sprawling Yes campaign and lenses that focused all the issues that angered and motivated Yes voters. In short, you were quite likely to end up on one of these sites if and when you did that “research”.

Fourthly, you do not have to believe in anything as long as you believe in us. The Yes campaign was highly motivated and very big, in terms of its street presence at least. But what did they all believe in? Not very much beyond the idea that Scottish independence was the answer to more or less any given problem.

At the same time that Alex Salmond was arguing that an independent Scotland could surf a global oil boom, the leader of the Scottish Greens was saying an independent Scotland could end its dependence on fossil fuels. Far left parties claimed a Yes vote “guaranteed” thousands of additional civil service jobs, while the governing Nationalists committed to making the private sector, fired by tax cuts, the engine of jobs growth.

Perhaps the No campaign could have done a better job in exposing these obvious contradictions and so forced at least one group of Yes supporters to confront the reality that they were on a hiding to nothing. But, regardless, the ethereal nature of so much of the campaign – conducted through social media – meant there were a limited number of hard targets for No to hit.

The approach of newspapers and broadcasters, desperate to look relevant to younger audiences, to social media did not help. Despite actually very few Scots being regular users of Twitter, it took on a special significance and that only served to emphasise that who could make the most noise online mattered almost as much as the quality of their arguments. What is more, the Yes campaign skilfully tried to turn the whole issue into a horserace, discount rational argument and only rely on emotion and energy.

They failed, of course. Facts carried more weight than they had hoped and the Yes campaign’s inability to give credible answers to some core economic questions – especially about what currency an independent Scotland would use, cost them dear.

All of which leads to me to a final conclusion. Which is one should never elevate tactics over strategy. The No campaign stuck doggedly to its strategy of hitting hard on the core economic questions and that was undoubtedly the right thing to do – after all they won. A better campaign might have had a more flexible response to the four horsemen of the Yes apocalypse discussed above, but a No campaign which abandoned its strategic vision to just hit at the latest conspiracy stupidity, fact-free assertion or contradictory comment from its opponents would have ended up losing the voters’ attention and the public’s vote.

No’s focus on continuing to ask the small number of really difficult questions for Yes was about more that getting their voice heard amongst all the shouting: it was a reminder to the voters that facts and assertions are not the same.

It had been a long, and at times desperate, struggle, but No’s discipline saw them through. That is worth remembering in any future public campaign no matter how far from Scotland.

The gravitational perpetual motion machine?

English: Gravitational potential is a scalar p...
English: Gravitational potential is a scalar potential energy per unit mass at each point in space associated with the force fields. : \phi = -( \frac{GM}{r}) . In this case, M = 100 000 kg, G = -6.67E-11 (Photo credit: Wikipedia)

Perhaps I should have thought about this years ago – when I was surrounded by physicists and cosmologists and the like, and so could have got an answer: but I didn’t – until I started reading Lee Smolin‘s Time Reborn: From the Crisis in Physics to the Future of the Universe.

Here’s the issue: as Smolin states, nothing stops gravity. You cannot muffle it or block it.

Then let us think of an object with mass – it sends out “gravitons” (we assume – these have never been detected of course) and these exert a force on every object they meet. If we go one step further and suggest that the universe is infinite, do we not end up with our massive body being the source of an infinite amount of force and hence an infinite amount of energy?

Getting into murky waters here – but as I understand it, physics gets round this with something of an accounting trick: bodies with gravitational potential energy are deemed to have negative energy and so all that happens is that our massive body converts this negative energy into a positive energy and the total amount of energy in the universe is unchanged.

Is that really it?

An unchanging quantum universe

This another one of those bizarre thoughts that cosmology throws up which manages to be both simple and profound.

Imagine the wave function for the whole universe.

By its nature the universe cannot change its quantum state: it’s the ultimate closed system. Of course there is a  probabilistic distribution of energy inside the system but the total energy of the system does not change and therefore its quantum state cannot change either.

So, in quantum terms the universe is unchanging over time.

Not even an April Fool

I can remember my first encounter with the metric system very clearly…
In the Summer of 1972 the British Army mobilised in massive numbers to end the “no go areas” that had sprung up in nationalist areas of Belfast and elsewhere over the previous two and a half years. Operation Motorman was to be the biggest ever “peacetime” military operation in the UK since the end of the Second World War.

One of those areas was in Lenadoon where my school, Blessed Oliver Plunkett, was based.  As the Army took over the two tower blocks on the estate as observation posts, the residents left and bedded down in the only place available – the school.

The result was that, to all effects and purposes, the school was closed and I – like hundreds of others – started the next academic year somewhere else – in my case at Holy Child Primary School (in consequence of “Olly Plunkett’s” closure, and the rapid expansion of the Catholic population of West Belfast,  Holy Child that year became the largest ever school in the UK – with over 2700 pupils.)

On my first day in Mrs MacManus’s class we had a maths lesson and I was confronted, for the first time, with these strange metric measurements, the centimetre, the gramme and the millilitre.

My point is this – in the UK, even in the bits of the UK that were least keen on being in the UK, we have been teaching our children in metric measurements since 1972 – 42 years.

Yet, along comes the Prime Minister, David Cameron, last night, and this happens:

“I think I’d still go for pounds and ounces, yes I do,” Cameron told BBC2’s Newsnight when asked which should be taught predominantly.

I admit, I am no fan of David Cameron to begin with. But where do you begin when faced with such idiocy?

I suppose you can start with the fact that Cameron is a graduate of PPE – politics, philosophy and economics – and plainly knows nothing, or next to nothing, about science and the fact that sciences have been taught, the world over, in some form of metric measurement since at least the 1950s. Teaching our children in imperial measurements would be to actively seek to disadvantage them.

Then again I could just recall that John Stuart Mill was moved to remark to the House of Commons: “What I stated was, that the Conservative party was, by the law of its constitution, necessarily the stupidest party. Now, I do not retract this assertion; but I did not mean that Conservatives are generally stupid; I meant, that stupid persons are generally Conservative. I believe that to be so obvious and undeniable a fact that I hardly think any hon. Gentleman will question it.” (My emphasis).

With Cameron one never quite knows of course – and this may just be the latest piece of his rather desperate efforts to appease the anti-Europeans in his party who want him to follow the lead of the hard-right United Kingdom Independence Party (UKIP).

UKIP’s platform is built on two propositions – that it would be better if we returned to the 1950s and that all that is bad in the UK emanates from the European Union. In metrication they find both enemies – modernity and Europe. At least in their minds they do – given that the UK did not join the then EEC until 1973 I am not sure Europe really is “to blame” for the end of the rood and the chain and the rise of the hectare and the metre.

Already the Tories have thrown a bone to the cave men of UKIP by bringing back rote learning of “twelve times table” – once an essential for a country where twelve pennies made a shilling but an anachronism since “decimalisation day” – 15 February 1971. So maybe this is next.

Or, more likely, it is Cameron not having the guts to stand up to them in public, even on such an obviously rational issue as the use of the metric system.

Pointers versus references

English: Image for teaching pointers in comput...
English: Image for teaching pointers in computer programming Česky: Obrázek pro výuku ukazatelů v programování (Photo credit: Wikipedia)

Some people don’t like pointers – and for that reason, I think, we have references in C++. But as a confirmed pointer person, I find references very hard going.

I had a piece of C++ code that did this:

PartialPage& DoubleTree::oldestPage()
	PartialPage& pageToKill = pageTree.begin()->second);
	long timeToKill = pageTree.begin()->second.getTime();
	map<long, PartialPage&>::iterator itOld;
	for (itOld = pageTree.begin(); itOld != pageTree.end(); itOld++) {
		if (itOld->second.getTime() < timeToKill) {
			timeToKill = itOld->second.getTime();
			pageToKill = itOld->second;
	return pageToKill;

This produced rubbish results – because re-assigning the reference didn’t make it refer to a new element of the map. Essentially you cannot mutate a reference in C++ at all.

Switching to pointers fixed the problem though.

PartialPage* DoubleTree::oldestPage()
	PartialPage* pageToKill = &(pageTree.begin()->second);
	long timeToKill = pageTree.begin()->second.getTime();
	map<long, PartialPage>::iterator itOld;
	for (itOld = pageTree.begin(); itOld != pageTree.end(); itOld++) {
		if (itOld->second.getTime() < timeToKill) {
			timeToKill = itOld->second.getTime();
			pageToKill = &(itOld->second);
	return pageToKill;



Get every new post delivered to your Inbox.

Join 1,004 other followers

%d bloggers like this: