Genealogy of Morals and Civilization and Its Discontents — March 19, 2016

Genealogy of Morals and Civilization and Its Discontents

Basically by happenstance, I ended up reading first Freud’s Civilization and Its Discontents, then Nietzsche’s Genealogy of Morals. The coincidence was convenient, since Nietzsche so clearly influenced Freud. The most striking difference between the two is probably that Nietzsche’s book is inspiring, whereas Freud’s is completely bananas. I would start here with Freud, for instance:

It is as though primal man had the habit, when he came in contact with fire, of satisfying an infantile desire connected with it, by putting it out with a stream of his urine. The legends that we possess leave no doubt about the originally phallic view taken of tongues of flame as they shoot upwards. Putting out fire by micturating—a theme to which modern giants, Gulliver in Lilliput and Rabelais’ Gargantua, still hark back—was therefore a kind of sexual act with a male, an enjoyment of sexual potency in a homosexual competition. The first person to renounce this desire and spare the fire was able to carry it off with him and subdue it to his own use. By damping down the fire of his own sexual excitation, he had tamed the natural force of fire.

(Kindle Locations 649-654)

W…what?

I call this out because the book is actually fascinating and worth reading, and I’m inspired to read other books of Freud’s (maybe Beyond the Pleasure Principle?). The man is clearly influential, but this sort of thing is obviously bonkers to a modern reader. I reason that either this urine/fire idea makes perfect sense in context — in which case I want to read the context — or it was completely bonkers even at the time, in which case Freud’s influence over early-20th-century culture says fascinating things about that culture.

The story of this book is probably familiar to everyone. Society demands that certain human instincts — those toward violence and sexual conquest — be suppressed. This social control eventually becomes a part of the mind itself: the superego is essentially the voice of society, policing the ego from inside the mind. The superego is the seat of guilt and shame.

Nietzsche says very much the same thing, though without Freud’s sexual basis. What Freud calls a ‘superego’, Nietzsche calls ‘bad conscience’. Bad conscience is a creation of the strong, imposed on the weak. The strong construct a society from oceans of blood — hammering together the weak over centuries until a bad conscience forms within them and they police themselves.

Bad conscience — the ethical teaching of nearly all civilizations — is the resentment of the weak directed toward the strong. The strong demonstrate that what is prized in this world is power, domination, wealth, and selfishness; the weak resentfully reply with an ethical system that says what is truly good is universal brotherhood, poverty, and altruism. (Nietzsche says that, among others, the Jews invented this ethics of the weak.)

This story of Nietzsche’s is filled with far more love toward humanity than I would have guessed from how people usually talk about him. The Genealogy of Morals is an exuberant book that marvels at the grandness of life; it laments the cramped, impoverished ethics of the weak that conceals our vast humanity. We could be so much, says Nietzsche, if our ethics didn’t cause us to cower and trudge through life.

I can see where the “superman” comes out of this. The superman isn’t bound by the stultifying ethics of the weak. You can see how this could go in a positive direction and a negative one, and you can understand why the Nietzschean superman is mostly held in low esteem. Watch Hitchcock’s excellent movie Rope, for instance, based on the Leopold and Loeb murders. A thinker like Nietzsche is arguably responsible for the lessons that everyone, murderers included, takes from his work. But I could just as easily see the Nietzschean superman as a liberator — the man who sweeps across the modern world, freeing it from the shackles that bad conscience has imposed on it. The superman realizes that bad conscience (superego) is a tool of control imposed by the strong. The superman is living life more fully than we are. (Hard to tell whether Nietzsche views a Napoléon or a Genghis Khan as a superman.)

Read in the right way, all of this can in fact be inspiring. I don’t fully understand the jump from Nietzsche to Freud, which is why I need to read more of the latter. Among the methods of control that bad conscience imposes is sexual repression … but even here, I can’t quite see the leap. Somewhere Freud notes that there’s a conflict between the needs of society and the needs of the family; romantic love makes us turn inward, focusing only on our nearest and dearest, while society demands engagement with the broader world. So society channels our sexual desires into acceptable forms, like marriage (community-sanctioned sexual love). And the community’s need for cleanliness (to prevent disease, etc.) leads each of us to be obsessed with bathing and with the avoidance of feces; hence the Freudian “anal” stage of development. But Freud takes it as an obvious next step, somewhere in C&ID, that there is a stage of “anal erotism” — hence, I assume, our modern phrase “anal retentive,” to mean someone who never moves beyond the societally imposed stage of obsessing over feces and cleanliness. I assume he explains this argument more fully elsewhere; certainly all of the citations in Civilization and Its Discontents point (in the manner of all cranks) to other works by the same author, so I assume he goes into anal erotism more fully elsewhere.

