Monday, August 25, 2014

The Problem with Fracking: Part 3

In the first and second parts of this series, I argued that aquifer contamination from the completion in a fracked gas well is highly improbable, and that fracking fluid, as distinct from waste water, is benign.

In this part, which could easily be titled “When Fracktivism Isn't About Fracking”, I take a look at “fraccidents” in Pennsylvania.

Pennsylvania has been a gas-producing state since the mid 19th century, but has seen a boom in gas production since fracking enabled the exploitation of the Marcellus shale. There are estimated to be 350,000 oil and gas wells in Pennsylvania, the vast majority of which are old, inactive wells. EIA data shows a sevenfold increase in gas production in the four years after horizontal drilling (more-or-less synonymous with fracking) began in earnest around 2008. Currently, there are about 9,000 active wells in Pennsylvania, with a new well being drilled every day (on average). The following EIA animation shows wells drilled in Pennsylvania between January 2005 and April 2012:


As it happens, this is more-or-less the same time span covered by Earth Justice's record of “fraccidents” in Google Maps. In mid-late August, 2014 (the time of writing of this blog entry), they place 38 “skull and crossbones” symbols over Pennsylvania for what are, presumably, poisoning events of some kind resulting in death or serious injury; at least a major fish-kill or something, right? You don't use a skull and crossbones to indicate something like rocks falling from the back of a truck with a faulty tailgate, after all, right? It turns out that you do.

“Fraccidents” in Pennsylvania
When you click on a skull & crossbones, you sometimes find that it corresponds to two or three separate events that might be revealed at a higher zoom level (or not; sometimes they are in the associated text or linked articles). It can sometimes be hard to disentangle where and when, exactly, a particular event occurred since, often, linked articles make reference to events that happened elsewhere in Pennsylvania at some indeterminate time in the past (the Zimmerman vs. Atlas Energy lawsuit is mentioned several times). Equally, there are occasions when an opportunity to include a separate skull and crossbones has been missed.

“Fraccidents” Overlaid on EIA Well Data
All in all, I figure that the Earth Justice “fraccidents” represent 45 separate events.

But how many of these are actually to do with fracking?

Let's have a look at a few of these fraccidents...

Sticking out like a sore thumb, there's a lonely skull & crossbones about 30 miles south of Harrisburg, and over 100 miles east of any well (fracked or otherwise) known to EIA. It turns out that this is actually a drilling mud spill that happened when a gas pipeline was being drilled 13 feet under a creek. This might be related to the Pennsylvania gas industry, but has nothing whatsoever to do with fracking and, even if it did, it's a very minor event. Equally, representing a spill of 2-3 cubic yards of bentonite (a kind of clay) with a skull and crossbones reeks of alarmism.

More appropriate use of a “skull & crossbones” is in the southwest corner (as it happens, the event actually happened in West Virginia, but appears in Pennsylvania, presumably due to some innocent error), where 10,000 fish were killed over a 30-mile stretch of river. What caused this? An algal bloom caused by discharges from coal-mining. Nothing to do with fracking, or even the oil & gas industry.

There's a water-contamination event in Hickory (just west of Pittsburgh) in December 2005. The problem is that the first horizontal well in this area was recorded by EIA in September 2007. So this event, if it was was due to a gas well at all, was due to a conventional well and, again, nothing to do with fracking.

There are several examples of compressors catching fire, a faulty tailgate on a truck allowing drill cuttings to fall out onto the road, a truck leaking hydrochloric acid, drilling mud spills, diesel spills, or methane leaks. These are nothing whatsoever to do with hydraulic fracturing: they might just as well have happened with any kind of gas well, fracked or not, or in another industry entirely.

In fairness, there are several events that can plausibly be linked to fracking in some way. In most cases, these are either actual wastewater leaks or events probably caused by wastewater leaks. For example, there are several cases of high levels of metals, including arsenic, and aromatics, including benzene, being found in soil or drinking water. Although the causal connection with fracking is tenuous, they are most likely attributable to wastewater leaks, and the wastewater is from frack-jobs. There have been a number of casing and cementing failures that probably wouldn't have happened in a conventional well, probably happening due to the extreme pressure used during fracking.

So, how many of the 45 “fraccidents” survive cursory fact-checking?

Being generous? About half. The other half range from outright lies (fish-kills due to coal-mining) to gross exaggeration (cuttings falling from a truck) to falsely attributing accidents to fracking when they're just associated with the gas industry generally (compressor accidents, pipeline leaks).

