There are more wackos out there than we think

Backdrop: Gabrielle Giffords was shot today in Tucson.

So I walk into this taco shop this afternoon to get a burrito.  At the ordering counter is a white guy, maybe late 50s, white-haired in a Harvard sweatshirt and horn-rimmed glasses.  Seems mild-mannered enough. He’s talking in crap Spanish to the staff, and I recognize that he’s trying to talk about the Giffords shooting.  I say, “I know what you’re talking about, the shooting in Tucson.”  Eventually he switches to English and says, nineteen people got shot at this rally.  The congresswoman was shot point-blank in the head, he says, and she survived.

I’m surprised: I’d heard that Giffords had died.  “She’s alive?” I ask.

He shrugs his shoulders.  “We all knew she was empty-headed!” he replies.  Presumably he was trying to tell this joke to the restaurant staff in his crap Spanish before I got involved.

Needless to say, I did not react well to this, told him that this was the Congressional representative my mother had voted for, and asked him to get the hell out of the restaurant.  His responses were telling: “Don’t you have a sense of humor?”  and “By the end of the year the writing’s going to be in the streets, and hundreds or thousands of people are going to be dead”, because the government is screwing us over and people aren’t going to take it anymore.

I told him that “you’re what’s wrong with this country,” which I now recognize is a pretty crummy comeback, because the immediate response was “no, you’re what’s wrong with this country; you’re a lamb being led blindly by the government.”

The conversation continued in ways that aren’t really worth describing in further detail; but crucially, at no point did this man express any condolence or disapproval of the Tucson gunman’s action.  I’m still parsing the details of the incident in my mind, but one basic take-home message strikes me above all else.  If here in California I can run into someone who essentially approves the ruthless slaughter of an elected official and numerous other bystanders on the grounds that he disagrees with the official’s political stances within a few hours of the event, then there are far more wackos out there than anyone thinks, and this country is in serious danger.

Avoid forgetting to send attachments in Mail.app

It can’t read your mind, but attachment Scanner Plugin for Mail.app is available here and will catch you some of the time 🙂 http://eaganj.free.fr/code/mail-plugin/

Mmm, middle click for trackpad under OS X

Incredibly useful for Firefox and X11: http://clement.beffa.org/labs/projects/middleclick/

Public support for tax cuts, and David Brooks’ social science naivete

David Brooks has just written approvingly of Obama’s capitulation to Republicans on tax cuts for the wealthy.  He cites the most recent Gallup poll’s estimate that 67% of independents and 52% of Democrats support extending all the tax cuts.  (In this poll, the average support over all political persuasions was 66%.)

But you would think that someone who devotes extensive and laudatory coverage to social science would account for the basic fact that how questions in a poll are worded can have a huge impact on what answers are given.  In this most recent Gallup poll, those surveyed were given only the option to vote yes or no on a law to “extend the federal income tax cuts passed in 2001 and 2003 for all Americans for two years”.

Less than three weeks ago, another Gallup poll gave participants three options: to keep tax cuts for all Americans (chosen by 40%), to keep tax cuts but set new limits for the wealthy (44%), or to let tax cuts expire for all (13%).  So according to this poll, a 57% majority of the public wants to let tax cuts for the wealthy expire.  And I’ll give you ten-to-one odds that the results of a three-option poll today would look more like November’s three-option poll than like December’s two-option poll.

And while he’s busy oversimplifying public opinion polls, why doesn’t Brooks mention that over two-thirds of the population supports repeal of “Don’t ask, don’t tell”?

Why do millionaires need another $139K?

http://news.firedoglake.com/2010/12/09/tax-cut-deal-gives-139000-to-every-millionaire-in-america/ — and this chart says it all:

How WebCT software sucks