Like I said, this is fascinating either because it’s well-argued, in which case the arguments themselves are fascinating; or because it’s not well-argued, in which case the society which adored Freud is fascinating.

I’m also interested in Freud for the same reason I’m interested in the 1950s: because I suspect that our stereotypes of his era are wildly overstated. We characterize the 50s as an era of repression and forcible consensus that exploded in the 60s, and we believe that Freudian neurosis is the natural result of Victorian repression. Both of these things could well be true; but it’s also completely possible that the 1950s were a period of creative flourishing that we only noticed in the next decade (see Halberstam’s The Fifties for this argument), and that Freud was a singular writer who would have dominated the thought of his era, whether or not that era was especially repressed.

Both Freud and Nietzsche are clearly strongly influenced by Darwin. The primitive man residing inside each of us is assumed to be brutal and sexually acquisitive. This particular view of man is quite widespread, and every sociopath you know likely defends all his (I use ‘his’ advisedly) retrograde gender-equity notions as the dictates of natural selection. It’s a limited, depressing view of man’s nature. Nowadays you can read academic refutations of this idea in, say, Robert Axelrod’s Evolution of Cooperation, which wonderful writers like Samuel Bowles turn into a theory of “homo reciprocans.” But these are rarefied discussions, and I suspect that most people believe in the nasty, brutish primitive man.

If early man was not as violent — with instincts that didn’t need to be as forcibly repressed — as Nietzsche and Freud make him out to be, then what becomes of their story? In Axelrod’s model, altruism can arise naturally whenever we expect to interact with someone repeatedly. What if Axelrod is right and Nietzsche is wrong? Then our kind attitudes toward our neighbors, and even toward strangers, are not the resentful constructs of a slave people; they are baked into primitive man. If early man wasn’t a sociopath, and didn’t need to be beaten into submission, then much of Genealogy of Morals would fall away. What would remain is an exuberant plea to live a passionate life, but much of the explanation for why we don’t already live that life would be hollowed out. I’ve not decided yet how much of Freud’s book would disappear, but that’s mostly because I (in a fascinated way) haven’t yet figured out what led him to many of his conclusions.

The next steps from here, I think, go in a couple directions. One is to work backwards, to Darwin, Herbert Spencer, and T.H. Huxley. The other is to dig more deeply into Freud, and maybe more into Nietzsche. Perhaps humorously, Freud’s arguments are so bananas that they’re inspiring me to read more of him. Is this how cranks and cult leaders get started? It’s much like the old definition of an optimist: the guy who comes to a room filled floor to ceiling with horse shit, and excitedly starts digging away with a shovel, on the theory that there must be a pony in there somewhere.

Preliminary questions before reading Robert Gordon — March 18, 2016

Preliminary questions before reading Robert Gordon

I was listening to the Freakonomics podcast episode about Robert Gordon on the walk home. A lot of people (including my beloved Weeds podcast) have been talking about Gordon’s new book on how American productivity has changed over the last hundred-plus years, and I’m probably going to read it soon; seems like the sort of thing I’d (and you’d?) be interested in. Also, it’s one of those books that a lot of people talk about but probably most people don’t read cover-to-cover, and I enjoy reading such books cover-to-cover out of spite.

A lot of the discussion is necessarily going to revolve around what you count and how you count it. I think I need to understand the National Income and Product Accounts, or at least brainstorm the problems with the NIPA, before I dig too much into Gordon. For instance, how does taking care of your own kids rather than hiring out childcare factor into the productivity measurements? My understanding (see 6.21 et seq. in System of National Accounts 1993 for a very succinct explanation) is that most domestic production is not counted. So if I employ a nanny to take care of my kid, that’s going to count as income for the nanny and an expense for me; if I instead choose to stay home and take care of my own kid rather than work, I am subtracting from GDP. I wonder how much GDP we added from 1945 to 1990, say, just by women shifting from home to the office. That much GDP is arguably artificial, in the sense that we should have been counting their work at home as well.

(If I buy my home rather than rent it, the BEA counts what they call “owner’s equivalent rent of primary residence”. Why don’t they likewise count “mother’s equivalent sale of child-care services”?)

Likewise, consider Nordhaus’s history of lighting efficiency. Consider, specifically, the chart on page 11, registering a 30,000-fold increase in the efficiency of lighting from the beginning of recorded history to the advent of the compact fluorescent light bulb. Is it possible that we’re just under-counting productivity increases?

