Friday, 19 September 2014

Dashed Hopes

So the predictions turned out to be reasonably accurate, Scotland voted NO and there is a bit of a hang-over mood. The waiting is over, and people voted for known unkowns. A great missed opportuinity and as someone commented - the greatest country of the 19th century remains stuck in the 19th century. Well, the yes camp should be pleased:

  • the referendum sparked a national debate that reached every bit of Scottish society with a huge turnout of 84.59%
  • the yes camp managed to mobilize a huge number of supporters during the last year.
  • the political discussion showed how the establishment thoroughly underestimated the situation
  • and people deeply care when they have the feeling that they can influence decisions.

Enough moaning - we should now look forward and see how we can move on

  • we need to make sure that we can keep some of the political momentum and not sulk in the darkness. A friend of mine told me today, that he voted for the first time ever. I hope he is not totally disillusioned
  • we need to remind the establishment that they have promised Scotland more devolution
  • the West Lothian Question must be solved - ideally England would get a number of regional parliaments
  • we should make sure that the UK stays in the EU

Speaking about the EU referendum, a colleague wondered if Cameron's attitude towards both the Scottish Independence and the In/Out EU referendum were similar - ie "surely they won't have a chance to succeed". Well, he miscalculated with the independence referendum, I hope the other one won't be as close.

Finally, today's spam was quite fun and made me chuckle:

Wednesday, 17 September 2014

More Musings on the Scottish Referendum

Even though my last post on the Scottish Independence Referendum ended up being quite long there is still much more. First of all, I found a very good essay by Charlie Stross on the referendum, well worth a read.
I tried to come up with some reasons why I would vote no. I found it quite tricky:
  • There is obviously the economy. But then an independent Scotland might be better off or worse off or nothing would change in terms of the economy. We might have another total financial melt-down dragging down the rUK (or the UK) or the world develops a serious whisky habit. Well, we basically do not know and have no way of knowing what will happen. So, I am not really that worried about the economy.
  • I can understand old (retired) people voting no, for them it can only get worse. I still have a few decades of work in front of me (hopefully), so I am not worried about my pensions. I also do not see why I should suddenly loose them.
  • I am already a foreigner in the UK. My family is spread over a number of European countries, my friends are distributed all over the world. So if Scotland should become independent my status would not change. Who knows - I might even decide to become a Scottish Citizen.

Anyway, one thing that really puzzled me was that I kept hearing that should Scotland become independent then Labour in the rUK would be finished and the Tories would rule for ever more. A corollary goes, that should there be an in/out EU referendum in the rUK (without Scotland) then it was more likely that the rUK would leave the EU. Well, during the last General Election in 2010 the number of Scottish votes were about 8% of the total number of votes given. So, somehow, if those assertions are true, the Scottish vote although a small fraction has a big influence on the rUK election results. At the same time, the Scots complain that their views are not represented in the UK parliament. Something cannot be right here.
I am a scientist, so I resolve burning questions by gathering data and plotting them. I found data for the past elections on the Parliamentary Elections in the United Kingdom - Elections to the House of Commons website. Some python and a few hours later I had a webscraper and a script that plotted the data
The graph shows the number of seats won by the Conservatives (blue), Labour (red) and other parties (black) for the past few general elections. The green line shows half the number of total seats. So, if a party is above the green line it has a majority. The solid lines show the combined number of seats for England, Wales and Northern Ireland, the dotted lines show the number of seats when Scottish seats are added to the rUK seats.
The plot shows that there is very little Tory support in Scotland (well, we did know that) and hence the Scottish complaint that they are ruled by a party they did not vote for. More interesting is that at no time during the last 30 years the UK government relied on the Scottish votes with the exception of the last election in 2010: without the Scottish vote the Tories would have had an outright majority (now they are in coalition with the Lib Dems).
It seems the statement that the Labour would have no chance in the rUK is based on the results of the last election. If the British do not like the Tories, they should just not vote for them. There might be other instances in the past when the UK government depended on the Scottish vote but I have not looked that far back (at least I did not extrapolate from one datum).
I also realise that the first past the post election system produces non-representative results. But that works both ways - for the Conservatives in England and Labour in Scotland. No wonder neither of the major parties wants to change the electoral system. Another reason the vote yes.
It's getting late and I shall have a look at the EU referendum issue in a later post.
You can download my scripts that collected the data and did plot from my github repo.

Sunday, 14 September 2014

The Scottish Indy Referendum