This is a persistent blog entry that I’ll keep editing to collect examples of how terrible WebCT software is.  It also serves as a memory for myself (and perhaps an FAQ for other hapless faculty) as to how to work around WebCT’s innumerable gotchas.  Though it is useful for a few things — such as automatically communicating grades to students with proper privacy settings on a secure (hopefully!) website, the list of bad things about WebCT is so large that it stuns me universities pay money for this product.

  • As a teacher, you can “hide” a column in a grade sheet.  This does not mean hide the column from the student’s view (the totally independent “Release to Student” setting is for that) — it means hide it from yourself!  Although there may be some good reason to do this, there is no excuse for the fact that it is hard to figure out how to unhide a column!  It turns out that unhiding a column cannot be done from the Column Settings page (where it would intuitively belong), but rather only from the Reorder Columns page.  Changing the “Release to Student” setting, on the other hand, can be done only from the Column Settings page, and not from the Reorder Columns page.  Go figure.
  • WebCT is extraordinarily inconsistent as to what is required to save a change.  To take the previous example: on the Column Settings page, you change the Release to Student setting for a grade-sheet column by clicking on the current value of the setting; this switches the setting (Yes changes to No, No changes to Yes), reloads the page, displays the new setting, and the new setting is thereby saved.  On the Reorder Columns page, in contrast, a currently hidden column will have a Show Column button that you can click, and vice versa for a currently unhidden column.  As with the Column Settings page, clicking on this button will change the setting and reload the page with the new setting.  But you have to click on an unobtrusive Save button at the bottom of the page to save this change! Either behavior would be fine, but please make the behavior consistent!

cacheSweave heads-up

I love Sweave for writing LaTeX documents with embedded R code, and R’s cacheSweave package helps tremendously in avoiding repetition of time-consuming computations.  (Thank you, Roger Peng, for writing cacheSweave!)  One catch that is evident from a careful perusal of the cacheSweave vignette but which I keep forgetting is that cacheSweave will not cache R code chunks with side effects! Side effects include (but are not limited to):

  • print() and related display-to-screen commands
  • plot() and other graphical-output commands

This failure to cache is silent, so it can be confusing; I keep on forgetting about it.  So this post is as much as anything else a note to myself to remember.  The simple solution is to separate out the long-computation chunks from the side-effect chunks and cache only the former (see the vignette for details).

R sub() backslash gotcha

One of the things I do to my Sweave output is to make scientific notation more transparent.  I have a special R function for this which I use in my Sweave documents:

myFormat <- function(...) {
tmp <- format(...)
return(sub("e(.*)","\\\\\\\\times 10^{\\1}",tmp))
}

Note in particular the ridiculous number of backslashes required in the call to sub() to obtain a single backslash in the string output.  I have no idea why so many backslashes are needed—but apparently they are.  Hopefully this will save someone else the headache of figuring out the magic number by trial and error!

A better way to get APA citation style in LaTeX

Earlier I posted on combining natbib and apacite to approximate APA citation style. Well, I became aware that this approach doesn’t handle the rule that in-text citations should be “AuthorA and AuthorB (year)” whereas parenthetical citations “(AuthorA & AuthorB, year)”. I can’t figure out how to get this to work while using natbib.

So I’ve concluded that just using apacite is probably better. The disadvantage is that its citation commands aren’t robust. But the makerobust package helps with that. Here is what the relevant part of my preamble currently looks like:


\usepackage{apacite}
\usepackage{makerobust}
\DeclareRobustCommand{\citep}[2][]{\cite[#1]{#2}}
\DeclareRobustCommand{\citealp}[2][]{\citeNP[#1]{#2}}
\DeclareRobustCommand{\citet}[2][]{\citeA[#1]{#2}}
\MakeRobustCommand{\citeauthor}
\MakeRobustCommand{\citeauthor}

and I don’t need to change any of the in-document citation commands from the natbib names I’m used to.

Getting the longnamesfirst option to work with natbib in LaTeX

I publish in a number of journals that use the rules of APA style.  I prefer to write my papers in LaTeX, and to use BibTeX together natbib to manage citations and bibliographic references.  One of the rules of APA style says that the first citation of a bibliographic reference must be the “long” citation (all authors listed, up to five).  Natbib has a longnamesfirst option that is supposed to do this automatically, but two of the most popular natbib style files — apalike and newapa — silently fail to use the option.

The solution is to use the apacite style file. It works. That is, you should have the following line in your preamble:

\usepackage[longnamesfirst]{natbib}

and the following line before you use the \bibliography command:

\bibliographystyle{apacite}