Or consider the humble shipping container (my review; Krugman’s hat tip). Where exactly does it show up in the productivity numbers? I assume/hope the BEA is counting an abstract cost of “shipping services”: the cost to ship the same quantity of the same goods from point A to point B; that cost has gone down, so the productivity of “shipping services” has gone up.

How about public health? As people stopped smoking and lung-cancer deaths decreased (see page 2), how did that show up in the GDP numbers? We lost some money from the unsold cigarettes, and we lost the money that we would have spent in hospitals. Yet clearly we’re better off than we were. Hopefully that shows up in GDP. Or, to take another public-health number: does water delivered to your tap from a tax-funded municipal water system count for less than water you buy in the store?

These public-health questions point to the broader question: what is the point of economic growth? Isn’t the point of economic growth that it makes us happier, healthier, and longer-living? Are we measuring that? To the extent that economic growth is connected to what matters, we should care about it; but otherwise, maybe we needn’t.

I think most of the usual argument for economic growth is that a rising tide lifts all boats, or a larger pie leaves more pie for everyone, or some such metaphor. But what if insufficiently small pies are not the problem? What if the problem is that we’re not getting pies to the right people? That is, what about distribution rather than growth? And what sort of improvements to the human standard of living could come about without anyone needing to spend another dime? What if we managed to get every last cigarette smoker to quit? What if we ended automobile deaths? We needn’t necessarily develop technological solutions to the problems of cigarette smoking and car crashes; we might be able to solve them without adding a dime to the GDP.

To be clear, I’m not suggesting that the GDP numbers are mismeasuring things. But I think these are the sorts of questions with which one should approach a book like Gordon’s: are they measuring the world correctly? And even if they are, should I care? Will increasing GDP per capita halt the rise in death rates among non-Hispanic whites? (The rise is seemingly driven by women in the South.) These are the sort of questions that I’ll have in the back of my head as I read Gordon.

Fake legitimation — March 17, 2016

Fake legitimation

I’ve had some miscellaneous thoughts about political legitimacy rattling around in my head lately. Nothing coherent enough to set down here, apart from a vague bleg to my readers to point me in the right direction.

At the most basic level, my question is why Stalin ever bothered with show trials. Why even bother with the pretense that this person is confessing, if no one is fooled into thinking that he did it of his own free will? If everyone is aware that his confession was elicited under torture, what’s the point?

Am I misunderstanding the point of the torture, or of the confession? It seems like modern democratic (small-d) society has created a need for at least the appearance of formal legitimacy — the appearance of the rule of law without the actual rule of law. But why? Why can’t totalitarian states just ‘disappear’ their enemies?

Oddly, the nomination of Merrick Garland to take the late Justice Scalia’s seat is reminding me of this. Everyone, I think, acknowledges that “we can’t confirm a nominee in the last year of a presidency” is a garbage reason. It’s fake legitimacy. But why even bother with the simulacrum? Why not just come out and say the truth? The truth is that they hope the next president is a Republican, and they’re willing to wait for Obama to leave.

Of course that question, such as it was, answers itself: no one could be this nakedly cynical in modern democratic America. We need to go through the kabuki theatre of legitimacy.

When Soviet political prisoners confessed under torture, hours before their execution, were there earnest quasi-debates about the honesty of the confession? That is, were there in fact some people who were fooled? Or is this all a grand, depressing, society-wide exercise in motivated reasoning, where the answer (Yuri will be hanged after a fair trial) comes first and the reasoning (he was a traitor to the state who confessed his sins) is enlisted to justify it?

So that’s my first question: is there a term for this fake legitimacy? Is there a term for the change in a political system that requires fake legitimacy?

My second question comes from having just listened to the English Civil War season of the Revolutions podcast (which I’d recommend in the strongest terms). At one point Charles I was compelled to summon 12 lords of the realm (maybe this was the Great Council) to pay for his army. My question is just: what compels him to summon it? What compels a king to do anything, basically? Why can’t the king just act arbitrarily?

The obvious answer is: because Parliament (or the landed aristocracy, or whoever) has its own independent source of strength. The king can’t force them to do anything, because they have guns as well.

My question is: how stable is this equilibrium? The short, simple answer would seem to be: “So long as the Parliament has its own independent source of power, the equilibrium is stable.” How, then, do you build institutions such that it’s a stable equilibrium? How do you guarantee that Parliament remains on roughly equal footing with the king?