I promised myself that I should write down my thoughts on the Scottish Independence Referendum before it actually happens on the 18th September 2014. It certainly has been a roller coaster ride of thoughts and only now a few days before the referendum my ideas have settled on a somewhat firm decision. When the referendum was announced I started off with no idea. After a while and some reading I was reasonably firmly in the no camp to the extent that I had a passionate discussion with a colleague about why no is sensible. Some more thoughts and I am in the yes camp.
I am German but I have made Scotland my home. I am very happy here in Edinburgh, a very international and multicultural place. My wife is Scottish, my kids are bilingual. They go to a school where about half the kids are multilingual too. I found Scotland very welcoming and tolerant. So my experience is that the desire for independence is not due to nationalistic feelings but a desire to shake up the current UK political establishment. In fact my personal viewpoint is that of an internationalist.
I think the difficulty with deciding which way to vote is because there is no way of making a rational choice. We cannot know what will happen in the future. I also think that both campaigns have been very selective with their messages. I did notice, however, that the no campaign is very negative about the future of an independent Scotland (perhaps it has to be). It is also very much stuck in the past - the UK used to be an empire which won various wars in the past (and don't get me wrong I am glad that Germany lost the second world war and had a chance to shed some of the entrenched traditions and outlooks and start anew). I think the Orange Order March in Edinburgh demonstrates this  yearning for the past quite nicely. The yes camp is naturally a lot more positive about the future. It is probably far too optimistic about what can be done.
So my thoughts on the economy:
  • In the case of independence there will losers and winners. I suspect that some of the financial institutions will relocate South (presumably London).
  • Oil production tends to follow a bell shaped curve - the Hubbard Curve. The theory includes a slow build up of production where new fields are found and production is ramped up, a peak and a decline where it becomes harder to extract the oil and fewer new fields (which are also smaller) are found. So from past production data and especially once production has peaked you can extrapolate how long the oil will last. The UK is unusual in that it has peaked twice. We discussed that at work and my colleague Roy Thompson thinks that the twin peaks are due to the Piper Alpha disaster. By the way, the same analysis can be applied to gas production. So, oil and gas will run out in the next few decades (soon enough to be within my lifetime).
  • An independent Scotland should use the remaining oil/gas revenues to support new industries which will offer opportunities for good jobs that compensate the loss of jobs in the financial industry and prepare the country for a time when the oil wells have dried up.
  • I would have thought that an independent Scotland would want to be also independent of the pound. Initially this would mean a Scottish pound and a Scottish Central Bank. This is also a requirement for EU membership.
  • I do think that EU membership is vitally important. The EU makes trade and movement within a much larger area possible. It also offers protection from outside events. So yes, bring on the Euro as well

EU membership might seem like a contradiction to the desire to be independent. I don't think so. The Scottish Independence is not a nationalistic movement. I think it is about correcting the neo-liberal course firmly pursued by the various UK governments of the past 30 years or so. Being German, I am very much in favour of a federation. Some powers should be devolved to local entities whilst other powers should be devolved to larger, overarching entities. This could obviously include a UK state. However, I fail to see that the UK establishment has the capacity to change direction and enter a serious constitutional debate. Current talk about the UK considering leaving the EU are obviously worrying as well. It would be a great disaster to the UK (and Europe) should they leave the EU. The recent uproar about limiting the power usage of vacuum cleaners is very telling - we do want more efficient gadgets whatever they might be and it takes regulation to make these changes happen.
The initial thought that moved me from a tentative no to a tentative yes was that an independent Scotland would have a much smaller armed force and could not afford to take part in any foreign military adventures. I do not want to support military actions based on blatant lies (remember the 40min weapons of mass destruction?). Trident might not move from the Clyde straight away - maybe it will never move but the (r)UK may decide to just not renew their nuclear capabilities and decommission it.
The no campaign threatens economic disaster and Scotland being left undefended should Scotland become independent. Frankly, when I think about the future my view of it is not very positive to start with. I strongly think that we will need to seriously change the way we live. Wars over resources in the Middle East, civil unrest in the US, youth unemployment in Southern Europe, migrants fleeing Africa in the hope for a better life in Europe and looming climate chaos all suggest we need to change or suffer the consequences. On top of that we have a relentless industrial revolution were it is not clear that humans are the winners.
So, I think I will vote YES, because
  • the entrenched, fusty establishment needs a serious shakeup
  • this is chance to correct the political direction away from the neo-liberal Westminster consensus to a social-democratic Scotland
  • an independent Scotland will not have the resource for massive involvement in foreign military adventures (and maybe even the rUK will be too busy to bomb other countries)
  • an independent Scotland should offer interesting opportunities to people and be able to retain talent locally rather than loose it to the ever-growing moloch that is London
  • we need to be less reliant on the parasitic financial industry
  • a small country such as Scotland might be more flexible, capable and adaptable to a changing world.
  • although there are clearly risks this might be the best chance we have at building a new society

Finally,  in any case, it is amazing how everyone talks about the referendum, in the streets, at the bus stop, at work. I think it does show that people have not lost interest in politics. However, it does suggest that people are fed up with mainstream politics. We shall see what will happen on Thursday. The one thing I truly hope is that participation will be huge.

Monday, 11 August 2014

Interesting Post on Multiprocessing in Python

Just so I don't forget, very useful documentation on communication between processes using queues and multiprocessing in python. I will need some of this.

Tuesday, 20 May 2014

Alternative to lsof and fuser

We recently had some mysterious run-away process(es) that trashed a NFS fileserver. Firstly, the offending client machine got blocked off so that others could still use the fileserver. We then had to find out which process was causing the damage. Unfortunately both lsof and fuser didn't work as they were blocked - presumably because of the firewalled fileserver. After some googling I found a need solution that pokes the /proc filesystem directly:

find /proc/ -type l -printf "%p -> %l/\n" 2>/dev/null | \
   grep " -> $FILE_PATH_TO_CHECK"|cut -d/ -f3|sort -u

This will spit out a list of PIDs which can then be further checked using for example

ps -p $PID -f