Start gVim with Tab Pages or Windows

I’ve recently started using gVim more when I work with text files, and it makes me sad that I ever quit using it.  I’ll write more about why I think Vim is awesome in another post; this is another “It took me a few minutes to find this so I hope I help someone else” post.

If you want to start gVim with tabs, the command-line switch is -p[n]. If you don’t specify n, the default is "1 tab per file you specify". If you specify n < w files, the files that don’t have tabs will be opened as buffers (see :help buffers for that; it’s a good topic for another post.) I’m not sure what happens for n > files; I assume it opens n tabs.

If you want to start gVim with windows, the command-line switch is -o[n]. It behaves like the tabs command-line switch.

For those that prefer examples (I know I do!):

gvim foo.txt bar.txt baz.txt
gVim opens with foo.txt in the primary buffer and the other files in other buffers.
gvim -p foo.txt bar.txt baz.txt
gVim opens with 3 tabs, one tab for each file.
gvim -p2 foo.txt bar.txt baz.txt
gVim opens with 2 tabs. foo.txt and bar.txt are in tabs, baz.txt is in a buffer.
gvim -o foo.txt bar.txt baz.txt
gVim opens with 3 windows, split who knows how.

The rest of the cases seem trivial to understand with these explanations.

Is it right to drill so close inland?

Yesterday I asked this question and left it unanswered because I didn’t want to rush.  I’ve spent a little time thinking about it and I know what I want to say.

First, a disclosure.  The oil industry has been very good to my family for generations.  I don’t know exactly what my great-grandfather did for his company but I know he was high in the org chart and supervised some things internationally.  My father has worked for the same company for all of my 26 years, possibly longer.  It’s not one of the big oil companies, but it’s still a large one that works internationally.  So it’s possible that I have a slightly biased view of the oil industry; it fed me for decades.

One can definitely argue that it is ethically irresponsible to put populated areas at risk, but that assumes that the risk of a blowout and irreversible failure of a rig is something calculated to be frequent.  When’s the last time this happened?  I found an oil rig disaster site that seems to do a good job of sorting it out.  If you choose “blowouts”, we’ll be doing an apples-to-apples comparison.  The worst blowout (not counting the current one) leaked 3.5 million barrels of oil in 1979; it took 9 months to cap.  It seems this is the most comparable to the current situation; the rest leaked less than 100,000 barrels and were capped within 2 weeks.  There are other notable blowouts on the page but no figures for leaks are given; it seems that most of these killed people but were capped quickly enough to make the leak negligible.  Based on these figures, we can see that there hasn’t been a blowout of this magnitude for 30 years.  I won’t try to derive the odds of one of these blowouts happening, but it seems minuscule and conversation with my father seems to agree with this.

One may argue that any risk of such a disaster is enough to avoid drilling close to shore; it’s a fair argument.  I’m not sure how economically feasible this is.  Part of why we aggressively drill is because the country consumes oil at an alarming rate.  I found a chart showing average commutes per state from a 2007 US Department of Transportation survey.  The mean travel time to work in the US is 25.3 minutes.  76.1 of America drives alone to work.  Here’s a fuel economy table.  The average fuel efficiency has been consistently near 22 MPG for 20 years, while maximum fuel economy has been slowly increasing beyond 30 MPG.   That’s an awful lot of waste, and you can see a very long lag between the current year model’s average fuel efficiency vs. the nation’s average; that’s a lot of waste.  And that’s just cars.  How many of us run air conditioning too much?  How many of us don’t have solar panels on our roof?  How many of us run 2 or more TVs in the house on the same channel?  I’ve got 12 entertainment-related devices plugged into the wall at all times, how many does the average American have? How many of us run the heater too much in the winter?  We’re developing electric cars, but the electricity can come from oil-fueled power plants; we just shift how the oil is used in this case.

What I’m getting at is we can’t just shut off offshore drilling and adjust to more expensive oil.  Entire suburbs cannot relocate closer to cities without decades of work towards providing affordable housing within the cities.  Public transportation has enough trouble making money without having to serve everyone in a 30 mile radius.  Will America cooperate with cutting their electricity usage by a drastic percentage like 25%?  Will homeowners pay upwards of $10,000 per home to install solar panels en masse?  Will we spend billions and wait decades for nuclear to trade risk of oil disaster for risk of radioactive disaster*?

If we decide that offshore drilling near land is unethical, America will have to dramatically alter a lifestyle that has been lived since the 50s.  It’s not something we can do quickly, either.  Most of the changes we’d need to make require at least a decade of work and funding we’re currently spending to set buildings and people on fire in other countries.  I see a growing sentiment for the nation to become “green”, but as is typical most people only want to be as green as they can get without giving up any luxuries.  We’re going to have to give up a lot of them to end offshore drilling.  Until then, we’ll continue to look the other way and hope rigs don’t fail.  We do this for a lot of issues, and it’s a shame.

* Radioactive disaster is probably at most as likely as a spill of this magnitude.  Wikipedia’s list of nuclear disasters shows that Three Mile Island in 1979 was the last failure that resulted in anything more dangerous than “required maintenance to repair damage”**.  By that measure, I suppose you could call nuclear safer.  Anything I say to disagree felt like I was being biased, so I won’t comment further.