The answer might be entirely boring and straightforward: Parliament remains on roughly equal footing with the king so long as people believe it’s so. When legitimacy goes away, it goes away quickly. The only thing, perhaps, keeping the U.S. military from turning its guns on Congress is legitimacy that’s baked very deeply into our society, but there’s no reason that legitimacy has to last forever.

No real conclusions from this. I think I just want to read more about legitimacy in democratic states, as a starting point.

Walter Bagehot, Lombard Street: A Description of the Money Market — March 6, 2016

Walter Bagehot, Lombard Street: A Description of the Money Market

This is, in my limited view, the classic introduction to what central banks do. Bagehot writes just after the Franco-Prussian War, when London has become the world’s sole financial center after Paris lost that role (and lost the war). Hence English banks are now not only responsible for keeping enough money on hand to meet domestic depositors’ needs; they’re responsible for converting other currencies to gold when foreign bankers demand it. British banking has just turned a corner, and Bagehot is trying to understand how the Bank of England should respond.

Lombard Street is maybe one-third a basic explanation of how banks work. Depositors put their money in the bank; the bank then turns around and lends out some fraction of the deposit. If all depositors then turned around and demanded all their money at the same time, banks would be unable to provide it. Normally this isn’t a problem, since normally all depositors aren’t demanding their money. But “normally” isn’t the adjective you want to be using with a banking system; you need to know that banks will be able to survive during a panic.

Panics might start when someone starts to question a major financial institution’s ability to honor its obligations; let’s call this institution “A” (or we could call it “Lehman”). Suppose bank B does a lot of business with A, and C does a lot of business with B. C knows that B gets its money from A, and C fears that A is on the verge of collapse. Hence C demands that B repay the debts that B owes to C. Now B has to find a way to come up with cash. In order to come up with cash, B calls in the debts that A owes to B. This happens on a wide enough scale; now everyone is demanding cash from everyone else.

Where does this cash come from? Let’s look, for instance, at what happens when B repays C. Maybe C owns some bonds that B has issued. C now demands the most liquid security there is (cash) in exchange for a somewhat less liquid security (bonds). Under normal circumstances, those bonds would be safe beyond question. In a panic, no one will buy those bonds, because everyone is simultaneously looking for liquid securities; today we call this the flight to liquidity. “Highly liquid securities” is a fancy term that just means “something which can always be sold, no matter what.” Cash will always be exchangeable for goods and services, even when bonds are not.

Central banks “create liquidity.” As we mentioned above, (non-central) banks never have as much cash on hand as their books say they do; so if everyone is panicking, and rushing to get their hands on cash, it’s quite likely that their banks won’t be able to help them. It’s in cases like this that central banks are “banks of last resort”: when no one else will provide cash, they will. A smaller bank (think Citibank, for instance) sells the Federal Reserve some security which under ordinary circumstances could be turned into cash without hesitation; the Fed hands bank cash. As Bagehot put it in the 1870s, quoting a Mr. Harman:

We lent it … by every possible means and in modes we had never adopted before; we took in stock on security, we purchased Exchequer bills, we made advances on Exchequer bills, we not only discounted outright, but we made advances on the deposit of bills of exchange to an immense amount, in short, by every possible means consistent with the safety of the Bank, and we were not on some occasions over-nice. Seeing the dreadful state in which the public were, we rendered every assistance in our power.

Bagehot adds, “After a day or two of this treatment, the entire panic subsided, and the ‘City’ was quite calm.”

As Bagehot describes it, a central bank should buy during a panic any assets that it would buy under ordinary circumstances. If the central bank refuses to buy some normally-safe asset, the rumor will spread rapidly that the market is illiquid, and then the panic will go into overdrive. A central bank, unlike a commercial enterprise, is supposed to be immortal; hence a central bank should be able to take a longer view — the central bank sees that a panic will subside in a few months, and that those assets can be sold back at non-fire-sale prices when the panic is over. (For a recent illustration, see TARP.)

This is still, if I understand correctly, the basic outline of how central banks work: during panics, central banks provide liquidity when no one else will. But are there limits to that liquidity? That is, does the central bank have unlimited power to create liquidity, or are its hands tied? During Bagehot’s time, the Bank of England’s power was strictly limited: one desk, called the Issue Department, issued currency, while another, called the Banking Department, held reserves. When a panic happened, banks would draw on the central bank’s reserves; those reserves could, in principle, run out, at which point liquidity would be at an end. When reserves ran out, the Issue Department could not print new currency to meet the demand for liquidity. This structure came out of the Bank Charter Act of 1844. As J.K. Galbraith put it in his magnificent Money: Whence It Came, Where It Went — which really ought to be viewed as a 20th-century updating of Bagehot’s book —