So is, say, 25 real “fraccidents” too many? Maybe. The reality is that oil & gas extraction is dangerous. All extractive industries carry the potential for pollution, whether that's fracking for shale gas or mining neodymium for the permanent magnets in wind turbines. With 9,000 active wells in Pennsylvania producing 4 trillion cubic feet of gas over 6 years, 25 accidents doesn't seem like a whole lot to me.

It isn't a great surprise that much fracktivism is disingenuous. After all, the movie that essentially started the whole anti-fracking hysteria, Gasland (on Netflix), is a stunningly dishonest piece, as exposed by FrackNation (also on Netflix). The truth is that almost all real “fraccidents” are wastewater leaks, which are actually pretty rare, but do happen occasionally.

The idea that we need better regulation of wastewater storage and disposal practices is worthy of consideration, and enforcement must be adequately resourced, but the way to argue these points is not with alarmist lies, hysterical exaggeration, and presenting personal anecdotes as fact.

Josh Fox (Gasland) found a dozen people who claim that “fracking” has destroyed their lives. Phelim McAleer (FrackNation) found a dozen who claim that “fracking” is essential to their economic survival. Neither is a sound basis for forming a personal opinion, much less government policy. I could easily find a dozen people who claim to have been abducted and anally probed by aliens. I could make an engaging and emotional documentary about it. But that doesn't mean that we need a government policy to deal with the alien abduction problem. Policy should be based on expert analysis of evidence.




Wednesday, August 13, 2014

The Problem with Fracking: Part 2

In the first part of this series, I demonstrated, by correcting a representative anti-fracking graphic with a few simple facts, that contamination of aquifers by fracking fluid or hydrocarbons from the completion of a shale gas well is highly implausible due to the natural barrier between the two in the Marcellus shale.

In this second part, I will argue both that the composition of fracking fluid is benign and that, even if it weren't, it wouldn't matter. Hopefully putting to bed another fracktivist fable.

 

Sensationalism and Ignorance

The myth goes something like this: “fracking is pumping millions of gallons of a cocktail of poisons into the ground”. The majority of people who believe this do so because they've been misinformed, usually by people who claim to understand fracking and ought to know better, often by people who actually do know better and are compartmentalizing, and rarely by idealogical liars.