** For this post I’m not going to consider international nuclear disasters, since a disaster in another country isn’t likely to have as large an impact on America. Chernobyl was in 1986; there was so much human error and borderline incompetence related to this disaster I’m not sure it counts.  I’ve heard that the reactor design was inherently unsafe as well, and a modern reactor wouldn’t be at risk for the same disaster.  I’m not a nuclear engineer, so I cannot verify.

The Gulf Oil Spill

What a fine mess.  I’m mostly uninformed about the spill because the only source of news I really follow is “people talking on Twitter”.  I got a little angry about what some people were saying the other day and @hotgazpacho called me out for being wrong.  So I decided to stop being lazy and read a bit about it.  It still didn’t answer most of my questions.

I decided to call my dad and see what he had to say about it.  He worked on an oil rig 20 years ago, and is an environmental/safety engineer for a refinery (not BP.)  He’s the person responsible for supervising cleanup when one of their pipelines leaks or a truck spills.  I figured between his roughnecking experience and training in cleaning up oil spills he could give me a better idea of what happened.  I didn’t really ask him if I could post this, but there’s nothing particularly dangerous.  Nothing he said is meant to represent his company or anyone else in the oil industry.

He’s better at being a scientist than I am: many of his answers were, “I don’t know.”  That’s fair enough; it’s a different company with different policies and he hasn’t been on a rig for a long time so there’s plenty of uncertainty.  It’s also hard to interpret everything because all we get is what the news reports: context can be lost and words can be misquoted.  But there were a few interesting points he made.

He said what he has read about the events leading up to the explosion don’t make sense.  A blowout (oil/gas under pressure pushes the drilling rig back out) is the most likely cause.  He also said that even 20 years ago it wasn’t difficult to see a blowout coming.  He mentioned that there were plenty of pressure gauges to watch and if you hit a gas pocket and you knew something bad was coming you could start the failsafes (he used some jargon for these failsafes but I don’t remember it exactly; I’m using the laymen terms he explained.)  The first failsafe clamps the rig shut to try and prevent the pressure bubble from reaching the surface.  If that doesn’t work, the next failsafe cuts the drilling bit and lets it fall (I’m not sure how that helps but didn’t ask.)  The last resort is to cap the rig; this renders it unusable but is preferable to a blowout.  He seemed certain that that if these measures were taken, the explosion could not have happened.  Applying Occam’s razor we agreed that either someone didn’t notice the pressure at all, they didn’t notice it soon enough, or an equipment failure rendered the failsafe measures inoperable.  He felt that since at least 11 men were near the rig when it exploded they must not have known it was happening.  He also mentioned that some of what BP has said doesn’t make sense, in particular they’ve apparently claimed that there were “troubles” applying one of the failsafes in the past but he couldn’t interpret what that meant.  I got the feeling this meant if they’d applied the failsafes in the past the rig should have been deemed unsafe or the equipment replaced.  This sounded like something that likely got mistranslated between BP and the press; the representative probably used jargon and the reporter may have misunderstood.

I asked him why the cleanup seemed so ineffective.  The primary weapon used in an oil spill is a boom; this is like a tarp with a float at the top and weights at the bottom.  This forms a barrier at the surface of the water and since oil floats the boom can contain the oil.  Once the slick is contained, a variety of methods are used to get the oil off the surface of the water or break it down.  Unfortunately, booms are not effective in the open seas.  The typical boom is about 10 inches tall the last time I saw one; when the waves can be 3-8 feet the seas will just throw the water over the boom.  He also pointed out it’s very likely that if every US oil company combined their powers, there’s not enough boom or ships to contain a slick this large. He seemed to believe the coast guard should have burned the slick sooner.  He did point out that he’s more used to cleaning up spills on land or in creeks and rivers and an ocean spill is a completely different beast.  He qualified most of his opinions with caution, pointing out that he doesn’t know everything since he’s not working for them and all he gets is what the news says.   However, he also feels like the size of the slick combined with the fact that BP hasn’t been able to shut off the rig indicates it may not have mattered.  BP’s fiddling with something at the drill site beneath where the rig was erected to attempt to stop the flow of oil, but it isn’t working.  Dad worried this indicates the leak is beneath the drill site and if this is the case there’s not much that can be done.   That’s troubling.

The news was quick to cover the Morgan City rig tipping over and framing it as equal to the one that sank.  He said this is hyperbole; the Morgan City rig was being towed to a new location and thus no oil was spilled.  It was carrying diesel fuel but in the end it’s probably about as disastrous as if someone sank their yacht, particularly when you consider the magnitude of what’s happening nearby.

In the end, it sounds like it’s going to be another case study in engineering ethics books.  Dad feels like BP’s going to blame at least some of the dead for making a mistake that triggered the event, but it’s more likely it was one of those rare combinations of several failures that leads to a disaster.  It happens.  Even when there’s a one in ten million chance of failure, that one failure will eventually happen.  I’ve read articles that state it well: the news doesn’t report when a worker flips the wrong switch at the power plant and three failsafes were defective but the fourth prevented disaster.  It’s when that fourth failsafe happens to fail that we see the news.  Everything can fail.

Cleanup’s going to be bad.  The morbid jokes at the office are that if you enjoy Destin and the Gulf Coast, you’d better get down there before the slick gets too thick.  It’s true.  Cleanup takes a long time.

Is it wrong for us to drill so close inland?  Why wasn’t BP prepared for a spill of this magnitude?  Why didn’t we have a plan for a disaster of this scale?  These points are too complicated for me to rush through.  I’m going to think more about them and post about them separately.