In 1844, after an intense discussion of the respective roles of currency and banking in monetary management, Sir Robert Peel put the Bank firmly in a straitjacket — what Walter Bagehot, thirty years later, was to call the “cast-iron” system. The Bank Charter Act of that year fixed the note issue of the Bank of England at £14 million. This amount was to be secured by government bonds. Beyond that, more notes could be issued only as there was gold and silver (no more than one-fourth the latter) in the vault. The cast-iron system was much too rigorous for another of the previously mentioned functions that the Bank was by now acquiring — that of supplying funds when people came in distressing numbers for their deposits in the lesser banks. This fault was remedied by suspending the law whenever it proved unduly inconvenient.

My naïve take is a simple supply-and-demand story: there’s a demand for cash which spikes during panics, and there’s a supply of cash in the world that’s available to meet that demand. If the demand exceeds the supply, there are two ways to handle that problem: either increase the supply, or reduce the demand. The way to reduce the demand is to increase interest rates; that is, if I come to the Federal Reserve pleading with them to give me cash in exchange for my bonds, they can agree to give me cash, but only via a short-term loan for which they charge me a high rate of interest. This is meant, Bagehot says, to ensure that the central bank truly is a lender of last resort — that borrowers come to the central bank only during periods of real panic.

Alternatively, they could increase the supply of cash by printing money. But as Bagehot and Galbraith explain, increasing supply was not one of the Bank’s powers: there was a fixed amount of money, and going beyond that limit was forbidden.

There really is nothing magical about how central banks work. When they need to “create money,” they do it by buying securities (usually highly safe assets like corporate or government bonds, though — again, see TARP — not always). It’s a simple sale: bonds (or mortgage-backed securities, or whatever) disappear from the market, and cash goes into the market. During ordinary times, people trust one another, so they don’t demand liquidity; hence you’d expect that during ordinary times, society is relatively more indebted than during panics — party A is more willing to loan money to party B, and therefore A is more willing to hold security from party B than A would be during times of panic. When the amount of trust in the economy is higher, the central bank can withdraw cash from the market because, again, demand for cash is lower than the supply. The central bank’s job is to match demand for liquidity with the supply of cash. Modern banks, unlike in Bagehot’s time, can “print money” to achieve this goal.

One alternative that really leapt out at me when reading Bagehot was simply: why not forbid banks from loaning out depositors’ money? I put $100 in the bank, and then … there’s $100 in the bank. As opposed to today, when some fraction of that $100 will immediately be lent out to someone else. I’ve not thought through all the consequences here, so maybe this is an absurd idea; but my understanding is that this was part of the Chicago Plan during the Great Depression. If panics come about because people aren’t sure that their money will be in the bank when they come to ask for it; and if, in response, we set up a “lender of last resort” infrastructure; well then, why don’t we just make it a certainty that people’s money will be in the bank when they come to ask for it?

This gets to another principle of banking systems, which in the United States is made flesh in the form of the FDIC: if everyone knows that their money will be in the bank, then the panic will never even get started. We no longer have bank runs, because if your bank goes out of business, the government will make your account whole (up to $250,000).

But the FDIC has its problems, as does any system of insurance on anything. It’s called “moral hazard”, and it’s a quite general principle: if you know you’re insured, you’re more likely to do the thing that insurance protects you from. The way the system works today is, in short, that the government will backstop your bank, in exchange for which the bank submits to regulation. The regulation ensures that deposit insurance will never need to be used. The bank gets a guarantee that bank runs will never happen; if they do happen, the government will make them whole; and in exchange, the bank agrees to behave responsibly. That’s the theory, but read about the FDIC’s role in the savings-and-loan crisis.

So again … wouldn’t it be easier just to prevent bank runs by preventing banks from lending? This would require a massive reorientation of American society, away from credit and away from an emphasis on growth, and the topic is probably far too large to consider here. But it does seem like a natural option to consider, and it surprises me that Bagehot didn’t even mention a word about it. It’s particularly surprising, given that Bagehot didn’t even have deposit insurance in his time: banking panics happened every few years. At least today, we can shrug and reject the Chicago Plan because we have the FDIC; what was Bagehot’s excuse? Panics were, I suppose, just considered an unavoidable part of nature. Bagehot also seemed to take it as given that the Bank of England would be a profit-making enterprise, and that it was required to return a dividend to its stockholders. A Bank of England which never had to lend during panics would be forced to charge lower rates of interest, and hence would return less to its owners. Seems wise that the Bank eventually was nationalized.