Much fracktivist propaganda exploits public scientific ignorance and chemophobia (“Eek! It's full of chemicals!”).

Not everyone is, or can be, highly scientifically literate, but to most of us, who don't know our isomethyloxidocarbonoxybenzoic acid from our isopropanylmethylphosphonofluoridate, these claims about an absolutely real fracking fluid component sound very scary: 
  • Component X is a powerful industrial solvent.
  • Component X is based on the highly reactive hydroxyl radical, known to mutate DNA, denature proteins, disrupt cell membranes, and chemically alter critical neurotransmitters.
  • Component X is a CNS (central nervous system) depressant, and can cause cerebral edema and brain herniation.
  • High levels of Component X have been found in tumors excised from cancer patients.
Are you scared yet? You should be: water is scary stuff!

The most common metric of toxicity is the median fatal dose, (LD50) usually expressed in wt/wt form, such as mg/kg (milligrams of toxin per kg of bodyweight) for lab animals like rats or rabbits (with certain caveats, we usually make the assumption that this “scales up” to people, at least roughly). The LD50 for water is 90 g/kg; this means that if 100 people, each weighing 80 kg (176 lbs) drank 7.2 liters (1.9 US gallons) of water in one sitting, half of them would die. Water is toxic.

This toxin, water, is “a powerful industrial solvent”. So what! Alternative uses of a substance tell you absolutely nothing about its safety.

Both sides of the fracking debate are absolutely rife with “danger by analogy” or “safety by analogy” fallacies, sometimes about the same substance. For example, a fracktivist might tell you that potassium chloride is the poison used in death by lethal injection, while a fracking proponent might tell you that potassium chloride is a harmless substitute for regular table salt. Both of these statements, on their own, are entirely true.

Now it would be tempting to damn both sides for making such fallacious arguments. After all, both “true” statements in the preceding paragraph are equally misleading, aren't they? Well, no, not quite. When we're talking about fracking, the concern is not that someone will accidentally inject fracking fluid intravenously, it's that someone will inadvertently ingest something contaminated with fracking fluid. In context, one of the analogies parallels the implied concern (ingestion vs. ingestion) and the other one doesn't (ingestion vs. injection).

Ultimately, there are three key points here:
  • misleading phraseology can make anything look extremely dangerous to a superficial reading;
  • simply asserting that something is “toxic” is meaningless without information about dosage (how much) and delivery (oral, skin, IV);
    • also, using more specific terms like “neurotoxic”, “hepatotoxic”, “cytotoxic”, “carcinogenic”, “teratogenic”, “mutagenic” doesn't change that; and
  • alternative uses for a substance are not indicative of their safety or otherwise.
Now, bearing these facts in mind, read this sensationalist article from Business Insider.  

 

Incidental Constituents

Let me ask a question:
  1. What would you think of a father who added acrylamide and nitrosamines to his child's food?
If we hadn't already dispensed with “danger by alternative uses”, I could probably ram home the psychopathic perversity of this parent by noting that acrylamide is a poison and carcinogen used in the manufacture of plastics and pesticides and in sewage treatment, and nitrosamines are known carcinogens used in the manufacture of rubber, pesticides, and cosmetics.

Now that you want to lynch the parent from the nearest tree for adding dangerous chemicals to their child's food, let me ask you a second question:
  1. What would you think of a father who gave his child a hot dog?
According to fracktivist logic, 1. and 2. are exactly the same thing.

Whenever you see anti-fracking propaganda saying that “oil companies used millions of gallons of products containing benzene and toluene in fracking fluid”, as in the above-linked article, it's undeniably true. Light hydrocarbons — including benzene, toluene, and others — occur incidentally in minute quantities in petroleum distillates, which are used directly as lubricants and indirectly as carriers for other additives. They are present, just as acrylamide is present in baked goods, such as a hot dog bun, and nitrosamines are present in cured and cooked meats, such as a wiener. But there is a huge difference between something being present incidentally in minute quantities, and being added with deliberate intent and depraved indifference to public safety.

The truth is that “Big Oil” is no more adding benzene to fracking fluid than Oscar Mayer is adding nitrosamines to bacon.

 

The Same, or Worse

Some of the most hysterical reactions to fracking fluid constituents are prompted by aromatics — hydrocarbons that contain 6 carbon atoms in a loop called a benzene ring that are often carcinogenic — such as benzene itself, toluene (a benzene ring with one methyl group), and xylene (a benzene ring with two methyl groups).

Natural gas, including shale gas, is a mixture of a large number of hydrocarbons. The composition varies widely from reservoir to reservoir, just as the composition of oil from Saudi Arabia, Texas, and the North Sea differ. We can say that it is mostly methane, ethane, propane, and butane, but also that it contains, amongst other things, benzene, toluene, xylene, and other aromatics.

The lithostatic overburden pressure (due to the rock above) in the Marcellus formation is probably something in the region of 400 to 500 times atmospheric pressure and the temperature is also considerably higher than at the surface. When the reservoir fluid is brought to the surface, it expands and cools. Some constituents remain or become natural gas and some condense into a liquid, called condensate. It can be pretty difficult to get an idea of the exact composition “deep in the ground” because data are published separately for natural gas and condensates at surface conditions, but the gas typically contains only minute traces of aromatics (0.005%), while the liquid condensate can contain aromatics at concentrations between 0.2 and 12%. What we can say is that there are a lot of aromatics in the ground and the concentration is non-negligible.

Why would a reasonable person care about pumping fracking fluid that has a trace of toluene in it into a formation where the concentration of toluene is 100 times higher? It makes no sense. We would all agree that discarding a lit cigarette butt is generally bad because it creates a fire hazard, but discarding it into a blast furnace is another thing entirely.

 

The Real Question

The proper concern about any component of fracking fluid is “is this substance harmful in the concentrations found in fracking fluid?”

We can vacillate endlessly about individual components, but ultimately, the simple answer is “no”.

Furthermore, whatever the components of any real-life fracking fluid, the same in higher concentrations or much, much worse is already down there, and some of it ends up in the fracking fluid that returns to the surface when the frack-job is done. This is the reason why it is the waste water after fracking that should be the focus of environmental concern, and not what “Big Oil” is putting in the fracking fluid. Conflating the two, as fracktivists are wont to do, is worse again.

Saying things like “fracking is pumping millions of gallons of a cocktail of poisons into the ground” is a shibboleth for reflexive opposition and ignorance of the real environmental issues.

In the next instalment, I will deal with the question: “When is fracktivism really about fracking?”

Monday, August 11, 2014

The Problem with Fracking: Part 1

The problem with fracking is that fracking itself is fairly benign. It's really the associated wastewater disposal that presents the most serious environmental challenge.

Almost every day, I see anti-fracking posts on Facebook. About once a month, I get handed anti-fracking leaflets on the street. All of these tell me that fracking is bad because of, amongst other things, the risk of contamination of drinking water aquifers with fracking fluid and hydrocarbons from the completion, as depicted in this graphic that I found via Google Image Search:

“Gasland” Fracking Graphic

The problem with this is that it's a lie. In this first instalment of The Problem with Fracking series of blog posts, I'll explain why.

Aquifers used for drinking water and irrigation are usually shallow, something like a few hundred feet down. Anything over 500 feet down is considered a “deep bedrock aquifer”. There are a couple of reasons why shallow aquifers are preferred: economics and water quality. As a general rule, the deeper you go, the worse the water. The reason for this is that temperature and pressure rise as you go down, with a corresponding increase in the proportion of dissolved salts in the water. Geothermal plants, where the water comes from deep underground at high temperature, regularly measure salinities as high as 20% (sea water is about 3.5%).

Most shale gas plays occur at depths of around 10,000 feet. The famous Marcellus shale is often chosen to exemplify the problems with fracking because it is well-known, vast, and unusually shallow in places, but still about 5,000 feet to the top of the formation, with an average well depth of 6,300 feet.

Marcellus Shale

I've said that the graphic above is a lie, so it's reasonable to ask what happens if we correct it? I took the number of pixels from the “surface” to the bottom of the water well on the right, dramatically shown with a big yellow flame on top, and found it to be 90 pixels. The average depth of a domestic water well in Pennsylvania is 200 feet, or 4.4 feet per pixel. At this vertical scale, the picture becomes:


So as not to be accused of hypocrisy, here's what it looks like if we correct the aquifer depth and fracture tops to their worst-case values (1,000 feet and 4,500 feet, respectively):


So, now we have something a little more honest, but there's also the issue of the composition of the rock. With its choice of color, the graphic implies that the gas play and the aquifer are part of the same rock formation. I have little doubt that the color is chosen to be suggestive of sandstone, which is typical of the permeable rock found in both aquifers and oil reservoirs, but these aren't called shale gas plays for nothing, and, in this case, it isn't called the Marcellus shale for nothing, so let's add somewhat plausible Pennsylvania stratigraphy (I've changed the color of the gas shale from black to light bluish gray to retain easy visibility of other features, such as the completion; other colors are unchanged):


This final diagram couldn't honestly be described as “representative”, because it stretches the facts to within a hair's breadth of breaking-point, yet it still leaves an impermeable barrier totalling over a kilometer of rock in three facies between the worst-case fractures and the worst-case aquifer. At least this diagram bears some passing resemblance to the truth, but the original is outright


It is possible for groundwater contamination to occur at the surface, but fear of aquifer contamination from the completion, as depicted in the original graphic, is about as reasonable as the premise of Black Sheep.

The next installment of this series will demonstrate why another hobby-horse of anti-fracking hysteria — the composition of fracking fluid — holds no water (pun intended).

Thursday, August 7, 2014

On the Datatype of Matrix Indices

Computer science purists often try to convince me that size_t is the appropriate type for matrix and vector indices in C or C++. This is always asserted without further justification as if it were commonly accepted. When I say “a matrix index isn't the size of anything, so the burden of establishing that size_t is the ‘one true type’ for these indices lies with you”, I'm generally either insulted or berated, but a strong rational justification has yet to be presented.

My position is that any unsigned integral type is unsuitable for use as a general matrix or array index in computational science.  My argument is essentially a utilitarian one: that pragmatism should win over naïve pedantry.

The most succinct expression of my reasoning is that, from an algorithmic perspective, it is, in general, highly desirable that indices approximate a group under addition (as closely as we can with finite size), and that using any unsigned integer type unnecessarily deprives index variables of the ability to store the additive inverse.



The argument that, formally, matrix indices are natural numbers, {1, 2, 3, ...}, holds very little weight in this argument, since C and C++ already base arrays at zero. I maintain that the ultimate reason for this is the utility of having the additive identity, 0 (zero).

Matrix-oriented languages, like Fortran and Matlab, despite basing indices at 1, do not restrict the datatype of variables used as indices strictly to the set of natural numbers. That is to say that, in these languages that are specifically and explicitly matrix- and vector-oriented, provided that an index variable is a valid index when it is used as an index, the values that it takes at other points in a program are unconstrained. I would take some convincing that the exact opposite should be the case in C or C++, yet this is precisely the position that purists ridicule me for opposing. If you were to suggest to a Fortran or Matlab programmer that assigning zero or a negative number to an index variable at any point in a program should cause an error, I would expect them to be so puzzled by the sheer stupidity of it that they would have extreme difficulty articulating why this is a bad idea.

If unsigned indices were genuinely as good an idea as the pedants would have you believe, one might expect that in 57 years of Fortran and 30 years of Matlab, it would have been tried out and been such a great success that it would have caught on, but that is clearly not the case. Fortran, in fact, allows you to define the index range of arrays to accommodate negative indices. If this were something C-specific, one might expect that the C standard would incorporate this idea, yet it does not (§6.5.2.1 “Array subscripting” uses int) and x[-5] is perfectly valid.

The reality of doing computational linear algebra is that, although indices are non-negative integers, the arithmetic manipulation of indices in the course of executing an algorithm often, if not usually, involves not just subtraction, but negative numbers even if the eventual index computed is always non-negative. Consider, for example, the diagonal matrices formed from the stencils of finite difference methods. It would add nightmarish complexity to restrict the relative indices of the stencil to non-negative integers. What would a lower boundary check, now a trivial if(i<0) {... }, become if i were not allowed to be negative?

It might be argued that, in these cases, one “ought” to do these index computations with a signed type so as not to “pollute” the index type with negative numbers, but what exactly is the benefit of doing this? I mean, other than the smug self-satisfaction of being an über-pedant?

In practice, if you attempt to use an unsigned integer type for indices, but a signed type for index calculations, you have to add a lot of casts to silence warnings, and this quickly becomes so onerous that one either ends up either with ill-considered casts that may accidentally mask true errors, or such diligent consideration of whether a cast is truly correct that “cast contemplation” becomes a major, if not the dominant, contributor to development effort.

Again, the pedant might argue that you should have to consider these cases; that it is not a bad thing to have your development time doubled if that means it's correct. But is it “correct”? What does this “correctness” buy me? What are the actual benefits?

Well, the only one I've ever heard is this: “because size_t is the canonical type used to represent sizes in C, such as in calls to malloc(), size_t is the correct type for indexes because it guarantees that they can index any array returned by malloc() irrespective of the platform”. Really? That's it?

Leaving aside the fact that this is really an argument for choosing one of size_t and ssize_t, and I hope I've convinced you that ssize_t would be the better option, this “guarantee” is worthless, because flexibility in the representational range of a datatype used as a matrix index is, at best, useless.

The range of values that you need to use as a vector or matrix index isn't defined by what size objects you can malloc(), it's defined by the problem that you're trying to solve. So, there are actually only two scenarios that merit consideration:
  • size_t is big enough to represent all problem indices; and
  • size_t is too small to represent all problem indices.
In the former case, which is usual, choosing size_t over, say, int32_t doesn't matter, and in the latter case, you have an issue so major that, not only does it not help, but it probably exacerbates.

Suppose that the problem of interest is such that indices need to go up to 1,000,000. You develop a solution under a 32-bit memory model where size_t is 4 bytes. Going to a 64-bit memory model where size_t is 8 bytes is essentially trivial and presents no problem (no matter the choice of datatype for indices) other than doubling the memory requirement for indices, which is not a good thing. However, going to a platform where size_t is 2 bytes is going to be very difficult: you're going to have to do quite a bit of memory management and index segmentation and manipulation to be able to solve your problem under this constraint, and direct indexing is more-or-less off the table. If you have chosen size_t for your indices, you now also have to contend with having 2 bytes automatically hacked off all of them, even in places in your code where no array is indexed; in all likelihood, this is going to make solving the issue more difficult instead of less.

So the correct answer to the question “what datatype should I use for matrix indices” is a signed integer type that is sufficiently large to represent all anticipated indices. Moreover, the correct answer to the question “what datatype should I choose for problem X” is “whatever is required by problem X” and not something provided by the compiler or platform for some other purpose.

Thursday, June 5, 2014

The “Secret to Happiness” Isn't on LinkedIn

LinkedIn's machine learning algorithms have decided that I need to be emailed daily with vacuous deepities from every self-proclaimed “life coach” on their multi-million user site, when, in fact, I hold them in contempt and put them into two categories: charlatans and clowns.

The charlatans prey on the insecurities that about half of us share: we don't like our jobs, we wonder if we were “meant to do” something else, our marriages or relationships could be better, we procrastinate, we feel guilty, or trapped, or unhappy or all of the above. The “cure” to all your ills is their patent medicine, their “Secret of Happiness” and as surely as snake-oil comes in a bottle, it's always the same hackneyed aphorism: “work towards being able to “pursue your passion” as a job even if it means taking a small pay-cut”, swiftly followed by a liberal dose of loosely connected banalities.

Almost worse than the charlatans are the semi-literate deluded clowns, who — having, to all appearances, dropped out of school and never been within a bull's bellow of an introductory philosophy or psychology book — nevertheless believe they're in a position to hawk hokey cornball platitudes to the rest of us (in fairness, I don't know if this particular “coach” is a charlatan or a clown, but, either way, I wouldn't give you the gum off the back of a stamp for five hundred of her moth-eaten potboilers).

The reality is that happiness is amenable to scientific inquiry and can be studied empirically. There are legitimate “happiness researchers” in psychology, psychiatry, and neuroscience. Here's the upshot of what we know: happiness is approximately
  • 50% genetic,
  • 40% attitude, and
  • 10% all the shit people think it's about.
If you're wondering what the hell I'm talking about, then you may have lucked out in the genetic component and just be naturally predisposed toward happiness, as opposed to your less fortunate counterpart on the other side with dysthymia.

But the really important points here are twofold:
  • your “career”, relationships, finances, etc. basically don't matter a shit; and
  • you can learn to change your “attitude”.
So you're really happy with the promotion you got today? Won the lottery today? Feeling on top of the world? In 6 months, you'll be at about the same level of happiness that you were up to yesterday. Just lost your legs in a car accident? Feeling suicidal? In 6 months you'll be at about the same level of happiness that you were up to yesterday. We adjust.

Empirical evidence suggests that spending 15–30 minutes every day cultivating mindful awareness or practising CBT techniques will do more for your long-term happiness than any new job, spouse, or money, and certainly more than any vapid drivel peddled on LinkedIn.

Tuesday, October 29, 2013

Seanad Reform

In the wake of the failure of the constitutional referendum to abolish the upper house, or Seanad, in Ireland, many people are clamouring for Seanad reform to make it “more democratic” and “less élitist” — in other words, they seem to want the Seanad elected by the exact same procedure that has given us an incompetent shower of party-political asshats in the Dáil for as long as anyone can remember.


What would be the point of two parallel houses directly elected by general franchise? We need only look to Washington to see how well that works. And what's wrong with élitism anyway? It's not like we need more publicans in Leinster House and fewer professors, nor does the Seanad have any real power to subvert the intentions of the democratically and directly elected Dáil in any case.

There's little disagreement that reform of both houses of the Oireachtas is highly desirable, so how about this...

The general idea here is that ministerial portfolios should be fixed prior to a general election, and three seanadóirí, suitably qualified in subject-matter related to that portfolio, would be directly elected by general franchise to a corresponding 3-member “bench”. This would mean that every minister would be “shadowed” by 3, at least somewhat knowledgeable, senators. Their job would be to directly scrutinise the his/her legislative and executive actions. Any scope or mechanism for the government to make the seanadóirí rubber-stamping cronies, or redefine their roles or the roles of ministers, is eliminated. This is the germ of an idea; we can argue the details, but what follows in an outline of how I think this could work.

First, the status quo in Ireland in relation to ministerial portfolios would be abolished with extreme prejudice. The brain-dead state of affairs where the Minister for Agriculture and Fisheries today can be replaced with a Minister for Ice Cream tommorrow — is both staggeringly wasteful and subject to populism. I originally got my ham radio license in 1988 from the “Department of Tourism, Transport, and Communications”, I now get it from the “Department of Communications, Energy & Natural Resources”, with I don't know how many “different” bizarrely-named departments, redesigned logos and letterheads, and civil service reorganizations in between.

For my idea to work, we need some kind of consistent and static — or at least not easily changed — set of ministerial portfolios, fixing ministers' roles and corresponding government departments prior to a general election. I can think of no argument against this other than that it's different from the an existing “system” that has little or nothing to recommend it.

To support this up-front fixing of ministerio-departmental portfolios, amended constitutional provisions are required: either the portfolios must be explicitly enumerated, or any change must be encumbered by requiring a supermajority in both houses, or, even better, some combination. A workable solution might be to fix the size of the cabinet at 15, and stipulate that “there shall be ministries for finance, health, education, and basket-weaving, the names and areas of responsibility of the remaining 9 ministries to be decided by two-thirds majority of both Houses, no changes to take effect until after the following general election”. That immediately does away with the stupid and wasteful gerrymandering of portfolios every year or two.

Having decided the 13 portfolios before the election, the Seanad could be constituted, with its current 60 members, as follows:
  • 11 to be appointed by the Taoiseach, as is currently the case;
  • 10 to be elected by extending the university franchise to all university graduates, an increase of four; and
  • 39 to be elected by general franchise to 13 three-member “benches” (three seats is a bench, right?), each bench directly corresponding to a ministerial portfolio.
The following “qualification rule” shall apply:
  • Candidates for each bench must be formally qualified for that bench; and
  • No candidate shall be a current member of, funded by or on behalf of, nor run under the imprimatur or official endorsement of, any political party.
In addition, three “5 year rules” shall apply:
  • No person, having been a candidate in a non-Seanad political election in the preceding 5 years, may be a senator or a candidate for election or appointment to the Seanad — the “no has-beens” rule; and
  • No person, having been a senator in the last 5 years, may be a candidate in a non-Seanad political election — the “no wannabes” rule.
  • No person, having lost in a Seanad election, may be appointed to the Seanad by the Taoiseach for 5 years — the “no second bite at the cherry” rule.
Now, admittedly, the “formally qualified” rule is a bit tough to nail down — it's easy enough to expect candidates in the “Finance” bench to be accountants or economists, but it's harder to define for, say, “Education”; how would qualification for that be assessed? Is being a schoolteacher enough or would you have to have an Ed.D.? It's a problem, for sure, but not an insurmountable one.

Also, in this context, a “non-Seanad political election” means a general, local, or European election anywhere in Europe. Together, these two rules remove the “wannabes” — cronies appointed to raise their political profile in preparation for running in a general election for the Dáil — and “has-beens” — cronies who just lost their seat in the Dáil (or other political assembly). The extension to Europe as a whole prevents cross-border wannabes and has-beens from the UK Parliament or Northern Ireland Assembly. Although we lack the jurisdiction to prevent a former senator running for the Northern Ireland Assembly, we can disenfranchise and disbar him/her from ever voting or being a candidate in any future election in Ireland if he/she does, or subject him/her to fines or imprisonment.

How about that for accountability? Every minister has 3 senators on his/her ass, permanently. With no way to stack the deck with has-beens and wannabes, even with no increase in power, the new Seanad would raise the standard of political discourse, while being more democratic.

The chief objection I anticipate is that voting for 13 people is too complicated for the average dimwit or that counting the votes would be too time-consuming. Fine, then: let everyone vote for just one bench, or a few benches, of their choice. That way, everyone decides what's important to them, and few people are voting purely for the sake of it on benches they have no knowledge of or don't care about. This would be at least different from the party political voting pattern that characterizes Dáil elections. That doesn't seem like a bad thing to me at all, and having a different second house is the entire point of the bicameral system.

Footnote on the Irish Parliamentary System

In Ireland, the Oireachtas, consists of Uachtarán na hÉireann (President of Ireland), who is directly elected to this largely ceremonial and powerless position; the 60-seat Seanad (Senate), an indirectly elected “upper house” with no real power; and the 166-seat Dáil, (House of Representatives or National Assembly), which effectively holds all legislative and executive power. This power is wielded by a 15-member cabinet (comh-aireacht, a seldom-used word since it is almost never necessary to distinguish between the cabinet and the Government, or Rialtas), elected by the Dáil from amongst their membership, with a seldom-exercised constitutional provision to have up to two seanadóirí (senators).

Constitutionally and practically, the Seanad is almost entirely powerless, apart from a smattering of limited and never-used constitutional functions, such as the impeachment of a judge or the president. The Seanad can amend legislation, but the amendments are more like suggestions: they go back to the Dáil, and if the government of the day doesn't like the amendments, the bill can pass into law without Seanad support after 180 days or less, in the case of financial bills. At worst, the Seanad can delay non-financial legislation by about 9 months.

In practice, once a general election — in which members are elected to the Dáil by general franchise — is over, one of the two large parties (Fine Gael and Fianna Fáil), in conjunction with one of the smaller parties or a group of independents, will have a majority in the Dáil, which will “elect” the leaders of those parties to the cabinet, which is the new government. The leader of the largest party will be the new Taoiseach (Prime Minister), the leader of the second largest party (of the coalition making up the cabinet, not the Dáil overall) will be the Tánaiste (Deputy Prime Minister), and the cabinet positions — Ministers for Finance, Health, etc. — will be assigned to senior figures in the governing parties according to their relative strengths and the importance of the position. It is usual for the largest party to keep the Ministry for Finance for one of their own, for example.

The Taoiseach, once elected, then appoints 11 people to the Seanad. The original idea was that these would be trusted advisers and experts, but, in practice, they have always been political cronies: has-beens, who just lost their seat in the Dáil, and wannabes, who are hoping for a seat in the Dáil in the future and have been appointed to the Seanad to raise their public profile in preparation for the next general election.

The remaining 49 seanadóirí (senators) consist of 6 elected by graduates of certain Irish universities, and 43 elected from 5 so-called “vocational panels”, which consist of union, local government, and other representatives.

Tuesday, August 27, 2013

Installer Tips for Open Source Developers

So, I've recently had to install a lot of software from source. I used to do this a lot — back in the days when I was a Linux hobbyist and had nothing better to do — but in recent years, I have tended to just live with whatever versions of software libraries come with whatever Linux distro I happen to be using on a particular machine, usually the latest Ubuntu LTS (although I've used Slackware, Red Hat, SuSE, Mandriva, Yellow Dog, and CentOS in addition to Irix, Solaris, and FreeBSD).

One thing that hasn't changed one iota in (almost) twenty years is the utter cluelessness of niche developers when it comes to packaging their software, and it's driving me nuts. Just because your software isn't totally mainstream doesn't mean you can subject your (potential) users to an installation nightmare of manually editing Makefiles and making decisions about minutiae of configuration and installation.

The rules are very, very, simple indeed. Everyone who's ever installed anything from source knows the rules, so why the hell don't niche developers?

Here it is. The standard way of installing from source is

After I download a (well-behaved tarball), I expect to be able to do this:

    $ tar xzf foo-1.2.3.tar.gz
    $ cd foo-1.2.3
    $ ./configure
    $ make
    $ make test|check
    $ sudo make install

There are a small number of variations, of course, you can use 7zip or bzip2 instead of gzip, and so on. At a push, you can inflict CMake or SCons on me, but, frankly, I don't care how much of a pain in the hole the Autotools are (and, as a developer, I hate them), ideally you should use them because that's what your users expect, and they don't really care if it takes you a day of frustration to figure out. If that's significant in the context of your overall software development, it's probably not worth installing your software in the first place.

If you insist on inflicting your egotistical notions of how installation from source should work, the one thing you absolutely cannot do is ignore now well-established conventions about where stuff goes: absent any explicit instruction from me, you install your shit in the appropriate directories in /usr/local and nowhere else. I don't care that it's easier for you to just copy great gobs of shit into /opt/IAmSoImportant and leave all the painful configuration to me, and for the love of all that is good and right, if you install anything directly in /usr, interfering with the packaging system of my distro, I will hunt you down like a rabid dog and hammer a mechanical pencil into your eye with your detached and still-bleeding leg. I know it's hard to decide whether you should put your headers directly in /usr/local/include or in a subdirectory thereof, or your libraries in /usr/local/lib or in a subdirectory thereof, and it's often subtly debatable how “platform independent” that file really is, so whether it should go in /usr/local/share/foo or somewhere else is, in the end, a judgement call. I know. I sympathise. I really do. But if you can't decide, and you wrote the damn thing, how the hell do you expect me to?

In short, if you want your software to ever have the slightest chance of “catching on” and becoming popular, you can't just do the fun stuff, you have to suck it up, make a decision or two, and do the mundane and tedious stuff that makes installation easy for your users and packaging easy for distributions.

End of rant :o)