Martin Keegan http://mk.ucant.org/blog/ A different sort of how to vote http://mk.ucant.org/archives/000184.html Imagine we accepted that people primarily vote their own economic self-interest. Our "which way should you vote" websites should just ask rather nosy questions about your economic status: net worth, earnings, assets, debt, mortgage, etc, and then recommend a party. It's a pity that party platforms don't and can't detail economic policies finely enough to create such a service reliably. EU referendums http://mk.ucant.org/archives/000183.html Every time someone talks about a referendum on an EU matter, look very very carefully indeed at precisely what question they're proposing to ask, and the circumstances in which they're proposing to ask it. The game with referendums is always to deny the public the right to choose on any actual relevant question. Imagine it were proposed that the EU modify its institutional arrangements in a way which is not supported by the general public in a particular member state, but that a tiny minority of vicious cranks, let us call them, say, Europhiles, favour this change. Those few in favour of the change can propose a referendum about something else, such as mere membership of the EU. They do this time and time again. A few previous times are documented on my blog already. And here they are, at it again with Greece: you're not allowed to have a referendum on the bailout package, only on Eurozone membership. The effect of this is that the people get no say, whatsoever over the rules that affect their lives. Cui bono? Global fiscal transparency anecdata http://mk.ucant.org/archives/000182.html I have spent a pleasant day or so researching how much spending data national governments publish on the web. A couple of observations: There are about ninety countries with usable budgetary data. A general ability to guess one's way in Romance and Germanic languages lets you read the majority of national government websites: English, Spanish, Portuguese, French and Dutch collectively give you the Americas, the Caribbean, Oceania and almost all of Africa. Arabic gets you another dozen countries. The international language of maladministration turns out to be French. Monarchies and socialist states take a less relaxed attitude towards brokenness on official websites. Republics are more laid back. This seems to be independent of national income. It's not clear whether authoritarianism discourages transparency: the right to reuse and redistribute a full breakdown of how much the state spends on torturing political opponents would presumably have a strong chilling effect. As colleagues had already surveyed Europe, I started with Commonwealth countries, then mopped up the rest, circling the globe east from South America, which is roughly in descending order of fiscal transparency. For a country's fiscal data to be maximally useful it needs to satisfy eight conditions; namely it must be * discoverable * open data (reusable) * structured data (in tables and columns, not in words) * machine readable (spreadsheet not PDF or Word) * disaggregated * up to date * timely * in an open format Some of these are absolute necessities; others are part of the cost function for obtaining useful results from the data. Examples of where these conditions didn't obtain: About fifty countries seem to publish no data at all. Most publication does not explicitly state that re-use of the data is permitted. A very large amount of the data is in tables in PDFs, which is expensive and unreliable to extract. Some of the data is in image files such as GIFs. These were clearly generated from an actual spreadsheet, so may be a deliberate attempt at obfuscation. In the opposite direction, some of the data is in the form of scanned paper documents, indicating attempts by public officials to counteract closed practices in other parts of the bureaucracy. Quite a few African countries gave up publishing budgetary data in 2008. A lot of the material in the developing world is a few years out of date. The sorts of problems above are the general problems of obtaining open knowledge from government data. In the case of spending data, there is an additional problem that the data should ideally be disaggregated: the absence of a standard multidimensional financial data format has left government publishers either providing a subset of possible aggregations or not bothering at all. The output of all this is linked from the Openspending wiki Countries page. You can't ban a political party http://mk.ucant.org/archives/000181.html Yesterday was the 60th anniversary of the failure of Australia's constitutional referendum on whether the federal government should have the power to ban the Communist Party. The referendum followed a defeat in the High Court on the constitutionality of a previous statutory measure, and this decision turned in part on the notion that the power of the courts to strike down legislation was a logically necessary consequence of any constitution which contained a limitation on the power of government (e.g. by division of powers between federation and states). In practice, the ban proved unnecessary. The odd thing is, the first I must ever heard about this was in the playground as a nine-year-old. I have no recollection whatsoever of how this came up, but I distinctly recall the new kid, Robertson, asserting "You can't ban a political party!", as though this were the sort of basic thing every kid should be ashamed not to know, like how to swim or where milk comes from. It was only when I was teenager in Germany and the possibility of banning Die Republikaner came up that it even occurred to me that the inability to ban political parties wasn't universal. What Is To Be Done ... about the UK political system http://mk.ucant.org/archives/000180.html British politics is now highly unresponsive to citizens. Three measures from the former colonies could greatly improve the situation: Canadian-style party funding, Australian-style party leadership elections, and American-style primary elections. There ought to be close feedback loops between electors and politicians, but these have been gradually loosened and removed in the UK. British legislators have to do what whips tell them, not what voters tell them. This explains some of those odd ways in which legislative outcomes differ offensively from public opinion. Defying the whips gets an MP deselected, terminating his career. But it gets worse: the whips are controlled by party leaders, who are not under the control of MPs or even voters. The party leaders are "elected" by their "parties", and they can't be easily removed by MPs. The leaders are chosen by party members and, in the case of Labour, non-members (who need not even be eligible to vote in Parliamentary elections). The leaders don't have to satisfy opinion within their parliamentary parties because of this, and because the parties are not financially dependent on the membership, the leaders don't have to do what the party memberships want once elected, but what rich donors want. This means the country is run for the benefit of the sixty-odd people rich enough to keep the parties afloat (millionaires in the case of the Tories, union bosses in the case of Labour, to the extent that the union bosses aren't millionaires themselves). Now this is much more pluralistic than, say, Russia or North Korea or France or wherever, but we could do a lot better. If the political system had to operate to the benefit of the sixty million citizens rather than the sixty millionaires, we'd doubtless be happier and more prosperous. The way the Canadians have avoided this is by banning donations other than from individuals, and capping individual donations at $1000. Yes. A thousand bucks. We should do it here in Britain. Obviously this would bankrupt most of the major parties overnight, which would be no great loss. Now parties which were financially accountable to their members would be a good start, but we can be stricter: Australian party leaders can be, and are, dispatched by a simple vote of the parliamentary party. (I believe Labor used to allow its National Executive Committee to dispatch the leader or dictate policy, and this was accorded unconstitutional). This means the party leadership cannot carry on policies opposed by substantial proportions of their own backbenchers, and these people are directly accountable to voters. Those parliamentarians can be made more accountable to voters, by primary elections (and possibly by reforming how their pensions work - I don't know the details, but it seems that UK parliamentary pensions depended on whether you lost an election or did not contest it, and whether you contested it depended on ... you guessed it ...). There are different flavours of primary election, depending on who is allowed to vote, who is allowed to stand, and so on, but the details aren't so important. What matters is that voters rather than the party machine get to choose the candidate who goes forward to the general election. Primary elections are a bit hard to engineer without fixed-term parliaments (which I oppose bitterly), and which, in practice, we won't always have. It can be done, though. UK parliamentary terms are five years. Primary elections ideally need to be some time before general elections, e.g., on year. Hung parliaments and other contingencies give rise to early elections, so one possible scheme is for a primary elections effectively to confer a status which lasts the length of one parliamenary term or until the next primary election, whichever finishes earlier. This is similar to how MP's actual terms in parliament work. Primaries could thus be scheduled for four years after the most recent general election, or five years after the most recent primary election, whichever comes earlier. This scheme can't be messed up by having, say, two general elections in a single year, as happened in the 1970s. Primary elections, capped individual donations, and parliamentary control of party leadership are all such lightweight changes they could be imposed by political parties upon themselves, and don't risk destabilising other aspects of the constitution (unlike pretty much any political reform scheme you hear from the Rowntree Trust or the Lib Dems; one might be forgiven for thinking that was the point, some time). What everyone should read http://mk.ucant.org/archives/000179.html There are several lists of what must be read. I furnish the correct list below: * What is Wrong with Our Thoughts, by David Stove. * Microcosmographia Academica, by F M Cornford. * Gulliver's Travels, by Jonathan Swift * Language of Liberty, by James Allan * Information Rules, by Hal Varian and Carl Shapiro * Mystery of Capital, by Hernando de Soto * Governing the Commons, by Elinor Ostrom * Logic of Political Survival (with a pinch of salt) by Bruce Bueno de Mesquita et al * Reflections on the Revolution in France by Edmund Burke * Supply without Burthen, from the writings of Jeremy Bentham * Law & Disagreement, by Jeremy Waldron What is a constitution? http://mk.ucant.org/archives/000178.html A constitution means that your country's org chart has a loop in it. Citizen-initiated legislation under the Westminster system http://mk.ucant.org/archives/000177.html Citizens should be able to initiate legislation; technological change has now made this viable, and it would contribute to making political institutions more democratically responsive. The current rules for introducing legislation in Parliament (in the Westminster System as practised in the UK, Canada, etc) afford the government a near-monopoly on legislative initiative: most bills originate with the government, and a few are introduced by individual members who have won a yearly lottery. This means that parliamentarians never need to account for a collective refusal to discuss legislation favoured by citizens but opposed by the political class. In the UK, there are several issues on which the political divide is not between parties, but between people and the elite: MPs' expenses and European integration being two well-known examples. A very small minority of MPs are in tune with public opinion on these issues and prepared to introduce legislation about them, albeit legislation with no chance of becoming law. However, once a bill is introduced, the formal procedures for rejecting it involve public discussion, debate, and voting, in a forum visible to all citizens. For centuries, it has been possible to present petitions to Parliament, signed by citizens. What I propose is that citizens be able to attach draft legislation to such petitions, and that, subject to a popularity threshold, such bills should be entered for discussion for First Reading, as government and MP's private bills are at present. In Latvia, there currently exists a similar system, named ManaBalss, and uses technology to facilitate citizens' collaboration on draft legislation (or the other types of parliamentary instrument that exist in their system). The system operates through a website, which identifies people (by means wholly inappropriate to the British political system), and lets them promote and amend proposals for submission to Parliament. The website enforces a multistage process, wherein the petitioners first respond to scrutiny by experts in the relevant field, the measure is published, publicised by the petitioners, reviewed by lawyers, and if sufficiently popular is deposited in the Parliamentary in-tray. Whereas the final piece of this (formal adoption by Parliament as law) is not complete in Latvia, the very existence and popularity of the system has already influenced legislative outcomes. The recent law on transparency of foreign-owned companies was passed as a result of a parallel initiative on the ManaBalss website. Elements of the Latvian proposal which are likely to translate well to the Westminster system are allowing the petitioners to speak in Parliament, and the overall assumptions of much weaker executive / whipping influence in the legislature. A simple list of which MPs voted against popular proposals would enhance British democracy, even if no proposal survived First Reading. An amusing side-effect would be that legislation initiated via such a website could be kept in an open, accessible data format, which would be a substantial improvement on existing arrangements. P.S. Francis Irving also has a writeup. Will the EU collapse? http://mk.ucant.org/archives/000176.html > You have listed problems with the European Union on your blog. I am > curious what you think will happen to the EU. Do you think the EU will > eventually collapse? Would these 10 problems with the EU lead to its > downfall? [This post originally written as private correspondence] I wrote that list five years ago as a challenge to supporters of the EU to engage with the arguments at all. There were very few takers. The reason is that basically no-one actually thinks the EU, as currently constituted, is in any way a good idea. Whether one says this publicly is a matter of how one wishes to be perceived. In the UK, support for the EU is basically a way of signalling that one is against nationalism, facism, racism, traditionalism, various forms of conservatism, etc. Opposition to the EU has often been *perceived to have been* dominated by undesirable types, and certainly the UK's only substantial racist party is highly Eurosceptic (except inasmuch as it sees the EU as an instrument for encouraging immigration by white people). The common perception of Euroscepticism is wrong, like so many common perceptions. So: there was no-one to have my argument with. The most committed Europhiles basically privately admit the entire thing is a catastrophe and work diligently for its reform. My 11 points in that article fall into three categories: the absence of most features of Europe-level democracy (in the last five years I have formalised this into testable questions), the misdesign and misbehaviour of actors (legislators, officials, judges) in the European lawmaking processes, and the undesirable effects this all has on policy outcomes. So as Abraham Lincoln didn't ask, can a government neither of the people, nor by the people, nor for the people, long endure? I see no reason to believe that it could. Either democracy will come to the EU, and so radically transform it as it no longer retain any meaningful identity with the constitutional structures we see today, or countries will vote to withdraw. The effect of the undemocratic operation of the EU is to transfer resources and power to people who would not otherwise receive them. It is irrational for any group of people to tolerate this indefinitely. Ireland didn't tolerate being governed from London in 1920, and I suppose the current rule from further east will be equally unwelcome. Most countries formerly controlled by the UK obtained their independence peacefully, and if independence is good enough for Canada, for Nigeria, for India and the rest, why is independence not good enough for the UK? I expect it will be the Germans whose patience snaps first though. Wikileaks could have been worse http://mk.ucant.org/archives/000175.html ... what if they'd leaked all the data the Government was planning to put on the National Identity Register? What if they'd leaked the Criminal Records Bureau's database? It's time to shut these databases down before some angry civil servant decides to let it all rip. Markets rigged? http://mk.ucant.org/archives/000173.html The first thing Vince Cable did when he got into Parliament was write a private member's bill, now the Copyright etc and Trade Marks (Offences and Enforcement) Act 2002, massively increasing the penalties for copyright infringement. No empirical evidence was offered supporting the contention that this measure was anything other than a redistribution of rent to the benefit of large established rightsholders. Now Mr Cable has pronounced that capitalist markets are often "rigged". I guess he'd know. September is finally over http://mk.ucant.org/archives/000172.html The UK's academic networking inhibitor, UKERNA, has finally announced that it is doing its bit to raise the standard of online public discussion by discontinuing access to Usenet. I never thought I'd agree with anything these monopolists did. Good riddance, Usenet. When the Toad came home http://mk.ucant.org/archives/000171.html My first day cycling to work almost ended prematurely at the hands of the Metropolitan Filth. As I was crossing the normally stately Eaton Square I was distracted by the sight of an elderly gentlemen on a bicycle of unimaginable antiquity which he must have nicked from the Science Museum back in South Ken, or indeed from the Egyptology section of the V&A. It is but a small exaggeration to say that his palaeovehicular contraption was a marvel of High Victorian overengineering: marble and hand-burnished mahogany surfaces held together by wrought iron and discredited physics, doubtless requiring frequent tyre rephlogistication. And that's how I was almost hit by a pair of speeding police cars hooning at me the wrong way 'round an intersection like Ayrton Senna on a neckload of blow. Having kept safely to the curb, the elderly cyclist just looked at me plaintively and uttered an absurd "Poop! Poop!", though he must have been about fifty when the film of Wind in the Willows came out. Happy anniversary? http://mk.ucant.org/archives/000170.html Do we really suppose that the University of Cambridge celebrated its 750th anniversary in 1959? Is there any documentary evidence to this effect? Enough is enough: Part I, Database reflection http://mk.ucant.org/archives/000169.html I try to restrict this 'blog to subject matter which annoys me, avoiding work, personal reminiscences and my over-indulged computing hobby. Today I shall have been mainly annoyed about database reflection, in the sense of "automatically give me a web app which lets me view and update the contents of an SQL database". There are lots of solutions to this problem, but they partake of some of the following deficiencies: * they also solve the problem of editing the database schema * they are written in languages of exclusively epidemiological interest (e.g., PHP and other disease vectors such as Perl) * they require a separate copy of the schema to reside outside the database * they are written with the assumption that the database schema will be instantiated by the web app Now leaving programmers in charge of the database schema does not scale, and many good programmers are afflicted by fear, ignorance and prejudice where SQL is concerned. In any case, larger organisations employ sysadmins to run production database servers and these DBAs are just not going to let some random Perl script scribble all over their database, if indeed it's allowed to run with any privileges at all. So any off-the-shelf solution whose preference is to issue all those CREATE TABLE statements itself must be approached cautiously. The bad news is that for small-scale systems this is an acceptable means of prototyping, so this behaviour is endemic in web app frameworks (and indeed is regarded as so normal that some of the documentation refers to "legacy" databases as though it were undesirable that they should not be created by some web app). If you want to re-use any of these components, you may well find yourself stuck in the "update table requires alter table privilege" ghetto. The competent people who are writing the Create-Read-Update-Delete ("CRUD") frontend don't want to have to reimplement the whole stack, so they just give you access to whatever database tables the rest of the framework presents them. ... and these frameworks, being written in dynamic languages, instantiate database entities as objects or classes in their own right. Where the web app contains the authoritative copy of the schema, doubtless in some pidgin DDL, it's obviously trivial for a cargo cult programmer to cut-n-paste himself a few more database tables by imitating the the ritual incantations elsewhere in the models file. I reproduce an example of this stuff below out of sheer sadism: class UnbearableMovie(DeclarativeBase): __tablename__ = 'unbearable_movie' #{ Columns id = Column(Integer, primary_key=True) title = Column(Unicode(255), nullable=False) director = Column(Unicode(255), nullable=False) #} So once you've included that in your code, you do m = UnbearableMovie(name="Sex and the City") or whatever. This is no good if you don't know what the tables are called because someone else is deciding that or it might change, but to their credit the SQLAlchemy people have an autoLoad feature which inspects a database table for its column names. I couldn't find anything on the web which ran this on all database tables in Python, but did find people with the same problem. So here is a rough and very brittle solution: class ReflectedTable(object): def __init__(self, **kwargs): for k, v in self.iteritems(): setattr(self, k, v) def init_model(engine): """Call me before using any of the tables or classes in the model.""" global metadata DBSession.configure(bind=engine) def table_names(): introspect = '''SELECT name FROM sqlite_master WHERE type = 'table';''' for row in engine.execute(introspect): yield str(row[0]) def do_reflect(name): class_name = name.title() reflected_table = Table(name, metadata, autoload=True, autoload_with=engine) cls = type(class_name, (ReflectedTable,), {}) mapper(cls, reflected_table) setattr(MY_APP_NAME.model.reflected, class_name, cls) for name in table_names(): do_reflect(name) Combined with the catwalk CRUD frontend, this is enough to get the necessary: a database whose schema changes are reflected in a web app without further hassle. UPDATE: Someone may well have got there before me, and written SqlSoup, though I've not checked that that does what I want. Interestingly, the chap who wrote has written a "blow off steam" blog post just like this one to vent his frustrations.