There are questions here which, to me, quite difficult. If the central bank can satisfy an unlimited demand for liquidity by “printing money” (i.e., buying bonds in unlimited quantities), and if modern central banks are — by design — somewhat insulated from the political process, then isn’t there a risk that the bank will print too much money? Again, that’s a much larger topic that I can’t get into here (and about which I have no expertise). I could gesture vaguely in the direction of “the central bank’s interest in securing its reputation,” and that’s probably the truth. But it requires more discussion.

Today we’re in the era of “shadow banking”. That is, the problem now isn’t panics in ordinary depository institutions; the problem is panics in hedge funds, investment banks, and so forth. We have the FDIC to protect our deposits, but there’s still a risk of systemic collapse when trust between investment banks disappears. Even if you were to separate, let’s say, Bank of America’s investment functions from its depository functions — the 21st-Century Glass-Steagall Act that Bernie Sanders, Elizabeth Warren, and others support — it does seem like you’d still have the problem of shadow banks collapsing. I need to understand this problem more deeply; in particular, I need to understand why shadow banks have suddenly become such a problem. Weren’t there always non-depository financial institutions?

It’s good to read Bagehot to understand that the more things change, the more they stay the same. At the same time, I’d like to see an update to Bagehot’s book, to explain how certain things really have changed, and what to do about it.

I would like to commend another stellar piece of Richard Posner’s writing to you — March 5, 2016

I would like to commend another stellar piece of Richard Posner’s writing to you

…while at the same time I would like to lament the legal profession’s continuing habit of using barbarous citation practices.

The evidence of benefits that was presented to the Texas legislature and discussed by the Fifth Circuit was weak; in our case it’s nonexistent. The principal witness for the State of Wisconsin, Dr. Thorp, mentioned earlier, testified that the death rate for women who undergo abortions is the same as for other pregnant women. But he could not substantiate that proposition and admitted that both rates are very low. His expert report states that there are “increased risks of death for women electing [abortion] compared to childbirth,” but the studies he cited measured long-term mortality rates rather than death resulting from an abortion, and also failed to control for socioeconomic status, marital status, or a variety of other factors relevant to longevity. See David Reardon & Priscilla Coleman, “Short and Long Term Mortality Rates Associated with First Pregnancy Outcome: Population Register Based Study for Denmark 1980–2004,” 18 Medical Science Monitor PH71, PH75 (2012); Coleman et al., “Reproductive History Patterns and Long-Term Mortality Rates: A Danish, Population-Based Record Linkage Study,” 23 European J. Public Health 569, 569, 573 (2012). In contrast, the plaintiffs’ expert Dr. Laube tendered a more apt study which concluded that the risk of death associated with childbirth is 14 times higher than that associated with abortion. See Elizabeth G. Raymond & David A. Grimes, “The Comparative Safety of Legal Induced Abortion and Childbirth in the United States,” 119 Obstetrics & Gynecology 215 (Feb. 2012)

Emphasis mine, to call out just how much of the paragraph is taken over with inline cites. Who are the legal monsters who came up with this style? Have they never heard of footnotes?

Anyway, the passage is from Planned Parenthood of Wisconsin v. Schmiel. As with all of Posner’s work that I’ve read (and by now I’ve read quite a lot), the arguments are concise, to the point, and at times relentlessly cutting in the most intellectually rigorous style. I would call your attention in particular to his decision in a Wisconsin gay-marriage case, or to his review of Scalia’s judicial philosophy.

I found this latest Posner decision, by the way, when Dahlia Lithwick offhandedly quoted Justice Breyer mentioning Posner, in Lithwick’s hilarious piece on the Supreme Court TRAP-law case. You should be listening to Lithwick’s Amicus podcast.

Finally, I would be remiss if I didn’t mention Katha Pollitt’s book Pro. It convinced me that when I thought I was being judicious and moderate in feeling discomfort about abortion, I was really just unknowingly subscribing to Republican brainwashing.

Matt Taibbi on Trump — February 26, 2016
Annals of not publishing blog posts fast enough — February 13, 2016

Annals of not publishing blog posts fast enough

I’ve been updating the code underlying the Supreme Court death calculator, with an emphasis on greater mathematical precision and increased code elegance. Meanwhile, Justice Scalia has died.

