Thursday, May 31, 2007

Globally Warmed Over

I am not a global warming denialist. I need to state this up front because I usually get mistaken for one when I point out that no political mechanism exists to mitigate AGWs effects. I also think that there are enough uncertainties in the degree and effects of warming, and enough uncertainty about what might actually help, that I am dubious about most prescriptions for actions.

Specifically, the imposition of any measure that is going to cause serious economic pain (which I suspect will be necessary if one is to stave off AGW's effects) gives an automatic opening to a rival party to make hay by offering to repeal it.

It should be clear that we are talking about taking actions now that will not yield all of their fruit for generations. Even if we could get people to acknowledge the usefulness of (for instance) a high gasoline tax, how would it 'stick'?

Climate is big, it has a lot of hysteresis, and will do confounding things, like unexpectedly going counter to the underlying trends for years. If you think evolution is a hard sell, just wait til AGW mitigation actually means that someone might not get to drive their SUV to the "Inconvenient Truth" screening.

We generally won't save money for retirement, as a culture, and we know that old age looms for all of us. We sometimes say we want to protect the children, but there is usually a fight about any taxation for schools. Who wants to pay 5 bucks a gallon for gasoline to keep our great great grandchildren comfortable? (I am being frivolous on purpose. I understand the gravity of the problem. I just don't see what to do about it.)

Note that this is not an argument for doing nothing. It is a cold, scary suspicion that this kind of problem may be outside the purview of politics as it is practiced. The world might hand the keys to a science-based policy that would cause deprivation and economic pain for a couple of years if something obvious and immanent were coming, like an asteroid.

My other dark suspicion is that AGW is, for most people (acknowledging that most people lack the skillz to calculate their own BMI, let alone evaluate climate models) a proxy left/right fight, where, since the US is doing approximately nothing about it, one can choose sides at nearly zero cost, lazily picking whatever their political affiliations suggest. Put less unkindly, few actually evaluate evidence because there is currently no penalty involved just going along with their 'side'. And people haven't gotten completely sick of the climate pr0n on the weather channel, yet.

My prediction- climate change denialism will become more fashionable the more is done to confront climate change. People are great rationalizers. When the money comes from their pocket, the data will suddenly be less clear. I suspect that the underlying science has the most acceptance and support it will ever get at this point now, before anything gets done. Once someone pays, sides will shift.

Yes, as a matter of fact, I am bitter, cynical, and slightly misanthropic.

Tuesday, May 29, 2007

Who's programming who?

I write a lot of software to collect and process data. The reasons and data itself is pretty much top secret, but some of the details about how I do it might be interesting, especially to the science types that wander by.

I am not a general-purpose programmer by any means, and I would hang myself if I were responsible for anything called "business logic" or database analysis or the kinds of things my 'real' programmer friends do for a living. I have one buddy who has done some interesting programming for the military and for phone network switching, which sounds kind of fun.

Some stuff I do falls into the area of embedded programming. Imagine your VCR, or your car, or your favorite piece of laboratory instrumentation. It's common knowledge that these contain microprocessors or microcontrollers, and often more than one per device. Embedded programming is the programming done to make this hardware work. Usually, I do this in C these days, but years ago, I did it in assembly language (thinking about this too much gives me the shakes...). There are usually no graphics involved, except maybe an lcd screen, though this has begun to change. Everything is done from memory, there is no operating system (again, this has begun to change as Linux is ported to microcontrollers). In most cases, I have done this to automate some data collection in an instrument that had to be custom built for some reason. Generally, if I can figure out how to do a project with commercial instruments, I'll do it that way, because the time involved in writing any software, but especially embedded software, is amazingly long.

At the extreme opposite of this is programming in LabVIEW. LabVIEW is a graphical programming language designed to allow one to string together instruments, controlling them and gathering data from them by essentially creating diagrams of their interconnections. It is much faster, in most cases, than procedural programming, but it isn't hard to do it really poorly. There really isn't any tool to protect you from the need to think clearly and logically. LabVIEW contains all sorts of mathematical and graphics functions, too, so it's not too difficult, supposing you really think through the logical tasks, to make spiffy, extremely useful software.

I have a handful of tasks where I have used LabVIEW to control a box that contains a microcontroller that I programmed in C to do some task. This combo is really powerful, because you get the fine-grained control of exactly what your hardware does using the embedded computer, but then the data you gather can be displayed and reported in a beautiful, professional fashion.

My latest foray into programming is Java. For years, I have been avoiding it. It always seemed slow and incredibly obtuse. But over the years, apparently, it has begun to get better and better, and best of all, there are lots of really fantastic tutorial and reference materials available on the web. The Java compiler and a good development system (I like Eclipse) are available for free, and there is a really good free pdf textbook suitable for people who know nothing about programming that covers the most recent incarnation of Java.

There's a lot of hype for Java, and a lot of negative bashing on the net about performance. There is a performance penalty in terms of speed for using Java, maybe 20%, in my experience. There are debunkings and counter-debunkings out there, and my advice is to ignore them- some of the worst knocks on Java were true a few years ago, but the language has continued to improve. Java lets a novice programmer do a lot of very cool things, and there is tons of support available on the Web. Ignore the programmer religious wars about which language is better.

Doing things that take a lot of time in other procedural languages are pretty easy in Java (even though there are C/C++/C# compilers available for free, the learning curve for programming in a GUI environment is pretty steep for these. I have found it much less so for Java).

For me the bottom line is this: I can do neat stuff with Java more quickly and with less fuss than with C++ and the other popular languages that I know about. I have been able to teach myself how to make some cool software in a relatively short period of time, and I can run this software on my Mac and my PCs. Is Java the greatest programming language on Earth? Don't know, don't care. Still, searching for info on Java has led me to some interesting name-calling and fighting about whether Java or C++ or C# is the best or sucks the most butt.

There are some weird things I dislike about Java, and I think I'll continue with this in another post. For the price, you can't beat it.

My very favorite thing is that the Eclipse development environment and Java work the same on my Mac and PCs. I have a PC at work, and a mixed-marriage of all sorts of computers at home, but my primary platform at home is the Mac. OS X runs Java stuff very well. Being able to pick up at home where I left off at work without kicking my kid off the PC is nice.

Monday, May 14, 2007


Except for those of us who got hooked early, I think science is a tough sell. There's little money, and the job market is flat (despite years of hearing about shortages of scientists), and there's almost no way the hours one puts in will pay off financially. That's the bad economic news.

Science is hard work, plenty of it boring, in relative obscurity, with a fair amount of isolation. So there is a social downside.

And if you are looking to 'change the world', being an activist or lawyer is going to look like a more direct route. Science is knowledge production, and one has damned little control about how or if it is used. So the impact of a single scientist is going to be limited.

Scientific superstars have a supporting cast that does the work and get none of the glory. So science has a sort of serfdom feel to it. (Worse, there is some sort of quasi-monastic bullshit that surrounds science, that makes people act like the serfs ought to be grateful for their squalor.)

And yet...

It's awesome, captivating, enchanting and mesmerizing. I still can't believe that I am paid to do this, even if paid poorly relative to others who have put in similar time in academia. It was worth the years in school, and the postdoc, and the realization that, in my general field, I could have gotten a BS in chemical engineering and gotten both more money and more respect. But I wouldn't have the ability and freedom to really find things out. In my opinion, there is nothing better.