For the record, I would not have predicted this. If you look at the CDC life tables, and scroll to page 35 (“Table 14. Life table for non-Hispanic white males: United States, 2010”), then scroll a little further down, you’ll see that, of 100,000 non-Hispanic white males born in the United States, 53,857 will survive to their 79th birthday. Justice Scalia would have been 84.9 years old on Inauguration Day, 2021. Of those 53,857 who make it to their 79th birthday, 38,053 are still alive on their 84th birthdays; 34,567 are alive on their 85th. So if you count 84.9 as “84 years old”, he had a 29% chance of dying before the 2021 inauguration. If you count it as 85, the number rises to 35%. If you interpolate between those two probabilities, you get (duh) a number between 29% and 35%. So I would not have bet money on his death.

The probability of one or more Justices’ dying, independently, between now and Inauguration Day 2021 was in the 85+% range. The expected number of Justices who’d die was around 1.7. I’ll have to re-run the numbers now with only 8 Justices.

SQL WITH-statement versus CREATE VIEW: have I been doing it all wrong? — February 9, 2016

SQL WITH-statement versus CREATE VIEW: have I been doing it all wrong?

Today I learned about the SQL WITH-statement. I’d been using CREATE VIEW whenever I needed to join a complex query to itself; have I been doing it all wrong all these years?

If nothing else, WITH is a lot more concise than what I had been doing, which was CREATE OR REPLACE TEMPORARY VIEW. Are there arguments for the one versus the other, apart from concision?

P.S.: I’m told — haven’t confirmed — that if you join a table A to itself using the WITH-statement, then A will be materialized just once, whereas it will be materialized twice under CREATE VIEW.

Querying Oracle databases from cx_Oracle under El Capitan — January 31, 2016

Querying Oracle databases from cx_Oracle under El Capitan

The following is my attempt to document a remarkably painful process that got even more remarkably painful under El Capitan than it was under earlier versions of Mac OS. It concerns querying an Oracle database from within a Python script via the cx_Oracle library. If you don’t query Oracle databases from Python scripts via the cx_Oracle library, you are hereby advised to do literally anything else.

The general process of the steps below is:

  1. Get Oracle Instant Client (aka sqlplus) running. This does a couple things. First, it lets you confirm that you can run Oracle queries at all, outside of Python. Second, it installs some libraries and executables that cx_Oracle uses.
  2. Muck around in the libraries that sqlplus installed, to change internal references from /ade/... to @loader_path/....
  3. Install cx_Oracle.
  4. Muck around in the cx_Oracle shared-object (.so) files to change their internal references from relative paths to absolute ones.

Here goes, start to finish:

  1. Download Oracle Instant Client. You want to download “Instant Client Package – Basic”, “Instant Client Package – JDBC Supplement”, “Instant Client Package – SQL*Plus”, “Instant Client Package – SDK”, and “Instant Client Package – WRC: Workload Replay Client”, because why download one file when you can download five? Additional notes about downloading these files:
    1. You need to accept the license-agreement radio button at the top of the page first.
    2. You likely want the 64-bit files, unless your machine is ancient.
    3. You need to log in to download these files, which means you need to create an Oracle login first. Because why make downloading easy when you can make it annoying?
  2. Unzip all the files you just downloaded. For the purposes of this exercise, I assume you downloaded these files to ${HOME}/Downloads.
    mkdir oracle
    cp *.zip !$
    for i in *.zip; do unzip $i; done
  3. Make a system-level directory that will house sqlplus. Since El Cap, you can’t touch anything under /usr, so you’ll want to put it in /usr/local or /opt. For reasons that now elude me, I put it in /opt/oracle.
  4. Change the ownership on /opt/oracle so that you, rather than root, own all the files therein.
    cp -r ~/Downloads/oracle/instantclient_11_2 /opt/oracle
    sudo chown -R $(whoami): !$

  5. In pre-El Cap versions of OS X, you’d set the ${DYLD_LIBRARY_PATH} environment variable to point to where your libraries lived. In the sqlplus case, you’d add /directory/where/sqplus/lives to ${DYLD_LIBRARY_PATH} by adding a line like

    export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/directory/where/sqplus/lives

    to your ~/.bashrc file.

    El Cap seems to have changed the treatment of DYLD_LIBRARY_PATH as part of System Integrity Protection. Maybe DYLD_LIBRARY_PATH stops working? That’s a problem, because all the pre-El Cap steps to configure cx_Oracle that you’ll find on the Internet involve setting that DYLD_LIBRARY_PATH to override the library paths inside the sqlplus executable. The library paths that sqlplus comes with are all absolute paths that seem to refer to Oracle’s own internal build system — like so:

    (16:40 -0500) slaniel@work_laptop:/opt/oracle/instantclient_11_2$ otool -L sqlplus
    sqlplus:
    /ade/dosulliv_sqlplus_mac/oracle/sqlplus/lib/libsqlplus.dylib (compatibility version 0.0.0, current version 0.0.0)
    /ade/b/2475221476/oracle/rdbms/lib/libclntsh.dylib.11.1 (compatibility version 0.0.0, current version 0.0.0)
    /ade/b/2475221476/oracle/ldap/lib/libnnz11.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

    All those need to change to use the path to your sqlplus install.

  6. So if the $DYLD_LIBRARY_PATH option is out, one option is to muck around in the binary and change the library paths from /ade/... to some sort of variable that means “whatever path the executable is in”. Various places on the web suggested using @executable_path as that variable, but — again — that seems to work only under pre-El Cap versions of OS X. Now you need to use @loader_path instead (for reasons that I’ve not bothered to investigate). The method is like so:

    (16:43 -0500) slaniel@work_laptop:/opt/oracle/instantclient_11_2$ sudo install_name_tool -change /ade/dosulliv_sqlplus_mac/oracle/sqlplus/lib/libsqlplus.dylib @loader_path/libsqlplus.dylib sqlplus
    (16:43 -0500) slaniel@work_laptop:/opt/oracle/instantclient_11_2$ otool -L !$
    otool -L sqlplus
    sqlplus:
    @loader_path/libsqlplus.dylib (compatibility version 0.0.0, current version 0.0.0)
    /ade/b/2475221476/oracle/rdbms/lib/libclntsh.dylib.11.1 (compatibility version 0.0.0, current version 0.0.0)
    /ade/b/2475221476/oracle/ldap/lib/libnnz11.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

    Note that the linked library is now @loader_path/.... Repeat this for all of the Oracle Instant Client files, and for all of the libraries linked within them. There’s a tool that does this. We end up, e.g., with

(16:45 -0500) slaniel@work_laptop:/opt/oracle/instantclient_11_2$ otool -L sqlplus
sqlplus:
    @loader_path/libsqlplus.dylib (compatibility version 0.0.0, current version 0.0.0)
    @loader_path/libclntsh.dylib.11.1 (compatibility version 0.0.0, current version 0.0.0)
    @loader_path/libnnz11.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

Okay, so we fix up all the libraries. On my end, this allowed me to get a sqlplus console and connect to our Oracle server. Nice.

Next up: make the Python cx_Oracle library work with it. First, you need to create a couple of symlinks:

(16:49 -0500) slaniel@work_laptop:/opt/oracle/instantclient_11_2$ sudo ln -s libclntsh.dylib{.11.1,}
(16:50 -0500) slaniel@work_laptop:/opt/oracle/instantclient_11_2$ sudo ln -s libocci.dylib{.11.1,}

The reason here is apparently that cx_Oracle is trying to link in those libraries without referencing their version numbers; if you try to install cx_Oracle without those symlinks, you’ll get make(1) puke that contains this telling line:

    ld: library not found for -lclntsh

So you create the symlinks, then you do your classic pip install cx_oracle. Various places on the web suggested, more fully,

pip install --no-cache-dir --allow-external --allow-unverified cx_oracle

, and by this point I was past the point of arguing. That command worked, though it did warn me that --allow-external was deprecated and would eventually stop working.

Sure it’s installed, but that doesn’t mean it’ll actually work. The cx_Oracle.so file now links to libclntsh.dylib.11.1 — a relative path with no /path/to/libraries/... prefix. You need to find the .egg file that Python actually loads when you do import cx_Oracle; in my case, that path is /Library/Python/2.7/site-packages/cx_Oracle-5.2.1-py2.7-macosx-10.11-intel.egg . That’s just a zip file, so

  1. copy it to some new empty directory under ${HOME}
  2. unzip it
  3. change the .so path from relative to absolute, via
    install_name_tool -change {,/opt/oracle/instantclient_11_2/}libclntsh.dylib.11.1 ./cx_Oracle.so
  4. zip the directory back up into the .egg file and copy it from your ${HOME} subdirectory back into the global library path:
sudo mv cx_Oracle-5.2.1-py2.7-macosx-10.11-intel.egg /Library/Python/2.7/site-packages/cx_Oracle-5.2.1-py2.7-macosx-10.11-intel.egg
  1. Does it work?
(17:19 -0500) slaniel@work_laptop:~$ python -c 'import cx_Oracle' && echo 'worked'
worked

Yes! It worked! (Contrast with what happens if you try ‘import cx_Oracl’ with no trailing ‘e’.)

And finally — finally — I can run queries against

LazyWeb request for a Time Magazine article — January 3, 2016